@treasuredata/tdx 0.16.5 → 0.16.6
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.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/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/claude-agent/claude-agent-client.d.ts +13 -0
- package/dist/sdk/claude-agent/claude-agent-client.d.ts.map +1 -1
- package/dist/sdk/claude-agent/claude-agent-client.js +1 -1
- package/dist/sdk/claude-agent/claude-agent-client.js.map +1 -1
- package/dist/sdk/claude-agent/environment.js +1 -1
- package/dist/sdk/claude-agent/index.js +1 -1
- package/dist/sdk/claude-agent/system-prompts.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-aliases.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/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/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.d.ts +10 -0
- package/dist/utils/process.d.ts.map +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/process.js.map +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x5c4456=a4_0x558e;(function(_0x5b1cd0,_0xd0b14d){const _0x29067e=a4_0x558e,_0x519415=_0x5b1cd0();while(!![]){try{const _0x325421=parseInt(_0x29067e(0x282))/0x1+-parseInt(_0x29067e(0x28b))/0x2*(-parseInt(_0x29067e(0x1f7))/0x3)+-parseInt(_0x29067e(0x230))/0x4*(-parseInt(_0x29067e(0x227))/0x5)+parseInt(_0x29067e(0x224))/0x6*(parseInt(_0x29067e(0x25b))/0x7)+-parseInt(_0x29067e(0x226))/0x8*(parseInt(_0x29067e(0x222))/0x9)+parseInt(_0x29067e(0x277))/0xa+parseInt(_0x29067e(0x244))/0xb*(-parseInt(_0x29067e(0x268))/0xc);if(_0x325421===_0xd0b14d)break;else _0x519415['push'](_0x519415['shift']());}catch(_0x59981e){_0x519415['push'](_0x519415['shift']());}}}(a4_0x1830,0xba9b1));function a4_0x1830(){const _0x3052c0=['\x20\x20Agents:\x20','yes','Would\x20push\x20agent:\x20','join','dirname','pullProject','\x0aChanges\x20to\x20agent\x20\x27','outputPath','Summary:','\x0aPush\x20summary\x20for\x20\x27','Pushing\x20agent\x20from\x20\x22','\x22\x20to\x20a\x20different\x20profile','\x20--profile\x20','Output:\x20','green','Agent\x20','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','Would\x20pull\x20agent:\x20','execute','unchanged','knowledgeBases','\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','errors','New\x20project\x20name\x20is\x20required','\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)','\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','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','isNew','Status:\x20','Would\x20clone:','pushAgent','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent','13166289yjdvtH','newProjectId','390BBQoFd','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','8iUasoc','5RAziwR','\x20\x20tdx\x20agent\x20pull\x20','Project\x20cloned\x20with\x20errors','force','INVALID_ARGUMENT','total','\x20|\x20','agent:push','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','1752592oyESzX','new','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','agent:clone','reason','pullAgent','Agent\x20pulled\x20successfully','found','Analyzing\x20changes\x20to\x20push...','\x27\x20to\x20create\x20the\x20folder\x20structure.','outputDir','prompts','updated','Using\x20context\x20project:\x20','\x0aChanges:','parse','projectName','\x0a✔\x20Pushed\x20','counts','cwd','2324047NqgyTA','integrations','Pulling\x20agent\x20\x22','llmProject','\x20unchanged','push','\x20files?','message','no_context','name','llm_project','\x20resources\x20to\x20\x27','created','Agent:\x20','Using\x20local\x20project:\x20','site','Using\x20current\x20project:\x20','No\x20tdx.json\x20found\x20in\x20','cloneProject','Writing\x20files...','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','New\x20project:\x20','Chat:\x20','19313FNadOc','Project:\x20','diff','hasChanges','session','llm','error','agent:pull','\x20\x20Knowledge\x20Base\x20\x22','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x22...','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x22\x20to\x20\x22','12oGmMmD','\x20\x20Prompts:\x20','<new-name>','projectId','\x0aWrite\x20','newProjectName','\x20\x20Text\x20Knowledge\x20Bases:\x20','cyan','\x20\x20Knowledge\x20Bases:\x20','utf-8','Dry\x20run\x20-\x20no\x20changes\x20made','\x20\x20Integrations:\x20','yellow','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','✔\x20Context\x20set:\x20','11168930ryBLOB','\x20new','\x20--name\x20','projectDir','\x20files\x20to\x20','\x20\x20Target:\x20','\x0aChanges\x20to\x20integration\x20\x27','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','description','\x20=\x20','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','535796qsUcaJ','\x20updated','agents','Dry\x20run\x20-\x20no\x20files\x20written','context','dim','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x20successfully','tdx.json','2878nhJImh','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','Cannot\x20clone\x20from\x20context\x20project\x20\x22','Errors:','\x22\x20from\x20project\x20\x22','log','Using\x20project:\x20','\x20errors','Failed\x20to\x20push\x20agent:\x20','action','dryRun','textKnowledgeBases','pushProject','Using\x20project\x20from\x20','repeat','agentName','Cloning\x20\x22','Analyzing\x20project\x20\x22','source','\x22\x20to\x20new\x20project\x20\x22','red','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','agentId','351gxZElQ','gray','\x0aProject\x20pushed\x20with\x20errors','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','sourceProjectName','\x20\x20Agent\x20\x22','\x22:\x20','\x0aPush\x20','Source:\x20','\x20\x20Integration\x20\x22','profile'];a4_0x1830=function(){return _0x3052c0;};return a4_0x1830();}import a4_0x3d30e6 from'chalk';import a4_0x5a24c8 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';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x57f33a){const _0x4df8d5=a4_0x558e,_0x483546=[];if(_0x57f33a[_0x4df8d5(0x22c)]!==undefined)_0x483546['push'](_0x57f33a[_0x4df8d5(0x22c)]+'\x20total');if(_0x57f33a[_0x4df8d5(0x231)]!==undefined&&_0x57f33a[_0x4df8d5(0x231)]>0x0)_0x483546['push'](a4_0x3d30e6[_0x4df8d5(0x210)](_0x57f33a[_0x4df8d5(0x231)]+_0x4df8d5(0x278)));if(_0x57f33a['created']!==undefined&&_0x57f33a[_0x4df8d5(0x250)]>0x0)_0x483546[_0x4df8d5(0x249)](a4_0x3d30e6[_0x4df8d5(0x210)](_0x57f33a[_0x4df8d5(0x250)]+'\x20created'));if(_0x57f33a[_0x4df8d5(0x23c)]!==undefined&&_0x57f33a['updated']>0x0)_0x483546[_0x4df8d5(0x249)](a4_0x3d30e6['yellow'](_0x57f33a['updated']+_0x4df8d5(0x283)));if(_0x57f33a['unchanged']!==undefined&&_0x57f33a[_0x4df8d5(0x215)]>0x0)_0x483546[_0x4df8d5(0x249)](a4_0x3d30e6[_0x4df8d5(0x1f8)](_0x57f33a[_0x4df8d5(0x215)]+_0x4df8d5(0x248)));if(_0x57f33a[_0x4df8d5(0x218)]!==undefined&&_0x57f33a[_0x4df8d5(0x218)]>0x0)_0x483546[_0x4df8d5(0x249)](a4_0x3d30e6['red'](_0x57f33a[_0x4df8d5(0x218)]+_0x4df8d5(0x1e7)));return _0x483546[_0x4df8d5(0x205)](',\x20');}function a4_0x558e(_0x1a9c24,_0x144be7){_0x1a9c24=_0x1a9c24-0x1e4;const _0x18305a=a4_0x1830();let _0x558eba=_0x18305a[_0x1a9c24];return _0x558eba;}function displayDiffs(_0x58274a,_0x19940b,_0x157edd,_0x4fc0a1,_0x66ec78=[]){const _0x184202=a4_0x558e;for(const _0x1e273e of _0x58274a){if(_0x1e273e[_0x184202(0x25d)]){const _0x50f420=_0x1e273e[_0x184202(0x1ef)]||_0x1e273e[_0x184202(0x24d)];console[_0x184202(0x1e5)](_0x184202(0x208)+_0x50f420+'\x27:'),console['log']('─'[_0x184202(0x1ee)](0x3c)),console[_0x184202(0x1e5)](_0x1e273e['diff']),console[_0x184202(0x1e5)]('─'[_0x184202(0x1ee)](0x3c));}}for(const _0x15cc27 of _0x19940b){_0x15cc27[_0x184202(0x25d)]&&(console[_0x184202(0x1e5)]('\x0aChanges\x20to\x20knowledge\x20base\x20\x27'+_0x15cc27[_0x184202(0x24d)]+'\x27:'),console[_0x184202(0x1e5)]('─'[_0x184202(0x1ee)](0x3c)),console['log'](_0x15cc27[_0x184202(0x25d)]),console[_0x184202(0x1e5)]('─'[_0x184202(0x1ee)](0x3c)));}for(const _0x1d6c5e of _0x157edd){_0x1d6c5e[_0x184202(0x25d)]&&(console[_0x184202(0x1e5)](_0x184202(0x225)+_0x1d6c5e[_0x184202(0x24d)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x184202(0x1e5)](_0x1d6c5e['diff']),console[_0x184202(0x1e5)]('─'[_0x184202(0x1ee)](0x3c)));}for(const _0x1acf14 of _0x4fc0a1){_0x1acf14[_0x184202(0x25d)]&&(console['log']('\x0aChanges\x20to\x20prompt\x20\x27'+_0x1acf14[_0x184202(0x24d)]+'\x27:'),console[_0x184202(0x1e5)]('─'[_0x184202(0x1ee)](0x3c)),console[_0x184202(0x1e5)](_0x1acf14[_0x184202(0x25d)]),console['log']('─'[_0x184202(0x1ee)](0x3c)));}for(const _0x4eb827 of _0x66ec78){_0x4eb827[_0x184202(0x25d)]&&(console[_0x184202(0x1e5)](_0x184202(0x27d)+_0x4eb827[_0x184202(0x24d)]+'\x27:'),console[_0x184202(0x1e5)]('─'[_0x184202(0x1ee)](0x3c)),console['log'](_0x4eb827[_0x184202(0x25d)]),console['log']('─'[_0x184202(0x1ee)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x5c4456(0x24d)]=a4_0x5c4456(0x262);[a4_0x5c4456(0x27f)]=a4_0x5c4456(0x27e);async[a4_0x5c4456(0x214)](_0x212a44){const _0xd15a9e=a4_0x5c4456,{options:_0x4ea3ab,args:_0x1f8c10,tdx:_0x4de787}=_0x212a44,_0x4a9120=_0x1f8c10[0x0],_0xa96c37=_0x1f8c10[0x1],_0x1becc2=_0x4ea3ab['output'],_0x322214=_0x4ea3ab['dryRun'],_0x2bbe48=_0x4ea3ab[_0xd15a9e(0x22a)],_0x5c7c56=_0x4ea3ab[_0xd15a9e(0x203)],_0x367c28=_0x4ea3ab['llmProject'];let _0x204923,_0x1fed2f;const _0x14b1ae=findAgentConfigPath(process[_0xd15a9e(0x243)]());if(_0x4a9120){const _0x5b910e=a4_0x5a24c8[_0xd15a9e(0x205)](_0x4a9120,_0xd15a9e(0x28a));if(existsSync(_0x5b910e))try{const _0x1045c0=JSON[_0xd15a9e(0x23f)](readFileSync(_0x5b910e,_0xd15a9e(0x271)));_0x204923=_0x1045c0[_0xd15a9e(0x24e)],_0x1fed2f=_0x4a9120,console[_0xd15a9e(0x1e5)](a4_0x3d30e6[_0xd15a9e(0x287)](_0xd15a9e(0x1ed)+_0x5b910e+':\x20'+_0x204923));}catch{_0x204923=_0x4a9120;}else _0x204923=_0x4a9120;}else{if(_0x14b1ae)try{const _0x3f270a=JSON[_0xd15a9e(0x23f)](readFileSync(_0x14b1ae,_0xd15a9e(0x271)));_0x204923=_0x3f270a['llm_project'],_0x1fed2f=a4_0x5a24c8[_0xd15a9e(0x206)](_0x14b1ae),console[_0xd15a9e(0x1e5)](a4_0x3d30e6['dim'](_0xd15a9e(0x1e6)+_0x204923));}catch{_0x204923=_0x367c28;}else _0x204923=_0x367c28;}if(!_0x204923)return console[_0xd15a9e(0x1e5)](a4_0x3d30e6[_0xd15a9e(0x274)](_0xd15a9e(0x22f))),console[_0xd15a9e(0x1e5)]('Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)'),console[_0xd15a9e(0x1e5)](_0xd15a9e(0x21b)),console['log'](_0xd15a9e(0x217)),console[_0xd15a9e(0x1e5)](_0xd15a9e(0x221)),0x1;if(_0xa96c37){const {data:_0x2a4cff}=await withSpinner(_0xd15a9e(0x246)+_0xa96c37+_0xd15a9e(0x1e4)+_0x204923+_0xd15a9e(0x265),()=>_0x4de787[_0xd15a9e(0x260)][_0xd15a9e(0x235)](_0x204923,_0xa96c37,_0x1becc2,{'dryRun':_0x322214,'force':_0x2bbe48}));if(_0x322214)return console[_0xd15a9e(0x1e5)](a4_0x3d30e6['yellow'](_0xd15a9e(0x285))),console[_0xd15a9e(0x1e5)](_0xd15a9e(0x213)+_0x2a4cff[_0xd15a9e(0x1ef)]),console['log']('Output\x20path:\x20'+_0x2a4cff[_0xd15a9e(0x209)]),_0x2a4cff[_0xd15a9e(0x25d)]&&(console['log'](_0xd15a9e(0x23e)),console[_0xd15a9e(0x1e5)]('─'[_0xd15a9e(0x1ee)](0x3c)),console[_0xd15a9e(0x1e5)](_0x2a4cff[_0xd15a9e(0x25d)]),console['log']('─'[_0xd15a9e(0x1ee)](0x3c))),0x0;return console[_0xd15a9e(0x1e5)](a4_0x3d30e6[_0xd15a9e(0x210)](_0xd15a9e(0x236))),console['log']('Agent:\x20'+_0x2a4cff[_0xd15a9e(0x1ef)]),console['log'](_0xd15a9e(0x20f)+_0x2a4cff[_0xd15a9e(0x209)]),console[_0xd15a9e(0x1e5)](_0xd15a9e(0x21e)+(_0x2a4cff[_0xd15a9e(0x21d)]?a4_0x3d30e6[_0xd15a9e(0x210)](_0xd15a9e(0x231)):_0x2a4cff[_0xd15a9e(0x25e)]?a4_0x3d30e6[_0xd15a9e(0x274)]('updated'):a4_0x3d30e6[_0xd15a9e(0x1f8)]('unchanged'))),0x0;}const _0x504b9b=_0x1fed2f||_0x1becc2,{data:_0x59bca3}=await withSpinner(_0xd15a9e(0x1f1)+_0x204923+_0xd15a9e(0x265),()=>_0x4de787[_0xd15a9e(0x260)][_0xd15a9e(0x207)](_0x204923,_0x504b9b,{'dryRun':!![]})),_0x554600=_0x59bca3[_0xd15a9e(0x242)][_0xd15a9e(0x284)][_0xd15a9e(0x231)]+_0x59bca3['counts'][_0xd15a9e(0x216)][_0xd15a9e(0x231)]+_0x59bca3[_0xd15a9e(0x242)][_0xd15a9e(0x1eb)][_0xd15a9e(0x231)]+_0x59bca3['counts'][_0xd15a9e(0x23b)]['new']+_0x59bca3[_0xd15a9e(0x242)]['integrations']['new'],_0x50b156=_0x59bca3['counts'][_0xd15a9e(0x284)][_0xd15a9e(0x23c)]+_0x59bca3[_0xd15a9e(0x242)][_0xd15a9e(0x216)][_0xd15a9e(0x23c)]+_0x59bca3[_0xd15a9e(0x242)]['textKnowledgeBases'][_0xd15a9e(0x23c)]+_0x59bca3[_0xd15a9e(0x242)][_0xd15a9e(0x23b)][_0xd15a9e(0x23c)]+_0x59bca3[_0xd15a9e(0x242)][_0xd15a9e(0x245)][_0xd15a9e(0x23c)],_0x4cd59f=_0x59bca3[_0xd15a9e(0x242)]['agents']['unchanged']+_0x59bca3[_0xd15a9e(0x242)][_0xd15a9e(0x216)]['unchanged']+_0x59bca3[_0xd15a9e(0x242)][_0xd15a9e(0x1eb)][_0xd15a9e(0x215)]+_0x59bca3[_0xd15a9e(0x242)]['prompts'][_0xd15a9e(0x215)]+_0x59bca3[_0xd15a9e(0x242)]['integrations'][_0xd15a9e(0x215)];console[_0xd15a9e(0x1e5)]('\x0aPull\x20summary\x20for\x20\x27'+_0x59bca3[_0xd15a9e(0x240)]+'\x27:'),console['log']('\x20\x20'+a4_0x3d30e6[_0xd15a9e(0x210)]('+\x20'+_0x554600+_0xd15a9e(0x278))+_0xd15a9e(0x22d)+a4_0x3d30e6[_0xd15a9e(0x274)]('~\x20'+_0x50b156+'\x20changed')+'\x20|\x20'+a4_0x3d30e6[_0xd15a9e(0x287)]('=\x20'+_0x4cd59f+_0xd15a9e(0x248))),console[_0xd15a9e(0x1e5)]('\x20\x20Agents:\x20'+formatCountSummary(_0x59bca3[_0xd15a9e(0x242)]['agents'])),console[_0xd15a9e(0x1e5)](_0xd15a9e(0x270)+formatCountSummary(_0x59bca3['counts'][_0xd15a9e(0x216)])),console['log'](_0xd15a9e(0x26e)+formatCountSummary(_0x59bca3[_0xd15a9e(0x242)][_0xd15a9e(0x1eb)])),console[_0xd15a9e(0x1e5)](_0xd15a9e(0x269)+formatCountSummary(_0x59bca3['counts'][_0xd15a9e(0x23b)])),console['log'](_0xd15a9e(0x273)+formatCountSummary(_0x59bca3['counts'][_0xd15a9e(0x245)])),console['log'](_0xd15a9e(0x27c)+a4_0x3d30e6[_0xd15a9e(0x26f)](_0x59bca3[_0xd15a9e(0x23a)])),displayDiffs(_0x59bca3[_0xd15a9e(0x284)],_0x59bca3[_0xd15a9e(0x216)],_0x59bca3[_0xd15a9e(0x1eb)],_0x59bca3['prompts'],_0x59bca3['integrations']);if(_0x322214)return console[_0xd15a9e(0x1e5)](a4_0x3d30e6[_0xd15a9e(0x274)](_0xd15a9e(0x275))),0x0;if(_0x554600===0x0&&_0x50b156===0x0)return console['log'](a4_0x3d30e6[_0xd15a9e(0x210)](_0xd15a9e(0x1f5))),saveSessionContext({'llm_project':_0x59bca3[_0xd15a9e(0x240)]},_0x4ea3ab[_0xd15a9e(0x25f)]),console['log'](a4_0x3d30e6[_0xd15a9e(0x210)](_0xd15a9e(0x276)+a4_0x3d30e6['dim']('llm_project')+_0xd15a9e(0x280)+a4_0x3d30e6[_0xd15a9e(0x26f)](_0x59bca3['projectName']))),0x0;if(!_0x5c7c56&&!_0x2bbe48){const _0x58f765=await confirmKey(_0xd15a9e(0x26c)+(_0x554600+_0x50b156)+_0xd15a9e(0x24a));if(!_0x58f765)return console[_0xd15a9e(0x1e5)]('Pull\x20cancelled'),0x0;}const {data:_0x3d19d7}=await withSpinner(_0xd15a9e(0x257),()=>_0x4de787['llm'][_0xd15a9e(0x207)](_0x204923,_0x504b9b,{'force':_0x2bbe48}));return console[_0xd15a9e(0x1e5)](a4_0x3d30e6['green']('\x0a✔\x20Pulled\x20'+(_0x554600+_0x50b156)+_0xd15a9e(0x27b)+_0x3d19d7[_0xd15a9e(0x23a)])),saveSessionContext({'llm_project':_0x3d19d7[_0xd15a9e(0x240)]},_0x4ea3ab['session']),console[_0xd15a9e(0x1e5)](a4_0x3d30e6[_0xd15a9e(0x210)](_0xd15a9e(0x276)+a4_0x3d30e6[_0xd15a9e(0x287)](_0xd15a9e(0x24e))+_0xd15a9e(0x280)+a4_0x3d30e6['cyan'](_0x3d19d7[_0xd15a9e(0x240)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x5c4456(0x24d)]=a4_0x5c4456(0x233);[a4_0x5c4456(0x27f)]=a4_0x5c4456(0x212);async[a4_0x5c4456(0x214)](_0x79a74f){const _0x168228=a4_0x5c4456,{options:_0x2dddcd,args:_0x3f2e1e,tdx:_0x167502}=_0x79a74f,_0x4bd39f=_0x3f2e1e[0x0],_0x23e7e9=_0x2dddcd[_0x168228(0x24d)],_0x387da6=_0x2dddcd['dryRun'],_0x4bde56=_0x2dddcd[_0x168228(0x203)],_0x5d0d96=_0x2dddcd[_0x168228(0x253)],_0x23b37b=_0x2dddcd[_0x168228(0x247)];let _0x184fc6;const _0x25e7ec=findAgentConfigPath(process[_0x168228(0x243)]());if(_0x4bd39f){const _0x242b4d=a4_0x5a24c8[_0x168228(0x205)](_0x4bd39f,'tdx.json');existsSync(_0x242b4d)?(_0x184fc6=_0x4bd39f,console[_0x168228(0x1e5)](a4_0x3d30e6[_0x168228(0x287)](_0x168228(0x252)+_0x4bd39f))):_0x184fc6=_0x4bd39f;}else{if(_0x25e7ec)_0x184fc6=a4_0x5a24c8['dirname'](_0x25e7ec),console[_0x168228(0x1e5)](a4_0x3d30e6[_0x168228(0x287)](_0x168228(0x254)+_0x184fc6));else{if(_0x23b37b){const _0x23be37=sanitizeForFilesystem(_0x23b37b);let _0x34b12c=_0x23be37,_0x5b8c35=a4_0x5a24c8[_0x168228(0x205)](process[_0x168228(0x243)](),_0x168228(0x284),_0x23be37,_0x168228(0x28a));if(!existsSync(_0x5b8c35)){const _0x4725ec=normalizeName(_0x23b37b),_0x5eddce=a4_0x5a24c8[_0x168228(0x205)](process[_0x168228(0x243)](),'agents',_0x4725ec,_0x168228(0x28a));existsSync(_0x5eddce)&&(_0x34b12c=_0x4725ec,_0x5b8c35=_0x5eddce);}if(existsSync(_0x5b8c35))_0x184fc6=a4_0x5a24c8[_0x168228(0x206)](_0x5b8c35),console[_0x168228(0x1e5)](a4_0x3d30e6[_0x168228(0x287)](_0x168228(0x252)+_0x184fc6));else{const _0x25286a=_0x2dddcd[_0x168228(0x201)];if(_0x25286a)throw new SDKError(ErrorCode[_0x168228(0x22b)],_0x168228(0x28d)+_0x23b37b+_0x168228(0x20d),undefined,{'helpText':'When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a'+_0x168228(0x258)+(_0x168228(0x228)+_0x23b37b+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x34b12c+_0x168228(0x279)+(_0x23e7e9||_0x168228(0x26a))+_0x168228(0x20e)+_0x25286a)});_0x184fc6=_0x23b37b,console[_0x168228(0x1e5)](a4_0x3d30e6[_0x168228(0x287)](_0x168228(0x23d)+_0x23b37b));}}}}if(!_0x184fc6)return console[_0x168228(0x1e5)](a4_0x3d30e6[_0x168228(0x274)](_0x168228(0x28c))),console[_0x168228(0x1e5)](_0x168228(0x232)),console['log']('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console[_0x168228(0x1e5)](_0x168228(0x21a)),console[_0x168228(0x1e5)](_0x168228(0x1fa)),0x1;if(!_0x23e7e9)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x168228(0x219),undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0x4bde56&&!_0x387da6){const _0x5928db=await confirmKey('Clone\x20\x22'+_0x184fc6+_0x168228(0x1f3)+_0x23e7e9+'\x22?');if(!_0x5928db)return console['log']('Clone\x20cancelled'),0x0;}const {data:_0x21bd47}=await withSpinner(_0x168228(0x1f0)+_0x184fc6+_0x168228(0x267)+_0x23e7e9+_0x168228(0x265),()=>_0x167502[_0x168228(0x260)][_0x168228(0x256)](_0x184fc6,_0x23e7e9,{'dryRun':_0x387da6}));if(_0x387da6)return console[_0x168228(0x1e5)](a4_0x3d30e6[_0x168228(0x274)](_0x168228(0x272))),console[_0x168228(0x1e5)](_0x168228(0x1ff)+_0x21bd47[_0x168228(0x1fb)]),console[_0x168228(0x1e5)](_0x168228(0x259)+_0x23e7e9),console['log'](_0x168228(0x21f)),console[_0x168228(0x1e5)](_0x168228(0x202)+_0x21bd47[_0x168228(0x242)][_0x168228(0x284)][_0x168228(0x250)]),console[_0x168228(0x1e5)](_0x168228(0x270)+_0x21bd47[_0x168228(0x242)]['knowledgeBases'][_0x168228(0x250)]),console[_0x168228(0x1e5)](_0x168228(0x269)+_0x21bd47['counts'][_0x168228(0x23b)]['created']),0x0;const _0x2385f7=_0x21bd47[_0x168228(0x242)][_0x168228(0x284)][_0x168228(0x218)]>0x0||_0x21bd47[_0x168228(0x242)][_0x168228(0x216)][_0x168228(0x218)]>0x0||_0x21bd47[_0x168228(0x242)][_0x168228(0x23b)][_0x168228(0x218)]>0x0;_0x2385f7?console[_0x168228(0x1e5)](a4_0x3d30e6['yellow'](_0x168228(0x229))):console[_0x168228(0x1e5)](a4_0x3d30e6[_0x168228(0x210)]('Project\x20cloned\x20successfully'));console[_0x168228(0x1e5)](_0x168228(0x1ff)+_0x21bd47[_0x168228(0x1fb)]),console[_0x168228(0x1e5)]('New\x20project:\x20'+_0x21bd47[_0x168228(0x26d)]),console[_0x168228(0x1e5)]('New\x20project\x20ID:\x20'+_0x21bd47[_0x168228(0x223)]),console[_0x168228(0x1e5)](),console[_0x168228(0x1e5)](_0x168228(0x20a)),console[_0x168228(0x1e5)](_0x168228(0x202)+formatCountSummary(_0x21bd47[_0x168228(0x242)][_0x168228(0x284)])),console['log'](_0x168228(0x270)+formatCountSummary(_0x21bd47[_0x168228(0x242)][_0x168228(0x216)])),console['log']('\x20\x20Prompts:\x20'+formatCountSummary(_0x21bd47[_0x168228(0x242)][_0x168228(0x23b)])),console['log']('\x20\x20Integrations:\x20'+formatCountSummary(_0x21bd47[_0x168228(0x242)][_0x168228(0x245)]));if(_0x2385f7){console[_0x168228(0x1e5)](),console['log'](a4_0x3d30e6[_0x168228(0x1f4)](_0x168228(0x28e)));for(const _0x4d255f of _0x21bd47[_0x168228(0x284)]){_0x4d255f[_0x168228(0x1e9)]===_0x168228(0x261)&&console['log'](a4_0x3d30e6[_0x168228(0x1f4)]('\x20\x20Agent\x20\x22'+_0x4d255f[_0x168228(0x1ef)]+_0x168228(0x1fd)+_0x4d255f[_0x168228(0x261)]));}for(const _0x52576d of _0x21bd47[_0x168228(0x216)]){_0x52576d[_0x168228(0x1e9)]===_0x168228(0x261)&&console[_0x168228(0x1e5)](a4_0x3d30e6['red'](_0x168228(0x263)+_0x52576d[_0x168228(0x24d)]+_0x168228(0x1fd)+_0x52576d[_0x168228(0x261)]));}for(const _0x3a7e22 of _0x21bd47[_0x168228(0x23b)]){_0x3a7e22[_0x168228(0x1e9)]===_0x168228(0x261)&&console[_0x168228(0x1e5)](a4_0x3d30e6[_0x168228(0x1f4)]('\x20\x20Prompt\x20\x22'+_0x3a7e22['name']+'\x22:\x20'+_0x3a7e22[_0x168228(0x261)]));}for(const _0x3567fe of _0x21bd47[_0x168228(0x245)]){_0x3567fe[_0x168228(0x1e9)]===_0x168228(0x261)&&console[_0x168228(0x1e5)](a4_0x3d30e6[_0x168228(0x1f4)](_0x168228(0x200)+_0x3567fe[_0x168228(0x24d)]+'\x22:\x20'+_0x3567fe[_0x168228(0x261)]));}return 0x1;}console[_0x168228(0x1e5)]();const _0x117ee6=getLLMProjectUrl(_0x5d0d96,_0x21bd47[_0x168228(0x223)]);return console[_0x168228(0x1e5)]('Project:\x20'+a4_0x3d30e6[_0x168228(0x26f)](_0x117ee6)),0x0;}}export class AgentPushCommand extends BaseCommand{['name']=a4_0x5c4456(0x22e);[a4_0x5c4456(0x27f)]=a4_0x5c4456(0x281);async[a4_0x5c4456(0x214)](_0x24374d){const _0xb1ed8=a4_0x5c4456,{options:_0x41741c,args:_0x471cd5,tdx:_0x2c42e5}=_0x24374d;let _0x4b405b=_0x471cd5[0x0]||process['cwd']();const _0x572520=_0x41741c[_0xb1ed8(0x1ea)],_0x2fde11=_0x41741c[_0xb1ed8(0x22a)],_0x5c9ae6=_0x41741c[_0xb1ed8(0x203)],_0x43d34e=_0x41741c['site'],_0xd3a0ab=a4_0x5a24c8[_0xb1ed8(0x205)](_0x4b405b,'agent.yml'),_0x19dde7=existsSync(_0xd3a0ab);if(_0x19dde7){const {data:_0x46014f}=await withSpinner(_0xb1ed8(0x20c)+_0x4b405b+_0xb1ed8(0x265),()=>_0x2c42e5[_0xb1ed8(0x260)][_0xb1ed8(0x220)](_0x4b405b,{'dryRun':_0x572520,'force':_0x2fde11}));if(_0x572520)return console['log'](a4_0x3d30e6[_0xb1ed8(0x274)](_0xb1ed8(0x272))),console['log'](_0xb1ed8(0x204)+_0x46014f[_0xb1ed8(0x1ef)]),0x0;if(_0x46014f[_0xb1ed8(0x1e9)]===_0xb1ed8(0x261))return console[_0xb1ed8(0x1e5)](a4_0x3d30e6[_0xb1ed8(0x1f4)](_0xb1ed8(0x1e8)+_0x46014f[_0xb1ed8(0x261)])),0x1;console[_0xb1ed8(0x1e5)](a4_0x3d30e6[_0xb1ed8(0x210)](_0xb1ed8(0x211)+_0x46014f[_0xb1ed8(0x1e9)]+_0xb1ed8(0x289))),console[_0xb1ed8(0x1e5)](_0xb1ed8(0x251)+_0x46014f[_0xb1ed8(0x1ef)]);if(_0x46014f['agentId']&&_0x46014f[_0xb1ed8(0x26b)]){const _0x3985b0=getLLMAgentChatUrl(_0x43d34e,_0x46014f[_0xb1ed8(0x26b)],_0x46014f[_0xb1ed8(0x1f6)]);console[_0xb1ed8(0x1e5)](_0xb1ed8(0x25a)+a4_0x3d30e6[_0xb1ed8(0x26f)](_0x3985b0));}return 0x0;}const _0x97872e=_0x41741c[_0xb1ed8(0x247)],_0x157007=resolveProjectFromContext(_0x4b405b,_0x97872e);if(_0x157007[_0xb1ed8(0x237)])_0x4b405b=_0x157007[_0xb1ed8(0x27a)],_0x157007[_0xb1ed8(0x1f2)]===_0xb1ed8(0x286)&&console['log'](a4_0x3d30e6[_0xb1ed8(0x287)](_0xb1ed8(0x1e6)+_0x4b405b));else{let _0x1a543f=_0xb1ed8(0x21c);_0x157007['reason']==='no_local_folder'&&(_0x1a543f=_0x157007['message']+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x157007[_0xb1ed8(0x247)]+_0xb1ed8(0x239));throw new SDKError(ErrorCode[_0xb1ed8(0x22b)],_0x157007[_0xb1ed8(0x234)]===_0xb1ed8(0x24c)?_0x157007[_0xb1ed8(0x24b)]:_0xb1ed8(0x255)+_0x4b405b,undefined,{'helpText':_0x1a543f});}const {data:_0x16ede7}=await withSpinner(_0xb1ed8(0x238),()=>_0x2c42e5[_0xb1ed8(0x260)][_0xb1ed8(0x1ec)](_0x4b405b,{'dryRun':!![]})),_0x2f761d=_0x16ede7[_0xb1ed8(0x242)]['agents']['errors']>0x0;if(_0x2f761d){console[_0xb1ed8(0x1e5)](a4_0x3d30e6[_0xb1ed8(0x1f4)]('\x0aErrors\x20found:'));for(const _0x203b3c of _0x16ede7[_0xb1ed8(0x284)]){_0x203b3c[_0xb1ed8(0x1e9)]===_0xb1ed8(0x261)&&console[_0xb1ed8(0x1e5)](a4_0x3d30e6['red'](_0xb1ed8(0x1fc)+_0x203b3c[_0xb1ed8(0x1ef)]+_0xb1ed8(0x1fd)+_0x203b3c[_0xb1ed8(0x261)]));}return 0x1;}const _0xe60f9=_0x16ede7[_0xb1ed8(0x242)]['agents'][_0xb1ed8(0x250)]+_0x16ede7[_0xb1ed8(0x242)][_0xb1ed8(0x216)][_0xb1ed8(0x250)]+_0x16ede7[_0xb1ed8(0x242)][_0xb1ed8(0x1eb)][_0xb1ed8(0x250)]+_0x16ede7[_0xb1ed8(0x242)][_0xb1ed8(0x23b)]['created']+_0x16ede7[_0xb1ed8(0x242)][_0xb1ed8(0x245)][_0xb1ed8(0x250)],_0x5e194f=_0x16ede7[_0xb1ed8(0x242)][_0xb1ed8(0x284)][_0xb1ed8(0x23c)]+_0x16ede7[_0xb1ed8(0x242)]['knowledgeBases'][_0xb1ed8(0x23c)]+_0x16ede7[_0xb1ed8(0x242)][_0xb1ed8(0x1eb)][_0xb1ed8(0x23c)]+_0x16ede7[_0xb1ed8(0x242)]['prompts'][_0xb1ed8(0x23c)]+_0x16ede7[_0xb1ed8(0x242)][_0xb1ed8(0x245)]['updated'],_0x1ca146=_0x16ede7[_0xb1ed8(0x242)][_0xb1ed8(0x284)]['unchanged']+_0x16ede7[_0xb1ed8(0x242)][_0xb1ed8(0x216)]['unchanged']+_0x16ede7['counts'][_0xb1ed8(0x1eb)][_0xb1ed8(0x215)]+_0x16ede7[_0xb1ed8(0x242)]['prompts'][_0xb1ed8(0x215)]+_0x16ede7[_0xb1ed8(0x242)][_0xb1ed8(0x245)][_0xb1ed8(0x215)];console[_0xb1ed8(0x1e5)](_0xb1ed8(0x20b)+_0x16ede7[_0xb1ed8(0x240)]+'\x27:'),console['log']('\x20\x20'+a4_0x3d30e6[_0xb1ed8(0x210)]('+\x20'+_0xe60f9+_0xb1ed8(0x278))+'\x20|\x20'+a4_0x3d30e6['yellow']('~\x20'+_0x5e194f+'\x20changed')+_0xb1ed8(0x22d)+a4_0x3d30e6['dim']('=\x20'+_0x1ca146+_0xb1ed8(0x248))),console[_0xb1ed8(0x1e5)](_0xb1ed8(0x202)+formatCountSummary(_0x16ede7['counts']['agents'])),console[_0xb1ed8(0x1e5)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x16ede7[_0xb1ed8(0x242)]['knowledgeBases'])),console[_0xb1ed8(0x1e5)](_0xb1ed8(0x26e)+formatCountSummary(_0x16ede7[_0xb1ed8(0x242)][_0xb1ed8(0x1eb)])),console[_0xb1ed8(0x1e5)](_0xb1ed8(0x269)+formatCountSummary(_0x16ede7['counts'][_0xb1ed8(0x23b)])),console[_0xb1ed8(0x1e5)](_0xb1ed8(0x273)+formatCountSummary(_0x16ede7[_0xb1ed8(0x242)][_0xb1ed8(0x245)])),console[_0xb1ed8(0x1e5)]('\x20\x20Source:\x20'+a4_0x3d30e6['cyan'](_0x4b405b)),displayDiffs(_0x16ede7[_0xb1ed8(0x284)],_0x16ede7[_0xb1ed8(0x216)],_0x16ede7[_0xb1ed8(0x1eb)],_0x16ede7[_0xb1ed8(0x23b)],_0x16ede7[_0xb1ed8(0x245)]);if(_0x572520)return console[_0xb1ed8(0x1e5)](a4_0x3d30e6[_0xb1ed8(0x274)](_0xb1ed8(0x264))),0x0;if(_0xe60f9===0x0&&_0x5e194f===0x0){console[_0xb1ed8(0x1e5)](a4_0x3d30e6[_0xb1ed8(0x210)](_0xb1ed8(0x288)));const _0x3b02a6=getLLMProjectUrl(_0x43d34e,_0x16ede7['projectId']);return console[_0xb1ed8(0x1e5)](_0xb1ed8(0x25c)+a4_0x3d30e6[_0xb1ed8(0x26f)](_0x3b02a6)),0x0;}if(!_0x5c9ae6&&!_0x2fde11){const _0x4779e9=await confirmKey(_0xb1ed8(0x1fe)+(_0xe60f9+_0x5e194f)+'\x20resources?');if(!_0x4779e9)return console[_0xb1ed8(0x1e5)]('Push\x20cancelled'),0x0;}const {data:_0x2831ce}=await withSpinner('Pushing\x20to\x20project...',()=>_0x2c42e5[_0xb1ed8(0x260)]['pushProject'](_0x4b405b,{'force':_0x2fde11})),_0x448b2d=_0x2831ce[_0xb1ed8(0x242)][_0xb1ed8(0x284)][_0xb1ed8(0x218)]>0x0||_0x2831ce[_0xb1ed8(0x242)][_0xb1ed8(0x216)][_0xb1ed8(0x218)]>0x0||_0x2831ce[_0xb1ed8(0x242)][_0xb1ed8(0x1eb)]['errors']>0x0||_0x2831ce[_0xb1ed8(0x242)]['prompts']['errors']>0x0;if(_0x448b2d){console[_0xb1ed8(0x1e5)](a4_0x3d30e6['yellow'](_0xb1ed8(0x1f9))),console[_0xb1ed8(0x1e5)](),console['log'](a4_0x3d30e6[_0xb1ed8(0x1f4)](_0xb1ed8(0x28e)));for(const _0x4693a1 of _0x2831ce[_0xb1ed8(0x284)]){_0x4693a1[_0xb1ed8(0x1e9)]==='error'&&console[_0xb1ed8(0x1e5)](a4_0x3d30e6[_0xb1ed8(0x1f4)](_0xb1ed8(0x1fc)+_0x4693a1[_0xb1ed8(0x1ef)]+_0xb1ed8(0x1fd)+_0x4693a1['error']));}for(const _0x3a3c95 of _0x2831ce[_0xb1ed8(0x216)]){_0x3a3c95[_0xb1ed8(0x1e9)]==='error'&&console[_0xb1ed8(0x1e5)](a4_0x3d30e6[_0xb1ed8(0x1f4)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x3a3c95[_0xb1ed8(0x24d)]+_0xb1ed8(0x1fd)+_0x3a3c95[_0xb1ed8(0x261)]));}for(const _0x13a0d8 of _0x2831ce['textKnowledgeBases']){_0x13a0d8[_0xb1ed8(0x1e9)]===_0xb1ed8(0x261)&&console[_0xb1ed8(0x1e5)](a4_0x3d30e6[_0xb1ed8(0x1f4)](_0xb1ed8(0x266)+_0x13a0d8[_0xb1ed8(0x24d)]+_0xb1ed8(0x1fd)+_0x13a0d8[_0xb1ed8(0x261)]));}for(const _0x4ca800 of _0x2831ce[_0xb1ed8(0x23b)]){_0x4ca800['action']===_0xb1ed8(0x261)&&console[_0xb1ed8(0x1e5)](a4_0x3d30e6[_0xb1ed8(0x1f4)]('\x20\x20Prompt\x20\x22'+_0x4ca800['name']+_0xb1ed8(0x1fd)+_0x4ca800['error']));}for(const _0xfdd3f4 of _0x2831ce[_0xb1ed8(0x245)]){_0xfdd3f4[_0xb1ed8(0x1e9)]==='error'&&console['log'](a4_0x3d30e6['red'](_0xb1ed8(0x200)+_0xfdd3f4[_0xb1ed8(0x24d)]+_0xb1ed8(0x1fd)+_0xfdd3f4['error']));}return 0x1;}console[_0xb1ed8(0x1e5)](a4_0x3d30e6[_0xb1ed8(0x210)](_0xb1ed8(0x241)+(_0xe60f9+_0x5e194f)+_0xb1ed8(0x24f)+_0x2831ce[_0xb1ed8(0x240)]+'\x27'));const _0x2f1129=getLLMProjectUrl(_0x43d34e,_0x2831ce[_0xb1ed8(0x26b)]);return console[_0xb1ed8(0x1e5)](_0xb1ed8(0x25c)+a4_0x3d30e6[_0xb1ed8(0x26f)](_0x2f1129)),0x0;}}
|
|
1
|
+
function a4_0x14a8(_0x3a1270,_0x31ca73){_0x3a1270=_0x3a1270-0x103;const _0x4732bd=a4_0x4732();let _0x14a863=_0x4732bd[_0x3a1270];return _0x14a863;}const a4_0x59c3f0=a4_0x14a8;(function(_0x5a35b2,_0x164bc3){const _0x2f3ef2=a4_0x14a8,_0x27042a=_0x5a35b2();while(!![]){try{const _0x3481cc=-parseInt(_0x2f3ef2(0x181))/0x1+-parseInt(_0x2f3ef2(0x1a5))/0x2+parseInt(_0x2f3ef2(0x188))/0x3+-parseInt(_0x2f3ef2(0x1a3))/0x4+-parseInt(_0x2f3ef2(0x15b))/0x5*(-parseInt(_0x2f3ef2(0x130))/0x6)+parseInt(_0x2f3ef2(0x147))/0x7*(parseInt(_0x2f3ef2(0x10d))/0x8)+parseInt(_0x2f3ef2(0x16c))/0x9*(-parseInt(_0x2f3ef2(0x1a4))/0xa);if(_0x3481cc===_0x164bc3)break;else _0x27042a['push'](_0x27042a['shift']());}catch(_0x202cef){_0x27042a['push'](_0x27042a['shift']());}}}(a4_0x4732,0x1e467));import a4_0x16b09a from'chalk';import a4_0x1b7e2f from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';function a4_0x4732(){const _0x24f5ff=['Status:\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','textKnowledgeBases','yellow','\x20\x20Agents:\x20','outputPath','agentName','green','updated','\x0aChanges\x20to\x20agent\x20\x27','Using\x20current\x20project:\x20','Would\x20push\x20agent:\x20','agent.yml','\x20errors','profile','6YrAwTo','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','join','\x20--name\x20','New\x20project\x20ID:\x20','counts','projectName','source','\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)','\x20\x20Prompts:\x20','Pull\x20cancelled','message','Agent\x20','pushProject','\x20\x20Text\x20Knowledge\x20Base\x20\x22','Analyzing\x20changes\x20to\x20push...','agents','dirname','Output:\x20','name','\x0aWrite\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','Would\x20clone:','1848wBmqxR','force','action','\x22:\x20','\x20created','Dry\x20run\x20-\x20no\x20changes\x20made','repeat','Using\x20project\x20from\x20','\x20files?','error','Using\x20project:\x20','red','\x20\x20tdx\x20agent\x20pull\x20','\x20total','projectDir','execute','<new-name>','Using\x20local\x20project:\x20','utf-8','\x0aPull\x20summary\x20for\x20\x27','1050565LuifwS','prompts','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','diff','\x20updated','Writing\x20files...','\x20\x20Integrations:\x20','\x20unchanged','sourceProjectName','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','no_local_folder','output','Push\x20cancelled','Using\x20context\x20project:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent','llm_project','Project\x20cloned\x20with\x20errors','144AEudHj','\x20resources?','\x20\x20Knowledge\x20Bases:\x20','Failed\x20to\x20push\x20agent:\x20','Pushing\x20to\x20project...','knowledgeBases','Cloning\x20\x22','newProjectId','\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','integrations','\x20new','\x20\x20Prompt\x20\x22','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x20files\x20to\x20','Clone\x20\x22','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x20\x20tdx\x20agent\x20clone\x20agents/','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)','pullAgent','Cannot\x20clone\x20from\x20context\x20project\x20\x22','parse','82877XsaHSo','\x0aPush\x20','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','agentId','reason','\x0a✔\x20Pushed\x20','errors','400449OHamFo','isNew','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x20--profile\x20','log','\x20=\x20','dim','\x20successfully','\x0aChanges\x20to\x20integration\x20\x27','Project\x20cloned\x20successfully','dryRun','Analyzing\x20project\x20\x22','Agent\x20pulled\x20successfully','\x0aErrors\x20found:','pullProject','description','site','\x20|\x20','agent:push','llm','\x20\x20Agent\x20\x22','Clone\x20cancelled','cyan','✔\x20Context\x20set:\x20','new','cwd','created','248960cdHMbO','88170zgkbmA','24144CFtINm','gray','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\x20\x20Knowledge\x20Base\x20\x22','llmProject','Output\x20path:\x20','\x0aChanges\x20to\x20prompt\x20\x27','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','no_context','\x20\x20Text\x20Knowledge\x20Bases:\x20','tdx.json','New\x20project:\x20','unchanged','total','push','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','newProjectName','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x22...','No\x20tdx.json\x20found\x20in\x20','yes','Summary:','agent:pull','2384KKJWyP','Agent:\x20','hasChanges','Project:\x20','Errors:','\x0aProject\x20pushed\x20with\x20errors','\x22\x20to\x20new\x20project\x20\x22','\x22\x20from\x20project\x20\x22','INVALID_ARGUMENT','cloneProject','Chat:\x20','\x20\x20Integration\x20\x22','projectId','\x22\x20to\x20\x22','\x20\x20Source:\x20','Would\x20pull\x20agent:\x20','\x22\x20to\x20a\x20different\x20profile','agent:clone','session','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a'];a4_0x4732=function(){return _0x24f5ff;};return a4_0x4732();}import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x333d57){const _0x2b7284=a4_0x14a8,_0x2ed4c0=[];if(_0x333d57[_0x2b7284(0x103)]!==undefined)_0x2ed4c0[_0x2b7284(0x104)](_0x333d57[_0x2b7284(0x103)]+_0x2b7284(0x154));if(_0x333d57[_0x2b7284(0x1a0)]!==undefined&&_0x333d57['new']>0x0)_0x2ed4c0[_0x2b7284(0x104)](a4_0x16b09a[_0x2b7284(0x128)](_0x333d57[_0x2b7284(0x1a0)]+_0x2b7284(0x176)));if(_0x333d57[_0x2b7284(0x1a2)]!==undefined&&_0x333d57['created']>0x0)_0x2ed4c0['push'](a4_0x16b09a[_0x2b7284(0x128)](_0x333d57[_0x2b7284(0x1a2)]+_0x2b7284(0x14b)));if(_0x333d57[_0x2b7284(0x129)]!==undefined&&_0x333d57[_0x2b7284(0x129)]>0x0)_0x2ed4c0['push'](a4_0x16b09a[_0x2b7284(0x124)](_0x333d57[_0x2b7284(0x129)]+_0x2b7284(0x15f)));if(_0x333d57[_0x2b7284(0x1b1)]!==undefined&&_0x333d57[_0x2b7284(0x1b1)]>0x0)_0x2ed4c0[_0x2b7284(0x104)](a4_0x16b09a[_0x2b7284(0x1a6)](_0x333d57[_0x2b7284(0x1b1)]+_0x2b7284(0x162)));if(_0x333d57[_0x2b7284(0x187)]!==undefined&&_0x333d57['errors']>0x0)_0x2ed4c0[_0x2b7284(0x104)](a4_0x16b09a[_0x2b7284(0x152)](_0x333d57[_0x2b7284(0x187)]+_0x2b7284(0x12e)));return _0x2ed4c0['join'](',\x20');}function displayDiffs(_0x52959c,_0x5a2af9,_0xf2e267,_0x55fae7,_0x5c1dae=[]){const _0xc72057=a4_0x14a8;for(const _0x24f4f6 of _0x52959c){if(_0x24f4f6['diff']){const _0x4e7a2b=_0x24f4f6[_0xc72057(0x127)]||_0x24f4f6[_0xc72057(0x143)];console[_0xc72057(0x18c)](_0xc72057(0x12a)+_0x4e7a2b+'\x27:'),console['log']('─'[_0xc72057(0x14d)](0x3c)),console[_0xc72057(0x18c)](_0x24f4f6[_0xc72057(0x15e)]),console[_0xc72057(0x18c)]('─'[_0xc72057(0x14d)](0x3c));}}for(const _0x15680c of _0x5a2af9){_0x15680c[_0xc72057(0x15e)]&&(console[_0xc72057(0x18c)]('\x0aChanges\x20to\x20knowledge\x20base\x20\x27'+_0x15680c[_0xc72057(0x143)]+'\x27:'),console[_0xc72057(0x18c)]('─'[_0xc72057(0x14d)](0x3c)),console['log'](_0x15680c['diff']),console[_0xc72057(0x18c)]('─'[_0xc72057(0x14d)](0x3c)));}for(const _0x1153b0 of _0xf2e267){_0x1153b0[_0xc72057(0x15e)]&&(console['log']('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x1153b0[_0xc72057(0x143)]+'\x27:'),console[_0xc72057(0x18c)]('─'['repeat'](0x3c)),console[_0xc72057(0x18c)](_0x1153b0[_0xc72057(0x15e)]),console[_0xc72057(0x18c)]('─'[_0xc72057(0x14d)](0x3c)));}for(const _0x2afbea of _0x55fae7){_0x2afbea[_0xc72057(0x15e)]&&(console['log'](_0xc72057(0x1ab)+_0x2afbea[_0xc72057(0x143)]+'\x27:'),console['log']('─'[_0xc72057(0x14d)](0x3c)),console[_0xc72057(0x18c)](_0x2afbea['diff']),console[_0xc72057(0x18c)]('─'[_0xc72057(0x14d)](0x3c)));}for(const _0x713f8d of _0x5c1dae){_0x713f8d[_0xc72057(0x15e)]&&(console[_0xc72057(0x18c)](_0xc72057(0x190)+_0x713f8d[_0xc72057(0x143)]+'\x27:'),console[_0xc72057(0x18c)]('─'[_0xc72057(0x14d)](0x3c)),console[_0xc72057(0x18c)](_0x713f8d[_0xc72057(0x15e)]),console[_0xc72057(0x18c)]('─'[_0xc72057(0x14d)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x59c3f0(0x143)]=a4_0x59c3f0(0x10c);['description']=a4_0x59c3f0(0x18a);async[a4_0x59c3f0(0x156)](_0xa843ed){const _0x1edb42=a4_0x59c3f0,{options:_0x41cb67,args:_0x404c9b,tdx:_0x47ba7d}=_0xa843ed,_0x2b0302=_0x404c9b[0x0],_0x91e6bf=_0x404c9b[0x1],_0x22aaea=_0x41cb67[_0x1edb42(0x166)],_0x367b3f=_0x41cb67['dryRun'],_0x3e8988=_0x41cb67[_0x1edb42(0x148)],_0x4639f1=_0x41cb67['yes'],_0x5de458=_0x41cb67['llmProject'];let _0x221053,_0x56ecea;const _0x3c60f1=findAgentConfigPath(process['cwd']());if(_0x2b0302){const _0x419848=a4_0x1b7e2f[_0x1edb42(0x132)](_0x2b0302,_0x1edb42(0x1af));if(existsSync(_0x419848))try{const _0x3c6f7c=JSON[_0x1edb42(0x180)](readFileSync(_0x419848,_0x1edb42(0x159)));_0x221053=_0x3c6f7c[_0x1edb42(0x16a)],_0x56ecea=_0x2b0302,console[_0x1edb42(0x18c)](a4_0x16b09a[_0x1edb42(0x18e)](_0x1edb42(0x14e)+_0x419848+':\x20'+_0x221053));}catch{_0x221053=_0x2b0302;}else _0x221053=_0x2b0302;}else{if(_0x3c60f1)try{const _0x48c2f6=JSON[_0x1edb42(0x180)](readFileSync(_0x3c60f1,'utf-8'));_0x221053=_0x48c2f6[_0x1edb42(0x16a)],_0x56ecea=a4_0x1b7e2f['dirname'](_0x3c60f1),console['log'](a4_0x16b09a['dim']('Using\x20project:\x20'+_0x221053));}catch{_0x221053=_0x5de458;}else _0x221053=_0x5de458;}if(!_0x221053)return console[_0x1edb42(0x18c)](a4_0x16b09a['yellow'](_0x1edb42(0x120))),console[_0x1edb42(0x18c)](_0x1edb42(0x17d)),console[_0x1edb42(0x18c)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project'),console[_0x1edb42(0x18c)](_0x1edb42(0x174)),console[_0x1edb42(0x18c)](_0x1edb42(0x169)),0x1;if(_0x91e6bf){const {data:_0x736b0}=await withSpinner('Pulling\x20agent\x20\x22'+_0x91e6bf+_0x1edb42(0x114)+_0x221053+_0x1edb42(0x108),()=>_0x47ba7d[_0x1edb42(0x19b)][_0x1edb42(0x17e)](_0x221053,_0x91e6bf,_0x22aaea,{'dryRun':_0x367b3f,'force':_0x3e8988}));if(_0x367b3f)return console[_0x1edb42(0x18c)](a4_0x16b09a[_0x1edb42(0x124)]('Dry\x20run\x20-\x20no\x20files\x20written')),console[_0x1edb42(0x18c)](_0x1edb42(0x11c)+_0x736b0[_0x1edb42(0x127)]),console[_0x1edb42(0x18c)](_0x1edb42(0x1aa)+_0x736b0['outputPath']),_0x736b0[_0x1edb42(0x15e)]&&(console[_0x1edb42(0x18c)]('\x0aChanges:'),console[_0x1edb42(0x18c)]('─'[_0x1edb42(0x14d)](0x3c)),console[_0x1edb42(0x18c)](_0x736b0['diff']),console[_0x1edb42(0x18c)]('─'['repeat'](0x3c))),0x0;return console[_0x1edb42(0x18c)](a4_0x16b09a[_0x1edb42(0x128)](_0x1edb42(0x194))),console[_0x1edb42(0x18c)](_0x1edb42(0x10e)+_0x736b0[_0x1edb42(0x127)]),console[_0x1edb42(0x18c)](_0x1edb42(0x142)+_0x736b0[_0x1edb42(0x126)]),console[_0x1edb42(0x18c)](_0x1edb42(0x121)+(_0x736b0[_0x1edb42(0x189)]?a4_0x16b09a[_0x1edb42(0x128)]('new'):_0x736b0[_0x1edb42(0x10f)]?a4_0x16b09a['yellow']('updated'):a4_0x16b09a[_0x1edb42(0x1a6)](_0x1edb42(0x1b1)))),0x0;}const _0x30ec84=_0x56ecea||_0x22aaea,{data:_0x5e957b}=await withSpinner(_0x1edb42(0x193)+_0x221053+'\x22...',()=>_0x47ba7d['llm']['pullProject'](_0x221053,_0x30ec84,{'dryRun':!![]})),_0x5c6e03=_0x5e957b[_0x1edb42(0x135)][_0x1edb42(0x140)][_0x1edb42(0x1a0)]+_0x5e957b['counts'][_0x1edb42(0x171)][_0x1edb42(0x1a0)]+_0x5e957b['counts']['textKnowledgeBases']['new']+_0x5e957b[_0x1edb42(0x135)][_0x1edb42(0x15c)][_0x1edb42(0x1a0)]+_0x5e957b[_0x1edb42(0x135)][_0x1edb42(0x175)][_0x1edb42(0x1a0)],_0x13dc72=_0x5e957b[_0x1edb42(0x135)][_0x1edb42(0x140)]['updated']+_0x5e957b[_0x1edb42(0x135)][_0x1edb42(0x171)]['updated']+_0x5e957b[_0x1edb42(0x135)]['textKnowledgeBases'][_0x1edb42(0x129)]+_0x5e957b[_0x1edb42(0x135)][_0x1edb42(0x15c)][_0x1edb42(0x129)]+_0x5e957b[_0x1edb42(0x135)][_0x1edb42(0x175)][_0x1edb42(0x129)],_0x504ce1=_0x5e957b[_0x1edb42(0x135)]['agents'][_0x1edb42(0x1b1)]+_0x5e957b[_0x1edb42(0x135)][_0x1edb42(0x171)][_0x1edb42(0x1b1)]+_0x5e957b[_0x1edb42(0x135)][_0x1edb42(0x123)][_0x1edb42(0x1b1)]+_0x5e957b[_0x1edb42(0x135)][_0x1edb42(0x15c)]['unchanged']+_0x5e957b[_0x1edb42(0x135)][_0x1edb42(0x175)]['unchanged'];console[_0x1edb42(0x18c)](_0x1edb42(0x15a)+_0x5e957b[_0x1edb42(0x136)]+'\x27:'),console[_0x1edb42(0x18c)]('\x20\x20'+a4_0x16b09a[_0x1edb42(0x128)]('+\x20'+_0x5c6e03+_0x1edb42(0x176))+_0x1edb42(0x199)+a4_0x16b09a['yellow']('~\x20'+_0x13dc72+'\x20changed')+'\x20|\x20'+a4_0x16b09a[_0x1edb42(0x18e)]('=\x20'+_0x504ce1+'\x20unchanged')),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x5e957b['counts'][_0x1edb42(0x140)])),console[_0x1edb42(0x18c)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x5e957b[_0x1edb42(0x135)][_0x1edb42(0x171)])),console[_0x1edb42(0x18c)](_0x1edb42(0x1ae)+formatCountSummary(_0x5e957b[_0x1edb42(0x135)][_0x1edb42(0x123)])),console[_0x1edb42(0x18c)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x5e957b[_0x1edb42(0x135)][_0x1edb42(0x15c)])),console[_0x1edb42(0x18c)](_0x1edb42(0x161)+formatCountSummary(_0x5e957b[_0x1edb42(0x135)][_0x1edb42(0x175)])),console[_0x1edb42(0x18c)]('\x20\x20Target:\x20'+a4_0x16b09a[_0x1edb42(0x19e)](_0x5e957b['outputDir'])),displayDiffs(_0x5e957b[_0x1edb42(0x140)],_0x5e957b[_0x1edb42(0x171)],_0x5e957b[_0x1edb42(0x123)],_0x5e957b[_0x1edb42(0x15c)],_0x5e957b[_0x1edb42(0x175)]);if(_0x367b3f)return console[_0x1edb42(0x18c)](a4_0x16b09a[_0x1edb42(0x124)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x5c6e03===0x0&&_0x13dc72===0x0)return console['log'](a4_0x16b09a[_0x1edb42(0x128)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x5e957b[_0x1edb42(0x136)]},_0x41cb67[_0x1edb42(0x11f)]),console[_0x1edb42(0x18c)](a4_0x16b09a[_0x1edb42(0x128)](_0x1edb42(0x19f)+a4_0x16b09a[_0x1edb42(0x18e)](_0x1edb42(0x16a))+_0x1edb42(0x18d)+a4_0x16b09a[_0x1edb42(0x19e)](_0x5e957b[_0x1edb42(0x136)]))),0x0;if(!_0x4639f1&&!_0x3e8988){const _0x3f312d=await confirmKey(_0x1edb42(0x144)+(_0x5c6e03+_0x13dc72)+_0x1edb42(0x14f));if(!_0x3f312d)return console[_0x1edb42(0x18c)](_0x1edb42(0x13a)),0x0;}const {data:_0x3ac398}=await withSpinner(_0x1edb42(0x160),()=>_0x47ba7d[_0x1edb42(0x19b)][_0x1edb42(0x196)](_0x221053,_0x30ec84,{'force':_0x3e8988}));return console['log'](a4_0x16b09a['green']('\x0a✔\x20Pulled\x20'+(_0x5c6e03+_0x13dc72)+_0x1edb42(0x179)+_0x3ac398['outputDir'])),saveSessionContext({'llm_project':_0x3ac398[_0x1edb42(0x136)]},_0x41cb67['session']),console[_0x1edb42(0x18c)](a4_0x16b09a[_0x1edb42(0x128)](_0x1edb42(0x19f)+a4_0x16b09a['dim'](_0x1edb42(0x16a))+'\x20=\x20'+a4_0x16b09a[_0x1edb42(0x19e)](_0x3ac398[_0x1edb42(0x136)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x59c3f0(0x143)]=a4_0x59c3f0(0x11e);[a4_0x59c3f0(0x197)]=a4_0x59c3f0(0x1ac);async[a4_0x59c3f0(0x156)](_0x3df021){const _0x5f5932=a4_0x59c3f0,{options:_0x3a435d,args:_0x3affcb,tdx:_0x169e3c}=_0x3df021,_0x3ddf9d=_0x3affcb[0x0],_0x43c066=_0x3a435d[_0x5f5932(0x143)],_0x1b7187=_0x3a435d[_0x5f5932(0x192)],_0x1b4e60=_0x3a435d[_0x5f5932(0x10a)],_0x9dc9f4=_0x3a435d[_0x5f5932(0x198)],_0x1f8b0f=_0x3a435d[_0x5f5932(0x1a9)];let _0x585dee;const _0x5f4a36=findAgentConfigPath(process[_0x5f5932(0x1a1)]());if(_0x3ddf9d){const _0x27ccda=a4_0x1b7e2f[_0x5f5932(0x132)](_0x3ddf9d,_0x5f5932(0x1af));existsSync(_0x27ccda)?(_0x585dee=_0x3ddf9d,console[_0x5f5932(0x18c)](a4_0x16b09a[_0x5f5932(0x18e)](_0x5f5932(0x158)+_0x3ddf9d))):_0x585dee=_0x3ddf9d;}else{if(_0x5f4a36)_0x585dee=a4_0x1b7e2f[_0x5f5932(0x141)](_0x5f4a36),console[_0x5f5932(0x18c)](a4_0x16b09a[_0x5f5932(0x18e)](_0x5f5932(0x12b)+_0x585dee));else{if(_0x1f8b0f){const _0xe854d=sanitizeForFilesystem(_0x1f8b0f);let _0x2f9783=_0xe854d,_0x5f46a3=a4_0x1b7e2f['join'](process[_0x5f5932(0x1a1)](),'agents',_0xe854d,'tdx.json');if(!existsSync(_0x5f46a3)){const _0xcab380=normalizeName(_0x1f8b0f),_0x30d642=a4_0x1b7e2f['join'](process[_0x5f5932(0x1a1)](),_0x5f5932(0x140),_0xcab380,_0x5f5932(0x1af));existsSync(_0x30d642)&&(_0x2f9783=_0xcab380,_0x5f46a3=_0x30d642);}if(existsSync(_0x5f46a3))_0x585dee=a4_0x1b7e2f[_0x5f5932(0x141)](_0x5f46a3),console[_0x5f5932(0x18c)](a4_0x16b09a[_0x5f5932(0x18e)]('Using\x20local\x20project:\x20'+_0x585dee));else{const _0x201161=_0x3a435d[_0x5f5932(0x12f)];if(_0x201161)throw new SDKError(ErrorCode[_0x5f5932(0x115)],_0x5f5932(0x17f)+_0x1f8b0f+_0x5f5932(0x11d),undefined,{'helpText':_0x5f5932(0x17b)+_0x5f5932(0x183)+(_0x5f5932(0x153)+_0x1f8b0f+'\x0a')+(_0x5f5932(0x17c)+_0x2f9783+_0x5f5932(0x133)+(_0x43c066||_0x5f5932(0x157))+_0x5f5932(0x18b)+_0x201161)});_0x585dee=_0x1f8b0f,console[_0x5f5932(0x18c)](a4_0x16b09a['dim'](_0x5f5932(0x168)+_0x1f8b0f));}}}}if(!_0x585dee)return console[_0x5f5932(0x18c)](a4_0x16b09a[_0x5f5932(0x124)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console['log'](_0x5f5932(0x107)),console[_0x5f5932(0x18c)](_0x5f5932(0x178)),console[_0x5f5932(0x18c)](_0x5f5932(0x138)),console[_0x5f5932(0x18c)](_0x5f5932(0x131)),0x1;if(!_0x43c066)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],'New\x20project\x20name\x20is\x20required',undefined,{'helpText':_0x5f5932(0x105)});if(!_0x1b4e60&&!_0x1b7187){const _0x906076=await confirmKey(_0x5f5932(0x17a)+_0x585dee+_0x5f5932(0x113)+_0x43c066+'\x22?');if(!_0x906076)return console[_0x5f5932(0x18c)](_0x5f5932(0x19d)),0x0;}const {data:_0x5d0769}=await withSpinner(_0x5f5932(0x172)+_0x585dee+_0x5f5932(0x11a)+_0x43c066+'\x22...',()=>_0x169e3c[_0x5f5932(0x19b)][_0x5f5932(0x116)](_0x585dee,_0x43c066,{'dryRun':_0x1b7187}));if(_0x1b7187)return console[_0x5f5932(0x18c)](a4_0x16b09a[_0x5f5932(0x124)](_0x5f5932(0x14c))),console[_0x5f5932(0x18c)]('Source:\x20'+_0x5d0769['sourceProjectName']),console[_0x5f5932(0x18c)](_0x5f5932(0x1b0)+_0x43c066),console[_0x5f5932(0x18c)](_0x5f5932(0x146)),console[_0x5f5932(0x18c)](_0x5f5932(0x125)+_0x5d0769[_0x5f5932(0x135)][_0x5f5932(0x140)]['created']),console[_0x5f5932(0x18c)](_0x5f5932(0x16e)+_0x5d0769[_0x5f5932(0x135)][_0x5f5932(0x171)][_0x5f5932(0x1a2)]),console['log']('\x20\x20Prompts:\x20'+_0x5d0769[_0x5f5932(0x135)][_0x5f5932(0x15c)][_0x5f5932(0x1a2)]),0x0;const _0x3fd125=_0x5d0769[_0x5f5932(0x135)][_0x5f5932(0x140)][_0x5f5932(0x187)]>0x0||_0x5d0769[_0x5f5932(0x135)][_0x5f5932(0x171)][_0x5f5932(0x187)]>0x0||_0x5d0769[_0x5f5932(0x135)][_0x5f5932(0x15c)][_0x5f5932(0x187)]>0x0;_0x3fd125?console[_0x5f5932(0x18c)](a4_0x16b09a[_0x5f5932(0x124)](_0x5f5932(0x16b))):console[_0x5f5932(0x18c)](a4_0x16b09a[_0x5f5932(0x128)](_0x5f5932(0x191)));console[_0x5f5932(0x18c)]('Source:\x20'+_0x5d0769[_0x5f5932(0x163)]),console[_0x5f5932(0x18c)](_0x5f5932(0x1b0)+_0x5d0769[_0x5f5932(0x106)]),console[_0x5f5932(0x18c)](_0x5f5932(0x134)+_0x5d0769['newProjectId']),console[_0x5f5932(0x18c)](),console[_0x5f5932(0x18c)](_0x5f5932(0x10b)),console[_0x5f5932(0x18c)](_0x5f5932(0x125)+formatCountSummary(_0x5d0769[_0x5f5932(0x135)][_0x5f5932(0x140)])),console[_0x5f5932(0x18c)](_0x5f5932(0x16e)+formatCountSummary(_0x5d0769[_0x5f5932(0x135)][_0x5f5932(0x171)])),console['log']('\x20\x20Prompts:\x20'+formatCountSummary(_0x5d0769[_0x5f5932(0x135)][_0x5f5932(0x15c)])),console[_0x5f5932(0x18c)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x5d0769[_0x5f5932(0x135)][_0x5f5932(0x175)]));if(_0x3fd125){console[_0x5f5932(0x18c)](),console['log'](a4_0x16b09a[_0x5f5932(0x152)](_0x5f5932(0x111)));for(const _0x243fdf of _0x5d0769[_0x5f5932(0x140)]){_0x243fdf['action']===_0x5f5932(0x150)&&console[_0x5f5932(0x18c)](a4_0x16b09a[_0x5f5932(0x152)](_0x5f5932(0x19c)+_0x243fdf[_0x5f5932(0x127)]+_0x5f5932(0x14a)+_0x243fdf[_0x5f5932(0x150)]));}for(const _0x2ea0f1 of _0x5d0769[_0x5f5932(0x171)]){_0x2ea0f1[_0x5f5932(0x149)]==='error'&&console[_0x5f5932(0x18c)](a4_0x16b09a['red'](_0x5f5932(0x1a8)+_0x2ea0f1[_0x5f5932(0x143)]+_0x5f5932(0x14a)+_0x2ea0f1['error']));}for(const _0x18886f of _0x5d0769[_0x5f5932(0x15c)]){_0x18886f[_0x5f5932(0x149)]===_0x5f5932(0x150)&&console[_0x5f5932(0x18c)](a4_0x16b09a['red'](_0x5f5932(0x177)+_0x18886f['name']+_0x5f5932(0x14a)+_0x18886f[_0x5f5932(0x150)]));}for(const _0x46868e of _0x5d0769[_0x5f5932(0x175)]){_0x46868e[_0x5f5932(0x149)]===_0x5f5932(0x150)&&console['log'](a4_0x16b09a[_0x5f5932(0x152)](_0x5f5932(0x118)+_0x46868e['name']+_0x5f5932(0x14a)+_0x46868e[_0x5f5932(0x150)]));}return 0x1;}console[_0x5f5932(0x18c)]();const _0x3cb3aa=getLLMProjectUrl(_0x9dc9f4,_0x5d0769[_0x5f5932(0x173)]);return console[_0x5f5932(0x18c)](_0x5f5932(0x110)+a4_0x16b09a[_0x5f5932(0x19e)](_0x3cb3aa)),0x0;}}export class AgentPushCommand extends BaseCommand{['name']=a4_0x59c3f0(0x19a);[a4_0x59c3f0(0x197)]=a4_0x59c3f0(0x15d);async['execute'](_0x4bdb66){const _0x3b9a40=a4_0x59c3f0,{options:_0x46f62b,args:_0xa4eab6,tdx:_0x2243cd}=_0x4bdb66;let _0x2ba9e3=_0xa4eab6[0x0]||process[_0x3b9a40(0x1a1)]();const _0x20321e=_0x46f62b[_0x3b9a40(0x192)],_0x24882b=_0x46f62b[_0x3b9a40(0x148)],_0x3fed7f=_0x46f62b[_0x3b9a40(0x10a)],_0x12ba4c=_0x46f62b[_0x3b9a40(0x198)],_0x227cd7=a4_0x1b7e2f[_0x3b9a40(0x132)](_0x2ba9e3,_0x3b9a40(0x12d)),_0x3d43a2=existsSync(_0x227cd7);if(_0x3d43a2){const {data:_0x5075c9}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x2ba9e3+_0x3b9a40(0x108),()=>_0x2243cd[_0x3b9a40(0x19b)]['pushAgent'](_0x2ba9e3,{'dryRun':_0x20321e,'force':_0x24882b}));if(_0x20321e)return console[_0x3b9a40(0x18c)](a4_0x16b09a[_0x3b9a40(0x124)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x3b9a40(0x18c)](_0x3b9a40(0x12c)+_0x5075c9['agentName']),0x0;if(_0x5075c9[_0x3b9a40(0x149)]===_0x3b9a40(0x150))return console['log'](a4_0x16b09a[_0x3b9a40(0x152)](_0x3b9a40(0x16f)+_0x5075c9[_0x3b9a40(0x150)])),0x1;console[_0x3b9a40(0x18c)](a4_0x16b09a[_0x3b9a40(0x128)](_0x3b9a40(0x13c)+_0x5075c9[_0x3b9a40(0x149)]+_0x3b9a40(0x18f))),console[_0x3b9a40(0x18c)](_0x3b9a40(0x10e)+_0x5075c9['agentName']);if(_0x5075c9[_0x3b9a40(0x184)]&&_0x5075c9[_0x3b9a40(0x119)]){const _0x160fca=getLLMAgentChatUrl(_0x12ba4c,_0x5075c9[_0x3b9a40(0x119)],_0x5075c9['agentId']);console['log'](_0x3b9a40(0x117)+a4_0x16b09a[_0x3b9a40(0x19e)](_0x160fca));}return 0x0;}const _0x51b924=_0x46f62b[_0x3b9a40(0x1a9)],_0x491d7a=resolveProjectFromContext(_0x2ba9e3,_0x51b924);if(_0x491d7a['found'])_0x2ba9e3=_0x491d7a[_0x3b9a40(0x155)],_0x491d7a[_0x3b9a40(0x137)]==='context'&&console[_0x3b9a40(0x18c)](a4_0x16b09a[_0x3b9a40(0x18e)](_0x3b9a40(0x151)+_0x2ba9e3));else{let _0xc680f4=_0x3b9a40(0x1a7);_0x491d7a['reason']===_0x3b9a40(0x165)&&(_0xc680f4=_0x491d7a[_0x3b9a40(0x13b)]+_0x3b9a40(0x164)+_0x491d7a['llmProject']+_0x3b9a40(0x122));throw new SDKError(ErrorCode[_0x3b9a40(0x115)],_0x491d7a[_0x3b9a40(0x185)]===_0x3b9a40(0x1ad)?_0x491d7a[_0x3b9a40(0x13b)]:_0x3b9a40(0x109)+_0x2ba9e3,undefined,{'helpText':_0xc680f4});}const {data:_0xd66cb5}=await withSpinner(_0x3b9a40(0x13f),()=>_0x2243cd['llm'][_0x3b9a40(0x13d)](_0x2ba9e3,{'dryRun':!![]})),_0x5b1dbe=_0xd66cb5['counts']['agents'][_0x3b9a40(0x187)]>0x0;if(_0x5b1dbe){console[_0x3b9a40(0x18c)](a4_0x16b09a[_0x3b9a40(0x152)](_0x3b9a40(0x195)));for(const _0x452ad3 of _0xd66cb5[_0x3b9a40(0x140)]){_0x452ad3['action']==='error'&&console['log'](a4_0x16b09a[_0x3b9a40(0x152)](_0x3b9a40(0x19c)+_0x452ad3[_0x3b9a40(0x127)]+_0x3b9a40(0x14a)+_0x452ad3[_0x3b9a40(0x150)]));}return 0x1;}const _0x1a1aeb=_0xd66cb5[_0x3b9a40(0x135)]['agents'][_0x3b9a40(0x1a2)]+_0xd66cb5[_0x3b9a40(0x135)][_0x3b9a40(0x171)][_0x3b9a40(0x1a2)]+_0xd66cb5[_0x3b9a40(0x135)][_0x3b9a40(0x123)][_0x3b9a40(0x1a2)]+_0xd66cb5['counts'][_0x3b9a40(0x15c)]['created']+_0xd66cb5[_0x3b9a40(0x135)][_0x3b9a40(0x175)]['created'],_0x1e807f=_0xd66cb5[_0x3b9a40(0x135)][_0x3b9a40(0x140)]['updated']+_0xd66cb5[_0x3b9a40(0x135)][_0x3b9a40(0x171)][_0x3b9a40(0x129)]+_0xd66cb5[_0x3b9a40(0x135)][_0x3b9a40(0x123)][_0x3b9a40(0x129)]+_0xd66cb5[_0x3b9a40(0x135)][_0x3b9a40(0x15c)][_0x3b9a40(0x129)]+_0xd66cb5['counts']['integrations'][_0x3b9a40(0x129)],_0x3851c7=_0xd66cb5[_0x3b9a40(0x135)][_0x3b9a40(0x140)][_0x3b9a40(0x1b1)]+_0xd66cb5['counts']['knowledgeBases'][_0x3b9a40(0x1b1)]+_0xd66cb5[_0x3b9a40(0x135)][_0x3b9a40(0x123)]['unchanged']+_0xd66cb5[_0x3b9a40(0x135)]['prompts']['unchanged']+_0xd66cb5[_0x3b9a40(0x135)]['integrations']['unchanged'];console['log']('\x0aPush\x20summary\x20for\x20\x27'+_0xd66cb5[_0x3b9a40(0x136)]+'\x27:'),console['log']('\x20\x20'+a4_0x16b09a['green']('+\x20'+_0x1a1aeb+'\x20new')+_0x3b9a40(0x199)+a4_0x16b09a[_0x3b9a40(0x124)]('~\x20'+_0x1e807f+'\x20changed')+_0x3b9a40(0x199)+a4_0x16b09a[_0x3b9a40(0x18e)]('=\x20'+_0x3851c7+'\x20unchanged')),console[_0x3b9a40(0x18c)]('\x20\x20Agents:\x20'+formatCountSummary(_0xd66cb5['counts'][_0x3b9a40(0x140)])),console['log'](_0x3b9a40(0x16e)+formatCountSummary(_0xd66cb5['counts'][_0x3b9a40(0x171)])),console[_0x3b9a40(0x18c)](_0x3b9a40(0x1ae)+formatCountSummary(_0xd66cb5[_0x3b9a40(0x135)][_0x3b9a40(0x123)])),console['log'](_0x3b9a40(0x139)+formatCountSummary(_0xd66cb5[_0x3b9a40(0x135)]['prompts'])),console[_0x3b9a40(0x18c)](_0x3b9a40(0x161)+formatCountSummary(_0xd66cb5[_0x3b9a40(0x135)][_0x3b9a40(0x175)])),console[_0x3b9a40(0x18c)](_0x3b9a40(0x11b)+a4_0x16b09a['cyan'](_0x2ba9e3)),displayDiffs(_0xd66cb5['agents'],_0xd66cb5[_0x3b9a40(0x171)],_0xd66cb5[_0x3b9a40(0x123)],_0xd66cb5[_0x3b9a40(0x15c)],_0xd66cb5['integrations']);if(_0x20321e)return console[_0x3b9a40(0x18c)](a4_0x16b09a[_0x3b9a40(0x124)](_0x3b9a40(0x145))),0x0;if(_0x1a1aeb===0x0&&_0x1e807f===0x0){console[_0x3b9a40(0x18c)](a4_0x16b09a[_0x3b9a40(0x128)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x41d26b=getLLMProjectUrl(_0x12ba4c,_0xd66cb5[_0x3b9a40(0x119)]);return console[_0x3b9a40(0x18c)](_0x3b9a40(0x110)+a4_0x16b09a[_0x3b9a40(0x19e)](_0x41d26b)),0x0;}if(!_0x3fed7f&&!_0x24882b){const _0x3cbaae=await confirmKey(_0x3b9a40(0x182)+(_0x1a1aeb+_0x1e807f)+_0x3b9a40(0x16d));if(!_0x3cbaae)return console['log'](_0x3b9a40(0x167)),0x0;}const {data:_0x2b5cf2}=await withSpinner(_0x3b9a40(0x170),()=>_0x2243cd[_0x3b9a40(0x19b)][_0x3b9a40(0x13d)](_0x2ba9e3,{'force':_0x24882b})),_0x4ed096=_0x2b5cf2[_0x3b9a40(0x135)]['agents']['errors']>0x0||_0x2b5cf2['counts'][_0x3b9a40(0x171)][_0x3b9a40(0x187)]>0x0||_0x2b5cf2[_0x3b9a40(0x135)][_0x3b9a40(0x123)]['errors']>0x0||_0x2b5cf2[_0x3b9a40(0x135)][_0x3b9a40(0x15c)]['errors']>0x0;if(_0x4ed096){console[_0x3b9a40(0x18c)](a4_0x16b09a['yellow'](_0x3b9a40(0x112))),console[_0x3b9a40(0x18c)](),console[_0x3b9a40(0x18c)](a4_0x16b09a[_0x3b9a40(0x152)](_0x3b9a40(0x111)));for(const _0x35586c of _0x2b5cf2[_0x3b9a40(0x140)]){_0x35586c[_0x3b9a40(0x149)]===_0x3b9a40(0x150)&&console[_0x3b9a40(0x18c)](a4_0x16b09a[_0x3b9a40(0x152)](_0x3b9a40(0x19c)+_0x35586c[_0x3b9a40(0x127)]+_0x3b9a40(0x14a)+_0x35586c[_0x3b9a40(0x150)]));}for(const _0xcdd4ba of _0x2b5cf2[_0x3b9a40(0x171)]){_0xcdd4ba[_0x3b9a40(0x149)]===_0x3b9a40(0x150)&&console[_0x3b9a40(0x18c)](a4_0x16b09a[_0x3b9a40(0x152)](_0x3b9a40(0x1a8)+_0xcdd4ba['name']+_0x3b9a40(0x14a)+_0xcdd4ba[_0x3b9a40(0x150)]));}for(const _0x4f3dde of _0x2b5cf2[_0x3b9a40(0x123)]){_0x4f3dde['action']===_0x3b9a40(0x150)&&console[_0x3b9a40(0x18c)](a4_0x16b09a['red'](_0x3b9a40(0x13e)+_0x4f3dde['name']+_0x3b9a40(0x14a)+_0x4f3dde[_0x3b9a40(0x150)]));}for(const _0x2519d3 of _0x2b5cf2['prompts']){_0x2519d3['action']==='error'&&console[_0x3b9a40(0x18c)](a4_0x16b09a['red'](_0x3b9a40(0x177)+_0x2519d3['name']+_0x3b9a40(0x14a)+_0x2519d3[_0x3b9a40(0x150)]));}for(const _0x3f099a of _0x2b5cf2[_0x3b9a40(0x175)]){_0x3f099a['action']==='error'&&console[_0x3b9a40(0x18c)](a4_0x16b09a[_0x3b9a40(0x152)](_0x3b9a40(0x118)+_0x3f099a['name']+_0x3b9a40(0x14a)+_0x3f099a['error']));}return 0x1;}console[_0x3b9a40(0x18c)](a4_0x16b09a[_0x3b9a40(0x128)](_0x3b9a40(0x186)+(_0x1a1aeb+_0x1e807f)+'\x20resources\x20to\x20\x27'+_0x2b5cf2[_0x3b9a40(0x136)]+'\x27'));const _0x2cef4f=getLLMProjectUrl(_0x12ba4c,_0x2b5cf2['projectId']);return console['log']('Project:\x20'+a4_0x16b09a[_0x3b9a40(0x19e)](_0x2cef4f)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x1d0ccd=a5_0x42b9;(function(_0xa997ad,_0x4caf2f){const _0x25dd13=a5_0x42b9,_0x274dc7=_0xa997ad();while(!![]){try{const _0x137704=parseInt(_0x25dd13(0x201))/0x1*(-parseInt(_0x25dd13(0x18f))/0x2)+parseInt(_0x25dd13(0x1db))/0x3*(parseInt(_0x25dd13(0x219))/0x4)+parseInt(_0x25dd13(0x1df))/0x5*(-parseInt(_0x25dd13(0x1f9))/0x6)+-parseInt(_0x25dd13(0x211))/0x7*(-parseInt(_0x25dd13(0x1dc))/0x8)+parseInt(_0x25dd13(0x1c6))/0x9*(parseInt(_0x25dd13(0x1ae))/0xa)+parseInt(_0x25dd13(0x19c))/0xb+-parseInt(_0x25dd13(0x21b))/0xc;if(_0x137704===_0x4caf2f)break;else _0x274dc7['push'](_0x274dc7['shift']());}catch(_0x5a9094){_0x274dc7['push'](_0x274dc7['shift']());}}}(a5_0x10c8,0xe566e));import*as a5_0x2d7196 from'node:fs';import*as a5_0x4603c8 from'node:path';import a5_0x214f8d from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';function a5_0x42b9(_0x1e6a6f,_0x40135e){_0x1e6a6f=_0x1e6a6f-0x186;const _0x10c847=a5_0x10c8();let _0x42b9d7=_0x10c847[_0x1e6a6f];return _0x42b9d7;}function a5_0x10c8(){const _0x39e10a=['test.yml','testYmlPath','toISOString','conversations','Failed:\x20\x20\x20','source','trim','Error:\x20No\x20previous\x20test\x20run\x20found.','context','Error\x20writing\x20output\x20file:\x20','projectName','Site:\x20','Test\x20Summary','map','find','rounds','45TWIWhm','Agent:\x20','...','Conversation\x20URL:\x20','404','\x20\x20Evaluating...\x20','\x20\x20Round\x20','llmProject','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','log','ERROR','Re-evaluation\x20Summary','Output\x20written\x20to:\x20','Passed:\x20\x20\x20','No\x20tests\x20found\x20matching:\x20','yellow','...\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','no_tests','text','has','6ofztfC','1952oBWPPP','Either\x20switch\x20to\x20the\x20\x22','includes','25Qaymnf','reeval','llm','testName','agentDirs','table','start','status','PASS','message','agent:test',':\x20Sending\x20user\x20input...','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','projectDir','Errors:\x20\x20\x20','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','Re-evaluating...','output','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','\x20(new)','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','Round\x201/','New\x20tests\x20to\x20execute:\x20','Running\x20agent\x20tests...','dim','timestamp','1083072TTZgHt','green','basename','existsSync','cyan','multiple_agents','Evaluating\x20response...','writeFileSync','1076225BhktUB','split','verbose','join','resolve','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','\x20\x20Conversation:\x20','Re-evaluating\x20cached\x20test\x20run...','tests','Run\x20\x27tdx\x20agent\x20pull\x20','length','⚠\x20SKIPPED:\x20','Re-evaluating\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)','Using\x20agent:\x20','agentName','40810ChrsEg','\x20\x20Project:\x20','execute','resolveProjectId','✗\x20ERROR:\x20','now','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','name','2795080SWovKf','Run\x20tests\x20for\x20an\x20LLM\x20agent','12395316xIQvXL','red','jsonl','tsv','site','white','eval','not\x20found','Available\x20tests:\x20','\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','substring','found','2PhTeIo','\x20(cached)','Usage:','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','resolveAgentId','\x22:\x20','Test\x20Configuration:','reason','push','stop','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','json','Running\x20test:\x20','4581533PXyyhF','\x20\x20-\x20','FAIL','Cached\x20run\x20is\x20from\x20site\x20\x22','✗\x20ERROR:\x20Project\x20not\x20found:\x20','\x20\x20Agent:\x20','no_context','\x20-\x20','Failed\x20Tests:','conversation_url','Round\x20','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','utf-8','Project\x20path:\x20','agent','Duration:\x20','✓\x20PASS:\x20','\x20\x20Site:\x20','1429590OuKAWQ','Total:\x20\x20\x20\x20','executeReeval','toLowerCase','filter','repeat','✗\x20FAIL:\x20','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.'];a5_0x10c8=function(){return _0x39e10a;};return a5_0x10c8();}import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x1d0ccd(0x218)]=a5_0x1d0ccd(0x1e9);['description']=a5_0x1d0ccd(0x21a);async[a5_0x1d0ccd(0x213)](_0x1a867b){const _0xcfb01c=a5_0x1d0ccd,{options:_0x5ed885,args:_0x2b28e4,tdx:_0x5967da}=_0x1a867b,_0x5b1256=_0x2b28e4[0x0]||'.',_0x43d8ee=_0x5ed885['dryRun'],_0x51c361=_0x5ed885,_0x31ec61=_0x51c361[_0xcfb01c(0x188)]===![],_0x222ab2=_0x51c361[_0xcfb01c(0x1e0)],_0x3e5abc=_0x51c361[_0xcfb01c(0x218)],_0x222546=_0x5ed885[_0xcfb01c(0x186)],_0x484c79=_0x51c361[_0xcfb01c(0x1f0)];if(_0x222ab2&&_0x31ec61)return console['log'](a5_0x214f8d['red'](_0xcfb01c(0x18c))),0x1;let _0x5215a4=_0xcfb01c(0x1e4);if(_0x51c361[_0xcfb01c(0x19a)])_0x5215a4='json';else{if(_0x51c361[_0xcfb01c(0x21d)])_0x5215a4=_0xcfb01c(0x21d);else{if(_0x51c361['tsv'])_0x5215a4=_0xcfb01c(0x21e);else{if(_0x51c361['table'])_0x5215a4='table';}}}const _0x209399=_0x51c361[_0xcfb01c(0x1cd)];let _0x88bc4f=_0x5b1256;const _0x281772=a5_0x2d7196[_0xcfb01c(0x1fc)](_0x5b1256),_0x3f4079=_0x5b1256==='.';if(!_0x281772||_0x3f4079){const _0x64306f=resolveProjectFromContext(_0x5b1256,_0x209399,{'requireFile':_0xcfb01c(0x1b6)});if(_0x64306f[_0xcfb01c(0x18e)])_0x88bc4f=_0x64306f[_0xcfb01c(0x1ec)],_0x64306f[_0xcfb01c(0x1bb)]===_0xcfb01c(0x1be)&&console[_0xcfb01c(0x1cf)](a5_0x214f8d['dim'](_0xcfb01c(0x20f)+_0x88bc4f));else switch(_0x64306f['reason']){case _0xcfb01c(0x1a2):console['log'](a5_0x214f8d[_0xcfb01c(0x1d5)](_0x64306f['message'])),console['log'](),console[_0xcfb01c(0x1cf)](_0xcfb01c(0x191)),console[_0xcfb01c(0x1cf)](_0xcfb01c(0x18b)),console['log'](_0xcfb01c(0x20e)),console[_0xcfb01c(0x1cf)](),console['log'](_0xcfb01c(0x1ce));return 0x1;case'no_local_folder':console['log'](a5_0x214f8d[_0xcfb01c(0x1d5)](_0x64306f[_0xcfb01c(0x1e8)])),console['log'](),console[_0xcfb01c(0x1cf)](_0xcfb01c(0x20a)+_0x64306f[_0xcfb01c(0x1cd)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');return 0x1;case _0xcfb01c(0x1fe):{const _0x1fa452=a5_0x4603c8[_0xcfb01c(0x1fb)](_0x64306f[_0xcfb01c(0x1ec)]);console[_0xcfb01c(0x1cf)](a5_0x214f8d[_0xcfb01c(0x1d5)]('Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22'+_0x64306f[_0xcfb01c(0x1cd)]+'\x22:'));for(const _0x457384 of _0x64306f[_0xcfb01c(0x1e3)]){console['log'](_0xcfb01c(0x19d)+_0x457384);}return console[_0xcfb01c(0x1cf)](),console[_0xcfb01c(0x1cf)](_0xcfb01c(0x1eb)+_0x1fa452+'/<agent-name>'),0x1;}case _0xcfb01c(0x1d8):console[_0xcfb01c(0x1cf)](a5_0x214f8d['yellow'](_0xcfb01c(0x192)+_0x64306f[_0xcfb01c(0x1cd)]+'\x22.')),console[_0xcfb01c(0x1cf)](a5_0x214f8d['dim'](_0xcfb01c(0x1a9)+_0x64306f[_0xcfb01c(0x1ec)])),console[_0xcfb01c(0x1cf)](),console['log'](_0xcfb01c(0x1ee));return 0x1;}}const {definition:_0x2f18f2,agentInfo:_0x4cee9e}=parseTestFile(_0x88bc4f);let _0x3e5ec8=_0x2f18f2[_0xcfb01c(0x209)];if(_0x3e5abc){const _0x1ae93d=_0x3e5abc[_0xcfb01c(0x202)](',')[_0xcfb01c(0x1c3)](_0x1fdf5c=>_0x1fdf5c[_0xcfb01c(0x1bc)]());_0x3e5ec8=_0x2f18f2[_0xcfb01c(0x209)][_0xcfb01c(0x1b2)](_0x179fca=>_0x1ae93d[_0xcfb01c(0x1de)](_0x179fca['name']));if(_0x3e5ec8[_0xcfb01c(0x20b)]===0x0)return console['log'](a5_0x214f8d[_0xcfb01c(0x1d5)](_0xcfb01c(0x1d4)+_0x3e5abc)),console[_0xcfb01c(0x1cf)](a5_0x214f8d[_0xcfb01c(0x1f7)](_0xcfb01c(0x18a)+_0x2f18f2[_0xcfb01c(0x209)][_0xcfb01c(0x1c3)](_0x6296e2=>_0x6296e2[_0xcfb01c(0x218)])[_0xcfb01c(0x204)](',\x20'))),0x1;}if(_0x222ab2)return this[_0xcfb01c(0x1b0)](_0x1a867b,{'definition':{'tests':_0x3e5ec8},'agentInfo':_0x4cee9e,'outputFormat':_0x5215a4,'outputFile':_0x484c79,'testNames':_0x3e5abc});if(_0x43d8ee){console['log'](a5_0x214f8d[_0xcfb01c(0x1fd)](_0xcfb01c(0x195))),console[_0xcfb01c(0x1cf)](_0xcfb01c(0x1ad)+a5_0x214f8d[_0xcfb01c(0x187)](_0x222546)),console[_0xcfb01c(0x1cf)](_0xcfb01c(0x212)+a5_0x214f8d['white'](_0x4cee9e['projectName'])),console[_0xcfb01c(0x1cf)](_0xcfb01c(0x1a1)+a5_0x214f8d[_0xcfb01c(0x187)](_0x4cee9e[_0xcfb01c(0x210)])),console[_0xcfb01c(0x1cf)](),console[_0xcfb01c(0x1cf)]('Tests\x20found:\x20'+a5_0x214f8d[_0xcfb01c(0x187)](_0x3e5ec8['length']));for(let _0x5a22ac=0x0;_0x5a22ac<_0x3e5ec8[_0xcfb01c(0x20b)];_0x5a22ac++){const _0x3e576f=_0x3e5ec8[_0x5a22ac],_0x156005=_0x3e576f['rounds']['length']===0x1?'round':_0xcfb01c(0x1c5);console[_0xcfb01c(0x1cf)]('\x20\x20'+(_0x5a22ac+0x1)+'.\x20'+a5_0x214f8d['white'](_0x3e576f[_0xcfb01c(0x218)])+'\x20('+_0x3e576f[_0xcfb01c(0x1c5)]['length']+'\x20'+_0x156005+')');}return 0x0;}let _0x50719a,_0x26fa2b;try{_0x50719a=await _0x5967da['llm'][_0xcfb01c(0x214)](_0x4cee9e[_0xcfb01c(0x1c0)]);}catch(_0x590901){const _0x2a4025=_0x590901 instanceof Error?_0x590901[_0xcfb01c(0x1e8)]:String(_0x590901);return _0x2a4025['includes'](_0xcfb01c(0x1ca))||_0x2a4025['toLowerCase']()[_0xcfb01c(0x1de)]('not\x20found')?console[_0xcfb01c(0x1cf)](a5_0x214f8d[_0xcfb01c(0x21c)](_0xcfb01c(0x1a0)+_0x4cee9e[_0xcfb01c(0x1c0)])):console[_0xcfb01c(0x1cf)](a5_0x214f8d['red'](_0xcfb01c(0x217)+_0x4cee9e[_0xcfb01c(0x1c0)]+'\x22:\x20'+_0x2a4025)),0x1;}try{_0x26fa2b=await _0x5967da[_0xcfb01c(0x1e1)][_0xcfb01c(0x193)](_0x4cee9e[_0xcfb01c(0x210)],_0x50719a);}catch(_0x42150d){const _0x36446c=_0x42150d instanceof Error?_0x42150d[_0xcfb01c(0x1e8)]:String(_0x42150d);return _0x36446c[_0xcfb01c(0x1de)]('404')||_0x36446c[_0xcfb01c(0x1b1)]()[_0xcfb01c(0x1de)](_0xcfb01c(0x189))?console[_0xcfb01c(0x1cf)](a5_0x214f8d[_0xcfb01c(0x21c)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x4cee9e[_0xcfb01c(0x210)])):console[_0xcfb01c(0x1cf)](a5_0x214f8d[_0xcfb01c(0x21c)](_0xcfb01c(0x199)+_0x4cee9e[_0xcfb01c(0x210)]+_0xcfb01c(0x194)+_0x36446c)),0x1;}let _0x2f9d99;if(!_0x31ec61)try{_0x2f9d99=await setupEvaluatorAgent(_0x5967da[_0xcfb01c(0x1e1)],_0x5ed885['verbose']);}catch(_0xf79148){const _0x9114a7=_0xf79148 instanceof Error?_0xf79148[_0xcfb01c(0x1e8)]:String(_0xf79148);return console[_0xcfb01c(0x1cf)](a5_0x214f8d['red'](_0xcfb01c(0x1d7)+_0x9114a7)),0x1;}console[_0xcfb01c(0x1cf)](a5_0x214f8d[_0xcfb01c(0x1fd)](_0xcfb01c(0x1f6))),console['log'](_0xcfb01c(0x1c1)+a5_0x214f8d[_0xcfb01c(0x187)](_0x222546)),console[_0xcfb01c(0x1cf)](_0xcfb01c(0x1c7)+a5_0x214f8d[_0xcfb01c(0x187)](_0x4cee9e['projectName']+'/'+_0x4cee9e[_0xcfb01c(0x210)])),console[_0xcfb01c(0x1cf)]();const _0x1379b1=[],_0x2f0c36=[],_0x21251e=Date['now']();for(let _0x4aa819=0x0;_0x4aa819<_0x3e5ec8['length'];_0x4aa819++){const _0x5de14a=_0x3e5ec8[_0x4aa819];_0x3e5ec8[_0xcfb01c(0x20b)]>0x1?console[_0xcfb01c(0x1cf)]('Test\x20'+(_0x4aa819+0x1)+'/'+_0x3e5ec8['length']+':\x20'+a5_0x214f8d[_0xcfb01c(0x187)](_0x5de14a[_0xcfb01c(0x218)])):console['log'](_0xcfb01c(0x19b)+a5_0x214f8d[_0xcfb01c(0x187)](_0x5de14a[_0xcfb01c(0x218)]));const _0x2197da=createCommandSpinner(_0xcfb01c(0x1f4)+_0x5de14a[_0xcfb01c(0x1c5)][_0xcfb01c(0x20b)]+':\x20Sending\x20user\x20input...');_0x2197da[_0xcfb01c(0x1e5)]();try{const {result:_0x1aa06f,conversation:_0x2f205c}=await runTest(_0x5967da[_0xcfb01c(0x1e1)],_0x5de14a,{'agentId':_0x26fa2b,'projectId':_0x50719a,'site':_0x222546,'noEval':_0x31ec61,'evaluatorId':_0x2f9d99,'onRoundStart':(_0x58ab2c,_0x5adaf9)=>{const _0xbd8126=_0xcfb01c;_0x2197da['text']=_0xbd8126(0x1a6)+(_0x58ab2c+0x1)+'/'+_0x5adaf9+_0xbd8126(0x1ea);},'onRoundComplete':(_0x2c3bbc,_0x36c62d,_0x140ad5)=>{const _0x43ef07=_0xcfb01c,_0x285cf5=formatElapsed(_0x36c62d);_0x140ad5?console[_0x43ef07(0x1cf)]('\x20\x20Round\x20'+(_0x2c3bbc+0x1)+'/'+_0x5de14a[_0x43ef07(0x1c5)][_0x43ef07(0x20b)]+_0x43ef07(0x1d6)+a5_0x214f8d['green']('✓')+'\x20('+_0x285cf5+')'):console[_0x43ef07(0x1cf)]('\x20\x20Round\x20'+(_0x2c3bbc+0x1)+'/'+_0x5de14a['rounds'][_0x43ef07(0x20b)]+_0x43ef07(0x1d6)+a5_0x214f8d['red']('✗'));},'onEvaluationStart':()=>{const _0x56ef48=_0xcfb01c;_0x2197da[_0x56ef48(0x1d9)]='Evaluating\x20response...';},'onEvaluationComplete':_0x151bea=>{const _0x45d920=_0xcfb01c,_0xfc8fd7=formatElapsed(_0x151bea);console[_0x45d920(0x1cf)](_0x45d920(0x1cb)+a5_0x214f8d[_0x45d920(0x1fa)]('✓')+'\x20('+_0xfc8fd7+')');}});_0x2197da[_0xcfb01c(0x198)](),_0x1379b1['push'](_0x1aa06f),_0x2f0c36[_0xcfb01c(0x197)](_0x2f205c);if(_0x1aa06f[_0xcfb01c(0x1e6)]===_0xcfb01c(0x1e7))console[_0xcfb01c(0x1cf)](a5_0x214f8d[_0xcfb01c(0x1fa)](_0xcfb01c(0x1ac)+_0x1aa06f[_0xcfb01c(0x196)]));else _0x1aa06f[_0xcfb01c(0x1e6)]===_0xcfb01c(0x19e)?console[_0xcfb01c(0x1cf)](a5_0x214f8d[_0xcfb01c(0x21c)](_0xcfb01c(0x1b4)+_0x1aa06f['reason'])):console[_0xcfb01c(0x1cf)](a5_0x214f8d[_0xcfb01c(0x21c)]('✗\x20ERROR:\x20'+_0x1aa06f[_0xcfb01c(0x196)]));_0x1aa06f[_0xcfb01c(0x1a5)]&&console[_0xcfb01c(0x1cf)](a5_0x214f8d['dim'](_0xcfb01c(0x1c9)+_0x1aa06f[_0xcfb01c(0x1a5)])),console[_0xcfb01c(0x1cf)]();}catch(_0x1b00fa){_0x2197da['stop']();const _0x26c95f=_0x1b00fa instanceof Error?_0x1b00fa[_0xcfb01c(0x1e8)]:String(_0x1b00fa);console[_0xcfb01c(0x1cf)](a5_0x214f8d[_0xcfb01c(0x21c)](_0xcfb01c(0x215)+_0x26c95f)),console[_0xcfb01c(0x1cf)](),_0x1379b1['push']({'name':_0x5de14a[_0xcfb01c(0x218)],'status':_0xcfb01c(0x1d0),'reason':_0x26c95f,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x4b130a=Date[_0xcfb01c(0x216)]()-_0x21251e,_0x2cac99=_0x1379b1[_0xcfb01c(0x1b2)](_0x4ba38b=>_0x4ba38b[_0xcfb01c(0x1e6)]===_0xcfb01c(0x1e7))['length'],_0x24129b=_0x1379b1[_0xcfb01c(0x1b2)](_0x2f3d18=>_0x2f3d18[_0xcfb01c(0x1e6)]==='FAIL')[_0xcfb01c(0x20b)],_0x37eb13=_0x1379b1['filter'](_0x8b33de=>_0x8b33de[_0xcfb01c(0x1e6)]===_0xcfb01c(0x1d0))[_0xcfb01c(0x20b)];console[_0xcfb01c(0x1cf)]('━'['repeat'](0x3c)),console['log'](_0xcfb01c(0x1c2)),console[_0xcfb01c(0x1cf)]('━'[_0xcfb01c(0x1b3)](0x3c)),console[_0xcfb01c(0x1cf)](_0xcfb01c(0x1af)+_0x1379b1[_0xcfb01c(0x20b)]),console[_0xcfb01c(0x1cf)](_0xcfb01c(0x1d3)+a5_0x214f8d['green'](_0x2cac99)),console[_0xcfb01c(0x1cf)](_0xcfb01c(0x1ba)+a5_0x214f8d['red'](_0x24129b));_0x37eb13>0x0&&console['log']('Errors:\x20\x20\x20'+a5_0x214f8d[_0xcfb01c(0x21c)](_0x37eb13));console['log'](_0xcfb01c(0x1ab)+formatElapsed(_0x4b130a)),console[_0xcfb01c(0x1cf)]('━'['repeat'](0x3c));const _0x5e00f9=_0x1379b1[_0xcfb01c(0x1b2)](_0x55bca2=>_0x55bca2[_0xcfb01c(0x1e6)]!==_0xcfb01c(0x1e7));if(_0x5e00f9[_0xcfb01c(0x20b)]>0x0){console[_0xcfb01c(0x1cf)](),console[_0xcfb01c(0x1cf)](_0xcfb01c(0x1a4));for(const _0x509f57 of _0x5e00f9){const _0x570e5f=a5_0x214f8d[_0xcfb01c(0x21c)]('✗'),_0x46d7aa=_0x509f57['reason'][_0xcfb01c(0x20b)]>0x32?_0x509f57['reason'][_0xcfb01c(0x18d)](0x0,0x32)+_0xcfb01c(0x1c8):_0x509f57[_0xcfb01c(0x196)];console['log']('\x20\x20'+_0x570e5f+'\x20'+_0x509f57[_0xcfb01c(0x218)]+':\x20'+_0x46d7aa);}}const _0x458692={'summary':{'total':_0x1379b1['length'],'passed':_0x2cac99,'failed':_0x24129b,'errors':_0x37eb13>0x0?_0x37eb13:undefined,'duration_ms':_0x4b130a},'tests':_0x1379b1,'agent':{'project':_0x4cee9e['projectName'],'name':_0x4cee9e[_0xcfb01c(0x210)],'site':_0x222546},'timestamp':new Date(_0x21251e)[_0xcfb01c(0x1b8)]()};try{const _0x5caf23=buildCachedTestRun(_0x2f0c36,{'site':_0x222546,'projectId':_0x50719a,'projectName':_0x4cee9e[_0xcfb01c(0x1c0)],'agentId':_0x26fa2b,'agentName':_0x4cee9e['agentName'],'testYmlPath':a5_0x4603c8[_0xcfb01c(0x205)](_0x4cee9e[_0xcfb01c(0x1b7)])});saveLastTestRun(_0x5caf23);}catch{}if(_0x5215a4!==_0xcfb01c(0x1e4)||_0x484c79){const _0x4fdf73=formatResults(_0x458692,_0x5215a4);if(_0x484c79)try{a5_0x2d7196[_0xcfb01c(0x200)](_0x484c79,_0x4fdf73,_0xcfb01c(0x1a8)),console[_0xcfb01c(0x1cf)](),console[_0xcfb01c(0x1cf)](a5_0x214f8d[_0xcfb01c(0x1f7)](_0xcfb01c(0x1d2)+_0x484c79));}catch(_0x26dd5c){return console[_0xcfb01c(0x1cf)](),console[_0xcfb01c(0x1cf)](a5_0x214f8d[_0xcfb01c(0x21c)](_0xcfb01c(0x1bf)+_0x26dd5c)),0x1;}else console[_0xcfb01c(0x1cf)](),console[_0xcfb01c(0x1cf)](_0x4fdf73);}return _0x5e00f9['length']>0x0?0x1:0x0;}async[a5_0x1d0ccd(0x1b0)](_0x139dc4,_0x23b4f8){const _0x355998=a5_0x1d0ccd,{options:_0x3a254d,tdx:_0x23a1ec}=_0x139dc4,{definition:_0x5e6332,agentInfo:_0x4f50ef,outputFormat:_0x12ae1d,outputFile:_0x1564ac}=_0x23b4f8,_0x1ea8c9=_0x3a254d[_0x355998(0x186)],_0x5b5ec0=loadLastTestRun();if(!_0x5b5ec0)return console[_0x355998(0x1cf)](a5_0x214f8d[_0x355998(0x21c)](_0x355998(0x1bd))),console[_0x355998(0x1cf)](a5_0x214f8d[_0x355998(0x1f7)](_0x355998(0x1f1))),0x1;if(_0x5b5ec0[_0x355998(0x1aa)][_0x355998(0x210)]!==_0x4f50ef[_0x355998(0x210)])return console[_0x355998(0x1cf)](a5_0x214f8d[_0x355998(0x21c)](_0x355998(0x1f3)+_0x5b5ec0[_0x355998(0x1aa)][_0x355998(0x210)]+_0x355998(0x1a7)+_0x4f50ef['agentName']+'\x22.')),console[_0x355998(0x1cf)](a5_0x214f8d[_0x355998(0x1f7)](_0x355998(0x1b5))),0x1;const _0x3ad213=new Set(_0x5b5ec0[_0x355998(0x1b9)][_0x355998(0x1c3)](_0x36c320=>_0x36c320[_0x355998(0x1e2)])),_0x3f980a=_0x5e6332[_0x355998(0x209)][_0x355998(0x1b2)](_0x8ab2dd=>!_0x3ad213[_0x355998(0x1da)](_0x8ab2dd[_0x355998(0x218)]));if(_0x3f980a['length']>0x0&&_0x5b5ec0[_0x355998(0x186)]!==_0x1ea8c9)return console[_0x355998(0x1cf)](a5_0x214f8d[_0x355998(0x21c)](_0x355998(0x206))),console[_0x355998(0x1cf)](a5_0x214f8d['dim'](_0x355998(0x19f)+_0x5b5ec0[_0x355998(0x186)]+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x1ea8c9+'\x22.')),console[_0x355998(0x1cf)](a5_0x214f8d['dim'](_0x355998(0x1dd)+_0x5b5ec0[_0x355998(0x186)]+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0xf5bab8=_0x5e6332[_0x355998(0x209)]['filter'](_0x5a0b67=>_0x3ad213[_0x355998(0x1da)](_0x5a0b67[_0x355998(0x218)])),_0x4865ad=_0x3f980a;let _0x1338d9;try{_0x1338d9=await setupEvaluatorAgent(_0x23a1ec[_0x355998(0x1e1)],_0x3a254d[_0x355998(0x203)]);}catch(_0x39abae){const _0x22c702=_0x39abae instanceof Error?_0x39abae[_0x355998(0x1e8)]:String(_0x39abae);return console[_0x355998(0x1cf)](a5_0x214f8d['red'](_0x355998(0x1d7)+_0x22c702)),0x1;}console[_0x355998(0x1cf)](a5_0x214f8d['cyan'](_0x355998(0x208))),console['log']('Cached\x20run\x20from:\x20'+a5_0x214f8d['white'](_0x5b5ec0[_0x355998(0x1f8)])),console[_0x355998(0x1cf)]('Agent:\x20'+a5_0x214f8d['white'](_0x5b5ec0['agent'][_0x355998(0x1c0)]+'/'+_0x5b5ec0['agent'][_0x355998(0x210)]));_0x4865ad['length']>0x0&&console[_0x355998(0x1cf)](_0x355998(0x1f5)+a5_0x214f8d['yellow'](_0x4865ad[_0x355998(0x20b)]));console[_0x355998(0x1cf)]();const _0x3bd453=[],_0xaa2fd5=Date['now'](),_0x128c8c=createCommandSpinner(_0x355998(0x1ef));if(_0xf5bab8[_0x355998(0x20b)]>0x0)try{const _0x4f2d57=await reevaluateFromCache(_0x23a1ec[_0x355998(0x1e1)],_0x5b5ec0,{'tests':_0xf5bab8},{'evaluatorId':_0x1338d9,'onTestStart':(_0x5eb519,_0x437e09,_0x204ad4)=>{const _0x5af335=_0x355998;_0x128c8c['text']=_0x5af335(0x20d)+(_0x437e09+0x1)+'/'+_0x204ad4+':\x20'+_0x5eb519+_0x5af335(0x1c8);if(!_0x128c8c['isSpinning'])_0x128c8c[_0x5af335(0x1e5)]();},'onTestComplete':(_0x1e91ce,_0x2ec6d8)=>{const _0x346393=_0x355998;_0x128c8c[_0x346393(0x198)]();if(_0x2ec6d8[_0x346393(0x1e6)]===_0x346393(0x1e7))console[_0x346393(0x1cf)](a5_0x214f8d[_0x346393(0x1fa)]('✓\x20PASS:\x20'+_0x1e91ce)+a5_0x214f8d[_0x346393(0x1f7)](_0x346393(0x190)));else _0x2ec6d8[_0x346393(0x1e6)]===_0x346393(0x19e)?console['log'](a5_0x214f8d[_0x346393(0x21c)](_0x346393(0x1b4)+_0x1e91ce+_0x346393(0x1a3)+_0x2ec6d8[_0x346393(0x196)])+a5_0x214f8d[_0x346393(0x1f7)](_0x346393(0x190))):console[_0x346393(0x1cf)](a5_0x214f8d[_0x346393(0x21c)](_0x346393(0x215)+_0x1e91ce+_0x346393(0x1a3)+_0x2ec6d8[_0x346393(0x196)]));_0x2ec6d8['conversation_url']&&console[_0x346393(0x1cf)](a5_0x214f8d[_0x346393(0x1f7)]('\x20\x20Conversation:\x20'+_0x2ec6d8[_0x346393(0x1a5)])),_0x3bd453[_0x346393(0x197)](_0x2ec6d8);},'onTestSkipped':(_0x51b688,_0x25d092)=>{const _0x4ebb0f=_0x355998;_0x128c8c[_0x4ebb0f(0x198)](),console[_0x4ebb0f(0x1cf)](a5_0x214f8d['yellow'](_0x4ebb0f(0x20c)+_0x51b688+_0x4ebb0f(0x1a3)+_0x25d092));}});for(const _0x4485d9 of _0x4f2d57){!_0x3bd453[_0x355998(0x1c4)](_0x3a21c2=>_0x3a21c2['name']===_0x4485d9[_0x355998(0x218)])&&_0x3bd453[_0x355998(0x197)](_0x4485d9);}}catch(_0x5322e3){_0x128c8c[_0x355998(0x198)]();const _0x5984f1=_0x5322e3 instanceof Error?_0x5322e3[_0x355998(0x1e8)]:String(_0x5322e3);return console[_0x355998(0x1cf)](a5_0x214f8d[_0x355998(0x21c)]('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0x5984f1)),0x1;}_0x128c8c[_0x355998(0x198)]();if(_0x4865ad[_0x355998(0x20b)]>0x0){console[_0x355998(0x1cf)](),console[_0x355998(0x1cf)](a5_0x214f8d[_0x355998(0x1fd)]('Executing\x20new\x20tests...'));const {projectId:_0x2024cf,agentId:_0x427d4d}=_0x5b5ec0['agent'];for(const _0x447075 of _0x4865ad){console[_0x355998(0x1cf)]('Running:\x20'+a5_0x214f8d[_0x355998(0x187)](_0x447075[_0x355998(0x218)]));const _0x544163=createCommandSpinner(_0x355998(0x1f4)+_0x447075['rounds'][_0x355998(0x20b)]+_0x355998(0x1ea));_0x544163[_0x355998(0x1e5)]();try{const {result:_0x1d682e}=await runTest(_0x23a1ec[_0x355998(0x1e1)],_0x447075,{'agentId':_0x427d4d,'projectId':_0x2024cf,'site':_0x5b5ec0[_0x355998(0x186)],'noEval':![],'evaluatorId':_0x1338d9,'onRoundStart':(_0x1111c0,_0x319300)=>{const _0x31a49a=_0x355998;_0x544163[_0x31a49a(0x1d9)]='Round\x20'+(_0x1111c0+0x1)+'/'+_0x319300+_0x31a49a(0x1ea);},'onRoundComplete':(_0x352f3c,_0x454b93,_0x16d5be)=>{const _0x54e53f=_0x355998,_0x3dba4f=formatElapsed(_0x454b93);_0x16d5be?console[_0x54e53f(0x1cf)]('\x20\x20Round\x20'+(_0x352f3c+0x1)+'/'+_0x447075['rounds'][_0x54e53f(0x20b)]+_0x54e53f(0x1d6)+a5_0x214f8d[_0x54e53f(0x1fa)]('✓')+'\x20('+_0x3dba4f+')'):console['log'](_0x54e53f(0x1cc)+(_0x352f3c+0x1)+'/'+_0x447075[_0x54e53f(0x1c5)][_0x54e53f(0x20b)]+_0x54e53f(0x1d6)+a5_0x214f8d[_0x54e53f(0x21c)]('✗'));},'onEvaluationStart':()=>{const _0x37b9c6=_0x355998;_0x544163[_0x37b9c6(0x1d9)]=_0x37b9c6(0x1ff);},'onEvaluationComplete':_0x57f4c7=>{const _0x259da9=_0x355998,_0x4f21dc=formatElapsed(_0x57f4c7);console[_0x259da9(0x1cf)]('\x20\x20Evaluating...\x20'+a5_0x214f8d['green']('✓')+'\x20('+_0x4f21dc+')');}});_0x544163['stop'](),_0x3bd453[_0x355998(0x197)](_0x1d682e);if(_0x1d682e[_0x355998(0x1e6)]==='PASS')console[_0x355998(0x1cf)](a5_0x214f8d['green'](_0x355998(0x1ac)+_0x1d682e[_0x355998(0x196)])+a5_0x214f8d[_0x355998(0x1f7)](_0x355998(0x1f2)));else _0x1d682e['status']===_0x355998(0x19e)?console['log'](a5_0x214f8d[_0x355998(0x21c)](_0x355998(0x1b4)+_0x1d682e[_0x355998(0x196)])+a5_0x214f8d[_0x355998(0x1f7)](_0x355998(0x1f2))):console['log'](a5_0x214f8d[_0x355998(0x21c)](_0x355998(0x215)+_0x1d682e[_0x355998(0x196)]));_0x1d682e[_0x355998(0x1a5)]&&console['log'](a5_0x214f8d[_0x355998(0x1f7)](_0x355998(0x207)+_0x1d682e['conversation_url']));}catch(_0x22a8bd){_0x544163[_0x355998(0x198)]();const _0x45bac9=_0x22a8bd instanceof Error?_0x22a8bd[_0x355998(0x1e8)]:String(_0x22a8bd);console[_0x355998(0x1cf)](a5_0x214f8d[_0x355998(0x21c)](_0x355998(0x215)+_0x45bac9)),_0x3bd453[_0x355998(0x197)]({'name':_0x447075[_0x355998(0x218)],'status':_0x355998(0x1d0),'reason':_0x45bac9,'timestamp':new Date()[_0x355998(0x1b8)](),'duration_ms':0x0});}}}console[_0x355998(0x1cf)]();const _0x522698=Date['now']()-_0xaa2fd5,_0x7725e2=_0x3bd453[_0x355998(0x1b2)](_0x5d2d94=>_0x5d2d94[_0x355998(0x1e6)]==='PASS')['length'],_0x3bcffa=_0x3bd453['filter'](_0x3537a7=>_0x3537a7[_0x355998(0x1e6)]===_0x355998(0x19e))['length'],_0x59f3ed=_0x3bd453[_0x355998(0x1b2)](_0x3e0f16=>_0x3e0f16[_0x355998(0x1e6)]===_0x355998(0x1d0))[_0x355998(0x20b)];console[_0x355998(0x1cf)]('━'[_0x355998(0x1b3)](0x3c)),console[_0x355998(0x1cf)](_0x355998(0x1d1)),console[_0x355998(0x1cf)]('━'[_0x355998(0x1b3)](0x3c)),console[_0x355998(0x1cf)](_0x355998(0x1af)+_0x3bd453[_0x355998(0x20b)]),console[_0x355998(0x1cf)](_0x355998(0x1d3)+a5_0x214f8d[_0x355998(0x1fa)](_0x7725e2)),console[_0x355998(0x1cf)](_0x355998(0x1ba)+a5_0x214f8d[_0x355998(0x21c)](_0x3bcffa));_0x59f3ed>0x0&&console['log'](_0x355998(0x1ed)+a5_0x214f8d['red'](_0x59f3ed));console[_0x355998(0x1cf)]('Duration:\x20'+formatElapsed(_0x522698)),console['log']('━'[_0x355998(0x1b3)](0x3c));const _0x294122={'summary':{'total':_0x3bd453[_0x355998(0x20b)],'passed':_0x7725e2,'failed':_0x3bcffa,'errors':_0x59f3ed>0x0?_0x59f3ed:undefined,'duration_ms':_0x522698},'tests':_0x3bd453,'agent':{'project':_0x4f50ef['projectName'],'name':_0x4f50ef['agentName'],'site':_0x1ea8c9},'timestamp':new Date(_0xaa2fd5)[_0x355998(0x1b8)]()};if(_0x12ae1d!=='table'||_0x1564ac){const _0x5e0ef1=formatResults(_0x294122,_0x12ae1d);if(_0x1564ac)try{a5_0x2d7196[_0x355998(0x200)](_0x1564ac,_0x5e0ef1,_0x355998(0x1a8)),console[_0x355998(0x1cf)](),console[_0x355998(0x1cf)](a5_0x214f8d[_0x355998(0x1f7)](_0x355998(0x1d2)+_0x1564ac));}catch(_0x50ff76){return console['log'](),console['log'](a5_0x214f8d['red'](_0x355998(0x1bf)+_0x50ff76)),0x1;}else console[_0x355998(0x1cf)](),console[_0x355998(0x1cf)](_0x5e0ef1);}const _0x3d9729=_0x3bd453['filter'](_0x20d438=>_0x20d438[_0x355998(0x1e6)]!==_0x355998(0x1e7));return _0x3d9729['length']>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0x2b2139=a5_0x39d4;function a5_0x39d4(_0x36d2cf,_0x16bdc6){_0x36d2cf=_0x36d2cf-0xb8;const _0x4f2cc2=a5_0x4f2c();let _0x39d4d4=_0x4f2cc2[_0x36d2cf];return _0x39d4d4;}(function(_0x1e3d1f,_0x4b7e5d){const _0x2d5e3f=a5_0x39d4,_0x5c1d50=_0x1e3d1f();while(!![]){try{const _0x88a8d=-parseInt(_0x2d5e3f(0xfe))/0x1*(-parseInt(_0x2d5e3f(0xe6))/0x2)+-parseInt(_0x2d5e3f(0x11d))/0x3*(parseInt(_0x2d5e3f(0x10f))/0x4)+-parseInt(_0x2d5e3f(0xc1))/0x5*(parseInt(_0x2d5e3f(0xe1))/0x6)+-parseInt(_0x2d5e3f(0xf1))/0x7*(-parseInt(_0x2d5e3f(0xc0))/0x8)+-parseInt(_0x2d5e3f(0xc4))/0x9*(parseInt(_0x2d5e3f(0x134))/0xa)+parseInt(_0x2d5e3f(0x10a))/0xb+-parseInt(_0x2d5e3f(0x13e))/0xc*(-parseInt(_0x2d5e3f(0xdb))/0xd);if(_0x88a8d===_0x4b7e5d)break;else _0x5c1d50['push'](_0x5c1d50['shift']());}catch(_0x4ca83e){_0x5c1d50['push'](_0x5c1d50['shift']());}}}(a5_0x4f2c,0x54cdc));import*as a5_0x300f72 from'node:fs';import*as a5_0x1da603 from'node:path';import a5_0x37fb0b from'chalk';function a5_0x4f2c(){const _0x4c9134=['Running\x20agent\x20tests...','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','reason','status','Duration:\x20','join','...','jsonl','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','log','3730454QrjuwD','Error:\x20No\x20previous\x20test\x20run\x20found.','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','Errors:\x20\x20\x20','Using\x20agent:\x20','404','108KmdlEi','\x20\x20Agent:\x20','tsv','json','start','14eqibyD','filter','\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)','timestamp','resolveAgentId','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','Round\x20','message','stop','llm','Total:\x20\x20\x20\x20','7742zLFRDJ','\x20\x20Conversation:\x20','substring','writeFileSync','Site:\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','trim','conversation_url','✓\x20PASS:\x20','\x20\x20Site:\x20','round','cyan','\x20(new)','86429KBvJvv','map','Cached\x20run\x20is\x20from\x20site\x20\x22','tests','✗\x20FAIL:\x20','Failed:\x20\x20\x20','reeval','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','push','\x20\x20Evaluating...\x20','PASS','isSpinning','5684305RxSUOn','Evaluating\x20response...','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','text','conversations','16NpOfqT','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','\x20-\x20','agentName','Run\x20\x27tdx\x20agent\x20pull\x20','Either\x20switch\x20to\x20the\x20\x22','Test\x20','Test\x20Summary','Re-evaluating\x20cached\x20test\x20run...','no_tests','existsSync','FAIL','Re-evaluating\x20','output','308973jBxmIJ','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','toISOString','white','has','basename','...\x20','Available\x20tests:\x20','includes','testName','yellow','resolve','\x22:\x20','now','dryRun','rounds','verbose','\x20\x20Project:\x20','Running\x20test:\x20','found','dim','table','Usage:','100fqszgM','not\x20found','\x20(cached)','length','\x20\x20-\x20','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','Tests\x20found:\x20','utf-8','Running:\x20','projectDir','12jyRIKW','ERROR','source','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','Round\x201/','llmProject','\x27\x20to\x20create\x20the\x20folder\x20structure.','execute','Error\x20writing\x20output\x20file:\x20','\x20\x20Round\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','green','Cached\x20run\x20from:\x20','agentDirs','context','split','agent','multiple_agents','no_local_folder',':\x20Sending\x20user\x20input...','928dWLryY','40645jkWiPP','red','site','568233wCPghV','repeat','projectName','Executing\x20new\x20tests...','Conversation\x20URL:\x20','Passed:\x20\x20\x20','New\x20tests\x20to\x20execute:\x20','no_context','Re-evaluation\x20Summary','Run\x20tests\x20for\x20an\x20LLM\x20agent','eval','name','Output\x20written\x20to:\x20'];a5_0x4f2c=function(){return _0x4c9134;};return a5_0x4f2c();}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{['name']='agent:test';['description']=a5_0x2b2139(0xcd);async[a5_0x2b2139(0x145)](_0x453ff5){const _0x488ac3=a5_0x2b2139,{options:_0x14cdf4,args:_0x209cfb,tdx:_0x1c4d6d}=_0x453ff5,_0x4c29ad=_0x209cfb[0x0]||'.',_0x33df4d=_0x14cdf4[_0x488ac3(0x12b)],_0x31b79a=_0x14cdf4,_0x5d9600=_0x31b79a[_0x488ac3(0xce)]===![],_0x11f103=_0x31b79a[_0x488ac3(0x104)],_0x33db54=_0x31b79a[_0x488ac3(0xcf)],_0x15dcb3=_0x14cdf4[_0x488ac3(0xc3)],_0x257a65=_0x31b79a[_0x488ac3(0x11c)];if(_0x11f103&&_0x5d9600)return console[_0x488ac3(0xda)](a5_0x37fb0b[_0x488ac3(0xc2)](_0x488ac3(0x110))),0x1;let _0x1afa02=_0x488ac3(0x132);if(_0x31b79a[_0x488ac3(0xe4)])_0x1afa02='json';else{if(_0x31b79a[_0x488ac3(0xd8)])_0x1afa02='jsonl';else{if(_0x31b79a['tsv'])_0x1afa02=_0x488ac3(0xe3);else{if(_0x31b79a[_0x488ac3(0x132)])_0x1afa02=_0x488ac3(0x132);}}}const _0x281b01=_0x31b79a['llmProject'];let _0x3c518c=_0x4c29ad;const _0x19dc93=a5_0x300f72[_0x488ac3(0x119)](_0x4c29ad),_0x3319bf=_0x4c29ad==='.';if(!_0x19dc93||_0x3319bf){const _0x31f38a=resolveProjectFromContext(_0x4c29ad,_0x281b01,{'requireFile':'test.yml'});if(_0x31f38a[_0x488ac3(0x130)])_0x3c518c=_0x31f38a[_0x488ac3(0x13d)],_0x31f38a[_0x488ac3(0x140)]===_0x488ac3(0xba)&&console[_0x488ac3(0xda)](a5_0x37fb0b[_0x488ac3(0x131)](_0x488ac3(0xdf)+_0x3c518c));else switch(_0x31f38a['reason']){case _0x488ac3(0xcb):console[_0x488ac3(0xda)](a5_0x37fb0b[_0x488ac3(0x127)](_0x31f38a[_0x488ac3(0xed)])),console[_0x488ac3(0xda)](),console[_0x488ac3(0xda)](_0x488ac3(0x133)),console[_0x488ac3(0xda)]('\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path'),console[_0x488ac3(0xda)](_0x488ac3(0xe8)),console['log'](),console[_0x488ac3(0xda)]('Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>');return 0x1;case _0x488ac3(0xbe):console[_0x488ac3(0xda)](a5_0x37fb0b['yellow'](_0x31f38a['message'])),console[_0x488ac3(0xda)](),console[_0x488ac3(0xda)](_0x488ac3(0x113)+_0x31f38a[_0x488ac3(0x143)]+_0x488ac3(0x144));return 0x1;case _0x488ac3(0xbd):{const _0x5a88b6=a5_0x1da603[_0x488ac3(0x122)](_0x31f38a[_0x488ac3(0x13d)]);console[_0x488ac3(0xda)](a5_0x37fb0b[_0x488ac3(0x127)](_0x488ac3(0xd2)+_0x31f38a[_0x488ac3(0x143)]+'\x22:'));for(const _0x521e41 of _0x31f38a[_0x488ac3(0xb9)]){console[_0x488ac3(0xda)](_0x488ac3(0x138)+_0x521e41);}return console['log'](),console[_0x488ac3(0xda)](_0x488ac3(0x139)+_0x5a88b6+'/<agent-name>'),0x1;}case _0x488ac3(0x118):console[_0x488ac3(0xda)](a5_0x37fb0b[_0x488ac3(0x127)](_0x488ac3(0x11e)+_0x31f38a[_0x488ac3(0x143)]+'\x22.')),console[_0x488ac3(0xda)](a5_0x37fb0b[_0x488ac3(0x131)]('Project\x20path:\x20'+_0x31f38a[_0x488ac3(0x13d)])),console['log'](),console[_0x488ac3(0xda)](_0x488ac3(0xd9));return 0x1;}}const {definition:_0x3a4480,agentInfo:_0x2b09c4}=parseTestFile(_0x3c518c);let _0x34f2a3=_0x3a4480['tests'];if(_0x33db54){const _0x43c949=_0x33db54[_0x488ac3(0xbb)](',')[_0x488ac3(0xff)](_0x5f0b65=>_0x5f0b65[_0x488ac3(0xf7)]());_0x34f2a3=_0x3a4480[_0x488ac3(0x101)][_0x488ac3(0xe7)](_0x5ac972=>_0x43c949[_0x488ac3(0x125)](_0x5ac972['name']));if(_0x34f2a3['length']===0x0)return console['log'](a5_0x37fb0b[_0x488ac3(0x127)]('No\x20tests\x20found\x20matching:\x20'+_0x33db54)),console[_0x488ac3(0xda)](a5_0x37fb0b[_0x488ac3(0x131)](_0x488ac3(0x124)+_0x3a4480[_0x488ac3(0x101)][_0x488ac3(0xff)](_0x2571e9=>_0x2571e9['name'])[_0x488ac3(0xd6)](',\x20'))),0x1;}if(_0x11f103)return this['executeReeval'](_0x453ff5,{'definition':{'tests':_0x34f2a3},'agentInfo':_0x2b09c4,'outputFormat':_0x1afa02,'outputFile':_0x257a65,'testNames':_0x33db54});if(_0x33df4d){console[_0x488ac3(0xda)](a5_0x37fb0b[_0x488ac3(0xfc)]('Test\x20Configuration:')),console[_0x488ac3(0xda)](_0x488ac3(0xfa)+a5_0x37fb0b[_0x488ac3(0x120)](_0x15dcb3)),console[_0x488ac3(0xda)](_0x488ac3(0x12e)+a5_0x37fb0b[_0x488ac3(0x120)](_0x2b09c4[_0x488ac3(0xc6)])),console[_0x488ac3(0xda)](_0x488ac3(0xe2)+a5_0x37fb0b[_0x488ac3(0x120)](_0x2b09c4['agentName'])),console[_0x488ac3(0xda)](),console[_0x488ac3(0xda)](_0x488ac3(0x13a)+a5_0x37fb0b['white'](_0x34f2a3[_0x488ac3(0x137)]));for(let _0x44ba51=0x0;_0x44ba51<_0x34f2a3['length'];_0x44ba51++){const _0x325e05=_0x34f2a3[_0x44ba51],_0x1dbb15=_0x325e05[_0x488ac3(0x12c)][_0x488ac3(0x137)]===0x1?_0x488ac3(0xfb):'rounds';console[_0x488ac3(0xda)]('\x20\x20'+(_0x44ba51+0x1)+'.\x20'+a5_0x37fb0b['white'](_0x325e05[_0x488ac3(0xcf)])+'\x20('+_0x325e05['rounds'][_0x488ac3(0x137)]+'\x20'+_0x1dbb15+')');}return 0x0;}let _0x7d9995,_0xbdfe14;try{_0x7d9995=await _0x1c4d6d[_0x488ac3(0xef)]['resolveProjectId'](_0x2b09c4[_0x488ac3(0xc6)]);}catch(_0x1d9965){const _0x59fa0d=_0x1d9965 instanceof Error?_0x1d9965[_0x488ac3(0xed)]:String(_0x1d9965);return _0x59fa0d['includes'](_0x488ac3(0xe0))||_0x59fa0d['toLowerCase']()['includes'](_0x488ac3(0x135))?console[_0x488ac3(0xda)](a5_0x37fb0b[_0x488ac3(0xc2)](_0x488ac3(0x148)+_0x2b09c4['projectName'])):console[_0x488ac3(0xda)](a5_0x37fb0b['red'](_0x488ac3(0xdd)+_0x2b09c4[_0x488ac3(0xc6)]+_0x488ac3(0x129)+_0x59fa0d)),0x1;}try{_0xbdfe14=await _0x1c4d6d[_0x488ac3(0xef)][_0x488ac3(0xea)](_0x2b09c4['agentName'],_0x7d9995);}catch(_0x427644){const _0x54abe0=_0x427644 instanceof Error?_0x427644[_0x488ac3(0xed)]:String(_0x427644);return _0x54abe0['includes']('404')||_0x54abe0['toLowerCase']()['includes'](_0x488ac3(0x135))?console['log'](a5_0x37fb0b[_0x488ac3(0xc2)](_0x488ac3(0xeb)+_0x2b09c4[_0x488ac3(0x112)])):console[_0x488ac3(0xda)](a5_0x37fb0b[_0x488ac3(0xc2)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x2b09c4['agentName']+_0x488ac3(0x129)+_0x54abe0)),0x1;}let _0x3d5793;if(!_0x5d9600)try{_0x3d5793=await setupEvaluatorAgent(_0x1c4d6d['llm'],_0x14cdf4[_0x488ac3(0x12d)]);}catch(_0x36c993){const _0x2100d9=_0x36c993 instanceof Error?_0x36c993['message']:String(_0x36c993);return console[_0x488ac3(0xda)](a5_0x37fb0b[_0x488ac3(0xc2)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x2100d9)),0x1;}console[_0x488ac3(0xda)](a5_0x37fb0b[_0x488ac3(0xfc)](_0x488ac3(0xd1))),console[_0x488ac3(0xda)](_0x488ac3(0xf5)+a5_0x37fb0b[_0x488ac3(0x120)](_0x15dcb3)),console[_0x488ac3(0xda)]('Agent:\x20'+a5_0x37fb0b['white'](_0x2b09c4['projectName']+'/'+_0x2b09c4[_0x488ac3(0x112)])),console[_0x488ac3(0xda)]();const _0x42eb1f=[],_0x5c3649=[],_0x2ced28=Date[_0x488ac3(0x12a)]();for(let _0x25364e=0x0;_0x25364e<_0x34f2a3[_0x488ac3(0x137)];_0x25364e++){const _0x3af0d7=_0x34f2a3[_0x25364e];_0x34f2a3[_0x488ac3(0x137)]>0x1?console[_0x488ac3(0xda)](_0x488ac3(0x115)+(_0x25364e+0x1)+'/'+_0x34f2a3[_0x488ac3(0x137)]+':\x20'+a5_0x37fb0b['white'](_0x3af0d7[_0x488ac3(0xcf)])):console[_0x488ac3(0xda)](_0x488ac3(0x12f)+a5_0x37fb0b[_0x488ac3(0x120)](_0x3af0d7['name']));const _0x1c258b=createCommandSpinner(_0x488ac3(0x142)+_0x3af0d7[_0x488ac3(0x12c)][_0x488ac3(0x137)]+_0x488ac3(0xbf));_0x1c258b[_0x488ac3(0xe5)]();try{const {result:_0x22c218,conversation:_0xca379}=await runTest(_0x1c4d6d['llm'],_0x3af0d7,{'agentId':_0xbdfe14,'projectId':_0x7d9995,'site':_0x15dcb3,'noEval':_0x5d9600,'evaluatorId':_0x3d5793,'onRoundStart':(_0x4761b3,_0x4cba0b)=>{const _0x356dec=_0x488ac3;_0x1c258b['text']=_0x356dec(0xec)+(_0x4761b3+0x1)+'/'+_0x4cba0b+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x5f55ec,_0x289cc6,_0x209d92)=>{const _0x48ded0=_0x488ac3,_0x916751=formatElapsed(_0x289cc6);_0x209d92?console['log'](_0x48ded0(0x147)+(_0x5f55ec+0x1)+'/'+_0x3af0d7['rounds'][_0x48ded0(0x137)]+_0x48ded0(0x123)+a5_0x37fb0b['green']('✓')+'\x20('+_0x916751+')'):console[_0x48ded0(0xda)]('\x20\x20Round\x20'+(_0x5f55ec+0x1)+'/'+_0x3af0d7[_0x48ded0(0x12c)][_0x48ded0(0x137)]+_0x48ded0(0x123)+a5_0x37fb0b[_0x48ded0(0xc2)]('✗'));},'onEvaluationStart':()=>{const _0x26894f=_0x488ac3;_0x1c258b['text']=_0x26894f(0x10b);},'onEvaluationComplete':_0x1a825d=>{const _0x33c359=_0x488ac3,_0x3dc06e=formatElapsed(_0x1a825d);console[_0x33c359(0xda)](_0x33c359(0x107)+a5_0x37fb0b[_0x33c359(0x149)]('✓')+'\x20('+_0x3dc06e+')');}});_0x1c258b[_0x488ac3(0xee)](),_0x42eb1f[_0x488ac3(0x106)](_0x22c218),_0x5c3649[_0x488ac3(0x106)](_0xca379);if(_0x22c218[_0x488ac3(0xd4)]===_0x488ac3(0x108))console[_0x488ac3(0xda)](a5_0x37fb0b[_0x488ac3(0x149)](_0x488ac3(0xf9)+_0x22c218['reason']));else _0x22c218['status']===_0x488ac3(0x11a)?console[_0x488ac3(0xda)](a5_0x37fb0b[_0x488ac3(0xc2)]('✗\x20FAIL:\x20'+_0x22c218[_0x488ac3(0xd3)])):console[_0x488ac3(0xda)](a5_0x37fb0b[_0x488ac3(0xc2)]('✗\x20ERROR:\x20'+_0x22c218['reason']));_0x22c218[_0x488ac3(0xf8)]&&console[_0x488ac3(0xda)](a5_0x37fb0b[_0x488ac3(0x131)](_0x488ac3(0xc8)+_0x22c218[_0x488ac3(0xf8)])),console[_0x488ac3(0xda)]();}catch(_0x38e291){_0x1c258b[_0x488ac3(0xee)]();const _0x453cc4=_0x38e291 instanceof Error?_0x38e291[_0x488ac3(0xed)]:String(_0x38e291);console[_0x488ac3(0xda)](a5_0x37fb0b[_0x488ac3(0xc2)]('✗\x20ERROR:\x20'+_0x453cc4)),console[_0x488ac3(0xda)](),_0x42eb1f[_0x488ac3(0x106)]({'name':_0x3af0d7[_0x488ac3(0xcf)],'status':'ERROR','reason':_0x453cc4,'timestamp':new Date()[_0x488ac3(0x11f)](),'duration_ms':0x0});}}const _0x11a1d3=Date['now']()-_0x2ced28,_0x2455a7=_0x42eb1f[_0x488ac3(0xe7)](_0x4715bb=>_0x4715bb[_0x488ac3(0xd4)]===_0x488ac3(0x108))[_0x488ac3(0x137)],_0x1381a5=_0x42eb1f[_0x488ac3(0xe7)](_0x5144f7=>_0x5144f7[_0x488ac3(0xd4)]==='FAIL')[_0x488ac3(0x137)],_0x3e5e0a=_0x42eb1f[_0x488ac3(0xe7)](_0x1fa238=>_0x1fa238['status']===_0x488ac3(0x13f))[_0x488ac3(0x137)];console[_0x488ac3(0xda)]('━'[_0x488ac3(0xc5)](0x3c)),console[_0x488ac3(0xda)](_0x488ac3(0x116)),console[_0x488ac3(0xda)]('━'[_0x488ac3(0xc5)](0x3c)),console[_0x488ac3(0xda)](_0x488ac3(0xf0)+_0x42eb1f[_0x488ac3(0x137)]),console[_0x488ac3(0xda)](_0x488ac3(0xc9)+a5_0x37fb0b[_0x488ac3(0x149)](_0x2455a7)),console[_0x488ac3(0xda)]('Failed:\x20\x20\x20'+a5_0x37fb0b[_0x488ac3(0xc2)](_0x1381a5));_0x3e5e0a>0x0&&console[_0x488ac3(0xda)](_0x488ac3(0xde)+a5_0x37fb0b[_0x488ac3(0xc2)](_0x3e5e0a));console[_0x488ac3(0xda)](_0x488ac3(0xd5)+formatElapsed(_0x11a1d3)),console[_0x488ac3(0xda)]('━'['repeat'](0x3c));const _0x5def20=_0x42eb1f[_0x488ac3(0xe7)](_0x4ed020=>_0x4ed020[_0x488ac3(0xd4)]!==_0x488ac3(0x108));if(_0x5def20[_0x488ac3(0x137)]>0x0){console[_0x488ac3(0xda)](),console[_0x488ac3(0xda)]('Failed\x20Tests:');for(const _0x4e1419 of _0x5def20){const _0x320cf9=a5_0x37fb0b[_0x488ac3(0xc2)]('✗'),_0x5c5243=_0x4e1419[_0x488ac3(0xd3)]['length']>0x32?_0x4e1419[_0x488ac3(0xd3)][_0x488ac3(0xf3)](0x0,0x32)+_0x488ac3(0xd7):_0x4e1419[_0x488ac3(0xd3)];console['log']('\x20\x20'+_0x320cf9+'\x20'+_0x4e1419[_0x488ac3(0xcf)]+':\x20'+_0x5c5243);}}const _0x600812={'summary':{'total':_0x42eb1f[_0x488ac3(0x137)],'passed':_0x2455a7,'failed':_0x1381a5,'errors':_0x3e5e0a>0x0?_0x3e5e0a:undefined,'duration_ms':_0x11a1d3},'tests':_0x42eb1f,'agent':{'project':_0x2b09c4[_0x488ac3(0xc6)],'name':_0x2b09c4[_0x488ac3(0x112)],'site':_0x15dcb3},'timestamp':new Date(_0x2ced28)['toISOString']()};try{const _0x580cca=buildCachedTestRun(_0x5c3649,{'site':_0x15dcb3,'projectId':_0x7d9995,'projectName':_0x2b09c4['projectName'],'agentId':_0xbdfe14,'agentName':_0x2b09c4[_0x488ac3(0x112)],'testYmlPath':a5_0x1da603[_0x488ac3(0x128)](_0x2b09c4['testYmlPath'])});saveLastTestRun(_0x580cca);}catch{}if(_0x1afa02!==_0x488ac3(0x132)||_0x257a65){const _0x530858=formatResults(_0x600812,_0x1afa02);if(_0x257a65)try{a5_0x300f72[_0x488ac3(0xf4)](_0x257a65,_0x530858,'utf-8'),console[_0x488ac3(0xda)](),console['log'](a5_0x37fb0b[_0x488ac3(0x131)](_0x488ac3(0xd0)+_0x257a65));}catch(_0x20ef33){return console['log'](),console[_0x488ac3(0xda)](a5_0x37fb0b[_0x488ac3(0xc2)]('Error\x20writing\x20output\x20file:\x20'+_0x20ef33)),0x1;}else console[_0x488ac3(0xda)](),console[_0x488ac3(0xda)](_0x530858);}return _0x5def20[_0x488ac3(0x137)]>0x0?0x1:0x0;}async['executeReeval'](_0x31184f,_0x3fbe4a){const _0x343e2a=a5_0x2b2139,{options:_0x5ce50c,tdx:_0x102d6b}=_0x31184f,{definition:_0x1b5fdc,agentInfo:_0x4f0025,outputFormat:_0x10831d,outputFile:_0x585e50}=_0x3fbe4a,_0x37fb24=_0x5ce50c[_0x343e2a(0xc3)],_0x599ac4=loadLastTestRun();if(!_0x599ac4)return console[_0x343e2a(0xda)](a5_0x37fb0b[_0x343e2a(0xc2)](_0x343e2a(0xdc))),console['log'](a5_0x37fb0b['dim'](_0x343e2a(0x105))),0x1;if(_0x599ac4[_0x343e2a(0xbc)][_0x343e2a(0x112)]!==_0x4f0025[_0x343e2a(0x112)])return console['log'](a5_0x37fb0b['red'](_0x343e2a(0x141)+_0x599ac4[_0x343e2a(0xbc)][_0x343e2a(0x112)]+_0x343e2a(0x10c)+_0x4f0025[_0x343e2a(0x112)]+'\x22.')),console[_0x343e2a(0xda)](a5_0x37fb0b['dim']('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x56217a=new Set(_0x599ac4[_0x343e2a(0x10e)][_0x343e2a(0xff)](_0x15216b=>_0x15216b[_0x343e2a(0x126)])),_0x2e03d2=_0x1b5fdc[_0x343e2a(0x101)]['filter'](_0x4037cb=>!_0x56217a[_0x343e2a(0x121)](_0x4037cb[_0x343e2a(0xcf)]));if(_0x2e03d2[_0x343e2a(0x137)]>0x0&&_0x599ac4[_0x343e2a(0xc3)]!==_0x37fb24)return console[_0x343e2a(0xda)](a5_0x37fb0b[_0x343e2a(0xc2)](_0x343e2a(0xf6))),console[_0x343e2a(0xda)](a5_0x37fb0b[_0x343e2a(0x131)](_0x343e2a(0x100)+_0x599ac4['site']+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x37fb24+'\x22.')),console['log'](a5_0x37fb0b[_0x343e2a(0x131)](_0x343e2a(0x114)+_0x599ac4['site']+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x2626d9=_0x1b5fdc['tests']['filter'](_0x3ed01a=>_0x56217a[_0x343e2a(0x121)](_0x3ed01a['name'])),_0x47fcc0=_0x2e03d2;let _0xb852b6;try{_0xb852b6=await setupEvaluatorAgent(_0x102d6b[_0x343e2a(0xef)],_0x5ce50c[_0x343e2a(0x12d)]);}catch(_0x163c2e){const _0x4a8ad2=_0x163c2e instanceof Error?_0x163c2e['message']:String(_0x163c2e);return console[_0x343e2a(0xda)](a5_0x37fb0b[_0x343e2a(0xc2)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x4a8ad2)),0x1;}console['log'](a5_0x37fb0b['cyan'](_0x343e2a(0x117))),console['log'](_0x343e2a(0xb8)+a5_0x37fb0b[_0x343e2a(0x120)](_0x599ac4[_0x343e2a(0xe9)])),console[_0x343e2a(0xda)]('Agent:\x20'+a5_0x37fb0b['white'](_0x599ac4['agent'][_0x343e2a(0xc6)]+'/'+_0x599ac4['agent'][_0x343e2a(0x112)]));_0x47fcc0[_0x343e2a(0x137)]>0x0&&console[_0x343e2a(0xda)](_0x343e2a(0xca)+a5_0x37fb0b['yellow'](_0x47fcc0['length']));console[_0x343e2a(0xda)]();const _0x15c7ab=[],_0x167a7a=Date[_0x343e2a(0x12a)](),_0x558b9f=createCommandSpinner('Re-evaluating...');if(_0x2626d9[_0x343e2a(0x137)]>0x0)try{const _0x1cf683=await reevaluateFromCache(_0x102d6b[_0x343e2a(0xef)],_0x599ac4,{'tests':_0x2626d9},{'evaluatorId':_0xb852b6,'onTestStart':(_0xa863d9,_0x3c89d1,_0x4ea14b)=>{const _0x433a46=_0x343e2a;_0x558b9f[_0x433a46(0x10d)]=_0x433a46(0x11b)+(_0x3c89d1+0x1)+'/'+_0x4ea14b+':\x20'+_0xa863d9+_0x433a46(0xd7);if(!_0x558b9f[_0x433a46(0x109)])_0x558b9f['start']();},'onTestComplete':(_0x67b6b3,_0x2b71a5)=>{const _0x11b1ed=_0x343e2a;_0x558b9f['stop']();if(_0x2b71a5['status']===_0x11b1ed(0x108))console[_0x11b1ed(0xda)](a5_0x37fb0b['green'](_0x11b1ed(0xf9)+_0x67b6b3)+a5_0x37fb0b[_0x11b1ed(0x131)](_0x11b1ed(0x136)));else _0x2b71a5[_0x11b1ed(0xd4)]===_0x11b1ed(0x11a)?console[_0x11b1ed(0xda)](a5_0x37fb0b[_0x11b1ed(0xc2)](_0x11b1ed(0x102)+_0x67b6b3+_0x11b1ed(0x111)+_0x2b71a5[_0x11b1ed(0xd3)])+a5_0x37fb0b[_0x11b1ed(0x131)]('\x20(cached)')):console['log'](a5_0x37fb0b[_0x11b1ed(0xc2)]('✗\x20ERROR:\x20'+_0x67b6b3+_0x11b1ed(0x111)+_0x2b71a5[_0x11b1ed(0xd3)]));_0x2b71a5[_0x11b1ed(0xf8)]&&console[_0x11b1ed(0xda)](a5_0x37fb0b[_0x11b1ed(0x131)](_0x11b1ed(0xf2)+_0x2b71a5[_0x11b1ed(0xf8)])),_0x15c7ab['push'](_0x2b71a5);},'onTestSkipped':(_0x5b7635,_0x4ce81c)=>{const _0x5f1efd=_0x343e2a;_0x558b9f[_0x5f1efd(0xee)](),console[_0x5f1efd(0xda)](a5_0x37fb0b[_0x5f1efd(0x127)]('⚠\x20SKIPPED:\x20'+_0x5b7635+_0x5f1efd(0x111)+_0x4ce81c));}});for(const _0x5b8fb5 of _0x1cf683){!_0x15c7ab['find'](_0x3a222a=>_0x3a222a[_0x343e2a(0xcf)]===_0x5b8fb5['name'])&&_0x15c7ab[_0x343e2a(0x106)](_0x5b8fb5);}}catch(_0x4ac911){_0x558b9f['stop']();const _0x4a6ec7=_0x4ac911 instanceof Error?_0x4ac911[_0x343e2a(0xed)]:String(_0x4ac911);return console['log'](a5_0x37fb0b['red']('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0x4a6ec7)),0x1;}_0x558b9f[_0x343e2a(0xee)]();if(_0x47fcc0[_0x343e2a(0x137)]>0x0){console[_0x343e2a(0xda)](),console[_0x343e2a(0xda)](a5_0x37fb0b[_0x343e2a(0xfc)](_0x343e2a(0xc7)));const {projectId:_0x26d8ae,agentId:_0x3c2b2f}=_0x599ac4[_0x343e2a(0xbc)];for(const _0x410f80 of _0x47fcc0){console[_0x343e2a(0xda)](_0x343e2a(0x13c)+a5_0x37fb0b[_0x343e2a(0x120)](_0x410f80[_0x343e2a(0xcf)]));const _0x5d7b3d=createCommandSpinner('Round\x201/'+_0x410f80[_0x343e2a(0x12c)][_0x343e2a(0x137)]+_0x343e2a(0xbf));_0x5d7b3d[_0x343e2a(0xe5)]();try{const {result:_0x53f0d9}=await runTest(_0x102d6b[_0x343e2a(0xef)],_0x410f80,{'agentId':_0x3c2b2f,'projectId':_0x26d8ae,'site':_0x599ac4[_0x343e2a(0xc3)],'noEval':![],'evaluatorId':_0xb852b6,'onRoundStart':(_0xde31a2,_0x2c99f7)=>{const _0xdabae9=_0x343e2a;_0x5d7b3d[_0xdabae9(0x10d)]=_0xdabae9(0xec)+(_0xde31a2+0x1)+'/'+_0x2c99f7+_0xdabae9(0xbf);},'onRoundComplete':(_0x548993,_0x115bf2,_0x515ecc)=>{const _0x4f6fef=_0x343e2a,_0x26a6fe=formatElapsed(_0x115bf2);_0x515ecc?console[_0x4f6fef(0xda)](_0x4f6fef(0x147)+(_0x548993+0x1)+'/'+_0x410f80['rounds']['length']+_0x4f6fef(0x123)+a5_0x37fb0b['green']('✓')+'\x20('+_0x26a6fe+')'):console[_0x4f6fef(0xda)](_0x4f6fef(0x147)+(_0x548993+0x1)+'/'+_0x410f80[_0x4f6fef(0x12c)][_0x4f6fef(0x137)]+_0x4f6fef(0x123)+a5_0x37fb0b[_0x4f6fef(0xc2)]('✗'));},'onEvaluationStart':()=>{const _0x5d887a=_0x343e2a;_0x5d7b3d[_0x5d887a(0x10d)]=_0x5d887a(0x10b);},'onEvaluationComplete':_0x242402=>{const _0x168712=_0x343e2a,_0x3d7e6c=formatElapsed(_0x242402);console[_0x168712(0xda)](_0x168712(0x107)+a5_0x37fb0b[_0x168712(0x149)]('✓')+'\x20('+_0x3d7e6c+')');}});_0x5d7b3d[_0x343e2a(0xee)](),_0x15c7ab[_0x343e2a(0x106)](_0x53f0d9);if(_0x53f0d9[_0x343e2a(0xd4)]==='PASS')console['log'](a5_0x37fb0b[_0x343e2a(0x149)](_0x343e2a(0xf9)+_0x53f0d9[_0x343e2a(0xd3)])+a5_0x37fb0b[_0x343e2a(0x131)]('\x20(new)'));else _0x53f0d9[_0x343e2a(0xd4)]==='FAIL'?console['log'](a5_0x37fb0b[_0x343e2a(0xc2)](_0x343e2a(0x102)+_0x53f0d9['reason'])+a5_0x37fb0b[_0x343e2a(0x131)](_0x343e2a(0xfd))):console['log'](a5_0x37fb0b['red']('✗\x20ERROR:\x20'+_0x53f0d9[_0x343e2a(0xd3)]));_0x53f0d9[_0x343e2a(0xf8)]&&console[_0x343e2a(0xda)](a5_0x37fb0b['dim'](_0x343e2a(0xf2)+_0x53f0d9[_0x343e2a(0xf8)]));}catch(_0x37ed96){_0x5d7b3d['stop']();const _0x22c57d=_0x37ed96 instanceof Error?_0x37ed96[_0x343e2a(0xed)]:String(_0x37ed96);console['log'](a5_0x37fb0b[_0x343e2a(0xc2)]('✗\x20ERROR:\x20'+_0x22c57d)),_0x15c7ab[_0x343e2a(0x106)]({'name':_0x410f80[_0x343e2a(0xcf)],'status':_0x343e2a(0x13f),'reason':_0x22c57d,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console['log']();const _0x42fbd0=Date[_0x343e2a(0x12a)]()-_0x167a7a,_0x57ece6=_0x15c7ab['filter'](_0x2d888f=>_0x2d888f['status']===_0x343e2a(0x108))[_0x343e2a(0x137)],_0x3f1b90=_0x15c7ab[_0x343e2a(0xe7)](_0x416d8d=>_0x416d8d[_0x343e2a(0xd4)]===_0x343e2a(0x11a))[_0x343e2a(0x137)],_0x184d8e=_0x15c7ab[_0x343e2a(0xe7)](_0x431813=>_0x431813[_0x343e2a(0xd4)]===_0x343e2a(0x13f))[_0x343e2a(0x137)];console[_0x343e2a(0xda)]('━'['repeat'](0x3c)),console['log'](_0x343e2a(0xcc)),console[_0x343e2a(0xda)]('━'[_0x343e2a(0xc5)](0x3c)),console[_0x343e2a(0xda)](_0x343e2a(0xf0)+_0x15c7ab['length']),console[_0x343e2a(0xda)]('Passed:\x20\x20\x20'+a5_0x37fb0b[_0x343e2a(0x149)](_0x57ece6)),console[_0x343e2a(0xda)](_0x343e2a(0x103)+a5_0x37fb0b[_0x343e2a(0xc2)](_0x3f1b90));_0x184d8e>0x0&&console[_0x343e2a(0xda)]('Errors:\x20\x20\x20'+a5_0x37fb0b[_0x343e2a(0xc2)](_0x184d8e));console[_0x343e2a(0xda)](_0x343e2a(0xd5)+formatElapsed(_0x42fbd0)),console['log']('━'['repeat'](0x3c));const _0xbc157c={'summary':{'total':_0x15c7ab['length'],'passed':_0x57ece6,'failed':_0x3f1b90,'errors':_0x184d8e>0x0?_0x184d8e:undefined,'duration_ms':_0x42fbd0},'tests':_0x15c7ab,'agent':{'project':_0x4f0025[_0x343e2a(0xc6)],'name':_0x4f0025['agentName'],'site':_0x37fb24},'timestamp':new Date(_0x167a7a)[_0x343e2a(0x11f)]()};if(_0x10831d!==_0x343e2a(0x132)||_0x585e50){const _0x38020a=formatResults(_0xbc157c,_0x10831d);if(_0x585e50)try{a5_0x300f72[_0x343e2a(0xf4)](_0x585e50,_0x38020a,_0x343e2a(0x13b)),console[_0x343e2a(0xda)](),console[_0x343e2a(0xda)](a5_0x37fb0b[_0x343e2a(0x131)](_0x343e2a(0xd0)+_0x585e50));}catch(_0x47fe2c){return console[_0x343e2a(0xda)](),console[_0x343e2a(0xda)](a5_0x37fb0b[_0x343e2a(0xc2)](_0x343e2a(0x146)+_0x47fe2c)),0x1;}else console[_0x343e2a(0xda)](),console[_0x343e2a(0xda)](_0x38020a);}const _0x11e08d=_0x15c7ab[_0x343e2a(0xe7)](_0x44bedf=>_0x44bedf[_0x343e2a(0xd4)]!=='PASS');return _0x11e08d[_0x343e2a(0x137)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x137e00=a6_0x2597;(function(_0xc4f8b6,_0xa3b97f){const _0x7eb2e8=a6_0x2597,_0x1fe1f9=_0xc4f8b6();while(!![]){try{const _0x477316=-parseInt(_0x7eb2e8(0x1f4))/0x1*(parseInt(_0x7eb2e8(0x1e5))/0x2)+parseInt(_0x7eb2e8(0x1df))/0x3*(-parseInt(_0x7eb2e8(0x1f9))/0x4)+-parseInt(_0x7eb2e8(0x1ff))/0x5*(parseInt(_0x7eb2e8(0x1e8))/0x6)+parseInt(_0x7eb2e8(0x1c5))/0x7+-parseInt(_0x7eb2e8(0x1cb))/0x8*(-parseInt(_0x7eb2e8(0x1f2))/0x9)+parseInt(_0x7eb2e8(0x1fa))/0xa+parseInt(_0x7eb2e8(0x1f8))/0xb;if(_0x477316===_0xa3b97f)break;else _0x1fe1f9['push'](_0x1fe1f9['shift']());}catch(_0x3a0e0f){_0x1fe1f9['push'](_0x1fe1f9['shift']());}}}(a6_0x3abb,0x87a33));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';function a6_0x2597(_0x3c5705,_0x5431ab){_0x3c5705=_0x3c5705-0x1c3;const _0x3abbd2=a6_0x3abb();let _0x25970d=_0x3abbd2[_0x3c5705];return _0x25970d;}import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';function a6_0x3abb(){const _0x233d84=['x-xsrf-token','stack','substring','\x22.\x20','74394CvaMNP','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','197748sfZJfE','GET','<\x20HTTP/1.1\x20','x-trino-user','9384793MBvAWY','4AfVnly','9494040ATtSpK','includes','length','Invalid\x20header\x20format:\x20\x22','DELETE','154925ZPjCoq','x-auth-token','toLowerCase','join','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','status','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','type','trino','keys','message','POST','.\x20Valid\x20methods:\x20','readBodyFromFile','1679594SLVGna','cdp','method','startsWith','authorization','llm-proxy','136UOGAkV','log','cookie','verbose','trim','data','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','set-cookie','entries','proxy-authorization','.\x20Valid\x20types:\x20','file','headers','description','indexOf','output','header','Invalid\x20HTTP\x20method:\x20','\x0aStack\x20trace:\x0a','workflow','2337081ntPhnB','name','api','Error:\x20','toUpperCase','error','2nFhcli','has','isArray','126gMaNZq','llm','color','Results\x20saved\x20to\x20','PUT','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22'];a6_0x3abb=function(){return _0x233d84;};return a6_0x3abb();}const SENSITIVE_HEADERS=new Set([a6_0x137e00(0x1c9),a6_0x137e00(0x1d4),a6_0x137e00(0x1cd),a6_0x137e00(0x1d2),'set-cookie2',a6_0x137e00(0x1ee),a6_0x137e00(0x200),a6_0x137e00(0x1f7)]);function isSensitiveHeader(_0x540ee9){const _0xcd3126=a6_0x137e00;return SENSITIVE_HEADERS[_0xcd3126(0x1e6)](_0x540ee9[_0xcd3126(0x201)]());}function parseHeader(_0x14e0eb){const _0x5e1976=a6_0x137e00,_0x23f837=_0x14e0eb[_0x5e1976(0x1d9)](':');if(_0x23f837===-0x1)throw new Error(_0x5e1976(0x1fd)+_0x14e0eb+_0x5e1976(0x1f1)+_0x5e1976(0x1ed));const _0x19fa3c=_0x14e0eb[_0x5e1976(0x1f0)](0x0,_0x23f837)[_0x5e1976(0x1cf)](),_0x15edc6=_0x14e0eb[_0x5e1976(0x1f0)](_0x23f837+0x1)[_0x5e1976(0x1cf)]();if(!_0x19fa3c)throw new Error(_0x5e1976(0x1f3)+_0x14e0eb+'\x22');return[_0x19fa3c,_0x15edc6];}export class ApiCommand extends BaseCommand{[a6_0x137e00(0x1e0)]=a6_0x137e00(0x1e1);[a6_0x137e00(0x1d8)]=a6_0x137e00(0x1d1);['validate'](_0x250309){const _0x533e57=a6_0x137e00,{args:_0x3bb656,options:_0x3b818d}=_0x250309,_0x15b349=_0x3b818d;if(_0x3bb656[_0x533e57(0x1fc)]===0x0)return _0x533e57(0x203);const _0x14b964=_0x3bb656[0x0];if(!_0x14b964[_0x533e57(0x1c8)]('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x14b964;const _0x49c7c2=_0x15b349[_0x533e57(0x1d0)],_0x45f348=_0x15b349[_0x533e57(0x1d6)];if(_0x49c7c2&&_0x45f348)return _0x533e57(0x205);const _0x443cc2=_0x15b349[_0x533e57(0x1c7)]||'GET',_0x340aa6=[_0x533e57(0x1f5),_0x533e57(0x20a),_0x533e57(0x1ec),_0x533e57(0x1fe),'PATCH'];if(!_0x340aa6[_0x533e57(0x1fb)](_0x443cc2[_0x533e57(0x1e3)]()))return _0x533e57(0x1dc)+_0x443cc2+_0x533e57(0x1c3)+_0x340aa6[_0x533e57(0x202)](',\x20');const _0x34a98f=_0x15b349[_0x533e57(0x206)]||'td',_0x29c796=['td',_0x533e57(0x1c6),_0x533e57(0x1de),_0x533e57(0x207),_0x533e57(0x1e9),_0x533e57(0x1ca)];if(!_0x29c796[_0x533e57(0x1fb)](_0x34a98f))return'Invalid\x20API\x20type:\x20'+_0x34a98f+_0x533e57(0x1d5)+_0x29c796[_0x533e57(0x202)](',\x20');return undefined;}async['execute'](_0x487d4d){const _0x25cca5=a6_0x137e00,{options:_0x1a2b5b,args:_0x17336f,tdx:_0x194f7f}=_0x487d4d,_0x4c3d09=_0x1a2b5b,_0xccce2f=_0x17336f[0x0],_0x4d4b14=(_0x4c3d09[_0x25cca5(0x1c7)]||'GET')['toUpperCase'](),_0x4837c7=_0x4c3d09[_0x25cca5(0x1d0)],_0x41fb6e=_0x4c3d09[_0x25cca5(0x1d6)],_0x2ea822=_0x4c3d09[_0x25cca5(0x1db)],_0x34eb02=_0x4c3d09[_0x25cca5(0x206)]||'td';try{const _0x14a215={};if(_0x2ea822){const _0x4e550a=Array[_0x25cca5(0x1e7)](_0x2ea822)?_0x2ea822:[_0x2ea822];for(const _0x35ace3 of _0x4e550a){const [_0x8c509d,_0x43537c]=parseHeader(_0x35ace3);_0x14a215[_0x8c509d]=_0x43537c;}}let _0xc8ab6;if(_0x4837c7)_0xc8ab6=_0x4837c7;else{if(_0x41fb6e)try{_0xc8ab6=RawAPI[_0x25cca5(0x1c4)](_0x41fb6e);}catch(_0x2e5713){return console[_0x25cca5(0x1e4)](_0x25cca5(0x1e2)+(_0x2e5713 instanceof Error?_0x2e5713['message']:String(_0x2e5713))),0x1;}}const _0x552263={'method':_0x4d4b14,'apiType':_0x34eb02,'includeHeaders':_0x1a2b5b['verbose']};_0xc8ab6&&(_0x552263['body']=_0xc8ab6);Object[_0x25cca5(0x208)](_0x14a215)[_0x25cca5(0x1fc)]>0x0&&(_0x552263[_0x25cca5(0x1d7)]=_0x14a215);if(_0x1a2b5b[_0x25cca5(0x1ce)]){const _0x5a709e=resolveSite(_0x1a2b5b['site']),_0x19746e=getEndpoint(_0x5a709e,_0x34eb02),_0x54951f=''+_0x19746e+_0xccce2f;console[_0x25cca5(0x1e4)]('>\x20'+_0x4d4b14+'\x20'+_0x54951f);const _0x249102=getAuthHeaders(_0x5a709e),_0x249281={..._0x249102,..._0x14a215};for(const [_0xf20e9a,_0x501874]of Object[_0x25cca5(0x1d3)](_0x249281)){!isSensitiveHeader(_0xf20e9a)&&console[_0x25cca5(0x1e4)]('>\x20'+_0xf20e9a+':\x20'+_0x501874);}_0xc8ab6&&console[_0x25cca5(0x1e4)]('>'),console[_0x25cca5(0x1e4)]('');}const _0x292fcc=await _0x194f7f[_0x25cca5(0x1e1)]['request'](_0xccce2f,_0x552263);if(_0x1a2b5b[_0x25cca5(0x1ce)]&&_0x292fcc[_0x25cca5(0x1d7)]){console[_0x25cca5(0x1e4)](_0x25cca5(0x1f6)+_0x292fcc[_0x25cca5(0x204)]);for(const [_0xec1c1e,_0x4d70b3]of Object[_0x25cca5(0x1d3)](_0x292fcc[_0x25cca5(0x1d7)])){!isSensitiveHeader(_0xec1c1e)&&console[_0x25cca5(0x1e4)]('<\x20'+_0xec1c1e+':\x20'+_0x4d70b3);}console['error']('');}const _0x327340=Boolean(_0x1a2b5b['output']),_0x3b2208={'color':_0x1a2b5b[_0x25cca5(0x1ea)],'noColor':_0x1a2b5b['noColor']||_0x327340&&!_0x1a2b5b['color']},_0x2885f7=colorizeJSON(_0x292fcc[_0x25cca5(0x1d0)],_0x3b2208);return _0x1a2b5b['output']?(writeFileSync(_0x1a2b5b[_0x25cca5(0x1da)],_0x2885f7),console[_0x25cca5(0x1e4)](_0x25cca5(0x1eb)+_0x1a2b5b[_0x25cca5(0x1da)])):console[_0x25cca5(0x1cc)](_0x2885f7),0x0;}catch(_0x456890){return _0x456890 instanceof Error?(console[_0x25cca5(0x1e4)](_0x25cca5(0x1e2)+_0x456890[_0x25cca5(0x209)]),_0x1a2b5b[_0x25cca5(0x1ce)]&&_0x456890[_0x25cca5(0x1ef)]&&console[_0x25cca5(0x1e4)](_0x25cca5(0x1dd)+_0x456890[_0x25cca5(0x1ef)])):console[_0x25cca5(0x1e4)]('Error:\x20'+String(_0x456890)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a7_0x257d85=a7_0x25c9;(function(_0x8141a,_0x144f80){const _0x6f785c=a7_0x25c9,_0x1ddb6a=_0x8141a();while(!![]){try{const _0x52cf80=parseInt(_0x6f785c(0x139))/0x1*(parseInt(_0x6f785c(0x166))/0x2)+-parseInt(_0x6f785c(0x13b))/0x3+parseInt(_0x6f785c(0x176))/0x4*(parseInt(_0x6f785c(0x141))/0x5)+parseInt(_0x6f785c(0x143))/0x6*(-parseInt(_0x6f785c(0x146))/0x7)+-parseInt(_0x6f785c(0x142))/0x8+parseInt(_0x6f785c(0x159))/0x9*(-parseInt(_0x6f785c(0x152))/0xa)+parseInt(_0x6f785c(0x137))/0xb*(parseInt(_0x6f785c(0x175))/0xc);if(_0x52cf80===_0x144f80)break;else _0x1ddb6a['push'](_0x1ddb6a['shift']());}catch(_0x1a72d6){_0x1ddb6a['push'](_0x1ddb6a['shift']());}}}(a7_0x18d8,0xf0fcf));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_0x527ca0 from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';function a7_0x25c9(_0x301aae,_0xff7308){_0x301aae=_0x301aae-0x12d;const _0x18d84a=a7_0x18d8();let _0x25c947=_0x18d84a[_0x301aae];return _0x25c947;}import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a7_0x272ab0 from'chalk';function a7_0x18d8(){const _0x5964de=['\x20(profile:\x20','us01','description','join','tdx:\x20auth\x20clear','bold','2043kJXHRW','\x20(site:\x20','✓\x20Profile\x20\x27','✗\x20Validation\x20failed:\x20','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','create','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','No\x20API\x20key\x20found\x20in\x20keychain','last_name','password','Setting\x20up\x20authentication\x20for\x20site:\x20','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','getUserInfo','118tsuZLi','✓\x20Authentication\x20successful\x0a','Read\x20credential\x20from\x20','Enter\x20site\x20name:','N/A','\x0aSetup\x20cancelled','execute','No\x20credential\x20found','name','email','message','You\x20can\x20find\x20your\x20API\x20key\x20at:','status','apiKey','other','44728716dnhXWB','1437668saqrIp','\x20for\x20profile:\x20','\x20--profile\x20','✓\x20API\x20key\x20removed\x20from\x20keychain','Name:\x20','first_name','\x20\x20tdx','warn','API\x20key\x20cannot\x20be\x20empty','✓\x20Default\x20site\x20set\x20to\x20','text','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','error','Site\x20name\x20cannot\x20be\x20empty','site','11lZylkl','customSite','2410ITFLGb','jobs','1651065xHLSib','auth:clear','profile','log','red','yellow','5HdBLrk','15330576zTXKOW','54JRdbVV','auth','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','322238osDuIQ','logLevel','trim','ERROR','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','test','auth:setup','tdx\x20profile:\x20','/app/mp/ak','Select\x20your\x20Treasure\x20Data\x20site:','Validating\x20API\x20key...','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','15900qjeaNe'];a7_0x18d8=function(){return _0x5964de;};return a7_0x18d8();}export class AuthSetupCommand extends BaseCommand{[a7_0x257d85(0x16e)]=a7_0x257d85(0x14c);[a7_0x257d85(0x155)]='Setup\x20API\x20key\x20authentication\x20interactively';async['execute'](_0x58636c){const _0x5cbd70=a7_0x257d85,{options:_0x4c5caa}=_0x58636c,_0x4bad93=_0x4c5caa[_0x5cbd70(0x13d)];console[_0x5cbd70(0x13e)](a7_0x272ab0[_0x5cbd70(0x158)]('tdx:\x20auth\x20setup'));const _0x4dd59d=_0x4c5caa[_0x5cbd70(0x136)]||_0x5cbd70(0x154),{choices:_0x47d530,initialIndex:_0x3afaeb}=buildSiteChoices(_0x4dd59d),_0x816663=_0x4bad93?_0x5cbd70(0x145)+_0x4bad93+'):':_0x5cbd70(0x14f),_0xacc2d4=await a7_0x527ca0({'type':'select','name':'site','message':_0x816663,'choices':_0x47d530,'initial':_0x3afaeb});if(!_0xacc2d4[_0x5cbd70(0x136)])return console[_0x5cbd70(0x13e)](_0x5cbd70(0x16b)),0x1;let _0x250060;if(_0xacc2d4[_0x5cbd70(0x136)]===_0x5cbd70(0x174)){const _0x6e7fb6=await a7_0x527ca0({'type':_0x5cbd70(0x132),'name':_0x5cbd70(0x138),'message':_0x5cbd70(0x169),'initial':'us01','validate':_0x2c2df7=>{const _0x160252=_0x5cbd70;if(!_0x2c2df7||!_0x2c2df7[_0x160252(0x148)]())return _0x160252(0x135);if(!/^[a-z0-9-]+$/[_0x160252(0x14b)](_0x2c2df7['trim']()))return _0x160252(0x164);return!![];}});if(!_0x6e7fb6['customSite'])return console[_0x5cbd70(0x13e)]('\x0aSetup\x20cancelled'),0x1;_0x250060=_0x6e7fb6['customSite'];}else _0x250060=_0xacc2d4[_0x5cbd70(0x136)];const _0x576c0b=resolveSite(_0x250060);console[_0x5cbd70(0x13e)](_0x5cbd70(0x163)+_0x576c0b),console['log'](_0x5cbd70(0x171)),console[_0x5cbd70(0x13e)]('\x20\x20'+getConsoleUrl(_0x576c0b,_0x5cbd70(0x14e)));const _0x75dc6a=await a7_0x527ca0({'type':_0x5cbd70(0x162),'name':_0x5cbd70(0x173),'message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x33fe0e=>{const _0x2abb2a=_0x5cbd70;if(!_0x33fe0e||!_0x33fe0e[_0x2abb2a(0x148)]())return _0x2abb2a(0x130);return!![];}});if(!_0x75dc6a[_0x5cbd70(0x173)])return console[_0x5cbd70(0x13e)](_0x5cbd70(0x16b)),0x1;const _0x46233=_0x75dc6a[_0x5cbd70(0x173)];console[_0x5cbd70(0x13e)](_0x5cbd70(0x150));try{const _0x9a0d05=TDX[_0x5cbd70(0x15e)]({'site':_0x576c0b,'apiKey':_0x46233[_0x5cbd70(0x148)](),'logLevel':_0x4c5caa[_0x5cbd70(0x147)]??LogLevel[_0x5cbd70(0x149)]}),_0x3250ce=await _0x9a0d05[_0x5cbd70(0x13a)]['getUserInfo']();console[_0x5cbd70(0x13e)]('✓\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x3250ce['email']+')');const _0x51d601=await isKeychainAvailable();_0x51d601?(await saveAPIKeyAsync(_0x46233[_0x5cbd70(0x148)](),_0x576c0b,_0x4bad93),console[_0x5cbd70(0x13e)]('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0x4bad93?_0x5cbd70(0x153)+_0x4bad93+')':''))):(console[_0x5cbd70(0x12f)](a7_0x272ab0['yellow']('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0x5cbd70(0x12f)](a7_0x272ab0['yellow'](_0x5cbd70(0x14a))));if(_0x4bad93){const _0x4d2db7={'site':_0x576c0b};saveProfileToUserConfig(_0x4bad93,_0x4d2db7),console[_0x5cbd70(0x13e)](_0x5cbd70(0x15b)+_0x4bad93+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x576c0b),console[_0x5cbd70(0x13e)](_0x5cbd70(0x131)+_0x576c0b);const _0x2ac47e=_0x4bad93?_0x5cbd70(0x178)+_0x4bad93:'';return console[_0x5cbd70(0x13e)](),console['log'](_0x5cbd70(0x133)),console[_0x5cbd70(0x13e)]('\x20\x20tdx'+_0x2ac47e+_0x5cbd70(0x151)),console[_0x5cbd70(0x13e)](_0x5cbd70(0x12e)+_0x2ac47e+_0x5cbd70(0x15d)),0x0;}catch(_0x37045e){if(_0x37045e instanceof HTTPClientError&&_0x37045e['status']===0x191)return printAuthError(_0x37045e),0x1;return console[_0x5cbd70(0x134)](a7_0x272ab0[_0x5cbd70(0x13f)](_0x5cbd70(0x15c)+(_0x37045e instanceof Error?_0x37045e[_0x5cbd70(0x170)]:String(_0x37045e)))),console[_0x5cbd70(0x134)]('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x257d85(0x16e)]=a7_0x257d85(0x144);[a7_0x257d85(0x155)]=a7_0x257d85(0x15f);async['execute'](_0x499264){const _0x82c899=a7_0x257d85,{options:_0x384594,tdx:_0x176700}=_0x499264,_0xc28b0b=_0x384594[_0x82c899(0x136)],_0x3806c6=_0x384594[_0x82c899(0x13d)],_0x21d596=_0x3806c6?_0x3806c6:_0x82c899(0x16a);console['log'](_0x82c899(0x14d)+_0x21d596+_0x82c899(0x15a)+_0xc28b0b+')');const _0x124043=await resolveAPIKeyAsync(_0xc28b0b,_0x3806c6);if(_0x124043){const {source:_0x6e8045,isDeprecated:_0x1e8e5f}=_0x124043,_0x24f4bd=_0x82c899(0x168)+_0x6e8045;console[_0x82c899(0x13e)](_0x1e8e5f?a7_0x272ab0[_0x82c899(0x140)](_0x24f4bd):_0x24f4bd);}else console['log'](a7_0x272ab0[_0x82c899(0x140)](_0x82c899(0x16d)));try{const _0x5e164c=await _0x176700['jobs'][_0x82c899(0x165)]();return console[_0x82c899(0x13e)](a7_0x272ab0['green'](_0x82c899(0x167))),console[_0x82c899(0x13e)]('User:\x20'+_0x5e164c[_0x82c899(0x16f)]),(_0x5e164c[_0x82c899(0x12d)]||_0x5e164c[_0x82c899(0x161)])&&console[_0x82c899(0x13e)](_0x82c899(0x17a)+[_0x5e164c[_0x82c899(0x12d)],_0x5e164c['last_name']]['filter'](Boolean)[_0x82c899(0x156)]('\x20')),0x0;}catch(_0x53f198){return _0x53f198 instanceof HTTPClientError&&_0x53f198[_0x82c899(0x172)]===0x191?printAuthError(_0x53f198,!![],_0x3806c6):console[_0x82c899(0x134)](a7_0x272ab0[_0x82c899(0x13f)](_0x82c899(0x15c)+(_0x53f198 instanceof Error?_0x53f198['message']:String(_0x53f198)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x257d85(0x16e)]=a7_0x257d85(0x13c);['description']='Remove\x20API\x20key\x20from\x20system\x20keychain';async[a7_0x257d85(0x16c)](_0x45633a){const _0x4d992d=a7_0x257d85,{options:_0x5d3212}=_0x45633a,_0x8d4b55=_0x5d3212[_0x4d992d(0x13d)];console[_0x4d992d(0x13e)](a7_0x272ab0[_0x4d992d(0x158)](_0x4d992d(0x157)));const _0x264deb=await isKeychainAvailable();if(!_0x264deb)return console[_0x4d992d(0x134)](a7_0x272ab0[_0x4d992d(0x13f)]('System\x20keychain\x20is\x20not\x20available')),0x1;const _0x38c5b6=await deleteKeychainAPIKey(_0x8d4b55);return _0x38c5b6?(clearCredentialCache(),console['log'](_0x4d992d(0x179)+(_0x8d4b55?'\x20(profile:\x20'+_0x8d4b55+')':'')),0x0):(console[_0x4d992d(0x13e)](_0x4d992d(0x160)+(_0x8d4b55?_0x4d992d(0x177)+_0x8d4b55:'')),0x1);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a8_0x1d55(_0x485c37,_0x8ecd91){_0x485c37=_0x485c37-0x12c;const _0x16c35b=a8_0x16c3();let _0x1d55ab=_0x16c35b[_0x485c37];return _0x1d55ab;}const a8_0x2c0a7b=a8_0x1d55;(function(_0x2fc025,_0x24a03d){const _0x49c8e3=a8_0x1d55,_0x4a6e24=_0x2fc025();while(!![]){try{const _0xad9f72=parseInt(_0x49c8e3(0x147))/0x1*(parseInt(_0x49c8e3(0x12c))/0x2)+-parseInt(_0x49c8e3(0x15c))/0x3+parseInt(_0x49c8e3(0x12d))/0x4*(parseInt(_0x49c8e3(0x159))/0x5)+parseInt(_0x49c8e3(0x14a))/0x6+parseInt(_0x49c8e3(0x15b))/0x7*(-parseInt(_0x49c8e3(0x132))/0x8)+parseInt(_0x49c8e3(0x15f))/0x9*(-parseInt(_0x49c8e3(0x158))/0xa)+parseInt(_0x49c8e3(0x142))/0xb;if(_0xad9f72===_0x24a03d)break;else _0x4a6e24['push'](_0x4a6e24['shift']());}catch(_0x3110d7){_0x4a6e24['push'](_0x4a6e24['shift']());}}}(a8_0x16c3,0xb2c53));import{BaseCommand}from'./command.js';function a8_0x16c3(){const _0x28ec3f=['includes','join','getAgentId','Error:\x20','Continuing\x20chat:\x20','description','streamChat','llm','data','Using\x20agent\x20from\x20','4704524RtAVxb','Getting\x20default\x20agent...','agent','claude-4.5-haiku','event','194398GmTMuN','write','execute','6079704TYbNKn','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','getOrCreateDefaultAgent','llmProject','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','new','resolveAgentId','\x27...','Resolving\x20agent\x20\x27','--agent\x20flag','\x0aStack\x20trace:','code','cause','stdout','60BCiGDr','5aKBSUI','validate','49EAxZjD','1377729NGoNcJ','Using\x20cached\x20default\x20agent:\x20','error','1514979iUfxXa','handleChatEvent','Chat\x20session:\x20','resolveProjectId','404','chat','8wINEBK','3974428YvPWhi','verbose','name','message','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','1155080IlEWaN','log','content','type','session\x20context','\x20\x20Cause:\x20'];a8_0x16c3=function(){return _0x28ec3f;};return a8_0x16c3();}import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';function handleSDKError(_0x144af5,_0x4deaae){const _0x4b7fa2=a8_0x1d55;if(_0x144af5 instanceof SDKError)console[_0x4b7fa2(0x15e)](_0x4b7fa2(0x13b)+_0x144af5['message']),_0x4deaae[_0x4b7fa2(0x12e)]&&(_0x144af5[_0x4b7fa2(0x156)]&&console[_0x4b7fa2(0x15e)](_0x4b7fa2(0x137)+_0x144af5[_0x4b7fa2(0x156)]),_0x144af5['stack']&&(console['error'](_0x4b7fa2(0x154)),console[_0x4b7fa2(0x15e)](_0x144af5['stack'])));else throw _0x144af5;}export class ChatCommand extends BaseCommand{[a8_0x2c0a7b(0x12f)]=a8_0x2c0a7b(0x164);[a8_0x2c0a7b(0x13d)]=a8_0x2c0a7b(0x131);[a8_0x2c0a7b(0x15a)](_0x5d6f58){const _0x542e27=a8_0x2c0a7b,_0x2101e1=_0x5d6f58['args'][_0x542e27(0x139)]('\x20');if(!_0x2101e1)return _0x542e27(0x14b);return undefined;}async[a8_0x2c0a7b(0x13e)](_0x2fda03,_0x3dfc3c,_0xc5704,_0x281f21,_0x496bf8){const _0x1f6007=a8_0x2c0a7b;for await(const _0x586f16 of _0x2fda03[_0x1f6007(0x13f)][_0x1f6007(0x164)](_0x3dfc3c,{'agentId':_0xc5704,'chatId':_0x281f21})){if(_0x586f16[_0x1f6007(0x135)]==='metadata'){const _0x3afc7b=_0x586f16[_0x1f6007(0x140)]['chatId'];saveLastChatId(_0x3afc7b),_0x496bf8&&console[_0x1f6007(0x15e)](_0x1f6007(0x161)+_0x3afc7b);}else _0x586f16[_0x1f6007(0x135)]===_0x1f6007(0x146)&&this[_0x1f6007(0x160)](_0x586f16[_0x1f6007(0x140)]);}}async[a8_0x2c0a7b(0x13a)](_0x343fc2,_0x57ccb7,_0x17a015,_0x10f3e1,_0x356169){const _0x1d936b=a8_0x2c0a7b,_0x3a637f=_0x57ccb7||_0x17a015;if(_0x3a637f){const {projectName:_0x1373ed,agentName:_0x4b3647}=parseAgentRef(_0x3a637f),_0xc4669b=_0x4b3647||_0x3a637f,_0x1a7da6=_0x4b3647?_0x1373ed:_0x10f3e1;if(!_0x1a7da6)throw new Error(_0x1d936b(0x14e));if(_0x356169){const _0x5a0817=_0x57ccb7?_0x1d936b(0x153):_0x1d936b(0x136);console[_0x1d936b(0x15e)](_0x1d936b(0x141)+_0x5a0817+':\x20'+_0x1a7da6+'/'+_0xc4669b);}const _0x31d31d=await withSpinner('Resolving\x20project\x20\x27'+_0x1a7da6+_0x1d936b(0x151),()=>_0x343fc2[_0x1d936b(0x13f)][_0x1d936b(0x162)](_0x1a7da6),{'verbose':_0x356169}),_0x3763b9=await withSpinner(_0x1d936b(0x152)+_0xc4669b+_0x1d936b(0x151),()=>_0x343fc2[_0x1d936b(0x13f)][_0x1d936b(0x150)](_0xc4669b,_0x31d31d[_0x1d936b(0x140)]),{'verbose':_0x356169});return _0x3763b9['data'];}else{const _0x3603ae=_0x343fc2[_0x1d936b(0x13f)]['getDefaultAgent']();if(_0x3603ae)return _0x356169&&console['error'](_0x1d936b(0x15d)+_0x3603ae[_0x1d936b(0x12f)]),_0x3603ae['id'];const _0x333f24=await withSpinner(_0x1d936b(0x143),()=>_0x343fc2['llm'][_0x1d936b(0x14c)](_0x1d936b(0x145),0x0),{'verbose':_0x356169});return _0x333f24[_0x1d936b(0x140)]['id'];}}async[a8_0x2c0a7b(0x149)](_0x473327){const _0x2b4b5e=a8_0x2c0a7b,{options:_0x5b7599,args:_0xf55303,tdx:_0x9077b5}=_0x473327,_0x4e674f=_0xf55303[_0x2b4b5e(0x139)]('\x20'),_0x5eca4f=_0x5b7599,_0x520094=_0x5eca4f[_0x2b4b5e(0x144)],_0xf68e85=_0x5eca4f['llmAgent'],_0x5f3296=_0x5eca4f[_0x2b4b5e(0x14d)],_0x428e37=_0x5eca4f[_0x2b4b5e(0x14f)];try{let _0x1e1f2b,_0xcf2627;!_0x428e37&&(_0xcf2627=loadLastChatId(),_0xcf2627&&_0x5b7599['verbose']&&console[_0x2b4b5e(0x15e)](_0x2b4b5e(0x13c)+_0xcf2627));(_0x428e37||!_0xcf2627)&&(_0x1e1f2b=await this[_0x2b4b5e(0x13a)](_0x9077b5,_0x520094,_0xf68e85,_0x5f3296,_0x5b7599[_0x2b4b5e(0x12e)]));try{await this[_0x2b4b5e(0x13e)](_0x9077b5,_0x4e674f,_0x1e1f2b,_0xcf2627,_0x5b7599['verbose']);}catch(_0x58a34c){const _0x3dd138=_0x58a34c instanceof SDKError&&_0x58a34c[_0x2b4b5e(0x155)]===ErrorCode['CHAT_NOT_FOUND']||_0x58a34c instanceof Error&&_0x58a34c[_0x2b4b5e(0x130)][_0x2b4b5e(0x138)](_0x2b4b5e(0x163));if(_0x3dd138)_0x5b7599[_0x2b4b5e(0x12e)]&&console[_0x2b4b5e(0x15e)]('Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...'),!_0x1e1f2b&&(_0x1e1f2b=await this[_0x2b4b5e(0x13a)](_0x9077b5,_0x520094,_0xf68e85,_0x5f3296,_0x5b7599[_0x2b4b5e(0x12e)])),await this['streamChat'](_0x9077b5,_0x4e674f,_0x1e1f2b,undefined,_0x5b7599[_0x2b4b5e(0x12e)]);else throw _0x58a34c;}return console[_0x2b4b5e(0x133)](),0x0;}catch(_0x36e6d7){return console['error'](),handleSDKError(_0x36e6d7,_0x5b7599),0x1;}}[a8_0x2c0a7b(0x160)](_0x24c7e5){const _0x6c61f0=a8_0x2c0a7b;if(_0x6c61f0(0x134)in _0x24c7e5)process[_0x6c61f0(0x157)][_0x6c61f0(0x148)](_0x24c7e5[_0x6c61f0(0x134)]);else _0x6c61f0(0x15e)in _0x24c7e5&&console['error']('\x0aError:\x20'+_0x24c7e5[_0x6c61f0(0x15e)]);}}
|