@treasuredata/tdx 2026.3.9 → 2026.3.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.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/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.d.ts.map +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/commands/workflow-command.js.map +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.d.ts +2 -0
- package/dist/sdk/errors.d.ts.map +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/errors.js.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- 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.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/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.d.ts +12 -0
- package/dist/sdk/workflow/index.d.ts.map +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/index.js.map +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_0x40b9c1=a4_0x51a1;(function(_0x597529,_0x2b9a49){const _0x320714=a4_0x51a1,_0x4e5824=_0x597529();while(!![]){try{const _0x54ddee=parseInt(_0x320714(0x10e))/0x1*(parseInt(_0x320714(0x147))/0x2)+parseInt(_0x320714(0xb3))/0x3*(-parseInt(_0x320714(0x158))/0x4)+-parseInt(_0x320714(0x14e))/0x5*(-parseInt(_0x320714(0xb1))/0x6)+parseInt(_0x320714(0xa6))/0x7*(-parseInt(_0x320714(0xa9))/0x8)+-parseInt(_0x320714(0xdb))/0x9*(-parseInt(_0x320714(0x116))/0xa)+-parseInt(_0x320714(0x135))/0xb*(-parseInt(_0x320714(0x11d))/0xc)+-parseInt(_0x320714(0xf5))/0xd*(parseInt(_0x320714(0x152))/0xe);if(_0x54ddee===_0x2b9a49)break;else _0x4e5824['push'](_0x4e5824['shift']());}catch(_0x1c1ce6){_0x4e5824['push'](_0x4e5824['shift']());}}}(a4_0x5b32,0x6c579));import a4_0x3397c1 from'chalk';import a4_0x2d596d from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,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(_0x205ae6){const _0x29890f=a4_0x51a1,_0x54481d=[];if(_0x205ae6[_0x29890f(0x13c)]!==undefined)_0x54481d[_0x29890f(0xbc)](_0x205ae6[_0x29890f(0x13c)]+_0x29890f(0xb5));if(_0x205ae6[_0x29890f(0x157)]!==undefined&&_0x205ae6[_0x29890f(0x157)]>0x0)_0x54481d['push'](a4_0x3397c1[_0x29890f(0xb9)](_0x205ae6[_0x29890f(0x157)]+_0x29890f(0xf9)));if(_0x205ae6[_0x29890f(0x102)]!==undefined&&_0x205ae6[_0x29890f(0x102)]>0x0)_0x54481d[_0x29890f(0xbc)](a4_0x3397c1[_0x29890f(0xb9)](_0x205ae6[_0x29890f(0x102)]+_0x29890f(0xd6)));if(_0x205ae6[_0x29890f(0x112)]!==undefined&&_0x205ae6['updated']>0x0)_0x54481d[_0x29890f(0xbc)](a4_0x3397c1[_0x29890f(0x137)](_0x205ae6['updated']+_0x29890f(0x140)));if(_0x205ae6['unchanged']!==undefined&&_0x205ae6[_0x29890f(0x13d)]>0x0)_0x54481d['push'](a4_0x3397c1[_0x29890f(0x150)](_0x205ae6[_0x29890f(0x13d)]+_0x29890f(0x11c)));if(_0x205ae6[_0x29890f(0xb4)]!==undefined&&_0x205ae6[_0x29890f(0xb4)]>0x0)_0x54481d[_0x29890f(0xbc)](a4_0x3397c1['red'](_0x205ae6[_0x29890f(0xb4)]+'\x20errors'));return _0x54481d[_0x29890f(0xcd)](',\x20');}function a4_0x5b32(){const _0x142ad0=['description','-\x20no\x20files\x20written','llmProject','\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','isNew','session','agent:pull','join','cwd-config','red','profile','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','Using\x20current\x20project:\x20','reason','llm','execute','\x20created','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','Cloning\x20\x22','no_context','9LpbytD','\x20\x20Text\x20Knowledge\x20Bases:\x20','No\x20tdx.json\x20found\x20in\x20','\x0aWrite\x20','action','log','\x0aPush\x20summary\x20for\x20\x27','\x0a✔\x20Pulled\x20','\x22\x20to\x20new\x20project\x20\x22','\x0aChanges\x20to\x20prompt\x20\x27','force','prompts','\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\x20Prompt\x20\x22','hasChanges','<new-name>','cyan','Using\x20project\x20from\x20','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x0aError:','\x22\x20to\x20\x22','Writing\x20files...','Output\x20path:\x20','parse','experimentalArtifacts','diff','143Kgwvaq','textKnowledgeBases','Source:\x20','\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','\x20new','dim','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','Pushing\x20to\x20project...','sourceProjectName','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','knowledgeBases','agent:push','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','created','utf-8','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)','\x22\x20to\x20a\x20different\x20profile','cwd','name','output','Agent:\x20','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','newProjectId','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','\x22...','189194EqaDfc','Output:\x20','Dry\x20run\x20-\x20no\x20files\x20written','pushAgent','updated','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Would\x20clone:','llm_project','2025130yoXWNG','\x20\x20tdx\x20agent\x20pull\x20','\x0aPull\x20summary\x20for\x20\x27','agentId','outputPath','\x0aPush\x20','\x20unchanged','804qmeqKV','\x20\x20Integration\x20\x22','Project\x20cloned\x20successfully','Status:\x20','\x20--name\x20','\x20--profile\x20','pullProject','\x20\x20Experimental\x20Artifacts:\x20','\x20\x20Prompts:\x20','Would\x20pull\x20agent:\x20','\x20=\x20','\x0aErrors\x20found:','outputDir','✔\x20Context\x20set:\x20','New\x20project\x20ID:\x20','dirname','agentName','Using\x20project\x20from\x20context:\x20','Agent\x20pulled\x20successfully','Clone\x20\x22','\x20resources?','\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)','yes','Project\x20cloned\x20with\x20errors','50017SJykXT','\x20changed','yellow','experimentalKnowledgeBases','\x0a✔\x20Pushed\x20','error','\x20\x20Experimental\x20Artifact\x20\x22','total','unchanged','\x20successfully','found','\x20updated','\x20\x20Knowledge\x20Bases:\x20','context','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','newProjectName','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','arg-dir','8OLUDyT','agents','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20\x20tdx\x20agent\x20clone\x20agents/','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','projectName','message','4835vwtciw','pushProject','gray','\x27\x20to\x20create\x20the\x20folder\x20structure.','632352rjtRoj','pullAgent','dryRun','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x20\x20Source:\x20','new','2100516RLmnfq','Analyzing\x20changes\x20to\x20push...','Using\x20context\x20project:\x20','Would\x20push\x20agent:\x20','INVALID_ARGUMENT','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x0aChanges:','tdx.json','source','integrations','projectId','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','184079puwwvt','agent.yml','\x20|\x20','136EUMsrm','counts','agent','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','New\x20project:\x20','\x20\x20Agents:\x20','Errors:','Using\x20project:\x20','4026bMDAzh','\x20\x20Knowledge\x20Base\x20\x22','3ZYmoMx','errors','\x20total','Pushing\x20agent\x20from\x20\x22','cloneProject','site','green','Summary:','Project:\x20','push','Dry\x20run\x20-\x20no\x20changes\x20made','Cancelled','Failed\x20to\x20push\x20agent:\x20','\x20\x20Agent\x20\x22','repeat','agent:clone','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x22:\x20','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date'];a4_0x5b32=function(){return _0x142ad0;};return a4_0x5b32();}function displayDiffs(_0x51daf5,_0x5ba373,_0x3740a0,_0x43e946,_0x1b79ca,_0x22c353,_0x25c097){const _0x3292ac=a4_0x51a1;for(const _0x45e269 of _0x51daf5){if(_0x45e269['diff']){const _0x2bec3d=_0x45e269[_0x3292ac(0x12d)]||_0x45e269[_0x3292ac(0x107)];console[_0x3292ac(0xe0)]('\x0aChanges\x20to\x20agent\x20\x27'+_0x2bec3d+'\x27:'),console[_0x3292ac(0xe0)]('─'[_0x3292ac(0xc1)](0x3c)),console['log'](_0x45e269['diff']),console[_0x3292ac(0xe0)]('─'[_0x3292ac(0xc1)](0x3c));}}for(const _0x547ca7 of _0x5ba373){_0x547ca7[_0x3292ac(0xf4)]&&(console[_0x3292ac(0xe0)](_0x3292ac(0xd7)+_0x547ca7[_0x3292ac(0x107)]+'\x27:'),console['log']('─'[_0x3292ac(0xc1)](0x3c)),console[_0x3292ac(0xe0)](_0x547ca7[_0x3292ac(0xf4)]),console[_0x3292ac(0xe0)]('─'['repeat'](0x3c)));}for(const _0x11f5f8 of _0x3740a0){_0x11f5f8[_0x3292ac(0xf4)]&&(console[_0x3292ac(0xe0)](_0x3292ac(0xc3)+_0x11f5f8['name']+'\x27:'),console[_0x3292ac(0xe0)]('─'[_0x3292ac(0xc1)](0x3c)),console[_0x3292ac(0xe0)](_0x11f5f8[_0x3292ac(0xf4)]),console[_0x3292ac(0xe0)]('─'['repeat'](0x3c)));}for(const _0x3383a6 of _0x43e946){_0x3383a6[_0x3292ac(0xf4)]&&(console[_0x3292ac(0xe0)](_0x3292ac(0xe4)+_0x3383a6[_0x3292ac(0x107)]+'\x27:'),console[_0x3292ac(0xe0)]('─'[_0x3292ac(0xc1)](0x3c)),console['log'](_0x3383a6[_0x3292ac(0xf4)]),console['log']('─'[_0x3292ac(0xc1)](0x3c)));}for(const _0xd8008a of _0x1b79ca){_0xd8008a['diff']&&(console[_0x3292ac(0xe0)]('\x0aChanges\x20to\x20integration\x20\x27'+_0xd8008a[_0x3292ac(0x107)]+'\x27:'),console[_0x3292ac(0xe0)]('─'['repeat'](0x3c)),console['log'](_0xd8008a[_0x3292ac(0xf4)]),console[_0x3292ac(0xe0)]('─'[_0x3292ac(0xc1)](0x3c)));}for(const _0x34b091 of _0x22c353){_0x34b091[_0x3292ac(0xf4)]&&(console[_0x3292ac(0xe0)](_0x3292ac(0xd1)+_0x34b091[_0x3292ac(0x107)]+'\x27:'),console[_0x3292ac(0xe0)]('─'[_0x3292ac(0xc1)](0x3c)),console[_0x3292ac(0xe0)](_0x34b091[_0x3292ac(0xf4)]),console[_0x3292ac(0xe0)]('─'[_0x3292ac(0xc1)](0x3c)));}for(const _0x297521 of _0x25c097){_0x297521[_0x3292ac(0xf4)]&&(console[_0x3292ac(0xe0)]('\x0aChanges\x20to\x20experimental\x20artifact\x20\x27'+_0x297521[_0x3292ac(0x107)]+'\x27:'),console[_0x3292ac(0xe0)]('─'[_0x3292ac(0xc1)](0x3c)),console[_0x3292ac(0xe0)](_0x297521[_0x3292ac(0xf4)]),console[_0x3292ac(0xe0)]('─'[_0x3292ac(0xc1)](0x3c)));}}function a4_0x51a1(_0x32f2a9,_0x37e0f0){_0x32f2a9=_0x32f2a9-0xa4;const _0x5b3209=a4_0x5b32();let _0x51a12e=_0x5b3209[_0x32f2a9];return _0x51a12e;}export class AgentPullCommand extends BaseCommand{[a4_0x40b9c1(0x107)]=a4_0x40b9c1(0xcc);[a4_0x40b9c1(0xc6)]=a4_0x40b9c1(0x14b);async['execute'](_0x2cd33f){const _0x313275=a4_0x40b9c1,{options:_0x428604,args:_0x5ec7f3,tdx:_0x5e6eb5}=_0x2cd33f,_0x113e9b=_0x5ec7f3[0x0],_0x331915=_0x5ec7f3[0x1],_0x45b1bd=_0x428604[_0x313275(0x108)],_0x1d1d20=_0x428604['dryRun'],_0xf0fa09=_0x428604['force'],_0x4e22a7=_0x428604[_0x313275(0x133)],_0x4888f8=_0x428604[_0x313275(0xc8)],_0x298f93=_0x428604[_0x313275(0xab)];let _0x1c57a7;if(_0x113e9b){const _0x512a3b=a4_0x2d596d[_0x313275(0xcd)](_0x113e9b,_0x313275(0x15f));if(existsSync(_0x512a3b))try{const _0x313189=JSON[_0x313275(0xf2)](readFileSync(_0x512a3b,_0x313275(0x103)));_0x313189[_0x313275(0x115)]&&(_0x1c57a7={'llm_project':_0x313189[_0x313275(0x115)]});}catch{}}const _0x49a52b=findAgentConfigPath(process[_0x313275(0x106)]());let _0x4253aa;if(_0x49a52b)try{const _0x5085f2=JSON[_0x313275(0xf2)](readFileSync(_0x49a52b,_0x313275(0x103)));_0x5085f2[_0x313275(0x115)]&&(_0x4253aa={'llm_project':_0x5085f2['llm_project']});}catch{}const _0x3b7a2f=resolveAgentPullArgs({'arg':_0x113e9b,'agentNameArg':_0x331915,'agentFlag':_0x298f93,'contextProject':_0x4888f8,'argDirConfig':_0x1c57a7,'cwdConfigPath':_0x49a52b||undefined,'cwdConfig':_0x4253aa}),{projectNameOrId:_0xe30c68,targetAgentName:_0x29bd90,existingOutputDir:_0x2febe9,source:_0x5d5f65}=_0x3b7a2f;if(_0x5d5f65===_0x313275(0x146))console[_0x313275(0xe0)](a4_0x3397c1[_0x313275(0xfa)](_0x313275(0xec)+a4_0x2d596d['join'](_0x113e9b,'tdx.json')+':\x20'+_0xe30c68));else{if(_0x5d5f65===_0x313275(0xce))console[_0x313275(0xe0)](a4_0x3397c1[_0x313275(0xfa)](_0x313275(0xb0)+_0xe30c68));else _0x5d5f65===_0x313275(0x142)&&console['log'](a4_0x3397c1[_0x313275(0xfa)](_0x313275(0x12e)+_0xe30c68));}if(!_0xe30c68)return _0x298f93?(console[_0x313275(0xe0)](a4_0x3397c1[_0x313275(0x137)]('The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a')),console[_0x313275(0xe0)](_0x313275(0x10c)),console[_0x313275(0xe0)](_0x313275(0xac))):(console[_0x313275(0xe0)](a4_0x3397c1['yellow'](_0x313275(0x101))),console[_0x313275(0xe0)](_0x313275(0x104)),console[_0x313275(0xe0)](_0x313275(0xe7)),console[_0x313275(0xe0)](_0x313275(0xc9)),console[_0x313275(0xe0)]('\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'),console[_0x313275(0xe0)](_0x313275(0xf8))),0x1;if(_0x29bd90){const {data:_0x3e41c2}=await withSpinner('Pulling\x20agent\x20\x22'+_0x29bd90+'\x22\x20from\x20project\x20\x22'+_0xe30c68+_0x313275(0x10d),()=>_0x5e6eb5['llm'][_0x313275(0x153)](_0xe30c68,_0x29bd90,_0x45b1bd,{'dryRun':_0x1d1d20,'force':_0xf0fa09}));if(_0x1d1d20)return console[_0x313275(0xe0)](a4_0x3397c1[_0x313275(0x137)](_0x313275(0x110))),console[_0x313275(0xe0)](_0x313275(0x126)+_0x3e41c2[_0x313275(0x12d)]),console[_0x313275(0xe0)](_0x313275(0xf1)+_0x3e41c2[_0x313275(0x11a)]),_0x3e41c2[_0x313275(0xf4)]&&(console[_0x313275(0xe0)](_0x313275(0x15e)),console[_0x313275(0xe0)]('─'[_0x313275(0xc1)](0x3c)),console['log'](_0x3e41c2[_0x313275(0xf4)]),console[_0x313275(0xe0)]('─'[_0x313275(0xc1)](0x3c))),0x0;return console[_0x313275(0xe0)](a4_0x3397c1[_0x313275(0xb9)](_0x313275(0x12f))),console[_0x313275(0xe0)](_0x313275(0x109)+_0x3e41c2[_0x313275(0x12d)]),console[_0x313275(0xe0)](_0x313275(0x10f)+_0x3e41c2[_0x313275(0x11a)]),console[_0x313275(0xe0)](_0x313275(0x120)+(_0x3e41c2[_0x313275(0xca)]?a4_0x3397c1[_0x313275(0xb9)](_0x313275(0x157)):_0x3e41c2[_0x313275(0xe9)]?a4_0x3397c1['yellow'](_0x313275(0x112)):a4_0x3397c1['gray']('unchanged'))),0x0;}const _0x574a07=_0x2febe9||_0x45b1bd,{data:_0x4b55f4}=await withSpinner('Analyzing\x20project\x20\x22'+_0xe30c68+_0x313275(0x10d),()=>_0x5e6eb5[_0x313275(0xd4)][_0x313275(0x123)](_0xe30c68,_0x574a07,{'dryRun':!![]})),_0x5cb9a1=_0x4b55f4[_0x313275(0xaa)][_0x313275(0x148)][_0x313275(0x157)]+_0x4b55f4[_0x313275(0xaa)]['knowledgeBases']['new']+_0x4b55f4[_0x313275(0xaa)][_0x313275(0xf6)][_0x313275(0x157)]+_0x4b55f4['counts']['prompts']['new']+_0x4b55f4['counts']['integrations']['new']+_0x4b55f4[_0x313275(0xaa)][_0x313275(0x138)][_0x313275(0x157)]+_0x4b55f4[_0x313275(0xaa)][_0x313275(0xf3)][_0x313275(0x157)],_0x2196b7=_0x4b55f4[_0x313275(0xaa)][_0x313275(0x148)][_0x313275(0x112)]+_0x4b55f4[_0x313275(0xaa)][_0x313275(0xff)]['updated']+_0x4b55f4[_0x313275(0xaa)][_0x313275(0xf6)]['updated']+_0x4b55f4[_0x313275(0xaa)][_0x313275(0xe6)][_0x313275(0x112)]+_0x4b55f4['counts'][_0x313275(0x161)][_0x313275(0x112)]+_0x4b55f4[_0x313275(0xaa)][_0x313275(0x138)][_0x313275(0x112)]+_0x4b55f4['counts'][_0x313275(0xf3)][_0x313275(0x112)],_0x15d389=_0x4b55f4[_0x313275(0xaa)][_0x313275(0x148)][_0x313275(0x13d)]+_0x4b55f4[_0x313275(0xaa)][_0x313275(0xff)][_0x313275(0x13d)]+_0x4b55f4[_0x313275(0xaa)]['textKnowledgeBases']['unchanged']+_0x4b55f4[_0x313275(0xaa)][_0x313275(0xe6)]['unchanged']+_0x4b55f4[_0x313275(0xaa)][_0x313275(0x161)][_0x313275(0x13d)]+_0x4b55f4[_0x313275(0xaa)][_0x313275(0x138)][_0x313275(0x13d)]+_0x4b55f4[_0x313275(0xaa)]['experimentalArtifacts'][_0x313275(0x13d)];console[_0x313275(0xe0)](_0x313275(0x118)+_0x4b55f4[_0x313275(0x14c)]+'\x27:'),console[_0x313275(0xe0)]('\x20\x20'+a4_0x3397c1['green']('+\x20'+_0x5cb9a1+_0x313275(0xf9))+'\x20|\x20'+a4_0x3397c1[_0x313275(0x137)]('~\x20'+_0x2196b7+_0x313275(0x136))+'\x20|\x20'+a4_0x3397c1['dim']('=\x20'+_0x15d389+_0x313275(0x11c))),console[_0x313275(0xe0)](_0x313275(0xae)+formatCountSummary(_0x4b55f4[_0x313275(0xaa)]['agents'])),console['log'](_0x313275(0x141)+formatCountSummary(_0x4b55f4['counts'][_0x313275(0xff)])),console[_0x313275(0xe0)](_0x313275(0xdc)+formatCountSummary(_0x4b55f4[_0x313275(0xaa)][_0x313275(0xf6)])),console[_0x313275(0xe0)](_0x313275(0x125)+formatCountSummary(_0x4b55f4['counts'][_0x313275(0xe6)])),console['log']('\x20\x20Integrations:\x20'+formatCountSummary(_0x4b55f4[_0x313275(0xaa)]['integrations']));const _0x368704=_0x4b55f4[_0x313275(0xaa)]['experimentalKnowledgeBases']['total']>0x0||_0x4b55f4['counts']['experimentalArtifacts'][_0x313275(0x13c)]>0x0;_0x368704&&(console['log'](_0x313275(0x143)+formatCountSummary(_0x4b55f4[_0x313275(0xaa)]['experimentalKnowledgeBases'])),console[_0x313275(0xe0)](_0x313275(0x124)+formatCountSummary(_0x4b55f4['counts']['experimentalArtifacts'])));console['log']('\x20\x20Target:\x20'+a4_0x3397c1[_0x313275(0xeb)](_0x4b55f4['outputDir'])),displayDiffs(_0x4b55f4['agents'],_0x4b55f4[_0x313275(0xff)],_0x4b55f4['textKnowledgeBases'],_0x4b55f4['prompts'],_0x4b55f4[_0x313275(0x161)],_0x4b55f4[_0x313275(0x138)],_0x4b55f4[_0x313275(0xf3)]);if(_0x1d1d20)return console[_0x313275(0xe0)](a4_0x3397c1[_0x313275(0x137)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x5cb9a1===0x0&&_0x2196b7===0x0)return console[_0x313275(0xe0)](a4_0x3397c1[_0x313275(0xb9)](_0x313275(0xc5))),saveSessionContext({'llm_project':_0x4b55f4[_0x313275(0x14c)]},_0x428604['session']),console[_0x313275(0xe0)](a4_0x3397c1[_0x313275(0xb9)](_0x313275(0x12a)+a4_0x3397c1['dim'](_0x313275(0x115))+_0x313275(0x127)+a4_0x3397c1[_0x313275(0xeb)](_0x4b55f4[_0x313275(0x14c)]))),0x0;if(!_0x4e22a7&&!_0xf0fa09){if(!isInteractive())return console[_0x313275(0x13a)](a4_0x3397c1['red'](_0x313275(0xee)),_0x313275(0x113)),console[_0x313275(0x13a)](a4_0x3397c1['dim'](_0x313275(0x149))),0x1;const _0x2d3b3b=await confirmKey(_0x313275(0xde)+(_0x5cb9a1+_0x2196b7)+'\x20files?');if(!_0x2d3b3b)return console[_0x313275(0xe0)](a4_0x3397c1[_0x313275(0x137)]('Cancelled'),_0x313275(0xc7)),0x1;}const {data:_0x131d3e}=await withSpinner(_0x313275(0xf0),()=>_0x5e6eb5[_0x313275(0xd4)][_0x313275(0x123)](_0xe30c68,_0x574a07,{'force':_0xf0fa09}));return console[_0x313275(0xe0)](a4_0x3397c1['green'](_0x313275(0xe2)+(_0x5cb9a1+_0x2196b7)+'\x20files\x20to\x20'+_0x131d3e[_0x313275(0x129)])),saveSessionContext({'llm_project':_0x131d3e[_0x313275(0x14c)]},_0x428604[_0x313275(0xcb)]),console[_0x313275(0xe0)](a4_0x3397c1[_0x313275(0xb9)](_0x313275(0x12a)+a4_0x3397c1[_0x313275(0xfa)](_0x313275(0x115))+'\x20=\x20'+a4_0x3397c1[_0x313275(0xeb)](_0x131d3e[_0x313275(0x14c)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x40b9c1(0x107)]=a4_0x40b9c1(0xc2);[a4_0x40b9c1(0xc6)]='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async[a4_0x40b9c1(0xd5)](_0x4e7028){const _0x148871=a4_0x40b9c1,{options:_0x276328,args:_0x50f395,tdx:_0x32af8b}=_0x4e7028,_0xff8d65=_0x50f395[0x0],_0x3eecca=_0x276328[_0x148871(0x107)],_0x1028e3=_0x276328['dryRun'],_0x40cfed=_0x276328[_0x148871(0x133)],_0x377350=_0x276328['site'],_0x3b3d73=_0x276328[_0x148871(0xc8)];let _0x453d4d;const _0x91a4=findAgentConfigPath(process[_0x148871(0x106)]());if(_0xff8d65){const _0x1b8dc3=a4_0x2d596d['join'](_0xff8d65,_0x148871(0x15f));existsSync(_0x1b8dc3)?(_0x453d4d=_0xff8d65,console['log'](a4_0x3397c1['dim']('Using\x20local\x20project:\x20'+_0xff8d65))):_0x453d4d=_0xff8d65;}else{if(_0x91a4)_0x453d4d=a4_0x2d596d[_0x148871(0x12c)](_0x91a4),console[_0x148871(0xe0)](a4_0x3397c1[_0x148871(0xfa)](_0x148871(0xd2)+_0x453d4d));else{if(_0x3b3d73){const _0x5918dc=sanitizeForFilesystem(_0x3b3d73);let _0x3fcf15=_0x5918dc,_0x27269f=a4_0x2d596d['join'](process[_0x148871(0x106)](),_0x148871(0x148),_0x5918dc,_0x148871(0x15f));if(!existsSync(_0x27269f)){const _0x3e0d61=normalizeName(_0x3b3d73),_0x480228=a4_0x2d596d[_0x148871(0xcd)](process[_0x148871(0x106)](),_0x148871(0x148),_0x3e0d61,_0x148871(0x15f));existsSync(_0x480228)&&(_0x3fcf15=_0x3e0d61,_0x27269f=_0x480228);}if(existsSync(_0x27269f))_0x453d4d=a4_0x2d596d[_0x148871(0x12c)](_0x27269f),console[_0x148871(0xe0)](a4_0x3397c1[_0x148871(0xfa)]('Using\x20local\x20project:\x20'+_0x453d4d));else{const _0x418be9=_0x276328[_0x148871(0xd0)];if(_0x418be9)throw new SDKError(ErrorCode[_0x148871(0x15c)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x3b3d73+_0x148871(0x105),undefined,{'helpText':_0x148871(0xed)+_0x148871(0x10a)+(_0x148871(0x117)+_0x3b3d73+'\x0a')+(_0x148871(0x14a)+_0x3fcf15+_0x148871(0x121)+(_0x3eecca||_0x148871(0xea))+_0x148871(0x122)+_0x418be9)});_0x453d4d=_0x3b3d73,console[_0x148871(0xe0)](a4_0x3397c1['dim'](_0x148871(0x15a)+_0x3b3d73));}}}}if(!_0x453d4d)return console[_0x148871(0xe0)](a4_0x3397c1[_0x148871(0x137)](_0x148871(0xa5))),console[_0x148871(0xe0)]('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console[_0x148871(0xe0)](_0x148871(0x155)),console[_0x148871(0xe0)](_0x148871(0x132)),console[_0x148871(0xe0)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x3eecca)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],'New\x20project\x20name\x20is\x20required',undefined,{'helpText':_0x148871(0xfe)});if(!_0x40cfed&&!_0x1028e3){if(!isInteractive())return console['error'](a4_0x3397c1[_0x148871(0xcf)](_0x148871(0xee)),_0x148871(0x113)),console['error'](a4_0x3397c1['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x27bf4b=await confirmKey(_0x148871(0x130)+_0x453d4d+_0x148871(0xe3)+_0x3eecca+'\x22?');if(!_0x27bf4b)return console['log'](a4_0x3397c1[_0x148871(0x137)](_0x148871(0xbe))),0x1;}const {data:_0x246c8f}=await withSpinner(_0x148871(0xd9)+_0x453d4d+_0x148871(0xef)+_0x3eecca+'\x22...',()=>_0x32af8b[_0x148871(0xd4)][_0x148871(0xb7)](_0x453d4d,_0x3eecca,{'dryRun':_0x1028e3}));if(_0x1028e3){console[_0x148871(0xe0)](a4_0x3397c1[_0x148871(0x137)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console['log']('Source:\x20'+_0x246c8f[_0x148871(0xfd)]),console['log'](_0x148871(0xad)+_0x3eecca),console['log'](_0x148871(0x114)),console[_0x148871(0xe0)](_0x148871(0xae)+_0x246c8f[_0x148871(0xaa)]['agents'][_0x148871(0x102)]),console['log'](_0x148871(0x141)+_0x246c8f[_0x148871(0xaa)][_0x148871(0xff)][_0x148871(0x102)]),console[_0x148871(0xe0)](_0x148871(0x125)+_0x246c8f[_0x148871(0xaa)][_0x148871(0xe6)]['created']);const _0x1368ef=_0x246c8f['counts'][_0x148871(0x138)]['created']>0x0||_0x246c8f['counts'][_0x148871(0xf3)][_0x148871(0x102)]>0x0;return _0x1368ef&&(console['log']('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+_0x246c8f['counts']['experimentalKnowledgeBases'][_0x148871(0x102)]),console['log']('\x20\x20Experimental\x20Artifacts:\x20'+_0x246c8f[_0x148871(0xaa)][_0x148871(0xf3)][_0x148871(0x102)])),0x0;}const _0x546fd4=_0x246c8f[_0x148871(0xaa)][_0x148871(0x148)][_0x148871(0xb4)]>0x0||_0x246c8f[_0x148871(0xaa)][_0x148871(0xff)]['errors']>0x0||_0x246c8f[_0x148871(0xaa)][_0x148871(0xe6)][_0x148871(0xb4)]>0x0||_0x246c8f[_0x148871(0xaa)]['experimentalKnowledgeBases'][_0x148871(0xb4)]>0x0||_0x246c8f[_0x148871(0xaa)]['experimentalArtifacts'][_0x148871(0xb4)]>0x0;_0x546fd4?console['log'](a4_0x3397c1[_0x148871(0x137)](_0x148871(0x134))):console[_0x148871(0xe0)](a4_0x3397c1[_0x148871(0xb9)](_0x148871(0x11f)));console[_0x148871(0xe0)](_0x148871(0xf7)+_0x246c8f['sourceProjectName']),console[_0x148871(0xe0)](_0x148871(0xad)+_0x246c8f[_0x148871(0x144)]),console[_0x148871(0xe0)](_0x148871(0x12b)+_0x246c8f[_0x148871(0x10b)]),console[_0x148871(0xe0)](),console[_0x148871(0xe0)](_0x148871(0xba)),console[_0x148871(0xe0)](_0x148871(0xae)+formatCountSummary(_0x246c8f[_0x148871(0xaa)][_0x148871(0x148)])),console[_0x148871(0xe0)](_0x148871(0x141)+formatCountSummary(_0x246c8f[_0x148871(0xaa)][_0x148871(0xff)])),console[_0x148871(0xe0)](_0x148871(0x125)+formatCountSummary(_0x246c8f[_0x148871(0xaa)][_0x148871(0xe6)])),console[_0x148871(0xe0)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x246c8f[_0x148871(0xaa)][_0x148871(0x161)]));const _0x434f79=_0x246c8f[_0x148871(0xaa)]['experimentalKnowledgeBases'][_0x148871(0x102)]>0x0||_0x246c8f[_0x148871(0xaa)][_0x148871(0x138)][_0x148871(0x112)]>0x0||_0x246c8f[_0x148871(0xaa)][_0x148871(0x138)][_0x148871(0x13d)]>0x0||_0x246c8f[_0x148871(0xaa)][_0x148871(0xf3)][_0x148871(0x102)]>0x0||_0x246c8f[_0x148871(0xaa)][_0x148871(0xf3)][_0x148871(0x112)]>0x0||_0x246c8f[_0x148871(0xaa)][_0x148871(0xf3)][_0x148871(0x13d)]>0x0;_0x434f79&&(console[_0x148871(0xe0)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x246c8f[_0x148871(0xaa)][_0x148871(0x138)])),console[_0x148871(0xe0)](_0x148871(0x124)+formatCountSummary(_0x246c8f[_0x148871(0xaa)]['experimentalArtifacts'])));if(_0x546fd4){console[_0x148871(0xe0)](),console[_0x148871(0xe0)](a4_0x3397c1[_0x148871(0xcf)](_0x148871(0xaf)));for(const _0x10d02c of _0x246c8f[_0x148871(0x148)]){_0x10d02c['action']==='error'&&console[_0x148871(0xe0)](a4_0x3397c1[_0x148871(0xcf)](_0x148871(0xc0)+_0x10d02c[_0x148871(0x12d)]+_0x148871(0xc4)+_0x10d02c[_0x148871(0x13a)]));}for(const _0x5e6567 of _0x246c8f[_0x148871(0xff)]){_0x5e6567[_0x148871(0xdf)]==='error'&&console['log'](a4_0x3397c1[_0x148871(0xcf)](_0x148871(0xb2)+_0x5e6567[_0x148871(0x107)]+_0x148871(0xc4)+_0x5e6567[_0x148871(0x13a)]));}for(const _0x4af607 of _0x246c8f['prompts']){_0x4af607[_0x148871(0xdf)]==='error'&&console[_0x148871(0xe0)](a4_0x3397c1[_0x148871(0xcf)]('\x20\x20Prompt\x20\x22'+_0x4af607[_0x148871(0x107)]+'\x22:\x20'+_0x4af607[_0x148871(0x13a)]));}for(const _0x5e9dde of _0x246c8f[_0x148871(0x161)]){_0x5e9dde[_0x148871(0xdf)]===_0x148871(0x13a)&&console[_0x148871(0xe0)](a4_0x3397c1[_0x148871(0xcf)](_0x148871(0x11e)+_0x5e9dde[_0x148871(0x107)]+_0x148871(0xc4)+_0x5e9dde[_0x148871(0x13a)]));}for(const _0xe7879d of _0x246c8f[_0x148871(0x138)]){_0xe7879d[_0x148871(0xdf)]===_0x148871(0x13a)&&console[_0x148871(0xe0)](a4_0x3397c1['red']('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0xe7879d['name']+'\x22:\x20'+_0xe7879d['error']));}for(const _0x49ad2e of _0x246c8f[_0x148871(0xf3)]){_0x49ad2e[_0x148871(0xdf)]==='error'&&console[_0x148871(0xe0)](a4_0x3397c1['red'](_0x148871(0x13b)+_0x49ad2e[_0x148871(0x107)]+_0x148871(0xc4)+_0x49ad2e[_0x148871(0x13a)]));}return 0x1;}console['log']();const _0x652d15=getLLMProjectUrl(_0x377350,_0x246c8f['newProjectId']);return console['log'](_0x148871(0xbb)+a4_0x3397c1[_0x148871(0xeb)](_0x652d15)),0x0;}}export class AgentPushCommand extends BaseCommand{['name']=a4_0x40b9c1(0x100);[a4_0x40b9c1(0xc6)]='Push\x20local\x20agent\x20files\x20to\x20LLM\x20project';async['execute'](_0x5a7a9){const _0x587577=a4_0x40b9c1,{options:_0x22377f,args:_0x27ed13,tdx:_0x47c3d5}=_0x5a7a9;let _0x549d1e=_0x27ed13[0x0]||process[_0x587577(0x106)]();const _0x34d4fa=_0x22377f[_0x587577(0x154)],_0x468dc3=_0x22377f[_0x587577(0xe5)],_0x46a4de=_0x22377f[_0x587577(0x133)],_0x30f4ce=_0x22377f[_0x587577(0xb8)],_0x1e930d=a4_0x2d596d[_0x587577(0xcd)](_0x549d1e,_0x587577(0xa7)),_0x25642a=existsSync(_0x1e930d);if(_0x25642a){const {data:_0x5035a1}=await withSpinner(_0x587577(0xb6)+_0x549d1e+_0x587577(0x10d),()=>_0x47c3d5[_0x587577(0xd4)][_0x587577(0x111)](_0x549d1e,{'dryRun':_0x34d4fa,'force':_0x468dc3}));if(_0x34d4fa)return console[_0x587577(0xe0)](a4_0x3397c1[_0x587577(0x137)](_0x587577(0xbd))),console['log'](_0x587577(0x15b)+_0x5035a1[_0x587577(0x12d)]),0x0;if(_0x5035a1[_0x587577(0xdf)]==='error')return console[_0x587577(0xe0)](a4_0x3397c1[_0x587577(0xcf)](_0x587577(0xbf)+_0x5035a1[_0x587577(0x13a)])),0x1;console['log'](a4_0x3397c1[_0x587577(0xb9)]('Agent\x20'+_0x5035a1[_0x587577(0xdf)]+_0x587577(0x13e))),console['log'](_0x587577(0x109)+_0x5035a1[_0x587577(0x12d)]);if(_0x5035a1['agentId']&&_0x5035a1[_0x587577(0xa4)]){const _0x48190d=getLLMAgentChatUrl(_0x30f4ce,_0x5035a1['projectId'],_0x5035a1[_0x587577(0x119)]);console[_0x587577(0xe0)]('Chat:\x20'+a4_0x3397c1[_0x587577(0xeb)](_0x48190d));}return 0x0;}const _0x8187c1=_0x22377f['llmProject'],_0x126b81=resolveProjectFromContext(_0x549d1e,_0x8187c1);if(_0x126b81[_0x587577(0x13f)])_0x549d1e=_0x126b81['projectDir'],_0x126b81[_0x587577(0x160)]===_0x587577(0x142)&&console['log'](a4_0x3397c1[_0x587577(0xfa)](_0x587577(0xb0)+_0x549d1e));else{let _0xda14b0=_0x587577(0x145);_0x126b81[_0x587577(0xd3)]==='no_local_folder'&&(_0xda14b0=_0x126b81[_0x587577(0x14d)]+_0x587577(0xd8)+_0x126b81[_0x587577(0xc8)]+_0x587577(0x151));throw new SDKError(ErrorCode[_0x587577(0x15c)],_0x126b81['reason']===_0x587577(0xda)?_0x126b81[_0x587577(0x14d)]:_0x587577(0xdd)+_0x549d1e,undefined,{'helpText':_0xda14b0});}const {data:_0x4a4d86}=await withSpinner(_0x587577(0x159),()=>_0x47c3d5[_0x587577(0xd4)][_0x587577(0x14f)](_0x549d1e,{'dryRun':!![]})),_0xd20d07=_0x4a4d86['counts'][_0x587577(0x148)]['errors']>0x0;if(_0xd20d07){console['log'](a4_0x3397c1[_0x587577(0xcf)](_0x587577(0x128)));for(const _0x43be70 of _0x4a4d86['agents']){_0x43be70[_0x587577(0xdf)]===_0x587577(0x13a)&&console[_0x587577(0xe0)](a4_0x3397c1['red'](_0x587577(0xc0)+_0x43be70[_0x587577(0x12d)]+_0x587577(0xc4)+_0x43be70[_0x587577(0x13a)]));}return 0x1;}const _0x499033=_0x4a4d86['counts']['agents'][_0x587577(0x102)]+_0x4a4d86['counts'][_0x587577(0xff)]['created']+_0x4a4d86[_0x587577(0xaa)][_0x587577(0xf6)][_0x587577(0x102)]+_0x4a4d86[_0x587577(0xaa)][_0x587577(0xe6)][_0x587577(0x102)]+_0x4a4d86[_0x587577(0xaa)][_0x587577(0x161)][_0x587577(0x102)]+_0x4a4d86[_0x587577(0xaa)][_0x587577(0x138)][_0x587577(0x102)]+_0x4a4d86[_0x587577(0xaa)]['experimentalArtifacts'][_0x587577(0x102)],_0x57f4c4=_0x4a4d86['counts'][_0x587577(0x148)][_0x587577(0x112)]+_0x4a4d86[_0x587577(0xaa)][_0x587577(0xff)][_0x587577(0x112)]+_0x4a4d86[_0x587577(0xaa)][_0x587577(0xf6)][_0x587577(0x112)]+_0x4a4d86[_0x587577(0xaa)][_0x587577(0xe6)][_0x587577(0x112)]+_0x4a4d86['counts'][_0x587577(0x161)][_0x587577(0x112)]+_0x4a4d86[_0x587577(0xaa)]['experimentalKnowledgeBases'][_0x587577(0x112)]+_0x4a4d86[_0x587577(0xaa)][_0x587577(0xf3)][_0x587577(0x112)],_0x249252=_0x4a4d86[_0x587577(0xaa)][_0x587577(0x148)][_0x587577(0x13d)]+_0x4a4d86[_0x587577(0xaa)][_0x587577(0xff)]['unchanged']+_0x4a4d86[_0x587577(0xaa)][_0x587577(0xf6)]['unchanged']+_0x4a4d86[_0x587577(0xaa)]['prompts'][_0x587577(0x13d)]+_0x4a4d86['counts']['integrations']['unchanged']+_0x4a4d86[_0x587577(0xaa)]['experimentalKnowledgeBases'][_0x587577(0x13d)]+_0x4a4d86[_0x587577(0xaa)]['experimentalArtifacts'][_0x587577(0x13d)];console[_0x587577(0xe0)](_0x587577(0xe1)+_0x4a4d86[_0x587577(0x14c)]+'\x27:'),console[_0x587577(0xe0)]('\x20\x20'+a4_0x3397c1[_0x587577(0xb9)]('+\x20'+_0x499033+_0x587577(0xf9))+'\x20|\x20'+a4_0x3397c1[_0x587577(0x137)]('~\x20'+_0x57f4c4+_0x587577(0x136))+_0x587577(0xa8)+a4_0x3397c1['dim']('=\x20'+_0x249252+_0x587577(0x11c))),console[_0x587577(0xe0)](_0x587577(0xae)+formatCountSummary(_0x4a4d86['counts'][_0x587577(0x148)])),console[_0x587577(0xe0)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x4a4d86[_0x587577(0xaa)][_0x587577(0xff)])),console['log'](_0x587577(0xdc)+formatCountSummary(_0x4a4d86['counts'][_0x587577(0xf6)])),console[_0x587577(0xe0)](_0x587577(0x125)+formatCountSummary(_0x4a4d86[_0x587577(0xaa)][_0x587577(0xe6)])),console[_0x587577(0xe0)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x4a4d86[_0x587577(0xaa)]['integrations']));const _0x4620a4=_0x4a4d86['counts'][_0x587577(0x138)]['created']>0x0||_0x4a4d86[_0x587577(0xaa)][_0x587577(0x138)]['updated']>0x0||_0x4a4d86[_0x587577(0xaa)][_0x587577(0x138)][_0x587577(0x13d)]>0x0||_0x4a4d86[_0x587577(0xaa)][_0x587577(0xf3)]['created']>0x0||_0x4a4d86[_0x587577(0xaa)]['experimentalArtifacts'][_0x587577(0x112)]>0x0||_0x4a4d86[_0x587577(0xaa)][_0x587577(0xf3)][_0x587577(0x13d)]>0x0;_0x4620a4&&(console['log'](_0x587577(0x143)+formatCountSummary(_0x4a4d86[_0x587577(0xaa)][_0x587577(0x138)])),console['log'](_0x587577(0x124)+formatCountSummary(_0x4a4d86[_0x587577(0xaa)][_0x587577(0xf3)])));console[_0x587577(0xe0)](_0x587577(0x156)+a4_0x3397c1[_0x587577(0xeb)](_0x549d1e)),displayDiffs(_0x4a4d86['agents'],_0x4a4d86['knowledgeBases'],_0x4a4d86[_0x587577(0xf6)],_0x4a4d86['prompts'],_0x4a4d86[_0x587577(0x161)],_0x4a4d86[_0x587577(0x138)],_0x4a4d86[_0x587577(0xf3)]);if(_0x34d4fa)return console['log'](a4_0x3397c1[_0x587577(0x137)](_0x587577(0xfb))),0x0;if(_0x499033===0x0&&_0x57f4c4===0x0){console[_0x587577(0xe0)](a4_0x3397c1[_0x587577(0xb9)](_0x587577(0x15d)));const _0xe2a728=getLLMProjectUrl(_0x30f4ce,_0x4a4d86[_0x587577(0xa4)]);return console[_0x587577(0xe0)](_0x587577(0xbb)+a4_0x3397c1[_0x587577(0xeb)](_0xe2a728)),0x0;}if(!_0x46a4de&&!_0x468dc3){if(!isInteractive())return console[_0x587577(0x13a)](a4_0x3397c1[_0x587577(0xcf)](_0x587577(0xee)),_0x587577(0x113)),console[_0x587577(0x13a)](a4_0x3397c1[_0x587577(0xfa)](_0x587577(0x149))),0x1;const _0x342eb6=await confirmKey(_0x587577(0x11b)+(_0x499033+_0x57f4c4)+_0x587577(0x131));if(!_0x342eb6)return console[_0x587577(0xe0)](a4_0x3397c1[_0x587577(0x137)]('Cancelled'),'-\x20nothing\x20pushed'),0x1;}const {data:_0x17345f}=await withSpinner(_0x587577(0xfc),()=>_0x47c3d5[_0x587577(0xd4)][_0x587577(0x14f)](_0x549d1e,{'force':_0x468dc3})),_0x3d8242=_0x17345f[_0x587577(0xaa)][_0x587577(0x148)][_0x587577(0xb4)]>0x0||_0x17345f[_0x587577(0xaa)]['knowledgeBases'][_0x587577(0xb4)]>0x0||_0x17345f['counts']['textKnowledgeBases'][_0x587577(0xb4)]>0x0||_0x17345f[_0x587577(0xaa)][_0x587577(0xe6)]['errors']>0x0;if(_0x3d8242){console['log'](a4_0x3397c1[_0x587577(0x137)]('\x0aProject\x20pushed\x20with\x20errors')),console['log'](),console[_0x587577(0xe0)](a4_0x3397c1['red'](_0x587577(0xaf)));for(const _0x2fe4f1 of _0x17345f[_0x587577(0x148)]){_0x2fe4f1[_0x587577(0xdf)]===_0x587577(0x13a)&&console[_0x587577(0xe0)](a4_0x3397c1[_0x587577(0xcf)]('\x20\x20Agent\x20\x22'+_0x2fe4f1[_0x587577(0x12d)]+_0x587577(0xc4)+_0x2fe4f1[_0x587577(0x13a)]));}for(const _0x3d7dc8 of _0x17345f['knowledgeBases']){_0x3d7dc8['action']===_0x587577(0x13a)&&console[_0x587577(0xe0)](a4_0x3397c1[_0x587577(0xcf)](_0x587577(0xb2)+_0x3d7dc8[_0x587577(0x107)]+'\x22:\x20'+_0x3d7dc8['error']));}for(const _0x3fdcfb of _0x17345f[_0x587577(0xf6)]){_0x3fdcfb[_0x587577(0xdf)]==='error'&&console['log'](a4_0x3397c1[_0x587577(0xcf)]('\x20\x20Text\x20Knowledge\x20Base\x20\x22'+_0x3fdcfb[_0x587577(0x107)]+_0x587577(0xc4)+_0x3fdcfb[_0x587577(0x13a)]));}for(const _0x492798 of _0x17345f['prompts']){_0x492798[_0x587577(0xdf)]===_0x587577(0x13a)&&console[_0x587577(0xe0)](a4_0x3397c1[_0x587577(0xcf)](_0x587577(0xe8)+_0x492798[_0x587577(0x107)]+_0x587577(0xc4)+_0x492798[_0x587577(0x13a)]));}for(const _0x55903b of _0x17345f['integrations']){_0x55903b[_0x587577(0xdf)]===_0x587577(0x13a)&&console[_0x587577(0xe0)](a4_0x3397c1[_0x587577(0xcf)](_0x587577(0x11e)+_0x55903b[_0x587577(0x107)]+_0x587577(0xc4)+_0x55903b[_0x587577(0x13a)]));}return 0x1;}console[_0x587577(0xe0)](a4_0x3397c1['green'](_0x587577(0x139)+(_0x499033+_0x57f4c4)+'\x20resources\x20to\x20\x27'+_0x17345f[_0x587577(0x14c)]+'\x27'));const _0x122637=getLLMProjectUrl(_0x30f4ce,_0x17345f[_0x587577(0xa4)]);return console[_0x587577(0xe0)](_0x587577(0xbb)+a4_0x3397c1['cyan'](_0x122637)),0x0;}}
|
|
1
|
+
function a4_0x5480(){const _0x160adc=['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)','projectDir','\x20\x20Integration\x20\x22','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','Using\x20project\x20from\x20','agentId','source','yellow','Pushing\x20agent\x20from\x20\x22','\x20unchanged','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','New\x20project:\x20','Summary:','agent:clone','description','\x20changed','red','site','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x22:\x20','Using\x20project:\x20','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','new','cyan','errors','llm_project','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','dirname','output','green','\x0aChanges:','117298qNgnVZ','\x20\x20Text\x20Knowledge\x20Bases:\x20','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','297Hpaebv','join','\x0aChanges\x20to\x20prompt\x20\x27','experimentalKnowledgeBases','920549zwMTtB','\x20resources\x20to\x20\x27','\x20|\x20','agentName','Pulling\x20agent\x20\x22','Status:\x20','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','\x0a✔\x20Pulled\x20','push','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','textKnowledgeBases','Analyzing\x20project\x20\x22','136260cPlMFZ','llm','\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','\x20\x20Experimental\x20Artifacts:\x20','Analyzing\x20changes\x20to\x20push...','yes','projectId','Would\x20push\x20agent:\x20','\x22\x20to\x20\x22','New\x20project\x20name\x20is\x20required','Clone\x20\x22','execute','Failed\x20to\x20push\x20agent:\x20','force','newProjectId','cwd','Source:\x20','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\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','\x20\x20Experimental\x20Artifact\x20\x22','Cloning\x20\x22','Using\x20project\x20from\x20context:\x20','tdx.json','6luAzrg','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','11XdxJlh','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x0aPush\x20summary\x20for\x20\x27','arg-dir','-\x20no\x20files\x20written','\x20files\x20to\x20','Chat:\x20','sourceProjectName','profile','agents','knowledgeBases','gray','\x27\x20to\x20create\x20the\x20folder\x20structure.','reason','log','updated','Would\x20pull\x20agent:\x20','\x20\x20Knowledge\x20Base\x20\x22','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','Agent:\x20','Using\x20local\x20project:\x20','session','Using\x20context\x20project:\x20','outputDir','\x20\x20Text\x20Knowledge\x20Base\x20\x22','pushAgent','llmProject','INVALID_ARGUMENT','\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)','cwd-config','Using\x20current\x20project:\x20','Dry\x20run\x20-\x20no\x20files\x20written','\x20\x20Integrations:\x20','\x0aWrite\x20','pullProject','projectName','dim','unchanged','agent','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','Project:\x20','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','experimentalArtifacts','Pushing\x20to\x20project...','Agent\x20','repeat','\x20\x20Target:\x20','error','\x20=\x20','\x20--profile\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','prompts','2261148tKbhkK','Project\x20cloned\x20with\x20errors','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','parse','MISSING_ARGUMENT','\x20\x20Agent\x20\x22','agent.yml','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','agent:pull','created','\x0aPush\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','utf-8','3ZoQYyi','\x20\x20Agents:\x20','\x22\x20to\x20new\x20project\x20\x22','\x20updated','\x0aError:','-\x20nothing\x20pushed','found','no_local_folder','\x20\x20Knowledge\x20Bases:\x20','63582GoUSMm','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x20\x20Prompt\x20\x22','\x0a✔\x20Pushed\x20','✔\x20Context\x20set:\x20','cloneProject','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x20successfully','New\x20project\x20ID:\x20','Cancelled','Dry\x20run\x20-\x20no\x20changes\x20made','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x20\x20Prompts:\x20','context','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x20new','outputPath','Output\x20path:\x20','448955BpEDXI','total','4vjTOKw','Writing\x20files...','\x20\x20tdx\x20agent\x20pull\x20','Project\x20cloned\x20successfully','agent:push','diff','action','no_context','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','17864awRrgR','Would\x20clone:','pushProject','Output:\x20','integrations','\x0aPull\x20summary\x20for\x20\x27','dryRun','Agent\x20pulled\x20successfully','Cannot\x20clone\x20from\x20context\x20project\x20\x22','counts','message','\x22\x20from\x20project\x20\x22','name','\x22...','Errors:'];a4_0x5480=function(){return _0x160adc;};return a4_0x5480();}const a4_0x321400=a4_0xe70e;(function(_0x447803,_0x2798e8){const _0xcfebc4=a4_0xe70e,_0x3f39ed=_0x447803();while(!![]){try{const _0x197d48=parseInt(_0xcfebc4(0x1b0))/0x1*(parseInt(_0xcfebc4(0x204))/0x2)+-parseInt(_0xcfebc4(0x1b9))/0x3*(-parseInt(_0xcfebc4(0x1cd))/0x4)+-parseInt(_0xcfebc4(0x1cb))/0x5+-parseInt(_0xcfebc4(0x16b))/0x6*(-parseInt(_0xcfebc4(0x20b))/0x7)+-parseInt(_0xcfebc4(0x1d6))/0x8*(-parseInt(_0xcfebc4(0x207))/0x9)+parseInt(_0xcfebc4(0x217))/0xa*(parseInt(_0xcfebc4(0x16d))/0xb)+-parseInt(_0xcfebc4(0x1a3))/0xc;if(_0x197d48===_0x2798e8)break;else _0x3f39ed['push'](_0x3f39ed['shift']());}catch(_0x38ed98){_0x3f39ed['push'](_0x3f39ed['shift']());}}}(a4_0x5480,0x21a0f));import a4_0x48726e from'chalk';import a4_0x549855 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,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(_0x5a915c){const _0x1c1fc0=a4_0xe70e,_0x1902f8=[];if(_0x5a915c[_0x1c1fc0(0x1cc)]!==undefined)_0x1902f8[_0x1c1fc0(0x213)](_0x5a915c[_0x1c1fc0(0x1cc)]+'\x20total');if(_0x5a915c[_0x1c1fc0(0x1fb)]!==undefined&&_0x5a915c[_0x1c1fc0(0x1fb)]>0x0)_0x1902f8[_0x1c1fc0(0x213)](a4_0x48726e['green'](_0x5a915c[_0x1c1fc0(0x1fb)]+_0x1c1fc0(0x1c8)));if(_0x5a915c[_0x1c1fc0(0x1ac)]!==undefined&&_0x5a915c[_0x1c1fc0(0x1ac)]>0x0)_0x1902f8[_0x1c1fc0(0x213)](a4_0x48726e[_0x1c1fc0(0x202)](_0x5a915c['created']+'\x20created'));if(_0x5a915c[_0x1c1fc0(0x17c)]!==undefined&&_0x5a915c[_0x1c1fc0(0x17c)]>0x0)_0x1902f8[_0x1c1fc0(0x213)](a4_0x48726e[_0x1c1fc0(0x1ec)](_0x5a915c['updated']+_0x1c1fc0(0x1b3)));if(_0x5a915c[_0x1c1fc0(0x192)]!==undefined&&_0x5a915c[_0x1c1fc0(0x192)]>0x0)_0x1902f8[_0x1c1fc0(0x213)](a4_0x48726e['gray'](_0x5a915c['unchanged']+_0x1c1fc0(0x1ee)));if(_0x5a915c['errors']!==undefined&&_0x5a915c[_0x1c1fc0(0x1fd)]>0x0)_0x1902f8['push'](a4_0x48726e[_0x1c1fc0(0x1f5)](_0x5a915c[_0x1c1fc0(0x1fd)]+'\x20errors'));return _0x1902f8[_0x1c1fc0(0x208)](',\x20');}function displayDiffs(_0x27b3e3,_0x59a2df,_0x860326,_0xaf9e3f,_0x5eb2e5,_0x35b614,_0x5eefb7){const _0x17ae34=a4_0xe70e;for(const _0x26e606 of _0x27b3e3){if(_0x26e606['diff']){const _0x365c90=_0x26e606['agentName']||_0x26e606['name'];console['log']('\x0aChanges\x20to\x20agent\x20\x27'+_0x365c90+'\x27:'),console[_0x17ae34(0x17b)]('─'[_0x17ae34(0x19c)](0x3c)),console['log'](_0x26e606[_0x17ae34(0x1d2)]),console['log']('─'['repeat'](0x3c));}}for(const _0x114384 of _0x59a2df){_0x114384[_0x17ae34(0x1d2)]&&(console[_0x17ae34(0x17b)](_0x17ae34(0x1c4)+_0x114384[_0x17ae34(0x1e2)]+'\x27:'),console[_0x17ae34(0x17b)]('─'[_0x17ae34(0x19c)](0x3c)),console[_0x17ae34(0x17b)](_0x114384[_0x17ae34(0x1d2)]),console[_0x17ae34(0x17b)]('─'[_0x17ae34(0x19c)](0x3c)));}for(const _0x49be6b of _0x860326){_0x49be6b[_0x17ae34(0x1d2)]&&(console[_0x17ae34(0x17b)]('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x49be6b['name']+'\x27:'),console['log']('─'[_0x17ae34(0x19c)](0x3c)),console[_0x17ae34(0x17b)](_0x49be6b['diff']),console['log']('─'[_0x17ae34(0x19c)](0x3c)));}for(const _0x32a376 of _0xaf9e3f){_0x32a376[_0x17ae34(0x1d2)]&&(console[_0x17ae34(0x17b)](_0x17ae34(0x209)+_0x32a376['name']+'\x27:'),console[_0x17ae34(0x17b)]('─'['repeat'](0x3c)),console['log'](_0x32a376[_0x17ae34(0x1d2)]),console[_0x17ae34(0x17b)]('─'[_0x17ae34(0x19c)](0x3c)));}for(const _0xb797b7 of _0x5eb2e5){_0xb797b7[_0x17ae34(0x1d2)]&&(console['log']('\x0aChanges\x20to\x20integration\x20\x27'+_0xb797b7[_0x17ae34(0x1e2)]+'\x27:'),console[_0x17ae34(0x17b)]('─'[_0x17ae34(0x19c)](0x3c)),console[_0x17ae34(0x17b)](_0xb797b7[_0x17ae34(0x1d2)]),console[_0x17ae34(0x17b)]('─'[_0x17ae34(0x19c)](0x3c)));}for(const _0x4aa33b of _0x35b614){_0x4aa33b[_0x17ae34(0x1d2)]&&(console['log'](_0x17ae34(0x16e)+_0x4aa33b[_0x17ae34(0x1e2)]+'\x27:'),console[_0x17ae34(0x17b)]('─'[_0x17ae34(0x19c)](0x3c)),console['log'](_0x4aa33b[_0x17ae34(0x1d2)]),console[_0x17ae34(0x17b)]('─'['repeat'](0x3c)));}for(const _0x276274 of _0x5eefb7){_0x276274[_0x17ae34(0x1d2)]&&(console[_0x17ae34(0x17b)](_0x17ae34(0x1e8)+_0x276274['name']+'\x27:'),console['log']('─'[_0x17ae34(0x19c)](0x3c)),console[_0x17ae34(0x17b)](_0x276274[_0x17ae34(0x1d2)]),console['log']('─'[_0x17ae34(0x19c)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']=a4_0x321400(0x1ab);[a4_0x321400(0x1f3)]=a4_0x321400(0x1d5);async[a4_0x321400(0x222)](_0x1596b9){const _0x1e523b=a4_0x321400,{options:_0x3042a2,args:_0x29273a,tdx:_0x4e6ba3}=_0x1596b9,_0x1b7863=_0x29273a[0x0],_0x548e3d=_0x29273a[0x1],_0x597b96=_0x3042a2[_0x1e523b(0x201)],_0x3b339b=_0x3042a2['dryRun'],_0x49167d=_0x3042a2[_0x1e523b(0x224)],_0x34d586=_0x3042a2[_0x1e523b(0x21c)],_0x267c20=_0x3042a2[_0x1e523b(0x187)],_0x321731=_0x3042a2[_0x1e523b(0x193)];let _0x5e0cb8;if(_0x1b7863){const _0x143882=a4_0x549855[_0x1e523b(0x208)](_0x1b7863,_0x1e523b(0x16a));if(existsSync(_0x143882))try{const _0x21fde1=JSON[_0x1e523b(0x1a6)](readFileSync(_0x143882,_0x1e523b(0x1af)));_0x21fde1[_0x1e523b(0x1fe)]&&(_0x5e0cb8={'llm_project':_0x21fde1[_0x1e523b(0x1fe)]});}catch{}}const _0x10483c=findAgentConfigPath(process[_0x1e523b(0x226)]());let _0x241f43;if(_0x10483c)try{const _0x5ac312=JSON[_0x1e523b(0x1a6)](readFileSync(_0x10483c,_0x1e523b(0x1af)));_0x5ac312['llm_project']&&(_0x241f43={'llm_project':_0x5ac312[_0x1e523b(0x1fe)]});}catch{}const _0x3bb4ed=resolveAgentPullArgs({'arg':_0x1b7863,'agentNameArg':_0x548e3d,'agentFlag':_0x321731,'contextProject':_0x267c20,'argDirConfig':_0x5e0cb8,'cwdConfigPath':_0x10483c||undefined,'cwdConfig':_0x241f43}),{projectNameOrId:_0x5dd36f,targetAgentName:_0x954ff1,existingOutputDir:_0x1d3f3b,source:_0x1825a6}=_0x3bb4ed;if(_0x1825a6===_0x1e523b(0x170))console[_0x1e523b(0x17b)](a4_0x48726e[_0x1e523b(0x191)](_0x1e523b(0x1e9)+a4_0x549855['join'](_0x1b7863,_0x1e523b(0x16a))+':\x20'+_0x5dd36f));else{if(_0x1825a6===_0x1e523b(0x18a))console[_0x1e523b(0x17b)](a4_0x48726e['dim']('Using\x20project:\x20'+_0x5dd36f));else _0x1825a6===_0x1e523b(0x1c6)&&console[_0x1e523b(0x17b)](a4_0x48726e['dim'](_0x1e523b(0x169)+_0x5dd36f));}if(!_0x5dd36f)return _0x321731?(console[_0x1e523b(0x17b)](a4_0x48726e['yellow']('The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a')),console[_0x1e523b(0x17b)]('Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>'),console['log'](_0x1e523b(0x194))):(console[_0x1e523b(0x17b)](a4_0x48726e[_0x1e523b(0x1ec)](_0x1e523b(0x211))),console[_0x1e523b(0x17b)](_0x1e523b(0x1e5)),console[_0x1e523b(0x17b)]('\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[_0x1e523b(0x17b)](_0x1e523b(0x166)),console[_0x1e523b(0x17b)]('\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'),console[_0x1e523b(0x17b)](_0x1e523b(0x219))),0x1;if(_0x954ff1){const {data:_0x413fcf}=await withSpinner(_0x1e523b(0x20f)+_0x954ff1+_0x1e523b(0x1e1)+_0x5dd36f+_0x1e523b(0x1e3),()=>_0x4e6ba3[_0x1e523b(0x218)]['pullAgent'](_0x5dd36f,_0x954ff1,_0x597b96,{'dryRun':_0x3b339b,'force':_0x49167d}));if(_0x3b339b)return console[_0x1e523b(0x17b)](a4_0x48726e[_0x1e523b(0x1ec)](_0x1e523b(0x18c))),console[_0x1e523b(0x17b)](_0x1e523b(0x17d)+_0x413fcf[_0x1e523b(0x20e)]),console[_0x1e523b(0x17b)](_0x1e523b(0x1ca)+_0x413fcf[_0x1e523b(0x1c9)]),_0x413fcf[_0x1e523b(0x1d2)]&&(console[_0x1e523b(0x17b)](_0x1e523b(0x203)),console[_0x1e523b(0x17b)]('─'[_0x1e523b(0x19c)](0x3c)),console[_0x1e523b(0x17b)](_0x413fcf[_0x1e523b(0x1d2)]),console['log']('─'[_0x1e523b(0x19c)](0x3c))),0x0;return console[_0x1e523b(0x17b)](a4_0x48726e['green'](_0x1e523b(0x1dd))),console['log'](_0x1e523b(0x180)+_0x413fcf[_0x1e523b(0x20e)]),console[_0x1e523b(0x17b)](_0x1e523b(0x1d9)+_0x413fcf[_0x1e523b(0x1c9)]),console[_0x1e523b(0x17b)](_0x1e523b(0x210)+(_0x413fcf['isNew']?a4_0x48726e[_0x1e523b(0x202)]('new'):_0x413fcf['hasChanges']?a4_0x48726e['yellow'](_0x1e523b(0x17c)):a4_0x48726e[_0x1e523b(0x178)](_0x1e523b(0x192)))),0x0;}const _0x108f94=_0x1d3f3b||_0x597b96,{data:_0x81c24}=await withSpinner(_0x1e523b(0x216)+_0x5dd36f+_0x1e523b(0x1e3),()=>_0x4e6ba3[_0x1e523b(0x218)][_0x1e523b(0x18f)](_0x5dd36f,_0x108f94,{'dryRun':!![]})),_0x5904a8=_0x81c24['counts'][_0x1e523b(0x176)][_0x1e523b(0x1fb)]+_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x177)][_0x1e523b(0x1fb)]+_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x215)][_0x1e523b(0x1fb)]+_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x1a2)]['new']+_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x1da)][_0x1e523b(0x1fb)]+_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x20a)][_0x1e523b(0x1fb)]+_0x81c24['counts'][_0x1e523b(0x199)][_0x1e523b(0x1fb)],_0x1fe5b7=_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x176)][_0x1e523b(0x17c)]+_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x177)][_0x1e523b(0x17c)]+_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x215)]['updated']+_0x81c24['counts'][_0x1e523b(0x1a2)][_0x1e523b(0x17c)]+_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x1da)][_0x1e523b(0x17c)]+_0x81c24['counts'][_0x1e523b(0x20a)]['updated']+_0x81c24['counts'][_0x1e523b(0x199)]['updated'],_0x1b0e9b=_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x176)][_0x1e523b(0x192)]+_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x177)][_0x1e523b(0x192)]+_0x81c24['counts'][_0x1e523b(0x215)]['unchanged']+_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x1a2)][_0x1e523b(0x192)]+_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x1da)][_0x1e523b(0x192)]+_0x81c24[_0x1e523b(0x1df)]['experimentalKnowledgeBases'][_0x1e523b(0x192)]+_0x81c24[_0x1e523b(0x1df)]['experimentalArtifacts'][_0x1e523b(0x192)];console['log'](_0x1e523b(0x1db)+_0x81c24['projectName']+'\x27:'),console[_0x1e523b(0x17b)]('\x20\x20'+a4_0x48726e[_0x1e523b(0x202)]('+\x20'+_0x5904a8+_0x1e523b(0x1c8))+_0x1e523b(0x20d)+a4_0x48726e[_0x1e523b(0x1ec)]('~\x20'+_0x1fe5b7+_0x1e523b(0x1f4))+_0x1e523b(0x20d)+a4_0x48726e[_0x1e523b(0x191)]('=\x20'+_0x1b0e9b+_0x1e523b(0x1ee))),console['log'](_0x1e523b(0x1b1)+formatCountSummary(_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x176)])),console[_0x1e523b(0x17b)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x177)])),console[_0x1e523b(0x17b)](_0x1e523b(0x205)+formatCountSummary(_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x215)])),console[_0x1e523b(0x17b)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x81c24['counts'][_0x1e523b(0x1a2)])),console[_0x1e523b(0x17b)](_0x1e523b(0x18d)+formatCountSummary(_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x1da)]));const _0x53f5d1=_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x20a)][_0x1e523b(0x1cc)]>0x0||_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x199)][_0x1e523b(0x1cc)]>0x0;_0x53f5d1&&(console[_0x1e523b(0x17b)](_0x1e523b(0x1aa)+formatCountSummary(_0x81c24[_0x1e523b(0x1df)][_0x1e523b(0x20a)])),console[_0x1e523b(0x17b)](_0x1e523b(0x21a)+formatCountSummary(_0x81c24[_0x1e523b(0x1df)]['experimentalArtifacts'])));console[_0x1e523b(0x17b)](_0x1e523b(0x19d)+a4_0x48726e[_0x1e523b(0x1fc)](_0x81c24[_0x1e523b(0x184)])),displayDiffs(_0x81c24[_0x1e523b(0x176)],_0x81c24[_0x1e523b(0x177)],_0x81c24[_0x1e523b(0x215)],_0x81c24[_0x1e523b(0x1a2)],_0x81c24[_0x1e523b(0x1da)],_0x81c24['experimentalKnowledgeBases'],_0x81c24[_0x1e523b(0x199)]);if(_0x3b339b)return console[_0x1e523b(0x17b)](a4_0x48726e[_0x1e523b(0x1ec)](_0x1e523b(0x1a1))),0x0;if(_0x5904a8===0x0&&_0x1fe5b7===0x0)return console[_0x1e523b(0x17b)](a4_0x48726e['green'](_0x1e523b(0x197))),saveSessionContext({'llm_project':_0x81c24['projectName']},_0x3042a2[_0x1e523b(0x182)]),console[_0x1e523b(0x17b)](a4_0x48726e['green'](_0x1e523b(0x1bd)+a4_0x48726e[_0x1e523b(0x191)]('llm_project')+_0x1e523b(0x19f)+a4_0x48726e[_0x1e523b(0x1fc)](_0x81c24['projectName']))),0x0;if(!_0x34d586&&!_0x49167d){if(!isInteractive())return console[_0x1e523b(0x19e)](a4_0x48726e[_0x1e523b(0x1f5)]('\x0aError:'),_0x1e523b(0x1ae)),console[_0x1e523b(0x19e)](a4_0x48726e[_0x1e523b(0x191)](_0x1e523b(0x1ff))),0x1;const _0x18b16e=await confirmKey(_0x1e523b(0x18e)+(_0x5904a8+_0x1fe5b7)+'\x20files?');if(!_0x18b16e)return console[_0x1e523b(0x17b)](a4_0x48726e[_0x1e523b(0x1ec)](_0x1e523b(0x1c2)),_0x1e523b(0x171)),0x1;}const {data:_0x44964a}=await withSpinner(_0x1e523b(0x1ce),()=>_0x4e6ba3[_0x1e523b(0x218)][_0x1e523b(0x18f)](_0x5dd36f,_0x108f94,{'force':_0x49167d}));return console[_0x1e523b(0x17b)](a4_0x48726e['green'](_0x1e523b(0x212)+(_0x5904a8+_0x1fe5b7)+_0x1e523b(0x172)+_0x44964a[_0x1e523b(0x184)])),saveSessionContext({'llm_project':_0x44964a[_0x1e523b(0x190)]},_0x3042a2['session']),console[_0x1e523b(0x17b)](a4_0x48726e[_0x1e523b(0x202)]('✔\x20Context\x20set:\x20'+a4_0x48726e[_0x1e523b(0x191)](_0x1e523b(0x1fe))+_0x1e523b(0x19f)+a4_0x48726e['cyan'](_0x44964a[_0x1e523b(0x190)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x321400(0x1e2)]=a4_0x321400(0x1f2);[a4_0x321400(0x1f3)]=a4_0x321400(0x214);async['execute'](_0x5767da){const _0x27f328=a4_0x321400,{options:_0x24b6a6,args:_0x57cde5,tdx:_0x453e39}=_0x5767da,_0x5eaeba=_0x57cde5[0x0],_0x5e055d=_0x24b6a6[_0x27f328(0x1e2)],_0x29ebf6=_0x24b6a6[_0x27f328(0x1dc)],_0x1aab89=_0x24b6a6[_0x27f328(0x21c)],_0x463c1e=_0x24b6a6[_0x27f328(0x1f6)],_0x59bdcb=_0x24b6a6[_0x27f328(0x187)];let _0x42757f;const _0xbe597d=findAgentConfigPath(process[_0x27f328(0x226)]());if(_0x5eaeba){const _0x4c759d=a4_0x549855[_0x27f328(0x208)](_0x5eaeba,_0x27f328(0x16a));existsSync(_0x4c759d)?(_0x42757f=_0x5eaeba,console[_0x27f328(0x17b)](a4_0x48726e[_0x27f328(0x191)](_0x27f328(0x181)+_0x5eaeba))):_0x42757f=_0x5eaeba;}else{if(_0xbe597d)_0x42757f=a4_0x549855[_0x27f328(0x200)](_0xbe597d),console['log'](a4_0x48726e['dim'](_0x27f328(0x18b)+_0x42757f));else{if(_0x59bdcb){const _0x4925ab=sanitizeForFilesystem(_0x59bdcb);let _0x2fb1cd=_0x4925ab,_0xfcfdac=a4_0x549855[_0x27f328(0x208)](process[_0x27f328(0x226)](),'agents',_0x4925ab,'tdx.json');if(!existsSync(_0xfcfdac)){const _0xe28c77=normalizeName(_0x59bdcb),_0x1efd44=a4_0x549855[_0x27f328(0x208)](process[_0x27f328(0x226)](),_0x27f328(0x176),_0xe28c77,_0x27f328(0x16a));existsSync(_0x1efd44)&&(_0x2fb1cd=_0xe28c77,_0xfcfdac=_0x1efd44);}if(existsSync(_0xfcfdac))_0x42757f=a4_0x549855[_0x27f328(0x200)](_0xfcfdac),console[_0x27f328(0x17b)](a4_0x48726e['dim'](_0x27f328(0x181)+_0x42757f));else{const _0x5f19a0=_0x24b6a6[_0x27f328(0x175)];if(_0x5f19a0)throw new SDKError(ErrorCode[_0x27f328(0x188)],_0x27f328(0x1de)+_0x59bdcb+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x27f328(0x1ba)+_0x27f328(0x1fa)+(_0x27f328(0x1cf)+_0x59bdcb+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x2fb1cd+'\x20--name\x20'+(_0x5e055d||'<new-name>')+_0x27f328(0x1a0)+_0x5f19a0)});_0x42757f=_0x59bdcb,console[_0x27f328(0x17b)](a4_0x48726e[_0x27f328(0x191)](_0x27f328(0x183)+_0x59bdcb));}}}}if(!_0x42757f)return console[_0x27f328(0x17b)](a4_0x48726e[_0x27f328(0x1ec)](_0x27f328(0x17f))),console[_0x27f328(0x17b)](_0x27f328(0x165)),console[_0x27f328(0x17b)](_0x27f328(0x16c)),console[_0x27f328(0x17b)](_0x27f328(0x189)),console[_0x27f328(0x17b)](_0x27f328(0x1bf)),0x1;if(!_0x5e055d)throw new SDKError(ErrorCode[_0x27f328(0x1a7)],_0x27f328(0x220),undefined,{'helpText':_0x27f328(0x198)});if(!_0x1aab89&&!_0x29ebf6){if(!isInteractive())return console[_0x27f328(0x19e)](a4_0x48726e[_0x27f328(0x1f5)](_0x27f328(0x1b4)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x27f328(0x19e)](a4_0x48726e[_0x27f328(0x191)](_0x27f328(0x1ff))),0x1;const _0x14b51c=await confirmKey(_0x27f328(0x221)+_0x42757f+_0x27f328(0x1b2)+_0x5e055d+'\x22?');if(!_0x14b51c)return console['log'](a4_0x48726e['yellow'](_0x27f328(0x1c2))),0x1;}const {data:_0x3b8f39}=await withSpinner(_0x27f328(0x168)+_0x42757f+_0x27f328(0x21f)+_0x5e055d+_0x27f328(0x1e3),()=>_0x453e39[_0x27f328(0x218)][_0x27f328(0x1be)](_0x42757f,_0x5e055d,{'dryRun':_0x29ebf6}));if(_0x29ebf6){console[_0x27f328(0x17b)](a4_0x48726e[_0x27f328(0x1ec)](_0x27f328(0x1c3))),console[_0x27f328(0x17b)](_0x27f328(0x164)+_0x3b8f39[_0x27f328(0x174)]),console['log']('New\x20project:\x20'+_0x5e055d),console[_0x27f328(0x17b)](_0x27f328(0x1d7)),console[_0x27f328(0x17b)](_0x27f328(0x1b1)+_0x3b8f39['counts'][_0x27f328(0x176)][_0x27f328(0x1ac)]),console['log'](_0x27f328(0x1b8)+_0x3b8f39['counts'][_0x27f328(0x177)][_0x27f328(0x1ac)]),console['log'](_0x27f328(0x1c5)+_0x3b8f39[_0x27f328(0x1df)][_0x27f328(0x1a2)][_0x27f328(0x1ac)]);const _0x25a690=_0x3b8f39[_0x27f328(0x1df)][_0x27f328(0x20a)][_0x27f328(0x1ac)]>0x0||_0x3b8f39['counts'][_0x27f328(0x199)][_0x27f328(0x1ac)]>0x0;return _0x25a690&&(console[_0x27f328(0x17b)](_0x27f328(0x1aa)+_0x3b8f39[_0x27f328(0x1df)][_0x27f328(0x20a)][_0x27f328(0x1ac)]),console['log'](_0x27f328(0x21a)+_0x3b8f39[_0x27f328(0x1df)][_0x27f328(0x199)]['created'])),0x0;}const _0x3d2bae=_0x3b8f39[_0x27f328(0x1df)][_0x27f328(0x176)][_0x27f328(0x1fd)]>0x0||_0x3b8f39[_0x27f328(0x1df)][_0x27f328(0x177)][_0x27f328(0x1fd)]>0x0||_0x3b8f39[_0x27f328(0x1df)][_0x27f328(0x1a2)][_0x27f328(0x1fd)]>0x0||_0x3b8f39[_0x27f328(0x1df)]['experimentalKnowledgeBases'][_0x27f328(0x1fd)]>0x0||_0x3b8f39[_0x27f328(0x1df)][_0x27f328(0x199)][_0x27f328(0x1fd)]>0x0;_0x3d2bae?console[_0x27f328(0x17b)](a4_0x48726e['yellow'](_0x27f328(0x1a4))):console[_0x27f328(0x17b)](a4_0x48726e[_0x27f328(0x202)](_0x27f328(0x1d0)));console[_0x27f328(0x17b)]('Source:\x20'+_0x3b8f39['sourceProjectName']),console[_0x27f328(0x17b)](_0x27f328(0x1f0)+_0x3b8f39['newProjectName']),console[_0x27f328(0x17b)](_0x27f328(0x1c1)+_0x3b8f39[_0x27f328(0x225)]),console[_0x27f328(0x17b)](),console[_0x27f328(0x17b)](_0x27f328(0x1f1)),console[_0x27f328(0x17b)](_0x27f328(0x1b1)+formatCountSummary(_0x3b8f39[_0x27f328(0x1df)][_0x27f328(0x176)])),console[_0x27f328(0x17b)](_0x27f328(0x1b8)+formatCountSummary(_0x3b8f39['counts'][_0x27f328(0x177)])),console[_0x27f328(0x17b)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x3b8f39['counts'][_0x27f328(0x1a2)])),console[_0x27f328(0x17b)](_0x27f328(0x18d)+formatCountSummary(_0x3b8f39[_0x27f328(0x1df)][_0x27f328(0x1da)]));const _0x1b7722=_0x3b8f39[_0x27f328(0x1df)]['experimentalKnowledgeBases'][_0x27f328(0x1ac)]>0x0||_0x3b8f39[_0x27f328(0x1df)][_0x27f328(0x20a)][_0x27f328(0x17c)]>0x0||_0x3b8f39[_0x27f328(0x1df)][_0x27f328(0x20a)][_0x27f328(0x192)]>0x0||_0x3b8f39[_0x27f328(0x1df)]['experimentalArtifacts']['created']>0x0||_0x3b8f39[_0x27f328(0x1df)][_0x27f328(0x199)]['updated']>0x0||_0x3b8f39['counts'][_0x27f328(0x199)][_0x27f328(0x192)]>0x0;_0x1b7722&&(console[_0x27f328(0x17b)](_0x27f328(0x1aa)+formatCountSummary(_0x3b8f39[_0x27f328(0x1df)][_0x27f328(0x20a)])),console[_0x27f328(0x17b)](_0x27f328(0x21a)+formatCountSummary(_0x3b8f39['counts']['experimentalArtifacts'])));if(_0x3d2bae){console[_0x27f328(0x17b)](),console[_0x27f328(0x17b)](a4_0x48726e[_0x27f328(0x1f5)]('Errors:'));for(const _0x258d54 of _0x3b8f39[_0x27f328(0x176)]){_0x258d54[_0x27f328(0x1d3)]===_0x27f328(0x19e)&&console[_0x27f328(0x17b)](a4_0x48726e[_0x27f328(0x1f5)](_0x27f328(0x1a8)+_0x258d54[_0x27f328(0x20e)]+_0x27f328(0x1f8)+_0x258d54['error']));}for(const _0x412a19 of _0x3b8f39['knowledgeBases']){_0x412a19[_0x27f328(0x1d3)]===_0x27f328(0x19e)&&console[_0x27f328(0x17b)](a4_0x48726e[_0x27f328(0x1f5)](_0x27f328(0x17e)+_0x412a19[_0x27f328(0x1e2)]+_0x27f328(0x1f8)+_0x412a19[_0x27f328(0x19e)]));}for(const _0x55418e of _0x3b8f39[_0x27f328(0x1a2)]){_0x55418e[_0x27f328(0x1d3)]===_0x27f328(0x19e)&&console[_0x27f328(0x17b)](a4_0x48726e[_0x27f328(0x1f5)](_0x27f328(0x1bb)+_0x55418e['name']+_0x27f328(0x1f8)+_0x55418e[_0x27f328(0x19e)]));}for(const _0x5c2b71 of _0x3b8f39['integrations']){_0x5c2b71['action']===_0x27f328(0x19e)&&console[_0x27f328(0x17b)](a4_0x48726e[_0x27f328(0x1f5)](_0x27f328(0x1e7)+_0x5c2b71[_0x27f328(0x1e2)]+_0x27f328(0x1f8)+_0x5c2b71['error']));}for(const _0x18d775 of _0x3b8f39['experimentalKnowledgeBases']){_0x18d775[_0x27f328(0x1d3)]===_0x27f328(0x19e)&&console[_0x27f328(0x17b)](a4_0x48726e['red'](_0x27f328(0x1c7)+_0x18d775[_0x27f328(0x1e2)]+_0x27f328(0x1f8)+_0x18d775[_0x27f328(0x19e)]));}for(const _0x476662 of _0x3b8f39[_0x27f328(0x199)]){_0x476662[_0x27f328(0x1d3)]==='error'&&console[_0x27f328(0x17b)](a4_0x48726e[_0x27f328(0x1f5)](_0x27f328(0x167)+_0x476662['name']+_0x27f328(0x1f8)+_0x476662[_0x27f328(0x19e)]));}return 0x1;}console[_0x27f328(0x17b)]();const _0x84daf9=getLLMProjectUrl(_0x463c1e,_0x3b8f39[_0x27f328(0x225)]);return console[_0x27f328(0x17b)](_0x27f328(0x196)+a4_0x48726e[_0x27f328(0x1fc)](_0x84daf9)),0x0;}}function a4_0xe70e(_0x3bf396,_0x277edc){_0x3bf396=_0x3bf396-0x164;const _0x548048=a4_0x5480();let _0xe70ee7=_0x548048[_0x3bf396];return _0xe70ee7;}export class AgentPushCommand extends BaseCommand{[a4_0x321400(0x1e2)]=a4_0x321400(0x1d1);[a4_0x321400(0x1f3)]=a4_0x321400(0x1ef);async[a4_0x321400(0x222)](_0x2a720b){const _0x1a54e3=a4_0x321400,{options:_0x3a6db8,args:_0x5dacba,tdx:_0x4fab18}=_0x2a720b;let _0x451ffb=_0x5dacba[0x0]||process['cwd']();const _0x12de37=_0x3a6db8['dryRun'],_0xa63e9b=_0x3a6db8[_0x1a54e3(0x224)],_0x191252=_0x3a6db8[_0x1a54e3(0x21c)],_0x28a9a7=_0x3a6db8['site'],_0x3bec93=a4_0x549855['join'](_0x451ffb,_0x1a54e3(0x1a9)),_0x355455=existsSync(_0x3bec93);if(_0x355455){const {data:_0x4086d6}=await withSpinner(_0x1a54e3(0x1ed)+_0x451ffb+_0x1a54e3(0x1e3),()=>_0x4fab18['llm'][_0x1a54e3(0x186)](_0x451ffb,{'dryRun':_0x12de37,'force':_0xa63e9b}));if(_0x12de37)return console[_0x1a54e3(0x17b)](a4_0x48726e[_0x1a54e3(0x1ec)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x1a54e3(0x17b)](_0x1a54e3(0x21e)+_0x4086d6[_0x1a54e3(0x20e)]),0x0;if(_0x4086d6['action']===_0x1a54e3(0x19e))return console[_0x1a54e3(0x17b)](a4_0x48726e[_0x1a54e3(0x1f5)](_0x1a54e3(0x223)+_0x4086d6[_0x1a54e3(0x19e)])),0x1;console[_0x1a54e3(0x17b)](a4_0x48726e[_0x1a54e3(0x202)](_0x1a54e3(0x19b)+_0x4086d6[_0x1a54e3(0x1d3)]+_0x1a54e3(0x1c0))),console['log']('Agent:\x20'+_0x4086d6[_0x1a54e3(0x20e)]);if(_0x4086d6[_0x1a54e3(0x1ea)]&&_0x4086d6['projectId']){const _0x8d9d4d=getLLMAgentChatUrl(_0x28a9a7,_0x4086d6[_0x1a54e3(0x21d)],_0x4086d6[_0x1a54e3(0x1ea)]);console['log'](_0x1a54e3(0x173)+a4_0x48726e[_0x1a54e3(0x1fc)](_0x8d9d4d));}return 0x0;}const _0x6cc956=_0x3a6db8[_0x1a54e3(0x187)],_0x549b31=resolveProjectFromContext(_0x451ffb,_0x6cc956);if(_0x549b31[_0x1a54e3(0x1b6)])_0x451ffb=_0x549b31[_0x1a54e3(0x1e6)],_0x549b31[_0x1a54e3(0x1eb)]===_0x1a54e3(0x1c6)&&console['log'](a4_0x48726e[_0x1a54e3(0x191)](_0x1a54e3(0x1f9)+_0x451ffb));else{let _0x49c105=_0x1a54e3(0x206);_0x549b31['reason']===_0x1a54e3(0x1b7)&&(_0x49c105=_0x549b31[_0x1a54e3(0x1e0)]+_0x1a54e3(0x1a5)+_0x549b31[_0x1a54e3(0x187)]+_0x1a54e3(0x179));throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x549b31[_0x1a54e3(0x17a)]===_0x1a54e3(0x1d4)?_0x549b31[_0x1a54e3(0x1e0)]:'No\x20tdx.json\x20found\x20in\x20'+_0x451ffb,undefined,{'helpText':_0x49c105});}const {data:_0x5d7a02}=await withSpinner(_0x1a54e3(0x21b),()=>_0x4fab18[_0x1a54e3(0x218)][_0x1a54e3(0x1d8)](_0x451ffb,{'dryRun':!![]})),_0x1e7194=_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x176)]['errors']>0x0;if(_0x1e7194){console[_0x1a54e3(0x17b)](a4_0x48726e[_0x1a54e3(0x1f5)]('\x0aErrors\x20found:'));for(const _0x3f8a7a of _0x5d7a02[_0x1a54e3(0x176)]){_0x3f8a7a['action']==='error'&&console[_0x1a54e3(0x17b)](a4_0x48726e[_0x1a54e3(0x1f5)](_0x1a54e3(0x1a8)+_0x3f8a7a['agentName']+_0x1a54e3(0x1f8)+_0x3f8a7a[_0x1a54e3(0x19e)]));}return 0x1;}const _0x3e1a9e=_0x5d7a02[_0x1a54e3(0x1df)]['agents']['created']+_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x177)]['created']+_0x5d7a02[_0x1a54e3(0x1df)]['textKnowledgeBases']['created']+_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x1a2)][_0x1a54e3(0x1ac)]+_0x5d7a02['counts'][_0x1a54e3(0x1da)][_0x1a54e3(0x1ac)]+_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x20a)][_0x1a54e3(0x1ac)]+_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x199)][_0x1a54e3(0x1ac)],_0x454f45=_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x176)]['updated']+_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x177)]['updated']+_0x5d7a02[_0x1a54e3(0x1df)]['textKnowledgeBases'][_0x1a54e3(0x17c)]+_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x1a2)][_0x1a54e3(0x17c)]+_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x1da)]['updated']+_0x5d7a02['counts'][_0x1a54e3(0x20a)][_0x1a54e3(0x17c)]+_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x199)]['updated'],_0xcfa50c=_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x176)]['unchanged']+_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x177)]['unchanged']+_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x215)][_0x1a54e3(0x192)]+_0x5d7a02[_0x1a54e3(0x1df)]['prompts'][_0x1a54e3(0x192)]+_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x1da)]['unchanged']+_0x5d7a02[_0x1a54e3(0x1df)]['experimentalKnowledgeBases']['unchanged']+_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x199)][_0x1a54e3(0x192)];console[_0x1a54e3(0x17b)](_0x1a54e3(0x16f)+_0x5d7a02[_0x1a54e3(0x190)]+'\x27:'),console[_0x1a54e3(0x17b)]('\x20\x20'+a4_0x48726e[_0x1a54e3(0x202)]('+\x20'+_0x3e1a9e+'\x20new')+_0x1a54e3(0x20d)+a4_0x48726e['yellow']('~\x20'+_0x454f45+_0x1a54e3(0x1f4))+'\x20|\x20'+a4_0x48726e[_0x1a54e3(0x191)]('=\x20'+_0xcfa50c+_0x1a54e3(0x1ee))),console[_0x1a54e3(0x17b)]('\x20\x20Agents:\x20'+formatCountSummary(_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x176)])),console[_0x1a54e3(0x17b)](_0x1a54e3(0x1b8)+formatCountSummary(_0x5d7a02['counts'][_0x1a54e3(0x177)])),console[_0x1a54e3(0x17b)](_0x1a54e3(0x205)+formatCountSummary(_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x215)])),console[_0x1a54e3(0x17b)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x1a2)])),console[_0x1a54e3(0x17b)](_0x1a54e3(0x18d)+formatCountSummary(_0x5d7a02[_0x1a54e3(0x1df)]['integrations']));const _0x35875e=_0x5d7a02['counts'][_0x1a54e3(0x20a)][_0x1a54e3(0x1ac)]>0x0||_0x5d7a02['counts'][_0x1a54e3(0x20a)][_0x1a54e3(0x17c)]>0x0||_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x20a)][_0x1a54e3(0x192)]>0x0||_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x199)][_0x1a54e3(0x1ac)]>0x0||_0x5d7a02[_0x1a54e3(0x1df)]['experimentalArtifacts']['updated']>0x0||_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x199)]['unchanged']>0x0;_0x35875e&&(console[_0x1a54e3(0x17b)](_0x1a54e3(0x1aa)+formatCountSummary(_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x20a)])),console[_0x1a54e3(0x17b)](_0x1a54e3(0x21a)+formatCountSummary(_0x5d7a02[_0x1a54e3(0x1df)][_0x1a54e3(0x199)])));console[_0x1a54e3(0x17b)]('\x20\x20Source:\x20'+a4_0x48726e[_0x1a54e3(0x1fc)](_0x451ffb)),displayDiffs(_0x5d7a02[_0x1a54e3(0x176)],_0x5d7a02[_0x1a54e3(0x177)],_0x5d7a02['textKnowledgeBases'],_0x5d7a02['prompts'],_0x5d7a02[_0x1a54e3(0x1da)],_0x5d7a02[_0x1a54e3(0x20a)],_0x5d7a02['experimentalArtifacts']);if(_0x12de37)return console[_0x1a54e3(0x17b)](a4_0x48726e['yellow'](_0x1a54e3(0x1f7))),0x0;if(_0x3e1a9e===0x0&&_0x454f45===0x0){console['log'](a4_0x48726e[_0x1a54e3(0x202)](_0x1a54e3(0x195)));const _0x3c7984=getLLMProjectUrl(_0x28a9a7,_0x5d7a02[_0x1a54e3(0x21d)]);return console['log'](_0x1a54e3(0x196)+a4_0x48726e['cyan'](_0x3c7984)),0x0;}if(!_0x191252&&!_0xa63e9b){if(!isInteractive())return console[_0x1a54e3(0x19e)](a4_0x48726e['red']('\x0aError:'),_0x1a54e3(0x1ae)),console[_0x1a54e3(0x19e)](a4_0x48726e['dim'](_0x1a54e3(0x1ff))),0x1;const _0x102e5d=await confirmKey(_0x1a54e3(0x1ad)+(_0x3e1a9e+_0x454f45)+'\x20resources?');if(!_0x102e5d)return console['log'](a4_0x48726e[_0x1a54e3(0x1ec)](_0x1a54e3(0x1c2)),_0x1a54e3(0x1b5)),0x1;}const {data:_0x21ba5e}=await withSpinner(_0x1a54e3(0x19a),()=>_0x4fab18[_0x1a54e3(0x218)][_0x1a54e3(0x1d8)](_0x451ffb,{'force':_0xa63e9b})),_0x95a502=_0x21ba5e['counts'][_0x1a54e3(0x176)][_0x1a54e3(0x1fd)]>0x0||_0x21ba5e['counts'][_0x1a54e3(0x177)][_0x1a54e3(0x1fd)]>0x0||_0x21ba5e[_0x1a54e3(0x1df)][_0x1a54e3(0x215)][_0x1a54e3(0x1fd)]>0x0||_0x21ba5e[_0x1a54e3(0x1df)][_0x1a54e3(0x1a2)][_0x1a54e3(0x1fd)]>0x0;if(_0x95a502){console[_0x1a54e3(0x17b)](a4_0x48726e[_0x1a54e3(0x1ec)]('\x0aProject\x20pushed\x20with\x20errors')),console['log'](),console[_0x1a54e3(0x17b)](a4_0x48726e[_0x1a54e3(0x1f5)](_0x1a54e3(0x1e4)));for(const _0x101174 of _0x21ba5e[_0x1a54e3(0x176)]){_0x101174[_0x1a54e3(0x1d3)]==='error'&&console[_0x1a54e3(0x17b)](a4_0x48726e[_0x1a54e3(0x1f5)](_0x1a54e3(0x1a8)+_0x101174[_0x1a54e3(0x20e)]+_0x1a54e3(0x1f8)+_0x101174['error']));}for(const _0x29ddc2 of _0x21ba5e['knowledgeBases']){_0x29ddc2[_0x1a54e3(0x1d3)]===_0x1a54e3(0x19e)&&console[_0x1a54e3(0x17b)](a4_0x48726e['red']('\x20\x20Knowledge\x20Base\x20\x22'+_0x29ddc2[_0x1a54e3(0x1e2)]+_0x1a54e3(0x1f8)+_0x29ddc2['error']));}for(const _0x589f8e of _0x21ba5e[_0x1a54e3(0x215)]){_0x589f8e[_0x1a54e3(0x1d3)]==='error'&&console[_0x1a54e3(0x17b)](a4_0x48726e['red'](_0x1a54e3(0x185)+_0x589f8e[_0x1a54e3(0x1e2)]+'\x22:\x20'+_0x589f8e[_0x1a54e3(0x19e)]));}for(const _0x46ccf5 of _0x21ba5e['prompts']){_0x46ccf5[_0x1a54e3(0x1d3)]===_0x1a54e3(0x19e)&&console[_0x1a54e3(0x17b)](a4_0x48726e[_0x1a54e3(0x1f5)](_0x1a54e3(0x1bb)+_0x46ccf5[_0x1a54e3(0x1e2)]+_0x1a54e3(0x1f8)+_0x46ccf5['error']));}for(const _0x470644 of _0x21ba5e[_0x1a54e3(0x1da)]){_0x470644['action']===_0x1a54e3(0x19e)&&console['log'](a4_0x48726e[_0x1a54e3(0x1f5)](_0x1a54e3(0x1e7)+_0x470644[_0x1a54e3(0x1e2)]+'\x22:\x20'+_0x470644['error']));}return 0x1;}console['log'](a4_0x48726e[_0x1a54e3(0x202)](_0x1a54e3(0x1bc)+(_0x3e1a9e+_0x454f45)+_0x1a54e3(0x20c)+_0x21ba5e[_0x1a54e3(0x190)]+'\x27'));const _0x429542=getLLMProjectUrl(_0x28a9a7,_0x21ba5e[_0x1a54e3(0x21d)]);return console[_0x1a54e3(0x17b)](_0x1a54e3(0x196)+a4_0x48726e[_0x1a54e3(0x1fc)](_0x429542)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a5_0x202f(_0x212be9,_0x457099){_0x212be9=_0x212be9-0x12e;const _0x5d095b=a5_0x5d09();let _0x202fab=_0x5d095b[_0x212be9];return _0x202fab;}const a5_0xdd547f=a5_0x202f;(function(_0x4f8332,_0x4475fa){const _0x203bb3=a5_0x202f,_0x54dcc2=_0x4f8332();while(!![]){try{const _0xae107a=-parseInt(_0x203bb3(0x19f))/0x1*(-parseInt(_0x203bb3(0x180))/0x2)+-parseInt(_0x203bb3(0x1c4))/0x3+-parseInt(_0x203bb3(0x18f))/0x4+parseInt(_0x203bb3(0x16c))/0x5*(-parseInt(_0x203bb3(0x1a5))/0x6)+-parseInt(_0x203bb3(0x13e))/0x7*(-parseInt(_0x203bb3(0x130))/0x8)+-parseInt(_0x203bb3(0x1bb))/0x9+parseInt(_0x203bb3(0x1c3))/0xa*(parseInt(_0x203bb3(0x1b0))/0xb);if(_0xae107a===_0x4475fa)break;else _0x54dcc2['push'](_0x54dcc2['shift']());}catch(_0x329e73){_0x54dcc2['push'](_0x54dcc2['shift']());}}}(a5_0x5d09,0xde827));import*as a5_0x543ebe from'node:fs';import*as a5_0x12bfc0 from'node:path';import a5_0x52832e from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';function a5_0x5d09(){const _0x432149=['Running\x20test:\x20','now','green','Test\x20Summary','PASS','projectDir',':\x20Sending\x20user\x20input...','resolve','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','yellow','...\x20','basename','6239366VHpSPh','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','\x20\x20Site:\x20','✗\x20FAIL:\x20','ERROR','Conversation\x20URL:\x20','Usage:','multiple_agents','Total:\x20\x20\x20\x20','Running:\x20','verbose','add','Re-evaluating...','FAIL','reason','no_context','utf-8','Re-evaluating\x20','round','\x27\x20to\x20create\x20the\x20folder\x20structure.','llmProject','test.yml','dim','Run\x20tests\x20for\x20an\x20LLM\x20agent','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','no_tests','agent','✗\x20ERROR:\x20Project\x20not\x20found:\x20','\x20\x20-\x20','text','not\x20found','conversation_url','Cached\x20run\x20is\x20from\x20site\x20\x22','tsv','substring','\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','Test\x20Configuration:','\x20\x20Project:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','push','Tests\x20found:\x20','description','message','Failed:\x20\x20\x20','Either\x20switch\x20to\x20the\x20\x22','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','4041185ZwHGnA','toISOString','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','resolveAgentId','Errors:\x20\x20\x20','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','Duration:\x20','Failed\x20Tests:','agent:test','writeFileSync','red','forEach','Run\x20\x27tdx\x20agent\x20pull\x20','map','timestamp','reeval','no_local_folder','length','404','source','10DsYkpf','site','Running\x20agent\x20tests...','\x22,\x20but\x20current\x20site\x20is\x20\x22','Error:\x20No\x20previous\x20test\x20run\x20found.','✓\x20PASS:\x20','rounds','agentName','\x20\x20Conversation:\x20','Cached\x20run\x20from:\x20','status','\x20-\x20','start','trim','toLowerCase','3510956bkxTjC','resolveProjectId','\x20(new)','log','executeReeval','tests','...','join','split','some','\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','white','New\x20tests\x20to\x20execute:\x20','repeat','json','131523WDJqXl','filter','Test\x20','Evaluating\x20response...','cyan','✗\x20ERROR:\x20','12fISrtP','\x22:\x20','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','table','testYmlPath','Using\x20agent:\x20','Site:\x20','Error\x20writing\x20output\x20file:\x20','stop','\x20\x20Evaluating...\x20','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','115445zTrwwT','Available\x20tests:\x20','find','/<agent-name>','name','tags','Agent:\x20','Round\x201/','found','llm','\x20\x20Round\x20','6698763sgVVJm','Available\x20tags:\x20','context','projectName','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','Passed:\x20\x20\x20','output','1930fJcfZS','947721QVOpRD','jsonl','includes','Output\x20written\x20to:\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','agentDirs','16jQkKjX','Executing\x20new\x20tests...'];a5_0x5d09=function(){return _0x432149;};return a5_0x5d09();}import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0xdd547f(0x1b4)]=a5_0xdd547f(0x174);[a5_0xdd547f(0x167)]=a5_0xdd547f(0x155);async['execute'](_0x27c79c){const _0x36b9c5=a5_0xdd547f,{options:_0x5bbdff,args:_0x15dda7,tdx:_0x56782a}=_0x27c79c,_0x56aebf=_0x15dda7[0x0]||'.',_0x5828f8=_0x5bbdff['dryRun'],_0x1bc3f2=_0x5bbdff,_0x4dc2e7=_0x1bc3f2['eval']===![],_0x2a3b8b=_0x1bc3f2[_0x36b9c5(0x17b)],_0x56e277=_0x1bc3f2[_0x36b9c5(0x1b4)],_0x268662=_0x1bc3f2[_0x36b9c5(0x1b5)],_0x414c84=_0x5bbdff[_0x36b9c5(0x181)],_0x3a60ca=_0x1bc3f2[_0x36b9c5(0x1c2)];if(_0x2a3b8b&&_0x4dc2e7)return console[_0x36b9c5(0x192)](a5_0x52832e['red'](_0x36b9c5(0x16e))),0x1;let _0x797dd4=_0x36b9c5(0x1a8);if(_0x1bc3f2[_0x36b9c5(0x19e)])_0x797dd4=_0x36b9c5(0x19e);else{if(_0x1bc3f2[_0x36b9c5(0x1c5)])_0x797dd4='jsonl';else{if(_0x1bc3f2[_0x36b9c5(0x15f)])_0x797dd4=_0x36b9c5(0x15f);else{if(_0x1bc3f2[_0x36b9c5(0x1a8)])_0x797dd4=_0x36b9c5(0x1a8);}}}const _0x3169cb=_0x1bc3f2['llmProject'];let _0x55adcb=_0x56aebf;const _0x2a8105=a5_0x543ebe['existsSync'](_0x56aebf),_0x4b28cc=_0x56aebf==='.';if(!_0x2a8105||_0x4b28cc){const _0x4ed351=resolveProjectFromContext(_0x56aebf,_0x3169cb,{'requireFile':_0x36b9c5(0x153)});if(_0x4ed351[_0x36b9c5(0x1b8)])_0x55adcb=_0x4ed351[_0x36b9c5(0x137)],_0x4ed351[_0x36b9c5(0x17f)]===_0x36b9c5(0x1bd)&&console[_0x36b9c5(0x192)](a5_0x52832e[_0x36b9c5(0x154)](_0x36b9c5(0x1aa)+_0x55adcb));else switch(_0x4ed351[_0x36b9c5(0x14c)]){case _0x36b9c5(0x14d):console[_0x36b9c5(0x192)](a5_0x52832e[_0x36b9c5(0x13b)](_0x4ed351[_0x36b9c5(0x168)])),console[_0x36b9c5(0x192)](),console[_0x36b9c5(0x192)](_0x36b9c5(0x144)),console[_0x36b9c5(0x192)](_0x36b9c5(0x161)),console[_0x36b9c5(0x192)](_0x36b9c5(0x199)),console[_0x36b9c5(0x192)](),console[_0x36b9c5(0x192)](_0x36b9c5(0x19a));return 0x1;case _0x36b9c5(0x17c):console[_0x36b9c5(0x192)](a5_0x52832e[_0x36b9c5(0x13b)](_0x4ed351[_0x36b9c5(0x168)])),console['log'](),console[_0x36b9c5(0x192)](_0x36b9c5(0x178)+_0x4ed351[_0x36b9c5(0x152)]+_0x36b9c5(0x151));return 0x1;case _0x36b9c5(0x145):{const _0x3cb9d9=a5_0x12bfc0[_0x36b9c5(0x13d)](_0x4ed351[_0x36b9c5(0x137)]);console[_0x36b9c5(0x192)](a5_0x52832e[_0x36b9c5(0x13b)](_0x36b9c5(0x1a7)+_0x4ed351[_0x36b9c5(0x152)]+'\x22:'));for(const _0x252992 of _0x4ed351[_0x36b9c5(0x12f)]){console[_0x36b9c5(0x192)](_0x36b9c5(0x15a)+_0x252992);}return console[_0x36b9c5(0x192)](),console['log'](_0x36b9c5(0x1c0)+_0x3cb9d9+_0x36b9c5(0x1b3)),0x1;}case _0x36b9c5(0x157):console['log'](a5_0x52832e[_0x36b9c5(0x13b)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x4ed351['llmProject']+'\x22.')),console[_0x36b9c5(0x192)](a5_0x52832e['dim']('Project\x20path:\x20'+_0x4ed351['projectDir'])),console[_0x36b9c5(0x192)](),console['log']('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0x3f462b,agentInfo:_0x466651}=parseTestFile(_0x55adcb);let _0x40d950=_0x3f462b[_0x36b9c5(0x194)];if(_0x56e277){const _0x1510f8=_0x56e277['split'](',')[_0x36b9c5(0x179)](_0x37cf9b=>_0x37cf9b[_0x36b9c5(0x18d)]());_0x40d950=_0x3f462b[_0x36b9c5(0x194)][_0x36b9c5(0x1a0)](_0x2809dc=>_0x1510f8[_0x36b9c5(0x1c6)](_0x2809dc[_0x36b9c5(0x1b4)]));if(_0x40d950[_0x36b9c5(0x17d)]===0x0)return console['log'](a5_0x52832e[_0x36b9c5(0x13b)]('No\x20tests\x20found\x20matching:\x20'+_0x56e277)),console[_0x36b9c5(0x192)](a5_0x52832e[_0x36b9c5(0x154)](_0x36b9c5(0x1b1)+_0x3f462b[_0x36b9c5(0x194)]['map'](_0x3740fc=>_0x3740fc['name'])['join'](',\x20'))),0x1;}if(_0x268662){const _0x16ddcb=_0x268662[_0x36b9c5(0x197)](',')[_0x36b9c5(0x179)](_0x924c46=>_0x924c46[_0x36b9c5(0x18d)]()[_0x36b9c5(0x18e)]());_0x40d950=_0x40d950[_0x36b9c5(0x1a0)](_0x2f33c6=>_0x2f33c6[_0x36b9c5(0x1b5)]?.[_0x36b9c5(0x198)](_0x68d91f=>_0x16ddcb[_0x36b9c5(0x1c6)](_0x68d91f[_0x36b9c5(0x18e)]())));if(_0x40d950['length']===0x0){console[_0x36b9c5(0x192)](a5_0x52832e[_0x36b9c5(0x13b)]('No\x20tests\x20found\x20with\x20tags:\x20'+_0x268662));const _0x27ddea=new Set();return _0x3f462b['tests'][_0x36b9c5(0x177)](_0x4a1ab8=>_0x4a1ab8[_0x36b9c5(0x1b5)]?.[_0x36b9c5(0x177)](_0x299981=>_0x27ddea[_0x36b9c5(0x149)](_0x299981))),_0x27ddea['size']>0x0?console['log'](a5_0x52832e[_0x36b9c5(0x154)](_0x36b9c5(0x1bc)+[..._0x27ddea][_0x36b9c5(0x196)](',\x20'))):console[_0x36b9c5(0x192)](a5_0x52832e[_0x36b9c5(0x154)]('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0x2a3b8b)return this[_0x36b9c5(0x193)](_0x27c79c,{'definition':{'tests':_0x40d950},'agentInfo':_0x466651,'outputFormat':_0x797dd4,'outputFile':_0x3a60ca,'testNames':_0x56e277});if(_0x5828f8){console['log'](a5_0x52832e['cyan'](_0x36b9c5(0x162))),console[_0x36b9c5(0x192)](_0x36b9c5(0x140)+a5_0x52832e[_0x36b9c5(0x19b)](_0x414c84)),console[_0x36b9c5(0x192)](_0x36b9c5(0x163)+a5_0x52832e[_0x36b9c5(0x19b)](_0x466651['projectName'])),console['log']('\x20\x20Agent:\x20'+a5_0x52832e[_0x36b9c5(0x19b)](_0x466651[_0x36b9c5(0x187)])),console[_0x36b9c5(0x192)](),console[_0x36b9c5(0x192)](_0x36b9c5(0x166)+a5_0x52832e['white'](_0x40d950[_0x36b9c5(0x17d)]));for(let _0xd694b5=0x0;_0xd694b5<_0x40d950[_0x36b9c5(0x17d)];_0xd694b5++){const _0x5e77f7=_0x40d950[_0xd694b5],_0x2db93e=_0x5e77f7['rounds']['length']===0x1?_0x36b9c5(0x150):_0x36b9c5(0x186),_0x2ff7d4=_0x5e77f7[_0x36b9c5(0x1b5)]?.[_0x36b9c5(0x17d)]?'\x20['+_0x5e77f7['tags'][_0x36b9c5(0x196)](',\x20')+']':'';console['log']('\x20\x20'+(_0xd694b5+0x1)+'.\x20'+a5_0x52832e['white'](_0x5e77f7[_0x36b9c5(0x1b4)])+'\x20('+_0x5e77f7[_0x36b9c5(0x186)][_0x36b9c5(0x17d)]+'\x20'+_0x2db93e+')'+a5_0x52832e[_0x36b9c5(0x154)](_0x2ff7d4));}return 0x0;}let _0x4f2cef,_0x4ec616;try{_0x4f2cef=await _0x56782a[_0x36b9c5(0x1b9)][_0x36b9c5(0x190)](_0x466651['projectName']);}catch(_0xaa3658){const _0x297385=_0xaa3658 instanceof Error?_0xaa3658['message']:String(_0xaa3658);return _0x297385['includes'](_0x36b9c5(0x17e))||_0x297385['toLowerCase']()['includes'](_0x36b9c5(0x15c))?console[_0x36b9c5(0x192)](a5_0x52832e[_0x36b9c5(0x176)](_0x36b9c5(0x159)+_0x466651[_0x36b9c5(0x1be)])):console['log'](a5_0x52832e[_0x36b9c5(0x176)](_0x36b9c5(0x13a)+_0x466651['projectName']+_0x36b9c5(0x1a6)+_0x297385)),0x1;}try{_0x4ec616=await _0x56782a[_0x36b9c5(0x1b9)][_0x36b9c5(0x16f)](_0x466651[_0x36b9c5(0x187)],_0x4f2cef);}catch(_0x5f49ee){const _0x343e7c=_0x5f49ee instanceof Error?_0x5f49ee[_0x36b9c5(0x168)]:String(_0x5f49ee);return _0x343e7c[_0x36b9c5(0x1c6)](_0x36b9c5(0x17e))||_0x343e7c[_0x36b9c5(0x18e)]()[_0x36b9c5(0x1c6)](_0x36b9c5(0x15c))?console['log'](a5_0x52832e[_0x36b9c5(0x176)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x466651['agentName'])):console[_0x36b9c5(0x192)](a5_0x52832e[_0x36b9c5(0x176)](_0x36b9c5(0x164)+_0x466651['agentName']+'\x22:\x20'+_0x343e7c)),0x1;}let _0x2d66fe;if(!_0x4dc2e7)try{_0x2d66fe=await setupEvaluatorAgent(_0x56782a[_0x36b9c5(0x1b9)],_0x5bbdff[_0x36b9c5(0x148)]);}catch(_0x261a35){const _0x5864af=_0x261a35 instanceof Error?_0x261a35['message']:String(_0x261a35);return console['log'](a5_0x52832e['red'](_0x36b9c5(0x12e)+_0x5864af)),0x1;}console['log'](a5_0x52832e['cyan'](_0x36b9c5(0x182))),console[_0x36b9c5(0x192)](_0x36b9c5(0x1ab)+a5_0x52832e[_0x36b9c5(0x19b)](_0x414c84)),console[_0x36b9c5(0x192)](_0x36b9c5(0x1b6)+a5_0x52832e['white'](_0x466651['projectName']+'/'+_0x466651[_0x36b9c5(0x187)])),console[_0x36b9c5(0x192)]();const _0x4d0bd2=[],_0x125290=[],_0x1ba706=Date[_0x36b9c5(0x133)]();for(let _0x372488=0x0;_0x372488<_0x40d950[_0x36b9c5(0x17d)];_0x372488++){const _0xfdead2=_0x40d950[_0x372488];_0x40d950['length']>0x1?console[_0x36b9c5(0x192)](_0x36b9c5(0x1a1)+(_0x372488+0x1)+'/'+_0x40d950[_0x36b9c5(0x17d)]+':\x20'+a5_0x52832e[_0x36b9c5(0x19b)](_0xfdead2[_0x36b9c5(0x1b4)])):console[_0x36b9c5(0x192)](_0x36b9c5(0x132)+a5_0x52832e[_0x36b9c5(0x19b)](_0xfdead2[_0x36b9c5(0x1b4)]));const _0x564200=createCommandSpinner(_0x36b9c5(0x1b7)+_0xfdead2['rounds'][_0x36b9c5(0x17d)]+_0x36b9c5(0x138));_0x564200[_0x36b9c5(0x18c)]();try{const {result:_0x3803b7,conversation:_0x28b793}=await runTest(_0x56782a[_0x36b9c5(0x1b9)],_0xfdead2,{'agentId':_0x4ec616,'projectId':_0x4f2cef,'site':_0x414c84,'noEval':_0x4dc2e7,'evaluatorId':_0x2d66fe,'onRoundStart':(_0x92200a,_0x3ee8dd)=>{const _0x4a6e8b=_0x36b9c5;_0x564200[_0x4a6e8b(0x15b)]='Round\x20'+(_0x92200a+0x1)+'/'+_0x3ee8dd+_0x4a6e8b(0x138);},'onRoundComplete':(_0x5a1e8e,_0x243052,_0x514d8a)=>{const _0x390d61=_0x36b9c5,_0x372cc3=formatElapsed(_0x243052);_0x514d8a?console[_0x390d61(0x192)]('\x20\x20Round\x20'+(_0x5a1e8e+0x1)+'/'+_0xfdead2['rounds'][_0x390d61(0x17d)]+_0x390d61(0x13c)+a5_0x52832e[_0x390d61(0x134)]('✓')+'\x20('+_0x372cc3+')'):console['log'](_0x390d61(0x1ba)+(_0x5a1e8e+0x1)+'/'+_0xfdead2['rounds'][_0x390d61(0x17d)]+_0x390d61(0x13c)+a5_0x52832e[_0x390d61(0x176)]('✗'));},'onEvaluationStart':()=>{const _0x29a7db=_0x36b9c5;_0x564200[_0x29a7db(0x15b)]=_0x29a7db(0x1a2);},'onEvaluationComplete':_0x3a1b96=>{const _0x35ffc5=_0x36b9c5,_0x1b87c7=formatElapsed(_0x3a1b96);console[_0x35ffc5(0x192)](_0x35ffc5(0x1ae)+a5_0x52832e['green']('✓')+'\x20('+_0x1b87c7+')');}});_0x564200[_0x36b9c5(0x1ad)](),_0x4d0bd2[_0x36b9c5(0x165)](_0x3803b7),_0x125290[_0x36b9c5(0x165)](_0x28b793);if(_0x3803b7[_0x36b9c5(0x18a)]===_0x36b9c5(0x136))console[_0x36b9c5(0x192)](a5_0x52832e[_0x36b9c5(0x134)](_0x36b9c5(0x185)+_0x3803b7[_0x36b9c5(0x14c)]));else _0x3803b7[_0x36b9c5(0x18a)]===_0x36b9c5(0x14b)?console[_0x36b9c5(0x192)](a5_0x52832e[_0x36b9c5(0x176)]('✗\x20FAIL:\x20'+_0x3803b7[_0x36b9c5(0x14c)])):console[_0x36b9c5(0x192)](a5_0x52832e[_0x36b9c5(0x176)]('✗\x20ERROR:\x20'+_0x3803b7[_0x36b9c5(0x14c)]));_0x3803b7[_0x36b9c5(0x15d)]&&console[_0x36b9c5(0x192)](a5_0x52832e[_0x36b9c5(0x154)](_0x36b9c5(0x143)+_0x3803b7[_0x36b9c5(0x15d)])),console['log']();}catch(_0x1f29a7){_0x564200[_0x36b9c5(0x1ad)]();const _0x5aa9e8=_0x1f29a7 instanceof Error?_0x1f29a7[_0x36b9c5(0x168)]:String(_0x1f29a7);console[_0x36b9c5(0x192)](a5_0x52832e[_0x36b9c5(0x176)]('✗\x20ERROR:\x20'+_0x5aa9e8)),console['log'](),_0x4d0bd2[_0x36b9c5(0x165)]({'name':_0xfdead2[_0x36b9c5(0x1b4)],'status':'ERROR','reason':_0x5aa9e8,'timestamp':new Date()[_0x36b9c5(0x16d)](),'duration_ms':0x0});}}const _0xf2176b=Date['now']()-_0x1ba706,_0x4f8dfc=_0x4d0bd2[_0x36b9c5(0x1a0)](_0x3573da=>_0x3573da[_0x36b9c5(0x18a)]===_0x36b9c5(0x136))['length'],_0x4b30d6=_0x4d0bd2[_0x36b9c5(0x1a0)](_0x2a8237=>_0x2a8237['status']==='FAIL')['length'],_0x1737ac=_0x4d0bd2[_0x36b9c5(0x1a0)](_0x682621=>_0x682621[_0x36b9c5(0x18a)]===_0x36b9c5(0x142))[_0x36b9c5(0x17d)];console['log']('━'['repeat'](0x3c)),console[_0x36b9c5(0x192)](_0x36b9c5(0x135)),console[_0x36b9c5(0x192)]('━'[_0x36b9c5(0x19d)](0x3c)),console[_0x36b9c5(0x192)](_0x36b9c5(0x146)+_0x4d0bd2[_0x36b9c5(0x17d)]),console[_0x36b9c5(0x192)]('Passed:\x20\x20\x20'+a5_0x52832e[_0x36b9c5(0x134)](_0x4f8dfc)),console[_0x36b9c5(0x192)]('Failed:\x20\x20\x20'+a5_0x52832e['red'](_0x4b30d6));_0x1737ac>0x0&&console['log'](_0x36b9c5(0x170)+a5_0x52832e['red'](_0x1737ac));console[_0x36b9c5(0x192)](_0x36b9c5(0x172)+formatElapsed(_0xf2176b)),console['log']('━'[_0x36b9c5(0x19d)](0x3c));const _0x3319cd=_0x4d0bd2[_0x36b9c5(0x1a0)](_0x195c2a=>_0x195c2a[_0x36b9c5(0x18a)]!==_0x36b9c5(0x136));if(_0x3319cd[_0x36b9c5(0x17d)]>0x0){console[_0x36b9c5(0x192)](),console[_0x36b9c5(0x192)](_0x36b9c5(0x173));for(const _0x506d4e of _0x3319cd){const _0x280584=a5_0x52832e[_0x36b9c5(0x176)]('✗'),_0x58321d=_0x506d4e['reason'][_0x36b9c5(0x17d)]>0x32?_0x506d4e[_0x36b9c5(0x14c)][_0x36b9c5(0x160)](0x0,0x32)+_0x36b9c5(0x195):_0x506d4e[_0x36b9c5(0x14c)];console['log']('\x20\x20'+_0x280584+'\x20'+_0x506d4e[_0x36b9c5(0x1b4)]+':\x20'+_0x58321d);}}const _0x1ed1fc={'summary':{'total':_0x4d0bd2[_0x36b9c5(0x17d)],'passed':_0x4f8dfc,'failed':_0x4b30d6,'errors':_0x1737ac>0x0?_0x1737ac:undefined,'duration_ms':_0xf2176b},'tests':_0x4d0bd2,'agent':{'project':_0x466651[_0x36b9c5(0x1be)],'name':_0x466651[_0x36b9c5(0x187)],'site':_0x414c84},'timestamp':new Date(_0x1ba706)[_0x36b9c5(0x16d)]()};try{const _0x5e3c3a=buildCachedTestRun(_0x125290,{'site':_0x414c84,'projectId':_0x4f2cef,'projectName':_0x466651[_0x36b9c5(0x1be)],'agentId':_0x4ec616,'agentName':_0x466651[_0x36b9c5(0x187)],'testYmlPath':a5_0x12bfc0[_0x36b9c5(0x139)](_0x466651[_0x36b9c5(0x1a9)])});saveLastTestRun(_0x5e3c3a);}catch{}if(_0x797dd4!=='table'||_0x3a60ca){const _0x443ab7=formatResults(_0x1ed1fc,_0x797dd4);if(_0x3a60ca)try{a5_0x543ebe[_0x36b9c5(0x175)](_0x3a60ca,_0x443ab7,_0x36b9c5(0x14e)),console[_0x36b9c5(0x192)](),console['log'](a5_0x52832e[_0x36b9c5(0x154)](_0x36b9c5(0x1c7)+_0x3a60ca));}catch(_0x45ac7b){return console[_0x36b9c5(0x192)](),console[_0x36b9c5(0x192)](a5_0x52832e[_0x36b9c5(0x176)](_0x36b9c5(0x1ac)+_0x45ac7b)),0x1;}else console['log'](),console[_0x36b9c5(0x192)](_0x443ab7);}return _0x3319cd[_0x36b9c5(0x17d)]>0x0?0x1:0x0;}async[a5_0xdd547f(0x193)](_0x1461b3,_0x20e82d){const _0x106724=a5_0xdd547f,{options:_0x504c46,tdx:_0x1356bf}=_0x1461b3,{definition:_0x4272ae,agentInfo:_0x25cd42,outputFormat:_0xf2be00,outputFile:_0x53e8fc}=_0x20e82d,_0x2cb16a=_0x504c46[_0x106724(0x181)],_0x58c18a=loadLastTestRun();if(!_0x58c18a)return console[_0x106724(0x192)](a5_0x52832e['red'](_0x106724(0x184))),console[_0x106724(0x192)](a5_0x52832e[_0x106724(0x154)](_0x106724(0x156))),0x1;if(_0x58c18a[_0x106724(0x158)][_0x106724(0x187)]!==_0x25cd42[_0x106724(0x187)])return console[_0x106724(0x192)](a5_0x52832e[_0x106724(0x176)](_0x106724(0x171)+_0x58c18a[_0x106724(0x158)][_0x106724(0x187)]+_0x106724(0x13f)+_0x25cd42[_0x106724(0x187)]+'\x22.')),console['log'](a5_0x52832e[_0x106724(0x154)](_0x106724(0x16b))),0x1;const _0x9666e9=new Set(_0x58c18a['conversations'][_0x106724(0x179)](_0x3d91d9=>_0x3d91d9['testName'])),_0x9ab314=_0x4272ae[_0x106724(0x194)][_0x106724(0x1a0)](_0x73910a=>!_0x9666e9['has'](_0x73910a[_0x106724(0x1b4)]));if(_0x9ab314['length']>0x0&&_0x58c18a[_0x106724(0x181)]!==_0x2cb16a)return console[_0x106724(0x192)](a5_0x52832e[_0x106724(0x176)](_0x106724(0x1bf))),console[_0x106724(0x192)](a5_0x52832e[_0x106724(0x154)](_0x106724(0x15e)+_0x58c18a[_0x106724(0x181)]+_0x106724(0x183)+_0x2cb16a+'\x22.')),console['log'](a5_0x52832e['dim'](_0x106724(0x16a)+_0x58c18a['site']+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x403195=_0x4272ae[_0x106724(0x194)][_0x106724(0x1a0)](_0x186c2c=>_0x9666e9['has'](_0x186c2c[_0x106724(0x1b4)])),_0x1b5ed4=_0x9ab314;let _0x5c3683;try{_0x5c3683=await setupEvaluatorAgent(_0x1356bf[_0x106724(0x1b9)],_0x504c46['verbose']);}catch(_0x88b693){const _0x58984b=_0x88b693 instanceof Error?_0x88b693[_0x106724(0x168)]:String(_0x88b693);return console[_0x106724(0x192)](a5_0x52832e[_0x106724(0x176)](_0x106724(0x12e)+_0x58984b)),0x1;}console[_0x106724(0x192)](a5_0x52832e[_0x106724(0x1a3)]('Re-evaluating\x20cached\x20test\x20run...')),console['log'](_0x106724(0x189)+a5_0x52832e[_0x106724(0x19b)](_0x58c18a[_0x106724(0x17a)])),console[_0x106724(0x192)](_0x106724(0x1b6)+a5_0x52832e[_0x106724(0x19b)](_0x58c18a[_0x106724(0x158)][_0x106724(0x1be)]+'/'+_0x58c18a['agent']['agentName']));_0x1b5ed4[_0x106724(0x17d)]>0x0&&console[_0x106724(0x192)](_0x106724(0x19c)+a5_0x52832e[_0x106724(0x13b)](_0x1b5ed4[_0x106724(0x17d)]));console['log']();const _0x5e134e=[],_0x2f4f21=Date[_0x106724(0x133)](),_0xcddfad=createCommandSpinner(_0x106724(0x14a));if(_0x403195[_0x106724(0x17d)]>0x0)try{const _0x2a9856=await reevaluateFromCache(_0x1356bf[_0x106724(0x1b9)],_0x58c18a,{'tests':_0x403195},{'evaluatorId':_0x5c3683,'onTestStart':(_0x51d177,_0x3ffed6,_0x3ab273)=>{const _0x458e5b=_0x106724;_0xcddfad[_0x458e5b(0x15b)]=_0x458e5b(0x14f)+(_0x3ffed6+0x1)+'/'+_0x3ab273+':\x20'+_0x51d177+_0x458e5b(0x195);if(!_0xcddfad['isSpinning'])_0xcddfad[_0x458e5b(0x18c)]();},'onTestComplete':(_0x2fae1c,_0x133ad3)=>{const _0x249780=_0x106724;_0xcddfad[_0x249780(0x1ad)]();if(_0x133ad3[_0x249780(0x18a)]===_0x249780(0x136))console[_0x249780(0x192)](a5_0x52832e[_0x249780(0x134)](_0x249780(0x185)+_0x2fae1c)+a5_0x52832e[_0x249780(0x154)]('\x20(cached)'));else _0x133ad3[_0x249780(0x18a)]===_0x249780(0x14b)?console[_0x249780(0x192)](a5_0x52832e[_0x249780(0x176)](_0x249780(0x141)+_0x2fae1c+'\x20-\x20'+_0x133ad3[_0x249780(0x14c)])+a5_0x52832e[_0x249780(0x154)]('\x20(cached)')):console[_0x249780(0x192)](a5_0x52832e[_0x249780(0x176)](_0x249780(0x1a4)+_0x2fae1c+_0x249780(0x18b)+_0x133ad3[_0x249780(0x14c)]));_0x133ad3[_0x249780(0x15d)]&&console[_0x249780(0x192)](a5_0x52832e[_0x249780(0x154)]('\x20\x20Conversation:\x20'+_0x133ad3[_0x249780(0x15d)])),_0x5e134e[_0x249780(0x165)](_0x133ad3);},'onTestSkipped':(_0x449a96,_0x255676)=>{const _0x415242=_0x106724;_0xcddfad[_0x415242(0x1ad)](),console[_0x415242(0x192)](a5_0x52832e['yellow']('⚠\x20SKIPPED:\x20'+_0x449a96+_0x415242(0x18b)+_0x255676));}});for(const _0x556e4c of _0x2a9856){!_0x5e134e[_0x106724(0x1b2)](_0x38d6dc=>_0x38d6dc['name']===_0x556e4c[_0x106724(0x1b4)])&&_0x5e134e[_0x106724(0x165)](_0x556e4c);}}catch(_0x45dce8){_0xcddfad[_0x106724(0x1ad)]();const _0x4d801e=_0x45dce8 instanceof Error?_0x45dce8[_0x106724(0x168)]:String(_0x45dce8);return console[_0x106724(0x192)](a5_0x52832e[_0x106724(0x176)](_0x106724(0x1af)+_0x4d801e)),0x1;}_0xcddfad['stop']();if(_0x1b5ed4[_0x106724(0x17d)]>0x0){console[_0x106724(0x192)](),console[_0x106724(0x192)](a5_0x52832e[_0x106724(0x1a3)](_0x106724(0x131)));const {projectId:_0xdda4fb,agentId:_0x1ec552}=_0x58c18a[_0x106724(0x158)];for(const _0x1ce2da of _0x1b5ed4){console['log'](_0x106724(0x147)+a5_0x52832e['white'](_0x1ce2da[_0x106724(0x1b4)]));const _0x2bf2d2=createCommandSpinner('Round\x201/'+_0x1ce2da['rounds']['length']+':\x20Sending\x20user\x20input...');_0x2bf2d2[_0x106724(0x18c)]();try{const {result:_0x16c705}=await runTest(_0x1356bf[_0x106724(0x1b9)],_0x1ce2da,{'agentId':_0x1ec552,'projectId':_0xdda4fb,'site':_0x58c18a[_0x106724(0x181)],'noEval':![],'evaluatorId':_0x5c3683,'onRoundStart':(_0x1d4bb6,_0x1c261e)=>{const _0x4f60aa=_0x106724;_0x2bf2d2[_0x4f60aa(0x15b)]='Round\x20'+(_0x1d4bb6+0x1)+'/'+_0x1c261e+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x2a0de1,_0x305af0,_0x42bebe)=>{const _0x5e3963=_0x106724,_0x1b6540=formatElapsed(_0x305af0);_0x42bebe?console['log'](_0x5e3963(0x1ba)+(_0x2a0de1+0x1)+'/'+_0x1ce2da['rounds'][_0x5e3963(0x17d)]+_0x5e3963(0x13c)+a5_0x52832e['green']('✓')+'\x20('+_0x1b6540+')'):console[_0x5e3963(0x192)](_0x5e3963(0x1ba)+(_0x2a0de1+0x1)+'/'+_0x1ce2da[_0x5e3963(0x186)]['length']+'...\x20'+a5_0x52832e[_0x5e3963(0x176)]('✗'));},'onEvaluationStart':()=>{const _0x299488=_0x106724;_0x2bf2d2[_0x299488(0x15b)]=_0x299488(0x1a2);},'onEvaluationComplete':_0x11c3d5=>{const _0x49342f=_0x106724,_0x1c26e9=formatElapsed(_0x11c3d5);console[_0x49342f(0x192)]('\x20\x20Evaluating...\x20'+a5_0x52832e[_0x49342f(0x134)]('✓')+'\x20('+_0x1c26e9+')');}});_0x2bf2d2[_0x106724(0x1ad)](),_0x5e134e[_0x106724(0x165)](_0x16c705);if(_0x16c705[_0x106724(0x18a)]===_0x106724(0x136))console['log'](a5_0x52832e[_0x106724(0x134)](_0x106724(0x185)+_0x16c705[_0x106724(0x14c)])+a5_0x52832e[_0x106724(0x154)](_0x106724(0x191)));else _0x16c705[_0x106724(0x18a)]===_0x106724(0x14b)?console['log'](a5_0x52832e[_0x106724(0x176)](_0x106724(0x141)+_0x16c705[_0x106724(0x14c)])+a5_0x52832e['dim']('\x20(new)')):console[_0x106724(0x192)](a5_0x52832e[_0x106724(0x176)](_0x106724(0x1a4)+_0x16c705[_0x106724(0x14c)]));_0x16c705[_0x106724(0x15d)]&&console[_0x106724(0x192)](a5_0x52832e['dim'](_0x106724(0x188)+_0x16c705[_0x106724(0x15d)]));}catch(_0xcbbd8c){_0x2bf2d2['stop']();const _0x270431=_0xcbbd8c instanceof Error?_0xcbbd8c['message']:String(_0xcbbd8c);console[_0x106724(0x192)](a5_0x52832e['red'](_0x106724(0x1a4)+_0x270431)),_0x5e134e['push']({'name':_0x1ce2da[_0x106724(0x1b4)],'status':_0x106724(0x142),'reason':_0x270431,'timestamp':new Date()[_0x106724(0x16d)](),'duration_ms':0x0});}}}console['log']();const _0x5109f6=Date[_0x106724(0x133)]()-_0x2f4f21,_0x17b44d=_0x5e134e[_0x106724(0x1a0)](_0x1841e1=>_0x1841e1[_0x106724(0x18a)]==='PASS')[_0x106724(0x17d)],_0x4d1d2d=_0x5e134e[_0x106724(0x1a0)](_0x4ec784=>_0x4ec784[_0x106724(0x18a)]===_0x106724(0x14b))['length'],_0x21bf75=_0x5e134e['filter'](_0x117eba=>_0x117eba[_0x106724(0x18a)]===_0x106724(0x142))['length'];console[_0x106724(0x192)]('━'[_0x106724(0x19d)](0x3c)),console['log']('Re-evaluation\x20Summary'),console['log']('━'[_0x106724(0x19d)](0x3c)),console[_0x106724(0x192)](_0x106724(0x146)+_0x5e134e['length']),console[_0x106724(0x192)](_0x106724(0x1c1)+a5_0x52832e[_0x106724(0x134)](_0x17b44d)),console[_0x106724(0x192)](_0x106724(0x169)+a5_0x52832e[_0x106724(0x176)](_0x4d1d2d));_0x21bf75>0x0&&console[_0x106724(0x192)](_0x106724(0x170)+a5_0x52832e[_0x106724(0x176)](_0x21bf75));console[_0x106724(0x192)](_0x106724(0x172)+formatElapsed(_0x5109f6)),console[_0x106724(0x192)]('━'[_0x106724(0x19d)](0x3c));const _0x10d7f3={'summary':{'total':_0x5e134e[_0x106724(0x17d)],'passed':_0x17b44d,'failed':_0x4d1d2d,'errors':_0x21bf75>0x0?_0x21bf75:undefined,'duration_ms':_0x5109f6},'tests':_0x5e134e,'agent':{'project':_0x25cd42[_0x106724(0x1be)],'name':_0x25cd42[_0x106724(0x187)],'site':_0x2cb16a},'timestamp':new Date(_0x2f4f21)['toISOString']()};if(_0xf2be00!==_0x106724(0x1a8)||_0x53e8fc){const _0x4f9b81=formatResults(_0x10d7f3,_0xf2be00);if(_0x53e8fc)try{a5_0x543ebe['writeFileSync'](_0x53e8fc,_0x4f9b81,_0x106724(0x14e)),console[_0x106724(0x192)](),console[_0x106724(0x192)](a5_0x52832e[_0x106724(0x154)](_0x106724(0x1c7)+_0x53e8fc));}catch(_0x323d59){return console[_0x106724(0x192)](),console[_0x106724(0x192)](a5_0x52832e['red']('Error\x20writing\x20output\x20file:\x20'+_0x323d59)),0x1;}else console['log'](),console['log'](_0x4f9b81);}const _0x483268=_0x5e134e['filter'](_0xca958d=>_0xca958d['status']!==_0x106724(0x136));return _0x483268[_0x106724(0x17d)]>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0xb0df85=a5_0x1e4a;function a5_0x1e4a(_0x3a36b2,_0x2a904a){_0x3a36b2=_0x3a36b2-0x138;const _0x2fe819=a5_0x2fe8();let _0x1e4a4f=_0x2fe819[_0x3a36b2];return _0x1e4a4f;}(function(_0xbd2e7,_0x424a1d){const _0x209128=a5_0x1e4a,_0x5b6166=_0xbd2e7();while(!![]){try{const _0x36d920=parseInt(_0x209128(0x143))/0x1*(parseInt(_0x209128(0x1c5))/0x2)+-parseInt(_0x209128(0x14b))/0x3*(-parseInt(_0x209128(0x175))/0x4)+-parseInt(_0x209128(0x158))/0x5*(parseInt(_0x209128(0x1c6))/0x6)+-parseInt(_0x209128(0x194))/0x7+parseInt(_0x209128(0x18f))/0x8*(-parseInt(_0x209128(0x190))/0x9)+parseInt(_0x209128(0x1c3))/0xa+parseInt(_0x209128(0x183))/0xb*(parseInt(_0x209128(0x1b7))/0xc);if(_0x36d920===_0x424a1d)break;else _0x5b6166['push'](_0x5b6166['shift']());}catch(_0xb151b8){_0x5b6166['push'](_0x5b6166['shift']());}}}(a5_0x2fe8,0xe4783));import*as a5_0x1a911a from'node:fs';import*as a5_0x163c04 from'node:path';import a5_0x1f5500 from'chalk';import{BaseCommand}from'./command.js';function a5_0x2fe8(){const _0x204497=['no_local_folder','Passed:\x20\x20\x20','reeval','isSpinning','size','no_context','green','\x20\x20Round\x20','status','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','PASS','jsonl','\x20\x20Site:\x20','✗\x20ERROR:\x20','toLowerCase','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','resolve','tags','Using\x20agent:\x20','Evaluating\x20response...','agent:test','No\x20tests\x20have\x20tags\x20defined.','ERROR','table','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','Test\x20','stop','600DoqziF','start','reason','Executing\x20new\x20tests...','test.yml','log','\x22,\x20but\x20current\x20site\x20is\x20\x22','\x20\x20Conversation:\x20','\x20\x20Project:\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','Test\x20Summary','filter','...','55AKyQDf','output','found','agentDirs','length','has','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','Agent:\x20','agentName','yellow','cyan','dim','8304vGntVP','9711KWkUgv','map','...\x20','Failed:\x20\x20\x20','6749904GbZLab','multiple_agents','Available\x20tests:\x20','✓\x20PASS:\x20','context','eval','verbose','Test\x20Configuration:','tsv','Total:\x20\x20\x20\x20','json','No\x20tests\x20found\x20with\x20tags:\x20','site','writeFileSync','split','tests','404','FAIL','description','agent','red','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','not\x20found','\x27\x20to\x20create\x20the\x20folder\x20structure.','Cached\x20run\x20from:\x20','join','Cached\x20run\x20is\x20from\x20site\x20\x22','\x20-\x20','✗\x20FAIL:\x20','\x20\x20Agent:\x20','timestamp','Usage:','Available\x20tags:\x20','Re-evaluating...','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','3536868wPggqQ','toISOString','now','resolveProjectId','\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','Conversation\x20URL:\x20','text','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','No\x20tests\x20found\x20matching:\x20','Tests\x20found:\x20','add','utf-8','14886040bokSdd','\x22:\x20','1880514sQQuhF','102shbPsA','Site:\x20','push','Re-evaluation\x20Summary','Output\x20written\x20to:\x20','New\x20tests\x20to\x20execute:\x20','Run\x20\x27tdx\x20agent\x20pull\x20','Running:\x20','includes','repeat','white','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','Either\x20switch\x20to\x20the\x20\x22','\x20(new)','✗\x20ERROR:\x20Project\x20not\x20found:\x20','llm','projectName','rounds','find','1ihRaBM','Error\x20writing\x20output\x20file:\x20','Project\x20path:\x20','message','Run\x20tests\x20for\x20an\x20LLM\x20agent','Round\x201/','Round\x20','no_tests','7413WCyLwq','llmProject','Duration:\x20','projectDir','Error:\x20No\x20previous\x20test\x20run\x20found.','execute','forEach',':\x20Sending\x20user\x20input...','conversations','name','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','trim','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','368565UhwTRF','conversation_url'];a5_0x2fe8=function(){return _0x204497;};return a5_0x2fe8();}import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0xb0df85(0x154)]=a5_0xb0df85(0x16e);[a5_0xb0df85(0x1a6)]=a5_0xb0df85(0x147);async[a5_0xb0df85(0x150)](_0x1c1ced){const _0x447390=a5_0xb0df85,{options:_0x3ca6e7,args:_0x3e8562,tdx:_0x362700}=_0x1c1ced,_0x65541c=_0x3e8562[0x0]||'.',_0x18ac5d=_0x3ca6e7['dryRun'],_0x1e8f72=_0x3ca6e7,_0x202e12=_0x1e8f72[_0x447390(0x199)]===![],_0x492ff8=_0x1e8f72[_0x447390(0x15c)],_0x3437a8=_0x1e8f72['name'],_0x51fd06=_0x1e8f72[_0x447390(0x16b)],_0x3972b2=_0x3ca6e7[_0x447390(0x1a0)],_0x249c90=_0x1e8f72[_0x447390(0x184)];if(_0x492ff8&&_0x202e12)return console[_0x447390(0x17a)](a5_0x1f5500['red']('Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval')),0x1;let _0x2309b4=_0x447390(0x171);if(_0x1e8f72[_0x447390(0x19e)])_0x2309b4=_0x447390(0x19e);else{if(_0x1e8f72[_0x447390(0x165)])_0x2309b4=_0x447390(0x165);else{if(_0x1e8f72[_0x447390(0x19c)])_0x2309b4='tsv';else{if(_0x1e8f72[_0x447390(0x171)])_0x2309b4=_0x447390(0x171);}}}const _0x260b47=_0x1e8f72[_0x447390(0x14c)];let _0x2d8b35=_0x65541c;const _0x1c4296=a5_0x1a911a['existsSync'](_0x65541c),_0x57a89b=_0x65541c==='.';if(!_0x1c4296||_0x57a89b){const _0x1f57a7=resolveProjectFromContext(_0x65541c,_0x260b47,{'requireFile':_0x447390(0x179)});if(_0x1f57a7[_0x447390(0x185)])_0x2d8b35=_0x1f57a7['projectDir'],_0x1f57a7['source']===_0x447390(0x198)&&console[_0x447390(0x17a)](a5_0x1f5500[_0x447390(0x18e)](_0x447390(0x16c)+_0x2d8b35));else switch(_0x1f57a7[_0x447390(0x177)]){case _0x447390(0x15f):console['log'](a5_0x1f5500[_0x447390(0x18c)](_0x1f57a7[_0x447390(0x146)])),console[_0x447390(0x17a)](),console['log'](_0x447390(0x1b3)),console[_0x447390(0x17a)](_0x447390(0x1bb)),console[_0x447390(0x17a)]('\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x447390(0x17a)](),console['log'](_0x447390(0x163));return 0x1;case _0x447390(0x15a):console['log'](a5_0x1f5500[_0x447390(0x18c)](_0x1f57a7[_0x447390(0x146)])),console[_0x447390(0x17a)](),console['log'](_0x447390(0x1cc)+_0x1f57a7[_0x447390(0x14c)]+_0x447390(0x1ab));return 0x1;case _0x447390(0x195):{const _0x5c7fcb=a5_0x163c04['basename'](_0x1f57a7['projectDir']);console[_0x447390(0x17a)](a5_0x1f5500[_0x447390(0x18c)]('Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22'+_0x1f57a7[_0x447390(0x14c)]+'\x22:'));for(const _0x4e0556 of _0x1f57a7[_0x447390(0x186)]){console[_0x447390(0x17a)]('\x20\x20-\x20'+_0x4e0556);}return console[_0x447390(0x17a)](),console[_0x447390(0x17a)](_0x447390(0x169)+_0x5c7fcb+'/<agent-name>'),0x1;}case _0x447390(0x14a):console[_0x447390(0x17a)](a5_0x1f5500['yellow'](_0x447390(0x155)+_0x1f57a7[_0x447390(0x14c)]+'\x22.')),console[_0x447390(0x17a)](a5_0x1f5500['dim'](_0x447390(0x145)+_0x1f57a7[_0x447390(0x14e)])),console[_0x447390(0x17a)](),console['log']('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0x1cf8eb,agentInfo:_0x255fd3}=parseTestFile(_0x2d8b35);let _0x1a378b=_0x1cf8eb[_0x447390(0x1a3)];if(_0x3437a8){const _0x1b1ee5=_0x3437a8[_0x447390(0x1a2)](',')[_0x447390(0x191)](_0x2663c2=>_0x2663c2[_0x447390(0x156)]());_0x1a378b=_0x1cf8eb[_0x447390(0x1a3)][_0x447390(0x181)](_0x4505a1=>_0x1b1ee5['includes'](_0x4505a1[_0x447390(0x154)]));if(_0x1a378b['length']===0x0)return console['log'](a5_0x1f5500['yellow'](_0x447390(0x1bf)+_0x3437a8)),console[_0x447390(0x17a)](a5_0x1f5500['dim'](_0x447390(0x196)+_0x1cf8eb['tests'][_0x447390(0x191)](_0x5c15f6=>_0x5c15f6[_0x447390(0x154)])[_0x447390(0x1ad)](',\x20'))),0x1;}if(_0x51fd06){const _0x103603=_0x51fd06['split'](',')[_0x447390(0x191)](_0x2c55a5=>_0x2c55a5[_0x447390(0x156)]()['toLowerCase']());_0x1a378b=_0x1a378b[_0x447390(0x181)](_0xebe82a=>_0xebe82a[_0x447390(0x16b)]?.['some'](_0xaa9417=>_0x103603['includes'](_0xaa9417[_0x447390(0x168)]())));if(_0x1a378b[_0x447390(0x187)]===0x0){console[_0x447390(0x17a)](a5_0x1f5500[_0x447390(0x18c)](_0x447390(0x19f)+_0x51fd06));const _0x1cafb6=new Set();return _0x1cf8eb['tests'][_0x447390(0x151)](_0x395436=>_0x395436['tags']?.['forEach'](_0x856bcb=>_0x1cafb6[_0x447390(0x1c1)](_0x856bcb))),_0x1cafb6[_0x447390(0x15e)]>0x0?console['log'](a5_0x1f5500[_0x447390(0x18e)](_0x447390(0x1b4)+[..._0x1cafb6]['join'](',\x20'))):console['log'](a5_0x1f5500[_0x447390(0x18e)](_0x447390(0x16f))),0x1;}}if(_0x492ff8)return this['executeReeval'](_0x1c1ced,{'definition':{'tests':_0x1a378b},'agentInfo':_0x255fd3,'outputFormat':_0x2309b4,'outputFile':_0x249c90,'testNames':_0x3437a8});if(_0x18ac5d){console['log'](a5_0x1f5500[_0x447390(0x18d)](_0x447390(0x19b))),console[_0x447390(0x17a)](_0x447390(0x166)+a5_0x1f5500[_0x447390(0x13a)](_0x3972b2)),console['log'](_0x447390(0x17d)+a5_0x1f5500[_0x447390(0x13a)](_0x255fd3[_0x447390(0x140)])),console[_0x447390(0x17a)](_0x447390(0x1b1)+a5_0x1f5500['white'](_0x255fd3[_0x447390(0x18b)])),console['log'](),console['log'](_0x447390(0x1c0)+a5_0x1f5500['white'](_0x1a378b[_0x447390(0x187)]));for(let _0x2a6d77=0x0;_0x2a6d77<_0x1a378b[_0x447390(0x187)];_0x2a6d77++){const _0x36ff35=_0x1a378b[_0x2a6d77],_0x271367=_0x36ff35[_0x447390(0x141)][_0x447390(0x187)]===0x1?'round':'rounds',_0x274fa5=_0x36ff35[_0x447390(0x16b)]?.['length']?'\x20['+_0x36ff35[_0x447390(0x16b)]['join'](',\x20')+']':'';console[_0x447390(0x17a)]('\x20\x20'+(_0x2a6d77+0x1)+'.\x20'+a5_0x1f5500[_0x447390(0x13a)](_0x36ff35[_0x447390(0x154)])+'\x20('+_0x36ff35[_0x447390(0x141)][_0x447390(0x187)]+'\x20'+_0x271367+')'+a5_0x1f5500[_0x447390(0x18e)](_0x274fa5));}return 0x0;}let _0x5aeaaa,_0x6273dc;try{_0x5aeaaa=await _0x362700[_0x447390(0x13f)][_0x447390(0x1ba)](_0x255fd3['projectName']);}catch(_0x4e7124){const _0x3236fc=_0x4e7124 instanceof Error?_0x4e7124[_0x447390(0x146)]:String(_0x4e7124);return _0x3236fc[_0x447390(0x138)](_0x447390(0x1a4))||_0x3236fc[_0x447390(0x168)]()[_0x447390(0x138)](_0x447390(0x1aa))?console[_0x447390(0x17a)](a5_0x1f5500[_0x447390(0x1a8)](_0x447390(0x13e)+_0x255fd3[_0x447390(0x140)])):console[_0x447390(0x17a)](a5_0x1f5500[_0x447390(0x1a8)](_0x447390(0x1a9)+_0x255fd3[_0x447390(0x140)]+'\x22:\x20'+_0x3236fc)),0x1;}try{_0x6273dc=await _0x362700[_0x447390(0x13f)]['resolveAgentId'](_0x255fd3[_0x447390(0x18b)],_0x5aeaaa);}catch(_0x3d79a2){const _0x416284=_0x3d79a2 instanceof Error?_0x3d79a2[_0x447390(0x146)]:String(_0x3d79a2);return _0x416284['includes']('404')||_0x416284[_0x447390(0x168)]()[_0x447390(0x138)]('not\x20found')?console[_0x447390(0x17a)](a5_0x1f5500[_0x447390(0x1a8)](_0x447390(0x1b6)+_0x255fd3[_0x447390(0x18b)])):console[_0x447390(0x17a)](a5_0x1f5500[_0x447390(0x1a8)](_0x447390(0x189)+_0x255fd3[_0x447390(0x18b)]+_0x447390(0x1c4)+_0x416284)),0x1;}let _0x4486a5;if(!_0x202e12)try{_0x4486a5=await setupEvaluatorAgent(_0x362700[_0x447390(0x13f)],_0x3ca6e7[_0x447390(0x19a)]);}catch(_0x1940c0){const _0x3fc0f3=_0x1940c0 instanceof Error?_0x1940c0['message']:String(_0x1940c0);return console[_0x447390(0x17a)](a5_0x1f5500[_0x447390(0x1a8)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x3fc0f3)),0x1;}console[_0x447390(0x17a)](a5_0x1f5500[_0x447390(0x18d)]('Running\x20agent\x20tests...')),console[_0x447390(0x17a)](_0x447390(0x1c7)+a5_0x1f5500['white'](_0x3972b2)),console['log'](_0x447390(0x18a)+a5_0x1f5500[_0x447390(0x13a)](_0x255fd3['projectName']+'/'+_0x255fd3[_0x447390(0x18b)])),console[_0x447390(0x17a)]();const _0x2ac577=[],_0x421542=[],_0x11032d=Date[_0x447390(0x1b9)]();for(let _0x2854f9=0x0;_0x2854f9<_0x1a378b['length'];_0x2854f9++){const _0x224892=_0x1a378b[_0x2854f9];_0x1a378b[_0x447390(0x187)]>0x1?console[_0x447390(0x17a)](_0x447390(0x173)+(_0x2854f9+0x1)+'/'+_0x1a378b[_0x447390(0x187)]+':\x20'+a5_0x1f5500['white'](_0x224892[_0x447390(0x154)])):console['log']('Running\x20test:\x20'+a5_0x1f5500[_0x447390(0x13a)](_0x224892[_0x447390(0x154)]));const _0x211ad8=createCommandSpinner(_0x447390(0x148)+_0x224892[_0x447390(0x141)]['length']+_0x447390(0x152));_0x211ad8[_0x447390(0x176)]();try{const {result:_0xce5cc5,conversation:_0x239e3c}=await runTest(_0x362700[_0x447390(0x13f)],_0x224892,{'agentId':_0x6273dc,'projectId':_0x5aeaaa,'site':_0x3972b2,'noEval':_0x202e12,'evaluatorId':_0x4486a5,'onRoundStart':(_0x7e8822,_0x4bc2b3)=>{const _0x3cf4f5=_0x447390;_0x211ad8[_0x3cf4f5(0x1bd)]=_0x3cf4f5(0x149)+(_0x7e8822+0x1)+'/'+_0x4bc2b3+_0x3cf4f5(0x152);},'onRoundComplete':(_0x3c0025,_0x1c45af,_0x36ea84)=>{const _0x375beb=_0x447390,_0x46bb09=formatElapsed(_0x1c45af);_0x36ea84?console[_0x375beb(0x17a)](_0x375beb(0x161)+(_0x3c0025+0x1)+'/'+_0x224892['rounds'][_0x375beb(0x187)]+_0x375beb(0x192)+a5_0x1f5500[_0x375beb(0x160)]('✓')+'\x20('+_0x46bb09+')'):console[_0x375beb(0x17a)](_0x375beb(0x161)+(_0x3c0025+0x1)+'/'+_0x224892['rounds'][_0x375beb(0x187)]+_0x375beb(0x192)+a5_0x1f5500[_0x375beb(0x1a8)]('✗'));},'onEvaluationStart':()=>{const _0x3bd89e=_0x447390;_0x211ad8[_0x3bd89e(0x1bd)]=_0x3bd89e(0x16d);},'onEvaluationComplete':_0x2dc74b=>{const _0x45605a=_0x447390,_0x27a4e8=formatElapsed(_0x2dc74b);console[_0x45605a(0x17a)]('\x20\x20Evaluating...\x20'+a5_0x1f5500[_0x45605a(0x160)]('✓')+'\x20('+_0x27a4e8+')');}});_0x211ad8[_0x447390(0x174)](),_0x2ac577[_0x447390(0x1c8)](_0xce5cc5),_0x421542[_0x447390(0x1c8)](_0x239e3c);if(_0xce5cc5[_0x447390(0x162)]===_0x447390(0x164))console[_0x447390(0x17a)](a5_0x1f5500[_0x447390(0x160)](_0x447390(0x197)+_0xce5cc5[_0x447390(0x177)]));else _0xce5cc5[_0x447390(0x162)]===_0x447390(0x1a5)?console[_0x447390(0x17a)](a5_0x1f5500[_0x447390(0x1a8)]('✗\x20FAIL:\x20'+_0xce5cc5[_0x447390(0x177)])):console['log'](a5_0x1f5500[_0x447390(0x1a8)](_0x447390(0x167)+_0xce5cc5[_0x447390(0x177)]));_0xce5cc5[_0x447390(0x159)]&&console[_0x447390(0x17a)](a5_0x1f5500[_0x447390(0x18e)](_0x447390(0x1bc)+_0xce5cc5['conversation_url'])),console[_0x447390(0x17a)]();}catch(_0x3c7493){_0x211ad8['stop']();const _0xf9f83c=_0x3c7493 instanceof Error?_0x3c7493[_0x447390(0x146)]:String(_0x3c7493);console[_0x447390(0x17a)](a5_0x1f5500[_0x447390(0x1a8)]('✗\x20ERROR:\x20'+_0xf9f83c)),console[_0x447390(0x17a)](),_0x2ac577['push']({'name':_0x224892[_0x447390(0x154)],'status':_0x447390(0x170),'reason':_0xf9f83c,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x25dfe5=Date[_0x447390(0x1b9)]()-_0x11032d,_0x38a8aa=_0x2ac577[_0x447390(0x181)](_0x24c8e2=>_0x24c8e2[_0x447390(0x162)]==='PASS')[_0x447390(0x187)],_0x59034a=_0x2ac577[_0x447390(0x181)](_0x5d31c2=>_0x5d31c2[_0x447390(0x162)]===_0x447390(0x1a5))['length'],_0x4ee738=_0x2ac577[_0x447390(0x181)](_0x27b199=>_0x27b199[_0x447390(0x162)]==='ERROR')[_0x447390(0x187)];console[_0x447390(0x17a)]('━'[_0x447390(0x139)](0x3c)),console['log'](_0x447390(0x180)),console[_0x447390(0x17a)]('━'[_0x447390(0x139)](0x3c)),console['log'](_0x447390(0x19d)+_0x2ac577[_0x447390(0x187)]),console[_0x447390(0x17a)](_0x447390(0x15b)+a5_0x1f5500[_0x447390(0x160)](_0x38a8aa)),console['log'](_0x447390(0x193)+a5_0x1f5500[_0x447390(0x1a8)](_0x59034a));_0x4ee738>0x0&&console[_0x447390(0x17a)]('Errors:\x20\x20\x20'+a5_0x1f5500['red'](_0x4ee738));console[_0x447390(0x17a)](_0x447390(0x14d)+formatElapsed(_0x25dfe5)),console['log']('━'['repeat'](0x3c));const _0x31e14a=_0x2ac577[_0x447390(0x181)](_0x4a7b32=>_0x4a7b32[_0x447390(0x162)]!=='PASS');if(_0x31e14a['length']>0x0){console[_0x447390(0x17a)](),console['log']('Failed\x20Tests:');for(const _0x545113 of _0x31e14a){const _0x40f749=a5_0x1f5500['red']('✗'),_0x3b8057=_0x545113[_0x447390(0x177)][_0x447390(0x187)]>0x32?_0x545113[_0x447390(0x177)]['substring'](0x0,0x32)+'...':_0x545113[_0x447390(0x177)];console[_0x447390(0x17a)]('\x20\x20'+_0x40f749+'\x20'+_0x545113[_0x447390(0x154)]+':\x20'+_0x3b8057);}}const _0x170a6c={'summary':{'total':_0x2ac577[_0x447390(0x187)],'passed':_0x38a8aa,'failed':_0x59034a,'errors':_0x4ee738>0x0?_0x4ee738:undefined,'duration_ms':_0x25dfe5},'tests':_0x2ac577,'agent':{'project':_0x255fd3[_0x447390(0x140)],'name':_0x255fd3['agentName'],'site':_0x3972b2},'timestamp':new Date(_0x11032d)[_0x447390(0x1b8)]()};try{const _0x20a7c0=buildCachedTestRun(_0x421542,{'site':_0x3972b2,'projectId':_0x5aeaaa,'projectName':_0x255fd3[_0x447390(0x140)],'agentId':_0x6273dc,'agentName':_0x255fd3[_0x447390(0x18b)],'testYmlPath':a5_0x163c04[_0x447390(0x16a)](_0x255fd3['testYmlPath'])});saveLastTestRun(_0x20a7c0);}catch{}if(_0x2309b4!=='table'||_0x249c90){const _0x472577=formatResults(_0x170a6c,_0x2309b4);if(_0x249c90)try{a5_0x1a911a[_0x447390(0x1a1)](_0x249c90,_0x472577,_0x447390(0x1c2)),console[_0x447390(0x17a)](),console[_0x447390(0x17a)](a5_0x1f5500['dim'](_0x447390(0x1ca)+_0x249c90));}catch(_0x3ad8e2){return console[_0x447390(0x17a)](),console[_0x447390(0x17a)](a5_0x1f5500[_0x447390(0x1a8)](_0x447390(0x144)+_0x3ad8e2)),0x1;}else console[_0x447390(0x17a)](),console[_0x447390(0x17a)](_0x472577);}return _0x31e14a[_0x447390(0x187)]>0x0?0x1:0x0;}async['executeReeval'](_0x4ce18d,_0x2c3211){const _0x34468b=a5_0xb0df85,{options:_0x3d1013,tdx:_0x38193d}=_0x4ce18d,{definition:_0x54e22a,agentInfo:_0x3975dc,outputFormat:_0x31e6ce,outputFile:_0x2b9fe2}=_0x2c3211,_0x3473a2=_0x3d1013['site'],_0x420908=loadLastTestRun();if(!_0x420908)return console['log'](a5_0x1f5500[_0x34468b(0x1a8)](_0x34468b(0x14f))),console['log'](a5_0x1f5500['dim'](_0x34468b(0x17e))),0x1;if(_0x420908[_0x34468b(0x1a7)][_0x34468b(0x18b)]!==_0x3975dc[_0x34468b(0x18b)])return console[_0x34468b(0x17a)](a5_0x1f5500[_0x34468b(0x1a8)](_0x34468b(0x17f)+_0x420908[_0x34468b(0x1a7)][_0x34468b(0x18b)]+_0x34468b(0x13b)+_0x3975dc[_0x34468b(0x18b)]+'\x22.')),console['log'](a5_0x1f5500[_0x34468b(0x18e)](_0x34468b(0x1be))),0x1;const _0x46ab01=new Set(_0x420908[_0x34468b(0x153)]['map'](_0x530e10=>_0x530e10['testName'])),_0x2c24ba=_0x54e22a[_0x34468b(0x1a3)][_0x34468b(0x181)](_0x21ef67=>!_0x46ab01[_0x34468b(0x188)](_0x21ef67['name']));if(_0x2c24ba[_0x34468b(0x187)]>0x0&&_0x420908[_0x34468b(0x1a0)]!==_0x3473a2)return console[_0x34468b(0x17a)](a5_0x1f5500[_0x34468b(0x1a8)](_0x34468b(0x172))),console['log'](a5_0x1f5500[_0x34468b(0x18e)](_0x34468b(0x1ae)+_0x420908[_0x34468b(0x1a0)]+_0x34468b(0x17b)+_0x3473a2+'\x22.')),console[_0x34468b(0x17a)](a5_0x1f5500[_0x34468b(0x18e)](_0x34468b(0x13c)+_0x420908['site']+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x4d75dc=_0x54e22a[_0x34468b(0x1a3)][_0x34468b(0x181)](_0x27d256=>_0x46ab01[_0x34468b(0x188)](_0x27d256['name'])),_0x1d09f7=_0x2c24ba;let _0x17536c;try{_0x17536c=await setupEvaluatorAgent(_0x38193d[_0x34468b(0x13f)],_0x3d1013['verbose']);}catch(_0x2e1d18){const _0x2bb8a4=_0x2e1d18 instanceof Error?_0x2e1d18[_0x34468b(0x146)]:String(_0x2e1d18);return console[_0x34468b(0x17a)](a5_0x1f5500['red'](_0x34468b(0x157)+_0x2bb8a4)),0x1;}console['log'](a5_0x1f5500[_0x34468b(0x18d)]('Re-evaluating\x20cached\x20test\x20run...')),console[_0x34468b(0x17a)](_0x34468b(0x1ac)+a5_0x1f5500[_0x34468b(0x13a)](_0x420908[_0x34468b(0x1b2)])),console[_0x34468b(0x17a)](_0x34468b(0x18a)+a5_0x1f5500[_0x34468b(0x13a)](_0x420908[_0x34468b(0x1a7)]['projectName']+'/'+_0x420908[_0x34468b(0x1a7)][_0x34468b(0x18b)]));_0x1d09f7[_0x34468b(0x187)]>0x0&&console[_0x34468b(0x17a)](_0x34468b(0x1cb)+a5_0x1f5500[_0x34468b(0x18c)](_0x1d09f7[_0x34468b(0x187)]));console[_0x34468b(0x17a)]();const _0x29328d=[],_0x12d404=Date[_0x34468b(0x1b9)](),_0x30cdc5=createCommandSpinner(_0x34468b(0x1b5));if(_0x4d75dc[_0x34468b(0x187)]>0x0)try{const _0x4a0646=await reevaluateFromCache(_0x38193d[_0x34468b(0x13f)],_0x420908,{'tests':_0x4d75dc},{'evaluatorId':_0x17536c,'onTestStart':(_0x2cb884,_0x540e43,_0x471d64)=>{const _0x4739c8=_0x34468b;_0x30cdc5[_0x4739c8(0x1bd)]='Re-evaluating\x20'+(_0x540e43+0x1)+'/'+_0x471d64+':\x20'+_0x2cb884+_0x4739c8(0x182);if(!_0x30cdc5[_0x4739c8(0x15d)])_0x30cdc5[_0x4739c8(0x176)]();},'onTestComplete':(_0x27d8bf,_0x289f53)=>{const _0x474c80=_0x34468b;_0x30cdc5[_0x474c80(0x174)]();if(_0x289f53[_0x474c80(0x162)]===_0x474c80(0x164))console[_0x474c80(0x17a)](a5_0x1f5500[_0x474c80(0x160)](_0x474c80(0x197)+_0x27d8bf)+a5_0x1f5500[_0x474c80(0x18e)]('\x20(cached)'));else _0x289f53[_0x474c80(0x162)]===_0x474c80(0x1a5)?console[_0x474c80(0x17a)](a5_0x1f5500[_0x474c80(0x1a8)]('✗\x20FAIL:\x20'+_0x27d8bf+_0x474c80(0x1af)+_0x289f53['reason'])+a5_0x1f5500[_0x474c80(0x18e)]('\x20(cached)')):console[_0x474c80(0x17a)](a5_0x1f5500[_0x474c80(0x1a8)](_0x474c80(0x167)+_0x27d8bf+'\x20-\x20'+_0x289f53[_0x474c80(0x177)]));_0x289f53[_0x474c80(0x159)]&&console[_0x474c80(0x17a)](a5_0x1f5500[_0x474c80(0x18e)](_0x474c80(0x17c)+_0x289f53[_0x474c80(0x159)])),_0x29328d['push'](_0x289f53);},'onTestSkipped':(_0x3b350b,_0xfe552c)=>{const _0x4b368d=_0x34468b;_0x30cdc5['stop'](),console[_0x4b368d(0x17a)](a5_0x1f5500[_0x4b368d(0x18c)]('⚠\x20SKIPPED:\x20'+_0x3b350b+_0x4b368d(0x1af)+_0xfe552c));}});for(const _0x4b4ac2 of _0x4a0646){!_0x29328d[_0x34468b(0x142)](_0x1adf60=>_0x1adf60[_0x34468b(0x154)]===_0x4b4ac2[_0x34468b(0x154)])&&_0x29328d[_0x34468b(0x1c8)](_0x4b4ac2);}}catch(_0x2b195a){_0x30cdc5[_0x34468b(0x174)]();const _0x219917=_0x2b195a instanceof Error?_0x2b195a[_0x34468b(0x146)]:String(_0x2b195a);return console[_0x34468b(0x17a)](a5_0x1f5500['red']('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0x219917)),0x1;}_0x30cdc5['stop']();if(_0x1d09f7[_0x34468b(0x187)]>0x0){console['log'](),console[_0x34468b(0x17a)](a5_0x1f5500[_0x34468b(0x18d)](_0x34468b(0x178)));const {projectId:_0x2ef814,agentId:_0x101469}=_0x420908[_0x34468b(0x1a7)];for(const _0x410dd4 of _0x1d09f7){console['log'](_0x34468b(0x1cd)+a5_0x1f5500[_0x34468b(0x13a)](_0x410dd4['name']));const _0x5153c3=createCommandSpinner(_0x34468b(0x148)+_0x410dd4[_0x34468b(0x141)][_0x34468b(0x187)]+_0x34468b(0x152));_0x5153c3[_0x34468b(0x176)]();try{const {result:_0x260c29}=await runTest(_0x38193d['llm'],_0x410dd4,{'agentId':_0x101469,'projectId':_0x2ef814,'site':_0x420908[_0x34468b(0x1a0)],'noEval':![],'evaluatorId':_0x17536c,'onRoundStart':(_0x2dd463,_0x3d688f)=>{const _0x345218=_0x34468b;_0x5153c3[_0x345218(0x1bd)]=_0x345218(0x149)+(_0x2dd463+0x1)+'/'+_0x3d688f+_0x345218(0x152);},'onRoundComplete':(_0x533624,_0x57416e,_0x51bb61)=>{const _0x407f8e=_0x34468b,_0x4963c7=formatElapsed(_0x57416e);_0x51bb61?console[_0x407f8e(0x17a)]('\x20\x20Round\x20'+(_0x533624+0x1)+'/'+_0x410dd4['rounds'][_0x407f8e(0x187)]+_0x407f8e(0x192)+a5_0x1f5500[_0x407f8e(0x160)]('✓')+'\x20('+_0x4963c7+')'):console[_0x407f8e(0x17a)]('\x20\x20Round\x20'+(_0x533624+0x1)+'/'+_0x410dd4[_0x407f8e(0x141)][_0x407f8e(0x187)]+_0x407f8e(0x192)+a5_0x1f5500[_0x407f8e(0x1a8)]('✗'));},'onEvaluationStart':()=>{const _0x2ba94d=_0x34468b;_0x5153c3[_0x2ba94d(0x1bd)]='Evaluating\x20response...';},'onEvaluationComplete':_0x7b6a07=>{const _0x166207=_0x34468b,_0x442c74=formatElapsed(_0x7b6a07);console[_0x166207(0x17a)]('\x20\x20Evaluating...\x20'+a5_0x1f5500[_0x166207(0x160)]('✓')+'\x20('+_0x442c74+')');}});_0x5153c3[_0x34468b(0x174)](),_0x29328d[_0x34468b(0x1c8)](_0x260c29);if(_0x260c29[_0x34468b(0x162)]===_0x34468b(0x164))console[_0x34468b(0x17a)](a5_0x1f5500[_0x34468b(0x160)](_0x34468b(0x197)+_0x260c29[_0x34468b(0x177)])+a5_0x1f5500['dim']('\x20(new)'));else _0x260c29[_0x34468b(0x162)]===_0x34468b(0x1a5)?console[_0x34468b(0x17a)](a5_0x1f5500[_0x34468b(0x1a8)](_0x34468b(0x1b0)+_0x260c29['reason'])+a5_0x1f5500[_0x34468b(0x18e)](_0x34468b(0x13d))):console[_0x34468b(0x17a)](a5_0x1f5500[_0x34468b(0x1a8)](_0x34468b(0x167)+_0x260c29[_0x34468b(0x177)]));_0x260c29[_0x34468b(0x159)]&&console[_0x34468b(0x17a)](a5_0x1f5500[_0x34468b(0x18e)](_0x34468b(0x17c)+_0x260c29[_0x34468b(0x159)]));}catch(_0x1f6382){_0x5153c3[_0x34468b(0x174)]();const _0x275365=_0x1f6382 instanceof Error?_0x1f6382[_0x34468b(0x146)]:String(_0x1f6382);console[_0x34468b(0x17a)](a5_0x1f5500[_0x34468b(0x1a8)](_0x34468b(0x167)+_0x275365)),_0x29328d[_0x34468b(0x1c8)]({'name':_0x410dd4['name'],'status':_0x34468b(0x170),'reason':_0x275365,'timestamp':new Date()[_0x34468b(0x1b8)](),'duration_ms':0x0});}}}console[_0x34468b(0x17a)]();const _0x2f77b0=Date[_0x34468b(0x1b9)]()-_0x12d404,_0x5d0a7a=_0x29328d[_0x34468b(0x181)](_0x2fd522=>_0x2fd522[_0x34468b(0x162)]===_0x34468b(0x164))[_0x34468b(0x187)],_0x1add85=_0x29328d[_0x34468b(0x181)](_0x23cf31=>_0x23cf31['status']===_0x34468b(0x1a5))[_0x34468b(0x187)],_0x1ee92a=_0x29328d[_0x34468b(0x181)](_0x351b0c=>_0x351b0c[_0x34468b(0x162)]===_0x34468b(0x170))[_0x34468b(0x187)];console[_0x34468b(0x17a)]('━'['repeat'](0x3c)),console[_0x34468b(0x17a)](_0x34468b(0x1c9)),console[_0x34468b(0x17a)]('━'['repeat'](0x3c)),console[_0x34468b(0x17a)]('Total:\x20\x20\x20\x20'+_0x29328d[_0x34468b(0x187)]),console[_0x34468b(0x17a)](_0x34468b(0x15b)+a5_0x1f5500[_0x34468b(0x160)](_0x5d0a7a)),console[_0x34468b(0x17a)]('Failed:\x20\x20\x20'+a5_0x1f5500['red'](_0x1add85));_0x1ee92a>0x0&&console['log']('Errors:\x20\x20\x20'+a5_0x1f5500[_0x34468b(0x1a8)](_0x1ee92a));console[_0x34468b(0x17a)](_0x34468b(0x14d)+formatElapsed(_0x2f77b0)),console[_0x34468b(0x17a)]('━'['repeat'](0x3c));const _0x3875bf={'summary':{'total':_0x29328d[_0x34468b(0x187)],'passed':_0x5d0a7a,'failed':_0x1add85,'errors':_0x1ee92a>0x0?_0x1ee92a:undefined,'duration_ms':_0x2f77b0},'tests':_0x29328d,'agent':{'project':_0x3975dc[_0x34468b(0x140)],'name':_0x3975dc[_0x34468b(0x18b)],'site':_0x3473a2},'timestamp':new Date(_0x12d404)[_0x34468b(0x1b8)]()};if(_0x31e6ce!=='table'||_0x2b9fe2){const _0x3a220a=formatResults(_0x3875bf,_0x31e6ce);if(_0x2b9fe2)try{a5_0x1a911a[_0x34468b(0x1a1)](_0x2b9fe2,_0x3a220a,'utf-8'),console[_0x34468b(0x17a)](),console[_0x34468b(0x17a)](a5_0x1f5500[_0x34468b(0x18e)](_0x34468b(0x1ca)+_0x2b9fe2));}catch(_0x5819cf){return console['log'](),console[_0x34468b(0x17a)](a5_0x1f5500[_0x34468b(0x1a8)](_0x34468b(0x144)+_0x5819cf)),0x1;}else console['log'](),console[_0x34468b(0x17a)](_0x3a220a);}const _0x15e7c4=_0x29328d[_0x34468b(0x181)](_0x5011c1=>_0x5011c1[_0x34468b(0x162)]!=='PASS');return _0x15e7c4[_0x34468b(0x187)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a6_0x2b53a3=a6_0x2ab9;(function(_0x447d43,_0x55f267){const _0x20cc9a=a6_0x2ab9,_0xc5a553=_0x447d43();while(!![]){try{const _0x4462a1=parseInt(_0x20cc9a(0x1c0))/0x1+parseInt(_0x20cc9a(0x1bc))/0x2+parseInt(_0x20cc9a(0x1c7))/0x3+parseInt(_0x20cc9a(0x1bb))/0x4+parseInt(_0x20cc9a(0x1ee))/0x5+-parseInt(_0x20cc9a(0x1ea))/0x6+-parseInt(_0x20cc9a(0x1d6))/0x7;if(_0x4462a1===_0x55f267)break;else _0xc5a553['push'](_0xc5a553['shift']());}catch(_0x302657){_0xc5a553['push'](_0xc5a553['shift']());}}}(a6_0x1568,0x9b87e));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_0x2b53a3(0x1e5),a6_0x2b53a3(0x1dc),a6_0x2b53a3(0x1b5),a6_0x2b53a3(0x1de),a6_0x2b53a3(0x1c8),a6_0x2b53a3(0x1df),a6_0x2b53a3(0x1b6),a6_0x2b53a3(0x1bf)]);function isSensitiveHeader(_0x7811f9){const _0x14b7b1=a6_0x2b53a3;return SENSITIVE_HEADERS['has'](_0x7811f9[_0x14b7b1(0x1cb)]());}function parseHeader(_0x16851f){const _0xe492e6=a6_0x2b53a3,_0x48d029=_0x16851f[_0xe492e6(0x1e4)](':');if(_0x48d029===-0x1)throw new Error(_0xe492e6(0x1b0)+_0x16851f+'\x22.\x20'+'Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22');const _0x412c8a=_0x16851f[_0xe492e6(0x1ec)](0x0,_0x48d029)[_0xe492e6(0x1c4)](),_0x53e903=_0x16851f[_0xe492e6(0x1ec)](_0x48d029+0x1)['trim']();if(!_0x412c8a)throw new Error(_0xe492e6(0x1eb)+_0x16851f+'\x22');return[_0x412c8a,_0x53e903];}function a6_0x2ab9(_0xa52ee5,_0x461cc9){_0xa52ee5=_0xa52ee5-0x1b0;const _0x1568cd=a6_0x1568();let _0x2ab96b=_0x1568cd[_0xa52ee5];return _0x2ab96b;}function a6_0x1568(){const _0x60c087=['join','cookie','x-auth-token','toUpperCase','includes','<\x20HTTP/1.1\x20','message','9592pcVnaZ','867212ZPLQbG','description','startsWith','x-trino-user','1140882ybQIXc','DELETE','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','output','trim','llm','GET','3318057NuBAbu','set-cookie2','entries','Error:\x20','toLowerCase','color','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','api','headers','Invalid\x20HTTP\x20method:\x20','execute','noColor','type','header','POST','15223334iOXGmp','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','site','log','trino','keys','proxy-authorization','length','set-cookie','x-xsrf-token','method','validate','\x0aStack\x20trace:\x0a','.\x20Valid\x20methods:\x20','indexOf','authorization','error','verbose','PUT','file','939000tPOolC','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','substring','cdp','1427055fazPLP','status','Invalid\x20header\x20format:\x20\x22','.\x20Valid\x20types:\x20','isArray','data'];a6_0x1568=function(){return _0x60c087;};return a6_0x1568();}export class ApiCommand extends BaseCommand{['name']=a6_0x2b53a3(0x1ce);[a6_0x2b53a3(0x1bd)]=a6_0x2b53a3(0x1c2);[a6_0x2b53a3(0x1e1)](_0x3da1f3){const _0x3b2747=a6_0x2b53a3,{args:_0xc17068,options:_0x1c65b3}=_0x3da1f3,_0x40c75b=_0x1c65b3;if(_0xc17068[_0x3b2747(0x1dd)]===0x0)return _0x3b2747(0x1d7);const _0x4bf330=_0xc17068[0x0];if(!_0x4bf330[_0x3b2747(0x1be)]('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x4bf330;const _0x1b9fe8=_0x40c75b[_0x3b2747(0x1b3)],_0x3f82a8=_0x40c75b[_0x3b2747(0x1e9)];if(_0x1b9fe8&&_0x3f82a8)return _0x3b2747(0x1cd);const _0x49e70c=_0x40c75b[_0x3b2747(0x1e0)]||_0x3b2747(0x1c6),_0x58e708=[_0x3b2747(0x1c6),_0x3b2747(0x1d5),_0x3b2747(0x1e8),_0x3b2747(0x1c1),'PATCH'];if(!_0x58e708[_0x3b2747(0x1b8)](_0x49e70c[_0x3b2747(0x1b7)]()))return _0x3b2747(0x1d0)+_0x49e70c+_0x3b2747(0x1e3)+_0x58e708['join'](',\x20');const _0x3a2e41=_0x40c75b[_0x3b2747(0x1d3)]||'td',_0x2f1f98=['td',_0x3b2747(0x1ed),'workflow',_0x3b2747(0x1da),_0x3b2747(0x1c5),'llm-proxy'];if(!_0x2f1f98[_0x3b2747(0x1b8)](_0x3a2e41))return'Invalid\x20API\x20type:\x20'+_0x3a2e41+_0x3b2747(0x1b1)+_0x2f1f98[_0x3b2747(0x1b4)](',\x20');return undefined;}async[a6_0x2b53a3(0x1d1)](_0x206e87){const _0x5a8521=a6_0x2b53a3,{options:_0x15ed8e,args:_0x3f4055,tdx:_0x264dec}=_0x206e87,_0x36bb75=_0x15ed8e,_0x2c8f72=_0x3f4055[0x0],_0x1c8a51=(_0x36bb75[_0x5a8521(0x1e0)]||_0x5a8521(0x1c6))['toUpperCase'](),_0x5b0cd2=_0x36bb75['data'],_0x3c22e5=_0x36bb75[_0x5a8521(0x1e9)],_0x528117=_0x36bb75[_0x5a8521(0x1d4)],_0x28d5a6=_0x36bb75[_0x5a8521(0x1d3)]||'td';try{const _0x34a255={};if(_0x528117){const _0x32cfe4=Array[_0x5a8521(0x1b2)](_0x528117)?_0x528117:[_0x528117];for(const _0x33a80b of _0x32cfe4){const [_0x4f8642,_0x3f375e]=parseHeader(_0x33a80b);_0x34a255[_0x4f8642]=_0x3f375e;}}let _0x3159b6;if(_0x5b0cd2)_0x3159b6=_0x5b0cd2;else{if(_0x3c22e5)try{_0x3159b6=RawAPI['readBodyFromFile'](_0x3c22e5);}catch(_0x1cfdcd){return console[_0x5a8521(0x1e6)](_0x5a8521(0x1ca)+(_0x1cfdcd instanceof Error?_0x1cfdcd[_0x5a8521(0x1ba)]:String(_0x1cfdcd))),0x1;}}const _0x60fc62={'method':_0x1c8a51,'apiType':_0x28d5a6,'includeHeaders':_0x15ed8e['verbose']};_0x3159b6&&(_0x60fc62['body']=_0x3159b6);Object[_0x5a8521(0x1db)](_0x34a255)['length']>0x0&&(_0x60fc62[_0x5a8521(0x1cf)]=_0x34a255);if(_0x15ed8e[_0x5a8521(0x1e7)]){const _0x4528fe=resolveSite(_0x15ed8e[_0x5a8521(0x1d8)]),_0x519765=getEndpoint(_0x4528fe,_0x28d5a6),_0x452ab9=''+_0x519765+_0x2c8f72;console[_0x5a8521(0x1e6)]('>\x20'+_0x1c8a51+'\x20'+_0x452ab9);const _0x54f61e=getAuthHeaders(_0x4528fe),_0x58a86a={..._0x54f61e,..._0x34a255};for(const [_0x242d76,_0x44d636]of Object[_0x5a8521(0x1c9)](_0x58a86a)){!isSensitiveHeader(_0x242d76)&&console[_0x5a8521(0x1e6)]('>\x20'+_0x242d76+':\x20'+_0x44d636);}_0x3159b6&&console[_0x5a8521(0x1e6)]('>'),console[_0x5a8521(0x1e6)]('');}const _0x54fbf1=await _0x264dec['api']['request'](_0x2c8f72,_0x60fc62);if(_0x15ed8e[_0x5a8521(0x1e7)]&&_0x54fbf1[_0x5a8521(0x1cf)]){console[_0x5a8521(0x1e6)](_0x5a8521(0x1b9)+_0x54fbf1[_0x5a8521(0x1ef)]);for(const [_0x1d03c4,_0x746cd4]of Object[_0x5a8521(0x1c9)](_0x54fbf1[_0x5a8521(0x1cf)])){!isSensitiveHeader(_0x1d03c4)&&console[_0x5a8521(0x1e6)]('<\x20'+_0x1d03c4+':\x20'+_0x746cd4);}console[_0x5a8521(0x1e6)]('');}const _0x2e91a5=Boolean(_0x15ed8e[_0x5a8521(0x1c3)]),_0x1b032f={'color':_0x15ed8e[_0x5a8521(0x1cc)],'noColor':_0x15ed8e[_0x5a8521(0x1d2)]||_0x2e91a5&&!_0x15ed8e['color']},_0x419e27=colorizeJSON(_0x54fbf1['data'],_0x1b032f);return _0x15ed8e[_0x5a8521(0x1c3)]?(writeFileSync(_0x15ed8e[_0x5a8521(0x1c3)],_0x419e27),console[_0x5a8521(0x1e6)]('Results\x20saved\x20to\x20'+_0x15ed8e[_0x5a8521(0x1c3)])):console[_0x5a8521(0x1d9)](_0x419e27),0x0;}catch(_0x240a7c){return _0x240a7c instanceof Error?(console[_0x5a8521(0x1e6)](_0x5a8521(0x1ca)+_0x240a7c[_0x5a8521(0x1ba)]),_0x15ed8e[_0x5a8521(0x1e7)]&&_0x240a7c['stack']&&console[_0x5a8521(0x1e6)](_0x5a8521(0x1e2)+_0x240a7c['stack'])):console['error']('Error:\x20'+String(_0x240a7c)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a7_0x11b603=a7_0x198d;(function(_0x31c7b3,_0x5d6a8b){const _0x4152d5=a7_0x198d,_0x1b2b80=_0x31c7b3();while(!![]){try{const _0x544e62=parseInt(_0x4152d5(0x1a3))/0x1*(-parseInt(_0x4152d5(0x19e))/0x2)+parseInt(_0x4152d5(0x1c0))/0x3+parseInt(_0x4152d5(0x1a9))/0x4+parseInt(_0x4152d5(0x1bc))/0x5*(-parseInt(_0x4152d5(0x197))/0x6)+parseInt(_0x4152d5(0x1bd))/0x7+parseInt(_0x4152d5(0x1aa))/0x8*(parseInt(_0x4152d5(0x192))/0x9)+-parseInt(_0x4152d5(0x18c))/0xa*(parseInt(_0x4152d5(0x19d))/0xb);if(_0x544e62===_0x5d6a8b)break;else _0x1b2b80['push'](_0x1b2b80['shift']());}catch(_0x618a90){_0x1b2b80['push'](_0x1b2b80['shift']());}}}(a7_0x1a32,0x35065));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';function a7_0x1a32(){const _0xaedcc5=['jobs','join','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','last_name','Read\x20credential\x20from\x20','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','Remove\x20API\x20key\x20from\x20system\x20keychain','Setting\x20up\x20authentication\x20for\x20site:\x20','\x20(site:\x20','3130zKXQAD','us01','message','create','tdx:\x20auth\x20setup','/app/mp/ak','522gIWiJV','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','apiKey','select','oauth','30mrzPrw','auth:clear','\x27\x20registered','\x20removed\x20from\x20keychain','Validating\x20API\x20key...','password','7403dclhdi','2278lIVKEU','OAuth\x20(browser\x20login)','tdx:\x20auth\x20clear','auth','ERROR','34LvtIrw','bold','✓\x20Default\x20site\x20set\x20to\x20','\x20\x20tdx','N/A','description','1516792SeXOHR','2224xqgHeZ','✗\x20Validation\x20failed:\x20','error','API\x20key\x20cannot\x20be\x20empty','\x20for\x20profile:\x20','\x20and\x20','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','warn','\x20(profile:\x20','You\x20can\x20find\x20your\x20API\x20key\x20at:','name','API\x20Key','Read\x20credential\x20from\x20keychain','✓\x20Authentication\x20successful\x0a','filter','Choose\x20authentication\x20method:','email','Setup\x20API\x20key\x20authentication\x20interactively','80035IfQyMe','115325LLPoby','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','first_name','404406vkCSbK','API\x20key','yellow','apikey','tdx\x20profile:\x20','log','Credential\x20type:\x20OAuth','No\x20credentials\x20found\x20in\x20keychain','method','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','logLevel','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','status','execute','all','User:\x20','trim','site','red','getUserInfo','green','profile'];a7_0x1a32=function(){return _0xaedcc5;};return a7_0x1a32();}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_0x3e9c11 from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';function a7_0x198d(_0x2bae06,_0x3d5f46){_0x2bae06=_0x2bae06-0x18a;const _0x1a320e=a7_0x1a32();let _0x198d41=_0x1a320e[_0x2bae06];return _0x198d41;}import{LogLevel}from'../utils/tdx-logger.js';import a7_0x1dac8f from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x11b603(0x1b4)]='auth:setup';[a7_0x11b603(0x1a8)]=a7_0x11b603(0x1bb);async[a7_0x11b603(0x1cd)](_0x3c64a9){const _0x14f07b=a7_0x11b603,{options:_0x3b5883}=_0x3c64a9,_0x57cf90=_0x3b5883[_0x14f07b(0x1d5)];console[_0x14f07b(0x1c5)](a7_0x1dac8f[_0x14f07b(0x1a4)](_0x14f07b(0x190)));const _0x92ec0d=_0x3b5883[_0x14f07b(0x1d1)]||_0x14f07b(0x18d),_0x403dcc=await promptSiteSelection(_0x92ec0d,_0x57cf90,'Setup\x20cancelled');if(!_0x403dcc)return 0x1;const _0xca56e7=resolveSite(_0x403dcc);if(isOAuthSupported(_0xca56e7)){const _0x1549a1=await a7_0x3e9c11({'type':_0x14f07b(0x195),'name':_0x14f07b(0x1c8),'message':_0x14f07b(0x1b9),'choices':[{'title':_0x14f07b(0x19f),'value':_0x14f07b(0x196)},{'title':_0x14f07b(0x1b5),'value':_0x14f07b(0x1c3)}]});if(!_0x1549a1['method'])return console[_0x14f07b(0x1c5)]('\x0aSetup\x20cancelled'),0x1;if(_0x1549a1['method']===_0x14f07b(0x196))return await runOAuthLoginFlow(_0xca56e7,_0x57cf90,_0x3b5883[_0x14f07b(0x1ca)]??LogLevel[_0x14f07b(0x1a2)]),0x0;}console[_0x14f07b(0x1c5)](_0x14f07b(0x18a)+_0xca56e7),console[_0x14f07b(0x1c5)](_0x14f07b(0x1b3)),console[_0x14f07b(0x1c5)]('\x20\x20'+getConsoleUrl(_0xca56e7,_0x14f07b(0x191)));const _0x3ff1dd=await a7_0x3e9c11({'type':_0x14f07b(0x19c),'name':_0x14f07b(0x194),'message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0xd7d8bb=>{const _0x43220d=_0x14f07b;if(!_0xd7d8bb||!_0xd7d8bb[_0x43220d(0x1d0)]())return _0x43220d(0x1ad);return!![];}});if(!_0x3ff1dd[_0x14f07b(0x194)])return console[_0x14f07b(0x1c5)]('\x0aSetup\x20cancelled'),0x1;const _0x28d8ad=_0x3ff1dd['apiKey'];console[_0x14f07b(0x1c5)](_0x14f07b(0x19b));try{const _0x7da7c8=TDX[_0x14f07b(0x18f)]({'site':_0xca56e7,'apiKey':_0x28d8ad[_0x14f07b(0x1d0)](),'logLevel':_0x3b5883['logLevel']??LogLevel[_0x14f07b(0x1a2)]}),_0x59ea8c=await _0x7da7c8[_0x14f07b(0x1d6)][_0x14f07b(0x1d3)]();console[_0x14f07b(0x1c5)]('✓\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x59ea8c[_0x14f07b(0x1ba)]+')');const _0x84b8b6=await isKeychainAvailable();_0x84b8b6?(await saveAPIKeyAsync(_0x28d8ad[_0x14f07b(0x1d0)](),_0xca56e7,_0x57cf90),console[_0x14f07b(0x1c5)](_0x14f07b(0x1b0)+(_0x57cf90?_0x14f07b(0x1b2)+_0x57cf90+')':''))):(console[_0x14f07b(0x1b1)](a7_0x1dac8f[_0x14f07b(0x1c2)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0x14f07b(0x1b1)](a7_0x1dac8f[_0x14f07b(0x1c2)](_0x14f07b(0x1c9))));if(_0x57cf90){const _0x2cdb37={'site':_0xca56e7};saveProfileToUserConfig(_0x57cf90,_0x2cdb37),console['log']('✓\x20Profile\x20\x27'+_0x57cf90+_0x14f07b(0x199));}else saveDefaultSiteToUserConfig(_0xca56e7),console[_0x14f07b(0x1c5)](_0x14f07b(0x1a5)+_0xca56e7);const _0x1e5051=_0x57cf90?'\x20--profile\x20'+_0x57cf90:'';return console['log'](),console[_0x14f07b(0x1c5)](_0x14f07b(0x1cb)),console['log'](_0x14f07b(0x1a6)+_0x1e5051+_0x14f07b(0x1be)),console[_0x14f07b(0x1c5)](_0x14f07b(0x1a6)+_0x1e5051+_0x14f07b(0x193)),0x0;}catch(_0x2af4c1){if(_0x2af4c1 instanceof HTTPClientError&&_0x2af4c1[_0x14f07b(0x1cc)]===0x191)return printAuthError(_0x2af4c1),0x1;return console[_0x14f07b(0x1ac)](a7_0x1dac8f[_0x14f07b(0x1d2)](_0x14f07b(0x1ab)+(_0x2af4c1 instanceof Error?_0x2af4c1[_0x14f07b(0x18e)]:String(_0x2af4c1)))),console[_0x14f07b(0x1ac)](_0x14f07b(0x1db)),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']=a7_0x11b603(0x1a1);[a7_0x11b603(0x1a8)]=a7_0x11b603(0x1d8);async[a7_0x11b603(0x1cd)](_0x346642){const _0x193cfb=a7_0x11b603,{options:_0x56351a,tdx:_0x52aa66}=_0x346642,_0x43f457=_0x56351a[_0x193cfb(0x1d1)],_0x4dc376=_0x56351a['profile'],_0xc43b79=_0x4dc376?_0x4dc376:_0x193cfb(0x1a7);console[_0x193cfb(0x1c5)](_0x193cfb(0x1c4)+_0xc43b79+_0x193cfb(0x18b)+_0x43f457+')');const _0x1a9a6b=await getOAuthTokens(_0x4dc376);if(_0x1a9a6b)console[_0x193cfb(0x1c5)](_0x193cfb(0x1c6)),console['log'](_0x193cfb(0x1b6)+(_0x4dc376?_0x193cfb(0x1b2)+_0x4dc376+')':''));else{const _0x2d2389=await resolveAPIKeyAsync(_0x43f457,_0x4dc376);if(_0x2d2389){const {source:_0x327937,isDeprecated:_0x3f320a}=_0x2d2389,_0x23e2d7=_0x193cfb(0x1da)+_0x327937;console[_0x193cfb(0x1c5)](_0x3f320a?a7_0x1dac8f['yellow'](_0x23e2d7):_0x23e2d7);}else console[_0x193cfb(0x1c5)](a7_0x1dac8f['yellow']('No\x20credential\x20found'));}try{const _0x10e781=await _0x52aa66[_0x193cfb(0x1d6)][_0x193cfb(0x1d3)]();return console[_0x193cfb(0x1c5)](a7_0x1dac8f[_0x193cfb(0x1d4)](_0x193cfb(0x1b7))),console[_0x193cfb(0x1c5)](_0x193cfb(0x1cf)+_0x10e781[_0x193cfb(0x1ba)]),(_0x10e781[_0x193cfb(0x1bf)]||_0x10e781[_0x193cfb(0x1d9)])&&console[_0x193cfb(0x1c5)]('Name:\x20'+[_0x10e781['first_name'],_0x10e781[_0x193cfb(0x1d9)]][_0x193cfb(0x1b8)](Boolean)[_0x193cfb(0x1d7)]('\x20')),0x0;}catch(_0x4da2ef){return _0x4da2ef instanceof HTTPClientError&&_0x4da2ef['status']===0x191?printAuthError(_0x4da2ef,!![],_0x4dc376):console[_0x193cfb(0x1ac)](a7_0x1dac8f['red'](_0x193cfb(0x1ab)+(_0x4da2ef instanceof Error?_0x4da2ef['message']:String(_0x4da2ef)))),0x1;}}}export class AuthClearCommand extends BaseCommand{['name']=a7_0x11b603(0x198);['description']=a7_0x11b603(0x1dc);async[a7_0x11b603(0x1cd)](_0x1c43e5){const _0x4af6a7=a7_0x11b603,{options:_0x4a1c40}=_0x1c43e5,_0x882d1e=_0x4a1c40[_0x4af6a7(0x1d5)];console[_0x4af6a7(0x1c5)](a7_0x1dac8f['bold'](_0x4af6a7(0x1a0)));const _0x19fdf7=await isKeychainAvailable();if(!_0x19fdf7)return console['error'](a7_0x1dac8f[_0x4af6a7(0x1d2)]('System\x20keychain\x20is\x20not\x20available')),0x1;const [_0x5221af,_0x26a2b4]=await Promise[_0x4af6a7(0x1ce)]([deleteKeychainAPIKey(_0x882d1e),deleteOAuthTokens(_0x882d1e)]);if(_0x5221af||_0x26a2b4){clearCredentialCache();const _0x3716c3=[_0x5221af&&_0x4af6a7(0x1c1),_0x26a2b4&&'OAuth\x20tokens'][_0x4af6a7(0x1b8)](Boolean)[_0x4af6a7(0x1d7)](_0x4af6a7(0x1af));return console[_0x4af6a7(0x1c5)]('✓\x20'+_0x3716c3+_0x4af6a7(0x19a)+(_0x882d1e?_0x4af6a7(0x1b2)+_0x882d1e+')':'')),0x0;}else return console[_0x4af6a7(0x1c5)](_0x4af6a7(0x1c7)+(_0x882d1e?_0x4af6a7(0x1ae)+_0x882d1e:'')),0x1;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a8_0x14b874=a8_0x54b9;(function(_0x3ecc5b,_0x3fa088){const _0x41c31e=a8_0x54b9,_0x10987e=_0x3ecc5b();while(!![]){try{const _0x552eab=-parseInt(_0x41c31e(0x1a5))/0x1+parseInt(_0x41c31e(0x1b4))/0x2+-parseInt(_0x41c31e(0x19a))/0x3*(parseInt(_0x41c31e(0x1a3))/0x4)+-parseInt(_0x41c31e(0x19f))/0x5*(-parseInt(_0x41c31e(0x1a6))/0x6)+-parseInt(_0x41c31e(0x18e))/0x7*(parseInt(_0x41c31e(0x1ae))/0x8)+parseInt(_0x41c31e(0x1a9))/0x9*(-parseInt(_0x41c31e(0x191))/0xa)+parseInt(_0x41c31e(0x1af))/0xb;if(_0x552eab===_0x3fa088)break;else _0x10987e['push'](_0x10987e['shift']());}catch(_0x5ea94b){_0x10987e['push'](_0x10987e['shift']());}}}(a8_0x1385,0x4bb52));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';import{promptSiteSelection}from'../core/constants.js';function a8_0x54b9(_0x4c4d70,_0xa0d89d){_0x4c4d70=_0x4c4d70-0x18b;const _0x138559=a8_0x1385();let _0x54b95b=_0x138559[_0x4c4d70];return _0x54b95b;}import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';function a8_0x1385(){const _0x44d86f=['OAuth\x20login\x20is\x20not\x20yet\x20available\x20for\x20site:\x20','845976EmnAZc','15084795LgGkCP','access_token','logLevel','name','create','563856qMJTkw','green','/oauth/authorize','log','35CrbLIl','ERROR','\x20--profile\x20','600Xzzhud','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','\x20\x20tdx','OAuth\x20is\x20currently\x20supported\x20on\x20dev-us01\x20and\x20dev-eu01\x20only.\x20','Opening\x20browser\x20for\x20authentication...','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','email','\x27\x20registered','✓\x20Authentication\x20successful\x20(User:\x20','3GZmaGr','bold','getUserInfo','Login\x20cancelled','Login\x20via\x20OAuth\x20(opens\x20browser)','5fUEfYX','auth:login','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','site','2108988jCadQx','description','393696WWiCsU','3417858dHAaXP','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','69471ePPwKM','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','execute','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'];a8_0x1385=function(){return _0x44d86f;};return a8_0x1385();}import a8_0x3e4482 from'chalk';export async function runOAuthLoginFlow(_0x589473,_0x576d14,_0x3463d9){const _0x580c4b=a8_0x54b9;if(!isOAuthSupported(_0x589473))throw new Error(_0x580c4b(0x1ad)+_0x589473+'.\x20'+_0x580c4b(0x194)+'Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.');const _0x29e789=await isKeychainAvailable();if(!_0x29e789)throw new Error(_0x580c4b(0x1a1)+_0x580c4b(0x1a7));const _0x5f1d97=getConsoleUrl(_0x589473);console[_0x580c4b(0x18d)](_0x580c4b(0x195)),console['log']('\x20\x20'+_0x5f1d97+_0x580c4b(0x18c)),console[_0x580c4b(0x18d)](_0x580c4b(0x196));const _0x18a323=await startOAuthFlow(_0x589473);console[_0x580c4b(0x18d)]('Validating\x20OAuth\x20tokens...');const _0x17cf56=TDX[_0x580c4b(0x1b3)]({'site':_0x589473,'accessToken':_0x18a323[_0x580c4b(0x1b0)],'logLevel':_0x3463d9??LogLevel['ERROR']}),_0x178126=await _0x17cf56['jobs'][_0x580c4b(0x19c)]();console[_0x580c4b(0x18d)](a8_0x3e4482[_0x580c4b(0x18b)](_0x580c4b(0x199)+_0x178126[_0x580c4b(0x197)]+')')),await saveOAuthTokens(_0x18a323,_0x576d14),console['log'](_0x580c4b(0x1a8)+(_0x576d14?'\x20(profile:\x20'+_0x576d14+')':''));if(_0x576d14){const _0x1a14f6={'site':_0x589473};saveProfileToUserConfig(_0x576d14,_0x1a14f6),console[_0x580c4b(0x18d)]('✓\x20Profile\x20\x27'+_0x576d14+_0x580c4b(0x198));}const _0x53b724=_0x576d14?_0x580c4b(0x190)+_0x576d14:'';console[_0x580c4b(0x18d)](),console[_0x580c4b(0x18d)](_0x580c4b(0x1ac)),console[_0x580c4b(0x18d)]('\x20\x20tdx'+_0x53b724+_0x580c4b(0x192)),console[_0x580c4b(0x18d)](_0x580c4b(0x193)+_0x53b724+_0x580c4b(0x1aa));}export class AuthLoginCommand extends BaseCommand{[a8_0x14b874(0x1b2)]=a8_0x14b874(0x1a0);[a8_0x14b874(0x1a4)]=a8_0x14b874(0x19e);async[a8_0x14b874(0x1ab)](_0xd9d240){const _0x14f327=a8_0x14b874,{options:_0x7d10be}=_0xd9d240,_0xb27c9f=_0x7d10be['profile'];console[_0x14f327(0x18d)](a8_0x3e4482[_0x14f327(0x19b)]('tdx:\x20auth\x20login'));const _0xe6bd1a=_0x7d10be[_0x14f327(0x1a2)]||'us01',_0xf27efb=await promptSiteSelection(_0xe6bd1a,_0xb27c9f,_0x14f327(0x19d));if(!_0xf27efb)return 0x1;const _0x58cf1c=resolveSite(_0xf27efb);return console[_0x14f327(0x18d)]('Authenticating\x20via\x20OAuth\x20for\x20site:\x20'+_0x58cf1c),await runOAuthLoginFlow(_0x58cf1c,_0xb27c9f,_0x7d10be[_0x14f327(0x1b1)]??LogLevel[_0x14f327(0x18f)]),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a9_0x41da7c=a9_0x1fbb;(function(_0x4b0607,_0x3a007e){const _0x522297=a9_0x1fbb,_0x5f1205=_0x4b0607();while(!![]){try{const _0x354860=-parseInt(_0x522297(0x19c))/0x1+-parseInt(_0x522297(0x1a4))/0x2*(parseInt(_0x522297(0x181))/0x3)+-parseInt(_0x522297(0x17b))/0x4*(-parseInt(_0x522297(0x1ba))/0x5)+-parseInt(_0x522297(0x1bb))/0x6+parseInt(_0x522297(0x17d))/0x7+parseInt(_0x522297(0x1a0))/0x8*(-parseInt(_0x522297(0x1a9))/0x9)+parseInt(_0x522297(0x1ae))/0xa;if(_0x354860===_0x3a007e)break;else _0x5f1205['push'](_0x5f1205['shift']());}catch(_0x2edc45){_0x5f1205['push'](_0x5f1205['shift']());}}}(a9_0x4219,0x83ccb));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';function a9_0x1fbb(_0x20ba88,_0x57d113){_0x20ba88=_0x20ba88-0x17a;const _0x4219d3=a9_0x4219();let _0x1fbb89=_0x4219d3[_0x20ba88];return _0x1fbb89;}import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x42af66,_0x2a6371){const _0x4ee080=a9_0x1fbb;if(_0x42af66 instanceof SDKError)console[_0x4ee080(0x189)]('Error:\x20'+_0x42af66['message']),_0x2a6371[_0x4ee080(0x190)]&&(_0x42af66[_0x4ee080(0x186)]&&console[_0x4ee080(0x189)]('\x20\x20Cause:\x20'+_0x42af66[_0x4ee080(0x186)]),_0x42af66['stack']&&(console[_0x4ee080(0x189)](_0x4ee080(0x180)),console[_0x4ee080(0x189)](_0x42af66[_0x4ee080(0x1ad)])));else throw _0x42af66;}async function resolveAgentId(_0x2e0983,_0x3b0611,_0x23185a,_0x5d16b9,_0x22789a){const _0x228433=a9_0x1fbb,_0x3997d1=_0x3b0611||_0x23185a;if(_0x3997d1){const {projectName:_0x400951,agentName:_0x3cfaa0}=parseAgentRef(_0x3997d1),_0x12f559=_0x3cfaa0||_0x3997d1,_0x3a79b4=_0x3cfaa0?_0x400951:_0x5d16b9;if(!_0x3a79b4)throw new Error(_0x228433(0x19a));if(_0x22789a){const _0x1c1e12=_0x3b0611?_0x228433(0x1af):_0x228433(0x1b2);console['error'](_0x228433(0x187)+_0x1c1e12+':\x20'+_0x3a79b4+'/'+_0x12f559);}const _0x238dfa=await withSpinner(_0x228433(0x19d)+_0x3a79b4+_0x228433(0x197),()=>_0x2e0983[_0x228433(0x1be)][_0x228433(0x1ac)](_0x3a79b4),{'verbose':_0x22789a}),_0x2761b2=await withSpinner(_0x228433(0x1b7)+_0x12f559+'\x27...',()=>_0x2e0983[_0x228433(0x1be)][_0x228433(0x198)](_0x12f559,_0x238dfa['data']),{'verbose':_0x22789a});return _0x2761b2[_0x228433(0x1b5)];}else{const _0x50320e=_0x2e0983[_0x228433(0x1be)][_0x228433(0x1c6)]();if(_0x50320e)return _0x22789a&&console[_0x228433(0x189)]('Using\x20cached\x20default\x20agent:\x20'+_0x50320e[_0x228433(0x1bd)]),_0x50320e['id'];const _0x4fe7a3=await withSpinner(_0x228433(0x199),()=>_0x2e0983[_0x228433(0x1be)][_0x228433(0x192)](_0x228433(0x18e),0x0),{'verbose':_0x22789a});return _0x4fe7a3[_0x228433(0x1b5)]['id'];}}function a9_0x4219(){const _0x47b87b=['Using\x20agent\x20from\x20','validate','error','streamChat','\x0aError:\x20','tool_result','type','claude-4.5-haiku','agent','verbose','execute','getOrCreateDefaultAgent','site','chat-create','metadata','event','\x27...','resolveAgentId','Getting\x20default\x20agent...','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','targetFunction','350178paqfjl','Resolving\x20project\x20\x27','join','content','5176pPaLwH','options','CHAT_NOT_FOUND','tool','439954HwJtie','streamChatJsonl','chat','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','11115PfwkjJ','functionName','log','resolveProjectId','stack','13232460fQfJsk','--agent\x20flag','description','message','session\x20context','projectId','\x27\x20not\x20found','data','handleChatEvent','Resolving\x20agent\x20\x27','tool_call','write','328645TsLkKz','2512524cCmThx','chatId','name','llm','stringify','args','llmAgent','targetKnowledgeBase','Continuing\x20chat:\x20','llmProject','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','getDefaultAgent','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','slice','20wWgSgC','agentId','4731398mrBFkT','code','string','\x0aStack\x20trace:','3AlkWlw','new','targetAgent','Chat\x20session:\x20','404','cause'];a9_0x4219=function(){return _0x47b87b;};return a9_0x4219();}export class ChatCommand extends BaseCommand{[a9_0x41da7c(0x1bd)]=a9_0x41da7c(0x1a6);[a9_0x41da7c(0x1b0)]=a9_0x41da7c(0x1c7);[a9_0x41da7c(0x188)](_0x13528f){const _0x53ab28=a9_0x41da7c,_0x54a8f6=_0x13528f[_0x53ab28(0x1c0)][_0x53ab28(0x19e)]('\x20');if(!_0x54a8f6)return'Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options';return undefined;}async[a9_0x41da7c(0x18a)](_0x51a4d5,_0x3b6caa,_0x406952,_0x576cf4,_0x441b91){const _0x2c5a18=a9_0x41da7c;for await(const _0xebbe3a of _0x51a4d5[_0x2c5a18(0x1be)][_0x2c5a18(0x1a6)](_0x3b6caa,{'agentId':_0x406952,'chatId':_0x576cf4})){if(_0xebbe3a['type']===_0x2c5a18(0x195)){const _0x1b62d8=_0xebbe3a[_0x2c5a18(0x1b5)][_0x2c5a18(0x1bc)];saveLastChatId(_0x1b62d8),_0x441b91&&console[_0x2c5a18(0x189)](_0x2c5a18(0x184)+_0x1b62d8);}else _0xebbe3a[_0x2c5a18(0x18d)]===_0x2c5a18(0x196)&&this[_0x2c5a18(0x1b6)](_0xebbe3a[_0x2c5a18(0x1b5)]);}}async[a9_0x41da7c(0x1a5)](_0x47cfe7,_0x231978,_0x964827,_0x48f19f){const _0x4bcd20=a9_0x41da7c,_0x3eaf9b=_0x47cfe7['context'][_0x4bcd20(0x193)];let _0x264328=![];for await(const _0x23a693 of _0x47cfe7[_0x4bcd20(0x1be)]['chat'](_0x231978,{'agentId':_0x964827,'chatId':_0x48f19f})){if(_0x23a693[_0x4bcd20(0x18d)]===_0x4bcd20(0x195)){const _0x3fe5b7=_0x23a693['data'];saveLastChatId(_0x3fe5b7[_0x4bcd20(0x1bc)]);const _0x10ccde=_0x3fe5b7[_0x4bcd20(0x1b3)]&&_0x3fe5b7[_0x4bcd20(0x17c)]?getLLMConversationUrl(_0x3eaf9b,_0x3fe5b7[_0x4bcd20(0x1b3)],_0x3fe5b7[_0x4bcd20(0x17c)],_0x3fe5b7[_0x4bcd20(0x1bc)]):undefined;console[_0x4bcd20(0x1ab)](JSON[_0x4bcd20(0x1bf)]({'type':_0x4bcd20(0x195),'data':{'chatId':_0x3fe5b7[_0x4bcd20(0x1bc)],'agentId':_0x3fe5b7[_0x4bcd20(0x17c)],'consoleUrl':_0x10ccde}})),_0x264328=!![];}else{if(_0x23a693[_0x4bcd20(0x18d)]===_0x4bcd20(0x196)){!_0x264328&&_0x48f19f&&(console[_0x4bcd20(0x1ab)](JSON[_0x4bcd20(0x1bf)]({'type':'metadata','data':{'chatId':_0x48f19f}})),_0x264328=!![]);const _0x18175d=_0x23a693[_0x4bcd20(0x1b5)];if(_0x4bcd20(0x19f)in _0x18175d)console['log'](JSON['stringify']({'type':_0x4bcd20(0x19f),'data':{'content':_0x18175d[_0x4bcd20(0x19f)]}}));else{if(_0x4bcd20(0x1b8)in _0x18175d){const _0x565c52=_0x18175d[_0x4bcd20(0x1b8)];console['log'](JSON[_0x4bcd20(0x1bf)]({'type':_0x4bcd20(0x1b8),'data':{'id':_0x565c52['id'],'name':_0x565c52[_0x4bcd20(0x1aa)],'target':_0x565c52[_0x4bcd20(0x1c2)]?.['name']||_0x565c52[_0x4bcd20(0x183)]?.['name']||_0x565c52['targetWebSearchTool']?.['name']||_0x565c52[_0x4bcd20(0x19b)]}}));}else{if('tool'in _0x18175d)console[_0x4bcd20(0x1ab)](JSON['stringify']({'type':_0x4bcd20(0x18c),'data':{'id':_0x18175d[_0x4bcd20(0x1a3)]['id'],'name':_0x18175d[_0x4bcd20(0x1a3)][_0x4bcd20(0x1aa)],'result':typeof _0x18175d[_0x4bcd20(0x1a3)][_0x4bcd20(0x19f)]===_0x4bcd20(0x17f)?_0x18175d['tool'][_0x4bcd20(0x19f)][_0x4bcd20(0x17a)](0x0,0x1f4):''}}));else _0x4bcd20(0x189)in _0x18175d&&console['log'](JSON['stringify']({'type':_0x4bcd20(0x189),'data':{'error':_0x18175d[_0x4bcd20(0x189)]}}));}}}}}console[_0x4bcd20(0x1ab)](JSON[_0x4bcd20(0x1bf)]({'type':'done'}));}async[a9_0x41da7c(0x191)](_0x3647a5){const _0x5eeb54=a9_0x41da7c,{options:_0x12ab26,args:_0x515026,tdx:_0x30f3f1}=_0x3647a5,_0x456566=_0x515026['join']('\x20'),_0x2e1798=_0x12ab26,_0x48c7f3=_0x2e1798['agent'],_0x5b0890=_0x2e1798[_0x5eeb54(0x1c1)],_0x35decf=_0x2e1798['llmProject'],_0x3f0238=_0x2e1798[_0x5eeb54(0x182)],_0x28c50f=_0x2e1798[_0x5eeb54(0x1bc)],_0x6cabb9=_0x2e1798['stream'];if(_0x3f0238&&_0x28c50f)return console[_0x5eeb54(0x189)](_0x5eeb54(0x1c5)),0x1;try{let _0xb52743,_0x560b06;if(_0x28c50f)_0x560b06=_0x28c50f;else!_0x3f0238&&(_0x560b06=loadLastChatId(),_0x560b06&&_0x12ab26[_0x5eeb54(0x190)]&&console[_0x5eeb54(0x189)](_0x5eeb54(0x1c3)+_0x560b06));!_0x28c50f&&(_0x3f0238||!_0x560b06)&&(_0xb52743=await resolveAgentId(_0x30f3f1,_0x48c7f3,_0x5b0890,_0x35decf,_0x12ab26[_0x5eeb54(0x190)]));const _0x508ef1=_0x6cabb9?(_0x11eead,_0x5726ca,_0xf866c7)=>this[_0x5eeb54(0x1a5)](_0x30f3f1,_0x11eead,_0x5726ca,_0xf866c7):(_0x4e2038,_0x2eaaa7,_0x5a2ece)=>this[_0x5eeb54(0x18a)](_0x30f3f1,_0x4e2038,_0x2eaaa7,_0x5a2ece,_0x12ab26[_0x5eeb54(0x190)]);try{await _0x508ef1(_0x456566,_0xb52743,_0x560b06);}catch(_0x147a99){const _0x44bd9d=_0x147a99 instanceof SDKError&&_0x147a99[_0x5eeb54(0x17e)]===ErrorCode[_0x5eeb54(0x1a2)]||_0x147a99 instanceof Error&&_0x147a99[_0x5eeb54(0x1b1)]['includes'](_0x5eeb54(0x185));if(_0x44bd9d&&_0x28c50f)return console[_0x5eeb54(0x189)]('Error:\x20Chat\x20session\x20\x27'+_0x28c50f+_0x5eeb54(0x1b4)),0x1;if(_0x44bd9d)_0x12ab26['verbose']&&console[_0x5eeb54(0x189)](_0x5eeb54(0x1a8)),!_0xb52743&&(_0xb52743=await resolveAgentId(_0x30f3f1,_0x48c7f3,_0x5b0890,_0x35decf,_0x12ab26[_0x5eeb54(0x190)])),await _0x508ef1(_0x456566,_0xb52743,undefined);else throw _0x147a99;}return!_0x6cabb9&&console[_0x5eeb54(0x1ab)](),0x0;}catch(_0x10ffed){return console['error'](),handleSDKError(_0x10ffed,_0x12ab26),0x1;}}[a9_0x41da7c(0x1b6)](_0x2c7289){const _0x3b670b=a9_0x41da7c;if(_0x3b670b(0x19f)in _0x2c7289)process['stdout'][_0x3b670b(0x1b9)](_0x2c7289[_0x3b670b(0x19f)]);else'error'in _0x2c7289&&console['error'](_0x3b670b(0x18b)+_0x2c7289[_0x3b670b(0x189)]);}}export class ChatCreateCommand extends BaseCommand{[a9_0x41da7c(0x1bd)]=a9_0x41da7c(0x194);[a9_0x41da7c(0x1b0)]='Create\x20a\x20new\x20chat\x20session';[a9_0x41da7c(0x188)](_0x535de7){const _0x157d57=a9_0x41da7c,_0x351d3e=_0x535de7[_0x157d57(0x1a1)],_0x44b1d7=_0x351d3e[_0x157d57(0x18f)],_0x5c954e=_0x351d3e[_0x157d57(0x1c1)];if(!_0x44b1d7&&!_0x5c954e)return _0x157d57(0x1a7);return undefined;}async[a9_0x41da7c(0x191)](_0x4f8ce1){const _0x16bed4=a9_0x41da7c,{options:_0x570ea8,tdx:_0x470aed}=_0x4f8ce1,_0x1e1518=_0x570ea8,_0x5cd6bd=_0x1e1518['agent'],_0x463af2=_0x1e1518[_0x16bed4(0x1c1)],_0x3353ce=_0x1e1518[_0x16bed4(0x1c4)];try{const _0x59defe=await resolveAgentId(_0x470aed,_0x5cd6bd,_0x463af2,_0x3353ce,_0x570ea8[_0x16bed4(0x190)]),_0x5e1f45=await _0x470aed[_0x16bed4(0x1be)]['startChat'](_0x59defe);return saveLastChatId(_0x5e1f45['id']),console['log'](JSON[_0x16bed4(0x1bf)]({'chatId':_0x5e1f45['id'],'agentId':_0x59defe})),0x0;}catch(_0x1d0d0d){return handleSDKError(_0x1d0d0d,_0x570ea8),0x1;}}}
|
|
1
|
+
const a9_0x5a639b=a9_0x1236;(function(_0x1d9951,_0x477852){const _0x3d5d0c=a9_0x1236,_0x156d81=_0x1d9951();while(!![]){try{const _0x4cc929=-parseInt(_0x3d5d0c(0x1ab))/0x1*(-parseInt(_0x3d5d0c(0x1c8))/0x2)+parseInt(_0x3d5d0c(0x1d1))/0x3+parseInt(_0x3d5d0c(0x1b1))/0x4+parseInt(_0x3d5d0c(0x191))/0x5*(-parseInt(_0x3d5d0c(0x19c))/0x6)+parseInt(_0x3d5d0c(0x1d4))/0x7+-parseInt(_0x3d5d0c(0x1c9))/0x8*(-parseInt(_0x3d5d0c(0x19e))/0x9)+-parseInt(_0x3d5d0c(0x1d2))/0xa;if(_0x4cc929===_0x477852)break;else _0x156d81['push'](_0x156d81['shift']());}catch(_0x130c33){_0x156d81['push'](_0x156d81['shift']());}}}(a9_0x4b83,0x9d2c4));function a9_0x4b83(){const _0x598091=['10SyDyrq','Resolving\x20agent\x20\x27','chatId','options','log','string','agentId','targetFunction','llmAgent','tool_call','verbose','96126FjsmMz','Create\x20a\x20new\x20chat\x20session','9900peRStP','cause','tool','404','name','message','resolveAgentId','projectId','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','Error:\x20Chat\x20session\x20\x27','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','\x27...','type','506262UqefcM','targetAgent','error','code','tool_result','event','4564384SgaHUj','getDefaultAgent','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','join','done','Continuing\x20chat:\x20','chat','Error:\x20','agent','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','validate','\x0aError:\x20','includes','data','llmProject','stack','execute','\x20\x20Cause:\x20','site','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','stringify','getOrCreateDefaultAgent','handleChatEvent','4HOoChK','5392zTbHvV','session\x20context','targetWebSearchTool','CHAT_NOT_FOUND','new','Using\x20cached\x20default\x20agent:\x20','streamChat','content','463245OpEOUs','25178720HJdCce','Chat\x20session:\x20','1009813RGfYul','Getting\x20default\x20agent...','description','metadata','streamChatJsonl','llm'];a9_0x4b83=function(){return _0x598091;};return a9_0x4b83();}function a9_0x1236(_0x444c8f,_0x4ff9f8){_0x444c8f=_0x444c8f-0x18f;const _0x4b83dc=a9_0x4b83();let _0x1236b3=_0x4b83dc[_0x444c8f];return _0x1236b3;}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(_0x2d08de,_0x31d946){const _0x2d546e=a9_0x1236;if(_0x2d08de instanceof SDKError)console[_0x2d546e(0x1ad)](_0x2d546e(0x1b8)+_0x2d08de['message']),_0x31d946['verbose']&&(_0x2d08de[_0x2d546e(0x19f)]&&console['error'](_0x2d546e(0x1c2)+_0x2d08de[_0x2d546e(0x19f)]),_0x2d08de[_0x2d546e(0x1c0)]&&(console[_0x2d546e(0x1ad)]('\x0aStack\x20trace:'),console[_0x2d546e(0x1ad)](_0x2d08de[_0x2d546e(0x1c0)])));else throw _0x2d08de;}async function resolveAgentId(_0x350209,_0x4cd174,_0x317d4e,_0x517b00,_0x585476){const _0x5a27dc=a9_0x1236,_0x5349b9=_0x4cd174||_0x317d4e;if(_0x5349b9){const {projectName:_0x2c837f,agentName:_0x43b505}=parseAgentRef(_0x5349b9),_0x125fd8=_0x43b505||_0x5349b9,_0x757e2c=_0x43b505?_0x2c837f:_0x517b00;if(!_0x757e2c)throw new Error(_0x5a27dc(0x1c4));if(_0x585476){const _0x1e3d70=_0x4cd174?'--agent\x20flag':_0x5a27dc(0x1ca);console[_0x5a27dc(0x1ad)]('Using\x20agent\x20from\x20'+_0x1e3d70+':\x20'+_0x757e2c+'/'+_0x125fd8);}const _0x1d4fbb=await withSpinner('Resolving\x20project\x20\x27'+_0x757e2c+_0x5a27dc(0x1a9),()=>_0x350209['llm']['resolveProjectId'](_0x757e2c),{'verbose':_0x585476}),_0x18d147=await withSpinner(_0x5a27dc(0x192)+_0x125fd8+_0x5a27dc(0x1a9),()=>_0x350209['llm'][_0x5a27dc(0x1a4)](_0x125fd8,_0x1d4fbb[_0x5a27dc(0x1be)]),{'verbose':_0x585476});return _0x18d147[_0x5a27dc(0x1be)];}else{const _0x46ceb2=_0x350209[_0x5a27dc(0x190)][_0x5a27dc(0x1b2)]();if(_0x46ceb2)return _0x585476&&console[_0x5a27dc(0x1ad)](_0x5a27dc(0x1ce)+_0x46ceb2['name']),_0x46ceb2['id'];const _0x3b185d=await withSpinner(_0x5a27dc(0x1d5),()=>_0x350209[_0x5a27dc(0x190)][_0x5a27dc(0x1c6)]('claude-4.5-haiku',0x0),{'verbose':_0x585476});return _0x3b185d['data']['id'];}}export class ChatCommand extends BaseCommand{[a9_0x5a639b(0x1a2)]=a9_0x5a639b(0x1b7);[a9_0x5a639b(0x1d6)]=a9_0x5a639b(0x1a6);[a9_0x5a639b(0x1bb)](_0x1b3a26){const _0x56b582=a9_0x5a639b,_0x4eabfd=_0x1b3a26['args'][_0x56b582(0x1b4)]('\x20');if(!_0x4eabfd)return _0x56b582(0x1b3);return undefined;}async[a9_0x5a639b(0x1cf)](_0x51aa2b,_0x286804,_0x22050d,_0x12e188,_0x3805d5){const _0x47fb5c=a9_0x5a639b;for await(const _0x25f70b of _0x51aa2b[_0x47fb5c(0x190)][_0x47fb5c(0x1b7)](_0x286804,{'agentId':_0x22050d,'chatId':_0x12e188})){if(_0x25f70b[_0x47fb5c(0x1aa)]===_0x47fb5c(0x1d7)){const _0x422abb=_0x25f70b[_0x47fb5c(0x1be)][_0x47fb5c(0x193)];saveLastChatId(_0x422abb),_0x3805d5&&console[_0x47fb5c(0x1ad)](_0x47fb5c(0x1d3)+_0x422abb);}else _0x25f70b[_0x47fb5c(0x1aa)]===_0x47fb5c(0x1b0)&&this[_0x47fb5c(0x1c7)](_0x25f70b[_0x47fb5c(0x1be)]);}}async[a9_0x5a639b(0x18f)](_0x52d8a7,_0x11e21b,_0x45a882,_0x1cd3dc){const _0x47b476=a9_0x5a639b,_0x3cff42=_0x52d8a7['context'][_0x47b476(0x1c3)];let _0x20015d=![];for await(const _0x489035 of _0x52d8a7['llm'][_0x47b476(0x1b7)](_0x11e21b,{'agentId':_0x45a882,'chatId':_0x1cd3dc})){if(_0x489035[_0x47b476(0x1aa)]===_0x47b476(0x1d7)){const _0x35186e=_0x489035['data'];saveLastChatId(_0x35186e[_0x47b476(0x193)]);const _0x271a5d=_0x35186e[_0x47b476(0x1a5)]&&_0x35186e[_0x47b476(0x197)]?getLLMConversationUrl(_0x3cff42,_0x35186e[_0x47b476(0x1a5)],_0x35186e[_0x47b476(0x197)],_0x35186e[_0x47b476(0x193)]):undefined;console[_0x47b476(0x195)](JSON[_0x47b476(0x1c5)]({'type':'metadata','data':{'chatId':_0x35186e[_0x47b476(0x193)],'agentId':_0x35186e[_0x47b476(0x197)],'consoleUrl':_0x271a5d}})),_0x20015d=!![];}else{if(_0x489035[_0x47b476(0x1aa)]===_0x47b476(0x1b0)){!_0x20015d&&_0x1cd3dc&&(console[_0x47b476(0x195)](JSON[_0x47b476(0x1c5)]({'type':_0x47b476(0x1d7),'data':{'chatId':_0x1cd3dc}})),_0x20015d=!![]);const _0xb0ab5e=_0x489035['data'];if(_0x47b476(0x1d0)in _0xb0ab5e)console[_0x47b476(0x195)](JSON['stringify']({'type':_0x47b476(0x1d0),'data':{'content':_0xb0ab5e[_0x47b476(0x1d0)]}}));else{if(_0x47b476(0x19a)in _0xb0ab5e){const _0x419067=_0xb0ab5e[_0x47b476(0x19a)];console[_0x47b476(0x195)](JSON['stringify']({'type':_0x47b476(0x19a),'data':{'id':_0x419067['id'],'name':_0x419067['functionName'],'target':_0x419067['targetKnowledgeBase']?.['name']||_0x419067[_0x47b476(0x1ac)]?.[_0x47b476(0x1a2)]||_0x419067[_0x47b476(0x1cb)]?.[_0x47b476(0x1a2)]||_0x419067[_0x47b476(0x198)]}}));}else{if(_0x47b476(0x1a0)in _0xb0ab5e)console[_0x47b476(0x195)](JSON[_0x47b476(0x1c5)]({'type':_0x47b476(0x1af),'data':{'id':_0xb0ab5e[_0x47b476(0x1a0)]['id'],'name':_0xb0ab5e[_0x47b476(0x1a0)]['functionName'],'result':typeof _0xb0ab5e['tool']['content']===_0x47b476(0x196)?_0xb0ab5e[_0x47b476(0x1a0)][_0x47b476(0x1d0)]['slice'](0x0,0x1f4):''}}));else _0x47b476(0x1ad)in _0xb0ab5e&&console[_0x47b476(0x195)](JSON['stringify']({'type':_0x47b476(0x1ad),'data':{'error':_0xb0ab5e[_0x47b476(0x1ad)]}}));}}}}}console[_0x47b476(0x195)](JSON[_0x47b476(0x1c5)]({'type':_0x47b476(0x1b5)}));}async[a9_0x5a639b(0x1c1)](_0x362ecc){const _0x406d51=a9_0x5a639b,{options:_0x247ff8,args:_0x1f11ce,tdx:_0x3ab192}=_0x362ecc,_0x3ca42a=_0x1f11ce[_0x406d51(0x1b4)]('\x20'),_0xa18159=_0x247ff8,_0xce6c0c=_0xa18159[_0x406d51(0x1b9)],_0x33b9c0=_0xa18159[_0x406d51(0x199)],_0x9c8433=_0xa18159[_0x406d51(0x1bf)],_0x294179=_0xa18159[_0x406d51(0x1cd)],_0x3f91ed=_0xa18159[_0x406d51(0x193)],_0x36d588=_0xa18159['stream'];if(_0x294179&&_0x3f91ed)return console[_0x406d51(0x1ad)](_0x406d51(0x1a8)),0x1;try{let _0x21d6f8,_0x12a1d8;if(_0x3f91ed)_0x12a1d8=_0x3f91ed;else!_0x294179&&(_0x12a1d8=loadLastChatId(),_0x12a1d8&&_0x247ff8[_0x406d51(0x19b)]&&console[_0x406d51(0x1ad)](_0x406d51(0x1b6)+_0x12a1d8));!_0x3f91ed&&(_0x294179||!_0x12a1d8)&&(_0x21d6f8=await resolveAgentId(_0x3ab192,_0xce6c0c,_0x33b9c0,_0x9c8433,_0x247ff8[_0x406d51(0x19b)]));const _0x46dc12=_0x36d588?(_0x3fadac,_0x2affd5,_0x1da3ec)=>this['streamChatJsonl'](_0x3ab192,_0x3fadac,_0x2affd5,_0x1da3ec):(_0x275530,_0x4bf645,_0x4463d3)=>this[_0x406d51(0x1cf)](_0x3ab192,_0x275530,_0x4bf645,_0x4463d3,_0x247ff8[_0x406d51(0x19b)]);try{await _0x46dc12(_0x3ca42a,_0x21d6f8,_0x12a1d8);}catch(_0x5a19b3){const _0x20402f=_0x5a19b3 instanceof SDKError&&_0x5a19b3[_0x406d51(0x1ae)]===ErrorCode[_0x406d51(0x1cc)]||_0x5a19b3 instanceof Error&&_0x5a19b3[_0x406d51(0x1a3)][_0x406d51(0x1bd)](_0x406d51(0x1a1));if(_0x20402f&&_0x3f91ed)return console[_0x406d51(0x1ad)](_0x406d51(0x1a7)+_0x3f91ed+'\x27\x20not\x20found'),0x1;if(_0x20402f)_0x247ff8['verbose']&&console[_0x406d51(0x1ad)](_0x406d51(0x1ba)),!_0x21d6f8&&(_0x21d6f8=await resolveAgentId(_0x3ab192,_0xce6c0c,_0x33b9c0,_0x9c8433,_0x247ff8[_0x406d51(0x19b)])),await _0x46dc12(_0x3ca42a,_0x21d6f8,undefined);else throw _0x5a19b3;}return!_0x36d588&&console[_0x406d51(0x195)](),0x0;}catch(_0xc51652){return console[_0x406d51(0x1ad)](),handleSDKError(_0xc51652,_0x247ff8),0x1;}}[a9_0x5a639b(0x1c7)](_0x1be2dc){const _0x4c4fa8=a9_0x5a639b;if(_0x4c4fa8(0x1d0)in _0x1be2dc)process['stdout']['write'](_0x1be2dc['content']);else _0x4c4fa8(0x1ad)in _0x1be2dc&&console[_0x4c4fa8(0x1ad)](_0x4c4fa8(0x1bc)+_0x1be2dc[_0x4c4fa8(0x1ad)]);}}export class ChatCreateCommand extends BaseCommand{[a9_0x5a639b(0x1a2)]='chat-create';[a9_0x5a639b(0x1d6)]=a9_0x5a639b(0x19d);[a9_0x5a639b(0x1bb)](_0x3f3c50){const _0x2e38a8=a9_0x5a639b,_0x4a72e2=_0x3f3c50[_0x2e38a8(0x194)],_0x5d8956=_0x4a72e2[_0x2e38a8(0x1b9)],_0x81c24=_0x4a72e2[_0x2e38a8(0x199)];if(!_0x5d8956&&!_0x81c24)return'Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22';return undefined;}async[a9_0x5a639b(0x1c1)](_0x39ab21){const _0x71855=a9_0x5a639b,{options:_0xdf0586,tdx:_0x2cbd24}=_0x39ab21,_0x5ac8b8=_0xdf0586,_0x19f53b=_0x5ac8b8['agent'],_0x1c8b8b=_0x5ac8b8[_0x71855(0x199)],_0xa57841=_0x5ac8b8['llmProject'];try{const _0x541b59=await resolveAgentId(_0x2cbd24,_0x19f53b,_0x1c8b8b,_0xa57841,_0xdf0586[_0x71855(0x19b)]),_0x170fc3=await _0x2cbd24[_0x71855(0x190)]['startChat'](_0x541b59);return saveLastChatId(_0x170fc3['id']),console[_0x71855(0x195)](JSON[_0x71855(0x1c5)]({'chatId':_0x170fc3['id'],'agentId':_0x541b59})),0x0;}catch(_0x1052c3){return handleSDKError(_0x1052c3,_0xdf0586),0x1;}}}
|