@treasuredata/tdx 0.21.0 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -13
- 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/profile-command.js.map +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/unset-command.js.map +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/use-command.js.map +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/config.js.map +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/global-context.js.map +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.d.ts +2 -1
- 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.d.ts.map +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/session.js.map +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-run.js.map +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/process.js.map +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x3f4182=a4_0x5d21;function a4_0x5d21(_0x530da2,_0xdca889){_0x530da2=_0x530da2-0x16d;const _0x312a9a=a4_0x312a();let _0x5d21c1=_0x312a9a[_0x530da2];return _0x5d21c1;}(function(_0x2f283b,_0x43aa03){const _0x249efd=a4_0x5d21,_0x571003=_0x2f283b();while(!![]){try{const _0x517aba=-parseInt(_0x249efd(0x185))/0x1+-parseInt(_0x249efd(0x16d))/0x2*(-parseInt(_0x249efd(0x208))/0x3)+-parseInt(_0x249efd(0x186))/0x4*(-parseInt(_0x249efd(0x1e4))/0x5)+parseInt(_0x249efd(0x219))/0x6+-parseInt(_0x249efd(0x195))/0x7*(-parseInt(_0x249efd(0x1b4))/0x8)+parseInt(_0x249efd(0x1f0))/0x9+-parseInt(_0x249efd(0x16f))/0xa*(parseInt(_0x249efd(0x1d0))/0xb);if(_0x517aba===_0x43aa03)break;else _0x571003['push'](_0x571003['shift']());}catch(_0x135409){_0x571003['push'](_0x571003['shift']());}}}(a4_0x312a,0x9ac23));import a4_0x583209 from'chalk';import a4_0x3ba644 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(_0x9be18e){const _0x36e705=a4_0x5d21,_0xb63487=[];if(_0x9be18e[_0x36e705(0x182)]!==undefined)_0xb63487['push'](_0x9be18e['total']+_0x36e705(0x1d1));if(_0x9be18e[_0x36e705(0x170)]!==undefined&&_0x9be18e[_0x36e705(0x170)]>0x0)_0xb63487[_0x36e705(0x1aa)](a4_0x583209[_0x36e705(0x21a)](_0x9be18e[_0x36e705(0x170)]+'\x20new'));if(_0x9be18e[_0x36e705(0x1d3)]!==undefined&&_0x9be18e['created']>0x0)_0xb63487['push'](a4_0x583209[_0x36e705(0x21a)](_0x9be18e[_0x36e705(0x1d3)]+_0x36e705(0x1ba)));if(_0x9be18e[_0x36e705(0x1bd)]!==undefined&&_0x9be18e[_0x36e705(0x1bd)]>0x0)_0xb63487[_0x36e705(0x1aa)](a4_0x583209[_0x36e705(0x21c)](_0x9be18e[_0x36e705(0x1bd)]+_0x36e705(0x1db)));if(_0x9be18e['unchanged']!==undefined&&_0x9be18e[_0x36e705(0x1ca)]>0x0)_0xb63487[_0x36e705(0x1aa)](a4_0x583209[_0x36e705(0x1ce)](_0x9be18e[_0x36e705(0x1ca)]+_0x36e705(0x1a2)));if(_0x9be18e['errors']!==undefined&&_0x9be18e[_0x36e705(0x18f)]>0x0)_0xb63487['push'](a4_0x583209[_0x36e705(0x17a)](_0x9be18e[_0x36e705(0x18f)]+_0x36e705(0x1e8)));return _0xb63487['join'](',\x20');}function displayDiffs(_0x1ed3d7,_0x1ea239,_0x485a91,_0x350443,_0x5e100f=[]){const _0x5227b0=a4_0x5d21;for(const _0x97012e of _0x1ed3d7){if(_0x97012e[_0x5227b0(0x211)]){const _0x269c14=_0x97012e[_0x5227b0(0x1cf)]||_0x97012e[_0x5227b0(0x193)];console[_0x5227b0(0x1c3)](_0x5227b0(0x1bb)+_0x269c14+'\x27:'),console[_0x5227b0(0x1c3)]('─'['repeat'](0x3c)),console[_0x5227b0(0x1c3)](_0x97012e[_0x5227b0(0x211)]),console['log']('─'['repeat'](0x3c));}}for(const _0x4051a7 of _0x1ea239){_0x4051a7['diff']&&(console['log'](_0x5227b0(0x18d)+_0x4051a7['name']+'\x27:'),console['log']('─'['repeat'](0x3c)),console['log'](_0x4051a7['diff']),console['log']('─'['repeat'](0x3c)));}for(const _0x36f6cd of _0x485a91){_0x36f6cd['diff']&&(console[_0x5227b0(0x1c3)](_0x5227b0(0x1c1)+_0x36f6cd['name']+'\x27:'),console[_0x5227b0(0x1c3)]('─'[_0x5227b0(0x1b9)](0x3c)),console[_0x5227b0(0x1c3)](_0x36f6cd[_0x5227b0(0x211)]),console[_0x5227b0(0x1c3)]('─'[_0x5227b0(0x1b9)](0x3c)));}for(const _0x1db46c of _0x350443){_0x1db46c[_0x5227b0(0x211)]&&(console['log'](_0x5227b0(0x187)+_0x1db46c['name']+'\x27:'),console[_0x5227b0(0x1c3)]('─'['repeat'](0x3c)),console['log'](_0x1db46c[_0x5227b0(0x211)]),console[_0x5227b0(0x1c3)]('─'[_0x5227b0(0x1b9)](0x3c)));}for(const _0x41461d of _0x5e100f){_0x41461d[_0x5227b0(0x211)]&&(console[_0x5227b0(0x1c3)](_0x5227b0(0x20f)+_0x41461d[_0x5227b0(0x193)]+'\x27:'),console[_0x5227b0(0x1c3)]('─'[_0x5227b0(0x1b9)](0x3c)),console['log'](_0x41461d[_0x5227b0(0x211)]),console[_0x5227b0(0x1c3)]('─'[_0x5227b0(0x1b9)](0x3c)));}}function a4_0x312a(){const _0x510c3d=['\x0aChanges\x20to\x20knowledge\x20base\x20\x27','Cloning\x20\x22','errors','counts','Project\x20cloned\x20successfully','Failed\x20to\x20push\x20agent:\x20','name','\x22\x20to\x20new\x20project\x20\x22','684250HVJqJb','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','llm_project','Would\x20clone:','sourceProjectName','action','newProjectId','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','New\x20project:\x20','dryRun','\x20\x20Knowledge\x20Base\x20\x22','agent.yml','\x20unchanged','Using\x20local\x20project:\x20','Project:\x20','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','projectName','\x20\x20Prompt\x20\x22','\x0aError:','parse','push','\x20\x20Prompts:\x20','\x22\x20to\x20\x22','\x20=\x20','\x20\x20Integrations:\x20','\x0aPull\x20summary\x20for\x20\x27','pullProject','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','hasChanges','llmProject','96GeDqMN','\x22...','agentId','INVALID_ARGUMENT','profile','repeat','\x20created','\x0aChanges\x20to\x20agent\x20\x27','Would\x20push\x20agent:\x20','updated','\x20\x20Integration\x20\x22','\x20successfully','\x0aPush\x20summary\x20for\x20\x27','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','pushProject','log','Clone\x20\x22','\x22:\x20','\x0a✔\x20Pulled\x20','\x20\x20tdx\x20agent\x20pull\x20','dirname','cwd','unchanged','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','newProjectName','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)','gray','agentName','77JWpHdh','\x20total','Errors:','created','reason','\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)','no_local_folder','llm','Status:\x20','yes','Analyzing\x20changes\x20to\x20push...','\x20updated','\x20--profile\x20','found','outputDir','Cancelled','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','context','agents','source','1895kATABl','projectDir','\x20\x20Agent\x20\x22','agent:push','\x20errors','cyan','outputPath','\x20files\x20to\x20','Source:\x20','Pushing\x20agent\x20from\x20\x22','message','Summary:','7996725eBGEmA','\x20\x20tdx\x20agent\x20clone\x20agents/','site','cloneProject','Using\x20context\x20project:\x20','\x20changed','execute','dim','Using\x20current\x20project:\x20','\x20|\x20','textKnowledgeBases','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x20\x20Knowledge\x20Bases:\x20','Using\x20project:\x20','Dry\x20run\x20-\x20no\x20files\x20written','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','✔\x20Context\x20set:\x20','Chat:\x20','\x20resources?','\x20\x20Source:\x20','\x22\x20from\x20project\x20\x22','force','\x20new','3515466AEJEjI','-\x20no\x20files\x20written','\x0aWrite\x20','\x0aErrors\x20found:','Writing\x20files...','Dry\x20run\x20-\x20no\x20changes\x20made','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x0aChanges\x20to\x20integration\x20\x27','knowledgeBases','diff','description','projectId','session','pullAgent','\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','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','Agent:\x20','7414080CbaBKI','green','MISSING_ARGUMENT','yellow','2uzbXbu','utf-8','5276330YQcuFh','new','Analyzing\x20project\x20\x22','tdx.json','integrations','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','join','\x20resources\x20to\x20\x27','\x20--name\x20','agent:clone','\x22\x20to\x20a\x20different\x20profile','red','\x0aProject\x20pushed\x20with\x20errors','New\x20project\x20name\x20is\x20required','\x20\x20Agents:\x20','Agent\x20pulled\x20successfully','prompts','\x20\x20Target:\x20','Output\x20path:\x20','total','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','error','911454LLSUHt','8124BSOrEq','\x0aChanges\x20to\x20prompt\x20\x27','No\x20tdx.json\x20found\x20in\x20','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','Pulling\x20agent\x20\x22','Using\x20project\x20from\x20','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'];a4_0x312a=function(){return _0x510c3d;};return a4_0x312a();}export class AgentPullCommand extends BaseCommand{['name']='agent:pull';[a4_0x3f4182(0x212)]=a4_0x3f4182(0x1e0);async[a4_0x3f4182(0x1f6)](_0x2375c6){const _0x549453=a4_0x3f4182,{options:_0x3fab38,args:_0x3c72c8,tdx:_0xe45ee2}=_0x2375c6,_0x535129=_0x3c72c8[0x0],_0x168330=_0x3c72c8[0x1],_0xadefde=_0x3fab38['output'],_0x16f910=_0x3fab38['dryRun'],_0x8674b9=_0x3fab38[_0x549453(0x206)],_0x46ecfb=_0x3fab38[_0x549453(0x1d9)],_0x2cc794=_0x3fab38[_0x549453(0x1b3)];let _0x3810cc,_0x163684;const _0x57583f=findAgentConfigPath(process['cwd']());if(_0x535129){const _0x1f73da=a4_0x3ba644['join'](_0x535129,_0x549453(0x172));if(existsSync(_0x1f73da))try{const _0x2b0d96=JSON[_0x549453(0x1a9)](readFileSync(_0x1f73da,_0x549453(0x16e)));_0x3810cc=_0x2b0d96['llm_project'],_0x163684=_0x535129,console[_0x549453(0x1c3)](a4_0x583209['dim'](_0x549453(0x18b)+_0x1f73da+':\x20'+_0x3810cc));}catch{_0x3810cc=_0x535129;}else _0x3810cc=_0x535129;}else{if(_0x57583f)try{const _0x3b8f97=JSON[_0x549453(0x1a9)](readFileSync(_0x57583f,'utf-8'));_0x3810cc=_0x3b8f97[_0x549453(0x198)],_0x163684=a4_0x3ba644[_0x549453(0x1c8)](_0x57583f),console[_0x549453(0x1c3)](a4_0x583209[_0x549453(0x1f7)]('Using\x20project:\x20'+_0x3810cc));}catch{_0x3810cc=_0x2cc794;}else _0x3810cc=_0x2cc794;}if(!_0x3810cc)return console[_0x549453(0x1c3)](a4_0x583209[_0x549453(0x21c)](_0x549453(0x1a5))),console[_0x549453(0x1c3)](_0x549453(0x1cd)),console[_0x549453(0x1c3)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project'),console[_0x549453(0x1c3)](_0x549453(0x216)),console[_0x549453(0x1c3)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent'),0x1;if(_0x168330){const {data:_0x3714ea}=await withSpinner(_0x549453(0x18a)+_0x168330+_0x549453(0x205)+_0x3810cc+'\x22...',()=>_0xe45ee2['llm'][_0x549453(0x215)](_0x3810cc,_0x168330,_0xadefde,{'dryRun':_0x16f910,'force':_0x8674b9}));if(_0x16f910)return console[_0x549453(0x1c3)](a4_0x583209[_0x549453(0x21c)](_0x549453(0x1ff))),console[_0x549453(0x1c3)]('Would\x20pull\x20agent:\x20'+_0x3714ea[_0x549453(0x1cf)]),console['log'](_0x549453(0x181)+_0x3714ea[_0x549453(0x1ea)]),_0x3714ea[_0x549453(0x211)]&&(console['log']('\x0aChanges:'),console[_0x549453(0x1c3)]('─'[_0x549453(0x1b9)](0x3c)),console['log'](_0x3714ea[_0x549453(0x211)]),console[_0x549453(0x1c3)]('─'[_0x549453(0x1b9)](0x3c))),0x0;return console['log'](a4_0x583209[_0x549453(0x21a)](_0x549453(0x17e))),console[_0x549453(0x1c3)](_0x549453(0x218)+_0x3714ea['agentName']),console[_0x549453(0x1c3)]('Output:\x20'+_0x3714ea[_0x549453(0x1ea)]),console[_0x549453(0x1c3)](_0x549453(0x1d8)+(_0x3714ea['isNew']?a4_0x583209['green']('new'):_0x3714ea[_0x549453(0x1b2)]?a4_0x583209[_0x549453(0x21c)](_0x549453(0x1bd)):a4_0x583209[_0x549453(0x1ce)](_0x549453(0x1ca)))),0x0;}const _0x336262=_0x163684||_0xadefde,{data:_0x2a4411}=await withSpinner(_0x549453(0x171)+_0x3810cc+_0x549453(0x1b5),()=>_0xe45ee2[_0x549453(0x1d7)][_0x549453(0x1b0)](_0x3810cc,_0x336262,{'dryRun':!![]})),_0x2eedcc=_0x2a4411[_0x549453(0x190)]['agents'][_0x549453(0x170)]+_0x2a4411[_0x549453(0x190)][_0x549453(0x210)][_0x549453(0x170)]+_0x2a4411[_0x549453(0x190)][_0x549453(0x1fa)][_0x549453(0x170)]+_0x2a4411[_0x549453(0x190)][_0x549453(0x17f)][_0x549453(0x170)]+_0x2a4411[_0x549453(0x190)]['integrations'][_0x549453(0x170)],_0x55fc9d=_0x2a4411[_0x549453(0x190)]['agents'][_0x549453(0x1bd)]+_0x2a4411[_0x549453(0x190)][_0x549453(0x210)][_0x549453(0x1bd)]+_0x2a4411[_0x549453(0x190)][_0x549453(0x1fa)][_0x549453(0x1bd)]+_0x2a4411[_0x549453(0x190)][_0x549453(0x17f)][_0x549453(0x1bd)]+_0x2a4411[_0x549453(0x190)][_0x549453(0x173)][_0x549453(0x1bd)],_0x410db9=_0x2a4411[_0x549453(0x190)]['agents'][_0x549453(0x1ca)]+_0x2a4411[_0x549453(0x190)][_0x549453(0x210)][_0x549453(0x1ca)]+_0x2a4411[_0x549453(0x190)][_0x549453(0x1fa)][_0x549453(0x1ca)]+_0x2a4411['counts'][_0x549453(0x17f)][_0x549453(0x1ca)]+_0x2a4411[_0x549453(0x190)][_0x549453(0x173)][_0x549453(0x1ca)];console[_0x549453(0x1c3)](_0x549453(0x1af)+_0x2a4411[_0x549453(0x1a6)]+'\x27:'),console['log']('\x20\x20'+a4_0x583209[_0x549453(0x21a)]('+\x20'+_0x2eedcc+_0x549453(0x207))+_0x549453(0x1f9)+a4_0x583209['yellow']('~\x20'+_0x55fc9d+'\x20changed')+'\x20|\x20'+a4_0x583209[_0x549453(0x1f7)]('=\x20'+_0x410db9+'\x20unchanged')),console['log'](_0x549453(0x17d)+formatCountSummary(_0x2a4411[_0x549453(0x190)][_0x549453(0x1e2)])),console['log'](_0x549453(0x1fd)+formatCountSummary(_0x2a4411[_0x549453(0x190)][_0x549453(0x210)])),console[_0x549453(0x1c3)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x2a4411[_0x549453(0x190)][_0x549453(0x1fa)])),console[_0x549453(0x1c3)](_0x549453(0x1ab)+formatCountSummary(_0x2a4411[_0x549453(0x190)]['prompts'])),console['log'](_0x549453(0x1ae)+formatCountSummary(_0x2a4411[_0x549453(0x190)]['integrations'])),console[_0x549453(0x1c3)](_0x549453(0x180)+a4_0x583209[_0x549453(0x1e9)](_0x2a4411['outputDir'])),displayDiffs(_0x2a4411[_0x549453(0x1e2)],_0x2a4411['knowledgeBases'],_0x2a4411[_0x549453(0x1fa)],_0x2a4411[_0x549453(0x17f)],_0x2a4411['integrations']);if(_0x16f910)return console[_0x549453(0x1c3)](a4_0x583209['yellow']('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x2eedcc===0x0&&_0x55fc9d===0x0)return console[_0x549453(0x1c3)](a4_0x583209['green'](_0x549453(0x200))),saveSessionContext({'llm_project':_0x2a4411[_0x549453(0x1a6)]},_0x3fab38[_0x549453(0x214)]),console[_0x549453(0x1c3)](a4_0x583209['green'](_0x549453(0x201)+a4_0x583209[_0x549453(0x1f7)]('llm_project')+_0x549453(0x1ad)+a4_0x583209[_0x549453(0x1e9)](_0x2a4411[_0x549453(0x1a6)]))),0x0;if(!_0x46ecfb&&!_0x8674b9){if(!isInteractive())return console[_0x549453(0x184)](a4_0x583209[_0x549453(0x17a)](_0x549453(0x1a8)),_0x549453(0x19d)),console[_0x549453(0x184)](a4_0x583209[_0x549453(0x1f7)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x12c291=await confirmKey(_0x549453(0x20a)+(_0x2eedcc+_0x55fc9d)+'\x20files?');if(!_0x12c291)return console[_0x549453(0x1c3)](a4_0x583209['yellow'](_0x549453(0x1df)),_0x549453(0x209)),0x1;}const {data:_0x5b26e7}=await withSpinner(_0x549453(0x20c),()=>_0xe45ee2['llm'][_0x549453(0x1b0)](_0x3810cc,_0x336262,{'force':_0x8674b9}));return console[_0x549453(0x1c3)](a4_0x583209['green'](_0x549453(0x1c6)+(_0x2eedcc+_0x55fc9d)+_0x549453(0x1eb)+_0x5b26e7[_0x549453(0x1de)])),saveSessionContext({'llm_project':_0x5b26e7[_0x549453(0x1a6)]},_0x3fab38[_0x549453(0x214)]),console['log'](a4_0x583209[_0x549453(0x21a)](_0x549453(0x201)+a4_0x583209[_0x549453(0x1f7)](_0x549453(0x198))+'\x20=\x20'+a4_0x583209[_0x549453(0x1e9)](_0x5b26e7['projectName']))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']=a4_0x3f4182(0x178);[a4_0x3f4182(0x212)]='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async['execute'](_0xc1e639){const _0x257f9e=a4_0x3f4182,{options:_0x2ab643,args:_0x3600ec,tdx:_0x5b85a0}=_0xc1e639,_0x4a7661=_0x3600ec[0x0],_0x3911da=_0x2ab643[_0x257f9e(0x193)],_0x4b05d8=_0x2ab643[_0x257f9e(0x19f)],_0x1b1b14=_0x2ab643[_0x257f9e(0x1d9)],_0x55e1f4=_0x2ab643[_0x257f9e(0x1f2)],_0x55ba11=_0x2ab643[_0x257f9e(0x1b3)];let _0xe05179;const _0x5c76c4=findAgentConfigPath(process[_0x257f9e(0x1c9)]());if(_0x4a7661){const _0x381a9e=a4_0x3ba644[_0x257f9e(0x175)](_0x4a7661,_0x257f9e(0x172));existsSync(_0x381a9e)?(_0xe05179=_0x4a7661,console[_0x257f9e(0x1c3)](a4_0x583209[_0x257f9e(0x1f7)](_0x257f9e(0x1a3)+_0x4a7661))):_0xe05179=_0x4a7661;}else{if(_0x5c76c4)_0xe05179=a4_0x3ba644[_0x257f9e(0x1c8)](_0x5c76c4),console[_0x257f9e(0x1c3)](a4_0x583209[_0x257f9e(0x1f7)](_0x257f9e(0x1f8)+_0xe05179));else{if(_0x55ba11){const _0x2ba0b8=sanitizeForFilesystem(_0x55ba11);let _0x460974=_0x2ba0b8,_0x17b0a9=a4_0x3ba644[_0x257f9e(0x175)](process[_0x257f9e(0x1c9)](),'agents',_0x2ba0b8,'tdx.json');if(!existsSync(_0x17b0a9)){const _0xfe9b00=normalizeName(_0x55ba11),_0x47da59=a4_0x3ba644[_0x257f9e(0x175)](process[_0x257f9e(0x1c9)](),_0x257f9e(0x1e2),_0xfe9b00,'tdx.json');existsSync(_0x47da59)&&(_0x460974=_0xfe9b00,_0x17b0a9=_0x47da59);}if(existsSync(_0x17b0a9))_0xe05179=a4_0x3ba644[_0x257f9e(0x1c8)](_0x17b0a9),console[_0x257f9e(0x1c3)](a4_0x583209['dim'](_0x257f9e(0x1a3)+_0xe05179));else{const _0x7dacfb=_0x2ab643[_0x257f9e(0x1b8)];if(_0x7dacfb)throw new SDKError(ErrorCode[_0x257f9e(0x1b7)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x55ba11+_0x257f9e(0x179),undefined,{'helpText':_0x257f9e(0x217)+_0x257f9e(0x18c)+(_0x257f9e(0x1c7)+_0x55ba11+'\x0a')+(_0x257f9e(0x1f1)+_0x460974+_0x257f9e(0x177)+(_0x3911da||'<new-name>')+_0x257f9e(0x1dc)+_0x7dacfb)});_0xe05179=_0x55ba11,console[_0x257f9e(0x1c3)](a4_0x583209[_0x257f9e(0x1f7)](_0x257f9e(0x1f4)+_0x55ba11));}}}}if(!_0xe05179)return console[_0x257f9e(0x1c3)](a4_0x583209[_0x257f9e(0x21c)](_0x257f9e(0x1fb))),console[_0x257f9e(0x1c3)](_0x257f9e(0x196)),console[_0x257f9e(0x1c3)](_0x257f9e(0x20e)),console[_0x257f9e(0x1c3)](_0x257f9e(0x1d5)),console[_0x257f9e(0x1c3)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x3911da)throw new SDKError(ErrorCode[_0x257f9e(0x21b)],_0x257f9e(0x17c),undefined,{'helpText':_0x257f9e(0x183)});if(!_0x1b1b14&&!_0x4b05d8){if(!isInteractive())return console[_0x257f9e(0x184)](a4_0x583209[_0x257f9e(0x17a)](_0x257f9e(0x1a8)),_0x257f9e(0x19d)),console[_0x257f9e(0x184)](a4_0x583209[_0x257f9e(0x1f7)](_0x257f9e(0x1cb))),0x1;const _0x53d168=await confirmKey(_0x257f9e(0x1c4)+_0xe05179+_0x257f9e(0x194)+_0x3911da+'\x22?');if(!_0x53d168)return console[_0x257f9e(0x1c3)](a4_0x583209[_0x257f9e(0x21c)](_0x257f9e(0x1df))),0x1;}const {data:_0x160a15}=await withSpinner(_0x257f9e(0x18e)+_0xe05179+_0x257f9e(0x1ac)+_0x3911da+_0x257f9e(0x1b5),()=>_0x5b85a0[_0x257f9e(0x1d7)][_0x257f9e(0x1f3)](_0xe05179,_0x3911da,{'dryRun':_0x4b05d8}));if(_0x4b05d8)return console[_0x257f9e(0x1c3)](a4_0x583209[_0x257f9e(0x21c)](_0x257f9e(0x20d))),console[_0x257f9e(0x1c3)]('Source:\x20'+_0x160a15['sourceProjectName']),console[_0x257f9e(0x1c3)](_0x257f9e(0x19e)+_0x3911da),console[_0x257f9e(0x1c3)](_0x257f9e(0x199)),console['log'](_0x257f9e(0x17d)+_0x160a15['counts'][_0x257f9e(0x1e2)]['created']),console[_0x257f9e(0x1c3)]('\x20\x20Knowledge\x20Bases:\x20'+_0x160a15[_0x257f9e(0x190)][_0x257f9e(0x210)][_0x257f9e(0x1d3)]),console['log'](_0x257f9e(0x1ab)+_0x160a15['counts'][_0x257f9e(0x17f)][_0x257f9e(0x1d3)]),0x0;const _0x2ba13a=_0x160a15[_0x257f9e(0x190)]['agents'][_0x257f9e(0x18f)]>0x0||_0x160a15['counts']['knowledgeBases'][_0x257f9e(0x18f)]>0x0||_0x160a15[_0x257f9e(0x190)]['prompts'][_0x257f9e(0x18f)]>0x0;_0x2ba13a?console[_0x257f9e(0x1c3)](a4_0x583209[_0x257f9e(0x21c)]('Project\x20cloned\x20with\x20errors')):console[_0x257f9e(0x1c3)](a4_0x583209[_0x257f9e(0x21a)](_0x257f9e(0x191)));console[_0x257f9e(0x1c3)](_0x257f9e(0x1ec)+_0x160a15[_0x257f9e(0x19a)]),console[_0x257f9e(0x1c3)](_0x257f9e(0x19e)+_0x160a15[_0x257f9e(0x1cc)]),console['log']('New\x20project\x20ID:\x20'+_0x160a15['newProjectId']),console[_0x257f9e(0x1c3)](),console['log'](_0x257f9e(0x1ef)),console[_0x257f9e(0x1c3)]('\x20\x20Agents:\x20'+formatCountSummary(_0x160a15[_0x257f9e(0x190)][_0x257f9e(0x1e2)])),console[_0x257f9e(0x1c3)](_0x257f9e(0x1fd)+formatCountSummary(_0x160a15['counts'][_0x257f9e(0x210)])),console[_0x257f9e(0x1c3)](_0x257f9e(0x1ab)+formatCountSummary(_0x160a15[_0x257f9e(0x190)][_0x257f9e(0x17f)])),console['log'](_0x257f9e(0x1ae)+formatCountSummary(_0x160a15[_0x257f9e(0x190)][_0x257f9e(0x173)]));if(_0x2ba13a){console['log'](),console['log'](a4_0x583209['red']('Errors:'));for(const _0x435502 of _0x160a15[_0x257f9e(0x1e2)]){_0x435502['action']===_0x257f9e(0x184)&&console['log'](a4_0x583209[_0x257f9e(0x17a)](_0x257f9e(0x1e6)+_0x435502[_0x257f9e(0x1cf)]+'\x22:\x20'+_0x435502[_0x257f9e(0x184)]));}for(const _0xdc50d of _0x160a15[_0x257f9e(0x210)]){_0xdc50d[_0x257f9e(0x19b)]===_0x257f9e(0x184)&&console['log'](a4_0x583209[_0x257f9e(0x17a)](_0x257f9e(0x1a0)+_0xdc50d[_0x257f9e(0x193)]+_0x257f9e(0x1c5)+_0xdc50d[_0x257f9e(0x184)]));}for(const _0x267f3f of _0x160a15['prompts']){_0x267f3f['action']===_0x257f9e(0x184)&&console[_0x257f9e(0x1c3)](a4_0x583209[_0x257f9e(0x17a)](_0x257f9e(0x1a7)+_0x267f3f[_0x257f9e(0x193)]+_0x257f9e(0x1c5)+_0x267f3f[_0x257f9e(0x184)]));}for(const _0x5933ea of _0x160a15['integrations']){_0x5933ea[_0x257f9e(0x19b)]===_0x257f9e(0x184)&&console[_0x257f9e(0x1c3)](a4_0x583209[_0x257f9e(0x17a)]('\x20\x20Integration\x20\x22'+_0x5933ea[_0x257f9e(0x193)]+_0x257f9e(0x1c5)+_0x5933ea[_0x257f9e(0x184)]));}return 0x1;}console[_0x257f9e(0x1c3)]();const _0x26b927=getLLMProjectUrl(_0x55e1f4,_0x160a15[_0x257f9e(0x19c)]);return console[_0x257f9e(0x1c3)]('Project:\x20'+a4_0x583209['cyan'](_0x26b927)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x3f4182(0x193)]=a4_0x3f4182(0x1e7);['description']=a4_0x3f4182(0x189);async[a4_0x3f4182(0x1f6)](_0x977816){const _0x39f125=a4_0x3f4182,{options:_0x43af3b,args:_0x20b255,tdx:_0x284ee7}=_0x977816;let _0x14c9bd=_0x20b255[0x0]||process['cwd']();const _0x4cdcbe=_0x43af3b['dryRun'],_0x2d2f00=_0x43af3b[_0x39f125(0x206)],_0x2bd2f5=_0x43af3b[_0x39f125(0x1d9)],_0x179a3f=_0x43af3b[_0x39f125(0x1f2)],_0x322bc0=a4_0x3ba644[_0x39f125(0x175)](_0x14c9bd,_0x39f125(0x1a1)),_0x1cec8a=existsSync(_0x322bc0);if(_0x1cec8a){const {data:_0x2ef081}=await withSpinner(_0x39f125(0x1ed)+_0x14c9bd+_0x39f125(0x1b5),()=>_0x284ee7[_0x39f125(0x1d7)]['pushAgent'](_0x14c9bd,{'dryRun':_0x4cdcbe,'force':_0x2d2f00}));if(_0x4cdcbe)return console[_0x39f125(0x1c3)](a4_0x583209[_0x39f125(0x21c)](_0x39f125(0x20d))),console[_0x39f125(0x1c3)](_0x39f125(0x1bc)+_0x2ef081[_0x39f125(0x1cf)]),0x0;if(_0x2ef081[_0x39f125(0x19b)]===_0x39f125(0x184))return console[_0x39f125(0x1c3)](a4_0x583209['red'](_0x39f125(0x192)+_0x2ef081[_0x39f125(0x184)])),0x1;console['log'](a4_0x583209[_0x39f125(0x21a)]('Agent\x20'+_0x2ef081['action']+_0x39f125(0x1bf))),console[_0x39f125(0x1c3)](_0x39f125(0x218)+_0x2ef081[_0x39f125(0x1cf)]);if(_0x2ef081[_0x39f125(0x1b6)]&&_0x2ef081[_0x39f125(0x213)]){const _0xb96004=getLLMAgentChatUrl(_0x179a3f,_0x2ef081['projectId'],_0x2ef081['agentId']);console[_0x39f125(0x1c3)](_0x39f125(0x202)+a4_0x583209[_0x39f125(0x1e9)](_0xb96004));}return 0x0;}const _0x1e608f=_0x43af3b[_0x39f125(0x1b3)],_0x5f1dd0=resolveProjectFromContext(_0x14c9bd,_0x1e608f);if(_0x5f1dd0[_0x39f125(0x1dd)])_0x14c9bd=_0x5f1dd0[_0x39f125(0x1e5)],_0x5f1dd0[_0x39f125(0x1e3)]===_0x39f125(0x1e1)&&console[_0x39f125(0x1c3)](a4_0x583209[_0x39f125(0x1f7)](_0x39f125(0x1fe)+_0x14c9bd));else{let _0x320bfe=_0x39f125(0x174);_0x5f1dd0[_0x39f125(0x1d4)]===_0x39f125(0x1d6)&&(_0x320bfe=_0x5f1dd0[_0x39f125(0x1ee)]+_0x39f125(0x1b1)+_0x5f1dd0['llmProject']+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x5f1dd0[_0x39f125(0x1d4)]==='no_context'?_0x5f1dd0[_0x39f125(0x1ee)]:_0x39f125(0x188)+_0x14c9bd,undefined,{'helpText':_0x320bfe});}const {data:_0x569174}=await withSpinner(_0x39f125(0x1da),()=>_0x284ee7[_0x39f125(0x1d7)][_0x39f125(0x1c2)](_0x14c9bd,{'dryRun':!![]})),_0x2458c4=_0x569174[_0x39f125(0x190)][_0x39f125(0x1e2)]['errors']>0x0;if(_0x2458c4){console[_0x39f125(0x1c3)](a4_0x583209[_0x39f125(0x17a)](_0x39f125(0x20b)));for(const _0x38410f of _0x569174['agents']){_0x38410f[_0x39f125(0x19b)]===_0x39f125(0x184)&&console[_0x39f125(0x1c3)](a4_0x583209[_0x39f125(0x17a)](_0x39f125(0x1e6)+_0x38410f[_0x39f125(0x1cf)]+'\x22:\x20'+_0x38410f[_0x39f125(0x184)]));}return 0x1;}const _0x1d0c14=_0x569174[_0x39f125(0x190)][_0x39f125(0x1e2)]['created']+_0x569174[_0x39f125(0x190)][_0x39f125(0x210)][_0x39f125(0x1d3)]+_0x569174[_0x39f125(0x190)][_0x39f125(0x1fa)][_0x39f125(0x1d3)]+_0x569174[_0x39f125(0x190)][_0x39f125(0x17f)][_0x39f125(0x1d3)]+_0x569174[_0x39f125(0x190)][_0x39f125(0x173)][_0x39f125(0x1d3)],_0x54f0f9=_0x569174[_0x39f125(0x190)][_0x39f125(0x1e2)]['updated']+_0x569174[_0x39f125(0x190)][_0x39f125(0x210)][_0x39f125(0x1bd)]+_0x569174[_0x39f125(0x190)][_0x39f125(0x1fa)]['updated']+_0x569174[_0x39f125(0x190)][_0x39f125(0x17f)][_0x39f125(0x1bd)]+_0x569174['counts'][_0x39f125(0x173)][_0x39f125(0x1bd)],_0x324ed9=_0x569174[_0x39f125(0x190)][_0x39f125(0x1e2)][_0x39f125(0x1ca)]+_0x569174[_0x39f125(0x190)][_0x39f125(0x210)]['unchanged']+_0x569174[_0x39f125(0x190)][_0x39f125(0x1fa)]['unchanged']+_0x569174[_0x39f125(0x190)][_0x39f125(0x17f)][_0x39f125(0x1ca)]+_0x569174[_0x39f125(0x190)]['integrations'][_0x39f125(0x1ca)];console[_0x39f125(0x1c3)](_0x39f125(0x1c0)+_0x569174['projectName']+'\x27:'),console[_0x39f125(0x1c3)]('\x20\x20'+a4_0x583209[_0x39f125(0x21a)]('+\x20'+_0x1d0c14+'\x20new')+'\x20|\x20'+a4_0x583209[_0x39f125(0x21c)]('~\x20'+_0x54f0f9+_0x39f125(0x1f5))+_0x39f125(0x1f9)+a4_0x583209['dim']('=\x20'+_0x324ed9+_0x39f125(0x1a2))),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x569174[_0x39f125(0x190)][_0x39f125(0x1e2)])),console['log'](_0x39f125(0x1fd)+formatCountSummary(_0x569174[_0x39f125(0x190)][_0x39f125(0x210)])),console[_0x39f125(0x1c3)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x569174[_0x39f125(0x190)][_0x39f125(0x1fa)])),console[_0x39f125(0x1c3)](_0x39f125(0x1ab)+formatCountSummary(_0x569174[_0x39f125(0x190)]['prompts'])),console[_0x39f125(0x1c3)](_0x39f125(0x1ae)+formatCountSummary(_0x569174[_0x39f125(0x190)]['integrations'])),console[_0x39f125(0x1c3)](_0x39f125(0x204)+a4_0x583209['cyan'](_0x14c9bd)),displayDiffs(_0x569174[_0x39f125(0x1e2)],_0x569174[_0x39f125(0x210)],_0x569174[_0x39f125(0x1fa)],_0x569174['prompts'],_0x569174[_0x39f125(0x173)]);if(_0x4cdcbe)return console['log'](a4_0x583209['yellow']('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x1d0c14===0x0&&_0x54f0f9===0x0){console[_0x39f125(0x1c3)](a4_0x583209['green'](_0x39f125(0x197)));const _0x3a650e=getLLMProjectUrl(_0x179a3f,_0x569174[_0x39f125(0x213)]);return console[_0x39f125(0x1c3)](_0x39f125(0x1a4)+a4_0x583209[_0x39f125(0x1e9)](_0x3a650e)),0x0;}if(!_0x2bd2f5&&!_0x2d2f00){if(!isInteractive())return console[_0x39f125(0x184)](a4_0x583209[_0x39f125(0x17a)](_0x39f125(0x1a8)),_0x39f125(0x19d)),console[_0x39f125(0x184)](a4_0x583209[_0x39f125(0x1f7)](_0x39f125(0x1cb))),0x1;const _0x3b376f=await confirmKey('\x0aPush\x20'+(_0x1d0c14+_0x54f0f9)+_0x39f125(0x203));if(!_0x3b376f)return console['log'](a4_0x583209[_0x39f125(0x21c)](_0x39f125(0x1df)),'-\x20nothing\x20pushed'),0x1;}const {data:_0x368421}=await withSpinner('Pushing\x20to\x20project...',()=>_0x284ee7[_0x39f125(0x1d7)][_0x39f125(0x1c2)](_0x14c9bd,{'force':_0x2d2f00})),_0x12bbaa=_0x368421[_0x39f125(0x190)]['agents'][_0x39f125(0x18f)]>0x0||_0x368421['counts'][_0x39f125(0x210)]['errors']>0x0||_0x368421['counts'][_0x39f125(0x1fa)][_0x39f125(0x18f)]>0x0||_0x368421[_0x39f125(0x190)][_0x39f125(0x17f)][_0x39f125(0x18f)]>0x0;if(_0x12bbaa){console['log'](a4_0x583209[_0x39f125(0x21c)](_0x39f125(0x17b))),console[_0x39f125(0x1c3)](),console[_0x39f125(0x1c3)](a4_0x583209['red'](_0x39f125(0x1d2)));for(const _0x437ef6 of _0x368421[_0x39f125(0x1e2)]){_0x437ef6[_0x39f125(0x19b)]===_0x39f125(0x184)&&console[_0x39f125(0x1c3)](a4_0x583209[_0x39f125(0x17a)](_0x39f125(0x1e6)+_0x437ef6[_0x39f125(0x1cf)]+_0x39f125(0x1c5)+_0x437ef6[_0x39f125(0x184)]));}for(const _0x3c1991 of _0x368421['knowledgeBases']){_0x3c1991[_0x39f125(0x19b)]===_0x39f125(0x184)&&console[_0x39f125(0x1c3)](a4_0x583209[_0x39f125(0x17a)](_0x39f125(0x1a0)+_0x3c1991['name']+_0x39f125(0x1c5)+_0x3c1991['error']));}for(const _0x1492e0 of _0x368421['textKnowledgeBases']){_0x1492e0[_0x39f125(0x19b)]===_0x39f125(0x184)&&console[_0x39f125(0x1c3)](a4_0x583209['red'](_0x39f125(0x1fc)+_0x1492e0['name']+_0x39f125(0x1c5)+_0x1492e0[_0x39f125(0x184)]));}for(const _0x472490 of _0x368421['prompts']){_0x472490[_0x39f125(0x19b)]===_0x39f125(0x184)&&console['log'](a4_0x583209[_0x39f125(0x17a)](_0x39f125(0x1a7)+_0x472490['name']+_0x39f125(0x1c5)+_0x472490[_0x39f125(0x184)]));}for(const _0x38aca0 of _0x368421['integrations']){_0x38aca0[_0x39f125(0x19b)]===_0x39f125(0x184)&&console[_0x39f125(0x1c3)](a4_0x583209['red'](_0x39f125(0x1be)+_0x38aca0['name']+_0x39f125(0x1c5)+_0x38aca0[_0x39f125(0x184)]));}return 0x1;}console['log'](a4_0x583209[_0x39f125(0x21a)]('\x0a✔\x20Pushed\x20'+(_0x1d0c14+_0x54f0f9)+_0x39f125(0x176)+_0x368421[_0x39f125(0x1a6)]+'\x27'));const _0x49c733=getLLMProjectUrl(_0x179a3f,_0x368421[_0x39f125(0x213)]);return console[_0x39f125(0x1c3)](_0x39f125(0x1a4)+a4_0x583209['cyan'](_0x49c733)),0x0;}}
|
|
1
|
+
const a4_0x3b07ea=a4_0xfd7b;(function(_0x3a5f54,_0x5057d4){const _0x3c8a2e=a4_0xfd7b,_0x447c58=_0x3a5f54();while(!![]){try{const _0x5f8901=parseInt(_0x3c8a2e(0x150))/0x1+parseInt(_0x3c8a2e(0x142))/0x2+-parseInt(_0x3c8a2e(0x19f))/0x3+-parseInt(_0x3c8a2e(0x131))/0x4+parseInt(_0x3c8a2e(0x152))/0x5*(-parseInt(_0x3c8a2e(0x1a0))/0x6)+parseInt(_0x3c8a2e(0x189))/0x7*(-parseInt(_0x3c8a2e(0x15e))/0x8)+parseInt(_0x3c8a2e(0x1b1))/0x9;if(_0x5f8901===_0x5057d4)break;else _0x447c58['push'](_0x447c58['shift']());}catch(_0x3109ca){_0x447c58['push'](_0x447c58['shift']());}}}(a4_0x2dbe,0x1c51a));import a4_0x24f204 from'chalk';import a4_0xfafc92 from'path';import{existsSync,readFileSync}from'fs';function a4_0x2dbe(){const _0x4441e0=['Project:\x20','\x0a✔\x20Pushed\x20','Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','\x0aPull\x20summary\x20for\x20\x27','Failed\x20to\x20push\x20agent:\x20','\x20\x20Prompt\x20\x22','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x27\x20to\x20create\x20the\x20folder\x20structure.','Clone\x20\x22','no_local_folder','total','Summary:','<new-name>','Using\x20project\x20from\x20','llm','\x0aChanges\x20to\x20prompt\x20\x27','tdx.json','Pulling\x20agent\x20\x22','isNew','agents','dryRun','\x22\x20from\x20project\x20\x22','Output\x20path:\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','agentId','Agent\x20pulled\x20successfully','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','integrations','Dry\x20run\x20-\x20no\x20files\x20written','agent.yml','prompts','\x20\x20Agent\x20\x22','Using\x20project:\x20','Agent\x20','763588Dwbmcf','\x22\x20to\x20new\x20project\x20\x22','\x20\x20Text\x20Knowledge\x20Bases:\x20','red','utf-8','Agent:\x20','repeat','Cannot\x20clone\x20from\x20context\x20project\x20\x22','knowledgeBases','\x20errors','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x20changed','✔\x20Context\x20set:\x20','Using\x20local\x20project:\x20','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','pullProject','pushProject','hasChanges','dirname','Pushing\x20to\x20project...','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','\x0aError:','322134WQMEqd','30kmAjbm','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','Project\x20cloned\x20successfully','\x20--profile\x20','INVALID_ARGUMENT','yellow','\x20new','updated','\x20\x20Prompts:\x20','\x0aProject\x20pushed\x20with\x20errors','MISSING_ARGUMENT','message','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','projectName','\x20files\x20to\x20','parse','Would\x20clone:','4046769iRtSxj','no_context','Cloning\x20\x22','\x22:\x20','New\x20project\x20name\x20is\x20required','gray','\x20=\x20','\x0aErrors\x20found:','context','\x20files?','\x20\x20Knowledge\x20Base\x20\x22','llm_project','\x20--name\x20','\x0aChanges\x20to\x20integration\x20\x27','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','Cancelled','log','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','cwd','\x0aChanges:','cyan','No\x20tdx.json\x20found\x20in\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','error','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x22\x20to\x20\x22','pullAgent','Using\x20current\x20project:\x20','\x22\x20to\x20a\x20different\x20profile','action','reason','\x20\x20Integrations:\x20','New\x20project:\x20','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','join','name','\x20\x20tdx\x20agent\x20pull\x20','dim','\x20\x20Text\x20Knowledge\x20Base\x20\x22','377940BqfVZP','-\x20no\x20files\x20written','projectId','Would\x20pull\x20agent:\x20','\x20\x20tdx\x20agent\x20clone\x20agents/','diff','outputPath','\x0aPush\x20summary\x20for\x20\x27','\x20successfully','description','newProjectId','session','Errors:','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','agentName','\x0a✔\x20Pulled\x20','\x0aWrite\x20','109886DmIxkq','Pushing\x20agent\x20from\x20\x22','Project\x20cloned\x20with\x20errors','push','Output:\x20','\x20\x20Source:\x20','New\x20project\x20ID:\x20','execute','\x20|\x20','created','\x0aChanges\x20to\x20agent\x20\x27','errors','site','counts','217296OBJsBD','textKnowledgeBases','185855KDdUrN','\x22...','Dry\x20run\x20-\x20no\x20changes\x20made','\x20\x20Knowledge\x20Bases:\x20','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x20\x20Target:\x20','green','\x20resources?','found','outputDir','yes','Source:\x20','16SlhkFb','\x20updated','\x20unchanged','\x20\x20Agents:\x20','new','Status:\x20','unchanged','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','llmProject'];a4_0x2dbe=function(){return _0x4441e0;};return a4_0x2dbe();}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';function a4_0xfd7b(_0x33f3f9,_0x16fd6e){_0x33f3f9=_0x33f3f9-0x12f;const _0x2dbe1f=a4_0x2dbe();let _0xfd7b63=_0x2dbe1f[_0x33f3f9];return _0xfd7b63;}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(_0x2b2735){const _0x48c887=a4_0xfd7b,_0x42e69d=[];if(_0x2b2735[_0x48c887(0x171)]!==undefined)_0x42e69d[_0x48c887(0x145)](_0x2b2735['total']+'\x20total');if(_0x2b2735[_0x48c887(0x162)]!==undefined&&_0x2b2735['new']>0x0)_0x42e69d[_0x48c887(0x145)](a4_0x24f204[_0x48c887(0x158)](_0x2b2735['new']+_0x48c887(0x1a6)));if(_0x2b2735[_0x48c887(0x14b)]!==undefined&&_0x2b2735[_0x48c887(0x14b)]>0x0)_0x42e69d['push'](a4_0x24f204[_0x48c887(0x158)](_0x2b2735['created']+'\x20created'));if(_0x2b2735[_0x48c887(0x1a7)]!==undefined&&_0x2b2735[_0x48c887(0x1a7)]>0x0)_0x42e69d[_0x48c887(0x145)](a4_0x24f204[_0x48c887(0x1a5)](_0x2b2735['updated']+_0x48c887(0x15f)));if(_0x2b2735[_0x48c887(0x164)]!==undefined&&_0x2b2735['unchanged']>0x0)_0x42e69d['push'](a4_0x24f204[_0x48c887(0x1b6)](_0x2b2735[_0x48c887(0x164)]+_0x48c887(0x160)));if(_0x2b2735[_0x48c887(0x14d)]!==undefined&&_0x2b2735[_0x48c887(0x14d)]>0x0)_0x42e69d['push'](a4_0x24f204[_0x48c887(0x18c)](_0x2b2735['errors']+_0x48c887(0x192)));return _0x42e69d[_0x48c887(0x1d4)](',\x20');}function displayDiffs(_0xcffd91,_0x4e99ff,_0x47317b,_0xeb746c,_0x4d8707=[]){const _0x241fbb=a4_0xfd7b;for(const _0x1d4cec of _0xcffd91){if(_0x1d4cec[_0x241fbb(0x136)]){const _0x31d91d=_0x1d4cec[_0x241fbb(0x13f)]||_0x1d4cec[_0x241fbb(0x1d5)];console['log'](_0x241fbb(0x14c)+_0x31d91d+'\x27:'),console[_0x241fbb(0x1c1)]('─'[_0x241fbb(0x18f)](0x3c)),console[_0x241fbb(0x1c1)](_0x1d4cec['diff']),console[_0x241fbb(0x1c1)]('─'[_0x241fbb(0x18f)](0x3c));}}for(const _0x99d07b of _0x4e99ff){_0x99d07b[_0x241fbb(0x136)]&&(console[_0x241fbb(0x1c1)](_0x241fbb(0x193)+_0x99d07b[_0x241fbb(0x1d5)]+'\x27:'),console[_0x241fbb(0x1c1)]('─'[_0x241fbb(0x18f)](0x3c)),console['log'](_0x99d07b[_0x241fbb(0x136)]),console['log']('─'[_0x241fbb(0x18f)](0x3c)));}for(const _0x38a7a9 of _0x47317b){_0x38a7a9[_0x241fbb(0x136)]&&(console['log'](_0x241fbb(0x16d)+_0x38a7a9[_0x241fbb(0x1d5)]+'\x27:'),console[_0x241fbb(0x1c1)]('─'[_0x241fbb(0x18f)](0x3c)),console[_0x241fbb(0x1c1)](_0x38a7a9[_0x241fbb(0x136)]),console['log']('─'[_0x241fbb(0x18f)](0x3c)));}for(const _0x2fca3c of _0xeb746c){_0x2fca3c['diff']&&(console[_0x241fbb(0x1c1)](_0x241fbb(0x176)+_0x2fca3c['name']+'\x27:'),console[_0x241fbb(0x1c1)]('─'[_0x241fbb(0x18f)](0x3c)),console['log'](_0x2fca3c[_0x241fbb(0x136)]),console[_0x241fbb(0x1c1)]('─'[_0x241fbb(0x18f)](0x3c)));}for(const _0x4704d6 of _0x4d8707){_0x4704d6[_0x241fbb(0x136)]&&(console['log'](_0x241fbb(0x1be)+_0x4704d6[_0x241fbb(0x1d5)]+'\x27:'),console['log']('─'[_0x241fbb(0x18f)](0x3c)),console[_0x241fbb(0x1c1)](_0x4704d6[_0x241fbb(0x136)]),console[_0x241fbb(0x1c1)]('─'[_0x241fbb(0x18f)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x3b07ea(0x1d5)]='agent:pull';['description']=a4_0x3b07ea(0x197);async[a4_0x3b07ea(0x149)](_0x36cefd){const _0x237fe2=a4_0x3b07ea,{options:_0x8f378,args:_0x159a17,tdx:_0x4f7d96}=_0x36cefd,_0x527f28=_0x159a17[0x0],_0x36a093=_0x159a17[0x1],_0x5356cc=_0x8f378['output'],_0x23932f=_0x8f378['dryRun'],_0x40eabe=_0x8f378['force'],_0x301dc2=_0x8f378['yes'],_0xaeb68a=_0x8f378[_0x237fe2(0x166)];let _0x1f5352,_0x2694de;const _0x24c47a=findAgentConfigPath(process[_0x237fe2(0x1c3)]());if(_0x527f28){const _0x79aabb=a4_0xfafc92[_0x237fe2(0x1d4)](_0x527f28,'tdx.json');if(existsSync(_0x79aabb))try{const _0x3bce2a=JSON[_0x237fe2(0x1af)](readFileSync(_0x79aabb,'utf-8'));_0x1f5352=_0x3bce2a['llm_project'],_0x2694de=_0x527f28,console[_0x237fe2(0x1c1)](a4_0x24f204[_0x237fe2(0x12f)](_0x237fe2(0x174)+_0x79aabb+':\x20'+_0x1f5352));}catch{_0x1f5352=_0x527f28;}else _0x1f5352=_0x527f28;}else{if(_0x24c47a)try{const _0x469808=JSON[_0x237fe2(0x1af)](readFileSync(_0x24c47a,_0x237fe2(0x18d)));_0x1f5352=_0x469808[_0x237fe2(0x1bc)],_0x2694de=a4_0xfafc92[_0x237fe2(0x19b)](_0x24c47a),console[_0x237fe2(0x1c1)](a4_0x24f204[_0x237fe2(0x12f)](_0x237fe2(0x187)+_0x1f5352));}catch{_0x1f5352=_0xaeb68a;}else _0x1f5352=_0xaeb68a;}if(!_0x1f5352)return console[_0x237fe2(0x1c1)](a4_0x24f204['yellow'](_0x237fe2(0x1c2))),console['log'](_0x237fe2(0x169)),console[_0x237fe2(0x1c1)](_0x237fe2(0x1c7)),console[_0x237fe2(0x1c1)](_0x237fe2(0x1ac)),console[_0x237fe2(0x1c1)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent'),0x1;if(_0x36a093){const {data:_0x4e2fd4}=await withSpinner(_0x237fe2(0x178)+_0x36a093+_0x237fe2(0x17c)+_0x1f5352+_0x237fe2(0x153),()=>_0x4f7d96[_0x237fe2(0x175)][_0x237fe2(0x1cb)](_0x1f5352,_0x36a093,_0x5356cc,{'dryRun':_0x23932f,'force':_0x40eabe}));if(_0x23932f)return console[_0x237fe2(0x1c1)](a4_0x24f204[_0x237fe2(0x1a5)](_0x237fe2(0x183))),console[_0x237fe2(0x1c1)](_0x237fe2(0x134)+_0x4e2fd4[_0x237fe2(0x13f)]),console[_0x237fe2(0x1c1)](_0x237fe2(0x17d)+_0x4e2fd4[_0x237fe2(0x137)]),_0x4e2fd4[_0x237fe2(0x136)]&&(console[_0x237fe2(0x1c1)](_0x237fe2(0x1c4)),console[_0x237fe2(0x1c1)]('─'[_0x237fe2(0x18f)](0x3c)),console['log'](_0x4e2fd4[_0x237fe2(0x136)]),console[_0x237fe2(0x1c1)]('─'[_0x237fe2(0x18f)](0x3c))),0x0;return console['log'](a4_0x24f204[_0x237fe2(0x158)](_0x237fe2(0x180))),console[_0x237fe2(0x1c1)](_0x237fe2(0x18e)+_0x4e2fd4[_0x237fe2(0x13f)]),console['log'](_0x237fe2(0x146)+_0x4e2fd4['outputPath']),console[_0x237fe2(0x1c1)](_0x237fe2(0x163)+(_0x4e2fd4[_0x237fe2(0x179)]?a4_0x24f204[_0x237fe2(0x158)](_0x237fe2(0x162)):_0x4e2fd4[_0x237fe2(0x19a)]?a4_0x24f204[_0x237fe2(0x1a5)](_0x237fe2(0x1a7)):a4_0x24f204['gray'](_0x237fe2(0x164)))),0x0;}const _0x29eaab=_0x2694de||_0x5356cc,{data:_0x368218}=await withSpinner('Analyzing\x20project\x20\x22'+_0x1f5352+_0x237fe2(0x153),()=>_0x4f7d96['llm'][_0x237fe2(0x198)](_0x1f5352,_0x29eaab,{'dryRun':!![]})),_0xae3837=_0x368218['counts'][_0x237fe2(0x17a)][_0x237fe2(0x162)]+_0x368218[_0x237fe2(0x14f)][_0x237fe2(0x191)][_0x237fe2(0x162)]+_0x368218['counts'][_0x237fe2(0x151)][_0x237fe2(0x162)]+_0x368218[_0x237fe2(0x14f)]['prompts'][_0x237fe2(0x162)]+_0x368218[_0x237fe2(0x14f)]['integrations']['new'],_0xe442ba=_0x368218['counts']['agents'][_0x237fe2(0x1a7)]+_0x368218[_0x237fe2(0x14f)][_0x237fe2(0x191)][_0x237fe2(0x1a7)]+_0x368218[_0x237fe2(0x14f)]['textKnowledgeBases'][_0x237fe2(0x1a7)]+_0x368218['counts']['prompts'][_0x237fe2(0x1a7)]+_0x368218[_0x237fe2(0x14f)]['integrations'][_0x237fe2(0x1a7)],_0x56fa54=_0x368218[_0x237fe2(0x14f)][_0x237fe2(0x17a)][_0x237fe2(0x164)]+_0x368218['counts'][_0x237fe2(0x191)][_0x237fe2(0x164)]+_0x368218[_0x237fe2(0x14f)][_0x237fe2(0x151)][_0x237fe2(0x164)]+_0x368218['counts']['prompts'][_0x237fe2(0x164)]+_0x368218[_0x237fe2(0x14f)][_0x237fe2(0x182)][_0x237fe2(0x164)];console[_0x237fe2(0x1c1)](_0x237fe2(0x16a)+_0x368218[_0x237fe2(0x1ad)]+'\x27:'),console[_0x237fe2(0x1c1)]('\x20\x20'+a4_0x24f204[_0x237fe2(0x158)]('+\x20'+_0xae3837+_0x237fe2(0x1a6))+_0x237fe2(0x14a)+a4_0x24f204[_0x237fe2(0x1a5)]('~\x20'+_0xe442ba+_0x237fe2(0x194))+_0x237fe2(0x14a)+a4_0x24f204[_0x237fe2(0x12f)]('=\x20'+_0x56fa54+'\x20unchanged')),console[_0x237fe2(0x1c1)]('\x20\x20Agents:\x20'+formatCountSummary(_0x368218[_0x237fe2(0x14f)][_0x237fe2(0x17a)])),console[_0x237fe2(0x1c1)](_0x237fe2(0x155)+formatCountSummary(_0x368218[_0x237fe2(0x14f)][_0x237fe2(0x191)])),console[_0x237fe2(0x1c1)](_0x237fe2(0x18b)+formatCountSummary(_0x368218[_0x237fe2(0x14f)][_0x237fe2(0x151)])),console['log'](_0x237fe2(0x1a8)+formatCountSummary(_0x368218[_0x237fe2(0x14f)][_0x237fe2(0x185)])),console[_0x237fe2(0x1c1)](_0x237fe2(0x1d0)+formatCountSummary(_0x368218[_0x237fe2(0x14f)]['integrations'])),console[_0x237fe2(0x1c1)](_0x237fe2(0x157)+a4_0x24f204['cyan'](_0x368218[_0x237fe2(0x15b)])),displayDiffs(_0x368218[_0x237fe2(0x17a)],_0x368218[_0x237fe2(0x191)],_0x368218['textKnowledgeBases'],_0x368218[_0x237fe2(0x185)],_0x368218[_0x237fe2(0x182)]);if(_0x23932f)return console[_0x237fe2(0x1c1)](a4_0x24f204[_0x237fe2(0x1a5)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0xae3837===0x0&&_0xe442ba===0x0)return console[_0x237fe2(0x1c1)](a4_0x24f204['green'](_0x237fe2(0x19d))),saveSessionContext({'llm_project':_0x368218[_0x237fe2(0x1ad)]},_0x8f378['session']),console[_0x237fe2(0x1c1)](a4_0x24f204[_0x237fe2(0x158)](_0x237fe2(0x195)+a4_0x24f204[_0x237fe2(0x12f)](_0x237fe2(0x1bc))+_0x237fe2(0x1b7)+a4_0x24f204[_0x237fe2(0x1c5)](_0x368218[_0x237fe2(0x1ad)]))),0x0;if(!_0x301dc2&&!_0x40eabe){if(!isInteractive())return console[_0x237fe2(0x1c8)](a4_0x24f204['red']('\x0aError:'),_0x237fe2(0x1d3)),console[_0x237fe2(0x1c8)](a4_0x24f204['dim'](_0x237fe2(0x1c9))),0x1;const _0x44aaa0=await confirmKey(_0x237fe2(0x141)+(_0xae3837+_0xe442ba)+_0x237fe2(0x1ba));if(!_0x44aaa0)return console[_0x237fe2(0x1c1)](a4_0x24f204[_0x237fe2(0x1a5)](_0x237fe2(0x1c0)),_0x237fe2(0x132)),0x1;}const {data:_0x5a7dcb}=await withSpinner('Writing\x20files...',()=>_0x4f7d96[_0x237fe2(0x175)][_0x237fe2(0x198)](_0x1f5352,_0x29eaab,{'force':_0x40eabe}));return console['log'](a4_0x24f204[_0x237fe2(0x158)](_0x237fe2(0x140)+(_0xae3837+_0xe442ba)+_0x237fe2(0x1ae)+_0x5a7dcb[_0x237fe2(0x15b)])),saveSessionContext({'llm_project':_0x5a7dcb[_0x237fe2(0x1ad)]},_0x8f378[_0x237fe2(0x13c)]),console[_0x237fe2(0x1c1)](a4_0x24f204['green']('✔\x20Context\x20set:\x20'+a4_0x24f204[_0x237fe2(0x12f)]('llm_project')+_0x237fe2(0x1b7)+a4_0x24f204[_0x237fe2(0x1c5)](_0x5a7dcb[_0x237fe2(0x1ad)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x3b07ea(0x1d5)]='agent:clone';['description']=a4_0x3b07ea(0x165);async['execute'](_0x48c0d0){const _0xec250b=a4_0x3b07ea,{options:_0x3ba86a,args:_0x3e138c,tdx:_0x79f6d8}=_0x48c0d0,_0x4dec24=_0x3e138c[0x0],_0x4e78af=_0x3ba86a[_0xec250b(0x1d5)],_0x259e01=_0x3ba86a[_0xec250b(0x17b)],_0x438d39=_0x3ba86a['yes'],_0x1af2b1=_0x3ba86a[_0xec250b(0x14e)],_0x5926b7=_0x3ba86a[_0xec250b(0x166)];let _0x4da93d;const _0x4e7c34=findAgentConfigPath(process['cwd']());if(_0x4dec24){const _0x2a5e90=a4_0xfafc92[_0xec250b(0x1d4)](_0x4dec24,_0xec250b(0x177));existsSync(_0x2a5e90)?(_0x4da93d=_0x4dec24,console[_0xec250b(0x1c1)](a4_0x24f204[_0xec250b(0x12f)](_0xec250b(0x196)+_0x4dec24))):_0x4da93d=_0x4dec24;}else{if(_0x4e7c34)_0x4da93d=a4_0xfafc92[_0xec250b(0x19b)](_0x4e7c34),console['log'](a4_0x24f204['dim'](_0xec250b(0x1cc)+_0x4da93d));else{if(_0x5926b7){const _0x4368ec=sanitizeForFilesystem(_0x5926b7);let _0x50263f=_0x4368ec,_0x2d3ffa=a4_0xfafc92[_0xec250b(0x1d4)](process[_0xec250b(0x1c3)](),_0xec250b(0x17a),_0x4368ec,_0xec250b(0x177));if(!existsSync(_0x2d3ffa)){const _0xb74439=normalizeName(_0x5926b7),_0x4846eb=a4_0xfafc92['join'](process[_0xec250b(0x1c3)](),_0xec250b(0x17a),_0xb74439,_0xec250b(0x177));existsSync(_0x4846eb)&&(_0x50263f=_0xb74439,_0x2d3ffa=_0x4846eb);}if(existsSync(_0x2d3ffa))_0x4da93d=a4_0xfafc92['dirname'](_0x2d3ffa),console[_0xec250b(0x1c1)](a4_0x24f204['dim']('Using\x20local\x20project:\x20'+_0x4da93d));else{const _0x53c6e9=_0x3ba86a['profile'];if(_0x53c6e9)throw new SDKError(ErrorCode[_0xec250b(0x1a4)],_0xec250b(0x190)+_0x5926b7+_0xec250b(0x1cd),undefined,{'helpText':'When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a'+_0xec250b(0x13e)+(_0xec250b(0x1d6)+_0x5926b7+'\x0a')+(_0xec250b(0x135)+_0x50263f+_0xec250b(0x1bd)+(_0x4e78af||_0xec250b(0x173))+_0xec250b(0x1a3)+_0x53c6e9)});_0x4da93d=_0x5926b7,console[_0xec250b(0x1c1)](a4_0x24f204[_0xec250b(0x12f)]('Using\x20context\x20project:\x20'+_0x5926b7));}}}}if(!_0x4da93d)return console[_0xec250b(0x1c1)](a4_0x24f204[_0xec250b(0x1a5)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0xec250b(0x1c1)](_0xec250b(0x181)),console[_0xec250b(0x1c1)](_0xec250b(0x1d2)),console[_0xec250b(0x1c1)]('\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)'),console['log'](_0xec250b(0x156)),0x1;if(!_0x4e78af)throw new SDKError(ErrorCode[_0xec250b(0x1aa)],_0xec250b(0x1b5),undefined,{'helpText':_0xec250b(0x1bf)});if(!_0x438d39&&!_0x259e01){if(!isInteractive())return console['error'](a4_0x24f204[_0xec250b(0x18c)](_0xec250b(0x19e)),_0xec250b(0x1d3)),console[_0xec250b(0x1c8)](a4_0x24f204[_0xec250b(0x12f)](_0xec250b(0x1c9))),0x1;const _0x3989a2=await confirmKey(_0xec250b(0x16f)+_0x4da93d+_0xec250b(0x18a)+_0x4e78af+'\x22?');if(!_0x3989a2)return console[_0xec250b(0x1c1)](a4_0x24f204['yellow']('Cancelled')),0x1;}const {data:_0x12a1bc}=await withSpinner(_0xec250b(0x1b3)+_0x4da93d+_0xec250b(0x1ca)+_0x4e78af+_0xec250b(0x153),()=>_0x79f6d8['llm']['cloneProject'](_0x4da93d,_0x4e78af,{'dryRun':_0x259e01}));if(_0x259e01)return console[_0xec250b(0x1c1)](a4_0x24f204[_0xec250b(0x1a5)](_0xec250b(0x154))),console[_0xec250b(0x1c1)](_0xec250b(0x15d)+_0x12a1bc['sourceProjectName']),console['log'](_0xec250b(0x1d1)+_0x4e78af),console['log'](_0xec250b(0x1b0)),console[_0xec250b(0x1c1)](_0xec250b(0x161)+_0x12a1bc['counts']['agents']['created']),console['log'](_0xec250b(0x155)+_0x12a1bc[_0xec250b(0x14f)][_0xec250b(0x191)][_0xec250b(0x14b)]),console[_0xec250b(0x1c1)](_0xec250b(0x1a8)+_0x12a1bc[_0xec250b(0x14f)][_0xec250b(0x185)][_0xec250b(0x14b)]),0x0;const _0x582c27=_0x12a1bc[_0xec250b(0x14f)]['agents']['errors']>0x0||_0x12a1bc[_0xec250b(0x14f)][_0xec250b(0x191)][_0xec250b(0x14d)]>0x0||_0x12a1bc[_0xec250b(0x14f)][_0xec250b(0x185)][_0xec250b(0x14d)]>0x0;_0x582c27?console[_0xec250b(0x1c1)](a4_0x24f204['yellow'](_0xec250b(0x144))):console[_0xec250b(0x1c1)](a4_0x24f204['green'](_0xec250b(0x1a2)));console['log']('Source:\x20'+_0x12a1bc['sourceProjectName']),console[_0xec250b(0x1c1)](_0xec250b(0x1d1)+_0x12a1bc['newProjectName']),console[_0xec250b(0x1c1)](_0xec250b(0x148)+_0x12a1bc['newProjectId']),console[_0xec250b(0x1c1)](),console['log'](_0xec250b(0x172)),console['log'](_0xec250b(0x161)+formatCountSummary(_0x12a1bc[_0xec250b(0x14f)][_0xec250b(0x17a)])),console['log'](_0xec250b(0x155)+formatCountSummary(_0x12a1bc[_0xec250b(0x14f)][_0xec250b(0x191)])),console[_0xec250b(0x1c1)](_0xec250b(0x1a8)+formatCountSummary(_0x12a1bc['counts'][_0xec250b(0x185)])),console['log']('\x20\x20Integrations:\x20'+formatCountSummary(_0x12a1bc['counts']['integrations']));if(_0x582c27){console[_0xec250b(0x1c1)](),console[_0xec250b(0x1c1)](a4_0x24f204[_0xec250b(0x18c)](_0xec250b(0x13d)));for(const _0x18b272 of _0x12a1bc[_0xec250b(0x17a)]){_0x18b272['action']==='error'&&console[_0xec250b(0x1c1)](a4_0x24f204[_0xec250b(0x18c)]('\x20\x20Agent\x20\x22'+_0x18b272[_0xec250b(0x13f)]+_0xec250b(0x1b4)+_0x18b272[_0xec250b(0x1c8)]));}for(const _0x1c4092 of _0x12a1bc['knowledgeBases']){_0x1c4092[_0xec250b(0x1ce)]===_0xec250b(0x1c8)&&console[_0xec250b(0x1c1)](a4_0x24f204[_0xec250b(0x18c)](_0xec250b(0x1bb)+_0x1c4092[_0xec250b(0x1d5)]+_0xec250b(0x1b4)+_0x1c4092['error']));}for(const _0x48b230 of _0x12a1bc[_0xec250b(0x185)]){_0x48b230[_0xec250b(0x1ce)]===_0xec250b(0x1c8)&&console[_0xec250b(0x1c1)](a4_0x24f204[_0xec250b(0x18c)](_0xec250b(0x16c)+_0x48b230[_0xec250b(0x1d5)]+'\x22:\x20'+_0x48b230[_0xec250b(0x1c8)]));}for(const _0x929c8d of _0x12a1bc['integrations']){_0x929c8d[_0xec250b(0x1ce)]==='error'&&console[_0xec250b(0x1c1)](a4_0x24f204['red']('\x20\x20Integration\x20\x22'+_0x929c8d[_0xec250b(0x1d5)]+_0xec250b(0x1b4)+_0x929c8d['error']));}return 0x1;}console[_0xec250b(0x1c1)]();const _0x3cbfdc=getLLMProjectUrl(_0x1af2b1,_0x12a1bc[_0xec250b(0x13b)]);return console[_0xec250b(0x1c1)](_0xec250b(0x167)+a4_0x24f204[_0xec250b(0x1c5)](_0x3cbfdc)),0x0;}}export class AgentPushCommand extends BaseCommand{['name']='agent:push';[a4_0x3b07ea(0x13a)]=a4_0x3b07ea(0x1a1);async['execute'](_0x5e4523){const _0x5d7551=a4_0x3b07ea,{options:_0xd04724,args:_0x14dc5a,tdx:_0x2ee292}=_0x5e4523;let _0x3a91ef=_0x14dc5a[0x0]||process[_0x5d7551(0x1c3)]();const _0x125620=_0xd04724[_0x5d7551(0x17b)],_0x73f8bd=_0xd04724['force'],_0x1d3eb9=_0xd04724[_0x5d7551(0x15c)],_0x365d11=_0xd04724['site'],_0x26a2e0=a4_0xfafc92['join'](_0x3a91ef,_0x5d7551(0x184)),_0x15873b=existsSync(_0x26a2e0);if(_0x15873b){const {data:_0x527f8f}=await withSpinner(_0x5d7551(0x143)+_0x3a91ef+_0x5d7551(0x153),()=>_0x2ee292[_0x5d7551(0x175)]['pushAgent'](_0x3a91ef,{'dryRun':_0x125620,'force':_0x73f8bd}));if(_0x125620)return console[_0x5d7551(0x1c1)](a4_0x24f204[_0x5d7551(0x1a5)](_0x5d7551(0x154))),console[_0x5d7551(0x1c1)]('Would\x20push\x20agent:\x20'+_0x527f8f[_0x5d7551(0x13f)]),0x0;if(_0x527f8f[_0x5d7551(0x1ce)]==='error')return console['log'](a4_0x24f204[_0x5d7551(0x18c)](_0x5d7551(0x16b)+_0x527f8f['error'])),0x1;console['log'](a4_0x24f204[_0x5d7551(0x158)](_0x5d7551(0x188)+_0x527f8f[_0x5d7551(0x1ce)]+_0x5d7551(0x139))),console[_0x5d7551(0x1c1)](_0x5d7551(0x18e)+_0x527f8f[_0x5d7551(0x13f)]);if(_0x527f8f[_0x5d7551(0x17f)]&&_0x527f8f[_0x5d7551(0x133)]){const _0x453c21=getLLMAgentChatUrl(_0x365d11,_0x527f8f[_0x5d7551(0x133)],_0x527f8f[_0x5d7551(0x17f)]);console[_0x5d7551(0x1c1)]('Chat:\x20'+a4_0x24f204[_0x5d7551(0x1c5)](_0x453c21));}return 0x0;}const _0x2fbbea=_0xd04724[_0x5d7551(0x166)],_0x27217b=resolveProjectFromContext(_0x3a91ef,_0x2fbbea);if(_0x27217b[_0x5d7551(0x15a)])_0x3a91ef=_0x27217b['projectDir'],_0x27217b['source']===_0x5d7551(0x1b9)&&console[_0x5d7551(0x1c1)](a4_0x24f204['dim'](_0x5d7551(0x187)+_0x3a91ef));else{let _0x385f6d='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x27217b['reason']===_0x5d7551(0x170)&&(_0x385f6d=_0x27217b['message']+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x27217b['llmProject']+_0x5d7551(0x16e));throw new SDKError(ErrorCode[_0x5d7551(0x1a4)],_0x27217b[_0x5d7551(0x1cf)]===_0x5d7551(0x1b2)?_0x27217b[_0x5d7551(0x1ab)]:_0x5d7551(0x1c6)+_0x3a91ef,undefined,{'helpText':_0x385f6d});}const {data:_0x59465b}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x2ee292[_0x5d7551(0x175)][_0x5d7551(0x199)](_0x3a91ef,{'dryRun':!![]})),_0x2085c6=_0x59465b[_0x5d7551(0x14f)]['agents'][_0x5d7551(0x14d)]>0x0;if(_0x2085c6){console['log'](a4_0x24f204[_0x5d7551(0x18c)](_0x5d7551(0x1b8)));for(const _0x441b3e of _0x59465b[_0x5d7551(0x17a)]){_0x441b3e['action']===_0x5d7551(0x1c8)&&console[_0x5d7551(0x1c1)](a4_0x24f204['red'](_0x5d7551(0x186)+_0x441b3e['agentName']+'\x22:\x20'+_0x441b3e['error']));}return 0x1;}const _0x3f9a06=_0x59465b['counts'][_0x5d7551(0x17a)][_0x5d7551(0x14b)]+_0x59465b['counts'][_0x5d7551(0x191)][_0x5d7551(0x14b)]+_0x59465b[_0x5d7551(0x14f)]['textKnowledgeBases'][_0x5d7551(0x14b)]+_0x59465b[_0x5d7551(0x14f)]['prompts'][_0x5d7551(0x14b)]+_0x59465b['counts'][_0x5d7551(0x182)][_0x5d7551(0x14b)],_0x4fb69d=_0x59465b['counts'][_0x5d7551(0x17a)][_0x5d7551(0x1a7)]+_0x59465b[_0x5d7551(0x14f)][_0x5d7551(0x191)][_0x5d7551(0x1a7)]+_0x59465b[_0x5d7551(0x14f)][_0x5d7551(0x151)]['updated']+_0x59465b['counts'][_0x5d7551(0x185)]['updated']+_0x59465b[_0x5d7551(0x14f)][_0x5d7551(0x182)][_0x5d7551(0x1a7)],_0x395974=_0x59465b[_0x5d7551(0x14f)]['agents'][_0x5d7551(0x164)]+_0x59465b['counts'][_0x5d7551(0x191)][_0x5d7551(0x164)]+_0x59465b[_0x5d7551(0x14f)][_0x5d7551(0x151)][_0x5d7551(0x164)]+_0x59465b[_0x5d7551(0x14f)]['prompts'][_0x5d7551(0x164)]+_0x59465b[_0x5d7551(0x14f)][_0x5d7551(0x182)][_0x5d7551(0x164)];console[_0x5d7551(0x1c1)](_0x5d7551(0x138)+_0x59465b['projectName']+'\x27:'),console[_0x5d7551(0x1c1)]('\x20\x20'+a4_0x24f204[_0x5d7551(0x158)]('+\x20'+_0x3f9a06+_0x5d7551(0x1a6))+'\x20|\x20'+a4_0x24f204[_0x5d7551(0x1a5)]('~\x20'+_0x4fb69d+'\x20changed')+'\x20|\x20'+a4_0x24f204['dim']('=\x20'+_0x395974+_0x5d7551(0x160))),console['log'](_0x5d7551(0x161)+formatCountSummary(_0x59465b[_0x5d7551(0x14f)]['agents'])),console[_0x5d7551(0x1c1)](_0x5d7551(0x155)+formatCountSummary(_0x59465b[_0x5d7551(0x14f)][_0x5d7551(0x191)])),console['log']('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x59465b[_0x5d7551(0x14f)][_0x5d7551(0x151)])),console[_0x5d7551(0x1c1)](_0x5d7551(0x1a8)+formatCountSummary(_0x59465b[_0x5d7551(0x14f)][_0x5d7551(0x185)])),console[_0x5d7551(0x1c1)](_0x5d7551(0x1d0)+formatCountSummary(_0x59465b[_0x5d7551(0x14f)][_0x5d7551(0x182)])),console[_0x5d7551(0x1c1)](_0x5d7551(0x147)+a4_0x24f204[_0x5d7551(0x1c5)](_0x3a91ef)),displayDiffs(_0x59465b[_0x5d7551(0x17a)],_0x59465b[_0x5d7551(0x191)],_0x59465b[_0x5d7551(0x151)],_0x59465b[_0x5d7551(0x185)],_0x59465b[_0x5d7551(0x182)]);if(_0x125620)return console['log'](a4_0x24f204[_0x5d7551(0x1a5)](_0x5d7551(0x17e))),0x0;if(_0x3f9a06===0x0&&_0x4fb69d===0x0){console[_0x5d7551(0x1c1)](a4_0x24f204[_0x5d7551(0x158)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x38ffae=getLLMProjectUrl(_0x365d11,_0x59465b[_0x5d7551(0x133)]);return console[_0x5d7551(0x1c1)]('Project:\x20'+a4_0x24f204[_0x5d7551(0x1c5)](_0x38ffae)),0x0;}if(!_0x1d3eb9&&!_0x73f8bd){if(!isInteractive())return console['error'](a4_0x24f204[_0x5d7551(0x18c)](_0x5d7551(0x19e)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a4_0x24f204['dim'](_0x5d7551(0x1c9))),0x1;const _0xe7d564=await confirmKey('\x0aPush\x20'+(_0x3f9a06+_0x4fb69d)+_0x5d7551(0x159));if(!_0xe7d564)return console[_0x5d7551(0x1c1)](a4_0x24f204[_0x5d7551(0x1a5)](_0x5d7551(0x1c0)),'-\x20nothing\x20pushed'),0x1;}const {data:_0x2015fa}=await withSpinner(_0x5d7551(0x19c),()=>_0x2ee292[_0x5d7551(0x175)][_0x5d7551(0x199)](_0x3a91ef,{'force':_0x73f8bd})),_0x1e0430=_0x2015fa[_0x5d7551(0x14f)]['agents'][_0x5d7551(0x14d)]>0x0||_0x2015fa[_0x5d7551(0x14f)][_0x5d7551(0x191)][_0x5d7551(0x14d)]>0x0||_0x2015fa[_0x5d7551(0x14f)]['textKnowledgeBases'][_0x5d7551(0x14d)]>0x0||_0x2015fa['counts'][_0x5d7551(0x185)][_0x5d7551(0x14d)]>0x0;if(_0x1e0430){console[_0x5d7551(0x1c1)](a4_0x24f204[_0x5d7551(0x1a5)](_0x5d7551(0x1a9))),console[_0x5d7551(0x1c1)](),console[_0x5d7551(0x1c1)](a4_0x24f204['red'](_0x5d7551(0x13d)));for(const _0xdb6225 of _0x2015fa[_0x5d7551(0x17a)]){_0xdb6225[_0x5d7551(0x1ce)]===_0x5d7551(0x1c8)&&console[_0x5d7551(0x1c1)](a4_0x24f204['red'](_0x5d7551(0x186)+_0xdb6225[_0x5d7551(0x13f)]+_0x5d7551(0x1b4)+_0xdb6225[_0x5d7551(0x1c8)]));}for(const _0x4086e2 of _0x2015fa[_0x5d7551(0x191)]){_0x4086e2[_0x5d7551(0x1ce)]===_0x5d7551(0x1c8)&&console[_0x5d7551(0x1c1)](a4_0x24f204[_0x5d7551(0x18c)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x4086e2[_0x5d7551(0x1d5)]+_0x5d7551(0x1b4)+_0x4086e2[_0x5d7551(0x1c8)]));}for(const _0x2d33ec of _0x2015fa[_0x5d7551(0x151)]){_0x2d33ec[_0x5d7551(0x1ce)]===_0x5d7551(0x1c8)&&console[_0x5d7551(0x1c1)](a4_0x24f204[_0x5d7551(0x18c)](_0x5d7551(0x130)+_0x2d33ec[_0x5d7551(0x1d5)]+_0x5d7551(0x1b4)+_0x2d33ec['error']));}for(const _0x57a23d of _0x2015fa['prompts']){_0x57a23d[_0x5d7551(0x1ce)]===_0x5d7551(0x1c8)&&console[_0x5d7551(0x1c1)](a4_0x24f204[_0x5d7551(0x18c)]('\x20\x20Prompt\x20\x22'+_0x57a23d[_0x5d7551(0x1d5)]+_0x5d7551(0x1b4)+_0x57a23d['error']));}for(const _0x54cb6b of _0x2015fa['integrations']){_0x54cb6b['action']===_0x5d7551(0x1c8)&&console[_0x5d7551(0x1c1)](a4_0x24f204['red']('\x20\x20Integration\x20\x22'+_0x54cb6b[_0x5d7551(0x1d5)]+_0x5d7551(0x1b4)+_0x54cb6b[_0x5d7551(0x1c8)]));}return 0x1;}console[_0x5d7551(0x1c1)](a4_0x24f204[_0x5d7551(0x158)](_0x5d7551(0x168)+(_0x3f9a06+_0x4fb69d)+'\x20resources\x20to\x20\x27'+_0x2015fa[_0x5d7551(0x1ad)]+'\x27'));const _0x20fc33=getLLMProjectUrl(_0x365d11,_0x2015fa[_0x5d7551(0x133)]);return console['log'](_0x5d7551(0x167)+a4_0x24f204['cyan'](_0x20fc33)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0xea0d6f=a5_0x19f4;function a5_0xfcc8(){const _0x2886ef=['Failed:\x20\x20\x20','no_tests','join','some','rounds','15823290HVOauB','Project\x20path:\x20','Agent:\x20','size','log','llmProject','start','Evaluating\x20response...','5705682DVKKEx','executeReeval','Run\x20\x27tdx\x20agent\x20pull\x20','projectName','testYmlPath','✗\x20FAIL:\x20','tags','\x20\x20Site:\x20','site','Test\x20Summary','\x20\x20Conversation:\x20','writeFileSync','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Errors:\x20\x20\x20','agent:test','now','tsv','9061595xWqmBO','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','text','\x20\x20Project:\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','json','\x27\x20to\x20create\x20the\x20folder\x20structure.','Available\x20tags:\x20','694CEKYVY','includes','12222909VoIUYI','Error:\x20No\x20previous\x20test\x20run\x20found.','not\x20found','✓\x20PASS:\x20','No\x20tests\x20have\x20tags\x20defined.','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','table','Output\x20written\x20to:\x20','toLowerCase','green','eval','3350312TfMsvn','source','verbose','agentName','4PgHvXW',':\x20Sending\x20user\x20input...','No\x20tests\x20found\x20with\x20tags:\x20','isSpinning','testName','dim','execute','...\x20','find','Usage:','Cached\x20run\x20from:\x20','Tests\x20found:\x20','white','Round\x201/','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','reason','resolveAgentId','no_context','\x22,\x20but\x20current\x20site\x20is\x20\x22','/<agent-name>','dryRun','Re-evaluating...','Run\x20tests\x20for\x20an\x20LLM\x20agent','✗\x20ERROR:\x20','round','push','name','yellow','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','cyan','Re-evaluation\x20Summary','tests','ERROR','output','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','\x20-\x20','\x20\x20Agent:\x20','reeval','✗\x20ERROR:\x20Project\x20not\x20found:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','conversations','existsSync','resolveProjectId','Duration:\x20','agentDirs','Executing\x20new\x20tests...','description','message','test.yml','Test\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','timestamp','...','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','length','projectDir','trim','Running:\x20','\x22:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','No\x20tests\x20found\x20matching:\x20','context','utf-8','Error\x20writing\x20output\x20file:\x20','\x20\x20Round\x20','has','11091BRYeWz','map','Total:\x20\x20\x20\x20','jsonl','status','toISOString','filter','\x20\x20-\x20','forEach','11wDFNca','red','split','conversation_url','resolve','Using\x20agent:\x20','stop','\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)','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','agent','PASS','Running\x20test:\x20','Test\x20Configuration:','Passed:\x20\x20\x20','\x20(cached)','repeat','8PujpSj','276383xRrviT','FAIL','llm','Failed\x20Tests:'];a5_0xfcc8=function(){return _0x2886ef;};return a5_0xfcc8();}(function(_0x5907ee,_0x1a1ea3){const _0x2aacb7=a5_0x19f4,_0x4dd10b=_0x5907ee();while(!![]){try{const _0x144d95=-parseInt(_0x2aacb7(0xa2))/0x1+parseInt(_0x2aacb7(0xcc))/0x2*(-parseInt(_0x2aacb7(0x11f))/0x3)+-parseInt(_0x2aacb7(0xdd))/0x4*(-parseInt(_0x2aacb7(0xc4))/0x5)+parseInt(_0x2aacb7(0xb3))/0x6+-parseInt(_0x2aacb7(0xd9))/0x7+parseInt(_0x2aacb7(0xa1))/0x8*(-parseInt(_0x2aacb7(0xce))/0x9)+-parseInt(_0x2aacb7(0xab))/0xa*(-parseInt(_0x2aacb7(0x91))/0xb);if(_0x144d95===_0x1a1ea3)break;else _0x4dd10b['push'](_0x4dd10b['shift']());}catch(_0x13a872){_0x4dd10b['push'](_0x4dd10b['shift']());}}}(a5_0xfcc8,0xe7d84));import*as a5_0x4b344f from'node:fs';import*as a5_0x5261cd from'node:path';import a5_0x1043b6 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';function a5_0x19f4(_0x679fe7,_0x145ca6){_0x679fe7=_0x679fe7-0x8f;const _0xfcc82=a5_0xfcc8();let _0x19f446=_0xfcc82[_0x679fe7];return _0x19f446;}import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{['name']=a5_0xea0d6f(0xc1);[a5_0xea0d6f(0x10b)]=a5_0xea0d6f(0xf3);async[a5_0xea0d6f(0xe3)](_0x3025e0){const _0x10bed6=a5_0xea0d6f,{options:_0x470169,args:_0x340da8,tdx:_0x36380c}=_0x3025e0,_0x2473e3=_0x340da8[0x0]||'.',_0x3a9219=_0x470169[_0x10bed6(0xf1)],_0x11baa0=_0x470169,_0x16da1e=_0x11baa0[_0x10bed6(0xd8)]===![],_0x343e14=_0x11baa0[_0x10bed6(0x102)],_0x51639e=_0x11baa0[_0x10bed6(0xf7)],_0x5e3051=_0x11baa0[_0x10bed6(0xb9)],_0x38bc5b=_0x470169[_0x10bed6(0xbb)],_0x38eb35=_0x11baa0[_0x10bed6(0xfe)];if(_0x343e14&&_0x16da1e)return console['log'](a5_0x1043b6[_0x10bed6(0x92)]('Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval')),0x1;let _0x39412a=_0x10bed6(0xd4);if(_0x11baa0[_0x10bed6(0xc9)])_0x39412a='json';else{if(_0x11baa0[_0x10bed6(0x122)])_0x39412a=_0x10bed6(0x122);else{if(_0x11baa0[_0x10bed6(0xc3)])_0x39412a=_0x10bed6(0xc3);else{if(_0x11baa0['table'])_0x39412a=_0x10bed6(0xd4);}}}const _0x5742f8=_0x11baa0[_0x10bed6(0xb0)];let _0x5a22c5=_0x2473e3;const _0x17a77=a5_0x4b344f[_0x10bed6(0x106)](_0x2473e3),_0x998bc8=_0x2473e3==='.';if(!_0x17a77||_0x998bc8){const _0x19048c=resolveProjectFromContext(_0x2473e3,_0x5742f8,{'requireFile':_0x10bed6(0x10d)});if(_0x19048c['found'])_0x5a22c5=_0x19048c[_0x10bed6(0x114)],_0x19048c[_0x10bed6(0xda)]===_0x10bed6(0x11a)&&console[_0x10bed6(0xaf)](a5_0x1043b6[_0x10bed6(0xe2)](_0x10bed6(0x96)+_0x5a22c5));else switch(_0x19048c['reason']){case _0x10bed6(0xee):console[_0x10bed6(0xaf)](a5_0x1043b6['yellow'](_0x19048c['message'])),console[_0x10bed6(0xaf)](),console[_0x10bed6(0xaf)](_0x10bed6(0xe6)),console[_0x10bed6(0xaf)]('\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[_0x10bed6(0xaf)](_0x10bed6(0x98)),console[_0x10bed6(0xaf)](),console[_0x10bed6(0xaf)](_0x10bed6(0x99));return 0x1;case'no_local_folder':console['log'](a5_0x1043b6['yellow'](_0x19048c[_0x10bed6(0x10c)])),console[_0x10bed6(0xaf)](),console[_0x10bed6(0xaf)](_0x10bed6(0xb5)+_0x19048c[_0x10bed6(0xb0)]+_0x10bed6(0xca));return 0x1;case'multiple_agents':{const _0x403339=a5_0x5261cd['basename'](_0x19048c[_0x10bed6(0x114)]);console[_0x10bed6(0xaf)](a5_0x1043b6[_0x10bed6(0xf8)](_0x10bed6(0xf9)+_0x19048c[_0x10bed6(0xb0)]+'\x22:'));for(const _0x3e1279 of _0x19048c[_0x10bed6(0x109)]){console[_0x10bed6(0xaf)](_0x10bed6(0x8f)+_0x3e1279);}return console[_0x10bed6(0xaf)](),console['log'](_0x10bed6(0xd3)+_0x403339+_0x10bed6(0xf0)),0x1;}case _0x10bed6(0xa7):console['log'](a5_0x1043b6[_0x10bed6(0xf8)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x19048c[_0x10bed6(0xb0)]+'\x22.')),console[_0x10bed6(0xaf)](a5_0x1043b6[_0x10bed6(0xe2)](_0x10bed6(0xac)+_0x19048c[_0x10bed6(0x114)])),console['log'](),console[_0x10bed6(0xaf)](_0x10bed6(0x112));return 0x1;}}const {definition:_0x51ffa2,agentInfo:_0x390df7}=parseTestFile(_0x5a22c5);let _0x21486f=_0x51ffa2[_0x10bed6(0xfc)];if(_0x51639e){const _0x1a2a22=_0x51639e[_0x10bed6(0x93)](',')[_0x10bed6(0x120)](_0x5dfa04=>_0x5dfa04[_0x10bed6(0x115)]());_0x21486f=_0x51ffa2['tests'][_0x10bed6(0x125)](_0x47f7d0=>_0x1a2a22[_0x10bed6(0xcd)](_0x47f7d0[_0x10bed6(0xf7)]));if(_0x21486f[_0x10bed6(0x113)]===0x0)return console['log'](a5_0x1043b6[_0x10bed6(0xf8)](_0x10bed6(0x119)+_0x51639e)),console[_0x10bed6(0xaf)](a5_0x1043b6[_0x10bed6(0xe2)]('Available\x20tests:\x20'+_0x51ffa2['tests'][_0x10bed6(0x120)](_0x2e7b73=>_0x2e7b73[_0x10bed6(0xf7)])['join'](',\x20'))),0x1;}if(_0x5e3051){const _0x947329=_0x5e3051[_0x10bed6(0x93)](',')[_0x10bed6(0x120)](_0x131a22=>_0x131a22[_0x10bed6(0x115)]()[_0x10bed6(0xd6)]());_0x21486f=_0x21486f['filter'](_0x180232=>_0x180232[_0x10bed6(0xb9)]?.[_0x10bed6(0xa9)](_0x221b94=>_0x947329['includes'](_0x221b94[_0x10bed6(0xd6)]())));if(_0x21486f[_0x10bed6(0x113)]===0x0){console['log'](a5_0x1043b6[_0x10bed6(0xf8)](_0x10bed6(0xdf)+_0x5e3051));const _0xce7512=new Set();return _0x51ffa2[_0x10bed6(0xfc)]['forEach'](_0x23f1d7=>_0x23f1d7[_0x10bed6(0xb9)]?.[_0x10bed6(0x90)](_0x3fe81d=>_0xce7512['add'](_0x3fe81d))),_0xce7512[_0x10bed6(0xae)]>0x0?console[_0x10bed6(0xaf)](a5_0x1043b6['dim'](_0x10bed6(0xcb)+[..._0xce7512][_0x10bed6(0xa8)](',\x20'))):console[_0x10bed6(0xaf)](a5_0x1043b6[_0x10bed6(0xe2)](_0x10bed6(0xd2))),0x1;}}if(_0x343e14)return this[_0x10bed6(0xb4)](_0x3025e0,{'definition':{'tests':_0x21486f},'agentInfo':_0x390df7,'outputFormat':_0x39412a,'outputFile':_0x38eb35,'testNames':_0x51639e});if(_0x3a9219){console['log'](a5_0x1043b6[_0x10bed6(0xfa)](_0x10bed6(0x9d))),console['log'](_0x10bed6(0xba)+a5_0x1043b6[_0x10bed6(0xe9)](_0x38bc5b)),console[_0x10bed6(0xaf)](_0x10bed6(0xc7)+a5_0x1043b6[_0x10bed6(0xe9)](_0x390df7['projectName'])),console[_0x10bed6(0xaf)](_0x10bed6(0x101)+a5_0x1043b6[_0x10bed6(0xe9)](_0x390df7[_0x10bed6(0xdc)])),console['log'](),console['log'](_0x10bed6(0xe8)+a5_0x1043b6[_0x10bed6(0xe9)](_0x21486f[_0x10bed6(0x113)]));for(let _0x22f610=0x0;_0x22f610<_0x21486f[_0x10bed6(0x113)];_0x22f610++){const _0x4396fd=_0x21486f[_0x22f610],_0x317be2=_0x4396fd[_0x10bed6(0xaa)][_0x10bed6(0x113)]===0x1?_0x10bed6(0xf5):'rounds',_0x41c788=_0x4396fd[_0x10bed6(0xb9)]?.[_0x10bed6(0x113)]?'\x20['+_0x4396fd['tags'][_0x10bed6(0xa8)](',\x20')+']':'';console[_0x10bed6(0xaf)]('\x20\x20'+(_0x22f610+0x1)+'.\x20'+a5_0x1043b6['white'](_0x4396fd[_0x10bed6(0xf7)])+'\x20('+_0x4396fd[_0x10bed6(0xaa)]['length']+'\x20'+_0x317be2+')'+a5_0x1043b6['dim'](_0x41c788));}return 0x0;}let _0x3e1515,_0x112d57;try{_0x3e1515=await _0x36380c[_0x10bed6(0xa4)][_0x10bed6(0x107)](_0x390df7['projectName']);}catch(_0x4e0e3c){const _0x233f1d=_0x4e0e3c instanceof Error?_0x4e0e3c[_0x10bed6(0x10c)]:String(_0x4e0e3c);return _0x233f1d[_0x10bed6(0xcd)]('404')||_0x233f1d[_0x10bed6(0xd6)]()[_0x10bed6(0xcd)](_0x10bed6(0xd0))?console[_0x10bed6(0xaf)](a5_0x1043b6[_0x10bed6(0x92)](_0x10bed6(0x103)+_0x390df7[_0x10bed6(0xb6)])):console[_0x10bed6(0xaf)](a5_0x1043b6['red'](_0x10bed6(0x118)+_0x390df7[_0x10bed6(0xb6)]+_0x10bed6(0x117)+_0x233f1d)),0x1;}try{_0x112d57=await _0x36380c[_0x10bed6(0xa4)][_0x10bed6(0xed)](_0x390df7['agentName'],_0x3e1515);}catch(_0x21b610){const _0x3c2507=_0x21b610 instanceof Error?_0x21b610[_0x10bed6(0x10c)]:String(_0x21b610);return _0x3c2507[_0x10bed6(0xcd)]('404')||_0x3c2507[_0x10bed6(0xd6)]()['includes'](_0x10bed6(0xd0))?console[_0x10bed6(0xaf)](a5_0x1043b6[_0x10bed6(0x92)](_0x10bed6(0xeb)+_0x390df7[_0x10bed6(0xdc)])):console[_0x10bed6(0xaf)](a5_0x1043b6[_0x10bed6(0x92)](_0x10bed6(0x104)+_0x390df7['agentName']+_0x10bed6(0x117)+_0x3c2507)),0x1;}let _0x111215;if(!_0x16da1e)try{_0x111215=await setupEvaluatorAgent(_0x36380c[_0x10bed6(0xa4)],_0x470169[_0x10bed6(0xdb)]);}catch(_0xda5ffc){const _0x1ebc84=_0xda5ffc instanceof Error?_0xda5ffc[_0x10bed6(0x10c)]:String(_0xda5ffc);return console[_0x10bed6(0xaf)](a5_0x1043b6[_0x10bed6(0x92)](_0x10bed6(0x10f)+_0x1ebc84)),0x1;}console['log'](a5_0x1043b6[_0x10bed6(0xfa)]('Running\x20agent\x20tests...')),console[_0x10bed6(0xaf)]('Site:\x20'+a5_0x1043b6[_0x10bed6(0xe9)](_0x38bc5b)),console[_0x10bed6(0xaf)](_0x10bed6(0xad)+a5_0x1043b6[_0x10bed6(0xe9)](_0x390df7['projectName']+'/'+_0x390df7[_0x10bed6(0xdc)])),console[_0x10bed6(0xaf)]();const _0x45187c=[],_0x1075c6=[],_0x813f3e=Date[_0x10bed6(0xc2)]();for(let _0x43c358=0x0;_0x43c358<_0x21486f[_0x10bed6(0x113)];_0x43c358++){const _0x3802bf=_0x21486f[_0x43c358];_0x21486f[_0x10bed6(0x113)]>0x1?console['log'](_0x10bed6(0x10e)+(_0x43c358+0x1)+'/'+_0x21486f[_0x10bed6(0x113)]+':\x20'+a5_0x1043b6[_0x10bed6(0xe9)](_0x3802bf[_0x10bed6(0xf7)])):console[_0x10bed6(0xaf)](_0x10bed6(0x9c)+a5_0x1043b6[_0x10bed6(0xe9)](_0x3802bf['name']));const _0x5e4c3b=createCommandSpinner(_0x10bed6(0xea)+_0x3802bf[_0x10bed6(0xaa)][_0x10bed6(0x113)]+_0x10bed6(0xde));_0x5e4c3b[_0x10bed6(0xb1)]();try{const {result:_0x24fc3c,conversation:_0x2047b1}=await runTest(_0x36380c[_0x10bed6(0xa4)],_0x3802bf,{'agentId':_0x112d57,'projectId':_0x3e1515,'site':_0x38bc5b,'noEval':_0x16da1e,'evaluatorId':_0x111215,'onRoundStart':(_0x470747,_0x345be7)=>{const _0x4c323f=_0x10bed6;_0x5e4c3b[_0x4c323f(0xc6)]='Round\x20'+(_0x470747+0x1)+'/'+_0x345be7+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x583725,_0x18ae24,_0x3c55e3)=>{const _0x3f2e18=_0x10bed6,_0x4aa9bf=formatElapsed(_0x18ae24);_0x3c55e3?console[_0x3f2e18(0xaf)]('\x20\x20Round\x20'+(_0x583725+0x1)+'/'+_0x3802bf[_0x3f2e18(0xaa)][_0x3f2e18(0x113)]+_0x3f2e18(0xe4)+a5_0x1043b6[_0x3f2e18(0xd7)]('✓')+'\x20('+_0x4aa9bf+')'):console[_0x3f2e18(0xaf)]('\x20\x20Round\x20'+(_0x583725+0x1)+'/'+_0x3802bf[_0x3f2e18(0xaa)][_0x3f2e18(0x113)]+_0x3f2e18(0xe4)+a5_0x1043b6[_0x3f2e18(0x92)]('✗'));},'onEvaluationStart':()=>{const _0xce0028=_0x10bed6;_0x5e4c3b[_0xce0028(0xc6)]=_0xce0028(0xb2);},'onEvaluationComplete':_0x122d76=>{const _0x4917d5=_0x10bed6,_0x3970d2=formatElapsed(_0x122d76);console[_0x4917d5(0xaf)]('\x20\x20Evaluating...\x20'+a5_0x1043b6[_0x4917d5(0xd7)]('✓')+'\x20('+_0x3970d2+')');}});_0x5e4c3b['stop'](),_0x45187c[_0x10bed6(0xf6)](_0x24fc3c),_0x1075c6[_0x10bed6(0xf6)](_0x2047b1);if(_0x24fc3c['status']===_0x10bed6(0x9b))console[_0x10bed6(0xaf)](a5_0x1043b6['green'](_0x10bed6(0xd1)+_0x24fc3c[_0x10bed6(0xec)]));else _0x24fc3c[_0x10bed6(0x123)]===_0x10bed6(0xa3)?console[_0x10bed6(0xaf)](a5_0x1043b6[_0x10bed6(0x92)](_0x10bed6(0xb8)+_0x24fc3c[_0x10bed6(0xec)])):console[_0x10bed6(0xaf)](a5_0x1043b6[_0x10bed6(0x92)](_0x10bed6(0xf4)+_0x24fc3c[_0x10bed6(0xec)]));_0x24fc3c[_0x10bed6(0x94)]&&console[_0x10bed6(0xaf)](a5_0x1043b6[_0x10bed6(0xe2)]('Conversation\x20URL:\x20'+_0x24fc3c[_0x10bed6(0x94)])),console[_0x10bed6(0xaf)]();}catch(_0x6cfd96){_0x5e4c3b[_0x10bed6(0x97)]();const _0x5bce3a=_0x6cfd96 instanceof Error?_0x6cfd96[_0x10bed6(0x10c)]:String(_0x6cfd96);console[_0x10bed6(0xaf)](a5_0x1043b6[_0x10bed6(0x92)](_0x10bed6(0xf4)+_0x5bce3a)),console[_0x10bed6(0xaf)](),_0x45187c[_0x10bed6(0xf6)]({'name':_0x3802bf[_0x10bed6(0xf7)],'status':_0x10bed6(0xfd),'reason':_0x5bce3a,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x54c7e2=Date[_0x10bed6(0xc2)]()-_0x813f3e,_0x1c677c=_0x45187c[_0x10bed6(0x125)](_0x4e9c11=>_0x4e9c11[_0x10bed6(0x123)]===_0x10bed6(0x9b))['length'],_0x5ee8e4=_0x45187c[_0x10bed6(0x125)](_0x21c51d=>_0x21c51d[_0x10bed6(0x123)]===_0x10bed6(0xa3))['length'],_0x587784=_0x45187c['filter'](_0x34e67d=>_0x34e67d[_0x10bed6(0x123)]==='ERROR')['length'];console[_0x10bed6(0xaf)]('━'[_0x10bed6(0xa0)](0x3c)),console[_0x10bed6(0xaf)](_0x10bed6(0xbc)),console[_0x10bed6(0xaf)]('━'[_0x10bed6(0xa0)](0x3c)),console['log'](_0x10bed6(0x121)+_0x45187c['length']),console[_0x10bed6(0xaf)](_0x10bed6(0x9e)+a5_0x1043b6[_0x10bed6(0xd7)](_0x1c677c)),console[_0x10bed6(0xaf)](_0x10bed6(0xa6)+a5_0x1043b6['red'](_0x5ee8e4));_0x587784>0x0&&console[_0x10bed6(0xaf)]('Errors:\x20\x20\x20'+a5_0x1043b6['red'](_0x587784));console['log'](_0x10bed6(0x108)+formatElapsed(_0x54c7e2)),console[_0x10bed6(0xaf)]('━'[_0x10bed6(0xa0)](0x3c));const _0x19cef3=_0x45187c[_0x10bed6(0x125)](_0x1e9a43=>_0x1e9a43[_0x10bed6(0x123)]!==_0x10bed6(0x9b));if(_0x19cef3[_0x10bed6(0x113)]>0x0){console[_0x10bed6(0xaf)](),console[_0x10bed6(0xaf)](_0x10bed6(0xa5));for(const _0xb5b77d of _0x19cef3){const _0xb035c9=a5_0x1043b6[_0x10bed6(0x92)]('✗'),_0x1838a8=_0xb5b77d[_0x10bed6(0xec)][_0x10bed6(0x113)]>0x32?_0xb5b77d[_0x10bed6(0xec)]['substring'](0x0,0x32)+_0x10bed6(0x111):_0xb5b77d[_0x10bed6(0xec)];console[_0x10bed6(0xaf)]('\x20\x20'+_0xb035c9+'\x20'+_0xb5b77d[_0x10bed6(0xf7)]+':\x20'+_0x1838a8);}}const _0x1093d5={'summary':{'total':_0x45187c['length'],'passed':_0x1c677c,'failed':_0x5ee8e4,'errors':_0x587784>0x0?_0x587784:undefined,'duration_ms':_0x54c7e2},'tests':_0x45187c,'agent':{'project':_0x390df7['projectName'],'name':_0x390df7['agentName'],'site':_0x38bc5b},'timestamp':new Date(_0x813f3e)['toISOString']()};try{const _0x4d2d72=buildCachedTestRun(_0x1075c6,{'site':_0x38bc5b,'projectId':_0x3e1515,'projectName':_0x390df7[_0x10bed6(0xb6)],'agentId':_0x112d57,'agentName':_0x390df7['agentName'],'testYmlPath':a5_0x5261cd[_0x10bed6(0x95)](_0x390df7[_0x10bed6(0xb7)])});saveLastTestRun(_0x4d2d72);}catch{}if(_0x39412a!==_0x10bed6(0xd4)||_0x38eb35){const _0x4e2e22=formatResults(_0x1093d5,_0x39412a);if(_0x38eb35)try{a5_0x4b344f[_0x10bed6(0xbe)](_0x38eb35,_0x4e2e22,_0x10bed6(0x11b)),console[_0x10bed6(0xaf)](),console['log'](a5_0x1043b6['dim'](_0x10bed6(0xd5)+_0x38eb35));}catch(_0xd55535){return console[_0x10bed6(0xaf)](),console[_0x10bed6(0xaf)](a5_0x1043b6[_0x10bed6(0x92)]('Error\x20writing\x20output\x20file:\x20'+_0xd55535)),0x1;}else console['log'](),console[_0x10bed6(0xaf)](_0x4e2e22);}return _0x19cef3[_0x10bed6(0x113)]>0x0?0x1:0x0;}async[a5_0xea0d6f(0xb4)](_0x17e1b3,_0x472cf9){const _0x20e0f3=a5_0xea0d6f,{options:_0x4f6d2e,tdx:_0x52e005}=_0x17e1b3,{definition:_0x3922fb,agentInfo:_0x5f4193,outputFormat:_0xa85fdf,outputFile:_0x1bc602}=_0x472cf9,_0x2fef40=_0x4f6d2e[_0x20e0f3(0xbb)],_0x156b35=loadLastTestRun();if(!_0x156b35)return console[_0x20e0f3(0xaf)](a5_0x1043b6[_0x20e0f3(0x92)](_0x20e0f3(0xcf))),console['log'](a5_0x1043b6[_0x20e0f3(0xe2)]('Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.')),0x1;if(_0x156b35[_0x20e0f3(0x9a)][_0x20e0f3(0xdc)]!==_0x5f4193[_0x20e0f3(0xdc)])return console[_0x20e0f3(0xaf)](a5_0x1043b6['red']('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x156b35['agent'][_0x20e0f3(0xdc)]+_0x20e0f3(0xc5)+_0x5f4193[_0x20e0f3(0xdc)]+'\x22.')),console[_0x20e0f3(0xaf)](a5_0x1043b6[_0x20e0f3(0xe2)]('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x2d1967=new Set(_0x156b35[_0x20e0f3(0x105)][_0x20e0f3(0x120)](_0x48e28f=>_0x48e28f[_0x20e0f3(0xe1)])),_0x34ef13=_0x3922fb[_0x20e0f3(0xfc)][_0x20e0f3(0x125)](_0x22cec4=>!_0x2d1967[_0x20e0f3(0x11e)](_0x22cec4[_0x20e0f3(0xf7)]));if(_0x34ef13[_0x20e0f3(0x113)]>0x0&&_0x156b35[_0x20e0f3(0xbb)]!==_0x2fef40)return console[_0x20e0f3(0xaf)](a5_0x1043b6[_0x20e0f3(0x92)](_0x20e0f3(0xff))),console[_0x20e0f3(0xaf)](a5_0x1043b6[_0x20e0f3(0xe2)]('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x156b35[_0x20e0f3(0xbb)]+_0x20e0f3(0xef)+_0x2fef40+'\x22.')),console[_0x20e0f3(0xaf)](a5_0x1043b6[_0x20e0f3(0xe2)]('Either\x20switch\x20to\x20the\x20\x22'+_0x156b35[_0x20e0f3(0xbb)]+_0x20e0f3(0xc8))),0x1;const _0x1aee3c=_0x3922fb[_0x20e0f3(0xfc)][_0x20e0f3(0x125)](_0x23349b=>_0x2d1967[_0x20e0f3(0x11e)](_0x23349b['name'])),_0x3ab7ba=_0x34ef13;let _0xfd332f;try{_0xfd332f=await setupEvaluatorAgent(_0x52e005[_0x20e0f3(0xa4)],_0x4f6d2e[_0x20e0f3(0xdb)]);}catch(_0xb6f47a){const _0x5c4bf3=_0xb6f47a instanceof Error?_0xb6f47a['message']:String(_0xb6f47a);return console[_0x20e0f3(0xaf)](a5_0x1043b6[_0x20e0f3(0x92)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x5c4bf3)),0x1;}console[_0x20e0f3(0xaf)](a5_0x1043b6[_0x20e0f3(0xfa)]('Re-evaluating\x20cached\x20test\x20run...')),console[_0x20e0f3(0xaf)](_0x20e0f3(0xe7)+a5_0x1043b6['white'](_0x156b35[_0x20e0f3(0x110)])),console['log']('Agent:\x20'+a5_0x1043b6[_0x20e0f3(0xe9)](_0x156b35[_0x20e0f3(0x9a)][_0x20e0f3(0xb6)]+'/'+_0x156b35['agent'][_0x20e0f3(0xdc)]));_0x3ab7ba[_0x20e0f3(0x113)]>0x0&&console[_0x20e0f3(0xaf)]('New\x20tests\x20to\x20execute:\x20'+a5_0x1043b6['yellow'](_0x3ab7ba['length']));console[_0x20e0f3(0xaf)]();const _0x13425a=[],_0xc6ff72=Date[_0x20e0f3(0xc2)](),_0x5e8596=createCommandSpinner(_0x20e0f3(0xf2));if(_0x1aee3c[_0x20e0f3(0x113)]>0x0)try{const _0x52d5ca=await reevaluateFromCache(_0x52e005[_0x20e0f3(0xa4)],_0x156b35,{'tests':_0x1aee3c},{'evaluatorId':_0xfd332f,'onTestStart':(_0x2872e8,_0x228bbd,_0x5b2b4f)=>{const _0x1d0c01=_0x20e0f3;_0x5e8596[_0x1d0c01(0xc6)]='Re-evaluating\x20'+(_0x228bbd+0x1)+'/'+_0x5b2b4f+':\x20'+_0x2872e8+_0x1d0c01(0x111);if(!_0x5e8596[_0x1d0c01(0xe0)])_0x5e8596[_0x1d0c01(0xb1)]();},'onTestComplete':(_0x5094e7,_0x29f0b3)=>{const _0x2f5b87=_0x20e0f3;_0x5e8596['stop']();if(_0x29f0b3[_0x2f5b87(0x123)]===_0x2f5b87(0x9b))console[_0x2f5b87(0xaf)](a5_0x1043b6[_0x2f5b87(0xd7)](_0x2f5b87(0xd1)+_0x5094e7)+a5_0x1043b6['dim']('\x20(cached)'));else _0x29f0b3[_0x2f5b87(0x123)]===_0x2f5b87(0xa3)?console[_0x2f5b87(0xaf)](a5_0x1043b6['red'](_0x2f5b87(0xb8)+_0x5094e7+_0x2f5b87(0x100)+_0x29f0b3[_0x2f5b87(0xec)])+a5_0x1043b6[_0x2f5b87(0xe2)](_0x2f5b87(0x9f))):console[_0x2f5b87(0xaf)](a5_0x1043b6[_0x2f5b87(0x92)](_0x2f5b87(0xf4)+_0x5094e7+_0x2f5b87(0x100)+_0x29f0b3[_0x2f5b87(0xec)]));_0x29f0b3[_0x2f5b87(0x94)]&&console[_0x2f5b87(0xaf)](a5_0x1043b6[_0x2f5b87(0xe2)](_0x2f5b87(0xbd)+_0x29f0b3[_0x2f5b87(0x94)])),_0x13425a['push'](_0x29f0b3);},'onTestSkipped':(_0x14cd24,_0x1e6efa)=>{const _0x1c8fea=_0x20e0f3;_0x5e8596['stop'](),console[_0x1c8fea(0xaf)](a5_0x1043b6[_0x1c8fea(0xf8)]('⚠\x20SKIPPED:\x20'+_0x14cd24+_0x1c8fea(0x100)+_0x1e6efa));}});for(const _0x3b2098 of _0x52d5ca){!_0x13425a[_0x20e0f3(0xe5)](_0x3220f2=>_0x3220f2['name']===_0x3b2098['name'])&&_0x13425a[_0x20e0f3(0xf6)](_0x3b2098);}}catch(_0x2978dc){_0x5e8596[_0x20e0f3(0x97)]();const _0x3bfb37=_0x2978dc instanceof Error?_0x2978dc[_0x20e0f3(0x10c)]:String(_0x2978dc);return console[_0x20e0f3(0xaf)](a5_0x1043b6[_0x20e0f3(0x92)](_0x20e0f3(0xbf)+_0x3bfb37)),0x1;}_0x5e8596['stop']();if(_0x3ab7ba[_0x20e0f3(0x113)]>0x0){console[_0x20e0f3(0xaf)](),console[_0x20e0f3(0xaf)](a5_0x1043b6['cyan'](_0x20e0f3(0x10a)));const {projectId:_0x191747,agentId:_0x2cbfbb}=_0x156b35[_0x20e0f3(0x9a)];for(const _0x3663bb of _0x3ab7ba){console['log'](_0x20e0f3(0x116)+a5_0x1043b6[_0x20e0f3(0xe9)](_0x3663bb[_0x20e0f3(0xf7)]));const _0x5bc9cb=createCommandSpinner(_0x20e0f3(0xea)+_0x3663bb[_0x20e0f3(0xaa)][_0x20e0f3(0x113)]+_0x20e0f3(0xde));_0x5bc9cb[_0x20e0f3(0xb1)]();try{const {result:_0x236a33}=await runTest(_0x52e005[_0x20e0f3(0xa4)],_0x3663bb,{'agentId':_0x2cbfbb,'projectId':_0x191747,'site':_0x156b35[_0x20e0f3(0xbb)],'noEval':![],'evaluatorId':_0xfd332f,'onRoundStart':(_0x5158fe,_0x430c01)=>{const _0x3a6979=_0x20e0f3;_0x5bc9cb[_0x3a6979(0xc6)]='Round\x20'+(_0x5158fe+0x1)+'/'+_0x430c01+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x938d00,_0x5ca59b,_0x1b689)=>{const _0x4727cd=_0x20e0f3,_0x2d032b=formatElapsed(_0x5ca59b);_0x1b689?console[_0x4727cd(0xaf)](_0x4727cd(0x11d)+(_0x938d00+0x1)+'/'+_0x3663bb[_0x4727cd(0xaa)][_0x4727cd(0x113)]+_0x4727cd(0xe4)+a5_0x1043b6[_0x4727cd(0xd7)]('✓')+'\x20('+_0x2d032b+')'):console[_0x4727cd(0xaf)](_0x4727cd(0x11d)+(_0x938d00+0x1)+'/'+_0x3663bb[_0x4727cd(0xaa)][_0x4727cd(0x113)]+'...\x20'+a5_0x1043b6['red']('✗'));},'onEvaluationStart':()=>{const _0x3598ce=_0x20e0f3;_0x5bc9cb[_0x3598ce(0xc6)]=_0x3598ce(0xb2);},'onEvaluationComplete':_0x33ce50=>{const _0x4745e6=_0x20e0f3,_0x9b6e89=formatElapsed(_0x33ce50);console['log']('\x20\x20Evaluating...\x20'+a5_0x1043b6[_0x4745e6(0xd7)]('✓')+'\x20('+_0x9b6e89+')');}});_0x5bc9cb[_0x20e0f3(0x97)](),_0x13425a[_0x20e0f3(0xf6)](_0x236a33);if(_0x236a33[_0x20e0f3(0x123)]===_0x20e0f3(0x9b))console[_0x20e0f3(0xaf)](a5_0x1043b6[_0x20e0f3(0xd7)](_0x20e0f3(0xd1)+_0x236a33[_0x20e0f3(0xec)])+a5_0x1043b6[_0x20e0f3(0xe2)]('\x20(new)'));else _0x236a33['status']===_0x20e0f3(0xa3)?console[_0x20e0f3(0xaf)](a5_0x1043b6[_0x20e0f3(0x92)](_0x20e0f3(0xb8)+_0x236a33[_0x20e0f3(0xec)])+a5_0x1043b6[_0x20e0f3(0xe2)]('\x20(new)')):console[_0x20e0f3(0xaf)](a5_0x1043b6[_0x20e0f3(0x92)]('✗\x20ERROR:\x20'+_0x236a33['reason']));_0x236a33[_0x20e0f3(0x94)]&&console['log'](a5_0x1043b6[_0x20e0f3(0xe2)](_0x20e0f3(0xbd)+_0x236a33[_0x20e0f3(0x94)]));}catch(_0x41985b){_0x5bc9cb[_0x20e0f3(0x97)]();const _0x51e909=_0x41985b instanceof Error?_0x41985b[_0x20e0f3(0x10c)]:String(_0x41985b);console[_0x20e0f3(0xaf)](a5_0x1043b6[_0x20e0f3(0x92)](_0x20e0f3(0xf4)+_0x51e909)),_0x13425a['push']({'name':_0x3663bb[_0x20e0f3(0xf7)],'status':_0x20e0f3(0xfd),'reason':_0x51e909,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console['log']();const _0x28d6c0=Date['now']()-_0xc6ff72,_0x24105a=_0x13425a[_0x20e0f3(0x125)](_0x113fa1=>_0x113fa1[_0x20e0f3(0x123)]==='PASS')[_0x20e0f3(0x113)],_0x3b54a1=_0x13425a[_0x20e0f3(0x125)](_0x5d1cfd=>_0x5d1cfd['status']===_0x20e0f3(0xa3))[_0x20e0f3(0x113)],_0xa70c6e=_0x13425a[_0x20e0f3(0x125)](_0x561359=>_0x561359[_0x20e0f3(0x123)]===_0x20e0f3(0xfd))[_0x20e0f3(0x113)];console[_0x20e0f3(0xaf)]('━'[_0x20e0f3(0xa0)](0x3c)),console[_0x20e0f3(0xaf)](_0x20e0f3(0xfb)),console[_0x20e0f3(0xaf)]('━'[_0x20e0f3(0xa0)](0x3c)),console[_0x20e0f3(0xaf)](_0x20e0f3(0x121)+_0x13425a['length']),console[_0x20e0f3(0xaf)]('Passed:\x20\x20\x20'+a5_0x1043b6['green'](_0x24105a)),console[_0x20e0f3(0xaf)](_0x20e0f3(0xa6)+a5_0x1043b6[_0x20e0f3(0x92)](_0x3b54a1));_0xa70c6e>0x0&&console[_0x20e0f3(0xaf)](_0x20e0f3(0xc0)+a5_0x1043b6[_0x20e0f3(0x92)](_0xa70c6e));console['log']('Duration:\x20'+formatElapsed(_0x28d6c0)),console[_0x20e0f3(0xaf)]('━'[_0x20e0f3(0xa0)](0x3c));const _0x5706ec={'summary':{'total':_0x13425a[_0x20e0f3(0x113)],'passed':_0x24105a,'failed':_0x3b54a1,'errors':_0xa70c6e>0x0?_0xa70c6e:undefined,'duration_ms':_0x28d6c0},'tests':_0x13425a,'agent':{'project':_0x5f4193[_0x20e0f3(0xb6)],'name':_0x5f4193[_0x20e0f3(0xdc)],'site':_0x2fef40},'timestamp':new Date(_0xc6ff72)[_0x20e0f3(0x124)]()};if(_0xa85fdf!==_0x20e0f3(0xd4)||_0x1bc602){const _0x2aa917=formatResults(_0x5706ec,_0xa85fdf);if(_0x1bc602)try{a5_0x4b344f['writeFileSync'](_0x1bc602,_0x2aa917,_0x20e0f3(0x11b)),console[_0x20e0f3(0xaf)](),console[_0x20e0f3(0xaf)](a5_0x1043b6[_0x20e0f3(0xe2)](_0x20e0f3(0xd5)+_0x1bc602));}catch(_0x1bc867){return console[_0x20e0f3(0xaf)](),console[_0x20e0f3(0xaf)](a5_0x1043b6[_0x20e0f3(0x92)](_0x20e0f3(0x11c)+_0x1bc867)),0x1;}else console['log'](),console[_0x20e0f3(0xaf)](_0x2aa917);}const _0xd9d637=_0x13425a[_0x20e0f3(0x125)](_0x5bd217=>_0x5bd217[_0x20e0f3(0x123)]!==_0x20e0f3(0x9b));return _0xd9d637[_0x20e0f3(0x113)]>0x0?0x1:0x0;}}
|
|
1
|
+
function a5_0x374e(_0x3054b9,_0x200a91){_0x3054b9=_0x3054b9-0xa5;const _0x4c9d16=a5_0x4c9d();let _0x374ebd=_0x4c9d16[_0x3054b9];return _0x374ebd;}const a5_0x57b6f6=a5_0x374e;(function(_0x2a40dd,_0x220dde){const _0x4e87a8=a5_0x374e,_0x19872b=_0x2a40dd();while(!![]){try{const _0x165199=parseInt(_0x4e87a8(0xe8))/0x1*(parseInt(_0x4e87a8(0x13f))/0x2)+-parseInt(_0x4e87a8(0xc3))/0x3*(-parseInt(_0x4e87a8(0x127))/0x4)+-parseInt(_0x4e87a8(0x108))/0x5+-parseInt(_0x4e87a8(0x10d))/0x6*(-parseInt(_0x4e87a8(0xba))/0x7)+parseInt(_0x4e87a8(0xd9))/0x8+parseInt(_0x4e87a8(0xcf))/0x9*(parseInt(_0x4e87a8(0xe6))/0xa)+-parseInt(_0x4e87a8(0x112))/0xb;if(_0x165199===_0x220dde)break;else _0x19872b['push'](_0x19872b['shift']());}catch(_0x452c2e){_0x19872b['push'](_0x19872b['shift']());}}}(a5_0x4c9d,0xa3008));function a5_0x4c9d(){const _0x4604d6=['ERROR','...\x20','FAIL','size','Duration:\x20','✗\x20ERROR:\x20','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','multiple_agents','timestamp','some',':\x20Sending\x20user\x20input...','output','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x20-\x20','Test\x20Configuration:','...','white','Available\x20tests:\x20','includes','Re-evaluation\x20Summary','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','dryRun','4754180qLJgmm','Site:\x20','Round\x20','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','Passed:\x20\x20\x20','1249386FXPOLF','Running:\x20','\x20\x20Site:\x20','404','✗\x20FAIL:\x20','3315092RwniCY','\x20\x20Conversation:\x20','\x22,\x20but\x20current\x20site\x20is\x20\x22','test.yml','agent','\x22:\x20','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','log','Error:\x20No\x20previous\x20test\x20run\x20found.','Round\x201/','tags','tsv','\x20(new)','projectName','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','Cached\x20run\x20from:\x20','Available\x20tags:\x20','Re-evaluating...','No\x20tests\x20have\x20tags\x20defined.','context','table','116lMmPct','utf-8','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Either\x20switch\x20to\x20the\x20\x22','Re-evaluating\x20cached\x20test\x20run...','Executing\x20new\x20tests...','Output\x20written\x20to:\x20','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path','filter','eval','Using\x20agent:\x20','repeat','PASS','json','no_local_folder','status','red','testYmlPath','map','rounds','verbose','conversation_url','\x20\x20Project:\x20','84330IeBWuF','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','writeFileSync','llm','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','green','\x20\x20-\x20','toLowerCase','agentName','stop','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','jsonl','Test\x20Summary','not\x20found','forEach','dim','Re-evaluating\x20','Evaluating\x20response...','existsSync','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','description','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','28mhENnP','Failed\x20Tests:','start','New\x20tests\x20to\x20execute:\x20','Conversation\x20URL:\x20','substring','cyan','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','13746oaGYtB','join','message','basename','⚠\x20SKIPPED:\x20','length','projectDir','llmProject','executeReeval','Test\x20','source','split','2626335KAWPVJ','toISOString','now','resolveProjectId','Total:\x20\x20\x20\x20','push','has','round','\x20\x20Evaluating...\x20','\x20(cached)','3611376YVeoqb','execute','✓\x20PASS:\x20','Errors:\x20\x20\x20','found','\x20\x20Round\x20','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Error\x20writing\x20output\x20file:\x20','yellow','Cached\x20run\x20is\x20from\x20site\x20\x22','find','reason','trim','10WOgRse','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','5NBjgay','text','site','resolveAgentId','Failed:\x20\x20\x20','/<agent-name>','agent:test','name','tests','\x20\x20Agent:\x20'];a5_0x4c9d=function(){return _0x4604d6;};return a5_0x4c9d();}import*as a5_0x5ee627 from'node:fs';import*as a5_0x55524e from'node:path';import a5_0x5800bb 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_0x57b6f6(0xef)]=a5_0x57b6f6(0xee);[a5_0x57b6f6(0xb8)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x57b6f6(0xda)](_0x1aaa44){const _0x1cfb7c=a5_0x57b6f6,{options:_0xc98e47,args:_0x3b5d6c,tdx:_0x2c66b0}=_0x1aaa44,_0x20d035=_0x3b5d6c[0x0]||'.',_0x45fdc7=_0xc98e47[_0x1cfb7c(0x107)],_0x4c1fda=_0xc98e47,_0x29bb1c=_0x4c1fda[_0x1cfb7c(0x131)]===![],_0x31288f=_0x4c1fda['reeval'],_0x1f2e9b=_0x4c1fda[_0x1cfb7c(0xef)],_0x1189ea=_0x4c1fda[_0x1cfb7c(0x11c)],_0xdb41ba=_0xc98e47[_0x1cfb7c(0xea)],_0x4772a2=_0x4c1fda[_0x1cfb7c(0xfd)];if(_0x31288f&&_0x29bb1c)return console['log'](a5_0x5800bb[_0x1cfb7c(0x138)](_0x1cfb7c(0xae))),0x1;let _0x1f8ceb=_0x1cfb7c(0x126);if(_0x4c1fda[_0x1cfb7c(0x135)])_0x1f8ceb=_0x1cfb7c(0x135);else{if(_0x4c1fda['jsonl'])_0x1f8ceb=_0x1cfb7c(0xaf);else{if(_0x4c1fda['tsv'])_0x1f8ceb=_0x1cfb7c(0x11d);else{if(_0x4c1fda['table'])_0x1f8ceb=_0x1cfb7c(0x126);}}}const _0x504b7b=_0x4c1fda[_0x1cfb7c(0xca)];let _0x59c2b1=_0x20d035;const _0x1c218d=a5_0x5ee627[_0x1cfb7c(0xb6)](_0x20d035),_0x16a254=_0x20d035==='.';if(!_0x1c218d||_0x16a254){const _0x5b8ea8=resolveProjectFromContext(_0x20d035,_0x504b7b,{'requireFile':_0x1cfb7c(0x115)});if(_0x5b8ea8[_0x1cfb7c(0xdd)])_0x59c2b1=_0x5b8ea8[_0x1cfb7c(0xc9)],_0x5b8ea8[_0x1cfb7c(0xcd)]===_0x1cfb7c(0x125)&&console[_0x1cfb7c(0x119)](a5_0x5800bb[_0x1cfb7c(0xb3)](_0x1cfb7c(0x132)+_0x59c2b1));else switch(_0x5b8ea8[_0x1cfb7c(0xe4)]){case'no_context':console[_0x1cfb7c(0x119)](a5_0x5800bb[_0x1cfb7c(0xe1)](_0x5b8ea8['message'])),console['log'](),console[_0x1cfb7c(0x119)]('Usage:'),console[_0x1cfb7c(0x119)](_0x1cfb7c(0x12f)),console[_0x1cfb7c(0x119)]('\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)'),console['log'](),console[_0x1cfb7c(0x119)](_0x1cfb7c(0x129));return 0x1;case _0x1cfb7c(0x136):console[_0x1cfb7c(0x119)](a5_0x5800bb[_0x1cfb7c(0xe1)](_0x5b8ea8['message'])),console[_0x1cfb7c(0x119)](),console[_0x1cfb7c(0x119)]('Run\x20\x27tdx\x20agent\x20pull\x20'+_0x5b8ea8[_0x1cfb7c(0xca)]+_0x1cfb7c(0xfe));return 0x1;case _0x1cfb7c(0xf9):{const _0x2b697b=a5_0x55524e[_0x1cfb7c(0xc6)](_0x5b8ea8[_0x1cfb7c(0xc9)]);console[_0x1cfb7c(0x119)](a5_0x5800bb['yellow'](_0x1cfb7c(0x118)+_0x5b8ea8[_0x1cfb7c(0xca)]+'\x22:'));for(const _0x59b690 of _0x5b8ea8['agentDirs']){console['log'](_0x1cfb7c(0xaa)+_0x59b690);}return console[_0x1cfb7c(0x119)](),console['log'](_0x1cfb7c(0xc2)+_0x2b697b+_0x1cfb7c(0xed)),0x1;}case'no_tests':console['log'](a5_0x5800bb[_0x1cfb7c(0xe1)](_0x1cfb7c(0xf8)+_0x5b8ea8[_0x1cfb7c(0xca)]+'\x22.')),console[_0x1cfb7c(0x119)](a5_0x5800bb[_0x1cfb7c(0xb3)]('Project\x20path:\x20'+_0x5b8ea8[_0x1cfb7c(0xc9)])),console['log'](),console[_0x1cfb7c(0x119)](_0x1cfb7c(0xb9));return 0x1;}}const {definition:_0x37b786,agentInfo:_0x2b82a6}=parseTestFile(_0x59c2b1);let _0x5dc78c=_0x37b786[_0x1cfb7c(0xf0)];if(_0x1f2e9b){const _0x3682a3=_0x1f2e9b[_0x1cfb7c(0xce)](',')[_0x1cfb7c(0x13a)](_0x4ebbd5=>_0x4ebbd5[_0x1cfb7c(0xe5)]());_0x5dc78c=_0x37b786[_0x1cfb7c(0xf0)][_0x1cfb7c(0x130)](_0x444543=>_0x3682a3['includes'](_0x444543[_0x1cfb7c(0xef)]));if(_0x5dc78c[_0x1cfb7c(0xc8)]===0x0)return console[_0x1cfb7c(0x119)](a5_0x5800bb[_0x1cfb7c(0xe1)]('No\x20tests\x20found\x20matching:\x20'+_0x1f2e9b)),console[_0x1cfb7c(0x119)](a5_0x5800bb[_0x1cfb7c(0xb3)](_0x1cfb7c(0x103)+_0x37b786[_0x1cfb7c(0xf0)][_0x1cfb7c(0x13a)](_0x4dca0c=>_0x4dca0c[_0x1cfb7c(0xef)])[_0x1cfb7c(0xc4)](',\x20'))),0x1;}if(_0x1189ea){const _0x36dfbf=_0x1189ea['split'](',')[_0x1cfb7c(0x13a)](_0x316593=>_0x316593[_0x1cfb7c(0xe5)]()[_0x1cfb7c(0xab)]());_0x5dc78c=_0x5dc78c['filter'](_0x2db10c=>_0x2db10c['tags']?.[_0x1cfb7c(0xfb)](_0x386a02=>_0x36dfbf[_0x1cfb7c(0x104)](_0x386a02[_0x1cfb7c(0xab)]())));if(_0x5dc78c[_0x1cfb7c(0xc8)]===0x0){console[_0x1cfb7c(0x119)](a5_0x5800bb['yellow']('No\x20tests\x20found\x20with\x20tags:\x20'+_0x1189ea));const _0x4878d9=new Set();return _0x37b786[_0x1cfb7c(0xf0)][_0x1cfb7c(0xb2)](_0x1643bc=>_0x1643bc['tags']?.['forEach'](_0x57abbb=>_0x4878d9['add'](_0x57abbb))),_0x4878d9[_0x1cfb7c(0xf5)]>0x0?console[_0x1cfb7c(0x119)](a5_0x5800bb['dim'](_0x1cfb7c(0x122)+[..._0x4878d9][_0x1cfb7c(0xc4)](',\x20'))):console['log'](a5_0x5800bb[_0x1cfb7c(0xb3)](_0x1cfb7c(0x124))),0x1;}}if(_0x31288f)return this['executeReeval'](_0x1aaa44,{'definition':{'tests':_0x5dc78c},'agentInfo':_0x2b82a6,'outputFormat':_0x1f8ceb,'outputFile':_0x4772a2,'testNames':_0x1f2e9b});if(_0x45fdc7){console[_0x1cfb7c(0x119)](a5_0x5800bb[_0x1cfb7c(0xc0)](_0x1cfb7c(0x100))),console['log'](_0x1cfb7c(0x10f)+a5_0x5800bb[_0x1cfb7c(0x102)](_0xdb41ba)),console[_0x1cfb7c(0x119)](_0x1cfb7c(0x13e)+a5_0x5800bb[_0x1cfb7c(0x102)](_0x2b82a6[_0x1cfb7c(0x11f)])),console[_0x1cfb7c(0x119)](_0x1cfb7c(0xf1)+a5_0x5800bb[_0x1cfb7c(0x102)](_0x2b82a6[_0x1cfb7c(0xac)])),console[_0x1cfb7c(0x119)](),console['log']('Tests\x20found:\x20'+a5_0x5800bb['white'](_0x5dc78c['length']));for(let _0x5a8436=0x0;_0x5a8436<_0x5dc78c['length'];_0x5a8436++){const _0x2c4b4=_0x5dc78c[_0x5a8436],_0x570720=_0x2c4b4[_0x1cfb7c(0x13b)][_0x1cfb7c(0xc8)]===0x1?_0x1cfb7c(0xd6):_0x1cfb7c(0x13b),_0x62bc13=_0x2c4b4[_0x1cfb7c(0x11c)]?.[_0x1cfb7c(0xc8)]?'\x20['+_0x2c4b4[_0x1cfb7c(0x11c)]['join'](',\x20')+']':'';console[_0x1cfb7c(0x119)]('\x20\x20'+(_0x5a8436+0x1)+'.\x20'+a5_0x5800bb[_0x1cfb7c(0x102)](_0x2c4b4[_0x1cfb7c(0xef)])+'\x20('+_0x2c4b4[_0x1cfb7c(0x13b)][_0x1cfb7c(0xc8)]+'\x20'+_0x570720+')'+a5_0x5800bb['dim'](_0x62bc13));}return 0x0;}let _0x3a9150,_0x103726;try{_0x3a9150=await _0x2c66b0['llm'][_0x1cfb7c(0xd2)](_0x2b82a6[_0x1cfb7c(0x11f)]);}catch(_0xe3e94e){const _0x2d355e=_0xe3e94e instanceof Error?_0xe3e94e[_0x1cfb7c(0xc5)]:String(_0xe3e94e);return _0x2d355e[_0x1cfb7c(0x104)](_0x1cfb7c(0x110))||_0x2d355e[_0x1cfb7c(0xab)]()['includes']('not\x20found')?console[_0x1cfb7c(0x119)](a5_0x5800bb[_0x1cfb7c(0x138)]('✗\x20ERROR:\x20Project\x20not\x20found:\x20'+_0x2b82a6[_0x1cfb7c(0x11f)])):console[_0x1cfb7c(0x119)](a5_0x5800bb[_0x1cfb7c(0x138)](_0x1cfb7c(0xa5)+_0x2b82a6[_0x1cfb7c(0x11f)]+_0x1cfb7c(0x117)+_0x2d355e)),0x1;}try{_0x103726=await _0x2c66b0['llm'][_0x1cfb7c(0xeb)](_0x2b82a6[_0x1cfb7c(0xac)],_0x3a9150);}catch(_0x3716da){const _0x23c135=_0x3716da instanceof Error?_0x3716da[_0x1cfb7c(0xc5)]:String(_0x3716da);return _0x23c135['includes'](_0x1cfb7c(0x110))||_0x23c135['toLowerCase']()[_0x1cfb7c(0x104)](_0x1cfb7c(0xb1))?console[_0x1cfb7c(0x119)](a5_0x5800bb[_0x1cfb7c(0x138)](_0x1cfb7c(0x12e)+_0x2b82a6[_0x1cfb7c(0xac)])):console[_0x1cfb7c(0x119)](a5_0x5800bb[_0x1cfb7c(0x138)](_0x1cfb7c(0x140)+_0x2b82a6[_0x1cfb7c(0xac)]+'\x22:\x20'+_0x23c135)),0x1;}let _0x138861;if(!_0x29bb1c)try{_0x138861=await setupEvaluatorAgent(_0x2c66b0['llm'],_0xc98e47[_0x1cfb7c(0x13c)]);}catch(_0x1b575f){const _0xefb754=_0x1b575f instanceof Error?_0x1b575f[_0x1cfb7c(0xc5)]:String(_0x1b575f);return console[_0x1cfb7c(0x119)](a5_0x5800bb['red'](_0x1cfb7c(0xe7)+_0xefb754)),0x1;}console[_0x1cfb7c(0x119)](a5_0x5800bb[_0x1cfb7c(0xc0)]('Running\x20agent\x20tests...')),console[_0x1cfb7c(0x119)](_0x1cfb7c(0x109)+a5_0x5800bb[_0x1cfb7c(0x102)](_0xdb41ba)),console[_0x1cfb7c(0x119)]('Agent:\x20'+a5_0x5800bb['white'](_0x2b82a6['projectName']+'/'+_0x2b82a6['agentName'])),console['log']();const _0x5bd3b7=[],_0x478308=[],_0x599d40=Date['now']();for(let _0x20d0fd=0x0;_0x20d0fd<_0x5dc78c[_0x1cfb7c(0xc8)];_0x20d0fd++){const _0x1fea7d=_0x5dc78c[_0x20d0fd];_0x5dc78c['length']>0x1?console[_0x1cfb7c(0x119)](_0x1cfb7c(0xcc)+(_0x20d0fd+0x1)+'/'+_0x5dc78c[_0x1cfb7c(0xc8)]+':\x20'+a5_0x5800bb[_0x1cfb7c(0x102)](_0x1fea7d[_0x1cfb7c(0xef)])):console[_0x1cfb7c(0x119)]('Running\x20test:\x20'+a5_0x5800bb[_0x1cfb7c(0x102)](_0x1fea7d[_0x1cfb7c(0xef)]));const _0x205777=createCommandSpinner(_0x1cfb7c(0x11b)+_0x1fea7d[_0x1cfb7c(0x13b)][_0x1cfb7c(0xc8)]+':\x20Sending\x20user\x20input...');_0x205777[_0x1cfb7c(0xbc)]();try{const {result:_0x407b02,conversation:_0x42ff81}=await runTest(_0x2c66b0['llm'],_0x1fea7d,{'agentId':_0x103726,'projectId':_0x3a9150,'site':_0xdb41ba,'noEval':_0x29bb1c,'evaluatorId':_0x138861,'onRoundStart':(_0x5263bd,_0x293e6f)=>{const _0x432b14=_0x1cfb7c;_0x205777['text']='Round\x20'+(_0x5263bd+0x1)+'/'+_0x293e6f+_0x432b14(0xfc);},'onRoundComplete':(_0x199aa6,_0x81742a,_0x34a062)=>{const _0x588eb4=_0x1cfb7c,_0x14e8f3=formatElapsed(_0x81742a);_0x34a062?console[_0x588eb4(0x119)](_0x588eb4(0xde)+(_0x199aa6+0x1)+'/'+_0x1fea7d[_0x588eb4(0x13b)][_0x588eb4(0xc8)]+_0x588eb4(0xf3)+a5_0x5800bb[_0x588eb4(0xa9)]('✓')+'\x20('+_0x14e8f3+')'):console[_0x588eb4(0x119)](_0x588eb4(0xde)+(_0x199aa6+0x1)+'/'+_0x1fea7d[_0x588eb4(0x13b)]['length']+_0x588eb4(0xf3)+a5_0x5800bb[_0x588eb4(0x138)]('✗'));},'onEvaluationStart':()=>{const _0x2f7b4b=_0x1cfb7c;_0x205777[_0x2f7b4b(0xe9)]=_0x2f7b4b(0xb5);},'onEvaluationComplete':_0xdbea58=>{const _0x5e29a1=_0x1cfb7c,_0xa373c6=formatElapsed(_0xdbea58);console[_0x5e29a1(0x119)](_0x5e29a1(0xd7)+a5_0x5800bb[_0x5e29a1(0xa9)]('✓')+'\x20('+_0xa373c6+')');}});_0x205777[_0x1cfb7c(0xad)](),_0x5bd3b7[_0x1cfb7c(0xd4)](_0x407b02),_0x478308[_0x1cfb7c(0xd4)](_0x42ff81);if(_0x407b02[_0x1cfb7c(0x137)]===_0x1cfb7c(0x134))console['log'](a5_0x5800bb['green'](_0x1cfb7c(0xdb)+_0x407b02[_0x1cfb7c(0xe4)]));else _0x407b02[_0x1cfb7c(0x137)]===_0x1cfb7c(0xf4)?console[_0x1cfb7c(0x119)](a5_0x5800bb[_0x1cfb7c(0x138)](_0x1cfb7c(0x111)+_0x407b02[_0x1cfb7c(0xe4)])):console['log'](a5_0x5800bb[_0x1cfb7c(0x138)]('✗\x20ERROR:\x20'+_0x407b02[_0x1cfb7c(0xe4)]));_0x407b02[_0x1cfb7c(0x13d)]&&console[_0x1cfb7c(0x119)](a5_0x5800bb[_0x1cfb7c(0xb3)](_0x1cfb7c(0xbe)+_0x407b02['conversation_url'])),console[_0x1cfb7c(0x119)]();}catch(_0x2290fe){_0x205777[_0x1cfb7c(0xad)]();const _0x5a8c4d=_0x2290fe instanceof Error?_0x2290fe['message']:String(_0x2290fe);console[_0x1cfb7c(0x119)](a5_0x5800bb[_0x1cfb7c(0x138)](_0x1cfb7c(0xf7)+_0x5a8c4d)),console[_0x1cfb7c(0x119)](),_0x5bd3b7['push']({'name':_0x1fea7d[_0x1cfb7c(0xef)],'status':'ERROR','reason':_0x5a8c4d,'timestamp':new Date()[_0x1cfb7c(0xd0)](),'duration_ms':0x0});}}const _0x4a5e80=Date[_0x1cfb7c(0xd1)]()-_0x599d40,_0x161a01=_0x5bd3b7[_0x1cfb7c(0x130)](_0xaa4e2=>_0xaa4e2['status']===_0x1cfb7c(0x134))['length'],_0x1a7efe=_0x5bd3b7['filter'](_0x23d48f=>_0x23d48f[_0x1cfb7c(0x137)]===_0x1cfb7c(0xf4))[_0x1cfb7c(0xc8)],_0x5e521e=_0x5bd3b7[_0x1cfb7c(0x130)](_0x1aa5de=>_0x1aa5de[_0x1cfb7c(0x137)]===_0x1cfb7c(0xf2))[_0x1cfb7c(0xc8)];console[_0x1cfb7c(0x119)]('━'[_0x1cfb7c(0x133)](0x3c)),console[_0x1cfb7c(0x119)](_0x1cfb7c(0xb0)),console[_0x1cfb7c(0x119)]('━'['repeat'](0x3c)),console[_0x1cfb7c(0x119)](_0x1cfb7c(0xd3)+_0x5bd3b7[_0x1cfb7c(0xc8)]),console['log'](_0x1cfb7c(0x10c)+a5_0x5800bb[_0x1cfb7c(0xa9)](_0x161a01)),console['log']('Failed:\x20\x20\x20'+a5_0x5800bb[_0x1cfb7c(0x138)](_0x1a7efe));_0x5e521e>0x0&&console['log'](_0x1cfb7c(0xdc)+a5_0x5800bb['red'](_0x5e521e));console[_0x1cfb7c(0x119)](_0x1cfb7c(0xf6)+formatElapsed(_0x4a5e80)),console['log']('━'[_0x1cfb7c(0x133)](0x3c));const _0x417b78=_0x5bd3b7[_0x1cfb7c(0x130)](_0xfbfd3c=>_0xfbfd3c[_0x1cfb7c(0x137)]!=='PASS');if(_0x417b78['length']>0x0){console[_0x1cfb7c(0x119)](),console[_0x1cfb7c(0x119)](_0x1cfb7c(0xbb));for(const _0x26f6bb of _0x417b78){const _0xff6c53=a5_0x5800bb['red']('✗'),_0x1fa641=_0x26f6bb['reason'][_0x1cfb7c(0xc8)]>0x32?_0x26f6bb[_0x1cfb7c(0xe4)][_0x1cfb7c(0xbf)](0x0,0x32)+_0x1cfb7c(0x101):_0x26f6bb['reason'];console[_0x1cfb7c(0x119)]('\x20\x20'+_0xff6c53+'\x20'+_0x26f6bb[_0x1cfb7c(0xef)]+':\x20'+_0x1fa641);}}const _0x4b7d4f={'summary':{'total':_0x5bd3b7[_0x1cfb7c(0xc8)],'passed':_0x161a01,'failed':_0x1a7efe,'errors':_0x5e521e>0x0?_0x5e521e:undefined,'duration_ms':_0x4a5e80},'tests':_0x5bd3b7,'agent':{'project':_0x2b82a6[_0x1cfb7c(0x11f)],'name':_0x2b82a6[_0x1cfb7c(0xac)],'site':_0xdb41ba},'timestamp':new Date(_0x599d40)['toISOString']()};try{const _0x5c8c50=buildCachedTestRun(_0x478308,{'site':_0xdb41ba,'projectId':_0x3a9150,'projectName':_0x2b82a6[_0x1cfb7c(0x11f)],'agentId':_0x103726,'agentName':_0x2b82a6[_0x1cfb7c(0xac)],'testYmlPath':a5_0x55524e['resolve'](_0x2b82a6[_0x1cfb7c(0x139)])});saveLastTestRun(_0x5c8c50);}catch{}if(_0x1f8ceb!=='table'||_0x4772a2){const _0x1a0dda=formatResults(_0x4b7d4f,_0x1f8ceb);if(_0x4772a2)try{a5_0x5ee627[_0x1cfb7c(0xa6)](_0x4772a2,_0x1a0dda,_0x1cfb7c(0x128)),console[_0x1cfb7c(0x119)](),console[_0x1cfb7c(0x119)](a5_0x5800bb[_0x1cfb7c(0xb3)](_0x1cfb7c(0x12d)+_0x4772a2));}catch(_0xd17c12){return console['log'](),console['log'](a5_0x5800bb[_0x1cfb7c(0x138)](_0x1cfb7c(0xe0)+_0xd17c12)),0x1;}else console[_0x1cfb7c(0x119)](),console[_0x1cfb7c(0x119)](_0x1a0dda);}return _0x417b78['length']>0x0?0x1:0x0;}async[a5_0x57b6f6(0xcb)](_0x3c4052,_0x31e0d1){const _0x4e0d8b=a5_0x57b6f6,{options:_0x4fb354,tdx:_0x1eafcf}=_0x3c4052,{definition:_0x2cf1d7,agentInfo:_0x343a42,outputFormat:_0x205a5d,outputFile:_0xb790a4}=_0x31e0d1,_0x51182c=_0x4fb354[_0x4e0d8b(0xea)],_0x8e3179=loadLastTestRun();if(!_0x8e3179)return console['log'](a5_0x5800bb[_0x4e0d8b(0x138)](_0x4e0d8b(0x11a))),console['log'](a5_0x5800bb[_0x4e0d8b(0xb3)](_0x4e0d8b(0xa8))),0x1;if(_0x8e3179[_0x4e0d8b(0x116)][_0x4e0d8b(0xac)]!==_0x343a42[_0x4e0d8b(0xac)])return console[_0x4e0d8b(0x119)](a5_0x5800bb['red'](_0x4e0d8b(0xc1)+_0x8e3179[_0x4e0d8b(0x116)]['agentName']+_0x4e0d8b(0x10b)+_0x343a42['agentName']+'\x22.')),console['log'](a5_0x5800bb['dim'](_0x4e0d8b(0x120))),0x1;const _0x51dc92=new Set(_0x8e3179['conversations']['map'](_0x59eded=>_0x59eded['testName'])),_0x8c3dc6=_0x2cf1d7['tests'][_0x4e0d8b(0x130)](_0x55e865=>!_0x51dc92[_0x4e0d8b(0xd5)](_0x55e865['name']));if(_0x8c3dc6[_0x4e0d8b(0xc8)]>0x0&&_0x8e3179[_0x4e0d8b(0xea)]!==_0x51182c)return console[_0x4e0d8b(0x119)](a5_0x5800bb[_0x4e0d8b(0x138)](_0x4e0d8b(0xb7))),console[_0x4e0d8b(0x119)](a5_0x5800bb[_0x4e0d8b(0xb3)](_0x4e0d8b(0xe2)+_0x8e3179[_0x4e0d8b(0xea)]+_0x4e0d8b(0x114)+_0x51182c+'\x22.')),console[_0x4e0d8b(0x119)](a5_0x5800bb[_0x4e0d8b(0xb3)](_0x4e0d8b(0x12a)+_0x8e3179['site']+_0x4e0d8b(0x106))),0x1;const _0x57c70a=_0x2cf1d7[_0x4e0d8b(0xf0)]['filter'](_0x21d336=>_0x51dc92[_0x4e0d8b(0xd5)](_0x21d336[_0x4e0d8b(0xef)])),_0x20ff9c=_0x8c3dc6;let _0x3fade2;try{_0x3fade2=await setupEvaluatorAgent(_0x1eafcf['llm'],_0x4fb354[_0x4e0d8b(0x13c)]);}catch(_0x35bbd4){const _0x1fb6e8=_0x35bbd4 instanceof Error?_0x35bbd4[_0x4e0d8b(0xc5)]:String(_0x35bbd4);return console['log'](a5_0x5800bb[_0x4e0d8b(0x138)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x1fb6e8)),0x1;}console['log'](a5_0x5800bb['cyan'](_0x4e0d8b(0x12b))),console[_0x4e0d8b(0x119)](_0x4e0d8b(0x121)+a5_0x5800bb[_0x4e0d8b(0x102)](_0x8e3179[_0x4e0d8b(0xfa)])),console['log']('Agent:\x20'+a5_0x5800bb[_0x4e0d8b(0x102)](_0x8e3179[_0x4e0d8b(0x116)][_0x4e0d8b(0x11f)]+'/'+_0x8e3179[_0x4e0d8b(0x116)][_0x4e0d8b(0xac)]));_0x20ff9c[_0x4e0d8b(0xc8)]>0x0&&console['log'](_0x4e0d8b(0xbd)+a5_0x5800bb['yellow'](_0x20ff9c['length']));console[_0x4e0d8b(0x119)]();const _0x23bcdd=[],_0x228ab9=Date['now'](),_0x22aad3=createCommandSpinner(_0x4e0d8b(0x123));if(_0x57c70a[_0x4e0d8b(0xc8)]>0x0)try{const _0xb6cf56=await reevaluateFromCache(_0x1eafcf[_0x4e0d8b(0xa7)],_0x8e3179,{'tests':_0x57c70a},{'evaluatorId':_0x3fade2,'onTestStart':(_0x50457d,_0x5c86fe,_0xb2007a)=>{const _0x50eb60=_0x4e0d8b;_0x22aad3['text']=_0x50eb60(0xb4)+(_0x5c86fe+0x1)+'/'+_0xb2007a+':\x20'+_0x50457d+_0x50eb60(0x101);if(!_0x22aad3['isSpinning'])_0x22aad3[_0x50eb60(0xbc)]();},'onTestComplete':(_0x24a579,_0x2d66ca)=>{const _0x415722=_0x4e0d8b;_0x22aad3[_0x415722(0xad)]();if(_0x2d66ca[_0x415722(0x137)]===_0x415722(0x134))console[_0x415722(0x119)](a5_0x5800bb[_0x415722(0xa9)](_0x415722(0xdb)+_0x24a579)+a5_0x5800bb['dim'](_0x415722(0xd8)));else _0x2d66ca[_0x415722(0x137)]===_0x415722(0xf4)?console[_0x415722(0x119)](a5_0x5800bb['red'](_0x415722(0x111)+_0x24a579+_0x415722(0xff)+_0x2d66ca[_0x415722(0xe4)])+a5_0x5800bb[_0x415722(0xb3)]('\x20(cached)')):console['log'](a5_0x5800bb['red'](_0x415722(0xf7)+_0x24a579+_0x415722(0xff)+_0x2d66ca[_0x415722(0xe4)]));_0x2d66ca['conversation_url']&&console['log'](a5_0x5800bb[_0x415722(0xb3)](_0x415722(0x113)+_0x2d66ca[_0x415722(0x13d)])),_0x23bcdd[_0x415722(0xd4)](_0x2d66ca);},'onTestSkipped':(_0x5af2df,_0x4b870d)=>{const _0x57af5f=_0x4e0d8b;_0x22aad3[_0x57af5f(0xad)](),console['log'](a5_0x5800bb['yellow'](_0x57af5f(0xc7)+_0x5af2df+_0x57af5f(0xff)+_0x4b870d));}});for(const _0x56459f of _0xb6cf56){!_0x23bcdd[_0x4e0d8b(0xe3)](_0x19fa5e=>_0x19fa5e['name']===_0x56459f[_0x4e0d8b(0xef)])&&_0x23bcdd[_0x4e0d8b(0xd4)](_0x56459f);}}catch(_0x8713ad){_0x22aad3[_0x4e0d8b(0xad)]();const _0x28209e=_0x8713ad instanceof Error?_0x8713ad[_0x4e0d8b(0xc5)]:String(_0x8713ad);return console[_0x4e0d8b(0x119)](a5_0x5800bb[_0x4e0d8b(0x138)](_0x4e0d8b(0xdf)+_0x28209e)),0x1;}_0x22aad3[_0x4e0d8b(0xad)]();if(_0x20ff9c[_0x4e0d8b(0xc8)]>0x0){console[_0x4e0d8b(0x119)](),console[_0x4e0d8b(0x119)](a5_0x5800bb['cyan'](_0x4e0d8b(0x12c)));const {projectId:_0xa401a9,agentId:_0x4925e3}=_0x8e3179['agent'];for(const _0x35f4b1 of _0x20ff9c){console[_0x4e0d8b(0x119)](_0x4e0d8b(0x10e)+a5_0x5800bb[_0x4e0d8b(0x102)](_0x35f4b1[_0x4e0d8b(0xef)]));const _0x5e36db=createCommandSpinner(_0x4e0d8b(0x11b)+_0x35f4b1[_0x4e0d8b(0x13b)][_0x4e0d8b(0xc8)]+':\x20Sending\x20user\x20input...');_0x5e36db[_0x4e0d8b(0xbc)]();try{const {result:_0x7db36c}=await runTest(_0x1eafcf[_0x4e0d8b(0xa7)],_0x35f4b1,{'agentId':_0x4925e3,'projectId':_0xa401a9,'site':_0x8e3179[_0x4e0d8b(0xea)],'noEval':![],'evaluatorId':_0x3fade2,'onRoundStart':(_0x28214a,_0x2b2c8b)=>{const _0x5552d2=_0x4e0d8b;_0x5e36db[_0x5552d2(0xe9)]=_0x5552d2(0x10a)+(_0x28214a+0x1)+'/'+_0x2b2c8b+_0x5552d2(0xfc);},'onRoundComplete':(_0x13527f,_0x2a0366,_0x5bdd99)=>{const _0x522ba6=_0x4e0d8b,_0x3adb69=formatElapsed(_0x2a0366);_0x5bdd99?console[_0x522ba6(0x119)](_0x522ba6(0xde)+(_0x13527f+0x1)+'/'+_0x35f4b1[_0x522ba6(0x13b)][_0x522ba6(0xc8)]+_0x522ba6(0xf3)+a5_0x5800bb[_0x522ba6(0xa9)]('✓')+'\x20('+_0x3adb69+')'):console[_0x522ba6(0x119)](_0x522ba6(0xde)+(_0x13527f+0x1)+'/'+_0x35f4b1['rounds'][_0x522ba6(0xc8)]+_0x522ba6(0xf3)+a5_0x5800bb[_0x522ba6(0x138)]('✗'));},'onEvaluationStart':()=>{const _0x165d05=_0x4e0d8b;_0x5e36db[_0x165d05(0xe9)]=_0x165d05(0xb5);},'onEvaluationComplete':_0x1db6ba=>{const _0xdf72ee=_0x4e0d8b,_0x45f8d7=formatElapsed(_0x1db6ba);console['log'](_0xdf72ee(0xd7)+a5_0x5800bb[_0xdf72ee(0xa9)]('✓')+'\x20('+_0x45f8d7+')');}});_0x5e36db[_0x4e0d8b(0xad)](),_0x23bcdd['push'](_0x7db36c);if(_0x7db36c[_0x4e0d8b(0x137)]===_0x4e0d8b(0x134))console[_0x4e0d8b(0x119)](a5_0x5800bb[_0x4e0d8b(0xa9)](_0x4e0d8b(0xdb)+_0x7db36c[_0x4e0d8b(0xe4)])+a5_0x5800bb[_0x4e0d8b(0xb3)](_0x4e0d8b(0x11e)));else _0x7db36c[_0x4e0d8b(0x137)]===_0x4e0d8b(0xf4)?console[_0x4e0d8b(0x119)](a5_0x5800bb[_0x4e0d8b(0x138)](_0x4e0d8b(0x111)+_0x7db36c[_0x4e0d8b(0xe4)])+a5_0x5800bb[_0x4e0d8b(0xb3)](_0x4e0d8b(0x11e))):console[_0x4e0d8b(0x119)](a5_0x5800bb[_0x4e0d8b(0x138)](_0x4e0d8b(0xf7)+_0x7db36c['reason']));_0x7db36c[_0x4e0d8b(0x13d)]&&console['log'](a5_0x5800bb[_0x4e0d8b(0xb3)](_0x4e0d8b(0x113)+_0x7db36c[_0x4e0d8b(0x13d)]));}catch(_0xe21f77){_0x5e36db[_0x4e0d8b(0xad)]();const _0xe8402b=_0xe21f77 instanceof Error?_0xe21f77[_0x4e0d8b(0xc5)]:String(_0xe21f77);console[_0x4e0d8b(0x119)](a5_0x5800bb[_0x4e0d8b(0x138)]('✗\x20ERROR:\x20'+_0xe8402b)),_0x23bcdd[_0x4e0d8b(0xd4)]({'name':_0x35f4b1[_0x4e0d8b(0xef)],'status':_0x4e0d8b(0xf2),'reason':_0xe8402b,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console['log']();const _0x172cb0=Date['now']()-_0x228ab9,_0x199c5b=_0x23bcdd['filter'](_0x460212=>_0x460212['status']===_0x4e0d8b(0x134))[_0x4e0d8b(0xc8)],_0x27d019=_0x23bcdd[_0x4e0d8b(0x130)](_0x212023=>_0x212023[_0x4e0d8b(0x137)]===_0x4e0d8b(0xf4))[_0x4e0d8b(0xc8)],_0x11112f=_0x23bcdd[_0x4e0d8b(0x130)](_0x2983e4=>_0x2983e4['status']===_0x4e0d8b(0xf2))[_0x4e0d8b(0xc8)];console[_0x4e0d8b(0x119)]('━'[_0x4e0d8b(0x133)](0x3c)),console['log'](_0x4e0d8b(0x105)),console[_0x4e0d8b(0x119)]('━'['repeat'](0x3c)),console['log']('Total:\x20\x20\x20\x20'+_0x23bcdd[_0x4e0d8b(0xc8)]),console[_0x4e0d8b(0x119)](_0x4e0d8b(0x10c)+a5_0x5800bb[_0x4e0d8b(0xa9)](_0x199c5b)),console[_0x4e0d8b(0x119)](_0x4e0d8b(0xec)+a5_0x5800bb[_0x4e0d8b(0x138)](_0x27d019));_0x11112f>0x0&&console[_0x4e0d8b(0x119)](_0x4e0d8b(0xdc)+a5_0x5800bb[_0x4e0d8b(0x138)](_0x11112f));console[_0x4e0d8b(0x119)](_0x4e0d8b(0xf6)+formatElapsed(_0x172cb0)),console[_0x4e0d8b(0x119)]('━'[_0x4e0d8b(0x133)](0x3c));const _0x51b9be={'summary':{'total':_0x23bcdd['length'],'passed':_0x199c5b,'failed':_0x27d019,'errors':_0x11112f>0x0?_0x11112f:undefined,'duration_ms':_0x172cb0},'tests':_0x23bcdd,'agent':{'project':_0x343a42[_0x4e0d8b(0x11f)],'name':_0x343a42[_0x4e0d8b(0xac)],'site':_0x51182c},'timestamp':new Date(_0x228ab9)['toISOString']()};if(_0x205a5d!==_0x4e0d8b(0x126)||_0xb790a4){const _0x483f00=formatResults(_0x51b9be,_0x205a5d);if(_0xb790a4)try{a5_0x5ee627[_0x4e0d8b(0xa6)](_0xb790a4,_0x483f00,_0x4e0d8b(0x128)),console[_0x4e0d8b(0x119)](),console['log'](a5_0x5800bb[_0x4e0d8b(0xb3)](_0x4e0d8b(0x12d)+_0xb790a4));}catch(_0xb0948b){return console[_0x4e0d8b(0x119)](),console['log'](a5_0x5800bb['red']('Error\x20writing\x20output\x20file:\x20'+_0xb0948b)),0x1;}else console[_0x4e0d8b(0x119)](),console[_0x4e0d8b(0x119)](_0x483f00);}const _0x1aeefc=_0x23bcdd[_0x4e0d8b(0x130)](_0x49f198=>_0x49f198[_0x4e0d8b(0x137)]!==_0x4e0d8b(0x134));return _0x1aeefc[_0x4e0d8b(0xc8)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x5836cb=a6_0x4feb;(function(_0x54c946,_0x576eca){const _0x4dbca1=a6_0x4feb,_0x1c26aa=_0x54c946();while(!![]){try{const _0x5494e1=parseInt(_0x4dbca1(0xce))/0x1*(parseInt(_0x4dbca1(0xc6))/0x2)+-parseInt(_0x4dbca1(0xbe))/0x3+parseInt(_0x4dbca1(0xae))/0x4+-parseInt(_0x4dbca1(0xcc))/0x5+-parseInt(_0x4dbca1(0xc5))/0x6*(parseInt(_0x4dbca1(0xc9))/0x7)+parseInt(_0x4dbca1(0xb3))/0x8*(-parseInt(_0x4dbca1(0xe4))/0x9)+parseInt(_0x4dbca1(0xcf))/0xa;if(_0x5494e1===_0x576eca)break;else _0x1c26aa['push'](_0x1c26aa['shift']());}catch(_0x55638a){_0x1c26aa['push'](_0x1c26aa['shift']());}}}(a6_0x33e9,0x39bac));function a6_0x4feb(_0x59b273,_0x487174){_0x59b273=_0x59b273-0xac;const _0x33e9d8=a6_0x33e9();let _0x4feb35=_0x33e9d8[_0x59b273];return _0x4feb35;}import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x5836cb(0xf2),a6_0x5836cb(0xe0),a6_0x5836cb(0xd7),a6_0x5836cb(0xb0),'set-cookie2',a6_0x5836cb(0xeb),a6_0x5836cb(0xe8),'x-trino-user']);function isSensitiveHeader(_0xda3b41){const _0x2dd513=a6_0x5836cb;return SENSITIVE_HEADERS[_0x2dd513(0xaf)](_0xda3b41['toLowerCase']());}function a6_0x33e9(){const _0x49e944=['isArray','Endpoint\x20must\x20start\x20with\x20/:\x20','1146136itbIfw','PUT','verbose','toUpperCase','Invalid\x20header\x20format:\x20\x22','body','includes','request','validate','POST','.\x20Valid\x20methods:\x20','907398WHaaFL','stack','type','trim','startsWith','keys','join','12Bkhpew','111786IbYsfT','\x22.\x20','llm','752563wBnfec','cdp','output','1422930pvEVGo','log','2LSXmMO','12158360Mqufiz','readBodyFromFile','DELETE','site','error','substring','execute','trino','cookie','<\x20HTTP/1.1\x20','file','entries','PATCH','headers','name','length','GET','proxy-authorization','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','Error:\x20','noColor','27QTvnvK','message','workflow','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','x-auth-token','method','llm-proxy','x-xsrf-token','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','header','.\x20Valid\x20types:\x20','color','Invalid\x20API\x20type:\x20','data','authorization','api','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','562836xmzIQW','has','set-cookie'];a6_0x33e9=function(){return _0x49e944;};return a6_0x33e9();}function parseHeader(_0x2bbbdd){const _0x3553af=a6_0x5836cb,_0x2ec33a=_0x2bbbdd['indexOf'](':');if(_0x2ec33a===-0x1)throw new Error(_0x3553af(0xb7)+_0x2bbbdd+_0x3553af(0xc7)+_0x3553af(0xe7));const _0x35e32d=_0x2bbbdd[_0x3553af(0xd4)](0x0,_0x2ec33a)['trim'](),_0xb4feb4=_0x2bbbdd[_0x3553af(0xd4)](_0x2ec33a+0x1)[_0x3553af(0xc1)]();if(!_0x35e32d)throw new Error(_0x3553af(0xec)+_0x2bbbdd+'\x22');return[_0x35e32d,_0xb4feb4];}export class ApiCommand extends BaseCommand{[a6_0x5836cb(0xdd)]=a6_0x5836cb(0xac);['description']=a6_0x5836cb(0xe1);[a6_0x5836cb(0xbb)](_0x19ad66){const _0x5c2600=a6_0x5836cb,{args:_0x497545,options:_0x580f5e}=_0x19ad66,_0x1bc33d=_0x580f5e;if(_0x497545[_0x5c2600(0xde)]===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0xe47771=_0x497545[0x0];if(!_0xe47771[_0x5c2600(0xc2)]('/'))return _0x5c2600(0xb2)+_0xe47771;const _0x3a9a0f=_0x1bc33d[_0x5c2600(0xf1)],_0x156ca2=_0x1bc33d['file'];if(_0x3a9a0f&&_0x156ca2)return _0x5c2600(0xad);const _0x37b18f=_0x1bc33d['method']||'GET',_0x283e9a=[_0x5c2600(0xdf),_0x5c2600(0xbc),_0x5c2600(0xb4),_0x5c2600(0xd1),_0x5c2600(0xdb)];if(!_0x283e9a['includes'](_0x37b18f[_0x5c2600(0xb6)]()))return'Invalid\x20HTTP\x20method:\x20'+_0x37b18f+_0x5c2600(0xbd)+_0x283e9a[_0x5c2600(0xc4)](',\x20');const _0x4511f7=_0x1bc33d[_0x5c2600(0xc0)]||'td',_0x14bdb0=['td',_0x5c2600(0xca),_0x5c2600(0xe6),_0x5c2600(0xd6),_0x5c2600(0xc8),_0x5c2600(0xea)];if(!_0x14bdb0[_0x5c2600(0xb9)](_0x4511f7))return _0x5c2600(0xf0)+_0x4511f7+_0x5c2600(0xee)+_0x14bdb0[_0x5c2600(0xc4)](',\x20');return undefined;}async[a6_0x5836cb(0xd5)](_0x33722f){const _0x2f0d2f=a6_0x5836cb,{options:_0x5f3b79,args:_0x3ae0c0,tdx:_0x5e7757}=_0x33722f,_0x5eb600=_0x5f3b79,_0x477128=_0x3ae0c0[0x0],_0x442f0f=(_0x5eb600[_0x2f0d2f(0xe9)]||_0x2f0d2f(0xdf))[_0x2f0d2f(0xb6)](),_0x3f8f48=_0x5eb600[_0x2f0d2f(0xf1)],_0x3b294c=_0x5eb600[_0x2f0d2f(0xd9)],_0x366a13=_0x5eb600[_0x2f0d2f(0xed)],_0x3bb86f=_0x5eb600[_0x2f0d2f(0xc0)]||'td';try{const _0x196579={};if(_0x366a13){const _0x874318=Array[_0x2f0d2f(0xb1)](_0x366a13)?_0x366a13:[_0x366a13];for(const _0x107d31 of _0x874318){const [_0x44bcd5,_0x2b8fa7]=parseHeader(_0x107d31);_0x196579[_0x44bcd5]=_0x2b8fa7;}}let _0x8cc9ed;if(_0x3f8f48)_0x8cc9ed=_0x3f8f48;else{if(_0x3b294c)try{_0x8cc9ed=RawAPI[_0x2f0d2f(0xd0)](_0x3b294c);}catch(_0x5a1ba4){return console[_0x2f0d2f(0xd3)](_0x2f0d2f(0xe2)+(_0x5a1ba4 instanceof Error?_0x5a1ba4['message']:String(_0x5a1ba4))),0x1;}}const _0x4f07ca={'method':_0x442f0f,'apiType':_0x3bb86f,'includeHeaders':_0x5f3b79[_0x2f0d2f(0xb5)]};_0x8cc9ed&&(_0x4f07ca[_0x2f0d2f(0xb8)]=_0x8cc9ed);Object[_0x2f0d2f(0xc3)](_0x196579)[_0x2f0d2f(0xde)]>0x0&&(_0x4f07ca['headers']=_0x196579);if(_0x5f3b79[_0x2f0d2f(0xb5)]){const _0x59bc14=resolveSite(_0x5f3b79[_0x2f0d2f(0xd2)]),_0x1ff071=getEndpoint(_0x59bc14,_0x3bb86f),_0x5ef539=''+_0x1ff071+_0x477128;console[_0x2f0d2f(0xd3)]('>\x20'+_0x442f0f+'\x20'+_0x5ef539);const _0x35d93a=getAuthHeaders(_0x59bc14),_0x3cd4ce={..._0x35d93a,..._0x196579};for(const [_0x44119b,_0xe4ea75]of Object[_0x2f0d2f(0xda)](_0x3cd4ce)){!isSensitiveHeader(_0x44119b)&&console[_0x2f0d2f(0xd3)]('>\x20'+_0x44119b+':\x20'+_0xe4ea75);}_0x8cc9ed&&console[_0x2f0d2f(0xd3)]('>'),console['error']('');}const _0x39b091=await _0x5e7757[_0x2f0d2f(0xac)][_0x2f0d2f(0xba)](_0x477128,_0x4f07ca);if(_0x5f3b79[_0x2f0d2f(0xb5)]&&_0x39b091[_0x2f0d2f(0xdc)]){console[_0x2f0d2f(0xd3)](_0x2f0d2f(0xd8)+_0x39b091['status']);for(const [_0x317229,_0x268831]of Object['entries'](_0x39b091[_0x2f0d2f(0xdc)])){!isSensitiveHeader(_0x317229)&&console['error']('<\x20'+_0x317229+':\x20'+_0x268831);}console[_0x2f0d2f(0xd3)]('');}const _0x3b52c5=Boolean(_0x5f3b79['output']),_0xe931f3={'color':_0x5f3b79[_0x2f0d2f(0xef)],'noColor':_0x5f3b79[_0x2f0d2f(0xe3)]||_0x3b52c5&&!_0x5f3b79[_0x2f0d2f(0xef)]},_0xa1844e=colorizeJSON(_0x39b091[_0x2f0d2f(0xf1)],_0xe931f3);return _0x5f3b79[_0x2f0d2f(0xcb)]?(writeFileSync(_0x5f3b79[_0x2f0d2f(0xcb)],_0xa1844e),console[_0x2f0d2f(0xd3)]('Results\x20saved\x20to\x20'+_0x5f3b79[_0x2f0d2f(0xcb)])):console[_0x2f0d2f(0xcd)](_0xa1844e),0x0;}catch(_0x295841){return _0x295841 instanceof Error?(console[_0x2f0d2f(0xd3)](_0x2f0d2f(0xe2)+_0x295841[_0x2f0d2f(0xe5)]),_0x5f3b79['verbose']&&_0x295841['stack']&&console[_0x2f0d2f(0xd3)]('\x0aStack\x20trace:\x0a'+_0x295841[_0x2f0d2f(0xbf)])):console[_0x2f0d2f(0xd3)](_0x2f0d2f(0xe2)+String(_0x295841)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a7_0xd3b1(_0x45050a,_0x162a5b){_0x45050a=_0x45050a-0x1ac;const _0x3b675a=a7_0x3b67();let _0xd3b143=_0x3b675a[_0x45050a];return _0xd3b143;}const a7_0x48d991=a7_0xd3b1;(function(_0x56abd1,_0x4c4907){const _0x21bb4a=a7_0xd3b1,_0x9c04fa=_0x56abd1();while(!![]){try{const _0x3f26d0=parseInt(_0x21bb4a(0x1d8))/0x1+-parseInt(_0x21bb4a(0x1b8))/0x2+-parseInt(_0x21bb4a(0x1cc))/0x3+parseInt(_0x21bb4a(0x1c9))/0x4*(parseInt(_0x21bb4a(0x1ea))/0x5)+-parseInt(_0x21bb4a(0x1b1))/0x6+parseInt(_0x21bb4a(0x1db))/0x7+-parseInt(_0x21bb4a(0x1b3))/0x8*(-parseInt(_0x21bb4a(0x1f3))/0x9);if(_0x3f26d0===_0x4c4907)break;else _0x9c04fa['push'](_0x9c04fa['shift']());}catch(_0x1ae14a){_0x9c04fa['push'](_0x9c04fa['shift']());}}}(a7_0x3b67,0x40ec4));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';function a7_0x3b67(){const _0x21c5c6=['customSite','User:\x20','500128EMgkhr','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','\x20(profile:\x20','System\x20keychain\x20is\x20not\x20available','N/A','tdx\x20profile:\x20','✓\x20Default\x20site\x20set\x20to\x20','\x20for\x20profile:\x20','description','red','last_name','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','logLevel','Name:\x20','create','\x0aSetup\x20cancelled','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','16hceoSF','\x20\x20tdx','API\x20key\x20cannot\x20be\x20empty','196908nbmGCH','Enter\x20site\x20name:','profile','No\x20credential\x20found','\x27\x20registered','trim','status','warn','yellow','text','Site\x20name\x20cannot\x20be\x20empty','execute','306747nVrjrP','us01','jobs','1444569KgCvyF','join','apiKey','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','bold','tdx:\x20auth\x20setup','You\x20can\x20find\x20your\x20API\x20key\x20at:','Setting\x20up\x20authentication\x20for\x20site:\x20','test','password','auth:clear','/app/mp/ak','✗\x20Validation\x20failed:\x20','error','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','378960XfXTDr','name','green','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','No\x20API\x20key\x20found\x20in\x20keychain','\x20--profile\x20','✓\x20Profile\x20\x27','Select\x20your\x20Treasure\x20Data\x20site:','262809BElnva','message','Read\x20credential\x20from\x20','auth:setup','first_name','email','tdx:\x20auth\x20clear','\x20(site:\x20','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','other','select','log','2984802wIgSWg','site','72CXqbyS','ERROR','getUserInfo'];a7_0x3b67=function(){return _0x21c5c6;};return a7_0x3b67();}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_0x2f9a9e from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a7_0x159986 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x48d991(0x1eb)]=a7_0x48d991(0x1f6);[a7_0x48d991(0x1c0)]='Setup\x20API\x20key\x20authentication\x20interactively';async[a7_0x48d991(0x1d7)](_0xd0eb94){const _0xf196ac=a7_0x48d991,{options:_0x19fe6a}=_0xd0eb94,_0x1b0ca0=_0x19fe6a['profile'];console[_0xf196ac(0x1b0)](a7_0x159986[_0xf196ac(0x1df)](_0xf196ac(0x1e0)));const _0x1e561b=_0x19fe6a[_0xf196ac(0x1b2)]||_0xf196ac(0x1d9),{choices:_0x5e8824,initialIndex:_0xc90e13}=buildSiteChoices(_0x1e561b),_0x305fcc=_0x1b0ca0?'Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20'+_0x1b0ca0+'):':_0xf196ac(0x1f2),_0x595e1c=await a7_0x2f9a9e({'type':_0xf196ac(0x1af),'name':_0xf196ac(0x1b2),'message':_0x305fcc,'choices':_0x5e8824,'initial':_0xc90e13});if(!_0x595e1c[_0xf196ac(0x1b2)])return console[_0xf196ac(0x1b0)](_0xf196ac(0x1c7)),0x1;let _0x15b11e;if(_0x595e1c['site']===_0xf196ac(0x1ae)){const _0x1f3d02=await a7_0x2f9a9e({'type':_0xf196ac(0x1d5),'name':_0xf196ac(0x1b6),'message':_0xf196ac(0x1cd),'initial':_0xf196ac(0x1d9),'validate':_0x1a38a0=>{const _0x22b635=_0xf196ac;if(!_0x1a38a0||!_0x1a38a0[_0x22b635(0x1d1)]())return _0x22b635(0x1d6);if(!/^[a-z0-9-]+$/[_0x22b635(0x1e3)](_0x1a38a0['trim']()))return _0x22b635(0x1ee);return!![];}});if(!_0x1f3d02[_0xf196ac(0x1b6)])return console['log']('\x0aSetup\x20cancelled'),0x1;_0x15b11e=_0x1f3d02['customSite'];}else _0x15b11e=_0x595e1c[_0xf196ac(0x1b2)];const _0x9707c5=resolveSite(_0x15b11e);console['log'](_0xf196ac(0x1e2)+_0x9707c5),console['log'](_0xf196ac(0x1e1)),console[_0xf196ac(0x1b0)]('\x20\x20'+getConsoleUrl(_0x9707c5,_0xf196ac(0x1e6)));const _0x23d6d3=await a7_0x2f9a9e({'type':_0xf196ac(0x1e4),'name':_0xf196ac(0x1dd),'message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x8b1cb9=>{const _0x9ce80f=_0xf196ac;if(!_0x8b1cb9||!_0x8b1cb9[_0x9ce80f(0x1d1)]())return _0x9ce80f(0x1cb);return!![];}});if(!_0x23d6d3[_0xf196ac(0x1dd)])return console[_0xf196ac(0x1b0)]('\x0aSetup\x20cancelled'),0x1;const _0x10af15=_0x23d6d3[_0xf196ac(0x1dd)];console['log']('Validating\x20API\x20key...');try{const _0x5b734f=TDX[_0xf196ac(0x1c6)]({'site':_0x9707c5,'apiKey':_0x10af15[_0xf196ac(0x1d1)](),'logLevel':_0x19fe6a[_0xf196ac(0x1c4)]??LogLevel[_0xf196ac(0x1b4)]}),_0xe6de5=await _0x5b734f[_0xf196ac(0x1da)][_0xf196ac(0x1b5)]();console['log'](_0xf196ac(0x1c8)+_0xe6de5[_0xf196ac(0x1f8)]+')');const _0x4d510f=await isKeychainAvailable();_0x4d510f?(await saveAPIKeyAsync(_0x10af15[_0xf196ac(0x1d1)](),_0x9707c5,_0x1b0ca0),console['log'](_0xf196ac(0x1c3)+(_0x1b0ca0?'\x20(profile:\x20'+_0x1b0ca0+')':''))):(console['warn'](a7_0x159986[_0xf196ac(0x1d4)](_0xf196ac(0x1b9))),console[_0xf196ac(0x1d3)](a7_0x159986['yellow'](_0xf196ac(0x1ed))));if(_0x1b0ca0){const _0x282a07={'site':_0x9707c5};saveProfileToUserConfig(_0x1b0ca0,_0x282a07),console['log'](_0xf196ac(0x1f1)+_0x1b0ca0+_0xf196ac(0x1d0));}else saveDefaultSiteToUserConfig(_0x9707c5),console[_0xf196ac(0x1b0)](_0xf196ac(0x1be)+_0x9707c5);const _0xfd791f=_0x1b0ca0?_0xf196ac(0x1f0)+_0x1b0ca0:'';return console[_0xf196ac(0x1b0)](),console[_0xf196ac(0x1b0)](_0xf196ac(0x1ad)),console['log'](_0xf196ac(0x1ca)+_0xfd791f+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0xf196ac(0x1b0)](_0xf196ac(0x1ca)+_0xfd791f+_0xf196ac(0x1de)),0x0;}catch(_0x469164){if(_0x469164 instanceof HTTPClientError&&_0x469164['status']===0x191)return printAuthError(_0x469164),0x1;return console[_0xf196ac(0x1e8)](a7_0x159986['red'](_0xf196ac(0x1e7)+(_0x469164 instanceof Error?_0x469164[_0xf196ac(0x1f4)]:String(_0x469164)))),console[_0xf196ac(0x1e8)](_0xf196ac(0x1e9)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x48d991(0x1eb)]='auth';[a7_0x48d991(0x1c0)]='Show\x20authentication\x20status\x20and\x20validate\x20API\x20key';async[a7_0x48d991(0x1d7)](_0x236f20){const _0x7b1d9a=a7_0x48d991,{options:_0x2baaa3,tdx:_0x1d2b4d}=_0x236f20,_0x40a69b=_0x2baaa3[_0x7b1d9a(0x1b2)],_0x446434=_0x2baaa3[_0x7b1d9a(0x1ce)],_0x1a2a2a=_0x446434?_0x446434:_0x7b1d9a(0x1bc);console['log'](_0x7b1d9a(0x1bd)+_0x1a2a2a+_0x7b1d9a(0x1ac)+_0x40a69b+')');const _0x3601a6=await resolveAPIKeyAsync(_0x40a69b,_0x446434);if(_0x3601a6){const {source:_0x3bfc2c,isDeprecated:_0x3abc74}=_0x3601a6,_0x37ff0b=_0x7b1d9a(0x1f5)+_0x3bfc2c;console[_0x7b1d9a(0x1b0)](_0x3abc74?a7_0x159986[_0x7b1d9a(0x1d4)](_0x37ff0b):_0x37ff0b);}else console[_0x7b1d9a(0x1b0)](a7_0x159986['yellow'](_0x7b1d9a(0x1cf)));try{const _0x59e597=await _0x1d2b4d[_0x7b1d9a(0x1da)][_0x7b1d9a(0x1b5)]();return console[_0x7b1d9a(0x1b0)](a7_0x159986[_0x7b1d9a(0x1ec)]('✓\x20Authentication\x20successful\x0a')),console[_0x7b1d9a(0x1b0)](_0x7b1d9a(0x1b7)+_0x59e597[_0x7b1d9a(0x1f8)]),(_0x59e597['first_name']||_0x59e597[_0x7b1d9a(0x1c2)])&&console[_0x7b1d9a(0x1b0)](_0x7b1d9a(0x1c5)+[_0x59e597[_0x7b1d9a(0x1f7)],_0x59e597[_0x7b1d9a(0x1c2)]]['filter'](Boolean)[_0x7b1d9a(0x1dc)]('\x20')),0x0;}catch(_0x22a462){return _0x22a462 instanceof HTTPClientError&&_0x22a462[_0x7b1d9a(0x1d2)]===0x191?printAuthError(_0x22a462,!![],_0x446434):console['error'](a7_0x159986[_0x7b1d9a(0x1c1)]('✗\x20Validation\x20failed:\x20'+(_0x22a462 instanceof Error?_0x22a462[_0x7b1d9a(0x1f4)]:String(_0x22a462)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x48d991(0x1eb)]=a7_0x48d991(0x1e5);[a7_0x48d991(0x1c0)]='Remove\x20API\x20key\x20from\x20system\x20keychain';async[a7_0x48d991(0x1d7)](_0x155aaf){const _0x1ce325=a7_0x48d991,{options:_0x28390e}=_0x155aaf,_0x44decf=_0x28390e[_0x1ce325(0x1ce)];console[_0x1ce325(0x1b0)](a7_0x159986[_0x1ce325(0x1df)](_0x1ce325(0x1f9)));const _0x551560=await isKeychainAvailable();if(!_0x551560)return console['error'](a7_0x159986[_0x1ce325(0x1c1)](_0x1ce325(0x1bb))),0x1;const _0x5ccba7=await deleteKeychainAPIKey(_0x44decf);return _0x5ccba7?(clearCredentialCache(),console[_0x1ce325(0x1b0)]('✓\x20API\x20key\x20removed\x20from\x20keychain'+(_0x44decf?_0x1ce325(0x1ba)+_0x44decf+')':'')),0x0):(console['log'](_0x1ce325(0x1ef)+(_0x44decf?_0x1ce325(0x1bf)+_0x44decf:'')),0x1);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a8_0x3e6f8f=a8_0x2e3d;(function(_0x3f64c5,_0x306362){const _0x2adcd6=a8_0x2e3d,_0x41bf1e=_0x3f64c5();while(!![]){try{const _0x16bd99=-parseInt(_0x2adcd6(0x12e))/0x1+-parseInt(_0x2adcd6(0x111))/0x2*(parseInt(_0x2adcd6(0x13d))/0x3)+parseInt(_0x2adcd6(0x129))/0x4+-parseInt(_0x2adcd6(0x11f))/0x5*(parseInt(_0x2adcd6(0x122))/0x6)+-parseInt(_0x2adcd6(0x127))/0x7+-parseInt(_0x2adcd6(0x11e))/0x8+parseInt(_0x2adcd6(0x12b))/0x9;if(_0x16bd99===_0x306362)break;else _0x41bf1e['push'](_0x41bf1e['shift']());}catch(_0x326b66){_0x41bf1e['push'](_0x41bf1e['shift']());}}}(a8_0x4af4,0xa63b6));function a8_0x2e3d(_0x222d69,_0x20ad45){_0x222d69=_0x222d69-0x110;const _0x4af467=a8_0x4af4();let _0x2e3d42=_0x4af467[_0x222d69];return _0x2e3d42;}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';function a8_0x4af4(){const _0x46d625=['Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','2674609eLclZg','validate','3288248ABYdai','metadata','23727366eKjAOD','claude-4.5-haiku','\x20\x20Cause:\x20','785104EhaCXU','Continuing\x20chat:\x20','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','message','\x27...','--agent\x20flag','404','write','Chat\x20session:\x20','stack','new','getAgentId','cause','resolveAgentId','data','72714WJbIqU','Getting\x20default\x20agent...','type','chat','event','\x0aStack\x20trace:','20klnARn','verbose','llm','content','name','handleChatEvent','Resolving\x20project\x20\x27','includes','error','llmAgent','llmProject','code','agent','2640216OkRHiR','18020ubmwIB','stdout','join','1728NOFlAy','Error:\x20','getOrCreateDefaultAgent','streamChat'];a8_0x4af4=function(){return _0x46d625;};return a8_0x4af4();}import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';function handleSDKError(_0x4a204a,_0x5ea663){const _0x466c8d=a8_0x2e3d;if(_0x4a204a instanceof SDKError)console[_0x466c8d(0x119)](_0x466c8d(0x123)+_0x4a204a[_0x466c8d(0x131)]),_0x5ea663[_0x466c8d(0x112)]&&(_0x4a204a[_0x466c8d(0x13a)]&&console[_0x466c8d(0x119)](_0x466c8d(0x12d)+_0x4a204a['cause']),_0x4a204a['stack']&&(console[_0x466c8d(0x119)](_0x466c8d(0x110)),console[_0x466c8d(0x119)](_0x4a204a[_0x466c8d(0x137)])));else throw _0x4a204a;}export class ChatCommand extends BaseCommand{[a8_0x3e6f8f(0x115)]=a8_0x3e6f8f(0x140);['description']='Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)';[a8_0x3e6f8f(0x128)](_0x3ea1ea){const _0x420d6c=a8_0x3e6f8f,_0x21ed28=_0x3ea1ea['args'][_0x420d6c(0x121)]('\x20');if(!_0x21ed28)return _0x420d6c(0x130);return undefined;}async[a8_0x3e6f8f(0x125)](_0x1867eb,_0x247b33,_0x129b0b,_0x509d36,_0x2321f6){const _0x27ab39=a8_0x3e6f8f;for await(const _0x3ba00d of _0x1867eb[_0x27ab39(0x113)][_0x27ab39(0x140)](_0x247b33,{'agentId':_0x129b0b,'chatId':_0x509d36})){if(_0x3ba00d[_0x27ab39(0x13f)]===_0x27ab39(0x12a)){const _0x140c0b=_0x3ba00d[_0x27ab39(0x13c)]['chatId'];saveLastChatId(_0x140c0b),_0x2321f6&&console['error'](_0x27ab39(0x136)+_0x140c0b);}else _0x3ba00d[_0x27ab39(0x13f)]===_0x27ab39(0x141)&&this[_0x27ab39(0x116)](_0x3ba00d['data']);}}async[a8_0x3e6f8f(0x139)](_0x43ea66,_0x1fae71,_0x5be818,_0x5e40f8,_0x29e5c0){const _0x3f8876=a8_0x3e6f8f,_0x6789e=_0x1fae71||_0x5be818;if(_0x6789e){const {projectName:_0x4b60a9,agentName:_0x5604c3}=parseAgentRef(_0x6789e),_0x1f4448=_0x5604c3||_0x6789e,_0x4c7af9=_0x5604c3?_0x4b60a9:_0x5e40f8;if(!_0x4c7af9)throw new Error('No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22');if(_0x29e5c0){const _0x451165=_0x1fae71?_0x3f8876(0x133):'session\x20context';console[_0x3f8876(0x119)]('Using\x20agent\x20from\x20'+_0x451165+':\x20'+_0x4c7af9+'/'+_0x1f4448);}const _0x337bee=await withSpinner(_0x3f8876(0x117)+_0x4c7af9+_0x3f8876(0x132),()=>_0x43ea66['llm']['resolveProjectId'](_0x4c7af9),{'verbose':_0x29e5c0}),_0xb60d2e=await withSpinner('Resolving\x20agent\x20\x27'+_0x1f4448+_0x3f8876(0x132),()=>_0x43ea66[_0x3f8876(0x113)][_0x3f8876(0x13b)](_0x1f4448,_0x337bee[_0x3f8876(0x13c)]),{'verbose':_0x29e5c0});return _0xb60d2e['data'];}else{const _0x404594=_0x43ea66[_0x3f8876(0x113)]['getDefaultAgent']();if(_0x404594)return _0x29e5c0&&console[_0x3f8876(0x119)]('Using\x20cached\x20default\x20agent:\x20'+_0x404594[_0x3f8876(0x115)]),_0x404594['id'];const _0xdfdc0f=await withSpinner(_0x3f8876(0x13e),()=>_0x43ea66[_0x3f8876(0x113)][_0x3f8876(0x124)](_0x3f8876(0x12c),0x0),{'verbose':_0x29e5c0});return _0xdfdc0f[_0x3f8876(0x13c)]['id'];}}async['execute'](_0xd952f5){const _0x46842e=a8_0x3e6f8f,{options:_0x1c73cc,args:_0x38236d,tdx:_0x4c804a}=_0xd952f5,_0x420eb1=_0x38236d[_0x46842e(0x121)]('\x20'),_0x3d9f22=_0x1c73cc,_0x3fe2be=_0x3d9f22[_0x46842e(0x11d)],_0x3dfad9=_0x3d9f22[_0x46842e(0x11a)],_0x154fe2=_0x3d9f22[_0x46842e(0x11b)],_0x4ee078=_0x3d9f22[_0x46842e(0x138)];try{let _0x401240,_0x5d0fb6;!_0x4ee078&&(_0x5d0fb6=loadLastChatId(),_0x5d0fb6&&_0x1c73cc[_0x46842e(0x112)]&&console['error'](_0x46842e(0x12f)+_0x5d0fb6));(_0x4ee078||!_0x5d0fb6)&&(_0x401240=await this[_0x46842e(0x139)](_0x4c804a,_0x3fe2be,_0x3dfad9,_0x154fe2,_0x1c73cc[_0x46842e(0x112)]));try{await this[_0x46842e(0x125)](_0x4c804a,_0x420eb1,_0x401240,_0x5d0fb6,_0x1c73cc[_0x46842e(0x112)]);}catch(_0x168f33){const _0x40ed23=_0x168f33 instanceof SDKError&&_0x168f33[_0x46842e(0x11c)]===ErrorCode['CHAT_NOT_FOUND']||_0x168f33 instanceof Error&&_0x168f33[_0x46842e(0x131)][_0x46842e(0x118)](_0x46842e(0x134));if(_0x40ed23)_0x1c73cc[_0x46842e(0x112)]&&console[_0x46842e(0x119)](_0x46842e(0x126)),!_0x401240&&(_0x401240=await this[_0x46842e(0x139)](_0x4c804a,_0x3fe2be,_0x3dfad9,_0x154fe2,_0x1c73cc[_0x46842e(0x112)])),await this['streamChat'](_0x4c804a,_0x420eb1,_0x401240,undefined,_0x1c73cc[_0x46842e(0x112)]);else throw _0x168f33;}return console['log'](),0x0;}catch(_0x5afbd9){return console[_0x46842e(0x119)](),handleSDKError(_0x5afbd9,_0x1c73cc),0x1;}}['handleChatEvent'](_0x19b1b9){const _0xc1a6c9=a8_0x3e6f8f;if(_0xc1a6c9(0x114)in _0x19b1b9)process[_0xc1a6c9(0x120)][_0xc1a6c9(0x135)](_0x19b1b9['content']);else _0xc1a6c9(0x119)in _0x19b1b9&&console[_0xc1a6c9(0x119)]('\x0aError:\x20'+_0x19b1b9[_0xc1a6c9(0x119)]);}}
|