@treasuredata/tdx 0.16.19 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +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.d.ts +3 -0
- package/dist/commands/job-command.d.ts.map +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/job-command.js.map +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/schedule-command.d.ts +67 -0
- package/dist/commands/schedule-command.d.ts.map +1 -0
- package/dist/commands/schedule-command.js +1 -0
- package/dist/commands/schedule-command.js.map +1 -0
- 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.d.ts +64 -1
- package/dist/sdk/client/td-api-client.d.ts.map +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/td-api-client.js.map +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.d.ts +6 -0
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-aliases.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/schedule.d.ts +99 -0
- package/dist/sdk/schedule.d.ts.map +1 -0
- package/dist/sdk/schedule.js +1 -0
- package/dist/sdk/schedule.js.map +1 -0
- 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.d.ts +1 -0
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/schedule.d.ts +196 -0
- package/dist/sdk/types/schedule.d.ts.map +1 -0
- package/dist/sdk/types/schedule.js +1 -0
- package/dist/sdk/types/schedule.js.map +1 -0
- 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 +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
function a4_0x2880(){const _0xc68b2=['pushProject','red','\x20\x20Prompt\x20\x22','\x20--profile\x20','Cannot\x20clone\x20from\x20context\x20project\x20\x22','Source:\x20','\x0a✔\x20Pushed\x20','green','\x20\x20Text\x20Knowledge\x20Bases:\x20','New\x20project:\x20','INVALID_ARGUMENT','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','Using\x20project\x20from\x20','\x0aWrite\x20','\x20\x20Target:\x20','\x0aPull\x20summary\x20for\x20\x27','594YNCdTb','push','updated','\x20\x20Agents:\x20','\x20resources\x20to\x20\x27','1530969XmrPUb','cwd','\x20\x20tdx\x20agent\x20clone\x20agents/','\x22:\x20','\x20\x20Knowledge\x20Base\x20\x22','\x22\x20to\x20a\x20different\x20profile','6MUzFdK','\x0aChanges\x20to\x20agent\x20\x27','2022957EVEzXy','Status:\x20','624Ednmsa','log','llm_project','newProjectId','integrations','agentId','\x20new','\x20total','\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','New\x20project\x20name\x20is\x20required','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','llmProject','outputDir','3318828qTYHKU','\x20resources?','\x20changed','\x20files?','\x0aProject\x20pushed\x20with\x20errors','reason','knowledgeBases','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','diff','Push\x20cancelled','llm','\x20\x20Agent\x20\x22','Analyzing\x20project\x20\x22','Agent:\x20','agents','parse','New\x20project\x20ID:\x20','errors','\x20--name\x20','sourceProjectName','yes','Pull\x20cancelled','force','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Writing\x20files...','Agent\x20','\x20successfully','action','dirname','context','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','Would\x20clone:','Project\x20cloned\x20with\x20errors','\x20created','Using\x20context\x20project:\x20','session','cloneProject','total','\x20\x20Integration\x20\x22','Agent\x20pulled\x20successfully','projectDir','found','\x20\x20Text\x20Knowledge\x20Base\x20\x22','no_context','4169915nWHUZu','693803JFfKYH','\x22...','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)','newProjectName','agentName','\x0aChanges:','Using\x20local\x20project:\x20','No\x20tdx.json\x20found\x20in\x20','join','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','Errors:','25488xQVePO','prompts','\x20|\x20','\x20unchanged','dryRun','Chat:\x20','pullProject','Project:\x20','Would\x20push\x20agent:\x20','\x20=\x20','70049QtDnvR','Pulling\x20agent\x20\x22','gray','new','projectName','dim','agent:clone','\x20errors','MISSING_ARGUMENT','hasChanges','Pushing\x20to\x20project...','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x20\x20Prompts:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','Would\x20pull\x20agent:\x20','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x20files\x20to\x20','Pushing\x20agent\x20from\x20\x22','utf-8','✔\x20Context\x20set:\x20','yellow','counts','\x20updated','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','unchanged','10rJEXFt','Output\x20path:\x20','\x20\x20Integrations:\x20','\x0aChanges\x20to\x20integration\x20\x27','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x20\x20Source:\x20','\x20\x20Knowledge\x20Bases:\x20','description','created','textKnowledgeBases','error','Using\x20project:\x20','message','tdx.json','repeat','outputPath','name','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','2fQqQAc','source','Output:\x20','Summary:','Using\x20current\x20project:\x20','projectId','execute','cyan','agent.yml','output'];a4_0x2880=function(){return _0xc68b2;};return a4_0x2880();}const a4_0x2b84da=a4_0x134a;(function(_0x5b0629,_0x54db96){const _0x43d597=a4_0x134a,_0x1f3236=_0x5b0629();while(!![]){try{const _0x1cd56b=parseInt(_0x43d597(0x1c8))/0x1+parseInt(_0x43d597(0x165))/0x2*(parseInt(_0x43d597(0x184))/0x3)+-parseInt(_0x43d597(0x19b))/0x4+-parseInt(_0x43d597(0x1c7))/0x5*(parseInt(_0x43d597(0x18a))/0x6)+parseInt(_0x43d597(0x1dd))/0x7*(parseInt(_0x43d597(0x18e))/0x8)+parseInt(_0x43d597(0x18c))/0x9*(parseInt(_0x43d597(0x153))/0xa)+-parseInt(_0x43d597(0x17f))/0xb*(parseInt(_0x43d597(0x1d3))/0xc);if(_0x1cd56b===_0x54db96)break;else _0x1f3236['push'](_0x1f3236['shift']());}catch(_0x42ed44){_0x1f3236['push'](_0x1f3236['shift']());}}}(a4_0x2880,0x693d3));import a4_0x52a25f from'chalk';import a4_0x52bb92 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a4_0x134a(_0xf6101b,_0x1df084){_0xf6101b=_0xf6101b-0x13d;const _0x288003=a4_0x2880();let _0x134a0f=_0x288003[_0xf6101b];return _0x134a0f;}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(_0x30b0b5){const _0x51560c=a4_0x134a,_0x449476=[];if(_0x30b0b5[_0x51560c(0x1c0)]!==undefined)_0x449476['push'](_0x30b0b5[_0x51560c(0x1c0)]+_0x51560c(0x195));if(_0x30b0b5[_0x51560c(0x1e0)]!==undefined&&_0x30b0b5['new']>0x0)_0x449476[_0x51560c(0x180)](a4_0x52a25f[_0x51560c(0x176)](_0x30b0b5['new']+_0x51560c(0x194)));if(_0x30b0b5[_0x51560c(0x15b)]!==undefined&&_0x30b0b5[_0x51560c(0x15b)]>0x0)_0x449476[_0x51560c(0x180)](a4_0x52a25f['green'](_0x30b0b5['created']+_0x51560c(0x1bc)));if(_0x30b0b5[_0x51560c(0x181)]!==undefined&&_0x30b0b5[_0x51560c(0x181)]>0x0)_0x449476[_0x51560c(0x180)](a4_0x52a25f[_0x51560c(0x14e)](_0x30b0b5[_0x51560c(0x181)]+_0x51560c(0x150)));if(_0x30b0b5[_0x51560c(0x152)]!==undefined&&_0x30b0b5[_0x51560c(0x152)]>0x0)_0x449476[_0x51560c(0x180)](a4_0x52a25f[_0x51560c(0x1df)](_0x30b0b5['unchanged']+_0x51560c(0x1d6)));if(_0x30b0b5[_0x51560c(0x1ac)]!==undefined&&_0x30b0b5['errors']>0x0)_0x449476[_0x51560c(0x180)](a4_0x52a25f[_0x51560c(0x170)](_0x30b0b5[_0x51560c(0x1ac)]+_0x51560c(0x140)));return _0x449476[_0x51560c(0x1d0)](',\x20');}function displayDiffs(_0xe6f6c0,_0x2bd93a,_0xe06ab1,_0x1cec0b,_0x16b3de=[]){const _0x1ba0ac=a4_0x134a;for(const _0x56ad1a of _0xe6f6c0){if(_0x56ad1a[_0x1ba0ac(0x1a3)]){const _0x1b128f=_0x56ad1a[_0x1ba0ac(0x1cc)]||_0x56ad1a['name'];console[_0x1ba0ac(0x18f)](_0x1ba0ac(0x18b)+_0x1b128f+'\x27:'),console[_0x1ba0ac(0x18f)]('─'[_0x1ba0ac(0x161)](0x3c)),console[_0x1ba0ac(0x18f)](_0x56ad1a[_0x1ba0ac(0x1a3)]),console[_0x1ba0ac(0x18f)]('─'[_0x1ba0ac(0x161)](0x3c));}}for(const _0x5d49d9 of _0x2bd93a){_0x5d49d9[_0x1ba0ac(0x1a3)]&&(console[_0x1ba0ac(0x18f)](_0x1ba0ac(0x144)+_0x5d49d9[_0x1ba0ac(0x163)]+'\x27:'),console[_0x1ba0ac(0x18f)]('─'[_0x1ba0ac(0x161)](0x3c)),console['log'](_0x5d49d9[_0x1ba0ac(0x1a3)]),console[_0x1ba0ac(0x18f)]('─'[_0x1ba0ac(0x161)](0x3c)));}for(const _0xf8784f of _0xe06ab1){_0xf8784f[_0x1ba0ac(0x1a3)]&&(console[_0x1ba0ac(0x18f)](_0x1ba0ac(0x198)+_0xf8784f[_0x1ba0ac(0x163)]+'\x27:'),console['log']('─'[_0x1ba0ac(0x161)](0x3c)),console['log'](_0xf8784f[_0x1ba0ac(0x1a3)]),console[_0x1ba0ac(0x18f)]('─'[_0x1ba0ac(0x161)](0x3c)));}for(const _0x47bfe2 of _0x1cec0b){_0x47bfe2[_0x1ba0ac(0x1a3)]&&(console[_0x1ba0ac(0x18f)]('\x0aChanges\x20to\x20prompt\x20\x27'+_0x47bfe2[_0x1ba0ac(0x163)]+'\x27:'),console[_0x1ba0ac(0x18f)]('─'[_0x1ba0ac(0x161)](0x3c)),console[_0x1ba0ac(0x18f)](_0x47bfe2['diff']),console[_0x1ba0ac(0x18f)]('─'[_0x1ba0ac(0x161)](0x3c)));}for(const _0x249526 of _0x16b3de){_0x249526[_0x1ba0ac(0x1a3)]&&(console['log'](_0x1ba0ac(0x156)+_0x249526[_0x1ba0ac(0x163)]+'\x27:'),console[_0x1ba0ac(0x18f)]('─'['repeat'](0x3c)),console[_0x1ba0ac(0x18f)](_0x249526[_0x1ba0ac(0x1a3)]),console[_0x1ba0ac(0x18f)]('─'['repeat'](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x2b84da(0x163)]='agent:pull';['description']=a4_0x2b84da(0x1b9);async['execute'](_0x56302c){const _0x37b923=a4_0x2b84da,{options:_0x41ed60,args:_0x16a011,tdx:_0x35a90c}=_0x56302c,_0x5d1098=_0x16a011[0x0],_0x13a3bb=_0x16a011[0x1],_0x2c2d67=_0x41ed60[_0x37b923(0x16e)],_0x50db2d=_0x41ed60[_0x37b923(0x1d7)],_0x51fdfd=_0x41ed60[_0x37b923(0x1b1)],_0x5cded1=_0x41ed60[_0x37b923(0x1af)],_0x5ccb05=_0x41ed60[_0x37b923(0x199)];let _0x25d6b5,_0x1348ad;const _0x43f3dd=findAgentConfigPath(process[_0x37b923(0x185)]());if(_0x5d1098){const _0x14b426=a4_0x52bb92[_0x37b923(0x1d0)](_0x5d1098,_0x37b923(0x160));if(existsSync(_0x14b426))try{const _0x206207=JSON[_0x37b923(0x1aa)](readFileSync(_0x14b426,'utf-8'));_0x25d6b5=_0x206207[_0x37b923(0x190)],_0x1348ad=_0x5d1098,console[_0x37b923(0x18f)](a4_0x52a25f['dim'](_0x37b923(0x17b)+_0x14b426+':\x20'+_0x25d6b5));}catch{_0x25d6b5=_0x5d1098;}else _0x25d6b5=_0x5d1098;}else{if(_0x43f3dd)try{const _0x4b9f0f=JSON[_0x37b923(0x1aa)](readFileSync(_0x43f3dd,_0x37b923(0x14c)));_0x25d6b5=_0x4b9f0f[_0x37b923(0x190)],_0x1348ad=a4_0x52bb92[_0x37b923(0x1b7)](_0x43f3dd),console[_0x37b923(0x18f)](a4_0x52a25f[_0x37b923(0x13e)](_0x37b923(0x15e)+_0x25d6b5));}catch{_0x25d6b5=_0x5ccb05;}else _0x25d6b5=_0x5ccb05;}if(!_0x25d6b5)return console[_0x37b923(0x18f)](a4_0x52a25f[_0x37b923(0x14e)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x37b923(0x18f)](_0x37b923(0x1ca)),console[_0x37b923(0x18f)](_0x37b923(0x196)),console[_0x37b923(0x18f)](_0x37b923(0x146)),console[_0x37b923(0x18f)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent'),0x1;if(_0x13a3bb){const {data:_0x3361a7}=await withSpinner(_0x37b923(0x1de)+_0x13a3bb+'\x22\x20from\x20project\x20\x22'+_0x25d6b5+_0x37b923(0x1c9),()=>_0x35a90c[_0x37b923(0x1a5)]['pullAgent'](_0x25d6b5,_0x13a3bb,_0x2c2d67,{'dryRun':_0x50db2d,'force':_0x51fdfd}));if(_0x50db2d)return console[_0x37b923(0x18f)](a4_0x52a25f[_0x37b923(0x14e)]('Dry\x20run\x20-\x20no\x20files\x20written')),console[_0x37b923(0x18f)](_0x37b923(0x147)+_0x3361a7[_0x37b923(0x1cc)]),console[_0x37b923(0x18f)](_0x37b923(0x154)+_0x3361a7[_0x37b923(0x162)]),_0x3361a7[_0x37b923(0x1a3)]&&(console['log'](_0x37b923(0x1cd)),console[_0x37b923(0x18f)]('─'[_0x37b923(0x161)](0x3c)),console[_0x37b923(0x18f)](_0x3361a7[_0x37b923(0x1a3)]),console['log']('─'['repeat'](0x3c))),0x0;return console[_0x37b923(0x18f)](a4_0x52a25f[_0x37b923(0x176)](_0x37b923(0x1c2))),console[_0x37b923(0x18f)](_0x37b923(0x1a8)+_0x3361a7[_0x37b923(0x1cc)]),console['log'](_0x37b923(0x167)+_0x3361a7['outputPath']),console[_0x37b923(0x18f)](_0x37b923(0x18d)+(_0x3361a7['isNew']?a4_0x52a25f[_0x37b923(0x176)](_0x37b923(0x1e0)):_0x3361a7[_0x37b923(0x142)]?a4_0x52a25f['yellow'](_0x37b923(0x181)):a4_0x52a25f[_0x37b923(0x1df)](_0x37b923(0x152)))),0x0;}const _0x4fd3b1=_0x1348ad||_0x2c2d67,{data:_0x314cbe}=await withSpinner(_0x37b923(0x1a7)+_0x25d6b5+_0x37b923(0x1c9),()=>_0x35a90c[_0x37b923(0x1a5)][_0x37b923(0x1d9)](_0x25d6b5,_0x4fd3b1,{'dryRun':!![]})),_0xad3fa8=_0x314cbe[_0x37b923(0x14f)][_0x37b923(0x1a9)]['new']+_0x314cbe['counts'][_0x37b923(0x1a1)][_0x37b923(0x1e0)]+_0x314cbe[_0x37b923(0x14f)]['textKnowledgeBases'][_0x37b923(0x1e0)]+_0x314cbe['counts'][_0x37b923(0x1d4)][_0x37b923(0x1e0)]+_0x314cbe[_0x37b923(0x14f)][_0x37b923(0x192)][_0x37b923(0x1e0)],_0x555a9a=_0x314cbe[_0x37b923(0x14f)][_0x37b923(0x1a9)][_0x37b923(0x181)]+_0x314cbe[_0x37b923(0x14f)][_0x37b923(0x1a1)][_0x37b923(0x181)]+_0x314cbe[_0x37b923(0x14f)][_0x37b923(0x15c)][_0x37b923(0x181)]+_0x314cbe[_0x37b923(0x14f)][_0x37b923(0x1d4)][_0x37b923(0x181)]+_0x314cbe[_0x37b923(0x14f)][_0x37b923(0x192)][_0x37b923(0x181)],_0x5caf4a=_0x314cbe['counts']['agents'][_0x37b923(0x152)]+_0x314cbe['counts'][_0x37b923(0x1a1)][_0x37b923(0x152)]+_0x314cbe[_0x37b923(0x14f)][_0x37b923(0x15c)][_0x37b923(0x152)]+_0x314cbe['counts']['prompts']['unchanged']+_0x314cbe[_0x37b923(0x14f)][_0x37b923(0x192)]['unchanged'];console['log'](_0x37b923(0x17e)+_0x314cbe['projectName']+'\x27:'),console[_0x37b923(0x18f)]('\x20\x20'+a4_0x52a25f[_0x37b923(0x176)]('+\x20'+_0xad3fa8+_0x37b923(0x194))+_0x37b923(0x1d5)+a4_0x52a25f['yellow']('~\x20'+_0x555a9a+_0x37b923(0x19d))+_0x37b923(0x1d5)+a4_0x52a25f[_0x37b923(0x13e)]('=\x20'+_0x5caf4a+_0x37b923(0x1d6))),console[_0x37b923(0x18f)](_0x37b923(0x182)+formatCountSummary(_0x314cbe[_0x37b923(0x14f)][_0x37b923(0x1a9)])),console[_0x37b923(0x18f)](_0x37b923(0x159)+formatCountSummary(_0x314cbe[_0x37b923(0x14f)][_0x37b923(0x1a1)])),console['log'](_0x37b923(0x177)+formatCountSummary(_0x314cbe[_0x37b923(0x14f)][_0x37b923(0x15c)])),console[_0x37b923(0x18f)](_0x37b923(0x145)+formatCountSummary(_0x314cbe['counts'][_0x37b923(0x1d4)])),console[_0x37b923(0x18f)](_0x37b923(0x155)+formatCountSummary(_0x314cbe[_0x37b923(0x14f)][_0x37b923(0x192)])),console[_0x37b923(0x18f)](_0x37b923(0x17d)+a4_0x52a25f[_0x37b923(0x16c)](_0x314cbe[_0x37b923(0x19a)])),displayDiffs(_0x314cbe['agents'],_0x314cbe['knowledgeBases'],_0x314cbe[_0x37b923(0x15c)],_0x314cbe[_0x37b923(0x1d4)],_0x314cbe[_0x37b923(0x192)]);if(_0x50db2d)return console[_0x37b923(0x18f)](a4_0x52a25f[_0x37b923(0x14e)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0xad3fa8===0x0&&_0x555a9a===0x0)return console[_0x37b923(0x18f)](a4_0x52a25f[_0x37b923(0x176)](_0x37b923(0x148))),saveSessionContext({'llm_project':_0x314cbe[_0x37b923(0x13d)]},_0x41ed60['session']),console[_0x37b923(0x18f)](a4_0x52a25f[_0x37b923(0x176)](_0x37b923(0x14d)+a4_0x52a25f[_0x37b923(0x13e)](_0x37b923(0x190))+_0x37b923(0x1dc)+a4_0x52a25f[_0x37b923(0x16c)](_0x314cbe[_0x37b923(0x13d)]))),0x0;if(!_0x5cded1&&!_0x51fdfd){const _0x4199ee=await confirmKey(_0x37b923(0x17c)+(_0xad3fa8+_0x555a9a)+_0x37b923(0x19e));if(!_0x4199ee)return console[_0x37b923(0x18f)](_0x37b923(0x1b0)),0x0;}const {data:_0x22b323}=await withSpinner(_0x37b923(0x1b3),()=>_0x35a90c[_0x37b923(0x1a5)][_0x37b923(0x1d9)](_0x25d6b5,_0x4fd3b1,{'force':_0x51fdfd}));return console[_0x37b923(0x18f)](a4_0x52a25f[_0x37b923(0x176)]('\x0a✔\x20Pulled\x20'+(_0xad3fa8+_0x555a9a)+_0x37b923(0x14a)+_0x22b323[_0x37b923(0x19a)])),saveSessionContext({'llm_project':_0x22b323[_0x37b923(0x13d)]},_0x41ed60[_0x37b923(0x1be)]),console[_0x37b923(0x18f)](a4_0x52a25f[_0x37b923(0x176)](_0x37b923(0x14d)+a4_0x52a25f['dim'](_0x37b923(0x190))+_0x37b923(0x1dc)+a4_0x52a25f['cyan'](_0x22b323[_0x37b923(0x13d)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x2b84da(0x163)]=a4_0x2b84da(0x13f);[a4_0x2b84da(0x15a)]='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async[a4_0x2b84da(0x16b)](_0x2ea9b3){const _0x3a9291=a4_0x2b84da,{options:_0x199c6a,args:_0x3e9a41,tdx:_0x5655df}=_0x2ea9b3,_0x263f75=_0x3e9a41[0x0],_0x5a5457=_0x199c6a[_0x3a9291(0x163)],_0x36c9cb=_0x199c6a[_0x3a9291(0x1d7)],_0x426632=_0x199c6a[_0x3a9291(0x1af)],_0x4afc15=_0x199c6a['site'],_0x19c3b9=_0x199c6a[_0x3a9291(0x199)];let _0x279648;const _0x4b210=findAgentConfigPath(process[_0x3a9291(0x185)]());if(_0x263f75){const _0x1fb0a5=a4_0x52bb92[_0x3a9291(0x1d0)](_0x263f75,_0x3a9291(0x160));existsSync(_0x1fb0a5)?(_0x279648=_0x263f75,console[_0x3a9291(0x18f)](a4_0x52a25f[_0x3a9291(0x13e)](_0x3a9291(0x1ce)+_0x263f75))):_0x279648=_0x263f75;}else{if(_0x4b210)_0x279648=a4_0x52bb92['dirname'](_0x4b210),console['log'](a4_0x52a25f[_0x3a9291(0x13e)](_0x3a9291(0x169)+_0x279648));else{if(_0x19c3b9){const _0xef721c=sanitizeForFilesystem(_0x19c3b9);let _0x5ef479=_0xef721c,_0x5a48bd=a4_0x52bb92[_0x3a9291(0x1d0)](process[_0x3a9291(0x185)](),_0x3a9291(0x1a9),_0xef721c,_0x3a9291(0x160));if(!existsSync(_0x5a48bd)){const _0x129530=normalizeName(_0x19c3b9),_0x38d50f=a4_0x52bb92[_0x3a9291(0x1d0)](process[_0x3a9291(0x185)](),'agents',_0x129530,_0x3a9291(0x160));existsSync(_0x38d50f)&&(_0x5ef479=_0x129530,_0x5a48bd=_0x38d50f);}if(existsSync(_0x5a48bd))_0x279648=a4_0x52bb92[_0x3a9291(0x1b7)](_0x5a48bd),console['log'](a4_0x52a25f[_0x3a9291(0x13e)](_0x3a9291(0x1ce)+_0x279648));else{const _0x3d1ad3=_0x199c6a['profile'];if(_0x3d1ad3)throw new SDKError(ErrorCode[_0x3a9291(0x179)],_0x3a9291(0x173)+_0x19c3b9+_0x3a9291(0x189),undefined,{'helpText':'When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a'+_0x3a9291(0x17a)+('\x20\x20tdx\x20agent\x20pull\x20'+_0x19c3b9+'\x0a')+(_0x3a9291(0x186)+_0x5ef479+_0x3a9291(0x1ad)+(_0x5a5457||'<new-name>')+_0x3a9291(0x172)+_0x3d1ad3)});_0x279648=_0x19c3b9,console['log'](a4_0x52a25f['dim'](_0x3a9291(0x1bd)+_0x19c3b9));}}}}if(!_0x279648)return console[_0x3a9291(0x18f)](a4_0x52a25f['yellow'](_0x3a9291(0x1a2))),console[_0x3a9291(0x18f)]('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console[_0x3a9291(0x18f)](_0x3a9291(0x151)),console[_0x3a9291(0x18f)]('\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[_0x3a9291(0x18f)](_0x3a9291(0x1b2)),0x1;if(!_0x5a5457)throw new SDKError(ErrorCode[_0x3a9291(0x141)],_0x3a9291(0x197),undefined,{'helpText':_0x3a9291(0x149)});if(!_0x426632&&!_0x36c9cb){const _0x25fc9f=await confirmKey('Clone\x20\x22'+_0x279648+'\x22\x20to\x20new\x20project\x20\x22'+_0x5a5457+'\x22?');if(!_0x25fc9f)return console[_0x3a9291(0x18f)]('Clone\x20cancelled'),0x0;}const {data:_0x4b814d}=await withSpinner('Cloning\x20\x22'+_0x279648+'\x22\x20to\x20\x22'+_0x5a5457+_0x3a9291(0x1c9),()=>_0x5655df['llm'][_0x3a9291(0x1bf)](_0x279648,_0x5a5457,{'dryRun':_0x36c9cb}));if(_0x36c9cb)return console[_0x3a9291(0x18f)](a4_0x52a25f[_0x3a9291(0x14e)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console['log'](_0x3a9291(0x174)+_0x4b814d[_0x3a9291(0x1ae)]),console[_0x3a9291(0x18f)](_0x3a9291(0x178)+_0x5a5457),console['log'](_0x3a9291(0x1ba)),console[_0x3a9291(0x18f)]('\x20\x20Agents:\x20'+_0x4b814d[_0x3a9291(0x14f)][_0x3a9291(0x1a9)]['created']),console[_0x3a9291(0x18f)](_0x3a9291(0x159)+_0x4b814d['counts'][_0x3a9291(0x1a1)][_0x3a9291(0x15b)]),console[_0x3a9291(0x18f)](_0x3a9291(0x145)+_0x4b814d['counts'][_0x3a9291(0x1d4)][_0x3a9291(0x15b)]),0x0;const _0xa20faf=_0x4b814d[_0x3a9291(0x14f)][_0x3a9291(0x1a9)][_0x3a9291(0x1ac)]>0x0||_0x4b814d[_0x3a9291(0x14f)][_0x3a9291(0x1a1)]['errors']>0x0||_0x4b814d[_0x3a9291(0x14f)][_0x3a9291(0x1d4)]['errors']>0x0;_0xa20faf?console[_0x3a9291(0x18f)](a4_0x52a25f[_0x3a9291(0x14e)](_0x3a9291(0x1bb))):console['log'](a4_0x52a25f[_0x3a9291(0x176)]('Project\x20cloned\x20successfully'));console[_0x3a9291(0x18f)](_0x3a9291(0x174)+_0x4b814d[_0x3a9291(0x1ae)]),console[_0x3a9291(0x18f)](_0x3a9291(0x178)+_0x4b814d[_0x3a9291(0x1cb)]),console['log'](_0x3a9291(0x1ab)+_0x4b814d['newProjectId']),console[_0x3a9291(0x18f)](),console[_0x3a9291(0x18f)](_0x3a9291(0x168)),console[_0x3a9291(0x18f)](_0x3a9291(0x182)+formatCountSummary(_0x4b814d[_0x3a9291(0x14f)][_0x3a9291(0x1a9)])),console[_0x3a9291(0x18f)](_0x3a9291(0x159)+formatCountSummary(_0x4b814d['counts']['knowledgeBases'])),console['log'](_0x3a9291(0x145)+formatCountSummary(_0x4b814d[_0x3a9291(0x14f)][_0x3a9291(0x1d4)])),console[_0x3a9291(0x18f)](_0x3a9291(0x155)+formatCountSummary(_0x4b814d['counts'][_0x3a9291(0x192)]));if(_0xa20faf){console[_0x3a9291(0x18f)](),console[_0x3a9291(0x18f)](a4_0x52a25f[_0x3a9291(0x170)](_0x3a9291(0x1d2)));for(const _0x382abc of _0x4b814d[_0x3a9291(0x1a9)]){_0x382abc[_0x3a9291(0x1b6)]===_0x3a9291(0x15d)&&console['log'](a4_0x52a25f[_0x3a9291(0x170)](_0x3a9291(0x1a6)+_0x382abc[_0x3a9291(0x1cc)]+_0x3a9291(0x187)+_0x382abc[_0x3a9291(0x15d)]));}for(const _0x2279f1 of _0x4b814d[_0x3a9291(0x1a1)]){_0x2279f1[_0x3a9291(0x1b6)]===_0x3a9291(0x15d)&&console[_0x3a9291(0x18f)](a4_0x52a25f[_0x3a9291(0x170)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x2279f1[_0x3a9291(0x163)]+'\x22:\x20'+_0x2279f1[_0x3a9291(0x15d)]));}for(const _0x8f60e2 of _0x4b814d[_0x3a9291(0x1d4)]){_0x8f60e2[_0x3a9291(0x1b6)]===_0x3a9291(0x15d)&&console['log'](a4_0x52a25f[_0x3a9291(0x170)](_0x3a9291(0x171)+_0x8f60e2[_0x3a9291(0x163)]+_0x3a9291(0x187)+_0x8f60e2[_0x3a9291(0x15d)]));}for(const _0x59a9a7 of _0x4b814d[_0x3a9291(0x192)]){_0x59a9a7[_0x3a9291(0x1b6)]===_0x3a9291(0x15d)&&console[_0x3a9291(0x18f)](a4_0x52a25f[_0x3a9291(0x170)](_0x3a9291(0x1c1)+_0x59a9a7['name']+_0x3a9291(0x187)+_0x59a9a7[_0x3a9291(0x15d)]));}return 0x1;}console['log']();const _0x1ac020=getLLMProjectUrl(_0x4afc15,_0x4b814d[_0x3a9291(0x191)]);return console[_0x3a9291(0x18f)](_0x3a9291(0x1da)+a4_0x52a25f[_0x3a9291(0x16c)](_0x1ac020)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x2b84da(0x163)]='agent:push';[a4_0x2b84da(0x15a)]='Push\x20local\x20agent\x20files\x20to\x20LLM\x20project';async[a4_0x2b84da(0x16b)](_0x3bb731){const _0x1e51c9=a4_0x2b84da,{options:_0x5243b0,args:_0x3272f4,tdx:_0x45be76}=_0x3bb731;let _0x55f46d=_0x3272f4[0x0]||process[_0x1e51c9(0x185)]();const _0x2f79cb=_0x5243b0[_0x1e51c9(0x1d7)],_0x5e7149=_0x5243b0['force'],_0xbfc535=_0x5243b0[_0x1e51c9(0x1af)],_0x70dbfc=_0x5243b0['site'],_0x4b1565=a4_0x52bb92[_0x1e51c9(0x1d0)](_0x55f46d,_0x1e51c9(0x16d)),_0x56ddcd=existsSync(_0x4b1565);if(_0x56ddcd){const {data:_0x2e0c85}=await withSpinner(_0x1e51c9(0x14b)+_0x55f46d+_0x1e51c9(0x1c9),()=>_0x45be76[_0x1e51c9(0x1a5)]['pushAgent'](_0x55f46d,{'dryRun':_0x2f79cb,'force':_0x5e7149}));if(_0x2f79cb)return console[_0x1e51c9(0x18f)](a4_0x52a25f['yellow']('Dry\x20run\x20-\x20no\x20changes\x20made')),console['log'](_0x1e51c9(0x1db)+_0x2e0c85[_0x1e51c9(0x1cc)]),0x0;if(_0x2e0c85[_0x1e51c9(0x1b6)]==='error')return console[_0x1e51c9(0x18f)](a4_0x52a25f[_0x1e51c9(0x170)]('Failed\x20to\x20push\x20agent:\x20'+_0x2e0c85[_0x1e51c9(0x15d)])),0x1;console[_0x1e51c9(0x18f)](a4_0x52a25f[_0x1e51c9(0x176)](_0x1e51c9(0x1b4)+_0x2e0c85[_0x1e51c9(0x1b6)]+_0x1e51c9(0x1b5))),console['log'](_0x1e51c9(0x1a8)+_0x2e0c85[_0x1e51c9(0x1cc)]);if(_0x2e0c85[_0x1e51c9(0x193)]&&_0x2e0c85[_0x1e51c9(0x16a)]){const _0x541ad6=getLLMAgentChatUrl(_0x70dbfc,_0x2e0c85['projectId'],_0x2e0c85[_0x1e51c9(0x193)]);console[_0x1e51c9(0x18f)](_0x1e51c9(0x1d8)+a4_0x52a25f[_0x1e51c9(0x16c)](_0x541ad6));}return 0x0;}const _0x4174fa=_0x5243b0[_0x1e51c9(0x199)],_0x4e0883=resolveProjectFromContext(_0x55f46d,_0x4174fa);if(_0x4e0883[_0x1e51c9(0x1c4)])_0x55f46d=_0x4e0883[_0x1e51c9(0x1c3)],_0x4e0883[_0x1e51c9(0x166)]===_0x1e51c9(0x1b8)&&console[_0x1e51c9(0x18f)](a4_0x52a25f[_0x1e51c9(0x13e)]('Using\x20project:\x20'+_0x55f46d));else{let _0x34ca76='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x4e0883['reason']==='no_local_folder'&&(_0x34ca76=_0x4e0883[_0x1e51c9(0x15f)]+_0x1e51c9(0x164)+_0x4e0883['llmProject']+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x4e0883[_0x1e51c9(0x1a0)]===_0x1e51c9(0x1c6)?_0x4e0883[_0x1e51c9(0x15f)]:_0x1e51c9(0x1cf)+_0x55f46d,undefined,{'helpText':_0x34ca76});}const {data:_0x2b8744}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x45be76['llm'][_0x1e51c9(0x16f)](_0x55f46d,{'dryRun':!![]})),_0x45d952=_0x2b8744[_0x1e51c9(0x14f)]['agents'][_0x1e51c9(0x1ac)]>0x0;if(_0x45d952){console[_0x1e51c9(0x18f)](a4_0x52a25f[_0x1e51c9(0x170)]('\x0aErrors\x20found:'));for(const _0x1072a0 of _0x2b8744[_0x1e51c9(0x1a9)]){_0x1072a0[_0x1e51c9(0x1b6)]===_0x1e51c9(0x15d)&&console[_0x1e51c9(0x18f)](a4_0x52a25f['red'](_0x1e51c9(0x1a6)+_0x1072a0[_0x1e51c9(0x1cc)]+'\x22:\x20'+_0x1072a0[_0x1e51c9(0x15d)]));}return 0x1;}const _0x43e0cd=_0x2b8744['counts']['agents'][_0x1e51c9(0x15b)]+_0x2b8744[_0x1e51c9(0x14f)][_0x1e51c9(0x1a1)]['created']+_0x2b8744[_0x1e51c9(0x14f)]['textKnowledgeBases'][_0x1e51c9(0x15b)]+_0x2b8744['counts'][_0x1e51c9(0x1d4)][_0x1e51c9(0x15b)]+_0x2b8744[_0x1e51c9(0x14f)][_0x1e51c9(0x192)][_0x1e51c9(0x15b)],_0x1a8dc5=_0x2b8744[_0x1e51c9(0x14f)][_0x1e51c9(0x1a9)][_0x1e51c9(0x181)]+_0x2b8744[_0x1e51c9(0x14f)]['knowledgeBases'][_0x1e51c9(0x181)]+_0x2b8744['counts'][_0x1e51c9(0x15c)][_0x1e51c9(0x181)]+_0x2b8744[_0x1e51c9(0x14f)][_0x1e51c9(0x1d4)][_0x1e51c9(0x181)]+_0x2b8744['counts'][_0x1e51c9(0x192)][_0x1e51c9(0x181)],_0x1e77fa=_0x2b8744[_0x1e51c9(0x14f)]['agents']['unchanged']+_0x2b8744[_0x1e51c9(0x14f)][_0x1e51c9(0x1a1)][_0x1e51c9(0x152)]+_0x2b8744[_0x1e51c9(0x14f)][_0x1e51c9(0x15c)]['unchanged']+_0x2b8744[_0x1e51c9(0x14f)][_0x1e51c9(0x1d4)][_0x1e51c9(0x152)]+_0x2b8744[_0x1e51c9(0x14f)][_0x1e51c9(0x192)]['unchanged'];console[_0x1e51c9(0x18f)]('\x0aPush\x20summary\x20for\x20\x27'+_0x2b8744[_0x1e51c9(0x13d)]+'\x27:'),console[_0x1e51c9(0x18f)]('\x20\x20'+a4_0x52a25f[_0x1e51c9(0x176)]('+\x20'+_0x43e0cd+_0x1e51c9(0x194))+_0x1e51c9(0x1d5)+a4_0x52a25f[_0x1e51c9(0x14e)]('~\x20'+_0x1a8dc5+'\x20changed')+_0x1e51c9(0x1d5)+a4_0x52a25f[_0x1e51c9(0x13e)]('=\x20'+_0x1e77fa+_0x1e51c9(0x1d6))),console[_0x1e51c9(0x18f)](_0x1e51c9(0x182)+formatCountSummary(_0x2b8744[_0x1e51c9(0x14f)][_0x1e51c9(0x1a9)])),console[_0x1e51c9(0x18f)](_0x1e51c9(0x159)+formatCountSummary(_0x2b8744[_0x1e51c9(0x14f)][_0x1e51c9(0x1a1)])),console[_0x1e51c9(0x18f)](_0x1e51c9(0x177)+formatCountSummary(_0x2b8744['counts']['textKnowledgeBases'])),console[_0x1e51c9(0x18f)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x2b8744['counts'][_0x1e51c9(0x1d4)])),console[_0x1e51c9(0x18f)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x2b8744[_0x1e51c9(0x14f)]['integrations'])),console[_0x1e51c9(0x18f)](_0x1e51c9(0x158)+a4_0x52a25f[_0x1e51c9(0x16c)](_0x55f46d)),displayDiffs(_0x2b8744[_0x1e51c9(0x1a9)],_0x2b8744[_0x1e51c9(0x1a1)],_0x2b8744[_0x1e51c9(0x15c)],_0x2b8744[_0x1e51c9(0x1d4)],_0x2b8744['integrations']);if(_0x2f79cb)return console['log'](a4_0x52a25f['yellow'](_0x1e51c9(0x157))),0x0;if(_0x43e0cd===0x0&&_0x1a8dc5===0x0){console['log'](a4_0x52a25f[_0x1e51c9(0x176)](_0x1e51c9(0x1d1)));const _0x16182e=getLLMProjectUrl(_0x70dbfc,_0x2b8744[_0x1e51c9(0x16a)]);return console[_0x1e51c9(0x18f)]('Project:\x20'+a4_0x52a25f['cyan'](_0x16182e)),0x0;}if(!_0xbfc535&&!_0x5e7149){const _0x2789c7=await confirmKey('\x0aPush\x20'+(_0x43e0cd+_0x1a8dc5)+_0x1e51c9(0x19c));if(!_0x2789c7)return console[_0x1e51c9(0x18f)](_0x1e51c9(0x1a4)),0x0;}const {data:_0x3aa4c8}=await withSpinner(_0x1e51c9(0x143),()=>_0x45be76[_0x1e51c9(0x1a5)][_0x1e51c9(0x16f)](_0x55f46d,{'force':_0x5e7149})),_0x1d6aa6=_0x3aa4c8[_0x1e51c9(0x14f)][_0x1e51c9(0x1a9)][_0x1e51c9(0x1ac)]>0x0||_0x3aa4c8['counts'][_0x1e51c9(0x1a1)][_0x1e51c9(0x1ac)]>0x0||_0x3aa4c8[_0x1e51c9(0x14f)][_0x1e51c9(0x15c)][_0x1e51c9(0x1ac)]>0x0||_0x3aa4c8['counts']['prompts'][_0x1e51c9(0x1ac)]>0x0;if(_0x1d6aa6){console[_0x1e51c9(0x18f)](a4_0x52a25f[_0x1e51c9(0x14e)](_0x1e51c9(0x19f))),console[_0x1e51c9(0x18f)](),console[_0x1e51c9(0x18f)](a4_0x52a25f[_0x1e51c9(0x170)](_0x1e51c9(0x1d2)));for(const _0x5b02fc of _0x3aa4c8[_0x1e51c9(0x1a9)]){_0x5b02fc[_0x1e51c9(0x1b6)]===_0x1e51c9(0x15d)&&console[_0x1e51c9(0x18f)](a4_0x52a25f['red']('\x20\x20Agent\x20\x22'+_0x5b02fc[_0x1e51c9(0x1cc)]+_0x1e51c9(0x187)+_0x5b02fc[_0x1e51c9(0x15d)]));}for(const _0x95aadd of _0x3aa4c8[_0x1e51c9(0x1a1)]){_0x95aadd[_0x1e51c9(0x1b6)]===_0x1e51c9(0x15d)&&console[_0x1e51c9(0x18f)](a4_0x52a25f['red'](_0x1e51c9(0x188)+_0x95aadd[_0x1e51c9(0x163)]+'\x22:\x20'+_0x95aadd['error']));}for(const _0x5be4ef of _0x3aa4c8['textKnowledgeBases']){_0x5be4ef[_0x1e51c9(0x1b6)]===_0x1e51c9(0x15d)&&console[_0x1e51c9(0x18f)](a4_0x52a25f['red'](_0x1e51c9(0x1c5)+_0x5be4ef[_0x1e51c9(0x163)]+'\x22:\x20'+_0x5be4ef[_0x1e51c9(0x15d)]));}for(const _0x427bf7 of _0x3aa4c8[_0x1e51c9(0x1d4)]){_0x427bf7[_0x1e51c9(0x1b6)]===_0x1e51c9(0x15d)&&console[_0x1e51c9(0x18f)](a4_0x52a25f['red'](_0x1e51c9(0x171)+_0x427bf7[_0x1e51c9(0x163)]+'\x22:\x20'+_0x427bf7[_0x1e51c9(0x15d)]));}for(const _0x28a4c1 of _0x3aa4c8['integrations']){_0x28a4c1[_0x1e51c9(0x1b6)]==='error'&&console['log'](a4_0x52a25f[_0x1e51c9(0x170)]('\x20\x20Integration\x20\x22'+_0x28a4c1['name']+_0x1e51c9(0x187)+_0x28a4c1[_0x1e51c9(0x15d)]));}return 0x1;}console['log'](a4_0x52a25f[_0x1e51c9(0x176)](_0x1e51c9(0x175)+(_0x43e0cd+_0x1a8dc5)+_0x1e51c9(0x183)+_0x3aa4c8[_0x1e51c9(0x13d)]+'\x27'));const _0x314135=getLLMProjectUrl(_0x70dbfc,_0x3aa4c8[_0x1e51c9(0x16a)]);return console[_0x1e51c9(0x18f)]('Project:\x20'+a4_0x52a25f[_0x1e51c9(0x16c)](_0x314135)),0x0;}}
|
|
1
|
+
const a4_0x3bc24c=a4_0x6439;(function(_0x5ac579,_0x505fb9){const _0xb3c386=a4_0x6439,_0x52f27d=_0x5ac579();while(!![]){try{const _0x3d2764=-parseInt(_0xb3c386(0x112))/0x1*(parseInt(_0xb3c386(0x10f))/0x2)+-parseInt(_0xb3c386(0x12d))/0x3+-parseInt(_0xb3c386(0x137))/0x4*(-parseInt(_0xb3c386(0xe4))/0x5)+parseInt(_0xb3c386(0xf7))/0x6*(-parseInt(_0xb3c386(0x153))/0x7)+parseInt(_0xb3c386(0x111))/0x8*(parseInt(_0xb3c386(0x14b))/0x9)+parseInt(_0xb3c386(0x16f))/0xa+parseInt(_0xb3c386(0x151))/0xb;if(_0x3d2764===_0x505fb9)break;else _0x52f27d['push'](_0x52f27d['shift']());}catch(_0x167c9a){_0x52f27d['push'](_0x52f27d['shift']());}}}(a4_0x4c7b,0xecfc0));import a4_0x3e39b5 from'chalk';import a4_0x2c0c07 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';function a4_0x4c7b(){const _0x5dae1c=['\x22:\x20','join','<new-name>','found','error','cloneProject','no_local_folder','\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','projectName','outputDir','errors','\x20\x20Target:\x20','push','656043hsxqhj','\x0aChanges\x20to\x20agent\x20\x27','\x20\x20Integrations:\x20','Using\x20project:\x20','\x0aChanges:','log','\x20\x20tdx\x20agent\x20clone\x20agents/','action','Would\x20pull\x20agent:\x20','Cannot\x20clone\x20from\x20context\x20project\x20\x22','8XvPyUF','\x22\x20to\x20\x22','INVALID_ARGUMENT','\x0a✔\x20Pushed\x20','New\x20project\x20name\x20is\x20required','Project:\x20','Chat:\x20','pushAgent','diff','created','\x20total','\x20\x20Text\x20Knowledge\x20Base\x20\x22','Failed\x20to\x20push\x20agent:\x20','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x20\x20Agent\x20\x22','Using\x20local\x20project:\x20','Agent\x20pulled\x20successfully','New\x20project\x20ID:\x20','knowledgeBases','Pull\x20cancelled','7266357TGoZKH','Errors:','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','Project\x20cloned\x20with\x20errors','\x20\x20Prompts:\x20','\x0aPull\x20summary\x20for\x20\x27','10798183mIbfNu','Agent\x20','133294Rrxzuz','\x20files?','\x0aChanges\x20to\x20integration\x20\x27','cyan','isNew','New\x20project:\x20','Output:\x20','repeat','\x20--name\x20','newProjectId','\x20errors','Agent:\x20','counts','description','tdx.json','session','\x20--profile\x20','hasChanges','outputPath','gray','\x20=\x20','Source:\x20','\x0aWrite\x20','agent:push','dim','sourceProjectName','\x20files\x20to\x20','agent.yml','8594800ptykOu','Clone\x20cancelled','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent','agent:pull','\x20\x20Agents:\x20','\x22\x20to\x20new\x20project\x20\x22','\x22\x20from\x20project\x20\x22','pullProject','Would\x20clone:','\x0aPush\x20','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','integrations','source','\x22\x20to\x20a\x20different\x20profile','dirname','yellow','\x20\x20Knowledge\x20Bases:\x20','cwd','Project\x20cloned\x20successfully','\x20resources\x20to\x20\x27','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','utf-8','llm','dryRun','site','no_context','yes','\x0a✔\x20Pulled\x20','Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','unchanged','llmProject','197755IQBhrv','agentName','Dry\x20run\x20-\x20no\x20changes\x20made','\x20unchanged','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','pushProject','\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','reason','\x20\x20Knowledge\x20Base\x20\x22','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','prompts','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','\x0aPush\x20summary\x20for\x20\x27','newProjectName','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','agents','\x20changed','600dhqxzD','Dry\x20run\x20-\x20no\x20files\x20written','textKnowledgeBases','Status:\x20','red','\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)','total','Analyzing\x20changes\x20to\x20push...','\x20\x20Integration\x20\x22','\x20created','Pushing\x20to\x20project...','Using\x20current\x20project:\x20','context','message','\x22...','green','Analyzing\x20project\x20\x22','name','force','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','new','\x20\x20Prompt\x20\x22','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','agentId','4rvQeKW','projectId','16ZTlfBg','220706sPmxqL','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','Push\x20cancelled','llm_project','updated','\x20|\x20','✔\x20Context\x20set:\x20','execute','Cloning\x20\x22','\x0aProject\x20pushed\x20with\x20errors','Using\x20project\x20from\x20','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','No\x20tdx.json\x20found\x20in\x20','projectDir'];a4_0x4c7b=function(){return _0x5dae1c;};return a4_0x4c7b();}import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x36a4ba){const _0x5cd82a=a4_0x6439,_0x4cea32=[];if(_0x36a4ba['total']!==undefined)_0x4cea32[_0x5cd82a(0x12c)](_0x36a4ba[_0x5cd82a(0xfd)]+_0x5cd82a(0x141));if(_0x36a4ba[_0x5cd82a(0x10b)]!==undefined&&_0x36a4ba[_0x5cd82a(0x10b)]>0x0)_0x4cea32['push'](a4_0x3e39b5['green'](_0x36a4ba[_0x5cd82a(0x10b)]+'\x20new'));if(_0x36a4ba[_0x5cd82a(0x140)]!==undefined&&_0x36a4ba[_0x5cd82a(0x140)]>0x0)_0x4cea32[_0x5cd82a(0x12c)](a4_0x3e39b5[_0x5cd82a(0x106)](_0x36a4ba[_0x5cd82a(0x140)]+_0x5cd82a(0x100)));if(_0x36a4ba[_0x5cd82a(0x116)]!==undefined&&_0x36a4ba['updated']>0x0)_0x4cea32[_0x5cd82a(0x12c)](a4_0x3e39b5[_0x5cd82a(0x17e)](_0x36a4ba[_0x5cd82a(0x116)]+'\x20updated'));if(_0x36a4ba[_0x5cd82a(0xe2)]!==undefined&&_0x36a4ba[_0x5cd82a(0xe2)]>0x0)_0x4cea32[_0x5cd82a(0x12c)](a4_0x3e39b5['gray'](_0x36a4ba[_0x5cd82a(0xe2)]+'\x20unchanged'));if(_0x36a4ba[_0x5cd82a(0x12a)]!==undefined&&_0x36a4ba['errors']>0x0)_0x4cea32[_0x5cd82a(0x12c)](a4_0x3e39b5['red'](_0x36a4ba['errors']+_0x5cd82a(0x15d)));return _0x4cea32[_0x5cd82a(0x121)](',\x20');}function a4_0x6439(_0x3085b3,_0x162f02){_0x3085b3=_0x3085b3-0xd6;const _0x4c7b4b=a4_0x4c7b();let _0x6439f8=_0x4c7b4b[_0x3085b3];return _0x6439f8;}function displayDiffs(_0x34ab86,_0x169000,_0x4d3730,_0x2e38d2,_0x24d777=[]){const _0x402deb=a4_0x6439;for(const _0x27965b of _0x34ab86){if(_0x27965b[_0x402deb(0x13f)]){const _0x158c27=_0x27965b['agentName']||_0x27965b['name'];console[_0x402deb(0x132)](_0x402deb(0x12e)+_0x158c27+'\x27:'),console['log']('─'[_0x402deb(0x15a)](0x3c)),console[_0x402deb(0x132)](_0x27965b[_0x402deb(0x13f)]),console[_0x402deb(0x132)]('─'[_0x402deb(0x15a)](0x3c));}}for(const _0x10fb25 of _0x169000){_0x10fb25[_0x402deb(0x13f)]&&(console[_0x402deb(0x132)](_0x402deb(0xee)+_0x10fb25[_0x402deb(0x108)]+'\x27:'),console[_0x402deb(0x132)]('─'[_0x402deb(0x15a)](0x3c)),console[_0x402deb(0x132)](_0x10fb25[_0x402deb(0x13f)]),console[_0x402deb(0x132)]('─'[_0x402deb(0x15a)](0x3c)));}for(const _0x3a3a24 of _0x4d3730){_0x3a3a24[_0x402deb(0x13f)]&&(console[_0x402deb(0x132)](_0x402deb(0x113)+_0x3a3a24[_0x402deb(0x108)]+'\x27:'),console[_0x402deb(0x132)]('─'[_0x402deb(0x15a)](0x3c)),console[_0x402deb(0x132)](_0x3a3a24[_0x402deb(0x13f)]),console[_0x402deb(0x132)]('─'[_0x402deb(0x15a)](0x3c)));}for(const _0x3b37d5 of _0x2e38d2){_0x3b37d5[_0x402deb(0x13f)]&&(console['log']('\x0aChanges\x20to\x20prompt\x20\x27'+_0x3b37d5[_0x402deb(0x108)]+'\x27:'),console[_0x402deb(0x132)]('─'[_0x402deb(0x15a)](0x3c)),console[_0x402deb(0x132)](_0x3b37d5[_0x402deb(0x13f)]),console['log']('─'[_0x402deb(0x15a)](0x3c)));}for(const _0x528d91 of _0x24d777){_0x528d91['diff']&&(console['log'](_0x402deb(0x155)+_0x528d91[_0x402deb(0x108)]+'\x27:'),console['log']('─'[_0x402deb(0x15a)](0x3c)),console['log'](_0x528d91[_0x402deb(0x13f)]),console['log']('─'[_0x402deb(0x15a)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x3bc24c(0x108)]=a4_0x3bc24c(0x172);[a4_0x3bc24c(0x160)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x3bc24c(0x119)](_0x572f43){const _0x57fac3=a4_0x3bc24c,{options:_0xf05adc,args:_0x3809a4,tdx:_0x298ebe}=_0x572f43,_0x8e71dd=_0x3809a4[0x0],_0x14022d=_0x3809a4[0x1],_0x29cc80=_0xf05adc['output'],_0x349675=_0xf05adc[_0x57fac3(0xdc)],_0xeef37c=_0xf05adc['force'],_0x40d0fb=_0xf05adc[_0x57fac3(0xdf)],_0xe89fd6=_0xf05adc[_0x57fac3(0xe3)];let _0x29c480,_0x26c53c;const _0x176283=findAgentConfigPath(process['cwd']());if(_0x8e71dd){const _0x5b1343=a4_0x2c0c07[_0x57fac3(0x121)](_0x8e71dd,_0x57fac3(0x161));if(existsSync(_0x5b1343))try{const _0x3e0b85=JSON['parse'](readFileSync(_0x5b1343,_0x57fac3(0xda)));_0x29c480=_0x3e0b85['llm_project'],_0x26c53c=_0x8e71dd,console[_0x57fac3(0x132)](a4_0x3e39b5['dim'](_0x57fac3(0x11c)+_0x5b1343+':\x20'+_0x29c480));}catch{_0x29c480=_0x8e71dd;}else _0x29c480=_0x8e71dd;}else{if(_0x176283)try{const _0x4b9a5c=JSON['parse'](readFileSync(_0x176283,_0x57fac3(0xda)));_0x29c480=_0x4b9a5c['llm_project'],_0x26c53c=a4_0x2c0c07[_0x57fac3(0x17d)](_0x176283),console['log'](a4_0x3e39b5[_0x57fac3(0x16b)]('Using\x20project:\x20'+_0x29c480));}catch{_0x29c480=_0xe89fd6;}else _0x29c480=_0xe89fd6;}if(!_0x29c480)return console[_0x57fac3(0x132)](a4_0x3e39b5[_0x57fac3(0x17e)](_0x57fac3(0x179))),console['log'](_0x57fac3(0xe1)),console[_0x57fac3(0x132)](_0x57fac3(0xeb)),console[_0x57fac3(0x132)](_0x57fac3(0x127)),console['log'](_0x57fac3(0x171)),0x1;if(_0x14022d){const {data:_0x2597ef}=await withSpinner('Pulling\x20agent\x20\x22'+_0x14022d+_0x57fac3(0x175)+_0x29c480+_0x57fac3(0x105),()=>_0x298ebe['llm']['pullAgent'](_0x29c480,_0x14022d,_0x29cc80,{'dryRun':_0x349675,'force':_0xeef37c}));if(_0x349675)return console[_0x57fac3(0x132)](a4_0x3e39b5[_0x57fac3(0x17e)](_0x57fac3(0xf8))),console[_0x57fac3(0x132)](_0x57fac3(0x135)+_0x2597ef[_0x57fac3(0xe5)]),console['log']('Output\x20path:\x20'+_0x2597ef['outputPath']),_0x2597ef[_0x57fac3(0x13f)]&&(console[_0x57fac3(0x132)](_0x57fac3(0x131)),console[_0x57fac3(0x132)]('─'[_0x57fac3(0x15a)](0x3c)),console[_0x57fac3(0x132)](_0x2597ef[_0x57fac3(0x13f)]),console['log']('─'[_0x57fac3(0x15a)](0x3c))),0x0;return console[_0x57fac3(0x132)](a4_0x3e39b5[_0x57fac3(0x106)](_0x57fac3(0x147))),console[_0x57fac3(0x132)](_0x57fac3(0x15e)+_0x2597ef[_0x57fac3(0xe5)]),console[_0x57fac3(0x132)](_0x57fac3(0x159)+_0x2597ef[_0x57fac3(0x165)]),console['log'](_0x57fac3(0xfa)+(_0x2597ef[_0x57fac3(0x157)]?a4_0x3e39b5[_0x57fac3(0x106)]('new'):_0x2597ef[_0x57fac3(0x164)]?a4_0x3e39b5['yellow'](_0x57fac3(0x116)):a4_0x3e39b5[_0x57fac3(0x166)]('unchanged'))),0x0;}const _0x6d991=_0x26c53c||_0x29cc80,{data:_0x2d0417}=await withSpinner(_0x57fac3(0x107)+_0x29c480+_0x57fac3(0x105),()=>_0x298ebe['llm'][_0x57fac3(0x176)](_0x29c480,_0x6d991,{'dryRun':!![]})),_0x2d2457=_0x2d0417[_0x57fac3(0x15f)][_0x57fac3(0xf5)][_0x57fac3(0x10b)]+_0x2d0417[_0x57fac3(0x15f)][_0x57fac3(0x149)][_0x57fac3(0x10b)]+_0x2d0417[_0x57fac3(0x15f)]['textKnowledgeBases'][_0x57fac3(0x10b)]+_0x2d0417[_0x57fac3(0x15f)]['prompts'][_0x57fac3(0x10b)]+_0x2d0417[_0x57fac3(0x15f)][_0x57fac3(0x17a)]['new'],_0x4bddbe=_0x2d0417['counts'][_0x57fac3(0xf5)]['updated']+_0x2d0417[_0x57fac3(0x15f)][_0x57fac3(0x149)][_0x57fac3(0x116)]+_0x2d0417[_0x57fac3(0x15f)][_0x57fac3(0xf9)][_0x57fac3(0x116)]+_0x2d0417['counts'][_0x57fac3(0xef)][_0x57fac3(0x116)]+_0x2d0417[_0x57fac3(0x15f)]['integrations'][_0x57fac3(0x116)],_0x35a065=_0x2d0417[_0x57fac3(0x15f)]['agents'][_0x57fac3(0xe2)]+_0x2d0417['counts'][_0x57fac3(0x149)][_0x57fac3(0xe2)]+_0x2d0417[_0x57fac3(0x15f)][_0x57fac3(0xf9)][_0x57fac3(0xe2)]+_0x2d0417[_0x57fac3(0x15f)]['prompts'][_0x57fac3(0xe2)]+_0x2d0417[_0x57fac3(0x15f)]['integrations'][_0x57fac3(0xe2)];console['log'](_0x57fac3(0x150)+_0x2d0417[_0x57fac3(0x128)]+'\x27:'),console[_0x57fac3(0x132)]('\x20\x20'+a4_0x3e39b5[_0x57fac3(0x106)]('+\x20'+_0x2d2457+'\x20new')+_0x57fac3(0x117)+a4_0x3e39b5[_0x57fac3(0x17e)]('~\x20'+_0x4bddbe+_0x57fac3(0xf6))+_0x57fac3(0x117)+a4_0x3e39b5[_0x57fac3(0x16b)]('=\x20'+_0x35a065+'\x20unchanged')),console[_0x57fac3(0x132)](_0x57fac3(0x173)+formatCountSummary(_0x2d0417[_0x57fac3(0x15f)][_0x57fac3(0xf5)])),console[_0x57fac3(0x132)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x2d0417[_0x57fac3(0x15f)][_0x57fac3(0x149)])),console[_0x57fac3(0x132)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x2d0417['counts'][_0x57fac3(0xf9)])),console['log'](_0x57fac3(0x14f)+formatCountSummary(_0x2d0417[_0x57fac3(0x15f)][_0x57fac3(0xef)])),console[_0x57fac3(0x132)](_0x57fac3(0x12f)+formatCountSummary(_0x2d0417[_0x57fac3(0x15f)][_0x57fac3(0x17a)])),console[_0x57fac3(0x132)](_0x57fac3(0x12b)+a4_0x3e39b5[_0x57fac3(0x156)](_0x2d0417[_0x57fac3(0x129)])),displayDiffs(_0x2d0417[_0x57fac3(0xf5)],_0x2d0417['knowledgeBases'],_0x2d0417[_0x57fac3(0xf9)],_0x2d0417[_0x57fac3(0xef)],_0x2d0417['integrations']);if(_0x349675)return console[_0x57fac3(0x132)](a4_0x3e39b5[_0x57fac3(0x17e)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x2d2457===0x0&&_0x4bddbe===0x0)return console[_0x57fac3(0x132)](a4_0x3e39b5[_0x57fac3(0x106)](_0x57fac3(0xf4))),saveSessionContext({'llm_project':_0x2d0417[_0x57fac3(0x128)]},_0xf05adc[_0x57fac3(0x162)]),console[_0x57fac3(0x132)](a4_0x3e39b5[_0x57fac3(0x106)](_0x57fac3(0x118)+a4_0x3e39b5[_0x57fac3(0x16b)]('llm_project')+_0x57fac3(0x167)+a4_0x3e39b5[_0x57fac3(0x156)](_0x2d0417[_0x57fac3(0x128)]))),0x0;if(!_0x40d0fb&&!_0xeef37c){const _0x5d5643=await confirmKey(_0x57fac3(0x169)+(_0x2d2457+_0x4bddbe)+_0x57fac3(0x154));if(!_0x5d5643)return console[_0x57fac3(0x132)](_0x57fac3(0x14a)),0x0;}const {data:_0x47136d}=await withSpinner('Writing\x20files...',()=>_0x298ebe[_0x57fac3(0xdb)][_0x57fac3(0x176)](_0x29c480,_0x6d991,{'force':_0xeef37c}));return console['log'](a4_0x3e39b5[_0x57fac3(0x106)](_0x57fac3(0xe0)+(_0x2d2457+_0x4bddbe)+_0x57fac3(0x16d)+_0x47136d['outputDir'])),saveSessionContext({'llm_project':_0x47136d[_0x57fac3(0x128)]},_0xf05adc[_0x57fac3(0x162)]),console[_0x57fac3(0x132)](a4_0x3e39b5[_0x57fac3(0x106)](_0x57fac3(0x118)+a4_0x3e39b5[_0x57fac3(0x16b)](_0x57fac3(0x115))+_0x57fac3(0x167)+a4_0x3e39b5['cyan'](_0x47136d[_0x57fac3(0x128)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x3bc24c(0x108)]='agent:clone';[a4_0x3bc24c(0x160)]='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async['execute'](_0x3c23f2){const _0x9503c=a4_0x3bc24c,{options:_0x2ba719,args:_0x3b8fb7,tdx:_0x569ad9}=_0x3c23f2,_0x351390=_0x3b8fb7[0x0],_0x83c9f=_0x2ba719[_0x9503c(0x108)],_0x7441ad=_0x2ba719[_0x9503c(0xdc)],_0x4c7587=_0x2ba719['yes'],_0x1d0154=_0x2ba719[_0x9503c(0xdd)],_0x43e5a0=_0x2ba719['llmProject'];let _0x5c68e6;const _0x544aff=findAgentConfigPath(process[_0x9503c(0xd6)]());if(_0x351390){const _0x2dd48b=a4_0x2c0c07['join'](_0x351390,_0x9503c(0x161));existsSync(_0x2dd48b)?(_0x5c68e6=_0x351390,console[_0x9503c(0x132)](a4_0x3e39b5['dim'](_0x9503c(0x146)+_0x351390))):_0x5c68e6=_0x351390;}else{if(_0x544aff)_0x5c68e6=a4_0x2c0c07[_0x9503c(0x17d)](_0x544aff),console[_0x9503c(0x132)](a4_0x3e39b5['dim'](_0x9503c(0x102)+_0x5c68e6));else{if(_0x43e5a0){const _0x5b472d=sanitizeForFilesystem(_0x43e5a0);let _0x1ac591=_0x5b472d,_0x5ce9ca=a4_0x2c0c07[_0x9503c(0x121)](process[_0x9503c(0xd6)](),_0x9503c(0xf5),_0x5b472d,_0x9503c(0x161));if(!existsSync(_0x5ce9ca)){const _0x457a3c=normalizeName(_0x43e5a0),_0x422a27=a4_0x2c0c07[_0x9503c(0x121)](process[_0x9503c(0xd6)](),_0x9503c(0xf5),_0x457a3c,_0x9503c(0x161));existsSync(_0x422a27)&&(_0x1ac591=_0x457a3c,_0x5ce9ca=_0x422a27);}if(existsSync(_0x5ce9ca))_0x5c68e6=a4_0x2c0c07[_0x9503c(0x17d)](_0x5ce9ca),console[_0x9503c(0x132)](a4_0x3e39b5[_0x9503c(0x16b)](_0x9503c(0x146)+_0x5c68e6));else{const _0x51320a=_0x2ba719['profile'];if(_0x51320a)throw new SDKError(ErrorCode[_0x9503c(0x139)],_0x9503c(0x136)+_0x43e5a0+_0x9503c(0x17c),undefined,{'helpText':_0x9503c(0xd9)+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+('\x20\x20tdx\x20agent\x20pull\x20'+_0x43e5a0+'\x0a')+(_0x9503c(0x133)+_0x1ac591+_0x9503c(0x15b)+(_0x83c9f||_0x9503c(0x122))+_0x9503c(0x163)+_0x51320a)});_0x5c68e6=_0x43e5a0,console[_0x9503c(0x132)](a4_0x3e39b5[_0x9503c(0x16b)]('Using\x20context\x20project:\x20'+_0x43e5a0));}}}}if(!_0x5c68e6)return console[_0x9503c(0x132)](a4_0x3e39b5[_0x9503c(0x17e)](_0x9503c(0xf0))),console['log'](_0x9503c(0x11d)),console[_0x9503c(0x132)](_0x9503c(0x14d)),console[_0x9503c(0x132)](_0x9503c(0xfc)),console[_0x9503c(0x132)](_0x9503c(0x10d)),0x1;if(!_0x83c9f)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x9503c(0x13b),undefined,{'helpText':_0x9503c(0xe8)});if(!_0x4c7587&&!_0x7441ad){const _0x5573b0=await confirmKey('Clone\x20\x22'+_0x5c68e6+_0x9503c(0x174)+_0x83c9f+'\x22?');if(!_0x5573b0)return console['log'](_0x9503c(0x170)),0x0;}const {data:_0x1ac336}=await withSpinner(_0x9503c(0x11a)+_0x5c68e6+_0x9503c(0x138)+_0x83c9f+_0x9503c(0x105),()=>_0x569ad9['llm'][_0x9503c(0x125)](_0x5c68e6,_0x83c9f,{'dryRun':_0x7441ad}));if(_0x7441ad)return console['log'](a4_0x3e39b5[_0x9503c(0x17e)](_0x9503c(0xe6))),console[_0x9503c(0x132)]('Source:\x20'+_0x1ac336[_0x9503c(0x16c)]),console[_0x9503c(0x132)](_0x9503c(0x158)+_0x83c9f),console['log'](_0x9503c(0x177)),console['log'](_0x9503c(0x173)+_0x1ac336[_0x9503c(0x15f)]['agents']['created']),console[_0x9503c(0x132)]('\x20\x20Knowledge\x20Bases:\x20'+_0x1ac336[_0x9503c(0x15f)]['knowledgeBases'][_0x9503c(0x140)]),console[_0x9503c(0x132)]('\x20\x20Prompts:\x20'+_0x1ac336[_0x9503c(0x15f)][_0x9503c(0xef)]['created']),0x0;const _0x4cb455=_0x1ac336[_0x9503c(0x15f)]['agents'][_0x9503c(0x12a)]>0x0||_0x1ac336[_0x9503c(0x15f)][_0x9503c(0x149)][_0x9503c(0x12a)]>0x0||_0x1ac336[_0x9503c(0x15f)][_0x9503c(0xef)]['errors']>0x0;_0x4cb455?console[_0x9503c(0x132)](a4_0x3e39b5[_0x9503c(0x17e)](_0x9503c(0x14e))):console[_0x9503c(0x132)](a4_0x3e39b5[_0x9503c(0x106)](_0x9503c(0xd7)));console[_0x9503c(0x132)](_0x9503c(0x168)+_0x1ac336['sourceProjectName']),console[_0x9503c(0x132)]('New\x20project:\x20'+_0x1ac336[_0x9503c(0xf2)]),console[_0x9503c(0x132)](_0x9503c(0x148)+_0x1ac336[_0x9503c(0x15c)]),console[_0x9503c(0x132)](),console[_0x9503c(0x132)]('Summary:'),console[_0x9503c(0x132)](_0x9503c(0x173)+formatCountSummary(_0x1ac336[_0x9503c(0x15f)][_0x9503c(0xf5)])),console[_0x9503c(0x132)](_0x9503c(0x17f)+formatCountSummary(_0x1ac336[_0x9503c(0x15f)][_0x9503c(0x149)])),console[_0x9503c(0x132)](_0x9503c(0x14f)+formatCountSummary(_0x1ac336['counts'][_0x9503c(0xef)])),console[_0x9503c(0x132)](_0x9503c(0x12f)+formatCountSummary(_0x1ac336[_0x9503c(0x15f)]['integrations']));if(_0x4cb455){console[_0x9503c(0x132)](),console['log'](a4_0x3e39b5[_0x9503c(0xfb)](_0x9503c(0x14c)));for(const _0x524834 of _0x1ac336[_0x9503c(0xf5)]){_0x524834[_0x9503c(0x134)]===_0x9503c(0x124)&&console[_0x9503c(0x132)](a4_0x3e39b5[_0x9503c(0xfb)](_0x9503c(0x145)+_0x524834[_0x9503c(0xe5)]+_0x9503c(0x120)+_0x524834[_0x9503c(0x124)]));}for(const _0x3831c4 of _0x1ac336['knowledgeBases']){_0x3831c4['action']===_0x9503c(0x124)&&console[_0x9503c(0x132)](a4_0x3e39b5[_0x9503c(0xfb)](_0x9503c(0xed)+_0x3831c4['name']+_0x9503c(0x120)+_0x3831c4[_0x9503c(0x124)]));}for(const _0xaedaf2 of _0x1ac336['prompts']){_0xaedaf2[_0x9503c(0x134)]===_0x9503c(0x124)&&console['log'](a4_0x3e39b5['red'](_0x9503c(0x10c)+_0xaedaf2[_0x9503c(0x108)]+_0x9503c(0x120)+_0xaedaf2[_0x9503c(0x124)]));}for(const _0x2557f7 of _0x1ac336[_0x9503c(0x17a)]){_0x2557f7['action']===_0x9503c(0x124)&&console[_0x9503c(0x132)](a4_0x3e39b5[_0x9503c(0xfb)](_0x9503c(0xff)+_0x2557f7['name']+_0x9503c(0x120)+_0x2557f7[_0x9503c(0x124)]));}return 0x1;}console[_0x9503c(0x132)]();const _0x24794e=getLLMProjectUrl(_0x1d0154,_0x1ac336['newProjectId']);return console[_0x9503c(0x132)](_0x9503c(0x13c)+a4_0x3e39b5[_0x9503c(0x156)](_0x24794e)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x3bc24c(0x108)]=a4_0x3bc24c(0x16a);[a4_0x3bc24c(0x160)]=a4_0x3bc24c(0x144);async['execute'](_0xe8da3a){const _0x3bae29=a4_0x3bc24c,{options:_0x3f4568,args:_0x4628b1,tdx:_0x45a48a}=_0xe8da3a;let _0x30540d=_0x4628b1[0x0]||process[_0x3bae29(0xd6)]();const _0x1cabb6=_0x3f4568[_0x3bae29(0xdc)],_0x57dc2b=_0x3f4568[_0x3bae29(0x109)],_0x1d4059=_0x3f4568[_0x3bae29(0xdf)],_0x50efb8=_0x3f4568[_0x3bae29(0xdd)],_0x432ef2=a4_0x2c0c07['join'](_0x30540d,_0x3bae29(0x16e)),_0x4fb8a4=existsSync(_0x432ef2);if(_0x4fb8a4){const {data:_0x4519de}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x30540d+'\x22...',()=>_0x45a48a[_0x3bae29(0xdb)][_0x3bae29(0x13e)](_0x30540d,{'dryRun':_0x1cabb6,'force':_0x57dc2b}));if(_0x1cabb6)return console[_0x3bae29(0x132)](a4_0x3e39b5[_0x3bae29(0x17e)](_0x3bae29(0xe6))),console[_0x3bae29(0x132)]('Would\x20push\x20agent:\x20'+_0x4519de[_0x3bae29(0xe5)]),0x0;if(_0x4519de['action']==='error')return console[_0x3bae29(0x132)](a4_0x3e39b5['red'](_0x3bae29(0x143)+_0x4519de[_0x3bae29(0x124)])),0x1;console[_0x3bae29(0x132)](a4_0x3e39b5['green'](_0x3bae29(0x152)+_0x4519de[_0x3bae29(0x134)]+'\x20successfully')),console['log']('Agent:\x20'+_0x4519de[_0x3bae29(0xe5)]);if(_0x4519de[_0x3bae29(0x10e)]&&_0x4519de[_0x3bae29(0x110)]){const _0x489433=getLLMAgentChatUrl(_0x50efb8,_0x4519de[_0x3bae29(0x110)],_0x4519de[_0x3bae29(0x10e)]);console[_0x3bae29(0x132)](_0x3bae29(0x13d)+a4_0x3e39b5[_0x3bae29(0x156)](_0x489433));}return 0x0;}const _0x2a2519=_0x3f4568['llmProject'],_0x527c06=resolveProjectFromContext(_0x30540d,_0x2a2519);if(_0x527c06[_0x3bae29(0x123)])_0x30540d=_0x527c06[_0x3bae29(0x11f)],_0x527c06[_0x3bae29(0x17b)]===_0x3bae29(0x103)&&console['log'](a4_0x3e39b5[_0x3bae29(0x16b)](_0x3bae29(0x130)+_0x30540d));else{let _0x23fc72=_0x3bae29(0xe9);_0x527c06['reason']===_0x3bae29(0x126)&&(_0x23fc72=_0x527c06[_0x3bae29(0x104)]+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x527c06['llmProject']+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode[_0x3bae29(0x139)],_0x527c06[_0x3bae29(0xec)]===_0x3bae29(0xde)?_0x527c06[_0x3bae29(0x104)]:_0x3bae29(0x11e)+_0x30540d,undefined,{'helpText':_0x23fc72});}const {data:_0x26ad27}=await withSpinner(_0x3bae29(0xfe),()=>_0x45a48a[_0x3bae29(0xdb)][_0x3bae29(0xea)](_0x30540d,{'dryRun':!![]})),_0xa5c145=_0x26ad27[_0x3bae29(0x15f)]['agents'][_0x3bae29(0x12a)]>0x0;if(_0xa5c145){console['log'](a4_0x3e39b5[_0x3bae29(0xfb)]('\x0aErrors\x20found:'));for(const _0x20452c of _0x26ad27[_0x3bae29(0xf5)]){_0x20452c['action']==='error'&&console[_0x3bae29(0x132)](a4_0x3e39b5[_0x3bae29(0xfb)](_0x3bae29(0x145)+_0x20452c['agentName']+_0x3bae29(0x120)+_0x20452c[_0x3bae29(0x124)]));}return 0x1;}const _0x23df5f=_0x26ad27['counts'][_0x3bae29(0xf5)][_0x3bae29(0x140)]+_0x26ad27[_0x3bae29(0x15f)][_0x3bae29(0x149)][_0x3bae29(0x140)]+_0x26ad27['counts'][_0x3bae29(0xf9)][_0x3bae29(0x140)]+_0x26ad27['counts'][_0x3bae29(0xef)][_0x3bae29(0x140)]+_0x26ad27[_0x3bae29(0x15f)][_0x3bae29(0x17a)]['created'],_0x40a5c9=_0x26ad27[_0x3bae29(0x15f)][_0x3bae29(0xf5)][_0x3bae29(0x116)]+_0x26ad27['counts'][_0x3bae29(0x149)][_0x3bae29(0x116)]+_0x26ad27[_0x3bae29(0x15f)][_0x3bae29(0xf9)][_0x3bae29(0x116)]+_0x26ad27[_0x3bae29(0x15f)][_0x3bae29(0xef)]['updated']+_0x26ad27[_0x3bae29(0x15f)]['integrations'][_0x3bae29(0x116)],_0x4fa088=_0x26ad27[_0x3bae29(0x15f)]['agents'][_0x3bae29(0xe2)]+_0x26ad27[_0x3bae29(0x15f)][_0x3bae29(0x149)][_0x3bae29(0xe2)]+_0x26ad27[_0x3bae29(0x15f)][_0x3bae29(0xf9)][_0x3bae29(0xe2)]+_0x26ad27[_0x3bae29(0x15f)][_0x3bae29(0xef)][_0x3bae29(0xe2)]+_0x26ad27[_0x3bae29(0x15f)][_0x3bae29(0x17a)]['unchanged'];console[_0x3bae29(0x132)](_0x3bae29(0xf1)+_0x26ad27[_0x3bae29(0x128)]+'\x27:'),console['log']('\x20\x20'+a4_0x3e39b5[_0x3bae29(0x106)]('+\x20'+_0x23df5f+'\x20new')+_0x3bae29(0x117)+a4_0x3e39b5[_0x3bae29(0x17e)]('~\x20'+_0x40a5c9+_0x3bae29(0xf6))+_0x3bae29(0x117)+a4_0x3e39b5['dim']('=\x20'+_0x4fa088+_0x3bae29(0xe7))),console[_0x3bae29(0x132)](_0x3bae29(0x173)+formatCountSummary(_0x26ad27[_0x3bae29(0x15f)]['agents'])),console[_0x3bae29(0x132)](_0x3bae29(0x17f)+formatCountSummary(_0x26ad27[_0x3bae29(0x15f)]['knowledgeBases'])),console[_0x3bae29(0x132)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x26ad27[_0x3bae29(0x15f)]['textKnowledgeBases'])),console[_0x3bae29(0x132)](_0x3bae29(0x14f)+formatCountSummary(_0x26ad27[_0x3bae29(0x15f)][_0x3bae29(0xef)])),console[_0x3bae29(0x132)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x26ad27[_0x3bae29(0x15f)][_0x3bae29(0x17a)])),console['log']('\x20\x20Source:\x20'+a4_0x3e39b5[_0x3bae29(0x156)](_0x30540d)),displayDiffs(_0x26ad27['agents'],_0x26ad27[_0x3bae29(0x149)],_0x26ad27[_0x3bae29(0xf9)],_0x26ad27[_0x3bae29(0xef)],_0x26ad27['integrations']);if(_0x1cabb6)return console[_0x3bae29(0x132)](a4_0x3e39b5['yellow'](_0x3bae29(0xf3))),0x0;if(_0x23df5f===0x0&&_0x40a5c9===0x0){console['log'](a4_0x3e39b5[_0x3bae29(0x106)](_0x3bae29(0x10a)));const _0x5d3055=getLLMProjectUrl(_0x50efb8,_0x26ad27[_0x3bae29(0x110)]);return console['log']('Project:\x20'+a4_0x3e39b5[_0x3bae29(0x156)](_0x5d3055)),0x0;}if(!_0x1d4059&&!_0x57dc2b){const _0x345c9b=await confirmKey(_0x3bae29(0x178)+(_0x23df5f+_0x40a5c9)+'\x20resources?');if(!_0x345c9b)return console[_0x3bae29(0x132)](_0x3bae29(0x114)),0x0;}const {data:_0x37603e}=await withSpinner(_0x3bae29(0x101),()=>_0x45a48a[_0x3bae29(0xdb)][_0x3bae29(0xea)](_0x30540d,{'force':_0x57dc2b})),_0x39a396=_0x37603e['counts']['agents'][_0x3bae29(0x12a)]>0x0||_0x37603e[_0x3bae29(0x15f)]['knowledgeBases'][_0x3bae29(0x12a)]>0x0||_0x37603e[_0x3bae29(0x15f)][_0x3bae29(0xf9)][_0x3bae29(0x12a)]>0x0||_0x37603e[_0x3bae29(0x15f)][_0x3bae29(0xef)][_0x3bae29(0x12a)]>0x0;if(_0x39a396){console[_0x3bae29(0x132)](a4_0x3e39b5[_0x3bae29(0x17e)](_0x3bae29(0x11b))),console[_0x3bae29(0x132)](),console[_0x3bae29(0x132)](a4_0x3e39b5[_0x3bae29(0xfb)](_0x3bae29(0x14c)));for(const _0x5e8206 of _0x37603e['agents']){_0x5e8206[_0x3bae29(0x134)]===_0x3bae29(0x124)&&console[_0x3bae29(0x132)](a4_0x3e39b5[_0x3bae29(0xfb)](_0x3bae29(0x145)+_0x5e8206[_0x3bae29(0xe5)]+_0x3bae29(0x120)+_0x5e8206[_0x3bae29(0x124)]));}for(const _0x987d56 of _0x37603e['knowledgeBases']){_0x987d56['action']==='error'&&console['log'](a4_0x3e39b5[_0x3bae29(0xfb)](_0x3bae29(0xed)+_0x987d56['name']+_0x3bae29(0x120)+_0x987d56['error']));}for(const _0x59654e of _0x37603e[_0x3bae29(0xf9)]){_0x59654e[_0x3bae29(0x134)]===_0x3bae29(0x124)&&console[_0x3bae29(0x132)](a4_0x3e39b5['red'](_0x3bae29(0x142)+_0x59654e[_0x3bae29(0x108)]+_0x3bae29(0x120)+_0x59654e[_0x3bae29(0x124)]));}for(const _0x593594 of _0x37603e['prompts']){_0x593594[_0x3bae29(0x134)]==='error'&&console[_0x3bae29(0x132)](a4_0x3e39b5[_0x3bae29(0xfb)](_0x3bae29(0x10c)+_0x593594[_0x3bae29(0x108)]+_0x3bae29(0x120)+_0x593594[_0x3bae29(0x124)]));}for(const _0x2de1d0 of _0x37603e[_0x3bae29(0x17a)]){_0x2de1d0[_0x3bae29(0x134)]===_0x3bae29(0x124)&&console[_0x3bae29(0x132)](a4_0x3e39b5[_0x3bae29(0xfb)]('\x20\x20Integration\x20\x22'+_0x2de1d0[_0x3bae29(0x108)]+_0x3bae29(0x120)+_0x2de1d0[_0x3bae29(0x124)]));}return 0x1;}console['log'](a4_0x3e39b5['green'](_0x3bae29(0x13a)+(_0x23df5f+_0x40a5c9)+_0x3bae29(0xd8)+_0x37603e[_0x3bae29(0x128)]+'\x27'));const _0x415414=getLLMProjectUrl(_0x50efb8,_0x37603e[_0x3bae29(0x110)]);return console[_0x3bae29(0x132)](_0x3bae29(0x13c)+a4_0x3e39b5[_0x3bae29(0x156)](_0x415414)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a5_0x45af(_0x467e81,_0x3c8bec){_0x467e81=_0x467e81-0xdd;const _0x14ffe9=a5_0x14ff();let _0x45afdc=_0x14ffe9[_0x467e81];return _0x45afdc;}const a5_0xbd1f9b=a5_0x45af;function a5_0x14ff(){const _0xc10d5c=['Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','stop','Evaluating\x20response...','some','context','verbose','split','white','...','✗\x20ERROR:\x20Project\x20not\x20found:\x20','Run\x20\x27tdx\x20agent\x20pull\x20','llm','multiple_agents','resolveProjectId','...\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','Test\x20Configuration:','tsv','agentName','includes','Total:\x20\x20\x20\x20','Agent:\x20','round','Executing\x20new\x20tests...','Failed:\x20\x20\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)','Cached\x20run\x20is\x20from\x20site\x20\x22','Errors:\x20\x20\x20','✗\x20ERROR:\x20','1ibpTyA','description','Error:\x20No\x20previous\x20test\x20run\x20found.','No\x20tests\x20found\x20matching:\x20','reason','✓\x20PASS:\x20','cyan','\x20\x20Project:\x20','push','log','table','now','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','7dOoXPc','found','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','has','agent:test','\x22:\x20','\x20(cached)','Run\x20tests\x20for\x20an\x20LLM\x20agent','not\x20found','repeat','no_local_folder','add','status','substring','942117wFrhCe','Duration:\x20','toISOString','no_tests','executeReeval','2645310JprDUr','resolve','utf-8','find','execute','output','Tests\x20found:\x20','red','yellow','Test\x20','Re-evaluation\x20Summary','Running\x20agent\x20tests...','\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','Passed:\x20\x20\x20','projectName','timestamp','203312auQcqt','conversations','42548NqcXnT','Output\x20written\x20to:\x20','dim','json','Running\x20test:\x20','\x20\x20Round\x20','eval','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Using\x20agent:\x20',':\x20Sending\x20user\x20input...','Re-evaluating\x20cached\x20test\x20run...','jsonl','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','rounds','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','tests','153XmaJOo','agentDirs','filter','green','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','200Umgebm','writeFileSync','start','50nLYUCA','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','\x20\x20Evaluating...\x20','No\x20tests\x20have\x20tags\x20defined.','Failed\x20Tests:','name','Project\x20path:\x20','projectDir','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','1067463MYGZmY','Conversation\x20URL:\x20','tags','source','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','join','Site:\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','PASS','dryRun','existsSync','agent','✗\x20FAIL:\x20','no_context','conversation_url','Re-evaluating...','\x22,\x20but\x20current\x20site\x20is\x20\x22','\x20-\x20','203426bFvGqZ','toLowerCase','FAIL','trim','testName','map','Re-evaluating\x20','No\x20tests\x20found\x20with\x20tags:\x20','Error\x20writing\x20output\x20file:\x20','\x20\x20Agent:\x20','length','site','\x20(new)','testYmlPath','llmProject','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','19814249LpWSNL','Round\x201/','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','forEach','text','12uqXIrL','\x20\x20Conversation:\x20','message'];a5_0x14ff=function(){return _0xc10d5c;};return a5_0x14ff();}(function(_0x2e8eae,_0x10521b){const _0x5795cb=a5_0x45af,_0x26c25a=_0x2e8eae();while(!![]){try{const _0x3d6afa=-parseInt(_0x5795cb(0x148))/0x1*(parseInt(_0x5795cb(0x113))/0x2)+-parseInt(_0x5795cb(0x101))/0x3+-parseInt(_0x5795cb(0xe0))/0x4*(parseInt(_0x5795cb(0xf5))/0x5)+-parseInt(_0x5795cb(0x16a))/0x6*(-parseInt(_0x5795cb(0x155))/0x7)+parseInt(_0x5795cb(0xde))/0x8*(-parseInt(_0x5795cb(0xf0))/0x9)+-parseInt(_0x5795cb(0xf8))/0xa*(parseInt(_0x5795cb(0x165))/0xb)+-parseInt(_0x5795cb(0x128))/0xc*(-parseInt(_0x5795cb(0x123))/0xd);if(_0x3d6afa===_0x10521b)break;else _0x26c25a['push'](_0x26c25a['shift']());}catch(_0x278794){_0x26c25a['push'](_0x26c25a['shift']());}}}(a5_0x14ff,0x3624b));import*as a5_0x86e8d7 from'node:fs';import*as a5_0x427176 from'node:path';import a5_0x307f62 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_0xbd1f9b(0xfd)]=a5_0xbd1f9b(0x15b);[a5_0xbd1f9b(0x149)]=a5_0xbd1f9b(0x15e);async[a5_0xbd1f9b(0x16e)](_0x2398a4){const _0x275857=a5_0xbd1f9b,{options:_0x4c62f2,args:_0x35cc76,tdx:_0x3443ff}=_0x2398a4,_0x4760a6=_0x35cc76[0x0]||'.',_0x3b54bc=_0x4c62f2[_0x275857(0x10a)],_0x44a4f4=_0x4c62f2,_0x1d0375=_0x44a4f4[_0x275857(0xe6)]===![],_0x237282=_0x44a4f4['reeval'],_0x278355=_0x44a4f4[_0x275857(0xfd)],_0xee475=_0x44a4f4[_0x275857(0x103)],_0x124dbb=_0x4c62f2[_0x275857(0x11e)],_0x3a9416=_0x44a4f4[_0x275857(0x16f)];if(_0x237282&&_0x1d0375)return console[_0x275857(0x151)](a5_0x307f62[_0x275857(0x171)](_0x275857(0xec))),0x1;let _0x531c4a=_0x275857(0x152);if(_0x44a4f4[_0x275857(0xe3)])_0x531c4a=_0x275857(0xe3);else{if(_0x44a4f4[_0x275857(0xeb)])_0x531c4a=_0x275857(0xeb);else{if(_0x44a4f4[_0x275857(0x13c)])_0x531c4a='tsv';else{if(_0x44a4f4[_0x275857(0x152)])_0x531c4a=_0x275857(0x152);}}}const _0x144ef8=_0x44a4f4[_0x275857(0x121)];let _0x2e991b=_0x4760a6;const _0x5e1a77=a5_0x86e8d7[_0x275857(0x10b)](_0x4760a6),_0x9d94a0=_0x4760a6==='.';if(!_0x5e1a77||_0x9d94a0){const _0x3af796=resolveProjectFromContext(_0x4760a6,_0x144ef8,{'requireFile':'test.yml'});if(_0x3af796[_0x275857(0x156)])_0x2e991b=_0x3af796[_0x275857(0xff)],_0x3af796[_0x275857(0x104)]===_0x275857(0x12f)&&console[_0x275857(0x151)](a5_0x307f62[_0x275857(0xe2)](_0x275857(0xe8)+_0x2e991b));else switch(_0x3af796['reason']){case _0x275857(0x10e):console['log'](a5_0x307f62[_0x275857(0x172)](_0x3af796['message'])),console[_0x275857(0x151)](),console[_0x275857(0x151)]('Usage:'),console[_0x275857(0x151)](_0x275857(0x176)),console[_0x275857(0x151)](_0x275857(0x144)),console['log'](),console[_0x275857(0x151)](_0x275857(0xe7));return 0x1;case _0x275857(0x161):console[_0x275857(0x151)](a5_0x307f62[_0x275857(0x172)](_0x3af796[_0x275857(0x12a)])),console[_0x275857(0x151)](),console[_0x275857(0x151)](_0x275857(0x135)+_0x3af796[_0x275857(0x121)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');return 0x1;case _0x275857(0x137):{const _0x20b451=a5_0x427176['basename'](_0x3af796['projectDir']);console[_0x275857(0x151)](a5_0x307f62['yellow'](_0x275857(0x159)+_0x3af796[_0x275857(0x121)]+'\x22:'));for(const _0x209834 of _0x3af796[_0x275857(0xf1)]){console[_0x275857(0x151)]('\x20\x20-\x20'+_0x209834);}return console[_0x275857(0x151)](),console[_0x275857(0x151)](_0x275857(0x122)+_0x20b451+'/<agent-name>'),0x1;}case _0x275857(0x168):console[_0x275857(0x151)](a5_0x307f62[_0x275857(0x172)](_0x275857(0xf4)+_0x3af796[_0x275857(0x121)]+'\x22.')),console['log'](a5_0x307f62['dim'](_0x275857(0xfe)+_0x3af796[_0x275857(0xff)])),console['log'](),console['log'](_0x275857(0xf9));return 0x1;}}const {definition:_0x18727d,agentInfo:_0xf1d37a}=parseTestFile(_0x2e991b);let _0x41de40=_0x18727d['tests'];if(_0x278355){const _0x25a9c6=_0x278355[_0x275857(0x131)](',')['map'](_0x5f9975=>_0x5f9975['trim']());_0x41de40=_0x18727d['tests'][_0x275857(0xf2)](_0x1595d8=>_0x25a9c6[_0x275857(0x13e)](_0x1595d8[_0x275857(0xfd)]));if(_0x41de40['length']===0x0)return console['log'](a5_0x307f62[_0x275857(0x172)](_0x275857(0x14b)+_0x278355)),console[_0x275857(0x151)](a5_0x307f62[_0x275857(0xe2)]('Available\x20tests:\x20'+_0x18727d['tests']['map'](_0xb593c6=>_0xb593c6[_0x275857(0xfd)])[_0x275857(0x106)](',\x20'))),0x1;}if(_0xee475){const _0x51fa28=_0xee475[_0x275857(0x131)](',')[_0x275857(0x118)](_0x57fa51=>_0x57fa51[_0x275857(0x116)]()[_0x275857(0x114)]());_0x41de40=_0x41de40['filter'](_0x4dad03=>_0x4dad03[_0x275857(0x103)]?.[_0x275857(0x12e)](_0x4720d7=>_0x51fa28[_0x275857(0x13e)](_0x4720d7[_0x275857(0x114)]())));if(_0x41de40[_0x275857(0x11d)]===0x0){console[_0x275857(0x151)](a5_0x307f62[_0x275857(0x172)](_0x275857(0x11a)+_0xee475));const _0xa38675=new Set();return _0x18727d[_0x275857(0xef)][_0x275857(0x126)](_0x49819c=>_0x49819c[_0x275857(0x103)]?.[_0x275857(0x126)](_0x10c42b=>_0xa38675[_0x275857(0x162)](_0x10c42b))),_0xa38675['size']>0x0?console[_0x275857(0x151)](a5_0x307f62[_0x275857(0xe2)]('Available\x20tags:\x20'+[..._0xa38675]['join'](',\x20'))):console[_0x275857(0x151)](a5_0x307f62[_0x275857(0xe2)](_0x275857(0xfb))),0x1;}}if(_0x237282)return this[_0x275857(0x169)](_0x2398a4,{'definition':{'tests':_0x41de40},'agentInfo':_0xf1d37a,'outputFormat':_0x531c4a,'outputFile':_0x3a9416,'testNames':_0x278355});if(_0x3b54bc){console[_0x275857(0x151)](a5_0x307f62[_0x275857(0x14e)](_0x275857(0x13b))),console[_0x275857(0x151)]('\x20\x20Site:\x20'+a5_0x307f62[_0x275857(0x132)](_0x124dbb)),console['log'](_0x275857(0x14f)+a5_0x307f62['white'](_0xf1d37a[_0x275857(0x178)])),console[_0x275857(0x151)](_0x275857(0x11c)+a5_0x307f62[_0x275857(0x132)](_0xf1d37a[_0x275857(0x13d)])),console['log'](),console[_0x275857(0x151)](_0x275857(0x170)+a5_0x307f62[_0x275857(0x132)](_0x41de40[_0x275857(0x11d)]));for(let _0x3bb799=0x0;_0x3bb799<_0x41de40[_0x275857(0x11d)];_0x3bb799++){const _0x1034b4=_0x41de40[_0x3bb799],_0x1c6dd6=_0x1034b4[_0x275857(0xed)][_0x275857(0x11d)]===0x1?_0x275857(0x141):_0x275857(0xed),_0x5b40da=_0x1034b4[_0x275857(0x103)]?.['length']?'\x20['+_0x1034b4[_0x275857(0x103)][_0x275857(0x106)](',\x20')+']':'';console[_0x275857(0x151)]('\x20\x20'+(_0x3bb799+0x1)+'.\x20'+a5_0x307f62[_0x275857(0x132)](_0x1034b4[_0x275857(0xfd)])+'\x20('+_0x1034b4[_0x275857(0xed)][_0x275857(0x11d)]+'\x20'+_0x1c6dd6+')'+a5_0x307f62['dim'](_0x5b40da));}return 0x0;}let _0x462de4,_0x1720a3;try{_0x462de4=await _0x3443ff[_0x275857(0x136)][_0x275857(0x138)](_0xf1d37a['projectName']);}catch(_0x14e8e5){const _0x1fed46=_0x14e8e5 instanceof Error?_0x14e8e5[_0x275857(0x12a)]:String(_0x14e8e5);return _0x1fed46[_0x275857(0x13e)]('404')||_0x1fed46['toLowerCase']()[_0x275857(0x13e)](_0x275857(0x15f))?console[_0x275857(0x151)](a5_0x307f62['red'](_0x275857(0x134)+_0xf1d37a[_0x275857(0x178)])):console[_0x275857(0x151)](a5_0x307f62[_0x275857(0x171)](_0x275857(0x13a)+_0xf1d37a[_0x275857(0x178)]+_0x275857(0x15c)+_0x1fed46)),0x1;}try{_0x1720a3=await _0x3443ff[_0x275857(0x136)]['resolveAgentId'](_0xf1d37a['agentName'],_0x462de4);}catch(_0x52799c){const _0x4d9643=_0x52799c instanceof Error?_0x52799c[_0x275857(0x12a)]:String(_0x52799c);return _0x4d9643[_0x275857(0x13e)]('404')||_0x4d9643[_0x275857(0x114)]()[_0x275857(0x13e)](_0x275857(0x15f))?console[_0x275857(0x151)](a5_0x307f62[_0x275857(0x171)](_0x275857(0x125)+_0xf1d37a[_0x275857(0x13d)])):console[_0x275857(0x151)](a5_0x307f62[_0x275857(0x171)](_0x275857(0x105)+_0xf1d37a['agentName']+_0x275857(0x15c)+_0x4d9643)),0x1;}let _0x380bdd;if(!_0x1d0375)try{_0x380bdd=await setupEvaluatorAgent(_0x3443ff[_0x275857(0x136)],_0x4c62f2[_0x275857(0x130)]);}catch(_0x575875){const _0x18ccfe=_0x575875 instanceof Error?_0x575875[_0x275857(0x12a)]:String(_0x575875);return console[_0x275857(0x151)](a5_0x307f62[_0x275857(0x171)](_0x275857(0x157)+_0x18ccfe)),0x1;}console['log'](a5_0x307f62[_0x275857(0x14e)](_0x275857(0x175))),console[_0x275857(0x151)](_0x275857(0x107)+a5_0x307f62[_0x275857(0x132)](_0x124dbb)),console[_0x275857(0x151)](_0x275857(0x140)+a5_0x307f62[_0x275857(0x132)](_0xf1d37a[_0x275857(0x178)]+'/'+_0xf1d37a[_0x275857(0x13d)])),console['log']();const _0x1ca672=[],_0x1d49e7=[],_0x433622=Date[_0x275857(0x153)]();for(let _0x599437=0x0;_0x599437<_0x41de40[_0x275857(0x11d)];_0x599437++){const _0x42f4a0=_0x41de40[_0x599437];_0x41de40[_0x275857(0x11d)]>0x1?console[_0x275857(0x151)](_0x275857(0x173)+(_0x599437+0x1)+'/'+_0x41de40[_0x275857(0x11d)]+':\x20'+a5_0x307f62[_0x275857(0x132)](_0x42f4a0['name'])):console[_0x275857(0x151)](_0x275857(0xe4)+a5_0x307f62[_0x275857(0x132)](_0x42f4a0[_0x275857(0xfd)]));const _0x4101c7=createCommandSpinner(_0x275857(0x124)+_0x42f4a0[_0x275857(0xed)][_0x275857(0x11d)]+_0x275857(0xe9));_0x4101c7[_0x275857(0xf7)]();try{const {result:_0x558bf1,conversation:_0x36e37a}=await runTest(_0x3443ff[_0x275857(0x136)],_0x42f4a0,{'agentId':_0x1720a3,'projectId':_0x462de4,'site':_0x124dbb,'noEval':_0x1d0375,'evaluatorId':_0x380bdd,'onRoundStart':(_0x5cdb0b,_0x44bae9)=>{const _0x530bba=_0x275857;_0x4101c7[_0x530bba(0x127)]='Round\x20'+(_0x5cdb0b+0x1)+'/'+_0x44bae9+_0x530bba(0xe9);},'onRoundComplete':(_0x51186e,_0x1351b8,_0x5d510f)=>{const _0x3b69a6=_0x275857,_0x31db00=formatElapsed(_0x1351b8);_0x5d510f?console['log']('\x20\x20Round\x20'+(_0x51186e+0x1)+'/'+_0x42f4a0[_0x3b69a6(0xed)][_0x3b69a6(0x11d)]+_0x3b69a6(0x139)+a5_0x307f62['green']('✓')+'\x20('+_0x31db00+')'):console[_0x3b69a6(0x151)](_0x3b69a6(0xe5)+(_0x51186e+0x1)+'/'+_0x42f4a0[_0x3b69a6(0xed)][_0x3b69a6(0x11d)]+_0x3b69a6(0x139)+a5_0x307f62[_0x3b69a6(0x171)]('✗'));},'onEvaluationStart':()=>{const _0x514026=_0x275857;_0x4101c7[_0x514026(0x127)]='Evaluating\x20response...';},'onEvaluationComplete':_0x46544d=>{const _0x25cf00=_0x275857,_0xe1c70d=formatElapsed(_0x46544d);console['log'](_0x25cf00(0xfa)+a5_0x307f62[_0x25cf00(0xf3)]('✓')+'\x20('+_0xe1c70d+')');}});_0x4101c7[_0x275857(0x12c)](),_0x1ca672[_0x275857(0x150)](_0x558bf1),_0x1d49e7[_0x275857(0x150)](_0x36e37a);if(_0x558bf1[_0x275857(0x163)]===_0x275857(0x109))console[_0x275857(0x151)](a5_0x307f62[_0x275857(0xf3)](_0x275857(0x14d)+_0x558bf1[_0x275857(0x14c)]));else _0x558bf1[_0x275857(0x163)]==='FAIL'?console['log'](a5_0x307f62[_0x275857(0x171)](_0x275857(0x10d)+_0x558bf1['reason'])):console[_0x275857(0x151)](a5_0x307f62[_0x275857(0x171)](_0x275857(0x147)+_0x558bf1[_0x275857(0x14c)]));_0x558bf1[_0x275857(0x10f)]&&console['log'](a5_0x307f62[_0x275857(0xe2)](_0x275857(0x102)+_0x558bf1[_0x275857(0x10f)])),console[_0x275857(0x151)]();}catch(_0x2d1222){_0x4101c7[_0x275857(0x12c)]();const _0x6825e7=_0x2d1222 instanceof Error?_0x2d1222[_0x275857(0x12a)]:String(_0x2d1222);console['log'](a5_0x307f62[_0x275857(0x171)]('✗\x20ERROR:\x20'+_0x6825e7)),console[_0x275857(0x151)](),_0x1ca672[_0x275857(0x150)]({'name':_0x42f4a0[_0x275857(0xfd)],'status':'ERROR','reason':_0x6825e7,'timestamp':new Date()[_0x275857(0x167)](),'duration_ms':0x0});}}const _0x111a6f=Date[_0x275857(0x153)]()-_0x433622,_0x1068c6=_0x1ca672[_0x275857(0xf2)](_0x529b0d=>_0x529b0d[_0x275857(0x163)]===_0x275857(0x109))[_0x275857(0x11d)],_0x2be36a=_0x1ca672[_0x275857(0xf2)](_0x20655c=>_0x20655c[_0x275857(0x163)]===_0x275857(0x115))[_0x275857(0x11d)],_0x424650=_0x1ca672['filter'](_0x38103e=>_0x38103e[_0x275857(0x163)]==='ERROR')[_0x275857(0x11d)];console[_0x275857(0x151)]('━'[_0x275857(0x160)](0x3c)),console[_0x275857(0x151)]('Test\x20Summary'),console[_0x275857(0x151)]('━'[_0x275857(0x160)](0x3c)),console['log'](_0x275857(0x13f)+_0x1ca672[_0x275857(0x11d)]),console[_0x275857(0x151)](_0x275857(0x177)+a5_0x307f62[_0x275857(0xf3)](_0x1068c6)),console[_0x275857(0x151)](_0x275857(0x143)+a5_0x307f62[_0x275857(0x171)](_0x2be36a));_0x424650>0x0&&console[_0x275857(0x151)]('Errors:\x20\x20\x20'+a5_0x307f62[_0x275857(0x171)](_0x424650));console[_0x275857(0x151)](_0x275857(0x166)+formatElapsed(_0x111a6f)),console[_0x275857(0x151)]('━'[_0x275857(0x160)](0x3c));const _0x3e9a5c=_0x1ca672['filter'](_0x476c11=>_0x476c11['status']!==_0x275857(0x109));if(_0x3e9a5c['length']>0x0){console[_0x275857(0x151)](),console[_0x275857(0x151)](_0x275857(0xfc));for(const _0x1d4f66 of _0x3e9a5c){const _0x5d93d3=a5_0x307f62['red']('✗'),_0x3559d2=_0x1d4f66[_0x275857(0x14c)][_0x275857(0x11d)]>0x32?_0x1d4f66[_0x275857(0x14c)][_0x275857(0x164)](0x0,0x32)+_0x275857(0x133):_0x1d4f66[_0x275857(0x14c)];console[_0x275857(0x151)]('\x20\x20'+_0x5d93d3+'\x20'+_0x1d4f66[_0x275857(0xfd)]+':\x20'+_0x3559d2);}}const _0x406d03={'summary':{'total':_0x1ca672[_0x275857(0x11d)],'passed':_0x1068c6,'failed':_0x2be36a,'errors':_0x424650>0x0?_0x424650:undefined,'duration_ms':_0x111a6f},'tests':_0x1ca672,'agent':{'project':_0xf1d37a[_0x275857(0x178)],'name':_0xf1d37a['agentName'],'site':_0x124dbb},'timestamp':new Date(_0x433622)[_0x275857(0x167)]()};try{const _0x27b044=buildCachedTestRun(_0x1d49e7,{'site':_0x124dbb,'projectId':_0x462de4,'projectName':_0xf1d37a['projectName'],'agentId':_0x1720a3,'agentName':_0xf1d37a[_0x275857(0x13d)],'testYmlPath':a5_0x427176[_0x275857(0x16b)](_0xf1d37a[_0x275857(0x120)])});saveLastTestRun(_0x27b044);}catch{}if(_0x531c4a!==_0x275857(0x152)||_0x3a9416){const _0x3ffd23=formatResults(_0x406d03,_0x531c4a);if(_0x3a9416)try{a5_0x86e8d7[_0x275857(0xf6)](_0x3a9416,_0x3ffd23,_0x275857(0x16c)),console[_0x275857(0x151)](),console[_0x275857(0x151)](a5_0x307f62['dim'](_0x275857(0xe1)+_0x3a9416));}catch(_0x52236b){return console[_0x275857(0x151)](),console[_0x275857(0x151)](a5_0x307f62[_0x275857(0x171)](_0x275857(0x11b)+_0x52236b)),0x1;}else console[_0x275857(0x151)](),console['log'](_0x3ffd23);}return _0x3e9a5c[_0x275857(0x11d)]>0x0?0x1:0x0;}async['executeReeval'](_0x26510d,_0x3ded7b){const _0x1486c4=a5_0xbd1f9b,{options:_0x54326b,tdx:_0x47522a}=_0x26510d,{definition:_0x438549,agentInfo:_0xdc2497,outputFormat:_0x28c84a,outputFile:_0x3fb9cf}=_0x3ded7b,_0x18bdeb=_0x54326b[_0x1486c4(0x11e)],_0x676a35=loadLastTestRun();if(!_0x676a35)return console[_0x1486c4(0x151)](a5_0x307f62['red'](_0x1486c4(0x14a))),console[_0x1486c4(0x151)](a5_0x307f62[_0x1486c4(0xe2)]('Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.')),0x1;if(_0x676a35[_0x1486c4(0x10c)]['agentName']!==_0xdc2497[_0x1486c4(0x13d)])return console['log'](a5_0x307f62[_0x1486c4(0x171)](_0x1486c4(0x12b)+_0x676a35['agent'][_0x1486c4(0x13d)]+_0x1486c4(0x154)+_0xdc2497[_0x1486c4(0x13d)]+'\x22.')),console['log'](a5_0x307f62[_0x1486c4(0xe2)](_0x1486c4(0xee))),0x1;const _0x25dcb5=new Set(_0x676a35[_0x1486c4(0xdf)][_0x1486c4(0x118)](_0x46fa15=>_0x46fa15[_0x1486c4(0x117)])),_0x46893e=_0x438549[_0x1486c4(0xef)][_0x1486c4(0xf2)](_0x2357b3=>!_0x25dcb5[_0x1486c4(0x15a)](_0x2357b3[_0x1486c4(0xfd)]));if(_0x46893e[_0x1486c4(0x11d)]>0x0&&_0x676a35[_0x1486c4(0x11e)]!==_0x18bdeb)return console['log'](a5_0x307f62[_0x1486c4(0x171)](_0x1486c4(0x158))),console[_0x1486c4(0x151)](a5_0x307f62[_0x1486c4(0xe2)](_0x1486c4(0x145)+_0x676a35['site']+_0x1486c4(0x111)+_0x18bdeb+'\x22.')),console[_0x1486c4(0x151)](a5_0x307f62[_0x1486c4(0xe2)]('Either\x20switch\x20to\x20the\x20\x22'+_0x676a35[_0x1486c4(0x11e)]+_0x1486c4(0x108))),0x1;const _0x1020e6=_0x438549[_0x1486c4(0xef)][_0x1486c4(0xf2)](_0x1de9ce=>_0x25dcb5['has'](_0x1de9ce[_0x1486c4(0xfd)])),_0x551d7a=_0x46893e;let _0x4744fa;try{_0x4744fa=await setupEvaluatorAgent(_0x47522a[_0x1486c4(0x136)],_0x54326b['verbose']);}catch(_0xb4ec8a){const _0x4801a2=_0xb4ec8a instanceof Error?_0xb4ec8a[_0x1486c4(0x12a)]:String(_0xb4ec8a);return console['log'](a5_0x307f62[_0x1486c4(0x171)](_0x1486c4(0x157)+_0x4801a2)),0x1;}console[_0x1486c4(0x151)](a5_0x307f62[_0x1486c4(0x14e)](_0x1486c4(0xea))),console['log']('Cached\x20run\x20from:\x20'+a5_0x307f62[_0x1486c4(0x132)](_0x676a35[_0x1486c4(0xdd)])),console[_0x1486c4(0x151)]('Agent:\x20'+a5_0x307f62[_0x1486c4(0x132)](_0x676a35[_0x1486c4(0x10c)][_0x1486c4(0x178)]+'/'+_0x676a35[_0x1486c4(0x10c)][_0x1486c4(0x13d)]));_0x551d7a[_0x1486c4(0x11d)]>0x0&&console[_0x1486c4(0x151)]('New\x20tests\x20to\x20execute:\x20'+a5_0x307f62[_0x1486c4(0x172)](_0x551d7a['length']));console['log']();const _0x599673=[],_0x21fac0=Date[_0x1486c4(0x153)](),_0x657b1d=createCommandSpinner(_0x1486c4(0x110));if(_0x1020e6[_0x1486c4(0x11d)]>0x0)try{const _0x4c7daa=await reevaluateFromCache(_0x47522a[_0x1486c4(0x136)],_0x676a35,{'tests':_0x1020e6},{'evaluatorId':_0x4744fa,'onTestStart':(_0x2e9031,_0x34b2df,_0x36d892)=>{const _0x4eb45b=_0x1486c4;_0x657b1d[_0x4eb45b(0x127)]=_0x4eb45b(0x119)+(_0x34b2df+0x1)+'/'+_0x36d892+':\x20'+_0x2e9031+'...';if(!_0x657b1d['isSpinning'])_0x657b1d['start']();},'onTestComplete':(_0x25008,_0x2bd764)=>{const _0x84c285=_0x1486c4;_0x657b1d[_0x84c285(0x12c)]();if(_0x2bd764['status']===_0x84c285(0x109))console[_0x84c285(0x151)](a5_0x307f62['green']('✓\x20PASS:\x20'+_0x25008)+a5_0x307f62[_0x84c285(0xe2)](_0x84c285(0x15d)));else _0x2bd764[_0x84c285(0x163)]==='FAIL'?console[_0x84c285(0x151)](a5_0x307f62[_0x84c285(0x171)](_0x84c285(0x10d)+_0x25008+_0x84c285(0x112)+_0x2bd764[_0x84c285(0x14c)])+a5_0x307f62[_0x84c285(0xe2)](_0x84c285(0x15d))):console[_0x84c285(0x151)](a5_0x307f62[_0x84c285(0x171)]('✗\x20ERROR:\x20'+_0x25008+'\x20-\x20'+_0x2bd764[_0x84c285(0x14c)]));_0x2bd764[_0x84c285(0x10f)]&&console[_0x84c285(0x151)](a5_0x307f62[_0x84c285(0xe2)]('\x20\x20Conversation:\x20'+_0x2bd764[_0x84c285(0x10f)])),_0x599673['push'](_0x2bd764);},'onTestSkipped':(_0x5e662c,_0x45171b)=>{const _0x50f46e=_0x1486c4;_0x657b1d[_0x50f46e(0x12c)](),console[_0x50f46e(0x151)](a5_0x307f62[_0x50f46e(0x172)]('⚠\x20SKIPPED:\x20'+_0x5e662c+_0x50f46e(0x112)+_0x45171b));}});for(const _0x1fe305 of _0x4c7daa){!_0x599673[_0x1486c4(0x16d)](_0x167c22=>_0x167c22[_0x1486c4(0xfd)]===_0x1fe305['name'])&&_0x599673[_0x1486c4(0x150)](_0x1fe305);}}catch(_0x455ccd){_0x657b1d['stop']();const _0x3a6cf1=_0x455ccd instanceof Error?_0x455ccd[_0x1486c4(0x12a)]:String(_0x455ccd);return console[_0x1486c4(0x151)](a5_0x307f62[_0x1486c4(0x171)](_0x1486c4(0x100)+_0x3a6cf1)),0x1;}_0x657b1d['stop']();if(_0x551d7a['length']>0x0){console[_0x1486c4(0x151)](),console[_0x1486c4(0x151)](a5_0x307f62[_0x1486c4(0x14e)](_0x1486c4(0x142)));const {projectId:_0x43ff3d,agentId:_0xa070b9}=_0x676a35[_0x1486c4(0x10c)];for(const _0x5eaf08 of _0x551d7a){console[_0x1486c4(0x151)]('Running:\x20'+a5_0x307f62[_0x1486c4(0x132)](_0x5eaf08[_0x1486c4(0xfd)]));const _0x44311f=createCommandSpinner(_0x1486c4(0x124)+_0x5eaf08['rounds'][_0x1486c4(0x11d)]+_0x1486c4(0xe9));_0x44311f['start']();try{const {result:_0x55f63}=await runTest(_0x47522a[_0x1486c4(0x136)],_0x5eaf08,{'agentId':_0xa070b9,'projectId':_0x43ff3d,'site':_0x676a35[_0x1486c4(0x11e)],'noEval':![],'evaluatorId':_0x4744fa,'onRoundStart':(_0xce6274,_0xae76d)=>{const _0x31c0bd=_0x1486c4;_0x44311f[_0x31c0bd(0x127)]='Round\x20'+(_0xce6274+0x1)+'/'+_0xae76d+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x51d546,_0x56ad3e,_0x1dacb7)=>{const _0x270d92=_0x1486c4,_0x522472=formatElapsed(_0x56ad3e);_0x1dacb7?console[_0x270d92(0x151)](_0x270d92(0xe5)+(_0x51d546+0x1)+'/'+_0x5eaf08[_0x270d92(0xed)][_0x270d92(0x11d)]+_0x270d92(0x139)+a5_0x307f62[_0x270d92(0xf3)]('✓')+'\x20('+_0x522472+')'):console[_0x270d92(0x151)](_0x270d92(0xe5)+(_0x51d546+0x1)+'/'+_0x5eaf08['rounds']['length']+_0x270d92(0x139)+a5_0x307f62[_0x270d92(0x171)]('✗'));},'onEvaluationStart':()=>{const _0x325576=_0x1486c4;_0x44311f[_0x325576(0x127)]=_0x325576(0x12d);},'onEvaluationComplete':_0x32bb73=>{const _0x3ff7ac=_0x1486c4,_0x2b0071=formatElapsed(_0x32bb73);console[_0x3ff7ac(0x151)]('\x20\x20Evaluating...\x20'+a5_0x307f62[_0x3ff7ac(0xf3)]('✓')+'\x20('+_0x2b0071+')');}});_0x44311f['stop'](),_0x599673[_0x1486c4(0x150)](_0x55f63);if(_0x55f63[_0x1486c4(0x163)]===_0x1486c4(0x109))console[_0x1486c4(0x151)](a5_0x307f62[_0x1486c4(0xf3)](_0x1486c4(0x14d)+_0x55f63['reason'])+a5_0x307f62[_0x1486c4(0xe2)](_0x1486c4(0x11f)));else _0x55f63['status']===_0x1486c4(0x115)?console[_0x1486c4(0x151)](a5_0x307f62[_0x1486c4(0x171)](_0x1486c4(0x10d)+_0x55f63[_0x1486c4(0x14c)])+a5_0x307f62['dim'](_0x1486c4(0x11f))):console['log'](a5_0x307f62[_0x1486c4(0x171)]('✗\x20ERROR:\x20'+_0x55f63[_0x1486c4(0x14c)]));_0x55f63['conversation_url']&&console['log'](a5_0x307f62[_0x1486c4(0xe2)](_0x1486c4(0x129)+_0x55f63[_0x1486c4(0x10f)]));}catch(_0x3f2261){_0x44311f[_0x1486c4(0x12c)]();const _0x520ae8=_0x3f2261 instanceof Error?_0x3f2261[_0x1486c4(0x12a)]:String(_0x3f2261);console[_0x1486c4(0x151)](a5_0x307f62[_0x1486c4(0x171)](_0x1486c4(0x147)+_0x520ae8)),_0x599673[_0x1486c4(0x150)]({'name':_0x5eaf08[_0x1486c4(0xfd)],'status':'ERROR','reason':_0x520ae8,'timestamp':new Date()[_0x1486c4(0x167)](),'duration_ms':0x0});}}}console[_0x1486c4(0x151)]();const _0x30d60f=Date[_0x1486c4(0x153)]()-_0x21fac0,_0x19f9cf=_0x599673[_0x1486c4(0xf2)](_0x4a99fb=>_0x4a99fb[_0x1486c4(0x163)]===_0x1486c4(0x109))[_0x1486c4(0x11d)],_0x502196=_0x599673['filter'](_0x2389fb=>_0x2389fb[_0x1486c4(0x163)]===_0x1486c4(0x115))['length'],_0xe1a06=_0x599673[_0x1486c4(0xf2)](_0x35ae54=>_0x35ae54['status']==='ERROR')['length'];console[_0x1486c4(0x151)]('━'[_0x1486c4(0x160)](0x3c)),console['log'](_0x1486c4(0x174)),console[_0x1486c4(0x151)]('━'[_0x1486c4(0x160)](0x3c)),console[_0x1486c4(0x151)](_0x1486c4(0x13f)+_0x599673['length']),console['log'](_0x1486c4(0x177)+a5_0x307f62['green'](_0x19f9cf)),console[_0x1486c4(0x151)](_0x1486c4(0x143)+a5_0x307f62[_0x1486c4(0x171)](_0x502196));_0xe1a06>0x0&&console['log'](_0x1486c4(0x146)+a5_0x307f62[_0x1486c4(0x171)](_0xe1a06));console[_0x1486c4(0x151)](_0x1486c4(0x166)+formatElapsed(_0x30d60f)),console['log']('━'[_0x1486c4(0x160)](0x3c));const _0x1040ca={'summary':{'total':_0x599673['length'],'passed':_0x19f9cf,'failed':_0x502196,'errors':_0xe1a06>0x0?_0xe1a06:undefined,'duration_ms':_0x30d60f},'tests':_0x599673,'agent':{'project':_0xdc2497['projectName'],'name':_0xdc2497[_0x1486c4(0x13d)],'site':_0x18bdeb},'timestamp':new Date(_0x21fac0)[_0x1486c4(0x167)]()};if(_0x28c84a!==_0x1486c4(0x152)||_0x3fb9cf){const _0x2adb9f=formatResults(_0x1040ca,_0x28c84a);if(_0x3fb9cf)try{a5_0x86e8d7[_0x1486c4(0xf6)](_0x3fb9cf,_0x2adb9f,_0x1486c4(0x16c)),console[_0x1486c4(0x151)](),console[_0x1486c4(0x151)](a5_0x307f62[_0x1486c4(0xe2)](_0x1486c4(0xe1)+_0x3fb9cf));}catch(_0x24a834){return console[_0x1486c4(0x151)](),console[_0x1486c4(0x151)](a5_0x307f62[_0x1486c4(0x171)](_0x1486c4(0x11b)+_0x24a834)),0x1;}else console[_0x1486c4(0x151)](),console[_0x1486c4(0x151)](_0x2adb9f);}const _0x163b51=_0x599673['filter'](_0x2e6719=>_0x2e6719['status']!=='PASS');return _0x163b51[_0x1486c4(0x11d)]>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0x5d7a31=a5_0x5be5;(function(_0x2eed20,_0x31a975){const _0x5dc466=a5_0x5be5,_0x219c7d=_0x2eed20();while(!![]){try{const _0x62af5a=parseInt(_0x5dc466(0x12c))/0x1*(-parseInt(_0x5dc466(0x188))/0x2)+-parseInt(_0x5dc466(0x1a5))/0x3+-parseInt(_0x5dc466(0x18c))/0x4*(parseInt(_0x5dc466(0x159))/0x5)+-parseInt(_0x5dc466(0x152))/0x6*(-parseInt(_0x5dc466(0x173))/0x7)+parseInt(_0x5dc466(0x1a1))/0x8+-parseInt(_0x5dc466(0x164))/0x9*(-parseInt(_0x5dc466(0x1a3))/0xa)+-parseInt(_0x5dc466(0x17c))/0xb*(-parseInt(_0x5dc466(0x167))/0xc);if(_0x62af5a===_0x31a975)break;else _0x219c7d['push'](_0x219c7d['shift']());}catch(_0x53264c){_0x219c7d['push'](_0x219c7d['shift']());}}}(a5_0x2c9b,0x43265));import*as a5_0x343e4e from'node:fs';import*as a5_0xd173a7 from'node:path';import a5_0x10e56c from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';function a5_0x5be5(_0x4d7bf3,_0x25dec5){_0x4d7bf3=_0x4d7bf3-0x116;const _0x2c9ba4=a5_0x2c9b();let _0x5be5b1=_0x2c9ba4[_0x4d7bf3];return _0x5be5b1;}import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';function a5_0x2c9b(){const _0x2cd34c=['Total:\x20\x20\x20\x20','✗\x20ERROR:\x20','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','\x20\x20-\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','agentName','Failed\x20Tests:','size','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','Running\x20test:\x20','llmProject','\x27\x20to\x20create\x20the\x20folder\x20structure.','some','Running:\x20','6spiojE','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','Error:\x20No\x20previous\x20test\x20run\x20found.','round','\x20\x20Round\x20','\x20\x20Agent:\x20','\x20-\x20','15rGbAeV','Test\x20Configuration:','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','message','...\x20','Passed:\x20\x20\x20','jsonl','agent','verbose','Test\x20','1856772Jnqifg','\x22,\x20but\x20current\x20site\x20is\x20\x22','tests','160620vRGdno','Tests\x20found:\x20','404','FAIL','\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)','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','json','Evaluating\x20response...','testYmlPath',':\x20Sending\x20user\x20input...','resolveProjectId','conversation_url','226877xeFPFm','projectName','executeReeval','cyan','log','found','Run\x20\x27tdx\x20agent\x20pull\x20','\x20\x20Conversation:\x20','Available\x20tags:\x20','407TMTRuV','No\x20tests\x20found\x20with\x20tags:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','Output\x20written\x20to:\x20','Usage:','utf-8','push','\x20\x20Project:\x20','⚠\x20SKIPPED:\x20','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','No\x20tests\x20found\x20matching:\x20','substring','173962pndDvu','✗\x20ERROR:\x20Project\x20not\x20found:\x20','Round\x201/','source','621524iARCBh','site','now','yellow','toISOString','text','Errors:\x20\x20\x20','resolveAgentId','Re-evaluation\x20Summary','Failed:\x20\x20\x20','status','llm','reason','join','agent:test','no_context','conversations','repeat','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','reeval','Duration:\x20','1717248yovjjs','Round\x20','20IcsTzB','green','458391DpCGEM','\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','testName','Re-evaluating\x20cached\x20test\x20run...','existsSync','resolve','map','ERROR','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','tsv','not\x20found','test.yml','rounds','Cached\x20run\x20from:\x20','no_tests','table','projectDir','name','forEach','\x20\x20Evaluating...\x20','Available\x20tests:\x20','length','Using\x20agent:\x20','...','✓\x20PASS:\x20','Project\x20path:\x20','dim','Agent:\x20','includes','description','Error\x20writing\x20output\x20file:\x20','filter','3ZkMcTc','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','Executing\x20new\x20tests...','start','stop','PASS','split','toLowerCase','✗\x20FAIL:\x20','dryRun','has','agentDirs','tags','isSpinning','Test\x20Summary','\x20\x20Site:\x20','execute','\x22:\x20','Cached\x20run\x20is\x20from\x20site\x20\x22','multiple_agents','white','no_local_folder','\x20(cached)','red'];a5_0x2c9b=function(){return _0x2cd34c;};return a5_0x2c9b();}import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x5d7a31(0x11d)]=a5_0x5d7a31(0x19a);[a5_0x5d7a31(0x129)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x5d7a31(0x13c)](_0x137522){const _0x46cc70=a5_0x5d7a31,{options:_0x376679,args:_0x596923,tdx:_0x40eda8}=_0x137522,_0x4df34d=_0x596923[0x0]||'.',_0x4de858=_0x376679[_0x46cc70(0x135)],_0x81d02=_0x376679,_0x1b815e=_0x81d02['eval']===![],_0x167576=_0x81d02[_0x46cc70(0x19f)],_0x320cc9=_0x81d02['name'],_0x3d5382=_0x81d02[_0x46cc70(0x138)],_0x6abef6=_0x376679[_0x46cc70(0x18d)],_0x2e0896=_0x81d02['output'];if(_0x167576&&_0x1b815e)return console[_0x46cc70(0x177)](a5_0x10e56c['red']('Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval')),0x1;let _0x47c626='table';if(_0x81d02[_0x46cc70(0x16d)])_0x47c626='json';else{if(_0x81d02[_0x46cc70(0x160)])_0x47c626=_0x46cc70(0x160);else{if(_0x81d02[_0x46cc70(0x1af)])_0x47c626=_0x46cc70(0x1af);else{if(_0x81d02[_0x46cc70(0x11b)])_0x47c626=_0x46cc70(0x11b);}}}const _0x3abfde=_0x81d02[_0x46cc70(0x14e)];let _0x2937a0=_0x4df34d;const _0x3e31f3=a5_0x343e4e[_0x46cc70(0x1a9)](_0x4df34d),_0x5b65be=_0x4df34d==='.';if(!_0x3e31f3||_0x5b65be){const _0x4ff3ba=resolveProjectFromContext(_0x4df34d,_0x3abfde,{'requireFile':_0x46cc70(0x117)});if(_0x4ff3ba[_0x46cc70(0x178)])_0x2937a0=_0x4ff3ba[_0x46cc70(0x11c)],_0x4ff3ba[_0x46cc70(0x18b)]==='context'&&console[_0x46cc70(0x177)](a5_0x10e56c[_0x46cc70(0x126)](_0x46cc70(0x122)+_0x2937a0));else switch(_0x4ff3ba[_0x46cc70(0x198)]){case _0x46cc70(0x19b):console[_0x46cc70(0x177)](a5_0x10e56c[_0x46cc70(0x18f)](_0x4ff3ba[_0x46cc70(0x15d)])),console[_0x46cc70(0x177)](),console[_0x46cc70(0x177)](_0x46cc70(0x180)),console['log'](_0x46cc70(0x1a6)),console[_0x46cc70(0x177)](_0x46cc70(0x16b)),console[_0x46cc70(0x177)](),console[_0x46cc70(0x177)]('Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>');return 0x1;case _0x46cc70(0x141):console[_0x46cc70(0x177)](a5_0x10e56c['yellow'](_0x4ff3ba[_0x46cc70(0x15d)])),console[_0x46cc70(0x177)](),console[_0x46cc70(0x177)](_0x46cc70(0x179)+_0x4ff3ba[_0x46cc70(0x14e)]+_0x46cc70(0x14f));return 0x1;case _0x46cc70(0x13f):{const _0x13e140=a5_0xd173a7['basename'](_0x4ff3ba[_0x46cc70(0x11c)]);console[_0x46cc70(0x177)](a5_0x10e56c[_0x46cc70(0x18f)](_0x46cc70(0x185)+_0x4ff3ba[_0x46cc70(0x14e)]+'\x22:'));for(const _0x33496e of _0x4ff3ba[_0x46cc70(0x137)]){console[_0x46cc70(0x177)](_0x46cc70(0x147)+_0x33496e);}return console[_0x46cc70(0x177)](),console[_0x46cc70(0x177)](_0x46cc70(0x19e)+_0x13e140+'/<agent-name>'),0x1;}case _0x46cc70(0x11a):console['log'](a5_0x10e56c[_0x46cc70(0x18f)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x4ff3ba[_0x46cc70(0x14e)]+'\x22.')),console[_0x46cc70(0x177)](a5_0x10e56c['dim'](_0x46cc70(0x125)+_0x4ff3ba[_0x46cc70(0x11c)])),console[_0x46cc70(0x177)](),console[_0x46cc70(0x177)](_0x46cc70(0x16c));return 0x1;}}const {definition:_0x3e4e4a,agentInfo:_0x1ae344}=parseTestFile(_0x2937a0);let _0x5f5b1d=_0x3e4e4a[_0x46cc70(0x166)];if(_0x320cc9){const _0x39ecf8=_0x320cc9[_0x46cc70(0x132)](',')['map'](_0x38f38b=>_0x38f38b['trim']());_0x5f5b1d=_0x3e4e4a['tests'][_0x46cc70(0x12b)](_0xb7c601=>_0x39ecf8['includes'](_0xb7c601[_0x46cc70(0x11d)]));if(_0x5f5b1d[_0x46cc70(0x121)]===0x0)return console['log'](a5_0x10e56c[_0x46cc70(0x18f)](_0x46cc70(0x186)+_0x320cc9)),console[_0x46cc70(0x177)](a5_0x10e56c[_0x46cc70(0x126)](_0x46cc70(0x120)+_0x3e4e4a['tests'][_0x46cc70(0x1ab)](_0x4b6f1e=>_0x4b6f1e[_0x46cc70(0x11d)])['join'](',\x20'))),0x1;}if(_0x3d5382){const _0x4592e4=_0x3d5382[_0x46cc70(0x132)](',')[_0x46cc70(0x1ab)](_0xcbd11a=>_0xcbd11a['trim']()[_0x46cc70(0x133)]());_0x5f5b1d=_0x5f5b1d[_0x46cc70(0x12b)](_0x256ac2=>_0x256ac2['tags']?.[_0x46cc70(0x150)](_0x12aeb8=>_0x4592e4['includes'](_0x12aeb8[_0x46cc70(0x133)]())));if(_0x5f5b1d[_0x46cc70(0x121)]===0x0){console[_0x46cc70(0x177)](a5_0x10e56c[_0x46cc70(0x18f)](_0x46cc70(0x17d)+_0x3d5382));const _0xd2927e=new Set();return _0x3e4e4a[_0x46cc70(0x166)][_0x46cc70(0x11e)](_0x589bf6=>_0x589bf6[_0x46cc70(0x138)]?.[_0x46cc70(0x11e)](_0x15a6df=>_0xd2927e['add'](_0x15a6df))),_0xd2927e[_0x46cc70(0x14b)]>0x0?console[_0x46cc70(0x177)](a5_0x10e56c[_0x46cc70(0x126)](_0x46cc70(0x17b)+[..._0xd2927e]['join'](',\x20'))):console[_0x46cc70(0x177)](a5_0x10e56c[_0x46cc70(0x126)]('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0x167576)return this['executeReeval'](_0x137522,{'definition':{'tests':_0x5f5b1d},'agentInfo':_0x1ae344,'outputFormat':_0x47c626,'outputFile':_0x2e0896,'testNames':_0x320cc9});if(_0x4de858){console[_0x46cc70(0x177)](a5_0x10e56c['cyan'](_0x46cc70(0x15a))),console[_0x46cc70(0x177)](_0x46cc70(0x13b)+a5_0x10e56c[_0x46cc70(0x140)](_0x6abef6)),console['log'](_0x46cc70(0x183)+a5_0x10e56c['white'](_0x1ae344[_0x46cc70(0x174)])),console[_0x46cc70(0x177)](_0x46cc70(0x157)+a5_0x10e56c[_0x46cc70(0x140)](_0x1ae344['agentName'])),console[_0x46cc70(0x177)](),console['log'](_0x46cc70(0x168)+a5_0x10e56c[_0x46cc70(0x140)](_0x5f5b1d['length']));for(let _0x19b813=0x0;_0x19b813<_0x5f5b1d[_0x46cc70(0x121)];_0x19b813++){const _0x195d84=_0x5f5b1d[_0x19b813],_0x22be3d=_0x195d84[_0x46cc70(0x118)][_0x46cc70(0x121)]===0x1?_0x46cc70(0x155):_0x46cc70(0x118),_0x53df66=_0x195d84[_0x46cc70(0x138)]?.['length']?'\x20['+_0x195d84[_0x46cc70(0x138)][_0x46cc70(0x199)](',\x20')+']':'';console['log']('\x20\x20'+(_0x19b813+0x1)+'.\x20'+a5_0x10e56c[_0x46cc70(0x140)](_0x195d84[_0x46cc70(0x11d)])+'\x20('+_0x195d84[_0x46cc70(0x118)]['length']+'\x20'+_0x22be3d+')'+a5_0x10e56c['dim'](_0x53df66));}return 0x0;}let _0x81e993,_0x43838f;try{_0x81e993=await _0x40eda8[_0x46cc70(0x197)][_0x46cc70(0x171)](_0x1ae344[_0x46cc70(0x174)]);}catch(_0x5f32d5){const _0xb61a6c=_0x5f32d5 instanceof Error?_0x5f32d5[_0x46cc70(0x15d)]:String(_0x5f32d5);return _0xb61a6c[_0x46cc70(0x128)](_0x46cc70(0x169))||_0xb61a6c[_0x46cc70(0x133)]()[_0x46cc70(0x128)](_0x46cc70(0x116))?console[_0x46cc70(0x177)](a5_0x10e56c['red'](_0x46cc70(0x189)+_0x1ae344[_0x46cc70(0x174)])):console[_0x46cc70(0x177)](a5_0x10e56c[_0x46cc70(0x143)](_0x46cc70(0x153)+_0x1ae344[_0x46cc70(0x174)]+_0x46cc70(0x13d)+_0xb61a6c)),0x1;}try{_0x43838f=await _0x40eda8[_0x46cc70(0x197)][_0x46cc70(0x193)](_0x1ae344[_0x46cc70(0x149)],_0x81e993);}catch(_0xbe4718){const _0x12ec1a=_0xbe4718 instanceof Error?_0xbe4718[_0x46cc70(0x15d)]:String(_0xbe4718);return _0x12ec1a[_0x46cc70(0x128)](_0x46cc70(0x169))||_0x12ec1a[_0x46cc70(0x133)]()[_0x46cc70(0x128)](_0x46cc70(0x116))?console['log'](a5_0x10e56c[_0x46cc70(0x143)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x1ae344['agentName'])):console[_0x46cc70(0x177)](a5_0x10e56c[_0x46cc70(0x143)](_0x46cc70(0x17e)+_0x1ae344['agentName']+_0x46cc70(0x13d)+_0x12ec1a)),0x1;}let _0x4dce8a;if(!_0x1b815e)try{_0x4dce8a=await setupEvaluatorAgent(_0x40eda8[_0x46cc70(0x197)],_0x376679[_0x46cc70(0x162)]);}catch(_0xf0d599){const _0x48f9c4=_0xf0d599 instanceof Error?_0xf0d599[_0x46cc70(0x15d)]:String(_0xf0d599);return console[_0x46cc70(0x177)](a5_0x10e56c[_0x46cc70(0x143)](_0x46cc70(0x1ad)+_0x48f9c4)),0x1;}console[_0x46cc70(0x177)](a5_0x10e56c[_0x46cc70(0x176)]('Running\x20agent\x20tests...')),console[_0x46cc70(0x177)]('Site:\x20'+a5_0x10e56c['white'](_0x6abef6)),console['log'](_0x46cc70(0x127)+a5_0x10e56c[_0x46cc70(0x140)](_0x1ae344[_0x46cc70(0x174)]+'/'+_0x1ae344[_0x46cc70(0x149)])),console['log']();const _0x21b5ff=[],_0x54ee2a=[],_0x2247a6=Date[_0x46cc70(0x18e)]();for(let _0xda366b=0x0;_0xda366b<_0x5f5b1d['length'];_0xda366b++){const _0x568caf=_0x5f5b1d[_0xda366b];_0x5f5b1d[_0x46cc70(0x121)]>0x1?console[_0x46cc70(0x177)](_0x46cc70(0x163)+(_0xda366b+0x1)+'/'+_0x5f5b1d[_0x46cc70(0x121)]+':\x20'+a5_0x10e56c[_0x46cc70(0x140)](_0x568caf[_0x46cc70(0x11d)])):console['log'](_0x46cc70(0x14d)+a5_0x10e56c[_0x46cc70(0x140)](_0x568caf['name']));const _0x1ae814=createCommandSpinner('Round\x201/'+_0x568caf[_0x46cc70(0x118)]['length']+_0x46cc70(0x170));_0x1ae814[_0x46cc70(0x12f)]();try{const {result:_0x2e98e6,conversation:_0x4a41be}=await runTest(_0x40eda8[_0x46cc70(0x197)],_0x568caf,{'agentId':_0x43838f,'projectId':_0x81e993,'site':_0x6abef6,'noEval':_0x1b815e,'evaluatorId':_0x4dce8a,'onRoundStart':(_0x14a666,_0x3915e7)=>{const _0x1215cd=_0x46cc70;_0x1ae814[_0x1215cd(0x191)]='Round\x20'+(_0x14a666+0x1)+'/'+_0x3915e7+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x22712d,_0x5205a7,_0x39ac3f)=>{const _0x58085a=_0x46cc70,_0x43af9d=formatElapsed(_0x5205a7);_0x39ac3f?console[_0x58085a(0x177)](_0x58085a(0x156)+(_0x22712d+0x1)+'/'+_0x568caf[_0x58085a(0x118)]['length']+_0x58085a(0x15e)+a5_0x10e56c[_0x58085a(0x1a4)]('✓')+'\x20('+_0x43af9d+')'):console[_0x58085a(0x177)](_0x58085a(0x156)+(_0x22712d+0x1)+'/'+_0x568caf[_0x58085a(0x118)]['length']+'...\x20'+a5_0x10e56c[_0x58085a(0x143)]('✗'));},'onEvaluationStart':()=>{const _0x59621d=_0x46cc70;_0x1ae814[_0x59621d(0x191)]=_0x59621d(0x16e);},'onEvaluationComplete':_0x2d9e23=>{const _0x262783=_0x46cc70,_0x549eb3=formatElapsed(_0x2d9e23);console['log'](_0x262783(0x11f)+a5_0x10e56c['green']('✓')+'\x20('+_0x549eb3+')');}});_0x1ae814[_0x46cc70(0x130)](),_0x21b5ff[_0x46cc70(0x182)](_0x2e98e6),_0x54ee2a['push'](_0x4a41be);if(_0x2e98e6[_0x46cc70(0x196)]===_0x46cc70(0x131))console[_0x46cc70(0x177)](a5_0x10e56c[_0x46cc70(0x1a4)](_0x46cc70(0x124)+_0x2e98e6['reason']));else _0x2e98e6[_0x46cc70(0x196)]===_0x46cc70(0x16a)?console[_0x46cc70(0x177)](a5_0x10e56c[_0x46cc70(0x143)](_0x46cc70(0x134)+_0x2e98e6['reason'])):console[_0x46cc70(0x177)](a5_0x10e56c[_0x46cc70(0x143)](_0x46cc70(0x145)+_0x2e98e6[_0x46cc70(0x198)]));_0x2e98e6[_0x46cc70(0x172)]&&console[_0x46cc70(0x177)](a5_0x10e56c['dim']('Conversation\x20URL:\x20'+_0x2e98e6[_0x46cc70(0x172)])),console[_0x46cc70(0x177)]();}catch(_0x13cc8d){_0x1ae814[_0x46cc70(0x130)]();const _0x6ed08d=_0x13cc8d instanceof Error?_0x13cc8d['message']:String(_0x13cc8d);console['log'](a5_0x10e56c[_0x46cc70(0x143)](_0x46cc70(0x145)+_0x6ed08d)),console[_0x46cc70(0x177)](),_0x21b5ff[_0x46cc70(0x182)]({'name':_0x568caf['name'],'status':_0x46cc70(0x1ac),'reason':_0x6ed08d,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x65a49f=Date['now']()-_0x2247a6,_0x523fe3=_0x21b5ff[_0x46cc70(0x12b)](_0x2655e5=>_0x2655e5[_0x46cc70(0x196)]===_0x46cc70(0x131))[_0x46cc70(0x121)],_0x2e6cd5=_0x21b5ff[_0x46cc70(0x12b)](_0x27179b=>_0x27179b['status']===_0x46cc70(0x16a))[_0x46cc70(0x121)],_0x3b481f=_0x21b5ff[_0x46cc70(0x12b)](_0xbcfeb4=>_0xbcfeb4[_0x46cc70(0x196)]===_0x46cc70(0x1ac))[_0x46cc70(0x121)];console[_0x46cc70(0x177)]('━'[_0x46cc70(0x19d)](0x3c)),console[_0x46cc70(0x177)](_0x46cc70(0x13a)),console[_0x46cc70(0x177)]('━'['repeat'](0x3c)),console[_0x46cc70(0x177)](_0x46cc70(0x144)+_0x21b5ff[_0x46cc70(0x121)]),console[_0x46cc70(0x177)](_0x46cc70(0x15f)+a5_0x10e56c['green'](_0x523fe3)),console[_0x46cc70(0x177)](_0x46cc70(0x195)+a5_0x10e56c['red'](_0x2e6cd5));_0x3b481f>0x0&&console[_0x46cc70(0x177)](_0x46cc70(0x192)+a5_0x10e56c[_0x46cc70(0x143)](_0x3b481f));console[_0x46cc70(0x177)](_0x46cc70(0x1a0)+formatElapsed(_0x65a49f)),console['log']('━'[_0x46cc70(0x19d)](0x3c));const _0xf5981e=_0x21b5ff[_0x46cc70(0x12b)](_0x469f89=>_0x469f89['status']!==_0x46cc70(0x131));if(_0xf5981e[_0x46cc70(0x121)]>0x0){console['log'](),console[_0x46cc70(0x177)](_0x46cc70(0x14a));for(const _0x33103b of _0xf5981e){const _0x4aab22=a5_0x10e56c[_0x46cc70(0x143)]('✗'),_0x5ce646=_0x33103b['reason']['length']>0x32?_0x33103b['reason'][_0x46cc70(0x187)](0x0,0x32)+_0x46cc70(0x123):_0x33103b[_0x46cc70(0x198)];console[_0x46cc70(0x177)]('\x20\x20'+_0x4aab22+'\x20'+_0x33103b[_0x46cc70(0x11d)]+':\x20'+_0x5ce646);}}const _0x2ef28b={'summary':{'total':_0x21b5ff[_0x46cc70(0x121)],'passed':_0x523fe3,'failed':_0x2e6cd5,'errors':_0x3b481f>0x0?_0x3b481f:undefined,'duration_ms':_0x65a49f},'tests':_0x21b5ff,'agent':{'project':_0x1ae344[_0x46cc70(0x174)],'name':_0x1ae344[_0x46cc70(0x149)],'site':_0x6abef6},'timestamp':new Date(_0x2247a6)['toISOString']()};try{const _0x3d290b=buildCachedTestRun(_0x54ee2a,{'site':_0x6abef6,'projectId':_0x81e993,'projectName':_0x1ae344[_0x46cc70(0x174)],'agentId':_0x43838f,'agentName':_0x1ae344[_0x46cc70(0x149)],'testYmlPath':a5_0xd173a7[_0x46cc70(0x1aa)](_0x1ae344[_0x46cc70(0x16f)])});saveLastTestRun(_0x3d290b);}catch{}if(_0x47c626!==_0x46cc70(0x11b)||_0x2e0896){const _0x5ad61a=formatResults(_0x2ef28b,_0x47c626);if(_0x2e0896)try{a5_0x343e4e['writeFileSync'](_0x2e0896,_0x5ad61a,'utf-8'),console['log'](),console[_0x46cc70(0x177)](a5_0x10e56c['dim']('Output\x20written\x20to:\x20'+_0x2e0896));}catch(_0x15ef26){return console[_0x46cc70(0x177)](),console[_0x46cc70(0x177)](a5_0x10e56c[_0x46cc70(0x143)](_0x46cc70(0x12a)+_0x15ef26)),0x1;}else console[_0x46cc70(0x177)](),console[_0x46cc70(0x177)](_0x5ad61a);}return _0xf5981e[_0x46cc70(0x121)]>0x0?0x1:0x0;}async[a5_0x5d7a31(0x175)](_0x2ba1f2,_0x11421c){const _0x35df99=a5_0x5d7a31,{options:_0x5ef9e7,tdx:_0x4dbf99}=_0x2ba1f2,{definition:_0x315dae,agentInfo:_0x262034,outputFormat:_0x4a1544,outputFile:_0x25390e}=_0x11421c,_0x215e18=_0x5ef9e7['site'],_0x3b8982=loadLastTestRun();if(!_0x3b8982)return console[_0x35df99(0x177)](a5_0x10e56c[_0x35df99(0x143)](_0x35df99(0x154))),console[_0x35df99(0x177)](a5_0x10e56c[_0x35df99(0x126)](_0x35df99(0x14c))),0x1;if(_0x3b8982[_0x35df99(0x161)][_0x35df99(0x149)]!==_0x262034[_0x35df99(0x149)])return console[_0x35df99(0x177)](a5_0x10e56c[_0x35df99(0x143)](_0x35df99(0x146)+_0x3b8982[_0x35df99(0x161)][_0x35df99(0x149)]+_0x35df99(0x15b)+_0x262034[_0x35df99(0x149)]+'\x22.')),console[_0x35df99(0x177)](a5_0x10e56c[_0x35df99(0x126)](_0x35df99(0x15c))),0x1;const _0x1a383f=new Set(_0x3b8982[_0x35df99(0x19c)][_0x35df99(0x1ab)](_0x348b4e=>_0x348b4e[_0x35df99(0x1a7)])),_0x429c2b=_0x315dae['tests'][_0x35df99(0x12b)](_0x448f3a=>!_0x1a383f[_0x35df99(0x136)](_0x448f3a[_0x35df99(0x11d)]));if(_0x429c2b[_0x35df99(0x121)]>0x0&&_0x3b8982['site']!==_0x215e18)return console['log'](a5_0x10e56c[_0x35df99(0x143)](_0x35df99(0x12d))),console[_0x35df99(0x177)](a5_0x10e56c[_0x35df99(0x126)](_0x35df99(0x13e)+_0x3b8982[_0x35df99(0x18d)]+_0x35df99(0x165)+_0x215e18+'\x22.')),console[_0x35df99(0x177)](a5_0x10e56c[_0x35df99(0x126)]('Either\x20switch\x20to\x20the\x20\x22'+_0x3b8982['site']+_0x35df99(0x148))),0x1;const _0x3239f1=_0x315dae[_0x35df99(0x166)][_0x35df99(0x12b)](_0x1af9f0=>_0x1a383f[_0x35df99(0x136)](_0x1af9f0[_0x35df99(0x11d)])),_0x5e0810=_0x429c2b;let _0x4ec66b;try{_0x4ec66b=await setupEvaluatorAgent(_0x4dbf99[_0x35df99(0x197)],_0x5ef9e7[_0x35df99(0x162)]);}catch(_0x5e9cd5){const _0x326169=_0x5e9cd5 instanceof Error?_0x5e9cd5[_0x35df99(0x15d)]:String(_0x5e9cd5);return console['log'](a5_0x10e56c[_0x35df99(0x143)](_0x35df99(0x1ad)+_0x326169)),0x1;}console[_0x35df99(0x177)](a5_0x10e56c[_0x35df99(0x176)](_0x35df99(0x1a8))),console[_0x35df99(0x177)](_0x35df99(0x119)+a5_0x10e56c[_0x35df99(0x140)](_0x3b8982['timestamp'])),console['log'](_0x35df99(0x127)+a5_0x10e56c['white'](_0x3b8982[_0x35df99(0x161)][_0x35df99(0x174)]+'/'+_0x3b8982['agent'][_0x35df99(0x149)]));_0x5e0810['length']>0x0&&console[_0x35df99(0x177)]('New\x20tests\x20to\x20execute:\x20'+a5_0x10e56c[_0x35df99(0x18f)](_0x5e0810[_0x35df99(0x121)]));console[_0x35df99(0x177)]();const _0x164777=[],_0x34538b=Date['now'](),_0x20aed7=createCommandSpinner('Re-evaluating...');if(_0x3239f1[_0x35df99(0x121)]>0x0)try{const _0x4f4c17=await reevaluateFromCache(_0x4dbf99[_0x35df99(0x197)],_0x3b8982,{'tests':_0x3239f1},{'evaluatorId':_0x4ec66b,'onTestStart':(_0x713f53,_0x58942,_0x4a5a9c)=>{const _0x5d496c=_0x35df99;_0x20aed7[_0x5d496c(0x191)]='Re-evaluating\x20'+(_0x58942+0x1)+'/'+_0x4a5a9c+':\x20'+_0x713f53+_0x5d496c(0x123);if(!_0x20aed7[_0x5d496c(0x139)])_0x20aed7[_0x5d496c(0x12f)]();},'onTestComplete':(_0x2e2276,_0x3f6732)=>{const _0x429daa=_0x35df99;_0x20aed7[_0x429daa(0x130)]();if(_0x3f6732[_0x429daa(0x196)]==='PASS')console[_0x429daa(0x177)](a5_0x10e56c[_0x429daa(0x1a4)]('✓\x20PASS:\x20'+_0x2e2276)+a5_0x10e56c['dim']('\x20(cached)'));else _0x3f6732[_0x429daa(0x196)]==='FAIL'?console[_0x429daa(0x177)](a5_0x10e56c['red']('✗\x20FAIL:\x20'+_0x2e2276+'\x20-\x20'+_0x3f6732[_0x429daa(0x198)])+a5_0x10e56c[_0x429daa(0x126)](_0x429daa(0x142))):console[_0x429daa(0x177)](a5_0x10e56c['red'](_0x429daa(0x145)+_0x2e2276+_0x429daa(0x158)+_0x3f6732['reason']));_0x3f6732['conversation_url']&&console[_0x429daa(0x177)](a5_0x10e56c[_0x429daa(0x126)](_0x429daa(0x17a)+_0x3f6732['conversation_url'])),_0x164777[_0x429daa(0x182)](_0x3f6732);},'onTestSkipped':(_0x3a4115,_0x2662f9)=>{const _0x1ffcf8=_0x35df99;_0x20aed7['stop'](),console['log'](a5_0x10e56c[_0x1ffcf8(0x18f)](_0x1ffcf8(0x184)+_0x3a4115+_0x1ffcf8(0x158)+_0x2662f9));}});for(const _0x4edacc of _0x4f4c17){!_0x164777['find'](_0x1712d0=>_0x1712d0[_0x35df99(0x11d)]===_0x4edacc[_0x35df99(0x11d)])&&_0x164777['push'](_0x4edacc);}}catch(_0x8baecc){_0x20aed7['stop']();const _0xc9cd38=_0x8baecc instanceof Error?_0x8baecc['message']:String(_0x8baecc);return console[_0x35df99(0x177)](a5_0x10e56c[_0x35df99(0x143)](_0x35df99(0x1ae)+_0xc9cd38)),0x1;}_0x20aed7[_0x35df99(0x130)]();if(_0x5e0810['length']>0x0){console[_0x35df99(0x177)](),console[_0x35df99(0x177)](a5_0x10e56c[_0x35df99(0x176)](_0x35df99(0x12e)));const {projectId:_0x1f71be,agentId:_0x2d8d4e}=_0x3b8982[_0x35df99(0x161)];for(const _0x41ef5e of _0x5e0810){console[_0x35df99(0x177)](_0x35df99(0x151)+a5_0x10e56c[_0x35df99(0x140)](_0x41ef5e[_0x35df99(0x11d)]));const _0x502dd6=createCommandSpinner(_0x35df99(0x18a)+_0x41ef5e[_0x35df99(0x118)][_0x35df99(0x121)]+_0x35df99(0x170));_0x502dd6['start']();try{const {result:_0x116b9a}=await runTest(_0x4dbf99[_0x35df99(0x197)],_0x41ef5e,{'agentId':_0x2d8d4e,'projectId':_0x1f71be,'site':_0x3b8982[_0x35df99(0x18d)],'noEval':![],'evaluatorId':_0x4ec66b,'onRoundStart':(_0xf6eb1d,_0x4db231)=>{const _0x171744=_0x35df99;_0x502dd6['text']=_0x171744(0x1a2)+(_0xf6eb1d+0x1)+'/'+_0x4db231+_0x171744(0x170);},'onRoundComplete':(_0x29caff,_0x3a1da6,_0x35168b)=>{const _0x12a343=_0x35df99,_0x230290=formatElapsed(_0x3a1da6);_0x35168b?console[_0x12a343(0x177)]('\x20\x20Round\x20'+(_0x29caff+0x1)+'/'+_0x41ef5e['rounds'][_0x12a343(0x121)]+_0x12a343(0x15e)+a5_0x10e56c[_0x12a343(0x1a4)]('✓')+'\x20('+_0x230290+')'):console[_0x12a343(0x177)]('\x20\x20Round\x20'+(_0x29caff+0x1)+'/'+_0x41ef5e['rounds'][_0x12a343(0x121)]+'...\x20'+a5_0x10e56c[_0x12a343(0x143)]('✗'));},'onEvaluationStart':()=>{const _0x17d088=_0x35df99;_0x502dd6[_0x17d088(0x191)]=_0x17d088(0x16e);},'onEvaluationComplete':_0x240607=>{const _0x4d715f=_0x35df99,_0x3648b8=formatElapsed(_0x240607);console[_0x4d715f(0x177)](_0x4d715f(0x11f)+a5_0x10e56c[_0x4d715f(0x1a4)]('✓')+'\x20('+_0x3648b8+')');}});_0x502dd6['stop'](),_0x164777['push'](_0x116b9a);if(_0x116b9a['status']===_0x35df99(0x131))console['log'](a5_0x10e56c['green'](_0x35df99(0x124)+_0x116b9a[_0x35df99(0x198)])+a5_0x10e56c[_0x35df99(0x126)]('\x20(new)'));else _0x116b9a[_0x35df99(0x196)]==='FAIL'?console[_0x35df99(0x177)](a5_0x10e56c[_0x35df99(0x143)](_0x35df99(0x134)+_0x116b9a[_0x35df99(0x198)])+a5_0x10e56c['dim']('\x20(new)')):console[_0x35df99(0x177)](a5_0x10e56c[_0x35df99(0x143)](_0x35df99(0x145)+_0x116b9a['reason']));_0x116b9a[_0x35df99(0x172)]&&console[_0x35df99(0x177)](a5_0x10e56c[_0x35df99(0x126)]('\x20\x20Conversation:\x20'+_0x116b9a[_0x35df99(0x172)]));}catch(_0x4ba899){_0x502dd6[_0x35df99(0x130)]();const _0x5344ad=_0x4ba899 instanceof Error?_0x4ba899[_0x35df99(0x15d)]:String(_0x4ba899);console['log'](a5_0x10e56c[_0x35df99(0x143)](_0x35df99(0x145)+_0x5344ad)),_0x164777[_0x35df99(0x182)]({'name':_0x41ef5e[_0x35df99(0x11d)],'status':'ERROR','reason':_0x5344ad,'timestamp':new Date()[_0x35df99(0x190)](),'duration_ms':0x0});}}}console['log']();const _0xdad340=Date['now']()-_0x34538b,_0x574eae=_0x164777[_0x35df99(0x12b)](_0x3a1f3d=>_0x3a1f3d[_0x35df99(0x196)]===_0x35df99(0x131))[_0x35df99(0x121)],_0x111db3=_0x164777[_0x35df99(0x12b)](_0x136743=>_0x136743[_0x35df99(0x196)]===_0x35df99(0x16a))[_0x35df99(0x121)],_0x3057e8=_0x164777['filter'](_0x1ced14=>_0x1ced14[_0x35df99(0x196)]===_0x35df99(0x1ac))[_0x35df99(0x121)];console[_0x35df99(0x177)]('━'[_0x35df99(0x19d)](0x3c)),console['log'](_0x35df99(0x194)),console[_0x35df99(0x177)]('━'[_0x35df99(0x19d)](0x3c)),console['log'](_0x35df99(0x144)+_0x164777['length']),console['log']('Passed:\x20\x20\x20'+a5_0x10e56c[_0x35df99(0x1a4)](_0x574eae)),console[_0x35df99(0x177)](_0x35df99(0x195)+a5_0x10e56c[_0x35df99(0x143)](_0x111db3));_0x3057e8>0x0&&console[_0x35df99(0x177)](_0x35df99(0x192)+a5_0x10e56c[_0x35df99(0x143)](_0x3057e8));console[_0x35df99(0x177)](_0x35df99(0x1a0)+formatElapsed(_0xdad340)),console[_0x35df99(0x177)]('━'['repeat'](0x3c));const _0x1f4418={'summary':{'total':_0x164777['length'],'passed':_0x574eae,'failed':_0x111db3,'errors':_0x3057e8>0x0?_0x3057e8:undefined,'duration_ms':_0xdad340},'tests':_0x164777,'agent':{'project':_0x262034['projectName'],'name':_0x262034[_0x35df99(0x149)],'site':_0x215e18},'timestamp':new Date(_0x34538b)[_0x35df99(0x190)]()};if(_0x4a1544!==_0x35df99(0x11b)||_0x25390e){const _0xb056db=formatResults(_0x1f4418,_0x4a1544);if(_0x25390e)try{a5_0x343e4e['writeFileSync'](_0x25390e,_0xb056db,_0x35df99(0x181)),console[_0x35df99(0x177)](),console['log'](a5_0x10e56c[_0x35df99(0x126)](_0x35df99(0x17f)+_0x25390e));}catch(_0x3c0440){return console[_0x35df99(0x177)](),console['log'](a5_0x10e56c[_0x35df99(0x143)](_0x35df99(0x12a)+_0x3c0440)),0x1;}else console[_0x35df99(0x177)](),console[_0x35df99(0x177)](_0xb056db);}const _0xc6b5be=_0x164777[_0x35df99(0x12b)](_0x50c049=>_0x50c049[_0x35df99(0x196)]!==_0x35df99(0x131));return _0xc6b5be[_0x35df99(0x121)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x43006d=a6_0x57d9;(function(_0x54a553,_0x310236){const _0x23998c=a6_0x57d9,_0x725e3=_0x54a553();while(!![]){try{const _0x5a33f4=-parseInt(_0x23998c(0xe0))/0x1+parseInt(_0x23998c(0xc6))/0x2+-parseInt(_0x23998c(0xab))/0x3+parseInt(_0x23998c(0xad))/0x4+parseInt(_0x23998c(0xdc))/0x5*(parseInt(_0x23998c(0xc5))/0x6)+parseInt(_0x23998c(0xa7))/0x7*(parseInt(_0x23998c(0xb8))/0x8)+parseInt(_0x23998c(0xcd))/0x9*(-parseInt(_0x23998c(0xbe))/0xa);if(_0x5a33f4===_0x310236)break;else _0x725e3['push'](_0x725e3['shift']());}catch(_0x21e3b3){_0x725e3['push'](_0x725e3['shift']());}}}(a6_0x3a04,0x93529));function a6_0x3a04(){const _0x396c52=['length','headers','9rQtiJM','trino','x-trino-user','message','startsWith','data','api','error','keys','join','entries','workflow','execute','\x0aStack\x20trace:\x0a','stack','305OsxMvL','method','toLowerCase','Invalid\x20HTTP\x20method:\x20','489900KmprHb','PATCH','log','site','7KIIfvg','proxy-authorization','x-xsrf-token','trim','887964tlFwRm','.\x20Valid\x20methods:\x20','3690048rINfod','type','file','Invalid\x20API\x20type:\x20','\x22.\x20','set-cookie2','GET','validate','DELETE','noColor','Results\x20saved\x20to\x20','3903032KVrvHi','output','description','indexOf','Endpoint\x20must\x20start\x20with\x20/:\x20','substring','10128230siroif','POST','verbose','cookie','includes','Error:\x20','request','5076ccvkrE','1880294rubTvD','color','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','cdp','PUT'];a6_0x3a04=function(){return _0x396c52;};return a6_0x3a04();}function a6_0x57d9(_0x3f1256,_0x7e5aac){_0x3f1256=_0x3f1256-0xa6;const _0x3a04f5=a6_0x3a04();let _0x57d9f5=_0x3a04f5[_0x3f1256];return _0x57d9f5;}import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set(['authorization',a6_0x43006d(0xa8),a6_0x43006d(0xc1),'set-cookie',a6_0x43006d(0xb2),a6_0x43006d(0xa9),'x-auth-token',a6_0x43006d(0xcf)]);function isSensitiveHeader(_0x4f833e){const _0x1aa2a9=a6_0x43006d;return SENSITIVE_HEADERS['has'](_0x4f833e[_0x1aa2a9(0xde)]());}function parseHeader(_0x532af5){const _0x3c9b8a=a6_0x43006d,_0x56f02a=_0x532af5[_0x3c9b8a(0xbb)](':');if(_0x56f02a===-0x1)throw new Error('Invalid\x20header\x20format:\x20\x22'+_0x532af5+_0x3c9b8a(0xb1)+'Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22');const _0x34898e=_0x532af5[_0x3c9b8a(0xbd)](0x0,_0x56f02a)[_0x3c9b8a(0xaa)](),_0x34463d=_0x532af5[_0x3c9b8a(0xbd)](_0x56f02a+0x1)[_0x3c9b8a(0xaa)]();if(!_0x34898e)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0x532af5+'\x22');return[_0x34898e,_0x34463d];}export class ApiCommand extends BaseCommand{['name']=a6_0x43006d(0xd3);[a6_0x43006d(0xba)]='Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs';[a6_0x43006d(0xb4)](_0x784c58){const _0x599e15=a6_0x43006d,{args:_0xc1122f,options:_0x3f0a8d}=_0x784c58,_0x1bb30a=_0x3f0a8d;if(_0xc1122f[_0x599e15(0xcb)]===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x4f86ea=_0xc1122f[0x0];if(!_0x4f86ea[_0x599e15(0xd1)]('/'))return _0x599e15(0xbc)+_0x4f86ea;const _0x2e4b9e=_0x1bb30a[_0x599e15(0xd2)],_0x336526=_0x1bb30a[_0x599e15(0xaf)];if(_0x2e4b9e&&_0x336526)return _0x599e15(0xc8);const _0x29f3ea=_0x1bb30a[_0x599e15(0xdd)]||_0x599e15(0xb3),_0x5acb7f=[_0x599e15(0xb3),_0x599e15(0xbf),_0x599e15(0xca),_0x599e15(0xb5),_0x599e15(0xe1)];if(!_0x5acb7f[_0x599e15(0xc2)](_0x29f3ea['toUpperCase']()))return _0x599e15(0xdf)+_0x29f3ea+_0x599e15(0xac)+_0x5acb7f[_0x599e15(0xd6)](',\x20');const _0x41c479=_0x1bb30a['type']||'td',_0x2af872=['td',_0x599e15(0xc9),_0x599e15(0xd8),_0x599e15(0xce),'llm','llm-proxy'];if(!_0x2af872[_0x599e15(0xc2)](_0x41c479))return _0x599e15(0xb0)+_0x41c479+'.\x20Valid\x20types:\x20'+_0x2af872[_0x599e15(0xd6)](',\x20');return undefined;}async[a6_0x43006d(0xd9)](_0x34f976){const _0x368c42=a6_0x43006d,{options:_0x4f12dc,args:_0x108600,tdx:_0x2ad945}=_0x34f976,_0x247952=_0x4f12dc,_0x1b2f8e=_0x108600[0x0],_0x2c69ca=(_0x247952[_0x368c42(0xdd)]||'GET')['toUpperCase'](),_0x3e364e=_0x247952[_0x368c42(0xd2)],_0x33baea=_0x247952[_0x368c42(0xaf)],_0x209c8f=_0x247952['header'],_0x22723b=_0x247952[_0x368c42(0xae)]||'td';try{const _0x5e88f2={};if(_0x209c8f){const _0x302e0c=Array['isArray'](_0x209c8f)?_0x209c8f:[_0x209c8f];for(const _0x432826 of _0x302e0c){const [_0x31caf3,_0x3cf0d6]=parseHeader(_0x432826);_0x5e88f2[_0x31caf3]=_0x3cf0d6;}}let _0x14554e;if(_0x3e364e)_0x14554e=_0x3e364e;else{if(_0x33baea)try{_0x14554e=RawAPI['readBodyFromFile'](_0x33baea);}catch(_0x186eb9){return console[_0x368c42(0xd4)](_0x368c42(0xc3)+(_0x186eb9 instanceof Error?_0x186eb9[_0x368c42(0xd0)]:String(_0x186eb9))),0x1;}}const _0x1b1e31={'method':_0x2c69ca,'apiType':_0x22723b,'includeHeaders':_0x4f12dc[_0x368c42(0xc0)]};_0x14554e&&(_0x1b1e31['body']=_0x14554e);Object[_0x368c42(0xd5)](_0x5e88f2)[_0x368c42(0xcb)]>0x0&&(_0x1b1e31[_0x368c42(0xcc)]=_0x5e88f2);if(_0x4f12dc[_0x368c42(0xc0)]){const _0x5556df=resolveSite(_0x4f12dc[_0x368c42(0xa6)]),_0x2b88a5=getEndpoint(_0x5556df,_0x22723b),_0x2ef6ed=''+_0x2b88a5+_0x1b2f8e;console[_0x368c42(0xd4)]('>\x20'+_0x2c69ca+'\x20'+_0x2ef6ed);const _0x1cf0aa=getAuthHeaders(_0x5556df),_0x106f64={..._0x1cf0aa,..._0x5e88f2};for(const [_0x5f30de,_0x5f591e]of Object[_0x368c42(0xd7)](_0x106f64)){!isSensitiveHeader(_0x5f30de)&&console['error']('>\x20'+_0x5f30de+':\x20'+_0x5f591e);}_0x14554e&&console[_0x368c42(0xd4)]('>'),console['error']('');}const _0x550799=await _0x2ad945[_0x368c42(0xd3)][_0x368c42(0xc4)](_0x1b2f8e,_0x1b1e31);if(_0x4f12dc[_0x368c42(0xc0)]&&_0x550799['headers']){console[_0x368c42(0xd4)]('<\x20HTTP/1.1\x20'+_0x550799['status']);for(const [_0x299737,_0xadf409]of Object[_0x368c42(0xd7)](_0x550799[_0x368c42(0xcc)])){!isSensitiveHeader(_0x299737)&&console[_0x368c42(0xd4)]('<\x20'+_0x299737+':\x20'+_0xadf409);}console[_0x368c42(0xd4)]('');}const _0xc93f46=Boolean(_0x4f12dc['output']),_0x3f0d3f={'color':_0x4f12dc[_0x368c42(0xc7)],'noColor':_0x4f12dc[_0x368c42(0xb6)]||_0xc93f46&&!_0x4f12dc[_0x368c42(0xc7)]},_0x451252=colorizeJSON(_0x550799[_0x368c42(0xd2)],_0x3f0d3f);return _0x4f12dc['output']?(writeFileSync(_0x4f12dc[_0x368c42(0xb9)],_0x451252),console[_0x368c42(0xd4)](_0x368c42(0xb7)+_0x4f12dc[_0x368c42(0xb9)])):console[_0x368c42(0xe2)](_0x451252),0x0;}catch(_0x4a6ab7){return _0x4a6ab7 instanceof Error?(console[_0x368c42(0xd4)]('Error:\x20'+_0x4a6ab7['message']),_0x4f12dc['verbose']&&_0x4a6ab7[_0x368c42(0xdb)]&&console[_0x368c42(0xd4)](_0x368c42(0xda)+_0x4a6ab7[_0x368c42(0xdb)])):console[_0x368c42(0xd4)](_0x368c42(0xc3)+String(_0x4a6ab7)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a7_0x2a22(_0x5b3e21,_0x4321b8){_0x5b3e21=_0x5b3e21-0xde;const _0x48dcfe=a7_0x48dc();let _0x2a2209=_0x48dcfe[_0x5b3e21];return _0x2a2209;}const a7_0x24cefe=a7_0x2a22;(function(_0x430510,_0xe3cb72){const _0x41635e=a7_0x2a22,_0x53e066=_0x430510();while(!![]){try{const _0x39dc80=parseInt(_0x41635e(0x122))/0x1+-parseInt(_0x41635e(0xe7))/0x2*(-parseInt(_0x41635e(0x109))/0x3)+parseInt(_0x41635e(0x11f))/0x4+parseInt(_0x41635e(0x11c))/0x5*(parseInt(_0x41635e(0xe5))/0x6)+parseInt(_0x41635e(0xe1))/0x7*(-parseInt(_0x41635e(0x124))/0x8)+-parseInt(_0x41635e(0x11b))/0x9*(-parseInt(_0x41635e(0xf4))/0xa)+-parseInt(_0x41635e(0xde))/0xb;if(_0x39dc80===_0xe3cb72)break;else _0x53e066['push'](_0x53e066['shift']());}catch(_0x4e7cc1){_0x53e066['push'](_0x53e066['shift']());}}}(a7_0x48dc,0x70963));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_0x1048f9 from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a7_0xeef820 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x24cefe(0xef)]='auth:setup';[a7_0x24cefe(0xee)]='Setup\x20API\x20key\x20authentication\x20interactively';async['execute'](_0x22e294){const _0x32b541=a7_0x24cefe,{options:_0x374315}=_0x22e294,_0x364e2d=_0x374315[_0x32b541(0x110)];console[_0x32b541(0x10d)](a7_0xeef820['bold'](_0x32b541(0x119)));const _0x725bac=_0x374315[_0x32b541(0x112)]||_0x32b541(0xfa),{choices:_0xa18a7a,initialIndex:_0x5c05c4}=buildSiteChoices(_0x725bac),_0xd551f9=_0x364e2d?_0x32b541(0xf6)+_0x364e2d+'):':_0x32b541(0x11e),_0x1abe37=await a7_0x1048f9({'type':'select','name':'site','message':_0xd551f9,'choices':_0xa18a7a,'initial':_0x5c05c4});if(!_0x1abe37[_0x32b541(0x112)])return console['log'](_0x32b541(0x120)),0x1;let _0x24d6e1;if(_0x1abe37[_0x32b541(0x112)]===_0x32b541(0x117)){const _0x5217e5=await a7_0x1048f9({'type':_0x32b541(0xf0),'name':'customSite','message':_0x32b541(0xea),'initial':_0x32b541(0xfa),'validate':_0x4401fc=>{const _0x3a4b24=_0x32b541;if(!_0x4401fc||!_0x4401fc[_0x3a4b24(0xf2)]())return _0x3a4b24(0x103);if(!/^[a-z0-9-]+$/[_0x3a4b24(0x121)](_0x4401fc[_0x3a4b24(0xf2)]()))return _0x3a4b24(0x118);return!![];}});if(!_0x5217e5['customSite'])return console[_0x32b541(0x10d)](_0x32b541(0x120)),0x1;_0x24d6e1=_0x5217e5[_0x32b541(0x100)];}else _0x24d6e1=_0x1abe37[_0x32b541(0x112)];const _0x478ba9=resolveSite(_0x24d6e1);console[_0x32b541(0x10d)]('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x478ba9),console[_0x32b541(0x10d)](_0x32b541(0x127)),console['log']('\x20\x20'+getConsoleUrl(_0x478ba9,_0x32b541(0xfe)));const _0x3bb682=await a7_0x1048f9({'type':_0x32b541(0x126),'name':'apiKey','message':_0x32b541(0x101),'validate':_0x296ce0=>{if(!_0x296ce0||!_0x296ce0['trim']())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x3bb682[_0x32b541(0x10e)])return console[_0x32b541(0x10d)]('\x0aSetup\x20cancelled'),0x1;const _0x2ce236=_0x3bb682[_0x32b541(0x10e)];console[_0x32b541(0x10d)](_0x32b541(0xf8));try{const _0xdea040=TDX[_0x32b541(0xff)]({'site':_0x478ba9,'apiKey':_0x2ce236[_0x32b541(0xf2)](),'logLevel':_0x374315[_0x32b541(0xdf)]??LogLevel['ERROR']}),_0x3bcdd2=await _0xdea040[_0x32b541(0xf3)][_0x32b541(0x116)]();console[_0x32b541(0x10d)]('✓\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x3bcdd2[_0x32b541(0xf5)]+')');const _0x500492=await isKeychainAvailable();_0x500492?(await saveAPIKeyAsync(_0x2ce236[_0x32b541(0xf2)](),_0x478ba9,_0x364e2d),console['log'](_0x32b541(0x114)+(_0x364e2d?_0x32b541(0x105)+_0x364e2d+')':''))):(console[_0x32b541(0xeb)](a7_0xeef820['yellow'](_0x32b541(0xe4))),console[_0x32b541(0xeb)](a7_0xeef820['yellow']('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0x364e2d){const _0x745d33={'site':_0x478ba9};saveProfileToUserConfig(_0x364e2d,_0x745d33),console['log'](_0x32b541(0xf1)+_0x364e2d+_0x32b541(0xf9));}else saveDefaultSiteToUserConfig(_0x478ba9),console[_0x32b541(0x10d)](_0x32b541(0xe3)+_0x478ba9);const _0x3d31fb=_0x364e2d?_0x32b541(0xe0)+_0x364e2d:'';return console[_0x32b541(0x10d)](),console[_0x32b541(0x10d)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x32b541(0x10d)](_0x32b541(0x106)+_0x3d31fb+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x32b541(0x10d)](_0x32b541(0x106)+_0x3d31fb+_0x32b541(0x10f)),0x0;}catch(_0x120351){if(_0x120351 instanceof HTTPClientError&&_0x120351[_0x32b541(0x107)]===0x191)return printAuthError(_0x120351),0x1;return console[_0x32b541(0xe8)](a7_0xeef820[_0x32b541(0xfd)](_0x32b541(0x104)+(_0x120351 instanceof Error?_0x120351[_0x32b541(0x111)]:String(_0x120351)))),console[_0x32b541(0xe8)](_0x32b541(0xfc)),0x1;}}}function a7_0x48dc(){const _0x9868f2=['Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','User:\x20','Validating\x20API\x20key...','\x27\x20registered','us01','filter','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','red','/app/mp/ak','create','customSite','Enter\x20your\x20TD\x20API\x20key:','bold','Site\x20name\x20cannot\x20be\x20empty','✗\x20Validation\x20failed:\x20','\x20(profile:\x20','\x20\x20tdx','status','Remove\x20API\x20key\x20from\x20system\x20keychain','58026TEmURw','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','Name:\x20','✓\x20Authentication\x20successful\x0a','log','apiKey','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','profile','message','site','green','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','No\x20credential\x20found','getUserInfo','other','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','tdx:\x20auth\x20setup','\x20for\x20profile:\x20','347607DGMwCM','16635ZhKLid','Read\x20credential\x20from\x20','Select\x20your\x20Treasure\x20Data\x20site:','3000720UyLrlx','\x0aSetup\x20cancelled','test','70722UonjfL','yellow','4386776BzlOsv','first_name','password','You\x20can\x20find\x20your\x20API\x20key\x20at:','6245998poeXHR','logLevel','\x20--profile\x20','7ZSbGnq','last_name','✓\x20Default\x20site\x20set\x20to\x20','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','354QbevFT','execute','6XeMgGV','error','✓\x20API\x20key\x20removed\x20from\x20keychain','Enter\x20site\x20name:','warn','\x20(site:\x20','join','description','name','text','✓\x20Profile\x20\x27','trim','jobs','130JunjKC','email'];a7_0x48dc=function(){return _0x9868f2;};return a7_0x48dc();}export class AuthStatusCommand extends BaseCommand{[a7_0x24cefe(0xef)]='auth';[a7_0x24cefe(0xee)]=a7_0x24cefe(0x10a);async[a7_0x24cefe(0xe6)](_0x206a4b){const _0x3b8fd1=a7_0x24cefe,{options:_0x428dd1,tdx:_0x8d8881}=_0x206a4b,_0x455765=_0x428dd1[_0x3b8fd1(0x112)],_0x315165=_0x428dd1[_0x3b8fd1(0x110)],_0x497a1b=_0x315165?_0x315165:'N/A';console[_0x3b8fd1(0x10d)]('tdx\x20profile:\x20'+_0x497a1b+_0x3b8fd1(0xec)+_0x455765+')');const _0x19430d=await resolveAPIKeyAsync(_0x455765,_0x315165);if(_0x19430d){const {source:_0x115354,isDeprecated:_0x39a772}=_0x19430d,_0x5b6d8a=_0x3b8fd1(0x11d)+_0x115354;console[_0x3b8fd1(0x10d)](_0x39a772?a7_0xeef820[_0x3b8fd1(0x123)](_0x5b6d8a):_0x5b6d8a);}else console[_0x3b8fd1(0x10d)](a7_0xeef820[_0x3b8fd1(0x123)](_0x3b8fd1(0x115)));try{const _0x188f95=await _0x8d8881[_0x3b8fd1(0xf3)][_0x3b8fd1(0x116)]();return console['log'](a7_0xeef820[_0x3b8fd1(0x113)](_0x3b8fd1(0x10c))),console['log'](_0x3b8fd1(0xf7)+_0x188f95['email']),(_0x188f95[_0x3b8fd1(0x125)]||_0x188f95[_0x3b8fd1(0xe2)])&&console[_0x3b8fd1(0x10d)](_0x3b8fd1(0x10b)+[_0x188f95['first_name'],_0x188f95[_0x3b8fd1(0xe2)]][_0x3b8fd1(0xfb)](Boolean)[_0x3b8fd1(0xed)]('\x20')),0x0;}catch(_0x461bbe){return _0x461bbe instanceof HTTPClientError&&_0x461bbe[_0x3b8fd1(0x107)]===0x191?printAuthError(_0x461bbe,!![],_0x315165):console[_0x3b8fd1(0xe8)](a7_0xeef820[_0x3b8fd1(0xfd)](_0x3b8fd1(0x104)+(_0x461bbe instanceof Error?_0x461bbe[_0x3b8fd1(0x111)]:String(_0x461bbe)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x24cefe(0xef)]='auth:clear';[a7_0x24cefe(0xee)]=a7_0x24cefe(0x108);async[a7_0x24cefe(0xe6)](_0x40eb8e){const _0x274136=a7_0x24cefe,{options:_0x27fc76}=_0x40eb8e,_0x141342=_0x27fc76['profile'];console['log'](a7_0xeef820[_0x274136(0x102)]('tdx:\x20auth\x20clear'));const _0x6e26ed=await isKeychainAvailable();if(!_0x6e26ed)return console[_0x274136(0xe8)](a7_0xeef820[_0x274136(0xfd)]('System\x20keychain\x20is\x20not\x20available')),0x1;const _0x296635=await deleteKeychainAPIKey(_0x141342);return _0x296635?(clearCredentialCache(),console[_0x274136(0x10d)](_0x274136(0xe9)+(_0x141342?_0x274136(0x105)+_0x141342+')':'')),0x0):(console[_0x274136(0x10d)]('No\x20API\x20key\x20found\x20in\x20keychain'+(_0x141342?_0x274136(0x11a)+_0x141342:'')),0x1);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a8_0x169ab1=a8_0x3e2b;(function(_0x4835fa,_0x25124f){const _0xcfa264=a8_0x3e2b,_0x324005=_0x4835fa();while(!![]){try{const _0x1bd432=-parseInt(_0xcfa264(0x1d1))/0x1+-parseInt(_0xcfa264(0x1be))/0x2*(-parseInt(_0xcfa264(0x1b6))/0x3)+-parseInt(_0xcfa264(0x1dc))/0x4+-parseInt(_0xcfa264(0x1c7))/0x5*(parseInt(_0xcfa264(0x1b8))/0x6)+parseInt(_0xcfa264(0x1d6))/0x7+-parseInt(_0xcfa264(0x1e1))/0x8+parseInt(_0xcfa264(0x1b4))/0x9;if(_0x1bd432===_0x25124f)break;else _0x324005['push'](_0x324005['shift']());}catch(_0x366259){_0x324005['push'](_0x324005['shift']());}}}(a8_0x4a3a,0xe8284));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';function a8_0x4a3a(){const _0x55348b=['10329mtogEr','Chat\x20session:\x20','6CEJbTJ','llmAgent','llm','metadata','validate','description','932GUuhaA','data','event','getDefaultAgent','streamChat','404','resolveProjectId','content','\x27...','2095955SLZgYV','agent','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','getAgentId','getOrCreateDefaultAgent','llmProject','log','write','Using\x20agent\x20from\x20','\x0aStack\x20trace:','1316459hfFAMl','Error:\x20','chatId','verbose','message','1806231GtbXXh','Getting\x20default\x20agent...','CHAT_NOT_FOUND','args','Resolving\x20project\x20\x27','cause','1427532GgWnyX','stdout','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','join','13385504aZaMrc','handleChatEvent','stack','\x0aError:\x20','error','name','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','session\x20context','resolveAgentId','Continuing\x20chat:\x20','chat','type','25687494poSBHR','Resolving\x20agent\x20\x27'];a8_0x4a3a=function(){return _0x55348b;};return a8_0x4a3a();}import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';function handleSDKError(_0x11a6d2,_0x57ae55){const _0x8bda8f=a8_0x3e2b;if(_0x11a6d2 instanceof SDKError)console[_0x8bda8f(0x1e5)](_0x8bda8f(0x1d2)+_0x11a6d2[_0x8bda8f(0x1d5)]),_0x57ae55[_0x8bda8f(0x1d4)]&&(_0x11a6d2[_0x8bda8f(0x1db)]&&console['error']('\x20\x20Cause:\x20'+_0x11a6d2[_0x8bda8f(0x1db)]),_0x11a6d2[_0x8bda8f(0x1e3)]&&(console[_0x8bda8f(0x1e5)](_0x8bda8f(0x1d0)),console['error'](_0x11a6d2[_0x8bda8f(0x1e3)])));else throw _0x11a6d2;}function a8_0x3e2b(_0x57d09f,_0x4dad18){_0x57d09f=_0x57d09f-0x1b2;const _0x4a3a40=a8_0x4a3a();let _0x3e2b6d=_0x4a3a40[_0x57d09f];return _0x3e2b6d;}export class ChatCommand extends BaseCommand{[a8_0x169ab1(0x1e6)]=a8_0x169ab1(0x1b2);[a8_0x169ab1(0x1bd)]=a8_0x169ab1(0x1df);[a8_0x169ab1(0x1bc)](_0x327426){const _0x1b922e=a8_0x169ab1,_0x55e7cb=_0x327426[_0x1b922e(0x1d9)][_0x1b922e(0x1e0)]('\x20');if(!_0x55e7cb)return _0x1b922e(0x1de);return undefined;}async['streamChat'](_0x13854f,_0x72ed27,_0x3e135e,_0xe75b47,_0x1981f5){const _0x438f89=a8_0x169ab1;for await(const _0x203403 of _0x13854f['llm'][_0x438f89(0x1b2)](_0x72ed27,{'agentId':_0x3e135e,'chatId':_0xe75b47})){if(_0x203403[_0x438f89(0x1b3)]===_0x438f89(0x1bb)){const _0x3bfeb2=_0x203403[_0x438f89(0x1bf)][_0x438f89(0x1d3)];saveLastChatId(_0x3bfeb2),_0x1981f5&&console[_0x438f89(0x1e5)](_0x438f89(0x1b7)+_0x3bfeb2);}else _0x203403[_0x438f89(0x1b3)]===_0x438f89(0x1c0)&&this['handleChatEvent'](_0x203403['data']);}}async[a8_0x169ab1(0x1ca)](_0x3ab1ec,_0x257d35,_0x2905d0,_0x52cf4d,_0x3581bf){const _0x1800b3=a8_0x169ab1,_0x210e43=_0x257d35||_0x2905d0;if(_0x210e43){const {projectName:_0x1efb3e,agentName:_0x3d1ab4}=parseAgentRef(_0x210e43),_0x12658c=_0x3d1ab4||_0x210e43,_0x3dff61=_0x3d1ab4?_0x1efb3e:_0x52cf4d;if(!_0x3dff61)throw new Error(_0x1800b3(0x1c9));if(_0x3581bf){const _0x37f7a8=_0x257d35?'--agent\x20flag':_0x1800b3(0x1e8);console['error'](_0x1800b3(0x1cf)+_0x37f7a8+':\x20'+_0x3dff61+'/'+_0x12658c);}const _0x48a439=await withSpinner(_0x1800b3(0x1da)+_0x3dff61+_0x1800b3(0x1c6),()=>_0x3ab1ec[_0x1800b3(0x1ba)][_0x1800b3(0x1c4)](_0x3dff61),{'verbose':_0x3581bf}),_0x1f18ea=await withSpinner(_0x1800b3(0x1b5)+_0x12658c+_0x1800b3(0x1c6),()=>_0x3ab1ec[_0x1800b3(0x1ba)][_0x1800b3(0x1e9)](_0x12658c,_0x48a439[_0x1800b3(0x1bf)]),{'verbose':_0x3581bf});return _0x1f18ea[_0x1800b3(0x1bf)];}else{const _0x41608c=_0x3ab1ec[_0x1800b3(0x1ba)][_0x1800b3(0x1c1)]();if(_0x41608c)return _0x3581bf&&console[_0x1800b3(0x1e5)]('Using\x20cached\x20default\x20agent:\x20'+_0x41608c['name']),_0x41608c['id'];const _0x222158=await withSpinner(_0x1800b3(0x1d7),()=>_0x3ab1ec[_0x1800b3(0x1ba)][_0x1800b3(0x1cb)]('claude-4.5-haiku',0x0),{'verbose':_0x3581bf});return _0x222158[_0x1800b3(0x1bf)]['id'];}}async['execute'](_0x17c265){const _0x478111=a8_0x169ab1,{options:_0x21e503,args:_0x26ed57,tdx:_0x3d0db8}=_0x17c265,_0x24967f=_0x26ed57[_0x478111(0x1e0)]('\x20'),_0x55c870=_0x21e503,_0x50fd87=_0x55c870[_0x478111(0x1c8)],_0xbfdb88=_0x55c870[_0x478111(0x1b9)],_0x1856f7=_0x55c870[_0x478111(0x1cc)],_0x21dc06=_0x55c870['new'];try{let _0x33d880,_0x3444be;!_0x21dc06&&(_0x3444be=loadLastChatId(),_0x3444be&&_0x21e503[_0x478111(0x1d4)]&&console[_0x478111(0x1e5)](_0x478111(0x1ea)+_0x3444be));(_0x21dc06||!_0x3444be)&&(_0x33d880=await this[_0x478111(0x1ca)](_0x3d0db8,_0x50fd87,_0xbfdb88,_0x1856f7,_0x21e503[_0x478111(0x1d4)]));try{await this[_0x478111(0x1c2)](_0x3d0db8,_0x24967f,_0x33d880,_0x3444be,_0x21e503[_0x478111(0x1d4)]);}catch(_0x229549){const _0x4be33b=_0x229549 instanceof SDKError&&_0x229549['code']===ErrorCode[_0x478111(0x1d8)]||_0x229549 instanceof Error&&_0x229549['message']['includes'](_0x478111(0x1c3));if(_0x4be33b)_0x21e503[_0x478111(0x1d4)]&&console[_0x478111(0x1e5)](_0x478111(0x1e7)),!_0x33d880&&(_0x33d880=await this[_0x478111(0x1ca)](_0x3d0db8,_0x50fd87,_0xbfdb88,_0x1856f7,_0x21e503[_0x478111(0x1d4)])),await this[_0x478111(0x1c2)](_0x3d0db8,_0x24967f,_0x33d880,undefined,_0x21e503['verbose']);else throw _0x229549;}return console[_0x478111(0x1cd)](),0x0;}catch(_0x5d9696){return console[_0x478111(0x1e5)](),handleSDKError(_0x5d9696,_0x21e503),0x1;}}[a8_0x169ab1(0x1e2)](_0x34c241){const _0x86060d=a8_0x169ab1;if(_0x86060d(0x1c5)in _0x34c241)process[_0x86060d(0x1dd)][_0x86060d(0x1ce)](_0x34c241[_0x86060d(0x1c5)]);else _0x86060d(0x1e5)in _0x34c241&&console['error'](_0x86060d(0x1e4)+_0x34c241['error']);}}
|