@treasuredata/tdx 0.22.0 → 0.23.1
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/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.d.ts +11 -2
- package/dist/commands/parent-segment-command.d.ts.map +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/parent-segment-command.js.map +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.d.ts +1 -0
- package/dist/core/profile.d.ts.map +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/profile.js.map +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/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/schedule.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.d.ts +24 -0
- package/dist/sdk/segment.d.ts.map +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/segment.js.map +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/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x375987=a4_0x41b7;(function(_0x21c67e,_0x4aaa6f){const _0x7f748e=a4_0x41b7,_0x204923=_0x21c67e();while(!![]){try{const _0x1c55bc=-parseInt(_0x7f748e(0x1c6))/0x1+-parseInt(_0x7f748e(0x1cc))/0x2+parseInt(_0x7f748e(0x1b9))/0x3*(parseInt(_0x7f748e(0x175))/0x4)+parseInt(_0x7f748e(0x148))/0x5+-parseInt(_0x7f748e(0x162))/0x6*(parseInt(_0x7f748e(0x190))/0x7)+-parseInt(_0x7f748e(0x176))/0x8*(-parseInt(_0x7f748e(0x154))/0x9)+parseInt(_0x7f748e(0x1ac))/0xa;if(_0x1c55bc===_0x4aaa6f)break;else _0x204923['push'](_0x204923['shift']());}catch(_0x187011){_0x204923['push'](_0x204923['shift']());}}}(a4_0x1c61,0x9b118));import a4_0x61008e from'chalk';import a4_0xb953b7 from'path';function a4_0x41b7(_0x15e7b6,_0x14740a){_0x15e7b6=_0x15e7b6-0x13d;const _0x1c6158=a4_0x1c61();let _0x41b775=_0x1c6158[_0x15e7b6];return _0x41b775;}import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a4_0x1c61(){const _0x5c2f50=['\x20successfully','description','Analyzing\x20changes\x20to\x20push...','new','9hVQVKH','\x20\x20Integrations:\x20','agentName','\x0aPush\x20','\x0aErrors\x20found:','\x0aPull\x20summary\x20for\x20\x27','action','\x0aChanges\x20to\x20agent\x20\x27','agents','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','agent:push','\x22\x20to\x20a\x20different\x20profile','\x27\x20to\x20create\x20the\x20folder\x20structure.','83728IrVrNf','updated','\x22\x20from\x20project\x20\x22','parse','✔\x20Context\x20set:\x20','\x20\x20Knowledge\x20Base\x20\x22','2433228thlJIi','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','Errors:','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','\x20resources\x20to\x20\x27','created','sourceProjectName','unchanged','Cloning\x20\x22','Output\x20path:\x20','\x20\x20tdx\x20agent\x20pull\x20','yes','knowledgeBases','name','Analyzing\x20project\x20\x22','Source:\x20','force','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x20unchanged','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x20\x20Text\x20Knowledge\x20Bases:\x20','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','Pushing\x20agent\x20from\x20\x22','Output:\x20','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','site','dirname','\x0aWrite\x20','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','Using\x20current\x20project:\x20','\x20\x20Source:\x20','outputDir','Failed\x20to\x20push\x20agent:\x20','\x20\x20tdx\x20agent\x20clone\x20agents/','agent:clone','total','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','1550555WDCnAH','log','\x22...','agentId','Would\x20clone:','error','llm','Pushing\x20to\x20project...','\x0aChanges\x20to\x20integration\x20\x27','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','-\x20nothing\x20pushed','\x20\x20Text\x20Knowledge\x20Base\x20\x22','6856353DDaahh','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','cwd','projectId','red','profile','session','cyan','\x20|\x20','\x20\x20Prompts:\x20','execute','Agent\x20','hasChanges','\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','18zgVrLU','Status:\x20','agent.yml','repeat','\x20total','\x22:\x20','push','MISSING_ARGUMENT','context','green','Agent\x20pulled\x20successfully','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','Using\x20project:\x20','message','source','utf-8','dim','diff','New\x20project\x20name\x20is\x20required','838876CDabxL','8mNoDWF','Cancelled','no_local_folder','pushProject','Would\x20push\x20agent:\x20','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','errors','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','newProjectName','counts','No\x20tdx.json\x20found\x20in\x20','\x20\x20Agent\x20\x22','Agent:\x20','yellow','projectName','llmProject','\x20--profile\x20','\x0aError:','llm_project','\x20files?','Using\x20local\x20project:\x20','integrations','-\x20no\x20files\x20written','join','Chat:\x20','101745IDEvoL','New\x20project:\x20','reason','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\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','New\x20project\x20ID:\x20','\x20\x20Prompt\x20\x22','\x20\x20Agents:\x20','textKnowledgeBases','\x22\x20to\x20\x22','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','cloneProject','outputPath','\x20=\x20','newProjectId','\x20changed','projectDir','pullProject','\x20\x20Knowledge\x20Bases:\x20','\x22\x20to\x20new\x20project\x20\x22','\x0aChanges\x20to\x20prompt\x20\x27','\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)','dryRun','\x20updated','\x0aChanges:','tdx.json','Dry\x20run\x20-\x20no\x20changes\x20made','Pulling\x20agent\x20\x22','2780220qHTqFa','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)','prompts','INVALID_ARGUMENT','output','Project:\x20','\x20new','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','Using\x20context\x20project:\x20'];a4_0x1c61=function(){return _0x5c2f50;};return a4_0x1c61();}import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x10222a){const _0x498975=a4_0x41b7,_0x15d376=[];if(_0x10222a[_0x498975(0x146)]!==undefined)_0x15d376[_0x498975(0x168)](_0x10222a[_0x498975(0x146)]+_0x498975(0x166));if(_0x10222a['new']!==undefined&&_0x10222a[_0x498975(0x1b8)]>0x0)_0x15d376[_0x498975(0x168)](a4_0x61008e[_0x498975(0x16b)](_0x10222a[_0x498975(0x1b8)]+_0x498975(0x1b2)));if(_0x10222a[_0x498975(0x1d1)]!==undefined&&_0x10222a[_0x498975(0x1d1)]>0x0)_0x15d376[_0x498975(0x168)](a4_0x61008e['green'](_0x10222a[_0x498975(0x1d1)]+'\x20created'));if(_0x10222a['updated']!==undefined&&_0x10222a[_0x498975(0x1c7)]>0x0)_0x15d376[_0x498975(0x168)](a4_0x61008e[_0x498975(0x184)](_0x10222a[_0x498975(0x1c7)]+_0x498975(0x1a7)));if(_0x10222a[_0x498975(0x1d3)]!==undefined&&_0x10222a[_0x498975(0x1d3)]>0x0)_0x15d376[_0x498975(0x168)](a4_0x61008e['gray'](_0x10222a[_0x498975(0x1d3)]+_0x498975(0x1de)));if(_0x10222a['errors']!==undefined&&_0x10222a[_0x498975(0x17d)]>0x0)_0x15d376[_0x498975(0x168)](a4_0x61008e['red'](_0x10222a[_0x498975(0x17d)]+'\x20errors'));return _0x15d376['join'](',\x20');}function displayDiffs(_0x34ab92,_0x3f74cb,_0x3ccc6d,_0x4b6d05,_0x5e2571=[]){const _0x425002=a4_0x41b7;for(const _0xd2719 of _0x34ab92){if(_0xd2719['diff']){const _0x1ee5a6=_0xd2719[_0x425002(0x1bb)]||_0xd2719[_0x425002(0x1d9)];console[_0x425002(0x149)](_0x425002(0x1c0)+_0x1ee5a6+'\x27:'),console['log']('─'[_0x425002(0x165)](0x3c)),console['log'](_0xd2719[_0x425002(0x173)]),console[_0x425002(0x149)]('─'[_0x425002(0x165)](0x3c));}}for(const _0x53072b of _0x3f74cb){_0x53072b[_0x425002(0x173)]&&(console['log'](_0x425002(0x1df)+_0x53072b['name']+'\x27:'),console[_0x425002(0x149)]('─'[_0x425002(0x165)](0x3c)),console['log'](_0x53072b[_0x425002(0x173)]),console[_0x425002(0x149)]('─'[_0x425002(0x165)](0x3c)));}for(const _0x5f2563 of _0x3ccc6d){_0x5f2563[_0x425002(0x173)]&&(console[_0x425002(0x149)]('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x5f2563[_0x425002(0x1d9)]+'\x27:'),console['log']('─'[_0x425002(0x165)](0x3c)),console['log'](_0x5f2563['diff']),console[_0x425002(0x149)]('─'[_0x425002(0x165)](0x3c)));}for(const _0x5387db of _0x4b6d05){_0x5387db['diff']&&(console[_0x425002(0x149)](_0x425002(0x1a4)+_0x5387db['name']+'\x27:'),console[_0x425002(0x149)]('─'['repeat'](0x3c)),console['log'](_0x5387db[_0x425002(0x173)]),console[_0x425002(0x149)]('─'['repeat'](0x3c)));}for(const _0x1421b1 of _0x5e2571){_0x1421b1[_0x425002(0x173)]&&(console[_0x425002(0x149)](_0x425002(0x150)+_0x1421b1[_0x425002(0x1d9)]+'\x27:'),console[_0x425002(0x149)]('─'[_0x425002(0x165)](0x3c)),console[_0x425002(0x149)](_0x1421b1['diff']),console['log']('─'[_0x425002(0x165)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']='agent:pull';[a4_0x375987(0x1b6)]=a4_0x375987(0x1e1);async['execute'](_0x36be66){const _0x3b4155=a4_0x375987,{options:_0x5af639,args:_0x2b2f81,tdx:_0x4d60e0}=_0x36be66,_0x394bc1=_0x2b2f81[0x0],_0x17d45d=_0x2b2f81[0x1],_0x342c75=_0x5af639[_0x3b4155(0x1b0)],_0x21b598=_0x5af639[_0x3b4155(0x1a6)],_0x111a60=_0x5af639[_0x3b4155(0x1dc)],_0x4ed390=_0x5af639['yes'],_0x5b26fd=_0x5af639[_0x3b4155(0x186)];let _0x3fd404,_0x3766bc;const _0x5a132b=findAgentConfigPath(process[_0x3b4155(0x156)]());if(_0x394bc1){const _0x15d45b=a4_0xb953b7['join'](_0x394bc1,'tdx.json');if(existsSync(_0x15d45b))try{const _0x34bae2=JSON[_0x3b4155(0x1c9)](readFileSync(_0x15d45b,_0x3b4155(0x171)));_0x3fd404=_0x34bae2[_0x3b4155(0x189)],_0x3766bc=_0x394bc1,console['log'](a4_0x61008e[_0x3b4155(0x172)]('Using\x20project\x20from\x20'+_0x15d45b+':\x20'+_0x3fd404));}catch{_0x3fd404=_0x394bc1;}else _0x3fd404=_0x394bc1;}else{if(_0x5a132b)try{const _0x567ca2=JSON[_0x3b4155(0x1c9)](readFileSync(_0x5a132b,_0x3b4155(0x171)));_0x3fd404=_0x567ca2[_0x3b4155(0x189)],_0x3766bc=a4_0xb953b7[_0x3b4155(0x13d)](_0x5a132b),console[_0x3b4155(0x149)](a4_0x61008e[_0x3b4155(0x172)](_0x3b4155(0x16e)+_0x3fd404));}catch{_0x3fd404=_0x5b26fd;}else _0x3fd404=_0x5b26fd;}if(!_0x3fd404)return console['log'](a4_0x61008e[_0x3b4155(0x184)](_0x3b4155(0x17c))),console[_0x3b4155(0x149)](_0x3b4155(0x1ad)),console[_0x3b4155(0x149)](_0x3b4155(0x161)),console['log'](_0x3b4155(0x194)),console['log']('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent'),0x1;if(_0x17d45d){const {data:_0x131c98}=await withSpinner(_0x3b4155(0x1ab)+_0x17d45d+_0x3b4155(0x1c8)+_0x3fd404+_0x3b4155(0x14a),()=>_0x4d60e0[_0x3b4155(0x14e)]['pullAgent'](_0x3fd404,_0x17d45d,_0x342c75,{'dryRun':_0x21b598,'force':_0x111a60}));if(_0x21b598)return console['log'](a4_0x61008e[_0x3b4155(0x184)]('Dry\x20run\x20-\x20no\x20files\x20written')),console[_0x3b4155(0x149)]('Would\x20pull\x20agent:\x20'+_0x131c98[_0x3b4155(0x1bb)]),console[_0x3b4155(0x149)](_0x3b4155(0x1d5)+_0x131c98[_0x3b4155(0x19c)]),_0x131c98[_0x3b4155(0x173)]&&(console[_0x3b4155(0x149)](_0x3b4155(0x1a8)),console[_0x3b4155(0x149)]('─'[_0x3b4155(0x165)](0x3c)),console[_0x3b4155(0x149)](_0x131c98[_0x3b4155(0x173)]),console[_0x3b4155(0x149)]('─'['repeat'](0x3c))),0x0;return console[_0x3b4155(0x149)](a4_0x61008e[_0x3b4155(0x16b)](_0x3b4155(0x16c))),console[_0x3b4155(0x149)]('Agent:\x20'+_0x131c98['agentName']),console[_0x3b4155(0x149)](_0x3b4155(0x1e3)+_0x131c98[_0x3b4155(0x19c)]),console[_0x3b4155(0x149)](_0x3b4155(0x163)+(_0x131c98['isNew']?a4_0x61008e['green'](_0x3b4155(0x1b8)):_0x131c98[_0x3b4155(0x160)]?a4_0x61008e['yellow'](_0x3b4155(0x1c7)):a4_0x61008e['gray'](_0x3b4155(0x1d3)))),0x0;}const _0x47d0a4=_0x3766bc||_0x342c75,{data:_0x90664a}=await withSpinner(_0x3b4155(0x1da)+_0x3fd404+_0x3b4155(0x14a),()=>_0x4d60e0[_0x3b4155(0x14e)]['pullProject'](_0x3fd404,_0x47d0a4,{'dryRun':!![]})),_0x59e8a0=_0x90664a[_0x3b4155(0x180)][_0x3b4155(0x1c1)][_0x3b4155(0x1b8)]+_0x90664a[_0x3b4155(0x180)][_0x3b4155(0x1d8)]['new']+_0x90664a[_0x3b4155(0x180)]['textKnowledgeBases']['new']+_0x90664a[_0x3b4155(0x180)][_0x3b4155(0x1ae)][_0x3b4155(0x1b8)]+_0x90664a['counts'][_0x3b4155(0x18c)][_0x3b4155(0x1b8)],_0x429659=_0x90664a[_0x3b4155(0x180)][_0x3b4155(0x1c1)][_0x3b4155(0x1c7)]+_0x90664a[_0x3b4155(0x180)]['knowledgeBases']['updated']+_0x90664a[_0x3b4155(0x180)][_0x3b4155(0x198)][_0x3b4155(0x1c7)]+_0x90664a[_0x3b4155(0x180)][_0x3b4155(0x1ae)][_0x3b4155(0x1c7)]+_0x90664a[_0x3b4155(0x180)][_0x3b4155(0x18c)]['updated'],_0xc24b51=_0x90664a[_0x3b4155(0x180)][_0x3b4155(0x1c1)][_0x3b4155(0x1d3)]+_0x90664a['counts']['knowledgeBases'][_0x3b4155(0x1d3)]+_0x90664a['counts']['textKnowledgeBases']['unchanged']+_0x90664a[_0x3b4155(0x180)][_0x3b4155(0x1ae)][_0x3b4155(0x1d3)]+_0x90664a[_0x3b4155(0x180)]['integrations'][_0x3b4155(0x1d3)];console['log'](_0x3b4155(0x1be)+_0x90664a[_0x3b4155(0x185)]+'\x27:'),console[_0x3b4155(0x149)]('\x20\x20'+a4_0x61008e[_0x3b4155(0x16b)]('+\x20'+_0x59e8a0+_0x3b4155(0x1b2))+'\x20|\x20'+a4_0x61008e[_0x3b4155(0x184)]('~\x20'+_0x429659+_0x3b4155(0x19f))+_0x3b4155(0x15c)+a4_0x61008e[_0x3b4155(0x172)]('=\x20'+_0xc24b51+_0x3b4155(0x1de))),console[_0x3b4155(0x149)](_0x3b4155(0x197)+formatCountSummary(_0x90664a[_0x3b4155(0x180)][_0x3b4155(0x1c1)])),console[_0x3b4155(0x149)](_0x3b4155(0x1a2)+formatCountSummary(_0x90664a[_0x3b4155(0x180)][_0x3b4155(0x1d8)])),console[_0x3b4155(0x149)](_0x3b4155(0x1e0)+formatCountSummary(_0x90664a[_0x3b4155(0x180)][_0x3b4155(0x198)])),console[_0x3b4155(0x149)](_0x3b4155(0x15d)+formatCountSummary(_0x90664a[_0x3b4155(0x180)]['prompts'])),console['log']('\x20\x20Integrations:\x20'+formatCountSummary(_0x90664a[_0x3b4155(0x180)][_0x3b4155(0x18c)])),console[_0x3b4155(0x149)]('\x20\x20Target:\x20'+a4_0x61008e[_0x3b4155(0x15b)](_0x90664a[_0x3b4155(0x142)])),displayDiffs(_0x90664a[_0x3b4155(0x1c1)],_0x90664a[_0x3b4155(0x1d8)],_0x90664a[_0x3b4155(0x198)],_0x90664a['prompts'],_0x90664a[_0x3b4155(0x18c)]);if(_0x21b598)return console[_0x3b4155(0x149)](a4_0x61008e[_0x3b4155(0x184)](_0x3b4155(0x147))),0x0;if(_0x59e8a0===0x0&&_0x429659===0x0)return console[_0x3b4155(0x149)](a4_0x61008e[_0x3b4155(0x16b)](_0x3b4155(0x1e4))),saveSessionContext({'llm_project':_0x90664a['projectName']},_0x5af639[_0x3b4155(0x15a)]),console['log'](a4_0x61008e[_0x3b4155(0x16b)](_0x3b4155(0x1ca)+a4_0x61008e[_0x3b4155(0x172)](_0x3b4155(0x189))+_0x3b4155(0x19d)+a4_0x61008e['cyan'](_0x90664a[_0x3b4155(0x185)]))),0x0;if(!_0x4ed390&&!_0x111a60){if(!isInteractive())return console[_0x3b4155(0x14d)](a4_0x61008e[_0x3b4155(0x158)](_0x3b4155(0x188)),_0x3b4155(0x151)),console[_0x3b4155(0x14d)](a4_0x61008e[_0x3b4155(0x172)](_0x3b4155(0x1c2))),0x1;const _0x44893b=await confirmKey(_0x3b4155(0x13e)+(_0x59e8a0+_0x429659)+_0x3b4155(0x18a));if(!_0x44893b)return console[_0x3b4155(0x149)](a4_0x61008e['yellow']('Cancelled'),_0x3b4155(0x18d)),0x1;}const {data:_0x99963d}=await withSpinner('Writing\x20files...',()=>_0x4d60e0['llm'][_0x3b4155(0x1a1)](_0x3fd404,_0x47d0a4,{'force':_0x111a60}));return console['log'](a4_0x61008e['green']('\x0a✔\x20Pulled\x20'+(_0x59e8a0+_0x429659)+'\x20files\x20to\x20'+_0x99963d[_0x3b4155(0x142)])),saveSessionContext({'llm_project':_0x99963d[_0x3b4155(0x185)]},_0x5af639[_0x3b4155(0x15a)]),console[_0x3b4155(0x149)](a4_0x61008e[_0x3b4155(0x16b)](_0x3b4155(0x1ca)+a4_0x61008e['dim'](_0x3b4155(0x189))+_0x3b4155(0x19d)+a4_0x61008e[_0x3b4155(0x15b)](_0x99963d[_0x3b4155(0x185)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x375987(0x1d9)]=a4_0x375987(0x145);[a4_0x375987(0x1b6)]=a4_0x375987(0x13f);async[a4_0x375987(0x15e)](_0x31affe){const _0x3f0ff0=a4_0x375987,{options:_0x49da38,args:_0x5f4d12,tdx:_0x22d0fd}=_0x31affe,_0x136f9=_0x5f4d12[0x0],_0x1a1d76=_0x49da38[_0x3f0ff0(0x1d9)],_0x2e0ba7=_0x49da38['dryRun'],_0x2b91b8=_0x49da38['yes'],_0x10a1d9=_0x49da38[_0x3f0ff0(0x1e5)],_0x292d3f=_0x49da38[_0x3f0ff0(0x186)];let _0x22770d;const _0x288ee5=findAgentConfigPath(process[_0x3f0ff0(0x156)]());if(_0x136f9){const _0x475d4d=a4_0xb953b7[_0x3f0ff0(0x18e)](_0x136f9,'tdx.json');existsSync(_0x475d4d)?(_0x22770d=_0x136f9,console[_0x3f0ff0(0x149)](a4_0x61008e[_0x3f0ff0(0x172)](_0x3f0ff0(0x18b)+_0x136f9))):_0x22770d=_0x136f9;}else{if(_0x288ee5)_0x22770d=a4_0xb953b7[_0x3f0ff0(0x13d)](_0x288ee5),console['log'](a4_0x61008e[_0x3f0ff0(0x172)](_0x3f0ff0(0x140)+_0x22770d));else{if(_0x292d3f){const _0x4feaa9=sanitizeForFilesystem(_0x292d3f);let _0x349d3=_0x4feaa9,_0x52bbe1=a4_0xb953b7['join'](process['cwd'](),'agents',_0x4feaa9,'tdx.json');if(!existsSync(_0x52bbe1)){const _0x5aec01=normalizeName(_0x292d3f),_0x464970=a4_0xb953b7[_0x3f0ff0(0x18e)](process[_0x3f0ff0(0x156)](),_0x3f0ff0(0x1c1),_0x5aec01,_0x3f0ff0(0x1a9));existsSync(_0x464970)&&(_0x349d3=_0x5aec01,_0x52bbe1=_0x464970);}if(existsSync(_0x52bbe1))_0x22770d=a4_0xb953b7[_0x3f0ff0(0x13d)](_0x52bbe1),console['log'](a4_0x61008e[_0x3f0ff0(0x172)](_0x3f0ff0(0x18b)+_0x22770d));else{const _0x6b2deb=_0x49da38[_0x3f0ff0(0x159)];if(_0x6b2deb)throw new SDKError(ErrorCode[_0x3f0ff0(0x1af)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x292d3f+_0x3f0ff0(0x1c4),undefined,{'helpText':_0x3f0ff0(0x155)+_0x3f0ff0(0x16d)+(_0x3f0ff0(0x1d6)+_0x292d3f+'\x0a')+(_0x3f0ff0(0x144)+_0x349d3+'\x20--name\x20'+(_0x1a1d76||'<new-name>')+_0x3f0ff0(0x187)+_0x6b2deb)});_0x22770d=_0x292d3f,console[_0x3f0ff0(0x149)](a4_0x61008e[_0x3f0ff0(0x172)](_0x3f0ff0(0x1b4)+_0x292d3f));}}}}if(!_0x22770d)return console['log'](a4_0x61008e[_0x3f0ff0(0x184)](_0x3f0ff0(0x17b))),console[_0x3f0ff0(0x149)](_0x3f0ff0(0x1cd)),console[_0x3f0ff0(0x149)](_0x3f0ff0(0x1b3)),console[_0x3f0ff0(0x149)](_0x3f0ff0(0x1a5)),console[_0x3f0ff0(0x149)](_0x3f0ff0(0x17e)),0x1;if(!_0x1a1d76)throw new SDKError(ErrorCode[_0x3f0ff0(0x169)],_0x3f0ff0(0x174),undefined,{'helpText':_0x3f0ff0(0x1dd)});if(!_0x2b91b8&&!_0x2e0ba7){if(!isInteractive())return console[_0x3f0ff0(0x14d)](a4_0x61008e[_0x3f0ff0(0x158)](_0x3f0ff0(0x188)),_0x3f0ff0(0x151)),console[_0x3f0ff0(0x14d)](a4_0x61008e[_0x3f0ff0(0x172)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x54e53a=await confirmKey('Clone\x20\x22'+_0x22770d+_0x3f0ff0(0x1a3)+_0x1a1d76+'\x22?');if(!_0x54e53a)return console[_0x3f0ff0(0x149)](a4_0x61008e[_0x3f0ff0(0x184)]('Cancelled')),0x1;}const {data:_0x65a4f8}=await withSpinner(_0x3f0ff0(0x1d4)+_0x22770d+_0x3f0ff0(0x199)+_0x1a1d76+_0x3f0ff0(0x14a),()=>_0x22d0fd[_0x3f0ff0(0x14e)][_0x3f0ff0(0x19b)](_0x22770d,_0x1a1d76,{'dryRun':_0x2e0ba7}));if(_0x2e0ba7)return console[_0x3f0ff0(0x149)](a4_0x61008e[_0x3f0ff0(0x184)](_0x3f0ff0(0x1aa))),console[_0x3f0ff0(0x149)](_0x3f0ff0(0x1db)+_0x65a4f8['sourceProjectName']),console['log'](_0x3f0ff0(0x191)+_0x1a1d76),console[_0x3f0ff0(0x149)](_0x3f0ff0(0x14c)),console[_0x3f0ff0(0x149)](_0x3f0ff0(0x197)+_0x65a4f8[_0x3f0ff0(0x180)]['agents'][_0x3f0ff0(0x1d1)]),console['log'](_0x3f0ff0(0x1a2)+_0x65a4f8[_0x3f0ff0(0x180)][_0x3f0ff0(0x1d8)]['created']),console['log'](_0x3f0ff0(0x15d)+_0x65a4f8['counts'][_0x3f0ff0(0x1ae)][_0x3f0ff0(0x1d1)]),0x0;const _0x1c6fc4=_0x65a4f8[_0x3f0ff0(0x180)][_0x3f0ff0(0x1c1)][_0x3f0ff0(0x17d)]>0x0||_0x65a4f8[_0x3f0ff0(0x180)][_0x3f0ff0(0x1d8)]['errors']>0x0||_0x65a4f8['counts'][_0x3f0ff0(0x1ae)][_0x3f0ff0(0x17d)]>0x0;_0x1c6fc4?console[_0x3f0ff0(0x149)](a4_0x61008e[_0x3f0ff0(0x184)]('Project\x20cloned\x20with\x20errors')):console[_0x3f0ff0(0x149)](a4_0x61008e['green']('Project\x20cloned\x20successfully'));console['log'](_0x3f0ff0(0x1db)+_0x65a4f8[_0x3f0ff0(0x1d2)]),console[_0x3f0ff0(0x149)](_0x3f0ff0(0x191)+_0x65a4f8[_0x3f0ff0(0x17f)]),console[_0x3f0ff0(0x149)](_0x3f0ff0(0x195)+_0x65a4f8['newProjectId']),console[_0x3f0ff0(0x149)](),console[_0x3f0ff0(0x149)]('Summary:'),console['log'](_0x3f0ff0(0x197)+formatCountSummary(_0x65a4f8[_0x3f0ff0(0x180)][_0x3f0ff0(0x1c1)])),console['log'](_0x3f0ff0(0x1a2)+formatCountSummary(_0x65a4f8[_0x3f0ff0(0x180)][_0x3f0ff0(0x1d8)])),console[_0x3f0ff0(0x149)](_0x3f0ff0(0x15d)+formatCountSummary(_0x65a4f8[_0x3f0ff0(0x180)][_0x3f0ff0(0x1ae)])),console[_0x3f0ff0(0x149)](_0x3f0ff0(0x1ba)+formatCountSummary(_0x65a4f8['counts'][_0x3f0ff0(0x18c)]));if(_0x1c6fc4){console[_0x3f0ff0(0x149)](),console['log'](a4_0x61008e[_0x3f0ff0(0x158)](_0x3f0ff0(0x1ce)));for(const _0x537b5c of _0x65a4f8[_0x3f0ff0(0x1c1)]){_0x537b5c[_0x3f0ff0(0x1bf)]===_0x3f0ff0(0x14d)&&console[_0x3f0ff0(0x149)](a4_0x61008e[_0x3f0ff0(0x158)](_0x3f0ff0(0x182)+_0x537b5c[_0x3f0ff0(0x1bb)]+'\x22:\x20'+_0x537b5c[_0x3f0ff0(0x14d)]));}for(const _0x1c0044 of _0x65a4f8['knowledgeBases']){_0x1c0044[_0x3f0ff0(0x1bf)]===_0x3f0ff0(0x14d)&&console['log'](a4_0x61008e[_0x3f0ff0(0x158)](_0x3f0ff0(0x1cb)+_0x1c0044[_0x3f0ff0(0x1d9)]+_0x3f0ff0(0x167)+_0x1c0044[_0x3f0ff0(0x14d)]));}for(const _0x5c63dc of _0x65a4f8[_0x3f0ff0(0x1ae)]){_0x5c63dc[_0x3f0ff0(0x1bf)]===_0x3f0ff0(0x14d)&&console['log'](a4_0x61008e[_0x3f0ff0(0x158)](_0x3f0ff0(0x196)+_0x5c63dc[_0x3f0ff0(0x1d9)]+_0x3f0ff0(0x167)+_0x5c63dc[_0x3f0ff0(0x14d)]));}for(const _0x4cd372 of _0x65a4f8[_0x3f0ff0(0x18c)]){_0x4cd372[_0x3f0ff0(0x1bf)]===_0x3f0ff0(0x14d)&&console[_0x3f0ff0(0x149)](a4_0x61008e[_0x3f0ff0(0x158)]('\x20\x20Integration\x20\x22'+_0x4cd372['name']+'\x22:\x20'+_0x4cd372[_0x3f0ff0(0x14d)]));}return 0x1;}console[_0x3f0ff0(0x149)]();const _0x5d8d7d=getLLMProjectUrl(_0x10a1d9,_0x65a4f8[_0x3f0ff0(0x19e)]);return console[_0x3f0ff0(0x149)](_0x3f0ff0(0x1b1)+a4_0x61008e[_0x3f0ff0(0x15b)](_0x5d8d7d)),0x0;}}export class AgentPushCommand extends BaseCommand{['name']=a4_0x375987(0x1c3);[a4_0x375987(0x1b6)]='Push\x20local\x20agent\x20files\x20to\x20LLM\x20project';async['execute'](_0x319833){const _0x5e937e=a4_0x375987,{options:_0x323601,args:_0x37811e,tdx:_0x4f57d0}=_0x319833;let _0x1783a2=_0x37811e[0x0]||process[_0x5e937e(0x156)]();const _0x1f350e=_0x323601[_0x5e937e(0x1a6)],_0x89cfd2=_0x323601['force'],_0xb34f37=_0x323601[_0x5e937e(0x1d7)],_0x24d651=_0x323601[_0x5e937e(0x1e5)],_0x2fc9e5=a4_0xb953b7[_0x5e937e(0x18e)](_0x1783a2,_0x5e937e(0x164)),_0xfef90b=existsSync(_0x2fc9e5);if(_0xfef90b){const {data:_0x5bf263}=await withSpinner(_0x5e937e(0x1e2)+_0x1783a2+_0x5e937e(0x14a),()=>_0x4f57d0[_0x5e937e(0x14e)]['pushAgent'](_0x1783a2,{'dryRun':_0x1f350e,'force':_0x89cfd2}));if(_0x1f350e)return console[_0x5e937e(0x149)](a4_0x61008e[_0x5e937e(0x184)](_0x5e937e(0x1aa))),console[_0x5e937e(0x149)](_0x5e937e(0x17a)+_0x5bf263[_0x5e937e(0x1bb)]),0x0;if(_0x5bf263[_0x5e937e(0x1bf)]===_0x5e937e(0x14d))return console[_0x5e937e(0x149)](a4_0x61008e['red'](_0x5e937e(0x143)+_0x5bf263['error'])),0x1;console['log'](a4_0x61008e['green'](_0x5e937e(0x15f)+_0x5bf263['action']+_0x5e937e(0x1b5))),console[_0x5e937e(0x149)](_0x5e937e(0x183)+_0x5bf263[_0x5e937e(0x1bb)]);if(_0x5bf263[_0x5e937e(0x14b)]&&_0x5bf263[_0x5e937e(0x157)]){const _0x487227=getLLMAgentChatUrl(_0x24d651,_0x5bf263[_0x5e937e(0x157)],_0x5bf263['agentId']);console[_0x5e937e(0x149)](_0x5e937e(0x18f)+a4_0x61008e[_0x5e937e(0x15b)](_0x487227));}return 0x0;}const _0x2e1364=_0x323601[_0x5e937e(0x186)],_0x56dd13=resolveProjectFromContext(_0x1783a2,_0x2e1364);if(_0x56dd13['found'])_0x1783a2=_0x56dd13[_0x5e937e(0x1a0)],_0x56dd13[_0x5e937e(0x170)]===_0x5e937e(0x16a)&&console[_0x5e937e(0x149)](a4_0x61008e[_0x5e937e(0x172)]('Using\x20project:\x20'+_0x1783a2));else{let _0x1c10c7=_0x5e937e(0x193);_0x56dd13[_0x5e937e(0x192)]===_0x5e937e(0x178)&&(_0x1c10c7=_0x56dd13[_0x5e937e(0x16f)]+_0x5e937e(0x1cf)+_0x56dd13[_0x5e937e(0x186)]+_0x5e937e(0x1c5));throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x56dd13[_0x5e937e(0x192)]==='no_context'?_0x56dd13['message']:_0x5e937e(0x181)+_0x1783a2,undefined,{'helpText':_0x1c10c7});}const {data:_0x4a05a2}=await withSpinner(_0x5e937e(0x1b7),()=>_0x4f57d0[_0x5e937e(0x14e)]['pushProject'](_0x1783a2,{'dryRun':!![]})),_0x440e48=_0x4a05a2['counts'][_0x5e937e(0x1c1)][_0x5e937e(0x17d)]>0x0;if(_0x440e48){console[_0x5e937e(0x149)](a4_0x61008e[_0x5e937e(0x158)](_0x5e937e(0x1bd)));for(const _0x5a50bd of _0x4a05a2[_0x5e937e(0x1c1)]){_0x5a50bd[_0x5e937e(0x1bf)]==='error'&&console[_0x5e937e(0x149)](a4_0x61008e[_0x5e937e(0x158)](_0x5e937e(0x182)+_0x5a50bd['agentName']+_0x5e937e(0x167)+_0x5a50bd[_0x5e937e(0x14d)]));}return 0x1;}const _0x10b4a5=_0x4a05a2[_0x5e937e(0x180)][_0x5e937e(0x1c1)][_0x5e937e(0x1d1)]+_0x4a05a2['counts'][_0x5e937e(0x1d8)][_0x5e937e(0x1d1)]+_0x4a05a2[_0x5e937e(0x180)][_0x5e937e(0x198)][_0x5e937e(0x1d1)]+_0x4a05a2[_0x5e937e(0x180)][_0x5e937e(0x1ae)][_0x5e937e(0x1d1)]+_0x4a05a2['counts'][_0x5e937e(0x18c)][_0x5e937e(0x1d1)],_0xef6e2b=_0x4a05a2[_0x5e937e(0x180)][_0x5e937e(0x1c1)][_0x5e937e(0x1c7)]+_0x4a05a2[_0x5e937e(0x180)][_0x5e937e(0x1d8)][_0x5e937e(0x1c7)]+_0x4a05a2[_0x5e937e(0x180)]['textKnowledgeBases'][_0x5e937e(0x1c7)]+_0x4a05a2[_0x5e937e(0x180)][_0x5e937e(0x1ae)][_0x5e937e(0x1c7)]+_0x4a05a2[_0x5e937e(0x180)]['integrations']['updated'],_0xa29e7a=_0x4a05a2[_0x5e937e(0x180)][_0x5e937e(0x1c1)][_0x5e937e(0x1d3)]+_0x4a05a2[_0x5e937e(0x180)][_0x5e937e(0x1d8)][_0x5e937e(0x1d3)]+_0x4a05a2[_0x5e937e(0x180)][_0x5e937e(0x198)][_0x5e937e(0x1d3)]+_0x4a05a2[_0x5e937e(0x180)][_0x5e937e(0x1ae)][_0x5e937e(0x1d3)]+_0x4a05a2[_0x5e937e(0x180)][_0x5e937e(0x18c)][_0x5e937e(0x1d3)];console[_0x5e937e(0x149)]('\x0aPush\x20summary\x20for\x20\x27'+_0x4a05a2[_0x5e937e(0x185)]+'\x27:'),console['log']('\x20\x20'+a4_0x61008e[_0x5e937e(0x16b)]('+\x20'+_0x10b4a5+_0x5e937e(0x1b2))+_0x5e937e(0x15c)+a4_0x61008e[_0x5e937e(0x184)]('~\x20'+_0xef6e2b+_0x5e937e(0x19f))+_0x5e937e(0x15c)+a4_0x61008e[_0x5e937e(0x172)]('=\x20'+_0xa29e7a+_0x5e937e(0x1de))),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x4a05a2[_0x5e937e(0x180)][_0x5e937e(0x1c1)])),console[_0x5e937e(0x149)](_0x5e937e(0x1a2)+formatCountSummary(_0x4a05a2[_0x5e937e(0x180)]['knowledgeBases'])),console[_0x5e937e(0x149)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x4a05a2[_0x5e937e(0x180)]['textKnowledgeBases'])),console[_0x5e937e(0x149)](_0x5e937e(0x15d)+formatCountSummary(_0x4a05a2['counts']['prompts'])),console[_0x5e937e(0x149)](_0x5e937e(0x1ba)+formatCountSummary(_0x4a05a2['counts'][_0x5e937e(0x18c)])),console['log'](_0x5e937e(0x141)+a4_0x61008e[_0x5e937e(0x15b)](_0x1783a2)),displayDiffs(_0x4a05a2['agents'],_0x4a05a2[_0x5e937e(0x1d8)],_0x4a05a2[_0x5e937e(0x198)],_0x4a05a2[_0x5e937e(0x1ae)],_0x4a05a2[_0x5e937e(0x18c)]);if(_0x1f350e)return console['log'](a4_0x61008e[_0x5e937e(0x184)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x10b4a5===0x0&&_0xef6e2b===0x0){console[_0x5e937e(0x149)](a4_0x61008e[_0x5e937e(0x16b)](_0x5e937e(0x19a)));const _0x985669=getLLMProjectUrl(_0x24d651,_0x4a05a2[_0x5e937e(0x157)]);return console['log'](_0x5e937e(0x1b1)+a4_0x61008e[_0x5e937e(0x15b)](_0x985669)),0x0;}if(!_0xb34f37&&!_0x89cfd2){if(!isInteractive())return console[_0x5e937e(0x14d)](a4_0x61008e[_0x5e937e(0x158)]('\x0aError:'),_0x5e937e(0x151)),console['error'](a4_0x61008e['dim'](_0x5e937e(0x1c2))),0x1;const _0x3f160f=await confirmKey(_0x5e937e(0x1bc)+(_0x10b4a5+_0xef6e2b)+'\x20resources?');if(!_0x3f160f)return console[_0x5e937e(0x149)](a4_0x61008e[_0x5e937e(0x184)](_0x5e937e(0x177)),_0x5e937e(0x152)),0x1;}const {data:_0x2d1627}=await withSpinner(_0x5e937e(0x14f),()=>_0x4f57d0[_0x5e937e(0x14e)][_0x5e937e(0x179)](_0x1783a2,{'force':_0x89cfd2})),_0x25be7f=_0x2d1627[_0x5e937e(0x180)][_0x5e937e(0x1c1)][_0x5e937e(0x17d)]>0x0||_0x2d1627[_0x5e937e(0x180)]['knowledgeBases']['errors']>0x0||_0x2d1627[_0x5e937e(0x180)][_0x5e937e(0x198)][_0x5e937e(0x17d)]>0x0||_0x2d1627['counts'][_0x5e937e(0x1ae)]['errors']>0x0;if(_0x25be7f){console['log'](a4_0x61008e[_0x5e937e(0x184)]('\x0aProject\x20pushed\x20with\x20errors')),console['log'](),console['log'](a4_0x61008e[_0x5e937e(0x158)](_0x5e937e(0x1ce)));for(const _0xfbf198 of _0x2d1627['agents']){_0xfbf198[_0x5e937e(0x1bf)]===_0x5e937e(0x14d)&&console[_0x5e937e(0x149)](a4_0x61008e['red']('\x20\x20Agent\x20\x22'+_0xfbf198[_0x5e937e(0x1bb)]+_0x5e937e(0x167)+_0xfbf198[_0x5e937e(0x14d)]));}for(const _0x3f31c8 of _0x2d1627[_0x5e937e(0x1d8)]){_0x3f31c8['action']===_0x5e937e(0x14d)&&console[_0x5e937e(0x149)](a4_0x61008e[_0x5e937e(0x158)](_0x5e937e(0x1cb)+_0x3f31c8[_0x5e937e(0x1d9)]+_0x5e937e(0x167)+_0x3f31c8[_0x5e937e(0x14d)]));}for(const _0x34a98c of _0x2d1627['textKnowledgeBases']){_0x34a98c[_0x5e937e(0x1bf)]===_0x5e937e(0x14d)&&console[_0x5e937e(0x149)](a4_0x61008e[_0x5e937e(0x158)](_0x5e937e(0x153)+_0x34a98c[_0x5e937e(0x1d9)]+_0x5e937e(0x167)+_0x34a98c[_0x5e937e(0x14d)]));}for(const _0xce0024 of _0x2d1627[_0x5e937e(0x1ae)]){_0xce0024[_0x5e937e(0x1bf)]==='error'&&console[_0x5e937e(0x149)](a4_0x61008e[_0x5e937e(0x158)](_0x5e937e(0x196)+_0xce0024['name']+_0x5e937e(0x167)+_0xce0024['error']));}for(const _0x3b2043 of _0x2d1627[_0x5e937e(0x18c)]){_0x3b2043['action']===_0x5e937e(0x14d)&&console[_0x5e937e(0x149)](a4_0x61008e['red']('\x20\x20Integration\x20\x22'+_0x3b2043[_0x5e937e(0x1d9)]+_0x5e937e(0x167)+_0x3b2043['error']));}return 0x1;}console['log'](a4_0x61008e[_0x5e937e(0x16b)]('\x0a✔\x20Pushed\x20'+(_0x10b4a5+_0xef6e2b)+_0x5e937e(0x1d0)+_0x2d1627[_0x5e937e(0x185)]+'\x27'));const _0x1bfacf=getLLMProjectUrl(_0x24d651,_0x2d1627[_0x5e937e(0x157)]);return console[_0x5e937e(0x149)](_0x5e937e(0x1b1)+a4_0x61008e[_0x5e937e(0x15b)](_0x1bfacf)),0x0;}}
|
|
1
|
+
const a4_0x1e86be=a4_0x3749;function a4_0x3749(_0x49dd69,_0x6e655d){_0x49dd69=_0x49dd69-0x1d8;const _0x970283=a4_0x9702();let _0x3749a6=_0x970283[_0x49dd69];return _0x3749a6;}(function(_0x40bc2f,_0x40469e){const _0x40ae59=a4_0x3749,_0x152afb=_0x40bc2f();while(!![]){try{const _0x85db6a=-parseInt(_0x40ae59(0x211))/0x1*(parseInt(_0x40ae59(0x22e))/0x2)+parseInt(_0x40ae59(0x227))/0x3*(-parseInt(_0x40ae59(0x257))/0x4)+-parseInt(_0x40ae59(0x26f))/0x5+parseInt(_0x40ae59(0x222))/0x6*(parseInt(_0x40ae59(0x1e4))/0x7)+parseInt(_0x40ae59(0x249))/0x8*(parseInt(_0x40ae59(0x266))/0x9)+-parseInt(_0x40ae59(0x207))/0xa*(parseInt(_0x40ae59(0x284))/0xb)+parseInt(_0x40ae59(0x25b))/0xc*(parseInt(_0x40ae59(0x220))/0xd);if(_0x85db6a===_0x40469e)break;else _0x152afb['push'](_0x152afb['shift']());}catch(_0x5c0e55){_0x152afb['push'](_0x152afb['shift']());}}}(a4_0x9702,0x88cc0));function a4_0x9702(){const _0x4d3d0d=['agents','320kpJckR','pullProject','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\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)','red','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','Using\x20current\x20project:\x20','-\x20nothing\x20pushed','\x22:\x20','\x20--name\x20','4731EitCtl','\x0a✔\x20Pushed\x20','no_context','site','yes','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x0aPush\x20','\x20\x20tdx\x20agent\x20pull\x20','newProjectId','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x20\x20Integrations:\x20','outputDir','Using\x20context\x20project:\x20','cloneProject','\x20\x20Source:\x20','156swbvRx','INVALID_ARGUMENT','22668GphENh','counts','\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','found','pullAgent','96378JjHTSj','dryRun','pushProject','message','Using\x20local\x20project:\x20','\x20created','integrations','202kAiFKM','\x20total','context','Failed\x20to\x20push\x20agent:\x20','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x0aChanges\x20to\x20prompt\x20\x27','\x22\x20to\x20new\x20project\x20\x22','execute','yellow','Writing\x20files...','\x27\x20to\x20create\x20the\x20folder\x20structure.','name','New\x20project\x20name\x20is\x20required','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x20\x20Agent\x20\x22','Cloning\x20\x22','Project:\x20','no_local_folder','log','join','llm','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)','\x20files?','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','llm_project','\x20\x20Integration\x20\x22','textKnowledgeBases','4911648DubLkj','projectDir','Agent\x20pulled\x20successfully','green','output','Agent\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','Errors:','\x20files\x20to\x20','agent:push','\x22\x20to\x20a\x20different\x20profile','Would\x20push\x20agent:\x20','profile','unchanged','76GuNomi','Using\x20project:\x20','Pushing\x20agent\x20from\x20\x22','Output\x20path:\x20','2720988cZGyJN','prompts','\x0aChanges\x20to\x20integration\x20\x27','New\x20project\x20ID:\x20','\x22...','agentId','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x20\x20Knowledge\x20Bases:\x20','Project\x20cloned\x20successfully','outputPath','Using\x20project\x20from\x20','9uoGnww','Dry\x20run\x20-\x20no\x20files\x20written','\x20\x20Prompt\x20\x22','New\x20project:\x20','\x20unchanged','projectName','\x20=\x20','\x20errors','✔\x20Context\x20set:\x20','3487195tYJRsY','Cancelled','Dry\x20run\x20-\x20no\x20changes\x20made','cyan','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent','Would\x20pull\x20agent:\x20','push','\x20\x20Knowledge\x20Base\x20\x22','total','\x20updated','agentName','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','tdx.json','\x20changed','\x22\x20from\x20project\x20\x22','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x0a✔\x20Pulled\x20','reason','Agent:\x20','cwd','360734TrwQiv','diff','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','dirname','\x20resources\x20to\x20\x27','\x0aProject\x20pushed\x20with\x20errors','Clone\x20\x22','-\x20no\x20files\x20written','Chat:\x20','Pulling\x20agent\x20\x22','\x20successfully','created','\x20\x20tdx\x20agent\x20clone\x20agents/','description','session','Summary:','\x20resources?','llmProject','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','112hiCDuj','errors','\x0aChanges\x20to\x20agent\x20\x27','action','newProjectName','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','hasChanges','\x0aError:','repeat','dim','Status:\x20','isNew','\x20\x20Agents:\x20','force','new','\x20--profile\x20','source','agent:clone','gray','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','updated','\x0aChanges:','Output:\x20','No\x20tdx.json\x20found\x20in\x20','\x20new','\x20|\x20','projectId','parse','pushAgent','\x20\x20Prompts:\x20','error','sourceProjectName','\x0aWrite\x20','knowledgeBases'];a4_0x9702=function(){return _0x4d3d0d;};return a4_0x9702();}import a4_0x1e3c51 from'chalk';import a4_0x14c103 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x38d4c7){const _0x4ecc15=a4_0x3749,_0x5e1919=[];if(_0x38d4c7[_0x4ecc15(0x277)]!==undefined)_0x5e1919[_0x4ecc15(0x275)](_0x38d4c7[_0x4ecc15(0x277)]+_0x4ecc15(0x22f));if(_0x38d4c7[_0x4ecc15(0x1f2)]!==undefined&&_0x38d4c7['new']>0x0)_0x5e1919[_0x4ecc15(0x275)](a4_0x1e3c51[_0x4ecc15(0x24c)](_0x38d4c7[_0x4ecc15(0x1f2)]+_0x4ecc15(0x1fc)));if(_0x38d4c7[_0x4ecc15(0x1dc)]!==undefined&&_0x38d4c7[_0x4ecc15(0x1dc)]>0x0)_0x5e1919[_0x4ecc15(0x275)](a4_0x1e3c51[_0x4ecc15(0x24c)](_0x38d4c7[_0x4ecc15(0x1dc)]+_0x4ecc15(0x22c)));if(_0x38d4c7[_0x4ecc15(0x1f8)]!==undefined&&_0x38d4c7['updated']>0x0)_0x5e1919[_0x4ecc15(0x275)](a4_0x1e3c51[_0x4ecc15(0x236)](_0x38d4c7['updated']+_0x4ecc15(0x278)));if(_0x38d4c7[_0x4ecc15(0x256)]!==undefined&&_0x38d4c7[_0x4ecc15(0x256)]>0x0)_0x5e1919[_0x4ecc15(0x275)](a4_0x1e3c51[_0x4ecc15(0x1f6)](_0x38d4c7[_0x4ecc15(0x256)]+'\x20unchanged'));if(_0x38d4c7['errors']!==undefined&&_0x38d4c7[_0x4ecc15(0x1e5)]>0x0)_0x5e1919['push'](a4_0x1e3c51[_0x4ecc15(0x20b)](_0x38d4c7[_0x4ecc15(0x1e5)]+_0x4ecc15(0x26d)));return _0x5e1919['join'](',\x20');}function displayDiffs(_0x5c1418,_0x36b7db,_0x1935ab,_0x5252d7,_0x24deef=[]){const _0x23c09b=a4_0x3749;for(const _0x242f75 of _0x5c1418){if(_0x242f75[_0x23c09b(0x285)]){const _0xda7545=_0x242f75['agentName']||_0x242f75[_0x23c09b(0x239)];console['log'](_0x23c09b(0x1e6)+_0xda7545+'\x27:'),console[_0x23c09b(0x240)]('─'[_0x23c09b(0x1ec)](0x3c)),console[_0x23c09b(0x240)](_0x242f75[_0x23c09b(0x285)]),console['log']('─'[_0x23c09b(0x1ec)](0x3c));}}for(const _0x3641dc of _0x36b7db){_0x3641dc[_0x23c09b(0x285)]&&(console['log'](_0x23c09b(0x232)+_0x3641dc[_0x23c09b(0x239)]+'\x27:'),console[_0x23c09b(0x240)]('─'[_0x23c09b(0x1ec)](0x3c)),console['log'](_0x3641dc[_0x23c09b(0x285)]),console[_0x23c09b(0x240)]('─'['repeat'](0x3c)));}for(const _0x1759ec of _0x1935ab){_0x1759ec[_0x23c09b(0x285)]&&(console[_0x23c09b(0x240)](_0x23c09b(0x209)+_0x1759ec[_0x23c09b(0x239)]+'\x27:'),console[_0x23c09b(0x240)]('─'[_0x23c09b(0x1ec)](0x3c)),console['log'](_0x1759ec[_0x23c09b(0x285)]),console[_0x23c09b(0x240)]('─'[_0x23c09b(0x1ec)](0x3c)));}for(const _0x3ef328 of _0x5252d7){_0x3ef328[_0x23c09b(0x285)]&&(console['log'](_0x23c09b(0x233)+_0x3ef328['name']+'\x27:'),console[_0x23c09b(0x240)]('─'[_0x23c09b(0x1ec)](0x3c)),console['log'](_0x3ef328[_0x23c09b(0x285)]),console[_0x23c09b(0x240)]('─'[_0x23c09b(0x1ec)](0x3c)));}for(const _0x287cb8 of _0x24deef){_0x287cb8['diff']&&(console['log'](_0x23c09b(0x25d)+_0x287cb8[_0x23c09b(0x239)]+'\x27:'),console[_0x23c09b(0x240)]('─'[_0x23c09b(0x1ec)](0x3c)),console[_0x23c09b(0x240)](_0x287cb8[_0x23c09b(0x285)]),console[_0x23c09b(0x240)]('─'[_0x23c09b(0x1ec)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x1e86be(0x239)]='agent:pull';[a4_0x1e86be(0x1de)]=a4_0x1e86be(0x21a);async[a4_0x1e86be(0x235)](_0x356b00){const _0x4e43c0=a4_0x1e86be,{options:_0x5cdf47,args:_0x580438,tdx:_0x34fc6b}=_0x356b00,_0x4a6958=_0x580438[0x0],_0x137607=_0x580438[0x1],_0x1ebe40=_0x5cdf47[_0x4e43c0(0x24d)],_0x323584=_0x5cdf47[_0x4e43c0(0x228)],_0xa58865=_0x5cdf47['force'],_0x517a2d=_0x5cdf47[_0x4e43c0(0x215)],_0x3615a5=_0x5cdf47[_0x4e43c0(0x1e2)];let _0x3567c0,_0xc5df0c;const _0x5204b7=findAgentConfigPath(process['cwd']());if(_0x4a6958){const _0x1c456c=a4_0x14c103[_0x4e43c0(0x241)](_0x4a6958,_0x4e43c0(0x27b));if(existsSync(_0x1c456c))try{const _0xe23ab1=JSON[_0x4e43c0(0x1ff)](readFileSync(_0x1c456c,'utf-8'));_0x3567c0=_0xe23ab1[_0x4e43c0(0x246)],_0xc5df0c=_0x4a6958,console[_0x4e43c0(0x240)](a4_0x1e3c51[_0x4e43c0(0x1ed)](_0x4e43c0(0x265)+_0x1c456c+':\x20'+_0x3567c0));}catch{_0x3567c0=_0x4a6958;}else _0x3567c0=_0x4a6958;}else{if(_0x5204b7)try{const _0x2ac947=JSON[_0x4e43c0(0x1ff)](readFileSync(_0x5204b7,'utf-8'));_0x3567c0=_0x2ac947[_0x4e43c0(0x246)],_0xc5df0c=a4_0x14c103[_0x4e43c0(0x287)](_0x5204b7),console[_0x4e43c0(0x240)](a4_0x1e3c51['dim'](_0x4e43c0(0x258)+_0x3567c0));}catch{_0x3567c0=_0x3615a5;}else _0x3567c0=_0x3615a5;}if(!_0x3567c0)return console[_0x4e43c0(0x240)](a4_0x1e3c51['yellow'](_0x4e43c0(0x20c))),console[_0x4e43c0(0x240)](_0x4e43c0(0x243)),console[_0x4e43c0(0x240)](_0x4e43c0(0x24f)),console[_0x4e43c0(0x240)](_0x4e43c0(0x224)),console['log'](_0x4e43c0(0x273)),0x1;if(_0x137607){const {data:_0x4f6bfb}=await withSpinner(_0x4e43c0(0x1da)+_0x137607+_0x4e43c0(0x27d)+_0x3567c0+_0x4e43c0(0x25f),()=>_0x34fc6b['llm'][_0x4e43c0(0x226)](_0x3567c0,_0x137607,_0x1ebe40,{'dryRun':_0x323584,'force':_0xa58865}));if(_0x323584)return console[_0x4e43c0(0x240)](a4_0x1e3c51[_0x4e43c0(0x236)](_0x4e43c0(0x267))),console[_0x4e43c0(0x240)](_0x4e43c0(0x274)+_0x4f6bfb[_0x4e43c0(0x279)]),console['log'](_0x4e43c0(0x25a)+_0x4f6bfb[_0x4e43c0(0x264)]),_0x4f6bfb[_0x4e43c0(0x285)]&&(console[_0x4e43c0(0x240)](_0x4e43c0(0x1f9)),console[_0x4e43c0(0x240)]('─'[_0x4e43c0(0x1ec)](0x3c)),console['log'](_0x4f6bfb[_0x4e43c0(0x285)]),console[_0x4e43c0(0x240)]('─'[_0x4e43c0(0x1ec)](0x3c))),0x0;return console[_0x4e43c0(0x240)](a4_0x1e3c51['green'](_0x4e43c0(0x24b))),console['log']('Agent:\x20'+_0x4f6bfb[_0x4e43c0(0x279)]),console[_0x4e43c0(0x240)](_0x4e43c0(0x1fa)+_0x4f6bfb[_0x4e43c0(0x264)]),console[_0x4e43c0(0x240)](_0x4e43c0(0x1ee)+(_0x4f6bfb[_0x4e43c0(0x1ef)]?a4_0x1e3c51[_0x4e43c0(0x24c)]('new'):_0x4f6bfb[_0x4e43c0(0x1ea)]?a4_0x1e3c51[_0x4e43c0(0x236)](_0x4e43c0(0x1f8)):a4_0x1e3c51['gray']('unchanged'))),0x0;}const _0x33cf89=_0xc5df0c||_0x1ebe40,{data:_0x152cdd}=await withSpinner('Analyzing\x20project\x20\x22'+_0x3567c0+_0x4e43c0(0x25f),()=>_0x34fc6b[_0x4e43c0(0x242)][_0x4e43c0(0x208)](_0x3567c0,_0x33cf89,{'dryRun':!![]})),_0x210a55=_0x152cdd[_0x4e43c0(0x223)][_0x4e43c0(0x206)][_0x4e43c0(0x1f2)]+_0x152cdd['counts'][_0x4e43c0(0x205)][_0x4e43c0(0x1f2)]+_0x152cdd[_0x4e43c0(0x223)][_0x4e43c0(0x248)][_0x4e43c0(0x1f2)]+_0x152cdd[_0x4e43c0(0x223)][_0x4e43c0(0x25c)][_0x4e43c0(0x1f2)]+_0x152cdd[_0x4e43c0(0x223)][_0x4e43c0(0x22d)][_0x4e43c0(0x1f2)],_0x460311=_0x152cdd['counts'][_0x4e43c0(0x206)][_0x4e43c0(0x1f8)]+_0x152cdd[_0x4e43c0(0x223)][_0x4e43c0(0x205)][_0x4e43c0(0x1f8)]+_0x152cdd['counts'][_0x4e43c0(0x248)][_0x4e43c0(0x1f8)]+_0x152cdd['counts']['prompts'][_0x4e43c0(0x1f8)]+_0x152cdd['counts'][_0x4e43c0(0x22d)][_0x4e43c0(0x1f8)],_0x453188=_0x152cdd[_0x4e43c0(0x223)]['agents'][_0x4e43c0(0x256)]+_0x152cdd[_0x4e43c0(0x223)][_0x4e43c0(0x205)]['unchanged']+_0x152cdd[_0x4e43c0(0x223)][_0x4e43c0(0x248)][_0x4e43c0(0x256)]+_0x152cdd[_0x4e43c0(0x223)]['prompts'][_0x4e43c0(0x256)]+_0x152cdd[_0x4e43c0(0x223)][_0x4e43c0(0x22d)][_0x4e43c0(0x256)];console[_0x4e43c0(0x240)]('\x0aPull\x20summary\x20for\x20\x27'+_0x152cdd['projectName']+'\x27:'),console['log']('\x20\x20'+a4_0x1e3c51[_0x4e43c0(0x24c)]('+\x20'+_0x210a55+_0x4e43c0(0x1fc))+'\x20|\x20'+a4_0x1e3c51[_0x4e43c0(0x236)]('~\x20'+_0x460311+_0x4e43c0(0x27c))+'\x20|\x20'+a4_0x1e3c51[_0x4e43c0(0x1ed)]('=\x20'+_0x453188+_0x4e43c0(0x26a))),console[_0x4e43c0(0x240)](_0x4e43c0(0x1f0)+formatCountSummary(_0x152cdd[_0x4e43c0(0x223)][_0x4e43c0(0x206)])),console[_0x4e43c0(0x240)](_0x4e43c0(0x262)+formatCountSummary(_0x152cdd['counts'][_0x4e43c0(0x205)])),console['log'](_0x4e43c0(0x216)+formatCountSummary(_0x152cdd['counts']['textKnowledgeBases'])),console[_0x4e43c0(0x240)](_0x4e43c0(0x201)+formatCountSummary(_0x152cdd['counts'][_0x4e43c0(0x25c)])),console[_0x4e43c0(0x240)](_0x4e43c0(0x21b)+formatCountSummary(_0x152cdd['counts'][_0x4e43c0(0x22d)])),console['log']('\x20\x20Target:\x20'+a4_0x1e3c51[_0x4e43c0(0x272)](_0x152cdd[_0x4e43c0(0x21c)])),displayDiffs(_0x152cdd[_0x4e43c0(0x206)],_0x152cdd[_0x4e43c0(0x205)],_0x152cdd[_0x4e43c0(0x248)],_0x152cdd[_0x4e43c0(0x25c)],_0x152cdd['integrations']);if(_0x323584)return console[_0x4e43c0(0x240)](a4_0x1e3c51[_0x4e43c0(0x236)](_0x4e43c0(0x27a))),0x0;if(_0x210a55===0x0&&_0x460311===0x0)return console[_0x4e43c0(0x240)](a4_0x1e3c51['green'](_0x4e43c0(0x1e9))),saveSessionContext({'llm_project':_0x152cdd[_0x4e43c0(0x26b)]},_0x5cdf47['session']),console[_0x4e43c0(0x240)](a4_0x1e3c51[_0x4e43c0(0x24c)]('✔\x20Context\x20set:\x20'+a4_0x1e3c51['dim'](_0x4e43c0(0x246))+'\x20=\x20'+a4_0x1e3c51[_0x4e43c0(0x272)](_0x152cdd[_0x4e43c0(0x26b)]))),0x0;if(!_0x517a2d&&!_0xa58865){if(!isInteractive())return console[_0x4e43c0(0x202)](a4_0x1e3c51[_0x4e43c0(0x20b)](_0x4e43c0(0x1eb)),_0x4e43c0(0x286)),console[_0x4e43c0(0x202)](a4_0x1e3c51[_0x4e43c0(0x1ed)](_0x4e43c0(0x245))),0x1;const _0x579362=await confirmKey(_0x4e43c0(0x204)+(_0x210a55+_0x460311)+_0x4e43c0(0x244));if(!_0x579362)return console[_0x4e43c0(0x240)](a4_0x1e3c51[_0x4e43c0(0x236)](_0x4e43c0(0x270)),_0x4e43c0(0x1d8)),0x1;}const {data:_0x21afef}=await withSpinner(_0x4e43c0(0x237),()=>_0x34fc6b[_0x4e43c0(0x242)][_0x4e43c0(0x208)](_0x3567c0,_0x33cf89,{'force':_0xa58865}));return console[_0x4e43c0(0x240)](a4_0x1e3c51[_0x4e43c0(0x24c)](_0x4e43c0(0x280)+(_0x210a55+_0x460311)+_0x4e43c0(0x251)+_0x21afef[_0x4e43c0(0x21c)])),saveSessionContext({'llm_project':_0x21afef[_0x4e43c0(0x26b)]},_0x5cdf47[_0x4e43c0(0x1df)]),console[_0x4e43c0(0x240)](a4_0x1e3c51[_0x4e43c0(0x24c)](_0x4e43c0(0x26e)+a4_0x1e3c51['dim']('llm_project')+_0x4e43c0(0x26c)+a4_0x1e3c51['cyan'](_0x21afef[_0x4e43c0(0x26b)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x1e86be(0x239)]=a4_0x1e86be(0x1f5);[a4_0x1e86be(0x1de)]=a4_0x1e86be(0x27e);async[a4_0x1e86be(0x235)](_0x3ae690){const _0x22f4ec=a4_0x1e86be,{options:_0x1215d9,args:_0x305a3f,tdx:_0x1cd9be}=_0x3ae690,_0x8befdb=_0x305a3f[0x0],_0x5b06ef=_0x1215d9['name'],_0x46e5c9=_0x1215d9[_0x22f4ec(0x228)],_0x1dc0cd=_0x1215d9['yes'],_0x5171dc=_0x1215d9[_0x22f4ec(0x214)],_0x477326=_0x1215d9[_0x22f4ec(0x1e2)];let _0x5e0483;const _0x201ea1=findAgentConfigPath(process['cwd']());if(_0x8befdb){const _0x4848b1=a4_0x14c103[_0x22f4ec(0x241)](_0x8befdb,'tdx.json');existsSync(_0x4848b1)?(_0x5e0483=_0x8befdb,console['log'](a4_0x1e3c51['dim']('Using\x20local\x20project:\x20'+_0x8befdb))):_0x5e0483=_0x8befdb;}else{if(_0x201ea1)_0x5e0483=a4_0x14c103[_0x22f4ec(0x287)](_0x201ea1),console[_0x22f4ec(0x240)](a4_0x1e3c51[_0x22f4ec(0x1ed)](_0x22f4ec(0x20d)+_0x5e0483));else{if(_0x477326){const _0x3b9a5a=sanitizeForFilesystem(_0x477326);let _0x4e744d=_0x3b9a5a,_0x74970c=a4_0x14c103[_0x22f4ec(0x241)](process[_0x22f4ec(0x283)](),_0x22f4ec(0x206),_0x3b9a5a,_0x22f4ec(0x27b));if(!existsSync(_0x74970c)){const _0x475279=normalizeName(_0x477326),_0xc8ebfa=a4_0x14c103[_0x22f4ec(0x241)](process[_0x22f4ec(0x283)](),_0x22f4ec(0x206),_0x475279,'tdx.json');existsSync(_0xc8ebfa)&&(_0x4e744d=_0x475279,_0x74970c=_0xc8ebfa);}if(existsSync(_0x74970c))_0x5e0483=a4_0x14c103[_0x22f4ec(0x287)](_0x74970c),console[_0x22f4ec(0x240)](a4_0x1e3c51[_0x22f4ec(0x1ed)](_0x22f4ec(0x22b)+_0x5e0483));else{const _0x37a44b=_0x1215d9[_0x22f4ec(0x255)];if(_0x37a44b)throw new SDKError(ErrorCode[_0x22f4ec(0x221)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x477326+_0x22f4ec(0x253),undefined,{'helpText':'When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a'+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+(_0x22f4ec(0x218)+_0x477326+'\x0a')+(_0x22f4ec(0x1dd)+_0x4e744d+_0x22f4ec(0x210)+(_0x5b06ef||'<new-name>')+_0x22f4ec(0x1f3)+_0x37a44b)});_0x5e0483=_0x477326,console[_0x22f4ec(0x240)](a4_0x1e3c51['dim'](_0x22f4ec(0x21d)+_0x477326));}}}}if(!_0x5e0483)return console['log'](a4_0x1e3c51[_0x22f4ec(0x236)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x22f4ec(0x240)]('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console['log']('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console['log'](_0x22f4ec(0x20a)),console[_0x22f4ec(0x240)](_0x22f4ec(0x23b)),0x1;if(!_0x5b06ef)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x22f4ec(0x23a),undefined,{'helpText':_0x22f4ec(0x1f7)});if(!_0x1dc0cd&&!_0x46e5c9){if(!isInteractive())return console['error'](a4_0x1e3c51[_0x22f4ec(0x20b)](_0x22f4ec(0x1eb)),_0x22f4ec(0x286)),console[_0x22f4ec(0x202)](a4_0x1e3c51[_0x22f4ec(0x1ed)](_0x22f4ec(0x245))),0x1;const _0xbb4d63=await confirmKey(_0x22f4ec(0x28a)+_0x5e0483+_0x22f4ec(0x234)+_0x5b06ef+'\x22?');if(!_0xbb4d63)return console[_0x22f4ec(0x240)](a4_0x1e3c51['yellow']('Cancelled')),0x1;}const {data:_0x3ecb2a}=await withSpinner(_0x22f4ec(0x23d)+_0x5e0483+'\x22\x20to\x20\x22'+_0x5b06ef+'\x22...',()=>_0x1cd9be[_0x22f4ec(0x242)][_0x22f4ec(0x21e)](_0x5e0483,_0x5b06ef,{'dryRun':_0x46e5c9}));if(_0x46e5c9)return console[_0x22f4ec(0x240)](a4_0x1e3c51[_0x22f4ec(0x236)](_0x22f4ec(0x271))),console[_0x22f4ec(0x240)]('Source:\x20'+_0x3ecb2a[_0x22f4ec(0x203)]),console[_0x22f4ec(0x240)](_0x22f4ec(0x269)+_0x5b06ef),console['log']('Would\x20clone:'),console[_0x22f4ec(0x240)]('\x20\x20Agents:\x20'+_0x3ecb2a['counts'][_0x22f4ec(0x206)][_0x22f4ec(0x1dc)]),console[_0x22f4ec(0x240)](_0x22f4ec(0x262)+_0x3ecb2a[_0x22f4ec(0x223)][_0x22f4ec(0x205)]['created']),console[_0x22f4ec(0x240)](_0x22f4ec(0x201)+_0x3ecb2a[_0x22f4ec(0x223)][_0x22f4ec(0x25c)][_0x22f4ec(0x1dc)]),0x0;const _0x2ed369=_0x3ecb2a[_0x22f4ec(0x223)][_0x22f4ec(0x206)][_0x22f4ec(0x1e5)]>0x0||_0x3ecb2a[_0x22f4ec(0x223)]['knowledgeBases'][_0x22f4ec(0x1e5)]>0x0||_0x3ecb2a[_0x22f4ec(0x223)]['prompts'][_0x22f4ec(0x1e5)]>0x0;_0x2ed369?console[_0x22f4ec(0x240)](a4_0x1e3c51['yellow']('Project\x20cloned\x20with\x20errors')):console[_0x22f4ec(0x240)](a4_0x1e3c51[_0x22f4ec(0x24c)](_0x22f4ec(0x263)));console[_0x22f4ec(0x240)]('Source:\x20'+_0x3ecb2a[_0x22f4ec(0x203)]),console[_0x22f4ec(0x240)](_0x22f4ec(0x269)+_0x3ecb2a[_0x22f4ec(0x1e8)]),console[_0x22f4ec(0x240)](_0x22f4ec(0x25e)+_0x3ecb2a['newProjectId']),console['log'](),console[_0x22f4ec(0x240)](_0x22f4ec(0x1e0)),console[_0x22f4ec(0x240)]('\x20\x20Agents:\x20'+formatCountSummary(_0x3ecb2a['counts']['agents'])),console[_0x22f4ec(0x240)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x3ecb2a[_0x22f4ec(0x223)]['knowledgeBases'])),console[_0x22f4ec(0x240)](_0x22f4ec(0x201)+formatCountSummary(_0x3ecb2a['counts'][_0x22f4ec(0x25c)])),console[_0x22f4ec(0x240)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x3ecb2a[_0x22f4ec(0x223)][_0x22f4ec(0x22d)]));if(_0x2ed369){console[_0x22f4ec(0x240)](),console['log'](a4_0x1e3c51[_0x22f4ec(0x20b)](_0x22f4ec(0x250)));for(const _0x81510c of _0x3ecb2a['agents']){_0x81510c[_0x22f4ec(0x1e7)]===_0x22f4ec(0x202)&&console['log'](a4_0x1e3c51[_0x22f4ec(0x20b)](_0x22f4ec(0x23c)+_0x81510c[_0x22f4ec(0x279)]+'\x22:\x20'+_0x81510c[_0x22f4ec(0x202)]));}for(const _0x4ed3c3 of _0x3ecb2a[_0x22f4ec(0x205)]){_0x4ed3c3[_0x22f4ec(0x1e7)]===_0x22f4ec(0x202)&&console['log'](a4_0x1e3c51[_0x22f4ec(0x20b)](_0x22f4ec(0x276)+_0x4ed3c3['name']+_0x22f4ec(0x20f)+_0x4ed3c3['error']));}for(const _0x5a0aee of _0x3ecb2a[_0x22f4ec(0x25c)]){_0x5a0aee[_0x22f4ec(0x1e7)]===_0x22f4ec(0x202)&&console[_0x22f4ec(0x240)](a4_0x1e3c51['red'](_0x22f4ec(0x268)+_0x5a0aee[_0x22f4ec(0x239)]+_0x22f4ec(0x20f)+_0x5a0aee[_0x22f4ec(0x202)]));}for(const _0x50a57f of _0x3ecb2a[_0x22f4ec(0x22d)]){_0x50a57f[_0x22f4ec(0x1e7)]===_0x22f4ec(0x202)&&console['log'](a4_0x1e3c51[_0x22f4ec(0x20b)]('\x20\x20Integration\x20\x22'+_0x50a57f[_0x22f4ec(0x239)]+_0x22f4ec(0x20f)+_0x50a57f['error']));}return 0x1;}console[_0x22f4ec(0x240)]();const _0x3dc33a=getLLMProjectUrl(_0x5171dc,_0x3ecb2a[_0x22f4ec(0x219)]);return console['log'](_0x22f4ec(0x23e)+a4_0x1e3c51['cyan'](_0x3dc33a)),0x0;}}export class AgentPushCommand extends BaseCommand{['name']=a4_0x1e86be(0x252);[a4_0x1e86be(0x1de)]='Push\x20local\x20agent\x20files\x20to\x20LLM\x20project';async[a4_0x1e86be(0x235)](_0x4ab63a){const _0x31e9a8=a4_0x1e86be,{options:_0x8923de,args:_0x1a3f56,tdx:_0x12ddb2}=_0x4ab63a;let _0x447e32=_0x1a3f56[0x0]||process[_0x31e9a8(0x283)]();const _0x30829d=_0x8923de[_0x31e9a8(0x228)],_0x5b7469=_0x8923de[_0x31e9a8(0x1f1)],_0x5af446=_0x8923de[_0x31e9a8(0x215)],_0x165d7b=_0x8923de[_0x31e9a8(0x214)],_0x4f3809=a4_0x14c103[_0x31e9a8(0x241)](_0x447e32,'agent.yml'),_0x3fab61=existsSync(_0x4f3809);if(_0x3fab61){const {data:_0x178777}=await withSpinner(_0x31e9a8(0x259)+_0x447e32+_0x31e9a8(0x25f),()=>_0x12ddb2[_0x31e9a8(0x242)][_0x31e9a8(0x200)](_0x447e32,{'dryRun':_0x30829d,'force':_0x5b7469}));if(_0x30829d)return console['log'](a4_0x1e3c51[_0x31e9a8(0x236)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x31e9a8(0x240)](_0x31e9a8(0x254)+_0x178777[_0x31e9a8(0x279)]),0x0;if(_0x178777[_0x31e9a8(0x1e7)]===_0x31e9a8(0x202))return console[_0x31e9a8(0x240)](a4_0x1e3c51[_0x31e9a8(0x20b)](_0x31e9a8(0x231)+_0x178777[_0x31e9a8(0x202)])),0x1;console[_0x31e9a8(0x240)](a4_0x1e3c51['green'](_0x31e9a8(0x24e)+_0x178777[_0x31e9a8(0x1e7)]+_0x31e9a8(0x1db))),console['log'](_0x31e9a8(0x282)+_0x178777[_0x31e9a8(0x279)]);if(_0x178777[_0x31e9a8(0x260)]&&_0x178777[_0x31e9a8(0x1fe)]){const _0x16e095=getLLMAgentChatUrl(_0x165d7b,_0x178777[_0x31e9a8(0x1fe)],_0x178777[_0x31e9a8(0x260)]);console[_0x31e9a8(0x240)](_0x31e9a8(0x1d9)+a4_0x1e3c51[_0x31e9a8(0x272)](_0x16e095));}return 0x0;}const _0x2a5ce3=_0x8923de[_0x31e9a8(0x1e2)],_0x191b25=resolveProjectFromContext(_0x447e32,_0x2a5ce3);if(_0x191b25[_0x31e9a8(0x225)])_0x447e32=_0x191b25[_0x31e9a8(0x24a)],_0x191b25[_0x31e9a8(0x1f4)]===_0x31e9a8(0x230)&&console[_0x31e9a8(0x240)](a4_0x1e3c51[_0x31e9a8(0x1ed)]('Using\x20project:\x20'+_0x447e32));else{let _0x35d3dd='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x191b25[_0x31e9a8(0x281)]===_0x31e9a8(0x23f)&&(_0x35d3dd=_0x191b25[_0x31e9a8(0x22a)]+_0x31e9a8(0x1e3)+_0x191b25[_0x31e9a8(0x1e2)]+_0x31e9a8(0x238));throw new SDKError(ErrorCode[_0x31e9a8(0x221)],_0x191b25[_0x31e9a8(0x281)]===_0x31e9a8(0x213)?_0x191b25[_0x31e9a8(0x22a)]:_0x31e9a8(0x1fb)+_0x447e32,undefined,{'helpText':_0x35d3dd});}const {data:_0x40883b}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x12ddb2[_0x31e9a8(0x242)]['pushProject'](_0x447e32,{'dryRun':!![]})),_0x4b0cc7=_0x40883b[_0x31e9a8(0x223)][_0x31e9a8(0x206)]['errors']>0x0;if(_0x4b0cc7){console['log'](a4_0x1e3c51['red']('\x0aErrors\x20found:'));for(const _0x3ce0cf of _0x40883b[_0x31e9a8(0x206)]){_0x3ce0cf[_0x31e9a8(0x1e7)]===_0x31e9a8(0x202)&&console[_0x31e9a8(0x240)](a4_0x1e3c51[_0x31e9a8(0x20b)]('\x20\x20Agent\x20\x22'+_0x3ce0cf[_0x31e9a8(0x279)]+_0x31e9a8(0x20f)+_0x3ce0cf['error']));}return 0x1;}const _0xa9c106=_0x40883b[_0x31e9a8(0x223)][_0x31e9a8(0x206)][_0x31e9a8(0x1dc)]+_0x40883b['counts'][_0x31e9a8(0x205)]['created']+_0x40883b[_0x31e9a8(0x223)][_0x31e9a8(0x248)][_0x31e9a8(0x1dc)]+_0x40883b[_0x31e9a8(0x223)]['prompts'][_0x31e9a8(0x1dc)]+_0x40883b['counts'][_0x31e9a8(0x22d)][_0x31e9a8(0x1dc)],_0x5cb985=_0x40883b[_0x31e9a8(0x223)]['agents'][_0x31e9a8(0x1f8)]+_0x40883b['counts'][_0x31e9a8(0x205)][_0x31e9a8(0x1f8)]+_0x40883b[_0x31e9a8(0x223)][_0x31e9a8(0x248)][_0x31e9a8(0x1f8)]+_0x40883b['counts'][_0x31e9a8(0x25c)][_0x31e9a8(0x1f8)]+_0x40883b[_0x31e9a8(0x223)][_0x31e9a8(0x22d)]['updated'],_0x8a7c05=_0x40883b[_0x31e9a8(0x223)][_0x31e9a8(0x206)][_0x31e9a8(0x256)]+_0x40883b['counts'][_0x31e9a8(0x205)][_0x31e9a8(0x256)]+_0x40883b[_0x31e9a8(0x223)]['textKnowledgeBases'][_0x31e9a8(0x256)]+_0x40883b[_0x31e9a8(0x223)][_0x31e9a8(0x25c)]['unchanged']+_0x40883b[_0x31e9a8(0x223)][_0x31e9a8(0x22d)][_0x31e9a8(0x256)];console[_0x31e9a8(0x240)]('\x0aPush\x20summary\x20for\x20\x27'+_0x40883b[_0x31e9a8(0x26b)]+'\x27:'),console[_0x31e9a8(0x240)]('\x20\x20'+a4_0x1e3c51['green']('+\x20'+_0xa9c106+'\x20new')+_0x31e9a8(0x1fd)+a4_0x1e3c51['yellow']('~\x20'+_0x5cb985+'\x20changed')+_0x31e9a8(0x1fd)+a4_0x1e3c51[_0x31e9a8(0x1ed)]('=\x20'+_0x8a7c05+_0x31e9a8(0x26a))),console[_0x31e9a8(0x240)]('\x20\x20Agents:\x20'+formatCountSummary(_0x40883b[_0x31e9a8(0x223)]['agents'])),console['log']('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x40883b['counts']['knowledgeBases'])),console[_0x31e9a8(0x240)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x40883b['counts'][_0x31e9a8(0x248)])),console['log'](_0x31e9a8(0x201)+formatCountSummary(_0x40883b['counts'][_0x31e9a8(0x25c)])),console['log'](_0x31e9a8(0x21b)+formatCountSummary(_0x40883b[_0x31e9a8(0x223)][_0x31e9a8(0x22d)])),console[_0x31e9a8(0x240)](_0x31e9a8(0x21f)+a4_0x1e3c51[_0x31e9a8(0x272)](_0x447e32)),displayDiffs(_0x40883b[_0x31e9a8(0x206)],_0x40883b[_0x31e9a8(0x205)],_0x40883b[_0x31e9a8(0x248)],_0x40883b[_0x31e9a8(0x25c)],_0x40883b[_0x31e9a8(0x22d)]);if(_0x30829d)return console[_0x31e9a8(0x240)](a4_0x1e3c51[_0x31e9a8(0x236)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0xa9c106===0x0&&_0x5cb985===0x0){console['log'](a4_0x1e3c51[_0x31e9a8(0x24c)](_0x31e9a8(0x27f)));const _0x326e88=getLLMProjectUrl(_0x165d7b,_0x40883b[_0x31e9a8(0x1fe)]);return console[_0x31e9a8(0x240)](_0x31e9a8(0x23e)+a4_0x1e3c51[_0x31e9a8(0x272)](_0x326e88)),0x0;}if(!_0x5af446&&!_0x5b7469){if(!isInteractive())return console['error'](a4_0x1e3c51['red'](_0x31e9a8(0x1eb)),_0x31e9a8(0x286)),console[_0x31e9a8(0x202)](a4_0x1e3c51[_0x31e9a8(0x1ed)](_0x31e9a8(0x245))),0x1;const _0x5230f0=await confirmKey(_0x31e9a8(0x217)+(_0xa9c106+_0x5cb985)+_0x31e9a8(0x1e1));if(!_0x5230f0)return console['log'](a4_0x1e3c51['yellow'](_0x31e9a8(0x270)),_0x31e9a8(0x20e)),0x1;}const {data:_0x3e2ac1}=await withSpinner('Pushing\x20to\x20project...',()=>_0x12ddb2[_0x31e9a8(0x242)][_0x31e9a8(0x229)](_0x447e32,{'force':_0x5b7469})),_0x5867e3=_0x3e2ac1[_0x31e9a8(0x223)][_0x31e9a8(0x206)][_0x31e9a8(0x1e5)]>0x0||_0x3e2ac1[_0x31e9a8(0x223)][_0x31e9a8(0x205)][_0x31e9a8(0x1e5)]>0x0||_0x3e2ac1[_0x31e9a8(0x223)][_0x31e9a8(0x248)][_0x31e9a8(0x1e5)]>0x0||_0x3e2ac1[_0x31e9a8(0x223)][_0x31e9a8(0x25c)][_0x31e9a8(0x1e5)]>0x0;if(_0x5867e3){console[_0x31e9a8(0x240)](a4_0x1e3c51[_0x31e9a8(0x236)](_0x31e9a8(0x289))),console[_0x31e9a8(0x240)](),console[_0x31e9a8(0x240)](a4_0x1e3c51[_0x31e9a8(0x20b)]('Errors:'));for(const _0x49b59d of _0x3e2ac1[_0x31e9a8(0x206)]){_0x49b59d[_0x31e9a8(0x1e7)]===_0x31e9a8(0x202)&&console[_0x31e9a8(0x240)](a4_0x1e3c51[_0x31e9a8(0x20b)](_0x31e9a8(0x23c)+_0x49b59d[_0x31e9a8(0x279)]+_0x31e9a8(0x20f)+_0x49b59d[_0x31e9a8(0x202)]));}for(const _0x2f5cb5 of _0x3e2ac1[_0x31e9a8(0x205)]){_0x2f5cb5['action']==='error'&&console['log'](a4_0x1e3c51['red']('\x20\x20Knowledge\x20Base\x20\x22'+_0x2f5cb5[_0x31e9a8(0x239)]+_0x31e9a8(0x20f)+_0x2f5cb5[_0x31e9a8(0x202)]));}for(const _0x3b264f of _0x3e2ac1[_0x31e9a8(0x248)]){_0x3b264f[_0x31e9a8(0x1e7)]==='error'&&console[_0x31e9a8(0x240)](a4_0x1e3c51[_0x31e9a8(0x20b)](_0x31e9a8(0x261)+_0x3b264f[_0x31e9a8(0x239)]+_0x31e9a8(0x20f)+_0x3b264f[_0x31e9a8(0x202)]));}for(const _0x96af7 of _0x3e2ac1[_0x31e9a8(0x25c)]){_0x96af7[_0x31e9a8(0x1e7)]===_0x31e9a8(0x202)&&console['log'](a4_0x1e3c51['red'](_0x31e9a8(0x268)+_0x96af7[_0x31e9a8(0x239)]+'\x22:\x20'+_0x96af7[_0x31e9a8(0x202)]));}for(const _0xc5dd4e of _0x3e2ac1[_0x31e9a8(0x22d)]){_0xc5dd4e[_0x31e9a8(0x1e7)]===_0x31e9a8(0x202)&&console[_0x31e9a8(0x240)](a4_0x1e3c51[_0x31e9a8(0x20b)](_0x31e9a8(0x247)+_0xc5dd4e['name']+_0x31e9a8(0x20f)+_0xc5dd4e[_0x31e9a8(0x202)]));}return 0x1;}console['log'](a4_0x1e3c51[_0x31e9a8(0x24c)](_0x31e9a8(0x212)+(_0xa9c106+_0x5cb985)+_0x31e9a8(0x288)+_0x3e2ac1[_0x31e9a8(0x26b)]+'\x27'));const _0x1f56fe=getLLMProjectUrl(_0x165d7b,_0x3e2ac1[_0x31e9a8(0x1fe)]);return console[_0x31e9a8(0x240)](_0x31e9a8(0x23e)+a4_0x1e3c51['cyan'](_0x1f56fe)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x16b20c=a5_0x3068;(function(_0x1aa731,_0x3410c0){const _0x2416ba=a5_0x3068,_0x422464=_0x1aa731();while(!![]){try{const _0x353973=parseInt(_0x2416ba(0x11d))/0x1*(parseInt(_0x2416ba(0x11f))/0x2)+parseInt(_0x2416ba(0x166))/0x3+parseInt(_0x2416ba(0x15f))/0x4*(-parseInt(_0x2416ba(0x13b))/0x5)+parseInt(_0x2416ba(0x189))/0x6+-parseInt(_0x2416ba(0x128))/0x7*(parseInt(_0x2416ba(0x115))/0x8)+parseInt(_0x2416ba(0x15a))/0x9+-parseInt(_0x2416ba(0x13f))/0xa*(-parseInt(_0x2416ba(0x17b))/0xb);if(_0x353973===_0x3410c0)break;else _0x422464['push'](_0x422464['shift']());}catch(_0x5d05de){_0x422464['push'](_0x422464['shift']());}}}(a5_0x8649,0x34c17));function a5_0x3068(_0x3fa6fb,_0x3d7a4c){_0x3fa6fb=_0x3fa6fb-0x101;const _0x86495=a5_0x8649();let _0x3068a1=_0x86495[_0x3fa6fb];return _0x3068a1;}import*as a5_0x2efd97 from'node:fs';import*as a5_0x2d59c5 from'node:path';import a5_0x4c6d88 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';function a5_0x8649(){const _0x37eda0=['agent','repeat','some','Evaluating\x20response...','...\x20','basename','Failed\x20Tests:','toISOString','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)','Tests\x20found:\x20','Re-evaluating...','Error\x20writing\x20output\x20file:\x20','start','Either\x20switch\x20to\x20the\x20\x22','301741wbfSmz','llm','projectName','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','timestamp','Cached\x20run\x20from:\x20','Output\x20written\x20to:\x20','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','has','stop','green','message','executeReeval','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','882696dNbKFk','eval','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','status','Errors:\x20\x20\x20','description','\x20\x20Evaluating...\x20','log','split','Running\x20agent\x20tests...','No\x20tests\x20have\x20tags\x20defined.','reeval','✗\x20ERROR:\x20Project\x20not\x20found:\x20','multiple_agents','\x22,\x20but\x20current\x20site\x20is\x20\x22','Agent:\x20','isSpinning','name','source','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','\x20-\x20','reason','Re-evaluating\x20','dim','agent:test','push','agentDirs','✗\x20ERROR:\x20','site','json','No\x20tests\x20found\x20matching:\x20','test.yml','Run\x20\x27tdx\x20agent\x20pull\x20','\x20(cached)','found','16uAmEcQ','text','table','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','Cached\x20run\x20is\x20from\x20site\x20\x22','Available\x20tags:\x20','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','404','5UICADL','not\x20found','147342GskxzH','Available\x20tests:\x20','Test\x20Configuration:','forEach','\x27\x20to\x20create\x20the\x20folder\x20structure.','projectDir','Conversation\x20URL:\x20','Using\x20agent:\x20','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','1329139RAMiCO','length','Total:\x20\x20\x20\x20','add','PASS','round','\x20\x20Round\x20','Re-evaluation\x20Summary','jsonl','output','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','verbose','red','context','agentName','utf-8','Executing\x20new\x20tests...','resolveAgentId','Round\x201/','75qhIjqq','tests','toLowerCase','⚠\x20SKIPPED:\x20','10BIUviL','Passed:\x20\x20\x20','New\x20tests\x20to\x20execute:\x20','\x20(new)','cyan','Failed:\x20\x20\x20','tsv','find','rounds','\x22:\x20','filter','Running\x20test:\x20','Error:\x20No\x20previous\x20test\x20run\x20found.','tags','Project\x20path:\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','Test\x20','conversation_url','llmProject','✗\x20FAIL:\x20','✓\x20PASS:\x20','yellow','ERROR','testName','writeFileSync','\x20\x20Conversation:\x20','existsSync','1815687XpddDR','white','resolve','...','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','87020CJAQBk','resolveProjectId','no_local_folder','map','conversations','FAIL',':\x20Sending\x20user\x20input...','532563alrhHn','join','now','includes','\x20\x20Site:\x20'];a5_0x8649=function(){return _0x37eda0;};return a5_0x8649();}import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x16b20c(0x103)]=a5_0x16b20c(0x10a);[a5_0x16b20c(0x18e)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async['execute'](_0x3e4d34){const _0xf8f4fb=a5_0x16b20c,{options:_0x56f7b3,args:_0x31c33e,tdx:_0x5dadae}=_0x3e4d34,_0x4fda5d=_0x31c33e[0x0]||'.',_0x4bb226=_0x56f7b3['dryRun'],_0x48b1eb=_0x56f7b3,_0x16384c=_0x48b1eb[_0xf8f4fb(0x18a)]===![],_0x28e159=_0x48b1eb[_0xf8f4fb(0x194)],_0xef2f87=_0x48b1eb['name'],_0x1efccf=_0x48b1eb[_0xf8f4fb(0x14c)],_0x172b2f=_0x56f7b3['site'],_0x4b941a=_0x48b1eb[_0xf8f4fb(0x131)];if(_0x28e159&&_0x16384c)return console[_0xf8f4fb(0x190)](a5_0x4c6d88[_0xf8f4fb(0x134)](_0xf8f4fb(0x127))),0x1;let _0x3d9fb4='table';if(_0x48b1eb['json'])_0x3d9fb4=_0xf8f4fb(0x10f);else{if(_0x48b1eb['jsonl'])_0x3d9fb4=_0xf8f4fb(0x130);else{if(_0x48b1eb[_0xf8f4fb(0x145)])_0x3d9fb4='tsv';else{if(_0x48b1eb[_0xf8f4fb(0x117)])_0x3d9fb4=_0xf8f4fb(0x117);}}}const _0x521e5f=_0x48b1eb['llmProject'];let _0x47ab6b=_0x4fda5d;const _0xe55525=a5_0x2efd97[_0xf8f4fb(0x159)](_0x4fda5d),_0x44fdcf=_0x4fda5d==='.';if(!_0xe55525||_0x44fdcf){const _0x5a380d=resolveProjectFromContext(_0x4fda5d,_0x521e5f,{'requireFile':_0xf8f4fb(0x111)});if(_0x5a380d[_0xf8f4fb(0x114)])_0x47ab6b=_0x5a380d[_0xf8f4fb(0x124)],_0x5a380d[_0xf8f4fb(0x104)]===_0xf8f4fb(0x135)&&console[_0xf8f4fb(0x190)](a5_0x4c6d88[_0xf8f4fb(0x109)](_0xf8f4fb(0x126)+_0x47ab6b));else switch(_0x5a380d['reason']){case'no_context':console[_0xf8f4fb(0x190)](a5_0x4c6d88[_0xf8f4fb(0x154)](_0x5a380d[_0xf8f4fb(0x186)])),console[_0xf8f4fb(0x190)](),console[_0xf8f4fb(0x190)]('Usage:'),console[_0xf8f4fb(0x190)]('\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[_0xf8f4fb(0x190)](_0xf8f4fb(0x175)),console['log'](),console['log'](_0xf8f4fb(0x188));return 0x1;case _0xf8f4fb(0x161):console['log'](a5_0x4c6d88[_0xf8f4fb(0x154)](_0x5a380d['message'])),console[_0xf8f4fb(0x190)](),console[_0xf8f4fb(0x190)](_0xf8f4fb(0x112)+_0x5a380d[_0xf8f4fb(0x151)]+_0xf8f4fb(0x123));return 0x1;case _0xf8f4fb(0x196):{const _0x2d4bb2=a5_0x2d59c5[_0xf8f4fb(0x170)](_0x5a380d[_0xf8f4fb(0x124)]);console[_0xf8f4fb(0x190)](a5_0x4c6d88['yellow'](_0xf8f4fb(0x18b)+_0x5a380d[_0xf8f4fb(0x151)]+'\x22:'));for(const _0x34a2e2 of _0x5a380d[_0xf8f4fb(0x10c)]){console['log']('\x20\x20-\x20'+_0x34a2e2);}return console['log'](),console['log'](_0xf8f4fb(0x105)+_0x2d4bb2+'/<agent-name>'),0x1;}case'no_tests':console[_0xf8f4fb(0x190)](a5_0x4c6d88[_0xf8f4fb(0x154)](_0xf8f4fb(0x182)+_0x5a380d['llmProject']+'\x22.')),console[_0xf8f4fb(0x190)](a5_0x4c6d88['dim'](_0xf8f4fb(0x14d)+_0x5a380d[_0xf8f4fb(0x124)])),console[_0xf8f4fb(0x190)](),console[_0xf8f4fb(0x190)](_0xf8f4fb(0x15e));return 0x1;}}const {definition:_0x499b34,agentInfo:_0x179233}=parseTestFile(_0x47ab6b);let _0x9d2432=_0x499b34[_0xf8f4fb(0x13c)];if(_0xef2f87){const _0xfbc3ee=_0xef2f87[_0xf8f4fb(0x191)](',')[_0xf8f4fb(0x162)](_0x14e016=>_0x14e016['trim']());_0x9d2432=_0x499b34['tests'][_0xf8f4fb(0x149)](_0x4e8cbc=>_0xfbc3ee[_0xf8f4fb(0x169)](_0x4e8cbc['name']));if(_0x9d2432['length']===0x0)return console['log'](a5_0x4c6d88['yellow'](_0xf8f4fb(0x110)+_0xef2f87)),console[_0xf8f4fb(0x190)](a5_0x4c6d88[_0xf8f4fb(0x109)](_0xf8f4fb(0x120)+_0x499b34[_0xf8f4fb(0x13c)][_0xf8f4fb(0x162)](_0x319fc0=>_0x319fc0['name'])[_0xf8f4fb(0x167)](',\x20'))),0x1;}if(_0x1efccf){const _0x2ddbe3=_0x1efccf[_0xf8f4fb(0x191)](',')['map'](_0x48c540=>_0x48c540['trim']()[_0xf8f4fb(0x13d)]());_0x9d2432=_0x9d2432[_0xf8f4fb(0x149)](_0x30439d=>_0x30439d[_0xf8f4fb(0x14c)]?.[_0xf8f4fb(0x16d)](_0x52dc9c=>_0x2ddbe3[_0xf8f4fb(0x169)](_0x52dc9c['toLowerCase']())));if(_0x9d2432[_0xf8f4fb(0x129)]===0x0){console[_0xf8f4fb(0x190)](a5_0x4c6d88['yellow']('No\x20tests\x20found\x20with\x20tags:\x20'+_0x1efccf));const _0x3a856b=new Set();return _0x499b34[_0xf8f4fb(0x13c)][_0xf8f4fb(0x122)](_0x56170c=>_0x56170c[_0xf8f4fb(0x14c)]?.[_0xf8f4fb(0x122)](_0x395849=>_0x3a856b[_0xf8f4fb(0x12b)](_0x395849))),_0x3a856b['size']>0x0?console[_0xf8f4fb(0x190)](a5_0x4c6d88[_0xf8f4fb(0x109)](_0xf8f4fb(0x11a)+[..._0x3a856b][_0xf8f4fb(0x167)](',\x20'))):console[_0xf8f4fb(0x190)](a5_0x4c6d88[_0xf8f4fb(0x109)](_0xf8f4fb(0x193))),0x1;}}if(_0x28e159)return this['executeReeval'](_0x3e4d34,{'definition':{'tests':_0x9d2432},'agentInfo':_0x179233,'outputFormat':_0x3d9fb4,'outputFile':_0x4b941a,'testNames':_0xef2f87});if(_0x4bb226){console['log'](a5_0x4c6d88[_0xf8f4fb(0x143)](_0xf8f4fb(0x121))),console[_0xf8f4fb(0x190)](_0xf8f4fb(0x16a)+a5_0x4c6d88[_0xf8f4fb(0x15b)](_0x172b2f)),console[_0xf8f4fb(0x190)]('\x20\x20Project:\x20'+a5_0x4c6d88[_0xf8f4fb(0x15b)](_0x179233[_0xf8f4fb(0x17d)])),console[_0xf8f4fb(0x190)]('\x20\x20Agent:\x20'+a5_0x4c6d88[_0xf8f4fb(0x15b)](_0x179233[_0xf8f4fb(0x136)])),console[_0xf8f4fb(0x190)](),console[_0xf8f4fb(0x190)](_0xf8f4fb(0x176)+a5_0x4c6d88[_0xf8f4fb(0x15b)](_0x9d2432['length']));for(let _0x5557ef=0x0;_0x5557ef<_0x9d2432['length'];_0x5557ef++){const _0x3ca0a8=_0x9d2432[_0x5557ef],_0x244131=_0x3ca0a8[_0xf8f4fb(0x147)]['length']===0x1?_0xf8f4fb(0x12d):_0xf8f4fb(0x147),_0x3d5ea2=_0x3ca0a8[_0xf8f4fb(0x14c)]?.[_0xf8f4fb(0x129)]?'\x20['+_0x3ca0a8['tags'][_0xf8f4fb(0x167)](',\x20')+']':'';console[_0xf8f4fb(0x190)]('\x20\x20'+(_0x5557ef+0x1)+'.\x20'+a5_0x4c6d88[_0xf8f4fb(0x15b)](_0x3ca0a8[_0xf8f4fb(0x103)])+'\x20('+_0x3ca0a8['rounds']['length']+'\x20'+_0x244131+')'+a5_0x4c6d88[_0xf8f4fb(0x109)](_0x3d5ea2));}return 0x0;}let _0x4f1f54,_0x59e3ac;try{_0x4f1f54=await _0x5dadae[_0xf8f4fb(0x17c)][_0xf8f4fb(0x160)](_0x179233['projectName']);}catch(_0x2c3f2a){const _0x1abdea=_0x2c3f2a instanceof Error?_0x2c3f2a['message']:String(_0x2c3f2a);return _0x1abdea['includes'](_0xf8f4fb(0x11c))||_0x1abdea['toLowerCase']()['includes'](_0xf8f4fb(0x11e))?console[_0xf8f4fb(0x190)](a5_0x4c6d88[_0xf8f4fb(0x134)](_0xf8f4fb(0x195)+_0x179233[_0xf8f4fb(0x17d)])):console['log'](a5_0x4c6d88[_0xf8f4fb(0x134)](_0xf8f4fb(0x17e)+_0x179233[_0xf8f4fb(0x17d)]+'\x22:\x20'+_0x1abdea)),0x1;}try{_0x59e3ac=await _0x5dadae['llm'][_0xf8f4fb(0x139)](_0x179233['agentName'],_0x4f1f54);}catch(_0x274277){const _0xe9fda1=_0x274277 instanceof Error?_0x274277[_0xf8f4fb(0x186)]:String(_0x274277);return _0xe9fda1[_0xf8f4fb(0x169)](_0xf8f4fb(0x11c))||_0xe9fda1[_0xf8f4fb(0x13d)]()[_0xf8f4fb(0x169)](_0xf8f4fb(0x11e))?console[_0xf8f4fb(0x190)](a5_0x4c6d88[_0xf8f4fb(0x134)](_0xf8f4fb(0x173)+_0x179233['agentName'])):console[_0xf8f4fb(0x190)](a5_0x4c6d88[_0xf8f4fb(0x134)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x179233[_0xf8f4fb(0x136)]+_0xf8f4fb(0x148)+_0xe9fda1)),0x1;}let _0x13fa07;if(!_0x16384c)try{_0x13fa07=await setupEvaluatorAgent(_0x5dadae['llm'],_0x56f7b3['verbose']);}catch(_0x1808f9){const _0x429f5f=_0x1808f9 instanceof Error?_0x1808f9[_0xf8f4fb(0x186)]:String(_0x1808f9);return console[_0xf8f4fb(0x190)](a5_0x4c6d88[_0xf8f4fb(0x134)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x429f5f)),0x1;}console[_0xf8f4fb(0x190)](a5_0x4c6d88[_0xf8f4fb(0x143)](_0xf8f4fb(0x192))),console[_0xf8f4fb(0x190)]('Site:\x20'+a5_0x4c6d88[_0xf8f4fb(0x15b)](_0x172b2f)),console['log'](_0xf8f4fb(0x101)+a5_0x4c6d88['white'](_0x179233[_0xf8f4fb(0x17d)]+'/'+_0x179233['agentName'])),console['log']();const _0x5078f7=[],_0x351b5a=[],_0x247ebb=Date['now']();for(let _0x3df30e=0x0;_0x3df30e<_0x9d2432[_0xf8f4fb(0x129)];_0x3df30e++){const _0x39167b=_0x9d2432[_0x3df30e];_0x9d2432[_0xf8f4fb(0x129)]>0x1?console['log'](_0xf8f4fb(0x14f)+(_0x3df30e+0x1)+'/'+_0x9d2432['length']+':\x20'+a5_0x4c6d88['white'](_0x39167b['name'])):console[_0xf8f4fb(0x190)](_0xf8f4fb(0x14a)+a5_0x4c6d88['white'](_0x39167b[_0xf8f4fb(0x103)]));const _0x1512c8=createCommandSpinner(_0xf8f4fb(0x13a)+_0x39167b[_0xf8f4fb(0x147)][_0xf8f4fb(0x129)]+_0xf8f4fb(0x165));_0x1512c8[_0xf8f4fb(0x179)]();try{const {result:_0xd9a89,conversation:_0x354b95}=await runTest(_0x5dadae[_0xf8f4fb(0x17c)],_0x39167b,{'agentId':_0x59e3ac,'projectId':_0x4f1f54,'site':_0x172b2f,'noEval':_0x16384c,'evaluatorId':_0x13fa07,'onRoundStart':(_0x3f61fc,_0x35e649)=>{const _0x40394c=_0xf8f4fb;_0x1512c8[_0x40394c(0x116)]='Round\x20'+(_0x3f61fc+0x1)+'/'+_0x35e649+_0x40394c(0x165);},'onRoundComplete':(_0xfefbe8,_0x575404,_0x3aebaa)=>{const _0x1bf669=_0xf8f4fb,_0x5bec37=formatElapsed(_0x575404);_0x3aebaa?console[_0x1bf669(0x190)]('\x20\x20Round\x20'+(_0xfefbe8+0x1)+'/'+_0x39167b[_0x1bf669(0x147)]['length']+_0x1bf669(0x16f)+a5_0x4c6d88[_0x1bf669(0x185)]('✓')+'\x20('+_0x5bec37+')'):console['log'](_0x1bf669(0x12e)+(_0xfefbe8+0x1)+'/'+_0x39167b[_0x1bf669(0x147)][_0x1bf669(0x129)]+_0x1bf669(0x16f)+a5_0x4c6d88[_0x1bf669(0x134)]('✗'));},'onEvaluationStart':()=>{const _0x4e5cd5=_0xf8f4fb;_0x1512c8[_0x4e5cd5(0x116)]=_0x4e5cd5(0x16e);},'onEvaluationComplete':_0x1596ad=>{const _0x4f3234=_0xf8f4fb,_0x218959=formatElapsed(_0x1596ad);console[_0x4f3234(0x190)](_0x4f3234(0x18f)+a5_0x4c6d88[_0x4f3234(0x185)]('✓')+'\x20('+_0x218959+')');}});_0x1512c8[_0xf8f4fb(0x184)](),_0x5078f7[_0xf8f4fb(0x10b)](_0xd9a89),_0x351b5a[_0xf8f4fb(0x10b)](_0x354b95);if(_0xd9a89[_0xf8f4fb(0x18c)]===_0xf8f4fb(0x12c))console[_0xf8f4fb(0x190)](a5_0x4c6d88[_0xf8f4fb(0x185)](_0xf8f4fb(0x153)+_0xd9a89[_0xf8f4fb(0x107)]));else _0xd9a89[_0xf8f4fb(0x18c)]===_0xf8f4fb(0x164)?console[_0xf8f4fb(0x190)](a5_0x4c6d88[_0xf8f4fb(0x134)]('✗\x20FAIL:\x20'+_0xd9a89[_0xf8f4fb(0x107)])):console[_0xf8f4fb(0x190)](a5_0x4c6d88[_0xf8f4fb(0x134)]('✗\x20ERROR:\x20'+_0xd9a89[_0xf8f4fb(0x107)]));_0xd9a89['conversation_url']&&console[_0xf8f4fb(0x190)](a5_0x4c6d88['dim'](_0xf8f4fb(0x125)+_0xd9a89['conversation_url'])),console[_0xf8f4fb(0x190)]();}catch(_0x47ff6c){_0x1512c8[_0xf8f4fb(0x184)]();const _0x390be3=_0x47ff6c instanceof Error?_0x47ff6c[_0xf8f4fb(0x186)]:String(_0x47ff6c);console[_0xf8f4fb(0x190)](a5_0x4c6d88['red']('✗\x20ERROR:\x20'+_0x390be3)),console[_0xf8f4fb(0x190)](),_0x5078f7[_0xf8f4fb(0x10b)]({'name':_0x39167b['name'],'status':_0xf8f4fb(0x155),'reason':_0x390be3,'timestamp':new Date()[_0xf8f4fb(0x172)](),'duration_ms':0x0});}}const _0x1a1271=Date[_0xf8f4fb(0x168)]()-_0x247ebb,_0x4105c6=_0x5078f7['filter'](_0x1ed7d6=>_0x1ed7d6[_0xf8f4fb(0x18c)]==='PASS')[_0xf8f4fb(0x129)],_0x3ffaa6=_0x5078f7['filter'](_0x9192a5=>_0x9192a5['status']===_0xf8f4fb(0x164))[_0xf8f4fb(0x129)],_0x25dd14=_0x5078f7['filter'](_0x5f4ee7=>_0x5f4ee7[_0xf8f4fb(0x18c)]===_0xf8f4fb(0x155))[_0xf8f4fb(0x129)];console[_0xf8f4fb(0x190)]('━'[_0xf8f4fb(0x16c)](0x3c)),console[_0xf8f4fb(0x190)]('Test\x20Summary'),console[_0xf8f4fb(0x190)]('━'[_0xf8f4fb(0x16c)](0x3c)),console[_0xf8f4fb(0x190)](_0xf8f4fb(0x12a)+_0x5078f7[_0xf8f4fb(0x129)]),console['log'](_0xf8f4fb(0x140)+a5_0x4c6d88[_0xf8f4fb(0x185)](_0x4105c6)),console['log'](_0xf8f4fb(0x144)+a5_0x4c6d88['red'](_0x3ffaa6));_0x25dd14>0x0&&console[_0xf8f4fb(0x190)](_0xf8f4fb(0x18d)+a5_0x4c6d88['red'](_0x25dd14));console[_0xf8f4fb(0x190)]('Duration:\x20'+formatElapsed(_0x1a1271)),console[_0xf8f4fb(0x190)]('━'[_0xf8f4fb(0x16c)](0x3c));const _0x36aa1f=_0x5078f7[_0xf8f4fb(0x149)](_0xc51a18=>_0xc51a18['status']!=='PASS');if(_0x36aa1f['length']>0x0){console[_0xf8f4fb(0x190)](),console[_0xf8f4fb(0x190)](_0xf8f4fb(0x171));for(const _0x262fc4 of _0x36aa1f){const _0x11e443=a5_0x4c6d88[_0xf8f4fb(0x134)]('✗'),_0x15af83=_0x262fc4[_0xf8f4fb(0x107)]['length']>0x32?_0x262fc4[_0xf8f4fb(0x107)]['substring'](0x0,0x32)+_0xf8f4fb(0x15d):_0x262fc4['reason'];console[_0xf8f4fb(0x190)]('\x20\x20'+_0x11e443+'\x20'+_0x262fc4[_0xf8f4fb(0x103)]+':\x20'+_0x15af83);}}const _0x2fb69a={'summary':{'total':_0x5078f7['length'],'passed':_0x4105c6,'failed':_0x3ffaa6,'errors':_0x25dd14>0x0?_0x25dd14:undefined,'duration_ms':_0x1a1271},'tests':_0x5078f7,'agent':{'project':_0x179233[_0xf8f4fb(0x17d)],'name':_0x179233[_0xf8f4fb(0x136)],'site':_0x172b2f},'timestamp':new Date(_0x247ebb)[_0xf8f4fb(0x172)]()};try{const _0x4926c7=buildCachedTestRun(_0x351b5a,{'site':_0x172b2f,'projectId':_0x4f1f54,'projectName':_0x179233[_0xf8f4fb(0x17d)],'agentId':_0x59e3ac,'agentName':_0x179233[_0xf8f4fb(0x136)],'testYmlPath':a5_0x2d59c5[_0xf8f4fb(0x15c)](_0x179233['testYmlPath'])});saveLastTestRun(_0x4926c7);}catch{}if(_0x3d9fb4!==_0xf8f4fb(0x117)||_0x4b941a){const _0x24c0d1=formatResults(_0x2fb69a,_0x3d9fb4);if(_0x4b941a)try{a5_0x2efd97[_0xf8f4fb(0x157)](_0x4b941a,_0x24c0d1,_0xf8f4fb(0x137)),console[_0xf8f4fb(0x190)](),console[_0xf8f4fb(0x190)](a5_0x4c6d88[_0xf8f4fb(0x109)](_0xf8f4fb(0x181)+_0x4b941a));}catch(_0x1ed37e){return console['log'](),console[_0xf8f4fb(0x190)](a5_0x4c6d88[_0xf8f4fb(0x134)](_0xf8f4fb(0x178)+_0x1ed37e)),0x1;}else console['log'](),console['log'](_0x24c0d1);}return _0x36aa1f[_0xf8f4fb(0x129)]>0x0?0x1:0x0;}async[a5_0x16b20c(0x187)](_0x293791,_0x472e1f){const _0x48e90a=a5_0x16b20c,{options:_0x1e8211,tdx:_0x106e0a}=_0x293791,{definition:_0x4dca93,agentInfo:_0x45b5a,outputFormat:_0x44ed6b,outputFile:_0x5c4957}=_0x472e1f,_0x5dc3db=_0x1e8211[_0x48e90a(0x10e)],_0x2fe8e6=loadLastTestRun();if(!_0x2fe8e6)return console[_0x48e90a(0x190)](a5_0x4c6d88['red'](_0x48e90a(0x14b))),console['log'](a5_0x4c6d88[_0x48e90a(0x109)](_0x48e90a(0x174))),0x1;if(_0x2fe8e6[_0x48e90a(0x16b)][_0x48e90a(0x136)]!==_0x45b5a[_0x48e90a(0x136)])return console[_0x48e90a(0x190)](a5_0x4c6d88[_0x48e90a(0x134)](_0x48e90a(0x118)+_0x2fe8e6[_0x48e90a(0x16b)][_0x48e90a(0x136)]+_0x48e90a(0x132)+_0x45b5a[_0x48e90a(0x136)]+'\x22.')),console[_0x48e90a(0x190)](a5_0x4c6d88[_0x48e90a(0x109)]('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x35b451=new Set(_0x2fe8e6[_0x48e90a(0x163)][_0x48e90a(0x162)](_0x10167b=>_0x10167b[_0x48e90a(0x156)])),_0x4dd572=_0x4dca93[_0x48e90a(0x13c)][_0x48e90a(0x149)](_0x535dfb=>!_0x35b451[_0x48e90a(0x183)](_0x535dfb[_0x48e90a(0x103)]));if(_0x4dd572[_0x48e90a(0x129)]>0x0&&_0x2fe8e6['site']!==_0x5dc3db)return console['log'](a5_0x4c6d88[_0x48e90a(0x134)]('Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.')),console['log'](a5_0x4c6d88[_0x48e90a(0x109)](_0x48e90a(0x119)+_0x2fe8e6[_0x48e90a(0x10e)]+_0x48e90a(0x197)+_0x5dc3db+'\x22.')),console[_0x48e90a(0x190)](a5_0x4c6d88['dim'](_0x48e90a(0x17a)+_0x2fe8e6[_0x48e90a(0x10e)]+_0x48e90a(0x14e))),0x1;const _0x33f380=_0x4dca93['tests'][_0x48e90a(0x149)](_0x184bdc=>_0x35b451['has'](_0x184bdc[_0x48e90a(0x103)])),_0x5046bc=_0x4dd572;let _0xa306de;try{_0xa306de=await setupEvaluatorAgent(_0x106e0a[_0x48e90a(0x17c)],_0x1e8211[_0x48e90a(0x133)]);}catch(_0x61c32c){const _0x5e617b=_0x61c32c instanceof Error?_0x61c32c[_0x48e90a(0x186)]:String(_0x61c32c);return console['log'](a5_0x4c6d88[_0x48e90a(0x134)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x5e617b)),0x1;}console[_0x48e90a(0x190)](a5_0x4c6d88[_0x48e90a(0x143)]('Re-evaluating\x20cached\x20test\x20run...')),console['log'](_0x48e90a(0x180)+a5_0x4c6d88[_0x48e90a(0x15b)](_0x2fe8e6[_0x48e90a(0x17f)])),console[_0x48e90a(0x190)]('Agent:\x20'+a5_0x4c6d88[_0x48e90a(0x15b)](_0x2fe8e6['agent'][_0x48e90a(0x17d)]+'/'+_0x2fe8e6[_0x48e90a(0x16b)][_0x48e90a(0x136)]));_0x5046bc[_0x48e90a(0x129)]>0x0&&console[_0x48e90a(0x190)](_0x48e90a(0x141)+a5_0x4c6d88[_0x48e90a(0x154)](_0x5046bc[_0x48e90a(0x129)]));console[_0x48e90a(0x190)]();const _0x6e2aa3=[],_0x83539d=Date[_0x48e90a(0x168)](),_0x68e053=createCommandSpinner(_0x48e90a(0x177));if(_0x33f380['length']>0x0)try{const _0x467e0d=await reevaluateFromCache(_0x106e0a['llm'],_0x2fe8e6,{'tests':_0x33f380},{'evaluatorId':_0xa306de,'onTestStart':(_0x22ad1a,_0x1ce086,_0x177cd2)=>{const _0x6cfaae=_0x48e90a;_0x68e053[_0x6cfaae(0x116)]=_0x6cfaae(0x108)+(_0x1ce086+0x1)+'/'+_0x177cd2+':\x20'+_0x22ad1a+_0x6cfaae(0x15d);if(!_0x68e053[_0x6cfaae(0x102)])_0x68e053[_0x6cfaae(0x179)]();},'onTestComplete':(_0x5bdaa4,_0x189eb8)=>{const _0x19293e=_0x48e90a;_0x68e053[_0x19293e(0x184)]();if(_0x189eb8['status']==='PASS')console['log'](a5_0x4c6d88[_0x19293e(0x185)](_0x19293e(0x153)+_0x5bdaa4)+a5_0x4c6d88[_0x19293e(0x109)](_0x19293e(0x113)));else _0x189eb8[_0x19293e(0x18c)]===_0x19293e(0x164)?console[_0x19293e(0x190)](a5_0x4c6d88[_0x19293e(0x134)](_0x19293e(0x152)+_0x5bdaa4+'\x20-\x20'+_0x189eb8[_0x19293e(0x107)])+a5_0x4c6d88['dim'](_0x19293e(0x113))):console[_0x19293e(0x190)](a5_0x4c6d88[_0x19293e(0x134)](_0x19293e(0x10d)+_0x5bdaa4+_0x19293e(0x106)+_0x189eb8[_0x19293e(0x107)]));_0x189eb8[_0x19293e(0x150)]&&console[_0x19293e(0x190)](a5_0x4c6d88[_0x19293e(0x109)]('\x20\x20Conversation:\x20'+_0x189eb8[_0x19293e(0x150)])),_0x6e2aa3[_0x19293e(0x10b)](_0x189eb8);},'onTestSkipped':(_0x1f6226,_0x46500a)=>{const _0x555cbd=_0x48e90a;_0x68e053[_0x555cbd(0x184)](),console[_0x555cbd(0x190)](a5_0x4c6d88[_0x555cbd(0x154)](_0x555cbd(0x13e)+_0x1f6226+_0x555cbd(0x106)+_0x46500a));}});for(const _0x289853 of _0x467e0d){!_0x6e2aa3[_0x48e90a(0x146)](_0x3d4e37=>_0x3d4e37['name']===_0x289853[_0x48e90a(0x103)])&&_0x6e2aa3[_0x48e90a(0x10b)](_0x289853);}}catch(_0x4a9f5e){_0x68e053[_0x48e90a(0x184)]();const _0x445c35=_0x4a9f5e instanceof Error?_0x4a9f5e[_0x48e90a(0x186)]:String(_0x4a9f5e);return console[_0x48e90a(0x190)](a5_0x4c6d88[_0x48e90a(0x134)](_0x48e90a(0x11b)+_0x445c35)),0x1;}_0x68e053[_0x48e90a(0x184)]();if(_0x5046bc[_0x48e90a(0x129)]>0x0){console['log'](),console[_0x48e90a(0x190)](a5_0x4c6d88[_0x48e90a(0x143)](_0x48e90a(0x138)));const {projectId:_0x1f791b,agentId:_0x30d74d}=_0x2fe8e6['agent'];for(const _0xd1e403 of _0x5046bc){console[_0x48e90a(0x190)]('Running:\x20'+a5_0x4c6d88[_0x48e90a(0x15b)](_0xd1e403[_0x48e90a(0x103)]));const _0x1ff200=createCommandSpinner(_0x48e90a(0x13a)+_0xd1e403[_0x48e90a(0x147)][_0x48e90a(0x129)]+_0x48e90a(0x165));_0x1ff200[_0x48e90a(0x179)]();try{const {result:_0x3d2ca0}=await runTest(_0x106e0a['llm'],_0xd1e403,{'agentId':_0x30d74d,'projectId':_0x1f791b,'site':_0x2fe8e6[_0x48e90a(0x10e)],'noEval':![],'evaluatorId':_0xa306de,'onRoundStart':(_0x1fe20e,_0x465e84)=>{const _0x5ba848=_0x48e90a;_0x1ff200[_0x5ba848(0x116)]='Round\x20'+(_0x1fe20e+0x1)+'/'+_0x465e84+_0x5ba848(0x165);},'onRoundComplete':(_0xe528cb,_0x479937,_0x530888)=>{const _0x35d221=_0x48e90a,_0x4826d3=formatElapsed(_0x479937);_0x530888?console[_0x35d221(0x190)](_0x35d221(0x12e)+(_0xe528cb+0x1)+'/'+_0xd1e403[_0x35d221(0x147)][_0x35d221(0x129)]+_0x35d221(0x16f)+a5_0x4c6d88['green']('✓')+'\x20('+_0x4826d3+')'):console[_0x35d221(0x190)](_0x35d221(0x12e)+(_0xe528cb+0x1)+'/'+_0xd1e403[_0x35d221(0x147)][_0x35d221(0x129)]+_0x35d221(0x16f)+a5_0x4c6d88['red']('✗'));},'onEvaluationStart':()=>{const _0x3fda1b=_0x48e90a;_0x1ff200[_0x3fda1b(0x116)]='Evaluating\x20response...';},'onEvaluationComplete':_0x39008e=>{const _0x1af052=_0x48e90a,_0x1fc4c1=formatElapsed(_0x39008e);console['log'](_0x1af052(0x18f)+a5_0x4c6d88[_0x1af052(0x185)]('✓')+'\x20('+_0x1fc4c1+')');}});_0x1ff200[_0x48e90a(0x184)](),_0x6e2aa3[_0x48e90a(0x10b)](_0x3d2ca0);if(_0x3d2ca0['status']==='PASS')console['log'](a5_0x4c6d88[_0x48e90a(0x185)](_0x48e90a(0x153)+_0x3d2ca0[_0x48e90a(0x107)])+a5_0x4c6d88[_0x48e90a(0x109)](_0x48e90a(0x142)));else _0x3d2ca0[_0x48e90a(0x18c)]==='FAIL'?console[_0x48e90a(0x190)](a5_0x4c6d88[_0x48e90a(0x134)](_0x48e90a(0x152)+_0x3d2ca0['reason'])+a5_0x4c6d88[_0x48e90a(0x109)](_0x48e90a(0x142))):console[_0x48e90a(0x190)](a5_0x4c6d88[_0x48e90a(0x134)]('✗\x20ERROR:\x20'+_0x3d2ca0['reason']));_0x3d2ca0[_0x48e90a(0x150)]&&console['log'](a5_0x4c6d88['dim'](_0x48e90a(0x158)+_0x3d2ca0[_0x48e90a(0x150)]));}catch(_0x326277){_0x1ff200['stop']();const _0xcc655f=_0x326277 instanceof Error?_0x326277['message']:String(_0x326277);console[_0x48e90a(0x190)](a5_0x4c6d88['red']('✗\x20ERROR:\x20'+_0xcc655f)),_0x6e2aa3[_0x48e90a(0x10b)]({'name':_0xd1e403['name'],'status':_0x48e90a(0x155),'reason':_0xcc655f,'timestamp':new Date()[_0x48e90a(0x172)](),'duration_ms':0x0});}}}console['log']();const _0x280cc3=Date[_0x48e90a(0x168)]()-_0x83539d,_0x15b168=_0x6e2aa3[_0x48e90a(0x149)](_0x40c547=>_0x40c547[_0x48e90a(0x18c)]===_0x48e90a(0x12c))['length'],_0x45b9b0=_0x6e2aa3['filter'](_0x3effe7=>_0x3effe7[_0x48e90a(0x18c)]==='FAIL')['length'],_0x2d70bc=_0x6e2aa3[_0x48e90a(0x149)](_0x4f2ca5=>_0x4f2ca5[_0x48e90a(0x18c)]===_0x48e90a(0x155))['length'];console['log']('━'[_0x48e90a(0x16c)](0x3c)),console[_0x48e90a(0x190)](_0x48e90a(0x12f)),console[_0x48e90a(0x190)]('━'[_0x48e90a(0x16c)](0x3c)),console['log']('Total:\x20\x20\x20\x20'+_0x6e2aa3[_0x48e90a(0x129)]),console[_0x48e90a(0x190)](_0x48e90a(0x140)+a5_0x4c6d88[_0x48e90a(0x185)](_0x15b168)),console[_0x48e90a(0x190)](_0x48e90a(0x144)+a5_0x4c6d88[_0x48e90a(0x134)](_0x45b9b0));_0x2d70bc>0x0&&console[_0x48e90a(0x190)](_0x48e90a(0x18d)+a5_0x4c6d88[_0x48e90a(0x134)](_0x2d70bc));console[_0x48e90a(0x190)]('Duration:\x20'+formatElapsed(_0x280cc3)),console[_0x48e90a(0x190)]('━'[_0x48e90a(0x16c)](0x3c));const _0x1d2551={'summary':{'total':_0x6e2aa3['length'],'passed':_0x15b168,'failed':_0x45b9b0,'errors':_0x2d70bc>0x0?_0x2d70bc:undefined,'duration_ms':_0x280cc3},'tests':_0x6e2aa3,'agent':{'project':_0x45b5a['projectName'],'name':_0x45b5a[_0x48e90a(0x136)],'site':_0x5dc3db},'timestamp':new Date(_0x83539d)['toISOString']()};if(_0x44ed6b!==_0x48e90a(0x117)||_0x5c4957){const _0x106e69=formatResults(_0x1d2551,_0x44ed6b);if(_0x5c4957)try{a5_0x2efd97['writeFileSync'](_0x5c4957,_0x106e69,'utf-8'),console[_0x48e90a(0x190)](),console[_0x48e90a(0x190)](a5_0x4c6d88[_0x48e90a(0x109)](_0x48e90a(0x181)+_0x5c4957));}catch(_0x43020f){return console[_0x48e90a(0x190)](),console['log'](a5_0x4c6d88[_0x48e90a(0x134)](_0x48e90a(0x178)+_0x43020f)),0x1;}else console[_0x48e90a(0x190)](),console[_0x48e90a(0x190)](_0x106e69);}const _0x5d6ed3=_0x6e2aa3[_0x48e90a(0x149)](_0xe1b67e=>_0xe1b67e[_0x48e90a(0x18c)]!==_0x48e90a(0x12c));return _0x5d6ed3[_0x48e90a(0x129)]>0x0?0x1:0x0;}}
|
|
1
|
+
function a5_0x3c3e(){const _0x584337=['includes','testYmlPath','...','Cached\x20run\x20from:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','\x20\x20Round\x20','Evaluating\x20response...','multiple_agents','forEach','Round\x201/','trim','length','No\x20tests\x20found\x20with\x20tags:\x20','has','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','Running\x20test:\x20','eval','Available\x20tags:\x20','white','\x20\x20Agent:\x20','Re-evaluating\x20cached\x20test\x20run...','298470tTQozd','Re-evaluation\x20Summary','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','tags','jsonl','⚠\x20SKIPPED:\x20','tsv','Test\x20Summary','log','text','utf-8','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','Executing\x20new\x20tests...','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','PASS','1512151HNsAIP','red','Site:\x20','context','description','Test\x20','Running\x20agent\x20tests...','Project\x20path:\x20','filter','agent','✗\x20FAIL:\x20','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','...\x20','agent:test','Using\x20agent:\x20','Duration:\x20','no_local_folder','404','agentDirs','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','testName','Re-evaluating\x20','projectDir','repeat','16005438REciwZ','6158344sQeBQy','Either\x20switch\x20to\x20the\x20\x22','map','Errors:\x20\x20\x20','tests','Output\x20written\x20to:\x20','conversations','\x20(new)','10255230hzoKCd','Passed:\x20\x20\x20','✓\x20PASS:\x20','executeReeval','resolveProjectId','\x20\x20-\x20','site','llm','substring','agentName',':\x20Sending\x20user\x20input...','\x20(cached)','not\x20found','stop','Failed\x20Tests:','toLowerCase','verbose','12351fFRTtc','push','resolveAgentId','reeval','Run\x20\x27tdx\x20agent\x20pull\x20','rounds','status','toISOString','Re-evaluating...','\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path','Agent:\x20','No\x20tests\x20have\x20tags\x20defined.','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','✗\x20ERROR:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','join','add','reason','round','\x22:\x20','size','Total:\x20\x20\x20\x20','existsSync','json','yellow','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','message','\x20\x20Site:\x20','Available\x20tests:\x20','262yhKIHh','cyan','green','2735720lceVub','\x20\x20Conversation:\x20','dim','25xlUpfx','conversation_url','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','start','some','projectName','Tests\x20found:\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','Failed:\x20\x20\x20','execute','/<agent-name>','llmProject','table','timestamp','\x20-\x20','now','split','name','Error:\x20No\x20previous\x20test\x20run\x20found.','Round\x20','Test\x20Configuration:','\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)','Conversation\x20URL:\x20','FAIL','No\x20tests\x20found\x20matching:\x20','ERROR','Run\x20tests\x20for\x20an\x20LLM\x20agent','7AGKWFb'];a5_0x3c3e=function(){return _0x584337;};return a5_0x3c3e();}const a5_0x152697=a5_0x39ef;function a5_0x39ef(_0x12b592,_0x379e92){_0x12b592=_0x12b592-0x12a;const _0x3c3e7a=a5_0x3c3e();let _0x39ef4b=_0x3c3e7a[_0x12b592];return _0x39ef4b;}(function(_0x3485db,_0xc905ff){const _0x2f94df=a5_0x39ef,_0x505679=_0x3485db();while(!![]){try{const _0x279c22=parseInt(_0x2f94df(0x18e))/0x1+parseInt(_0x2f94df(0x147))/0x2*(parseInt(_0x2f94df(0x12a))/0x3)+parseInt(_0x2f94df(0x14a))/0x4+-parseInt(_0x2f94df(0x14d))/0x5*(-parseInt(_0x2f94df(0x17e))/0x6)+-parseInt(_0x2f94df(0x168))/0x7*(-parseInt(_0x2f94df(0x1a7))/0x8)+-parseInt(_0x2f94df(0x1a6))/0x9+-parseInt(_0x2f94df(0x1af))/0xa;if(_0x279c22===_0xc905ff)break;else _0x505679['push'](_0x505679['shift']());}catch(_0x241ac0){_0x505679['push'](_0x505679['shift']());}}}(a5_0x3c3e,0xe7f05));import*as a5_0x4e0322 from'node:fs';import*as a5_0xb1ada0 from'node:path';import a5_0x67163 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x152697(0x15e)]=a5_0x152697(0x19b);[a5_0x152697(0x192)]=a5_0x152697(0x167);async[a5_0x152697(0x156)](_0xe64d7){const _0x23a13f=a5_0x152697,{options:_0x26ace4,args:_0x1f2dbc,tdx:_0x20a0d7}=_0xe64d7,_0x3736a0=_0x1f2dbc[0x0]||'.',_0x5babca=_0x26ace4['dryRun'],_0x438c55=_0x26ace4,_0xfe680f=_0x438c55[_0x23a13f(0x179)]===![],_0x2aaf68=_0x438c55[_0x23a13f(0x12d)],_0x369ba6=_0x438c55[_0x23a13f(0x15e)],_0x46085a=_0x438c55['tags'],_0x55f205=_0x26ace4[_0x23a13f(0x1b5)],_0x3e7613=_0x438c55['output'];if(_0x2aaf68&&_0xfe680f)return console['log'](a5_0x67163[_0x23a13f(0x18f)]('Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval')),0x1;let _0x503587=_0x23a13f(0x159);if(_0x438c55[_0x23a13f(0x141)])_0x503587='json';else{if(_0x438c55[_0x23a13f(0x182)])_0x503587=_0x23a13f(0x182);else{if(_0x438c55[_0x23a13f(0x184)])_0x503587=_0x23a13f(0x184);else{if(_0x438c55[_0x23a13f(0x159)])_0x503587=_0x23a13f(0x159);}}}const _0x2f9562=_0x438c55['llmProject'];let _0x3491da=_0x3736a0;const _0x304c3f=a5_0x4e0322[_0x23a13f(0x140)](_0x3736a0),_0x21a754=_0x3736a0==='.';if(!_0x304c3f||_0x21a754){const _0x108b1c=resolveProjectFromContext(_0x3736a0,_0x2f9562,{'requireFile':'test.yml'});if(_0x108b1c['found'])_0x3491da=_0x108b1c[_0x23a13f(0x1a4)],_0x108b1c['source']===_0x23a13f(0x191)&&console[_0x23a13f(0x186)](a5_0x67163[_0x23a13f(0x14c)](_0x23a13f(0x19c)+_0x3491da));else switch(_0x108b1c[_0x23a13f(0x13b)]){case'no_context':console[_0x23a13f(0x186)](a5_0x67163[_0x23a13f(0x142)](_0x108b1c[_0x23a13f(0x144)])),console[_0x23a13f(0x186)](),console['log']('Usage:'),console['log'](_0x23a13f(0x133)),console['log'](_0x23a13f(0x162)),console[_0x23a13f(0x186)](),console[_0x23a13f(0x186)](_0x23a13f(0x199));return 0x1;case _0x23a13f(0x19e):console[_0x23a13f(0x186)](a5_0x67163[_0x23a13f(0x142)](_0x108b1c[_0x23a13f(0x144)])),console[_0x23a13f(0x186)](),console[_0x23a13f(0x186)](_0x23a13f(0x12e)+_0x108b1c[_0x23a13f(0x158)]+_0x23a13f(0x18b));return 0x1;case _0x23a13f(0x170):{const _0x1f7e8c=a5_0xb1ada0['basename'](_0x108b1c[_0x23a13f(0x1a4)]);console['log'](a5_0x67163[_0x23a13f(0x142)]('Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22'+_0x108b1c[_0x23a13f(0x158)]+'\x22:'));for(const _0x34bcaa of _0x108b1c[_0x23a13f(0x1a0)]){console[_0x23a13f(0x186)](_0x23a13f(0x1b4)+_0x34bcaa);}return console[_0x23a13f(0x186)](),console['log'](_0x23a13f(0x189)+_0x1f7e8c+_0x23a13f(0x157)),0x1;}case'no_tests':console['log'](a5_0x67163[_0x23a13f(0x142)](_0x23a13f(0x14f)+_0x108b1c[_0x23a13f(0x158)]+'\x22.')),console[_0x23a13f(0x186)](a5_0x67163[_0x23a13f(0x14c)](_0x23a13f(0x195)+_0x108b1c['projectDir'])),console[_0x23a13f(0x186)](),console[_0x23a13f(0x186)](_0x23a13f(0x177));return 0x1;}}const {definition:_0x35e658,agentInfo:_0x20b001}=parseTestFile(_0x3491da);let _0x5a61b3=_0x35e658[_0x23a13f(0x1ab)];if(_0x369ba6){const _0x5b74ab=_0x369ba6['split'](',')[_0x23a13f(0x1a9)](_0x20e908=>_0x20e908[_0x23a13f(0x173)]());_0x5a61b3=_0x35e658[_0x23a13f(0x1ab)][_0x23a13f(0x196)](_0x327c2c=>_0x5b74ab['includes'](_0x327c2c[_0x23a13f(0x15e)]));if(_0x5a61b3[_0x23a13f(0x174)]===0x0)return console[_0x23a13f(0x186)](a5_0x67163[_0x23a13f(0x142)](_0x23a13f(0x165)+_0x369ba6)),console[_0x23a13f(0x186)](a5_0x67163[_0x23a13f(0x14c)](_0x23a13f(0x146)+_0x35e658[_0x23a13f(0x1ab)][_0x23a13f(0x1a9)](_0x47fe37=>_0x47fe37[_0x23a13f(0x15e)])[_0x23a13f(0x139)](',\x20'))),0x1;}if(_0x46085a){const _0x2f797d=_0x46085a[_0x23a13f(0x15d)](',')[_0x23a13f(0x1a9)](_0x492f79=>_0x492f79[_0x23a13f(0x173)]()[_0x23a13f(0x1be)]());_0x5a61b3=_0x5a61b3[_0x23a13f(0x196)](_0x16dfc3=>_0x16dfc3[_0x23a13f(0x181)]?.[_0x23a13f(0x151)](_0x4f7835=>_0x2f797d[_0x23a13f(0x169)](_0x4f7835[_0x23a13f(0x1be)]())));if(_0x5a61b3[_0x23a13f(0x174)]===0x0){console[_0x23a13f(0x186)](a5_0x67163[_0x23a13f(0x142)](_0x23a13f(0x175)+_0x46085a));const _0x444a22=new Set();return _0x35e658[_0x23a13f(0x1ab)][_0x23a13f(0x171)](_0x33b8a2=>_0x33b8a2[_0x23a13f(0x181)]?.['forEach'](_0x2df9a9=>_0x444a22[_0x23a13f(0x13a)](_0x2df9a9))),_0x444a22[_0x23a13f(0x13e)]>0x0?console[_0x23a13f(0x186)](a5_0x67163[_0x23a13f(0x14c)](_0x23a13f(0x17a)+[..._0x444a22][_0x23a13f(0x139)](',\x20'))):console[_0x23a13f(0x186)](a5_0x67163[_0x23a13f(0x14c)](_0x23a13f(0x135))),0x1;}}if(_0x2aaf68)return this[_0x23a13f(0x1b2)](_0xe64d7,{'definition':{'tests':_0x5a61b3},'agentInfo':_0x20b001,'outputFormat':_0x503587,'outputFile':_0x3e7613,'testNames':_0x369ba6});if(_0x5babca){console[_0x23a13f(0x186)](a5_0x67163['cyan'](_0x23a13f(0x161))),console[_0x23a13f(0x186)](_0x23a13f(0x145)+a5_0x67163[_0x23a13f(0x17b)](_0x55f205)),console[_0x23a13f(0x186)]('\x20\x20Project:\x20'+a5_0x67163[_0x23a13f(0x17b)](_0x20b001[_0x23a13f(0x152)])),console[_0x23a13f(0x186)](_0x23a13f(0x17c)+a5_0x67163[_0x23a13f(0x17b)](_0x20b001[_0x23a13f(0x1b8)])),console['log'](),console[_0x23a13f(0x186)](_0x23a13f(0x153)+a5_0x67163[_0x23a13f(0x17b)](_0x5a61b3['length']));for(let _0x470593=0x0;_0x470593<_0x5a61b3[_0x23a13f(0x174)];_0x470593++){const _0x5dabce=_0x5a61b3[_0x470593],_0x49963c=_0x5dabce[_0x23a13f(0x12f)][_0x23a13f(0x174)]===0x1?_0x23a13f(0x13c):_0x23a13f(0x12f),_0x132259=_0x5dabce['tags']?.[_0x23a13f(0x174)]?'\x20['+_0x5dabce[_0x23a13f(0x181)][_0x23a13f(0x139)](',\x20')+']':'';console[_0x23a13f(0x186)]('\x20\x20'+(_0x470593+0x1)+'.\x20'+a5_0x67163[_0x23a13f(0x17b)](_0x5dabce[_0x23a13f(0x15e)])+'\x20('+_0x5dabce['rounds'][_0x23a13f(0x174)]+'\x20'+_0x49963c+')'+a5_0x67163[_0x23a13f(0x14c)](_0x132259));}return 0x0;}let _0x297b0c,_0x3e02bc;try{_0x297b0c=await _0x20a0d7['llm'][_0x23a13f(0x1b3)](_0x20b001[_0x23a13f(0x152)]);}catch(_0x5a7497){const _0x2d9782=_0x5a7497 instanceof Error?_0x5a7497[_0x23a13f(0x144)]:String(_0x5a7497);return _0x2d9782[_0x23a13f(0x169)](_0x23a13f(0x19f))||_0x2d9782[_0x23a13f(0x1be)]()['includes'](_0x23a13f(0x1bb))?console[_0x23a13f(0x186)](a5_0x67163[_0x23a13f(0x18f)]('✗\x20ERROR:\x20Project\x20not\x20found:\x20'+_0x20b001[_0x23a13f(0x152)])):console[_0x23a13f(0x186)](a5_0x67163[_0x23a13f(0x18f)](_0x23a13f(0x16d)+_0x20b001['projectName']+_0x23a13f(0x13d)+_0x2d9782)),0x1;}try{_0x3e02bc=await _0x20a0d7[_0x23a13f(0x1b6)][_0x23a13f(0x12c)](_0x20b001[_0x23a13f(0x1b8)],_0x297b0c);}catch(_0x58790a){const _0x2526c7=_0x58790a instanceof Error?_0x58790a[_0x23a13f(0x144)]:String(_0x58790a);return _0x2526c7[_0x23a13f(0x169)](_0x23a13f(0x19f))||_0x2526c7['toLowerCase']()[_0x23a13f(0x169)](_0x23a13f(0x1bb))?console[_0x23a13f(0x186)](a5_0x67163['red'](_0x23a13f(0x143)+_0x20b001[_0x23a13f(0x1b8)])):console[_0x23a13f(0x186)](a5_0x67163['red'](_0x23a13f(0x138)+_0x20b001[_0x23a13f(0x1b8)]+'\x22:\x20'+_0x2526c7)),0x1;}let _0x53d768;if(!_0xfe680f)try{_0x53d768=await setupEvaluatorAgent(_0x20a0d7[_0x23a13f(0x1b6)],_0x26ace4['verbose']);}catch(_0x4d8ccf){const _0x3091bc=_0x4d8ccf instanceof Error?_0x4d8ccf[_0x23a13f(0x144)]:String(_0x4d8ccf);return console[_0x23a13f(0x186)](a5_0x67163[_0x23a13f(0x18f)](_0x23a13f(0x180)+_0x3091bc)),0x1;}console[_0x23a13f(0x186)](a5_0x67163[_0x23a13f(0x148)](_0x23a13f(0x194))),console[_0x23a13f(0x186)](_0x23a13f(0x190)+a5_0x67163['white'](_0x55f205)),console[_0x23a13f(0x186)](_0x23a13f(0x134)+a5_0x67163[_0x23a13f(0x17b)](_0x20b001['projectName']+'/'+_0x20b001[_0x23a13f(0x1b8)])),console['log']();const _0x44e960=[],_0x4b9b9b=[],_0x2bb73c=Date[_0x23a13f(0x15c)]();for(let _0x1f2f80=0x0;_0x1f2f80<_0x5a61b3['length'];_0x1f2f80++){const _0x1001f0=_0x5a61b3[_0x1f2f80];_0x5a61b3[_0x23a13f(0x174)]>0x1?console[_0x23a13f(0x186)](_0x23a13f(0x193)+(_0x1f2f80+0x1)+'/'+_0x5a61b3[_0x23a13f(0x174)]+':\x20'+a5_0x67163[_0x23a13f(0x17b)](_0x1001f0[_0x23a13f(0x15e)])):console[_0x23a13f(0x186)](_0x23a13f(0x178)+a5_0x67163[_0x23a13f(0x17b)](_0x1001f0[_0x23a13f(0x15e)]));const _0x2de066=createCommandSpinner(_0x23a13f(0x172)+_0x1001f0['rounds'][_0x23a13f(0x174)]+_0x23a13f(0x1b9));_0x2de066[_0x23a13f(0x150)]();try{const {result:_0x1e682b,conversation:_0x49f206}=await runTest(_0x20a0d7[_0x23a13f(0x1b6)],_0x1001f0,{'agentId':_0x3e02bc,'projectId':_0x297b0c,'site':_0x55f205,'noEval':_0xfe680f,'evaluatorId':_0x53d768,'onRoundStart':(_0x12a3bb,_0x834ac6)=>{const _0x2966b1=_0x23a13f;_0x2de066[_0x2966b1(0x187)]='Round\x20'+(_0x12a3bb+0x1)+'/'+_0x834ac6+_0x2966b1(0x1b9);},'onRoundComplete':(_0x128ab5,_0x232ec9,_0x387ef1)=>{const _0x224012=_0x23a13f,_0x124b6c=formatElapsed(_0x232ec9);_0x387ef1?console[_0x224012(0x186)]('\x20\x20Round\x20'+(_0x128ab5+0x1)+'/'+_0x1001f0[_0x224012(0x12f)]['length']+_0x224012(0x19a)+a5_0x67163[_0x224012(0x149)]('✓')+'\x20('+_0x124b6c+')'):console[_0x224012(0x186)](_0x224012(0x16e)+(_0x128ab5+0x1)+'/'+_0x1001f0[_0x224012(0x12f)]['length']+_0x224012(0x19a)+a5_0x67163[_0x224012(0x18f)]('✗'));},'onEvaluationStart':()=>{const _0x198c68=_0x23a13f;_0x2de066[_0x198c68(0x187)]='Evaluating\x20response...';},'onEvaluationComplete':_0x3956ba=>{const _0xc3847c=_0x23a13f,_0x3ac18e=formatElapsed(_0x3956ba);console['log']('\x20\x20Evaluating...\x20'+a5_0x67163[_0xc3847c(0x149)]('✓')+'\x20('+_0x3ac18e+')');}});_0x2de066[_0x23a13f(0x1bc)](),_0x44e960[_0x23a13f(0x12b)](_0x1e682b),_0x4b9b9b[_0x23a13f(0x12b)](_0x49f206);if(_0x1e682b[_0x23a13f(0x130)]===_0x23a13f(0x18d))console['log'](a5_0x67163[_0x23a13f(0x149)](_0x23a13f(0x1b1)+_0x1e682b[_0x23a13f(0x13b)]));else _0x1e682b['status']===_0x23a13f(0x164)?console[_0x23a13f(0x186)](a5_0x67163[_0x23a13f(0x18f)](_0x23a13f(0x198)+_0x1e682b[_0x23a13f(0x13b)])):console[_0x23a13f(0x186)](a5_0x67163[_0x23a13f(0x18f)](_0x23a13f(0x137)+_0x1e682b[_0x23a13f(0x13b)]));_0x1e682b[_0x23a13f(0x14e)]&&console[_0x23a13f(0x186)](a5_0x67163[_0x23a13f(0x14c)](_0x23a13f(0x163)+_0x1e682b[_0x23a13f(0x14e)])),console[_0x23a13f(0x186)]();}catch(_0x260652){_0x2de066['stop']();const _0x460d2d=_0x260652 instanceof Error?_0x260652['message']:String(_0x260652);console[_0x23a13f(0x186)](a5_0x67163[_0x23a13f(0x18f)](_0x23a13f(0x137)+_0x460d2d)),console[_0x23a13f(0x186)](),_0x44e960[_0x23a13f(0x12b)]({'name':_0x1001f0[_0x23a13f(0x15e)],'status':_0x23a13f(0x166),'reason':_0x460d2d,'timestamp':new Date()[_0x23a13f(0x131)](),'duration_ms':0x0});}}const _0x43d7cb=Date[_0x23a13f(0x15c)]()-_0x2bb73c,_0x1c75dc=_0x44e960[_0x23a13f(0x196)](_0x798d0=>_0x798d0['status']===_0x23a13f(0x18d))[_0x23a13f(0x174)],_0x481829=_0x44e960['filter'](_0x2a8460=>_0x2a8460[_0x23a13f(0x130)]===_0x23a13f(0x164))['length'],_0x3a3297=_0x44e960[_0x23a13f(0x196)](_0x26eed4=>_0x26eed4['status']===_0x23a13f(0x166))[_0x23a13f(0x174)];console['log']('━'[_0x23a13f(0x1a5)](0x3c)),console[_0x23a13f(0x186)](_0x23a13f(0x185)),console[_0x23a13f(0x186)]('━'[_0x23a13f(0x1a5)](0x3c)),console[_0x23a13f(0x186)](_0x23a13f(0x13f)+_0x44e960[_0x23a13f(0x174)]),console[_0x23a13f(0x186)](_0x23a13f(0x1b0)+a5_0x67163[_0x23a13f(0x149)](_0x1c75dc)),console[_0x23a13f(0x186)](_0x23a13f(0x155)+a5_0x67163[_0x23a13f(0x18f)](_0x481829));_0x3a3297>0x0&&console[_0x23a13f(0x186)](_0x23a13f(0x1aa)+a5_0x67163[_0x23a13f(0x18f)](_0x3a3297));console['log'](_0x23a13f(0x19d)+formatElapsed(_0x43d7cb)),console[_0x23a13f(0x186)]('━'[_0x23a13f(0x1a5)](0x3c));const _0x553149=_0x44e960[_0x23a13f(0x196)](_0x455760=>_0x455760[_0x23a13f(0x130)]!==_0x23a13f(0x18d));if(_0x553149['length']>0x0){console['log'](),console['log'](_0x23a13f(0x1bd));for(const _0x235609 of _0x553149){const _0x16534a=a5_0x67163[_0x23a13f(0x18f)]('✗'),_0x125eea=_0x235609[_0x23a13f(0x13b)]['length']>0x32?_0x235609[_0x23a13f(0x13b)][_0x23a13f(0x1b7)](0x0,0x32)+_0x23a13f(0x16b):_0x235609[_0x23a13f(0x13b)];console[_0x23a13f(0x186)]('\x20\x20'+_0x16534a+'\x20'+_0x235609[_0x23a13f(0x15e)]+':\x20'+_0x125eea);}}const _0x37e630={'summary':{'total':_0x44e960['length'],'passed':_0x1c75dc,'failed':_0x481829,'errors':_0x3a3297>0x0?_0x3a3297:undefined,'duration_ms':_0x43d7cb},'tests':_0x44e960,'agent':{'project':_0x20b001['projectName'],'name':_0x20b001[_0x23a13f(0x1b8)],'site':_0x55f205},'timestamp':new Date(_0x2bb73c)[_0x23a13f(0x131)]()};try{const _0x50eb63=buildCachedTestRun(_0x4b9b9b,{'site':_0x55f205,'projectId':_0x297b0c,'projectName':_0x20b001[_0x23a13f(0x152)],'agentId':_0x3e02bc,'agentName':_0x20b001[_0x23a13f(0x1b8)],'testYmlPath':a5_0xb1ada0['resolve'](_0x20b001[_0x23a13f(0x16a)])});saveLastTestRun(_0x50eb63);}catch{}if(_0x503587!=='table'||_0x3e7613){const _0x5b5e7b=formatResults(_0x37e630,_0x503587);if(_0x3e7613)try{a5_0x4e0322['writeFileSync'](_0x3e7613,_0x5b5e7b,_0x23a13f(0x188)),console[_0x23a13f(0x186)](),console[_0x23a13f(0x186)](a5_0x67163[_0x23a13f(0x14c)](_0x23a13f(0x1ac)+_0x3e7613));}catch(_0x3b2231){return console[_0x23a13f(0x186)](),console[_0x23a13f(0x186)](a5_0x67163[_0x23a13f(0x18f)]('Error\x20writing\x20output\x20file:\x20'+_0x3b2231)),0x1;}else console[_0x23a13f(0x186)](),console['log'](_0x5b5e7b);}return _0x553149[_0x23a13f(0x174)]>0x0?0x1:0x0;}async[a5_0x152697(0x1b2)](_0x3bec32,_0x4fbe34){const _0x56db38=a5_0x152697,{options:_0x2396ad,tdx:_0x452baa}=_0x3bec32,{definition:_0x257f1b,agentInfo:_0x38bda8,outputFormat:_0x1e528d,outputFile:_0x440fc0}=_0x4fbe34,_0x4312d6=_0x2396ad[_0x56db38(0x1b5)],_0x93dc12=loadLastTestRun();if(!_0x93dc12)return console['log'](a5_0x67163[_0x56db38(0x18f)](_0x56db38(0x15f))),console['log'](a5_0x67163[_0x56db38(0x14c)]('Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.')),0x1;if(_0x93dc12[_0x56db38(0x197)][_0x56db38(0x1b8)]!==_0x38bda8[_0x56db38(0x1b8)])return console[_0x56db38(0x186)](a5_0x67163[_0x56db38(0x18f)](_0x56db38(0x1a1)+_0x93dc12['agent'][_0x56db38(0x1b8)]+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x38bda8[_0x56db38(0x1b8)]+'\x22.')),console[_0x56db38(0x186)](a5_0x67163['dim']('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x857666=new Set(_0x93dc12[_0x56db38(0x1ad)][_0x56db38(0x1a9)](_0x29a06d=>_0x29a06d[_0x56db38(0x1a2)])),_0x3239e2=_0x257f1b['tests'][_0x56db38(0x196)](_0x5ac566=>!_0x857666['has'](_0x5ac566[_0x56db38(0x15e)]));if(_0x3239e2[_0x56db38(0x174)]>0x0&&_0x93dc12[_0x56db38(0x1b5)]!==_0x4312d6)return console['log'](a5_0x67163['red'](_0x56db38(0x154))),console[_0x56db38(0x186)](a5_0x67163[_0x56db38(0x14c)]('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x93dc12[_0x56db38(0x1b5)]+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x4312d6+'\x22.')),console[_0x56db38(0x186)](a5_0x67163[_0x56db38(0x14c)](_0x56db38(0x1a8)+_0x93dc12[_0x56db38(0x1b5)]+_0x56db38(0x18c))),0x1;const _0x3cea51=_0x257f1b[_0x56db38(0x1ab)][_0x56db38(0x196)](_0x1a9b9a=>_0x857666[_0x56db38(0x176)](_0x1a9b9a['name'])),_0x447d75=_0x3239e2;let _0x535f25;try{_0x535f25=await setupEvaluatorAgent(_0x452baa['llm'],_0x2396ad[_0x56db38(0x1bf)]);}catch(_0x56bf90){const _0x1c7bce=_0x56bf90 instanceof Error?_0x56bf90[_0x56db38(0x144)]:String(_0x56bf90);return console[_0x56db38(0x186)](a5_0x67163[_0x56db38(0x18f)](_0x56db38(0x180)+_0x1c7bce)),0x1;}console[_0x56db38(0x186)](a5_0x67163[_0x56db38(0x148)](_0x56db38(0x17d))),console['log'](_0x56db38(0x16c)+a5_0x67163[_0x56db38(0x17b)](_0x93dc12[_0x56db38(0x15a)])),console[_0x56db38(0x186)](_0x56db38(0x134)+a5_0x67163[_0x56db38(0x17b)](_0x93dc12[_0x56db38(0x197)][_0x56db38(0x152)]+'/'+_0x93dc12[_0x56db38(0x197)][_0x56db38(0x1b8)]));_0x447d75[_0x56db38(0x174)]>0x0&&console[_0x56db38(0x186)]('New\x20tests\x20to\x20execute:\x20'+a5_0x67163[_0x56db38(0x142)](_0x447d75[_0x56db38(0x174)]));console[_0x56db38(0x186)]();const _0x13e0af=[],_0x4e9546=Date[_0x56db38(0x15c)](),_0x4a6dda=createCommandSpinner(_0x56db38(0x132));if(_0x3cea51[_0x56db38(0x174)]>0x0)try{const _0x27fa53=await reevaluateFromCache(_0x452baa['llm'],_0x93dc12,{'tests':_0x3cea51},{'evaluatorId':_0x535f25,'onTestStart':(_0x4b941a,_0x1ac591,_0x786483)=>{const _0x4077cb=_0x56db38;_0x4a6dda[_0x4077cb(0x187)]=_0x4077cb(0x1a3)+(_0x1ac591+0x1)+'/'+_0x786483+':\x20'+_0x4b941a+_0x4077cb(0x16b);if(!_0x4a6dda['isSpinning'])_0x4a6dda[_0x4077cb(0x150)]();},'onTestComplete':(_0x2dff18,_0x52cf11)=>{const _0x269a79=_0x56db38;_0x4a6dda['stop']();if(_0x52cf11[_0x269a79(0x130)]===_0x269a79(0x18d))console[_0x269a79(0x186)](a5_0x67163['green'](_0x269a79(0x1b1)+_0x2dff18)+a5_0x67163[_0x269a79(0x14c)]('\x20(cached)'));else _0x52cf11[_0x269a79(0x130)]===_0x269a79(0x164)?console[_0x269a79(0x186)](a5_0x67163[_0x269a79(0x18f)](_0x269a79(0x198)+_0x2dff18+_0x269a79(0x15b)+_0x52cf11[_0x269a79(0x13b)])+a5_0x67163['dim'](_0x269a79(0x1ba))):console[_0x269a79(0x186)](a5_0x67163[_0x269a79(0x18f)](_0x269a79(0x137)+_0x2dff18+_0x269a79(0x15b)+_0x52cf11[_0x269a79(0x13b)]));_0x52cf11['conversation_url']&&console[_0x269a79(0x186)](a5_0x67163[_0x269a79(0x14c)](_0x269a79(0x14b)+_0x52cf11[_0x269a79(0x14e)])),_0x13e0af[_0x269a79(0x12b)](_0x52cf11);},'onTestSkipped':(_0x45f926,_0x4ac749)=>{const _0x2d3f2b=_0x56db38;_0x4a6dda['stop'](),console[_0x2d3f2b(0x186)](a5_0x67163[_0x2d3f2b(0x142)](_0x2d3f2b(0x183)+_0x45f926+_0x2d3f2b(0x15b)+_0x4ac749));}});for(const _0x2cf925 of _0x27fa53){!_0x13e0af['find'](_0xb8e71f=>_0xb8e71f[_0x56db38(0x15e)]===_0x2cf925[_0x56db38(0x15e)])&&_0x13e0af[_0x56db38(0x12b)](_0x2cf925);}}catch(_0x20b6cb){_0x4a6dda[_0x56db38(0x1bc)]();const _0x5dbd16=_0x20b6cb instanceof Error?_0x20b6cb[_0x56db38(0x144)]:String(_0x20b6cb);return console[_0x56db38(0x186)](a5_0x67163[_0x56db38(0x18f)](_0x56db38(0x136)+_0x5dbd16)),0x1;}_0x4a6dda[_0x56db38(0x1bc)]();if(_0x447d75[_0x56db38(0x174)]>0x0){console[_0x56db38(0x186)](),console[_0x56db38(0x186)](a5_0x67163['cyan'](_0x56db38(0x18a)));const {projectId:_0xbc0b6b,agentId:_0x1e0fa9}=_0x93dc12[_0x56db38(0x197)];for(const _0xa98bd9 of _0x447d75){console['log']('Running:\x20'+a5_0x67163[_0x56db38(0x17b)](_0xa98bd9[_0x56db38(0x15e)]));const _0x38d98c=createCommandSpinner(_0x56db38(0x172)+_0xa98bd9[_0x56db38(0x12f)][_0x56db38(0x174)]+_0x56db38(0x1b9));_0x38d98c[_0x56db38(0x150)]();try{const {result:_0x1e5afd}=await runTest(_0x452baa[_0x56db38(0x1b6)],_0xa98bd9,{'agentId':_0x1e0fa9,'projectId':_0xbc0b6b,'site':_0x93dc12[_0x56db38(0x1b5)],'noEval':![],'evaluatorId':_0x535f25,'onRoundStart':(_0x47f71b,_0x48372b)=>{const _0x164a38=_0x56db38;_0x38d98c[_0x164a38(0x187)]=_0x164a38(0x160)+(_0x47f71b+0x1)+'/'+_0x48372b+_0x164a38(0x1b9);},'onRoundComplete':(_0x39f091,_0x2a4116,_0x48eb29)=>{const _0x27a5ef=_0x56db38,_0x56bde1=formatElapsed(_0x2a4116);_0x48eb29?console[_0x27a5ef(0x186)](_0x27a5ef(0x16e)+(_0x39f091+0x1)+'/'+_0xa98bd9['rounds'][_0x27a5ef(0x174)]+_0x27a5ef(0x19a)+a5_0x67163[_0x27a5ef(0x149)]('✓')+'\x20('+_0x56bde1+')'):console['log'](_0x27a5ef(0x16e)+(_0x39f091+0x1)+'/'+_0xa98bd9[_0x27a5ef(0x12f)][_0x27a5ef(0x174)]+'...\x20'+a5_0x67163[_0x27a5ef(0x18f)]('✗'));},'onEvaluationStart':()=>{const _0x393f89=_0x56db38;_0x38d98c[_0x393f89(0x187)]=_0x393f89(0x16f);},'onEvaluationComplete':_0x2a1e62=>{const _0x39a9c4=_0x56db38,_0x3cdc77=formatElapsed(_0x2a1e62);console[_0x39a9c4(0x186)]('\x20\x20Evaluating...\x20'+a5_0x67163[_0x39a9c4(0x149)]('✓')+'\x20('+_0x3cdc77+')');}});_0x38d98c['stop'](),_0x13e0af[_0x56db38(0x12b)](_0x1e5afd);if(_0x1e5afd[_0x56db38(0x130)]===_0x56db38(0x18d))console[_0x56db38(0x186)](a5_0x67163[_0x56db38(0x149)](_0x56db38(0x1b1)+_0x1e5afd[_0x56db38(0x13b)])+a5_0x67163[_0x56db38(0x14c)](_0x56db38(0x1ae)));else _0x1e5afd[_0x56db38(0x130)]===_0x56db38(0x164)?console[_0x56db38(0x186)](a5_0x67163[_0x56db38(0x18f)](_0x56db38(0x198)+_0x1e5afd[_0x56db38(0x13b)])+a5_0x67163[_0x56db38(0x14c)]('\x20(new)')):console['log'](a5_0x67163[_0x56db38(0x18f)](_0x56db38(0x137)+_0x1e5afd[_0x56db38(0x13b)]));_0x1e5afd['conversation_url']&&console[_0x56db38(0x186)](a5_0x67163[_0x56db38(0x14c)](_0x56db38(0x14b)+_0x1e5afd[_0x56db38(0x14e)]));}catch(_0x1dbf3d){_0x38d98c[_0x56db38(0x1bc)]();const _0x28ab7d=_0x1dbf3d instanceof Error?_0x1dbf3d[_0x56db38(0x144)]:String(_0x1dbf3d);console[_0x56db38(0x186)](a5_0x67163[_0x56db38(0x18f)](_0x56db38(0x137)+_0x28ab7d)),_0x13e0af[_0x56db38(0x12b)]({'name':_0xa98bd9[_0x56db38(0x15e)],'status':'ERROR','reason':_0x28ab7d,'timestamp':new Date()[_0x56db38(0x131)](),'duration_ms':0x0});}}}console[_0x56db38(0x186)]();const _0x4a2bee=Date[_0x56db38(0x15c)]()-_0x4e9546,_0x461bc6=_0x13e0af[_0x56db38(0x196)](_0x2b3fba=>_0x2b3fba[_0x56db38(0x130)]===_0x56db38(0x18d))[_0x56db38(0x174)],_0x566894=_0x13e0af[_0x56db38(0x196)](_0x33797c=>_0x33797c['status']===_0x56db38(0x164))['length'],_0x11e22d=_0x13e0af[_0x56db38(0x196)](_0x1b93cc=>_0x1b93cc[_0x56db38(0x130)]==='ERROR')[_0x56db38(0x174)];console[_0x56db38(0x186)]('━'[_0x56db38(0x1a5)](0x3c)),console['log'](_0x56db38(0x17f)),console[_0x56db38(0x186)]('━'['repeat'](0x3c)),console[_0x56db38(0x186)]('Total:\x20\x20\x20\x20'+_0x13e0af[_0x56db38(0x174)]),console[_0x56db38(0x186)](_0x56db38(0x1b0)+a5_0x67163[_0x56db38(0x149)](_0x461bc6)),console[_0x56db38(0x186)](_0x56db38(0x155)+a5_0x67163[_0x56db38(0x18f)](_0x566894));_0x11e22d>0x0&&console[_0x56db38(0x186)](_0x56db38(0x1aa)+a5_0x67163[_0x56db38(0x18f)](_0x11e22d));console[_0x56db38(0x186)](_0x56db38(0x19d)+formatElapsed(_0x4a2bee)),console[_0x56db38(0x186)]('━'[_0x56db38(0x1a5)](0x3c));const _0x3ef800={'summary':{'total':_0x13e0af[_0x56db38(0x174)],'passed':_0x461bc6,'failed':_0x566894,'errors':_0x11e22d>0x0?_0x11e22d:undefined,'duration_ms':_0x4a2bee},'tests':_0x13e0af,'agent':{'project':_0x38bda8['projectName'],'name':_0x38bda8[_0x56db38(0x1b8)],'site':_0x4312d6},'timestamp':new Date(_0x4e9546)['toISOString']()};if(_0x1e528d!==_0x56db38(0x159)||_0x440fc0){const _0x384183=formatResults(_0x3ef800,_0x1e528d);if(_0x440fc0)try{a5_0x4e0322['writeFileSync'](_0x440fc0,_0x384183,_0x56db38(0x188)),console[_0x56db38(0x186)](),console['log'](a5_0x67163[_0x56db38(0x14c)](_0x56db38(0x1ac)+_0x440fc0));}catch(_0x10e163){return console[_0x56db38(0x186)](),console[_0x56db38(0x186)](a5_0x67163[_0x56db38(0x18f)]('Error\x20writing\x20output\x20file:\x20'+_0x10e163)),0x1;}else console['log'](),console['log'](_0x384183);}const _0x2d0121=_0x13e0af[_0x56db38(0x196)](_0x3fba3b=>_0x3fba3b[_0x56db38(0x130)]!==_0x56db38(0x18d));return _0x2d0121[_0x56db38(0x174)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x298428=a6_0x15e4;(function(_0x556043,_0xac7ffa){const _0x193359=a6_0x15e4,_0x5dd297=_0x556043();while(!![]){try{const _0x19db8e=-parseInt(_0x193359(0xd5))/0x1+-parseInt(_0x193359(0xcb))/0x2*(parseInt(_0x193359(0xc3))/0x3)+parseInt(_0x193359(0xbb))/0x4+-parseInt(_0x193359(0xaf))/0x5*(-parseInt(_0x193359(0xa6))/0x6)+-parseInt(_0x193359(0xa0))/0x7+parseInt(_0x193359(0x9a))/0x8*(parseInt(_0x193359(0xa1))/0x9)+parseInt(_0x193359(0xa2))/0xa;if(_0x19db8e===_0xac7ffa)break;else _0x5dd297['push'](_0x5dd297['shift']());}catch(_0x17827d){_0x5dd297['push'](_0x5dd297['shift']());}}}(a6_0x9884,0xcd90e));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';function a6_0x9884(){const _0x115eeb=['x-xsrf-token','\x0aStack\x20trace:\x0a','status','15MbZgwp','trim','x-trino-user','description','color','set-cookie','x-auth-token','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','392660Vzmffx','cdp','output','readBodyFromFile','data','cookie','Results\x20saved\x20to\x20','name','error','startsWith','1242329BaiVfk','toLowerCase','site','stack','PATCH','includes','llm-proxy','10492616NvPRYZ','method','noColor','Invalid\x20API\x20type:\x20','entries','file','10945851dNseGt','9XfoyPV','14194030vygdWa','toUpperCase','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','POST','5424BLthux','PUT','.\x20Valid\x20types:\x20','body','GET','Invalid\x20HTTP\x20method:\x20','proxy-authorization','set-cookie2','log','9215qdYjKR','<\x20HTTP/1.1\x20','isArray','type','llm','headers','header','verbose','DELETE','Error:\x20','substring','api','930472cRODmV','join','length','message','\x22.\x20'];a6_0x9884=function(){return _0x115eeb;};return a6_0x9884();}import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set(['authorization',a6_0x298428(0xac),a6_0x298428(0xd0),a6_0x298428(0xc8),a6_0x298428(0xad),a6_0x298428(0xc0),a6_0x298428(0xc9),a6_0x298428(0xc5)]);function isSensitiveHeader(_0x2cf4b5){const _0x56e1e6=a6_0x298428;return SENSITIVE_HEADERS['has'](_0x2cf4b5[_0x56e1e6(0xd6)]());}function parseHeader(_0x30dedb){const _0x5b2348=a6_0x298428,_0x50d275=_0x30dedb['indexOf'](':');if(_0x50d275===-0x1)throw new Error('Invalid\x20header\x20format:\x20\x22'+_0x30dedb+_0x5b2348(0xbf)+'Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22');const _0x53fd11=_0x30dedb['substring'](0x0,_0x50d275)[_0x5b2348(0xc4)](),_0x2562ec=_0x30dedb[_0x5b2348(0xb9)](_0x50d275+0x1)[_0x5b2348(0xc4)]();if(!_0x53fd11)throw new Error(_0x5b2348(0xa4)+_0x30dedb+'\x22');return[_0x53fd11,_0x2562ec];}function a6_0x15e4(_0x65f0c7,_0xcd2a27){_0x65f0c7=_0x65f0c7-0x97;const _0x9884b=a6_0x9884();let _0x15e49e=_0x9884b[_0x65f0c7];return _0x15e49e;}export class ApiCommand extends BaseCommand{[a6_0x298428(0xd2)]=a6_0x298428(0xba);[a6_0x298428(0xc6)]='Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs';['validate'](_0x563351){const _0x196bb1=a6_0x298428,{args:_0x68995f,options:_0x318027}=_0x563351,_0x4c19b3=_0x318027;if(_0x68995f[_0x196bb1(0xbd)]===0x0)return _0x196bb1(0xca);const _0x324722=_0x68995f[0x0];if(!_0x324722[_0x196bb1(0xd4)]('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x324722;const _0x33fa35=_0x4c19b3[_0x196bb1(0xcf)],_0x277e39=_0x4c19b3[_0x196bb1(0x9f)];if(_0x33fa35&&_0x277e39)return'Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.';const _0x49ce4a=_0x4c19b3[_0x196bb1(0x9b)]||_0x196bb1(0xaa),_0x346893=[_0x196bb1(0xaa),_0x196bb1(0xa5),_0x196bb1(0xa7),_0x196bb1(0xb7),_0x196bb1(0x97)];if(!_0x346893[_0x196bb1(0x98)](_0x49ce4a[_0x196bb1(0xa3)]()))return _0x196bb1(0xab)+_0x49ce4a+'.\x20Valid\x20methods:\x20'+_0x346893[_0x196bb1(0xbc)](',\x20');const _0x563d00=_0x4c19b3[_0x196bb1(0xb2)]||'td',_0x38f98d=['td',_0x196bb1(0xcc),'workflow','trino',_0x196bb1(0xb3),_0x196bb1(0x99)];if(!_0x38f98d['includes'](_0x563d00))return _0x196bb1(0x9d)+_0x563d00+_0x196bb1(0xa8)+_0x38f98d['join'](',\x20');return undefined;}async['execute'](_0x5b7d84){const _0x531665=a6_0x298428,{options:_0xc67d51,args:_0x2b395e,tdx:_0x57f189}=_0x5b7d84,_0x4ac6f7=_0xc67d51,_0x2e89ad=_0x2b395e[0x0],_0x2810c7=(_0x4ac6f7[_0x531665(0x9b)]||_0x531665(0xaa))['toUpperCase'](),_0x2627bd=_0x4ac6f7[_0x531665(0xcf)],_0x373bd2=_0x4ac6f7[_0x531665(0x9f)],_0x1f42d0=_0x4ac6f7[_0x531665(0xb5)],_0x140c90=_0x4ac6f7[_0x531665(0xb2)]||'td';try{const _0x524bf5={};if(_0x1f42d0){const _0x56ec77=Array[_0x531665(0xb1)](_0x1f42d0)?_0x1f42d0:[_0x1f42d0];for(const _0x241163 of _0x56ec77){const [_0x339c46,_0x377d72]=parseHeader(_0x241163);_0x524bf5[_0x339c46]=_0x377d72;}}let _0x4ac837;if(_0x2627bd)_0x4ac837=_0x2627bd;else{if(_0x373bd2)try{_0x4ac837=RawAPI[_0x531665(0xce)](_0x373bd2);}catch(_0x192b83){return console[_0x531665(0xd3)]('Error:\x20'+(_0x192b83 instanceof Error?_0x192b83['message']:String(_0x192b83))),0x1;}}const _0x1a4e26={'method':_0x2810c7,'apiType':_0x140c90,'includeHeaders':_0xc67d51[_0x531665(0xb6)]};_0x4ac837&&(_0x1a4e26[_0x531665(0xa9)]=_0x4ac837);Object['keys'](_0x524bf5)['length']>0x0&&(_0x1a4e26[_0x531665(0xb4)]=_0x524bf5);if(_0xc67d51['verbose']){const _0x48f915=resolveSite(_0xc67d51[_0x531665(0xd7)]),_0x13136e=getEndpoint(_0x48f915,_0x140c90),_0x5069ed=''+_0x13136e+_0x2e89ad;console[_0x531665(0xd3)]('>\x20'+_0x2810c7+'\x20'+_0x5069ed);const _0x52ea61=getAuthHeaders(_0x48f915),_0x3e5fb5={..._0x52ea61,..._0x524bf5};for(const [_0x77517b,_0xc094c4]of Object[_0x531665(0x9e)](_0x3e5fb5)){!isSensitiveHeader(_0x77517b)&&console[_0x531665(0xd3)]('>\x20'+_0x77517b+':\x20'+_0xc094c4);}_0x4ac837&&console['error']('>'),console[_0x531665(0xd3)]('');}const _0x2a9171=await _0x57f189[_0x531665(0xba)]['request'](_0x2e89ad,_0x1a4e26);if(_0xc67d51[_0x531665(0xb6)]&&_0x2a9171[_0x531665(0xb4)]){console[_0x531665(0xd3)](_0x531665(0xb0)+_0x2a9171[_0x531665(0xc2)]);for(const [_0x245775,_0x1265ef]of Object[_0x531665(0x9e)](_0x2a9171[_0x531665(0xb4)])){!isSensitiveHeader(_0x245775)&&console[_0x531665(0xd3)]('<\x20'+_0x245775+':\x20'+_0x1265ef);}console[_0x531665(0xd3)]('');}const _0xc6e344=Boolean(_0xc67d51[_0x531665(0xcd)]),_0x274fc5={'color':_0xc67d51['color'],'noColor':_0xc67d51[_0x531665(0x9c)]||_0xc6e344&&!_0xc67d51[_0x531665(0xc7)]},_0x360c1b=colorizeJSON(_0x2a9171[_0x531665(0xcf)],_0x274fc5);return _0xc67d51[_0x531665(0xcd)]?(writeFileSync(_0xc67d51['output'],_0x360c1b),console[_0x531665(0xd3)](_0x531665(0xd1)+_0xc67d51[_0x531665(0xcd)])):console[_0x531665(0xae)](_0x360c1b),0x0;}catch(_0x3b44d6){return _0x3b44d6 instanceof Error?(console['error']('Error:\x20'+_0x3b44d6[_0x531665(0xbe)]),_0xc67d51[_0x531665(0xb6)]&&_0x3b44d6['stack']&&console[_0x531665(0xd3)](_0x531665(0xc1)+_0x3b44d6[_0x531665(0xd8)])):console['error'](_0x531665(0xb8)+String(_0x3b44d6)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a7_0xf89471=a7_0x50c9;(function(_0xbd3870,_0x2b893d){const _0x36638a=a7_0x50c9,_0x5ec960=_0xbd3870();while(!![]){try{const _0x16d8d8=-parseInt(_0x36638a(0x1ee))/0x1+-parseInt(_0x36638a(0x1b4))/0x2*(-parseInt(_0x36638a(0x1ae))/0x3)+parseInt(_0x36638a(0x1ef))/0x4*(parseInt(_0x36638a(0x1a7))/0x5)+-parseInt(_0x36638a(0x1a9))/0x6*(-parseInt(_0x36638a(0x1b6))/0x7)+parseInt(_0x36638a(0x1c1))/0x8+parseInt(_0x36638a(0x1d4))/0x9*(parseInt(_0x36638a(0x1c5))/0xa)+-parseInt(_0x36638a(0x1b7))/0xb;if(_0x16d8d8===_0x2b893d)break;else _0x5ec960['push'](_0x5ec960['shift']());}catch(_0x272a97){_0x5ec960['push'](_0x5ec960['shift']());}}}(a7_0xe43d,0xaeff4));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_0x4cf435 from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';function a7_0x50c9(_0x52ba03,_0x4c8e3a){_0x52ba03=_0x52ba03-0x1a2;const _0xe43d83=a7_0xe43d();let _0x50c958=_0xe43d83[_0x52ba03];return _0x50c958;}import{LogLevel}from'../utils/tdx-logger.js';import a7_0x3fbf5e from'chalk';function a7_0xe43d(){const _0x3d41a1=['yellow','bold','Validating\x20API\x20key...','\x20for\x20profile:\x20','5559516wjugLq','description','N/A','test','trim','\x20--profile\x20','text','warn','profile','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','filter','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','error','status','name','select','apiKey','auth','execute','tdx:\x20auth\x20clear','Setup\x20API\x20key\x20authentication\x20interactively','message','\x0aSetup\x20cancelled','✓\x20Default\x20site\x20set\x20to\x20','Select\x20your\x20Treasure\x20Data\x20site:','462527HKSiSC','78460LXBkPr','us01','tdx\x20profile:\x20','email','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','red','✗\x20Validation\x20failed:\x20','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','first_name','215suBnpX','\x20\x20tdx','20724wXtAHx','No\x20API\x20key\x20found\x20in\x20keychain','getUserInfo','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','other','6zFLMAl','join','green','/app/mp/ak','last_name','Site\x20name\x20cannot\x20be\x20empty','1025318ajKOJT','customSite','2674HeHoyn','29721527GIMUaF','create','\x27\x20registered','Enter\x20site\x20name:','User:\x20','\x20(profile:\x20','\x20(site:\x20','✓\x20Authentication\x20successful\x0a','✓\x20API\x20key\x20removed\x20from\x20keychain','jobs','602856FldVNs','log','password','Setting\x20up\x20authentication\x20for\x20site:\x20','10wFqmgu','API\x20key\x20cannot\x20be\x20empty','site','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','Name:\x20','auth:clear','auth:setup','ERROR','System\x20keychain\x20is\x20not\x20available','No\x20credential\x20found'];a7_0xe43d=function(){return _0x3d41a1;};return a7_0xe43d();}export class AuthSetupCommand extends BaseCommand{[a7_0xf89471(0x1e3)]=a7_0xf89471(0x1cc);[a7_0xf89471(0x1d5)]=a7_0xf89471(0x1e9);async['execute'](_0xeb369a){const _0x741c3a=a7_0xf89471,{options:_0x2c4221}=_0xeb369a,_0x5739f6=_0x2c4221['profile'];console[_0x741c3a(0x1c2)](a7_0x3fbf5e[_0x741c3a(0x1d1)]('tdx:\x20auth\x20setup'));const _0x4f27ba=_0x2c4221[_0x741c3a(0x1c7)]||_0x741c3a(0x1f0),{choices:_0x5161ae,initialIndex:_0x34e034}=buildSiteChoices(_0x4f27ba),_0x59c9f9=_0x5739f6?_0x741c3a(0x1dd)+_0x5739f6+'):':_0x741c3a(0x1ed),_0x1e156d=await a7_0x4cf435({'type':_0x741c3a(0x1e4),'name':_0x741c3a(0x1c7),'message':_0x59c9f9,'choices':_0x5161ae,'initial':_0x34e034});if(!_0x1e156d[_0x741c3a(0x1c7)])return console[_0x741c3a(0x1c2)](_0x741c3a(0x1eb)),0x1;let _0x38379f;if(_0x1e156d['site']===_0x741c3a(0x1ad)){const _0x58ab98=await a7_0x4cf435({'type':_0x741c3a(0x1da),'name':'customSite','message':_0x741c3a(0x1ba),'initial':_0x741c3a(0x1f0),'validate':_0x4bc1bd=>{const _0x5dd908=_0x741c3a;if(!_0x4bc1bd||!_0x4bc1bd[_0x5dd908(0x1d8)]())return _0x5dd908(0x1b3);if(!/^[a-z0-9-]+$/[_0x5dd908(0x1d7)](_0x4bc1bd[_0x5dd908(0x1d8)]()))return _0x5dd908(0x1a5);return!![];}});if(!_0x58ab98[_0x741c3a(0x1b5)])return console['log'](_0x741c3a(0x1eb)),0x1;_0x38379f=_0x58ab98[_0x741c3a(0x1b5)];}else _0x38379f=_0x1e156d[_0x741c3a(0x1c7)];const _0x8017ea=resolveSite(_0x38379f);console[_0x741c3a(0x1c2)](_0x741c3a(0x1c4)+_0x8017ea),console[_0x741c3a(0x1c2)]('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0x741c3a(0x1c2)]('\x20\x20'+getConsoleUrl(_0x8017ea,_0x741c3a(0x1b1)));const _0x5d7a07=await a7_0x4cf435({'type':_0x741c3a(0x1c3),'name':_0x741c3a(0x1e5),'message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x123a9a=>{const _0x2cea23=_0x741c3a;if(!_0x123a9a||!_0x123a9a[_0x2cea23(0x1d8)]())return _0x2cea23(0x1c6);return!![];}});if(!_0x5d7a07['apiKey'])return console[_0x741c3a(0x1c2)]('\x0aSetup\x20cancelled'),0x1;const _0x17b744=_0x5d7a07[_0x741c3a(0x1e5)];console['log'](_0x741c3a(0x1d2));try{const _0x3fd211=TDX[_0x741c3a(0x1b8)]({'site':_0x8017ea,'apiKey':_0x17b744[_0x741c3a(0x1d8)](),'logLevel':_0x2c4221['logLevel']??LogLevel[_0x741c3a(0x1cd)]}),_0x10326b=await _0x3fd211[_0x741c3a(0x1c0)]['getUserInfo']();console[_0x741c3a(0x1c2)](_0x741c3a(0x1e0)+_0x10326b[_0x741c3a(0x1f2)]+')');const _0x5ab155=await isKeychainAvailable();_0x5ab155?(await saveAPIKeyAsync(_0x17b744[_0x741c3a(0x1d8)](),_0x8017ea,_0x5739f6),console['log'](_0x741c3a(0x1a2)+(_0x5739f6?_0x741c3a(0x1bc)+_0x5739f6+')':''))):(console[_0x741c3a(0x1db)](a7_0x3fbf5e[_0x741c3a(0x1d0)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0x741c3a(0x1db)](a7_0x3fbf5e[_0x741c3a(0x1d0)](_0x741c3a(0x1de))));if(_0x5739f6){const _0x19ff5c={'site':_0x8017ea};saveProfileToUserConfig(_0x5739f6,_0x19ff5c),console[_0x741c3a(0x1c2)]('✓\x20Profile\x20\x27'+_0x5739f6+_0x741c3a(0x1b9));}else saveDefaultSiteToUserConfig(_0x8017ea),console['log'](_0x741c3a(0x1ec)+_0x8017ea);const _0x27fb8d=_0x5739f6?_0x741c3a(0x1d9)+_0x5739f6:'';return console['log'](),console['log']('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x741c3a(0x1c2)](_0x741c3a(0x1a8)+_0x27fb8d+_0x741c3a(0x1ac)),console[_0x741c3a(0x1c2)](_0x741c3a(0x1a8)+_0x27fb8d+_0x741c3a(0x1c8)),0x0;}catch(_0x10e931){if(_0x10e931 instanceof HTTPClientError&&_0x10e931['status']===0x191)return printAuthError(_0x10e931),0x1;return console[_0x741c3a(0x1e1)](a7_0x3fbf5e[_0x741c3a(0x1a3)](_0x741c3a(0x1a4)+(_0x10e931 instanceof Error?_0x10e931['message']:String(_0x10e931)))),console[_0x741c3a(0x1e1)](_0x741c3a(0x1c9)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0xf89471(0x1e3)]=a7_0xf89471(0x1e6);['description']='Show\x20authentication\x20status\x20and\x20validate\x20API\x20key';async['execute'](_0xc8ce14){const _0x2d3c37=a7_0xf89471,{options:_0x565b46,tdx:_0x496f58}=_0xc8ce14,_0x372f02=_0x565b46['site'],_0x21f5c5=_0x565b46[_0x2d3c37(0x1dc)],_0x36d036=_0x21f5c5?_0x21f5c5:_0x2d3c37(0x1d6);console[_0x2d3c37(0x1c2)](_0x2d3c37(0x1f1)+_0x36d036+_0x2d3c37(0x1bd)+_0x372f02+')');const _0x5da166=await resolveAPIKeyAsync(_0x372f02,_0x21f5c5);if(_0x5da166){const {source:_0x201785,isDeprecated:_0x31e4d1}=_0x5da166,_0xcc9890='Read\x20credential\x20from\x20'+_0x201785;console['log'](_0x31e4d1?a7_0x3fbf5e[_0x2d3c37(0x1d0)](_0xcc9890):_0xcc9890);}else console[_0x2d3c37(0x1c2)](a7_0x3fbf5e[_0x2d3c37(0x1d0)](_0x2d3c37(0x1cf)));try{const _0x49ebe2=await _0x496f58['jobs'][_0x2d3c37(0x1ab)]();return console[_0x2d3c37(0x1c2)](a7_0x3fbf5e[_0x2d3c37(0x1b0)](_0x2d3c37(0x1be))),console['log'](_0x2d3c37(0x1bb)+_0x49ebe2[_0x2d3c37(0x1f2)]),(_0x49ebe2['first_name']||_0x49ebe2[_0x2d3c37(0x1b2)])&&console[_0x2d3c37(0x1c2)](_0x2d3c37(0x1ca)+[_0x49ebe2[_0x2d3c37(0x1a6)],_0x49ebe2['last_name']][_0x2d3c37(0x1df)](Boolean)[_0x2d3c37(0x1af)]('\x20')),0x0;}catch(_0x576a24){return _0x576a24 instanceof HTTPClientError&&_0x576a24[_0x2d3c37(0x1e2)]===0x191?printAuthError(_0x576a24,!![],_0x21f5c5):console[_0x2d3c37(0x1e1)](a7_0x3fbf5e[_0x2d3c37(0x1a3)]('✗\x20Validation\x20failed:\x20'+(_0x576a24 instanceof Error?_0x576a24[_0x2d3c37(0x1ea)]:String(_0x576a24)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0xf89471(0x1e3)]=a7_0xf89471(0x1cb);[a7_0xf89471(0x1d5)]='Remove\x20API\x20key\x20from\x20system\x20keychain';async[a7_0xf89471(0x1e7)](_0x396c40){const _0x31a315=a7_0xf89471,{options:_0x261e5e}=_0x396c40,_0xc82cda=_0x261e5e[_0x31a315(0x1dc)];console[_0x31a315(0x1c2)](a7_0x3fbf5e[_0x31a315(0x1d1)](_0x31a315(0x1e8)));const _0x3c9246=await isKeychainAvailable();if(!_0x3c9246)return console[_0x31a315(0x1e1)](a7_0x3fbf5e[_0x31a315(0x1a3)](_0x31a315(0x1ce))),0x1;const _0x49543c=await deleteKeychainAPIKey(_0xc82cda);return _0x49543c?(clearCredentialCache(),console[_0x31a315(0x1c2)](_0x31a315(0x1bf)+(_0xc82cda?_0x31a315(0x1bc)+_0xc82cda+')':'')),0x0):(console[_0x31a315(0x1c2)](_0x31a315(0x1aa)+(_0xc82cda?_0x31a315(0x1d3)+_0xc82cda:'')),0x1);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a8_0x2dccbc=a8_0x1e77;(function(_0x411f01,_0x463255){const _0x17190e=a8_0x1e77,_0xade0ee=_0x411f01();while(!![]){try{const _0x51c8e3=-parseInt(_0x17190e(0xba))/0x1+-parseInt(_0x17190e(0xd6))/0x2*(-parseInt(_0x17190e(0xdc))/0x3)+-parseInt(_0x17190e(0xe9))/0x4+parseInt(_0x17190e(0xc2))/0x5*(parseInt(_0x17190e(0xc8))/0x6)+parseInt(_0x17190e(0xe8))/0x7*(parseInt(_0x17190e(0xe6))/0x8)+parseInt(_0x17190e(0xdb))/0x9+-parseInt(_0x17190e(0xc6))/0xa*(parseInt(_0x17190e(0xe3))/0xb);if(_0x51c8e3===_0x463255)break;else _0xade0ee['push'](_0xade0ee['shift']());}catch(_0x426473){_0xade0ee['push'](_0xade0ee['shift']());}}}(a8_0x18e6,0x27afb));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';function a8_0x1e77(_0x5d3ed3,_0x4e50d7){_0x5d3ed3=_0x5d3ed3-0xba;const _0x18e69d=a8_0x18e6();let _0x1e7792=_0x18e69d[_0x5d3ed3];return _0x1e7792;}import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';function a8_0x18e6(){const _0x2dd80f=['llmProject','execute','\x0aStack\x20trace:','182722WShSiT','verbose','Resolving\x20project\x20\x27','getOrCreateDefaultAgent','includes','1553355VbDQme','3OgcAQY','llm','metadata','llmAgent','Resolving\x20agent\x20\x27','resolveAgentId','\x20\x20Cause:\x20','11MJCNdt','Error:\x20','new','584rUMRAj','chat','20118BPeMgl','148948aqBPzi','cause','CHAT_NOT_FOUND','stack','\x27...','log','--agent\x20flag','name','data','error','join','76725OaDgEO','claude-4.5-haiku','resolveProjectId','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','stdout','write','validate','10euDHTk','streamChat','handleChatEvent','getAgentId','3910310ZANeSW','agent','581370rCGahz','\x0aError:\x20','message','Using\x20agent\x20from\x20','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','Getting\x20default\x20agent...','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','description','chatId','404','type'];a8_0x18e6=function(){return _0x2dd80f;};return a8_0x18e6();}import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';function handleSDKError(_0x1e95e3,_0x14d7e2){const _0x4298ff=a8_0x1e77;if(_0x1e95e3 instanceof SDKError)console[_0x4298ff(0xf2)](_0x4298ff(0xe4)+_0x1e95e3[_0x4298ff(0xca)]),_0x14d7e2[_0x4298ff(0xd7)]&&(_0x1e95e3['cause']&&console['error'](_0x4298ff(0xe2)+_0x1e95e3[_0x4298ff(0xea)]),_0x1e95e3[_0x4298ff(0xec)]&&(console[_0x4298ff(0xf2)](_0x4298ff(0xd5)),console[_0x4298ff(0xf2)](_0x1e95e3[_0x4298ff(0xec)])));else throw _0x1e95e3;}export class ChatCommand extends BaseCommand{['name']=a8_0x2dccbc(0xe7);[a8_0x2dccbc(0xcf)]=a8_0x2dccbc(0xbe);[a8_0x2dccbc(0xc1)](_0x5a5ffa){const _0x590157=a8_0x2dccbc,_0xf258f3=_0x5a5ffa['args'][_0x590157(0xf3)]('\x20');if(!_0xf258f3)return _0x590157(0xbd);return undefined;}async['streamChat'](_0xa3cc69,_0x3fef3c,_0xc96992,_0x152b3d,_0x103ace){const _0x105dd6=a8_0x2dccbc;for await(const _0x2402f9 of _0xa3cc69[_0x105dd6(0xdd)][_0x105dd6(0xe7)](_0x3fef3c,{'agentId':_0xc96992,'chatId':_0x152b3d})){if(_0x2402f9[_0x105dd6(0xd2)]===_0x105dd6(0xde)){const _0x4bfa4e=_0x2402f9['data'][_0x105dd6(0xd0)];saveLastChatId(_0x4bfa4e),_0x103ace&&console[_0x105dd6(0xf2)]('Chat\x20session:\x20'+_0x4bfa4e);}else _0x2402f9['type']==='event'&&this[_0x105dd6(0xc4)](_0x2402f9[_0x105dd6(0xf1)]);}}async[a8_0x2dccbc(0xc5)](_0x548622,_0x2a5932,_0x9c78c,_0x156f0d,_0x5d4db3){const _0xb860f1=a8_0x2dccbc,_0x55a810=_0x2a5932||_0x9c78c;if(_0x55a810){const {projectName:_0x4c87e5,agentName:_0x4e3456}=parseAgentRef(_0x55a810),_0x56443f=_0x4e3456||_0x55a810,_0x42a3d6=_0x4e3456?_0x4c87e5:_0x156f0d;if(!_0x42a3d6)throw new Error(_0xb860f1(0xce));if(_0x5d4db3){const _0x43d8c7=_0x2a5932?_0xb860f1(0xef):'session\x20context';console[_0xb860f1(0xf2)](_0xb860f1(0xcb)+_0x43d8c7+':\x20'+_0x42a3d6+'/'+_0x56443f);}const _0x179515=await withSpinner(_0xb860f1(0xd8)+_0x42a3d6+'\x27...',()=>_0x548622['llm'][_0xb860f1(0xbc)](_0x42a3d6),{'verbose':_0x5d4db3}),_0x144dd3=await withSpinner(_0xb860f1(0xe0)+_0x56443f+_0xb860f1(0xed),()=>_0x548622[_0xb860f1(0xdd)][_0xb860f1(0xe1)](_0x56443f,_0x179515[_0xb860f1(0xf1)]),{'verbose':_0x5d4db3});return _0x144dd3[_0xb860f1(0xf1)];}else{const _0x328ed4=_0x548622[_0xb860f1(0xdd)]['getDefaultAgent']();if(_0x328ed4)return _0x5d4db3&&console[_0xb860f1(0xf2)]('Using\x20cached\x20default\x20agent:\x20'+_0x328ed4[_0xb860f1(0xf0)]),_0x328ed4['id'];const _0x344dbb=await withSpinner(_0xb860f1(0xcd),()=>_0x548622[_0xb860f1(0xdd)][_0xb860f1(0xd9)](_0xb860f1(0xbb),0x0),{'verbose':_0x5d4db3});return _0x344dbb[_0xb860f1(0xf1)]['id'];}}async[a8_0x2dccbc(0xd4)](_0x3f051c){const _0x62be23=a8_0x2dccbc,{options:_0x4df2b3,args:_0x17766a,tdx:_0x49a698}=_0x3f051c,_0x41ad88=_0x17766a[_0x62be23(0xf3)]('\x20'),_0x2b2e71=_0x4df2b3,_0x7b2d61=_0x2b2e71[_0x62be23(0xc7)],_0x671b2=_0x2b2e71[_0x62be23(0xdf)],_0x25bc6d=_0x2b2e71[_0x62be23(0xd3)],_0x3b86fc=_0x2b2e71[_0x62be23(0xe5)];try{let _0x3f9dcf,_0x49cf78;!_0x3b86fc&&(_0x49cf78=loadLastChatId(),_0x49cf78&&_0x4df2b3['verbose']&&console[_0x62be23(0xf2)]('Continuing\x20chat:\x20'+_0x49cf78));(_0x3b86fc||!_0x49cf78)&&(_0x3f9dcf=await this['getAgentId'](_0x49a698,_0x7b2d61,_0x671b2,_0x25bc6d,_0x4df2b3[_0x62be23(0xd7)]));try{await this[_0x62be23(0xc3)](_0x49a698,_0x41ad88,_0x3f9dcf,_0x49cf78,_0x4df2b3[_0x62be23(0xd7)]);}catch(_0xe3b004){const _0x52221a=_0xe3b004 instanceof SDKError&&_0xe3b004['code']===ErrorCode[_0x62be23(0xeb)]||_0xe3b004 instanceof Error&&_0xe3b004[_0x62be23(0xca)][_0x62be23(0xda)](_0x62be23(0xd1));if(_0x52221a)_0x4df2b3[_0x62be23(0xd7)]&&console[_0x62be23(0xf2)](_0x62be23(0xcc)),!_0x3f9dcf&&(_0x3f9dcf=await this[_0x62be23(0xc5)](_0x49a698,_0x7b2d61,_0x671b2,_0x25bc6d,_0x4df2b3[_0x62be23(0xd7)])),await this[_0x62be23(0xc3)](_0x49a698,_0x41ad88,_0x3f9dcf,undefined,_0x4df2b3[_0x62be23(0xd7)]);else throw _0xe3b004;}return console[_0x62be23(0xee)](),0x0;}catch(_0x36e9fd){return console['error'](),handleSDKError(_0x36e9fd,_0x4df2b3),0x1;}}[a8_0x2dccbc(0xc4)](_0x207417){const _0x47f3ee=a8_0x2dccbc;if('content'in _0x207417)process[_0x47f3ee(0xbf)][_0x47f3ee(0xc0)](_0x207417['content']);else'error'in _0x207417&&console['error'](_0x47f3ee(0xc9)+_0x207417[_0x47f3ee(0xf2)]);}}
|