@treasuredata/tdx 0.16.12 → 0.16.13
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/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.js +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.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/passthrough-server.js +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.js +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
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a3_0x2b73dc=a3_0x1b60;(function(_0x5b7adb,_0xfcbc82){const _0x15a713=a3_0x1b60,_0x4f5740=_0x5b7adb();while(!![]){try{const _0x5a3d70=parseInt(_0x15a713(0x1e6))/0x1*(parseInt(_0x15a713(0x1e1))/0x2)+parseInt(_0x15a713(0x1d5))/0x3+-parseInt(_0x15a713(0x1f5))/0x4+parseInt(_0x15a713(0x1ef))/0x5+parseInt(_0x15a713(0x1d4))/0x6+-parseInt(_0x15a713(0x1dc))/0x7*(parseInt(_0x15a713(0x1de))/0x8)+parseInt(_0x15a713(0x1f8))/0x9;if(_0x5a3d70===_0xfcbc82)break;else _0x4f5740['push'](_0x4f5740['shift']());}catch(_0x22d8c2){_0x4f5740['push'](_0x4f5740['shift']());}}}(a3_0x1d88,0x2c4e3));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a3_0x1b60(_0x38011d,_0x10405b){_0x38011d=_0x38011d-0x1d4;const _0x1d8841=a3_0x1d88();let _0x1b609c=_0x1d8841[_0x38011d];return _0x1b609c;}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a3_0x1d88(){const _0x423332=['613440BZPsZs','description','data','site','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','resolveSegmentId','1214848cSWOfl','execute','Resolved\x20parent\x20ID:\x20','1367154nnZZAW','cause','882582EyHJmn','220032XCNRBc','Site:\x20','Error:\x20Segment\x20name\x20is\x20required','Parent\x20name:\x20','listActivations','verbose','\x20\x20Cause:\x20','7CfXjiJ','length','1991192itILWp','Error:\x20','error','554GwmqUK','Resolving\x20parent\x20segment\x20\x27','Resolving\x20child\x20segment\x20\x27','\x20activation','name','863UXcEKu','segment','message','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','Listing\x20activations\x20for\x20segment\x20\x27','\x27...','✔\x20Found\x20','List\x20activations\x20for\x20a\x20segment','activations'];a3_0x1d88=function(){return _0x423332;};return a3_0x1d88();}import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x2b73dc(0x1e5)]=a3_0x2b73dc(0x1ee);[a3_0x2b73dc(0x1f0)]=a3_0x2b73dc(0x1ed);async[a3_0x2b73dc(0x1f6)](_0x2c0ac9){const _0x471701=a3_0x2b73dc,{options:_0x1438cc,args:_0x9f1874,tdx:_0x29f55c}=_0x2c0ac9;if(_0x9f1874['length']===0x0)return console[_0x471701(0x1e0)](_0x471701(0x1d7)),console['error'](_0x471701(0x1f3)),0x1;try{const {parentId:_0x437cb9,childId:_0x103c13}=parseSegmentRef(_0x9f1874[0x0]);if(!_0x103c13)return console['error'](_0x471701(0x1e9)),console[_0x471701(0x1e0)](_0x471701(0x1f3)),0x1;_0x1438cc['verbose']&&(console['error'](_0x471701(0x1d6)+_0x1438cc[_0x471701(0x1f2)]),console['error'](_0x471701(0x1d8)+_0x437cb9),console[_0x471701(0x1e0)]('Child\x20name:\x20'+_0x103c13));const _0x297e87=await withSpinner(_0x471701(0x1e2)+_0x437cb9+_0x471701(0x1eb),()=>_0x29f55c[_0x471701(0x1e7)]['resolveParentId'](_0x437cb9),{'verbose':_0x1438cc[_0x471701(0x1da)]}),_0x3b4116=_0x297e87[_0x471701(0x1f1)];_0x1438cc[_0x471701(0x1da)]&&console[_0x471701(0x1e0)](_0x471701(0x1f7)+_0x3b4116);const _0x99f4a5=await withSpinner(_0x471701(0x1e3)+_0x103c13+_0x471701(0x1eb),()=>_0x29f55c['segment'][_0x471701(0x1f4)](_0x3b4116,_0x103c13),{'verbose':_0x1438cc['verbose']}),_0x82785f=_0x99f4a5[_0x471701(0x1f1)];_0x1438cc['verbose']&&console[_0x471701(0x1e0)]('Resolved\x20child\x20ID:\x20'+_0x82785f);const _0x54262f=await withSpinner(_0x471701(0x1ea)+_0x103c13+_0x471701(0x1eb),()=>_0x29f55c[_0x471701(0x1e7)][_0x471701(0x1d9)](_0x3b4116,_0x82785f),{'verbose':_0x1438cc[_0x471701(0x1da)]}),_0x124a91=_0x54262f['data'];return console['error'](_0x471701(0x1ec)+_0x124a91[_0x471701(0x1dd)]+_0x471701(0x1e4)+(_0x124a91[_0x471701(0x1dd)]!==0x1?'s':'')),await handleSDKOutput(_0x124a91,_0x1438cc),0x0;}catch(_0x37e47a){if(_0x37e47a instanceof SDKError)return console[_0x471701(0x1e0)](_0x471701(0x1df)+_0x37e47a[_0x471701(0x1e8)]),_0x37e47a[_0x471701(0x1f9)]&&console['error'](_0x471701(0x1db)+_0x37e47a[_0x471701(0x1f9)]),0x1;throw _0x37e47a;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x28f8a6=a4_0x1d39;(function(_0x11e090,_0x4d3b2c){const _0x32eda7=a4_0x1d39,_0x5aaa39=_0x11e090();while(!![]){try{const _0x295ba7=-parseInt(_0x32eda7(0xe9))/0x1+-parseInt(_0x32eda7(0x93))/0x2*(parseInt(_0x32eda7(0xd2))/0x3)+parseInt(_0x32eda7(0xdc))/0x4+parseInt(_0x32eda7(0x109))/0x5*(-parseInt(_0x32eda7(0x6d))/0x6)+parseInt(_0x32eda7(0xf2))/0x7*(parseInt(_0x32eda7(0xa5))/0x8)+-parseInt(_0x32eda7(0xd0))/0x9*(parseInt(_0x32eda7(0xf7))/0xa)+parseInt(_0x32eda7(0x6b))/0xb*(parseInt(_0x32eda7(0xea))/0xc);if(_0x295ba7===_0x4d3b2c)break;else _0x5aaa39['push'](_0x5aaa39['shift']());}catch(_0x5eb915){_0x5aaa39['push'](_0x5aaa39['shift']());}}}(a4_0x3d08,0xdc987));import a4_0x2b4f70 from'chalk';import a4_0x4bfc8a 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';function a4_0x3d08(){const _0x17a096=['\x22:\x20','\x20\x20Prompt\x20\x22','Writing\x20files...','\x20unchanged','\x22\x20to\x20a\x20different\x20profile','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','957590QklnBY','48yqvWLW','parse','\x0aPull\x20summary\x20for\x20\x27','yes','sourceProjectName','\x20\x20Agents:\x20','Using\x20project\x20from\x20','\x20errors','147CzIKEN','output','\x20\x20Agent\x20\x22','agentName','\x20\x20Knowledge\x20Bases:\x20','10bCgwVz','\x20updated','tdx.json','diff','Cannot\x20clone\x20from\x20context\x20project\x20\x22','llm_project','total','✔\x20Context\x20set:\x20','execute','green','Would\x20push\x20agent:\x20','\x0aErrors\x20found:','\x20--name\x20','\x0a✔\x20Pulled\x20','\x20\x20Source:\x20','projectDir','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','textKnowledgeBases','1905agBvzE','cloneProject','outputDir','cyan','\x20|\x20','\x20\x20Integration\x20\x22','\x20files\x20to\x20','\x20=\x20','name','<new-name>','9136413jgcdkq','Would\x20clone:','3054vNTiAL','Summary:','\x22...','red','session','\x0aPush\x20summary\x20for\x20\x27','agent:push','description','Clone\x20cancelled','no_local_folder','\x0aProject\x20pushed\x20with\x20errors','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','new','repeat','projectId','updated','Source:\x20','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','utf-8','dim','agent:pull','error','action','found','Push\x20cancelled','gray','\x22\x20to\x20new\x20project\x20\x22','llmProject','llm','\x20\x20Prompts:\x20','pushAgent','\x20total','Pull\x20cancelled','Pushing\x20to\x20project...','\x27\x20to\x20create\x20the\x20folder\x20structure.','newProjectName','Project\x20cloned\x20with\x20errors','2wDrZdn','counts','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','log','Output\x20path:\x20','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','Output:\x20','\x0aChanges\x20to\x20integration\x20\x27','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)','reason','errors','agentId','newProjectId','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','\x20changed','Using\x20local\x20project:\x20','Clone\x20\x22','\x22\x20to\x20\x22','101576ksGhUb','INVALID_ARGUMENT','\x0a✔\x20Pushed\x20','Errors:','\x0aWrite\x20','pullProject','Agent:\x20','Agent\x20','dirname','join','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','Project:\x20','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\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','Using\x20context\x20project:\x20','outputPath','dryRun','no_context','agent:clone','Pushing\x20agent\x20from\x20\x22','knowledgeBases','Cloning\x20\x22','pullAgent','cwd','site','\x20\x20Text\x20Knowledge\x20Bases:\x20','profile','Using\x20project:\x20','Chat:\x20','projectName','unchanged','\x0aChanges\x20to\x20prompt\x20\x27','No\x20tdx.json\x20found\x20in\x20','\x20\x20Text\x20Knowledge\x20Base\x20\x22','prompts','\x0aChanges:','created','yellow','\x20\x20Integrations:\x20','\x22\x20from\x20project\x20\x22','agents','\x0aPush\x20','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','12688029YCuoqf','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','1118766oaCmIi','Dry\x20run\x20-\x20no\x20changes\x20made','\x20\x20tdx\x20agent\x20clone\x20agents/','message','Status:\x20','integrations','New\x20project\x20name\x20is\x20required','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','push','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','995248IfYApE','\x20new','\x20--profile\x20','New\x20project:\x20','pushProject','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','Failed\x20to\x20push\x20agent:\x20'];a4_0x3d08=function(){return _0x17a096;};return a4_0x3d08();}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(_0xba2063){const _0x2834f2=a4_0x1d39,_0x1f54ac=[];if(_0xba2063['total']!==undefined)_0x1f54ac[_0x2834f2(0xda)](_0xba2063[_0x2834f2(0xfd)]+_0x2834f2(0x8d));if(_0xba2063[_0x2834f2(0x7a)]!==undefined&&_0xba2063['new']>0x0)_0x1f54ac[_0x2834f2(0xda)](a4_0x2b4f70['green'](_0xba2063[_0x2834f2(0x7a)]+_0x2834f2(0xdd)));if(_0xba2063['created']!==undefined&&_0xba2063[_0x2834f2(0xc9)]>0x0)_0x1f54ac['push'](a4_0x2b4f70[_0x2834f2(0x100)](_0xba2063['created']+'\x20created'));if(_0xba2063[_0x2834f2(0x7d)]!==undefined&&_0xba2063[_0x2834f2(0x7d)]>0x0)_0x1f54ac[_0x2834f2(0xda)](a4_0x2b4f70['yellow'](_0xba2063['updated']+_0x2834f2(0xf8)));if(_0xba2063[_0x2834f2(0xc3)]!==undefined&&_0xba2063[_0x2834f2(0xc3)]>0x0)_0x1f54ac['push'](a4_0x2b4f70[_0x2834f2(0x87)](_0xba2063[_0x2834f2(0xc3)]+_0x2834f2(0xe6)));if(_0xba2063[_0x2834f2(0x9d)]!==undefined&&_0xba2063[_0x2834f2(0x9d)]>0x0)_0x1f54ac[_0x2834f2(0xda)](a4_0x2b4f70['red'](_0xba2063[_0x2834f2(0x9d)]+_0x2834f2(0xf1)));return _0x1f54ac[_0x2834f2(0xae)](',\x20');}function displayDiffs(_0x46716b,_0xbbada4,_0x48a5b5,_0x184991,_0x1ad9cc=[]){const _0x5d8e92=a4_0x1d39;for(const _0x93a8e4 of _0x46716b){if(_0x93a8e4[_0x5d8e92(0xfa)]){const _0x382212=_0x93a8e4['agentName']||_0x93a8e4['name'];console[_0x5d8e92(0x96)]('\x0aChanges\x20to\x20agent\x20\x27'+_0x382212+'\x27:'),console[_0x5d8e92(0x96)]('─'[_0x5d8e92(0x7b)](0x3c)),console['log'](_0x93a8e4[_0x5d8e92(0xfa)]),console['log']('─'['repeat'](0x3c));}}for(const _0x3899a7 of _0xbbada4){_0x3899a7[_0x5d8e92(0xfa)]&&(console[_0x5d8e92(0x96)]('\x0aChanges\x20to\x20knowledge\x20base\x20\x27'+_0x3899a7[_0x5d8e92(0x111)]+'\x27:'),console[_0x5d8e92(0x96)]('─'['repeat'](0x3c)),console[_0x5d8e92(0x96)](_0x3899a7[_0x5d8e92(0xfa)]),console[_0x5d8e92(0x96)]('─'['repeat'](0x3c)));}for(const _0xed354b of _0x48a5b5){_0xed354b[_0x5d8e92(0xfa)]&&(console['log'](_0x5d8e92(0xdb)+_0xed354b[_0x5d8e92(0x111)]+'\x27:'),console[_0x5d8e92(0x96)]('─'[_0x5d8e92(0x7b)](0x3c)),console[_0x5d8e92(0x96)](_0xed354b[_0x5d8e92(0xfa)]),console[_0x5d8e92(0x96)]('─'[_0x5d8e92(0x7b)](0x3c)));}for(const _0x1ca660 of _0x184991){_0x1ca660[_0x5d8e92(0xfa)]&&(console[_0x5d8e92(0x96)](_0x5d8e92(0xc4)+_0x1ca660[_0x5d8e92(0x111)]+'\x27:'),console[_0x5d8e92(0x96)]('─'['repeat'](0x3c)),console[_0x5d8e92(0x96)](_0x1ca660['diff']),console[_0x5d8e92(0x96)]('─'[_0x5d8e92(0x7b)](0x3c)));}for(const _0x2a824e of _0x1ad9cc){_0x2a824e[_0x5d8e92(0xfa)]&&(console[_0x5d8e92(0x96)](_0x5d8e92(0x9a)+_0x2a824e[_0x5d8e92(0x111)]+'\x27:'),console[_0x5d8e92(0x96)]('─'[_0x5d8e92(0x7b)](0x3c)),console['log'](_0x2a824e['diff']),console[_0x5d8e92(0x96)]('─'[_0x5d8e92(0x7b)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']=a4_0x28f8a6(0x82);['description']=a4_0x28f8a6(0x7f);async[a4_0x28f8a6(0xff)](_0x472079){const _0x92fcf=a4_0x28f8a6,{options:_0x1b5675,args:_0x5c59ae,tdx:_0x1e8b41}=_0x472079,_0x2e37b9=_0x5c59ae[0x0],_0x7b96db=_0x5c59ae[0x1],_0x2955d8=_0x1b5675[_0x92fcf(0xf3)],_0x3b71a0=_0x1b5675['dryRun'],_0x4c7a50=_0x1b5675['force'],_0x3749ef=_0x1b5675[_0x92fcf(0xed)],_0x114115=_0x1b5675['llmProject'];let _0x59075b,_0x34819e;const _0xb398fe=findAgentConfigPath(process[_0x92fcf(0xbc)]());if(_0x2e37b9){const _0xa4257c=a4_0x4bfc8a['join'](_0x2e37b9,_0x92fcf(0xf9));if(existsSync(_0xa4257c))try{const _0x3cdf41=JSON[_0x92fcf(0xeb)](readFileSync(_0xa4257c,_0x92fcf(0x80)));_0x59075b=_0x3cdf41[_0x92fcf(0xfc)],_0x34819e=_0x2e37b9,console[_0x92fcf(0x96)](a4_0x2b4f70[_0x92fcf(0x81)](_0x92fcf(0xf0)+_0xa4257c+':\x20'+_0x59075b));}catch{_0x59075b=_0x2e37b9;}else _0x59075b=_0x2e37b9;}else{if(_0xb398fe)try{const _0x585732=JSON[_0x92fcf(0xeb)](readFileSync(_0xb398fe,'utf-8'));_0x59075b=_0x585732[_0x92fcf(0xfc)],_0x34819e=a4_0x4bfc8a[_0x92fcf(0xad)](_0xb398fe),console[_0x92fcf(0x96)](a4_0x2b4f70[_0x92fcf(0x81)](_0x92fcf(0xc0)+_0x59075b));}catch{_0x59075b=_0x114115;}else _0x59075b=_0x114115;}if(!_0x59075b)return console['log'](a4_0x2b4f70[_0x92fcf(0xca)](_0x92fcf(0x95))),console['log'](_0x92fcf(0x9b)),console[_0x92fcf(0x96)](_0x92fcf(0xb2)),console[_0x92fcf(0x96)]('\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']('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent'),0x1;if(_0x7b96db){const {data:_0x31b779}=await withSpinner('Pulling\x20agent\x20\x22'+_0x7b96db+_0x92fcf(0xcc)+_0x59075b+_0x92fcf(0x6f),()=>_0x1e8b41['llm'][_0x92fcf(0xbb)](_0x59075b,_0x7b96db,_0x2955d8,{'dryRun':_0x3b71a0,'force':_0x4c7a50}));if(_0x3b71a0)return console[_0x92fcf(0x96)](a4_0x2b4f70['yellow']('Dry\x20run\x20-\x20no\x20files\x20written')),console[_0x92fcf(0x96)]('Would\x20pull\x20agent:\x20'+_0x31b779[_0x92fcf(0xf5)]),console[_0x92fcf(0x96)](_0x92fcf(0x97)+_0x31b779[_0x92fcf(0xb4)]),_0x31b779[_0x92fcf(0xfa)]&&(console[_0x92fcf(0x96)](_0x92fcf(0xc8)),console[_0x92fcf(0x96)]('─'[_0x92fcf(0x7b)](0x3c)),console[_0x92fcf(0x96)](_0x31b779['diff']),console[_0x92fcf(0x96)]('─'[_0x92fcf(0x7b)](0x3c))),0x0;return console[_0x92fcf(0x96)](a4_0x2b4f70[_0x92fcf(0x100)]('Agent\x20pulled\x20successfully')),console[_0x92fcf(0x96)](_0x92fcf(0xab)+_0x31b779[_0x92fcf(0xf5)]),console[_0x92fcf(0x96)](_0x92fcf(0x99)+_0x31b779[_0x92fcf(0xb4)]),console[_0x92fcf(0x96)](_0x92fcf(0xd6)+(_0x31b779['isNew']?a4_0x2b4f70[_0x92fcf(0x100)](_0x92fcf(0x7a)):_0x31b779['hasChanges']?a4_0x2b4f70[_0x92fcf(0xca)]('updated'):a4_0x2b4f70[_0x92fcf(0x87)](_0x92fcf(0xc3)))),0x0;}const _0x5e226d=_0x34819e||_0x2955d8,{data:_0x51fb2a}=await withSpinner('Analyzing\x20project\x20\x22'+_0x59075b+_0x92fcf(0x6f),()=>_0x1e8b41[_0x92fcf(0x8a)][_0x92fcf(0xaa)](_0x59075b,_0x5e226d,{'dryRun':!![]})),_0x4b02ce=_0x51fb2a[_0x92fcf(0x94)][_0x92fcf(0xcd)][_0x92fcf(0x7a)]+_0x51fb2a[_0x92fcf(0x94)][_0x92fcf(0xb9)][_0x92fcf(0x7a)]+_0x51fb2a['counts']['textKnowledgeBases']['new']+_0x51fb2a[_0x92fcf(0x94)]['prompts'][_0x92fcf(0x7a)]+_0x51fb2a[_0x92fcf(0x94)][_0x92fcf(0xd7)][_0x92fcf(0x7a)],_0x36cf20=_0x51fb2a[_0x92fcf(0x94)]['agents'][_0x92fcf(0x7d)]+_0x51fb2a['counts'][_0x92fcf(0xb9)][_0x92fcf(0x7d)]+_0x51fb2a[_0x92fcf(0x94)][_0x92fcf(0x108)][_0x92fcf(0x7d)]+_0x51fb2a[_0x92fcf(0x94)][_0x92fcf(0xc7)][_0x92fcf(0x7d)]+_0x51fb2a['counts']['integrations'][_0x92fcf(0x7d)],_0x11ac95=_0x51fb2a['counts'][_0x92fcf(0xcd)][_0x92fcf(0xc3)]+_0x51fb2a[_0x92fcf(0x94)][_0x92fcf(0xb9)][_0x92fcf(0xc3)]+_0x51fb2a[_0x92fcf(0x94)][_0x92fcf(0x108)][_0x92fcf(0xc3)]+_0x51fb2a['counts'][_0x92fcf(0xc7)]['unchanged']+_0x51fb2a[_0x92fcf(0x94)]['integrations']['unchanged'];console[_0x92fcf(0x96)](_0x92fcf(0xec)+_0x51fb2a[_0x92fcf(0xc2)]+'\x27:'),console['log']('\x20\x20'+a4_0x2b4f70[_0x92fcf(0x100)]('+\x20'+_0x4b02ce+'\x20new')+'\x20|\x20'+a4_0x2b4f70[_0x92fcf(0xca)]('~\x20'+_0x36cf20+_0x92fcf(0xa1))+_0x92fcf(0x10d)+a4_0x2b4f70['dim']('=\x20'+_0x11ac95+'\x20unchanged')),console[_0x92fcf(0x96)](_0x92fcf(0xef)+formatCountSummary(_0x51fb2a[_0x92fcf(0x94)]['agents'])),console['log'](_0x92fcf(0xf6)+formatCountSummary(_0x51fb2a[_0x92fcf(0x94)]['knowledgeBases'])),console[_0x92fcf(0x96)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x51fb2a[_0x92fcf(0x94)]['textKnowledgeBases'])),console[_0x92fcf(0x96)](_0x92fcf(0x8b)+formatCountSummary(_0x51fb2a[_0x92fcf(0x94)][_0x92fcf(0xc7)])),console[_0x92fcf(0x96)](_0x92fcf(0xcb)+formatCountSummary(_0x51fb2a[_0x92fcf(0x94)]['integrations'])),console['log']('\x20\x20Target:\x20'+a4_0x2b4f70[_0x92fcf(0x10c)](_0x51fb2a[_0x92fcf(0x10b)])),displayDiffs(_0x51fb2a[_0x92fcf(0xcd)],_0x51fb2a[_0x92fcf(0xb9)],_0x51fb2a[_0x92fcf(0x108)],_0x51fb2a['prompts'],_0x51fb2a[_0x92fcf(0xd7)]);if(_0x3b71a0)return console[_0x92fcf(0x96)](a4_0x2b4f70[_0x92fcf(0xca)](_0x92fcf(0x79))),0x0;if(_0x4b02ce===0x0&&_0x36cf20===0x0)return console[_0x92fcf(0x96)](a4_0x2b4f70[_0x92fcf(0x100)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x51fb2a[_0x92fcf(0xc2)]},_0x1b5675[_0x92fcf(0x71)]),console[_0x92fcf(0x96)](a4_0x2b4f70[_0x92fcf(0x100)]('✔\x20Context\x20set:\x20'+a4_0x2b4f70['dim']('llm_project')+_0x92fcf(0x110)+a4_0x2b4f70[_0x92fcf(0x10c)](_0x51fb2a[_0x92fcf(0xc2)]))),0x0;if(!_0x3749ef&&!_0x4c7a50){const _0x3ce124=await confirmKey(_0x92fcf(0xa9)+(_0x4b02ce+_0x36cf20)+'\x20files?');if(!_0x3ce124)return console[_0x92fcf(0x96)](_0x92fcf(0x8e)),0x0;}const {data:_0x563d16}=await withSpinner(_0x92fcf(0xe5),()=>_0x1e8b41[_0x92fcf(0x8a)]['pullProject'](_0x59075b,_0x5e226d,{'force':_0x4c7a50}));return console[_0x92fcf(0x96)](a4_0x2b4f70[_0x92fcf(0x100)](_0x92fcf(0x104)+(_0x4b02ce+_0x36cf20)+_0x92fcf(0x10f)+_0x563d16[_0x92fcf(0x10b)])),saveSessionContext({'llm_project':_0x563d16[_0x92fcf(0xc2)]},_0x1b5675[_0x92fcf(0x71)]),console[_0x92fcf(0x96)](a4_0x2b4f70[_0x92fcf(0x100)](_0x92fcf(0xfe)+a4_0x2b4f70[_0x92fcf(0x81)](_0x92fcf(0xfc))+_0x92fcf(0x110)+a4_0x2b4f70[_0x92fcf(0x10c)](_0x563d16[_0x92fcf(0xc2)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x28f8a6(0x111)]=a4_0x28f8a6(0xb7);['description']=a4_0x28f8a6(0xd9);async['execute'](_0x374a21){const _0x1cb686=a4_0x28f8a6,{options:_0x27ce42,args:_0xe317d1,tdx:_0x374f19}=_0x374a21,_0x1eab3c=_0xe317d1[0x0],_0x3742d9=_0x27ce42[_0x1cb686(0x111)],_0x36074a=_0x27ce42[_0x1cb686(0xb5)],_0x268d5f=_0x27ce42[_0x1cb686(0xed)],_0x30cc9e=_0x27ce42[_0x1cb686(0xbd)],_0x419877=_0x27ce42['llmProject'];let _0x2e2ef8;const _0x671f32=findAgentConfigPath(process['cwd']());if(_0x1eab3c){const _0x43569b=a4_0x4bfc8a[_0x1cb686(0xae)](_0x1eab3c,_0x1cb686(0xf9));existsSync(_0x43569b)?(_0x2e2ef8=_0x1eab3c,console['log'](a4_0x2b4f70['dim']('Using\x20local\x20project:\x20'+_0x1eab3c))):_0x2e2ef8=_0x1eab3c;}else{if(_0x671f32)_0x2e2ef8=a4_0x4bfc8a['dirname'](_0x671f32),console['log'](a4_0x2b4f70[_0x1cb686(0x81)]('Using\x20current\x20project:\x20'+_0x2e2ef8));else{if(_0x419877){const _0x28414b=sanitizeForFilesystem(_0x419877);let _0xa2774=_0x28414b,_0x51ba06=a4_0x4bfc8a[_0x1cb686(0xae)](process['cwd'](),_0x1cb686(0xcd),_0x28414b,_0x1cb686(0xf9));if(!existsSync(_0x51ba06)){const _0x7dbbab=normalizeName(_0x419877),_0x158de8=a4_0x4bfc8a[_0x1cb686(0xae)](process[_0x1cb686(0xbc)](),_0x1cb686(0xcd),_0x7dbbab,'tdx.json');existsSync(_0x158de8)&&(_0xa2774=_0x7dbbab,_0x51ba06=_0x158de8);}if(existsSync(_0x51ba06))_0x2e2ef8=a4_0x4bfc8a[_0x1cb686(0xad)](_0x51ba06),console[_0x1cb686(0x96)](a4_0x2b4f70[_0x1cb686(0x81)](_0x1cb686(0xa2)+_0x2e2ef8));else{const _0x3d300c=_0x27ce42[_0x1cb686(0xbf)];if(_0x3d300c)throw new SDKError(ErrorCode[_0x1cb686(0xa6)],_0x1cb686(0xfb)+_0x419877+_0x1cb686(0xe7),undefined,{'helpText':_0x1cb686(0xcf)+_0x1cb686(0xe1)+('\x20\x20tdx\x20agent\x20pull\x20'+_0x419877+'\x0a')+(_0x1cb686(0xd4)+_0xa2774+_0x1cb686(0x103)+(_0x3742d9||_0x1cb686(0x112))+_0x1cb686(0xde)+_0x3d300c)});_0x2e2ef8=_0x419877,console[_0x1cb686(0x96)](a4_0x2b4f70['dim'](_0x1cb686(0xb3)+_0x419877));}}}}if(!_0x2e2ef8)return console[_0x1cb686(0x96)](a4_0x2b4f70[_0x1cb686(0xca)](_0x1cb686(0xaf))),console[_0x1cb686(0x96)]('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console['log'](_0x1cb686(0xe8)),console[_0x1cb686(0x96)]('\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[_0x1cb686(0x96)](_0x1cb686(0x107)),0x1;if(!_0x3742d9)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x1cb686(0xd8),undefined,{'helpText':_0x1cb686(0xb1)});if(!_0x268d5f&&!_0x36074a){const _0x220258=await confirmKey(_0x1cb686(0xa3)+_0x2e2ef8+_0x1cb686(0x88)+_0x3742d9+'\x22?');if(!_0x220258)return console[_0x1cb686(0x96)](_0x1cb686(0x75)),0x0;}const {data:_0x2b74da}=await withSpinner(_0x1cb686(0xba)+_0x2e2ef8+_0x1cb686(0xa4)+_0x3742d9+_0x1cb686(0x6f),()=>_0x374f19[_0x1cb686(0x8a)][_0x1cb686(0x10a)](_0x2e2ef8,_0x3742d9,{'dryRun':_0x36074a}));if(_0x36074a)return console[_0x1cb686(0x96)](a4_0x2b4f70[_0x1cb686(0xca)](_0x1cb686(0xd3))),console['log'](_0x1cb686(0x7e)+_0x2b74da[_0x1cb686(0xee)]),console[_0x1cb686(0x96)](_0x1cb686(0xdf)+_0x3742d9),console[_0x1cb686(0x96)](_0x1cb686(0x6c)),console[_0x1cb686(0x96)](_0x1cb686(0xef)+_0x2b74da[_0x1cb686(0x94)]['agents']['created']),console[_0x1cb686(0x96)]('\x20\x20Knowledge\x20Bases:\x20'+_0x2b74da[_0x1cb686(0x94)][_0x1cb686(0xb9)][_0x1cb686(0xc9)]),console['log'](_0x1cb686(0x8b)+_0x2b74da[_0x1cb686(0x94)][_0x1cb686(0xc7)][_0x1cb686(0xc9)]),0x0;const _0x42306e=_0x2b74da['counts'][_0x1cb686(0xcd)]['errors']>0x0||_0x2b74da[_0x1cb686(0x94)]['knowledgeBases']['errors']>0x0||_0x2b74da[_0x1cb686(0x94)][_0x1cb686(0xc7)][_0x1cb686(0x9d)]>0x0;_0x42306e?console['log'](a4_0x2b4f70['yellow'](_0x1cb686(0x92))):console[_0x1cb686(0x96)](a4_0x2b4f70[_0x1cb686(0x100)]('Project\x20cloned\x20successfully'));console['log']('Source:\x20'+_0x2b74da['sourceProjectName']),console[_0x1cb686(0x96)]('New\x20project:\x20'+_0x2b74da[_0x1cb686(0x91)]),console['log']('New\x20project\x20ID:\x20'+_0x2b74da[_0x1cb686(0x9f)]),console[_0x1cb686(0x96)](),console[_0x1cb686(0x96)](_0x1cb686(0x6e)),console[_0x1cb686(0x96)]('\x20\x20Agents:\x20'+formatCountSummary(_0x2b74da[_0x1cb686(0x94)][_0x1cb686(0xcd)])),console[_0x1cb686(0x96)](_0x1cb686(0xf6)+formatCountSummary(_0x2b74da[_0x1cb686(0x94)][_0x1cb686(0xb9)])),console[_0x1cb686(0x96)](_0x1cb686(0x8b)+formatCountSummary(_0x2b74da[_0x1cb686(0x94)][_0x1cb686(0xc7)])),console['log'](_0x1cb686(0xcb)+formatCountSummary(_0x2b74da[_0x1cb686(0x94)][_0x1cb686(0xd7)]));if(_0x42306e){console[_0x1cb686(0x96)](),console['log'](a4_0x2b4f70[_0x1cb686(0x70)](_0x1cb686(0xa8)));for(const _0x26d562 of _0x2b74da[_0x1cb686(0xcd)]){_0x26d562['action']===_0x1cb686(0x83)&&console['log'](a4_0x2b4f70[_0x1cb686(0x70)](_0x1cb686(0xf4)+_0x26d562[_0x1cb686(0xf5)]+'\x22:\x20'+_0x26d562[_0x1cb686(0x83)]));}for(const _0x20b599 of _0x2b74da['knowledgeBases']){_0x20b599[_0x1cb686(0x84)]===_0x1cb686(0x83)&&console[_0x1cb686(0x96)](a4_0x2b4f70[_0x1cb686(0x70)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x20b599['name']+_0x1cb686(0xe3)+_0x20b599[_0x1cb686(0x83)]));}for(const _0x3180ce of _0x2b74da[_0x1cb686(0xc7)]){_0x3180ce[_0x1cb686(0x84)]===_0x1cb686(0x83)&&console[_0x1cb686(0x96)](a4_0x2b4f70['red'](_0x1cb686(0xe4)+_0x3180ce[_0x1cb686(0x111)]+_0x1cb686(0xe3)+_0x3180ce['error']));}for(const _0x30d43e of _0x2b74da[_0x1cb686(0xd7)]){_0x30d43e['action']===_0x1cb686(0x83)&&console[_0x1cb686(0x96)](a4_0x2b4f70[_0x1cb686(0x70)](_0x1cb686(0x10e)+_0x30d43e[_0x1cb686(0x111)]+_0x1cb686(0xe3)+_0x30d43e[_0x1cb686(0x83)]));}return 0x1;}console[_0x1cb686(0x96)]();const _0x37fd4d=getLLMProjectUrl(_0x30cc9e,_0x2b74da['newProjectId']);return console['log'](_0x1cb686(0xb0)+a4_0x2b4f70['cyan'](_0x37fd4d)),0x0;}}function a4_0x1d39(_0x3580fa,_0x4488ef){_0x3580fa=_0x3580fa-0x6b;const _0x3d0835=a4_0x3d08();let _0x1d3925=_0x3d0835[_0x3580fa];return _0x1d3925;}export class AgentPushCommand extends BaseCommand{[a4_0x28f8a6(0x111)]=a4_0x28f8a6(0x73);[a4_0x28f8a6(0x74)]=a4_0x28f8a6(0x98);async[a4_0x28f8a6(0xff)](_0x1b3328){const _0x4aeafe=a4_0x28f8a6,{options:_0xa46660,args:_0x2b07e2,tdx:_0x3bc62f}=_0x1b3328;let _0x51ab2e=_0x2b07e2[0x0]||process[_0x4aeafe(0xbc)]();const _0x3d7819=_0xa46660[_0x4aeafe(0xb5)],_0x1db254=_0xa46660['force'],_0x382cb6=_0xa46660['yes'],_0xb2764c=_0xa46660[_0x4aeafe(0xbd)],_0x557bf3=a4_0x4bfc8a[_0x4aeafe(0xae)](_0x51ab2e,'agent.yml'),_0x5a5044=existsSync(_0x557bf3);if(_0x5a5044){const {data:_0x352ccc}=await withSpinner(_0x4aeafe(0xb8)+_0x51ab2e+'\x22...',()=>_0x3bc62f['llm'][_0x4aeafe(0x8c)](_0x51ab2e,{'dryRun':_0x3d7819,'force':_0x1db254}));if(_0x3d7819)return console[_0x4aeafe(0x96)](a4_0x2b4f70[_0x4aeafe(0xca)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x4aeafe(0x96)](_0x4aeafe(0x101)+_0x352ccc[_0x4aeafe(0xf5)]),0x0;if(_0x352ccc[_0x4aeafe(0x84)]==='error')return console[_0x4aeafe(0x96)](a4_0x2b4f70[_0x4aeafe(0x70)](_0x4aeafe(0xe2)+_0x352ccc[_0x4aeafe(0x83)])),0x1;console[_0x4aeafe(0x96)](a4_0x2b4f70[_0x4aeafe(0x100)](_0x4aeafe(0xac)+_0x352ccc['action']+'\x20successfully')),console[_0x4aeafe(0x96)](_0x4aeafe(0xab)+_0x352ccc[_0x4aeafe(0xf5)]);if(_0x352ccc[_0x4aeafe(0x9e)]&&_0x352ccc[_0x4aeafe(0x7c)]){const _0x599b13=getLLMAgentChatUrl(_0xb2764c,_0x352ccc[_0x4aeafe(0x7c)],_0x352ccc['agentId']);console['log'](_0x4aeafe(0xc1)+a4_0x2b4f70[_0x4aeafe(0x10c)](_0x599b13));}return 0x0;}const _0x5b309a=_0xa46660['llmProject'],_0x348387=resolveProjectFromContext(_0x51ab2e,_0x5b309a);if(_0x348387[_0x4aeafe(0x85)])_0x51ab2e=_0x348387[_0x4aeafe(0x106)],_0x348387['source']==='context'&&console[_0x4aeafe(0x96)](a4_0x2b4f70[_0x4aeafe(0x81)](_0x4aeafe(0xc0)+_0x51ab2e));else{let _0x5e9c33='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x348387[_0x4aeafe(0x9c)]===_0x4aeafe(0x76)&&(_0x5e9c33=_0x348387[_0x4aeafe(0xd5)]+_0x4aeafe(0xa0)+_0x348387[_0x4aeafe(0x89)]+_0x4aeafe(0x90));throw new SDKError(ErrorCode[_0x4aeafe(0xa6)],_0x348387[_0x4aeafe(0x9c)]===_0x4aeafe(0xb6)?_0x348387[_0x4aeafe(0xd5)]:_0x4aeafe(0xc5)+_0x51ab2e,undefined,{'helpText':_0x5e9c33});}const {data:_0x352ea2}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x3bc62f[_0x4aeafe(0x8a)][_0x4aeafe(0xe0)](_0x51ab2e,{'dryRun':!![]})),_0x5a7b84=_0x352ea2[_0x4aeafe(0x94)]['agents'][_0x4aeafe(0x9d)]>0x0;if(_0x5a7b84){console[_0x4aeafe(0x96)](a4_0x2b4f70[_0x4aeafe(0x70)](_0x4aeafe(0x102)));for(const _0x5d419e of _0x352ea2[_0x4aeafe(0xcd)]){_0x5d419e['action']===_0x4aeafe(0x83)&&console[_0x4aeafe(0x96)](a4_0x2b4f70['red'](_0x4aeafe(0xf4)+_0x5d419e[_0x4aeafe(0xf5)]+_0x4aeafe(0xe3)+_0x5d419e[_0x4aeafe(0x83)]));}return 0x1;}const _0x4f3ada=_0x352ea2['counts'][_0x4aeafe(0xcd)]['created']+_0x352ea2[_0x4aeafe(0x94)][_0x4aeafe(0xb9)][_0x4aeafe(0xc9)]+_0x352ea2[_0x4aeafe(0x94)][_0x4aeafe(0x108)][_0x4aeafe(0xc9)]+_0x352ea2[_0x4aeafe(0x94)][_0x4aeafe(0xc7)][_0x4aeafe(0xc9)]+_0x352ea2[_0x4aeafe(0x94)][_0x4aeafe(0xd7)][_0x4aeafe(0xc9)],_0x43fcb3=_0x352ea2['counts'][_0x4aeafe(0xcd)]['updated']+_0x352ea2[_0x4aeafe(0x94)][_0x4aeafe(0xb9)][_0x4aeafe(0x7d)]+_0x352ea2[_0x4aeafe(0x94)][_0x4aeafe(0x108)][_0x4aeafe(0x7d)]+_0x352ea2[_0x4aeafe(0x94)][_0x4aeafe(0xc7)]['updated']+_0x352ea2[_0x4aeafe(0x94)][_0x4aeafe(0xd7)][_0x4aeafe(0x7d)],_0x38dfef=_0x352ea2[_0x4aeafe(0x94)][_0x4aeafe(0xcd)][_0x4aeafe(0xc3)]+_0x352ea2['counts'][_0x4aeafe(0xb9)][_0x4aeafe(0xc3)]+_0x352ea2[_0x4aeafe(0x94)][_0x4aeafe(0x108)][_0x4aeafe(0xc3)]+_0x352ea2['counts'][_0x4aeafe(0xc7)][_0x4aeafe(0xc3)]+_0x352ea2['counts'][_0x4aeafe(0xd7)][_0x4aeafe(0xc3)];console['log'](_0x4aeafe(0x72)+_0x352ea2['projectName']+'\x27:'),console['log']('\x20\x20'+a4_0x2b4f70[_0x4aeafe(0x100)]('+\x20'+_0x4f3ada+_0x4aeafe(0xdd))+_0x4aeafe(0x10d)+a4_0x2b4f70[_0x4aeafe(0xca)]('~\x20'+_0x43fcb3+'\x20changed')+'\x20|\x20'+a4_0x2b4f70['dim']('=\x20'+_0x38dfef+_0x4aeafe(0xe6))),console[_0x4aeafe(0x96)]('\x20\x20Agents:\x20'+formatCountSummary(_0x352ea2['counts'][_0x4aeafe(0xcd)])),console[_0x4aeafe(0x96)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x352ea2[_0x4aeafe(0x94)]['knowledgeBases'])),console[_0x4aeafe(0x96)](_0x4aeafe(0xbe)+formatCountSummary(_0x352ea2[_0x4aeafe(0x94)]['textKnowledgeBases'])),console[_0x4aeafe(0x96)](_0x4aeafe(0x8b)+formatCountSummary(_0x352ea2[_0x4aeafe(0x94)][_0x4aeafe(0xc7)])),console['log'](_0x4aeafe(0xcb)+formatCountSummary(_0x352ea2[_0x4aeafe(0x94)][_0x4aeafe(0xd7)])),console['log'](_0x4aeafe(0x105)+a4_0x2b4f70[_0x4aeafe(0x10c)](_0x51ab2e)),displayDiffs(_0x352ea2[_0x4aeafe(0xcd)],_0x352ea2[_0x4aeafe(0xb9)],_0x352ea2[_0x4aeafe(0x108)],_0x352ea2[_0x4aeafe(0xc7)],_0x352ea2[_0x4aeafe(0xd7)]);if(_0x3d7819)return console[_0x4aeafe(0x96)](a4_0x2b4f70['yellow'](_0x4aeafe(0x78))),0x0;if(_0x4f3ada===0x0&&_0x43fcb3===0x0){console[_0x4aeafe(0x96)](a4_0x2b4f70[_0x4aeafe(0x100)](_0x4aeafe(0xd1)));const _0x17ff11=getLLMProjectUrl(_0xb2764c,_0x352ea2[_0x4aeafe(0x7c)]);return console[_0x4aeafe(0x96)](_0x4aeafe(0xb0)+a4_0x2b4f70['cyan'](_0x17ff11)),0x0;}if(!_0x382cb6&&!_0x1db254){const _0x1207d5=await confirmKey(_0x4aeafe(0xce)+(_0x4f3ada+_0x43fcb3)+'\x20resources?');if(!_0x1207d5)return console['log'](_0x4aeafe(0x86)),0x0;}const {data:_0x48578d}=await withSpinner(_0x4aeafe(0x8f),()=>_0x3bc62f[_0x4aeafe(0x8a)][_0x4aeafe(0xe0)](_0x51ab2e,{'force':_0x1db254})),_0x192c0c=_0x48578d['counts'][_0x4aeafe(0xcd)][_0x4aeafe(0x9d)]>0x0||_0x48578d['counts'][_0x4aeafe(0xb9)]['errors']>0x0||_0x48578d[_0x4aeafe(0x94)]['textKnowledgeBases'][_0x4aeafe(0x9d)]>0x0||_0x48578d[_0x4aeafe(0x94)]['prompts'][_0x4aeafe(0x9d)]>0x0;if(_0x192c0c){console['log'](a4_0x2b4f70[_0x4aeafe(0xca)](_0x4aeafe(0x77))),console['log'](),console['log'](a4_0x2b4f70[_0x4aeafe(0x70)](_0x4aeafe(0xa8)));for(const _0x380eb0 of _0x48578d['agents']){_0x380eb0[_0x4aeafe(0x84)]==='error'&&console['log'](a4_0x2b4f70[_0x4aeafe(0x70)](_0x4aeafe(0xf4)+_0x380eb0[_0x4aeafe(0xf5)]+_0x4aeafe(0xe3)+_0x380eb0[_0x4aeafe(0x83)]));}for(const _0x293379 of _0x48578d['knowledgeBases']){_0x293379[_0x4aeafe(0x84)]===_0x4aeafe(0x83)&&console['log'](a4_0x2b4f70[_0x4aeafe(0x70)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x293379['name']+_0x4aeafe(0xe3)+_0x293379[_0x4aeafe(0x83)]));}for(const _0x4ba432 of _0x48578d[_0x4aeafe(0x108)]){_0x4ba432[_0x4aeafe(0x84)]===_0x4aeafe(0x83)&&console[_0x4aeafe(0x96)](a4_0x2b4f70[_0x4aeafe(0x70)](_0x4aeafe(0xc6)+_0x4ba432[_0x4aeafe(0x111)]+_0x4aeafe(0xe3)+_0x4ba432[_0x4aeafe(0x83)]));}for(const _0x6c7ce6 of _0x48578d[_0x4aeafe(0xc7)]){_0x6c7ce6[_0x4aeafe(0x84)]===_0x4aeafe(0x83)&&console[_0x4aeafe(0x96)](a4_0x2b4f70[_0x4aeafe(0x70)](_0x4aeafe(0xe4)+_0x6c7ce6['name']+_0x4aeafe(0xe3)+_0x6c7ce6[_0x4aeafe(0x83)]));}for(const _0x9153ae of _0x48578d['integrations']){_0x9153ae[_0x4aeafe(0x84)]===_0x4aeafe(0x83)&&console[_0x4aeafe(0x96)](a4_0x2b4f70[_0x4aeafe(0x70)](_0x4aeafe(0x10e)+_0x9153ae['name']+'\x22:\x20'+_0x9153ae[_0x4aeafe(0x83)]));}return 0x1;}console['log'](a4_0x2b4f70[_0x4aeafe(0x100)](_0x4aeafe(0xa7)+(_0x4f3ada+_0x43fcb3)+'\x20resources\x20to\x20\x27'+_0x48578d['projectName']+'\x27'));const _0x1a3280=getLLMProjectUrl(_0xb2764c,_0x48578d[_0x4aeafe(0x7c)]);return console[_0x4aeafe(0x96)](_0x4aeafe(0xb0)+a4_0x2b4f70['cyan'](_0x1a3280)),0x0;}}
|
|
1
|
+
const a4_0x29d98a=a4_0x3dc0;(function(_0x5f0d19,_0x2fa80f){const _0x2b4758=a4_0x3dc0,_0x3e480d=_0x5f0d19();while(!![]){try{const _0x45fc52=parseInt(_0x2b4758(0x100))/0x1+parseInt(_0x2b4758(0x151))/0x2*(-parseInt(_0x2b4758(0xea))/0x3)+parseInt(_0x2b4758(0x13e))/0x4*(parseInt(_0x2b4758(0x14a))/0x5)+-parseInt(_0x2b4758(0x162))/0x6+parseInt(_0x2b4758(0x152))/0x7+parseInt(_0x2b4758(0x119))/0x8+parseInt(_0x2b4758(0x143))/0x9*(parseInt(_0x2b4758(0x112))/0xa);if(_0x45fc52===_0x2fa80f)break;else _0x3e480d['push'](_0x3e480d['shift']());}catch(_0x540bdb){_0x3e480d['push'](_0x3e480d['shift']());}}}(a4_0x4ecd,0x701c5));import a4_0x47fabb from'chalk';import a4_0xadaa93 from'path';import{existsSync,readFileSync}from'fs';function a4_0x3dc0(_0x4dc7d7,_0xa46091){_0x4dc7d7=_0x4dc7d7-0xd5;const _0x4ecd07=a4_0x4ecd();let _0x3dc0b7=_0x4ecd07[_0x4dc7d7];return _0x3dc0b7;}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';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x1ab4be){const _0x51922e=a4_0x3dc0,_0x290b87=[];if(_0x1ab4be[_0x51922e(0x128)]!==undefined)_0x290b87[_0x51922e(0xda)](_0x1ab4be[_0x51922e(0x128)]+_0x51922e(0x103));if(_0x1ab4be['new']!==undefined&&_0x1ab4be[_0x51922e(0x10b)]>0x0)_0x290b87['push'](a4_0x47fabb[_0x51922e(0x150)](_0x1ab4be[_0x51922e(0x10b)]+_0x51922e(0x149)));if(_0x1ab4be[_0x51922e(0xf5)]!==undefined&&_0x1ab4be[_0x51922e(0xf5)]>0x0)_0x290b87[_0x51922e(0xda)](a4_0x47fabb['green'](_0x1ab4be[_0x51922e(0xf5)]+_0x51922e(0xdf)));if(_0x1ab4be['updated']!==undefined&&_0x1ab4be[_0x51922e(0x10d)]>0x0)_0x290b87[_0x51922e(0xda)](a4_0x47fabb[_0x51922e(0x146)](_0x1ab4be[_0x51922e(0x10d)]+_0x51922e(0x13a)));if(_0x1ab4be[_0x51922e(0x145)]!==undefined&&_0x1ab4be['unchanged']>0x0)_0x290b87[_0x51922e(0xda)](a4_0x47fabb[_0x51922e(0x169)](_0x1ab4be[_0x51922e(0x145)]+_0x51922e(0xd9)));if(_0x1ab4be[_0x51922e(0x104)]!==undefined&&_0x1ab4be['errors']>0x0)_0x290b87['push'](a4_0x47fabb[_0x51922e(0x123)](_0x1ab4be['errors']+_0x51922e(0x13d)));return _0x290b87['join'](',\x20');}function displayDiffs(_0x3c5c3e,_0x3ec196,_0x2d281e,_0x2c3650,_0x4f6b5b=[]){const _0x4bd368=a4_0x3dc0;for(const _0xd64b65 of _0x3c5c3e){if(_0xd64b65[_0x4bd368(0xf7)]){const _0x19d563=_0xd64b65[_0x4bd368(0x13f)]||_0xd64b65[_0x4bd368(0x135)];console[_0x4bd368(0x134)]('\x0aChanges\x20to\x20agent\x20\x27'+_0x19d563+'\x27:'),console[_0x4bd368(0x134)]('─'[_0x4bd368(0x107)](0x3c)),console[_0x4bd368(0x134)](_0xd64b65[_0x4bd368(0xf7)]),console['log']('─'[_0x4bd368(0x107)](0x3c));}}for(const _0x3f568a of _0x3ec196){_0x3f568a['diff']&&(console[_0x4bd368(0x134)](_0x4bd368(0xec)+_0x3f568a[_0x4bd368(0x135)]+'\x27:'),console['log']('─'[_0x4bd368(0x107)](0x3c)),console[_0x4bd368(0x134)](_0x3f568a[_0x4bd368(0xf7)]),console[_0x4bd368(0x134)]('─'[_0x4bd368(0x107)](0x3c)));}for(const _0x589478 of _0x2d281e){_0x589478[_0x4bd368(0xf7)]&&(console[_0x4bd368(0x134)](_0x4bd368(0x118)+_0x589478[_0x4bd368(0x135)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x4bd368(0x134)](_0x589478[_0x4bd368(0xf7)]),console['log']('─'[_0x4bd368(0x107)](0x3c)));}for(const _0x4846b4 of _0x2c3650){_0x4846b4[_0x4bd368(0xf7)]&&(console[_0x4bd368(0x134)]('\x0aChanges\x20to\x20prompt\x20\x27'+_0x4846b4['name']+'\x27:'),console[_0x4bd368(0x134)]('─'[_0x4bd368(0x107)](0x3c)),console['log'](_0x4846b4[_0x4bd368(0xf7)]),console[_0x4bd368(0x134)]('─'[_0x4bd368(0x107)](0x3c)));}for(const _0x501db9 of _0x4f6b5b){_0x501db9[_0x4bd368(0xf7)]&&(console['log']('\x0aChanges\x20to\x20integration\x20\x27'+_0x501db9['name']+'\x27:'),console['log']('─'[_0x4bd368(0x107)](0x3c)),console[_0x4bd368(0x134)](_0x501db9[_0x4bd368(0xf7)]),console[_0x4bd368(0x134)]('─'[_0x4bd368(0x107)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']='agent:pull';[a4_0x29d98a(0xe0)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async['execute'](_0x160e5b){const _0x4b92fb=a4_0x29d98a,{options:_0x2a784d,args:_0x465ee6,tdx:_0x8b2ae5}=_0x160e5b,_0x20f35f=_0x465ee6[0x0],_0x134960=_0x465ee6[0x1],_0x86551f=_0x2a784d[_0x4b92fb(0xf3)],_0x3151b2=_0x2a784d[_0x4b92fb(0x174)],_0x2cdd00=_0x2a784d[_0x4b92fb(0x11d)],_0x380da8=_0x2a784d['yes'],_0x431da3=_0x2a784d[_0x4b92fb(0x16e)];let _0x1f2126,_0x1570c5;const _0x393f38=findAgentConfigPath(process[_0x4b92fb(0x168)]());if(_0x20f35f){const _0x2701dc=a4_0xadaa93[_0x4b92fb(0x125)](_0x20f35f,_0x4b92fb(0x171));if(existsSync(_0x2701dc))try{const _0x271110=JSON[_0x4b92fb(0x14b)](readFileSync(_0x2701dc,'utf-8'));_0x1f2126=_0x271110['llm_project'],_0x1570c5=_0x20f35f,console['log'](a4_0x47fabb[_0x4b92fb(0xed)](_0x4b92fb(0x111)+_0x2701dc+':\x20'+_0x1f2126));}catch{_0x1f2126=_0x20f35f;}else _0x1f2126=_0x20f35f;}else{if(_0x393f38)try{const _0x35799a=JSON[_0x4b92fb(0x14b)](readFileSync(_0x393f38,'utf-8'));_0x1f2126=_0x35799a[_0x4b92fb(0x148)],_0x1570c5=a4_0xadaa93[_0x4b92fb(0x139)](_0x393f38),console['log'](a4_0x47fabb[_0x4b92fb(0xed)](_0x4b92fb(0x116)+_0x1f2126));}catch{_0x1f2126=_0x431da3;}else _0x1f2126=_0x431da3;}if(!_0x1f2126)return console[_0x4b92fb(0x134)](a4_0x47fabb[_0x4b92fb(0x146)](_0x4b92fb(0x12a))),console[_0x4b92fb(0x134)](_0x4b92fb(0x144)),console['log'](_0x4b92fb(0x15b)),console[_0x4b92fb(0x134)](_0x4b92fb(0xfd)),console[_0x4b92fb(0x134)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent'),0x1;if(_0x134960){const {data:_0x2f8033}=await withSpinner(_0x4b92fb(0xd7)+_0x134960+'\x22\x20from\x20project\x20\x22'+_0x1f2126+_0x4b92fb(0x11b),()=>_0x8b2ae5['llm'][_0x4b92fb(0xdd)](_0x1f2126,_0x134960,_0x86551f,{'dryRun':_0x3151b2,'force':_0x2cdd00}));if(_0x3151b2)return console[_0x4b92fb(0x134)](a4_0x47fabb[_0x4b92fb(0x146)]('Dry\x20run\x20-\x20no\x20files\x20written')),console[_0x4b92fb(0x134)](_0x4b92fb(0x110)+_0x2f8033[_0x4b92fb(0x13f)]),console['log'](_0x4b92fb(0x142)+_0x2f8033[_0x4b92fb(0x141)]),_0x2f8033[_0x4b92fb(0xf7)]&&(console['log'](_0x4b92fb(0xf2)),console[_0x4b92fb(0x134)]('─'[_0x4b92fb(0x107)](0x3c)),console[_0x4b92fb(0x134)](_0x2f8033[_0x4b92fb(0xf7)]),console['log']('─'[_0x4b92fb(0x107)](0x3c))),0x0;return console[_0x4b92fb(0x134)](a4_0x47fabb[_0x4b92fb(0x150)]('Agent\x20pulled\x20successfully')),console[_0x4b92fb(0x134)]('Agent:\x20'+_0x2f8033[_0x4b92fb(0x13f)]),console[_0x4b92fb(0x134)]('Output:\x20'+_0x2f8033['outputPath']),console['log'](_0x4b92fb(0xee)+(_0x2f8033[_0x4b92fb(0x138)]?a4_0x47fabb[_0x4b92fb(0x150)]('new'):_0x2f8033[_0x4b92fb(0xf6)]?a4_0x47fabb['yellow'](_0x4b92fb(0x10d)):a4_0x47fabb['gray'](_0x4b92fb(0x145)))),0x0;}const _0x4c6a2b=_0x1570c5||_0x86551f,{data:_0x16c897}=await withSpinner('Analyzing\x20project\x20\x22'+_0x1f2126+_0x4b92fb(0x11b),()=>_0x8b2ae5[_0x4b92fb(0x12e)][_0x4b92fb(0x115)](_0x1f2126,_0x4c6a2b,{'dryRun':!![]})),_0x24da45=_0x16c897[_0x4b92fb(0x16b)]['agents']['new']+_0x16c897['counts']['knowledgeBases'][_0x4b92fb(0x10b)]+_0x16c897[_0x4b92fb(0x16b)]['textKnowledgeBases'][_0x4b92fb(0x10b)]+_0x16c897[_0x4b92fb(0x16b)]['prompts']['new']+_0x16c897[_0x4b92fb(0x16b)][_0x4b92fb(0xd8)][_0x4b92fb(0x10b)],_0x12934b=_0x16c897[_0x4b92fb(0x16b)][_0x4b92fb(0x117)][_0x4b92fb(0x10d)]+_0x16c897['counts']['knowledgeBases'][_0x4b92fb(0x10d)]+_0x16c897[_0x4b92fb(0x16b)]['textKnowledgeBases'][_0x4b92fb(0x10d)]+_0x16c897['counts'][_0x4b92fb(0x157)]['updated']+_0x16c897[_0x4b92fb(0x16b)][_0x4b92fb(0xd8)][_0x4b92fb(0x10d)],_0x2a6c89=_0x16c897[_0x4b92fb(0x16b)][_0x4b92fb(0x117)][_0x4b92fb(0x145)]+_0x16c897[_0x4b92fb(0x16b)][_0x4b92fb(0x15f)]['unchanged']+_0x16c897[_0x4b92fb(0x16b)][_0x4b92fb(0xe7)][_0x4b92fb(0x145)]+_0x16c897[_0x4b92fb(0x16b)][_0x4b92fb(0x157)][_0x4b92fb(0x145)]+_0x16c897[_0x4b92fb(0x16b)][_0x4b92fb(0xd8)][_0x4b92fb(0x145)];console[_0x4b92fb(0x134)]('\x0aPull\x20summary\x20for\x20\x27'+_0x16c897[_0x4b92fb(0x10e)]+'\x27:'),console[_0x4b92fb(0x134)]('\x20\x20'+a4_0x47fabb[_0x4b92fb(0x150)]('+\x20'+_0x24da45+'\x20new')+'\x20|\x20'+a4_0x47fabb[_0x4b92fb(0x146)]('~\x20'+_0x12934b+_0x4b92fb(0x106))+'\x20|\x20'+a4_0x47fabb[_0x4b92fb(0xed)]('=\x20'+_0x2a6c89+_0x4b92fb(0xd9))),console['log'](_0x4b92fb(0xfe)+formatCountSummary(_0x16c897[_0x4b92fb(0x16b)]['agents'])),console[_0x4b92fb(0x134)](_0x4b92fb(0x159)+formatCountSummary(_0x16c897[_0x4b92fb(0x16b)][_0x4b92fb(0x15f)])),console[_0x4b92fb(0x134)](_0x4b92fb(0xff)+formatCountSummary(_0x16c897[_0x4b92fb(0x16b)]['textKnowledgeBases'])),console['log']('\x20\x20Prompts:\x20'+formatCountSummary(_0x16c897['counts']['prompts'])),console['log'](_0x4b92fb(0x11a)+formatCountSummary(_0x16c897[_0x4b92fb(0x16b)][_0x4b92fb(0xd8)])),console['log'](_0x4b92fb(0x158)+a4_0x47fabb[_0x4b92fb(0x14c)](_0x16c897[_0x4b92fb(0xfb)])),displayDiffs(_0x16c897[_0x4b92fb(0x117)],_0x16c897['knowledgeBases'],_0x16c897[_0x4b92fb(0xe7)],_0x16c897[_0x4b92fb(0x157)],_0x16c897[_0x4b92fb(0xd8)]);if(_0x3151b2)return console[_0x4b92fb(0x134)](a4_0x47fabb['yellow'](_0x4b92fb(0x12f))),0x0;if(_0x24da45===0x0&&_0x12934b===0x0)return console[_0x4b92fb(0x134)](a4_0x47fabb[_0x4b92fb(0x150)](_0x4b92fb(0x114))),saveSessionContext({'llm_project':_0x16c897[_0x4b92fb(0x10e)]},_0x2a784d['session']),console[_0x4b92fb(0x134)](a4_0x47fabb[_0x4b92fb(0x150)](_0x4b92fb(0xe6)+a4_0x47fabb['dim'](_0x4b92fb(0x148))+_0x4b92fb(0xd5)+a4_0x47fabb[_0x4b92fb(0x14c)](_0x16c897['projectName']))),0x0;if(!_0x380da8&&!_0x2cdd00){const _0x58d33e=await confirmKey(_0x4b92fb(0xe1)+(_0x24da45+_0x12934b)+'\x20files?');if(!_0x58d33e)return console[_0x4b92fb(0x134)]('Pull\x20cancelled'),0x0;}const {data:_0x57f917}=await withSpinner(_0x4b92fb(0x105),()=>_0x8b2ae5['llm'][_0x4b92fb(0x115)](_0x1f2126,_0x4c6a2b,{'force':_0x2cdd00}));return console[_0x4b92fb(0x134)](a4_0x47fabb['green'](_0x4b92fb(0x15d)+(_0x24da45+_0x12934b)+'\x20files\x20to\x20'+_0x57f917[_0x4b92fb(0xfb)])),saveSessionContext({'llm_project':_0x57f917['projectName']},_0x2a784d[_0x4b92fb(0x15e)]),console[_0x4b92fb(0x134)](a4_0x47fabb[_0x4b92fb(0x150)](_0x4b92fb(0xe6)+a4_0x47fabb['dim']('llm_project')+_0x4b92fb(0xd5)+a4_0x47fabb[_0x4b92fb(0x14c)](_0x57f917[_0x4b92fb(0x10e)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x29d98a(0x135)]=a4_0x29d98a(0x13b);[a4_0x29d98a(0xe0)]=a4_0x29d98a(0x165);async[a4_0x29d98a(0xf1)](_0x464830){const _0x5bd1c1=a4_0x29d98a,{options:_0x5f5cb4,args:_0x2b52b6,tdx:_0x49e14e}=_0x464830,_0x55404e=_0x2b52b6[0x0],_0x3ddc81=_0x5f5cb4[_0x5bd1c1(0x135)],_0x4bd4f7=_0x5f5cb4[_0x5bd1c1(0x174)],_0x16c743=_0x5f5cb4['yes'],_0x681ace=_0x5f5cb4['site'],_0xea1a00=_0x5f5cb4[_0x5bd1c1(0x16e)];let _0x2e8625;const _0x41b75a=findAgentConfigPath(process[_0x5bd1c1(0x168)]());if(_0x55404e){const _0x310657=a4_0xadaa93[_0x5bd1c1(0x125)](_0x55404e,_0x5bd1c1(0x171));existsSync(_0x310657)?(_0x2e8625=_0x55404e,console[_0x5bd1c1(0x134)](a4_0x47fabb[_0x5bd1c1(0xed)](_0x5bd1c1(0xef)+_0x55404e))):_0x2e8625=_0x55404e;}else{if(_0x41b75a)_0x2e8625=a4_0xadaa93['dirname'](_0x41b75a),console[_0x5bd1c1(0x134)](a4_0x47fabb[_0x5bd1c1(0xed)](_0x5bd1c1(0x10f)+_0x2e8625));else{if(_0xea1a00){const _0x547055=sanitizeForFilesystem(_0xea1a00);let _0x3b99e9=_0x547055,_0x36695c=a4_0xadaa93['join'](process['cwd'](),_0x5bd1c1(0x117),_0x547055,_0x5bd1c1(0x171));if(!existsSync(_0x36695c)){const _0x13c8f3=normalizeName(_0xea1a00),_0x5c08fa=a4_0xadaa93[_0x5bd1c1(0x125)](process[_0x5bd1c1(0x168)](),_0x5bd1c1(0x117),_0x13c8f3,_0x5bd1c1(0x171));existsSync(_0x5c08fa)&&(_0x3b99e9=_0x13c8f3,_0x36695c=_0x5c08fa);}if(existsSync(_0x36695c))_0x2e8625=a4_0xadaa93[_0x5bd1c1(0x139)](_0x36695c),console['log'](a4_0x47fabb['dim'](_0x5bd1c1(0xef)+_0x2e8625));else{const _0x75161=_0x5f5cb4[_0x5bd1c1(0x13c)];if(_0x75161)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x5bd1c1(0x16c)+_0xea1a00+_0x5bd1c1(0x137),undefined,{'helpText':_0x5bd1c1(0xfa)+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+(_0x5bd1c1(0x14f)+_0xea1a00+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x3b99e9+_0x5bd1c1(0x160)+(_0x3ddc81||'<new-name>')+_0x5bd1c1(0x12d)+_0x75161)});_0x2e8625=_0xea1a00,console[_0x5bd1c1(0x134)](a4_0x47fabb[_0x5bd1c1(0xed)]('Using\x20context\x20project:\x20'+_0xea1a00));}}}}if(!_0x2e8625)return console[_0x5bd1c1(0x134)](a4_0x47fabb[_0x5bd1c1(0x146)](_0x5bd1c1(0x167))),console[_0x5bd1c1(0x134)](_0x5bd1c1(0x130)),console[_0x5bd1c1(0x134)](_0x5bd1c1(0x109)),console[_0x5bd1c1(0x134)]('\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[_0x5bd1c1(0x134)](_0x5bd1c1(0x127)),0x1;if(!_0x3ddc81)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x5bd1c1(0x108),undefined,{'helpText':_0x5bd1c1(0x155)});if(!_0x16c743&&!_0x4bd4f7){const _0x426890=await confirmKey(_0x5bd1c1(0x154)+_0x2e8625+_0x5bd1c1(0x121)+_0x3ddc81+'\x22?');if(!_0x426890)return console['log']('Clone\x20cancelled'),0x0;}const {data:_0x4a296d}=await withSpinner(_0x5bd1c1(0x161)+_0x2e8625+_0x5bd1c1(0x12b)+_0x3ddc81+_0x5bd1c1(0x11b),()=>_0x49e14e['llm'][_0x5bd1c1(0x15c)](_0x2e8625,_0x3ddc81,{'dryRun':_0x4bd4f7}));if(_0x4bd4f7)return console[_0x5bd1c1(0x134)](a4_0x47fabb[_0x5bd1c1(0x146)](_0x5bd1c1(0x153))),console[_0x5bd1c1(0x134)](_0x5bd1c1(0x156)+_0x4a296d['sourceProjectName']),console[_0x5bd1c1(0x134)](_0x5bd1c1(0x173)+_0x3ddc81),console['log'](_0x5bd1c1(0x133)),console[_0x5bd1c1(0x134)]('\x20\x20Agents:\x20'+_0x4a296d[_0x5bd1c1(0x16b)][_0x5bd1c1(0x117)][_0x5bd1c1(0xf5)]),console[_0x5bd1c1(0x134)](_0x5bd1c1(0x159)+_0x4a296d[_0x5bd1c1(0x16b)]['knowledgeBases'][_0x5bd1c1(0xf5)]),console[_0x5bd1c1(0x134)](_0x5bd1c1(0xe3)+_0x4a296d[_0x5bd1c1(0x16b)][_0x5bd1c1(0x157)][_0x5bd1c1(0xf5)]),0x0;const _0x203956=_0x4a296d['counts'][_0x5bd1c1(0x117)][_0x5bd1c1(0x104)]>0x0||_0x4a296d[_0x5bd1c1(0x16b)]['knowledgeBases'][_0x5bd1c1(0x104)]>0x0||_0x4a296d[_0x5bd1c1(0x16b)][_0x5bd1c1(0x157)]['errors']>0x0;_0x203956?console[_0x5bd1c1(0x134)](a4_0x47fabb[_0x5bd1c1(0x146)](_0x5bd1c1(0x10c))):console[_0x5bd1c1(0x134)](a4_0x47fabb[_0x5bd1c1(0x150)](_0x5bd1c1(0x136)));console[_0x5bd1c1(0x134)](_0x5bd1c1(0x156)+_0x4a296d['sourceProjectName']),console[_0x5bd1c1(0x134)](_0x5bd1c1(0x173)+_0x4a296d['newProjectName']),console[_0x5bd1c1(0x134)](_0x5bd1c1(0xf4)+_0x4a296d[_0x5bd1c1(0x113)]),console[_0x5bd1c1(0x134)](),console['log'](_0x5bd1c1(0xeb)),console[_0x5bd1c1(0x134)]('\x20\x20Agents:\x20'+formatCountSummary(_0x4a296d['counts'][_0x5bd1c1(0x117)])),console['log']('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x4a296d[_0x5bd1c1(0x16b)][_0x5bd1c1(0x15f)])),console['log']('\x20\x20Prompts:\x20'+formatCountSummary(_0x4a296d['counts'][_0x5bd1c1(0x157)])),console['log'](_0x5bd1c1(0x11a)+formatCountSummary(_0x4a296d[_0x5bd1c1(0x16b)][_0x5bd1c1(0xd8)]));if(_0x203956){console[_0x5bd1c1(0x134)](),console[_0x5bd1c1(0x134)](a4_0x47fabb[_0x5bd1c1(0x123)](_0x5bd1c1(0x166)));for(const _0x312800 of _0x4a296d['agents']){_0x312800[_0x5bd1c1(0x16d)]==='error'&&console[_0x5bd1c1(0x134)](a4_0x47fabb[_0x5bd1c1(0x123)](_0x5bd1c1(0x11e)+_0x312800['agentName']+_0x5bd1c1(0x129)+_0x312800[_0x5bd1c1(0x131)]));}for(const _0x4c578f of _0x4a296d[_0x5bd1c1(0x15f)]){_0x4c578f[_0x5bd1c1(0x16d)]===_0x5bd1c1(0x131)&&console[_0x5bd1c1(0x134)](a4_0x47fabb['red'](_0x5bd1c1(0xe5)+_0x4c578f[_0x5bd1c1(0x135)]+_0x5bd1c1(0x129)+_0x4c578f[_0x5bd1c1(0x131)]));}for(const _0x59e6f2 of _0x4a296d[_0x5bd1c1(0x157)]){_0x59e6f2[_0x5bd1c1(0x16d)]===_0x5bd1c1(0x131)&&console[_0x5bd1c1(0x134)](a4_0x47fabb[_0x5bd1c1(0x123)]('\x20\x20Prompt\x20\x22'+_0x59e6f2['name']+'\x22:\x20'+_0x59e6f2[_0x5bd1c1(0x131)]));}for(const _0x5eb9be of _0x4a296d[_0x5bd1c1(0xd8)]){_0x5eb9be['action']===_0x5bd1c1(0x131)&&console[_0x5bd1c1(0x134)](a4_0x47fabb[_0x5bd1c1(0x123)](_0x5bd1c1(0xd6)+_0x5eb9be['name']+_0x5bd1c1(0x129)+_0x5eb9be[_0x5bd1c1(0x131)]));}return 0x1;}console['log']();const _0x1408e9=getLLMProjectUrl(_0x681ace,_0x4a296d[_0x5bd1c1(0x113)]);return console[_0x5bd1c1(0x134)](_0x5bd1c1(0xf9)+a4_0x47fabb[_0x5bd1c1(0x14c)](_0x1408e9)),0x0;}}function a4_0x4ecd(){const _0x3e7065=['reason','llm_project','\x20new','2569755KVhqXT','parse','cyan','\x27\x20to\x20create\x20the\x20folder\x20structure.','message','\x20\x20tdx\x20agent\x20pull\x20','green','19152xCKEAZ','100674gGbeMT','Dry\x20run\x20-\x20no\x20changes\x20made','Clone\x20\x22','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','Source:\x20','prompts','\x20\x20Target:\x20','\x20\x20Knowledge\x20Bases:\x20','\x0aRun\x20\x27tdx\x20agent\x20pull\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','cloneProject','\x0a✔\x20Pulled\x20','session','knowledgeBases','\x20--name\x20','Cloning\x20\x22','4265634iDaPIM','agentId','Chat:\x20','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','Errors:','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','cwd','gray','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','counts','Cannot\x20clone\x20from\x20context\x20project\x20\x22','action','llmProject','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x20successfully','tdx.json','Agent:\x20','New\x20project:\x20','dryRun','\x20resources?','\x20=\x20','\x20\x20Integration\x20\x22','Pulling\x20agent\x20\x22','integrations','\x20unchanged','push','INVALID_ARGUMENT','projectDir','pullAgent','projectId','\x20created','description','\x0aWrite\x20','Pushing\x20agent\x20from\x20\x22','\x20\x20Prompts:\x20','source','\x20\x20Knowledge\x20Base\x20\x22','✔\x20Context\x20set:\x20','textKnowledgeBases','Analyzing\x20changes\x20to\x20push...','\x0aPush\x20','51ETPNxH','Summary:','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','dim','Status:\x20','Using\x20local\x20project:\x20','site','execute','\x0aChanges:','output','New\x20project\x20ID:\x20','created','hasChanges','diff','\x0a✔\x20Pushed\x20','Project:\x20','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','outputDir','agent:push','\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','\x20\x20Agents:\x20','\x20\x20Text\x20Knowledge\x20Bases:\x20','411977BKlNYf','Would\x20push\x20agent:\x20','agent.yml','\x20total','errors','Writing\x20files...','\x20changed','repeat','New\x20project\x20name\x20is\x20required','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','Push\x20cancelled','new','Project\x20cloned\x20with\x20errors','updated','projectName','Using\x20current\x20project:\x20','Would\x20pull\x20agent:\x20','Using\x20project\x20from\x20','23810ZtVumk','newProjectId','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','pullProject','Using\x20project:\x20','agents','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','1560024gzILYk','\x20\x20Integrations:\x20','\x22...','\x20\x20Prompt\x20\x22','force','\x20\x20Agent\x20\x22','\x20resources\x20to\x20\x27','found','\x22\x20to\x20new\x20project\x20\x22','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','red','pushProject','join','\x20|\x20','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','total','\x22:\x20','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','\x22\x20to\x20\x22','Pushing\x20to\x20project...','\x20--profile\x20','llm','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','error','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','Would\x20clone:','log','name','Project\x20cloned\x20successfully','\x22\x20to\x20a\x20different\x20profile','isNew','dirname','\x20updated','agent:clone','profile','\x20errors','4hutQPn','agentName','\x0aProject\x20pushed\x20with\x20errors','outputPath','Output\x20path:\x20','747VszIbe','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)','unchanged','yellow'];a4_0x4ecd=function(){return _0x3e7065;};return a4_0x4ecd();}export class AgentPushCommand extends BaseCommand{['name']=a4_0x29d98a(0xfc);[a4_0x29d98a(0xe0)]=a4_0x29d98a(0x16f);async[a4_0x29d98a(0xf1)](_0x2eb985){const _0x804c0c=a4_0x29d98a,{options:_0xbff3cd,args:_0x336734,tdx:_0x8a41ba}=_0x2eb985;let _0x38107a=_0x336734[0x0]||process[_0x804c0c(0x168)]();const _0x7c3040=_0xbff3cd['dryRun'],_0x5b4ba8=_0xbff3cd[_0x804c0c(0x11d)],_0x151e02=_0xbff3cd['yes'],_0x467a31=_0xbff3cd[_0x804c0c(0xf0)],_0x1285c2=a4_0xadaa93['join'](_0x38107a,_0x804c0c(0x102)),_0x54a988=existsSync(_0x1285c2);if(_0x54a988){const {data:_0x7b4b09}=await withSpinner(_0x804c0c(0xe2)+_0x38107a+'\x22...',()=>_0x8a41ba[_0x804c0c(0x12e)]['pushAgent'](_0x38107a,{'dryRun':_0x7c3040,'force':_0x5b4ba8}));if(_0x7c3040)return console['log'](a4_0x47fabb[_0x804c0c(0x146)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x804c0c(0x134)](_0x804c0c(0x101)+_0x7b4b09[_0x804c0c(0x13f)]),0x0;if(_0x7b4b09[_0x804c0c(0x16d)]===_0x804c0c(0x131))return console[_0x804c0c(0x134)](a4_0x47fabb[_0x804c0c(0x123)]('Failed\x20to\x20push\x20agent:\x20'+_0x7b4b09['error'])),0x1;console['log'](a4_0x47fabb['green']('Agent\x20'+_0x7b4b09[_0x804c0c(0x16d)]+_0x804c0c(0x170))),console[_0x804c0c(0x134)](_0x804c0c(0x172)+_0x7b4b09['agentName']);if(_0x7b4b09[_0x804c0c(0x163)]&&_0x7b4b09[_0x804c0c(0xde)]){const _0x57c6da=getLLMAgentChatUrl(_0x467a31,_0x7b4b09[_0x804c0c(0xde)],_0x7b4b09['agentId']);console[_0x804c0c(0x134)](_0x804c0c(0x164)+a4_0x47fabb['cyan'](_0x57c6da));}return 0x0;}const _0x578290=_0xbff3cd[_0x804c0c(0x16e)],_0x173eb7=resolveProjectFromContext(_0x38107a,_0x578290);if(_0x173eb7[_0x804c0c(0x120)])_0x38107a=_0x173eb7[_0x804c0c(0xdc)],_0x173eb7[_0x804c0c(0xe4)]==='context'&&console[_0x804c0c(0x134)](a4_0x47fabb[_0x804c0c(0xed)](_0x804c0c(0x116)+_0x38107a));else{let _0x3214a4=_0x804c0c(0x122);_0x173eb7[_0x804c0c(0x147)]==='no_local_folder'&&(_0x3214a4=_0x173eb7[_0x804c0c(0x14e)]+_0x804c0c(0x15a)+_0x173eb7[_0x804c0c(0x16e)]+_0x804c0c(0x14d));throw new SDKError(ErrorCode[_0x804c0c(0xdb)],_0x173eb7['reason']==='no_context'?_0x173eb7[_0x804c0c(0x14e)]:'No\x20tdx.json\x20found\x20in\x20'+_0x38107a,undefined,{'helpText':_0x3214a4});}const {data:_0x1b13c7}=await withSpinner(_0x804c0c(0xe8),()=>_0x8a41ba[_0x804c0c(0x12e)][_0x804c0c(0x124)](_0x38107a,{'dryRun':!![]})),_0x334763=_0x1b13c7['counts']['agents'][_0x804c0c(0x104)]>0x0;if(_0x334763){console[_0x804c0c(0x134)](a4_0x47fabb[_0x804c0c(0x123)]('\x0aErrors\x20found:'));for(const _0x552079 of _0x1b13c7[_0x804c0c(0x117)]){_0x552079[_0x804c0c(0x16d)]===_0x804c0c(0x131)&&console[_0x804c0c(0x134)](a4_0x47fabb[_0x804c0c(0x123)]('\x20\x20Agent\x20\x22'+_0x552079[_0x804c0c(0x13f)]+_0x804c0c(0x129)+_0x552079['error']));}return 0x1;}const _0x1f225=_0x1b13c7[_0x804c0c(0x16b)][_0x804c0c(0x117)][_0x804c0c(0xf5)]+_0x1b13c7[_0x804c0c(0x16b)]['knowledgeBases'][_0x804c0c(0xf5)]+_0x1b13c7[_0x804c0c(0x16b)][_0x804c0c(0xe7)][_0x804c0c(0xf5)]+_0x1b13c7[_0x804c0c(0x16b)][_0x804c0c(0x157)][_0x804c0c(0xf5)]+_0x1b13c7[_0x804c0c(0x16b)][_0x804c0c(0xd8)][_0x804c0c(0xf5)],_0x2b886d=_0x1b13c7[_0x804c0c(0x16b)][_0x804c0c(0x117)][_0x804c0c(0x10d)]+_0x1b13c7['counts'][_0x804c0c(0x15f)][_0x804c0c(0x10d)]+_0x1b13c7[_0x804c0c(0x16b)]['textKnowledgeBases'][_0x804c0c(0x10d)]+_0x1b13c7[_0x804c0c(0x16b)][_0x804c0c(0x157)][_0x804c0c(0x10d)]+_0x1b13c7[_0x804c0c(0x16b)]['integrations'][_0x804c0c(0x10d)],_0x361863=_0x1b13c7[_0x804c0c(0x16b)][_0x804c0c(0x117)][_0x804c0c(0x145)]+_0x1b13c7[_0x804c0c(0x16b)][_0x804c0c(0x15f)][_0x804c0c(0x145)]+_0x1b13c7['counts'][_0x804c0c(0xe7)][_0x804c0c(0x145)]+_0x1b13c7['counts']['prompts']['unchanged']+_0x1b13c7[_0x804c0c(0x16b)][_0x804c0c(0xd8)][_0x804c0c(0x145)];console[_0x804c0c(0x134)]('\x0aPush\x20summary\x20for\x20\x27'+_0x1b13c7[_0x804c0c(0x10e)]+'\x27:'),console['log']('\x20\x20'+a4_0x47fabb[_0x804c0c(0x150)]('+\x20'+_0x1f225+_0x804c0c(0x149))+_0x804c0c(0x126)+a4_0x47fabb[_0x804c0c(0x146)]('~\x20'+_0x2b886d+_0x804c0c(0x106))+_0x804c0c(0x126)+a4_0x47fabb[_0x804c0c(0xed)]('=\x20'+_0x361863+'\x20unchanged')),console[_0x804c0c(0x134)](_0x804c0c(0xfe)+formatCountSummary(_0x1b13c7[_0x804c0c(0x16b)][_0x804c0c(0x117)])),console['log'](_0x804c0c(0x159)+formatCountSummary(_0x1b13c7[_0x804c0c(0x16b)][_0x804c0c(0x15f)])),console['log']('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x1b13c7[_0x804c0c(0x16b)][_0x804c0c(0xe7)])),console['log'](_0x804c0c(0xe3)+formatCountSummary(_0x1b13c7['counts']['prompts'])),console[_0x804c0c(0x134)](_0x804c0c(0x11a)+formatCountSummary(_0x1b13c7['counts'][_0x804c0c(0xd8)])),console[_0x804c0c(0x134)]('\x20\x20Source:\x20'+a4_0x47fabb[_0x804c0c(0x14c)](_0x38107a)),displayDiffs(_0x1b13c7['agents'],_0x1b13c7[_0x804c0c(0x15f)],_0x1b13c7[_0x804c0c(0xe7)],_0x1b13c7['prompts'],_0x1b13c7[_0x804c0c(0xd8)]);if(_0x7c3040)return console[_0x804c0c(0x134)](a4_0x47fabb['yellow'](_0x804c0c(0x16a))),0x0;if(_0x1f225===0x0&&_0x2b886d===0x0){console[_0x804c0c(0x134)](a4_0x47fabb[_0x804c0c(0x150)](_0x804c0c(0x132)));const _0x4e1eb9=getLLMProjectUrl(_0x467a31,_0x1b13c7[_0x804c0c(0xde)]);return console[_0x804c0c(0x134)](_0x804c0c(0xf9)+a4_0x47fabb[_0x804c0c(0x14c)](_0x4e1eb9)),0x0;}if(!_0x151e02&&!_0x5b4ba8){const _0x10dd89=await confirmKey(_0x804c0c(0xe9)+(_0x1f225+_0x2b886d)+_0x804c0c(0x175));if(!_0x10dd89)return console['log'](_0x804c0c(0x10a)),0x0;}const {data:_0x2de9f3}=await withSpinner(_0x804c0c(0x12c),()=>_0x8a41ba['llm'][_0x804c0c(0x124)](_0x38107a,{'force':_0x5b4ba8})),_0x38ba1a=_0x2de9f3[_0x804c0c(0x16b)]['agents'][_0x804c0c(0x104)]>0x0||_0x2de9f3[_0x804c0c(0x16b)][_0x804c0c(0x15f)][_0x804c0c(0x104)]>0x0||_0x2de9f3[_0x804c0c(0x16b)][_0x804c0c(0xe7)][_0x804c0c(0x104)]>0x0||_0x2de9f3[_0x804c0c(0x16b)][_0x804c0c(0x157)][_0x804c0c(0x104)]>0x0;if(_0x38ba1a){console['log'](a4_0x47fabb[_0x804c0c(0x146)](_0x804c0c(0x140))),console['log'](),console['log'](a4_0x47fabb[_0x804c0c(0x123)](_0x804c0c(0x166)));for(const _0x39aabd of _0x2de9f3[_0x804c0c(0x117)]){_0x39aabd['action']===_0x804c0c(0x131)&&console[_0x804c0c(0x134)](a4_0x47fabb[_0x804c0c(0x123)](_0x804c0c(0x11e)+_0x39aabd[_0x804c0c(0x13f)]+_0x804c0c(0x129)+_0x39aabd['error']));}for(const _0x1929a2 of _0x2de9f3[_0x804c0c(0x15f)]){_0x1929a2['action']==='error'&&console['log'](a4_0x47fabb[_0x804c0c(0x123)](_0x804c0c(0xe5)+_0x1929a2['name']+_0x804c0c(0x129)+_0x1929a2[_0x804c0c(0x131)]));}for(const _0x1683da of _0x2de9f3[_0x804c0c(0xe7)]){_0x1683da[_0x804c0c(0x16d)]===_0x804c0c(0x131)&&console['log'](a4_0x47fabb[_0x804c0c(0x123)]('\x20\x20Text\x20Knowledge\x20Base\x20\x22'+_0x1683da['name']+'\x22:\x20'+_0x1683da[_0x804c0c(0x131)]));}for(const _0x35a3e4 of _0x2de9f3['prompts']){_0x35a3e4[_0x804c0c(0x16d)]===_0x804c0c(0x131)&&console[_0x804c0c(0x134)](a4_0x47fabb[_0x804c0c(0x123)](_0x804c0c(0x11c)+_0x35a3e4[_0x804c0c(0x135)]+_0x804c0c(0x129)+_0x35a3e4[_0x804c0c(0x131)]));}for(const _0x228014 of _0x2de9f3[_0x804c0c(0xd8)]){_0x228014['action']===_0x804c0c(0x131)&&console[_0x804c0c(0x134)](a4_0x47fabb[_0x804c0c(0x123)](_0x804c0c(0xd6)+_0x228014[_0x804c0c(0x135)]+_0x804c0c(0x129)+_0x228014[_0x804c0c(0x131)]));}return 0x1;}console[_0x804c0c(0x134)](a4_0x47fabb['green'](_0x804c0c(0xf8)+(_0x1f225+_0x2b886d)+_0x804c0c(0x11f)+_0x2de9f3[_0x804c0c(0x10e)]+'\x27'));const _0x1d2834=getLLMProjectUrl(_0x467a31,_0x2de9f3[_0x804c0c(0xde)]);return console[_0x804c0c(0x134)]('Project:\x20'+a4_0x47fabb[_0x804c0c(0x14c)](_0x1d2834)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x4fcb2b=a5_0x4284;function a5_0x154a(){const _0x418159=['Round\x20','utf-8','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','projectDir','\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',':\x20Sending\x20user\x20input...','cyan','length','\x20\x20Round\x20','eval','includes','9CocdnL','\x22:\x20','\x20\x20Project:\x20','dryRun','reason','721026cBmkaN','description','forEach','Running:\x20','existsSync','Test\x20Summary','No\x20tests\x20have\x20tags\x20defined.','tags','No\x20tests\x20found\x20matching:\x20','\x20-\x20','Running\x20test:\x20','✗\x20ERROR:\x20','repeat','44031iFMlZn','split','conversations','add','ERROR','Re-evaluating\x20cached\x20test\x20run...','✓\x20PASS:\x20','Cached\x20run\x20from:\x20','3275570SSTtcq','Agent:\x20','llmProject','found','not\x20found','trim','⚠\x20SKIPPED:\x20','Available\x20tags:\x20','find','site','push','Run\x20tests\x20for\x20an\x20LLM\x20agent','no_tests','white','dim','has','message','...','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','toLowerCase','✗\x20ERROR:\x20Project\x20not\x20found:\x20','...\x20','text','Re-evaluating\x20','28dqRmRJ','tests','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','Errors:\x20\x20\x20','\x20\x20Conversation:\x20','Project\x20path:\x20','Error:\x20No\x20previous\x20test\x20run\x20found.','table','json','Test\x20','Error\x20writing\x20output\x20file:\x20','testName','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','FAIL','Output\x20written\x20to:\x20','Running\x20agent\x20tests...','basename','agent:test','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','now','146xgkSDY','Re-evaluating...','filter','verbose','1355iCOyQg','reeval','1152078pWUVXC','agentName','16359970ovRlSG','1005208AtHjWV','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','\x20\x20Agent:\x20','substring','green','rounds','tsv','resolve','✗\x20FAIL:\x20','\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)','Total:\x20\x20\x20\x20','Test\x20Configuration:','Passed:\x20\x20\x20','llm','toISOString','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','404','writeFileSync','multiple_agents','9380BoiBZl','size','output','/<agent-name>','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','jsonl','join','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','Failed:\x20\x20\x20','test.yml','log','Re-evaluation\x20Summary','\x20(cached)','some','resolveAgentId','Run\x20\x27tdx\x20agent\x20pull\x20','Cached\x20run\x20is\x20from\x20site\x20\x22','no_local_folder','red','start','timestamp','Failed\x20Tests:','map','conversation_url','testYmlPath','agent','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','name','resolveProjectId','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','projectName','No\x20tests\x20found\x20with\x20tags:\x20','executeReeval','PASS','stop','\x20\x20-\x20','New\x20tests\x20to\x20execute:\x20','Evaluating\x20response...','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','\x20\x20Evaluating...\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','yellow','Round\x201/','status'];a5_0x154a=function(){return _0x418159;};return a5_0x154a();}(function(_0x494b9b,_0x535b06){const _0x7e23a6=a5_0x4284,_0x43c3b1=_0x494b9b();while(!![]){try{const _0x26231e=-parseInt(_0x7e23a6(0x1a2))/0x1+parseInt(_0x7e23a6(0x14a))/0x2*(parseInt(_0x7e23a6(0x1af))/0x3)+-parseInt(_0x7e23a6(0x166))/0x4*(parseInt(_0x7e23a6(0x14e))/0x5)+-parseInt(_0x7e23a6(0x150))/0x6*(parseInt(_0x7e23a6(0x135))/0x7)+-parseInt(_0x7e23a6(0x153))/0x8*(parseInt(_0x7e23a6(0x19d))/0x9)+parseInt(_0x7e23a6(0x1b7))/0xa+parseInt(_0x7e23a6(0x152))/0xb;if(_0x26231e===_0x535b06)break;else _0x43c3b1['push'](_0x43c3b1['shift']());}catch(_0x6c1165){_0x43c3b1['push'](_0x43c3b1['shift']());}}}(a5_0x154a,0x9b478));import*as a5_0x14c1f9 from'node:fs';import*as a5_0x35db17 from'node:path';import a5_0x125331 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_0x4284(_0x366fd2,_0x22d49a){_0x366fd2=_0x366fd2-0x11e;const _0x154ab6=a5_0x154a();let _0x428416=_0x154ab6[_0x366fd2];return _0x428416;}import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x4fcb2b(0x181)]=a5_0x4fcb2b(0x146);[a5_0x4fcb2b(0x1a3)]=a5_0x4fcb2b(0x128);async['execute'](_0x13078f){const _0x32eea1=a5_0x4fcb2b,{options:_0x9764ba,args:_0x463728,tdx:_0x1e68b0}=_0x13078f,_0x5a9d06=_0x463728[0x0]||'.',_0x49ee83=_0x9764ba[_0x32eea1(0x1a0)],_0x25bc6f=_0x9764ba,_0x4f9c12=_0x25bc6f[_0x32eea1(0x19b)]===![],_0x59b7c9=_0x25bc6f[_0x32eea1(0x14f)],_0x30ee1e=_0x25bc6f[_0x32eea1(0x181)],_0x26c24d=_0x25bc6f[_0x32eea1(0x1a9)],_0x3aaac1=_0x9764ba[_0x32eea1(0x126)],_0x16d582=_0x25bc6f[_0x32eea1(0x168)];if(_0x59b7c9&&_0x4f9c12)return console[_0x32eea1(0x170)](a5_0x125331['red'](_0x32eea1(0x183))),0x1;let _0x28950d='table';if(_0x25bc6f[_0x32eea1(0x13d)])_0x28950d=_0x32eea1(0x13d);else{if(_0x25bc6f[_0x32eea1(0x16b)])_0x28950d=_0x32eea1(0x16b);else{if(_0x25bc6f[_0x32eea1(0x159)])_0x28950d='tsv';else{if(_0x25bc6f['table'])_0x28950d=_0x32eea1(0x13c);}}}const _0x2cc78c=_0x25bc6f[_0x32eea1(0x11f)];let _0x1ee18a=_0x5a9d06;const _0x51a116=a5_0x14c1f9[_0x32eea1(0x1a6)](_0x5a9d06),_0x2cae4e=_0x5a9d06==='.';if(!_0x51a116||_0x2cae4e){const _0x4d98b3=resolveProjectFromContext(_0x5a9d06,_0x2cc78c,{'requireFile':_0x32eea1(0x16f)});if(_0x4d98b3[_0x32eea1(0x120)])_0x1ee18a=_0x4d98b3[_0x32eea1(0x195)],_0x4d98b3['source']==='context'&&console[_0x32eea1(0x170)](a5_0x125331[_0x32eea1(0x12b)]('Using\x20agent:\x20'+_0x1ee18a));else switch(_0x4d98b3[_0x32eea1(0x1a1)]){case'no_context':console[_0x32eea1(0x170)](a5_0x125331['yellow'](_0x4d98b3[_0x32eea1(0x12d)])),console[_0x32eea1(0x170)](),console[_0x32eea1(0x170)]('Usage:'),console[_0x32eea1(0x170)](_0x32eea1(0x196)),console[_0x32eea1(0x170)](_0x32eea1(0x15c)),console[_0x32eea1(0x170)](),console['log'](_0x32eea1(0x147));return 0x1;case _0x32eea1(0x177):console[_0x32eea1(0x170)](a5_0x125331[_0x32eea1(0x18f)](_0x4d98b3[_0x32eea1(0x12d)])),console[_0x32eea1(0x170)](),console[_0x32eea1(0x170)](_0x32eea1(0x175)+_0x4d98b3[_0x32eea1(0x11f)]+_0x32eea1(0x18e));return 0x1;case _0x32eea1(0x165):{const _0x417446=a5_0x35db17[_0x32eea1(0x145)](_0x4d98b3[_0x32eea1(0x195)]);console[_0x32eea1(0x170)](a5_0x125331[_0x32eea1(0x18f)](_0x32eea1(0x180)+_0x4d98b3['llmProject']+'\x22:'));for(const _0x15d4cd of _0x4d98b3['agentDirs']){console[_0x32eea1(0x170)](_0x32eea1(0x189)+_0x15d4cd);}return console['log'](),console[_0x32eea1(0x170)]('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x417446+_0x32eea1(0x169)),0x1;}case _0x32eea1(0x129):console[_0x32eea1(0x170)](a5_0x125331[_0x32eea1(0x18f)](_0x32eea1(0x154)+_0x4d98b3['llmProject']+'\x22.')),console[_0x32eea1(0x170)](a5_0x125331['dim'](_0x32eea1(0x13a)+_0x4d98b3['projectDir'])),console[_0x32eea1(0x170)](),console[_0x32eea1(0x170)](_0x32eea1(0x141));return 0x1;}}const {definition:_0x2cddeb,agentInfo:_0x524aff}=parseTestFile(_0x1ee18a);let _0x3fe67d=_0x2cddeb[_0x32eea1(0x136)];if(_0x30ee1e){const _0x1a4308=_0x30ee1e[_0x32eea1(0x1b0)](',')[_0x32eea1(0x17c)](_0x561901=>_0x561901[_0x32eea1(0x122)]());_0x3fe67d=_0x2cddeb[_0x32eea1(0x136)][_0x32eea1(0x14c)](_0x1df107=>_0x1a4308[_0x32eea1(0x19c)](_0x1df107[_0x32eea1(0x181)]));if(_0x3fe67d[_0x32eea1(0x199)]===0x0)return console[_0x32eea1(0x170)](a5_0x125331[_0x32eea1(0x18f)](_0x32eea1(0x1aa)+_0x30ee1e)),console['log'](a5_0x125331[_0x32eea1(0x12b)]('Available\x20tests:\x20'+_0x2cddeb[_0x32eea1(0x136)]['map'](_0x172a38=>_0x172a38[_0x32eea1(0x181)])['join'](',\x20'))),0x1;}if(_0x26c24d){const _0x5f1e0e=_0x26c24d[_0x32eea1(0x1b0)](',')[_0x32eea1(0x17c)](_0xdd9915=>_0xdd9915[_0x32eea1(0x122)]()[_0x32eea1(0x130)]());_0x3fe67d=_0x3fe67d[_0x32eea1(0x14c)](_0x44bf58=>_0x44bf58[_0x32eea1(0x1a9)]?.[_0x32eea1(0x173)](_0x434b61=>_0x5f1e0e[_0x32eea1(0x19c)](_0x434b61[_0x32eea1(0x130)]())));if(_0x3fe67d[_0x32eea1(0x199)]===0x0){console[_0x32eea1(0x170)](a5_0x125331['yellow'](_0x32eea1(0x185)+_0x26c24d));const _0x528b7e=new Set();return _0x2cddeb[_0x32eea1(0x136)][_0x32eea1(0x1a4)](_0x5f2ac8=>_0x5f2ac8[_0x32eea1(0x1a9)]?.[_0x32eea1(0x1a4)](_0x2db72c=>_0x528b7e[_0x32eea1(0x1b2)](_0x2db72c))),_0x528b7e[_0x32eea1(0x167)]>0x0?console[_0x32eea1(0x170)](a5_0x125331[_0x32eea1(0x12b)](_0x32eea1(0x124)+[..._0x528b7e][_0x32eea1(0x16c)](',\x20'))):console[_0x32eea1(0x170)](a5_0x125331[_0x32eea1(0x12b)](_0x32eea1(0x1a8))),0x1;}}if(_0x59b7c9)return this[_0x32eea1(0x186)](_0x13078f,{'definition':{'tests':_0x3fe67d},'agentInfo':_0x524aff,'outputFormat':_0x28950d,'outputFile':_0x16d582,'testNames':_0x30ee1e});if(_0x49ee83){console[_0x32eea1(0x170)](a5_0x125331[_0x32eea1(0x198)](_0x32eea1(0x15e))),console[_0x32eea1(0x170)]('\x20\x20Site:\x20'+a5_0x125331[_0x32eea1(0x12a)](_0x3aaac1)),console['log'](_0x32eea1(0x19f)+a5_0x125331['white'](_0x524aff[_0x32eea1(0x184)])),console['log'](_0x32eea1(0x155)+a5_0x125331[_0x32eea1(0x12a)](_0x524aff[_0x32eea1(0x151)])),console['log'](),console[_0x32eea1(0x170)]('Tests\x20found:\x20'+a5_0x125331['white'](_0x3fe67d['length']));for(let _0x13713d=0x0;_0x13713d<_0x3fe67d[_0x32eea1(0x199)];_0x13713d++){const _0x5b3350=_0x3fe67d[_0x13713d],_0x23acfa=_0x5b3350[_0x32eea1(0x158)][_0x32eea1(0x199)]===0x1?'round':_0x32eea1(0x158),_0x26a4fd=_0x5b3350['tags']?.[_0x32eea1(0x199)]?'\x20['+_0x5b3350[_0x32eea1(0x1a9)]['join'](',\x20')+']':'';console[_0x32eea1(0x170)]('\x20\x20'+(_0x13713d+0x1)+'.\x20'+a5_0x125331['white'](_0x5b3350[_0x32eea1(0x181)])+'\x20('+_0x5b3350[_0x32eea1(0x158)][_0x32eea1(0x199)]+'\x20'+_0x23acfa+')'+a5_0x125331[_0x32eea1(0x12b)](_0x26a4fd));}return 0x0;}let _0x410c8b,_0x176c9e;try{_0x410c8b=await _0x1e68b0[_0x32eea1(0x160)][_0x32eea1(0x182)](_0x524aff[_0x32eea1(0x184)]);}catch(_0x510ef0){const _0x554db2=_0x510ef0 instanceof Error?_0x510ef0[_0x32eea1(0x12d)]:String(_0x510ef0);return _0x554db2['includes'](_0x32eea1(0x163))||_0x554db2['toLowerCase']()['includes'](_0x32eea1(0x121))?console[_0x32eea1(0x170)](a5_0x125331[_0x32eea1(0x178)](_0x32eea1(0x131)+_0x524aff[_0x32eea1(0x184)])):console[_0x32eea1(0x170)](a5_0x125331[_0x32eea1(0x178)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0x524aff[_0x32eea1(0x184)]+_0x32eea1(0x19e)+_0x554db2)),0x1;}try{_0x176c9e=await _0x1e68b0['llm'][_0x32eea1(0x174)](_0x524aff[_0x32eea1(0x151)],_0x410c8b);}catch(_0x1b29c0){const _0x256689=_0x1b29c0 instanceof Error?_0x1b29c0['message']:String(_0x1b29c0);return _0x256689[_0x32eea1(0x19c)](_0x32eea1(0x163))||_0x256689[_0x32eea1(0x130)]()[_0x32eea1(0x19c)](_0x32eea1(0x121))?console['log'](a5_0x125331[_0x32eea1(0x178)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x524aff['agentName'])):console['log'](a5_0x125331[_0x32eea1(0x178)](_0x32eea1(0x12f)+_0x524aff[_0x32eea1(0x151)]+_0x32eea1(0x19e)+_0x256689)),0x1;}let _0x5e98b0;if(!_0x4f9c12)try{_0x5e98b0=await setupEvaluatorAgent(_0x1e68b0[_0x32eea1(0x160)],_0x9764ba['verbose']);}catch(_0x43fc38){const _0x148981=_0x43fc38 instanceof Error?_0x43fc38[_0x32eea1(0x12d)]:String(_0x43fc38);return console['log'](a5_0x125331[_0x32eea1(0x178)](_0x32eea1(0x16d)+_0x148981)),0x1;}console['log'](a5_0x125331[_0x32eea1(0x198)](_0x32eea1(0x144))),console['log']('Site:\x20'+a5_0x125331['white'](_0x3aaac1)),console['log'](_0x32eea1(0x11e)+a5_0x125331[_0x32eea1(0x12a)](_0x524aff[_0x32eea1(0x184)]+'/'+_0x524aff[_0x32eea1(0x151)])),console['log']();const _0x4254b7=[],_0x2298b2=[],_0x230dff=Date[_0x32eea1(0x149)]();for(let _0x342c01=0x0;_0x342c01<_0x3fe67d[_0x32eea1(0x199)];_0x342c01++){const _0xf52039=_0x3fe67d[_0x342c01];_0x3fe67d[_0x32eea1(0x199)]>0x1?console[_0x32eea1(0x170)](_0x32eea1(0x13e)+(_0x342c01+0x1)+'/'+_0x3fe67d[_0x32eea1(0x199)]+':\x20'+a5_0x125331[_0x32eea1(0x12a)](_0xf52039['name'])):console[_0x32eea1(0x170)](_0x32eea1(0x1ac)+a5_0x125331[_0x32eea1(0x12a)](_0xf52039['name']));const _0x1083cf=createCommandSpinner(_0x32eea1(0x190)+_0xf52039['rounds'][_0x32eea1(0x199)]+_0x32eea1(0x197));_0x1083cf[_0x32eea1(0x179)]();try{const {result:_0x40ffb8,conversation:_0x36dfe2}=await runTest(_0x1e68b0[_0x32eea1(0x160)],_0xf52039,{'agentId':_0x176c9e,'projectId':_0x410c8b,'site':_0x3aaac1,'noEval':_0x4f9c12,'evaluatorId':_0x5e98b0,'onRoundStart':(_0x2f1057,_0x388431)=>{_0x1083cf['text']='Round\x20'+(_0x2f1057+0x1)+'/'+_0x388431+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x5abb65,_0x42072a,_0x524044)=>{const _0x3c41c4=_0x32eea1,_0x4c6573=formatElapsed(_0x42072a);_0x524044?console['log'](_0x3c41c4(0x19a)+(_0x5abb65+0x1)+'/'+_0xf52039[_0x3c41c4(0x158)][_0x3c41c4(0x199)]+_0x3c41c4(0x132)+a5_0x125331['green']('✓')+'\x20('+_0x4c6573+')'):console[_0x3c41c4(0x170)](_0x3c41c4(0x19a)+(_0x5abb65+0x1)+'/'+_0xf52039[_0x3c41c4(0x158)][_0x3c41c4(0x199)]+_0x3c41c4(0x132)+a5_0x125331[_0x3c41c4(0x178)]('✗'));},'onEvaluationStart':()=>{const _0x455e98=_0x32eea1;_0x1083cf[_0x455e98(0x133)]='Evaluating\x20response...';},'onEvaluationComplete':_0x4bb0f3=>{const _0xd48912=_0x32eea1,_0x307ddb=formatElapsed(_0x4bb0f3);console[_0xd48912(0x170)](_0xd48912(0x18d)+a5_0x125331[_0xd48912(0x157)]('✓')+'\x20('+_0x307ddb+')');}});_0x1083cf[_0x32eea1(0x188)](),_0x4254b7[_0x32eea1(0x127)](_0x40ffb8),_0x2298b2[_0x32eea1(0x127)](_0x36dfe2);if(_0x40ffb8[_0x32eea1(0x191)]==='PASS')console[_0x32eea1(0x170)](a5_0x125331[_0x32eea1(0x157)]('✓\x20PASS:\x20'+_0x40ffb8[_0x32eea1(0x1a1)]));else _0x40ffb8['status']===_0x32eea1(0x142)?console['log'](a5_0x125331['red'](_0x32eea1(0x15b)+_0x40ffb8['reason'])):console[_0x32eea1(0x170)](a5_0x125331['red']('✗\x20ERROR:\x20'+_0x40ffb8[_0x32eea1(0x1a1)]));_0x40ffb8[_0x32eea1(0x17d)]&&console['log'](a5_0x125331[_0x32eea1(0x12b)]('Conversation\x20URL:\x20'+_0x40ffb8[_0x32eea1(0x17d)])),console[_0x32eea1(0x170)]();}catch(_0x15ba3d){_0x1083cf['stop']();const _0x56dc00=_0x15ba3d instanceof Error?_0x15ba3d[_0x32eea1(0x12d)]:String(_0x15ba3d);console['log'](a5_0x125331['red'](_0x32eea1(0x1ad)+_0x56dc00)),console[_0x32eea1(0x170)](),_0x4254b7['push']({'name':_0xf52039[_0x32eea1(0x181)],'status':_0x32eea1(0x1b3),'reason':_0x56dc00,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x44043f=Date[_0x32eea1(0x149)]()-_0x230dff,_0x1a4b96=_0x4254b7[_0x32eea1(0x14c)](_0x1c4df7=>_0x1c4df7['status']===_0x32eea1(0x187))[_0x32eea1(0x199)],_0x546f9d=_0x4254b7[_0x32eea1(0x14c)](_0x82a5c8=>_0x82a5c8[_0x32eea1(0x191)]===_0x32eea1(0x142))['length'],_0x3179b2=_0x4254b7['filter'](_0x31903c=>_0x31903c[_0x32eea1(0x191)]===_0x32eea1(0x1b3))['length'];console[_0x32eea1(0x170)]('━'['repeat'](0x3c)),console[_0x32eea1(0x170)](_0x32eea1(0x1a7)),console[_0x32eea1(0x170)]('━'[_0x32eea1(0x1ae)](0x3c)),console[_0x32eea1(0x170)](_0x32eea1(0x15d)+_0x4254b7[_0x32eea1(0x199)]),console[_0x32eea1(0x170)](_0x32eea1(0x15f)+a5_0x125331['green'](_0x1a4b96)),console[_0x32eea1(0x170)](_0x32eea1(0x16e)+a5_0x125331[_0x32eea1(0x178)](_0x546f9d));_0x3179b2>0x0&&console[_0x32eea1(0x170)](_0x32eea1(0x138)+a5_0x125331[_0x32eea1(0x178)](_0x3179b2));console[_0x32eea1(0x170)]('Duration:\x20'+formatElapsed(_0x44043f)),console[_0x32eea1(0x170)]('━'['repeat'](0x3c));const _0x54324c=_0x4254b7['filter'](_0x34f99a=>_0x34f99a[_0x32eea1(0x191)]!==_0x32eea1(0x187));if(_0x54324c['length']>0x0){console[_0x32eea1(0x170)](),console[_0x32eea1(0x170)](_0x32eea1(0x17b));for(const _0x5f5632 of _0x54324c){const _0x5e7c57=a5_0x125331[_0x32eea1(0x178)]('✗'),_0x41fa08=_0x5f5632[_0x32eea1(0x1a1)][_0x32eea1(0x199)]>0x32?_0x5f5632['reason'][_0x32eea1(0x156)](0x0,0x32)+_0x32eea1(0x12e):_0x5f5632[_0x32eea1(0x1a1)];console['log']('\x20\x20'+_0x5e7c57+'\x20'+_0x5f5632['name']+':\x20'+_0x41fa08);}}const _0x3cef80={'summary':{'total':_0x4254b7[_0x32eea1(0x199)],'passed':_0x1a4b96,'failed':_0x546f9d,'errors':_0x3179b2>0x0?_0x3179b2:undefined,'duration_ms':_0x44043f},'tests':_0x4254b7,'agent':{'project':_0x524aff['projectName'],'name':_0x524aff[_0x32eea1(0x151)],'site':_0x3aaac1},'timestamp':new Date(_0x230dff)[_0x32eea1(0x161)]()};try{const _0x3fa6f2=buildCachedTestRun(_0x2298b2,{'site':_0x3aaac1,'projectId':_0x410c8b,'projectName':_0x524aff[_0x32eea1(0x184)],'agentId':_0x176c9e,'agentName':_0x524aff['agentName'],'testYmlPath':a5_0x35db17[_0x32eea1(0x15a)](_0x524aff[_0x32eea1(0x17e)])});saveLastTestRun(_0x3fa6f2);}catch{}if(_0x28950d!==_0x32eea1(0x13c)||_0x16d582){const _0x59cc75=formatResults(_0x3cef80,_0x28950d);if(_0x16d582)try{a5_0x14c1f9[_0x32eea1(0x164)](_0x16d582,_0x59cc75,_0x32eea1(0x193)),console[_0x32eea1(0x170)](),console[_0x32eea1(0x170)](a5_0x125331[_0x32eea1(0x12b)](_0x32eea1(0x143)+_0x16d582));}catch(_0x1432be){return console[_0x32eea1(0x170)](),console['log'](a5_0x125331[_0x32eea1(0x178)](_0x32eea1(0x13f)+_0x1432be)),0x1;}else console[_0x32eea1(0x170)](),console[_0x32eea1(0x170)](_0x59cc75);}return _0x54324c[_0x32eea1(0x199)]>0x0?0x1:0x0;}async['executeReeval'](_0x40b193,_0x35f4f4){const _0x239780=a5_0x4fcb2b,{options:_0xbcea5d,tdx:_0x3e99e5}=_0x40b193,{definition:_0x211be4,agentInfo:_0x1f9a32,outputFormat:_0x3602a4,outputFile:_0x51b1c9}=_0x35f4f4,_0x45e30a=_0xbcea5d[_0x239780(0x126)],_0xd91e99=loadLastTestRun();if(!_0xd91e99)return console['log'](a5_0x125331['red'](_0x239780(0x13b))),console[_0x239780(0x170)](a5_0x125331[_0x239780(0x12b)](_0x239780(0x194))),0x1;if(_0xd91e99[_0x239780(0x17f)]['agentName']!==_0x1f9a32[_0x239780(0x151)])return console[_0x239780(0x170)](a5_0x125331[_0x239780(0x178)](_0x239780(0x18c)+_0xd91e99[_0x239780(0x17f)][_0x239780(0x151)]+_0x239780(0x16a)+_0x1f9a32[_0x239780(0x151)]+'\x22.')),console[_0x239780(0x170)](a5_0x125331[_0x239780(0x12b)](_0x239780(0x162))),0x1;const _0xa65679=new Set(_0xd91e99[_0x239780(0x1b1)][_0x239780(0x17c)](_0x2d669d=>_0x2d669d[_0x239780(0x140)])),_0x41c28b=_0x211be4[_0x239780(0x136)]['filter'](_0x3c6bbc=>!_0xa65679['has'](_0x3c6bbc[_0x239780(0x181)]));if(_0x41c28b[_0x239780(0x199)]>0x0&&_0xd91e99[_0x239780(0x126)]!==_0x45e30a)return console['log'](a5_0x125331[_0x239780(0x178)](_0x239780(0x148))),console[_0x239780(0x170)](a5_0x125331['dim'](_0x239780(0x176)+_0xd91e99[_0x239780(0x126)]+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x45e30a+'\x22.')),console[_0x239780(0x170)](a5_0x125331[_0x239780(0x12b)]('Either\x20switch\x20to\x20the\x20\x22'+_0xd91e99[_0x239780(0x126)]+_0x239780(0x137))),0x1;const _0x353d3d=_0x211be4[_0x239780(0x136)][_0x239780(0x14c)](_0x50248b=>_0xa65679[_0x239780(0x12c)](_0x50248b['name'])),_0x2b8827=_0x41c28b;let _0x25da39;try{_0x25da39=await setupEvaluatorAgent(_0x3e99e5[_0x239780(0x160)],_0xbcea5d[_0x239780(0x14d)]);}catch(_0x1eb8b3){const _0x37edb8=_0x1eb8b3 instanceof Error?_0x1eb8b3[_0x239780(0x12d)]:String(_0x1eb8b3);return console[_0x239780(0x170)](a5_0x125331['red'](_0x239780(0x16d)+_0x37edb8)),0x1;}console[_0x239780(0x170)](a5_0x125331[_0x239780(0x198)](_0x239780(0x1b4))),console['log'](_0x239780(0x1b6)+a5_0x125331[_0x239780(0x12a)](_0xd91e99[_0x239780(0x17a)])),console['log']('Agent:\x20'+a5_0x125331[_0x239780(0x12a)](_0xd91e99[_0x239780(0x17f)][_0x239780(0x184)]+'/'+_0xd91e99['agent'][_0x239780(0x151)]));_0x2b8827['length']>0x0&&console[_0x239780(0x170)](_0x239780(0x18a)+a5_0x125331[_0x239780(0x18f)](_0x2b8827[_0x239780(0x199)]));console[_0x239780(0x170)]();const _0xb4f5ed=[],_0x189c70=Date[_0x239780(0x149)](),_0x37ed01=createCommandSpinner(_0x239780(0x14b));if(_0x353d3d[_0x239780(0x199)]>0x0)try{const _0x361ff3=await reevaluateFromCache(_0x3e99e5[_0x239780(0x160)],_0xd91e99,{'tests':_0x353d3d},{'evaluatorId':_0x25da39,'onTestStart':(_0x8cc935,_0x2ce983,_0x325308)=>{const _0x6b2983=_0x239780;_0x37ed01[_0x6b2983(0x133)]=_0x6b2983(0x134)+(_0x2ce983+0x1)+'/'+_0x325308+':\x20'+_0x8cc935+_0x6b2983(0x12e);if(!_0x37ed01['isSpinning'])_0x37ed01['start']();},'onTestComplete':(_0x56b3c1,_0x26ceba)=>{const _0x10c8c4=_0x239780;_0x37ed01[_0x10c8c4(0x188)]();if(_0x26ceba['status']==='PASS')console[_0x10c8c4(0x170)](a5_0x125331[_0x10c8c4(0x157)]('✓\x20PASS:\x20'+_0x56b3c1)+a5_0x125331[_0x10c8c4(0x12b)](_0x10c8c4(0x172)));else _0x26ceba[_0x10c8c4(0x191)]===_0x10c8c4(0x142)?console['log'](a5_0x125331[_0x10c8c4(0x178)](_0x10c8c4(0x15b)+_0x56b3c1+'\x20-\x20'+_0x26ceba[_0x10c8c4(0x1a1)])+a5_0x125331[_0x10c8c4(0x12b)](_0x10c8c4(0x172))):console[_0x10c8c4(0x170)](a5_0x125331[_0x10c8c4(0x178)]('✗\x20ERROR:\x20'+_0x56b3c1+_0x10c8c4(0x1ab)+_0x26ceba[_0x10c8c4(0x1a1)]));_0x26ceba[_0x10c8c4(0x17d)]&&console[_0x10c8c4(0x170)](a5_0x125331[_0x10c8c4(0x12b)](_0x10c8c4(0x139)+_0x26ceba[_0x10c8c4(0x17d)])),_0xb4f5ed[_0x10c8c4(0x127)](_0x26ceba);},'onTestSkipped':(_0x1600d7,_0x28c70d)=>{const _0x357e64=_0x239780;_0x37ed01[_0x357e64(0x188)](),console[_0x357e64(0x170)](a5_0x125331[_0x357e64(0x18f)](_0x357e64(0x123)+_0x1600d7+'\x20-\x20'+_0x28c70d));}});for(const _0x405d6f of _0x361ff3){!_0xb4f5ed[_0x239780(0x125)](_0x3b13d6=>_0x3b13d6[_0x239780(0x181)]===_0x405d6f['name'])&&_0xb4f5ed[_0x239780(0x127)](_0x405d6f);}}catch(_0x55cbf7){_0x37ed01['stop']();const _0x39b1ef=_0x55cbf7 instanceof Error?_0x55cbf7[_0x239780(0x12d)]:String(_0x55cbf7);return console['log'](a5_0x125331['red']('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0x39b1ef)),0x1;}_0x37ed01[_0x239780(0x188)]();if(_0x2b8827[_0x239780(0x199)]>0x0){console[_0x239780(0x170)](),console[_0x239780(0x170)](a5_0x125331[_0x239780(0x198)]('Executing\x20new\x20tests...'));const {projectId:_0x4d9cab,agentId:_0x491479}=_0xd91e99['agent'];for(const _0x3bc6e4 of _0x2b8827){console[_0x239780(0x170)](_0x239780(0x1a5)+a5_0x125331[_0x239780(0x12a)](_0x3bc6e4[_0x239780(0x181)]));const _0x1cfd0b=createCommandSpinner(_0x239780(0x190)+_0x3bc6e4[_0x239780(0x158)][_0x239780(0x199)]+':\x20Sending\x20user\x20input...');_0x1cfd0b[_0x239780(0x179)]();try{const {result:_0x56ec3c}=await runTest(_0x3e99e5[_0x239780(0x160)],_0x3bc6e4,{'agentId':_0x491479,'projectId':_0x4d9cab,'site':_0xd91e99[_0x239780(0x126)],'noEval':![],'evaluatorId':_0x25da39,'onRoundStart':(_0x4ada25,_0x1bf2e9)=>{const _0x52f0bc=_0x239780;_0x1cfd0b[_0x52f0bc(0x133)]=_0x52f0bc(0x192)+(_0x4ada25+0x1)+'/'+_0x1bf2e9+_0x52f0bc(0x197);},'onRoundComplete':(_0x3fc2bb,_0xb9128b,_0x1b78fd)=>{const _0x26afea=_0x239780,_0x47164d=formatElapsed(_0xb9128b);_0x1b78fd?console['log'](_0x26afea(0x19a)+(_0x3fc2bb+0x1)+'/'+_0x3bc6e4[_0x26afea(0x158)]['length']+_0x26afea(0x132)+a5_0x125331[_0x26afea(0x157)]('✓')+'\x20('+_0x47164d+')'):console[_0x26afea(0x170)](_0x26afea(0x19a)+(_0x3fc2bb+0x1)+'/'+_0x3bc6e4[_0x26afea(0x158)]['length']+_0x26afea(0x132)+a5_0x125331['red']('✗'));},'onEvaluationStart':()=>{const _0x1fd45c=_0x239780;_0x1cfd0b[_0x1fd45c(0x133)]=_0x1fd45c(0x18b);},'onEvaluationComplete':_0x2d33a7=>{const _0x10d5f9=_0x239780,_0x5c9136=formatElapsed(_0x2d33a7);console['log'](_0x10d5f9(0x18d)+a5_0x125331[_0x10d5f9(0x157)]('✓')+'\x20('+_0x5c9136+')');}});_0x1cfd0b[_0x239780(0x188)](),_0xb4f5ed['push'](_0x56ec3c);if(_0x56ec3c['status']===_0x239780(0x187))console['log'](a5_0x125331[_0x239780(0x157)](_0x239780(0x1b5)+_0x56ec3c[_0x239780(0x1a1)])+a5_0x125331[_0x239780(0x12b)]('\x20(new)'));else _0x56ec3c[_0x239780(0x191)]===_0x239780(0x142)?console['log'](a5_0x125331[_0x239780(0x178)](_0x239780(0x15b)+_0x56ec3c['reason'])+a5_0x125331[_0x239780(0x12b)]('\x20(new)')):console[_0x239780(0x170)](a5_0x125331[_0x239780(0x178)](_0x239780(0x1ad)+_0x56ec3c[_0x239780(0x1a1)]));_0x56ec3c[_0x239780(0x17d)]&&console['log'](a5_0x125331['dim'](_0x239780(0x139)+_0x56ec3c[_0x239780(0x17d)]));}catch(_0x2054bb){_0x1cfd0b[_0x239780(0x188)]();const _0xb15420=_0x2054bb instanceof Error?_0x2054bb[_0x239780(0x12d)]:String(_0x2054bb);console[_0x239780(0x170)](a5_0x125331[_0x239780(0x178)](_0x239780(0x1ad)+_0xb15420)),_0xb4f5ed[_0x239780(0x127)]({'name':_0x3bc6e4['name'],'status':_0x239780(0x1b3),'reason':_0xb15420,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console[_0x239780(0x170)]();const _0x577378=Date[_0x239780(0x149)]()-_0x189c70,_0x422d8c=_0xb4f5ed['filter'](_0x498760=>_0x498760[_0x239780(0x191)]===_0x239780(0x187))[_0x239780(0x199)],_0x3a436a=_0xb4f5ed[_0x239780(0x14c)](_0x1bb839=>_0x1bb839[_0x239780(0x191)]===_0x239780(0x142))[_0x239780(0x199)],_0x5e7ade=_0xb4f5ed['filter'](_0x548f53=>_0x548f53['status']==='ERROR')[_0x239780(0x199)];console[_0x239780(0x170)]('━'[_0x239780(0x1ae)](0x3c)),console[_0x239780(0x170)](_0x239780(0x171)),console['log']('━'['repeat'](0x3c)),console[_0x239780(0x170)]('Total:\x20\x20\x20\x20'+_0xb4f5ed[_0x239780(0x199)]),console['log'](_0x239780(0x15f)+a5_0x125331[_0x239780(0x157)](_0x422d8c)),console[_0x239780(0x170)]('Failed:\x20\x20\x20'+a5_0x125331[_0x239780(0x178)](_0x3a436a));_0x5e7ade>0x0&&console[_0x239780(0x170)](_0x239780(0x138)+a5_0x125331['red'](_0x5e7ade));console[_0x239780(0x170)]('Duration:\x20'+formatElapsed(_0x577378)),console[_0x239780(0x170)]('━'[_0x239780(0x1ae)](0x3c));const _0x3cbf1a={'summary':{'total':_0xb4f5ed[_0x239780(0x199)],'passed':_0x422d8c,'failed':_0x3a436a,'errors':_0x5e7ade>0x0?_0x5e7ade:undefined,'duration_ms':_0x577378},'tests':_0xb4f5ed,'agent':{'project':_0x1f9a32['projectName'],'name':_0x1f9a32[_0x239780(0x151)],'site':_0x45e30a},'timestamp':new Date(_0x189c70)[_0x239780(0x161)]()};if(_0x3602a4!=='table'||_0x51b1c9){const _0x2b6fac=formatResults(_0x3cbf1a,_0x3602a4);if(_0x51b1c9)try{a5_0x14c1f9[_0x239780(0x164)](_0x51b1c9,_0x2b6fac,_0x239780(0x193)),console[_0x239780(0x170)](),console['log'](a5_0x125331[_0x239780(0x12b)](_0x239780(0x143)+_0x51b1c9));}catch(_0x45c66c){return console[_0x239780(0x170)](),console[_0x239780(0x170)](a5_0x125331['red'](_0x239780(0x13f)+_0x45c66c)),0x1;}else console[_0x239780(0x170)](),console[_0x239780(0x170)](_0x2b6fac);}const _0xd1aba7=_0xb4f5ed[_0x239780(0x14c)](_0x31eb8d=>_0x31eb8d[_0x239780(0x191)]!==_0x239780(0x187));return _0xd1aba7[_0x239780(0x199)]>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0x270750=a5_0x1df3;function a5_0x38ea(){const _0x394d73=['Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','Failed:\x20\x20\x20','red','text','Project\x20path:\x20','10561944jvAMBu','4407020KTNDup','some','8UClOjY','timestamp','agentName','\x22:\x20','has','basename','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','...\x20','filter','\x20\x20Round\x20','reeval','Available\x20tags:\x20','\x20\x20Conversation:\x20','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','Cached\x20run\x20is\x20from\x20site\x20\x22','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','Passed:\x20\x20\x20','8194PnwlOY','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','Either\x20switch\x20to\x20the\x20\x22','cyan','testName','No\x20tests\x20have\x20tags\x20defined.','Test\x20Summary','size','\x20(new)','\x20-\x20','Re-evaluating...','No\x20tests\x20found\x20with\x20tags:\x20','dim','Cached\x20run\x20from:\x20','testYmlPath','✗\x20ERROR:\x20Project\x20not\x20found:\x20','status','llmProject','tags','Failed\x20Tests:','Re-evaluating\x20cached\x20test\x20run...','tests','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','table','Errors:\x20\x20\x20','found','✗\x20ERROR:\x20','agentDirs','resolveAgentId','Re-evaluation\x20Summary','llm','name','conversations','No\x20tests\x20found\x20matching:\x20','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','context','38871tPBrQb','7598885WnLApO','push','site','Conversation\x20URL:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','tsv','eval','resolve','52750819YPEnYu','\x22,\x20but\x20current\x20site\x20is\x20\x22','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','Running\x20test:\x20','start','conversation_url','substring','toLowerCase','json','Duration:\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','log','projectName','Round\x201/','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','message','description','map','5silJUD','\x20\x20-\x20','122XgOBHM','4380753CsuQax','round','resolveProjectId','executeReeval','utf-8','Site:\x20','verbose','Test\x20','Tests\x20found:\x20','reason','agent','⚠\x20SKIPPED:\x20','\x20\x20Agent:\x20','stop','length','split','jsonl','trim','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','existsSync','not\x20found','✓\x20PASS:\x20','✗\x20FAIL:\x20','multiple_agents','ERROR','includes','no_context','\x20\x20Site:\x20','...','Evaluating\x20response...','Usage:','join','white','find','Round\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','Output\x20written\x20to:\x20','writeFileSync','Agent:\x20','404',':\x20Sending\x20user\x20input...','rounds','repeat','Using\x20agent:\x20','370SoQZpb','Run\x20\x27tdx\x20agent\x20pull\x20','Re-evaluating\x20','FAIL','toISOString','Run\x20tests\x20for\x20an\x20LLM\x20agent','\x20\x20Evaluating...\x20','green','PASS','Error:\x20No\x20previous\x20test\x20run\x20found.','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','projectDir','now','forEach','output','\x20(cached)','Available\x20tests:\x20','no_tests','Executing\x20new\x20tests...','yellow'];a5_0x38ea=function(){return _0x394d73;};return a5_0x38ea();}(function(_0x10910f,_0x1ebf30){const _0x4a1167=a5_0x1df3,_0x120ed5=_0x10910f();while(!![]){try{const _0x470242=parseInt(_0x4a1167(0x128))/0x1*(parseInt(_0x4a1167(0x182))/0x2)+parseInt(_0x4a1167(0x129))/0x3+parseInt(_0x4a1167(0x16f))/0x4*(parseInt(_0x4a1167(0x126))/0x5)+parseInt(_0x4a1167(0x16e))/0x6+-parseInt(_0x4a1167(0x1a7))/0x7*(-parseInt(_0x4a1167(0x171))/0x8)+-parseInt(_0x4a1167(0x1a6))/0x9*(parseInt(_0x4a1167(0x155))/0xa)+-parseInt(_0x4a1167(0x1af))/0xb;if(_0x470242===_0x1ebf30)break;else _0x120ed5['push'](_0x120ed5['shift']());}catch(_0x3f57c7){_0x120ed5['push'](_0x120ed5['shift']());}}}(a5_0x38ea,0xe8843));import*as a5_0x33a289 from'node:fs';import*as a5_0x110d65 from'node:path';function a5_0x1df3(_0x2e6b9e,_0x39629f){_0x2e6b9e=_0x2e6b9e-0x117;const _0x38ea1e=a5_0x38ea();let _0x1df3be=_0x38ea1e[_0x2e6b9e];return _0x1df3be;}import a5_0x336d07 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x270750(0x1a1)]='agent:test';[a5_0x270750(0x124)]=a5_0x270750(0x15a);async['execute'](_0x216ab3){const _0x3c7845=a5_0x270750,{options:_0x5bd5c5,args:_0x5059cd,tdx:_0x3907c7}=_0x216ab3,_0x3b9b2b=_0x5059cd[0x0]||'.',_0x38a605=_0x5bd5c5['dryRun'],_0x156d94=_0x5bd5c5,_0x3ba03d=_0x156d94[_0x3c7845(0x1ad)]===![],_0x3edb99=_0x156d94[_0x3c7845(0x17b)],_0x2cf943=_0x156d94[_0x3c7845(0x1a1)],_0x20aff7=_0x156d94['tags'],_0x479e59=_0x5bd5c5[_0x3c7845(0x1a9)],_0x1a6d4e=_0x156d94[_0x3c7845(0x163)];if(_0x3edb99&&_0x3ba03d)return console[_0x3c7845(0x11f)](a5_0x336d07['red'](_0x3c7845(0x183))),0x1;let _0x45f71d=_0x3c7845(0x199);if(_0x156d94[_0x3c7845(0x11c)])_0x45f71d=_0x3c7845(0x11c);else{if(_0x156d94[_0x3c7845(0x139)])_0x45f71d='jsonl';else{if(_0x156d94[_0x3c7845(0x1ac)])_0x45f71d='tsv';else{if(_0x156d94['table'])_0x45f71d='table';}}}const _0x10a2af=_0x156d94[_0x3c7845(0x193)];let _0x449e16=_0x3b9b2b;const _0x7b1843=a5_0x33a289[_0x3c7845(0x13c)](_0x3b9b2b),_0x1f179d=_0x3b9b2b==='.';if(!_0x7b1843||_0x1f179d){const _0xe7e9c0=resolveProjectFromContext(_0x3b9b2b,_0x10a2af,{'requireFile':'test.yml'});if(_0xe7e9c0[_0x3c7845(0x19b)])_0x449e16=_0xe7e9c0['projectDir'],_0xe7e9c0['source']===_0x3c7845(0x1a5)&&console[_0x3c7845(0x11f)](a5_0x336d07[_0x3c7845(0x18e)](_0x3c7845(0x154)+_0x449e16));else switch(_0xe7e9c0[_0x3c7845(0x132)]){case _0x3c7845(0x143):console[_0x3c7845(0x11f)](a5_0x336d07['yellow'](_0xe7e9c0['message'])),console[_0x3c7845(0x11f)](),console[_0x3c7845(0x11f)](_0x3c7845(0x147)),console['log']('\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[_0x3c7845(0x11f)]('\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)'),console[_0x3c7845(0x11f)](),console[_0x3c7845(0x11f)]('Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>');return 0x1;case'no_local_folder':console[_0x3c7845(0x11f)](a5_0x336d07[_0x3c7845(0x168)](_0xe7e9c0['message'])),console[_0x3c7845(0x11f)](),console['log'](_0x3c7845(0x156)+_0xe7e9c0['llmProject']+_0x3c7845(0x14c));return 0x1;case _0x3c7845(0x140):{const _0x295028=a5_0x110d65[_0x3c7845(0x176)](_0xe7e9c0[_0x3c7845(0x160)]);console[_0x3c7845(0x11f)](a5_0x336d07[_0x3c7845(0x168)](_0x3c7845(0x180)+_0xe7e9c0[_0x3c7845(0x193)]+'\x22:'));for(const _0x38f3e4 of _0xe7e9c0[_0x3c7845(0x19d)]){console['log'](_0x3c7845(0x127)+_0x38f3e4);}return console[_0x3c7845(0x11f)](),console[_0x3c7845(0x11f)]('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x295028+'/<agent-name>'),0x1;}case _0x3c7845(0x166):console[_0x3c7845(0x11f)](a5_0x336d07[_0x3c7845(0x168)](_0x3c7845(0x1b1)+_0xe7e9c0[_0x3c7845(0x193)]+'\x22.')),console[_0x3c7845(0x11f)](a5_0x336d07[_0x3c7845(0x18e)](_0x3c7845(0x16d)+_0xe7e9c0['projectDir'])),console[_0x3c7845(0x11f)](),console[_0x3c7845(0x11f)](_0x3c7845(0x17e));return 0x1;}}const {definition:_0x383ce2,agentInfo:_0x497b80}=parseTestFile(_0x449e16);let _0x52bc37=_0x383ce2['tests'];if(_0x2cf943){const _0x317865=_0x2cf943['split'](',')[_0x3c7845(0x125)](_0x5ad587=>_0x5ad587[_0x3c7845(0x13a)]());_0x52bc37=_0x383ce2[_0x3c7845(0x197)][_0x3c7845(0x179)](_0x1a0fa7=>_0x317865[_0x3c7845(0x142)](_0x1a0fa7['name']));if(_0x52bc37['length']===0x0)return console[_0x3c7845(0x11f)](a5_0x336d07[_0x3c7845(0x168)](_0x3c7845(0x1a3)+_0x2cf943)),console[_0x3c7845(0x11f)](a5_0x336d07[_0x3c7845(0x18e)](_0x3c7845(0x165)+_0x383ce2[_0x3c7845(0x197)]['map'](_0x34c803=>_0x34c803[_0x3c7845(0x1a1)])['join'](',\x20'))),0x1;}if(_0x20aff7){const _0x183075=_0x20aff7[_0x3c7845(0x138)](',')[_0x3c7845(0x125)](_0x5c49e2=>_0x5c49e2[_0x3c7845(0x13a)]()[_0x3c7845(0x11b)]());_0x52bc37=_0x52bc37[_0x3c7845(0x179)](_0x5305fe=>_0x5305fe['tags']?.[_0x3c7845(0x170)](_0x4c600b=>_0x183075['includes'](_0x4c600b[_0x3c7845(0x11b)]())));if(_0x52bc37[_0x3c7845(0x137)]===0x0){console[_0x3c7845(0x11f)](a5_0x336d07['yellow'](_0x3c7845(0x18d)+_0x20aff7));const _0x2a1d2d=new Set();return _0x383ce2[_0x3c7845(0x197)][_0x3c7845(0x162)](_0x59fbd6=>_0x59fbd6[_0x3c7845(0x194)]?.[_0x3c7845(0x162)](_0xe4112e=>_0x2a1d2d['add'](_0xe4112e))),_0x2a1d2d[_0x3c7845(0x189)]>0x0?console[_0x3c7845(0x11f)](a5_0x336d07[_0x3c7845(0x18e)](_0x3c7845(0x17c)+[..._0x2a1d2d][_0x3c7845(0x148)](',\x20'))):console[_0x3c7845(0x11f)](a5_0x336d07['dim'](_0x3c7845(0x187))),0x1;}}if(_0x3edb99)return this[_0x3c7845(0x12c)](_0x216ab3,{'definition':{'tests':_0x52bc37},'agentInfo':_0x497b80,'outputFormat':_0x45f71d,'outputFile':_0x1a6d4e,'testNames':_0x2cf943});if(_0x38a605){console[_0x3c7845(0x11f)](a5_0x336d07[_0x3c7845(0x185)]('Test\x20Configuration:')),console[_0x3c7845(0x11f)](_0x3c7845(0x144)+a5_0x336d07[_0x3c7845(0x149)](_0x479e59)),console[_0x3c7845(0x11f)]('\x20\x20Project:\x20'+a5_0x336d07[_0x3c7845(0x149)](_0x497b80[_0x3c7845(0x120)])),console[_0x3c7845(0x11f)](_0x3c7845(0x135)+a5_0x336d07[_0x3c7845(0x149)](_0x497b80[_0x3c7845(0x173)])),console['log'](),console['log'](_0x3c7845(0x131)+a5_0x336d07[_0x3c7845(0x149)](_0x52bc37[_0x3c7845(0x137)]));for(let _0x190092=0x0;_0x190092<_0x52bc37[_0x3c7845(0x137)];_0x190092++){const _0x399b79=_0x52bc37[_0x190092],_0x4bca62=_0x399b79['rounds']['length']===0x1?_0x3c7845(0x12a):_0x3c7845(0x152),_0x55b16c=_0x399b79[_0x3c7845(0x194)]?.[_0x3c7845(0x137)]?'\x20['+_0x399b79['tags'][_0x3c7845(0x148)](',\x20')+']':'';console[_0x3c7845(0x11f)]('\x20\x20'+(_0x190092+0x1)+'.\x20'+a5_0x336d07[_0x3c7845(0x149)](_0x399b79[_0x3c7845(0x1a1)])+'\x20('+_0x399b79[_0x3c7845(0x152)][_0x3c7845(0x137)]+'\x20'+_0x4bca62+')'+a5_0x336d07['dim'](_0x55b16c));}return 0x0;}let _0x47d046,_0x332c13;try{_0x47d046=await _0x3907c7[_0x3c7845(0x1a0)][_0x3c7845(0x12b)](_0x497b80['projectName']);}catch(_0x10a4c0){const _0x19ce69=_0x10a4c0 instanceof Error?_0x10a4c0[_0x3c7845(0x123)]:String(_0x10a4c0);return _0x19ce69[_0x3c7845(0x142)](_0x3c7845(0x150))||_0x19ce69[_0x3c7845(0x11b)]()[_0x3c7845(0x142)]('not\x20found')?console[_0x3c7845(0x11f)](a5_0x336d07['red'](_0x3c7845(0x191)+_0x497b80[_0x3c7845(0x120)])):console[_0x3c7845(0x11f)](a5_0x336d07['red'](_0x3c7845(0x13b)+_0x497b80[_0x3c7845(0x120)]+_0x3c7845(0x174)+_0x19ce69)),0x1;}try{_0x332c13=await _0x3907c7['llm'][_0x3c7845(0x19e)](_0x497b80['agentName'],_0x47d046);}catch(_0x152624){const _0x30b2d6=_0x152624 instanceof Error?_0x152624[_0x3c7845(0x123)]:String(_0x152624);return _0x30b2d6[_0x3c7845(0x142)]('404')||_0x30b2d6[_0x3c7845(0x11b)]()['includes'](_0x3c7845(0x13d))?console[_0x3c7845(0x11f)](a5_0x336d07[_0x3c7845(0x16b)](_0x3c7845(0x1a4)+_0x497b80['agentName'])):console['log'](a5_0x336d07[_0x3c7845(0x16b)](_0x3c7845(0x1ab)+_0x497b80[_0x3c7845(0x173)]+_0x3c7845(0x174)+_0x30b2d6)),0x1;}let _0x18371b;if(!_0x3ba03d)try{_0x18371b=await setupEvaluatorAgent(_0x3907c7[_0x3c7845(0x1a0)],_0x5bd5c5[_0x3c7845(0x12f)]);}catch(_0x2454ac){const _0x2872b=_0x2454ac instanceof Error?_0x2454ac['message']:String(_0x2454ac);return console[_0x3c7845(0x11f)](a5_0x336d07[_0x3c7845(0x16b)](_0x3c7845(0x15f)+_0x2872b)),0x1;}console[_0x3c7845(0x11f)](a5_0x336d07[_0x3c7845(0x185)]('Running\x20agent\x20tests...')),console['log'](_0x3c7845(0x12e)+a5_0x336d07['white'](_0x479e59)),console['log'](_0x3c7845(0x14f)+a5_0x336d07[_0x3c7845(0x149)](_0x497b80[_0x3c7845(0x120)]+'/'+_0x497b80['agentName'])),console['log']();const _0xfff891=[],_0x2e3232=[],_0x284696=Date[_0x3c7845(0x161)]();for(let _0x36fe23=0x0;_0x36fe23<_0x52bc37['length'];_0x36fe23++){const _0x47d50f=_0x52bc37[_0x36fe23];_0x52bc37['length']>0x1?console[_0x3c7845(0x11f)](_0x3c7845(0x130)+(_0x36fe23+0x1)+'/'+_0x52bc37['length']+':\x20'+a5_0x336d07[_0x3c7845(0x149)](_0x47d50f[_0x3c7845(0x1a1)])):console['log'](_0x3c7845(0x117)+a5_0x336d07['white'](_0x47d50f[_0x3c7845(0x1a1)]));const _0x2c7cbf=createCommandSpinner(_0x3c7845(0x121)+_0x47d50f['rounds'][_0x3c7845(0x137)]+':\x20Sending\x20user\x20input...');_0x2c7cbf[_0x3c7845(0x118)]();try{const {result:_0x2359b1,conversation:_0x273ffe}=await runTest(_0x3907c7['llm'],_0x47d50f,{'agentId':_0x332c13,'projectId':_0x47d046,'site':_0x479e59,'noEval':_0x3ba03d,'evaluatorId':_0x18371b,'onRoundStart':(_0x37608c,_0x527288)=>{const _0x3b8c26=_0x3c7845;_0x2c7cbf['text']='Round\x20'+(_0x37608c+0x1)+'/'+_0x527288+_0x3b8c26(0x151);},'onRoundComplete':(_0x526449,_0x1418a0,_0xa2dee3)=>{const _0x2e5ad5=_0x3c7845,_0x18621d=formatElapsed(_0x1418a0);_0xa2dee3?console[_0x2e5ad5(0x11f)](_0x2e5ad5(0x17a)+(_0x526449+0x1)+'/'+_0x47d50f[_0x2e5ad5(0x152)][_0x2e5ad5(0x137)]+_0x2e5ad5(0x178)+a5_0x336d07[_0x2e5ad5(0x15c)]('✓')+'\x20('+_0x18621d+')'):console[_0x2e5ad5(0x11f)](_0x2e5ad5(0x17a)+(_0x526449+0x1)+'/'+_0x47d50f['rounds'][_0x2e5ad5(0x137)]+_0x2e5ad5(0x178)+a5_0x336d07['red']('✗'));},'onEvaluationStart':()=>{const _0x4d1599=_0x3c7845;_0x2c7cbf[_0x4d1599(0x16c)]=_0x4d1599(0x146);},'onEvaluationComplete':_0x3f03c4=>{const _0x70cc89=_0x3c7845,_0x560798=formatElapsed(_0x3f03c4);console[_0x70cc89(0x11f)](_0x70cc89(0x15b)+a5_0x336d07[_0x70cc89(0x15c)]('✓')+'\x20('+_0x560798+')');}});_0x2c7cbf[_0x3c7845(0x136)](),_0xfff891[_0x3c7845(0x1a8)](_0x2359b1),_0x2e3232[_0x3c7845(0x1a8)](_0x273ffe);if(_0x2359b1[_0x3c7845(0x192)]===_0x3c7845(0x15d))console[_0x3c7845(0x11f)](a5_0x336d07[_0x3c7845(0x15c)]('✓\x20PASS:\x20'+_0x2359b1[_0x3c7845(0x132)]));else _0x2359b1['status']==='FAIL'?console[_0x3c7845(0x11f)](a5_0x336d07[_0x3c7845(0x16b)]('✗\x20FAIL:\x20'+_0x2359b1['reason'])):console[_0x3c7845(0x11f)](a5_0x336d07[_0x3c7845(0x16b)](_0x3c7845(0x19c)+_0x2359b1['reason']));_0x2359b1[_0x3c7845(0x119)]&&console[_0x3c7845(0x11f)](a5_0x336d07['dim'](_0x3c7845(0x1aa)+_0x2359b1['conversation_url'])),console[_0x3c7845(0x11f)]();}catch(_0x55b074){_0x2c7cbf['stop']();const _0x4bba57=_0x55b074 instanceof Error?_0x55b074[_0x3c7845(0x123)]:String(_0x55b074);console['log'](a5_0x336d07[_0x3c7845(0x16b)](_0x3c7845(0x19c)+_0x4bba57)),console['log'](),_0xfff891[_0x3c7845(0x1a8)]({'name':_0x47d50f['name'],'status':_0x3c7845(0x141),'reason':_0x4bba57,'timestamp':new Date()[_0x3c7845(0x159)](),'duration_ms':0x0});}}const _0xe48c5d=Date[_0x3c7845(0x161)]()-_0x284696,_0x244627=_0xfff891[_0x3c7845(0x179)](_0x462774=>_0x462774['status']===_0x3c7845(0x15d))['length'],_0x5654fb=_0xfff891[_0x3c7845(0x179)](_0x5d0bc9=>_0x5d0bc9[_0x3c7845(0x192)]==='FAIL')[_0x3c7845(0x137)],_0x4e57f2=_0xfff891[_0x3c7845(0x179)](_0x6b18ce=>_0x6b18ce[_0x3c7845(0x192)]===_0x3c7845(0x141))['length'];console['log']('━'['repeat'](0x3c)),console[_0x3c7845(0x11f)](_0x3c7845(0x188)),console[_0x3c7845(0x11f)]('━'[_0x3c7845(0x153)](0x3c)),console['log']('Total:\x20\x20\x20\x20'+_0xfff891['length']),console[_0x3c7845(0x11f)](_0x3c7845(0x181)+a5_0x336d07['green'](_0x244627)),console[_0x3c7845(0x11f)]('Failed:\x20\x20\x20'+a5_0x336d07[_0x3c7845(0x16b)](_0x5654fb));_0x4e57f2>0x0&&console[_0x3c7845(0x11f)](_0x3c7845(0x19a)+a5_0x336d07[_0x3c7845(0x16b)](_0x4e57f2));console['log']('Duration:\x20'+formatElapsed(_0xe48c5d)),console[_0x3c7845(0x11f)]('━'['repeat'](0x3c));const _0x3ef547=_0xfff891[_0x3c7845(0x179)](_0x11b628=>_0x11b628['status']!==_0x3c7845(0x15d));if(_0x3ef547[_0x3c7845(0x137)]>0x0){console[_0x3c7845(0x11f)](),console['log'](_0x3c7845(0x195));for(const _0x3473b4 of _0x3ef547){const _0x3ed456=a5_0x336d07['red']('✗'),_0x2aff99=_0x3473b4[_0x3c7845(0x132)]['length']>0x32?_0x3473b4[_0x3c7845(0x132)][_0x3c7845(0x11a)](0x0,0x32)+_0x3c7845(0x145):_0x3473b4[_0x3c7845(0x132)];console[_0x3c7845(0x11f)]('\x20\x20'+_0x3ed456+'\x20'+_0x3473b4[_0x3c7845(0x1a1)]+':\x20'+_0x2aff99);}}const _0x3e4753={'summary':{'total':_0xfff891['length'],'passed':_0x244627,'failed':_0x5654fb,'errors':_0x4e57f2>0x0?_0x4e57f2:undefined,'duration_ms':_0xe48c5d},'tests':_0xfff891,'agent':{'project':_0x497b80[_0x3c7845(0x120)],'name':_0x497b80[_0x3c7845(0x173)],'site':_0x479e59},'timestamp':new Date(_0x284696)['toISOString']()};try{const _0x250632=buildCachedTestRun(_0x2e3232,{'site':_0x479e59,'projectId':_0x47d046,'projectName':_0x497b80['projectName'],'agentId':_0x332c13,'agentName':_0x497b80[_0x3c7845(0x173)],'testYmlPath':a5_0x110d65[_0x3c7845(0x1ae)](_0x497b80[_0x3c7845(0x190)])});saveLastTestRun(_0x250632);}catch{}if(_0x45f71d!==_0x3c7845(0x199)||_0x1a6d4e){const _0x5edde9=formatResults(_0x3e4753,_0x45f71d);if(_0x1a6d4e)try{a5_0x33a289[_0x3c7845(0x14e)](_0x1a6d4e,_0x5edde9,_0x3c7845(0x12d)),console[_0x3c7845(0x11f)](),console[_0x3c7845(0x11f)](a5_0x336d07['dim']('Output\x20written\x20to:\x20'+_0x1a6d4e));}catch(_0x2beb26){return console['log'](),console['log'](a5_0x336d07[_0x3c7845(0x16b)]('Error\x20writing\x20output\x20file:\x20'+_0x2beb26)),0x1;}else console[_0x3c7845(0x11f)](),console[_0x3c7845(0x11f)](_0x5edde9);}return _0x3ef547[_0x3c7845(0x137)]>0x0?0x1:0x0;}async[a5_0x270750(0x12c)](_0x57e2e2,_0x23572c){const _0x568249=a5_0x270750,{options:_0x53ff57,tdx:_0x226041}=_0x57e2e2,{definition:_0x3555b8,agentInfo:_0x5a75e1,outputFormat:_0x45fa99,outputFile:_0x5c8d74}=_0x23572c,_0x5cc146=_0x53ff57['site'],_0x39755a=loadLastTestRun();if(!_0x39755a)return console[_0x568249(0x11f)](a5_0x336d07[_0x568249(0x16b)](_0x568249(0x15e))),console['log'](a5_0x336d07['dim'](_0x568249(0x11e))),0x1;if(_0x39755a[_0x568249(0x133)][_0x568249(0x173)]!==_0x5a75e1['agentName'])return console['log'](a5_0x336d07['red']('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x39755a[_0x568249(0x133)][_0x568249(0x173)]+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x5a75e1[_0x568249(0x173)]+'\x22.')),console['log'](a5_0x336d07[_0x568249(0x18e)](_0x568249(0x177))),0x1;const _0x52eb88=new Set(_0x39755a[_0x568249(0x1a2)]['map'](_0x2ef27e=>_0x2ef27e[_0x568249(0x186)])),_0xcbc949=_0x3555b8[_0x568249(0x197)][_0x568249(0x179)](_0x4ca894=>!_0x52eb88['has'](_0x4ca894[_0x568249(0x1a1)]));if(_0xcbc949[_0x568249(0x137)]>0x0&&_0x39755a[_0x568249(0x1a9)]!==_0x5cc146)return console[_0x568249(0x11f)](a5_0x336d07[_0x568249(0x16b)](_0x568249(0x169))),console[_0x568249(0x11f)](a5_0x336d07[_0x568249(0x18e)](_0x568249(0x17f)+_0x39755a['site']+_0x568249(0x1b0)+_0x5cc146+'\x22.')),console[_0x568249(0x11f)](a5_0x336d07[_0x568249(0x18e)](_0x568249(0x184)+_0x39755a['site']+_0x568249(0x122))),0x1;const _0x14f3d1=_0x3555b8[_0x568249(0x197)][_0x568249(0x179)](_0x10a1ab=>_0x52eb88[_0x568249(0x175)](_0x10a1ab[_0x568249(0x1a1)])),_0x373808=_0xcbc949;let _0x303281;try{_0x303281=await setupEvaluatorAgent(_0x226041['llm'],_0x53ff57[_0x568249(0x12f)]);}catch(_0x54094c){const _0x593ad8=_0x54094c instanceof Error?_0x54094c[_0x568249(0x123)]:String(_0x54094c);return console[_0x568249(0x11f)](a5_0x336d07['red'](_0x568249(0x15f)+_0x593ad8)),0x1;}console[_0x568249(0x11f)](a5_0x336d07['cyan'](_0x568249(0x196))),console['log'](_0x568249(0x18f)+a5_0x336d07['white'](_0x39755a[_0x568249(0x172)])),console['log'](_0x568249(0x14f)+a5_0x336d07['white'](_0x39755a[_0x568249(0x133)]['projectName']+'/'+_0x39755a['agent']['agentName']));_0x373808[_0x568249(0x137)]>0x0&&console['log']('New\x20tests\x20to\x20execute:\x20'+a5_0x336d07[_0x568249(0x168)](_0x373808[_0x568249(0x137)]));console[_0x568249(0x11f)]();const _0x20e2c9=[],_0xcc7ca4=Date['now'](),_0x301c03=createCommandSpinner(_0x568249(0x18c));if(_0x14f3d1['length']>0x0)try{const _0x3943dd=await reevaluateFromCache(_0x226041[_0x568249(0x1a0)],_0x39755a,{'tests':_0x14f3d1},{'evaluatorId':_0x303281,'onTestStart':(_0x2f8b9c,_0x59b1ce,_0x3a7c26)=>{const _0x55e2b6=_0x568249;_0x301c03['text']=_0x55e2b6(0x157)+(_0x59b1ce+0x1)+'/'+_0x3a7c26+':\x20'+_0x2f8b9c+_0x55e2b6(0x145);if(!_0x301c03['isSpinning'])_0x301c03[_0x55e2b6(0x118)]();},'onTestComplete':(_0x5f1078,_0x3ade71)=>{const _0x24881e=_0x568249;_0x301c03[_0x24881e(0x136)]();if(_0x3ade71['status']===_0x24881e(0x15d))console[_0x24881e(0x11f)](a5_0x336d07['green'](_0x24881e(0x13e)+_0x5f1078)+a5_0x336d07['dim']('\x20(cached)'));else _0x3ade71[_0x24881e(0x192)]===_0x24881e(0x158)?console[_0x24881e(0x11f)](a5_0x336d07[_0x24881e(0x16b)](_0x24881e(0x13f)+_0x5f1078+'\x20-\x20'+_0x3ade71['reason'])+a5_0x336d07[_0x24881e(0x18e)](_0x24881e(0x164))):console[_0x24881e(0x11f)](a5_0x336d07[_0x24881e(0x16b)](_0x24881e(0x19c)+_0x5f1078+_0x24881e(0x18b)+_0x3ade71[_0x24881e(0x132)]));_0x3ade71[_0x24881e(0x119)]&&console[_0x24881e(0x11f)](a5_0x336d07[_0x24881e(0x18e)](_0x24881e(0x17d)+_0x3ade71[_0x24881e(0x119)])),_0x20e2c9['push'](_0x3ade71);},'onTestSkipped':(_0x3b5006,_0x4cf239)=>{const _0x13d85e=_0x568249;_0x301c03[_0x13d85e(0x136)](),console['log'](a5_0x336d07[_0x13d85e(0x168)](_0x13d85e(0x134)+_0x3b5006+_0x13d85e(0x18b)+_0x4cf239));}});for(const _0x441cdf of _0x3943dd){!_0x20e2c9[_0x568249(0x14a)](_0x4dcc20=>_0x4dcc20[_0x568249(0x1a1)]===_0x441cdf[_0x568249(0x1a1)])&&_0x20e2c9[_0x568249(0x1a8)](_0x441cdf);}}catch(_0x1d1e63){_0x301c03[_0x568249(0x136)]();const _0x11d7a1=_0x1d1e63 instanceof Error?_0x1d1e63[_0x568249(0x123)]:String(_0x1d1e63);return console[_0x568249(0x11f)](a5_0x336d07['red'](_0x568249(0x198)+_0x11d7a1)),0x1;}_0x301c03['stop']();if(_0x373808[_0x568249(0x137)]>0x0){console[_0x568249(0x11f)](),console[_0x568249(0x11f)](a5_0x336d07[_0x568249(0x185)](_0x568249(0x167)));const {projectId:_0x84fd9,agentId:_0x55ee25}=_0x39755a[_0x568249(0x133)];for(const _0x587312 of _0x373808){console['log']('Running:\x20'+a5_0x336d07[_0x568249(0x149)](_0x587312[_0x568249(0x1a1)]));const _0xacd306=createCommandSpinner(_0x568249(0x121)+_0x587312[_0x568249(0x152)][_0x568249(0x137)]+_0x568249(0x151));_0xacd306[_0x568249(0x118)]();try{const {result:_0x21a4c6}=await runTest(_0x226041['llm'],_0x587312,{'agentId':_0x55ee25,'projectId':_0x84fd9,'site':_0x39755a[_0x568249(0x1a9)],'noEval':![],'evaluatorId':_0x303281,'onRoundStart':(_0x340912,_0x5ab91c)=>{const _0x5d4c3c=_0x568249;_0xacd306[_0x5d4c3c(0x16c)]=_0x5d4c3c(0x14b)+(_0x340912+0x1)+'/'+_0x5ab91c+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x3d5d85,_0x3003cf,_0x5bf98c)=>{const _0x2263a5=_0x568249,_0x4bcf82=formatElapsed(_0x3003cf);_0x5bf98c?console[_0x2263a5(0x11f)](_0x2263a5(0x17a)+(_0x3d5d85+0x1)+'/'+_0x587312[_0x2263a5(0x152)][_0x2263a5(0x137)]+_0x2263a5(0x178)+a5_0x336d07[_0x2263a5(0x15c)]('✓')+'\x20('+_0x4bcf82+')'):console[_0x2263a5(0x11f)](_0x2263a5(0x17a)+(_0x3d5d85+0x1)+'/'+_0x587312['rounds'][_0x2263a5(0x137)]+'...\x20'+a5_0x336d07[_0x2263a5(0x16b)]('✗'));},'onEvaluationStart':()=>{const _0x281e08=_0x568249;_0xacd306[_0x281e08(0x16c)]='Evaluating\x20response...';},'onEvaluationComplete':_0x120b66=>{const _0x5dcef4=_0x568249,_0x3aeec7=formatElapsed(_0x120b66);console['log'](_0x5dcef4(0x15b)+a5_0x336d07[_0x5dcef4(0x15c)]('✓')+'\x20('+_0x3aeec7+')');}});_0xacd306[_0x568249(0x136)](),_0x20e2c9[_0x568249(0x1a8)](_0x21a4c6);if(_0x21a4c6[_0x568249(0x192)]===_0x568249(0x15d))console[_0x568249(0x11f)](a5_0x336d07[_0x568249(0x15c)](_0x568249(0x13e)+_0x21a4c6[_0x568249(0x132)])+a5_0x336d07[_0x568249(0x18e)](_0x568249(0x18a)));else _0x21a4c6[_0x568249(0x192)]==='FAIL'?console[_0x568249(0x11f)](a5_0x336d07['red'](_0x568249(0x13f)+_0x21a4c6['reason'])+a5_0x336d07[_0x568249(0x18e)](_0x568249(0x18a))):console[_0x568249(0x11f)](a5_0x336d07[_0x568249(0x16b)](_0x568249(0x19c)+_0x21a4c6[_0x568249(0x132)]));_0x21a4c6[_0x568249(0x119)]&&console[_0x568249(0x11f)](a5_0x336d07['dim'](_0x568249(0x17d)+_0x21a4c6['conversation_url']));}catch(_0x22313a){_0xacd306[_0x568249(0x136)]();const _0x4412c3=_0x22313a instanceof Error?_0x22313a[_0x568249(0x123)]:String(_0x22313a);console['log'](a5_0x336d07[_0x568249(0x16b)](_0x568249(0x19c)+_0x4412c3)),_0x20e2c9[_0x568249(0x1a8)]({'name':_0x587312[_0x568249(0x1a1)],'status':_0x568249(0x141),'reason':_0x4412c3,'timestamp':new Date()[_0x568249(0x159)](),'duration_ms':0x0});}}}console[_0x568249(0x11f)]();const _0x529212=Date[_0x568249(0x161)]()-_0xcc7ca4,_0x273585=_0x20e2c9[_0x568249(0x179)](_0x11a454=>_0x11a454[_0x568249(0x192)]===_0x568249(0x15d))[_0x568249(0x137)],_0xb227d9=_0x20e2c9[_0x568249(0x179)](_0xb91397=>_0xb91397['status']==='FAIL')[_0x568249(0x137)],_0x45d1d8=_0x20e2c9[_0x568249(0x179)](_0x148269=>_0x148269[_0x568249(0x192)]===_0x568249(0x141))['length'];console[_0x568249(0x11f)]('━'['repeat'](0x3c)),console['log'](_0x568249(0x19f)),console[_0x568249(0x11f)]('━'[_0x568249(0x153)](0x3c)),console[_0x568249(0x11f)]('Total:\x20\x20\x20\x20'+_0x20e2c9['length']),console[_0x568249(0x11f)](_0x568249(0x181)+a5_0x336d07[_0x568249(0x15c)](_0x273585)),console[_0x568249(0x11f)](_0x568249(0x16a)+a5_0x336d07[_0x568249(0x16b)](_0xb227d9));_0x45d1d8>0x0&&console[_0x568249(0x11f)]('Errors:\x20\x20\x20'+a5_0x336d07[_0x568249(0x16b)](_0x45d1d8));console['log'](_0x568249(0x11d)+formatElapsed(_0x529212)),console[_0x568249(0x11f)]('━'[_0x568249(0x153)](0x3c));const _0x567388={'summary':{'total':_0x20e2c9[_0x568249(0x137)],'passed':_0x273585,'failed':_0xb227d9,'errors':_0x45d1d8>0x0?_0x45d1d8:undefined,'duration_ms':_0x529212},'tests':_0x20e2c9,'agent':{'project':_0x5a75e1[_0x568249(0x120)],'name':_0x5a75e1[_0x568249(0x173)],'site':_0x5cc146},'timestamp':new Date(_0xcc7ca4)[_0x568249(0x159)]()};if(_0x45fa99!=='table'||_0x5c8d74){const _0x11bc01=formatResults(_0x567388,_0x45fa99);if(_0x5c8d74)try{a5_0x33a289[_0x568249(0x14e)](_0x5c8d74,_0x11bc01,_0x568249(0x12d)),console[_0x568249(0x11f)](),console[_0x568249(0x11f)](a5_0x336d07[_0x568249(0x18e)](_0x568249(0x14d)+_0x5c8d74));}catch(_0x566dad){return console[_0x568249(0x11f)](),console['log'](a5_0x336d07[_0x568249(0x16b)]('Error\x20writing\x20output\x20file:\x20'+_0x566dad)),0x1;}else console[_0x568249(0x11f)](),console[_0x568249(0x11f)](_0x11bc01);}const _0x3cc9ef=_0x20e2c9[_0x568249(0x179)](_0x1a30ab=>_0x1a30ab['status']!==_0x568249(0x15d));return _0x3cc9ef[_0x568249(0x137)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x3e8d05=a6_0x25b2;(function(_0xacf677,_0x36dc37){const _0x5f5733=a6_0x25b2,_0x9e983c=_0xacf677();while(!![]){try{const _0x4dea83=-parseInt(_0x5f5733(0x1c8))/0x1+parseInt(_0x5f5733(0x1d9))/0x2+parseInt(_0x5f5733(0x1c5))/0x3*(parseInt(_0x5f5733(0x1d0))/0x4)+-parseInt(_0x5f5733(0x1bf))/0x5*(parseInt(_0x5f5733(0x1a2))/0x6)+parseInt(_0x5f5733(0x1b8))/0x7*(-parseInt(_0x5f5733(0x1cf))/0x8)+parseInt(_0x5f5733(0x1dc))/0x9+parseInt(_0x5f5733(0x1c3))/0xa;if(_0x4dea83===_0x36dc37)break;else _0x9e983c['push'](_0x9e983c['shift']());}catch(_0x16ac58){_0x9e983c['push'](_0x9e983c['shift']());}}}(a6_0x5879,0xc0976));import{BaseCommand}from'./command.js';function a6_0x5879(){const _0x19edfa=['3751050BiaiiZ','x-trino-user','api','keys','POST','startsWith','trim','llm','site','cdp','length','message','Invalid\x20API\x20type:\x20','has','output','GET','entries','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','description','llm-proxy','.\x20Valid\x20methods:\x20','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','3820040DAnggk','\x0aStack\x20trace:\x0a','error','log','DELETE','execute','proxy-authorization','5TRKYSd','stack','body','PATCH','9034160tUaLcG','Error:\x20','570642OgsYam','data','method','817083OTHiRa','trino','join','type','verbose','authorization','color','8wlePag','8HTAhni','isArray','toUpperCase','indexOf','headers','Invalid\x20header\x20format:\x20\x22','substring','status','.\x20Valid\x20types:\x20','556496geXGkP','workflow','Invalid\x20HTTP\x20method:\x20','10932660fvoLZV','x-xsrf-token','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','readBodyFromFile','file','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','x-auth-token','includes','request','PUT'];a6_0x5879=function(){return _0x19edfa;};return a6_0x5879();}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';function a6_0x25b2(_0x58e14d,_0x29baeb){_0x58e14d=_0x58e14d-0x19a;const _0x5879b2=a6_0x5879();let _0x25b20e=_0x5879b2[_0x58e14d];return _0x25b20e;}const SENSITIVE_HEADERS=new Set([a6_0x3e8d05(0x1cd),a6_0x3e8d05(0x1be),'cookie','set-cookie','set-cookie2',a6_0x3e8d05(0x1dd),a6_0x3e8d05(0x19e),a6_0x3e8d05(0x1a3)]);function isSensitiveHeader(_0x24d5a8){const _0x5c7ba6=a6_0x3e8d05;return SENSITIVE_HEADERS[_0x5c7ba6(0x1af)](_0x24d5a8['toLowerCase']());}function parseHeader(_0x564fd4){const _0x447bed=a6_0x3e8d05,_0x18b7a0=_0x564fd4[_0x447bed(0x1d3)](':');if(_0x18b7a0===-0x1)throw new Error(_0x447bed(0x1d5)+_0x564fd4+'\x22.\x20'+_0x447bed(0x19d));const _0x57eca8=_0x564fd4['substring'](0x0,_0x18b7a0)[_0x447bed(0x1a8)](),_0x103b4b=_0x564fd4[_0x447bed(0x1d6)](_0x18b7a0+0x1)[_0x447bed(0x1a8)]();if(!_0x57eca8)throw new Error(_0x447bed(0x1b3)+_0x564fd4+'\x22');return[_0x57eca8,_0x103b4b];}export class ApiCommand extends BaseCommand{['name']=a6_0x3e8d05(0x1a4);[a6_0x3e8d05(0x1b4)]='Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs';['validate'](_0x124c2d){const _0x27b890=a6_0x3e8d05,{args:_0x5953b3,options:_0x422271}=_0x124c2d,_0x3e0840=_0x422271;if(_0x5953b3[_0x27b890(0x1ac)]===0x0)return _0x27b890(0x1b7);const _0x259d68=_0x5953b3[0x0];if(!_0x259d68[_0x27b890(0x1a7)]('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x259d68;const _0xb0736d=_0x3e0840[_0x27b890(0x1c6)],_0x1a4143=_0x3e0840[_0x27b890(0x19c)];if(_0xb0736d&&_0x1a4143)return _0x27b890(0x19a);const _0x3d61a4=_0x3e0840[_0x27b890(0x1c7)]||_0x27b890(0x1b1),_0x2a3391=[_0x27b890(0x1b1),_0x27b890(0x1a6),_0x27b890(0x1a1),_0x27b890(0x1bc),_0x27b890(0x1c2)];if(!_0x2a3391['includes'](_0x3d61a4['toUpperCase']()))return _0x27b890(0x1db)+_0x3d61a4+_0x27b890(0x1b6)+_0x2a3391[_0x27b890(0x1ca)](',\x20');const _0xb35863=_0x3e0840[_0x27b890(0x1cb)]||'td',_0x30d797=['td',_0x27b890(0x1ab),_0x27b890(0x1da),_0x27b890(0x1c9),_0x27b890(0x1a9),_0x27b890(0x1b5)];if(!_0x30d797[_0x27b890(0x19f)](_0xb35863))return _0x27b890(0x1ae)+_0xb35863+_0x27b890(0x1d8)+_0x30d797[_0x27b890(0x1ca)](',\x20');return undefined;}async[a6_0x3e8d05(0x1bd)](_0x48da36){const _0x17f427=a6_0x3e8d05,{options:_0x2adb63,args:_0x2046c9,tdx:_0x51168a}=_0x48da36,_0x3a677b=_0x2adb63,_0x10ccb8=_0x2046c9[0x0],_0x3744a4=(_0x3a677b['method']||'GET')[_0x17f427(0x1d2)](),_0x109419=_0x3a677b[_0x17f427(0x1c6)],_0x3a4b9f=_0x3a677b['file'],_0x36bcc5=_0x3a677b['header'],_0x273298=_0x3a677b['type']||'td';try{const _0x2fc276={};if(_0x36bcc5){const _0x105c84=Array[_0x17f427(0x1d1)](_0x36bcc5)?_0x36bcc5:[_0x36bcc5];for(const _0x3c77e0 of _0x105c84){const [_0x30e3f7,_0x3ddf55]=parseHeader(_0x3c77e0);_0x2fc276[_0x30e3f7]=_0x3ddf55;}}let _0x3ba174;if(_0x109419)_0x3ba174=_0x109419;else{if(_0x3a4b9f)try{_0x3ba174=RawAPI[_0x17f427(0x19b)](_0x3a4b9f);}catch(_0x396d7a){return console['error'](_0x17f427(0x1c4)+(_0x396d7a instanceof Error?_0x396d7a[_0x17f427(0x1ad)]:String(_0x396d7a))),0x1;}}const _0x39cd9a={'method':_0x3744a4,'apiType':_0x273298,'includeHeaders':_0x2adb63['verbose']};_0x3ba174&&(_0x39cd9a[_0x17f427(0x1c1)]=_0x3ba174);Object[_0x17f427(0x1a5)](_0x2fc276)[_0x17f427(0x1ac)]>0x0&&(_0x39cd9a[_0x17f427(0x1d4)]=_0x2fc276);if(_0x2adb63['verbose']){const _0x19b87b=resolveSite(_0x2adb63[_0x17f427(0x1aa)]),_0x134b26=getEndpoint(_0x19b87b,_0x273298),_0x4ed2a0=''+_0x134b26+_0x10ccb8;console[_0x17f427(0x1ba)]('>\x20'+_0x3744a4+'\x20'+_0x4ed2a0);const _0x361050=getAuthHeaders(_0x19b87b),_0x3c4721={..._0x361050,..._0x2fc276};for(const [_0x541c08,_0x3b5d3f]of Object[_0x17f427(0x1b2)](_0x3c4721)){!isSensitiveHeader(_0x541c08)&&console[_0x17f427(0x1ba)]('>\x20'+_0x541c08+':\x20'+_0x3b5d3f);}_0x3ba174&&console['error']('>'),console[_0x17f427(0x1ba)]('');}const _0x1d4929=await _0x51168a[_0x17f427(0x1a4)][_0x17f427(0x1a0)](_0x10ccb8,_0x39cd9a);if(_0x2adb63[_0x17f427(0x1cc)]&&_0x1d4929['headers']){console[_0x17f427(0x1ba)]('<\x20HTTP/1.1\x20'+_0x1d4929[_0x17f427(0x1d7)]);for(const [_0x12e55f,_0x381d8a]of Object[_0x17f427(0x1b2)](_0x1d4929[_0x17f427(0x1d4)])){!isSensitiveHeader(_0x12e55f)&&console[_0x17f427(0x1ba)]('<\x20'+_0x12e55f+':\x20'+_0x381d8a);}console['error']('');}const _0xbeefee=Boolean(_0x2adb63['output']),_0x3574b1={'color':_0x2adb63[_0x17f427(0x1ce)],'noColor':_0x2adb63['noColor']||_0xbeefee&&!_0x2adb63[_0x17f427(0x1ce)]},_0xd15394=colorizeJSON(_0x1d4929[_0x17f427(0x1c6)],_0x3574b1);return _0x2adb63[_0x17f427(0x1b0)]?(writeFileSync(_0x2adb63[_0x17f427(0x1b0)],_0xd15394),console['error']('Results\x20saved\x20to\x20'+_0x2adb63[_0x17f427(0x1b0)])):console[_0x17f427(0x1bb)](_0xd15394),0x0;}catch(_0x2d0971){return _0x2d0971 instanceof Error?(console[_0x17f427(0x1ba)](_0x17f427(0x1c4)+_0x2d0971[_0x17f427(0x1ad)]),_0x2adb63[_0x17f427(0x1cc)]&&_0x2d0971[_0x17f427(0x1c0)]&&console[_0x17f427(0x1ba)](_0x17f427(0x1b9)+_0x2d0971[_0x17f427(0x1c0)])):console[_0x17f427(0x1ba)](_0x17f427(0x1c4)+String(_0x2d0971)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a7_0x4654a2=a7_0x25ad;(function(_0x42e6f6,_0x4d9878){const _0x192681=a7_0x25ad,_0x1c2059=_0x42e6f6();while(!![]){try{const _0x32768e=-parseInt(_0x192681(0x149))/0x1+parseInt(_0x192681(0x14f))/0x2+parseInt(_0x192681(0x14c))/0x3+-parseInt(_0x192681(0x150))/0x4+-parseInt(_0x192681(0x128))/0x5*(-parseInt(_0x192681(0x157))/0x6)+-parseInt(_0x192681(0x135))/0x7+parseInt(_0x192681(0x13b))/0x8;if(_0x32768e===_0x4d9878)break;else _0x1c2059['push'](_0x1c2059['shift']());}catch(_0xfe591d){_0x1c2059['push'](_0x1c2059['shift']());}}}(a7_0x32de,0x27756));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{buildSiteChoices}from'../core/constants.js';import a7_0xdbce83 from'prompts';function a7_0x32de(){const _0x1366cd=['us01','N/A','tdx:\x20auth\x20clear','Remove\x20API\x20key\x20from\x20system\x20keychain','Setup\x20API\x20key\x20authentication\x20interactively','20OumRRV','yellow','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','trim','customSite','create','tdx\x20profile:\x20','last_name','Read\x20credential\x20from\x20','description','select','You\x20can\x20find\x20your\x20API\x20key\x20at:','382620aETVKZ','error','getUserInfo','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','User:\x20','profile','38552vKSGPx','\x20(site:\x20','logLevel','site','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','\x20\x20tdx','apiKey','No\x20API\x20key\x20found\x20in\x20keychain','Enter\x20site\x20name:','\x20for\x20profile:\x20','name','auth:clear','status','243415VWTEEX','green','jobs','729663bRHsKn','join','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','329624APDdcI','12604wZxWZF','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','\x20(profile:\x20','Validating\x20API\x20key...','Enter\x20your\x20TD\x20API\x20key:','message','log','74994yciKbK','\x27\x20registered','/app/mp/ak','✓\x20Profile\x20\x27','email','System\x20keychain\x20is\x20not\x20available','first_name','\x0aSetup\x20cancelled','test','bold','red','✗\x20Validation\x20failed:\x20','Name:\x20','warn','auth:setup','execute'];a7_0x32de=function(){return _0x1366cd;};return a7_0x32de();}function a7_0x25ad(_0x5487dd,_0x417e46){_0x5487dd=_0x5487dd-0x123;const _0x32de8f=a7_0x32de();let _0x25ad29=_0x32de8f[_0x5487dd];return _0x25ad29;}import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a7_0x4d3ac3 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x4654a2(0x146)]=a7_0x4654a2(0x165);[a7_0x4654a2(0x132)]=a7_0x4654a2(0x127);async[a7_0x4654a2(0x166)](_0x35bab2){const _0x1920a2=a7_0x4654a2,{options:_0x1581ba}=_0x35bab2,_0x36d3d8=_0x1581ba['profile'];console[_0x1920a2(0x156)](a7_0x4d3ac3[_0x1920a2(0x160)]('tdx:\x20auth\x20setup'));const _0x4b667f=_0x1581ba['site']||_0x1920a2(0x123),{choices:_0x49c57d,initialIndex:_0x59196c}=buildSiteChoices(_0x4b667f),_0x2aec65=_0x36d3d8?'Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20'+_0x36d3d8+'):':'Select\x20your\x20Treasure\x20Data\x20site:',_0x5717de=await a7_0xdbce83({'type':_0x1920a2(0x133),'name':_0x1920a2(0x13e),'message':_0x2aec65,'choices':_0x49c57d,'initial':_0x59196c});if(!_0x5717de['site'])return console[_0x1920a2(0x156)](_0x1920a2(0x15e)),0x1;let _0x5974d1;if(_0x5717de[_0x1920a2(0x13e)]==='other'){const _0xae4638=await a7_0xdbce83({'type':'text','name':_0x1920a2(0x12d),'message':_0x1920a2(0x144),'initial':_0x1920a2(0x123),'validate':_0x5a4a64=>{const _0x52c4cf=_0x1920a2;if(!_0x5a4a64||!_0x5a4a64[_0x52c4cf(0x12c)]())return'Site\x20name\x20cannot\x20be\x20empty';if(!/^[a-z0-9-]+$/[_0x52c4cf(0x15f)](_0x5a4a64[_0x52c4cf(0x12c)]()))return _0x52c4cf(0x12b);return!![];}});if(!_0xae4638['customSite'])return console[_0x1920a2(0x156)]('\x0aSetup\x20cancelled'),0x1;_0x5974d1=_0xae4638[_0x1920a2(0x12d)];}else _0x5974d1=_0x5717de['site'];const _0x3b7f2d=resolveSite(_0x5974d1);console[_0x1920a2(0x156)]('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x3b7f2d),console['log'](_0x1920a2(0x134)),console[_0x1920a2(0x156)]('\x20\x20'+getConsoleUrl(_0x3b7f2d,_0x1920a2(0x159)));const _0x96c336=await a7_0xdbce83({'type':'password','name':_0x1920a2(0x142),'message':_0x1920a2(0x154),'validate':_0x1e9416=>{const _0x4ae132=_0x1920a2;if(!_0x1e9416||!_0x1e9416[_0x4ae132(0x12c)]())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x96c336[_0x1920a2(0x142)])return console[_0x1920a2(0x156)](_0x1920a2(0x15e)),0x1;const _0x46ed81=_0x96c336[_0x1920a2(0x142)];console[_0x1920a2(0x156)](_0x1920a2(0x153));try{const _0x49d819=TDX[_0x1920a2(0x12e)]({'site':_0x3b7f2d,'apiKey':_0x46ed81[_0x1920a2(0x12c)](),'logLevel':_0x1581ba[_0x1920a2(0x13d)]??LogLevel['ERROR']}),_0x2f54bd=await _0x49d819[_0x1920a2(0x14b)][_0x1920a2(0x137)]();console[_0x1920a2(0x156)](_0x1920a2(0x140)+_0x2f54bd[_0x1920a2(0x15b)]+')');const _0x297c79=await isKeychainAvailable();_0x297c79?(await saveAPIKeyAsync(_0x46ed81['trim'](),_0x3b7f2d,_0x36d3d8),console[_0x1920a2(0x156)](_0x1920a2(0x13f)+(_0x36d3d8?_0x1920a2(0x152)+_0x36d3d8+')':''))):(console[_0x1920a2(0x164)](a7_0x4d3ac3[_0x1920a2(0x129)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console['warn'](a7_0x4d3ac3[_0x1920a2(0x129)](_0x1920a2(0x14e))));if(_0x36d3d8){const _0x222527={'site':_0x3b7f2d};saveProfileToUserConfig(_0x36d3d8,_0x222527),console[_0x1920a2(0x156)](_0x1920a2(0x15a)+_0x36d3d8+_0x1920a2(0x158));}else saveDefaultSiteToUserConfig(_0x3b7f2d),console[_0x1920a2(0x156)]('✓\x20Default\x20site\x20set\x20to\x20'+_0x3b7f2d);const _0x51a6e9=_0x36d3d8?'\x20--profile\x20'+_0x36d3d8:'';return console[_0x1920a2(0x156)](),console['log'](_0x1920a2(0x151)),console[_0x1920a2(0x156)]('\x20\x20tdx'+_0x51a6e9+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x1920a2(0x156)](_0x1920a2(0x141)+_0x51a6e9+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x4e14fc){if(_0x4e14fc instanceof HTTPClientError&&_0x4e14fc[_0x1920a2(0x148)]===0x191)return printAuthError(_0x4e14fc),0x1;return console[_0x1920a2(0x136)](a7_0x4d3ac3[_0x1920a2(0x161)](_0x1920a2(0x162)+(_0x4e14fc instanceof Error?_0x4e14fc[_0x1920a2(0x155)]:String(_0x4e14fc)))),console['error'](_0x1920a2(0x12a)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x4654a2(0x146)]='auth';['description']=a7_0x4654a2(0x138);async[a7_0x4654a2(0x166)](_0x37fe32){const _0x4cdeb2=a7_0x4654a2,{options:_0x5416b1,tdx:_0x179843}=_0x37fe32,_0x2ce589=_0x5416b1[_0x4cdeb2(0x13e)],_0x118d16=_0x5416b1[_0x4cdeb2(0x13a)],_0xe1e213=_0x118d16?_0x118d16:_0x4cdeb2(0x124);console[_0x4cdeb2(0x156)](_0x4cdeb2(0x12f)+_0xe1e213+_0x4cdeb2(0x13c)+_0x2ce589+')');const _0xf0854a=await resolveAPIKeyAsync(_0x2ce589,_0x118d16);if(_0xf0854a){const {source:_0x27a154,isDeprecated:_0x1a57d9}=_0xf0854a,_0x347f22=_0x4cdeb2(0x131)+_0x27a154;console[_0x4cdeb2(0x156)](_0x1a57d9?a7_0x4d3ac3[_0x4cdeb2(0x129)](_0x347f22):_0x347f22);}else console[_0x4cdeb2(0x156)](a7_0x4d3ac3['yellow']('No\x20credential\x20found'));try{const _0x3c3ca4=await _0x179843[_0x4cdeb2(0x14b)][_0x4cdeb2(0x137)]();return console[_0x4cdeb2(0x156)](a7_0x4d3ac3[_0x4cdeb2(0x14a)]('✓\x20Authentication\x20successful\x0a')),console[_0x4cdeb2(0x156)](_0x4cdeb2(0x139)+_0x3c3ca4[_0x4cdeb2(0x15b)]),(_0x3c3ca4[_0x4cdeb2(0x15d)]||_0x3c3ca4[_0x4cdeb2(0x130)])&&console[_0x4cdeb2(0x156)](_0x4cdeb2(0x163)+[_0x3c3ca4[_0x4cdeb2(0x15d)],_0x3c3ca4[_0x4cdeb2(0x130)]]['filter'](Boolean)[_0x4cdeb2(0x14d)]('\x20')),0x0;}catch(_0x46db43){return _0x46db43 instanceof HTTPClientError&&_0x46db43[_0x4cdeb2(0x148)]===0x191?printAuthError(_0x46db43,!![],_0x118d16):console[_0x4cdeb2(0x136)](a7_0x4d3ac3[_0x4cdeb2(0x161)](_0x4cdeb2(0x162)+(_0x46db43 instanceof Error?_0x46db43[_0x4cdeb2(0x155)]:String(_0x46db43)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x4654a2(0x146)]=a7_0x4654a2(0x147);[a7_0x4654a2(0x132)]=a7_0x4654a2(0x126);async['execute'](_0x5ac7f3){const _0x1b922c=a7_0x4654a2,{options:_0x2cc494}=_0x5ac7f3,_0x55f578=_0x2cc494[_0x1b922c(0x13a)];console['log'](a7_0x4d3ac3[_0x1b922c(0x160)](_0x1b922c(0x125)));const _0x533ade=await isKeychainAvailable();if(!_0x533ade)return console[_0x1b922c(0x136)](a7_0x4d3ac3[_0x1b922c(0x161)](_0x1b922c(0x15c))),0x1;const _0x1deefc=await deleteKeychainAPIKey(_0x55f578);return _0x1deefc?(clearCredentialCache(),console[_0x1b922c(0x156)]('✓\x20API\x20key\x20removed\x20from\x20keychain'+(_0x55f578?_0x1b922c(0x152)+_0x55f578+')':'')),0x0):(console[_0x1b922c(0x156)](_0x1b922c(0x143)+(_0x55f578?_0x1b922c(0x145)+_0x55f578:'')),0x1);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a8_0x287780=a8_0x1eb2;(function(_0x196b12,_0x423eef){const _0x35fed2=a8_0x1eb2,_0x5a24b0=_0x196b12();while(!![]){try{const _0x5708f7=-parseInt(_0x35fed2(0x164))/0x1*(-parseInt(_0x35fed2(0x180))/0x2)+-parseInt(_0x35fed2(0x17a))/0x3*(-parseInt(_0x35fed2(0x18a))/0x4)+-parseInt(_0x35fed2(0x16e))/0x5+-parseInt(_0x35fed2(0x16c))/0x6*(-parseInt(_0x35fed2(0x166))/0x7)+parseInt(_0x35fed2(0x191))/0x8*(parseInt(_0x35fed2(0x18d))/0x9)+parseInt(_0x35fed2(0x15d))/0xa*(parseInt(_0x35fed2(0x172))/0xb)+parseInt(_0x35fed2(0x165))/0xc*(-parseInt(_0x35fed2(0x17f))/0xd);if(_0x5708f7===_0x423eef)break;else _0x5a24b0['push'](_0x5a24b0['shift']());}catch(_0xe14762){_0x5a24b0['push'](_0x5a24b0['shift']());}}}(a8_0xa8f4,0xf08a5));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';function a8_0xa8f4(){const _0x4bccb4=['127NKahZk','24NObMGm','11626909OQZaAd','llm','Using\x20agent\x20from\x20','content','cause','new','6EQpffP','session\x20context','3402725YsFWlS','handleChatEvent','claude-4.5-haiku','Error:\x20','44GUyiYG','args','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','resolveProjectId','agent','getDefaultAgent','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','metadata','21nFkTHg','description','\x27...','type','log','25876409eWDPKC','13346cYPqGX','error','verbose','name','message','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','execute','Using\x20cached\x20default\x20agent:\x20','Getting\x20default\x20agent...','Resolving\x20project\x20\x27','612980CFAeIz','streamChat','\x0aError:\x20','117OxEmnH','data','code','getAgentId','810904mSqUFn','--agent\x20flag','Chat\x20session:\x20','write','includes','event','1869730pwBcGe','Continuing\x20chat:\x20','CHAT_NOT_FOUND','join','resolveAgentId','llmAgent','llmProject'];a8_0xa8f4=function(){return _0x4bccb4;};return a8_0xa8f4();}import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';function handleSDKError(_0x2dacbf,_0x3f0b21){const _0x18f6c9=a8_0x1eb2;if(_0x2dacbf instanceof SDKError)console[_0x18f6c9(0x181)](_0x18f6c9(0x171)+_0x2dacbf[_0x18f6c9(0x184)]),_0x3f0b21[_0x18f6c9(0x182)]&&(_0x2dacbf[_0x18f6c9(0x16a)]&&console['error']('\x20\x20Cause:\x20'+_0x2dacbf[_0x18f6c9(0x16a)]),_0x2dacbf['stack']&&(console[_0x18f6c9(0x181)]('\x0aStack\x20trace:'),console[_0x18f6c9(0x181)](_0x2dacbf['stack'])));else throw _0x2dacbf;}function a8_0x1eb2(_0x367fe2,_0x524881){_0x367fe2=_0x367fe2-0x15b;const _0xa8f404=a8_0xa8f4();let _0x1eb283=_0xa8f404[_0x367fe2];return _0x1eb283;}export class ChatCommand extends BaseCommand{[a8_0x287780(0x183)]='chat';[a8_0x287780(0x17b)]=a8_0x287780(0x174);['validate'](_0x218568){const _0x2322f6=a8_0x287780,_0x2a5b81=_0x218568[_0x2322f6(0x173)][_0x2322f6(0x160)]('\x20');if(!_0x2a5b81)return'Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options';return undefined;}async[a8_0x287780(0x18b)](_0xf2c683,_0x3084a6,_0x2dd7d4,_0x1ddf85,_0x3e811c){const _0x5501d5=a8_0x287780;for await(const _0x1df6d1 of _0xf2c683[_0x5501d5(0x167)]['chat'](_0x3084a6,{'agentId':_0x2dd7d4,'chatId':_0x1ddf85})){if(_0x1df6d1[_0x5501d5(0x17d)]===_0x5501d5(0x179)){const _0x2f9250=_0x1df6d1['data']['chatId'];saveLastChatId(_0x2f9250),_0x3e811c&&console[_0x5501d5(0x181)](_0x5501d5(0x193)+_0x2f9250);}else _0x1df6d1[_0x5501d5(0x17d)]===_0x5501d5(0x15c)&&this[_0x5501d5(0x16f)](_0x1df6d1[_0x5501d5(0x18e)]);}}async['getAgentId'](_0xa8e4eb,_0x32c9d4,_0x588cc2,_0x239de8,_0x16e964){const _0x419f7a=a8_0x287780,_0x59d5b3=_0x32c9d4||_0x588cc2;if(_0x59d5b3){const {projectName:_0x37efa9,agentName:_0x2e3dc7}=parseAgentRef(_0x59d5b3),_0x504ea9=_0x2e3dc7||_0x59d5b3,_0x4197d9=_0x2e3dc7?_0x37efa9:_0x239de8;if(!_0x4197d9)throw new Error(_0x419f7a(0x185));if(_0x16e964){const _0x34abda=_0x32c9d4?_0x419f7a(0x192):_0x419f7a(0x16d);console[_0x419f7a(0x181)](_0x419f7a(0x168)+_0x34abda+':\x20'+_0x4197d9+'/'+_0x504ea9);}const _0x520a20=await withSpinner(_0x419f7a(0x189)+_0x4197d9+'\x27...',()=>_0xa8e4eb['llm'][_0x419f7a(0x175)](_0x4197d9),{'verbose':_0x16e964}),_0x397b14=await withSpinner('Resolving\x20agent\x20\x27'+_0x504ea9+_0x419f7a(0x17c),()=>_0xa8e4eb[_0x419f7a(0x167)][_0x419f7a(0x161)](_0x504ea9,_0x520a20[_0x419f7a(0x18e)]),{'verbose':_0x16e964});return _0x397b14[_0x419f7a(0x18e)];}else{const _0x1e2171=_0xa8e4eb['llm'][_0x419f7a(0x177)]();if(_0x1e2171)return _0x16e964&&console[_0x419f7a(0x181)](_0x419f7a(0x187)+_0x1e2171['name']),_0x1e2171['id'];const _0x2b1e94=await withSpinner(_0x419f7a(0x188),()=>_0xa8e4eb[_0x419f7a(0x167)]['getOrCreateDefaultAgent'](_0x419f7a(0x170),0x0),{'verbose':_0x16e964});return _0x2b1e94[_0x419f7a(0x18e)]['id'];}}async[a8_0x287780(0x186)](_0x29f342){const _0x176c7d=a8_0x287780,{options:_0x2bcb59,args:_0x1d130d,tdx:_0x1bc043}=_0x29f342,_0x3073f4=_0x1d130d[_0x176c7d(0x160)]('\x20'),_0x3ecff3=_0x2bcb59,_0x5ff63a=_0x3ecff3[_0x176c7d(0x176)],_0x118eee=_0x3ecff3[_0x176c7d(0x162)],_0x2c826c=_0x3ecff3[_0x176c7d(0x163)],_0x1fc5c3=_0x3ecff3[_0x176c7d(0x16b)];try{let _0x25e1d9,_0x548b75;!_0x1fc5c3&&(_0x548b75=loadLastChatId(),_0x548b75&&_0x2bcb59[_0x176c7d(0x182)]&&console['error'](_0x176c7d(0x15e)+_0x548b75));(_0x1fc5c3||!_0x548b75)&&(_0x25e1d9=await this[_0x176c7d(0x190)](_0x1bc043,_0x5ff63a,_0x118eee,_0x2c826c,_0x2bcb59[_0x176c7d(0x182)]));try{await this[_0x176c7d(0x18b)](_0x1bc043,_0x3073f4,_0x25e1d9,_0x548b75,_0x2bcb59[_0x176c7d(0x182)]);}catch(_0x56134b){const _0x51a414=_0x56134b instanceof SDKError&&_0x56134b[_0x176c7d(0x18f)]===ErrorCode[_0x176c7d(0x15f)]||_0x56134b instanceof Error&&_0x56134b[_0x176c7d(0x184)][_0x176c7d(0x15b)]('404');if(_0x51a414)_0x2bcb59[_0x176c7d(0x182)]&&console['error'](_0x176c7d(0x178)),!_0x25e1d9&&(_0x25e1d9=await this[_0x176c7d(0x190)](_0x1bc043,_0x5ff63a,_0x118eee,_0x2c826c,_0x2bcb59[_0x176c7d(0x182)])),await this[_0x176c7d(0x18b)](_0x1bc043,_0x3073f4,_0x25e1d9,undefined,_0x2bcb59['verbose']);else throw _0x56134b;}return console[_0x176c7d(0x17e)](),0x0;}catch(_0x41c6d3){return console['error'](),handleSDKError(_0x41c6d3,_0x2bcb59),0x1;}}['handleChatEvent'](_0x28db5c){const _0x5bcc81=a8_0x287780;if(_0x5bcc81(0x169)in _0x28db5c)process['stdout'][_0x5bcc81(0x194)](_0x28db5c[_0x5bcc81(0x169)]);else _0x5bcc81(0x181)in _0x28db5c&&console[_0x5bcc81(0x181)](_0x5bcc81(0x18c)+_0x28db5c[_0x5bcc81(0x181)]);}}
|