@treasuredata/tdx 0.25.2 → 0.25.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/use-command.d.ts.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.d.ts +16 -0
- package/dist/core/config.d.ts.map +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/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/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.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.d.ts +4 -1
- package/dist/utils/version-check.d.ts.map +1 -1
- package/dist/utils/version-check.js +1 -1
- package/dist/utils/version-check.js.map +1 -1
- package/package.json +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x24ee34=a4_0x2bdb;(function(_0x85b999,_0x413424){const _0x4bb0d0=a4_0x2bdb,_0x9ed7dd=_0x85b999();while(!![]){try{const _0x41cb10=-parseInt(_0x4bb0d0(0x66))/0x1*(-parseInt(_0x4bb0d0(0x6a))/0x2)+parseInt(_0x4bb0d0(0x6c))/0x3+parseInt(_0x4bb0d0(0xb1))/0x4*(parseInt(_0x4bb0d0(0xfb))/0x5)+parseInt(_0x4bb0d0(0x74))/0x6+-parseInt(_0x4bb0d0(0xb3))/0x7+parseInt(_0x4bb0d0(0x9b))/0x8+-parseInt(_0x4bb0d0(0x73))/0x9*(parseInt(_0x4bb0d0(0x9d))/0xa);if(_0x41cb10===_0x413424)break;else _0x9ed7dd['push'](_0x9ed7dd['shift']());}catch(_0x2601b2){_0x9ed7dd['push'](_0x9ed7dd['shift']());}}}(a4_0x346b,0x5872c));import a4_0x362182 from'chalk';function a4_0x346b(){const _0x310b1f=['\x22\x20to\x20a\x20different\x20profile','\x20\x20Prompts:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','new','found','agent:push','\x22...','green','Pushing\x20agent\x20from\x20\x22','\x20total','hasChanges','created','Failed\x20to\x20push\x20agent:\x20','parse','Analyzing\x20changes\x20to\x20push...','\x20\x20Knowledge\x20Bases:\x20','\x20\x20tdx\x20agent\x20pull\x20','Using\x20local\x20project:\x20','no_context','counts','unchanged','\x20=\x20','\x20\x20Agents:\x20','agent:clone','diff','\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)','Output\x20path:\x20','session','agentId','\x22:\x20','prompts','\x20changed','Analyzing\x20project\x20\x22','Agent\x20pulled\x20successfully','Would\x20pull\x20agent:\x20','\x20new','dirname','\x0aProject\x20pushed\x20with\x20errors','pushProject','outputDir','no_local_folder','output','updated','Using\x20context\x20project:\x20','\x0aError:','\x27\x20to\x20create\x20the\x20folder\x20structure.','action','outputPath','pullProject','Writing\x20files...','\x20\x20Prompt\x20\x22','220Mwfesj','\x20updated','agentName','\x20\x20Integrations:\x20','Project\x20cloned\x20successfully','INVALID_ARGUMENT','projectName','Would\x20clone:','execute','\x0aErrors\x20found:','\x0a✔\x20Pulled\x20','\x20resources?','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x20created','llm','2RdtmWL','Output:\x20','Errors:','\x22\x20to\x20new\x20project\x20\x22','109394cPGXfs','textKnowledgeBases','1156794doMzOW','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)','No\x20tdx.json\x20found\x20in\x20','\x0aPush\x20summary\x20for\x20\x27','Using\x20project\x20from\x20','red','\x20unchanged','954VpUNgf','3189774LxkFVE','gray','cyan','\x0aPull\x20summary\x20for\x20\x27','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','Cancelled','utf-8','pullAgent','Cannot\x20clone\x20from\x20context\x20project\x20\x22','dim','\x20\x20Agent\x20\x22','integrations','yellow','cloneProject','Pulling\x20agent\x20\x22','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','Using\x20current\x20project:\x20','\x20|\x20','Cloning\x20\x22','\x0aWrite\x20','total','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','reason','✔\x20Context\x20set:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','source','knowledgeBases','-\x20nothing\x20pushed','Pushing\x20to\x20project...','\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','\x20\x20Knowledge\x20Base\x20\x22','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','\x0aChanges\x20to\x20prompt\x20\x27','errors','Clone\x20\x22','join','\x20\x20Text\x20Knowledge\x20Bases:\x20','error','4209008mmWXGK','dryRun','131860IqacUY','Agent:\x20','Dry\x20run\x20-\x20no\x20changes\x20made','repeat','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','Chat:\x20','newProjectId','\x20\x20Target:\x20','Dry\x20run\x20-\x20no\x20files\x20written','New\x20project\x20ID:\x20','pushAgent','push','<new-name>','agents','description','name','llmProject','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','message','llm_project','61604OIxqCi','projectDir','3292737xEcVlg','Summary:','\x20\x20Integration\x20\x22','cwd','force','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x0aPush\x20','log','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','New\x20project:\x20','\x20files?','sourceProjectName','tdx.json','\x20files\x20to\x20','projectId','\x22\x20to\x20\x22','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','Source:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','Project:\x20'];a4_0x346b=function(){return _0x310b1f;};return a4_0x346b();}import a4_0x41f431 from'path';import{existsSync,readFileSync}from'fs';function a4_0x2bdb(_0x95d662,_0x524e32){_0x95d662=_0x95d662-0x65;const _0x346b11=a4_0x346b();let _0x2bdb8f=_0x346b11[_0x95d662];return _0x2bdb8f;}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(_0x557a8f){const _0x4136c0=a4_0x2bdb,_0x3db7da=[];if(_0x557a8f[_0x4136c0(0x88)]!==undefined)_0x3db7da['push'](_0x557a8f[_0x4136c0(0x88)]+_0x4136c0(0xd1));if(_0x557a8f[_0x4136c0(0xcb)]!==undefined&&_0x557a8f[_0x4136c0(0xcb)]>0x0)_0x3db7da[_0x4136c0(0xa8)](a4_0x362182['green'](_0x557a8f[_0x4136c0(0xcb)]+_0x4136c0(0xeb)));if(_0x557a8f[_0x4136c0(0xd3)]!==undefined&&_0x557a8f['created']>0x0)_0x3db7da[_0x4136c0(0xa8)](a4_0x362182[_0x4136c0(0xcf)](_0x557a8f[_0x4136c0(0xd3)]+_0x4136c0(0x108)));if(_0x557a8f[_0x4136c0(0xf2)]!==undefined&&_0x557a8f['updated']>0x0)_0x3db7da[_0x4136c0(0xa8)](a4_0x362182[_0x4136c0(0x80)](_0x557a8f['updated']+_0x4136c0(0xfc)));if(_0x557a8f[_0x4136c0(0xdc)]!==undefined&&_0x557a8f[_0x4136c0(0xdc)]>0x0)_0x3db7da['push'](a4_0x362182[_0x4136c0(0x75)](_0x557a8f[_0x4136c0(0xdc)]+_0x4136c0(0x72)));if(_0x557a8f[_0x4136c0(0x96)]!==undefined&&_0x557a8f['errors']>0x0)_0x3db7da[_0x4136c0(0xa8)](a4_0x362182[_0x4136c0(0x71)](_0x557a8f[_0x4136c0(0x96)]+'\x20errors'));return _0x3db7da[_0x4136c0(0x98)](',\x20');}function displayDiffs(_0x5b16d7,_0x1822a3,_0x131300,_0x3a6b2b,_0x27a25e=[]){const _0x48c47f=a4_0x2bdb;for(const _0x2fdcc4 of _0x5b16d7){if(_0x2fdcc4[_0x48c47f(0xe0)]){const _0x106e5a=_0x2fdcc4[_0x48c47f(0xfd)]||_0x2fdcc4[_0x48c47f(0xac)];console[_0x48c47f(0xba)]('\x0aChanges\x20to\x20agent\x20\x27'+_0x106e5a+'\x27:'),console[_0x48c47f(0xba)]('─'[_0x48c47f(0xa0)](0x3c)),console[_0x48c47f(0xba)](_0x2fdcc4[_0x48c47f(0xe0)]),console[_0x48c47f(0xba)]('─'[_0x48c47f(0xa0)](0x3c));}}for(const _0x55d2df of _0x1822a3){_0x55d2df['diff']&&(console[_0x48c47f(0xba)]('\x0aChanges\x20to\x20knowledge\x20base\x20\x27'+_0x55d2df[_0x48c47f(0xac)]+'\x27:'),console[_0x48c47f(0xba)]('─'['repeat'](0x3c)),console[_0x48c47f(0xba)](_0x55d2df[_0x48c47f(0xe0)]),console[_0x48c47f(0xba)]('─'[_0x48c47f(0xa0)](0x3c)));}for(const _0x4b07bf of _0x131300){_0x4b07bf['diff']&&(console[_0x48c47f(0xba)](_0x48c47f(0xae)+_0x4b07bf[_0x48c47f(0xac)]+'\x27:'),console['log']('─'[_0x48c47f(0xa0)](0x3c)),console[_0x48c47f(0xba)](_0x4b07bf[_0x48c47f(0xe0)]),console[_0x48c47f(0xba)]('─'[_0x48c47f(0xa0)](0x3c)));}for(const _0x5d92f0 of _0x3a6b2b){_0x5d92f0[_0x48c47f(0xe0)]&&(console[_0x48c47f(0xba)](_0x48c47f(0x95)+_0x5d92f0[_0x48c47f(0xac)]+'\x27:'),console[_0x48c47f(0xba)]('─'[_0x48c47f(0xa0)](0x3c)),console[_0x48c47f(0xba)](_0x5d92f0['diff']),console[_0x48c47f(0xba)]('─'[_0x48c47f(0xa0)](0x3c)));}for(const _0x24c482 of _0x27a25e){_0x24c482[_0x48c47f(0xe0)]&&(console[_0x48c47f(0xba)]('\x0aChanges\x20to\x20integration\x20\x27'+_0x24c482[_0x48c47f(0xac)]+'\x27:'),console[_0x48c47f(0xba)]('─'[_0x48c47f(0xa0)](0x3c)),console[_0x48c47f(0xba)](_0x24c482[_0x48c47f(0xe0)]),console[_0x48c47f(0xba)]('─'[_0x48c47f(0xa0)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x24ee34(0xac)]='agent:pull';[a4_0x24ee34(0xab)]=a4_0x24ee34(0xc3);async[a4_0x24ee34(0x103)](_0x3e58dd){const _0x202bd8=a4_0x24ee34,{options:_0x22f005,args:_0x529ca3,tdx:_0x26a8ba}=_0x3e58dd,_0x6d409e=_0x529ca3[0x0],_0x5c1520=_0x529ca3[0x1],_0x20dabd=_0x22f005[_0x202bd8(0xf1)],_0x43a38c=_0x22f005[_0x202bd8(0x9c)],_0xc00d91=_0x22f005[_0x202bd8(0xb7)],_0x3e9543=_0x22f005['yes'],_0x4cb8da=_0x22f005[_0x202bd8(0xad)];let _0x6e8001,_0xf40408;const _0x514258=findAgentConfigPath(process['cwd']());if(_0x6d409e){const _0x20b5fc=a4_0x41f431[_0x202bd8(0x98)](_0x6d409e,'tdx.json');if(existsSync(_0x20b5fc))try{const _0x410193=JSON['parse'](readFileSync(_0x20b5fc,_0x202bd8(0x7a)));_0x6e8001=_0x410193[_0x202bd8(0xb0)],_0xf40408=_0x6d409e,console[_0x202bd8(0xba)](a4_0x362182['dim'](_0x202bd8(0x70)+_0x20b5fc+':\x20'+_0x6e8001));}catch{_0x6e8001=_0x6d409e;}else _0x6e8001=_0x6d409e;}else{if(_0x514258)try{const _0x34d993=JSON[_0x202bd8(0xd5)](readFileSync(_0x514258,_0x202bd8(0x7a)));_0x6e8001=_0x34d993[_0x202bd8(0xb0)],_0xf40408=a4_0x41f431[_0x202bd8(0xec)](_0x514258),console[_0x202bd8(0xba)](a4_0x362182[_0x202bd8(0x7d)]('Using\x20project:\x20'+_0x6e8001));}catch{_0x6e8001=_0x4cb8da;}else _0x6e8001=_0x4cb8da;}if(!_0x6e8001)return console['log'](a4_0x362182['yellow'](_0x202bd8(0x83))),console[_0x202bd8(0xba)](_0x202bd8(0x6d)),console['log'](_0x202bd8(0x92)),console[_0x202bd8(0xba)](_0x202bd8(0xc5)),console[_0x202bd8(0xba)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent'),0x1;if(_0x5c1520){const {data:_0xde0ed3}=await withSpinner(_0x202bd8(0x82)+_0x5c1520+'\x22\x20from\x20project\x20\x22'+_0x6e8001+_0x202bd8(0xce),()=>_0x26a8ba['llm'][_0x202bd8(0x7b)](_0x6e8001,_0x5c1520,_0x20dabd,{'dryRun':_0x43a38c,'force':_0xc00d91}));if(_0x43a38c)return console[_0x202bd8(0xba)](a4_0x362182[_0x202bd8(0x80)](_0x202bd8(0xa5))),console[_0x202bd8(0xba)](_0x202bd8(0xea)+_0xde0ed3['agentName']),console[_0x202bd8(0xba)](_0x202bd8(0xe2)+_0xde0ed3[_0x202bd8(0xf7)]),_0xde0ed3[_0x202bd8(0xe0)]&&(console['log']('\x0aChanges:'),console[_0x202bd8(0xba)]('─'[_0x202bd8(0xa0)](0x3c)),console[_0x202bd8(0xba)](_0xde0ed3[_0x202bd8(0xe0)]),console[_0x202bd8(0xba)]('─'[_0x202bd8(0xa0)](0x3c))),0x0;return console['log'](a4_0x362182[_0x202bd8(0xcf)](_0x202bd8(0xe9))),console['log'](_0x202bd8(0x9e)+_0xde0ed3['agentName']),console['log'](_0x202bd8(0x67)+_0xde0ed3['outputPath']),console[_0x202bd8(0xba)]('Status:\x20'+(_0xde0ed3['isNew']?a4_0x362182['green'](_0x202bd8(0xcb)):_0xde0ed3[_0x202bd8(0xd2)]?a4_0x362182[_0x202bd8(0x80)](_0x202bd8(0xf2)):a4_0x362182['gray'](_0x202bd8(0xdc)))),0x0;}const _0x40c2be=_0xf40408||_0x20dabd,{data:_0x277d83}=await withSpinner(_0x202bd8(0xe8)+_0x6e8001+_0x202bd8(0xce),()=>_0x26a8ba[_0x202bd8(0x65)]['pullProject'](_0x6e8001,_0x40c2be,{'dryRun':!![]})),_0x1a1036=_0x277d83['counts'][_0x202bd8(0xaa)][_0x202bd8(0xcb)]+_0x277d83[_0x202bd8(0xdb)][_0x202bd8(0x8f)]['new']+_0x277d83[_0x202bd8(0xdb)]['textKnowledgeBases']['new']+_0x277d83[_0x202bd8(0xdb)]['prompts']['new']+_0x277d83[_0x202bd8(0xdb)][_0x202bd8(0x7f)]['new'],_0x1dfd75=_0x277d83[_0x202bd8(0xdb)][_0x202bd8(0xaa)][_0x202bd8(0xf2)]+_0x277d83['counts'][_0x202bd8(0x8f)][_0x202bd8(0xf2)]+_0x277d83[_0x202bd8(0xdb)]['textKnowledgeBases']['updated']+_0x277d83[_0x202bd8(0xdb)]['prompts'][_0x202bd8(0xf2)]+_0x277d83['counts'][_0x202bd8(0x7f)]['updated'],_0x404831=_0x277d83[_0x202bd8(0xdb)][_0x202bd8(0xaa)][_0x202bd8(0xdc)]+_0x277d83[_0x202bd8(0xdb)]['knowledgeBases'][_0x202bd8(0xdc)]+_0x277d83[_0x202bd8(0xdb)]['textKnowledgeBases'][_0x202bd8(0xdc)]+_0x277d83[_0x202bd8(0xdb)][_0x202bd8(0xe6)][_0x202bd8(0xdc)]+_0x277d83[_0x202bd8(0xdb)][_0x202bd8(0x7f)]['unchanged'];console[_0x202bd8(0xba)](_0x202bd8(0x77)+_0x277d83['projectName']+'\x27:'),console['log']('\x20\x20'+a4_0x362182['green']('+\x20'+_0x1a1036+_0x202bd8(0xeb))+'\x20|\x20'+a4_0x362182[_0x202bd8(0x80)]('~\x20'+_0x1dfd75+'\x20changed')+_0x202bd8(0x85)+a4_0x362182[_0x202bd8(0x7d)]('=\x20'+_0x404831+_0x202bd8(0x72))),console[_0x202bd8(0xba)]('\x20\x20Agents:\x20'+formatCountSummary(_0x277d83[_0x202bd8(0xdb)][_0x202bd8(0xaa)])),console[_0x202bd8(0xba)](_0x202bd8(0xd7)+formatCountSummary(_0x277d83[_0x202bd8(0xdb)][_0x202bd8(0x8f)])),console[_0x202bd8(0xba)](_0x202bd8(0x99)+formatCountSummary(_0x277d83['counts'][_0x202bd8(0x6b)])),console[_0x202bd8(0xba)](_0x202bd8(0xc9)+formatCountSummary(_0x277d83[_0x202bd8(0xdb)]['prompts'])),console[_0x202bd8(0xba)](_0x202bd8(0xfe)+formatCountSummary(_0x277d83[_0x202bd8(0xdb)][_0x202bd8(0x7f)])),console[_0x202bd8(0xba)](_0x202bd8(0xa4)+a4_0x362182[_0x202bd8(0x76)](_0x277d83[_0x202bd8(0xef)])),displayDiffs(_0x277d83[_0x202bd8(0xaa)],_0x277d83[_0x202bd8(0x8f)],_0x277d83[_0x202bd8(0x6b)],_0x277d83['prompts'],_0x277d83[_0x202bd8(0x7f)]);if(_0x43a38c)return console[_0x202bd8(0xba)](a4_0x362182['yellow']('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x1a1036===0x0&&_0x1dfd75===0x0)return console[_0x202bd8(0xba)](a4_0x362182[_0x202bd8(0xcf)](_0x202bd8(0x94))),saveSessionContext({'llm_project':_0x277d83[_0x202bd8(0x101)]},_0x22f005[_0x202bd8(0xe3)]),console[_0x202bd8(0xba)](a4_0x362182[_0x202bd8(0xcf)](_0x202bd8(0x8c)+a4_0x362182[_0x202bd8(0x7d)](_0x202bd8(0xb0))+'\x20=\x20'+a4_0x362182[_0x202bd8(0x76)](_0x277d83['projectName']))),0x0;if(!_0x3e9543&&!_0xc00d91){if(!isInteractive())return console['error'](a4_0x362182['red'](_0x202bd8(0xf4)),_0x202bd8(0xca)),console[_0x202bd8(0x9a)](a4_0x362182[_0x202bd8(0x7d)](_0x202bd8(0x8d))),0x1;const _0x3dff80=await confirmKey(_0x202bd8(0x87)+(_0x1a1036+_0x1dfd75)+_0x202bd8(0xbd));if(!_0x3dff80)return console['log'](a4_0x362182[_0x202bd8(0x80)](_0x202bd8(0x79)),'-\x20no\x20files\x20written'),0x1;}const {data:_0x58bbc4}=await withSpinner(_0x202bd8(0xf9),()=>_0x26a8ba[_0x202bd8(0x65)][_0x202bd8(0xf8)](_0x6e8001,_0x40c2be,{'force':_0xc00d91}));return console['log'](a4_0x362182['green'](_0x202bd8(0x105)+(_0x1a1036+_0x1dfd75)+_0x202bd8(0xc0)+_0x58bbc4[_0x202bd8(0xef)])),saveSessionContext({'llm_project':_0x58bbc4[_0x202bd8(0x101)]},_0x22f005['session']),console[_0x202bd8(0xba)](a4_0x362182[_0x202bd8(0xcf)](_0x202bd8(0x8c)+a4_0x362182['dim'](_0x202bd8(0xb0))+_0x202bd8(0xdd)+a4_0x362182['cyan'](_0x58bbc4[_0x202bd8(0x101)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']=a4_0x24ee34(0xdf);['description']='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async['execute'](_0x15014a){const _0x3dfa20=a4_0x24ee34,{options:_0x1c0ad5,args:_0x314beb,tdx:_0x2d49cc}=_0x15014a,_0x2a3f4b=_0x314beb[0x0],_0x53da33=_0x1c0ad5[_0x3dfa20(0xac)],_0x41e315=_0x1c0ad5[_0x3dfa20(0x9c)],_0x1f4216=_0x1c0ad5['yes'],_0x4657a7=_0x1c0ad5['site'],_0x21166c=_0x1c0ad5[_0x3dfa20(0xad)];let _0x581b9e;const _0x186c64=findAgentConfigPath(process[_0x3dfa20(0xb6)]());if(_0x2a3f4b){const _0x45782c=a4_0x41f431[_0x3dfa20(0x98)](_0x2a3f4b,_0x3dfa20(0xbf));existsSync(_0x45782c)?(_0x581b9e=_0x2a3f4b,console[_0x3dfa20(0xba)](a4_0x362182['dim'](_0x3dfa20(0xd9)+_0x2a3f4b))):_0x581b9e=_0x2a3f4b;}else{if(_0x186c64)_0x581b9e=a4_0x41f431[_0x3dfa20(0xec)](_0x186c64),console[_0x3dfa20(0xba)](a4_0x362182[_0x3dfa20(0x7d)](_0x3dfa20(0x84)+_0x581b9e));else{if(_0x21166c){const _0xfe75ce=sanitizeForFilesystem(_0x21166c);let _0x29cddb=_0xfe75ce,_0xf5d37b=a4_0x41f431['join'](process[_0x3dfa20(0xb6)](),_0x3dfa20(0xaa),_0xfe75ce,_0x3dfa20(0xbf));if(!existsSync(_0xf5d37b)){const _0x486081=normalizeName(_0x21166c),_0x4a72b8=a4_0x41f431[_0x3dfa20(0x98)](process[_0x3dfa20(0xb6)](),'agents',_0x486081,_0x3dfa20(0xbf));existsSync(_0x4a72b8)&&(_0x29cddb=_0x486081,_0xf5d37b=_0x4a72b8);}if(existsSync(_0xf5d37b))_0x581b9e=a4_0x41f431['dirname'](_0xf5d37b),console['log'](a4_0x362182[_0x3dfa20(0x7d)](_0x3dfa20(0xd9)+_0x581b9e));else{const _0x28cdcd=_0x1c0ad5['profile'];if(_0x28cdcd)throw new SDKError(ErrorCode[_0x3dfa20(0x100)],_0x3dfa20(0x7c)+_0x21166c+_0x3dfa20(0xc8),undefined,{'helpText':_0x3dfa20(0xbb)+_0x3dfa20(0xb8)+(_0x3dfa20(0xd8)+_0x21166c+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x29cddb+'\x20--name\x20'+(_0x53da33||_0x3dfa20(0xa9))+'\x20--profile\x20'+_0x28cdcd)});_0x581b9e=_0x21166c,console[_0x3dfa20(0xba)](a4_0x362182[_0x3dfa20(0x7d)](_0x3dfa20(0xf3)+_0x21166c));}}}}if(!_0x581b9e)return console[_0x3dfa20(0xba)](a4_0x362182[_0x3dfa20(0x80)](_0x3dfa20(0x89))),console[_0x3dfa20(0xba)]('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console['log'](_0x3dfa20(0xa1)),console[_0x3dfa20(0xba)](_0x3dfa20(0xe1)),console[_0x3dfa20(0xba)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x53da33)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],'New\x20project\x20name\x20is\x20required',undefined,{'helpText':_0x3dfa20(0x107)});if(!_0x1f4216&&!_0x41e315){if(!isInteractive())return console[_0x3dfa20(0x9a)](a4_0x362182['red'](_0x3dfa20(0xf4)),_0x3dfa20(0xca)),console[_0x3dfa20(0x9a)](a4_0x362182[_0x3dfa20(0x7d)](_0x3dfa20(0x8d))),0x1;const _0x141e91=await confirmKey(_0x3dfa20(0x97)+_0x581b9e+_0x3dfa20(0x69)+_0x53da33+'\x22?');if(!_0x141e91)return console[_0x3dfa20(0xba)](a4_0x362182[_0x3dfa20(0x80)](_0x3dfa20(0x79))),0x1;}const {data:_0x2e1869}=await withSpinner(_0x3dfa20(0x86)+_0x581b9e+_0x3dfa20(0xc2)+_0x53da33+'\x22...',()=>_0x2d49cc[_0x3dfa20(0x65)][_0x3dfa20(0x81)](_0x581b9e,_0x53da33,{'dryRun':_0x41e315}));if(_0x41e315)return console[_0x3dfa20(0xba)](a4_0x362182[_0x3dfa20(0x80)](_0x3dfa20(0x9f))),console[_0x3dfa20(0xba)](_0x3dfa20(0xc4)+_0x2e1869[_0x3dfa20(0xbe)]),console['log'](_0x3dfa20(0xbc)+_0x53da33),console[_0x3dfa20(0xba)](_0x3dfa20(0x102)),console[_0x3dfa20(0xba)]('\x20\x20Agents:\x20'+_0x2e1869[_0x3dfa20(0xdb)][_0x3dfa20(0xaa)][_0x3dfa20(0xd3)]),console[_0x3dfa20(0xba)]('\x20\x20Knowledge\x20Bases:\x20'+_0x2e1869[_0x3dfa20(0xdb)][_0x3dfa20(0x8f)][_0x3dfa20(0xd3)]),console[_0x3dfa20(0xba)](_0x3dfa20(0xc9)+_0x2e1869[_0x3dfa20(0xdb)][_0x3dfa20(0xe6)]['created']),0x0;const _0x10ed23=_0x2e1869[_0x3dfa20(0xdb)]['agents'][_0x3dfa20(0x96)]>0x0||_0x2e1869[_0x3dfa20(0xdb)][_0x3dfa20(0x8f)]['errors']>0x0||_0x2e1869[_0x3dfa20(0xdb)]['prompts'][_0x3dfa20(0x96)]>0x0;_0x10ed23?console[_0x3dfa20(0xba)](a4_0x362182['yellow']('Project\x20cloned\x20with\x20errors')):console[_0x3dfa20(0xba)](a4_0x362182['green'](_0x3dfa20(0xff)));console['log'](_0x3dfa20(0xc4)+_0x2e1869['sourceProjectName']),console[_0x3dfa20(0xba)](_0x3dfa20(0xbc)+_0x2e1869['newProjectName']),console[_0x3dfa20(0xba)](_0x3dfa20(0xa6)+_0x2e1869[_0x3dfa20(0xa3)]),console[_0x3dfa20(0xba)](),console[_0x3dfa20(0xba)](_0x3dfa20(0xb4)),console['log'](_0x3dfa20(0xde)+formatCountSummary(_0x2e1869[_0x3dfa20(0xdb)][_0x3dfa20(0xaa)])),console[_0x3dfa20(0xba)](_0x3dfa20(0xd7)+formatCountSummary(_0x2e1869[_0x3dfa20(0xdb)][_0x3dfa20(0x8f)])),console[_0x3dfa20(0xba)](_0x3dfa20(0xc9)+formatCountSummary(_0x2e1869[_0x3dfa20(0xdb)][_0x3dfa20(0xe6)])),console[_0x3dfa20(0xba)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x2e1869[_0x3dfa20(0xdb)][_0x3dfa20(0x7f)]));if(_0x10ed23){console['log'](),console[_0x3dfa20(0xba)](a4_0x362182['red']('Errors:'));for(const _0x2bae75 of _0x2e1869[_0x3dfa20(0xaa)]){_0x2bae75[_0x3dfa20(0xf6)]==='error'&&console[_0x3dfa20(0xba)](a4_0x362182[_0x3dfa20(0x71)]('\x20\x20Agent\x20\x22'+_0x2bae75[_0x3dfa20(0xfd)]+_0x3dfa20(0xe5)+_0x2bae75[_0x3dfa20(0x9a)]));}for(const _0x4a8f7a of _0x2e1869[_0x3dfa20(0x8f)]){_0x4a8f7a[_0x3dfa20(0xf6)]===_0x3dfa20(0x9a)&&console[_0x3dfa20(0xba)](a4_0x362182[_0x3dfa20(0x71)](_0x3dfa20(0x93)+_0x4a8f7a[_0x3dfa20(0xac)]+_0x3dfa20(0xe5)+_0x4a8f7a[_0x3dfa20(0x9a)]));}for(const _0x551ee4 of _0x2e1869[_0x3dfa20(0xe6)]){_0x551ee4['action']===_0x3dfa20(0x9a)&&console['log'](a4_0x362182[_0x3dfa20(0x71)](_0x3dfa20(0xfa)+_0x551ee4[_0x3dfa20(0xac)]+'\x22:\x20'+_0x551ee4[_0x3dfa20(0x9a)]));}for(const _0x50e305 of _0x2e1869[_0x3dfa20(0x7f)]){_0x50e305['action']===_0x3dfa20(0x9a)&&console[_0x3dfa20(0xba)](a4_0x362182[_0x3dfa20(0x71)](_0x3dfa20(0xb5)+_0x50e305[_0x3dfa20(0xac)]+_0x3dfa20(0xe5)+_0x50e305['error']));}return 0x1;}console[_0x3dfa20(0xba)]();const _0x14511a=getLLMProjectUrl(_0x4657a7,_0x2e1869['newProjectId']);return console[_0x3dfa20(0xba)](_0x3dfa20(0xc7)+a4_0x362182[_0x3dfa20(0x76)](_0x14511a)),0x0;}}export class AgentPushCommand extends BaseCommand{['name']=a4_0x24ee34(0xcd);['description']=a4_0x24ee34(0x78);async[a4_0x24ee34(0x103)](_0xfbc7e4){const _0x50f6b8=a4_0x24ee34,{options:_0x50b31f,args:_0x4e4cbe,tdx:_0x11799f}=_0xfbc7e4;let _0x419a9c=_0x4e4cbe[0x0]||process[_0x50f6b8(0xb6)]();const _0x252262=_0x50b31f[_0x50f6b8(0x9c)],_0x40fe6c=_0x50b31f[_0x50f6b8(0xb7)],_0x1d4b80=_0x50b31f['yes'],_0x283bda=_0x50b31f['site'],_0x49d9aa=a4_0x41f431['join'](_0x419a9c,'agent.yml'),_0x5d9e2a=existsSync(_0x49d9aa);if(_0x5d9e2a){const {data:_0x2408d3}=await withSpinner(_0x50f6b8(0xd0)+_0x419a9c+_0x50f6b8(0xce),()=>_0x11799f[_0x50f6b8(0x65)][_0x50f6b8(0xa7)](_0x419a9c,{'dryRun':_0x252262,'force':_0x40fe6c}));if(_0x252262)return console[_0x50f6b8(0xba)](a4_0x362182[_0x50f6b8(0x80)](_0x50f6b8(0x9f))),console[_0x50f6b8(0xba)]('Would\x20push\x20agent:\x20'+_0x2408d3[_0x50f6b8(0xfd)]),0x0;if(_0x2408d3[_0x50f6b8(0xf6)]===_0x50f6b8(0x9a))return console[_0x50f6b8(0xba)](a4_0x362182[_0x50f6b8(0x71)](_0x50f6b8(0xd4)+_0x2408d3[_0x50f6b8(0x9a)])),0x1;console[_0x50f6b8(0xba)](a4_0x362182[_0x50f6b8(0xcf)]('Agent\x20'+_0x2408d3[_0x50f6b8(0xf6)]+'\x20successfully')),console[_0x50f6b8(0xba)](_0x50f6b8(0x9e)+_0x2408d3[_0x50f6b8(0xfd)]);if(_0x2408d3[_0x50f6b8(0xe4)]&&_0x2408d3[_0x50f6b8(0xc1)]){const _0x5d41fe=getLLMAgentChatUrl(_0x283bda,_0x2408d3[_0x50f6b8(0xc1)],_0x2408d3[_0x50f6b8(0xe4)]);console[_0x50f6b8(0xba)](_0x50f6b8(0xa2)+a4_0x362182[_0x50f6b8(0x76)](_0x5d41fe));}return 0x0;}const _0x9686ce=_0x50b31f[_0x50f6b8(0xad)],_0x5f32b7=resolveProjectFromContext(_0x419a9c,_0x9686ce);if(_0x5f32b7[_0x50f6b8(0xcc)])_0x419a9c=_0x5f32b7[_0x50f6b8(0xb2)],_0x5f32b7[_0x50f6b8(0x8e)]==='context'&&console[_0x50f6b8(0xba)](a4_0x362182['dim']('Using\x20project:\x20'+_0x419a9c));else{let _0x3e8dea=_0x50f6b8(0xc6);_0x5f32b7[_0x50f6b8(0x8b)]===_0x50f6b8(0xf0)&&(_0x3e8dea=_0x5f32b7['message']+_0x50f6b8(0x8a)+_0x5f32b7[_0x50f6b8(0xad)]+_0x50f6b8(0xf5));throw new SDKError(ErrorCode[_0x50f6b8(0x100)],_0x5f32b7[_0x50f6b8(0x8b)]===_0x50f6b8(0xda)?_0x5f32b7[_0x50f6b8(0xaf)]:_0x50f6b8(0x6e)+_0x419a9c,undefined,{'helpText':_0x3e8dea});}const {data:_0x4ced9e}=await withSpinner(_0x50f6b8(0xd6),()=>_0x11799f['llm']['pushProject'](_0x419a9c,{'dryRun':!![]})),_0x4445e6=_0x4ced9e[_0x50f6b8(0xdb)][_0x50f6b8(0xaa)][_0x50f6b8(0x96)]>0x0;if(_0x4445e6){console['log'](a4_0x362182[_0x50f6b8(0x71)](_0x50f6b8(0x104)));for(const _0x312217 of _0x4ced9e[_0x50f6b8(0xaa)]){_0x312217[_0x50f6b8(0xf6)]===_0x50f6b8(0x9a)&&console[_0x50f6b8(0xba)](a4_0x362182['red'](_0x50f6b8(0x7e)+_0x312217[_0x50f6b8(0xfd)]+'\x22:\x20'+_0x312217[_0x50f6b8(0x9a)]));}return 0x1;}const _0x1b7aed=_0x4ced9e[_0x50f6b8(0xdb)]['agents'][_0x50f6b8(0xd3)]+_0x4ced9e[_0x50f6b8(0xdb)][_0x50f6b8(0x8f)][_0x50f6b8(0xd3)]+_0x4ced9e[_0x50f6b8(0xdb)][_0x50f6b8(0x6b)][_0x50f6b8(0xd3)]+_0x4ced9e[_0x50f6b8(0xdb)]['prompts'][_0x50f6b8(0xd3)]+_0x4ced9e[_0x50f6b8(0xdb)][_0x50f6b8(0x7f)][_0x50f6b8(0xd3)],_0x307e66=_0x4ced9e['counts']['agents'][_0x50f6b8(0xf2)]+_0x4ced9e[_0x50f6b8(0xdb)]['knowledgeBases'][_0x50f6b8(0xf2)]+_0x4ced9e['counts'][_0x50f6b8(0x6b)]['updated']+_0x4ced9e[_0x50f6b8(0xdb)]['prompts']['updated']+_0x4ced9e['counts']['integrations']['updated'],_0x173cc2=_0x4ced9e[_0x50f6b8(0xdb)]['agents']['unchanged']+_0x4ced9e[_0x50f6b8(0xdb)]['knowledgeBases']['unchanged']+_0x4ced9e[_0x50f6b8(0xdb)][_0x50f6b8(0x6b)]['unchanged']+_0x4ced9e['counts'][_0x50f6b8(0xe6)][_0x50f6b8(0xdc)]+_0x4ced9e[_0x50f6b8(0xdb)][_0x50f6b8(0x7f)][_0x50f6b8(0xdc)];console[_0x50f6b8(0xba)](_0x50f6b8(0x6f)+_0x4ced9e[_0x50f6b8(0x101)]+'\x27:'),console[_0x50f6b8(0xba)]('\x20\x20'+a4_0x362182[_0x50f6b8(0xcf)]('+\x20'+_0x1b7aed+_0x50f6b8(0xeb))+_0x50f6b8(0x85)+a4_0x362182[_0x50f6b8(0x80)]('~\x20'+_0x307e66+_0x50f6b8(0xe7))+_0x50f6b8(0x85)+a4_0x362182[_0x50f6b8(0x7d)]('=\x20'+_0x173cc2+_0x50f6b8(0x72))),console[_0x50f6b8(0xba)]('\x20\x20Agents:\x20'+formatCountSummary(_0x4ced9e[_0x50f6b8(0xdb)][_0x50f6b8(0xaa)])),console[_0x50f6b8(0xba)](_0x50f6b8(0xd7)+formatCountSummary(_0x4ced9e['counts'][_0x50f6b8(0x8f)])),console[_0x50f6b8(0xba)](_0x50f6b8(0x99)+formatCountSummary(_0x4ced9e[_0x50f6b8(0xdb)][_0x50f6b8(0x6b)])),console[_0x50f6b8(0xba)](_0x50f6b8(0xc9)+formatCountSummary(_0x4ced9e[_0x50f6b8(0xdb)][_0x50f6b8(0xe6)])),console[_0x50f6b8(0xba)](_0x50f6b8(0xfe)+formatCountSummary(_0x4ced9e[_0x50f6b8(0xdb)][_0x50f6b8(0x7f)])),console[_0x50f6b8(0xba)]('\x20\x20Source:\x20'+a4_0x362182[_0x50f6b8(0x76)](_0x419a9c)),displayDiffs(_0x4ced9e['agents'],_0x4ced9e[_0x50f6b8(0x8f)],_0x4ced9e[_0x50f6b8(0x6b)],_0x4ced9e[_0x50f6b8(0xe6)],_0x4ced9e['integrations']);if(_0x252262)return console[_0x50f6b8(0xba)](a4_0x362182['yellow']('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x1b7aed===0x0&&_0x307e66===0x0){console['log'](a4_0x362182[_0x50f6b8(0xcf)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x811b7=getLLMProjectUrl(_0x283bda,_0x4ced9e['projectId']);return console['log'](_0x50f6b8(0xc7)+a4_0x362182['cyan'](_0x811b7)),0x0;}if(!_0x1d4b80&&!_0x40fe6c){if(!isInteractive())return console[_0x50f6b8(0x9a)](a4_0x362182['red'](_0x50f6b8(0xf4)),_0x50f6b8(0xca)),console[_0x50f6b8(0x9a)](a4_0x362182['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4d13d5=await confirmKey(_0x50f6b8(0xb9)+(_0x1b7aed+_0x307e66)+_0x50f6b8(0x106));if(!_0x4d13d5)return console['log'](a4_0x362182[_0x50f6b8(0x80)](_0x50f6b8(0x79)),_0x50f6b8(0x90)),0x1;}const {data:_0x2467b7}=await withSpinner(_0x50f6b8(0x91),()=>_0x11799f[_0x50f6b8(0x65)][_0x50f6b8(0xee)](_0x419a9c,{'force':_0x40fe6c})),_0x517f65=_0x2467b7[_0x50f6b8(0xdb)][_0x50f6b8(0xaa)][_0x50f6b8(0x96)]>0x0||_0x2467b7['counts'][_0x50f6b8(0x8f)][_0x50f6b8(0x96)]>0x0||_0x2467b7['counts'][_0x50f6b8(0x6b)][_0x50f6b8(0x96)]>0x0||_0x2467b7[_0x50f6b8(0xdb)]['prompts']['errors']>0x0;if(_0x517f65){console[_0x50f6b8(0xba)](a4_0x362182[_0x50f6b8(0x80)](_0x50f6b8(0xed))),console[_0x50f6b8(0xba)](),console['log'](a4_0x362182['red'](_0x50f6b8(0x68)));for(const _0xc93781 of _0x2467b7['agents']){_0xc93781[_0x50f6b8(0xf6)]===_0x50f6b8(0x9a)&&console[_0x50f6b8(0xba)](a4_0x362182[_0x50f6b8(0x71)](_0x50f6b8(0x7e)+_0xc93781[_0x50f6b8(0xfd)]+'\x22:\x20'+_0xc93781[_0x50f6b8(0x9a)]));}for(const _0x26604c of _0x2467b7[_0x50f6b8(0x8f)]){_0x26604c[_0x50f6b8(0xf6)]===_0x50f6b8(0x9a)&&console[_0x50f6b8(0xba)](a4_0x362182[_0x50f6b8(0x71)](_0x50f6b8(0x93)+_0x26604c[_0x50f6b8(0xac)]+'\x22:\x20'+_0x26604c[_0x50f6b8(0x9a)]));}for(const _0x18149a of _0x2467b7[_0x50f6b8(0x6b)]){_0x18149a['action']===_0x50f6b8(0x9a)&&console[_0x50f6b8(0xba)](a4_0x362182[_0x50f6b8(0x71)]('\x20\x20Text\x20Knowledge\x20Base\x20\x22'+_0x18149a['name']+_0x50f6b8(0xe5)+_0x18149a[_0x50f6b8(0x9a)]));}for(const _0x183251 of _0x2467b7[_0x50f6b8(0xe6)]){_0x183251[_0x50f6b8(0xf6)]===_0x50f6b8(0x9a)&&console[_0x50f6b8(0xba)](a4_0x362182[_0x50f6b8(0x71)]('\x20\x20Prompt\x20\x22'+_0x183251[_0x50f6b8(0xac)]+_0x50f6b8(0xe5)+_0x183251[_0x50f6b8(0x9a)]));}for(const _0x261c3d of _0x2467b7[_0x50f6b8(0x7f)]){_0x261c3d[_0x50f6b8(0xf6)]===_0x50f6b8(0x9a)&&console[_0x50f6b8(0xba)](a4_0x362182[_0x50f6b8(0x71)](_0x50f6b8(0xb5)+_0x261c3d[_0x50f6b8(0xac)]+_0x50f6b8(0xe5)+_0x261c3d[_0x50f6b8(0x9a)]));}return 0x1;}console[_0x50f6b8(0xba)](a4_0x362182[_0x50f6b8(0xcf)]('\x0a✔\x20Pushed\x20'+(_0x1b7aed+_0x307e66)+'\x20resources\x20to\x20\x27'+_0x2467b7[_0x50f6b8(0x101)]+'\x27'));const _0x14370b=getLLMProjectUrl(_0x283bda,_0x2467b7['projectId']);return console[_0x50f6b8(0xba)](_0x50f6b8(0xc7)+a4_0x362182[_0x50f6b8(0x76)](_0x14370b)),0x0;}}
|
|
1
|
+
const a4_0x283f9c=a4_0x2a42;(function(_0x4dad03,_0x4f232c){const _0x5a31c9=a4_0x2a42,_0xfba53a=_0x4dad03();while(!![]){try{const _0x46d438=-parseInt(_0x5a31c9(0x160))/0x1*(-parseInt(_0x5a31c9(0xda))/0x2)+parseInt(_0x5a31c9(0xd1))/0x3+-parseInt(_0x5a31c9(0x139))/0x4*(parseInt(_0x5a31c9(0x130))/0x5)+-parseInt(_0x5a31c9(0x12c))/0x6*(parseInt(_0x5a31c9(0x138))/0x7)+parseInt(_0x5a31c9(0x156))/0x8+-parseInt(_0x5a31c9(0x126))/0x9+parseInt(_0x5a31c9(0xf1))/0xa;if(_0x46d438===_0x4f232c)break;else _0xfba53a['push'](_0xfba53a['shift']());}catch(_0x38b686){_0xfba53a['push'](_0xfba53a['shift']());}}}(a4_0x7aa2,0x22957));import a4_0x2503c1 from'chalk';function a4_0x2a42(_0x1c8722,_0xf5ea54){_0x1c8722=_0x1c8722-0xbb;const _0x7aa21=a4_0x7aa2();let _0x2a42f5=_0x7aa21[_0x1c8722];return _0x2a42f5;}import a4_0x17b288 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(_0x5f0fcb){const _0x92c502=a4_0x2a42,_0x367537=[];if(_0x5f0fcb[_0x92c502(0xe7)]!==undefined)_0x367537['push'](_0x5f0fcb[_0x92c502(0xe7)]+'\x20total');if(_0x5f0fcb[_0x92c502(0x134)]!==undefined&&_0x5f0fcb['new']>0x0)_0x367537[_0x92c502(0x135)](a4_0x2503c1['green'](_0x5f0fcb['new']+_0x92c502(0xfe)));if(_0x5f0fcb[_0x92c502(0xcb)]!==undefined&&_0x5f0fcb[_0x92c502(0xcb)]>0x0)_0x367537[_0x92c502(0x135)](a4_0x2503c1['green'](_0x5f0fcb[_0x92c502(0xcb)]+_0x92c502(0xe3)));if(_0x5f0fcb['updated']!==undefined&&_0x5f0fcb['updated']>0x0)_0x367537['push'](a4_0x2503c1[_0x92c502(0x12d)](_0x5f0fcb[_0x92c502(0xd2)]+'\x20updated'));if(_0x5f0fcb['unchanged']!==undefined&&_0x5f0fcb[_0x92c502(0x15b)]>0x0)_0x367537[_0x92c502(0x135)](a4_0x2503c1[_0x92c502(0xf6)](_0x5f0fcb[_0x92c502(0x15b)]+'\x20unchanged'));if(_0x5f0fcb[_0x92c502(0x120)]!==undefined&&_0x5f0fcb[_0x92c502(0x120)]>0x0)_0x367537[_0x92c502(0x135)](a4_0x2503c1[_0x92c502(0x119)](_0x5f0fcb[_0x92c502(0x120)]+_0x92c502(0x144)));return _0x367537['join'](',\x20');}function displayDiffs(_0x5d5c81,_0x1f0057,_0x5c0c24,_0x5e9358,_0x321e01=[]){const _0x736f04=a4_0x2a42;for(const _0x257347 of _0x5d5c81){if(_0x257347[_0x736f04(0x118)]){const _0x3b9dae=_0x257347[_0x736f04(0x103)]||_0x257347[_0x736f04(0xe5)];console[_0x736f04(0xbf)]('\x0aChanges\x20to\x20agent\x20\x27'+_0x3b9dae+'\x27:'),console[_0x736f04(0xbf)]('─'[_0x736f04(0xc6)](0x3c)),console[_0x736f04(0xbf)](_0x257347[_0x736f04(0x118)]),console[_0x736f04(0xbf)]('─'[_0x736f04(0xc6)](0x3c));}}for(const _0x368a81 of _0x1f0057){_0x368a81[_0x736f04(0x118)]&&(console[_0x736f04(0xbf)]('\x0aChanges\x20to\x20knowledge\x20base\x20\x27'+_0x368a81[_0x736f04(0xe5)]+'\x27:'),console[_0x736f04(0xbf)]('─'[_0x736f04(0xc6)](0x3c)),console[_0x736f04(0xbf)](_0x368a81[_0x736f04(0x118)]),console[_0x736f04(0xbf)]('─'[_0x736f04(0xc6)](0x3c)));}for(const _0x37425a of _0x5c0c24){_0x37425a[_0x736f04(0x118)]&&(console[_0x736f04(0xbf)](_0x736f04(0x10a)+_0x37425a['name']+'\x27:'),console['log']('─'[_0x736f04(0xc6)](0x3c)),console[_0x736f04(0xbf)](_0x37425a[_0x736f04(0x118)]),console['log']('─'['repeat'](0x3c)));}for(const _0x1a241a of _0x5e9358){_0x1a241a['diff']&&(console['log'](_0x736f04(0xf8)+_0x1a241a[_0x736f04(0xe5)]+'\x27:'),console[_0x736f04(0xbf)]('─'[_0x736f04(0xc6)](0x3c)),console[_0x736f04(0xbf)](_0x1a241a['diff']),console[_0x736f04(0xbf)]('─'[_0x736f04(0xc6)](0x3c)));}for(const _0x11542b of _0x321e01){_0x11542b[_0x736f04(0x118)]&&(console[_0x736f04(0xbf)]('\x0aChanges\x20to\x20integration\x20\x27'+_0x11542b[_0x736f04(0xe5)]+'\x27:'),console[_0x736f04(0xbf)]('─'[_0x736f04(0xc6)](0x3c)),console[_0x736f04(0xbf)](_0x11542b[_0x736f04(0x118)]),console[_0x736f04(0xbf)]('─'[_0x736f04(0xc6)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x283f9c(0xe5)]=a4_0x283f9c(0x149);['description']=a4_0x283f9c(0x133);async[a4_0x283f9c(0xd6)](_0x148744){const _0x21d6d5=a4_0x283f9c,{options:_0x36edd9,args:_0x2374fd,tdx:_0x53842c}=_0x148744,_0x1a17d2=_0x2374fd[0x0],_0x1d8312=_0x2374fd[0x1],_0x54c79f=_0x36edd9['output'],_0x111f41=_0x36edd9[_0x21d6d5(0xca)],_0x555418=_0x36edd9[_0x21d6d5(0xc4)],_0x5a47bf=_0x36edd9[_0x21d6d5(0xf9)],_0x4cc6ce=_0x36edd9[_0x21d6d5(0xc0)];let _0x1fb0b1,_0x403d85;const _0x3afbf2=findAgentConfigPath(process[_0x21d6d5(0x159)]());if(_0x1a17d2){const _0x5cbaa3=a4_0x17b288[_0x21d6d5(0xcc)](_0x1a17d2,_0x21d6d5(0xc7));if(existsSync(_0x5cbaa3))try{const _0x29feca=JSON['parse'](readFileSync(_0x5cbaa3,'utf-8'));_0x1fb0b1=_0x29feca[_0x21d6d5(0x128)],_0x403d85=_0x1a17d2,console[_0x21d6d5(0xbf)](a4_0x2503c1[_0x21d6d5(0x104)]('Using\x20project\x20from\x20'+_0x5cbaa3+':\x20'+_0x1fb0b1));}catch{_0x1fb0b1=_0x1a17d2;}else _0x1fb0b1=_0x1a17d2;}else{if(_0x3afbf2)try{const _0x3e3287=JSON['parse'](readFileSync(_0x3afbf2,_0x21d6d5(0x14d)));_0x1fb0b1=_0x3e3287[_0x21d6d5(0x128)],_0x403d85=a4_0x17b288[_0x21d6d5(0x13f)](_0x3afbf2),console[_0x21d6d5(0xbf)](a4_0x2503c1[_0x21d6d5(0x104)](_0x21d6d5(0x152)+_0x1fb0b1));}catch{_0x1fb0b1=_0x4cc6ce;}else _0x1fb0b1=_0x4cc6ce;}if(!_0x1fb0b1)return console['log'](a4_0x2503c1[_0x21d6d5(0x12d)](_0x21d6d5(0xc8))),console[_0x21d6d5(0xbf)](_0x21d6d5(0x11f)),console['log'](_0x21d6d5(0x150)),console[_0x21d6d5(0xbf)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory'),console[_0x21d6d5(0xbf)](_0x21d6d5(0x109)),0x1;if(_0x1d8312){const {data:_0x32ffd8}=await withSpinner(_0x21d6d5(0x145)+_0x1d8312+'\x22\x20from\x20project\x20\x22'+_0x1fb0b1+_0x21d6d5(0x12b),()=>_0x53842c[_0x21d6d5(0x125)][_0x21d6d5(0xbb)](_0x1fb0b1,_0x1d8312,_0x54c79f,{'dryRun':_0x111f41,'force':_0x555418}));if(_0x111f41)return console['log'](a4_0x2503c1[_0x21d6d5(0x12d)](_0x21d6d5(0xfc))),console[_0x21d6d5(0xbf)](_0x21d6d5(0x15f)+_0x32ffd8[_0x21d6d5(0x103)]),console[_0x21d6d5(0xbf)]('Output\x20path:\x20'+_0x32ffd8[_0x21d6d5(0xee)]),_0x32ffd8['diff']&&(console['log'](_0x21d6d5(0xbd)),console[_0x21d6d5(0xbf)]('─'[_0x21d6d5(0xc6)](0x3c)),console[_0x21d6d5(0xbf)](_0x32ffd8[_0x21d6d5(0x118)]),console[_0x21d6d5(0xbf)]('─'[_0x21d6d5(0xc6)](0x3c))),0x0;return console['log'](a4_0x2503c1[_0x21d6d5(0x100)](_0x21d6d5(0x129))),console[_0x21d6d5(0xbf)](_0x21d6d5(0x137)+_0x32ffd8[_0x21d6d5(0x103)]),console[_0x21d6d5(0xbf)](_0x21d6d5(0xcf)+_0x32ffd8[_0x21d6d5(0xee)]),console['log'](_0x21d6d5(0x115)+(_0x32ffd8['isNew']?a4_0x2503c1[_0x21d6d5(0x100)](_0x21d6d5(0x134)):_0x32ffd8[_0x21d6d5(0x122)]?a4_0x2503c1[_0x21d6d5(0x12d)](_0x21d6d5(0xd2)):a4_0x2503c1['gray'](_0x21d6d5(0x15b)))),0x0;}const _0x49c62d=_0x403d85||_0x54c79f,{data:_0x4a7a65}=await withSpinner('Analyzing\x20project\x20\x22'+_0x1fb0b1+_0x21d6d5(0x12b),()=>_0x53842c[_0x21d6d5(0x125)][_0x21d6d5(0x11d)](_0x1fb0b1,_0x49c62d,{'dryRun':!![]})),_0x7cfc95=_0x4a7a65[_0x21d6d5(0x11e)]['agents'][_0x21d6d5(0x134)]+_0x4a7a65[_0x21d6d5(0x11e)][_0x21d6d5(0x13a)][_0x21d6d5(0x134)]+_0x4a7a65[_0x21d6d5(0x11e)]['textKnowledgeBases'][_0x21d6d5(0x134)]+_0x4a7a65['counts'][_0x21d6d5(0x158)][_0x21d6d5(0x134)]+_0x4a7a65[_0x21d6d5(0x11e)][_0x21d6d5(0x12a)][_0x21d6d5(0x134)],_0x5b73b9=_0x4a7a65['counts']['agents'][_0x21d6d5(0xd2)]+_0x4a7a65['counts'][_0x21d6d5(0x13a)][_0x21d6d5(0xd2)]+_0x4a7a65[_0x21d6d5(0x11e)][_0x21d6d5(0x112)][_0x21d6d5(0xd2)]+_0x4a7a65['counts'][_0x21d6d5(0x158)][_0x21d6d5(0xd2)]+_0x4a7a65[_0x21d6d5(0x11e)][_0x21d6d5(0x12a)][_0x21d6d5(0xd2)],_0xf03cdf=_0x4a7a65[_0x21d6d5(0x11e)]['agents'][_0x21d6d5(0x15b)]+_0x4a7a65[_0x21d6d5(0x11e)][_0x21d6d5(0x13a)][_0x21d6d5(0x15b)]+_0x4a7a65[_0x21d6d5(0x11e)][_0x21d6d5(0x112)]['unchanged']+_0x4a7a65[_0x21d6d5(0x11e)]['prompts'][_0x21d6d5(0x15b)]+_0x4a7a65[_0x21d6d5(0x11e)]['integrations'][_0x21d6d5(0x15b)];console[_0x21d6d5(0xbf)](_0x21d6d5(0x15e)+_0x4a7a65[_0x21d6d5(0x140)]+'\x27:'),console[_0x21d6d5(0xbf)]('\x20\x20'+a4_0x2503c1[_0x21d6d5(0x100)]('+\x20'+_0x7cfc95+'\x20new')+_0x21d6d5(0x11a)+a4_0x2503c1[_0x21d6d5(0x12d)]('~\x20'+_0x5b73b9+'\x20changed')+_0x21d6d5(0x11a)+a4_0x2503c1[_0x21d6d5(0x104)]('=\x20'+_0xf03cdf+_0x21d6d5(0xe6))),console[_0x21d6d5(0xbf)](_0x21d6d5(0xc9)+formatCountSummary(_0x4a7a65['counts'][_0x21d6d5(0xff)])),console[_0x21d6d5(0xbf)](_0x21d6d5(0x136)+formatCountSummary(_0x4a7a65[_0x21d6d5(0x11e)][_0x21d6d5(0x13a)])),console[_0x21d6d5(0xbf)](_0x21d6d5(0xbc)+formatCountSummary(_0x4a7a65[_0x21d6d5(0x11e)][_0x21d6d5(0x112)])),console[_0x21d6d5(0xbf)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x4a7a65[_0x21d6d5(0x11e)]['prompts'])),console[_0x21d6d5(0xbf)](_0x21d6d5(0xc3)+formatCountSummary(_0x4a7a65[_0x21d6d5(0x11e)][_0x21d6d5(0x12a)])),console[_0x21d6d5(0xbf)](_0x21d6d5(0xd9)+a4_0x2503c1[_0x21d6d5(0xde)](_0x4a7a65['outputDir'])),displayDiffs(_0x4a7a65[_0x21d6d5(0xff)],_0x4a7a65['knowledgeBases'],_0x4a7a65[_0x21d6d5(0x112)],_0x4a7a65[_0x21d6d5(0x158)],_0x4a7a65[_0x21d6d5(0x12a)]);if(_0x111f41)return console[_0x21d6d5(0xbf)](a4_0x2503c1[_0x21d6d5(0x12d)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x7cfc95===0x0&&_0x5b73b9===0x0)return console[_0x21d6d5(0xbf)](a4_0x2503c1[_0x21d6d5(0x100)](_0x21d6d5(0xdd))),saveSessionContext({'llm_project':_0x4a7a65[_0x21d6d5(0x140)]},_0x36edd9['session']),console[_0x21d6d5(0xbf)](a4_0x2503c1[_0x21d6d5(0x100)](_0x21d6d5(0x154)+a4_0x2503c1[_0x21d6d5(0x104)]('llm_project')+_0x21d6d5(0x121)+a4_0x2503c1['cyan'](_0x4a7a65[_0x21d6d5(0x140)]))),0x0;if(!_0x5a47bf&&!_0x555418){if(!isInteractive())return console[_0x21d6d5(0xe0)](a4_0x2503c1['red'](_0x21d6d5(0x10c)),_0x21d6d5(0xf7)),console[_0x21d6d5(0xe0)](a4_0x2503c1[_0x21d6d5(0x104)](_0x21d6d5(0x14a))),0x1;const _0x566911=await confirmKey('\x0aWrite\x20'+(_0x7cfc95+_0x5b73b9)+_0x21d6d5(0x13c));if(!_0x566911)return console['log'](a4_0x2503c1[_0x21d6d5(0x12d)]('Cancelled'),_0x21d6d5(0xce)),0x1;}const {data:_0x4a48be}=await withSpinner('Writing\x20files...',()=>_0x53842c[_0x21d6d5(0x125)][_0x21d6d5(0x11d)](_0x1fb0b1,_0x49c62d,{'force':_0x555418}));return console[_0x21d6d5(0xbf)](a4_0x2503c1[_0x21d6d5(0x100)]('\x0a✔\x20Pulled\x20'+(_0x7cfc95+_0x5b73b9)+'\x20files\x20to\x20'+_0x4a48be['outputDir'])),saveSessionContext({'llm_project':_0x4a48be[_0x21d6d5(0x140)]},_0x36edd9[_0x21d6d5(0x161)]),console[_0x21d6d5(0xbf)](a4_0x2503c1[_0x21d6d5(0x100)](_0x21d6d5(0x154)+a4_0x2503c1[_0x21d6d5(0x104)](_0x21d6d5(0x128))+_0x21d6d5(0x121)+a4_0x2503c1[_0x21d6d5(0xde)](_0x4a48be[_0x21d6d5(0x140)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x283f9c(0xe5)]=a4_0x283f9c(0xdb);[a4_0x283f9c(0xd0)]=a4_0x283f9c(0x148);async[a4_0x283f9c(0xd6)](_0x4ea1e7){const _0x210990=a4_0x283f9c,{options:_0x293821,args:_0x3714a1,tdx:_0x1bebfb}=_0x4ea1e7,_0x3119cf=_0x3714a1[0x0],_0x288f77=_0x293821[_0x210990(0xe5)],_0x4c57e5=_0x293821[_0x210990(0xca)],_0x4b555a=_0x293821[_0x210990(0xf9)],_0x405267=_0x293821[_0x210990(0xf5)],_0x5bafd0=_0x293821[_0x210990(0xc0)];let _0x4e0e2e;const _0x14c329=findAgentConfigPath(process[_0x210990(0x159)]());if(_0x3119cf){const _0x5572f7=a4_0x17b288[_0x210990(0xcc)](_0x3119cf,_0x210990(0xc7));existsSync(_0x5572f7)?(_0x4e0e2e=_0x3119cf,console[_0x210990(0xbf)](a4_0x2503c1[_0x210990(0x104)]('Using\x20local\x20project:\x20'+_0x3119cf))):_0x4e0e2e=_0x3119cf;}else{if(_0x14c329)_0x4e0e2e=a4_0x17b288[_0x210990(0x13f)](_0x14c329),console['log'](a4_0x2503c1[_0x210990(0x104)](_0x210990(0xeb)+_0x4e0e2e));else{if(_0x5bafd0){const _0x26fcb7=sanitizeForFilesystem(_0x5bafd0);let _0x488aab=_0x26fcb7,_0x44454d=a4_0x17b288[_0x210990(0xcc)](process[_0x210990(0x159)](),_0x210990(0xff),_0x26fcb7,'tdx.json');if(!existsSync(_0x44454d)){const _0x20f5b1=normalizeName(_0x5bafd0),_0x27930f=a4_0x17b288[_0x210990(0xcc)](process[_0x210990(0x159)](),_0x210990(0xff),_0x20f5b1,_0x210990(0xc7));existsSync(_0x27930f)&&(_0x488aab=_0x20f5b1,_0x44454d=_0x27930f);}if(existsSync(_0x44454d))_0x4e0e2e=a4_0x17b288[_0x210990(0x13f)](_0x44454d),console['log'](a4_0x2503c1[_0x210990(0x104)](_0x210990(0x102)+_0x4e0e2e));else{const _0x5d9b4b=_0x293821[_0x210990(0xc1)];if(_0x5d9b4b)throw new SDKError(ErrorCode[_0x210990(0x162)],_0x210990(0x11b)+_0x5bafd0+_0x210990(0xe1),undefined,{'helpText':_0x210990(0xe4)+_0x210990(0xfb)+(_0x210990(0xbe)+_0x5bafd0+'\x0a')+(_0x210990(0x131)+_0x488aab+_0x210990(0x142)+(_0x288f77||_0x210990(0x12f))+_0x210990(0x101)+_0x5d9b4b)});_0x4e0e2e=_0x5bafd0,console['log'](a4_0x2503c1[_0x210990(0x104)](_0x210990(0x10e)+_0x5bafd0));}}}}if(!_0x4e0e2e)return console[_0x210990(0xbf)](a4_0x2503c1['yellow'](_0x210990(0x117))),console[_0x210990(0xbf)](_0x210990(0x15c)),console[_0x210990(0xbf)](_0x210990(0x132)),console['log']('\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[_0x210990(0xbf)](_0x210990(0xd7)),0x1;if(!_0x288f77)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x210990(0xd8),undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0x4b555a&&!_0x4c57e5){if(!isInteractive())return console[_0x210990(0xe0)](a4_0x2503c1[_0x210990(0x119)](_0x210990(0x10c)),_0x210990(0xf7)),console[_0x210990(0xe0)](a4_0x2503c1['dim'](_0x210990(0x14a))),0x1;const _0x5911a6=await confirmKey(_0x210990(0xd4)+_0x4e0e2e+_0x210990(0xed)+_0x288f77+'\x22?');if(!_0x5911a6)return console[_0x210990(0xbf)](a4_0x2503c1['yellow'](_0x210990(0x13d))),0x1;}const {data:_0x8a377b}=await withSpinner('Cloning\x20\x22'+_0x4e0e2e+_0x210990(0xc2)+_0x288f77+'\x22...',()=>_0x1bebfb[_0x210990(0x125)][_0x210990(0xf4)](_0x4e0e2e,_0x288f77,{'dryRun':_0x4c57e5}));if(_0x4c57e5)return console[_0x210990(0xbf)](a4_0x2503c1[_0x210990(0x12d)](_0x210990(0xe9))),console[_0x210990(0xbf)](_0x210990(0x105)+_0x8a377b['sourceProjectName']),console[_0x210990(0xbf)](_0x210990(0xf2)+_0x288f77),console[_0x210990(0xbf)]('Would\x20clone:'),console['log'](_0x210990(0xc9)+_0x8a377b['counts'][_0x210990(0xff)][_0x210990(0xcb)]),console[_0x210990(0xbf)](_0x210990(0x136)+_0x8a377b[_0x210990(0x11e)][_0x210990(0x13a)][_0x210990(0xcb)]),console[_0x210990(0xbf)]('\x20\x20Prompts:\x20'+_0x8a377b['counts']['prompts']['created']),0x0;const _0x6043bc=_0x8a377b[_0x210990(0x11e)][_0x210990(0xff)][_0x210990(0x120)]>0x0||_0x8a377b[_0x210990(0x11e)][_0x210990(0x13a)][_0x210990(0x120)]>0x0||_0x8a377b['counts']['prompts'][_0x210990(0x120)]>0x0;_0x6043bc?console[_0x210990(0xbf)](a4_0x2503c1[_0x210990(0x12d)](_0x210990(0x110))):console[_0x210990(0xbf)](a4_0x2503c1['green'](_0x210990(0xe8)));console[_0x210990(0xbf)]('Source:\x20'+_0x8a377b['sourceProjectName']),console[_0x210990(0xbf)]('New\x20project:\x20'+_0x8a377b[_0x210990(0x157)]),console['log'](_0x210990(0xef)+_0x8a377b['newProjectId']),console[_0x210990(0xbf)](),console[_0x210990(0xbf)](_0x210990(0x10f)),console[_0x210990(0xbf)]('\x20\x20Agents:\x20'+formatCountSummary(_0x8a377b[_0x210990(0x11e)]['agents'])),console[_0x210990(0xbf)](_0x210990(0x136)+formatCountSummary(_0x8a377b['counts'][_0x210990(0x13a)])),console[_0x210990(0xbf)](_0x210990(0x116)+formatCountSummary(_0x8a377b[_0x210990(0x11e)][_0x210990(0x158)])),console['log'](_0x210990(0xc3)+formatCountSummary(_0x8a377b['counts']['integrations']));if(_0x6043bc){console[_0x210990(0xbf)](),console[_0x210990(0xbf)](a4_0x2503c1['red'](_0x210990(0xf3)));for(const _0x4c3cc5 of _0x8a377b[_0x210990(0xff)]){_0x4c3cc5[_0x210990(0x14f)]==='error'&&console['log'](a4_0x2503c1[_0x210990(0x119)](_0x210990(0x13b)+_0x4c3cc5[_0x210990(0x103)]+_0x210990(0x15a)+_0x4c3cc5[_0x210990(0xe0)]));}for(const _0x43426e of _0x8a377b[_0x210990(0x13a)]){_0x43426e[_0x210990(0x14f)]===_0x210990(0xe0)&&console['log'](a4_0x2503c1[_0x210990(0x119)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x43426e[_0x210990(0xe5)]+'\x22:\x20'+_0x43426e[_0x210990(0xe0)]));}for(const _0x1073a9 of _0x8a377b[_0x210990(0x158)]){_0x1073a9['action']===_0x210990(0xe0)&&console[_0x210990(0xbf)](a4_0x2503c1[_0x210990(0x119)]('\x20\x20Prompt\x20\x22'+_0x1073a9[_0x210990(0xe5)]+_0x210990(0x15a)+_0x1073a9[_0x210990(0xe0)]));}for(const _0x550a68 of _0x8a377b[_0x210990(0x12a)]){_0x550a68[_0x210990(0x14f)]===_0x210990(0xe0)&&console[_0x210990(0xbf)](a4_0x2503c1[_0x210990(0x119)](_0x210990(0x14b)+_0x550a68['name']+'\x22:\x20'+_0x550a68[_0x210990(0xe0)]));}return 0x1;}console[_0x210990(0xbf)]();const _0x1e3d34=getLLMProjectUrl(_0x405267,_0x8a377b[_0x210990(0x14c)]);return console[_0x210990(0xbf)](_0x210990(0x143)+a4_0x2503c1['cyan'](_0x1e3d34)),0x0;}}function a4_0x7aa2(){const _0x570d07=['✔\x20Context\x20set:\x20','pushProject','1032856eujkaZ','newProjectName','prompts','cwd','\x22:\x20','unchanged','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','reason','\x0aPull\x20summary\x20for\x20\x27','Would\x20pull\x20agent:\x20','375fKAYod','session','INVALID_ARGUMENT','pullAgent','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x0aChanges:','\x20\x20tdx\x20agent\x20pull\x20','log','llmProject','profile','\x22\x20to\x20\x22','\x20\x20Integrations:\x20','force','\x20successfully','repeat','tdx.json','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','\x20\x20Agents:\x20','dryRun','created','join','\x20\x20Prompt\x20\x22','-\x20no\x20files\x20written','Output:\x20','description','827952mVHJeD','updated','Agent\x20','Clone\x20\x22','\x20\x20Knowledge\x20Base\x20\x22','execute','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','New\x20project\x20name\x20is\x20required','\x20\x20Target:\x20','454evXQwF','agent:clone','Chat:\x20','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','cyan','No\x20tdx.json\x20found\x20in\x20','error','\x22\x20to\x20a\x20different\x20profile','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x20created','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','name','\x20unchanged','total','Project\x20cloned\x20successfully','Dry\x20run\x20-\x20no\x20changes\x20made','context','Using\x20current\x20project:\x20','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x22\x20to\x20new\x20project\x20\x22','outputPath','New\x20project\x20ID:\x20','pushAgent','1512370ZLTDme','New\x20project:\x20','Errors:','cloneProject','site','gray','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x0aChanges\x20to\x20prompt\x20\x27','yes','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','Dry\x20run\x20-\x20no\x20files\x20written','\x20resources?','\x20new','agents','green','\x20--profile\x20','Using\x20local\x20project:\x20','agentName','dim','Source:\x20','Pushing\x20agent\x20from\x20\x22','\x0aPush\x20summary\x20for\x20\x27','\x0aPush\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x0a✔\x20Pushed\x20','\x0aError:','Would\x20push\x20agent:\x20','Using\x20context\x20project:\x20','Summary:','Project\x20cloned\x20with\x20errors','\x20changed','textKnowledgeBases','\x0aProject\x20pushed\x20with\x20errors','source','Status:\x20','\x20\x20Prompts:\x20','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','diff','red','\x20|\x20','Cannot\x20clone\x20from\x20context\x20project\x20\x22','-\x20nothing\x20pushed','pullProject','counts','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)','errors','\x20=\x20','hasChanges','no_context','no_local_folder','llm','1684116bqaMaZ','projectId','llm_project','Agent\x20pulled\x20successfully','integrations','\x22...','365718AjXgQj','yellow','agentId','<new-name>','92725wtHBFZ','\x20\x20tdx\x20agent\x20clone\x20agents/','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','new','push','\x20\x20Knowledge\x20Bases:\x20','Agent:\x20','21qVgPDx','28NMMmsp','knowledgeBases','\x20\x20Agent\x20\x22','\x20files?','Cancelled','\x20\x20Text\x20Knowledge\x20Base\x20\x22','dirname','projectName','\x0aErrors\x20found:','\x20--name\x20','Project:\x20','\x20errors','Pulling\x20agent\x20\x22','agent.yml','message','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','agent:pull','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20\x20Integration\x20\x22','newProjectId','utf-8','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','action','\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','Failed\x20to\x20push\x20agent:\x20','Using\x20project:\x20','\x20\x20Source:\x20'];a4_0x7aa2=function(){return _0x570d07;};return a4_0x7aa2();}export class AgentPushCommand extends BaseCommand{[a4_0x283f9c(0xe5)]='agent:push';['description']='Push\x20local\x20agent\x20files\x20to\x20LLM\x20project';async[a4_0x283f9c(0xd6)](_0x3db2c0){const _0x4d5e7c=a4_0x283f9c,{options:_0x365bb8,args:_0x1e2878,tdx:_0x28a961}=_0x3db2c0;let _0x5c3235=_0x1e2878[0x0]||process[_0x4d5e7c(0x159)]();const _0x11bc31=_0x365bb8[_0x4d5e7c(0xca)],_0x28d773=_0x365bb8['force'],_0x4b778e=_0x365bb8[_0x4d5e7c(0xf9)],_0x5c9bb7=_0x365bb8[_0x4d5e7c(0xf5)],_0xce9508=a4_0x17b288[_0x4d5e7c(0xcc)](_0x5c3235,_0x4d5e7c(0x146)),_0x41ec2d=existsSync(_0xce9508);if(_0x41ec2d){const {data:_0x33aec6}=await withSpinner(_0x4d5e7c(0x106)+_0x5c3235+_0x4d5e7c(0x12b),()=>_0x28a961[_0x4d5e7c(0x125)][_0x4d5e7c(0xf0)](_0x5c3235,{'dryRun':_0x11bc31,'force':_0x28d773}));if(_0x11bc31)return console['log'](a4_0x2503c1[_0x4d5e7c(0x12d)](_0x4d5e7c(0xe9))),console[_0x4d5e7c(0xbf)](_0x4d5e7c(0x10d)+_0x33aec6[_0x4d5e7c(0x103)]),0x0;if(_0x33aec6[_0x4d5e7c(0x14f)]===_0x4d5e7c(0xe0))return console['log'](a4_0x2503c1[_0x4d5e7c(0x119)](_0x4d5e7c(0x151)+_0x33aec6[_0x4d5e7c(0xe0)])),0x1;console[_0x4d5e7c(0xbf)](a4_0x2503c1[_0x4d5e7c(0x100)](_0x4d5e7c(0xd3)+_0x33aec6[_0x4d5e7c(0x14f)]+_0x4d5e7c(0xc5))),console[_0x4d5e7c(0xbf)](_0x4d5e7c(0x137)+_0x33aec6[_0x4d5e7c(0x103)]);if(_0x33aec6[_0x4d5e7c(0x12e)]&&_0x33aec6[_0x4d5e7c(0x127)]){const _0x95c589=getLLMAgentChatUrl(_0x5c9bb7,_0x33aec6[_0x4d5e7c(0x127)],_0x33aec6[_0x4d5e7c(0x12e)]);console[_0x4d5e7c(0xbf)](_0x4d5e7c(0xdc)+a4_0x2503c1['cyan'](_0x95c589));}return 0x0;}const _0x2afaac=_0x365bb8[_0x4d5e7c(0xc0)],_0x25006c=resolveProjectFromContext(_0x5c3235,_0x2afaac);if(_0x25006c['found'])_0x5c3235=_0x25006c['projectDir'],_0x25006c[_0x4d5e7c(0x114)]===_0x4d5e7c(0xea)&&console['log'](a4_0x2503c1[_0x4d5e7c(0x104)](_0x4d5e7c(0x152)+_0x5c3235));else{let _0x3484ef=_0x4d5e7c(0xfa);_0x25006c['reason']===_0x4d5e7c(0x124)&&(_0x3484ef=_0x25006c['message']+_0x4d5e7c(0x14e)+_0x25006c['llmProject']+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode[_0x4d5e7c(0x162)],_0x25006c[_0x4d5e7c(0x15d)]===_0x4d5e7c(0x123)?_0x25006c[_0x4d5e7c(0x147)]:_0x4d5e7c(0xdf)+_0x5c3235,undefined,{'helpText':_0x3484ef});}const {data:_0x5a29b6}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x28a961[_0x4d5e7c(0x125)][_0x4d5e7c(0x155)](_0x5c3235,{'dryRun':!![]})),_0x39863e=_0x5a29b6[_0x4d5e7c(0x11e)][_0x4d5e7c(0xff)]['errors']>0x0;if(_0x39863e){console[_0x4d5e7c(0xbf)](a4_0x2503c1['red'](_0x4d5e7c(0x141)));for(const _0x1265b7 of _0x5a29b6[_0x4d5e7c(0xff)]){_0x1265b7[_0x4d5e7c(0x14f)]===_0x4d5e7c(0xe0)&&console[_0x4d5e7c(0xbf)](a4_0x2503c1[_0x4d5e7c(0x119)](_0x4d5e7c(0x13b)+_0x1265b7['agentName']+_0x4d5e7c(0x15a)+_0x1265b7[_0x4d5e7c(0xe0)]));}return 0x1;}const _0xde6eb7=_0x5a29b6[_0x4d5e7c(0x11e)][_0x4d5e7c(0xff)][_0x4d5e7c(0xcb)]+_0x5a29b6['counts']['knowledgeBases'][_0x4d5e7c(0xcb)]+_0x5a29b6[_0x4d5e7c(0x11e)][_0x4d5e7c(0x112)][_0x4d5e7c(0xcb)]+_0x5a29b6[_0x4d5e7c(0x11e)][_0x4d5e7c(0x158)]['created']+_0x5a29b6[_0x4d5e7c(0x11e)][_0x4d5e7c(0x12a)][_0x4d5e7c(0xcb)],_0x4b32cf=_0x5a29b6[_0x4d5e7c(0x11e)][_0x4d5e7c(0xff)]['updated']+_0x5a29b6[_0x4d5e7c(0x11e)]['knowledgeBases'][_0x4d5e7c(0xd2)]+_0x5a29b6['counts'][_0x4d5e7c(0x112)]['updated']+_0x5a29b6[_0x4d5e7c(0x11e)][_0x4d5e7c(0x158)][_0x4d5e7c(0xd2)]+_0x5a29b6['counts']['integrations'][_0x4d5e7c(0xd2)],_0x83d68c=_0x5a29b6['counts'][_0x4d5e7c(0xff)][_0x4d5e7c(0x15b)]+_0x5a29b6[_0x4d5e7c(0x11e)][_0x4d5e7c(0x13a)][_0x4d5e7c(0x15b)]+_0x5a29b6['counts'][_0x4d5e7c(0x112)][_0x4d5e7c(0x15b)]+_0x5a29b6[_0x4d5e7c(0x11e)][_0x4d5e7c(0x158)][_0x4d5e7c(0x15b)]+_0x5a29b6['counts']['integrations']['unchanged'];console[_0x4d5e7c(0xbf)](_0x4d5e7c(0x107)+_0x5a29b6[_0x4d5e7c(0x140)]+'\x27:'),console['log']('\x20\x20'+a4_0x2503c1['green']('+\x20'+_0xde6eb7+_0x4d5e7c(0xfe))+_0x4d5e7c(0x11a)+a4_0x2503c1[_0x4d5e7c(0x12d)]('~\x20'+_0x4b32cf+_0x4d5e7c(0x111))+'\x20|\x20'+a4_0x2503c1[_0x4d5e7c(0x104)]('=\x20'+_0x83d68c+'\x20unchanged')),console['log'](_0x4d5e7c(0xc9)+formatCountSummary(_0x5a29b6[_0x4d5e7c(0x11e)][_0x4d5e7c(0xff)])),console[_0x4d5e7c(0xbf)](_0x4d5e7c(0x136)+formatCountSummary(_0x5a29b6[_0x4d5e7c(0x11e)][_0x4d5e7c(0x13a)])),console[_0x4d5e7c(0xbf)](_0x4d5e7c(0xbc)+formatCountSummary(_0x5a29b6[_0x4d5e7c(0x11e)][_0x4d5e7c(0x112)])),console['log']('\x20\x20Prompts:\x20'+formatCountSummary(_0x5a29b6[_0x4d5e7c(0x11e)][_0x4d5e7c(0x158)])),console[_0x4d5e7c(0xbf)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x5a29b6[_0x4d5e7c(0x11e)]['integrations'])),console[_0x4d5e7c(0xbf)](_0x4d5e7c(0x153)+a4_0x2503c1[_0x4d5e7c(0xde)](_0x5c3235)),displayDiffs(_0x5a29b6[_0x4d5e7c(0xff)],_0x5a29b6[_0x4d5e7c(0x13a)],_0x5a29b6[_0x4d5e7c(0x112)],_0x5a29b6[_0x4d5e7c(0x158)],_0x5a29b6['integrations']);if(_0x11bc31)return console[_0x4d5e7c(0xbf)](a4_0x2503c1[_0x4d5e7c(0x12d)](_0x4d5e7c(0xe2))),0x0;if(_0xde6eb7===0x0&&_0x4b32cf===0x0){console[_0x4d5e7c(0xbf)](a4_0x2503c1[_0x4d5e7c(0x100)](_0x4d5e7c(0xec)));const _0x1ee04e=getLLMProjectUrl(_0x5c9bb7,_0x5a29b6[_0x4d5e7c(0x127)]);return console[_0x4d5e7c(0xbf)](_0x4d5e7c(0x143)+a4_0x2503c1[_0x4d5e7c(0xde)](_0x1ee04e)),0x0;}if(!_0x4b778e&&!_0x28d773){if(!isInteractive())return console[_0x4d5e7c(0xe0)](a4_0x2503c1['red'](_0x4d5e7c(0x10c)),_0x4d5e7c(0xf7)),console['error'](a4_0x2503c1[_0x4d5e7c(0x104)](_0x4d5e7c(0x14a))),0x1;const _0x47192f=await confirmKey(_0x4d5e7c(0x108)+(_0xde6eb7+_0x4b32cf)+_0x4d5e7c(0xfd));if(!_0x47192f)return console[_0x4d5e7c(0xbf)](a4_0x2503c1['yellow'](_0x4d5e7c(0x13d)),_0x4d5e7c(0x11c)),0x1;}const {data:_0x3c6d7f}=await withSpinner('Pushing\x20to\x20project...',()=>_0x28a961[_0x4d5e7c(0x125)]['pushProject'](_0x5c3235,{'force':_0x28d773})),_0x539e0c=_0x3c6d7f[_0x4d5e7c(0x11e)][_0x4d5e7c(0xff)][_0x4d5e7c(0x120)]>0x0||_0x3c6d7f[_0x4d5e7c(0x11e)][_0x4d5e7c(0x13a)]['errors']>0x0||_0x3c6d7f[_0x4d5e7c(0x11e)][_0x4d5e7c(0x112)][_0x4d5e7c(0x120)]>0x0||_0x3c6d7f['counts']['prompts'][_0x4d5e7c(0x120)]>0x0;if(_0x539e0c){console[_0x4d5e7c(0xbf)](a4_0x2503c1[_0x4d5e7c(0x12d)](_0x4d5e7c(0x113))),console[_0x4d5e7c(0xbf)](),console[_0x4d5e7c(0xbf)](a4_0x2503c1['red'](_0x4d5e7c(0xf3)));for(const _0x422a9 of _0x3c6d7f['agents']){_0x422a9[_0x4d5e7c(0x14f)]===_0x4d5e7c(0xe0)&&console[_0x4d5e7c(0xbf)](a4_0x2503c1[_0x4d5e7c(0x119)]('\x20\x20Agent\x20\x22'+_0x422a9[_0x4d5e7c(0x103)]+_0x4d5e7c(0x15a)+_0x422a9['error']));}for(const _0x4dd638 of _0x3c6d7f[_0x4d5e7c(0x13a)]){_0x4dd638[_0x4d5e7c(0x14f)]===_0x4d5e7c(0xe0)&&console[_0x4d5e7c(0xbf)](a4_0x2503c1['red'](_0x4d5e7c(0xd5)+_0x4dd638[_0x4d5e7c(0xe5)]+_0x4d5e7c(0x15a)+_0x4dd638[_0x4d5e7c(0xe0)]));}for(const _0x2561dc of _0x3c6d7f[_0x4d5e7c(0x112)]){_0x2561dc[_0x4d5e7c(0x14f)]===_0x4d5e7c(0xe0)&&console[_0x4d5e7c(0xbf)](a4_0x2503c1[_0x4d5e7c(0x119)](_0x4d5e7c(0x13e)+_0x2561dc[_0x4d5e7c(0xe5)]+_0x4d5e7c(0x15a)+_0x2561dc['error']));}for(const _0x1793c7 of _0x3c6d7f[_0x4d5e7c(0x158)]){_0x1793c7[_0x4d5e7c(0x14f)]===_0x4d5e7c(0xe0)&&console[_0x4d5e7c(0xbf)](a4_0x2503c1['red'](_0x4d5e7c(0xcd)+_0x1793c7[_0x4d5e7c(0xe5)]+_0x4d5e7c(0x15a)+_0x1793c7[_0x4d5e7c(0xe0)]));}for(const _0x47feb1 of _0x3c6d7f[_0x4d5e7c(0x12a)]){_0x47feb1[_0x4d5e7c(0x14f)]===_0x4d5e7c(0xe0)&&console[_0x4d5e7c(0xbf)](a4_0x2503c1[_0x4d5e7c(0x119)]('\x20\x20Integration\x20\x22'+_0x47feb1[_0x4d5e7c(0xe5)]+'\x22:\x20'+_0x47feb1['error']));}return 0x1;}console[_0x4d5e7c(0xbf)](a4_0x2503c1['green'](_0x4d5e7c(0x10b)+(_0xde6eb7+_0x4b32cf)+'\x20resources\x20to\x20\x27'+_0x3c6d7f[_0x4d5e7c(0x140)]+'\x27'));const _0x10c4dd=getLLMProjectUrl(_0x5c9bb7,_0x3c6d7f[_0x4d5e7c(0x127)]);return console[_0x4d5e7c(0xbf)](_0x4d5e7c(0x143)+a4_0x2503c1[_0x4d5e7c(0xde)](_0x10c4dd)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x29ec61=a5_0x5e65;(function(_0x142fde,_0x4979c4){const _0x349691=a5_0x5e65,_0x2f6ed3=_0x142fde();while(!![]){try{const _0x59b5fa=-parseInt(_0x349691(0x218))/0x1+parseInt(_0x349691(0x214))/0x2+-parseInt(_0x349691(0x1e3))/0x3*(parseInt(_0x349691(0x21d))/0x4)+-parseInt(_0x349691(0x1cb))/0x5+parseInt(_0x349691(0x22d))/0x6*(-parseInt(_0x349691(0x19d))/0x7)+parseInt(_0x349691(0x202))/0x8+-parseInt(_0x349691(0x1af))/0x9*(-parseInt(_0x349691(0x1e2))/0xa);if(_0x59b5fa===_0x4979c4)break;else _0x2f6ed3['push'](_0x2f6ed3['shift']());}catch(_0x450271){_0x2f6ed3['push'](_0x2f6ed3['shift']());}}}(a5_0x389d,0x8ae54));function a5_0x389d(){const _0x535a80=['1130316VyKqWu','join','text','Re-evaluating...','828457kcgkTz','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','Evaluating\x20response...','site','⚠\x20SKIPPED:\x20','1219316ozjVnw','Either\x20switch\x20to\x20the\x20\x22','yellow','description','map','testName','Usage:','Executing\x20new\x20tests...','green','stop','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','Running:\x20','resolve','testYmlPath','Using\x20agent:\x20','Test\x20Summary','6KtnPXZ','Project\x20path:\x20','red','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','writeFileSync','found','dryRun','add','No\x20tests\x20found\x20matching:\x20','7730590cldmdH','\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','Re-evaluating\x20cached\x20test\x20run...','Available\x20tags:\x20','ERROR','Running\x20agent\x20tests...','/<agent-name>','\x20\x20Round\x20','jsonl','No\x20tests\x20have\x20tags\x20defined.','\x20(new)','llm','timestamp','New\x20tests\x20to\x20execute:\x20','no_local_folder','basename','existsSync','tags','17496KsrdIp','\x27\x20to\x20create\x20the\x20folder\x20structure.','Agent:\x20','Duration:\x20','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','...\x20','Running\x20test:\x20','No\x20tests\x20found\x20with\x20tags:\x20','toLowerCase','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','agent','llmProject','tests','verbose','toISOString','Conversation\x20URL:\x20','status','...','size','find','context','agentName','execute',':\x20Sending\x20user\x20input...','\x20\x20-\x20','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','Passed:\x20\x20\x20','PASS','382870uPdfCj','Re-evaluating\x20','\x20\x20Conversation:\x20','\x20-\x20','Test\x20','name','\x20\x20Evaluating...\x20','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','Failed:\x20\x20\x20','Output\x20written\x20to:\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','Errors:\x20\x20\x20','message','no_tests','Tests\x20found:\x20','resolveAgentId','\x20(cached)','cyan','some','Re-evaluation\x20Summary','start','projectName','projectDir','6610MrQZWI','3nZyzNh','dim','Error:\x20No\x20previous\x20test\x20run\x20found.','Total:\x20\x20\x20\x20','json','Run\x20tests\x20for\x20an\x20LLM\x20agent','output','agentDirs','✗\x20ERROR:\x20','now','reason','agent:test','\x22:\x20','executeReeval','Round\x201/','includes','Round\x20','split','white','utf-8','✗\x20FAIL:\x20','conversation_url','Site:\x20','404','log','no_context','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','resolveProjectId','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','rounds','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','8264032obBgkt','length','Failed\x20Tests:','has','forEach','not\x20found','filter','trim','repeat','✓\x20PASS:\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','tsv','Error\x20writing\x20output\x20file:\x20','table','reeval','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','FAIL','push'];a5_0x389d=function(){return _0x535a80;};return a5_0x389d();}import*as a5_0x512f45 from'node:fs';function a5_0x5e65(_0x1dd110,_0x2dce9a){_0x1dd110=_0x1dd110-0x19a;const _0x389dc5=a5_0x389d();let _0x5e6550=_0x389dc5[_0x1dd110];return _0x5e6550;}import*as a5_0x59fe4e from'node:path';import a5_0x156d4c 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_0x29ec61(0x1d0)]=a5_0x29ec61(0x1ee);[a5_0x29ec61(0x220)]=a5_0x29ec61(0x1e8);async[a5_0x29ec61(0x1c5)](_0x5615b4){const _0x5643b3=a5_0x29ec61,{options:_0x23caa6,args:_0x32526b,tdx:_0xf1f8e7}=_0x5615b4,_0x4bc8ad=_0x32526b[0x0]||'.',_0x17f9b7=_0x23caa6[_0x5643b3(0x19a)],_0x498167=_0x23caa6,_0x628b93=_0x498167['eval']===![],_0x151dc9=_0x498167[_0x5643b3(0x210)],_0x8ed697=_0x498167['name'],_0x58e9f6=_0x498167[_0x5643b3(0x1ae)],_0xe47f7a=_0x23caa6['site'],_0x5aa41d=_0x498167[_0x5643b3(0x1e9)];if(_0x151dc9&&_0x628b93)return console[_0x5643b3(0x1fb)](a5_0x156d4c['red'](_0x5643b3(0x1d2))),0x1;let _0x3edbb6='table';if(_0x498167['json'])_0x3edbb6=_0x5643b3(0x1e7);else{if(_0x498167[_0x5643b3(0x1a5)])_0x3edbb6='jsonl';else{if(_0x498167[_0x5643b3(0x20d)])_0x3edbb6=_0x5643b3(0x20d);else{if(_0x498167['table'])_0x3edbb6='table';}}}const _0x251149=_0x498167[_0x5643b3(0x1ba)];let _0x3a10f2=_0x4bc8ad;const _0x3f9a3a=a5_0x512f45[_0x5643b3(0x1ad)](_0x4bc8ad),_0x4746ec=_0x4bc8ad==='.';if(!_0x3f9a3a||_0x4746ec){const _0x3c2b0a=resolveProjectFromContext(_0x4bc8ad,_0x251149,{'requireFile':'test.yml'});if(_0x3c2b0a[_0x5643b3(0x232)])_0x3a10f2=_0x3c2b0a['projectDir'],_0x3c2b0a['source']===_0x5643b3(0x1c3)&&console[_0x5643b3(0x1fb)](a5_0x156d4c['dim'](_0x5643b3(0x22b)+_0x3a10f2));else switch(_0x3c2b0a[_0x5643b3(0x1ed)]){case _0x5643b3(0x1fc):console[_0x5643b3(0x1fb)](a5_0x156d4c['yellow'](_0x3c2b0a[_0x5643b3(0x1d7)])),console[_0x5643b3(0x1fb)](),console['log'](_0x5643b3(0x223)),console['log'](_0x5643b3(0x19e)),console['log']('\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[_0x5643b3(0x1fb)](),console[_0x5643b3(0x1fb)](_0x5643b3(0x1ff));return 0x1;case _0x5643b3(0x1ab):console[_0x5643b3(0x1fb)](a5_0x156d4c[_0x5643b3(0x21f)](_0x3c2b0a[_0x5643b3(0x1d7)])),console[_0x5643b3(0x1fb)](),console[_0x5643b3(0x1fb)]('Run\x20\x27tdx\x20agent\x20pull\x20'+_0x3c2b0a[_0x5643b3(0x1ba)]+_0x5643b3(0x1b0));return 0x1;case'multiple_agents':{const _0x2b0343=a5_0x59fe4e[_0x5643b3(0x1ac)](_0x3c2b0a[_0x5643b3(0x1e1)]);console['log'](a5_0x156d4c[_0x5643b3(0x21f)](_0x5643b3(0x227)+_0x3c2b0a[_0x5643b3(0x1ba)]+'\x22:'));for(const _0x5d8deb of _0x3c2b0a[_0x5643b3(0x1ea)]){console[_0x5643b3(0x1fb)](_0x5643b3(0x1c7)+_0x5d8deb);}return console[_0x5643b3(0x1fb)](),console[_0x5643b3(0x1fb)](_0x5643b3(0x230)+_0x2b0343+_0x5643b3(0x1a3)),0x1;}case _0x5643b3(0x1d8):console[_0x5643b3(0x1fb)](a5_0x156d4c[_0x5643b3(0x21f)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x3c2b0a[_0x5643b3(0x1ba)]+'\x22.')),console[_0x5643b3(0x1fb)](a5_0x156d4c[_0x5643b3(0x1e4)](_0x5643b3(0x22e)+_0x3c2b0a[_0x5643b3(0x1e1)])),console['log'](),console['log']('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0x3b3777,agentInfo:_0x1a665e}=parseTestFile(_0x3a10f2);let _0x160f77=_0x3b3777[_0x5643b3(0x1bb)];if(_0x8ed697){const _0x430087=_0x8ed697[_0x5643b3(0x1f4)](',')[_0x5643b3(0x221)](_0x315a00=>_0x315a00['trim']());_0x160f77=_0x3b3777[_0x5643b3(0x1bb)][_0x5643b3(0x208)](_0x4c2977=>_0x430087[_0x5643b3(0x1f2)](_0x4c2977[_0x5643b3(0x1d0)]));if(_0x160f77[_0x5643b3(0x203)]===0x0)return console[_0x5643b3(0x1fb)](a5_0x156d4c[_0x5643b3(0x21f)](_0x5643b3(0x19c)+_0x8ed697)),console[_0x5643b3(0x1fb)](a5_0x156d4c[_0x5643b3(0x1e4)]('Available\x20tests:\x20'+_0x3b3777[_0x5643b3(0x1bb)][_0x5643b3(0x221)](_0x18673d=>_0x18673d[_0x5643b3(0x1d0)])[_0x5643b3(0x215)](',\x20'))),0x1;}if(_0x58e9f6){const _0x5d63d6=_0x58e9f6[_0x5643b3(0x1f4)](',')['map'](_0x2d7b2e=>_0x2d7b2e[_0x5643b3(0x209)]()[_0x5643b3(0x1b7)]());_0x160f77=_0x160f77[_0x5643b3(0x208)](_0x151289=>_0x151289[_0x5643b3(0x1ae)]?.[_0x5643b3(0x1dd)](_0x101add=>_0x5d63d6[_0x5643b3(0x1f2)](_0x101add[_0x5643b3(0x1b7)]())));if(_0x160f77[_0x5643b3(0x203)]===0x0){console[_0x5643b3(0x1fb)](a5_0x156d4c[_0x5643b3(0x21f)](_0x5643b3(0x1b6)+_0x58e9f6));const _0x378c30=new Set();return _0x3b3777['tests']['forEach'](_0x5c363e=>_0x5c363e[_0x5643b3(0x1ae)]?.[_0x5643b3(0x206)](_0xd8b4df=>_0x378c30[_0x5643b3(0x19b)](_0xd8b4df))),_0x378c30[_0x5643b3(0x1c1)]>0x0?console['log'](a5_0x156d4c[_0x5643b3(0x1e4)](_0x5643b3(0x1a0)+[..._0x378c30][_0x5643b3(0x215)](',\x20'))):console[_0x5643b3(0x1fb)](a5_0x156d4c[_0x5643b3(0x1e4)](_0x5643b3(0x1a6))),0x1;}}if(_0x151dc9)return this[_0x5643b3(0x1f0)](_0x5615b4,{'definition':{'tests':_0x160f77},'agentInfo':_0x1a665e,'outputFormat':_0x3edbb6,'outputFile':_0x5aa41d,'testNames':_0x8ed697});if(_0x17f9b7){console[_0x5643b3(0x1fb)](a5_0x156d4c[_0x5643b3(0x1dc)]('Test\x20Configuration:')),console[_0x5643b3(0x1fb)]('\x20\x20Site:\x20'+a5_0x156d4c['white'](_0xe47f7a)),console[_0x5643b3(0x1fb)]('\x20\x20Project:\x20'+a5_0x156d4c['white'](_0x1a665e['projectName'])),console['log']('\x20\x20Agent:\x20'+a5_0x156d4c[_0x5643b3(0x1f5)](_0x1a665e['agentName'])),console[_0x5643b3(0x1fb)](),console[_0x5643b3(0x1fb)](_0x5643b3(0x1d9)+a5_0x156d4c[_0x5643b3(0x1f5)](_0x160f77['length']));for(let _0x3b623c=0x0;_0x3b623c<_0x160f77['length'];_0x3b623c++){const _0x3355b1=_0x160f77[_0x3b623c],_0x71c7ad=_0x3355b1['rounds'][_0x5643b3(0x203)]===0x1?'round':_0x5643b3(0x200),_0x23ea92=_0x3355b1['tags']?.[_0x5643b3(0x203)]?'\x20['+_0x3355b1['tags'][_0x5643b3(0x215)](',\x20')+']':'';console[_0x5643b3(0x1fb)]('\x20\x20'+(_0x3b623c+0x1)+'.\x20'+a5_0x156d4c[_0x5643b3(0x1f5)](_0x3355b1[_0x5643b3(0x1d0)])+'\x20('+_0x3355b1[_0x5643b3(0x200)][_0x5643b3(0x203)]+'\x20'+_0x71c7ad+')'+a5_0x156d4c[_0x5643b3(0x1e4)](_0x23ea92));}return 0x0;}let _0x5e1f83,_0x2a3168;try{_0x5e1f83=await _0xf1f8e7[_0x5643b3(0x1a8)][_0x5643b3(0x1fe)](_0x1a665e['projectName']);}catch(_0xc7355a){const _0x34755f=_0xc7355a instanceof Error?_0xc7355a[_0x5643b3(0x1d7)]:String(_0xc7355a);return _0x34755f[_0x5643b3(0x1f2)](_0x5643b3(0x1fa))||_0x34755f[_0x5643b3(0x1b7)]()[_0x5643b3(0x1f2)](_0x5643b3(0x207))?console[_0x5643b3(0x1fb)](a5_0x156d4c['red'](_0x5643b3(0x20c)+_0x1a665e['projectName'])):console['log'](a5_0x156d4c[_0x5643b3(0x22f)](_0x5643b3(0x1b8)+_0x1a665e[_0x5643b3(0x1e0)]+_0x5643b3(0x1ef)+_0x34755f)),0x1;}try{_0x2a3168=await _0xf1f8e7['llm'][_0x5643b3(0x1da)](_0x1a665e['agentName'],_0x5e1f83);}catch(_0x645a88){const _0x2ea1c7=_0x645a88 instanceof Error?_0x645a88[_0x5643b3(0x1d7)]:String(_0x645a88);return _0x2ea1c7['includes'](_0x5643b3(0x1fa))||_0x2ea1c7[_0x5643b3(0x1b7)]()[_0x5643b3(0x1f2)](_0x5643b3(0x207))?console[_0x5643b3(0x1fb)](a5_0x156d4c[_0x5643b3(0x22f)](_0x5643b3(0x219)+_0x1a665e[_0x5643b3(0x1c4)])):console['log'](a5_0x156d4c[_0x5643b3(0x22f)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x1a665e[_0x5643b3(0x1c4)]+_0x5643b3(0x1ef)+_0x2ea1c7)),0x1;}let _0x1e1793;if(!_0x628b93)try{_0x1e1793=await setupEvaluatorAgent(_0xf1f8e7['llm'],_0x23caa6[_0x5643b3(0x1bc)]);}catch(_0x504264){const _0x1c7ab3=_0x504264 instanceof Error?_0x504264[_0x5643b3(0x1d7)]:String(_0x504264);return console[_0x5643b3(0x1fb)](a5_0x156d4c['red'](_0x5643b3(0x1d5)+_0x1c7ab3)),0x1;}console[_0x5643b3(0x1fb)](a5_0x156d4c[_0x5643b3(0x1dc)](_0x5643b3(0x1a2))),console['log'](_0x5643b3(0x1f9)+a5_0x156d4c[_0x5643b3(0x1f5)](_0xe47f7a)),console[_0x5643b3(0x1fb)](_0x5643b3(0x1b1)+a5_0x156d4c[_0x5643b3(0x1f5)](_0x1a665e[_0x5643b3(0x1e0)]+'/'+_0x1a665e[_0x5643b3(0x1c4)])),console['log']();const _0x185784=[],_0x33a30c=[],_0xdb00c7=Date[_0x5643b3(0x1ec)]();for(let _0xf40f9c=0x0;_0xf40f9c<_0x160f77[_0x5643b3(0x203)];_0xf40f9c++){const _0x4bdacd=_0x160f77[_0xf40f9c];_0x160f77[_0x5643b3(0x203)]>0x1?console[_0x5643b3(0x1fb)](_0x5643b3(0x1cf)+(_0xf40f9c+0x1)+'/'+_0x160f77['length']+':\x20'+a5_0x156d4c['white'](_0x4bdacd['name'])):console['log'](_0x5643b3(0x1b5)+a5_0x156d4c[_0x5643b3(0x1f5)](_0x4bdacd[_0x5643b3(0x1d0)]));const _0x48be0c=createCommandSpinner('Round\x201/'+_0x4bdacd['rounds'][_0x5643b3(0x203)]+':\x20Sending\x20user\x20input...');_0x48be0c['start']();try{const {result:_0x2f2f91,conversation:_0x31d24a}=await runTest(_0xf1f8e7[_0x5643b3(0x1a8)],_0x4bdacd,{'agentId':_0x2a3168,'projectId':_0x5e1f83,'site':_0xe47f7a,'noEval':_0x628b93,'evaluatorId':_0x1e1793,'onRoundStart':(_0x484796,_0x28dc31)=>{const _0x5ef606=_0x5643b3;_0x48be0c[_0x5ef606(0x216)]='Round\x20'+(_0x484796+0x1)+'/'+_0x28dc31+_0x5ef606(0x1c6);},'onRoundComplete':(_0x274f4e,_0x25b4e9,_0x31ec6f)=>{const _0x5594c0=_0x5643b3,_0x1d501c=formatElapsed(_0x25b4e9);_0x31ec6f?console[_0x5594c0(0x1fb)]('\x20\x20Round\x20'+(_0x274f4e+0x1)+'/'+_0x4bdacd[_0x5594c0(0x200)]['length']+_0x5594c0(0x1b4)+a5_0x156d4c[_0x5594c0(0x225)]('✓')+'\x20('+_0x1d501c+')'):console[_0x5594c0(0x1fb)](_0x5594c0(0x1a4)+(_0x274f4e+0x1)+'/'+_0x4bdacd[_0x5594c0(0x200)]['length']+_0x5594c0(0x1b4)+a5_0x156d4c[_0x5594c0(0x22f)]('✗'));},'onEvaluationStart':()=>{const _0x53c952=_0x5643b3;_0x48be0c[_0x53c952(0x216)]='Evaluating\x20response...';},'onEvaluationComplete':_0x2aa1f6=>{const _0x332377=_0x5643b3,_0x497ee8=formatElapsed(_0x2aa1f6);console[_0x332377(0x1fb)](_0x332377(0x1d1)+a5_0x156d4c[_0x332377(0x225)]('✓')+'\x20('+_0x497ee8+')');}});_0x48be0c[_0x5643b3(0x226)](),_0x185784[_0x5643b3(0x213)](_0x2f2f91),_0x33a30c[_0x5643b3(0x213)](_0x31d24a);if(_0x2f2f91[_0x5643b3(0x1bf)]==='PASS')console['log'](a5_0x156d4c['green'](_0x5643b3(0x20b)+_0x2f2f91['reason']));else _0x2f2f91[_0x5643b3(0x1bf)]==='FAIL'?console[_0x5643b3(0x1fb)](a5_0x156d4c[_0x5643b3(0x22f)]('✗\x20FAIL:\x20'+_0x2f2f91[_0x5643b3(0x1ed)])):console[_0x5643b3(0x1fb)](a5_0x156d4c[_0x5643b3(0x22f)](_0x5643b3(0x1eb)+_0x2f2f91['reason']));_0x2f2f91[_0x5643b3(0x1f8)]&&console[_0x5643b3(0x1fb)](a5_0x156d4c[_0x5643b3(0x1e4)](_0x5643b3(0x1be)+_0x2f2f91[_0x5643b3(0x1f8)])),console[_0x5643b3(0x1fb)]();}catch(_0x4a0c60){_0x48be0c[_0x5643b3(0x226)]();const _0x587aa9=_0x4a0c60 instanceof Error?_0x4a0c60[_0x5643b3(0x1d7)]:String(_0x4a0c60);console[_0x5643b3(0x1fb)](a5_0x156d4c[_0x5643b3(0x22f)]('✗\x20ERROR:\x20'+_0x587aa9)),console['log'](),_0x185784[_0x5643b3(0x213)]({'name':_0x4bdacd[_0x5643b3(0x1d0)],'status':_0x5643b3(0x1a1),'reason':_0x587aa9,'timestamp':new Date()[_0x5643b3(0x1bd)](),'duration_ms':0x0});}}const _0x11c26c=Date[_0x5643b3(0x1ec)]()-_0xdb00c7,_0x4b7afe=_0x185784[_0x5643b3(0x208)](_0x203395=>_0x203395[_0x5643b3(0x1bf)]===_0x5643b3(0x1ca))[_0x5643b3(0x203)],_0x43d4c4=_0x185784[_0x5643b3(0x208)](_0x5d5aed=>_0x5d5aed[_0x5643b3(0x1bf)]==='FAIL')[_0x5643b3(0x203)],_0x5d33db=_0x185784[_0x5643b3(0x208)](_0x14fbe7=>_0x14fbe7[_0x5643b3(0x1bf)]===_0x5643b3(0x1a1))[_0x5643b3(0x203)];console[_0x5643b3(0x1fb)]('━'[_0x5643b3(0x20a)](0x3c)),console[_0x5643b3(0x1fb)](_0x5643b3(0x22c)),console[_0x5643b3(0x1fb)]('━'[_0x5643b3(0x20a)](0x3c)),console[_0x5643b3(0x1fb)](_0x5643b3(0x1e6)+_0x185784[_0x5643b3(0x203)]),console[_0x5643b3(0x1fb)](_0x5643b3(0x1c9)+a5_0x156d4c[_0x5643b3(0x225)](_0x4b7afe)),console[_0x5643b3(0x1fb)](_0x5643b3(0x1d3)+a5_0x156d4c[_0x5643b3(0x22f)](_0x43d4c4));_0x5d33db>0x0&&console[_0x5643b3(0x1fb)]('Errors:\x20\x20\x20'+a5_0x156d4c[_0x5643b3(0x22f)](_0x5d33db));console[_0x5643b3(0x1fb)](_0x5643b3(0x1b2)+formatElapsed(_0x11c26c)),console[_0x5643b3(0x1fb)]('━'['repeat'](0x3c));const _0x12a8b0=_0x185784[_0x5643b3(0x208)](_0x5cd14c=>_0x5cd14c[_0x5643b3(0x1bf)]!==_0x5643b3(0x1ca));if(_0x12a8b0[_0x5643b3(0x203)]>0x0){console[_0x5643b3(0x1fb)](),console[_0x5643b3(0x1fb)](_0x5643b3(0x204));for(const _0x7049fd of _0x12a8b0){const _0x4dcdfb=a5_0x156d4c[_0x5643b3(0x22f)]('✗'),_0x5eeee5=_0x7049fd[_0x5643b3(0x1ed)][_0x5643b3(0x203)]>0x32?_0x7049fd[_0x5643b3(0x1ed)]['substring'](0x0,0x32)+_0x5643b3(0x1c0):_0x7049fd['reason'];console[_0x5643b3(0x1fb)]('\x20\x20'+_0x4dcdfb+'\x20'+_0x7049fd['name']+':\x20'+_0x5eeee5);}}const _0x53d0d7={'summary':{'total':_0x185784[_0x5643b3(0x203)],'passed':_0x4b7afe,'failed':_0x43d4c4,'errors':_0x5d33db>0x0?_0x5d33db:undefined,'duration_ms':_0x11c26c},'tests':_0x185784,'agent':{'project':_0x1a665e[_0x5643b3(0x1e0)],'name':_0x1a665e[_0x5643b3(0x1c4)],'site':_0xe47f7a},'timestamp':new Date(_0xdb00c7)['toISOString']()};try{const _0x578d57=buildCachedTestRun(_0x33a30c,{'site':_0xe47f7a,'projectId':_0x5e1f83,'projectName':_0x1a665e['projectName'],'agentId':_0x2a3168,'agentName':_0x1a665e[_0x5643b3(0x1c4)],'testYmlPath':a5_0x59fe4e[_0x5643b3(0x229)](_0x1a665e[_0x5643b3(0x22a)])});saveLastTestRun(_0x578d57);}catch{}if(_0x3edbb6!==_0x5643b3(0x20f)||_0x5aa41d){const _0x1f5969=formatResults(_0x53d0d7,_0x3edbb6);if(_0x5aa41d)try{a5_0x512f45[_0x5643b3(0x231)](_0x5aa41d,_0x1f5969,_0x5643b3(0x1f6)),console['log'](),console[_0x5643b3(0x1fb)](a5_0x156d4c[_0x5643b3(0x1e4)]('Output\x20written\x20to:\x20'+_0x5aa41d));}catch(_0x41a3f9){return console[_0x5643b3(0x1fb)](),console[_0x5643b3(0x1fb)](a5_0x156d4c[_0x5643b3(0x22f)]('Error\x20writing\x20output\x20file:\x20'+_0x41a3f9)),0x1;}else console['log'](),console[_0x5643b3(0x1fb)](_0x1f5969);}return _0x12a8b0[_0x5643b3(0x203)]>0x0?0x1:0x0;}async[a5_0x29ec61(0x1f0)](_0x2be0f6,_0x5b6593){const _0x86bbf7=a5_0x29ec61,{options:_0x585540,tdx:_0x287334}=_0x2be0f6,{definition:_0x3bcad4,agentInfo:_0x25bc48,outputFormat:_0x52e6f5,outputFile:_0x2f9bc4}=_0x5b6593,_0x5cc9f4=_0x585540[_0x86bbf7(0x21b)],_0xfee129=loadLastTestRun();if(!_0xfee129)return console['log'](a5_0x156d4c[_0x86bbf7(0x22f)](_0x86bbf7(0x1e5))),console[_0x86bbf7(0x1fb)](a5_0x156d4c[_0x86bbf7(0x1e4)](_0x86bbf7(0x1fd))),0x1;if(_0xfee129[_0x86bbf7(0x1b9)][_0x86bbf7(0x1c4)]!==_0x25bc48[_0x86bbf7(0x1c4)])return console[_0x86bbf7(0x1fb)](a5_0x156d4c[_0x86bbf7(0x22f)](_0x86bbf7(0x1c8)+_0xfee129[_0x86bbf7(0x1b9)][_0x86bbf7(0x1c4)]+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x25bc48['agentName']+'\x22.')),console[_0x86bbf7(0x1fb)](a5_0x156d4c[_0x86bbf7(0x1e4)](_0x86bbf7(0x1b3))),0x1;const _0x7d4e79=new Set(_0xfee129['conversations']['map'](_0x1b5e7d=>_0x1b5e7d[_0x86bbf7(0x222)])),_0x5ed22a=_0x3bcad4['tests'][_0x86bbf7(0x208)](_0x30117d=>!_0x7d4e79[_0x86bbf7(0x205)](_0x30117d[_0x86bbf7(0x1d0)]));if(_0x5ed22a[_0x86bbf7(0x203)]>0x0&&_0xfee129[_0x86bbf7(0x21b)]!==_0x5cc9f4)return console[_0x86bbf7(0x1fb)](a5_0x156d4c[_0x86bbf7(0x22f)](_0x86bbf7(0x211))),console[_0x86bbf7(0x1fb)](a5_0x156d4c[_0x86bbf7(0x1e4)]('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0xfee129['site']+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x5cc9f4+'\x22.')),console[_0x86bbf7(0x1fb)](a5_0x156d4c['dim'](_0x86bbf7(0x21e)+_0xfee129[_0x86bbf7(0x21b)]+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0xe8af8b=_0x3bcad4['tests'][_0x86bbf7(0x208)](_0x54d482=>_0x7d4e79[_0x86bbf7(0x205)](_0x54d482['name'])),_0x24ac2a=_0x5ed22a;let _0x380c97;try{_0x380c97=await setupEvaluatorAgent(_0x287334[_0x86bbf7(0x1a8)],_0x585540[_0x86bbf7(0x1bc)]);}catch(_0x540ee0){const _0xc29e01=_0x540ee0 instanceof Error?_0x540ee0[_0x86bbf7(0x1d7)]:String(_0x540ee0);return console['log'](a5_0x156d4c[_0x86bbf7(0x22f)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0xc29e01)),0x1;}console[_0x86bbf7(0x1fb)](a5_0x156d4c['cyan'](_0x86bbf7(0x19f))),console[_0x86bbf7(0x1fb)]('Cached\x20run\x20from:\x20'+a5_0x156d4c['white'](_0xfee129[_0x86bbf7(0x1a9)])),console[_0x86bbf7(0x1fb)](_0x86bbf7(0x1b1)+a5_0x156d4c[_0x86bbf7(0x1f5)](_0xfee129[_0x86bbf7(0x1b9)][_0x86bbf7(0x1e0)]+'/'+_0xfee129[_0x86bbf7(0x1b9)][_0x86bbf7(0x1c4)]));_0x24ac2a[_0x86bbf7(0x203)]>0x0&&console['log'](_0x86bbf7(0x1aa)+a5_0x156d4c[_0x86bbf7(0x21f)](_0x24ac2a[_0x86bbf7(0x203)]));console[_0x86bbf7(0x1fb)]();const _0x56426=[],_0x2fd197=Date[_0x86bbf7(0x1ec)](),_0x2d0608=createCommandSpinner(_0x86bbf7(0x217));if(_0xe8af8b['length']>0x0)try{const _0x508b50=await reevaluateFromCache(_0x287334[_0x86bbf7(0x1a8)],_0xfee129,{'tests':_0xe8af8b},{'evaluatorId':_0x380c97,'onTestStart':(_0x3fef0e,_0x45861e,_0xced3a1)=>{const _0x34ea79=_0x86bbf7;_0x2d0608['text']=_0x34ea79(0x1cc)+(_0x45861e+0x1)+'/'+_0xced3a1+':\x20'+_0x3fef0e+_0x34ea79(0x1c0);if(!_0x2d0608['isSpinning'])_0x2d0608['start']();},'onTestComplete':(_0x81916d,_0x6728a6)=>{const _0x5ce67b=_0x86bbf7;_0x2d0608[_0x5ce67b(0x226)]();if(_0x6728a6['status']==='PASS')console[_0x5ce67b(0x1fb)](a5_0x156d4c[_0x5ce67b(0x225)](_0x5ce67b(0x20b)+_0x81916d)+a5_0x156d4c[_0x5ce67b(0x1e4)](_0x5ce67b(0x1db)));else _0x6728a6['status']===_0x5ce67b(0x212)?console[_0x5ce67b(0x1fb)](a5_0x156d4c[_0x5ce67b(0x22f)](_0x5ce67b(0x1f7)+_0x81916d+_0x5ce67b(0x1ce)+_0x6728a6['reason'])+a5_0x156d4c[_0x5ce67b(0x1e4)](_0x5ce67b(0x1db))):console['log'](a5_0x156d4c[_0x5ce67b(0x22f)](_0x5ce67b(0x1eb)+_0x81916d+_0x5ce67b(0x1ce)+_0x6728a6[_0x5ce67b(0x1ed)]));_0x6728a6[_0x5ce67b(0x1f8)]&&console[_0x5ce67b(0x1fb)](a5_0x156d4c['dim'](_0x5ce67b(0x1cd)+_0x6728a6[_0x5ce67b(0x1f8)])),_0x56426['push'](_0x6728a6);},'onTestSkipped':(_0x13388f,_0x1aa11f)=>{const _0x4fc105=_0x86bbf7;_0x2d0608[_0x4fc105(0x226)](),console[_0x4fc105(0x1fb)](a5_0x156d4c[_0x4fc105(0x21f)](_0x4fc105(0x21c)+_0x13388f+_0x4fc105(0x1ce)+_0x1aa11f));}});for(const _0x2c1d1e of _0x508b50){!_0x56426[_0x86bbf7(0x1c2)](_0x4e2a01=>_0x4e2a01[_0x86bbf7(0x1d0)]===_0x2c1d1e[_0x86bbf7(0x1d0)])&&_0x56426['push'](_0x2c1d1e);}}catch(_0x1a695e){_0x2d0608[_0x86bbf7(0x226)]();const _0x331182=_0x1a695e instanceof Error?_0x1a695e[_0x86bbf7(0x1d7)]:String(_0x1a695e);return console[_0x86bbf7(0x1fb)](a5_0x156d4c[_0x86bbf7(0x22f)](_0x86bbf7(0x201)+_0x331182)),0x1;}_0x2d0608['stop']();if(_0x24ac2a['length']>0x0){console[_0x86bbf7(0x1fb)](),console[_0x86bbf7(0x1fb)](a5_0x156d4c[_0x86bbf7(0x1dc)](_0x86bbf7(0x224)));const {projectId:_0x1b119f,agentId:_0x18c969}=_0xfee129[_0x86bbf7(0x1b9)];for(const _0x44ca28 of _0x24ac2a){console[_0x86bbf7(0x1fb)](_0x86bbf7(0x228)+a5_0x156d4c[_0x86bbf7(0x1f5)](_0x44ca28[_0x86bbf7(0x1d0)]));const _0x1bf37e=createCommandSpinner(_0x86bbf7(0x1f1)+_0x44ca28[_0x86bbf7(0x200)][_0x86bbf7(0x203)]+_0x86bbf7(0x1c6));_0x1bf37e[_0x86bbf7(0x1df)]();try{const {result:_0x45baa9}=await runTest(_0x287334[_0x86bbf7(0x1a8)],_0x44ca28,{'agentId':_0x18c969,'projectId':_0x1b119f,'site':_0xfee129[_0x86bbf7(0x21b)],'noEval':![],'evaluatorId':_0x380c97,'onRoundStart':(_0x1d620b,_0x4c9a0b)=>{const _0x4816bf=_0x86bbf7;_0x1bf37e[_0x4816bf(0x216)]=_0x4816bf(0x1f3)+(_0x1d620b+0x1)+'/'+_0x4c9a0b+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x4c17f6,_0x1f48c3,_0x141eb2)=>{const _0x5c6d86=_0x86bbf7,_0x58768b=formatElapsed(_0x1f48c3);_0x141eb2?console[_0x5c6d86(0x1fb)](_0x5c6d86(0x1a4)+(_0x4c17f6+0x1)+'/'+_0x44ca28[_0x5c6d86(0x200)][_0x5c6d86(0x203)]+_0x5c6d86(0x1b4)+a5_0x156d4c['green']('✓')+'\x20('+_0x58768b+')'):console[_0x5c6d86(0x1fb)](_0x5c6d86(0x1a4)+(_0x4c17f6+0x1)+'/'+_0x44ca28['rounds']['length']+'...\x20'+a5_0x156d4c[_0x5c6d86(0x22f)]('✗'));},'onEvaluationStart':()=>{const _0x3f07b6=_0x86bbf7;_0x1bf37e['text']=_0x3f07b6(0x21a);},'onEvaluationComplete':_0x5479f3=>{const _0x43c197=_0x86bbf7,_0x20ca89=formatElapsed(_0x5479f3);console['log'](_0x43c197(0x1d1)+a5_0x156d4c['green']('✓')+'\x20('+_0x20ca89+')');}});_0x1bf37e[_0x86bbf7(0x226)](),_0x56426[_0x86bbf7(0x213)](_0x45baa9);if(_0x45baa9[_0x86bbf7(0x1bf)]===_0x86bbf7(0x1ca))console[_0x86bbf7(0x1fb)](a5_0x156d4c[_0x86bbf7(0x225)](_0x86bbf7(0x20b)+_0x45baa9[_0x86bbf7(0x1ed)])+a5_0x156d4c['dim'](_0x86bbf7(0x1a7)));else _0x45baa9[_0x86bbf7(0x1bf)]==='FAIL'?console['log'](a5_0x156d4c[_0x86bbf7(0x22f)](_0x86bbf7(0x1f7)+_0x45baa9[_0x86bbf7(0x1ed)])+a5_0x156d4c[_0x86bbf7(0x1e4)]('\x20(new)')):console[_0x86bbf7(0x1fb)](a5_0x156d4c[_0x86bbf7(0x22f)](_0x86bbf7(0x1eb)+_0x45baa9[_0x86bbf7(0x1ed)]));_0x45baa9[_0x86bbf7(0x1f8)]&&console[_0x86bbf7(0x1fb)](a5_0x156d4c['dim'](_0x86bbf7(0x1cd)+_0x45baa9[_0x86bbf7(0x1f8)]));}catch(_0x1826b2){_0x1bf37e[_0x86bbf7(0x226)]();const _0x2893e4=_0x1826b2 instanceof Error?_0x1826b2[_0x86bbf7(0x1d7)]:String(_0x1826b2);console[_0x86bbf7(0x1fb)](a5_0x156d4c[_0x86bbf7(0x22f)](_0x86bbf7(0x1eb)+_0x2893e4)),_0x56426[_0x86bbf7(0x213)]({'name':_0x44ca28['name'],'status':_0x86bbf7(0x1a1),'reason':_0x2893e4,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console[_0x86bbf7(0x1fb)]();const _0x614a4=Date[_0x86bbf7(0x1ec)]()-_0x2fd197,_0x5a2394=_0x56426[_0x86bbf7(0x208)](_0x11ce26=>_0x11ce26[_0x86bbf7(0x1bf)]===_0x86bbf7(0x1ca))[_0x86bbf7(0x203)],_0x4ab1a0=_0x56426[_0x86bbf7(0x208)](_0x3f54b4=>_0x3f54b4[_0x86bbf7(0x1bf)]===_0x86bbf7(0x212))[_0x86bbf7(0x203)],_0x49c49b=_0x56426[_0x86bbf7(0x208)](_0x5afb5e=>_0x5afb5e['status']===_0x86bbf7(0x1a1))[_0x86bbf7(0x203)];console[_0x86bbf7(0x1fb)]('━'[_0x86bbf7(0x20a)](0x3c)),console[_0x86bbf7(0x1fb)](_0x86bbf7(0x1de)),console['log']('━'['repeat'](0x3c)),console[_0x86bbf7(0x1fb)]('Total:\x20\x20\x20\x20'+_0x56426[_0x86bbf7(0x203)]),console['log'](_0x86bbf7(0x1c9)+a5_0x156d4c[_0x86bbf7(0x225)](_0x5a2394)),console['log'](_0x86bbf7(0x1d3)+a5_0x156d4c[_0x86bbf7(0x22f)](_0x4ab1a0));_0x49c49b>0x0&&console[_0x86bbf7(0x1fb)](_0x86bbf7(0x1d6)+a5_0x156d4c[_0x86bbf7(0x22f)](_0x49c49b));console['log']('Duration:\x20'+formatElapsed(_0x614a4)),console['log']('━'[_0x86bbf7(0x20a)](0x3c));const _0x261d49={'summary':{'total':_0x56426[_0x86bbf7(0x203)],'passed':_0x5a2394,'failed':_0x4ab1a0,'errors':_0x49c49b>0x0?_0x49c49b:undefined,'duration_ms':_0x614a4},'tests':_0x56426,'agent':{'project':_0x25bc48['projectName'],'name':_0x25bc48[_0x86bbf7(0x1c4)],'site':_0x5cc9f4},'timestamp':new Date(_0x2fd197)[_0x86bbf7(0x1bd)]()};if(_0x52e6f5!==_0x86bbf7(0x20f)||_0x2f9bc4){const _0x2655f1=formatResults(_0x261d49,_0x52e6f5);if(_0x2f9bc4)try{a5_0x512f45['writeFileSync'](_0x2f9bc4,_0x2655f1,_0x86bbf7(0x1f6)),console[_0x86bbf7(0x1fb)](),console[_0x86bbf7(0x1fb)](a5_0x156d4c[_0x86bbf7(0x1e4)](_0x86bbf7(0x1d4)+_0x2f9bc4));}catch(_0x3d25e1){return console[_0x86bbf7(0x1fb)](),console[_0x86bbf7(0x1fb)](a5_0x156d4c[_0x86bbf7(0x22f)](_0x86bbf7(0x20e)+_0x3d25e1)),0x1;}else console[_0x86bbf7(0x1fb)](),console[_0x86bbf7(0x1fb)](_0x2655f1);}const _0x4ae001=_0x56426['filter'](_0x5bba2c=>_0x5bba2c['status']!==_0x86bbf7(0x1ca));return _0x4ae001[_0x86bbf7(0x203)]>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0x45514c=a5_0x16cf;(function(_0x2d747e,_0x36645d){const _0x197bd4=a5_0x16cf,_0x48b945=_0x2d747e();while(!![]){try{const _0x3cfc6c=-parseInt(_0x197bd4(0x102))/0x1*(-parseInt(_0x197bd4(0x106))/0x2)+parseInt(_0x197bd4(0x10d))/0x3*(parseInt(_0x197bd4(0x11b))/0x4)+parseInt(_0x197bd4(0x132))/0x5+parseInt(_0x197bd4(0x16e))/0x6+parseInt(_0x197bd4(0x188))/0x7+-parseInt(_0x197bd4(0x124))/0x8+-parseInt(_0x197bd4(0x131))/0x9;if(_0x3cfc6c===_0x36645d)break;else _0x48b945['push'](_0x48b945['shift']());}catch(_0xb99f19){_0x48b945['push'](_0x48b945['shift']());}}}(a5_0x7b8b,0x6500f));import*as a5_0x485951 from'node:fs';function a5_0x16cf(_0x210e77,_0x12c56b){_0x210e77=_0x210e77-0xf7;const _0x7b8bdd=a5_0x7b8b();let _0x16cf8d=_0x7b8bdd[_0x210e77];return _0x16cf8d;}import*as a5_0x47b9cf from'node:path';import a5_0x4cca12 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_0x45514c(0x11e)]=a5_0x45514c(0x149);['description']='Run\x20tests\x20for\x20an\x20LLM\x20agent';async['execute'](_0x58a485){const _0x4ccc95=a5_0x45514c,{options:_0x17f9b8,args:_0x54f9a9,tdx:_0x26750e}=_0x58a485,_0x311756=_0x54f9a9[0x0]||'.',_0x4bdcf6=_0x17f9b8[_0x4ccc95(0x108)],_0x34e5b2=_0x17f9b8,_0x234c56=_0x34e5b2[_0x4ccc95(0x16d)]===![],_0x558667=_0x34e5b2[_0x4ccc95(0x174)],_0xde4a05=_0x34e5b2['name'],_0x520cbd=_0x34e5b2['tags'],_0x37c040=_0x17f9b8[_0x4ccc95(0x101)],_0x204b30=_0x34e5b2[_0x4ccc95(0x156)];if(_0x558667&&_0x234c56)return console['log'](a5_0x4cca12[_0x4ccc95(0x128)](_0x4ccc95(0x120))),0x1;let _0x2c4948='table';if(_0x34e5b2['json'])_0x2c4948=_0x4ccc95(0x155);else{if(_0x34e5b2[_0x4ccc95(0x10e)])_0x2c4948=_0x4ccc95(0x10e);else{if(_0x34e5b2['tsv'])_0x2c4948=_0x4ccc95(0x13d);else{if(_0x34e5b2[_0x4ccc95(0x119)])_0x2c4948=_0x4ccc95(0x119);}}}const _0x416fe9=_0x34e5b2[_0x4ccc95(0x159)];let _0x1a6849=_0x311756;const _0x160e00=a5_0x485951[_0x4ccc95(0x136)](_0x311756),_0x5ca60c=_0x311756==='.';if(!_0x160e00||_0x5ca60c){const _0x235b98=resolveProjectFromContext(_0x311756,_0x416fe9,{'requireFile':'test.yml'});if(_0x235b98[_0x4ccc95(0x12f)])_0x1a6849=_0x235b98[_0x4ccc95(0x143)],_0x235b98['source']===_0x4ccc95(0x134)&&console[_0x4ccc95(0x157)](a5_0x4cca12[_0x4ccc95(0x18c)](_0x4ccc95(0x14d)+_0x1a6849));else switch(_0x235b98[_0x4ccc95(0x162)]){case _0x4ccc95(0x11c):console['log'](a5_0x4cca12[_0x4ccc95(0x145)](_0x235b98['message'])),console[_0x4ccc95(0x157)](),console['log'](_0x4ccc95(0x117)),console[_0x4ccc95(0x157)](_0x4ccc95(0x142)),console[_0x4ccc95(0x157)](_0x4ccc95(0x15e)),console[_0x4ccc95(0x157)](),console['log'](_0x4ccc95(0x166));return 0x1;case _0x4ccc95(0x140):console[_0x4ccc95(0x157)](a5_0x4cca12[_0x4ccc95(0x145)](_0x235b98['message'])),console[_0x4ccc95(0x157)](),console['log'](_0x4ccc95(0xf7)+_0x235b98[_0x4ccc95(0x159)]+_0x4ccc95(0x17b));return 0x1;case _0x4ccc95(0x189):{const _0x213cd8=a5_0x47b9cf[_0x4ccc95(0x130)](_0x235b98[_0x4ccc95(0x143)]);console['log'](a5_0x4cca12[_0x4ccc95(0x145)](_0x4ccc95(0x115)+_0x235b98[_0x4ccc95(0x159)]+'\x22:'));for(const _0x36ca47 of _0x235b98[_0x4ccc95(0x123)]){console['log']('\x20\x20-\x20'+_0x36ca47);}return console[_0x4ccc95(0x157)](),console['log'](_0x4ccc95(0x127)+_0x213cd8+_0x4ccc95(0x122)),0x1;}case _0x4ccc95(0x18d):console['log'](a5_0x4cca12[_0x4ccc95(0x145)](_0x4ccc95(0x15b)+_0x235b98[_0x4ccc95(0x159)]+'\x22.')),console[_0x4ccc95(0x157)](a5_0x4cca12[_0x4ccc95(0x18c)](_0x4ccc95(0x16f)+_0x235b98[_0x4ccc95(0x143)])),console['log'](),console['log'](_0x4ccc95(0x138));return 0x1;}}const {definition:_0x417f05,agentInfo:_0x3afd5a}=parseTestFile(_0x1a6849);let _0x4dceb9=_0x417f05[_0x4ccc95(0xf9)];if(_0xde4a05){const _0x40bba8=_0xde4a05['split'](',')[_0x4ccc95(0x171)](_0x30632e=>_0x30632e[_0x4ccc95(0x165)]());_0x4dceb9=_0x417f05[_0x4ccc95(0xf9)][_0x4ccc95(0x187)](_0x556484=>_0x40bba8[_0x4ccc95(0x13e)](_0x556484[_0x4ccc95(0x11e)]));if(_0x4dceb9['length']===0x0)return console[_0x4ccc95(0x157)](a5_0x4cca12[_0x4ccc95(0x145)]('No\x20tests\x20found\x20matching:\x20'+_0xde4a05)),console[_0x4ccc95(0x157)](a5_0x4cca12[_0x4ccc95(0x18c)](_0x4ccc95(0x13f)+_0x417f05[_0x4ccc95(0xf9)][_0x4ccc95(0x171)](_0x17681e=>_0x17681e[_0x4ccc95(0x11e)])[_0x4ccc95(0x18a)](',\x20'))),0x1;}if(_0x520cbd){const _0x4a71b1=_0x520cbd[_0x4ccc95(0x109)](',')[_0x4ccc95(0x171)](_0x5c342b=>_0x5c342b[_0x4ccc95(0x165)]()['toLowerCase']());_0x4dceb9=_0x4dceb9['filter'](_0x2c40da=>_0x2c40da['tags']?.['some'](_0x552425=>_0x4a71b1[_0x4ccc95(0x13e)](_0x552425[_0x4ccc95(0x147)]())));if(_0x4dceb9[_0x4ccc95(0xfa)]===0x0){console[_0x4ccc95(0x157)](a5_0x4cca12[_0x4ccc95(0x145)](_0x4ccc95(0x18b)+_0x520cbd));const _0x203420=new Set();return _0x417f05[_0x4ccc95(0xf9)][_0x4ccc95(0x125)](_0x243bd6=>_0x243bd6[_0x4ccc95(0x14f)]?.[_0x4ccc95(0x125)](_0x421e3c=>_0x203420[_0x4ccc95(0xff)](_0x421e3c))),_0x203420[_0x4ccc95(0x172)]>0x0?console[_0x4ccc95(0x157)](a5_0x4cca12[_0x4ccc95(0x18c)](_0x4ccc95(0x15f)+[..._0x203420][_0x4ccc95(0x18a)](',\x20'))):console[_0x4ccc95(0x157)](a5_0x4cca12[_0x4ccc95(0x18c)](_0x4ccc95(0x14a))),0x1;}}if(_0x558667)return this['executeReeval'](_0x58a485,{'definition':{'tests':_0x4dceb9},'agentInfo':_0x3afd5a,'outputFormat':_0x2c4948,'outputFile':_0x204b30,'testNames':_0xde4a05});if(_0x4bdcf6){console['log'](a5_0x4cca12['cyan'](_0x4ccc95(0xf8))),console[_0x4ccc95(0x157)](_0x4ccc95(0x105)+a5_0x4cca12['white'](_0x37c040)),console[_0x4ccc95(0x157)]('\x20\x20Project:\x20'+a5_0x4cca12['white'](_0x3afd5a['projectName'])),console[_0x4ccc95(0x157)](_0x4ccc95(0x175)+a5_0x4cca12[_0x4ccc95(0x176)](_0x3afd5a[_0x4ccc95(0x10c)])),console[_0x4ccc95(0x157)](),console['log'](_0x4ccc95(0x180)+a5_0x4cca12['white'](_0x4dceb9['length']));for(let _0x5b5999=0x0;_0x5b5999<_0x4dceb9[_0x4ccc95(0xfa)];_0x5b5999++){const _0x450d01=_0x4dceb9[_0x5b5999],_0x53712e=_0x450d01['rounds'][_0x4ccc95(0xfa)]===0x1?_0x4ccc95(0x12d):'rounds',_0x517b07=_0x450d01['tags']?.[_0x4ccc95(0xfa)]?'\x20['+_0x450d01['tags']['join'](',\x20')+']':'';console[_0x4ccc95(0x157)]('\x20\x20'+(_0x5b5999+0x1)+'.\x20'+a5_0x4cca12[_0x4ccc95(0x176)](_0x450d01[_0x4ccc95(0x11e)])+'\x20('+_0x450d01['rounds'][_0x4ccc95(0xfa)]+'\x20'+_0x53712e+')'+a5_0x4cca12[_0x4ccc95(0x18c)](_0x517b07));}return 0x0;}let _0x1e210e,_0x3b6379;try{_0x1e210e=await _0x26750e['llm'][_0x4ccc95(0x10b)](_0x3afd5a[_0x4ccc95(0xfb)]);}catch(_0x2f3537){const _0x4f2924=_0x2f3537 instanceof Error?_0x2f3537[_0x4ccc95(0x12e)]:String(_0x2f3537);return _0x4f2924['includes'](_0x4ccc95(0x18f))||_0x4f2924[_0x4ccc95(0x147)]()[_0x4ccc95(0x13e)]('not\x20found')?console[_0x4ccc95(0x157)](a5_0x4cca12[_0x4ccc95(0x128)](_0x4ccc95(0x14e)+_0x3afd5a[_0x4ccc95(0xfb)])):console['log'](a5_0x4cca12['red']('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0x3afd5a['projectName']+_0x4ccc95(0x139)+_0x4f2924)),0x1;}try{_0x3b6379=await _0x26750e[_0x4ccc95(0x16a)]['resolveAgentId'](_0x3afd5a[_0x4ccc95(0x10c)],_0x1e210e);}catch(_0xbddb93){const _0xc5c0aa=_0xbddb93 instanceof Error?_0xbddb93['message']:String(_0xbddb93);return _0xc5c0aa[_0x4ccc95(0x13e)](_0x4ccc95(0x18f))||_0xc5c0aa['toLowerCase']()['includes'](_0x4ccc95(0x104))?console[_0x4ccc95(0x157)](a5_0x4cca12[_0x4ccc95(0x128)](_0x4ccc95(0x150)+_0x3afd5a[_0x4ccc95(0x10c)])):console['log'](a5_0x4cca12[_0x4ccc95(0x128)](_0x4ccc95(0x107)+_0x3afd5a[_0x4ccc95(0x10c)]+'\x22:\x20'+_0xc5c0aa)),0x1;}let _0x204322;if(!_0x234c56)try{_0x204322=await setupEvaluatorAgent(_0x26750e[_0x4ccc95(0x16a)],_0x17f9b8[_0x4ccc95(0xfe)]);}catch(_0x53b912){const _0x27215e=_0x53b912 instanceof Error?_0x53b912['message']:String(_0x53b912);return console[_0x4ccc95(0x157)](a5_0x4cca12[_0x4ccc95(0x128)](_0x4ccc95(0x151)+_0x27215e)),0x1;}console[_0x4ccc95(0x157)](a5_0x4cca12[_0x4ccc95(0x17f)](_0x4ccc95(0x173))),console[_0x4ccc95(0x157)](_0x4ccc95(0x184)+a5_0x4cca12['white'](_0x37c040)),console[_0x4ccc95(0x157)](_0x4ccc95(0x110)+a5_0x4cca12[_0x4ccc95(0x176)](_0x3afd5a[_0x4ccc95(0xfb)]+'/'+_0x3afd5a['agentName'])),console[_0x4ccc95(0x157)]();const _0x349891=[],_0x216a84=[],_0x52cd10=Date[_0x4ccc95(0x15a)]();for(let _0x5b37cc=0x0;_0x5b37cc<_0x4dceb9[_0x4ccc95(0xfa)];_0x5b37cc++){const _0x21ced3=_0x4dceb9[_0x5b37cc];_0x4dceb9[_0x4ccc95(0xfa)]>0x1?console['log'](_0x4ccc95(0x17a)+(_0x5b37cc+0x1)+'/'+_0x4dceb9['length']+':\x20'+a5_0x4cca12[_0x4ccc95(0x176)](_0x21ced3[_0x4ccc95(0x11e)])):console[_0x4ccc95(0x157)](_0x4ccc95(0x111)+a5_0x4cca12[_0x4ccc95(0x176)](_0x21ced3[_0x4ccc95(0x11e)]));const _0x25900c=createCommandSpinner(_0x4ccc95(0x161)+_0x21ced3[_0x4ccc95(0x148)][_0x4ccc95(0xfa)]+_0x4ccc95(0x160));_0x25900c[_0x4ccc95(0x177)]();try{const {result:_0x11eb96,conversation:_0x1616c9}=await runTest(_0x26750e[_0x4ccc95(0x16a)],_0x21ced3,{'agentId':_0x3b6379,'projectId':_0x1e210e,'site':_0x37c040,'noEval':_0x234c56,'evaluatorId':_0x204322,'onRoundStart':(_0x4ba09a,_0x2a297d)=>{const _0xfbfc28=_0x4ccc95;_0x25900c[_0xfbfc28(0x103)]='Round\x20'+(_0x4ba09a+0x1)+'/'+_0x2a297d+_0xfbfc28(0x160);},'onRoundComplete':(_0x2e15ac,_0x22e687,_0x50e4c3)=>{const _0x4f6dda=_0x4ccc95,_0x17ace3=formatElapsed(_0x22e687);_0x50e4c3?console[_0x4f6dda(0x157)]('\x20\x20Round\x20'+(_0x2e15ac+0x1)+'/'+_0x21ced3[_0x4f6dda(0x148)][_0x4f6dda(0xfa)]+_0x4f6dda(0x152)+a5_0x4cca12[_0x4f6dda(0x133)]('✓')+'\x20('+_0x17ace3+')'):console[_0x4f6dda(0x157)](_0x4f6dda(0x191)+(_0x2e15ac+0x1)+'/'+_0x21ced3['rounds']['length']+_0x4f6dda(0x152)+a5_0x4cca12[_0x4f6dda(0x128)]('✗'));},'onEvaluationStart':()=>{const _0x122ac6=_0x4ccc95;_0x25900c[_0x122ac6(0x103)]=_0x122ac6(0x137);},'onEvaluationComplete':_0x1462fc=>{const _0x2fff30=_0x4ccc95,_0x3d6e53=formatElapsed(_0x1462fc);console[_0x2fff30(0x157)](_0x2fff30(0x17c)+a5_0x4cca12[_0x2fff30(0x133)]('✓')+'\x20('+_0x3d6e53+')');}});_0x25900c[_0x4ccc95(0x183)](),_0x349891['push'](_0x11eb96),_0x216a84['push'](_0x1616c9);if(_0x11eb96[_0x4ccc95(0x118)]===_0x4ccc95(0x141))console[_0x4ccc95(0x157)](a5_0x4cca12[_0x4ccc95(0x133)](_0x4ccc95(0x13c)+_0x11eb96[_0x4ccc95(0x162)]));else _0x11eb96[_0x4ccc95(0x118)]==='FAIL'?console[_0x4ccc95(0x157)](a5_0x4cca12[_0x4ccc95(0x128)](_0x4ccc95(0x11d)+_0x11eb96['reason'])):console[_0x4ccc95(0x157)](a5_0x4cca12[_0x4ccc95(0x128)](_0x4ccc95(0x167)+_0x11eb96[_0x4ccc95(0x162)]));_0x11eb96[_0x4ccc95(0x168)]&&console[_0x4ccc95(0x157)](a5_0x4cca12[_0x4ccc95(0x18c)](_0x4ccc95(0x11a)+_0x11eb96['conversation_url'])),console['log']();}catch(_0x55b299){_0x25900c[_0x4ccc95(0x183)]();const _0x5e3e04=_0x55b299 instanceof Error?_0x55b299[_0x4ccc95(0x12e)]:String(_0x55b299);console[_0x4ccc95(0x157)](a5_0x4cca12['red'](_0x4ccc95(0x167)+_0x5e3e04)),console[_0x4ccc95(0x157)](),_0x349891['push']({'name':_0x21ced3[_0x4ccc95(0x11e)],'status':_0x4ccc95(0x10f),'reason':_0x5e3e04,'timestamp':new Date()[_0x4ccc95(0x113)](),'duration_ms':0x0});}}const _0x3b2378=Date[_0x4ccc95(0x15a)]()-_0x52cd10,_0x1a4551=_0x349891[_0x4ccc95(0x187)](_0x3d6c92=>_0x3d6c92['status']===_0x4ccc95(0x141))['length'],_0x33ff8a=_0x349891[_0x4ccc95(0x187)](_0x31edd2=>_0x31edd2['status']==='FAIL')[_0x4ccc95(0xfa)],_0x274e36=_0x349891['filter'](_0x198e31=>_0x198e31[_0x4ccc95(0x118)]===_0x4ccc95(0x10f))[_0x4ccc95(0xfa)];console[_0x4ccc95(0x157)]('━'[_0x4ccc95(0x12a)](0x3c)),console[_0x4ccc95(0x157)](_0x4ccc95(0x153)),console['log']('━'[_0x4ccc95(0x12a)](0x3c)),console[_0x4ccc95(0x157)](_0x4ccc95(0x179)+_0x349891[_0x4ccc95(0xfa)]),console['log']('Passed:\x20\x20\x20'+a5_0x4cca12[_0x4ccc95(0x133)](_0x1a4551)),console[_0x4ccc95(0x157)](_0x4ccc95(0xfc)+a5_0x4cca12['red'](_0x33ff8a));_0x274e36>0x0&&console[_0x4ccc95(0x157)](_0x4ccc95(0x14b)+a5_0x4cca12[_0x4ccc95(0x128)](_0x274e36));console[_0x4ccc95(0x157)](_0x4ccc95(0x100)+formatElapsed(_0x3b2378)),console[_0x4ccc95(0x157)]('━'[_0x4ccc95(0x12a)](0x3c));const _0x200d1a=_0x349891[_0x4ccc95(0x187)](_0xc95340=>_0xc95340['status']!==_0x4ccc95(0x141));if(_0x200d1a[_0x4ccc95(0xfa)]>0x0){console[_0x4ccc95(0x157)](),console['log'](_0x4ccc95(0x126));for(const _0x1832ca of _0x200d1a){const _0xb74298=a5_0x4cca12['red']('✗'),_0x34a988=_0x1832ca[_0x4ccc95(0x162)][_0x4ccc95(0xfa)]>0x32?_0x1832ca['reason']['substring'](0x0,0x32)+_0x4ccc95(0x11f):_0x1832ca['reason'];console[_0x4ccc95(0x157)]('\x20\x20'+_0xb74298+'\x20'+_0x1832ca['name']+':\x20'+_0x34a988);}}const _0x202315={'summary':{'total':_0x349891['length'],'passed':_0x1a4551,'failed':_0x33ff8a,'errors':_0x274e36>0x0?_0x274e36:undefined,'duration_ms':_0x3b2378},'tests':_0x349891,'agent':{'project':_0x3afd5a['projectName'],'name':_0x3afd5a[_0x4ccc95(0x10c)],'site':_0x37c040},'timestamp':new Date(_0x52cd10)['toISOString']()};try{const _0x19d23e=buildCachedTestRun(_0x216a84,{'site':_0x37c040,'projectId':_0x1e210e,'projectName':_0x3afd5a[_0x4ccc95(0xfb)],'agentId':_0x3b6379,'agentName':_0x3afd5a['agentName'],'testYmlPath':a5_0x47b9cf[_0x4ccc95(0x16b)](_0x3afd5a['testYmlPath'])});saveLastTestRun(_0x19d23e);}catch{}if(_0x2c4948!=='table'||_0x204b30){const _0x58d029=formatResults(_0x202315,_0x2c4948);if(_0x204b30)try{a5_0x485951[_0x4ccc95(0x158)](_0x204b30,_0x58d029,'utf-8'),console[_0x4ccc95(0x157)](),console[_0x4ccc95(0x157)](a5_0x4cca12[_0x4ccc95(0x18c)](_0x4ccc95(0x13b)+_0x204b30));}catch(_0x18088c){return console[_0x4ccc95(0x157)](),console[_0x4ccc95(0x157)](a5_0x4cca12['red'](_0x4ccc95(0x164)+_0x18088c)),0x1;}else console[_0x4ccc95(0x157)](),console[_0x4ccc95(0x157)](_0x58d029);}return _0x200d1a['length']>0x0?0x1:0x0;}async[a5_0x45514c(0x135)](_0x548e89,_0x4cc5b5){const _0x1f4ca0=a5_0x45514c,{options:_0x426e94,tdx:_0x1e9123}=_0x548e89,{definition:_0x488158,agentInfo:_0x3223e9,outputFormat:_0x50f10a,outputFile:_0x4e1d99}=_0x4cc5b5,_0x2653c2=_0x426e94['site'],_0x4ab948=loadLastTestRun();if(!_0x4ab948)return console['log'](a5_0x4cca12['red'](_0x1f4ca0(0x170))),console[_0x1f4ca0(0x157)](a5_0x4cca12[_0x1f4ca0(0x18c)](_0x1f4ca0(0x17d))),0x1;if(_0x4ab948['agent'][_0x1f4ca0(0x10c)]!==_0x3223e9[_0x1f4ca0(0x10c)])return console['log'](a5_0x4cca12[_0x1f4ca0(0x128)](_0x1f4ca0(0x15c)+_0x4ab948[_0x1f4ca0(0x112)]['agentName']+_0x1f4ca0(0x182)+_0x3223e9[_0x1f4ca0(0x10c)]+'\x22.')),console[_0x1f4ca0(0x157)](a5_0x4cca12[_0x1f4ca0(0x18c)](_0x1f4ca0(0x185))),0x1;const _0x51fd06=new Set(_0x4ab948['conversations'][_0x1f4ca0(0x171)](_0x4c3888=>_0x4c3888[_0x1f4ca0(0x129)])),_0x34f0eb=_0x488158['tests'][_0x1f4ca0(0x187)](_0x25db73=>!_0x51fd06[_0x1f4ca0(0xfd)](_0x25db73[_0x1f4ca0(0x11e)]));if(_0x34f0eb['length']>0x0&&_0x4ab948[_0x1f4ca0(0x101)]!==_0x2653c2)return console[_0x1f4ca0(0x157)](a5_0x4cca12[_0x1f4ca0(0x128)](_0x1f4ca0(0x114))),console[_0x1f4ca0(0x157)](a5_0x4cca12['dim']('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x4ab948[_0x1f4ca0(0x101)]+_0x1f4ca0(0x18e)+_0x2653c2+'\x22.')),console[_0x1f4ca0(0x157)](a5_0x4cca12['dim']('Either\x20switch\x20to\x20the\x20\x22'+_0x4ab948['site']+_0x1f4ca0(0x169))),0x1;const _0x4f45be=_0x488158[_0x1f4ca0(0xf9)][_0x1f4ca0(0x187)](_0x4a46a4=>_0x51fd06['has'](_0x4a46a4[_0x1f4ca0(0x11e)])),_0x54325b=_0x34f0eb;let _0x7f7050;try{_0x7f7050=await setupEvaluatorAgent(_0x1e9123[_0x1f4ca0(0x16a)],_0x426e94[_0x1f4ca0(0xfe)]);}catch(_0xf5ab31){const _0x15c481=_0xf5ab31 instanceof Error?_0xf5ab31[_0x1f4ca0(0x12e)]:String(_0xf5ab31);return console['log'](a5_0x4cca12[_0x1f4ca0(0x128)](_0x1f4ca0(0x151)+_0x15c481)),0x1;}console[_0x1f4ca0(0x157)](a5_0x4cca12[_0x1f4ca0(0x17f)]('Re-evaluating\x20cached\x20test\x20run...')),console[_0x1f4ca0(0x157)]('Cached\x20run\x20from:\x20'+a5_0x4cca12[_0x1f4ca0(0x176)](_0x4ab948['timestamp'])),console['log'](_0x1f4ca0(0x110)+a5_0x4cca12['white'](_0x4ab948[_0x1f4ca0(0x112)][_0x1f4ca0(0xfb)]+'/'+_0x4ab948[_0x1f4ca0(0x112)]['agentName']));_0x54325b[_0x1f4ca0(0xfa)]>0x0&&console[_0x1f4ca0(0x157)](_0x1f4ca0(0x16c)+a5_0x4cca12[_0x1f4ca0(0x145)](_0x54325b[_0x1f4ca0(0xfa)]));console['log']();const _0x325ca5=[],_0xa9e1c9=Date[_0x1f4ca0(0x15a)](),_0x6e6b54=createCommandSpinner(_0x1f4ca0(0x178));if(_0x4f45be[_0x1f4ca0(0xfa)]>0x0)try{const _0x3d0148=await reevaluateFromCache(_0x1e9123['llm'],_0x4ab948,{'tests':_0x4f45be},{'evaluatorId':_0x7f7050,'onTestStart':(_0x53829e,_0x4d94e0,_0x1157f5)=>{const _0x5d9647=_0x1f4ca0;_0x6e6b54[_0x5d9647(0x103)]=_0x5d9647(0x12c)+(_0x4d94e0+0x1)+'/'+_0x1157f5+':\x20'+_0x53829e+_0x5d9647(0x11f);if(!_0x6e6b54[_0x5d9647(0x116)])_0x6e6b54[_0x5d9647(0x177)]();},'onTestComplete':(_0x4bab51,_0x15b10b)=>{const _0x261a71=_0x1f4ca0;_0x6e6b54[_0x261a71(0x183)]();if(_0x15b10b[_0x261a71(0x118)]===_0x261a71(0x141))console[_0x261a71(0x157)](a5_0x4cca12[_0x261a71(0x133)](_0x261a71(0x13c)+_0x4bab51)+a5_0x4cca12[_0x261a71(0x18c)](_0x261a71(0x186)));else _0x15b10b[_0x261a71(0x118)]===_0x261a71(0x146)?console['log'](a5_0x4cca12['red'](_0x261a71(0x11d)+_0x4bab51+_0x261a71(0x10a)+_0x15b10b[_0x261a71(0x162)])+a5_0x4cca12[_0x261a71(0x18c)](_0x261a71(0x186))):console[_0x261a71(0x157)](a5_0x4cca12['red'](_0x261a71(0x167)+_0x4bab51+'\x20-\x20'+_0x15b10b['reason']));_0x15b10b[_0x261a71(0x168)]&&console['log'](a5_0x4cca12[_0x261a71(0x18c)](_0x261a71(0x13a)+_0x15b10b['conversation_url'])),_0x325ca5[_0x261a71(0x14c)](_0x15b10b);},'onTestSkipped':(_0x217b24,_0x3b52f7)=>{const _0x31a995=_0x1f4ca0;_0x6e6b54[_0x31a995(0x183)](),console[_0x31a995(0x157)](a5_0x4cca12['yellow'](_0x31a995(0x154)+_0x217b24+_0x31a995(0x10a)+_0x3b52f7));}});for(const _0x409f4d of _0x3d0148){!_0x325ca5[_0x1f4ca0(0x17e)](_0x52d964=>_0x52d964[_0x1f4ca0(0x11e)]===_0x409f4d['name'])&&_0x325ca5[_0x1f4ca0(0x14c)](_0x409f4d);}}catch(_0xbee53e){_0x6e6b54[_0x1f4ca0(0x183)]();const _0x596ab0=_0xbee53e instanceof Error?_0xbee53e['message']:String(_0xbee53e);return console['log'](a5_0x4cca12[_0x1f4ca0(0x128)]('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0x596ab0)),0x1;}_0x6e6b54['stop']();if(_0x54325b[_0x1f4ca0(0xfa)]>0x0){console['log'](),console['log'](a5_0x4cca12[_0x1f4ca0(0x17f)](_0x1f4ca0(0x190)));const {projectId:_0x10347d,agentId:_0x34a9ef}=_0x4ab948[_0x1f4ca0(0x112)];for(const _0x1ade5f of _0x54325b){console['log'](_0x1f4ca0(0x121)+a5_0x4cca12['white'](_0x1ade5f[_0x1f4ca0(0x11e)]));const _0x3842f7=createCommandSpinner(_0x1f4ca0(0x161)+_0x1ade5f[_0x1f4ca0(0x148)][_0x1f4ca0(0xfa)]+':\x20Sending\x20user\x20input...');_0x3842f7[_0x1f4ca0(0x177)]();try{const {result:_0x9e7c11}=await runTest(_0x1e9123['llm'],_0x1ade5f,{'agentId':_0x34a9ef,'projectId':_0x10347d,'site':_0x4ab948[_0x1f4ca0(0x101)],'noEval':![],'evaluatorId':_0x7f7050,'onRoundStart':(_0xfad42b,_0x1a0236)=>{const _0xd28c4e=_0x1f4ca0;_0x3842f7[_0xd28c4e(0x103)]=_0xd28c4e(0x144)+(_0xfad42b+0x1)+'/'+_0x1a0236+_0xd28c4e(0x160);},'onRoundComplete':(_0x5af63d,_0x5dd91e,_0x317c78)=>{const _0x5cbc8c=_0x1f4ca0,_0xf2ef4a=formatElapsed(_0x5dd91e);_0x317c78?console['log'](_0x5cbc8c(0x191)+(_0x5af63d+0x1)+'/'+_0x1ade5f[_0x5cbc8c(0x148)]['length']+_0x5cbc8c(0x152)+a5_0x4cca12['green']('✓')+'\x20('+_0xf2ef4a+')'):console['log'](_0x5cbc8c(0x191)+(_0x5af63d+0x1)+'/'+_0x1ade5f['rounds'][_0x5cbc8c(0xfa)]+_0x5cbc8c(0x152)+a5_0x4cca12[_0x5cbc8c(0x128)]('✗'));},'onEvaluationStart':()=>{const _0x154eb4=_0x1f4ca0;_0x3842f7[_0x154eb4(0x103)]='Evaluating\x20response...';},'onEvaluationComplete':_0x5265a6=>{const _0x4556af=_0x1f4ca0,_0x3dbe12=formatElapsed(_0x5265a6);console[_0x4556af(0x157)](_0x4556af(0x17c)+a5_0x4cca12['green']('✓')+'\x20('+_0x3dbe12+')');}});_0x3842f7['stop'](),_0x325ca5[_0x1f4ca0(0x14c)](_0x9e7c11);if(_0x9e7c11[_0x1f4ca0(0x118)]===_0x1f4ca0(0x141))console[_0x1f4ca0(0x157)](a5_0x4cca12['green'](_0x1f4ca0(0x13c)+_0x9e7c11['reason'])+a5_0x4cca12[_0x1f4ca0(0x18c)](_0x1f4ca0(0x163)));else _0x9e7c11['status']===_0x1f4ca0(0x146)?console['log'](a5_0x4cca12['red']('✗\x20FAIL:\x20'+_0x9e7c11[_0x1f4ca0(0x162)])+a5_0x4cca12[_0x1f4ca0(0x18c)](_0x1f4ca0(0x163))):console['log'](a5_0x4cca12['red'](_0x1f4ca0(0x167)+_0x9e7c11[_0x1f4ca0(0x162)]));_0x9e7c11[_0x1f4ca0(0x168)]&&console[_0x1f4ca0(0x157)](a5_0x4cca12[_0x1f4ca0(0x18c)](_0x1f4ca0(0x13a)+_0x9e7c11[_0x1f4ca0(0x168)]));}catch(_0x54a6da){_0x3842f7[_0x1f4ca0(0x183)]();const _0x148135=_0x54a6da instanceof Error?_0x54a6da[_0x1f4ca0(0x12e)]:String(_0x54a6da);console['log'](a5_0x4cca12[_0x1f4ca0(0x128)](_0x1f4ca0(0x167)+_0x148135)),_0x325ca5[_0x1f4ca0(0x14c)]({'name':_0x1ade5f[_0x1f4ca0(0x11e)],'status':_0x1f4ca0(0x10f),'reason':_0x148135,'timestamp':new Date()[_0x1f4ca0(0x113)](),'duration_ms':0x0});}}}console[_0x1f4ca0(0x157)]();const _0x249cd3=Date[_0x1f4ca0(0x15a)]()-_0xa9e1c9,_0x478752=_0x325ca5[_0x1f4ca0(0x187)](_0x2cfdda=>_0x2cfdda[_0x1f4ca0(0x118)]===_0x1f4ca0(0x141))['length'],_0x33d05b=_0x325ca5[_0x1f4ca0(0x187)](_0x2db6a5=>_0x2db6a5[_0x1f4ca0(0x118)]===_0x1f4ca0(0x146))['length'],_0x47f373=_0x325ca5[_0x1f4ca0(0x187)](_0x4054ab=>_0x4054ab['status']===_0x1f4ca0(0x10f))[_0x1f4ca0(0xfa)];console[_0x1f4ca0(0x157)]('━'['repeat'](0x3c)),console[_0x1f4ca0(0x157)](_0x1f4ca0(0x15d)),console[_0x1f4ca0(0x157)]('━'[_0x1f4ca0(0x12a)](0x3c)),console[_0x1f4ca0(0x157)](_0x1f4ca0(0x179)+_0x325ca5[_0x1f4ca0(0xfa)]),console['log'](_0x1f4ca0(0x181)+a5_0x4cca12[_0x1f4ca0(0x133)](_0x478752)),console[_0x1f4ca0(0x157)]('Failed:\x20\x20\x20'+a5_0x4cca12[_0x1f4ca0(0x128)](_0x33d05b));_0x47f373>0x0&&console['log']('Errors:\x20\x20\x20'+a5_0x4cca12[_0x1f4ca0(0x128)](_0x47f373));console[_0x1f4ca0(0x157)](_0x1f4ca0(0x100)+formatElapsed(_0x249cd3)),console[_0x1f4ca0(0x157)]('━'[_0x1f4ca0(0x12a)](0x3c));const _0x1b3069={'summary':{'total':_0x325ca5[_0x1f4ca0(0xfa)],'passed':_0x478752,'failed':_0x33d05b,'errors':_0x47f373>0x0?_0x47f373:undefined,'duration_ms':_0x249cd3},'tests':_0x325ca5,'agent':{'project':_0x3223e9[_0x1f4ca0(0xfb)],'name':_0x3223e9['agentName'],'site':_0x2653c2},'timestamp':new Date(_0xa9e1c9)[_0x1f4ca0(0x113)]()};if(_0x50f10a!==_0x1f4ca0(0x119)||_0x4e1d99){const _0x59dd49=formatResults(_0x1b3069,_0x50f10a);if(_0x4e1d99)try{a5_0x485951[_0x1f4ca0(0x158)](_0x4e1d99,_0x59dd49,_0x1f4ca0(0x12b)),console[_0x1f4ca0(0x157)](),console[_0x1f4ca0(0x157)](a5_0x4cca12[_0x1f4ca0(0x18c)](_0x1f4ca0(0x13b)+_0x4e1d99));}catch(_0x3cf439){return console[_0x1f4ca0(0x157)](),console[_0x1f4ca0(0x157)](a5_0x4cca12[_0x1f4ca0(0x128)]('Error\x20writing\x20output\x20file:\x20'+_0x3cf439)),0x1;}else console[_0x1f4ca0(0x157)](),console[_0x1f4ca0(0x157)](_0x59dd49);}const _0x5db090=_0x325ca5[_0x1f4ca0(0x187)](_0x36fcc5=>_0x36fcc5[_0x1f4ca0(0x118)]!==_0x1f4ca0(0x141));return _0x5db090[_0x1f4ca0(0xfa)]>0x0?0x1:0x0;}}function a5_0x7b8b(){const _0x5f1e70=['7930269UxYuhT','920565eivvIf','green','context','executeReeval','existsSync','Evaluating\x20response...','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','\x22:\x20','\x20\x20Conversation:\x20','Output\x20written\x20to:\x20','✓\x20PASS:\x20','tsv','includes','Available\x20tests:\x20','no_local_folder','PASS','\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','projectDir','Round\x20','yellow','FAIL','toLowerCase','rounds','agent:test','No\x20tests\x20have\x20tags\x20defined.','Errors:\x20\x20\x20','push','Using\x20agent:\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','tags','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','...\x20','Test\x20Summary','⚠\x20SKIPPED:\x20','json','output','log','writeFileSync','llmProject','now','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','Re-evaluation\x20Summary','\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)','Available\x20tags:\x20',':\x20Sending\x20user\x20input...','Round\x201/','reason','\x20(new)','Error\x20writing\x20output\x20file:\x20','trim','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','✗\x20ERROR:\x20','conversation_url','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','llm','resolve','New\x20tests\x20to\x20execute:\x20','eval','629838PxByvy','Project\x20path:\x20','Error:\x20No\x20previous\x20test\x20run\x20found.','map','size','Running\x20agent\x20tests...','reeval','\x20\x20Agent:\x20','white','start','Re-evaluating...','Total:\x20\x20\x20\x20','Test\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x20\x20Evaluating...\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','find','cyan','Tests\x20found:\x20','Passed:\x20\x20\x20','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','stop','Site:\x20','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','\x20(cached)','filter','320964OBASTG','multiple_agents','join','No\x20tests\x20found\x20with\x20tags:\x20','dim','no_tests','\x22,\x20but\x20current\x20site\x20is\x20\x22','404','Executing\x20new\x20tests...','\x20\x20Round\x20','Run\x20\x27tdx\x20agent\x20pull\x20','Test\x20Configuration:','tests','length','projectName','Failed:\x20\x20\x20','has','verbose','add','Duration:\x20','site','9iQVDGP','text','not\x20found','\x20\x20Site:\x20','110578AVqcfx','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','dryRun','split','\x20-\x20','resolveProjectId','agentName','16356klRKtH','jsonl','ERROR','Agent:\x20','Running\x20test:\x20','agent','toISOString','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','isSpinning','Usage:','status','table','Conversation\x20URL:\x20','400gWRCCK','no_context','✗\x20FAIL:\x20','name','...','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','Running:\x20','/<agent-name>','agentDirs','663096NbJsPf','forEach','Failed\x20Tests:','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','red','testName','repeat','utf-8','Re-evaluating\x20','round','message','found','basename'];a5_0x7b8b=function(){return _0x5f1e70;};return a5_0x7b8b();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a6_0x3af6(_0x344e96,_0x1f74bf){_0x344e96=_0x344e96-0x1ca;const _0x1fdde3=a6_0x1fdd();let _0x3af6e0=_0x1fdde3[_0x344e96];return _0x3af6e0;}const a6_0x1c5247=a6_0x3af6;(function(_0x5bb30e,_0x252a25){const _0x484b4b=a6_0x3af6,_0xfc0033=_0x5bb30e();while(!![]){try{const _0x46bb20=-parseInt(_0x484b4b(0x20f))/0x1*(-parseInt(_0x484b4b(0x1ea))/0x2)+-parseInt(_0x484b4b(0x1e7))/0x3+parseInt(_0x484b4b(0x1d9))/0x4*(-parseInt(_0x484b4b(0x20e))/0x5)+parseInt(_0x484b4b(0x1f1))/0x6*(parseInt(_0x484b4b(0x1e2))/0x7)+parseInt(_0x484b4b(0x1d0))/0x8+parseInt(_0x484b4b(0x1d6))/0x9+-parseInt(_0x484b4b(0x1ca))/0xa;if(_0x46bb20===_0x252a25)break;else _0xfc0033['push'](_0xfc0033['shift']());}catch(_0x19757f){_0xfc0033['push'](_0xfc0033['shift']());}}}(a6_0x1fdd,0x5641c));import{BaseCommand}from'./command.js';function a6_0x1fdd(){const _0x19de83=['workflow','Error:\x20','trino','substring','error','498060fuPgbJ','api','Endpoint\x20must\x20start\x20with\x20/:\x20','32876CfgpYP','Invalid\x20HTTP\x20method:\x20','validate','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','llm','.\x20Valid\x20methods:\x20','header','Invalid\x20header\x20format:\x20\x22','data','459753lGrynT','set-cookie','has','Results\x20saved\x20to\x20','method','1051155WBpWVY','color','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','134HVPaVw','name','proxy-authorization','file','description','join','DELETE','42fShwoZ','headers','toUpperCase','log','GET','type','<\x20HTTP/1.1\x20','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','keys','\x0aStack\x20trace:\x0a','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','startsWith','POST','cookie','stack','trim','verbose','set-cookie2','output','status','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','cdp','.\x20Valid\x20types:\x20','authorization','readBodyFromFile','x-auth-token','entries','message','PATCH','365uDzSTi','10095QwuxGL','4835480HJCnJV','\x22.\x20','indexOf','execute','toLowerCase','noColor','4766160DZrjJG'];a6_0x1fdd=function(){return _0x19de83;};return a6_0x1fdd();}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_0x1c5247(0x208),a6_0x1c5247(0x1ec),a6_0x1c5247(0x1fe),a6_0x1c5247(0x1e3),a6_0x1c5247(0x202),'x-xsrf-token',a6_0x1c5247(0x20a),'x-trino-user']);function isSensitiveHeader(_0x5cda35){const _0x43d9e6=a6_0x1c5247;return SENSITIVE_HEADERS[_0x43d9e6(0x1e4)](_0x5cda35[_0x43d9e6(0x1ce)]());}function parseHeader(_0x20a8b7){const _0x362b98=a6_0x1c5247,_0x19d295=_0x20a8b7[_0x362b98(0x1cc)](':');if(_0x19d295===-0x1)throw new Error(_0x362b98(0x1e0)+_0x20a8b7+_0x362b98(0x1cb)+_0x362b98(0x205));const _0x4b37f9=_0x20a8b7[_0x362b98(0x1d4)](0x0,_0x19d295)[_0x362b98(0x200)](),_0x2c778c=_0x20a8b7['substring'](_0x19d295+0x1)['trim']();if(!_0x4b37f9)throw new Error(_0x362b98(0x1f8)+_0x20a8b7+'\x22');return[_0x4b37f9,_0x2c778c];}export class ApiCommand extends BaseCommand{[a6_0x1c5247(0x1eb)]='api';[a6_0x1c5247(0x1ee)]=a6_0x1c5247(0x1e9);[a6_0x1c5247(0x1db)](_0x12cde8){const _0x26d77e=a6_0x1c5247,{args:_0x8efb80,options:_0x644c13}=_0x12cde8,_0x2c9940=_0x644c13;if(_0x8efb80['length']===0x0)return _0x26d77e(0x1fb);const _0x4bba3a=_0x8efb80[0x0];if(!_0x4bba3a[_0x26d77e(0x1fc)]('/'))return _0x26d77e(0x1d8)+_0x4bba3a;const _0x25597c=_0x2c9940[_0x26d77e(0x1e1)],_0x3e5e=_0x2c9940[_0x26d77e(0x1ed)];if(_0x25597c&&_0x3e5e)return _0x26d77e(0x1dc);const _0x46932a=_0x2c9940['method']||_0x26d77e(0x1f5),_0x85d088=[_0x26d77e(0x1f5),_0x26d77e(0x1fd),'PUT',_0x26d77e(0x1f0),_0x26d77e(0x20d)];if(!_0x85d088['includes'](_0x46932a['toUpperCase']()))return _0x26d77e(0x1da)+_0x46932a+_0x26d77e(0x1de)+_0x85d088['join'](',\x20');const _0x5737b7=_0x2c9940['type']||'td',_0x140995=['td',_0x26d77e(0x206),_0x26d77e(0x1d1),_0x26d77e(0x1d3),_0x26d77e(0x1dd),'llm-proxy'];if(!_0x140995['includes'](_0x5737b7))return'Invalid\x20API\x20type:\x20'+_0x5737b7+_0x26d77e(0x207)+_0x140995[_0x26d77e(0x1ef)](',\x20');return undefined;}async[a6_0x1c5247(0x1cd)](_0x91b720){const _0x7cca6=a6_0x1c5247,{options:_0xd3cce6,args:_0x47a01e,tdx:_0x1cca14}=_0x91b720,_0x506a6c=_0xd3cce6,_0x369a51=_0x47a01e[0x0],_0x17517a=(_0x506a6c[_0x7cca6(0x1e6)]||_0x7cca6(0x1f5))[_0x7cca6(0x1f3)](),_0x170134=_0x506a6c[_0x7cca6(0x1e1)],_0x26f1f1=_0x506a6c[_0x7cca6(0x1ed)],_0xf05f13=_0x506a6c[_0x7cca6(0x1df)],_0x4dbe62=_0x506a6c[_0x7cca6(0x1f6)]||'td';try{const _0x3d84f2={};if(_0xf05f13){const _0x991abd=Array['isArray'](_0xf05f13)?_0xf05f13:[_0xf05f13];for(const _0x4ea85b of _0x991abd){const [_0x3bc356,_0x310424]=parseHeader(_0x4ea85b);_0x3d84f2[_0x3bc356]=_0x310424;}}let _0x2551fa;if(_0x170134)_0x2551fa=_0x170134;else{if(_0x26f1f1)try{_0x2551fa=RawAPI[_0x7cca6(0x209)](_0x26f1f1);}catch(_0x2b083e){return console[_0x7cca6(0x1d5)](_0x7cca6(0x1d2)+(_0x2b083e instanceof Error?_0x2b083e[_0x7cca6(0x20c)]:String(_0x2b083e))),0x1;}}const _0x4e962b={'method':_0x17517a,'apiType':_0x4dbe62,'includeHeaders':_0xd3cce6['verbose']};_0x2551fa&&(_0x4e962b['body']=_0x2551fa);Object[_0x7cca6(0x1f9)](_0x3d84f2)['length']>0x0&&(_0x4e962b[_0x7cca6(0x1f2)]=_0x3d84f2);if(_0xd3cce6['verbose']){const _0x4b2e9e=resolveSite(_0xd3cce6['site']),_0x456acd=getEndpoint(_0x4b2e9e,_0x4dbe62),_0x5d08e5=''+_0x456acd+_0x369a51;console[_0x7cca6(0x1d5)]('>\x20'+_0x17517a+'\x20'+_0x5d08e5);const _0x3e1887=getAuthHeaders(_0x4b2e9e),_0x14c859={..._0x3e1887,..._0x3d84f2};for(const [_0x3e7695,_0x5f218e]of Object[_0x7cca6(0x20b)](_0x14c859)){!isSensitiveHeader(_0x3e7695)&&console[_0x7cca6(0x1d5)]('>\x20'+_0x3e7695+':\x20'+_0x5f218e);}_0x2551fa&&console[_0x7cca6(0x1d5)]('>'),console[_0x7cca6(0x1d5)]('');}const _0x49bbd3=await _0x1cca14[_0x7cca6(0x1d7)]['request'](_0x369a51,_0x4e962b);if(_0xd3cce6[_0x7cca6(0x201)]&&_0x49bbd3[_0x7cca6(0x1f2)]){console[_0x7cca6(0x1d5)](_0x7cca6(0x1f7)+_0x49bbd3[_0x7cca6(0x204)]);for(const [_0x54a0f0,_0x2729ab]of Object[_0x7cca6(0x20b)](_0x49bbd3['headers'])){!isSensitiveHeader(_0x54a0f0)&&console[_0x7cca6(0x1d5)]('<\x20'+_0x54a0f0+':\x20'+_0x2729ab);}console[_0x7cca6(0x1d5)]('');}const _0x1157d1=Boolean(_0xd3cce6[_0x7cca6(0x203)]),_0x425690={'color':_0xd3cce6[_0x7cca6(0x1e8)],'noColor':_0xd3cce6[_0x7cca6(0x1cf)]||_0x1157d1&&!_0xd3cce6['color']},_0x32bc5c=colorizeJSON(_0x49bbd3[_0x7cca6(0x1e1)],_0x425690);return _0xd3cce6['output']?(writeFileSync(_0xd3cce6[_0x7cca6(0x203)],_0x32bc5c),console['error'](_0x7cca6(0x1e5)+_0xd3cce6['output'])):console[_0x7cca6(0x1f4)](_0x32bc5c),0x0;}catch(_0x385f03){return _0x385f03 instanceof Error?(console['error'](_0x7cca6(0x1d2)+_0x385f03[_0x7cca6(0x20c)]),_0xd3cce6[_0x7cca6(0x201)]&&_0x385f03[_0x7cca6(0x1ff)]&&console[_0x7cca6(0x1d5)](_0x7cca6(0x1fa)+_0x385f03[_0x7cca6(0x1ff)])):console[_0x7cca6(0x1d5)]('Error:\x20'+String(_0x385f03)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a7_0x9baadc=a7_0x2a51;(function(_0x59c523,_0x19945d){const _0x1d17c7=a7_0x2a51,_0x1c11a7=_0x59c523();while(!![]){try{const _0x3412c3=-parseInt(_0x1d17c7(0x119))/0x1+-parseInt(_0x1d17c7(0x114))/0x2+-parseInt(_0x1d17c7(0x122))/0x3+parseInt(_0x1d17c7(0x101))/0x4*(parseInt(_0x1d17c7(0xf9))/0x5)+parseInt(_0x1d17c7(0xec))/0x6+-parseInt(_0x1d17c7(0x12d))/0x7*(-parseInt(_0x1d17c7(0x111))/0x8)+-parseInt(_0x1d17c7(0x116))/0x9;if(_0x3412c3===_0x19945d)break;else _0x1c11a7['push'](_0x1c11a7['shift']());}catch(_0x2abbe6){_0x1c11a7['push'](_0x1c11a7['shift']());}}}(a7_0x4f2c,0xab3bd));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';function a7_0x4f2c(){const _0x886c5a=['N/A','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','tdx\x20profile:\x20','Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20','status','User:\x20','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','✓\x20Authentication\x20successful\x0a','3424TBTBQM','\x20(site:\x20','Setup\x20API\x20key\x20authentication\x20interactively','337214yezpOt','select','1472796ShSRTd','text','warn','837003FsUwhH','Remove\x20API\x20key\x20from\x20system\x20keychain','other','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','filter','auth','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','profile','create','3060342RlccAm','green','✗\x20Validation\x20failed:\x20','Read\x20credential\x20from\x20','error','join','name','bold','Site\x20name\x20cannot\x20be\x20empty','customSite','\x20(profile:\x20','6937GkPXeF','\x20--profile\x20','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','\x0aSetup\x20cancelled','us01','API\x20key\x20cannot\x20be\x20empty','apiKey','yellow','auth:setup','jobs','8156046TvPVsK','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','description','first_name','✓\x20API\x20key\x20removed\x20from\x20keychain','tdx:\x20auth\x20setup','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','ERROR','getUserInfo','Enter\x20site\x20name:','execute','Enter\x20your\x20TD\x20API\x20key:','red','1384065zUcGMT','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','\x20for\x20profile:\x20','message','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','tdx:\x20auth\x20clear','\x27\x20registered','trim','16sRSNbL','log','Name:\x20','\x20\x20tdx','site','last_name','No\x20API\x20key\x20found\x20in\x20keychain'];a7_0x4f2c=function(){return _0x886c5a;};return a7_0x4f2c();}import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';function a7_0x2a51(_0x135f2d,_0x452183){_0x135f2d=_0x135f2d-0xea;const _0x4f2cab=a7_0x4f2c();let _0x2a512d=_0x4f2cab[_0x135f2d];return _0x2a512d;}import{clearCredentialCache}from'../core/credential-cache.js';import{buildSiteChoices}from'../core/constants.js';import a7_0x215d35 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_0x333136 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x9baadc(0x128)]=a7_0x9baadc(0xea);[a7_0x9baadc(0xee)]=a7_0x9baadc(0x113);async[a7_0x9baadc(0xf6)](_0x2e5863){const _0x3e7fbd=a7_0x9baadc,{options:_0x23e969}=_0x2e5863,_0x3f2ab1=_0x23e969[_0x3e7fbd(0x120)];console['log'](a7_0x333136[_0x3e7fbd(0x129)](_0x3e7fbd(0xf1)));const _0x45589b=_0x23e969[_0x3e7fbd(0x105)]||_0x3e7fbd(0x131),{choices:_0x30c76f,initialIndex:_0x5e7986}=buildSiteChoices(_0x45589b),_0x51d1c4=_0x3f2ab1?_0x3e7fbd(0x10c)+_0x3f2ab1+'):':'Select\x20your\x20Treasure\x20Data\x20site:',_0x41c704=await a7_0x215d35({'type':_0x3e7fbd(0x115),'name':_0x3e7fbd(0x105),'message':_0x51d1c4,'choices':_0x30c76f,'initial':_0x5e7986});if(!_0x41c704[_0x3e7fbd(0x105)])return console['log'](_0x3e7fbd(0x130)),0x1;let _0x376a0e;if(_0x41c704['site']===_0x3e7fbd(0x11b)){const _0x2c7b79=await a7_0x215d35({'type':_0x3e7fbd(0x117),'name':_0x3e7fbd(0x12b),'message':_0x3e7fbd(0xf5),'initial':_0x3e7fbd(0x131),'validate':_0x2d31ab=>{const _0x49cff7=_0x3e7fbd;if(!_0x2d31ab||!_0x2d31ab['trim']())return _0x49cff7(0x12a);if(!/^[a-z0-9-]+$/['test'](_0x2d31ab[_0x49cff7(0x100)]()))return _0x49cff7(0xed);return!![];}});if(!_0x2c7b79[_0x3e7fbd(0x12b)])return console[_0x3e7fbd(0x102)](_0x3e7fbd(0x130)),0x1;_0x376a0e=_0x2c7b79[_0x3e7fbd(0x12b)];}else _0x376a0e=_0x41c704['site'];const _0xc401d3=resolveSite(_0x376a0e);console[_0x3e7fbd(0x102)]('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0xc401d3),console['log']('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console['log']('\x20\x20'+getConsoleUrl(_0xc401d3,'/app/mp/ak'));const _0x194e4c=await a7_0x215d35({'type':'password','name':_0x3e7fbd(0x133),'message':_0x3e7fbd(0xf7),'validate':_0x2faba8=>{const _0x3dff65=_0x3e7fbd;if(!_0x2faba8||!_0x2faba8[_0x3dff65(0x100)]())return _0x3dff65(0x132);return!![];}});if(!_0x194e4c[_0x3e7fbd(0x133)])return console[_0x3e7fbd(0x102)]('\x0aSetup\x20cancelled'),0x1;const _0x39b61a=_0x194e4c[_0x3e7fbd(0x133)];console[_0x3e7fbd(0x102)]('Validating\x20API\x20key...');try{const _0x6c9da2=TDX[_0x3e7fbd(0x121)]({'site':_0xc401d3,'apiKey':_0x39b61a[_0x3e7fbd(0x100)](),'logLevel':_0x23e969['logLevel']??LogLevel[_0x3e7fbd(0xf3)]}),_0x193ebc=await _0x6c9da2[_0x3e7fbd(0xeb)][_0x3e7fbd(0xf4)]();console[_0x3e7fbd(0x102)](_0x3e7fbd(0x12f)+_0x193ebc['email']+')');const _0x494a15=await isKeychainAvailable();_0x494a15?(await saveAPIKeyAsync(_0x39b61a[_0x3e7fbd(0x100)](),_0xc401d3,_0x3f2ab1),console[_0x3e7fbd(0x102)](_0x3e7fbd(0x10f)+(_0x3f2ab1?_0x3e7fbd(0x12c)+_0x3f2ab1+')':''))):(console[_0x3e7fbd(0x118)](a7_0x333136[_0x3e7fbd(0x134)](_0x3e7fbd(0x11c))),console['warn'](a7_0x333136[_0x3e7fbd(0x134)](_0x3e7fbd(0xf2))));if(_0x3f2ab1){const _0x3499b2={'site':_0xc401d3};saveProfileToUserConfig(_0x3f2ab1,_0x3499b2),console[_0x3e7fbd(0x102)]('✓\x20Profile\x20\x27'+_0x3f2ab1+_0x3e7fbd(0xff));}else saveDefaultSiteToUserConfig(_0xc401d3),console[_0x3e7fbd(0x102)]('✓\x20Default\x20site\x20set\x20to\x20'+_0xc401d3);const _0x2075d4=_0x3f2ab1?_0x3e7fbd(0x12e)+_0x3f2ab1:'';return console[_0x3e7fbd(0x102)](),console[_0x3e7fbd(0x102)](_0x3e7fbd(0x10a)),console['log']('\x20\x20tdx'+_0x2075d4+_0x3e7fbd(0xfd)),console[_0x3e7fbd(0x102)](_0x3e7fbd(0x104)+_0x2075d4+_0x3e7fbd(0xfa)),0x0;}catch(_0x681f84){if(_0x681f84 instanceof HTTPClientError&&_0x681f84['status']===0x191)return printAuthError(_0x681f84),0x1;return console[_0x3e7fbd(0x126)](a7_0x333136['red'](_0x3e7fbd(0x124)+(_0x681f84 instanceof Error?_0x681f84[_0x3e7fbd(0xfc)]:String(_0x681f84)))),console[_0x3e7fbd(0x126)](_0x3e7fbd(0x109)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x9baadc(0x128)]=a7_0x9baadc(0x11e);[a7_0x9baadc(0xee)]=a7_0x9baadc(0x11f);async[a7_0x9baadc(0xf6)](_0x4b2155){const _0x3a6ffc=a7_0x9baadc,{options:_0x5cfab3,tdx:_0x9b92bb}=_0x4b2155,_0x128f94=_0x5cfab3['site'],_0x34c020=_0x5cfab3[_0x3a6ffc(0x120)],_0x54e98c=_0x34c020?_0x34c020:_0x3a6ffc(0x108);console[_0x3a6ffc(0x102)](_0x3a6ffc(0x10b)+_0x54e98c+_0x3a6ffc(0x112)+_0x128f94+')');const _0x4771d6=await resolveAPIKeyAsync(_0x128f94,_0x34c020);if(_0x4771d6){const {source:_0x2d634e,isDeprecated:_0x5bfccb}=_0x4771d6,_0x4dca01=_0x3a6ffc(0x125)+_0x2d634e;console['log'](_0x5bfccb?a7_0x333136['yellow'](_0x4dca01):_0x4dca01);}else console[_0x3a6ffc(0x102)](a7_0x333136[_0x3a6ffc(0x134)]('No\x20credential\x20found'));try{const _0x24f272=await _0x9b92bb['jobs'][_0x3a6ffc(0xf4)]();return console[_0x3a6ffc(0x102)](a7_0x333136[_0x3a6ffc(0x123)](_0x3a6ffc(0x110))),console['log'](_0x3a6ffc(0x10e)+_0x24f272['email']),(_0x24f272[_0x3a6ffc(0xef)]||_0x24f272[_0x3a6ffc(0x106)])&&console[_0x3a6ffc(0x102)](_0x3a6ffc(0x103)+[_0x24f272['first_name'],_0x24f272[_0x3a6ffc(0x106)]][_0x3a6ffc(0x11d)](Boolean)[_0x3a6ffc(0x127)]('\x20')),0x0;}catch(_0x4777c0){return _0x4777c0 instanceof HTTPClientError&&_0x4777c0[_0x3a6ffc(0x10d)]===0x191?printAuthError(_0x4777c0,!![],_0x34c020):console['error'](a7_0x333136['red']('✗\x20Validation\x20failed:\x20'+(_0x4777c0 instanceof Error?_0x4777c0[_0x3a6ffc(0xfc)]:String(_0x4777c0)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x9baadc(0x128)]='auth:clear';[a7_0x9baadc(0xee)]=a7_0x9baadc(0x11a);async[a7_0x9baadc(0xf6)](_0x13cec7){const _0x21e66d=a7_0x9baadc,{options:_0x2654e0}=_0x13cec7,_0x3ee4b6=_0x2654e0['profile'];console['log'](a7_0x333136['bold'](_0x21e66d(0xfe)));const _0x23ffdf=await isKeychainAvailable();if(!_0x23ffdf)return console[_0x21e66d(0x126)](a7_0x333136[_0x21e66d(0xf8)]('System\x20keychain\x20is\x20not\x20available')),0x1;const _0x5ccc83=await deleteKeychainAPIKey(_0x3ee4b6);return _0x5ccc83?(clearCredentialCache(),console[_0x21e66d(0x102)](_0x21e66d(0xf0)+(_0x3ee4b6?_0x21e66d(0x12c)+_0x3ee4b6+')':'')),0x0):(console['log'](_0x21e66d(0x107)+(_0x3ee4b6?_0x21e66d(0xfb)+_0x3ee4b6:'')),0x1);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a8_0x2480b6=a8_0x28d1;(function(_0x5b3179,_0x1faedb){const _0x474997=a8_0x28d1,_0x36ed19=_0x5b3179();while(!![]){try{const _0x269768=parseInt(_0x474997(0x8e))/0x1*(-parseInt(_0x474997(0x89))/0x2)+-parseInt(_0x474997(0xd2))/0x3*(-parseInt(_0x474997(0xbd))/0x4)+parseInt(_0x474997(0xac))/0x5*(-parseInt(_0x474997(0xc9))/0x6)+-parseInt(_0x474997(0xb9))/0x7*(-parseInt(_0x474997(0x8d))/0x8)+parseInt(_0x474997(0x9e))/0x9*(-parseInt(_0x474997(0xcc))/0xa)+-parseInt(_0x474997(0x97))/0xb+parseInt(_0x474997(0xc7))/0xc*(parseInt(_0x474997(0x8b))/0xd);if(_0x269768===_0x1faedb)break;else _0x36ed19['push'](_0x36ed19['shift']());}catch(_0x75429c){_0x36ed19['push'](_0x36ed19['shift']());}}}(a8_0x39ac,0xaa6e2));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';function a8_0x28d1(_0x19a3fb,_0x52d414){_0x19a3fb=_0x19a3fb-0x88;const _0x39ac57=a8_0x39ac();let _0x28d19c=_0x39ac57[_0x19a3fb];return _0x28d19c;}function a8_0x39ac(){const _0x43f585=['Getting\x20default\x20agent...','stdout','args','6952778fLcCbs','CHAT_NOT_FOUND','session\x20context','streamChat','1787060zljbkj','tool_call','new','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','claude-4.5-haiku','getDefaultAgent','tool','verbose','metadata','error','12qLBIOi','stream','10074uOjYcu','\x27...','llmProject','1060tPXBgF','message','Chat\x20session:\x20','llm','streamChatJsonl','resolveProjectId','9vhFoMe','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','chat-create','targetKnowledgeBase','chatId','\x20\x20Cause:\x20','type','Error:\x20','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','10838iGDiNx','code','3603041CifyIA','done','8KuOwpM','14vGvqSD','agentId','join','stringify','log','agent','projectId','Using\x20agent\x20from\x20','string','2243417BRGUjS','\x0aStack\x20trace:','write','slice','Continuing\x20chat:\x20','Create\x20a\x20new\x20chat\x20session','context','77193ArzTHN','handleChatEvent','name','chat','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','cause','--agent\x20flag','stack','\x27\x20not\x20found','functionName','validate','options','llmAgent','Resolving\x20agent\x20\x27','2155ybMwQb','event','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','site','description','targetWebSearchTool','execute','data','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','content'];a8_0x39ac=function(){return _0x43f585;};return a8_0x39ac();}import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x54a71f,_0x243ac8){const _0x265837=a8_0x28d1;if(_0x54a71f instanceof SDKError)console[_0x265837(0xc6)](_0x265837(0xd9)+_0x54a71f[_0x265837(0xcd)]),_0x243ac8['verbose']&&(_0x54a71f[_0x265837(0xa3)]&&console[_0x265837(0xc6)](_0x265837(0xd7)+_0x54a71f['cause']),_0x54a71f['stack']&&(console[_0x265837(0xc6)](_0x265837(0x98)),console[_0x265837(0xc6)](_0x54a71f[_0x265837(0xa5)])));else throw _0x54a71f;}async function resolveAgentId(_0x3e76d3,_0x19ba9a,_0x2286af,_0xcfd159,_0xbcb74f){const _0x3f7c2f=a8_0x28d1,_0x2d857c=_0x19ba9a||_0x2286af;if(_0x2d857c){const {projectName:_0x1617ce,agentName:_0xf88aa8}=parseAgentRef(_0x2d857c),_0x207c06=_0xf88aa8||_0x2d857c,_0x5778ce=_0xf88aa8?_0x1617ce:_0xcfd159;if(!_0x5778ce)throw new Error(_0x3f7c2f(0xae));if(_0xbcb74f){const _0x383179=_0x19ba9a?_0x3f7c2f(0xa4):_0x3f7c2f(0xbb);console[_0x3f7c2f(0xc6)](_0x3f7c2f(0x95)+_0x383179+':\x20'+_0x5778ce+'/'+_0x207c06);}const _0x1c885d=await withSpinner('Resolving\x20project\x20\x27'+_0x5778ce+_0x3f7c2f(0xca),()=>_0x3e76d3[_0x3f7c2f(0xcf)][_0x3f7c2f(0xd1)](_0x5778ce),{'verbose':_0xbcb74f}),_0x555c6b=await withSpinner(_0x3f7c2f(0xab)+_0x207c06+_0x3f7c2f(0xca),()=>_0x3e76d3[_0x3f7c2f(0xcf)]['resolveAgentId'](_0x207c06,_0x1c885d[_0x3f7c2f(0xb3)]),{'verbose':_0xbcb74f});return _0x555c6b['data'];}else{const _0xfcc097=_0x3e76d3[_0x3f7c2f(0xcf)][_0x3f7c2f(0xc2)]();if(_0xfcc097)return _0xbcb74f&&console[_0x3f7c2f(0xc6)]('Using\x20cached\x20default\x20agent:\x20'+_0xfcc097[_0x3f7c2f(0xa0)]),_0xfcc097['id'];const _0x17ede1=await withSpinner(_0x3f7c2f(0xb6),()=>_0x3e76d3['llm']['getOrCreateDefaultAgent'](_0x3f7c2f(0xc1),0x0),{'verbose':_0xbcb74f});return _0x17ede1[_0x3f7c2f(0xb3)]['id'];}}export class ChatCommand extends BaseCommand{['name']=a8_0x2480b6(0xa1);['description']=a8_0x2480b6(0xa2);[a8_0x2480b6(0xa8)](_0x55ced8){const _0x52d8a9=a8_0x2480b6,_0x4cb96a=_0x55ced8[_0x52d8a9(0xb8)][_0x52d8a9(0x90)]('\x20');if(!_0x4cb96a)return _0x52d8a9(0x88);return undefined;}async[a8_0x2480b6(0xbc)](_0x73851f,_0x51135f,_0xc79d56,_0x545a28,_0x4302b7){const _0x2c3f7c=a8_0x2480b6;for await(const _0x30794c of _0x73851f['llm'][_0x2c3f7c(0xa1)](_0x51135f,{'agentId':_0xc79d56,'chatId':_0x545a28})){if(_0x30794c[_0x2c3f7c(0xd8)]===_0x2c3f7c(0xc5)){const _0x274dc4=_0x30794c['data'][_0x2c3f7c(0xd6)];saveLastChatId(_0x274dc4),_0x4302b7&&console[_0x2c3f7c(0xc6)](_0x2c3f7c(0xce)+_0x274dc4);}else _0x30794c['type']===_0x2c3f7c(0xad)&&this[_0x2c3f7c(0x9f)](_0x30794c[_0x2c3f7c(0xb3)]);}}async[a8_0x2480b6(0xd0)](_0x3cbf03,_0x5e7228,_0x501abb,_0x59ee42){const _0x19da73=a8_0x2480b6,_0xdb6ae5=_0x3cbf03[_0x19da73(0x9d)][_0x19da73(0xaf)];let _0x34899f=![];for await(const _0x3fb4d4 of _0x3cbf03['llm'][_0x19da73(0xa1)](_0x5e7228,{'agentId':_0x501abb,'chatId':_0x59ee42})){if(_0x3fb4d4[_0x19da73(0xd8)]===_0x19da73(0xc5)){const _0x1ee61b=_0x3fb4d4[_0x19da73(0xb3)];saveLastChatId(_0x1ee61b[_0x19da73(0xd6)]);const _0x579889=_0x1ee61b[_0x19da73(0x94)]&&_0x1ee61b[_0x19da73(0x8f)]?getLLMConversationUrl(_0xdb6ae5,_0x1ee61b[_0x19da73(0x94)],_0x1ee61b[_0x19da73(0x8f)],_0x1ee61b[_0x19da73(0xd6)]):undefined;console[_0x19da73(0x92)](JSON[_0x19da73(0x91)]({'type':'metadata','data':{'chatId':_0x1ee61b[_0x19da73(0xd6)],'agentId':_0x1ee61b[_0x19da73(0x8f)],'consoleUrl':_0x579889}})),_0x34899f=!![];}else{if(_0x3fb4d4[_0x19da73(0xd8)]===_0x19da73(0xad)){!_0x34899f&&_0x59ee42&&(console[_0x19da73(0x92)](JSON[_0x19da73(0x91)]({'type':_0x19da73(0xc5),'data':{'chatId':_0x59ee42}})),_0x34899f=!![]);const _0x44647c=_0x3fb4d4['data'];if(_0x19da73(0xb5)in _0x44647c)console[_0x19da73(0x92)](JSON[_0x19da73(0x91)]({'type':_0x19da73(0xb5),'data':{'content':_0x44647c[_0x19da73(0xb5)]}}));else{if(_0x19da73(0xbe)in _0x44647c){const _0x39d875=_0x44647c['tool_call'];console[_0x19da73(0x92)](JSON[_0x19da73(0x91)]({'type':_0x19da73(0xbe),'data':{'id':_0x39d875['id'],'name':_0x39d875[_0x19da73(0xa7)],'target':_0x39d875[_0x19da73(0xd5)]?.[_0x19da73(0xa0)]||_0x39d875['targetAgent']?.['name']||_0x39d875[_0x19da73(0xb1)]?.[_0x19da73(0xa0)]||_0x39d875['targetFunction']}}));}else{if('tool'in _0x44647c)console[_0x19da73(0x92)](JSON[_0x19da73(0x91)]({'type':'tool_result','data':{'id':_0x44647c['tool']['id'],'name':_0x44647c[_0x19da73(0xc3)]['functionName'],'result':typeof _0x44647c[_0x19da73(0xc3)][_0x19da73(0xb5)]===_0x19da73(0x96)?_0x44647c[_0x19da73(0xc3)][_0x19da73(0xb5)][_0x19da73(0x9a)](0x0,0x1f4):''}}));else _0x19da73(0xc6)in _0x44647c&&console[_0x19da73(0x92)](JSON[_0x19da73(0x91)]({'type':'error','data':{'error':_0x44647c[_0x19da73(0xc6)]}}));}}}}}console[_0x19da73(0x92)](JSON[_0x19da73(0x91)]({'type':_0x19da73(0x8c)}));}async[a8_0x2480b6(0xb2)](_0x15c459){const _0x3c78c0=a8_0x2480b6,{options:_0x40c35d,args:_0xdcc066,tdx:_0x16062a}=_0x15c459,_0x194398=_0xdcc066[_0x3c78c0(0x90)]('\x20'),_0x46537f=_0x40c35d,_0xe76245=_0x46537f[_0x3c78c0(0x93)],_0x4dfa4e=_0x46537f[_0x3c78c0(0xaa)],_0x335783=_0x46537f[_0x3c78c0(0xcb)],_0x533606=_0x46537f[_0x3c78c0(0xbf)],_0x281c9d=_0x46537f[_0x3c78c0(0xd6)],_0x5a7c50=_0x46537f[_0x3c78c0(0xc8)];if(_0x533606&&_0x281c9d)return console[_0x3c78c0(0xc6)](_0x3c78c0(0xc0)),0x1;try{let _0xc6079a,_0x3db940;if(_0x281c9d)_0x3db940=_0x281c9d;else!_0x533606&&(_0x3db940=loadLastChatId(),_0x3db940&&_0x40c35d[_0x3c78c0(0xc4)]&&console['error'](_0x3c78c0(0x9b)+_0x3db940));!_0x281c9d&&(_0x533606||!_0x3db940)&&(_0xc6079a=await resolveAgentId(_0x16062a,_0xe76245,_0x4dfa4e,_0x335783,_0x40c35d[_0x3c78c0(0xc4)]));const _0xb1312f=_0x5a7c50?(_0x574419,_0x4d9cb1,_0x3506ac)=>this[_0x3c78c0(0xd0)](_0x16062a,_0x574419,_0x4d9cb1,_0x3506ac):(_0x181a8a,_0x530be1,_0x5c4833)=>this[_0x3c78c0(0xbc)](_0x16062a,_0x181a8a,_0x530be1,_0x5c4833,_0x40c35d[_0x3c78c0(0xc4)]);try{await _0xb1312f(_0x194398,_0xc6079a,_0x3db940);}catch(_0x3e3836){const _0x2174d6=_0x3e3836 instanceof SDKError&&_0x3e3836[_0x3c78c0(0x8a)]===ErrorCode[_0x3c78c0(0xba)]||_0x3e3836 instanceof Error&&_0x3e3836['message']['includes']('404');if(_0x2174d6&&_0x281c9d)return console[_0x3c78c0(0xc6)]('Error:\x20Chat\x20session\x20\x27'+_0x281c9d+_0x3c78c0(0xa6)),0x1;if(_0x2174d6)_0x40c35d[_0x3c78c0(0xc4)]&&console[_0x3c78c0(0xc6)](_0x3c78c0(0xd3)),!_0xc6079a&&(_0xc6079a=await resolveAgentId(_0x16062a,_0xe76245,_0x4dfa4e,_0x335783,_0x40c35d[_0x3c78c0(0xc4)])),await _0xb1312f(_0x194398,_0xc6079a,undefined);else throw _0x3e3836;}return!_0x5a7c50&&console['log'](),0x0;}catch(_0x5f37f4){return console['error'](),handleSDKError(_0x5f37f4,_0x40c35d),0x1;}}[a8_0x2480b6(0x9f)](_0x1b4bfd){const _0x38ddc7=a8_0x2480b6;if(_0x38ddc7(0xb5)in _0x1b4bfd)process[_0x38ddc7(0xb7)][_0x38ddc7(0x99)](_0x1b4bfd[_0x38ddc7(0xb5)]);else _0x38ddc7(0xc6)in _0x1b4bfd&&console[_0x38ddc7(0xc6)]('\x0aError:\x20'+_0x1b4bfd['error']);}}export class ChatCreateCommand extends BaseCommand{['name']=a8_0x2480b6(0xd4);[a8_0x2480b6(0xb0)]=a8_0x2480b6(0x9c);['validate'](_0x569d22){const _0x4dc48e=a8_0x2480b6,_0x178a04=_0x569d22[_0x4dc48e(0xa9)],_0x5a5c57=_0x178a04['agent'],_0x2437a4=_0x178a04[_0x4dc48e(0xaa)];if(!_0x5a5c57&&!_0x2437a4)return _0x4dc48e(0xb4);return undefined;}async['execute'](_0x43f989){const _0x5e0582=a8_0x2480b6,{options:_0x223dc9,tdx:_0x163259}=_0x43f989,_0x1acc94=_0x223dc9,_0x421c35=_0x1acc94['agent'],_0x5211d6=_0x1acc94[_0x5e0582(0xaa)],_0x9b4893=_0x1acc94[_0x5e0582(0xcb)];try{const _0x2f909e=await resolveAgentId(_0x163259,_0x421c35,_0x5211d6,_0x9b4893,_0x223dc9[_0x5e0582(0xc4)]),_0x2871d5=await _0x163259[_0x5e0582(0xcf)]['startChat'](_0x2f909e);return saveLastChatId(_0x2871d5['id']),console['log'](JSON['stringify']({'chatId':_0x2871d5['id'],'agentId':_0x2f909e})),0x0;}catch(_0x28141a){return handleSDKError(_0x28141a,_0x223dc9),0x1;}}}
|
|
1
|
+
const a8_0x13b8d2=a8_0x5727;(function(_0x68b633,_0x1d0e0f){const _0x9e1203=a8_0x5727,_0x4577f8=_0x68b633();while(!![]){try{const _0x5483ac=parseInt(_0x9e1203(0xa1))/0x1+-parseInt(_0x9e1203(0xca))/0x2*(parseInt(_0x9e1203(0xa5))/0x3)+parseInt(_0x9e1203(0xd8))/0x4+parseInt(_0x9e1203(0x8c))/0x5+parseInt(_0x9e1203(0x8e))/0x6+parseInt(_0x9e1203(0xaf))/0x7+-parseInt(_0x9e1203(0xc9))/0x8*(parseInt(_0x9e1203(0xb8))/0x9);if(_0x5483ac===_0x1d0e0f)break;else _0x4577f8['push'](_0x4577f8['shift']());}catch(_0x447d6c){_0x4577f8['push'](_0x4577f8['shift']());}}}(a8_0x4c63,0xd04a1));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';function a8_0x4c63(){const _0x2e9f70=['validate','Chat\x20session:\x20','description','session\x20context','targetFunction','\x0aStack\x20trace:','llm','verbose','message','3256792wsmcBw','chat-create','write','Using\x20cached\x20default\x20agent:\x20','handleChatEvent','streamChatJsonl','llmProject','resolveAgentId','\x20\x20Cause:\x20','18UvuEGu','join','options','slice','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','name','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','args','Error:\x20','stringify','CHAT_NOT_FOUND','metadata','--agent\x20flag','chatId','projectId','targetWebSearchTool','stream','12932224eFigux','6858jOgdQY','Getting\x20default\x20agent...','agentId','tool_result','Error:\x20Chat\x20session\x20\x27','startChat','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','Continuing\x20chat:\x20','404','Create\x20a\x20new\x20chat\x20session','streamChat','error','getOrCreateDefaultAgent','functionName','3661032QaAyWM','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','\x27\x20not\x20found','execute','event','6906075fBNKXQ','\x0aError:\x20','8879808EjBdHk','targetAgent','claude-4.5-haiku','llmAgent','done','data','content','log','new','tool','code','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','tool_call','type','Resolving\x20agent\x20\x27','\x27...','cause','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','site','207986ZSERSy','agent','stack','Using\x20agent\x20from\x20','318pXexUd'];a8_0x4c63=function(){return _0x2e9f70;};return a8_0x4c63();}function a8_0x5727(_0x11afc9,_0x54b7a2){_0x11afc9=_0x11afc9-0x88;const _0x4c63c2=a8_0x4c63();let _0x572776=_0x4c63c2[_0x11afc9];return _0x572776;}import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x2c7939,_0x5968ce){const _0x106b65=a8_0x5727;if(_0x2c7939 instanceof SDKError)console[_0x106b65(0xd5)](_0x106b65(0xc0)+_0x2c7939[_0x106b65(0xae)]),_0x5968ce[_0x106b65(0xad)]&&(_0x2c7939[_0x106b65(0x9e)]&&console[_0x106b65(0xd5)](_0x106b65(0xb7)+_0x2c7939[_0x106b65(0x9e)]),_0x2c7939[_0x106b65(0xa3)]&&(console['error'](_0x106b65(0xab)),console[_0x106b65(0xd5)](_0x2c7939['stack'])));else throw _0x2c7939;}async function resolveAgentId(_0x2bd8cf,_0x2b80cb,_0x27b7ed,_0x3fa97c,_0x935e01){const _0x4a6c3f=a8_0x5727,_0x599bff=_0x2b80cb||_0x27b7ed;if(_0x599bff){const {projectName:_0x4e3cbc,agentName:_0x2bc553}=parseAgentRef(_0x599bff),_0x1b90fb=_0x2bc553||_0x599bff,_0x4d1f5a=_0x2bc553?_0x4e3cbc:_0x3fa97c;if(!_0x4d1f5a)throw new Error(_0x4a6c3f(0xbc));if(_0x935e01){const _0xdfd0c1=_0x2b80cb?_0x4a6c3f(0xc4):_0x4a6c3f(0xa9);console[_0x4a6c3f(0xd5)](_0x4a6c3f(0xa4)+_0xdfd0c1+':\x20'+_0x4d1f5a+'/'+_0x1b90fb);}const _0x568825=await withSpinner('Resolving\x20project\x20\x27'+_0x4d1f5a+'\x27...',()=>_0x2bd8cf[_0x4a6c3f(0xac)]['resolveProjectId'](_0x4d1f5a),{'verbose':_0x935e01}),_0x1ab1ac=await withSpinner(_0x4a6c3f(0x9c)+_0x1b90fb+_0x4a6c3f(0x9d),()=>_0x2bd8cf['llm'][_0x4a6c3f(0xb6)](_0x1b90fb,_0x568825['data']),{'verbose':_0x935e01});return _0x1ab1ac[_0x4a6c3f(0x93)];}else{const _0x7930a1=_0x2bd8cf['llm']['getDefaultAgent']();if(_0x7930a1)return _0x935e01&&console['error'](_0x4a6c3f(0xb2)+_0x7930a1[_0x4a6c3f(0xbd)]),_0x7930a1['id'];const _0xfdb53c=await withSpinner(_0x4a6c3f(0xcb),()=>_0x2bd8cf['llm'][_0x4a6c3f(0xd6)](_0x4a6c3f(0x90),0x0),{'verbose':_0x935e01});return _0xfdb53c['data']['id'];}}export class ChatCommand extends BaseCommand{[a8_0x13b8d2(0xbd)]='chat';[a8_0x13b8d2(0xa8)]=a8_0x13b8d2(0x99);[a8_0x13b8d2(0xa6)](_0x5e5c63){const _0x139300=a8_0x13b8d2,_0xaa94e1=_0x5e5c63[_0x139300(0xbf)]['join']('\x20');if(!_0xaa94e1)return _0x139300(0xbe);return undefined;}async[a8_0x13b8d2(0xd4)](_0x3d02ee,_0x182d4d,_0x1b6a70,_0x4113b3,_0x2e8e77){const _0x3eb068=a8_0x13b8d2;for await(const _0x1612d8 of _0x3d02ee[_0x3eb068(0xac)]['chat'](_0x182d4d,{'agentId':_0x1b6a70,'chatId':_0x4113b3})){if(_0x1612d8[_0x3eb068(0x9b)]===_0x3eb068(0xc3)){const _0x49936f=_0x1612d8[_0x3eb068(0x93)][_0x3eb068(0xc5)];saveLastChatId(_0x49936f),_0x2e8e77&&console['error'](_0x3eb068(0xa7)+_0x49936f);}else _0x1612d8[_0x3eb068(0x9b)]===_0x3eb068(0x8b)&&this[_0x3eb068(0xb3)](_0x1612d8['data']);}}async[a8_0x13b8d2(0xb4)](_0x461029,_0x3081c7,_0x43f737,_0x2feef6){const _0x181a03=a8_0x13b8d2,_0x421a75=_0x461029['context'][_0x181a03(0xa0)];let _0x5982f9=![];for await(const _0x3876da of _0x461029['llm']['chat'](_0x3081c7,{'agentId':_0x43f737,'chatId':_0x2feef6})){if(_0x3876da[_0x181a03(0x9b)]===_0x181a03(0xc3)){const _0x48bed4=_0x3876da[_0x181a03(0x93)];saveLastChatId(_0x48bed4[_0x181a03(0xc5)]);const _0x32b74e=_0x48bed4[_0x181a03(0xc6)]&&_0x48bed4[_0x181a03(0xcc)]?getLLMConversationUrl(_0x421a75,_0x48bed4[_0x181a03(0xc6)],_0x48bed4['agentId'],_0x48bed4[_0x181a03(0xc5)]):undefined;console[_0x181a03(0x95)](JSON[_0x181a03(0xc1)]({'type':_0x181a03(0xc3),'data':{'chatId':_0x48bed4['chatId'],'agentId':_0x48bed4[_0x181a03(0xcc)],'consoleUrl':_0x32b74e}})),_0x5982f9=!![];}else{if(_0x3876da[_0x181a03(0x9b)]===_0x181a03(0x8b)){!_0x5982f9&&_0x2feef6&&(console[_0x181a03(0x95)](JSON[_0x181a03(0xc1)]({'type':_0x181a03(0xc3),'data':{'chatId':_0x2feef6}})),_0x5982f9=!![]);const _0x909f69=_0x3876da[_0x181a03(0x93)];if(_0x181a03(0x94)in _0x909f69)console[_0x181a03(0x95)](JSON[_0x181a03(0xc1)]({'type':_0x181a03(0x94),'data':{'content':_0x909f69[_0x181a03(0x94)]}}));else{if('tool_call'in _0x909f69){const _0x592949=_0x909f69['tool_call'];console[_0x181a03(0x95)](JSON['stringify']({'type':_0x181a03(0x9a),'data':{'id':_0x592949['id'],'name':_0x592949[_0x181a03(0xd7)],'target':_0x592949['targetKnowledgeBase']?.[_0x181a03(0xbd)]||_0x592949[_0x181a03(0x8f)]?.['name']||_0x592949[_0x181a03(0xc7)]?.['name']||_0x592949[_0x181a03(0xaa)]}}));}else{if('tool'in _0x909f69)console[_0x181a03(0x95)](JSON[_0x181a03(0xc1)]({'type':_0x181a03(0xcd),'data':{'id':_0x909f69[_0x181a03(0x97)]['id'],'name':_0x909f69['tool'][_0x181a03(0xd7)],'result':typeof _0x909f69[_0x181a03(0x97)][_0x181a03(0x94)]==='string'?_0x909f69[_0x181a03(0x97)]['content'][_0x181a03(0xbb)](0x0,0x1f4):''}}));else'error'in _0x909f69&&console[_0x181a03(0x95)](JSON[_0x181a03(0xc1)]({'type':_0x181a03(0xd5),'data':{'error':_0x909f69['error']}}));}}}}}console['log'](JSON[_0x181a03(0xc1)]({'type':_0x181a03(0x92)}));}async[a8_0x13b8d2(0x8a)](_0x123ac8){const _0x4519d0=a8_0x13b8d2,{options:_0x48f7a9,args:_0x64acd8,tdx:_0x58a7a2}=_0x123ac8,_0x41af8e=_0x64acd8[_0x4519d0(0xb9)]('\x20'),_0x3c56f7=_0x48f7a9,_0x363c03=_0x3c56f7[_0x4519d0(0xa2)],_0x33c09b=_0x3c56f7['llmAgent'],_0x103c53=_0x3c56f7[_0x4519d0(0xb5)],_0x46e25d=_0x3c56f7[_0x4519d0(0x96)],_0x3d88c9=_0x3c56f7[_0x4519d0(0xc5)],_0x3afe6f=_0x3c56f7[_0x4519d0(0xc8)];if(_0x46e25d&&_0x3d88c9)return console[_0x4519d0(0xd5)](_0x4519d0(0xd0)),0x1;try{let _0x107680,_0x3603fb;if(_0x3d88c9)_0x3603fb=_0x3d88c9;else!_0x46e25d&&(_0x3603fb=loadLastChatId(),_0x3603fb&&_0x48f7a9['verbose']&&console[_0x4519d0(0xd5)](_0x4519d0(0xd1)+_0x3603fb));!_0x3d88c9&&(_0x46e25d||!_0x3603fb)&&(_0x107680=await resolveAgentId(_0x58a7a2,_0x363c03,_0x33c09b,_0x103c53,_0x48f7a9[_0x4519d0(0xad)]));const _0x38a029=_0x3afe6f?(_0x460c7a,_0x39d51f,_0x32b452)=>this[_0x4519d0(0xb4)](_0x58a7a2,_0x460c7a,_0x39d51f,_0x32b452):(_0x35bd95,_0x57d470,_0x17924e)=>this[_0x4519d0(0xd4)](_0x58a7a2,_0x35bd95,_0x57d470,_0x17924e,_0x48f7a9[_0x4519d0(0xad)]);try{await _0x38a029(_0x41af8e,_0x107680,_0x3603fb);}catch(_0xf2c110){const _0x4b3d4f=_0xf2c110 instanceof SDKError&&_0xf2c110[_0x4519d0(0x98)]===ErrorCode[_0x4519d0(0xc2)]||_0xf2c110 instanceof Error&&_0xf2c110[_0x4519d0(0xae)]['includes'](_0x4519d0(0xd2));if(_0x4b3d4f&&_0x3d88c9)return console[_0x4519d0(0xd5)](_0x4519d0(0xce)+_0x3d88c9+_0x4519d0(0x89)),0x1;if(_0x4b3d4f)_0x48f7a9[_0x4519d0(0xad)]&&console['error'](_0x4519d0(0x88)),!_0x107680&&(_0x107680=await resolveAgentId(_0x58a7a2,_0x363c03,_0x33c09b,_0x103c53,_0x48f7a9['verbose'])),await _0x38a029(_0x41af8e,_0x107680,undefined);else throw _0xf2c110;}return!_0x3afe6f&&console[_0x4519d0(0x95)](),0x0;}catch(_0x32b47c){return console[_0x4519d0(0xd5)](),handleSDKError(_0x32b47c,_0x48f7a9),0x1;}}[a8_0x13b8d2(0xb3)](_0x1444cd){const _0x2d32d4=a8_0x13b8d2;if(_0x2d32d4(0x94)in _0x1444cd)process['stdout'][_0x2d32d4(0xb1)](_0x1444cd[_0x2d32d4(0x94)]);else _0x2d32d4(0xd5)in _0x1444cd&&console['error'](_0x2d32d4(0x8d)+_0x1444cd[_0x2d32d4(0xd5)]);}}export class ChatCreateCommand extends BaseCommand{[a8_0x13b8d2(0xbd)]=a8_0x13b8d2(0xb0);[a8_0x13b8d2(0xa8)]=a8_0x13b8d2(0xd3);[a8_0x13b8d2(0xa6)](_0x486c29){const _0x576044=a8_0x13b8d2,_0x2ab217=_0x486c29[_0x576044(0xba)],_0x30260a=_0x2ab217[_0x576044(0xa2)],_0x1b3a8e=_0x2ab217[_0x576044(0x91)];if(!_0x30260a&&!_0x1b3a8e)return _0x576044(0x9f);return undefined;}async[a8_0x13b8d2(0x8a)](_0x22ec7e){const _0x164b36=a8_0x13b8d2,{options:_0x5e5cfe,tdx:_0x9f1055}=_0x22ec7e,_0x3c2054=_0x5e5cfe,_0xfc713=_0x3c2054['agent'],_0x488ba1=_0x3c2054[_0x164b36(0x91)],_0x51bc19=_0x3c2054[_0x164b36(0xb5)];try{const _0x568072=await resolveAgentId(_0x9f1055,_0xfc713,_0x488ba1,_0x51bc19,_0x5e5cfe['verbose']),_0x1e282a=await _0x9f1055[_0x164b36(0xac)][_0x164b36(0xcf)](_0x568072);return saveLastChatId(_0x1e282a['id']),console[_0x164b36(0x95)](JSON[_0x164b36(0xc1)]({'chatId':_0x1e282a['id'],'agentId':_0x568072})),0x0;}catch(_0x4f2597){return handleSDKError(_0x4f2597,_0x5e5cfe),0x1;}}}
|