@treasuredata/tdx 2026.3.20 → 2026.3.22
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.d.ts +1 -1
- package/dist/cli-categories.js +1 -1
- package/dist/cli-categories.js.map +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/auth-login-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/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-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/policy-command.d.ts +33 -0
- package/dist/commands/policy-command.d.ts.map +1 -0
- package/dist/commands/policy-command.js +1 -0
- package/dist/commands/policy-command.js.map +1 -0
- 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/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.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/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-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/oauth-refresh.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/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.d.ts +7 -0
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.d.ts +41 -0
- package/dist/sdk/policy.d.ts.map +1 -0
- package/dist/sdk/policy.js +1 -0
- package/dist/sdk/policy.js.map +1 -0
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.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-validator.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-recovery.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/segment-validator.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/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.d.ts +1 -0
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/index.js.map +1 -1
- package/dist/sdk/types/policy.d.ts +58 -0
- package/dist/sdk/types/policy.d.ts.map +1 -0
- package/dist/sdk/types/policy.js +1 -0
- package/dist/sdk/types/policy.js.map +1 -0
- 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/paginate.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/file-reader.js +1 -1
- package/dist/utils/github-releases.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/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x331360=a4_0x5a2e;(function(_0x573a2f,_0x2ed40c){const _0x5518dc=a4_0x5a2e,_0x341a4b=_0x573a2f();while(!![]){try{const _0x1aff3a=parseInt(_0x5518dc(0xba))/0x1+parseInt(_0x5518dc(0x123))/0x2*(-parseInt(_0x5518dc(0xb5))/0x3)+parseInt(_0x5518dc(0x142))/0x4+-parseInt(_0x5518dc(0xc6))/0x5+parseInt(_0x5518dc(0xc4))/0x6*(-parseInt(_0x5518dc(0x160))/0x7)+parseInt(_0x5518dc(0xea))/0x8+parseInt(_0x5518dc(0xfe))/0x9;if(_0x1aff3a===_0x2ed40c)break;else _0x341a4b['push'](_0x341a4b['shift']());}catch(_0x172cd9){_0x341a4b['push'](_0x341a4b['shift']());}}}(a4_0x1d91,0x8a4a4));import a4_0x5f490c from'chalk';import a4_0x4515b8 from'path';import{existsSync,readFileSync}from'fs';function a4_0x1d91(){const _0x17504e=['\x20\x20Experimental\x20Knowledge\x20Bases:\x20','source','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x0a✔\x20Pushed\x20','Cloning\x20\x22','projectDir','Pushing\x20agent\x20from\x20\x22','Cancelled','\x20\x20Prompts:\x20','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','gray','experimentalKnowledgeBases','Using\x20local\x20project:\x20','\x20total','outputPath','integrations','311376mxDlRC','\x20=\x20','\x20\x20Experimental\x20Artifacts:\x20','\x20\x20Knowledge\x20Base\x20\x22','Writing\x20files...','New\x20project:\x20','Project\x20cloned\x20successfully','\x20\x20Experimental\x20Artifact\x20\x22','\x22:\x20','reason','\x22\x20to\x20new\x20project\x20\x22','profile','cwd','Project:\x20','dim','\x20\x20Integrations:\x20','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','found','Analyzing\x20changes\x20to\x20push...','agent:clone','no_context','yes','\x20--profile\x20','\x0aChanges\x20to\x20agent\x20\x27','log','total','Source:\x20','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x0aChanges\x20to\x20integration\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project','63413EYTfxm','<new-name>','agent.yml','\x0aPull\x20summary\x20for\x20\x27','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','join','action','\x0aError:','red','projectId','\x20updated','projectName','Output\x20path:\x20','cyan','\x0aProject\x20pushed\x20with\x20errors','description','knowledgeBases','\x20\x20Text\x20Knowledge\x20Base\x20\x22','555sOOIMV','newProjectId','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','Usage:\x20tdx\x20agent\x20pull\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#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','pullProject','93560TpNGhg','\x20\x20Knowledge\x20Bases:\x20','\x20errors','cloneProject','Would\x20pull\x20agent:\x20','Output:\x20','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','new','utf-8','green','258smkHYd','Would\x20clone:','2430670cihoUt','-\x20no\x20files\x20written','\x20\x20Target:\x20','Clone\x20\x22','\x22\x20to\x20\x22','diff','counts','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','experimentalArtifacts','llm','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\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.','Analyzing\x20project\x20\x22','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','site','-\x20nothing\x20pushed','\x0aErrors\x20found:','push','\x0aChanges:','Chat:\x20','\x20\x20Agents:\x20','\x20|\x20','tdx.json','New\x20project\x20name\x20is\x20required','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','prompts','\x22\x20from\x20project\x20\x22','No\x20tdx.json\x20found\x20in\x20','yellow','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x27\x20to\x20create\x20the\x20folder\x20structure.','newProjectName','\x20\x20Prompt\x20\x22','hasChanges','arg-dir','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','1362616lipgNi','Using\x20project:\x20','textKnowledgeBases','agents','Errors:','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','Using\x20context\x20project:\x20','llm_project','message','\x20unchanged','name','repeat','Using\x20current\x20project:\x20','pushProject','cwd-config','\x20\x20Agent\x20\x22','\x20\x20Integration\x20\x22','\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)','agentId','llmProject','12136149aYMhyo','agent:push','execute','Would\x20push\x20agent:\x20','Project\x20cloned\x20with\x20errors','\x20changed','Pushing\x20to\x20project...','errors','parse','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x20resources\x20to\x20\x27','Status:\x20','agentName','✔\x20Context\x20set:\x20','dryRun','INVALID_ARGUMENT','\x0aWrite\x20','Agent\x20','\x20--name\x20','\x0aPush\x20summary\x20for\x20\x27','force','outputDir','Using\x20project\x20from\x20context:\x20','created','no_local_folder','agent','error','unchanged','\x20new','\x20files\x20to\x20','\x0a✔\x20Pulled\x20','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','New\x20project\x20ID:\x20','updated','Summary:','agent:pull','2682GufHvo','\x20\x20Text\x20Knowledge\x20Bases:\x20','isNew','Cannot\x20clone\x20from\x20context\x20project\x20\x22','sourceProjectName','session','Using\x20project\x20from\x20','Agent:\x20','context','\x22...','\x22\x20to\x20a\x20different\x20profile','dirname','Dry\x20run\x20-\x20no\x20changes\x20made','\x20created'];a4_0x1d91=function(){return _0x17504e;};return a4_0x1d91();}function a4_0x5a2e(_0x460d4a,_0x47ae2a){_0x460d4a=_0x460d4a-0xaf;const _0x1d9114=a4_0x1d91();let _0x5a2e35=_0x1d9114[_0x460d4a];return _0x5a2e35;}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,resolveAgentPullArgs}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(_0x2a0e6a){const _0x592f38=a4_0x5a2e,_0x39ff7d=[];if(_0x2a0e6a[_0x592f38(0x15b)]!==undefined)_0x39ff7d[_0x592f38(0xd7)](_0x2a0e6a[_0x592f38(0x15b)]+_0x592f38(0x13f));if(_0x2a0e6a[_0x592f38(0xc1)]!==undefined&&_0x2a0e6a[_0x592f38(0xc1)]>0x0)_0x39ff7d['push'](a4_0x5f490c[_0x592f38(0xc3)](_0x2a0e6a['new']+_0x592f38(0x11b)));if(_0x2a0e6a[_0x592f38(0x116)]!==undefined&&_0x2a0e6a[_0x592f38(0x116)]>0x0)_0x39ff7d[_0x592f38(0xd7)](a4_0x5f490c[_0x592f38(0xc3)](_0x2a0e6a['created']+_0x592f38(0x130)));if(_0x2a0e6a[_0x592f38(0x120)]!==undefined&&_0x2a0e6a[_0x592f38(0x120)]>0x0)_0x39ff7d['push'](a4_0x5f490c[_0x592f38(0xe2)](_0x2a0e6a[_0x592f38(0x120)]+_0x592f38(0x16a)));if(_0x2a0e6a[_0x592f38(0x11a)]!==undefined&&_0x2a0e6a[_0x592f38(0x11a)]>0x0)_0x39ff7d[_0x592f38(0xd7)](a4_0x5f490c[_0x592f38(0x13c)](_0x2a0e6a['unchanged']+_0x592f38(0xf3)));if(_0x2a0e6a[_0x592f38(0x105)]!==undefined&&_0x2a0e6a[_0x592f38(0x105)]>0x0)_0x39ff7d[_0x592f38(0xd7)](a4_0x5f490c['red'](_0x2a0e6a['errors']+_0x592f38(0xbc)));return _0x39ff7d[_0x592f38(0x165)](',\x20');}function displayDiffs(_0x322372,_0x18a472,_0x2fef93,_0x3eb37a,_0x457325,_0x21918f,_0x4012d2){const _0x5ec1b4=a4_0x5a2e;for(const _0x52af83 of _0x322372){if(_0x52af83[_0x5ec1b4(0xcb)]){const _0x4c050d=_0x52af83[_0x5ec1b4(0x10b)]||_0x52af83[_0x5ec1b4(0xf4)];console[_0x5ec1b4(0x15a)](_0x5ec1b4(0x159)+_0x4c050d+'\x27:'),console[_0x5ec1b4(0x15a)]('─'['repeat'](0x3c)),console[_0x5ec1b4(0x15a)](_0x52af83[_0x5ec1b4(0xcb)]),console[_0x5ec1b4(0x15a)]('─'[_0x5ec1b4(0xf5)](0x3c));}}for(const _0x332ff9 of _0x18a472){_0x332ff9[_0x5ec1b4(0xcb)]&&(console[_0x5ec1b4(0x15a)](_0x5ec1b4(0x108)+_0x332ff9['name']+'\x27:'),console['log']('─'[_0x5ec1b4(0xf5)](0x3c)),console[_0x5ec1b4(0x15a)](_0x332ff9[_0x5ec1b4(0xcb)]),console[_0x5ec1b4(0x15a)]('─'[_0x5ec1b4(0xf5)](0x3c)));}for(const _0x419e2b of _0x2fef93){_0x419e2b['diff']&&(console[_0x5ec1b4(0x15a)](_0x5ec1b4(0x164)+_0x419e2b[_0x5ec1b4(0xf4)]+'\x27:'),console[_0x5ec1b4(0x15a)]('─'['repeat'](0x3c)),console['log'](_0x419e2b['diff']),console[_0x5ec1b4(0x15a)]('─'[_0x5ec1b4(0xf5)](0x3c)));}for(const _0x51f7c0 of _0x3eb37a){_0x51f7c0[_0x5ec1b4(0xcb)]&&(console['log']('\x0aChanges\x20to\x20prompt\x20\x27'+_0x51f7c0[_0x5ec1b4(0xf4)]+'\x27:'),console['log']('─'[_0x5ec1b4(0xf5)](0x3c)),console[_0x5ec1b4(0x15a)](_0x51f7c0[_0x5ec1b4(0xcb)]),console[_0x5ec1b4(0x15a)]('─'['repeat'](0x3c)));}for(const _0x3aea6d of _0x457325){_0x3aea6d[_0x5ec1b4(0xcb)]&&(console[_0x5ec1b4(0x15a)](_0x5ec1b4(0x15e)+_0x3aea6d['name']+'\x27:'),console[_0x5ec1b4(0x15a)]('─'[_0x5ec1b4(0xf5)](0x3c)),console['log'](_0x3aea6d[_0x5ec1b4(0xcb)]),console[_0x5ec1b4(0x15a)]('─'[_0x5ec1b4(0xf5)](0x3c)));}for(const _0x5408dd of _0x21918f){_0x5408dd[_0x5ec1b4(0xcb)]&&(console[_0x5ec1b4(0x15a)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x5408dd['name']+'\x27:'),console[_0x5ec1b4(0x15a)]('─'['repeat'](0x3c)),console['log'](_0x5408dd[_0x5ec1b4(0xcb)]),console[_0x5ec1b4(0x15a)]('─'[_0x5ec1b4(0xf5)](0x3c)));}for(const _0x3cd39b of _0x4012d2){_0x3cd39b[_0x5ec1b4(0xcb)]&&(console[_0x5ec1b4(0x15a)](_0x5ec1b4(0x134)+_0x3cd39b['name']+'\x27:'),console['log']('─'[_0x5ec1b4(0xf5)](0x3c)),console['log'](_0x3cd39b[_0x5ec1b4(0xcb)]),console[_0x5ec1b4(0x15a)]('─'[_0x5ec1b4(0xf5)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']=a4_0x331360(0x122);[a4_0x331360(0xb2)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async['execute'](_0x30e5f0){const _0x4164e1=a4_0x331360,{options:_0x5c0528,args:_0x1e5fe9,tdx:_0x2c3198}=_0x30e5f0,_0x54962e=_0x1e5fe9[0x0],_0x58fd2a=_0x1e5fe9[0x1],_0x5aa254=_0x5c0528['output'],_0x13159a=_0x5c0528[_0x4164e1(0x10d)],_0x5f09c2=_0x5c0528[_0x4164e1(0x113)],_0x3f1383=_0x5c0528[_0x4164e1(0x157)],_0x434f10=_0x5c0528['llmProject'],_0x1d0859=_0x5c0528[_0x4164e1(0x118)];let _0xf52789;if(_0x54962e){const _0xde893f=a4_0x4515b8[_0x4164e1(0x165)](_0x54962e,_0x4164e1(0xdc));if(existsSync(_0xde893f))try{const _0x4102b6=JSON[_0x4164e1(0x106)](readFileSync(_0xde893f,_0x4164e1(0xc2)));_0x4102b6['llm_project']&&(_0xf52789={'llm_project':_0x4102b6['llm_project']});}catch{}}const _0xcbfdd8=findAgentConfigPath(process[_0x4164e1(0x14e)]());let _0x2901ed;if(_0xcbfdd8)try{const _0x343955=JSON[_0x4164e1(0x106)](readFileSync(_0xcbfdd8,_0x4164e1(0xc2)));_0x343955[_0x4164e1(0xf1)]&&(_0x2901ed={'llm_project':_0x343955[_0x4164e1(0xf1)]});}catch{}const _0x146279=resolveAgentPullArgs({'arg':_0x54962e,'agentNameArg':_0x58fd2a,'agentFlag':_0x1d0859,'contextProject':_0x434f10,'argDirConfig':_0xf52789,'cwdConfigPath':_0xcbfdd8||undefined,'cwdConfig':_0x2901ed}),{projectNameOrId:_0x3d448e,targetAgentName:_0x4affc6,existingOutputDir:_0x5dc4be,source:_0x14adf3}=_0x146279;if(_0x14adf3===_0x4164e1(0xe8))console['log'](a4_0x5f490c[_0x4164e1(0x150)](_0x4164e1(0x129)+a4_0x4515b8[_0x4164e1(0x165)](_0x54962e,'tdx.json')+':\x20'+_0x3d448e));else{if(_0x14adf3===_0x4164e1(0xf8))console['log'](a4_0x5f490c['dim'](_0x4164e1(0xeb)+_0x3d448e));else _0x14adf3===_0x4164e1(0x12b)&&console[_0x4164e1(0x15a)](a4_0x5f490c['dim'](_0x4164e1(0x115)+_0x3d448e));}if(!_0x3d448e)return _0x1d0859?(console['log'](a4_0x5f490c[_0x4164e1(0xe2)](_0x4164e1(0x13b))),console['log']('Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>'),console['log'](_0x4164e1(0x152))):(console[_0x4164e1(0x15a)](a4_0x5f490c[_0x4164e1(0xe2)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console['log'](_0x4164e1(0xb8)),console[_0x4164e1(0x15a)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project'),console[_0x4164e1(0x15a)](_0x4164e1(0xd0)),console['log'](_0x4164e1(0x15f)),console[_0x4164e1(0x15a)](_0x4164e1(0x107))),0x1;if(_0x4affc6){const {data:_0x531c09}=await withSpinner('Pulling\x20agent\x20\x22'+_0x4affc6+_0x4164e1(0xe0)+_0x3d448e+_0x4164e1(0x12c),()=>_0x2c3198[_0x4164e1(0xcf)]['pullAgent'](_0x3d448e,_0x4affc6,_0x5aa254,{'dryRun':_0x13159a,'force':_0x5f09c2}));if(_0x13159a)return console[_0x4164e1(0x15a)](a4_0x5f490c['yellow']('Dry\x20run\x20-\x20no\x20files\x20written')),console[_0x4164e1(0x15a)](_0x4164e1(0xbe)+_0x531c09[_0x4164e1(0x10b)]),console[_0x4164e1(0x15a)](_0x4164e1(0xaf)+_0x531c09[_0x4164e1(0x140)]),_0x531c09[_0x4164e1(0xcb)]&&(console[_0x4164e1(0x15a)](_0x4164e1(0xd8)),console['log']('─'[_0x4164e1(0xf5)](0x3c)),console['log'](_0x531c09[_0x4164e1(0xcb)]),console['log']('─'[_0x4164e1(0xf5)](0x3c))),0x0;return console[_0x4164e1(0x15a)](a4_0x5f490c['green']('Agent\x20pulled\x20successfully')),console[_0x4164e1(0x15a)](_0x4164e1(0x12a)+_0x531c09[_0x4164e1(0x10b)]),console[_0x4164e1(0x15a)](_0x4164e1(0xbf)+_0x531c09[_0x4164e1(0x140)]),console[_0x4164e1(0x15a)](_0x4164e1(0x10a)+(_0x531c09[_0x4164e1(0x125)]?a4_0x5f490c[_0x4164e1(0xc3)](_0x4164e1(0xc1)):_0x531c09[_0x4164e1(0xe7)]?a4_0x5f490c[_0x4164e1(0xe2)](_0x4164e1(0x120)):a4_0x5f490c[_0x4164e1(0x13c)](_0x4164e1(0x11a)))),0x0;}const _0x527d93=_0x5dc4be||_0x5aa254,{data:_0x1af576}=await withSpinner(_0x4164e1(0xd2)+_0x3d448e+'\x22...',()=>_0x2c3198[_0x4164e1(0xcf)]['pullProject'](_0x3d448e,_0x527d93,{'dryRun':!![]})),_0x12fe96=_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0xed)][_0x4164e1(0xc1)]+_0x1af576[_0x4164e1(0xcc)]['knowledgeBases'][_0x4164e1(0xc1)]+_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0xec)][_0x4164e1(0xc1)]+_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0xdf)][_0x4164e1(0xc1)]+_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0x141)][_0x4164e1(0xc1)]+_0x1af576[_0x4164e1(0xcc)]['experimentalKnowledgeBases'][_0x4164e1(0xc1)]+_0x1af576['counts'][_0x4164e1(0xce)][_0x4164e1(0xc1)],_0x46faa7=_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0xed)]['updated']+_0x1af576['counts'][_0x4164e1(0xb3)][_0x4164e1(0x120)]+_0x1af576['counts']['textKnowledgeBases']['updated']+_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0xdf)][_0x4164e1(0x120)]+_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0x141)]['updated']+_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0x13d)][_0x4164e1(0x120)]+_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0xce)][_0x4164e1(0x120)],_0x2be3da=_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0xed)][_0x4164e1(0x11a)]+_0x1af576[_0x4164e1(0xcc)]['knowledgeBases']['unchanged']+_0x1af576['counts'][_0x4164e1(0xec)][_0x4164e1(0x11a)]+_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0xdf)][_0x4164e1(0x11a)]+_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0x141)][_0x4164e1(0x11a)]+_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0x13d)][_0x4164e1(0x11a)]+_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0xce)][_0x4164e1(0x11a)];console['log'](_0x4164e1(0x163)+_0x1af576[_0x4164e1(0x16b)]+'\x27:'),console['log']('\x20\x20'+a4_0x5f490c[_0x4164e1(0xc3)]('+\x20'+_0x12fe96+_0x4164e1(0x11b))+_0x4164e1(0xdb)+a4_0x5f490c[_0x4164e1(0xe2)]('~\x20'+_0x46faa7+_0x4164e1(0x103))+_0x4164e1(0xdb)+a4_0x5f490c[_0x4164e1(0x150)]('=\x20'+_0x2be3da+'\x20unchanged')),console[_0x4164e1(0x15a)](_0x4164e1(0xda)+formatCountSummary(_0x1af576['counts'][_0x4164e1(0xed)])),console['log']('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x1af576[_0x4164e1(0xcc)]['knowledgeBases'])),console[_0x4164e1(0x15a)](_0x4164e1(0x124)+formatCountSummary(_0x1af576[_0x4164e1(0xcc)]['textKnowledgeBases'])),console[_0x4164e1(0x15a)](_0x4164e1(0x13a)+formatCountSummary(_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0xdf)])),console['log'](_0x4164e1(0x151)+formatCountSummary(_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0x141)]));const _0x1332ec=_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0x13d)][_0x4164e1(0x15b)]>0x0||_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0xce)][_0x4164e1(0x15b)]>0x0;_0x1332ec&&(console['log'](_0x4164e1(0x131)+formatCountSummary(_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0x13d)])),console[_0x4164e1(0x15a)](_0x4164e1(0x144)+formatCountSummary(_0x1af576[_0x4164e1(0xcc)][_0x4164e1(0xce)])));console[_0x4164e1(0x15a)](_0x4164e1(0xc8)+a4_0x5f490c[_0x4164e1(0xb0)](_0x1af576['outputDir'])),displayDiffs(_0x1af576[_0x4164e1(0xed)],_0x1af576[_0x4164e1(0xb3)],_0x1af576[_0x4164e1(0xec)],_0x1af576[_0x4164e1(0xdf)],_0x1af576[_0x4164e1(0x141)],_0x1af576[_0x4164e1(0x13d)],_0x1af576[_0x4164e1(0xce)]);if(_0x13159a)return console[_0x4164e1(0x15a)](a4_0x5f490c[_0x4164e1(0xe2)](_0x4164e1(0x133))),0x0;if(_0x12fe96===0x0&&_0x46faa7===0x0)return console['log'](a4_0x5f490c[_0x4164e1(0xc3)](_0x4164e1(0xe9))),saveSessionContext({'llm_project':_0x1af576[_0x4164e1(0x16b)]},_0x5c0528[_0x4164e1(0x128)]),console[_0x4164e1(0x15a)](a4_0x5f490c[_0x4164e1(0xc3)]('✔\x20Context\x20set:\x20'+a4_0x5f490c[_0x4164e1(0x150)]('llm_project')+_0x4164e1(0x143)+a4_0x5f490c[_0x4164e1(0xb0)](_0x1af576['projectName']))),0x0;if(!_0x3f1383&&!_0x5f09c2){if(!isInteractive())return console[_0x4164e1(0x119)](a4_0x5f490c['red']('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x4164e1(0x119)](a4_0x5f490c['dim'](_0x4164e1(0xd3))),0x1;const _0x85b247=await confirmKey(_0x4164e1(0x10f)+(_0x12fe96+_0x46faa7)+'\x20files?');if(!_0x85b247)return console[_0x4164e1(0x15a)](a4_0x5f490c[_0x4164e1(0xe2)](_0x4164e1(0x139)),_0x4164e1(0xc7)),0x1;}const {data:_0x28bef9}=await withSpinner(_0x4164e1(0x146),()=>_0x2c3198[_0x4164e1(0xcf)][_0x4164e1(0xb9)](_0x3d448e,_0x527d93,{'force':_0x5f09c2}));return console[_0x4164e1(0x15a)](a4_0x5f490c[_0x4164e1(0xc3)](_0x4164e1(0x11d)+(_0x12fe96+_0x46faa7)+_0x4164e1(0x11c)+_0x28bef9[_0x4164e1(0x114)])),saveSessionContext({'llm_project':_0x28bef9['projectName']},_0x5c0528['session']),console['log'](a4_0x5f490c[_0x4164e1(0xc3)](_0x4164e1(0x10c)+a4_0x5f490c[_0x4164e1(0x150)](_0x4164e1(0xf1))+_0x4164e1(0x143)+a4_0x5f490c[_0x4164e1(0xb0)](_0x28bef9[_0x4164e1(0x16b)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x331360(0xf4)]=a4_0x331360(0x155);[a4_0x331360(0xb2)]=a4_0x331360(0x15d);async[a4_0x331360(0x100)](_0x5485a6){const _0x233d51=a4_0x331360,{options:_0x289af8,args:_0xe12882,tdx:_0x4868fe}=_0x5485a6,_0x5ca833=_0xe12882[0x0],_0x2c5151=_0x289af8[_0x233d51(0xf4)],_0x56fe8d=_0x289af8[_0x233d51(0x10d)],_0x568b29=_0x289af8[_0x233d51(0x157)],_0x1a1c46=_0x289af8[_0x233d51(0xd4)],_0x3a9416=_0x289af8[_0x233d51(0xfd)];let _0x3e81f8;const _0x524043=findAgentConfigPath(process['cwd']());if(_0x5ca833){const _0x293526=a4_0x4515b8[_0x233d51(0x165)](_0x5ca833,_0x233d51(0xdc));existsSync(_0x293526)?(_0x3e81f8=_0x5ca833,console['log'](a4_0x5f490c[_0x233d51(0x150)](_0x233d51(0x13e)+_0x5ca833))):_0x3e81f8=_0x5ca833;}else{if(_0x524043)_0x3e81f8=a4_0x4515b8[_0x233d51(0x12e)](_0x524043),console[_0x233d51(0x15a)](a4_0x5f490c['dim'](_0x233d51(0xf6)+_0x3e81f8));else{if(_0x3a9416){const _0x4b90ae=sanitizeForFilesystem(_0x3a9416);let _0x1a75a2=_0x4b90ae,_0x524674=a4_0x4515b8['join'](process[_0x233d51(0x14e)](),_0x233d51(0xed),_0x4b90ae,'tdx.json');if(!existsSync(_0x524674)){const _0x568a34=normalizeName(_0x3a9416),_0x3c744f=a4_0x4515b8[_0x233d51(0x165)](process[_0x233d51(0x14e)](),'agents',_0x568a34,_0x233d51(0xdc));existsSync(_0x3c744f)&&(_0x1a75a2=_0x568a34,_0x524674=_0x3c744f);}if(existsSync(_0x524674))_0x3e81f8=a4_0x4515b8[_0x233d51(0x12e)](_0x524674),console['log'](a4_0x5f490c[_0x233d51(0x150)](_0x233d51(0x13e)+_0x3e81f8));else{const _0x1d610d=_0x289af8[_0x233d51(0x14d)];if(_0x1d610d)throw new SDKError(ErrorCode[_0x233d51(0x10e)],_0x233d51(0x126)+_0x3a9416+_0x233d51(0x12d),undefined,{'helpText':'When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a'+_0x233d51(0xef)+('\x20\x20tdx\x20agent\x20pull\x20'+_0x3a9416+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x1a75a2+_0x233d51(0x111)+(_0x2c5151||_0x233d51(0x161))+_0x233d51(0x158)+_0x1d610d)});_0x3e81f8=_0x3a9416,console[_0x233d51(0x15a)](a4_0x5f490c['dim'](_0x233d51(0xf0)+_0x3a9416));}}}}if(!_0x3e81f8)return console['log'](a4_0x5f490c[_0x233d51(0xe2)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x233d51(0x15a)](_0x233d51(0xcd)),console[_0x233d51(0x15a)](_0x233d51(0xe3)),console[_0x233d51(0x15a)](_0x233d51(0xfb)),console['log']('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x2c5151)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x233d51(0xdd),undefined,{'helpText':_0x233d51(0xb7)});if(!_0x568b29&&!_0x56fe8d){if(!isInteractive())return console[_0x233d51(0x119)](a4_0x5f490c[_0x233d51(0x168)]('\x0aError:'),_0x233d51(0xde)),console['error'](a4_0x5f490c[_0x233d51(0x150)](_0x233d51(0xd3))),0x1;const _0x2f4451=await confirmKey(_0x233d51(0xc9)+_0x3e81f8+_0x233d51(0x14c)+_0x2c5151+'\x22?');if(!_0x2f4451)return console['log'](a4_0x5f490c[_0x233d51(0xe2)]('Cancelled')),0x1;}const {data:_0x149ee9}=await withSpinner(_0x233d51(0x136)+_0x3e81f8+_0x233d51(0xca)+_0x2c5151+_0x233d51(0x12c),()=>_0x4868fe[_0x233d51(0xcf)][_0x233d51(0xbd)](_0x3e81f8,_0x2c5151,{'dryRun':_0x56fe8d}));if(_0x56fe8d){console[_0x233d51(0x15a)](a4_0x5f490c[_0x233d51(0xe2)](_0x233d51(0x12f))),console[_0x233d51(0x15a)](_0x233d51(0x15c)+_0x149ee9[_0x233d51(0x127)]),console[_0x233d51(0x15a)](_0x233d51(0x147)+_0x2c5151),console[_0x233d51(0x15a)](_0x233d51(0xc5)),console[_0x233d51(0x15a)](_0x233d51(0xda)+_0x149ee9[_0x233d51(0xcc)][_0x233d51(0xed)][_0x233d51(0x116)]),console[_0x233d51(0x15a)](_0x233d51(0xbb)+_0x149ee9[_0x233d51(0xcc)][_0x233d51(0xb3)][_0x233d51(0x116)]),console['log'](_0x233d51(0x13a)+_0x149ee9['counts']['prompts'][_0x233d51(0x116)]);const _0x159965=_0x149ee9['counts'][_0x233d51(0x13d)][_0x233d51(0x116)]>0x0||_0x149ee9[_0x233d51(0xcc)][_0x233d51(0xce)][_0x233d51(0x116)]>0x0;return _0x159965&&(console[_0x233d51(0x15a)](_0x233d51(0x131)+_0x149ee9[_0x233d51(0xcc)][_0x233d51(0x13d)][_0x233d51(0x116)]),console['log'](_0x233d51(0x144)+_0x149ee9[_0x233d51(0xcc)][_0x233d51(0xce)][_0x233d51(0x116)])),0x0;}const _0x3d17c9=_0x149ee9[_0x233d51(0xcc)][_0x233d51(0xed)][_0x233d51(0x105)]>0x0||_0x149ee9[_0x233d51(0xcc)][_0x233d51(0xb3)][_0x233d51(0x105)]>0x0||_0x149ee9[_0x233d51(0xcc)][_0x233d51(0xdf)][_0x233d51(0x105)]>0x0||_0x149ee9['counts'][_0x233d51(0x13d)][_0x233d51(0x105)]>0x0||_0x149ee9[_0x233d51(0xcc)][_0x233d51(0xce)][_0x233d51(0x105)]>0x0;_0x3d17c9?console[_0x233d51(0x15a)](a4_0x5f490c[_0x233d51(0xe2)](_0x233d51(0x102))):console[_0x233d51(0x15a)](a4_0x5f490c['green'](_0x233d51(0x148)));console[_0x233d51(0x15a)](_0x233d51(0x15c)+_0x149ee9[_0x233d51(0x127)]),console[_0x233d51(0x15a)](_0x233d51(0x147)+_0x149ee9[_0x233d51(0xe5)]),console['log'](_0x233d51(0x11f)+_0x149ee9[_0x233d51(0xb6)]),console[_0x233d51(0x15a)](),console[_0x233d51(0x15a)](_0x233d51(0x121)),console[_0x233d51(0x15a)](_0x233d51(0xda)+formatCountSummary(_0x149ee9[_0x233d51(0xcc)][_0x233d51(0xed)])),console[_0x233d51(0x15a)](_0x233d51(0xbb)+formatCountSummary(_0x149ee9[_0x233d51(0xcc)][_0x233d51(0xb3)])),console[_0x233d51(0x15a)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x149ee9[_0x233d51(0xcc)][_0x233d51(0xdf)])),console['log'](_0x233d51(0x151)+formatCountSummary(_0x149ee9[_0x233d51(0xcc)][_0x233d51(0x141)]));const _0x19f889=_0x149ee9[_0x233d51(0xcc)][_0x233d51(0x13d)][_0x233d51(0x116)]>0x0||_0x149ee9[_0x233d51(0xcc)]['experimentalKnowledgeBases'][_0x233d51(0x120)]>0x0||_0x149ee9[_0x233d51(0xcc)][_0x233d51(0x13d)][_0x233d51(0x11a)]>0x0||_0x149ee9[_0x233d51(0xcc)][_0x233d51(0xce)][_0x233d51(0x116)]>0x0||_0x149ee9[_0x233d51(0xcc)][_0x233d51(0xce)][_0x233d51(0x120)]>0x0||_0x149ee9[_0x233d51(0xcc)][_0x233d51(0xce)][_0x233d51(0x11a)]>0x0;_0x19f889&&(console['log'](_0x233d51(0x131)+formatCountSummary(_0x149ee9['counts'][_0x233d51(0x13d)])),console[_0x233d51(0x15a)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x149ee9[_0x233d51(0xcc)]['experimentalArtifacts'])));if(_0x3d17c9){console[_0x233d51(0x15a)](),console[_0x233d51(0x15a)](a4_0x5f490c[_0x233d51(0x168)]('Errors:'));for(const _0x527b79 of _0x149ee9[_0x233d51(0xed)]){_0x527b79[_0x233d51(0x166)]===_0x233d51(0x119)&&console[_0x233d51(0x15a)](a4_0x5f490c[_0x233d51(0x168)](_0x233d51(0xf9)+_0x527b79[_0x233d51(0x10b)]+_0x233d51(0x14a)+_0x527b79['error']));}for(const _0x26049a of _0x149ee9[_0x233d51(0xb3)]){_0x26049a[_0x233d51(0x166)]===_0x233d51(0x119)&&console[_0x233d51(0x15a)](a4_0x5f490c[_0x233d51(0x168)](_0x233d51(0x145)+_0x26049a[_0x233d51(0xf4)]+_0x233d51(0x14a)+_0x26049a[_0x233d51(0x119)]));}for(const _0x27c590 of _0x149ee9['prompts']){_0x27c590['action']==='error'&&console['log'](a4_0x5f490c[_0x233d51(0x168)]('\x20\x20Prompt\x20\x22'+_0x27c590[_0x233d51(0xf4)]+_0x233d51(0x14a)+_0x27c590[_0x233d51(0x119)]));}for(const _0x1d2544 of _0x149ee9['integrations']){_0x1d2544['action']==='error'&&console['log'](a4_0x5f490c['red'](_0x233d51(0xfa)+_0x1d2544[_0x233d51(0xf4)]+'\x22:\x20'+_0x1d2544[_0x233d51(0x119)]));}for(const _0x40afe1 of _0x149ee9[_0x233d51(0x13d)]){_0x40afe1[_0x233d51(0x166)]===_0x233d51(0x119)&&console['log'](a4_0x5f490c[_0x233d51(0x168)]('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0x40afe1[_0x233d51(0xf4)]+'\x22:\x20'+_0x40afe1[_0x233d51(0x119)]));}for(const _0x304706 of _0x149ee9['experimentalArtifacts']){_0x304706[_0x233d51(0x166)]===_0x233d51(0x119)&&console[_0x233d51(0x15a)](a4_0x5f490c[_0x233d51(0x168)](_0x233d51(0x149)+_0x304706[_0x233d51(0xf4)]+_0x233d51(0x14a)+_0x304706[_0x233d51(0x119)]));}return 0x1;}console[_0x233d51(0x15a)]();const _0x383676=getLLMProjectUrl(_0x1a1c46,_0x149ee9[_0x233d51(0xb6)]);return console['log'](_0x233d51(0x14f)+a4_0x5f490c[_0x233d51(0xb0)](_0x383676)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x331360(0xf4)]=a4_0x331360(0xff);[a4_0x331360(0xb2)]=a4_0x331360(0x11e);async[a4_0x331360(0x100)](_0x51702e){const _0xe5d998=a4_0x331360,{options:_0x486db1,args:_0x2282dd,tdx:_0x2ecfc7}=_0x51702e;let _0xa813c8=_0x2282dd[0x0]||process[_0xe5d998(0x14e)]();const _0x41ff62=_0x486db1['dryRun'],_0x232106=_0x486db1['force'],_0x31c85f=_0x486db1['yes'],_0x488537=_0x486db1[_0xe5d998(0xd4)],_0xa77caa=a4_0x4515b8[_0xe5d998(0x165)](_0xa813c8,_0xe5d998(0x162)),_0x3b7b6b=existsSync(_0xa77caa);if(_0x3b7b6b){const {data:_0x52649a}=await withSpinner(_0xe5d998(0x138)+_0xa813c8+_0xe5d998(0x12c),()=>_0x2ecfc7['llm']['pushAgent'](_0xa813c8,{'dryRun':_0x41ff62,'force':_0x232106}));if(_0x41ff62)return console[_0xe5d998(0x15a)](a4_0x5f490c[_0xe5d998(0xe2)](_0xe5d998(0x12f))),console[_0xe5d998(0x15a)](_0xe5d998(0x101)+_0x52649a[_0xe5d998(0x10b)]),0x0;if(_0x52649a['action']===_0xe5d998(0x119))return console['log'](a4_0x5f490c[_0xe5d998(0x168)]('Failed\x20to\x20push\x20agent:\x20'+_0x52649a[_0xe5d998(0x119)])),0x1;console[_0xe5d998(0x15a)](a4_0x5f490c[_0xe5d998(0xc3)](_0xe5d998(0x110)+_0x52649a[_0xe5d998(0x166)]+'\x20successfully')),console[_0xe5d998(0x15a)](_0xe5d998(0x12a)+_0x52649a['agentName']);if(_0x52649a[_0xe5d998(0xfc)]&&_0x52649a[_0xe5d998(0x169)]){const _0x5a87d1=getLLMAgentChatUrl(_0x488537,_0x52649a[_0xe5d998(0x169)],_0x52649a[_0xe5d998(0xfc)]);console[_0xe5d998(0x15a)](_0xe5d998(0xd9)+a4_0x5f490c[_0xe5d998(0xb0)](_0x5a87d1));}return 0x0;}const _0xb4d210=_0x486db1[_0xe5d998(0xfd)],_0x2dcc66=resolveProjectFromContext(_0xa813c8,_0xb4d210);if(_0x2dcc66[_0xe5d998(0x153)])_0xa813c8=_0x2dcc66[_0xe5d998(0x137)],_0x2dcc66[_0xe5d998(0x132)]===_0xe5d998(0x12b)&&console[_0xe5d998(0x15a)](a4_0x5f490c[_0xe5d998(0x150)](_0xe5d998(0xeb)+_0xa813c8));else{let _0x3bee25=_0xe5d998(0xd1);_0x2dcc66[_0xe5d998(0x14b)]===_0xe5d998(0x117)&&(_0x3bee25=_0x2dcc66[_0xe5d998(0xf2)]+_0xe5d998(0xc0)+_0x2dcc66[_0xe5d998(0xfd)]+_0xe5d998(0xe4));throw new SDKError(ErrorCode[_0xe5d998(0x10e)],_0x2dcc66[_0xe5d998(0x14b)]===_0xe5d998(0x156)?_0x2dcc66[_0xe5d998(0xf2)]:_0xe5d998(0xe1)+_0xa813c8,undefined,{'helpText':_0x3bee25});}const {data:_0x2101a7}=await withSpinner(_0xe5d998(0x154),()=>_0x2ecfc7[_0xe5d998(0xcf)][_0xe5d998(0xf7)](_0xa813c8,{'dryRun':!![]})),_0x45df95=_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0xed)][_0xe5d998(0x105)]>0x0;if(_0x45df95){console[_0xe5d998(0x15a)](a4_0x5f490c['red'](_0xe5d998(0xd6)));for(const _0x690b87 of _0x2101a7[_0xe5d998(0xed)]){_0x690b87[_0xe5d998(0x166)]===_0xe5d998(0x119)&&console[_0xe5d998(0x15a)](a4_0x5f490c[_0xe5d998(0x168)]('\x20\x20Agent\x20\x22'+_0x690b87[_0xe5d998(0x10b)]+_0xe5d998(0x14a)+_0x690b87[_0xe5d998(0x119)]));}return 0x1;}const _0x59ae31=_0x2101a7[_0xe5d998(0xcc)]['agents'][_0xe5d998(0x116)]+_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0xb3)][_0xe5d998(0x116)]+_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0xec)][_0xe5d998(0x116)]+_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0xdf)][_0xe5d998(0x116)]+_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0x141)][_0xe5d998(0x116)]+_0x2101a7[_0xe5d998(0xcc)]['experimentalKnowledgeBases'][_0xe5d998(0x116)]+_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0xce)]['created'],_0x5a3dbb=_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0xed)][_0xe5d998(0x120)]+_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0xb3)][_0xe5d998(0x120)]+_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0xec)]['updated']+_0x2101a7[_0xe5d998(0xcc)]['prompts'][_0xe5d998(0x120)]+_0x2101a7[_0xe5d998(0xcc)]['integrations'][_0xe5d998(0x120)]+_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0x13d)][_0xe5d998(0x120)]+_0x2101a7[_0xe5d998(0xcc)]['experimentalArtifacts'][_0xe5d998(0x120)],_0x37eddb=_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0xed)][_0xe5d998(0x11a)]+_0x2101a7['counts'][_0xe5d998(0xb3)]['unchanged']+_0x2101a7['counts'][_0xe5d998(0xec)][_0xe5d998(0x11a)]+_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0xdf)][_0xe5d998(0x11a)]+_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0x141)]['unchanged']+_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0x13d)]['unchanged']+_0x2101a7[_0xe5d998(0xcc)]['experimentalArtifacts'][_0xe5d998(0x11a)];console['log'](_0xe5d998(0x112)+_0x2101a7[_0xe5d998(0x16b)]+'\x27:'),console[_0xe5d998(0x15a)]('\x20\x20'+a4_0x5f490c[_0xe5d998(0xc3)]('+\x20'+_0x59ae31+'\x20new')+_0xe5d998(0xdb)+a4_0x5f490c['yellow']('~\x20'+_0x5a3dbb+'\x20changed')+_0xe5d998(0xdb)+a4_0x5f490c[_0xe5d998(0x150)]('=\x20'+_0x37eddb+_0xe5d998(0xf3))),console['log'](_0xe5d998(0xda)+formatCountSummary(_0x2101a7['counts'][_0xe5d998(0xed)])),console[_0xe5d998(0x15a)](_0xe5d998(0xbb)+formatCountSummary(_0x2101a7['counts'][_0xe5d998(0xb3)])),console['log'](_0xe5d998(0x124)+formatCountSummary(_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0xec)])),console[_0xe5d998(0x15a)](_0xe5d998(0x13a)+formatCountSummary(_0x2101a7['counts']['prompts'])),console[_0xe5d998(0x15a)](_0xe5d998(0x151)+formatCountSummary(_0x2101a7[_0xe5d998(0xcc)]['integrations']));const _0x176993=_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0x13d)][_0xe5d998(0x116)]>0x0||_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0x13d)][_0xe5d998(0x120)]>0x0||_0x2101a7['counts'][_0xe5d998(0x13d)]['unchanged']>0x0||_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0xce)][_0xe5d998(0x116)]>0x0||_0x2101a7[_0xe5d998(0xcc)]['experimentalArtifacts'][_0xe5d998(0x120)]>0x0||_0x2101a7[_0xe5d998(0xcc)]['experimentalArtifacts'][_0xe5d998(0x11a)]>0x0;_0x176993&&(console['log'](_0xe5d998(0x131)+formatCountSummary(_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0x13d)])),console['log']('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x2101a7[_0xe5d998(0xcc)][_0xe5d998(0xce)])));console[_0xe5d998(0x15a)]('\x20\x20Source:\x20'+a4_0x5f490c[_0xe5d998(0xb0)](_0xa813c8)),displayDiffs(_0x2101a7['agents'],_0x2101a7[_0xe5d998(0xb3)],_0x2101a7[_0xe5d998(0xec)],_0x2101a7['prompts'],_0x2101a7[_0xe5d998(0x141)],_0x2101a7[_0xe5d998(0x13d)],_0x2101a7['experimentalArtifacts']);if(_0x41ff62)return console['log'](a4_0x5f490c['yellow']('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x59ae31===0x0&&_0x5a3dbb===0x0){console[_0xe5d998(0x15a)](a4_0x5f490c[_0xe5d998(0xc3)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x36ff45=getLLMProjectUrl(_0x488537,_0x2101a7[_0xe5d998(0x169)]);return console[_0xe5d998(0x15a)](_0xe5d998(0x14f)+a4_0x5f490c[_0xe5d998(0xb0)](_0x36ff45)),0x0;}if(!_0x31c85f&&!_0x232106){if(!isInteractive())return console[_0xe5d998(0x119)](a4_0x5f490c[_0xe5d998(0x168)](_0xe5d998(0x167)),_0xe5d998(0xde)),console[_0xe5d998(0x119)](a4_0x5f490c[_0xe5d998(0x150)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x582951=await confirmKey('\x0aPush\x20'+(_0x59ae31+_0x5a3dbb)+'\x20resources?');if(!_0x582951)return console[_0xe5d998(0x15a)](a4_0x5f490c['yellow'](_0xe5d998(0x139)),_0xe5d998(0xd5)),0x1;}const {data:_0x53ee01}=await withSpinner(_0xe5d998(0x104),()=>_0x2ecfc7[_0xe5d998(0xcf)]['pushProject'](_0xa813c8,{'force':_0x232106})),_0x19d1ab=_0x53ee01[_0xe5d998(0xcc)][_0xe5d998(0xed)][_0xe5d998(0x105)]>0x0||_0x53ee01[_0xe5d998(0xcc)][_0xe5d998(0xb3)][_0xe5d998(0x105)]>0x0||_0x53ee01[_0xe5d998(0xcc)][_0xe5d998(0xec)]['errors']>0x0||_0x53ee01[_0xe5d998(0xcc)][_0xe5d998(0xdf)][_0xe5d998(0x105)]>0x0;if(_0x19d1ab){console[_0xe5d998(0x15a)](a4_0x5f490c[_0xe5d998(0xe2)](_0xe5d998(0xb1))),console[_0xe5d998(0x15a)](),console[_0xe5d998(0x15a)](a4_0x5f490c['red'](_0xe5d998(0xee)));for(const _0x38fd21 of _0x53ee01[_0xe5d998(0xed)]){_0x38fd21['action']===_0xe5d998(0x119)&&console[_0xe5d998(0x15a)](a4_0x5f490c[_0xe5d998(0x168)](_0xe5d998(0xf9)+_0x38fd21['agentName']+_0xe5d998(0x14a)+_0x38fd21[_0xe5d998(0x119)]));}for(const _0x5014fa of _0x53ee01[_0xe5d998(0xb3)]){_0x5014fa[_0xe5d998(0x166)]===_0xe5d998(0x119)&&console[_0xe5d998(0x15a)](a4_0x5f490c[_0xe5d998(0x168)](_0xe5d998(0x145)+_0x5014fa['name']+_0xe5d998(0x14a)+_0x5014fa[_0xe5d998(0x119)]));}for(const _0x3f25b0 of _0x53ee01[_0xe5d998(0xec)]){_0x3f25b0[_0xe5d998(0x166)]===_0xe5d998(0x119)&&console['log'](a4_0x5f490c['red'](_0xe5d998(0xb4)+_0x3f25b0[_0xe5d998(0xf4)]+_0xe5d998(0x14a)+_0x3f25b0[_0xe5d998(0x119)]));}for(const _0x92e369 of _0x53ee01['prompts']){_0x92e369[_0xe5d998(0x166)]===_0xe5d998(0x119)&&console[_0xe5d998(0x15a)](a4_0x5f490c[_0xe5d998(0x168)](_0xe5d998(0xe6)+_0x92e369[_0xe5d998(0xf4)]+_0xe5d998(0x14a)+_0x92e369[_0xe5d998(0x119)]));}for(const _0x54d352 of _0x53ee01['integrations']){_0x54d352['action']===_0xe5d998(0x119)&&console[_0xe5d998(0x15a)](a4_0x5f490c[_0xe5d998(0x168)](_0xe5d998(0xfa)+_0x54d352['name']+'\x22:\x20'+_0x54d352[_0xe5d998(0x119)]));}return 0x1;}console[_0xe5d998(0x15a)](a4_0x5f490c[_0xe5d998(0xc3)](_0xe5d998(0x135)+(_0x59ae31+_0x5a3dbb)+_0xe5d998(0x109)+_0x53ee01[_0xe5d998(0x16b)]+'\x27'));const _0x5cc9c4=getLLMProjectUrl(_0x488537,_0x53ee01['projectId']);return console[_0xe5d998(0x15a)](_0xe5d998(0x14f)+a4_0x5f490c[_0xe5d998(0xb0)](_0x5cc9c4)),0x0;}}
|
|
1
|
+
const a4_0x2b2217=a4_0x7c7f;(function(_0xa070de,_0x564371){const _0x164261=a4_0x7c7f,_0xaa9cfa=_0xa070de();while(!![]){try{const _0x1edf7a=-parseInt(_0x164261(0x24b))/0x1+parseInt(_0x164261(0x1fd))/0x2+parseInt(_0x164261(0x1f5))/0x3+-parseInt(_0x164261(0x1e9))/0x4*(parseInt(_0x164261(0x22c))/0x5)+parseInt(_0x164261(0x204))/0x6*(-parseInt(_0x164261(0x1c6))/0x7)+-parseInt(_0x164261(0x1b1))/0x8*(parseInt(_0x164261(0x21b))/0x9)+parseInt(_0x164261(0x219))/0xa;if(_0x1edf7a===_0x564371)break;else _0xaa9cfa['push'](_0xaa9cfa['shift']());}catch(_0x4bae76){_0xaa9cfa['push'](_0xaa9cfa['shift']());}}}(a4_0xbec1,0xce36a));import a4_0x135328 from'chalk';import a4_0x572045 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';function a4_0x7c7f(_0x2281bf,_0x318cd5){_0x2281bf=_0x2281bf-0x1ab;const _0xbec1e1=a4_0xbec1();let _0x7c7f9f=_0xbec1e1[_0x2281bf];return _0x7c7f9f;}import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}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(_0x3adf99){const _0x1eb67b=a4_0x7c7f,_0x5dbdba=[];if(_0x3adf99['total']!==undefined)_0x5dbdba['push'](_0x3adf99[_0x1eb67b(0x1d8)]+_0x1eb67b(0x1be));if(_0x3adf99['new']!==undefined&&_0x3adf99[_0x1eb67b(0x1c2)]>0x0)_0x5dbdba[_0x1eb67b(0x1d3)](a4_0x135328[_0x1eb67b(0x24d)](_0x3adf99['new']+_0x1eb67b(0x23b)));if(_0x3adf99['created']!==undefined&&_0x3adf99[_0x1eb67b(0x20e)]>0x0)_0x5dbdba[_0x1eb67b(0x1d3)](a4_0x135328['green'](_0x3adf99[_0x1eb67b(0x20e)]+_0x1eb67b(0x234)));if(_0x3adf99[_0x1eb67b(0x23e)]!==undefined&&_0x3adf99[_0x1eb67b(0x23e)]>0x0)_0x5dbdba[_0x1eb67b(0x1d3)](a4_0x135328['yellow'](_0x3adf99[_0x1eb67b(0x23e)]+'\x20updated'));if(_0x3adf99[_0x1eb67b(0x222)]!==undefined&&_0x3adf99[_0x1eb67b(0x222)]>0x0)_0x5dbdba['push'](a4_0x135328[_0x1eb67b(0x1f3)](_0x3adf99[_0x1eb67b(0x222)]+_0x1eb67b(0x207)));if(_0x3adf99[_0x1eb67b(0x1b5)]!==undefined&&_0x3adf99[_0x1eb67b(0x1b5)]>0x0)_0x5dbdba[_0x1eb67b(0x1d3)](a4_0x135328[_0x1eb67b(0x21f)](_0x3adf99[_0x1eb67b(0x1b5)]+'\x20errors'));return _0x5dbdba['join'](',\x20');}function displayDiffs(_0x22dc2e,_0x3cce45,_0x2e7d0b,_0x287d20,_0x19c650,_0x135e4e,_0x178d22){const _0x92d652=a4_0x7c7f;for(const _0x353b96 of _0x22dc2e){if(_0x353b96[_0x92d652(0x1ed)]){const _0x4a24a7=_0x353b96['agentName']||_0x353b96[_0x92d652(0x255)];console['log']('\x0aChanges\x20to\x20agent\x20\x27'+_0x4a24a7+'\x27:'),console[_0x92d652(0x1c3)]('─'[_0x92d652(0x233)](0x3c)),console[_0x92d652(0x1c3)](_0x353b96['diff']),console['log']('─'[_0x92d652(0x233)](0x3c));}}for(const _0x57015b of _0x3cce45){_0x57015b[_0x92d652(0x1ed)]&&(console[_0x92d652(0x1c3)](_0x92d652(0x1ac)+_0x57015b[_0x92d652(0x255)]+'\x27:'),console[_0x92d652(0x1c3)]('─'[_0x92d652(0x233)](0x3c)),console[_0x92d652(0x1c3)](_0x57015b['diff']),console[_0x92d652(0x1c3)]('─'[_0x92d652(0x233)](0x3c)));}for(const _0x39d01a of _0x2e7d0b){_0x39d01a['diff']&&(console['log']('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x39d01a['name']+'\x27:'),console[_0x92d652(0x1c3)]('─'[_0x92d652(0x233)](0x3c)),console[_0x92d652(0x1c3)](_0x39d01a[_0x92d652(0x1ed)]),console[_0x92d652(0x1c3)]('─'['repeat'](0x3c)));}for(const _0x5c958b of _0x287d20){_0x5c958b[_0x92d652(0x1ed)]&&(console[_0x92d652(0x1c3)](_0x92d652(0x237)+_0x5c958b[_0x92d652(0x255)]+'\x27:'),console[_0x92d652(0x1c3)]('─'[_0x92d652(0x233)](0x3c)),console[_0x92d652(0x1c3)](_0x5c958b['diff']),console[_0x92d652(0x1c3)]('─'['repeat'](0x3c)));}for(const _0x290015 of _0x19c650){_0x290015[_0x92d652(0x1ed)]&&(console[_0x92d652(0x1c3)](_0x92d652(0x253)+_0x290015['name']+'\x27:'),console[_0x92d652(0x1c3)]('─'[_0x92d652(0x233)](0x3c)),console[_0x92d652(0x1c3)](_0x290015[_0x92d652(0x1ed)]),console['log']('─'['repeat'](0x3c)));}for(const _0x89ec41 of _0x135e4e){_0x89ec41[_0x92d652(0x1ed)]&&(console[_0x92d652(0x1c3)](_0x92d652(0x231)+_0x89ec41[_0x92d652(0x255)]+'\x27:'),console['log']('─'[_0x92d652(0x233)](0x3c)),console[_0x92d652(0x1c3)](_0x89ec41[_0x92d652(0x1ed)]),console[_0x92d652(0x1c3)]('─'[_0x92d652(0x233)](0x3c)));}for(const _0x2c11b1 of _0x178d22){_0x2c11b1[_0x92d652(0x1ed)]&&(console[_0x92d652(0x1c3)](_0x92d652(0x1ae)+_0x2c11b1[_0x92d652(0x255)]+'\x27:'),console[_0x92d652(0x1c3)]('─'[_0x92d652(0x233)](0x3c)),console[_0x92d652(0x1c3)](_0x2c11b1[_0x92d652(0x1ed)]),console[_0x92d652(0x1c3)]('─'[_0x92d652(0x233)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x2b2217(0x255)]=a4_0x2b2217(0x1b2);['description']=a4_0x2b2217(0x256);async[a4_0x2b2217(0x257)](_0x21ec45){const _0xb13774=a4_0x2b2217,{options:_0x31f079,args:_0x444b5e,tdx:_0x3098e8}=_0x21ec45,_0x27ea2d=_0x444b5e[0x0],_0x33922a=_0x444b5e[0x1],_0x409b6a=_0x31f079[_0xb13774(0x247)],_0x1321e3=_0x31f079[_0xb13774(0x1ad)],_0x2ca707=_0x31f079[_0xb13774(0x223)],_0x23a784=_0x31f079['yes'],_0x3dc49f=_0x31f079[_0xb13774(0x24c)],_0x1b49bf=_0x31f079[_0xb13774(0x1f8)];let _0x1e9503;if(_0x27ea2d){const _0x1cd154=a4_0x572045[_0xb13774(0x1b8)](_0x27ea2d,_0xb13774(0x20f));if(existsSync(_0x1cd154))try{const _0x3f6edb=JSON[_0xb13774(0x1dd)](readFileSync(_0x1cd154,'utf-8'));_0x3f6edb[_0xb13774(0x200)]&&(_0x1e9503={'llm_project':_0x3f6edb[_0xb13774(0x200)]});}catch{}}const _0x561a39=findAgentConfigPath(process[_0xb13774(0x243)]());let _0x13c82d;if(_0x561a39)try{const _0x1ac357=JSON[_0xb13774(0x1dd)](readFileSync(_0x561a39,'utf-8'));_0x1ac357[_0xb13774(0x200)]&&(_0x13c82d={'llm_project':_0x1ac357['llm_project']});}catch{}const _0x260e5a=resolveAgentPullArgs({'arg':_0x27ea2d,'agentNameArg':_0x33922a,'agentFlag':_0x1b49bf,'contextProject':_0x3dc49f,'argDirConfig':_0x1e9503,'cwdConfigPath':_0x561a39||undefined,'cwdConfig':_0x13c82d}),{projectNameOrId:_0x2ec0a9,targetAgentName:_0x515f5f,existingOutputDir:_0x1adbee,source:_0x346f23}=_0x260e5a;if(_0x346f23===_0xb13774(0x1c7))console[_0xb13774(0x1c3)](a4_0x135328['dim'](_0xb13774(0x1f2)+a4_0x572045['join'](_0x27ea2d,_0xb13774(0x20f))+':\x20'+_0x2ec0a9));else{if(_0x346f23==='cwd-config')console[_0xb13774(0x1c3)](a4_0x135328[_0xb13774(0x212)](_0xb13774(0x250)+_0x2ec0a9));else _0x346f23===_0xb13774(0x22f)&&console[_0xb13774(0x1c3)](a4_0x135328[_0xb13774(0x212)](_0xb13774(0x220)+_0x2ec0a9));}if(!_0x2ec0a9)return _0x1b49bf?(console[_0xb13774(0x1c3)](a4_0x135328[_0xb13774(0x23a)](_0xb13774(0x209))),console[_0xb13774(0x1c3)](_0xb13774(0x1c1)),console[_0xb13774(0x1c3)]('Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>')):(console[_0xb13774(0x1c3)](a4_0x135328['yellow']('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console['log'](_0xb13774(0x1b0)),console['log'](_0xb13774(0x1e4)),console[_0xb13774(0x1c3)](_0xb13774(0x1c8)),console[_0xb13774(0x1c3)](_0xb13774(0x1e5)),console[_0xb13774(0x1c3)](_0xb13774(0x236))),0x1;if(_0x515f5f){const {data:_0x8f1944}=await withSpinner(_0xb13774(0x20c)+_0x515f5f+_0xb13774(0x252)+_0x2ec0a9+_0xb13774(0x230),()=>_0x3098e8[_0xb13774(0x1c5)][_0xb13774(0x1f1)](_0x2ec0a9,_0x515f5f,_0x409b6a,{'dryRun':_0x1321e3,'force':_0x2ca707}));if(_0x1321e3)return console[_0xb13774(0x1c3)](a4_0x135328[_0xb13774(0x23a)](_0xb13774(0x25c))),console['log'](_0xb13774(0x228)+_0x8f1944[_0xb13774(0x1e8)]),console[_0xb13774(0x1c3)]('Output\x20path:\x20'+_0x8f1944[_0xb13774(0x1e1)]),_0x8f1944[_0xb13774(0x1ed)]&&(console[_0xb13774(0x1c3)]('\x0aChanges:'),console[_0xb13774(0x1c3)]('─'[_0xb13774(0x233)](0x3c)),console[_0xb13774(0x1c3)](_0x8f1944[_0xb13774(0x1ed)]),console[_0xb13774(0x1c3)]('─'[_0xb13774(0x233)](0x3c))),0x0;return console['log'](a4_0x135328[_0xb13774(0x24d)](_0xb13774(0x1cb))),console[_0xb13774(0x1c3)](_0xb13774(0x1dc)+_0x8f1944['agentName']),console[_0xb13774(0x1c3)]('Output:\x20'+_0x8f1944[_0xb13774(0x1e1)]),console[_0xb13774(0x1c3)](_0xb13774(0x226)+(_0x8f1944[_0xb13774(0x22e)]?a4_0x135328[_0xb13774(0x24d)](_0xb13774(0x1c2)):_0x8f1944['hasChanges']?a4_0x135328[_0xb13774(0x23a)](_0xb13774(0x23e)):a4_0x135328[_0xb13774(0x1f3)](_0xb13774(0x222)))),0x0;}const _0x1b6d5d=_0x1adbee||_0x409b6a,{data:_0x3cda7c}=await withSpinner(_0xb13774(0x1e6)+_0x2ec0a9+'\x22...',()=>_0x3098e8[_0xb13774(0x1c5)][_0xb13774(0x1cd)](_0x2ec0a9,_0x1b6d5d,{'dryRun':!![]})),_0x22d72c=_0x3cda7c['counts'][_0xb13774(0x254)]['new']+_0x3cda7c[_0xb13774(0x248)]['knowledgeBases'][_0xb13774(0x1c2)]+_0x3cda7c[_0xb13774(0x248)][_0xb13774(0x24e)][_0xb13774(0x1c2)]+_0x3cda7c[_0xb13774(0x248)][_0xb13774(0x1b7)][_0xb13774(0x1c2)]+_0x3cda7c[_0xb13774(0x248)][_0xb13774(0x1ab)][_0xb13774(0x1c2)]+_0x3cda7c['counts'][_0xb13774(0x216)]['new']+_0x3cda7c['counts'][_0xb13774(0x1b4)]['new'],_0x37aed1=_0x3cda7c[_0xb13774(0x248)][_0xb13774(0x254)][_0xb13774(0x23e)]+_0x3cda7c[_0xb13774(0x248)]['knowledgeBases'][_0xb13774(0x23e)]+_0x3cda7c[_0xb13774(0x248)][_0xb13774(0x24e)]['updated']+_0x3cda7c[_0xb13774(0x248)][_0xb13774(0x1b7)][_0xb13774(0x23e)]+_0x3cda7c['counts'][_0xb13774(0x1ab)][_0xb13774(0x23e)]+_0x3cda7c[_0xb13774(0x248)]['experimentalKnowledgeBases'][_0xb13774(0x23e)]+_0x3cda7c[_0xb13774(0x248)][_0xb13774(0x1b4)]['updated'],_0x2ad53c=_0x3cda7c[_0xb13774(0x248)]['agents'][_0xb13774(0x222)]+_0x3cda7c[_0xb13774(0x248)]['knowledgeBases']['unchanged']+_0x3cda7c['counts'][_0xb13774(0x24e)]['unchanged']+_0x3cda7c['counts'][_0xb13774(0x1b7)]['unchanged']+_0x3cda7c[_0xb13774(0x248)][_0xb13774(0x1ab)][_0xb13774(0x222)]+_0x3cda7c['counts'][_0xb13774(0x216)][_0xb13774(0x222)]+_0x3cda7c[_0xb13774(0x248)][_0xb13774(0x1b4)][_0xb13774(0x222)];console[_0xb13774(0x1c3)]('\x0aPull\x20summary\x20for\x20\x27'+_0x3cda7c['projectName']+'\x27:'),console['log']('\x20\x20'+a4_0x135328[_0xb13774(0x24d)]('+\x20'+_0x22d72c+'\x20new')+_0xb13774(0x1d7)+a4_0x135328['yellow']('~\x20'+_0x37aed1+_0xb13774(0x1e0))+'\x20|\x20'+a4_0x135328[_0xb13774(0x212)]('=\x20'+_0x2ad53c+_0xb13774(0x207))),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x3cda7c['counts'][_0xb13774(0x254)])),console[_0xb13774(0x1c3)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x3cda7c['counts'][_0xb13774(0x251)])),console['log'](_0xb13774(0x1ce)+formatCountSummary(_0x3cda7c[_0xb13774(0x248)][_0xb13774(0x24e)])),console['log']('\x20\x20Prompts:\x20'+formatCountSummary(_0x3cda7c[_0xb13774(0x248)][_0xb13774(0x1b7)])),console[_0xb13774(0x1c3)](_0xb13774(0x214)+formatCountSummary(_0x3cda7c['counts']['integrations']));const _0x45195b=_0x3cda7c[_0xb13774(0x248)][_0xb13774(0x216)][_0xb13774(0x1d8)]>0x0||_0x3cda7c[_0xb13774(0x248)][_0xb13774(0x1b4)][_0xb13774(0x1d8)]>0x0;_0x45195b&&(console[_0xb13774(0x1c3)](_0xb13774(0x1f0)+formatCountSummary(_0x3cda7c[_0xb13774(0x248)][_0xb13774(0x216)])),console['log'](_0xb13774(0x1b3)+formatCountSummary(_0x3cda7c[_0xb13774(0x248)][_0xb13774(0x1b4)])));console[_0xb13774(0x1c3)](_0xb13774(0x208)+a4_0x135328[_0xb13774(0x1ec)](_0x3cda7c['outputDir'])),displayDiffs(_0x3cda7c[_0xb13774(0x254)],_0x3cda7c['knowledgeBases'],_0x3cda7c[_0xb13774(0x24e)],_0x3cda7c[_0xb13774(0x1b7)],_0x3cda7c[_0xb13774(0x1ab)],_0x3cda7c[_0xb13774(0x216)],_0x3cda7c[_0xb13774(0x1b4)]);if(_0x1321e3)return console[_0xb13774(0x1c3)](a4_0x135328[_0xb13774(0x23a)](_0xb13774(0x1eb))),0x0;if(_0x22d72c===0x0&&_0x37aed1===0x0)return console[_0xb13774(0x1c3)](a4_0x135328['green'](_0xb13774(0x239))),saveSessionContext({'llm_project':_0x3cda7c[_0xb13774(0x240)]},_0x31f079[_0xb13774(0x20d)]),console[_0xb13774(0x1c3)](a4_0x135328['green'](_0xb13774(0x21c)+a4_0x135328[_0xb13774(0x212)]('llm_project')+_0xb13774(0x24f)+a4_0x135328[_0xb13774(0x1ec)](_0x3cda7c[_0xb13774(0x240)]))),0x0;if(!_0x23a784&&!_0x2ca707){if(!isInteractive())return console[_0xb13774(0x1e7)](a4_0x135328['red'](_0xb13774(0x1df)),_0xb13774(0x1c0)),console[_0xb13774(0x1e7)](a4_0x135328[_0xb13774(0x212)](_0xb13774(0x221))),0x1;const _0x56a92f=await confirmKey(_0xb13774(0x1ca)+(_0x22d72c+_0x37aed1)+_0xb13774(0x215));if(!_0x56a92f)return console[_0xb13774(0x1c3)](a4_0x135328[_0xb13774(0x23a)](_0xb13774(0x232)),_0xb13774(0x1de)),0x1;}const {data:_0x1349af}=await withSpinner(_0xb13774(0x1bc),()=>_0x3098e8['llm']['pullProject'](_0x2ec0a9,_0x1b6d5d,{'force':_0x2ca707}));return console['log'](a4_0x135328[_0xb13774(0x24d)](_0xb13774(0x1ea)+(_0x22d72c+_0x37aed1)+'\x20files\x20to\x20'+_0x1349af[_0xb13774(0x201)])),saveSessionContext({'llm_project':_0x1349af[_0xb13774(0x240)]},_0x31f079[_0xb13774(0x20d)]),console[_0xb13774(0x1c3)](a4_0x135328[_0xb13774(0x24d)](_0xb13774(0x21c)+a4_0x135328['dim'](_0xb13774(0x200))+_0xb13774(0x24f)+a4_0x135328['cyan'](_0x1349af['projectName']))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x2b2217(0x255)]='agent:clone';[a4_0x2b2217(0x23f)]=a4_0x2b2217(0x1bd);async[a4_0x2b2217(0x257)](_0x39ea83){const _0x57810e=a4_0x2b2217,{options:_0x4f5a0f,args:_0x2a555a,tdx:_0x4e1131}=_0x39ea83,_0x454c54=_0x2a555a[0x0],_0x1eeb8f=_0x4f5a0f[_0x57810e(0x255)],_0x5802=_0x4f5a0f[_0x57810e(0x1ad)],_0x32029c=_0x4f5a0f[_0x57810e(0x205)],_0x2175d7=_0x4f5a0f[_0x57810e(0x1b9)],_0x1df721=_0x4f5a0f[_0x57810e(0x24c)];let _0x187852;const _0x3e6b44=findAgentConfigPath(process[_0x57810e(0x243)]());if(_0x454c54){const _0x4ac4d6=a4_0x572045[_0x57810e(0x1b8)](_0x454c54,_0x57810e(0x20f));existsSync(_0x4ac4d6)?(_0x187852=_0x454c54,console[_0x57810e(0x1c3)](a4_0x135328[_0x57810e(0x212)](_0x57810e(0x1d1)+_0x454c54))):_0x187852=_0x454c54;}else{if(_0x3e6b44)_0x187852=a4_0x572045[_0x57810e(0x1bf)](_0x3e6b44),console[_0x57810e(0x1c3)](a4_0x135328[_0x57810e(0x212)]('Using\x20current\x20project:\x20'+_0x187852));else{if(_0x1df721){const _0x5e545a=sanitizeForFilesystem(_0x1df721);let _0x775d3d=_0x5e545a,_0x4c5cec=a4_0x572045['join'](process[_0x57810e(0x243)](),_0x57810e(0x254),_0x5e545a,_0x57810e(0x20f));if(!existsSync(_0x4c5cec)){const _0x565774=normalizeName(_0x1df721),_0x2f993e=a4_0x572045[_0x57810e(0x1b8)](process[_0x57810e(0x243)](),'agents',_0x565774,'tdx.json');existsSync(_0x2f993e)&&(_0x775d3d=_0x565774,_0x4c5cec=_0x2f993e);}if(existsSync(_0x4c5cec))_0x187852=a4_0x572045['dirname'](_0x4c5cec),console[_0x57810e(0x1c3)](a4_0x135328['dim']('Using\x20local\x20project:\x20'+_0x187852));else{const _0x3849c8=_0x4f5a0f[_0x57810e(0x1bb)];if(_0x3849c8)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x57810e(0x227)+_0x1df721+_0x57810e(0x21d),undefined,{'helpText':'When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a'+_0x57810e(0x217)+(_0x57810e(0x1f9)+_0x1df721+'\x0a')+(_0x57810e(0x1f6)+_0x775d3d+'\x20--name\x20'+(_0x1eeb8f||'<new-name>')+_0x57810e(0x1d4)+_0x3849c8)});_0x187852=_0x1df721,console[_0x57810e(0x1c3)](a4_0x135328[_0x57810e(0x212)]('Using\x20context\x20project:\x20'+_0x1df721));}}}}if(!_0x187852)return console['log'](a4_0x135328[_0x57810e(0x23a)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x57810e(0x1c3)]('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console[_0x57810e(0x1c3)]('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console['log'](_0x57810e(0x245)),console[_0x57810e(0x1c3)](_0x57810e(0x246)),0x1;if(!_0x1eeb8f)throw new SDKError(ErrorCode[_0x57810e(0x225)],'New\x20project\x20name\x20is\x20required',undefined,{'helpText':_0x57810e(0x23c)});if(!_0x32029c&&!_0x5802){if(!isInteractive())return console['error'](a4_0x135328['red'](_0x57810e(0x1df)),_0x57810e(0x1c0)),console[_0x57810e(0x1e7)](a4_0x135328[_0x57810e(0x212)](_0x57810e(0x221))),0x1;const _0x368e29=await confirmKey('Clone\x20\x22'+_0x187852+_0x57810e(0x203)+_0x1eeb8f+'\x22?');if(!_0x368e29)return console['log'](a4_0x135328[_0x57810e(0x23a)](_0x57810e(0x232))),0x1;}const {data:_0x55b6a0}=await withSpinner('Cloning\x20\x22'+_0x187852+_0x57810e(0x1d6)+_0x1eeb8f+_0x57810e(0x230),()=>_0x4e1131['llm'][_0x57810e(0x241)](_0x187852,_0x1eeb8f,{'dryRun':_0x5802}));if(_0x5802){console[_0x57810e(0x1c3)](a4_0x135328['yellow'](_0x57810e(0x1c4))),console[_0x57810e(0x1c3)]('Source:\x20'+_0x55b6a0[_0x57810e(0x25a)]),console[_0x57810e(0x1c3)](_0x57810e(0x21a)+_0x1eeb8f),console[_0x57810e(0x1c3)](_0x57810e(0x206)),console[_0x57810e(0x1c3)](_0x57810e(0x22a)+_0x55b6a0[_0x57810e(0x248)][_0x57810e(0x254)][_0x57810e(0x20e)]),console[_0x57810e(0x1c3)](_0x57810e(0x1e2)+_0x55b6a0[_0x57810e(0x248)][_0x57810e(0x251)][_0x57810e(0x20e)]),console[_0x57810e(0x1c3)](_0x57810e(0x202)+_0x55b6a0[_0x57810e(0x248)]['prompts'][_0x57810e(0x20e)]);const _0x59fc63=_0x55b6a0[_0x57810e(0x248)][_0x57810e(0x216)][_0x57810e(0x20e)]>0x0||_0x55b6a0[_0x57810e(0x248)][_0x57810e(0x1b4)][_0x57810e(0x20e)]>0x0;return _0x59fc63&&(console[_0x57810e(0x1c3)](_0x57810e(0x1f0)+_0x55b6a0[_0x57810e(0x248)][_0x57810e(0x216)]['created']),console['log'](_0x57810e(0x1b3)+_0x55b6a0[_0x57810e(0x248)]['experimentalArtifacts'][_0x57810e(0x20e)])),0x0;}const _0x1808f4=_0x55b6a0[_0x57810e(0x248)][_0x57810e(0x254)][_0x57810e(0x1b5)]>0x0||_0x55b6a0[_0x57810e(0x248)][_0x57810e(0x251)][_0x57810e(0x1b5)]>0x0||_0x55b6a0[_0x57810e(0x248)][_0x57810e(0x1b7)][_0x57810e(0x1b5)]>0x0||_0x55b6a0['counts'][_0x57810e(0x216)][_0x57810e(0x1b5)]>0x0||_0x55b6a0[_0x57810e(0x248)][_0x57810e(0x1b4)][_0x57810e(0x1b5)]>0x0;_0x1808f4?console[_0x57810e(0x1c3)](a4_0x135328[_0x57810e(0x23a)](_0x57810e(0x1f7))):console['log'](a4_0x135328[_0x57810e(0x24d)](_0x57810e(0x1da)));console[_0x57810e(0x1c3)](_0x57810e(0x1cc)+_0x55b6a0[_0x57810e(0x25a)]),console['log'](_0x57810e(0x21a)+_0x55b6a0[_0x57810e(0x229)]),console[_0x57810e(0x1c3)](_0x57810e(0x1fa)+_0x55b6a0[_0x57810e(0x1f4)]),console[_0x57810e(0x1c3)](),console[_0x57810e(0x1c3)]('Summary:'),console[_0x57810e(0x1c3)]('\x20\x20Agents:\x20'+formatCountSummary(_0x55b6a0[_0x57810e(0x248)][_0x57810e(0x254)])),console['log']('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x55b6a0['counts'][_0x57810e(0x251)])),console[_0x57810e(0x1c3)](_0x57810e(0x202)+formatCountSummary(_0x55b6a0[_0x57810e(0x248)][_0x57810e(0x1b7)])),console[_0x57810e(0x1c3)](_0x57810e(0x214)+formatCountSummary(_0x55b6a0[_0x57810e(0x248)]['integrations']));const _0x3d63af=_0x55b6a0[_0x57810e(0x248)][_0x57810e(0x216)]['created']>0x0||_0x55b6a0[_0x57810e(0x248)][_0x57810e(0x216)][_0x57810e(0x23e)]>0x0||_0x55b6a0['counts'][_0x57810e(0x216)][_0x57810e(0x222)]>0x0||_0x55b6a0[_0x57810e(0x248)][_0x57810e(0x1b4)][_0x57810e(0x20e)]>0x0||_0x55b6a0[_0x57810e(0x248)]['experimentalArtifacts']['updated']>0x0||_0x55b6a0['counts'][_0x57810e(0x1b4)]['unchanged']>0x0;_0x3d63af&&(console['log'](_0x57810e(0x1f0)+formatCountSummary(_0x55b6a0[_0x57810e(0x248)]['experimentalKnowledgeBases'])),console[_0x57810e(0x1c3)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x55b6a0[_0x57810e(0x248)][_0x57810e(0x1b4)])));if(_0x1808f4){console['log'](),console[_0x57810e(0x1c3)](a4_0x135328[_0x57810e(0x21f)]('Errors:'));for(const _0x59525f of _0x55b6a0[_0x57810e(0x254)]){_0x59525f[_0x57810e(0x249)]===_0x57810e(0x1e7)&&console[_0x57810e(0x1c3)](a4_0x135328[_0x57810e(0x21f)](_0x57810e(0x1fc)+_0x59525f['agentName']+_0x57810e(0x24a)+_0x59525f[_0x57810e(0x1e7)]));}for(const _0x5663f0 of _0x55b6a0[_0x57810e(0x251)]){_0x5663f0[_0x57810e(0x249)]===_0x57810e(0x1e7)&&console[_0x57810e(0x1c3)](a4_0x135328[_0x57810e(0x21f)](_0x57810e(0x259)+_0x5663f0[_0x57810e(0x255)]+'\x22:\x20'+_0x5663f0['error']));}for(const _0x493907 of _0x55b6a0[_0x57810e(0x1b7)]){_0x493907[_0x57810e(0x249)]===_0x57810e(0x1e7)&&console['log'](a4_0x135328['red'](_0x57810e(0x1fe)+_0x493907['name']+'\x22:\x20'+_0x493907['error']));}for(const _0x440e32 of _0x55b6a0[_0x57810e(0x1ab)]){_0x440e32[_0x57810e(0x249)]==='error'&&console[_0x57810e(0x1c3)](a4_0x135328[_0x57810e(0x21f)](_0x57810e(0x242)+_0x440e32[_0x57810e(0x255)]+'\x22:\x20'+_0x440e32[_0x57810e(0x1e7)]));}for(const _0x1674d8 of _0x55b6a0[_0x57810e(0x216)]){_0x1674d8[_0x57810e(0x249)]==='error'&&console[_0x57810e(0x1c3)](a4_0x135328[_0x57810e(0x21f)](_0x57810e(0x22b)+_0x1674d8[_0x57810e(0x255)]+_0x57810e(0x24a)+_0x1674d8[_0x57810e(0x1e7)]));}for(const _0x2e220e of _0x55b6a0[_0x57810e(0x1b4)]){_0x2e220e[_0x57810e(0x249)]===_0x57810e(0x1e7)&&console['log'](a4_0x135328[_0x57810e(0x21f)](_0x57810e(0x224)+_0x2e220e['name']+_0x57810e(0x24a)+_0x2e220e[_0x57810e(0x1e7)]));}return 0x1;}console[_0x57810e(0x1c3)]();const _0x1e1156=getLLMProjectUrl(_0x2175d7,_0x55b6a0[_0x57810e(0x1f4)]);return console[_0x57810e(0x1c3)](_0x57810e(0x1cf)+a4_0x135328[_0x57810e(0x1ec)](_0x1e1156)),0x0;}}export class AgentPushCommand extends BaseCommand{['name']='agent:push';[a4_0x2b2217(0x23f)]='Push\x20local\x20agent\x20files\x20to\x20LLM\x20project';async[a4_0x2b2217(0x257)](_0x2b1dae){const _0x148115=a4_0x2b2217,{options:_0x4981de,args:_0x5c772d,tdx:_0x48402e}=_0x2b1dae;let _0x295122=_0x5c772d[0x0]||process[_0x148115(0x243)]();const _0x3509a5=_0x4981de[_0x148115(0x1ad)],_0x25157e=_0x4981de[_0x148115(0x223)],_0x352065=_0x4981de[_0x148115(0x205)],_0x5eeda4=_0x4981de[_0x148115(0x1b9)],_0x27be8b=a4_0x572045[_0x148115(0x1b8)](_0x295122,_0x148115(0x244)),_0x52749b=existsSync(_0x27be8b);if(_0x52749b){const {data:_0x4354ae}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x295122+_0x148115(0x230),()=>_0x48402e[_0x148115(0x1c5)][_0x148115(0x1d0)](_0x295122,{'dryRun':_0x3509a5,'force':_0x25157e}));if(_0x3509a5)return console[_0x148115(0x1c3)](a4_0x135328[_0x148115(0x23a)](_0x148115(0x1c4))),console['log'](_0x148115(0x1d2)+_0x4354ae[_0x148115(0x1e8)]),0x0;if(_0x4354ae['action']===_0x148115(0x1e7))return console[_0x148115(0x1c3)](a4_0x135328[_0x148115(0x21f)](_0x148115(0x1b6)+_0x4354ae[_0x148115(0x1e7)])),0x1;console[_0x148115(0x1c3)](a4_0x135328[_0x148115(0x24d)](_0x148115(0x258)+_0x4354ae[_0x148115(0x249)]+_0x148115(0x218))),console[_0x148115(0x1c3)](_0x148115(0x1dc)+_0x4354ae[_0x148115(0x1e8)]);if(_0x4354ae[_0x148115(0x1db)]&&_0x4354ae[_0x148115(0x25b)]){const _0x57ba4f=getLLMAgentChatUrl(_0x5eeda4,_0x4354ae['projectId'],_0x4354ae[_0x148115(0x1db)]);console[_0x148115(0x1c3)]('Chat:\x20'+a4_0x135328[_0x148115(0x1ec)](_0x57ba4f));}return 0x0;}const _0x1b8a89=_0x4981de[_0x148115(0x24c)],_0x5cc6df=resolveProjectFromContext(_0x295122,_0x1b8a89);if(_0x5cc6df['found'])_0x295122=_0x5cc6df[_0x148115(0x210)],_0x5cc6df[_0x148115(0x21e)]===_0x148115(0x22f)&&console[_0x148115(0x1c3)](a4_0x135328[_0x148115(0x212)](_0x148115(0x250)+_0x295122));else{let _0x525879=_0x148115(0x1d9);_0x5cc6df[_0x148115(0x213)]===_0x148115(0x235)&&(_0x525879=_0x5cc6df[_0x148115(0x20b)]+_0x148115(0x1ee)+_0x5cc6df[_0x148115(0x24c)]+_0x148115(0x1e3));throw new SDKError(ErrorCode[_0x148115(0x1fb)],_0x5cc6df['reason']===_0x148115(0x20a)?_0x5cc6df[_0x148115(0x20b)]:_0x148115(0x1ff)+_0x295122,undefined,{'helpText':_0x525879});}const {data:_0x2cd609}=await withSpinner(_0x148115(0x211),()=>_0x48402e[_0x148115(0x1c5)]['pushProject'](_0x295122,{'dryRun':!![]})),_0x7e409d=_0x2cd609[_0x148115(0x248)][_0x148115(0x254)][_0x148115(0x1b5)]>0x0;if(_0x7e409d){console[_0x148115(0x1c3)](a4_0x135328[_0x148115(0x21f)](_0x148115(0x1d5)));for(const _0x3f4be4 of _0x2cd609['agents']){_0x3f4be4['action']===_0x148115(0x1e7)&&console['log'](a4_0x135328[_0x148115(0x21f)](_0x148115(0x1fc)+_0x3f4be4[_0x148115(0x1e8)]+_0x148115(0x24a)+_0x3f4be4[_0x148115(0x1e7)]));}return 0x1;}const _0x2eaa66=_0x2cd609[_0x148115(0x248)][_0x148115(0x254)][_0x148115(0x20e)]+_0x2cd609[_0x148115(0x248)][_0x148115(0x251)][_0x148115(0x20e)]+_0x2cd609[_0x148115(0x248)][_0x148115(0x24e)][_0x148115(0x20e)]+_0x2cd609[_0x148115(0x248)]['prompts'][_0x148115(0x20e)]+_0x2cd609['counts']['integrations'][_0x148115(0x20e)]+_0x2cd609[_0x148115(0x248)][_0x148115(0x216)][_0x148115(0x20e)]+_0x2cd609[_0x148115(0x248)]['experimentalArtifacts'][_0x148115(0x20e)],_0x149074=_0x2cd609[_0x148115(0x248)][_0x148115(0x254)][_0x148115(0x23e)]+_0x2cd609[_0x148115(0x248)][_0x148115(0x251)][_0x148115(0x23e)]+_0x2cd609['counts'][_0x148115(0x24e)][_0x148115(0x23e)]+_0x2cd609[_0x148115(0x248)][_0x148115(0x1b7)][_0x148115(0x23e)]+_0x2cd609['counts'][_0x148115(0x1ab)]['updated']+_0x2cd609[_0x148115(0x248)]['experimentalKnowledgeBases'][_0x148115(0x23e)]+_0x2cd609[_0x148115(0x248)][_0x148115(0x1b4)][_0x148115(0x23e)],_0x42af4d=_0x2cd609[_0x148115(0x248)][_0x148115(0x254)]['unchanged']+_0x2cd609[_0x148115(0x248)][_0x148115(0x251)][_0x148115(0x222)]+_0x2cd609[_0x148115(0x248)][_0x148115(0x24e)]['unchanged']+_0x2cd609['counts'][_0x148115(0x1b7)][_0x148115(0x222)]+_0x2cd609[_0x148115(0x248)][_0x148115(0x1ab)][_0x148115(0x222)]+_0x2cd609[_0x148115(0x248)][_0x148115(0x216)][_0x148115(0x222)]+_0x2cd609['counts'][_0x148115(0x1b4)]['unchanged'];console['log']('\x0aPush\x20summary\x20for\x20\x27'+_0x2cd609[_0x148115(0x240)]+'\x27:'),console[_0x148115(0x1c3)]('\x20\x20'+a4_0x135328[_0x148115(0x24d)]('+\x20'+_0x2eaa66+_0x148115(0x23b))+_0x148115(0x1d7)+a4_0x135328[_0x148115(0x23a)]('~\x20'+_0x149074+_0x148115(0x1e0))+'\x20|\x20'+a4_0x135328[_0x148115(0x212)]('=\x20'+_0x42af4d+_0x148115(0x207))),console[_0x148115(0x1c3)](_0x148115(0x22a)+formatCountSummary(_0x2cd609[_0x148115(0x248)]['agents'])),console[_0x148115(0x1c3)](_0x148115(0x1e2)+formatCountSummary(_0x2cd609[_0x148115(0x248)][_0x148115(0x251)])),console[_0x148115(0x1c3)](_0x148115(0x1ce)+formatCountSummary(_0x2cd609[_0x148115(0x248)][_0x148115(0x24e)])),console[_0x148115(0x1c3)](_0x148115(0x202)+formatCountSummary(_0x2cd609['counts'][_0x148115(0x1b7)])),console[_0x148115(0x1c3)](_0x148115(0x214)+formatCountSummary(_0x2cd609[_0x148115(0x248)][_0x148115(0x1ab)]));const _0xf513a4=_0x2cd609[_0x148115(0x248)][_0x148115(0x216)][_0x148115(0x20e)]>0x0||_0x2cd609[_0x148115(0x248)][_0x148115(0x216)][_0x148115(0x23e)]>0x0||_0x2cd609[_0x148115(0x248)][_0x148115(0x216)][_0x148115(0x222)]>0x0||_0x2cd609[_0x148115(0x248)][_0x148115(0x1b4)][_0x148115(0x20e)]>0x0||_0x2cd609[_0x148115(0x248)][_0x148115(0x1b4)][_0x148115(0x23e)]>0x0||_0x2cd609['counts'][_0x148115(0x1b4)]['unchanged']>0x0;_0xf513a4&&(console[_0x148115(0x1c3)](_0x148115(0x1f0)+formatCountSummary(_0x2cd609['counts'][_0x148115(0x216)])),console[_0x148115(0x1c3)](_0x148115(0x1b3)+formatCountSummary(_0x2cd609[_0x148115(0x248)][_0x148115(0x1b4)])));console[_0x148115(0x1c3)](_0x148115(0x1ba)+a4_0x135328['cyan'](_0x295122)),displayDiffs(_0x2cd609[_0x148115(0x254)],_0x2cd609[_0x148115(0x251)],_0x2cd609[_0x148115(0x24e)],_0x2cd609[_0x148115(0x1b7)],_0x2cd609[_0x148115(0x1ab)],_0x2cd609[_0x148115(0x216)],_0x2cd609[_0x148115(0x1b4)]);if(_0x3509a5)return console[_0x148115(0x1c3)](a4_0x135328[_0x148115(0x23a)](_0x148115(0x23d))),0x0;if(_0x2eaa66===0x0&&_0x149074===0x0){console[_0x148115(0x1c3)](a4_0x135328[_0x148115(0x24d)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x1a154a=getLLMProjectUrl(_0x5eeda4,_0x2cd609[_0x148115(0x25b)]);return console[_0x148115(0x1c3)](_0x148115(0x1cf)+a4_0x135328[_0x148115(0x1ec)](_0x1a154a)),0x0;}if(!_0x352065&&!_0x25157e){if(!isInteractive())return console[_0x148115(0x1e7)](a4_0x135328['red']('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x148115(0x1e7)](a4_0x135328[_0x148115(0x212)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x1d9a10=await confirmKey(_0x148115(0x238)+(_0x2eaa66+_0x149074)+'\x20resources?');if(!_0x1d9a10)return console['log'](a4_0x135328[_0x148115(0x23a)](_0x148115(0x232)),'-\x20nothing\x20pushed'),0x1;}const {data:_0x5e0a4c}=await withSpinner('Pushing\x20to\x20project...',()=>_0x48402e[_0x148115(0x1c5)][_0x148115(0x1af)](_0x295122,{'force':_0x25157e})),_0x2cc7b4=_0x5e0a4c['counts'][_0x148115(0x254)][_0x148115(0x1b5)]>0x0||_0x5e0a4c['counts'][_0x148115(0x251)]['errors']>0x0||_0x5e0a4c[_0x148115(0x248)][_0x148115(0x24e)][_0x148115(0x1b5)]>0x0||_0x5e0a4c[_0x148115(0x248)][_0x148115(0x1b7)][_0x148115(0x1b5)]>0x0;if(_0x2cc7b4){console[_0x148115(0x1c3)](a4_0x135328['yellow'](_0x148115(0x1c9))),console[_0x148115(0x1c3)](),console[_0x148115(0x1c3)](a4_0x135328['red'](_0x148115(0x1ef)));for(const _0x120513 of _0x5e0a4c['agents']){_0x120513['action']===_0x148115(0x1e7)&&console['log'](a4_0x135328[_0x148115(0x21f)]('\x20\x20Agent\x20\x22'+_0x120513[_0x148115(0x1e8)]+_0x148115(0x24a)+_0x120513['error']));}for(const _0x1add04 of _0x5e0a4c[_0x148115(0x251)]){_0x1add04[_0x148115(0x249)]==='error'&&console[_0x148115(0x1c3)](a4_0x135328[_0x148115(0x21f)](_0x148115(0x259)+_0x1add04['name']+'\x22:\x20'+_0x1add04['error']));}for(const _0x41c9d0 of _0x5e0a4c[_0x148115(0x24e)]){_0x41c9d0['action']===_0x148115(0x1e7)&&console['log'](a4_0x135328[_0x148115(0x21f)]('\x20\x20Text\x20Knowledge\x20Base\x20\x22'+_0x41c9d0[_0x148115(0x255)]+_0x148115(0x24a)+_0x41c9d0[_0x148115(0x1e7)]));}for(const _0x348285 of _0x5e0a4c[_0x148115(0x1b7)]){_0x348285['action']===_0x148115(0x1e7)&&console[_0x148115(0x1c3)](a4_0x135328[_0x148115(0x21f)](_0x148115(0x1fe)+_0x348285[_0x148115(0x255)]+_0x148115(0x24a)+_0x348285['error']));}for(const _0x45ea5a of _0x5e0a4c[_0x148115(0x1ab)]){_0x45ea5a[_0x148115(0x249)]===_0x148115(0x1e7)&&console['log'](a4_0x135328['red'](_0x148115(0x242)+_0x45ea5a[_0x148115(0x255)]+_0x148115(0x24a)+_0x45ea5a[_0x148115(0x1e7)]));}return 0x1;}console[_0x148115(0x1c3)](a4_0x135328[_0x148115(0x24d)]('\x0a✔\x20Pushed\x20'+(_0x2eaa66+_0x149074)+_0x148115(0x22d)+_0x5e0a4c[_0x148115(0x240)]+'\x27'));const _0x21c880=getLLMProjectUrl(_0x5eeda4,_0x5e0a4c[_0x148115(0x25b)]);return console[_0x148115(0x1c3)](_0x148115(0x1cf)+a4_0x135328[_0x148115(0x1ec)](_0x21c880)),0x0;}}function a4_0xbec1(){const _0xa47598=['action','\x22:\x20','606188AwnrzP','llmProject','green','textKnowledgeBases','\x20=\x20','Using\x20project:\x20','knowledgeBases','\x22\x20from\x20project\x20\x22','\x0aChanges\x20to\x20integration\x20\x27','agents','name','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','execute','Agent\x20','\x20\x20Knowledge\x20Base\x20\x22','sourceProjectName','projectId','Dry\x20run\x20-\x20no\x20files\x20written','integrations','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','dryRun','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','pushProject','Usage:\x20tdx\x20agent\x20pull\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#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','109808rVWehw','agent:pull','\x20\x20Experimental\x20Artifacts:\x20','experimentalArtifacts','errors','Failed\x20to\x20push\x20agent:\x20','prompts','join','site','\x20\x20Source:\x20','profile','Writing\x20files...','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x20total','dirname','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','new','log','Dry\x20run\x20-\x20no\x20changes\x20made','llm','8112461rIcIeP','arg-dir','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','\x0aProject\x20pushed\x20with\x20errors','\x0aWrite\x20','Agent\x20pulled\x20successfully','Source:\x20','pullProject','\x20\x20Text\x20Knowledge\x20Bases:\x20','Project:\x20','pushAgent','Using\x20local\x20project:\x20','Would\x20push\x20agent:\x20','push','\x20--profile\x20','\x0aErrors\x20found:','\x22\x20to\x20\x22','\x20|\x20','total','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','Project\x20cloned\x20successfully','agentId','Agent:\x20','parse','-\x20no\x20files\x20written','\x0aError:','\x20changed','outputPath','\x20\x20Knowledge\x20Bases:\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project','Analyzing\x20project\x20\x22','error','agentName','4edzNpw','\x0a✔\x20Pulled\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','cyan','diff','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','Errors:','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','pullAgent','Using\x20project\x20from\x20','gray','newProjectId','179802CkNits','\x20\x20tdx\x20agent\x20clone\x20agents/','Project\x20cloned\x20with\x20errors','agent','\x20\x20tdx\x20agent\x20pull\x20','New\x20project\x20ID:\x20','INVALID_ARGUMENT','\x20\x20Agent\x20\x22','571650vhGPhH','\x20\x20Prompt\x20\x22','No\x20tdx.json\x20found\x20in\x20','llm_project','outputDir','\x20\x20Prompts:\x20','\x22\x20to\x20new\x20project\x20\x22','6NkaHGk','yes','Would\x20clone:','\x20unchanged','\x20\x20Target:\x20','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','no_context','message','Pulling\x20agent\x20\x22','session','created','tdx.json','projectDir','Analyzing\x20changes\x20to\x20push...','dim','reason','\x20\x20Integrations:\x20','\x20files?','experimentalKnowledgeBases','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x20successfully','45062700Cpofrp','New\x20project:\x20','621umAgSg','✔\x20Context\x20set:\x20','\x22\x20to\x20a\x20different\x20profile','source','red','Using\x20project\x20from\x20context:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','unchanged','force','\x20\x20Experimental\x20Artifact\x20\x22','MISSING_ARGUMENT','Status:\x20','Cannot\x20clone\x20from\x20context\x20project\x20\x22','Would\x20pull\x20agent:\x20','newProjectName','\x20\x20Agents:\x20','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','6475870jDzDxi','\x20resources\x20to\x20\x27','isNew','context','\x22...','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','Cancelled','repeat','\x20created','no_local_folder','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project','\x0aChanges\x20to\x20prompt\x20\x27','\x0aPush\x20','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','yellow','\x20new','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','updated','description','projectName','cloneProject','\x20\x20Integration\x20\x22','cwd','agent.yml','\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)','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','output','counts'];a4_0xbec1=function(){return _0xa47598;};return a4_0xbec1();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a5_0x19f7(){const _0x56d9af=['Re-evaluating\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','substring','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','tags','output','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','dryRun','reeval','log','table','join','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','\x20\x20-\x20','find','Re-evaluating...','map','FAIL','387aqsjLm','llm','\x27\x20to\x20create\x20the\x20folder\x20structure.','Duration:\x20','404','344daqqSj','jsonl','Round\x201/','164299jPYDen','basename','white','filter','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','executeReeval','toLowerCase','Cached\x20run\x20is\x20from\x20site\x20\x22','\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','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','No\x20tests\x20found\x20with\x20tags:\x20','yellow','verbose','message','agentDirs','llmProject','no_local_folder','Run\x20\x27tdx\x20agent\x20pull\x20','No\x20tests\x20found\x20matching:\x20','Test\x20','push','\x20\x20Agent:\x20','rounds','not\x20found','repeat','Output\x20written\x20to:\x20','reason','Cached\x20run\x20from:\x20','\x20\x20Evaluating...\x20','isSpinning','⚠\x20SKIPPED:\x20','size','Using\x20agent:\x20','Passed:\x20\x20\x20','length','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','context','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','eval','description','Available\x20tags:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','add','tsv','Re-evaluation\x20Summary','site','no_tests','Round\x20','cyan','resolve','testYmlPath','Agent:\x20','projectName','no_context','1380010kruwQT','42oQfbnn','\x20(new)','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','includes','1929180JwZrjp','\x20\x20Round\x20','start','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','text','round','Failed:\x20\x20\x20','forEach','conversations','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','Site:\x20','red',':\x20Sending\x20user\x20input...','some','now','json','source','has','\x20-\x20','Either\x20switch\x20to\x20the\x20\x22','\x20\x20Conversation:\x20','PASS','name','...\x20','green','✗\x20FAIL:\x20','10105HpsmnA','32753RbFaBb','\x20\x20Project:\x20','dim','\x20(cached)','agentName','projectDir','114KrWxAc','trim','\x22:\x20','37486vaqwRf','stop','agent','...','Project\x20path:\x20','timestamp','Errors:\x20\x20\x20','\x22,\x20but\x20current\x20site\x20is\x20\x22','execute','Usage:','30120icvUIc','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','conversation_url','Test\x20Configuration:','ERROR','✓\x20PASS:\x20','Evaluating\x20response...','Available\x20tests:\x20','Running\x20test:\x20','writeFileSync','No\x20tests\x20have\x20tags\x20defined.','✗\x20ERROR:\x20','\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)','agent:test','Executing\x20new\x20tests...','Error\x20writing\x20output\x20file:\x20','Test\x20Summary','New\x20tests\x20to\x20execute:\x20','Total:\x20\x20\x20\x20','found','✗\x20ERROR:\x20Project\x20not\x20found:\x20','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','tests','status','toISOString','✗\x20ERROR:\x20Agent\x20not\x20found:\x20'];a5_0x19f7=function(){return _0x56d9af;};return a5_0x19f7();}const a5_0xa60653=a5_0x5a2b;(function(_0x436f16,_0x20da0d){const _0x4439da=a5_0x5a2b,_0x3ebfef=_0x436f16();while(!![]){try{const _0x3b7f84=-parseInt(_0x4439da(0xd4))/0x1+parseInt(_0x4439da(0x96))/0x2*(parseInt(_0x4439da(0x10b))/0x3)+-parseInt(_0x4439da(0xd1))/0x4*(-parseInt(_0x4439da(0x8c))/0x5)+-parseInt(_0x4439da(0x93))/0x6*(-parseInt(_0x4439da(0x8d))/0x7)+-parseInt(_0x4439da(0xa0))/0x8*(parseInt(_0x4439da(0xcc))/0x9)+parseInt(_0x4439da(0x10a))/0xa+-parseInt(_0x4439da(0x10f))/0xb;if(_0x3b7f84===_0x20da0d)break;else _0x3ebfef['push'](_0x3ebfef['shift']());}catch(_0x189382){_0x3ebfef['push'](_0x3ebfef['shift']());}}}(a5_0x19f7,0x27700));import*as a5_0x35afb0 from'node:fs';import*as a5_0x46fc01 from'node:path';import a5_0xdc0274 from'chalk';function a5_0x5a2b(_0x2a3d3b,_0x556ea7){_0x2a3d3b=_0x2a3d3b-0x7b;const _0x19f724=a5_0x19f7();let _0x5a2b01=_0x19f724[_0x2a3d3b];return _0x5a2b01;}import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{['name']=a5_0xa60653(0xad);[a5_0xa60653(0xfb)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0xa60653(0x9e)](_0x40484a){const _0x2396e4=a5_0xa60653,{options:_0x5ad9f8,args:_0x57c72d,tdx:_0x5a4514}=_0x40484a,_0xebda57=_0x57c72d[0x0]||'.',_0x1314c0=_0x5ad9f8[_0x2396e4(0xc1)],_0x43e520=_0x5ad9f8,_0x5f46aa=_0x43e520[_0x2396e4(0xfa)]===![],_0x2566d5=_0x43e520[_0x2396e4(0xc2)],_0x324f87=_0x43e520[_0x2396e4(0x88)],_0x22fe20=_0x43e520[_0x2396e4(0xbe)],_0x556b3e=_0x5ad9f8[_0x2396e4(0x101)],_0x564118=_0x43e520[_0x2396e4(0xbf)];if(_0x2566d5&&_0x5f46aa)return console[_0x2396e4(0xc3)](a5_0xdc0274[_0x2396e4(0x7d)](_0x2396e4(0x112))),0x1;let _0x205c23=_0x2396e4(0xc4);if(_0x43e520[_0x2396e4(0x81)])_0x205c23=_0x2396e4(0x81);else{if(_0x43e520[_0x2396e4(0xd2)])_0x205c23=_0x2396e4(0xd2);else{if(_0x43e520[_0x2396e4(0xff)])_0x205c23=_0x2396e4(0xff);else{if(_0x43e520[_0x2396e4(0xc4)])_0x205c23=_0x2396e4(0xc4);}}}const _0x1f42a3=_0x43e520[_0x2396e4(0xe3)];let _0x48f75a=_0xebda57;const _0x17d191=a5_0x35afb0['existsSync'](_0xebda57),_0x20e5f0=_0xebda57==='.';if(!_0x17d191||_0x20e5f0){const _0x432388=resolveProjectFromContext(_0xebda57,_0x1f42a3,{'requireFile':'test.yml'});if(_0x432388[_0x2396e4(0xb3)])_0x48f75a=_0x432388[_0x2396e4(0x92)],_0x432388[_0x2396e4(0x82)]===_0x2396e4(0xf8)&&console[_0x2396e4(0xc3)](a5_0xdc0274[_0x2396e4(0x8f)](_0x2396e4(0xf4)+_0x48f75a));else switch(_0x432388['reason']){case _0x2396e4(0x109):console[_0x2396e4(0xc3)](a5_0xdc0274['yellow'](_0x432388[_0x2396e4(0xe1)])),console[_0x2396e4(0xc3)](),console[_0x2396e4(0xc3)](_0x2396e4(0x9f)),console[_0x2396e4(0xc3)](_0x2396e4(0xdc)),console[_0x2396e4(0xc3)](_0x2396e4(0xac)),console[_0x2396e4(0xc3)](),console[_0x2396e4(0xc3)](_0x2396e4(0xa1));return 0x1;case _0x2396e4(0xe4):console[_0x2396e4(0xc3)](a5_0xdc0274[_0x2396e4(0xdf)](_0x432388['message'])),console[_0x2396e4(0xc3)](),console[_0x2396e4(0xc3)](_0x2396e4(0xe5)+_0x432388[_0x2396e4(0xe3)]+_0x2396e4(0xce));return 0x1;case'multiple_agents':{const _0x4ac9a0=a5_0x46fc01[_0x2396e4(0xd5)](_0x432388[_0x2396e4(0x92)]);console[_0x2396e4(0xc3)](a5_0xdc0274['yellow'](_0x2396e4(0xb5)+_0x432388[_0x2396e4(0xe3)]+'\x22:'));for(const _0x2e1886 of _0x432388[_0x2396e4(0xe2)]){console[_0x2396e4(0xc3)](_0x2396e4(0xc7)+_0x2e1886);}return console[_0x2396e4(0xc3)](),console[_0x2396e4(0xc3)](_0x2396e4(0xdd)+_0x4ac9a0+'/<agent-name>'),0x1;}case _0x2396e4(0x102):console[_0x2396e4(0xc3)](a5_0xdc0274['yellow'](_0x2396e4(0xf7)+_0x432388[_0x2396e4(0xe3)]+'\x22.')),console[_0x2396e4(0xc3)](a5_0xdc0274['dim'](_0x2396e4(0x9a)+_0x432388['projectDir'])),console[_0x2396e4(0xc3)](),console[_0x2396e4(0xc3)](_0x2396e4(0x7b));return 0x1;}}const {definition:_0x1e36f6,agentInfo:_0x635603}=parseTestFile(_0x48f75a);let _0x1ba8b7=_0x1e36f6[_0x2396e4(0xb6)];if(_0x324f87){const _0xbb240b=_0x324f87['split'](',')[_0x2396e4(0xca)](_0x205a9b=>_0x205a9b[_0x2396e4(0x94)]());_0x1ba8b7=_0x1e36f6[_0x2396e4(0xb6)]['filter'](_0x2f36d2=>_0xbb240b[_0x2396e4(0x10e)](_0x2f36d2['name']));if(_0x1ba8b7[_0x2396e4(0xf6)]===0x0)return console[_0x2396e4(0xc3)](a5_0xdc0274[_0x2396e4(0xdf)](_0x2396e4(0xe6)+_0x324f87)),console['log'](a5_0xdc0274[_0x2396e4(0x8f)](_0x2396e4(0xa7)+_0x1e36f6[_0x2396e4(0xb6)][_0x2396e4(0xca)](_0x21f330=>_0x21f330[_0x2396e4(0x88)])['join'](',\x20'))),0x1;}if(_0x22fe20){const _0x3570aa=_0x22fe20['split'](',')[_0x2396e4(0xca)](_0x57de94=>_0x57de94['trim']()[_0x2396e4(0xda)]());_0x1ba8b7=_0x1ba8b7[_0x2396e4(0xd7)](_0x5db7a3=>_0x5db7a3[_0x2396e4(0xbe)]?.[_0x2396e4(0x7f)](_0x10df41=>_0x3570aa['includes'](_0x10df41[_0x2396e4(0xda)]())));if(_0x1ba8b7[_0x2396e4(0xf6)]===0x0){console['log'](a5_0xdc0274[_0x2396e4(0xdf)](_0x2396e4(0xde)+_0x22fe20));const _0x1308dd=new Set();return _0x1e36f6['tests'][_0x2396e4(0x116)](_0x138d4e=>_0x138d4e['tags']?.['forEach'](_0x4bef0c=>_0x1308dd[_0x2396e4(0xfe)](_0x4bef0c))),_0x1308dd[_0x2396e4(0xf3)]>0x0?console[_0x2396e4(0xc3)](a5_0xdc0274['dim'](_0x2396e4(0xfc)+[..._0x1308dd][_0x2396e4(0xc5)](',\x20'))):console[_0x2396e4(0xc3)](a5_0xdc0274[_0x2396e4(0x8f)](_0x2396e4(0xaa))),0x1;}}if(_0x2566d5)return this['executeReeval'](_0x40484a,{'definition':{'tests':_0x1ba8b7},'agentInfo':_0x635603,'outputFormat':_0x205c23,'outputFile':_0x564118,'testNames':_0x324f87});if(_0x1314c0){console[_0x2396e4(0xc3)](a5_0xdc0274[_0x2396e4(0x104)](_0x2396e4(0xa3))),console[_0x2396e4(0xc3)]('\x20\x20Site:\x20'+a5_0xdc0274[_0x2396e4(0xd6)](_0x556b3e)),console[_0x2396e4(0xc3)](_0x2396e4(0x8e)+a5_0xdc0274[_0x2396e4(0xd6)](_0x635603[_0x2396e4(0x108)])),console[_0x2396e4(0xc3)](_0x2396e4(0xe9)+a5_0xdc0274[_0x2396e4(0xd6)](_0x635603[_0x2396e4(0x91)])),console['log'](),console['log']('Tests\x20found:\x20'+a5_0xdc0274[_0x2396e4(0xd6)](_0x1ba8b7[_0x2396e4(0xf6)]));for(let _0x38211c=0x0;_0x38211c<_0x1ba8b7[_0x2396e4(0xf6)];_0x38211c++){const _0x42ae24=_0x1ba8b7[_0x38211c],_0x1ddf8c=_0x42ae24[_0x2396e4(0xea)][_0x2396e4(0xf6)]===0x1?_0x2396e4(0x114):_0x2396e4(0xea),_0xf5e382=_0x42ae24[_0x2396e4(0xbe)]?.[_0x2396e4(0xf6)]?'\x20['+_0x42ae24[_0x2396e4(0xbe)][_0x2396e4(0xc5)](',\x20')+']':'';console[_0x2396e4(0xc3)]('\x20\x20'+(_0x38211c+0x1)+'.\x20'+a5_0xdc0274['white'](_0x42ae24[_0x2396e4(0x88)])+'\x20('+_0x42ae24[_0x2396e4(0xea)][_0x2396e4(0xf6)]+'\x20'+_0x1ddf8c+')'+a5_0xdc0274[_0x2396e4(0x8f)](_0xf5e382));}return 0x0;}let _0x1cf430,_0x22440f;try{_0x1cf430=await _0x5a4514[_0x2396e4(0xcd)]['resolveProjectId'](_0x635603[_0x2396e4(0x108)]);}catch(_0x5f3257){const _0x3bdf1f=_0x5f3257 instanceof Error?_0x5f3257[_0x2396e4(0xe1)]:String(_0x5f3257);return _0x3bdf1f[_0x2396e4(0x10e)](_0x2396e4(0xd0))||_0x3bdf1f['toLowerCase']()[_0x2396e4(0x10e)](_0x2396e4(0xeb))?console[_0x2396e4(0xc3)](a5_0xdc0274[_0x2396e4(0x7d)](_0x2396e4(0xb4)+_0x635603[_0x2396e4(0x108)])):console[_0x2396e4(0xc3)](a5_0xdc0274[_0x2396e4(0x7d)](_0x2396e4(0xfd)+_0x635603[_0x2396e4(0x108)]+_0x2396e4(0x95)+_0x3bdf1f)),0x1;}try{_0x22440f=await _0x5a4514[_0x2396e4(0xcd)]['resolveAgentId'](_0x635603['agentName'],_0x1cf430);}catch(_0x20daba){const _0x69db97=_0x20daba instanceof Error?_0x20daba[_0x2396e4(0xe1)]:String(_0x20daba);return _0x69db97[_0x2396e4(0x10e)]('404')||_0x69db97[_0x2396e4(0xda)]()[_0x2396e4(0x10e)]('not\x20found')?console[_0x2396e4(0xc3)](a5_0xdc0274['red'](_0x2396e4(0xb9)+_0x635603[_0x2396e4(0x91)])):console[_0x2396e4(0xc3)](a5_0xdc0274[_0x2396e4(0x7d)](_0x2396e4(0x10d)+_0x635603[_0x2396e4(0x91)]+'\x22:\x20'+_0x69db97)),0x1;}let _0x4d4bf6;if(!_0x5f46aa)try{_0x4d4bf6=await setupEvaluatorAgent(_0x5a4514[_0x2396e4(0xcd)],_0x5ad9f8['verbose']);}catch(_0x86f09b){const _0x41ad79=_0x86f09b instanceof Error?_0x86f09b[_0x2396e4(0xe1)]:String(_0x86f09b);return console['log'](a5_0xdc0274[_0x2396e4(0x7d)](_0x2396e4(0xc6)+_0x41ad79)),0x1;}console[_0x2396e4(0xc3)](a5_0xdc0274[_0x2396e4(0x104)]('Running\x20agent\x20tests...')),console['log'](_0x2396e4(0x7c)+a5_0xdc0274[_0x2396e4(0xd6)](_0x556b3e)),console['log'](_0x2396e4(0x107)+a5_0xdc0274[_0x2396e4(0xd6)](_0x635603[_0x2396e4(0x108)]+'/'+_0x635603[_0x2396e4(0x91)])),console[_0x2396e4(0xc3)]();const _0x4751f7=[],_0x3aaa1c=[],_0x425be1=Date[_0x2396e4(0x80)]();for(let _0x2af7fd=0x0;_0x2af7fd<_0x1ba8b7[_0x2396e4(0xf6)];_0x2af7fd++){const _0x4738cf=_0x1ba8b7[_0x2af7fd];_0x1ba8b7[_0x2396e4(0xf6)]>0x1?console[_0x2396e4(0xc3)](_0x2396e4(0xe7)+(_0x2af7fd+0x1)+'/'+_0x1ba8b7['length']+':\x20'+a5_0xdc0274['white'](_0x4738cf['name'])):console[_0x2396e4(0xc3)](_0x2396e4(0xa8)+a5_0xdc0274[_0x2396e4(0xd6)](_0x4738cf[_0x2396e4(0x88)]));const _0x42333a=createCommandSpinner(_0x2396e4(0xd3)+_0x4738cf['rounds'][_0x2396e4(0xf6)]+_0x2396e4(0x7e));_0x42333a['start']();try{const {result:_0x3db7d7,conversation:_0x3695d9}=await runTest(_0x5a4514[_0x2396e4(0xcd)],_0x4738cf,{'agentId':_0x22440f,'projectId':_0x1cf430,'site':_0x556b3e,'noEval':_0x5f46aa,'evaluatorId':_0x4d4bf6,'onRoundStart':(_0x181fa4,_0x50462a)=>{const _0x4e84ca=_0x2396e4;_0x42333a[_0x4e84ca(0x113)]=_0x4e84ca(0x103)+(_0x181fa4+0x1)+'/'+_0x50462a+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x1e76e1,_0xa5abd1,_0x69c190)=>{const _0x19ba64=_0x2396e4,_0x39342e=formatElapsed(_0xa5abd1);_0x69c190?console[_0x19ba64(0xc3)](_0x19ba64(0x110)+(_0x1e76e1+0x1)+'/'+_0x4738cf[_0x19ba64(0xea)][_0x19ba64(0xf6)]+'...\x20'+a5_0xdc0274['green']('✓')+'\x20('+_0x39342e+')'):console[_0x19ba64(0xc3)](_0x19ba64(0x110)+(_0x1e76e1+0x1)+'/'+_0x4738cf['rounds'][_0x19ba64(0xf6)]+_0x19ba64(0x89)+a5_0xdc0274[_0x19ba64(0x7d)]('✗'));},'onEvaluationStart':()=>{const _0x31bb4d=_0x2396e4;_0x42333a[_0x31bb4d(0x113)]=_0x31bb4d(0xa6);},'onEvaluationComplete':_0xcd6f1b=>{const _0x3d3627=_0x2396e4,_0x3d83b7=formatElapsed(_0xcd6f1b);console[_0x3d3627(0xc3)]('\x20\x20Evaluating...\x20'+a5_0xdc0274[_0x3d3627(0x8a)]('✓')+'\x20('+_0x3d83b7+')');}});_0x42333a[_0x2396e4(0x97)](),_0x4751f7['push'](_0x3db7d7),_0x3aaa1c[_0x2396e4(0xe8)](_0x3695d9);if(_0x3db7d7[_0x2396e4(0xb7)]===_0x2396e4(0x87))console[_0x2396e4(0xc3)](a5_0xdc0274[_0x2396e4(0x8a)](_0x2396e4(0xa5)+_0x3db7d7['reason']));else _0x3db7d7[_0x2396e4(0xb7)]===_0x2396e4(0xcb)?console[_0x2396e4(0xc3)](a5_0xdc0274[_0x2396e4(0x7d)](_0x2396e4(0x8b)+_0x3db7d7[_0x2396e4(0xee)])):console[_0x2396e4(0xc3)](a5_0xdc0274[_0x2396e4(0x7d)]('✗\x20ERROR:\x20'+_0x3db7d7[_0x2396e4(0xee)]));_0x3db7d7[_0x2396e4(0xa2)]&&console[_0x2396e4(0xc3)](a5_0xdc0274['dim']('Conversation\x20URL:\x20'+_0x3db7d7['conversation_url'])),console[_0x2396e4(0xc3)]();}catch(_0x5cf1d3){_0x42333a[_0x2396e4(0x97)]();const _0x4d0c9a=_0x5cf1d3 instanceof Error?_0x5cf1d3['message']:String(_0x5cf1d3);console['log'](a5_0xdc0274[_0x2396e4(0x7d)](_0x2396e4(0xab)+_0x4d0c9a)),console[_0x2396e4(0xc3)](),_0x4751f7[_0x2396e4(0xe8)]({'name':_0x4738cf['name'],'status':_0x2396e4(0xa4),'reason':_0x4d0c9a,'timestamp':new Date()[_0x2396e4(0xb8)](),'duration_ms':0x0});}}const _0x8a8384=Date[_0x2396e4(0x80)]()-_0x425be1,_0x565759=_0x4751f7[_0x2396e4(0xd7)](_0x2c8d1e=>_0x2c8d1e[_0x2396e4(0xb7)]===_0x2396e4(0x87))[_0x2396e4(0xf6)],_0x1a0b3a=_0x4751f7[_0x2396e4(0xd7)](_0x452c81=>_0x452c81[_0x2396e4(0xb7)]===_0x2396e4(0xcb))[_0x2396e4(0xf6)],_0x36f2f5=_0x4751f7[_0x2396e4(0xd7)](_0x1f141b=>_0x1f141b['status']==='ERROR')[_0x2396e4(0xf6)];console[_0x2396e4(0xc3)]('━'[_0x2396e4(0xec)](0x3c)),console[_0x2396e4(0xc3)](_0x2396e4(0xb0)),console[_0x2396e4(0xc3)]('━'[_0x2396e4(0xec)](0x3c)),console[_0x2396e4(0xc3)](_0x2396e4(0xb2)+_0x4751f7['length']),console[_0x2396e4(0xc3)](_0x2396e4(0xf5)+a5_0xdc0274[_0x2396e4(0x8a)](_0x565759)),console[_0x2396e4(0xc3)](_0x2396e4(0x115)+a5_0xdc0274[_0x2396e4(0x7d)](_0x1a0b3a));_0x36f2f5>0x0&&console[_0x2396e4(0xc3)](_0x2396e4(0x9c)+a5_0xdc0274[_0x2396e4(0x7d)](_0x36f2f5));console[_0x2396e4(0xc3)](_0x2396e4(0xcf)+formatElapsed(_0x8a8384)),console[_0x2396e4(0xc3)]('━'[_0x2396e4(0xec)](0x3c));const _0x194a34=_0x4751f7['filter'](_0x2486ff=>_0x2486ff['status']!==_0x2396e4(0x87));if(_0x194a34[_0x2396e4(0xf6)]>0x0){console['log'](),console[_0x2396e4(0xc3)]('Failed\x20Tests:');for(const _0x487169 of _0x194a34){const _0x344fc8=a5_0xdc0274[_0x2396e4(0x7d)]('✗'),_0x313a4d=_0x487169[_0x2396e4(0xee)]['length']>0x32?_0x487169[_0x2396e4(0xee)][_0x2396e4(0xbc)](0x0,0x32)+'...':_0x487169[_0x2396e4(0xee)];console['log']('\x20\x20'+_0x344fc8+'\x20'+_0x487169['name']+':\x20'+_0x313a4d);}}const _0x515f5f={'summary':{'total':_0x4751f7[_0x2396e4(0xf6)],'passed':_0x565759,'failed':_0x1a0b3a,'errors':_0x36f2f5>0x0?_0x36f2f5:undefined,'duration_ms':_0x8a8384},'tests':_0x4751f7,'agent':{'project':_0x635603['projectName'],'name':_0x635603[_0x2396e4(0x91)],'site':_0x556b3e},'timestamp':new Date(_0x425be1)[_0x2396e4(0xb8)]()};try{const _0x56e6d7=buildCachedTestRun(_0x3aaa1c,{'site':_0x556b3e,'projectId':_0x1cf430,'projectName':_0x635603[_0x2396e4(0x108)],'agentId':_0x22440f,'agentName':_0x635603['agentName'],'testYmlPath':a5_0x46fc01[_0x2396e4(0x105)](_0x635603[_0x2396e4(0x106)])});saveLastTestRun(_0x56e6d7);}catch{}if(_0x205c23!==_0x2396e4(0xc4)||_0x564118){const _0x2fd7b8=formatResults(_0x515f5f,_0x205c23);if(_0x564118)try{a5_0x35afb0[_0x2396e4(0xa9)](_0x564118,_0x2fd7b8,'utf-8'),console[_0x2396e4(0xc3)](),console[_0x2396e4(0xc3)](a5_0xdc0274[_0x2396e4(0x8f)](_0x2396e4(0xed)+_0x564118));}catch(_0x1aed0d){return console[_0x2396e4(0xc3)](),console[_0x2396e4(0xc3)](a5_0xdc0274[_0x2396e4(0x7d)](_0x2396e4(0xaf)+_0x1aed0d)),0x1;}else console[_0x2396e4(0xc3)](),console[_0x2396e4(0xc3)](_0x2fd7b8);}return _0x194a34[_0x2396e4(0xf6)]>0x0?0x1:0x0;}async[a5_0xa60653(0xd9)](_0x1562ef,_0x1f37cc){const _0x5eb8d8=a5_0xa60653,{options:_0x3f994f,tdx:_0x2398a9}=_0x1562ef,{definition:_0x513cd6,agentInfo:_0x23abbc,outputFormat:_0x4c0b09,outputFile:_0x35c144}=_0x1f37cc,_0x7c8bc3=_0x3f994f['site'],_0x37008e=loadLastTestRun();if(!_0x37008e)return console[_0x5eb8d8(0xc3)](a5_0xdc0274['red']('Error:\x20No\x20previous\x20test\x20run\x20found.')),console['log'](a5_0xdc0274[_0x5eb8d8(0x8f)](_0x5eb8d8(0xf9))),0x1;if(_0x37008e[_0x5eb8d8(0x98)][_0x5eb8d8(0x91)]!==_0x23abbc[_0x5eb8d8(0x91)])return console[_0x5eb8d8(0xc3)](a5_0xdc0274['red']('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x37008e['agent'][_0x5eb8d8(0x91)]+_0x5eb8d8(0xc0)+_0x23abbc['agentName']+'\x22.')),console[_0x5eb8d8(0xc3)](a5_0xdc0274[_0x5eb8d8(0x8f)]('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x4f5e4d=new Set(_0x37008e[_0x5eb8d8(0x117)]['map'](_0x31028a=>_0x31028a['testName'])),_0x4460b4=_0x513cd6[_0x5eb8d8(0xb6)][_0x5eb8d8(0xd7)](_0xb1b295=>!_0x4f5e4d[_0x5eb8d8(0x83)](_0xb1b295[_0x5eb8d8(0x88)]));if(_0x4460b4[_0x5eb8d8(0xf6)]>0x0&&_0x37008e['site']!==_0x7c8bc3)return console['log'](a5_0xdc0274[_0x5eb8d8(0x7d)](_0x5eb8d8(0xbb))),console['log'](a5_0xdc0274[_0x5eb8d8(0x8f)](_0x5eb8d8(0xdb)+_0x37008e[_0x5eb8d8(0x101)]+_0x5eb8d8(0x9d)+_0x7c8bc3+'\x22.')),console['log'](a5_0xdc0274[_0x5eb8d8(0x8f)](_0x5eb8d8(0x85)+_0x37008e['site']+_0x5eb8d8(0xbd))),0x1;const _0x53e98f=_0x513cd6[_0x5eb8d8(0xb6)]['filter'](_0x335b0e=>_0x4f5e4d[_0x5eb8d8(0x83)](_0x335b0e[_0x5eb8d8(0x88)])),_0x46fc2a=_0x4460b4;let _0x1cc551;try{_0x1cc551=await setupEvaluatorAgent(_0x2398a9[_0x5eb8d8(0xcd)],_0x3f994f[_0x5eb8d8(0xe0)]);}catch(_0x47be4e){const _0x3382ce=_0x47be4e instanceof Error?_0x47be4e[_0x5eb8d8(0xe1)]:String(_0x47be4e);return console[_0x5eb8d8(0xc3)](a5_0xdc0274[_0x5eb8d8(0x7d)](_0x5eb8d8(0xc6)+_0x3382ce)),0x1;}console[_0x5eb8d8(0xc3)](a5_0xdc0274['cyan']('Re-evaluating\x20cached\x20test\x20run...')),console[_0x5eb8d8(0xc3)](_0x5eb8d8(0xef)+a5_0xdc0274['white'](_0x37008e[_0x5eb8d8(0x9b)])),console[_0x5eb8d8(0xc3)](_0x5eb8d8(0x107)+a5_0xdc0274['white'](_0x37008e[_0x5eb8d8(0x98)]['projectName']+'/'+_0x37008e[_0x5eb8d8(0x98)][_0x5eb8d8(0x91)]));_0x46fc2a['length']>0x0&&console[_0x5eb8d8(0xc3)](_0x5eb8d8(0xb1)+a5_0xdc0274[_0x5eb8d8(0xdf)](_0x46fc2a[_0x5eb8d8(0xf6)]));console['log']();const _0x2e0d78=[],_0x57dd83=Date[_0x5eb8d8(0x80)](),_0x4ae20f=createCommandSpinner(_0x5eb8d8(0xc9));if(_0x53e98f[_0x5eb8d8(0xf6)]>0x0)try{const _0xd68473=await reevaluateFromCache(_0x2398a9['llm'],_0x37008e,{'tests':_0x53e98f},{'evaluatorId':_0x1cc551,'onTestStart':(_0x423b57,_0x38c41c,_0xf8df9)=>{const _0xd3e4f0=_0x5eb8d8;_0x4ae20f[_0xd3e4f0(0x113)]=_0xd3e4f0(0xba)+(_0x38c41c+0x1)+'/'+_0xf8df9+':\x20'+_0x423b57+_0xd3e4f0(0x99);if(!_0x4ae20f[_0xd3e4f0(0xf1)])_0x4ae20f['start']();},'onTestComplete':(_0x5d6d5d,_0x5575d4)=>{const _0x479483=_0x5eb8d8;_0x4ae20f[_0x479483(0x97)]();if(_0x5575d4[_0x479483(0xb7)]===_0x479483(0x87))console[_0x479483(0xc3)](a5_0xdc0274[_0x479483(0x8a)]('✓\x20PASS:\x20'+_0x5d6d5d)+a5_0xdc0274[_0x479483(0x8f)](_0x479483(0x90)));else _0x5575d4[_0x479483(0xb7)]===_0x479483(0xcb)?console[_0x479483(0xc3)](a5_0xdc0274[_0x479483(0x7d)](_0x479483(0x8b)+_0x5d6d5d+_0x479483(0x84)+_0x5575d4['reason'])+a5_0xdc0274[_0x479483(0x8f)]('\x20(cached)')):console['log'](a5_0xdc0274[_0x479483(0x7d)](_0x479483(0xab)+_0x5d6d5d+_0x479483(0x84)+_0x5575d4[_0x479483(0xee)]));_0x5575d4[_0x479483(0xa2)]&&console[_0x479483(0xc3)](a5_0xdc0274[_0x479483(0x8f)](_0x479483(0x86)+_0x5575d4[_0x479483(0xa2)])),_0x2e0d78[_0x479483(0xe8)](_0x5575d4);},'onTestSkipped':(_0x467684,_0x47368f)=>{const _0x5d7a26=_0x5eb8d8;_0x4ae20f[_0x5d7a26(0x97)](),console[_0x5d7a26(0xc3)](a5_0xdc0274[_0x5d7a26(0xdf)](_0x5d7a26(0xf2)+_0x467684+'\x20-\x20'+_0x47368f));}});for(const _0x328a4a of _0xd68473){!_0x2e0d78[_0x5eb8d8(0xc8)](_0x3576de=>_0x3576de['name']===_0x328a4a[_0x5eb8d8(0x88)])&&_0x2e0d78[_0x5eb8d8(0xe8)](_0x328a4a);}}catch(_0x403b98){_0x4ae20f[_0x5eb8d8(0x97)]();const _0x281746=_0x403b98 instanceof Error?_0x403b98['message']:String(_0x403b98);return console[_0x5eb8d8(0xc3)](a5_0xdc0274[_0x5eb8d8(0x7d)](_0x5eb8d8(0xd8)+_0x281746)),0x1;}_0x4ae20f['stop']();if(_0x46fc2a[_0x5eb8d8(0xf6)]>0x0){console['log'](),console['log'](a5_0xdc0274[_0x5eb8d8(0x104)](_0x5eb8d8(0xae)));const {projectId:_0x5898a7,agentId:_0x462098}=_0x37008e[_0x5eb8d8(0x98)];for(const _0x5892a1 of _0x46fc2a){console['log']('Running:\x20'+a5_0xdc0274[_0x5eb8d8(0xd6)](_0x5892a1['name']));const _0x44333b=createCommandSpinner(_0x5eb8d8(0xd3)+_0x5892a1[_0x5eb8d8(0xea)][_0x5eb8d8(0xf6)]+':\x20Sending\x20user\x20input...');_0x44333b[_0x5eb8d8(0x111)]();try{const {result:_0x19ad13}=await runTest(_0x2398a9['llm'],_0x5892a1,{'agentId':_0x462098,'projectId':_0x5898a7,'site':_0x37008e[_0x5eb8d8(0x101)],'noEval':![],'evaluatorId':_0x1cc551,'onRoundStart':(_0x5481bc,_0x5b0563)=>{const _0x1c33fb=_0x5eb8d8;_0x44333b['text']='Round\x20'+(_0x5481bc+0x1)+'/'+_0x5b0563+_0x1c33fb(0x7e);},'onRoundComplete':(_0x54529d,_0x303a9f,_0x397f0d)=>{const _0x254918=_0x5eb8d8,_0x33b918=formatElapsed(_0x303a9f);_0x397f0d?console[_0x254918(0xc3)](_0x254918(0x110)+(_0x54529d+0x1)+'/'+_0x5892a1[_0x254918(0xea)]['length']+_0x254918(0x89)+a5_0xdc0274[_0x254918(0x8a)]('✓')+'\x20('+_0x33b918+')'):console[_0x254918(0xc3)]('\x20\x20Round\x20'+(_0x54529d+0x1)+'/'+_0x5892a1[_0x254918(0xea)][_0x254918(0xf6)]+_0x254918(0x89)+a5_0xdc0274['red']('✗'));},'onEvaluationStart':()=>{const _0x5c0e60=_0x5eb8d8;_0x44333b[_0x5c0e60(0x113)]=_0x5c0e60(0xa6);},'onEvaluationComplete':_0x1b08c8=>{const _0x3d0037=_0x5eb8d8,_0xe8690=formatElapsed(_0x1b08c8);console['log'](_0x3d0037(0xf0)+a5_0xdc0274[_0x3d0037(0x8a)]('✓')+'\x20('+_0xe8690+')');}});_0x44333b[_0x5eb8d8(0x97)](),_0x2e0d78[_0x5eb8d8(0xe8)](_0x19ad13);if(_0x19ad13[_0x5eb8d8(0xb7)]===_0x5eb8d8(0x87))console['log'](a5_0xdc0274[_0x5eb8d8(0x8a)]('✓\x20PASS:\x20'+_0x19ad13[_0x5eb8d8(0xee)])+a5_0xdc0274[_0x5eb8d8(0x8f)](_0x5eb8d8(0x10c)));else _0x19ad13[_0x5eb8d8(0xb7)]==='FAIL'?console[_0x5eb8d8(0xc3)](a5_0xdc0274[_0x5eb8d8(0x7d)](_0x5eb8d8(0x8b)+_0x19ad13[_0x5eb8d8(0xee)])+a5_0xdc0274[_0x5eb8d8(0x8f)]('\x20(new)')):console['log'](a5_0xdc0274[_0x5eb8d8(0x7d)](_0x5eb8d8(0xab)+_0x19ad13[_0x5eb8d8(0xee)]));_0x19ad13[_0x5eb8d8(0xa2)]&&console[_0x5eb8d8(0xc3)](a5_0xdc0274['dim']('\x20\x20Conversation:\x20'+_0x19ad13[_0x5eb8d8(0xa2)]));}catch(_0x350dad){_0x44333b[_0x5eb8d8(0x97)]();const _0x597ee9=_0x350dad instanceof Error?_0x350dad[_0x5eb8d8(0xe1)]:String(_0x350dad);console['log'](a5_0xdc0274[_0x5eb8d8(0x7d)](_0x5eb8d8(0xab)+_0x597ee9)),_0x2e0d78[_0x5eb8d8(0xe8)]({'name':_0x5892a1['name'],'status':_0x5eb8d8(0xa4),'reason':_0x597ee9,'timestamp':new Date()[_0x5eb8d8(0xb8)](),'duration_ms':0x0});}}}console[_0x5eb8d8(0xc3)]();const _0x254265=Date[_0x5eb8d8(0x80)]()-_0x57dd83,_0x4f62d3=_0x2e0d78[_0x5eb8d8(0xd7)](_0x24b661=>_0x24b661[_0x5eb8d8(0xb7)]===_0x5eb8d8(0x87))[_0x5eb8d8(0xf6)],_0x381cd3=_0x2e0d78['filter'](_0x525298=>_0x525298['status']===_0x5eb8d8(0xcb))['length'],_0x5a713a=_0x2e0d78[_0x5eb8d8(0xd7)](_0xdf7485=>_0xdf7485[_0x5eb8d8(0xb7)]==='ERROR')['length'];console[_0x5eb8d8(0xc3)]('━'[_0x5eb8d8(0xec)](0x3c)),console[_0x5eb8d8(0xc3)](_0x5eb8d8(0x100)),console['log']('━'[_0x5eb8d8(0xec)](0x3c)),console['log'](_0x5eb8d8(0xb2)+_0x2e0d78['length']),console[_0x5eb8d8(0xc3)](_0x5eb8d8(0xf5)+a5_0xdc0274[_0x5eb8d8(0x8a)](_0x4f62d3)),console['log'](_0x5eb8d8(0x115)+a5_0xdc0274[_0x5eb8d8(0x7d)](_0x381cd3));_0x5a713a>0x0&&console['log']('Errors:\x20\x20\x20'+a5_0xdc0274[_0x5eb8d8(0x7d)](_0x5a713a));console[_0x5eb8d8(0xc3)]('Duration:\x20'+formatElapsed(_0x254265)),console[_0x5eb8d8(0xc3)]('━'[_0x5eb8d8(0xec)](0x3c));const _0x5862e9={'summary':{'total':_0x2e0d78[_0x5eb8d8(0xf6)],'passed':_0x4f62d3,'failed':_0x381cd3,'errors':_0x5a713a>0x0?_0x5a713a:undefined,'duration_ms':_0x254265},'tests':_0x2e0d78,'agent':{'project':_0x23abbc[_0x5eb8d8(0x108)],'name':_0x23abbc['agentName'],'site':_0x7c8bc3},'timestamp':new Date(_0x57dd83)[_0x5eb8d8(0xb8)]()};if(_0x4c0b09!=='table'||_0x35c144){const _0x14b866=formatResults(_0x5862e9,_0x4c0b09);if(_0x35c144)try{a5_0x35afb0[_0x5eb8d8(0xa9)](_0x35c144,_0x14b866,'utf-8'),console[_0x5eb8d8(0xc3)](),console[_0x5eb8d8(0xc3)](a5_0xdc0274[_0x5eb8d8(0x8f)](_0x5eb8d8(0xed)+_0x35c144));}catch(_0x2041cf){return console[_0x5eb8d8(0xc3)](),console[_0x5eb8d8(0xc3)](a5_0xdc0274[_0x5eb8d8(0x7d)](_0x5eb8d8(0xaf)+_0x2041cf)),0x1;}else console['log'](),console[_0x5eb8d8(0xc3)](_0x14b866);}const _0xa8bf2f=_0x2e0d78[_0x5eb8d8(0xd7)](_0x7a4a6a=>_0x7a4a6a[_0x5eb8d8(0xb7)]!==_0x5eb8d8(0x87));return _0xa8bf2f[_0x5eb8d8(0xf6)]>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0x413b26=a5_0x26bb;(function(_0x576a35,_0x106afd){const _0x4b5813=a5_0x26bb,_0x425787=_0x576a35();while(!![]){try{const _0x5b4d4a=parseInt(_0x4b5813(0xcb))/0x1*(parseInt(_0x4b5813(0xd0))/0x2)+parseInt(_0x4b5813(0x116))/0x3*(parseInt(_0x4b5813(0x109))/0x4)+-parseInt(_0x4b5813(0x106))/0x5+parseInt(_0x4b5813(0x10e))/0x6+parseInt(_0x4b5813(0xf0))/0x7+-parseInt(_0x4b5813(0x142))/0x8+-parseInt(_0x4b5813(0x10d))/0x9*(parseInt(_0x4b5813(0x141))/0xa);if(_0x5b4d4a===_0x106afd)break;else _0x425787['push'](_0x425787['shift']());}catch(_0x244d8b){_0x425787['push'](_0x425787['shift']());}}}(a5_0x1a58,0x5d111));import*as a5_0x2f367c from'node:fs';import*as a5_0x2aad79 from'node:path';function a5_0x26bb(_0xee5235,_0x322d9a){_0xee5235=_0xee5235-0xb1;const _0x1a5822=a5_0x1a58();let _0x26bbf4=_0x1a5822[_0xee5235];return _0x26bbf4;}import a5_0x5108d1 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';function a5_0x1a58(){const _0x339843=['\x20\x20Round\x20','green','tags','cyan','size','red','Executing\x20new\x20tests...','Evaluating\x20response...','...\x20','FAIL','2355535sHGYUk','site','Failed:\x20\x20\x20','toISOString','Cached\x20run\x20is\x20from\x20site\x20\x22','conversation_url','forEach','✓\x20PASS:\x20','Re-evaluating\x20cached\x20test\x20run...','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','Either\x20switch\x20to\x20the\x20\x22','llmProject','No\x20tests\x20found\x20matching:\x20','agent','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','Round\x20','Total:\x20\x20\x20\x20','Tests\x20found:\x20','/<agent-name>','toLowerCase','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','start','2607225oVryRR','yellow','executeReeval','2536fOYvxv','isSpinning','multiple_agents','agent:test','18VUhwyy','3775260tEzmMV','Round\x201/','\x20(new)','now','\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)','stop','Test\x20','repeat','2064IzbKYs','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','utf-8','projectName','log','PASS','resolve','rounds','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','\x27\x20to\x20create\x20the\x20folder\x20structure.','includes','\x20(cached)','join','\x20-\x20','Test\x20Configuration:','add','found','projectDir','find','ERROR','Re-evaluating...','resolveAgentId','✗\x20ERROR:\x20Project\x20not\x20found:\x20','text','\x20\x20Agent:\x20','split','Re-evaluation\x20Summary','jsonl','Error:\x20No\x20previous\x20test\x20run\x20found.','Running\x20test:\x20','Test\x20Summary','\x22:\x20','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','tests','round','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','Project\x20path:\x20','has','dim','test.yml','existsSync','⚠\x20SKIPPED:\x20','reason','1565160VafFQS','3006264Ienila','basename','Available\x20tests:\x20','length','json','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','404','Error\x20writing\x20output\x20file:\x20',':\x20Sending\x20user\x20input...','agentName','push','message','tsv','\x20\x20-\x20','Failed\x20Tests:','New\x20tests\x20to\x20execute:\x20','Agent:\x20','llm','Conversation\x20URL:\x20','table','Duration:\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','✗\x20ERROR:\x20','Errors:\x20\x20\x20','white','not\x20found','trim','Site:\x20','✗\x20FAIL:\x20','substring','94777QrgRjP','Running:\x20','Using\x20agent:\x20','Re-evaluating\x20','status','4nKGXJt','some','name','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','reeval','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Passed:\x20\x20\x20','no_local_folder','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','\x20\x20Conversation:\x20','\x20\x20Site:\x20','\x20\x20Evaluating...\x20','Run\x20tests\x20for\x20an\x20LLM\x20agent','filter','map','Cached\x20run\x20from:\x20','\x20\x20Project:\x20','Output\x20written\x20to:\x20','testYmlPath','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','...'];a5_0x1a58=function(){return _0x339843;};return a5_0x1a58();}export class AgentTestCommand extends BaseCommand{[a5_0x413b26(0xd2)]=a5_0x413b26(0x10c);['description']=a5_0x413b26(0xdd);async['execute'](_0x90c4aa){const _0x55257f=a5_0x413b26,{options:_0x198494,args:_0x4035aa,tdx:_0x1b848a}=_0x90c4aa,_0x3185e8=_0x4035aa[0x0]||'.',_0x565795=_0x198494['dryRun'],_0x405d10=_0x198494,_0x552db3=_0x405d10['eval']===![],_0x455a7e=_0x405d10[_0x55257f(0xd5)],_0x494e2a=_0x405d10[_0x55257f(0xd2)],_0x2457fa=_0x405d10[_0x55257f(0xe8)],_0x598915=_0x198494[_0x55257f(0xf1)],_0x577182=_0x405d10['output'];if(_0x455a7e&&_0x552db3)return console[_0x55257f(0x11a)](a5_0x5108d1[_0x55257f(0xeb)](_0x55257f(0x136))),0x1;let _0x3f55b6=_0x55257f(0xc0);if(_0x405d10['json'])_0x3f55b6=_0x55257f(0x146);else{if(_0x405d10[_0x55257f(0x131)])_0x3f55b6=_0x55257f(0x131);else{if(_0x405d10[_0x55257f(0xb9)])_0x3f55b6=_0x55257f(0xb9);else{if(_0x405d10['table'])_0x3f55b6='table';}}}const _0x3b920b=_0x405d10[_0x55257f(0xfb)];let _0x5c08f6=_0x3185e8;const _0x5aea97=a5_0x2f367c[_0x55257f(0x13e)](_0x3185e8),_0x532a44=_0x3185e8==='.';if(!_0x5aea97||_0x532a44){const _0x363aa8=resolveProjectFromContext(_0x3185e8,_0x3b920b,{'requireFile':_0x55257f(0x13d)});if(_0x363aa8[_0x55257f(0x126)])_0x5c08f6=_0x363aa8['projectDir'],_0x363aa8['source']==='context'&&console['log'](a5_0x5108d1['dim'](_0x55257f(0xcd)+_0x5c08f6));else switch(_0x363aa8['reason']){case'no_context':console['log'](a5_0x5108d1[_0x55257f(0x107)](_0x363aa8[_0x55257f(0xb8)])),console[_0x55257f(0x11a)](),console['log']('Usage:'),console['log']('\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path'),console[_0x55257f(0x11a)](_0x55257f(0x112)),console[_0x55257f(0x11a)](),console[_0x55257f(0x11a)](_0x55257f(0x117));return 0x1;case _0x55257f(0xd8):console[_0x55257f(0x11a)](a5_0x5108d1[_0x55257f(0x107)](_0x363aa8['message'])),console['log'](),console[_0x55257f(0x11a)]('Run\x20\x27tdx\x20agent\x20pull\x20'+_0x363aa8[_0x55257f(0xfb)]+_0x55257f(0x11f));return 0x1;case _0x55257f(0x10b):{const _0x3949a5=a5_0x2aad79[_0x55257f(0x143)](_0x363aa8[_0x55257f(0x127)]);console[_0x55257f(0x11a)](a5_0x5108d1[_0x55257f(0x107)](_0x55257f(0xb1)+_0x363aa8[_0x55257f(0xfb)]+'\x22:'));for(const _0x4ef2a6 of _0x363aa8['agentDirs']){console[_0x55257f(0x11a)](_0x55257f(0xba)+_0x4ef2a6);}return console[_0x55257f(0x11a)](),console[_0x55257f(0x11a)]('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x3949a5+_0x55257f(0x102)),0x1;}case'no_tests':console[_0x55257f(0x11a)](a5_0x5108d1[_0x55257f(0x107)](_0x55257f(0xd3)+_0x363aa8['llmProject']+'\x22.')),console[_0x55257f(0x11a)](a5_0x5108d1[_0x55257f(0x13c)](_0x55257f(0x13a)+_0x363aa8['projectDir'])),console[_0x55257f(0x11a)](),console[_0x55257f(0x11a)](_0x55257f(0xd4));return 0x1;}}const {definition:_0x37dcfa,agentInfo:_0xdf923}=parseTestFile(_0x5c08f6);let _0x41a84b=_0x37dcfa[_0x55257f(0x137)];if(_0x494e2a){const _0x37884c=_0x494e2a['split'](',')[_0x55257f(0xdf)](_0xac17bb=>_0xac17bb[_0x55257f(0xc7)]());_0x41a84b=_0x37dcfa[_0x55257f(0x137)][_0x55257f(0xde)](_0x55523c=>_0x37884c['includes'](_0x55523c[_0x55257f(0xd2)]));if(_0x41a84b['length']===0x0)return console[_0x55257f(0x11a)](a5_0x5108d1[_0x55257f(0x107)](_0x55257f(0xfc)+_0x494e2a)),console['log'](a5_0x5108d1[_0x55257f(0x13c)](_0x55257f(0x144)+_0x37dcfa[_0x55257f(0x137)]['map'](_0x5b5ae2=>_0x5b5ae2['name'])[_0x55257f(0x122)](',\x20'))),0x1;}if(_0x2457fa){const _0x5f029f=_0x2457fa[_0x55257f(0x12f)](',')[_0x55257f(0xdf)](_0x45b5c2=>_0x45b5c2[_0x55257f(0xc7)]()[_0x55257f(0x103)]());_0x41a84b=_0x41a84b['filter'](_0x1d8310=>_0x1d8310[_0x55257f(0xe8)]?.[_0x55257f(0xd1)](_0x53ff3e=>_0x5f029f[_0x55257f(0x120)](_0x53ff3e['toLowerCase']())));if(_0x41a84b['length']===0x0){console['log'](a5_0x5108d1[_0x55257f(0x107)]('No\x20tests\x20found\x20with\x20tags:\x20'+_0x2457fa));const _0x75ca86=new Set();return _0x37dcfa['tests'][_0x55257f(0xf6)](_0x3453ea=>_0x3453ea[_0x55257f(0xe8)]?.[_0x55257f(0xf6)](_0x6d8066=>_0x75ca86[_0x55257f(0x125)](_0x6d8066))),_0x75ca86[_0x55257f(0xea)]>0x0?console['log'](a5_0x5108d1[_0x55257f(0x13c)]('Available\x20tags:\x20'+[..._0x75ca86][_0x55257f(0x122)](',\x20'))):console[_0x55257f(0x11a)](a5_0x5108d1['dim']('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0x455a7e)return this[_0x55257f(0x108)](_0x90c4aa,{'definition':{'tests':_0x41a84b},'agentInfo':_0xdf923,'outputFormat':_0x3f55b6,'outputFile':_0x577182,'testNames':_0x494e2a});if(_0x565795){console['log'](a5_0x5108d1[_0x55257f(0xe9)](_0x55257f(0x124))),console['log'](_0x55257f(0xdb)+a5_0x5108d1['white'](_0x598915)),console[_0x55257f(0x11a)](_0x55257f(0xe1)+a5_0x5108d1[_0x55257f(0xc5)](_0xdf923[_0x55257f(0x119)])),console[_0x55257f(0x11a)](_0x55257f(0x12e)+a5_0x5108d1['white'](_0xdf923[_0x55257f(0xb6)])),console['log'](),console[_0x55257f(0x11a)](_0x55257f(0x101)+a5_0x5108d1['white'](_0x41a84b['length']));for(let _0x19e40d=0x0;_0x19e40d<_0x41a84b['length'];_0x19e40d++){const _0x23f994=_0x41a84b[_0x19e40d],_0xbdcce3=_0x23f994[_0x55257f(0x11d)]['length']===0x1?_0x55257f(0x138):_0x55257f(0x11d),_0x247efd=_0x23f994[_0x55257f(0xe8)]?.[_0x55257f(0x145)]?'\x20['+_0x23f994['tags'][_0x55257f(0x122)](',\x20')+']':'';console['log']('\x20\x20'+(_0x19e40d+0x1)+'.\x20'+a5_0x5108d1['white'](_0x23f994[_0x55257f(0xd2)])+'\x20('+_0x23f994[_0x55257f(0x11d)][_0x55257f(0x145)]+'\x20'+_0xbdcce3+')'+a5_0x5108d1[_0x55257f(0x13c)](_0x247efd));}return 0x0;}let _0x433523,_0x5ca8a0;try{_0x433523=await _0x1b848a[_0x55257f(0xbe)]['resolveProjectId'](_0xdf923[_0x55257f(0x119)]);}catch(_0x1cc369){const _0x45efc7=_0x1cc369 instanceof Error?_0x1cc369['message']:String(_0x1cc369);return _0x45efc7[_0x55257f(0x120)](_0x55257f(0xb3))||_0x45efc7[_0x55257f(0x103)]()[_0x55257f(0x120)](_0x55257f(0xc6))?console[_0x55257f(0x11a)](a5_0x5108d1[_0x55257f(0xeb)](_0x55257f(0x12c)+_0xdf923[_0x55257f(0x119)])):console[_0x55257f(0x11a)](a5_0x5108d1[_0x55257f(0xeb)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0xdf923[_0x55257f(0x119)]+_0x55257f(0x135)+_0x45efc7)),0x1;}try{_0x5ca8a0=await _0x1b848a[_0x55257f(0xbe)][_0x55257f(0x12b)](_0xdf923['agentName'],_0x433523);}catch(_0x3c8c0f){const _0x5a780d=_0x3c8c0f instanceof Error?_0x3c8c0f[_0x55257f(0xb8)]:String(_0x3c8c0f);return _0x5a780d[_0x55257f(0x120)](_0x55257f(0xb3))||_0x5a780d[_0x55257f(0x103)]()[_0x55257f(0x120)](_0x55257f(0xc6))?console[_0x55257f(0x11a)](a5_0x5108d1[_0x55257f(0xeb)](_0x55257f(0xfe)+_0xdf923[_0x55257f(0xb6)])):console[_0x55257f(0x11a)](a5_0x5108d1[_0x55257f(0xeb)](_0x55257f(0x11e)+_0xdf923[_0x55257f(0xb6)]+_0x55257f(0x135)+_0x5a780d)),0x1;}let _0x75c312;if(!_0x552db3)try{_0x75c312=await setupEvaluatorAgent(_0x1b848a[_0x55257f(0xbe)],_0x198494['verbose']);}catch(_0x2a728f){const _0x5b9cbb=_0x2a728f instanceof Error?_0x2a728f[_0x55257f(0xb8)]:String(_0x2a728f);return console[_0x55257f(0x11a)](a5_0x5108d1[_0x55257f(0xeb)](_0x55257f(0x139)+_0x5b9cbb)),0x1;}console[_0x55257f(0x11a)](a5_0x5108d1[_0x55257f(0xe9)]('Running\x20agent\x20tests...')),console[_0x55257f(0x11a)](_0x55257f(0xc8)+a5_0x5108d1[_0x55257f(0xc5)](_0x598915)),console[_0x55257f(0x11a)](_0x55257f(0xbd)+a5_0x5108d1[_0x55257f(0xc5)](_0xdf923[_0x55257f(0x119)]+'/'+_0xdf923[_0x55257f(0xb6)])),console[_0x55257f(0x11a)]();const _0x50ecff=[],_0x46cdf9=[],_0x2afbb0=Date[_0x55257f(0x111)]();for(let _0x1ca47f=0x0;_0x1ca47f<_0x41a84b[_0x55257f(0x145)];_0x1ca47f++){const _0x31c5ab=_0x41a84b[_0x1ca47f];_0x41a84b[_0x55257f(0x145)]>0x1?console[_0x55257f(0x11a)](_0x55257f(0x114)+(_0x1ca47f+0x1)+'/'+_0x41a84b[_0x55257f(0x145)]+':\x20'+a5_0x5108d1[_0x55257f(0xc5)](_0x31c5ab['name'])):console[_0x55257f(0x11a)](_0x55257f(0x133)+a5_0x5108d1['white'](_0x31c5ab[_0x55257f(0xd2)]));const _0x116256=createCommandSpinner(_0x55257f(0x10f)+_0x31c5ab[_0x55257f(0x11d)][_0x55257f(0x145)]+_0x55257f(0xb5));_0x116256[_0x55257f(0x105)]();try{const {result:_0x424a3f,conversation:_0x4af4a6}=await runTest(_0x1b848a[_0x55257f(0xbe)],_0x31c5ab,{'agentId':_0x5ca8a0,'projectId':_0x433523,'site':_0x598915,'noEval':_0x552db3,'evaluatorId':_0x75c312,'onRoundStart':(_0x52bcbb,_0x4d52ce)=>{const _0x385124=_0x55257f;_0x116256[_0x385124(0x12d)]=_0x385124(0xff)+(_0x52bcbb+0x1)+'/'+_0x4d52ce+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x565d61,_0x37bccb,_0x1912dd)=>{const _0x372e71=_0x55257f,_0x2bee62=formatElapsed(_0x37bccb);_0x1912dd?console['log'](_0x372e71(0xe6)+(_0x565d61+0x1)+'/'+_0x31c5ab[_0x372e71(0x11d)][_0x372e71(0x145)]+_0x372e71(0xee)+a5_0x5108d1[_0x372e71(0xe7)]('✓')+'\x20('+_0x2bee62+')'):console[_0x372e71(0x11a)](_0x372e71(0xe6)+(_0x565d61+0x1)+'/'+_0x31c5ab[_0x372e71(0x11d)]['length']+_0x372e71(0xee)+a5_0x5108d1['red']('✗'));},'onEvaluationStart':()=>{const _0x114b2b=_0x55257f;_0x116256[_0x114b2b(0x12d)]='Evaluating\x20response...';},'onEvaluationComplete':_0x2fe0c8=>{const _0x395973=_0x55257f,_0x574047=formatElapsed(_0x2fe0c8);console[_0x395973(0x11a)]('\x20\x20Evaluating...\x20'+a5_0x5108d1['green']('✓')+'\x20('+_0x574047+')');}});_0x116256['stop'](),_0x50ecff[_0x55257f(0xb7)](_0x424a3f),_0x46cdf9[_0x55257f(0xb7)](_0x4af4a6);if(_0x424a3f['status']===_0x55257f(0x11b))console['log'](a5_0x5108d1['green'](_0x55257f(0xf7)+_0x424a3f[_0x55257f(0x140)]));else _0x424a3f['status']==='FAIL'?console[_0x55257f(0x11a)](a5_0x5108d1['red'](_0x55257f(0xc9)+_0x424a3f[_0x55257f(0x140)])):console[_0x55257f(0x11a)](a5_0x5108d1[_0x55257f(0xeb)](_0x55257f(0xc3)+_0x424a3f[_0x55257f(0x140)]));_0x424a3f[_0x55257f(0xf5)]&&console[_0x55257f(0x11a)](a5_0x5108d1['dim'](_0x55257f(0xbf)+_0x424a3f[_0x55257f(0xf5)])),console[_0x55257f(0x11a)]();}catch(_0x5116fe){_0x116256[_0x55257f(0x113)]();const _0x20d27b=_0x5116fe instanceof Error?_0x5116fe[_0x55257f(0xb8)]:String(_0x5116fe);console[_0x55257f(0x11a)](a5_0x5108d1[_0x55257f(0xeb)](_0x55257f(0xc3)+_0x20d27b)),console[_0x55257f(0x11a)](),_0x50ecff[_0x55257f(0xb7)]({'name':_0x31c5ab[_0x55257f(0xd2)],'status':_0x55257f(0x129),'reason':_0x20d27b,'timestamp':new Date()[_0x55257f(0xf3)](),'duration_ms':0x0});}}const _0x1e9800=Date['now']()-_0x2afbb0,_0x14bc59=_0x50ecff['filter'](_0x464d0e=>_0x464d0e[_0x55257f(0xcf)]===_0x55257f(0x11b))['length'],_0x375f8e=_0x50ecff['filter'](_0x54bd5a=>_0x54bd5a[_0x55257f(0xcf)]===_0x55257f(0xef))[_0x55257f(0x145)],_0x3fe2f1=_0x50ecff[_0x55257f(0xde)](_0x3b82bb=>_0x3b82bb['status']===_0x55257f(0x129))[_0x55257f(0x145)];console['log']('━'[_0x55257f(0x115)](0x3c)),console[_0x55257f(0x11a)](_0x55257f(0x134)),console[_0x55257f(0x11a)]('━'[_0x55257f(0x115)](0x3c)),console[_0x55257f(0x11a)](_0x55257f(0x100)+_0x50ecff[_0x55257f(0x145)]),console[_0x55257f(0x11a)](_0x55257f(0xd7)+a5_0x5108d1[_0x55257f(0xe7)](_0x14bc59)),console[_0x55257f(0x11a)]('Failed:\x20\x20\x20'+a5_0x5108d1[_0x55257f(0xeb)](_0x375f8e));_0x3fe2f1>0x0&&console[_0x55257f(0x11a)](_0x55257f(0xc4)+a5_0x5108d1[_0x55257f(0xeb)](_0x3fe2f1));console[_0x55257f(0x11a)](_0x55257f(0xc1)+formatElapsed(_0x1e9800)),console[_0x55257f(0x11a)]('━'[_0x55257f(0x115)](0x3c));const _0x464da5=_0x50ecff[_0x55257f(0xde)](_0x22695e=>_0x22695e[_0x55257f(0xcf)]!==_0x55257f(0x11b));if(_0x464da5[_0x55257f(0x145)]>0x0){console[_0x55257f(0x11a)](),console[_0x55257f(0x11a)](_0x55257f(0xbb));for(const _0x1aafa8 of _0x464da5){const _0x4b268f=a5_0x5108d1[_0x55257f(0xeb)]('✗'),_0x4de0a5=_0x1aafa8[_0x55257f(0x140)][_0x55257f(0x145)]>0x32?_0x1aafa8[_0x55257f(0x140)][_0x55257f(0xca)](0x0,0x32)+_0x55257f(0xe5):_0x1aafa8['reason'];console[_0x55257f(0x11a)]('\x20\x20'+_0x4b268f+'\x20'+_0x1aafa8[_0x55257f(0xd2)]+':\x20'+_0x4de0a5);}}const _0x251de3={'summary':{'total':_0x50ecff[_0x55257f(0x145)],'passed':_0x14bc59,'failed':_0x375f8e,'errors':_0x3fe2f1>0x0?_0x3fe2f1:undefined,'duration_ms':_0x1e9800},'tests':_0x50ecff,'agent':{'project':_0xdf923[_0x55257f(0x119)],'name':_0xdf923[_0x55257f(0xb6)],'site':_0x598915},'timestamp':new Date(_0x2afbb0)['toISOString']()};try{const _0x5150b=buildCachedTestRun(_0x46cdf9,{'site':_0x598915,'projectId':_0x433523,'projectName':_0xdf923[_0x55257f(0x119)],'agentId':_0x5ca8a0,'agentName':_0xdf923[_0x55257f(0xb6)],'testYmlPath':a5_0x2aad79[_0x55257f(0x11c)](_0xdf923[_0x55257f(0xe3)])});saveLastTestRun(_0x5150b);}catch{}if(_0x3f55b6!==_0x55257f(0xc0)||_0x577182){const _0x406695=formatResults(_0x251de3,_0x3f55b6);if(_0x577182)try{a5_0x2f367c['writeFileSync'](_0x577182,_0x406695,_0x55257f(0x118)),console[_0x55257f(0x11a)](),console[_0x55257f(0x11a)](a5_0x5108d1[_0x55257f(0x13c)](_0x55257f(0xe2)+_0x577182));}catch(_0x643f08){return console[_0x55257f(0x11a)](),console[_0x55257f(0x11a)](a5_0x5108d1[_0x55257f(0xeb)](_0x55257f(0xb4)+_0x643f08)),0x1;}else console[_0x55257f(0x11a)](),console['log'](_0x406695);}return _0x464da5[_0x55257f(0x145)]>0x0?0x1:0x0;}async[a5_0x413b26(0x108)](_0x256473,_0x2917bc){const _0x45b178=a5_0x413b26,{options:_0x53b759,tdx:_0x5d7128}=_0x256473,{definition:_0x596849,agentInfo:_0x587220,outputFormat:_0x165782,outputFile:_0x18c89a}=_0x2917bc,_0x3c9b2f=_0x53b759[_0x45b178(0xf1)],_0x1aca58=loadLastTestRun();if(!_0x1aca58)return console[_0x45b178(0x11a)](a5_0x5108d1[_0x45b178(0xeb)](_0x45b178(0x132))),console['log'](a5_0x5108d1[_0x45b178(0x13c)](_0x45b178(0xc2))),0x1;if(_0x1aca58[_0x45b178(0xfd)][_0x45b178(0xb6)]!==_0x587220['agentName'])return console[_0x45b178(0x11a)](a5_0x5108d1['red'](_0x45b178(0xf9)+_0x1aca58[_0x45b178(0xfd)][_0x45b178(0xb6)]+_0x45b178(0xb2)+_0x587220[_0x45b178(0xb6)]+'\x22.')),console['log'](a5_0x5108d1['dim'](_0x45b178(0xd9))),0x1;const _0x4c05c1=new Set(_0x1aca58['conversations'][_0x45b178(0xdf)](_0x293b56=>_0x293b56['testName'])),_0x157ae0=_0x596849['tests'][_0x45b178(0xde)](_0x1d8b48=>!_0x4c05c1[_0x45b178(0x13b)](_0x1d8b48[_0x45b178(0xd2)]));if(_0x157ae0[_0x45b178(0x145)]>0x0&&_0x1aca58['site']!==_0x3c9b2f)return console[_0x45b178(0x11a)](a5_0x5108d1[_0x45b178(0xeb)](_0x45b178(0xe4))),console[_0x45b178(0x11a)](a5_0x5108d1[_0x45b178(0x13c)](_0x45b178(0xf4)+_0x1aca58[_0x45b178(0xf1)]+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x3c9b2f+'\x22.')),console[_0x45b178(0x11a)](a5_0x5108d1[_0x45b178(0x13c)](_0x45b178(0xfa)+_0x1aca58[_0x45b178(0xf1)]+_0x45b178(0x104))),0x1;const _0x4ed328=_0x596849[_0x45b178(0x137)]['filter'](_0x919622=>_0x4c05c1[_0x45b178(0x13b)](_0x919622[_0x45b178(0xd2)])),_0x313f47=_0x157ae0;let _0x333432;try{_0x333432=await setupEvaluatorAgent(_0x5d7128[_0x45b178(0xbe)],_0x53b759['verbose']);}catch(_0x53671e){const _0x684445=_0x53671e instanceof Error?_0x53671e[_0x45b178(0xb8)]:String(_0x53671e);return console[_0x45b178(0x11a)](a5_0x5108d1[_0x45b178(0xeb)](_0x45b178(0x139)+_0x684445)),0x1;}console['log'](a5_0x5108d1[_0x45b178(0xe9)](_0x45b178(0xf8))),console[_0x45b178(0x11a)](_0x45b178(0xe0)+a5_0x5108d1[_0x45b178(0xc5)](_0x1aca58['timestamp'])),console[_0x45b178(0x11a)]('Agent:\x20'+a5_0x5108d1[_0x45b178(0xc5)](_0x1aca58[_0x45b178(0xfd)][_0x45b178(0x119)]+'/'+_0x1aca58[_0x45b178(0xfd)][_0x45b178(0xb6)]));_0x313f47[_0x45b178(0x145)]>0x0&&console[_0x45b178(0x11a)](_0x45b178(0xbc)+a5_0x5108d1[_0x45b178(0x107)](_0x313f47[_0x45b178(0x145)]));console[_0x45b178(0x11a)]();const _0x35054e=[],_0x5d4902=Date[_0x45b178(0x111)](),_0xe0bb7a=createCommandSpinner(_0x45b178(0x12a));if(_0x4ed328[_0x45b178(0x145)]>0x0)try{const _0x1db188=await reevaluateFromCache(_0x5d7128[_0x45b178(0xbe)],_0x1aca58,{'tests':_0x4ed328},{'evaluatorId':_0x333432,'onTestStart':(_0x263ae4,_0x34fe08,_0x1e5497)=>{const _0x255220=_0x45b178;_0xe0bb7a[_0x255220(0x12d)]=_0x255220(0xce)+(_0x34fe08+0x1)+'/'+_0x1e5497+':\x20'+_0x263ae4+_0x255220(0xe5);if(!_0xe0bb7a[_0x255220(0x10a)])_0xe0bb7a['start']();},'onTestComplete':(_0x37e8ab,_0x5ccffd)=>{const _0x8edb5f=_0x45b178;_0xe0bb7a[_0x8edb5f(0x113)]();if(_0x5ccffd[_0x8edb5f(0xcf)]===_0x8edb5f(0x11b))console[_0x8edb5f(0x11a)](a5_0x5108d1[_0x8edb5f(0xe7)]('✓\x20PASS:\x20'+_0x37e8ab)+a5_0x5108d1['dim'](_0x8edb5f(0x121)));else _0x5ccffd[_0x8edb5f(0xcf)]===_0x8edb5f(0xef)?console[_0x8edb5f(0x11a)](a5_0x5108d1[_0x8edb5f(0xeb)](_0x8edb5f(0xc9)+_0x37e8ab+_0x8edb5f(0x123)+_0x5ccffd[_0x8edb5f(0x140)])+a5_0x5108d1[_0x8edb5f(0x13c)](_0x8edb5f(0x121))):console['log'](a5_0x5108d1[_0x8edb5f(0xeb)](_0x8edb5f(0xc3)+_0x37e8ab+_0x8edb5f(0x123)+_0x5ccffd[_0x8edb5f(0x140)]));_0x5ccffd[_0x8edb5f(0xf5)]&&console[_0x8edb5f(0x11a)](a5_0x5108d1[_0x8edb5f(0x13c)]('\x20\x20Conversation:\x20'+_0x5ccffd[_0x8edb5f(0xf5)])),_0x35054e[_0x8edb5f(0xb7)](_0x5ccffd);},'onTestSkipped':(_0x35d096,_0x2db93c)=>{const _0x5da00e=_0x45b178;_0xe0bb7a[_0x5da00e(0x113)](),console[_0x5da00e(0x11a)](a5_0x5108d1['yellow'](_0x5da00e(0x13f)+_0x35d096+_0x5da00e(0x123)+_0x2db93c));}});for(const _0x4b6c3e of _0x1db188){!_0x35054e[_0x45b178(0x128)](_0x4d66cf=>_0x4d66cf['name']===_0x4b6c3e[_0x45b178(0xd2)])&&_0x35054e['push'](_0x4b6c3e);}}catch(_0x322317){_0xe0bb7a[_0x45b178(0x113)]();const _0x4e69ee=_0x322317 instanceof Error?_0x322317[_0x45b178(0xb8)]:String(_0x322317);return console[_0x45b178(0x11a)](a5_0x5108d1['red'](_0x45b178(0xd6)+_0x4e69ee)),0x1;}_0xe0bb7a['stop']();if(_0x313f47['length']>0x0){console[_0x45b178(0x11a)](),console[_0x45b178(0x11a)](a5_0x5108d1[_0x45b178(0xe9)](_0x45b178(0xec)));const {projectId:_0x4ad278,agentId:_0x3c6fc5}=_0x1aca58[_0x45b178(0xfd)];for(const _0x3a870b of _0x313f47){console[_0x45b178(0x11a)](_0x45b178(0xcc)+a5_0x5108d1[_0x45b178(0xc5)](_0x3a870b['name']));const _0x51d8b8=createCommandSpinner(_0x45b178(0x10f)+_0x3a870b[_0x45b178(0x11d)][_0x45b178(0x145)]+_0x45b178(0xb5));_0x51d8b8[_0x45b178(0x105)]();try{const {result:_0x502332}=await runTest(_0x5d7128[_0x45b178(0xbe)],_0x3a870b,{'agentId':_0x3c6fc5,'projectId':_0x4ad278,'site':_0x1aca58[_0x45b178(0xf1)],'noEval':![],'evaluatorId':_0x333432,'onRoundStart':(_0x53729f,_0x5adb5e)=>{const _0x264ea2=_0x45b178;_0x51d8b8['text']=_0x264ea2(0xff)+(_0x53729f+0x1)+'/'+_0x5adb5e+_0x264ea2(0xb5);},'onRoundComplete':(_0xb54d9f,_0x24d14c,_0x13b7cf)=>{const _0x11743a=_0x45b178,_0x4abaa7=formatElapsed(_0x24d14c);_0x13b7cf?console[_0x11743a(0x11a)](_0x11743a(0xe6)+(_0xb54d9f+0x1)+'/'+_0x3a870b['rounds'][_0x11743a(0x145)]+_0x11743a(0xee)+a5_0x5108d1[_0x11743a(0xe7)]('✓')+'\x20('+_0x4abaa7+')'):console[_0x11743a(0x11a)](_0x11743a(0xe6)+(_0xb54d9f+0x1)+'/'+_0x3a870b['rounds'][_0x11743a(0x145)]+_0x11743a(0xee)+a5_0x5108d1[_0x11743a(0xeb)]('✗'));},'onEvaluationStart':()=>{const _0x16cd04=_0x45b178;_0x51d8b8['text']=_0x16cd04(0xed);},'onEvaluationComplete':_0x76b002=>{const _0x4629cc=_0x45b178,_0x5b23df=formatElapsed(_0x76b002);console[_0x4629cc(0x11a)](_0x4629cc(0xdc)+a5_0x5108d1[_0x4629cc(0xe7)]('✓')+'\x20('+_0x5b23df+')');}});_0x51d8b8[_0x45b178(0x113)](),_0x35054e[_0x45b178(0xb7)](_0x502332);if(_0x502332[_0x45b178(0xcf)]===_0x45b178(0x11b))console[_0x45b178(0x11a)](a5_0x5108d1[_0x45b178(0xe7)](_0x45b178(0xf7)+_0x502332['reason'])+a5_0x5108d1['dim'](_0x45b178(0x110)));else _0x502332[_0x45b178(0xcf)]===_0x45b178(0xef)?console['log'](a5_0x5108d1[_0x45b178(0xeb)](_0x45b178(0xc9)+_0x502332['reason'])+a5_0x5108d1[_0x45b178(0x13c)]('\x20(new)')):console['log'](a5_0x5108d1[_0x45b178(0xeb)](_0x45b178(0xc3)+_0x502332[_0x45b178(0x140)]));_0x502332[_0x45b178(0xf5)]&&console['log'](a5_0x5108d1[_0x45b178(0x13c)](_0x45b178(0xda)+_0x502332[_0x45b178(0xf5)]));}catch(_0xfc300b){_0x51d8b8['stop']();const _0x746ba2=_0xfc300b instanceof Error?_0xfc300b[_0x45b178(0xb8)]:String(_0xfc300b);console['log'](a5_0x5108d1[_0x45b178(0xeb)](_0x45b178(0xc3)+_0x746ba2)),_0x35054e[_0x45b178(0xb7)]({'name':_0x3a870b[_0x45b178(0xd2)],'status':'ERROR','reason':_0x746ba2,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console[_0x45b178(0x11a)]();const _0x374a88=Date['now']()-_0x5d4902,_0x54be7b=_0x35054e['filter'](_0x2e9522=>_0x2e9522[_0x45b178(0xcf)]===_0x45b178(0x11b))['length'],_0x3221ea=_0x35054e['filter'](_0x3bcfa4=>_0x3bcfa4[_0x45b178(0xcf)]===_0x45b178(0xef))[_0x45b178(0x145)],_0x349b99=_0x35054e['filter'](_0x406b07=>_0x406b07[_0x45b178(0xcf)]===_0x45b178(0x129))[_0x45b178(0x145)];console[_0x45b178(0x11a)]('━'[_0x45b178(0x115)](0x3c)),console[_0x45b178(0x11a)](_0x45b178(0x130)),console[_0x45b178(0x11a)]('━'[_0x45b178(0x115)](0x3c)),console['log'](_0x45b178(0x100)+_0x35054e[_0x45b178(0x145)]),console['log'](_0x45b178(0xd7)+a5_0x5108d1[_0x45b178(0xe7)](_0x54be7b)),console['log'](_0x45b178(0xf2)+a5_0x5108d1[_0x45b178(0xeb)](_0x3221ea));_0x349b99>0x0&&console[_0x45b178(0x11a)](_0x45b178(0xc4)+a5_0x5108d1[_0x45b178(0xeb)](_0x349b99));console[_0x45b178(0x11a)]('Duration:\x20'+formatElapsed(_0x374a88)),console[_0x45b178(0x11a)]('━'[_0x45b178(0x115)](0x3c));const _0x11022c={'summary':{'total':_0x35054e[_0x45b178(0x145)],'passed':_0x54be7b,'failed':_0x3221ea,'errors':_0x349b99>0x0?_0x349b99:undefined,'duration_ms':_0x374a88},'tests':_0x35054e,'agent':{'project':_0x587220[_0x45b178(0x119)],'name':_0x587220[_0x45b178(0xb6)],'site':_0x3c9b2f},'timestamp':new Date(_0x5d4902)[_0x45b178(0xf3)]()};if(_0x165782!==_0x45b178(0xc0)||_0x18c89a){const _0x8b3c1=formatResults(_0x11022c,_0x165782);if(_0x18c89a)try{a5_0x2f367c['writeFileSync'](_0x18c89a,_0x8b3c1,_0x45b178(0x118)),console[_0x45b178(0x11a)](),console['log'](a5_0x5108d1[_0x45b178(0x13c)]('Output\x20written\x20to:\x20'+_0x18c89a));}catch(_0x465130){return console[_0x45b178(0x11a)](),console[_0x45b178(0x11a)](a5_0x5108d1[_0x45b178(0xeb)](_0x45b178(0xb4)+_0x465130)),0x1;}else console[_0x45b178(0x11a)](),console[_0x45b178(0x11a)](_0x8b3c1);}const _0xf7be01=_0x35054e['filter'](_0x35720e=>_0x35720e['status']!==_0x45b178(0x11b));return _0xf7be01[_0x45b178(0x145)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x7c45bb=a6_0x1c12;(function(_0x1b6798,_0xa7dad8){const _0x254971=a6_0x1c12,_0x51e74e=_0x1b6798();while(!![]){try{const _0x4a6f46=-parseInt(_0x254971(0x223))/0x1*(-parseInt(_0x254971(0x206))/0x2)+-parseInt(_0x254971(0x210))/0x3+-parseInt(_0x254971(0x225))/0x4+-parseInt(_0x254971(0x1ea))/0x5*(parseInt(_0x254971(0x214))/0x6)+-parseInt(_0x254971(0x205))/0x7+-parseInt(_0x254971(0x204))/0x8*(parseInt(_0x254971(0x221))/0x9)+-parseInt(_0x254971(0x1f8))/0xa*(-parseInt(_0x254971(0x1f2))/0xb);if(_0x4a6f46===_0xa7dad8)break;else _0x51e74e['push'](_0x51e74e['shift']());}catch(_0x462564){_0x51e74e['push'](_0x51e74e['shift']());}}}(a6_0x54c0,0x99f75));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x7c45bb(0x208),a6_0x7c45bb(0x203),'cookie',a6_0x7c45bb(0x211),a6_0x7c45bb(0x209),a6_0x7c45bb(0x1f0),a6_0x7c45bb(0x21c),a6_0x7c45bb(0x222)]);function a6_0x54c0(){const _0x51e601=['name','Invalid\x20HTTP\x20method:\x20','1912761HTVipZ','set-cookie','body','substring','6hetrsu','Endpoint\x20must\x20start\x20with\x20/:\x20','PUT','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','stack','toUpperCase','POST','length','x-auth-token','file','site','message','type','15471RBhnnZ','x-trino-user','93ITzuaK','llm','197908xFJWWB','readBodyFromFile','output','status','toLowerCase','Results\x20saved\x20to\x20','.\x20Valid\x20methods:\x20','has','3433505WRUyPk','entries','cdp','PATCH','verbose','validate','x-xsrf-token','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','99nwZmRn','<\x20HTTP/1.1\x20','startsWith','isArray','join','includes','2592130DSVrgB','api','GET','color','Invalid\x20header\x20format:\x20\x22','noColor','trino','header','description','Error:\x20','error','proxy-authorization','1200vwqwuT','972433CoGWbe','1468TIlrQz','data','authorization','set-cookie2','method','.\x20Valid\x20types:\x20','workflow','headers'];a6_0x54c0=function(){return _0x51e601;};return a6_0x54c0();}function a6_0x1c12(_0x4013f7,_0xabdad7){_0x4013f7=_0x4013f7-0x1e4;const _0x54c042=a6_0x54c0();let _0x1c127a=_0x54c042[_0x4013f7];return _0x1c127a;}function isSensitiveHeader(_0x4e21aa){const _0x626ef0=a6_0x7c45bb;return SENSITIVE_HEADERS[_0x626ef0(0x1e9)](_0x4e21aa[_0x626ef0(0x1e6)]());}function parseHeader(_0x2452a2){const _0x7afe98=a6_0x7c45bb,_0x3023cd=_0x2452a2['indexOf'](':');if(_0x3023cd===-0x1)throw new Error(_0x7afe98(0x1fc)+_0x2452a2+'\x22.\x20'+'Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22');const _0x1e4cc8=_0x2452a2[_0x7afe98(0x213)](0x0,_0x3023cd)['trim'](),_0x56d042=_0x2452a2[_0x7afe98(0x213)](_0x3023cd+0x1)['trim']();if(!_0x1e4cc8)throw new Error(_0x7afe98(0x217)+_0x2452a2+'\x22');return[_0x1e4cc8,_0x56d042];}export class ApiCommand extends BaseCommand{[a6_0x7c45bb(0x20e)]=a6_0x7c45bb(0x1f9);[a6_0x7c45bb(0x200)]=a6_0x7c45bb(0x1f1);[a6_0x7c45bb(0x1ef)](_0x4eeebb){const _0x43a721=a6_0x7c45bb,{args:_0x2a41d9,options:_0x1c825d}=_0x4eeebb,_0x1f84cc=_0x1c825d;if(_0x2a41d9[_0x43a721(0x21b)]===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x5a862f=_0x2a41d9[0x0];if(!_0x5a862f[_0x43a721(0x1f4)]('/'))return _0x43a721(0x215)+_0x5a862f;const _0x2f651a=_0x1f84cc[_0x43a721(0x207)],_0x3df99f=_0x1f84cc[_0x43a721(0x21d)];if(_0x2f651a&&_0x3df99f)return'Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.';const _0x2f4e78=_0x1f84cc[_0x43a721(0x20a)]||_0x43a721(0x1fa),_0x2759f4=['GET',_0x43a721(0x21a),_0x43a721(0x216),'DELETE',_0x43a721(0x1ed)];if(!_0x2759f4['includes'](_0x2f4e78[_0x43a721(0x219)]()))return _0x43a721(0x20f)+_0x2f4e78+_0x43a721(0x1e8)+_0x2759f4[_0x43a721(0x1f6)](',\x20');const _0x5ecb4f=_0x1f84cc['type']||'td',_0x5e44db=['td',_0x43a721(0x1ec),_0x43a721(0x20c),_0x43a721(0x1fe),_0x43a721(0x224),'llm-proxy'];if(!_0x5e44db[_0x43a721(0x1f7)](_0x5ecb4f))return'Invalid\x20API\x20type:\x20'+_0x5ecb4f+_0x43a721(0x20b)+_0x5e44db[_0x43a721(0x1f6)](',\x20');return undefined;}async['execute'](_0x510635){const _0x165050=a6_0x7c45bb,{options:_0x5ce589,args:_0x3dfed5,tdx:_0x4138e8}=_0x510635,_0x2994dc=_0x5ce589,_0x539190=_0x3dfed5[0x0],_0x1198ea=(_0x2994dc[_0x165050(0x20a)]||_0x165050(0x1fa))['toUpperCase'](),_0x43487b=_0x2994dc[_0x165050(0x207)],_0x1c262e=_0x2994dc[_0x165050(0x21d)],_0xfc8d97=_0x2994dc[_0x165050(0x1ff)],_0x20606a=_0x2994dc[_0x165050(0x220)]||'td';try{const _0x4c0532={};if(_0xfc8d97){const _0x31e6d6=Array[_0x165050(0x1f5)](_0xfc8d97)?_0xfc8d97:[_0xfc8d97];for(const _0x3e472c of _0x31e6d6){const [_0x56dc1f,_0x13f5da]=parseHeader(_0x3e472c);_0x4c0532[_0x56dc1f]=_0x13f5da;}}let _0x23608a;if(_0x43487b)_0x23608a=_0x43487b;else{if(_0x1c262e)try{_0x23608a=RawAPI[_0x165050(0x226)](_0x1c262e);}catch(_0xbad8ef){return console[_0x165050(0x202)](_0x165050(0x201)+(_0xbad8ef instanceof Error?_0xbad8ef[_0x165050(0x21f)]:String(_0xbad8ef))),0x1;}}const _0x47d28a={'method':_0x1198ea,'apiType':_0x20606a,'includeHeaders':_0x5ce589['verbose']};_0x23608a&&(_0x47d28a[_0x165050(0x212)]=_0x23608a);Object['keys'](_0x4c0532)[_0x165050(0x21b)]>0x0&&(_0x47d28a[_0x165050(0x20d)]=_0x4c0532);if(_0x5ce589[_0x165050(0x1ee)]){const _0x17ed69=resolveSite(_0x5ce589[_0x165050(0x21e)]),_0x49025b=getEndpoint(_0x17ed69,_0x20606a),_0x281bcf=''+_0x49025b+_0x539190;console[_0x165050(0x202)]('>\x20'+_0x1198ea+'\x20'+_0x281bcf);const _0x7a44fd=getAuthHeaders(_0x17ed69),_0x1c80e9={..._0x7a44fd,..._0x4c0532};for(const [_0x43d4e7,_0x47942f]of Object[_0x165050(0x1eb)](_0x1c80e9)){!isSensitiveHeader(_0x43d4e7)&&console[_0x165050(0x202)]('>\x20'+_0x43d4e7+':\x20'+_0x47942f);}_0x23608a&&console[_0x165050(0x202)]('>'),console[_0x165050(0x202)]('');}const _0x48ba08=await _0x4138e8[_0x165050(0x1f9)]['request'](_0x539190,_0x47d28a);if(_0x5ce589[_0x165050(0x1ee)]&&_0x48ba08[_0x165050(0x20d)]){console['error'](_0x165050(0x1f3)+_0x48ba08[_0x165050(0x1e5)]);for(const [_0x496508,_0x15a694]of Object[_0x165050(0x1eb)](_0x48ba08[_0x165050(0x20d)])){!isSensitiveHeader(_0x496508)&&console[_0x165050(0x202)]('<\x20'+_0x496508+':\x20'+_0x15a694);}console[_0x165050(0x202)]('');}const _0x261e10=Boolean(_0x5ce589['output']),_0x52b45c={'color':_0x5ce589[_0x165050(0x1fb)],'noColor':_0x5ce589[_0x165050(0x1fd)]||_0x261e10&&!_0x5ce589[_0x165050(0x1fb)]},_0x417c32=colorizeJSON(_0x48ba08['data'],_0x52b45c);return _0x5ce589['output']?(writeFileSync(_0x5ce589[_0x165050(0x1e4)],_0x417c32),console[_0x165050(0x202)](_0x165050(0x1e7)+_0x5ce589[_0x165050(0x1e4)])):console['log'](_0x417c32),0x0;}catch(_0x1cac57){return _0x1cac57 instanceof Error?(console[_0x165050(0x202)](_0x165050(0x201)+_0x1cac57[_0x165050(0x21f)]),_0x5ce589[_0x165050(0x1ee)]&&_0x1cac57['stack']&&console[_0x165050(0x202)]('\x0aStack\x20trace:\x0a'+_0x1cac57[_0x165050(0x218)])):console[_0x165050(0x202)](_0x165050(0x201)+String(_0x1cac57)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a7_0x40be05=a7_0x5544;(function(_0x4c623a,_0x2bac25){const _0x103b9f=a7_0x5544,_0x20baf9=_0x4c623a();while(!![]){try{const _0x26b945=-parseInt(_0x103b9f(0xfb))/0x1*(parseInt(_0x103b9f(0x12e))/0x2)+-parseInt(_0x103b9f(0x130))/0x3*(-parseInt(_0x103b9f(0x144))/0x4)+parseInt(_0x103b9f(0x10c))/0x5+parseInt(_0x103b9f(0x11a))/0x6+-parseInt(_0x103b9f(0x10a))/0x7+parseInt(_0x103b9f(0x115))/0x8+parseInt(_0x103b9f(0x134))/0x9*(parseInt(_0x103b9f(0x109))/0xa);if(_0x26b945===_0x2bac25)break;else _0x20baf9['push'](_0x20baf9['shift']());}catch(_0x43127b){_0x20baf9['push'](_0x20baf9['shift']());}}}(a7_0x3df2,0x41943));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{isOAuthSupported}from'../core/oauth.js';import{runOAuthLoginFlow}from'./auth-login-command.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x48c0ba from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';function a7_0x5544(_0x432e31,_0x2eeac3){_0x432e31=_0x432e31-0xfa;const _0x3df212=a7_0x3df2();let _0x5544e3=_0x3df212[_0x432e31];return _0x5544e3;}function a7_0x3df2(){const _0x358126=['\x0aSetup\x20cancelled','apiKey','tdx\x20profile:\x20','last_name','✓\x20Profile\x20\x27','4wSHSLF','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','Read\x20credential\x20from\x20keychain','first_name','error','auth','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','54929iAqMYS','join','execute','method','N/A','\x20(profile:\x20','Read\x20credential\x20from\x20','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','API\x20Key','No\x20credential\x20found','Setting\x20up\x20authentication\x20for\x20site:\x20','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','Remove\x20API\x20key\x20from\x20system\x20keychain','No\x20credentials\x20found\x20in\x20keychain','288990oflvVs','2177777sJeaHT','log','993680bHcHHw','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','site','ERROR','status','✓\x20Authentication\x20successful\x0a','\x20(site:\x20','name','Credential\x20type:\x20OAuth','495632oiFnCn','\x27\x20registered','auth:clear','API\x20key','Name:\x20','2385036VXoOYe','Choose\x20authentication\x20method:','red','User:\x20','\x20for\x20profile:\x20','email','trim','\x20removed\x20from\x20keychain','green','logLevel','getUserInfo','description','message','✓\x20Default\x20site\x20set\x20to\x20','jobs','apikey','password','filter','\x20and\x20','System\x20keychain\x20is\x20not\x20available','10nVUvNf','warn','415119krSmYs','✗\x20Validation\x20failed:\x20','OAuth\x20(browser\x20login)','auth:setup','18orRzQD','API\x20key\x20cannot\x20be\x20empty','bold','You\x20can\x20find\x20your\x20API\x20key\x20at:','\x20--profile\x20','Validating\x20API\x20key...','yellow','\x20\x20tdx','Setup\x20API\x20key\x20authentication\x20interactively','profile','select'];a7_0x3df2=function(){return _0x358126;};return a7_0x3df2();}import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a7_0x4b8d90 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x40be05(0x113)]=a7_0x40be05(0x133);[a7_0x40be05(0x125)]=a7_0x40be05(0x13c);async['execute'](_0x4580c3){const _0x2079d5=a7_0x40be05,{options:_0x418cc7}=_0x4580c3,_0x1b5507=_0x418cc7['profile'];console[_0x2079d5(0x10b)](a7_0x4b8d90[_0x2079d5(0x136)]('tdx:\x20auth\x20setup'));const _0x3c4713=_0x418cc7['site']||'us01',_0x35e943=await promptSiteSelection(_0x3c4713,_0x1b5507,'Setup\x20cancelled');if(!_0x35e943)return 0x1;const _0x146c8a=resolveSite(_0x35e943);if(isOAuthSupported(_0x146c8a)){const _0x32878e=await a7_0x48c0ba({'type':_0x2079d5(0x13e),'name':_0x2079d5(0xfe),'message':_0x2079d5(0x11b),'choices':[{'title':_0x2079d5(0x132),'value':'oauth'},{'title':_0x2079d5(0x103),'value':_0x2079d5(0x129)}]});if(!_0x32878e[_0x2079d5(0xfe)])return console[_0x2079d5(0x10b)](_0x2079d5(0x13f)),0x1;if(_0x32878e[_0x2079d5(0xfe)]==='oauth')return await runOAuthLoginFlow(_0x146c8a,_0x1b5507,_0x418cc7[_0x2079d5(0x123)]??LogLevel[_0x2079d5(0x10f)]),0x0;}console[_0x2079d5(0x10b)](_0x2079d5(0x105)+_0x146c8a),console['log'](_0x2079d5(0x137)),console[_0x2079d5(0x10b)]('\x20\x20'+getConsoleUrl(_0x146c8a,'/app/mp/ak'));const _0x307237=await a7_0x48c0ba({'type':_0x2079d5(0x12a),'name':_0x2079d5(0x140),'message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x28603b=>{const _0x4b2546=_0x2079d5;if(!_0x28603b||!_0x28603b[_0x4b2546(0x120)]())return _0x4b2546(0x135);return!![];}});if(!_0x307237['apiKey'])return console[_0x2079d5(0x10b)]('\x0aSetup\x20cancelled'),0x1;const _0x2a50e7=_0x307237[_0x2079d5(0x140)];console[_0x2079d5(0x10b)](_0x2079d5(0x139));try{const _0x47f456=TDX['create']({'site':_0x146c8a,'apiKey':_0x2a50e7['trim'](),'logLevel':_0x418cc7[_0x2079d5(0x123)]??LogLevel['ERROR']}),_0x1052d0=await _0x47f456[_0x2079d5(0x128)][_0x2079d5(0x124)]();console[_0x2079d5(0x10b)](_0x2079d5(0x14a)+_0x1052d0[_0x2079d5(0x11f)]+')');const _0x530383=await isKeychainAvailable();_0x530383?(await saveAPIKeyAsync(_0x2a50e7[_0x2079d5(0x120)](),_0x146c8a,_0x1b5507),console[_0x2079d5(0x10b)](_0x2079d5(0xfa)+(_0x1b5507?_0x2079d5(0x100)+_0x1b5507+')':''))):(console[_0x2079d5(0x12f)](a7_0x4b8d90[_0x2079d5(0x13a)](_0x2079d5(0x145))),console['warn'](a7_0x4b8d90['yellow'](_0x2079d5(0x10d))));if(_0x1b5507){const _0x5106cb={'site':_0x146c8a};saveProfileToUserConfig(_0x1b5507,_0x5106cb),console[_0x2079d5(0x10b)](_0x2079d5(0x143)+_0x1b5507+_0x2079d5(0x116));}else saveDefaultSiteToUserConfig(_0x146c8a),console[_0x2079d5(0x10b)](_0x2079d5(0x127)+_0x146c8a);const _0x4e7f3f=_0x1b5507?_0x2079d5(0x138)+_0x1b5507:'';return console[_0x2079d5(0x10b)](),console[_0x2079d5(0x10b)](_0x2079d5(0x102)),console['log'](_0x2079d5(0x13b)+_0x4e7f3f+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x2079d5(0x10b)](_0x2079d5(0x13b)+_0x4e7f3f+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x5bdba7){if(_0x5bdba7 instanceof HTTPClientError&&_0x5bdba7[_0x2079d5(0x110)]===0x191)return printAuthError(_0x5bdba7),0x1;return console[_0x2079d5(0x148)](a7_0x4b8d90[_0x2079d5(0x11c)](_0x2079d5(0x131)+(_0x5bdba7 instanceof Error?_0x5bdba7['message']:String(_0x5bdba7)))),console['error']('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']=a7_0x40be05(0x149);['description']=a7_0x40be05(0x106);async[a7_0x40be05(0xfd)](_0xc78a7){const _0xa9a608=a7_0x40be05,{options:_0x334a20,tdx:_0x32bbaf}=_0xc78a7,_0x55f1bb=_0x334a20[_0xa9a608(0x10e)],_0x2c3d3e=_0x334a20[_0xa9a608(0x13d)],_0x1816e9=_0x2c3d3e?_0x2c3d3e:_0xa9a608(0xff);console[_0xa9a608(0x10b)](_0xa9a608(0x141)+_0x1816e9+_0xa9a608(0x112)+_0x55f1bb+')');const _0x2154c0=await getOAuthTokens(_0x2c3d3e);if(_0x2154c0)console[_0xa9a608(0x10b)](_0xa9a608(0x114)),console[_0xa9a608(0x10b)](_0xa9a608(0x146)+(_0x2c3d3e?'\x20(profile:\x20'+_0x2c3d3e+')':''));else{const _0x14a999=await resolveAPIKeyAsync(_0x55f1bb,_0x2c3d3e);if(_0x14a999){const {source:_0x2b7f91,isDeprecated:_0x376ff6}=_0x14a999,_0x77aea9=_0xa9a608(0x101)+_0x2b7f91;console[_0xa9a608(0x10b)](_0x376ff6?a7_0x4b8d90['yellow'](_0x77aea9):_0x77aea9);}else console[_0xa9a608(0x10b)](a7_0x4b8d90[_0xa9a608(0x13a)](_0xa9a608(0x104)));}try{const _0x502499=await _0x32bbaf[_0xa9a608(0x128)][_0xa9a608(0x124)]();return console[_0xa9a608(0x10b)](a7_0x4b8d90[_0xa9a608(0x122)](_0xa9a608(0x111))),console[_0xa9a608(0x10b)](_0xa9a608(0x11d)+_0x502499[_0xa9a608(0x11f)]),(_0x502499[_0xa9a608(0x147)]||_0x502499[_0xa9a608(0x142)])&&console[_0xa9a608(0x10b)](_0xa9a608(0x119)+[_0x502499[_0xa9a608(0x147)],_0x502499[_0xa9a608(0x142)]][_0xa9a608(0x12b)](Boolean)['join']('\x20')),0x0;}catch(_0x433cbf){return _0x433cbf instanceof HTTPClientError&&_0x433cbf[_0xa9a608(0x110)]===0x191?printAuthError(_0x433cbf,!![],_0x2c3d3e):console[_0xa9a608(0x148)](a7_0x4b8d90[_0xa9a608(0x11c)](_0xa9a608(0x131)+(_0x433cbf instanceof Error?_0x433cbf[_0xa9a608(0x126)]:String(_0x433cbf)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x40be05(0x113)]=a7_0x40be05(0x117);['description']=a7_0x40be05(0x107);async[a7_0x40be05(0xfd)](_0x3bd63a){const _0x2a394e=a7_0x40be05,{options:_0x5210ac}=_0x3bd63a,_0x179b16=_0x5210ac[_0x2a394e(0x13d)];console[_0x2a394e(0x10b)](a7_0x4b8d90[_0x2a394e(0x136)]('tdx:\x20auth\x20clear'));const _0xfb5ed3=await isKeychainAvailable();if(!_0xfb5ed3)return console['error'](a7_0x4b8d90[_0x2a394e(0x11c)](_0x2a394e(0x12d))),0x1;const [_0x295985,_0x2b4fc0]=await Promise['all']([deleteKeychainAPIKey(_0x179b16),deleteOAuthTokens(_0x179b16)]);if(_0x295985||_0x2b4fc0){clearCredentialCache();const _0x5d170b=[_0x295985&&_0x2a394e(0x118),_0x2b4fc0&&'OAuth\x20tokens']['filter'](Boolean)[_0x2a394e(0xfc)](_0x2a394e(0x12c));return console['log']('✓\x20'+_0x5d170b+_0x2a394e(0x121)+(_0x179b16?_0x2a394e(0x100)+_0x179b16+')':'')),0x0;}else return console[_0x2a394e(0x10b)](_0x2a394e(0x108)+(_0x179b16?_0x2a394e(0x11e)+_0x179b16:'')),0x1;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a8_0x4fc511=a8_0x5777;(function(_0x444538,_0x56cd4c){const _0x8fdeb9=a8_0x5777,_0x14c1f4=_0x444538();while(!![]){try{const _0x1374c5=-parseInt(_0x8fdeb9(0x70))/0x1+-parseInt(_0x8fdeb9(0x80))/0x2*(-parseInt(_0x8fdeb9(0x93))/0x3)+parseInt(_0x8fdeb9(0x79))/0x4*(parseInt(_0x8fdeb9(0x7c))/0x5)+-parseInt(_0x8fdeb9(0x7b))/0x6+parseInt(_0x8fdeb9(0x8f))/0x7*(parseInt(_0x8fdeb9(0x87))/0x8)+-parseInt(_0x8fdeb9(0x8a))/0x9+parseInt(_0x8fdeb9(0x6f))/0xa;if(_0x1374c5===_0x56cd4c)break;else _0x14c1f4['push'](_0x14c1f4['shift']());}catch(_0xa910aa){_0x14c1f4['push'](_0x14c1f4['shift']());}}}(a8_0xb7fe,0xdf085));import{BaseCommand}from'./command.js';import{resolveSite}from'../core/config.js';import{saveProfileToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{isKeychainAvailable}from'../core/keychain.js';import{saveOAuthTokens}from'../core/oauth-keychain.js';import{startOAuthFlow,isOAuthSupported}from'../core/oauth.js';function a8_0xb7fe(){const _0x2de803=['6GvLHNW','\x20--profile\x20','logLevel','\x27\x20registered','17715320jURFkL','592621NUmEmR','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','Login\x20via\x20OAuth\x20(opens\x20browser)','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','tdx:\x20auth\x20login','OAuth\x20is\x20currently\x20supported\x20on\x20dev-us01\x20and\x20dev-eu01\x20only.\x20','bold','green','execute','4668208UDMVEd','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','6924678hbFOUJ','5quDMPs','log','Authenticating\x20via\x20OAuth\x20for\x20site:\x20','access_token','48496MfBTme','\x20(profile:\x20','OAuth\x20login\x20is\x20not\x20yet\x20available\x20for\x20site:\x20','email','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','✓\x20Profile\x20\x27','ERROR','344FluNnX','us01','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','5301558xmQNND','/oauth/authorize','create','profile','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','42693sMlufI','jobs','getUserInfo','auth:login'];a8_0xb7fe=function(){return _0x2de803;};return a8_0xb7fe();}import{promptSiteSelection}from'../core/constants.js';function a8_0x5777(_0x439ebd,_0x3df4bd){_0x439ebd=_0x439ebd-0x6e;const _0xb7fed8=a8_0xb7fe();let _0x5777d7=_0xb7fed8[_0x439ebd];return _0x5777d7;}import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a8_0x433fe2 from'chalk';export async function runOAuthLoginFlow(_0x54dc77,_0x581de9,_0x4d271b){const _0x400173=a8_0x5777;if(!isOAuthSupported(_0x54dc77))throw new Error(_0x400173(0x82)+_0x54dc77+'.\x20'+_0x400173(0x75)+_0x400173(0x7a));const _0x64c09a=await isKeychainAvailable();if(!_0x64c09a)throw new Error(_0x400173(0x89)+_0x400173(0x7a));const _0xe26d05=getConsoleUrl(_0x54dc77);console[_0x400173(0x7d)]('Opening\x20browser\x20for\x20authentication...'),console[_0x400173(0x7d)]('\x20\x20'+_0xe26d05+_0x400173(0x8b)),console['log'](_0x400173(0x71));const _0x53b2ab=await startOAuthFlow(_0x54dc77);console[_0x400173(0x7d)]('Validating\x20OAuth\x20tokens...');const _0x55940e=TDX[_0x400173(0x8c)]({'site':_0x54dc77,'accessToken':_0x53b2ab[_0x400173(0x7f)],'logLevel':_0x4d271b??LogLevel[_0x400173(0x86)]}),_0x1a1e85=await _0x55940e[_0x400173(0x90)][_0x400173(0x91)]();console[_0x400173(0x7d)](a8_0x433fe2[_0x400173(0x77)]('✓\x20Authentication\x20successful\x20(User:\x20'+_0x1a1e85[_0x400173(0x83)]+')')),await saveOAuthTokens(_0x53b2ab,_0x581de9),console[_0x400173(0x7d)]('✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain'+(_0x581de9?_0x400173(0x81)+_0x581de9+')':''));if(_0x581de9){const _0x3998ac={'site':_0x54dc77};saveProfileToUserConfig(_0x581de9,_0x3998ac),console[_0x400173(0x7d)](_0x400173(0x85)+_0x581de9+_0x400173(0x6e));}const _0x155640=_0x581de9?_0x400173(0x94)+_0x581de9:'';console['log'](),console[_0x400173(0x7d)](_0x400173(0x8e)),console[_0x400173(0x7d)]('\x20\x20tdx'+_0x155640+_0x400173(0x84)),console[_0x400173(0x7d)]('\x20\x20tdx'+_0x155640+_0x400173(0x73));}export class AuthLoginCommand extends BaseCommand{['name']=a8_0x4fc511(0x92);['description']=a8_0x4fc511(0x72);async[a8_0x4fc511(0x78)](_0x5b2ff9){const _0x3a9c70=a8_0x4fc511,{options:_0x254573}=_0x5b2ff9,_0x14ae5e=_0x254573[_0x3a9c70(0x8d)];console[_0x3a9c70(0x7d)](a8_0x433fe2[_0x3a9c70(0x76)](_0x3a9c70(0x74)));const _0x4b9262=_0x254573['site']||_0x3a9c70(0x88),_0x1288a2=await promptSiteSelection(_0x4b9262,_0x14ae5e,'Login\x20cancelled');if(!_0x1288a2)return 0x1;const _0x3d36a9=resolveSite(_0x1288a2);return console[_0x3a9c70(0x7d)](_0x3a9c70(0x7e)+_0x3d36a9),await runOAuthLoginFlow(_0x3d36a9,_0x14ae5e,_0x254573[_0x3a9c70(0x95)]??LogLevel[_0x3a9c70(0x86)]),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a9_0x2fbc0e=a9_0x58a9;(function(_0x597dfc,_0x5f001c){const _0x131dba=a9_0x58a9,_0x2a7c72=_0x597dfc();while(!![]){try{const _0x57a9f5=parseInt(_0x131dba(0x12c))/0x1*(-parseInt(_0x131dba(0x119))/0x2)+parseInt(_0x131dba(0x137))/0x3*(-parseInt(_0x131dba(0xf1))/0x4)+parseInt(_0x131dba(0x103))/0x5+parseInt(_0x131dba(0xfc))/0x6*(parseInt(_0x131dba(0x105))/0x7)+parseInt(_0x131dba(0x12e))/0x8*(-parseInt(_0x131dba(0x136))/0x9)+parseInt(_0x131dba(0x106))/0xa*(parseInt(_0x131dba(0x12f))/0xb)+-parseInt(_0x131dba(0x123))/0xc*(parseInt(_0x131dba(0xf4))/0xd);if(_0x57a9f5===_0x5f001c)break;else _0x2a7c72['push'](_0x2a7c72['shift']());}catch(_0x2acac6){_0x2a7c72['push'](_0x2a7c72['shift']());}}}(a9_0x29d8,0x308b3));import{BaseCommand}from'./command.js';function a9_0x58a9(_0x354d83,_0x2c4cd1){_0x354d83=_0x354d83-0xed;const _0x29d82f=a9_0x29d8();let _0x58a9ea=_0x29d82f[_0x354d83];return _0x58a9ea;}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';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x1d71bd,_0x2dffa9){const _0x25083f=a9_0x58a9;if(_0x1d71bd instanceof SDKError)console[_0x25083f(0x11f)]('Error:\x20'+_0x1d71bd['message']),_0x2dffa9['verbose']&&(_0x1d71bd[_0x25083f(0xf6)]&&console['error']('\x20\x20Cause:\x20'+_0x1d71bd['cause']),_0x1d71bd[_0x25083f(0x10b)]&&(console[_0x25083f(0x11f)]('\x0aStack\x20trace:'),console[_0x25083f(0x11f)](_0x1d71bd['stack'])));else throw _0x1d71bd;}async function resolveAgentId(_0xb6a98c,_0x6d12f2,_0x4e4118,_0x42f406,_0x5cd9d4){const _0x1a7ae1=a9_0x58a9,_0x1d5f12=_0x6d12f2||_0x4e4118;if(_0x1d5f12){const {projectName:_0x4e4ec5,agentName:_0x32dfac}=parseAgentRef(_0x1d5f12),_0x4329df=_0x32dfac||_0x1d5f12,_0x4b62fb=_0x32dfac?_0x4e4ec5:_0x42f406;if(!_0x4b62fb)throw new Error('No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22');if(_0x5cd9d4){const _0x5b7227=_0x6d12f2?_0x1a7ae1(0xfe):_0x1a7ae1(0x131);console[_0x1a7ae1(0x11f)]('Using\x20agent\x20from\x20'+_0x5b7227+':\x20'+_0x4b62fb+'/'+_0x4329df);}const _0x33b3e5=await withSpinner('Resolving\x20project\x20\x27'+_0x4b62fb+_0x1a7ae1(0x121),()=>_0xb6a98c[_0x1a7ae1(0x10f)][_0x1a7ae1(0xfa)](_0x4b62fb),{'verbose':_0x5cd9d4}),_0x1216d2=await withSpinner('Resolving\x20agent\x20\x27'+_0x4329df+_0x1a7ae1(0x121),()=>_0xb6a98c[_0x1a7ae1(0x10f)][_0x1a7ae1(0x11c)](_0x4329df,_0x33b3e5['data']),{'verbose':_0x5cd9d4});return _0x1216d2['data'];}else{const _0x1be0e8=_0xb6a98c[_0x1a7ae1(0x10f)]['getDefaultAgent']();if(_0x1be0e8)return _0x5cd9d4&&console['error']('Using\x20cached\x20default\x20agent:\x20'+_0x1be0e8['name']),_0x1be0e8['id'];const _0x3076f5=await withSpinner(_0x1a7ae1(0x135),()=>_0xb6a98c['llm'][_0x1a7ae1(0x126)](_0x1a7ae1(0xf3),0x0),{'verbose':_0x5cd9d4});return _0x3076f5[_0x1a7ae1(0x117)]['id'];}}function a9_0x29d8(){const _0x2bd07e=['startChat','options','includes','args','data','functionName','36xqROjt','name','agentId','resolveAgentId','slice','stream','error','write','\x27...','metadata','133368NFRbVa','stringify','CHAT_NOT_FOUND','getOrCreateDefaultAgent','agent','description','message','code','projectId','2265pCeQxZ','type','1784qTKGDG','3492313TFZNaP','llmAgent','session\x20context','streamChat','validate','site','Getting\x20default\x20agent...','15480vAUwYd','81evvQZX','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','\x0aError:\x20','tool_call','event','48908SjxAEl','Chat\x20session:\x20','claude-4.5-haiku','52ayHSVq','\x27\x20not\x20found','cause','tool','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','targetKnowledgeBase','resolveProjectId','execute','246AeqTCw','chat','--agent\x20flag','chatId','content','targetFunction','streamChatJsonl','1659040vIqlWu','verbose','59493wdUiQV','10vrFVlf','targetWebSearchTool','llmProject','Continuing\x20chat:\x20','stdout','stack','Create\x20a\x20new\x20chat\x20session','chat-create','tool_result','llm','context','404','log'];a9_0x29d8=function(){return _0x2bd07e;};return a9_0x29d8();}export class ChatCommand extends BaseCommand{[a9_0x2fbc0e(0x11a)]=a9_0x2fbc0e(0xfd);[a9_0x2fbc0e(0x128)]='Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)';[a9_0x2fbc0e(0x133)](_0x538c09){const _0x3c4ff5=a9_0x2fbc0e,_0x133618=_0x538c09[_0x3c4ff5(0x116)]['join']('\x20');if(!_0x133618)return _0x3c4ff5(0xf8);return undefined;}async['streamChat'](_0x53844a,_0x3c6d49,_0x4d7e0d,_0x5aa267,_0x142ca3){const _0x4db9cd=a9_0x2fbc0e;for await(const _0x5a7609 of _0x53844a[_0x4db9cd(0x10f)][_0x4db9cd(0xfd)](_0x3c6d49,{'agentId':_0x4d7e0d,'chatId':_0x5aa267})){if(_0x5a7609[_0x4db9cd(0x12d)]===_0x4db9cd(0x122)){const _0x53ca27=_0x5a7609[_0x4db9cd(0x117)][_0x4db9cd(0xff)];saveLastChatId(_0x53ca27),_0x142ca3&&console[_0x4db9cd(0x11f)](_0x4db9cd(0xf2)+_0x53ca27);}else _0x5a7609[_0x4db9cd(0x12d)]===_0x4db9cd(0xf0)&&this['handleChatEvent'](_0x5a7609[_0x4db9cd(0x117)]);}}async[a9_0x2fbc0e(0x102)](_0x3e9906,_0x789f5,_0x345b27,_0x26128d){const _0x2b5fb3=a9_0x2fbc0e,_0x59af59=_0x3e9906[_0x2b5fb3(0x110)][_0x2b5fb3(0x134)];let _0x5a3704=![];for await(const _0x171a5a of _0x3e9906[_0x2b5fb3(0x10f)][_0x2b5fb3(0xfd)](_0x789f5,{'agentId':_0x345b27,'chatId':_0x26128d})){if(_0x171a5a[_0x2b5fb3(0x12d)]===_0x2b5fb3(0x122)){const _0x9e942a=_0x171a5a[_0x2b5fb3(0x117)];saveLastChatId(_0x9e942a[_0x2b5fb3(0xff)]);const _0x29606c=_0x9e942a['projectId']&&_0x9e942a[_0x2b5fb3(0x11b)]?getLLMConversationUrl(_0x59af59,_0x9e942a[_0x2b5fb3(0x12b)],_0x9e942a[_0x2b5fb3(0x11b)],_0x9e942a[_0x2b5fb3(0xff)]):undefined;console[_0x2b5fb3(0x112)](JSON[_0x2b5fb3(0x124)]({'type':_0x2b5fb3(0x122),'data':{'chatId':_0x9e942a['chatId'],'agentId':_0x9e942a[_0x2b5fb3(0x11b)],'consoleUrl':_0x29606c}})),_0x5a3704=!![];}else{if(_0x171a5a['type']===_0x2b5fb3(0xf0)){!_0x5a3704&&_0x26128d&&(console[_0x2b5fb3(0x112)](JSON[_0x2b5fb3(0x124)]({'type':_0x2b5fb3(0x122),'data':{'chatId':_0x26128d}})),_0x5a3704=!![]);const _0x3adcbb=_0x171a5a[_0x2b5fb3(0x117)];if('content'in _0x3adcbb)console[_0x2b5fb3(0x112)](JSON[_0x2b5fb3(0x124)]({'type':_0x2b5fb3(0x100),'data':{'content':_0x3adcbb['content']}}));else{if(_0x2b5fb3(0xef)in _0x3adcbb){const _0x10b161=_0x3adcbb['tool_call'];console[_0x2b5fb3(0x112)](JSON['stringify']({'type':_0x2b5fb3(0xef),'data':{'id':_0x10b161['id'],'name':_0x10b161[_0x2b5fb3(0x118)],'target':_0x10b161[_0x2b5fb3(0xf9)]?.[_0x2b5fb3(0x11a)]||_0x10b161['targetAgent']?.[_0x2b5fb3(0x11a)]||_0x10b161[_0x2b5fb3(0x107)]?.[_0x2b5fb3(0x11a)]||_0x10b161[_0x2b5fb3(0x101)]}}));}else{if(_0x2b5fb3(0xf7)in _0x3adcbb)console[_0x2b5fb3(0x112)](JSON['stringify']({'type':_0x2b5fb3(0x10e),'data':{'id':_0x3adcbb[_0x2b5fb3(0xf7)]['id'],'name':_0x3adcbb[_0x2b5fb3(0xf7)][_0x2b5fb3(0x118)],'result':typeof _0x3adcbb['tool'][_0x2b5fb3(0x100)]==='string'?_0x3adcbb[_0x2b5fb3(0xf7)]['content'][_0x2b5fb3(0x11d)](0x0,0x1f4):''}}));else _0x2b5fb3(0x11f)in _0x3adcbb&&console[_0x2b5fb3(0x112)](JSON[_0x2b5fb3(0x124)]({'type':_0x2b5fb3(0x11f),'data':{'error':_0x3adcbb[_0x2b5fb3(0x11f)]}}));}}}}}console['log'](JSON[_0x2b5fb3(0x124)]({'type':'done'}));}async[a9_0x2fbc0e(0xfb)](_0x338017){const _0x4fe6d4=a9_0x2fbc0e,{options:_0x17da2b,args:_0xb7b4d4,tdx:_0x415691}=_0x338017,_0x489269=_0xb7b4d4['join']('\x20'),_0x48bfb4=_0x17da2b,_0x36df0f=_0x48bfb4['agent'],_0x571f88=_0x48bfb4['llmAgent'],_0x3cdac9=_0x48bfb4[_0x4fe6d4(0x108)],_0x1bebbb=_0x48bfb4['new'],_0x1fae32=_0x48bfb4['chatId'],_0x234107=_0x48bfb4[_0x4fe6d4(0x11e)];if(_0x1bebbb&&_0x1fae32)return console[_0x4fe6d4(0x11f)]('Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together'),0x1;try{let _0x156239,_0x3c4ae9;if(_0x1fae32)_0x3c4ae9=_0x1fae32;else!_0x1bebbb&&(_0x3c4ae9=loadLastChatId(),_0x3c4ae9&&_0x17da2b['verbose']&&console['error'](_0x4fe6d4(0x109)+_0x3c4ae9));!_0x1fae32&&(_0x1bebbb||!_0x3c4ae9)&&(_0x156239=await resolveAgentId(_0x415691,_0x36df0f,_0x571f88,_0x3cdac9,_0x17da2b[_0x4fe6d4(0x104)]));const _0x359848=_0x234107?(_0x2be6f3,_0x596b63,_0x5d0e46)=>this['streamChatJsonl'](_0x415691,_0x2be6f3,_0x596b63,_0x5d0e46):(_0x23e6ca,_0x28ea3a,_0x31b275)=>this[_0x4fe6d4(0x132)](_0x415691,_0x23e6ca,_0x28ea3a,_0x31b275,_0x17da2b[_0x4fe6d4(0x104)]);try{await _0x359848(_0x489269,_0x156239,_0x3c4ae9);}catch(_0x209c54){const _0x2207d8=_0x209c54 instanceof SDKError&&_0x209c54[_0x4fe6d4(0x12a)]===ErrorCode[_0x4fe6d4(0x125)]||_0x209c54 instanceof Error&&_0x209c54[_0x4fe6d4(0x129)][_0x4fe6d4(0x115)](_0x4fe6d4(0x111));if(_0x2207d8&&_0x1fae32)return console[_0x4fe6d4(0x11f)]('Error:\x20Chat\x20session\x20\x27'+_0x1fae32+_0x4fe6d4(0xf5)),0x1;if(_0x2207d8)_0x17da2b[_0x4fe6d4(0x104)]&&console['error']('Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...'),!_0x156239&&(_0x156239=await resolveAgentId(_0x415691,_0x36df0f,_0x571f88,_0x3cdac9,_0x17da2b[_0x4fe6d4(0x104)])),await _0x359848(_0x489269,_0x156239,undefined);else throw _0x209c54;}return!_0x234107&&console[_0x4fe6d4(0x112)](),0x0;}catch(_0x27e759){return console[_0x4fe6d4(0x11f)](),handleSDKError(_0x27e759,_0x17da2b),0x1;}}['handleChatEvent'](_0xbf2480){const _0x278347=a9_0x2fbc0e;if(_0x278347(0x100)in _0xbf2480)process[_0x278347(0x10a)][_0x278347(0x120)](_0xbf2480[_0x278347(0x100)]);else _0x278347(0x11f)in _0xbf2480&&console[_0x278347(0x11f)](_0x278347(0xee)+_0xbf2480[_0x278347(0x11f)]);}}export class ChatCreateCommand extends BaseCommand{[a9_0x2fbc0e(0x11a)]=a9_0x2fbc0e(0x10d);[a9_0x2fbc0e(0x128)]=a9_0x2fbc0e(0x10c);['validate'](_0x27f963){const _0x1f59bd=a9_0x2fbc0e,_0x206254=_0x27f963[_0x1f59bd(0x114)],_0x1ae7af=_0x206254[_0x1f59bd(0x127)],_0x33e227=_0x206254['llmAgent'];if(!_0x1ae7af&&!_0x33e227)return _0x1f59bd(0xed);return undefined;}async['execute'](_0x3df264){const _0xea8dbb=a9_0x2fbc0e,{options:_0x684101,tdx:_0x4f77f3}=_0x3df264,_0x23c782=_0x684101,_0x4bb90b=_0x23c782[_0xea8dbb(0x127)],_0x474bf2=_0x23c782[_0xea8dbb(0x130)],_0x5727b0=_0x23c782[_0xea8dbb(0x108)];try{const _0x5442da=await resolveAgentId(_0x4f77f3,_0x4bb90b,_0x474bf2,_0x5727b0,_0x684101[_0xea8dbb(0x104)]),_0x275898=await _0x4f77f3[_0xea8dbb(0x10f)][_0xea8dbb(0x113)](_0x5442da);return saveLastChatId(_0x275898['id']),console['log'](JSON[_0xea8dbb(0x124)]({'chatId':_0x275898['id'],'agentId':_0x5442da})),0x0;}catch(_0x324254){return handleSDKError(_0x324254,_0x684101),0x1;}}}
|
|
1
|
+
const a9_0x5aa7bf=a9_0x580a;function a9_0x580a(_0x303908,_0xffe118){_0x303908=_0x303908-0x1ea;const _0x4ae62d=a9_0x4ae6();let _0x580a46=_0x4ae62d[_0x303908];return _0x580a46;}(function(_0x2c49a3,_0x32551a){const _0x4eed64=a9_0x580a,_0x4e040a=_0x2c49a3();while(!![]){try{const _0x45fe7a=-parseInt(_0x4eed64(0x204))/0x1+-parseInt(_0x4eed64(0x1ed))/0x2+parseInt(_0x4eed64(0x229))/0x3*(-parseInt(_0x4eed64(0x210))/0x4)+parseInt(_0x4eed64(0x224))/0x5+parseInt(_0x4eed64(0x228))/0x6*(parseInt(_0x4eed64(0x225))/0x7)+-parseInt(_0x4eed64(0x21a))/0x8*(parseInt(_0x4eed64(0x1f3))/0x9)+parseInt(_0x4eed64(0x1f5))/0xa;if(_0x45fe7a===_0x32551a)break;else _0x4e040a['push'](_0x4e040a['shift']());}catch(_0x229a95){_0x4e040a['push'](_0x4e040a['shift']());}}}(a9_0x4ae6,0x91222));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';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x11487c,_0x1526f4){const _0x287c23=a9_0x580a;if(_0x11487c instanceof SDKError)console[_0x287c23(0x214)](_0x287c23(0x223)+_0x11487c[_0x287c23(0x211)]),_0x1526f4[_0x287c23(0x1f8)]&&(_0x11487c[_0x287c23(0x219)]&&console['error']('\x20\x20Cause:\x20'+_0x11487c[_0x287c23(0x219)]),_0x11487c[_0x287c23(0x201)]&&(console[_0x287c23(0x214)](_0x287c23(0x207)),console[_0x287c23(0x214)](_0x11487c[_0x287c23(0x201)])));else throw _0x11487c;}function a9_0x4ae6(){const _0x1cf5d9=['claude-4.5-haiku','Resolving\x20project\x20\x27','error','Using\x20cached\x20default\x20agent:\x20','startChat','getOrCreateDefaultAgent','data','cause','40TIDCDc','options','chat','targetWebSearchTool','Using\x20agent\x20from\x20','execute','done','agent','Continuing\x20chat:\x20','Error:\x20','4744725fqTdsk','805mJqCIM','CHAT_NOT_FOUND','metadata','6792kXsTCD','1160142mejMIE','tool_call','validate','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','handleChatEvent','resolveProjectId','llmAgent','2319204ZAXFTC','llmProject','projectId','llm','chatId','includes','139896RXSmPS','site','13485290KIHmQa','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','content','verbose','\x0aError:\x20','\x27...','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','context','event','log','write','session\x20context','stack','Resolving\x20agent\x20\x27','type','209152CUysTe','Chat\x20session:\x20','stringify','\x0aStack\x20trace:','name','agentId','Error:\x20Chat\x20session\x20\x27','tool','args','stream','description','streamChat','4CSGPAI','message'];a9_0x4ae6=function(){return _0x1cf5d9;};return a9_0x4ae6();}async function resolveAgentId(_0x1260ad,_0x1653a8,_0x8a6e0d,_0x375721,_0x4b74cf){const _0x4d1a88=a9_0x580a,_0x1e71b8=_0x1653a8||_0x8a6e0d;if(_0x1e71b8){const {projectName:_0x50524e,agentName:_0x27fda8}=parseAgentRef(_0x1e71b8),_0x4fc043=_0x27fda8||_0x1e71b8,_0x1b494f=_0x27fda8?_0x50524e:_0x375721;if(!_0x1b494f)throw new Error('No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22');if(_0x4b74cf){const _0x196acf=_0x1653a8?'--agent\x20flag':_0x4d1a88(0x200);console[_0x4d1a88(0x214)](_0x4d1a88(0x21e)+_0x196acf+':\x20'+_0x1b494f+'/'+_0x4fc043);}const _0x48e87b=await withSpinner(_0x4d1a88(0x213)+_0x1b494f+'\x27...',()=>_0x1260ad[_0x4d1a88(0x1f0)][_0x4d1a88(0x1eb)](_0x1b494f),{'verbose':_0x4b74cf}),_0x51b329=await withSpinner(_0x4d1a88(0x202)+_0x4fc043+_0x4d1a88(0x1fa),()=>_0x1260ad['llm']['resolveAgentId'](_0x4fc043,_0x48e87b[_0x4d1a88(0x218)]),{'verbose':_0x4b74cf});return _0x51b329['data'];}else{const _0x10baa4=_0x1260ad[_0x4d1a88(0x1f0)]['getDefaultAgent']();if(_0x10baa4)return _0x4b74cf&&console['error'](_0x4d1a88(0x215)+_0x10baa4[_0x4d1a88(0x208)]),_0x10baa4['id'];const _0x405aa5=await withSpinner('Getting\x20default\x20agent...',()=>_0x1260ad['llm'][_0x4d1a88(0x217)](_0x4d1a88(0x212),0x0),{'verbose':_0x4b74cf});return _0x405aa5[_0x4d1a88(0x218)]['id'];}}export class ChatCommand extends BaseCommand{[a9_0x5aa7bf(0x208)]='chat';[a9_0x5aa7bf(0x20e)]=a9_0x5aa7bf(0x1f6);[a9_0x5aa7bf(0x22b)](_0x3b41e5){const _0x593231=a9_0x5aa7bf,_0x52dfe8=_0x3b41e5[_0x593231(0x20c)]['join']('\x20');if(!_0x52dfe8)return'Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options';return undefined;}async['streamChat'](_0x114714,_0xd74385,_0x3c604b,_0x26168f,_0x5eb6d9){const _0x2428a3=a9_0x5aa7bf;for await(const _0x6a039c of _0x114714['llm']['chat'](_0xd74385,{'agentId':_0x3c604b,'chatId':_0x26168f})){if(_0x6a039c[_0x2428a3(0x203)]===_0x2428a3(0x227)){const _0x5a121c=_0x6a039c['data'][_0x2428a3(0x1f1)];saveLastChatId(_0x5a121c),_0x5eb6d9&&console[_0x2428a3(0x214)](_0x2428a3(0x205)+_0x5a121c);}else _0x6a039c[_0x2428a3(0x203)]===_0x2428a3(0x1fd)&&this[_0x2428a3(0x1ea)](_0x6a039c[_0x2428a3(0x218)]);}}async['streamChatJsonl'](_0x309eaa,_0x2e94ad,_0x18d536,_0x2b2e1a){const _0x501206=a9_0x5aa7bf,_0x7b3ee1=_0x309eaa[_0x501206(0x1fc)][_0x501206(0x1f4)];let _0x4fefd2=![];for await(const _0x2f3fbe of _0x309eaa[_0x501206(0x1f0)][_0x501206(0x21c)](_0x2e94ad,{'agentId':_0x18d536,'chatId':_0x2b2e1a})){if(_0x2f3fbe['type']===_0x501206(0x227)){const _0x24e289=_0x2f3fbe['data'];saveLastChatId(_0x24e289[_0x501206(0x1f1)]);const _0x1f7322=_0x24e289[_0x501206(0x1ef)]&&_0x24e289[_0x501206(0x209)]?getLLMConversationUrl(_0x7b3ee1,_0x24e289[_0x501206(0x1ef)],_0x24e289[_0x501206(0x209)],_0x24e289[_0x501206(0x1f1)]):undefined;console[_0x501206(0x1fe)](JSON[_0x501206(0x206)]({'type':'metadata','data':{'chatId':_0x24e289[_0x501206(0x1f1)],'agentId':_0x24e289[_0x501206(0x209)],'consoleUrl':_0x1f7322}})),_0x4fefd2=!![];}else{if(_0x2f3fbe[_0x501206(0x203)]===_0x501206(0x1fd)){!_0x4fefd2&&_0x2b2e1a&&(console[_0x501206(0x1fe)](JSON[_0x501206(0x206)]({'type':_0x501206(0x227),'data':{'chatId':_0x2b2e1a}})),_0x4fefd2=!![]);const _0x2edb46=_0x2f3fbe[_0x501206(0x218)];if('content'in _0x2edb46)console[_0x501206(0x1fe)](JSON[_0x501206(0x206)]({'type':_0x501206(0x1f7),'data':{'content':_0x2edb46[_0x501206(0x1f7)]}}));else{if(_0x501206(0x22a)in _0x2edb46){const _0x5de98c=_0x2edb46['tool_call'];console['log'](JSON[_0x501206(0x206)]({'type':_0x501206(0x22a),'data':{'id':_0x5de98c['id'],'name':_0x5de98c['functionName'],'target':_0x5de98c['targetKnowledgeBase']?.[_0x501206(0x208)]||_0x5de98c['targetAgent']?.['name']||_0x5de98c[_0x501206(0x21d)]?.['name']||_0x5de98c['targetFunction']}}));}else{if(_0x501206(0x20b)in _0x2edb46)console['log'](JSON['stringify']({'type':'tool_result','data':{'id':_0x2edb46[_0x501206(0x20b)]['id'],'name':_0x2edb46['tool']['functionName'],'result':typeof _0x2edb46[_0x501206(0x20b)][_0x501206(0x1f7)]==='string'?_0x2edb46[_0x501206(0x20b)][_0x501206(0x1f7)]['slice'](0x0,0x1f4):''}}));else _0x501206(0x214)in _0x2edb46&&console[_0x501206(0x1fe)](JSON[_0x501206(0x206)]({'type':_0x501206(0x214),'data':{'error':_0x2edb46[_0x501206(0x214)]}}));}}}}}console[_0x501206(0x1fe)](JSON[_0x501206(0x206)]({'type':_0x501206(0x220)}));}async[a9_0x5aa7bf(0x21f)](_0x39674b){const _0xbfc228=a9_0x5aa7bf,{options:_0x454483,args:_0x1bc31d,tdx:_0x1f7e3c}=_0x39674b,_0x2eba82=_0x1bc31d['join']('\x20'),_0x32edc1=_0x454483,_0x208bc8=_0x32edc1[_0xbfc228(0x221)],_0x37dd92=_0x32edc1[_0xbfc228(0x1ec)],_0x1face9=_0x32edc1[_0xbfc228(0x1ee)],_0x52d955=_0x32edc1['new'],_0x1fef89=_0x32edc1['chatId'],_0x341a19=_0x32edc1[_0xbfc228(0x20d)];if(_0x52d955&&_0x1fef89)return console[_0xbfc228(0x214)]('Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together'),0x1;try{let _0x47e8c0,_0x28dcd8;if(_0x1fef89)_0x28dcd8=_0x1fef89;else!_0x52d955&&(_0x28dcd8=loadLastChatId(),_0x28dcd8&&_0x454483['verbose']&&console['error'](_0xbfc228(0x222)+_0x28dcd8));!_0x1fef89&&(_0x52d955||!_0x28dcd8)&&(_0x47e8c0=await resolveAgentId(_0x1f7e3c,_0x208bc8,_0x37dd92,_0x1face9,_0x454483[_0xbfc228(0x1f8)]));const _0x3a7134=_0x341a19?(_0x49b3a1,_0xba3143,_0x11ab32)=>this['streamChatJsonl'](_0x1f7e3c,_0x49b3a1,_0xba3143,_0x11ab32):(_0x255b86,_0x1a361c,_0x1ea5f8)=>this[_0xbfc228(0x20f)](_0x1f7e3c,_0x255b86,_0x1a361c,_0x1ea5f8,_0x454483[_0xbfc228(0x1f8)]);try{await _0x3a7134(_0x2eba82,_0x47e8c0,_0x28dcd8);}catch(_0x1f3bd4){const _0x3fd4e6=_0x1f3bd4 instanceof SDKError&&_0x1f3bd4['code']===ErrorCode[_0xbfc228(0x226)]||_0x1f3bd4 instanceof Error&&_0x1f3bd4[_0xbfc228(0x211)][_0xbfc228(0x1f2)]('404');if(_0x3fd4e6&&_0x1fef89)return console[_0xbfc228(0x214)](_0xbfc228(0x20a)+_0x1fef89+'\x27\x20not\x20found'),0x1;if(_0x3fd4e6)_0x454483[_0xbfc228(0x1f8)]&&console[_0xbfc228(0x214)](_0xbfc228(0x22c)),!_0x47e8c0&&(_0x47e8c0=await resolveAgentId(_0x1f7e3c,_0x208bc8,_0x37dd92,_0x1face9,_0x454483[_0xbfc228(0x1f8)])),await _0x3a7134(_0x2eba82,_0x47e8c0,undefined);else throw _0x1f3bd4;}return!_0x341a19&&console[_0xbfc228(0x1fe)](),0x0;}catch(_0x78f1c4){return console[_0xbfc228(0x214)](),handleSDKError(_0x78f1c4,_0x454483),0x1;}}['handleChatEvent'](_0x5c4ec4){const _0xb7d1a6=a9_0x5aa7bf;if('content'in _0x5c4ec4)process['stdout'][_0xb7d1a6(0x1ff)](_0x5c4ec4[_0xb7d1a6(0x1f7)]);else'error'in _0x5c4ec4&&console[_0xb7d1a6(0x214)](_0xb7d1a6(0x1f9)+_0x5c4ec4['error']);}}export class ChatCreateCommand extends BaseCommand{[a9_0x5aa7bf(0x208)]='chat-create';[a9_0x5aa7bf(0x20e)]='Create\x20a\x20new\x20chat\x20session';['validate'](_0x47f4a4){const _0x472e4a=a9_0x5aa7bf,_0x151a04=_0x47f4a4[_0x472e4a(0x21b)],_0xa29213=_0x151a04[_0x472e4a(0x221)],_0x25e5eb=_0x151a04[_0x472e4a(0x1ec)];if(!_0xa29213&&!_0x25e5eb)return _0x472e4a(0x1fb);return undefined;}async[a9_0x5aa7bf(0x21f)](_0x282352){const _0x561038=a9_0x5aa7bf,{options:_0x42677f,tdx:_0x497410}=_0x282352,_0xa2fa75=_0x42677f,_0x5c2ede=_0xa2fa75['agent'],_0x3fee3e=_0xa2fa75[_0x561038(0x1ec)],_0x1f16ac=_0xa2fa75[_0x561038(0x1ee)];try{const _0x19090c=await resolveAgentId(_0x497410,_0x5c2ede,_0x3fee3e,_0x1f16ac,_0x42677f['verbose']),_0x31588e=await _0x497410['llm'][_0x561038(0x216)](_0x19090c);return saveLastChatId(_0x31588e['id']),console[_0x561038(0x1fe)](JSON[_0x561038(0x206)]({'chatId':_0x31588e['id'],'agentId':_0x19090c})),0x0;}catch(_0x279ec3){return handleSDKError(_0x279ec3,_0x42677f),0x1;}}}
|