@treasuredata/tdx 0.28.8 → 0.29.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/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/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.d.ts +8 -0
- package/dist/commands/segment-command.d.ts.map +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-command.js.map +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.d.ts.map +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-push-command.js.map +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.d.ts +2 -2
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.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.d.ts +15 -0
- package/dist/sdk/client/cdp-api-client.d.ts.map +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/cdp-api-client.js.map +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.d.ts +5 -5
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/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.d.ts.map +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-validator.js.map +1 -1
- package/dist/sdk/engage/campaign-yaml.d.ts.map +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js.map +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.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.d.ts +2 -2
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/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.d.ts.map +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js.map +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.d.ts +1 -1
- package/dist/sdk/segment/push-workflow.d.ts.map +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js.map +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.d.ts +2 -0
- package/dist/sdk/segment/segment-path-parser.d.ts.map +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js.map +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.d.ts +33 -0
- package/dist/sdk/segment/segment-validator.d.ts.map +1 -0
- package/dist/sdk/segment/segment-validator.js +1 -0
- package/dist/sdk/segment/segment-validator.js.map +1 -0
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/segment-def.d.ts +5 -179
- package/dist/sdk/segment/types/segment-def.d.ts.map +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-def.js.map +1 -1
- package/dist/sdk/segment/types/segment-schema.d.ts +259 -0
- package/dist/sdk/segment/types/segment-schema.d.ts.map +1 -0
- package/dist/sdk/segment/types/segment-schema.js +1 -0
- package/dist/sdk/segment/types/segment-schema.js.map +1 -0
- package/dist/sdk/segment/validate-files.d.ts.map +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/validate-files.js.map +1 -1
- package/dist/sdk/segment/yaml-validator.d.ts +27 -10
- package/dist/sdk/segment/yaml-validator.d.ts.map +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment/yaml-validator.js.map +1 -1
- package/dist/sdk/segment.d.ts +20 -1
- package/dist/sdk/segment.d.ts.map +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/segment.js.map +1 -1
- package/dist/sdk/types/cdp.d.ts +11 -2
- package/dist/sdk/types/cdp.d.ts.map +1 -1
- package/dist/sdk/types/index.d.ts +3 -3
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/index.js.map +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.d.ts +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/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_0x3c89bd=a4_0xedae;function a4_0x209a(){const _0x52a439=['join','Using\x20current\x20project:\x20','dim','\x20\x20Agents:\x20','experimentalKnowledgeBases','\x20\x20Prompt\x20\x22','execute','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','gray','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','Writing\x20files...','error','\x0aProject\x20pushed\x20with\x20errors','red','context','\x20|\x20','\x20\x20tdx\x20agent\x20clone\x20agents/','Would\x20push\x20agent:\x20','\x0aChanges\x20to\x20agent\x20\x27','\x22:\x20','no_local_folder','Pushing\x20to\x20project...','message','session','prompts','\x20\x20Agent\x20\x22','\x20successfully','\x20--profile\x20','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','1055304cngdev','\x22\x20to\x20new\x20project\x20\x22','\x20\x20tdx\x20agent\x20pull\x20','Status:\x20','cloneProject','cyan','Chat:\x20','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','newProjectName','\x0aPull\x20summary\x20for\x20\x27','Project\x20cloned\x20with\x20errors','\x20errors','log','\x0aError:','agentName','arg-dir','pushProject','\x20\x20Text\x20Knowledge\x20Bases:\x20','50687qHZVoC','utf-8','Using\x20local\x20project:\x20','repeat','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','llm_project','88vAQMyK','new','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','42170iHmyTy','New\x20project\x20ID:\x20','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x22\x20to\x20a\x20different\x20profile','outputDir','force','sourceProjectName','Agent:\x20','Summary:','diff','\x20\x20Experimental\x20Artifacts:\x20','yes','\x20\x20Source:\x20','Errors:','profile','\x0aErrors\x20found:','\x20\x20Integration\x20\x22','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','created','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Using\x20project:\x20','tdx.json','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x20\x20Prompts:\x20','dryRun','newProjectId','agent.yml','\x20\x20Knowledge\x20Bases:\x20','New\x20project:\x20','llmProject','Dry\x20run\x20-\x20no\x20files\x20written','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','cwd-config','Cancelled','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x20\x20Integrations:\x20','Project\x20cloned\x20successfully','found','push','total','cwd','\x20--name\x20','\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','Clone\x20\x22','counts','\x27\x20to\x20create\x20the\x20folder\x20structure.','green','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Cloning\x20\x22','INVALID_ARGUMENT','\x20new','dirname','Analyzing\x20project\x20\x22','\x20\x20Text\x20Knowledge\x20Base\x20\x22','294sjAxyL','textKnowledgeBases','883470auTgYu','parse','Using\x20project\x20from\x20context:\x20','\x20\x20Knowledge\x20Base\x20\x22','Agent\x20','projectName','Source:\x20','\x20resources\x20to\x20\x27','name','\x20files\x20to\x20','\x0aPush\x20','action','projectId','yellow','\x0a✔\x20Pushed\x20','Dry\x20run\x20-\x20no\x20changes\x20made','\x20unchanged','99356AVdsLY','source','No\x20tdx.json\x20found\x20in\x20','experimentalArtifacts','outputPath','\x20resources?','\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','integrations','updated','New\x20project\x20name\x20is\x20required','agent:push','knowledgeBases','agentId','llm','agents','\x0aPush\x20summary\x20for\x20\x27','agent:clone','Project:\x20','no_context','unchanged','Pushing\x20agent\x20from\x20\x22','Using\x20context\x20project:\x20','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\x0aChanges:','\x0aChanges\x20to\x20prompt\x20\x27','\x22\x20to\x20\x22','5041540gzgCch','pullAgent','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','1785vYuQhq','hasChanges','Push\x20local\x20agent\x20files\x20to\x20LLM\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','48ZGeBVX','\x20changed','Would\x20clone:','Failed\x20to\x20push\x20agent:\x20','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','errors','\x22...','\x20updated','pullProject','description','\x20=\x20','\x20total','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','MISSING_ARGUMENT','✔\x20Context\x20set:\x20','reason','\x20\x20Experimental\x20Artifact\x20\x22'];a4_0x209a=function(){return _0x52a439;};return a4_0x209a();}(function(_0x131120,_0x550e26){const _0x511519=a4_0xedae,_0x164b86=_0x131120();while(!![]){try{const _0x4e3869=parseInt(_0x511519(0x21a))/0x1*(-parseInt(_0x511519(0x1ea))/0x2)+-parseInt(_0x511519(0x1ec))/0x3+parseInt(_0x511519(0x1fd))/0x4+-parseInt(_0x511519(0x26a))/0x5*(-parseInt(_0x511519(0x21e))/0x6)+-parseInt(_0x511519(0x261))/0x7*(-parseInt(_0x511519(0x267))/0x8)+parseInt(_0x511519(0x24f))/0x9+parseInt(_0x511519(0x217))/0xa;if(_0x4e3869===_0x550e26)break;else _0x164b86['push'](_0x164b86['shift']());}catch(_0x6d3247){_0x164b86['push'](_0x164b86['shift']());}}}(a4_0x209a,0x39bc7));import a4_0x282c7e from'chalk';import a4_0x24c893 from'path';function a4_0xedae(_0x2e79a2,_0x359332){_0x2e79a2=_0x2e79a2-0x1e6;const _0x209aae=a4_0x209a();let _0xedae48=_0x209aae[_0x2e79a2];return _0xedae48;}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(_0x5336cd){const _0xd0c5c9=a4_0xedae,_0x35d977=[];if(_0x5336cd['total']!==undefined)_0x35d977['push'](_0x5336cd['total']+_0xd0c5c9(0x229));if(_0x5336cd[_0xd0c5c9(0x268)]!==undefined&&_0x5336cd['new']>0x0)_0x35d977[_0xd0c5c9(0x292)](a4_0x282c7e[_0xd0c5c9(0x29a)](_0x5336cd['new']+'\x20new'));if(_0x5336cd[_0xd0c5c9(0x27d)]!==undefined&&_0x5336cd[_0xd0c5c9(0x27d)]>0x0)_0x35d977['push'](a4_0x282c7e[_0xd0c5c9(0x29a)](_0x5336cd[_0xd0c5c9(0x27d)]+'\x20created'));if(_0x5336cd['updated']!==undefined&&_0x5336cd['updated']>0x0)_0x35d977['push'](a4_0x282c7e['yellow'](_0x5336cd['updated']+_0xd0c5c9(0x225)));if(_0x5336cd[_0xd0c5c9(0x210)]!==undefined&&_0x5336cd[_0xd0c5c9(0x210)]>0x0)_0x35d977[_0xd0c5c9(0x292)](a4_0x282c7e[_0xd0c5c9(0x239)](_0x5336cd['unchanged']+_0xd0c5c9(0x1fc)));if(_0x5336cd[_0xd0c5c9(0x223)]!==undefined&&_0x5336cd[_0xd0c5c9(0x223)]>0x0)_0x35d977['push'](a4_0x282c7e[_0xd0c5c9(0x23f)](_0x5336cd[_0xd0c5c9(0x223)]+_0xd0c5c9(0x25a)));return _0x35d977['join'](',\x20');}function displayDiffs(_0x1a39ae,_0x24169b,_0x2723b2,_0x4cf2b9,_0x4c6f36,_0x2749cd,_0x5942e0){const _0x3b8876=a4_0xedae;for(const _0xcb9655 of _0x1a39ae){if(_0xcb9655[_0x3b8876(0x274)]){const _0xe02c6b=_0xcb9655[_0x3b8876(0x25d)]||_0xcb9655['name'];console[_0x3b8876(0x25b)](_0x3b8876(0x244)+_0xe02c6b+'\x27:'),console[_0x3b8876(0x25b)]('─'[_0x3b8876(0x264)](0x3c)),console[_0x3b8876(0x25b)](_0xcb9655['diff']),console[_0x3b8876(0x25b)]('─'[_0x3b8876(0x264)](0x3c));}}for(const _0x2d742b of _0x24169b){_0x2d742b['diff']&&(console[_0x3b8876(0x25b)](_0x3b8876(0x256)+_0x2d742b[_0x3b8876(0x1f4)]+'\x27:'),console[_0x3b8876(0x25b)]('─'[_0x3b8876(0x264)](0x3c)),console[_0x3b8876(0x25b)](_0x2d742b['diff']),console[_0x3b8876(0x25b)]('─'[_0x3b8876(0x264)](0x3c)));}for(const _0x3d8f03 of _0x2723b2){_0x3d8f03[_0x3b8876(0x274)]&&(console['log'](_0x3b8876(0x281)+_0x3d8f03[_0x3b8876(0x1f4)]+'\x27:'),console[_0x3b8876(0x25b)]('─'[_0x3b8876(0x264)](0x3c)),console[_0x3b8876(0x25b)](_0x3d8f03[_0x3b8876(0x274)]),console['log']('─'[_0x3b8876(0x264)](0x3c)));}for(const _0x31332b of _0x4cf2b9){_0x31332b['diff']&&(console[_0x3b8876(0x25b)](_0x3b8876(0x215)+_0x31332b[_0x3b8876(0x1f4)]+'\x27:'),console[_0x3b8876(0x25b)]('─'['repeat'](0x3c)),console[_0x3b8876(0x25b)](_0x31332b[_0x3b8876(0x274)]),console['log']('─'[_0x3b8876(0x264)](0x3c)));}for(const _0x276eb2 of _0x4c6f36){_0x276eb2[_0x3b8876(0x274)]&&(console[_0x3b8876(0x25b)]('\x0aChanges\x20to\x20integration\x20\x27'+_0x276eb2['name']+'\x27:'),console['log']('─'[_0x3b8876(0x264)](0x3c)),console['log'](_0x276eb2[_0x3b8876(0x274)]),console[_0x3b8876(0x25b)]('─'[_0x3b8876(0x264)](0x3c)));}for(const _0x48a327 of _0x2749cd){_0x48a327[_0x3b8876(0x274)]&&(console[_0x3b8876(0x25b)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x48a327['name']+'\x27:'),console[_0x3b8876(0x25b)]('─'[_0x3b8876(0x264)](0x3c)),console[_0x3b8876(0x25b)](_0x48a327[_0x3b8876(0x274)]),console[_0x3b8876(0x25b)]('─'[_0x3b8876(0x264)](0x3c)));}for(const _0x5827a2 of _0x5942e0){_0x5827a2[_0x3b8876(0x274)]&&(console['log'](_0x3b8876(0x238)+_0x5827a2[_0x3b8876(0x1f4)]+'\x27:'),console[_0x3b8876(0x25b)]('─'['repeat'](0x3c)),console['log'](_0x5827a2['diff']),console['log']('─'[_0x3b8876(0x264)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x3c89bd(0x1f4)]='agent:pull';[a4_0x3c89bd(0x227)]=a4_0x3c89bd(0x269);async[a4_0x3c89bd(0x237)](_0x4b682c){const _0x4b631d=a4_0x3c89bd,{options:_0x470222,args:_0x5d370d,tdx:_0x3e47d7}=_0x4b682c,_0x1eea3a=_0x5d370d[0x0],_0x3bca87=_0x5d370d[0x1],_0x3c5c1e=_0x470222['output'],_0x4fea08=_0x470222[_0x4b631d(0x284)],_0x3e3c76=_0x470222['force'],_0x55301c=_0x470222[_0x4b631d(0x276)],_0x4de693=_0x470222[_0x4b631d(0x289)],_0x349cbc=_0x470222['agent'];let _0x251d6d;if(_0x1eea3a){const _0x4fb99a=a4_0x24c893[_0x4b631d(0x231)](_0x1eea3a,_0x4b631d(0x280));if(existsSync(_0x4fb99a))try{const _0x25af65=JSON[_0x4b631d(0x1ed)](readFileSync(_0x4fb99a,_0x4b631d(0x262)));_0x25af65[_0x4b631d(0x266)]&&(_0x251d6d={'llm_project':_0x25af65[_0x4b631d(0x266)]});}catch{}}const _0xbfe48=findAgentConfigPath(process['cwd']());let _0xbae5b8;if(_0xbfe48)try{const _0x4643db=JSON['parse'](readFileSync(_0xbfe48,_0x4b631d(0x262)));_0x4643db['llm_project']&&(_0xbae5b8={'llm_project':_0x4643db[_0x4b631d(0x266)]});}catch{}const _0x4db4e3=resolveAgentPullArgs({'arg':_0x1eea3a,'agentNameArg':_0x3bca87,'agentFlag':_0x349cbc,'contextProject':_0x4de693,'argDirConfig':_0x251d6d,'cwdConfigPath':_0xbfe48||undefined,'cwdConfig':_0xbae5b8}),{projectNameOrId:_0x1a1d88,targetAgentName:_0x4f5ba8,existingOutputDir:_0x5bbd00,source:_0x4afc7f}=_0x4db4e3;if(_0x4afc7f===_0x4b631d(0x25e))console['log'](a4_0x282c7e[_0x4b631d(0x233)]('Using\x20project\x20from\x20'+a4_0x24c893[_0x4b631d(0x231)](_0x1eea3a,_0x4b631d(0x280))+':\x20'+_0x1a1d88));else{if(_0x4afc7f===_0x4b631d(0x28c))console['log'](a4_0x282c7e[_0x4b631d(0x233)](_0x4b631d(0x27f)+_0x1a1d88));else _0x4afc7f==='context'&&console[_0x4b631d(0x25b)](a4_0x282c7e[_0x4b631d(0x233)](_0x4b631d(0x1ee)+_0x1a1d88));}if(!_0x1a1d88)return _0x349cbc?(console[_0x4b631d(0x25b)](a4_0x282c7e[_0x4b631d(0x1f9)]('The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a')),console[_0x4b631d(0x25b)](_0x4b631d(0x22b)),console[_0x4b631d(0x25b)](_0x4b631d(0x213))):(console[_0x4b631d(0x25b)](a4_0x282c7e[_0x4b631d(0x1f9)](_0x4b631d(0x265))),console[_0x4b631d(0x25b)](_0x4b631d(0x22c)),console['log'](_0x4b631d(0x296)),console[_0x4b631d(0x25b)](_0x4b631d(0x21d)),console['log']('\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['log'](_0x4b631d(0x203))),0x1;if(_0x4f5ba8){const {data:_0x3f815c}=await withSpinner('Pulling\x20agent\x20\x22'+_0x4f5ba8+'\x22\x20from\x20project\x20\x22'+_0x1a1d88+_0x4b631d(0x224),()=>_0x3e47d7[_0x4b631d(0x20a)][_0x4b631d(0x218)](_0x1a1d88,_0x4f5ba8,_0x3c5c1e,{'dryRun':_0x4fea08,'force':_0x3e3c76}));if(_0x4fea08)return console['log'](a4_0x282c7e[_0x4b631d(0x1f9)](_0x4b631d(0x28a))),console[_0x4b631d(0x25b)]('Would\x20pull\x20agent:\x20'+_0x3f815c[_0x4b631d(0x25d)]),console[_0x4b631d(0x25b)]('Output\x20path:\x20'+_0x3f815c[_0x4b631d(0x201)]),_0x3f815c[_0x4b631d(0x274)]&&(console[_0x4b631d(0x25b)](_0x4b631d(0x214)),console['log']('─'[_0x4b631d(0x264)](0x3c)),console[_0x4b631d(0x25b)](_0x3f815c[_0x4b631d(0x274)]),console[_0x4b631d(0x25b)]('─'['repeat'](0x3c))),0x0;return console['log'](a4_0x282c7e[_0x4b631d(0x29a)]('Agent\x20pulled\x20successfully')),console[_0x4b631d(0x25b)]('Agent:\x20'+_0x3f815c['agentName']),console[_0x4b631d(0x25b)]('Output:\x20'+_0x3f815c[_0x4b631d(0x201)]),console['log'](_0x4b631d(0x252)+(_0x3f815c['isNew']?a4_0x282c7e[_0x4b631d(0x29a)](_0x4b631d(0x268)):_0x3f815c[_0x4b631d(0x21b)]?a4_0x282c7e[_0x4b631d(0x1f9)]('updated'):a4_0x282c7e[_0x4b631d(0x239)](_0x4b631d(0x210)))),0x0;}const _0x574ed9=_0x5bbd00||_0x3c5c1e,{data:_0x120938}=await withSpinner(_0x4b631d(0x1e8)+_0x1a1d88+_0x4b631d(0x224),()=>_0x3e47d7[_0x4b631d(0x20a)]['pullProject'](_0x1a1d88,_0x574ed9,{'dryRun':!![]})),_0x266ea6=_0x120938['counts'][_0x4b631d(0x20b)][_0x4b631d(0x268)]+_0x120938[_0x4b631d(0x298)][_0x4b631d(0x208)]['new']+_0x120938[_0x4b631d(0x298)][_0x4b631d(0x1eb)][_0x4b631d(0x268)]+_0x120938['counts'][_0x4b631d(0x24a)][_0x4b631d(0x268)]+_0x120938['counts'][_0x4b631d(0x204)]['new']+_0x120938[_0x4b631d(0x298)]['experimentalKnowledgeBases'][_0x4b631d(0x268)]+_0x120938['counts'][_0x4b631d(0x200)][_0x4b631d(0x268)],_0xc31fdb=_0x120938[_0x4b631d(0x298)][_0x4b631d(0x20b)][_0x4b631d(0x205)]+_0x120938[_0x4b631d(0x298)][_0x4b631d(0x208)][_0x4b631d(0x205)]+_0x120938[_0x4b631d(0x298)][_0x4b631d(0x1eb)]['updated']+_0x120938[_0x4b631d(0x298)][_0x4b631d(0x24a)][_0x4b631d(0x205)]+_0x120938[_0x4b631d(0x298)][_0x4b631d(0x204)]['updated']+_0x120938[_0x4b631d(0x298)][_0x4b631d(0x235)][_0x4b631d(0x205)]+_0x120938[_0x4b631d(0x298)][_0x4b631d(0x200)][_0x4b631d(0x205)],_0x2ab2a7=_0x120938[_0x4b631d(0x298)]['agents'][_0x4b631d(0x210)]+_0x120938[_0x4b631d(0x298)][_0x4b631d(0x208)][_0x4b631d(0x210)]+_0x120938['counts']['textKnowledgeBases'][_0x4b631d(0x210)]+_0x120938[_0x4b631d(0x298)][_0x4b631d(0x24a)]['unchanged']+_0x120938[_0x4b631d(0x298)][_0x4b631d(0x204)][_0x4b631d(0x210)]+_0x120938['counts'][_0x4b631d(0x235)]['unchanged']+_0x120938[_0x4b631d(0x298)][_0x4b631d(0x200)][_0x4b631d(0x210)];console[_0x4b631d(0x25b)](_0x4b631d(0x258)+_0x120938[_0x4b631d(0x1f1)]+'\x27:'),console[_0x4b631d(0x25b)]('\x20\x20'+a4_0x282c7e[_0x4b631d(0x29a)]('+\x20'+_0x266ea6+'\x20new')+_0x4b631d(0x241)+a4_0x282c7e['yellow']('~\x20'+_0xc31fdb+_0x4b631d(0x21f))+_0x4b631d(0x241)+a4_0x282c7e[_0x4b631d(0x233)]('=\x20'+_0x2ab2a7+_0x4b631d(0x1fc))),console[_0x4b631d(0x25b)](_0x4b631d(0x234)+formatCountSummary(_0x120938[_0x4b631d(0x298)][_0x4b631d(0x20b)])),console[_0x4b631d(0x25b)](_0x4b631d(0x287)+formatCountSummary(_0x120938[_0x4b631d(0x298)][_0x4b631d(0x208)])),console[_0x4b631d(0x25b)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x120938[_0x4b631d(0x298)]['textKnowledgeBases'])),console[_0x4b631d(0x25b)](_0x4b631d(0x283)+formatCountSummary(_0x120938[_0x4b631d(0x298)][_0x4b631d(0x24a)])),console[_0x4b631d(0x25b)](_0x4b631d(0x28f)+formatCountSummary(_0x120938[_0x4b631d(0x298)][_0x4b631d(0x204)]));const _0x4d2228=_0x120938[_0x4b631d(0x298)][_0x4b631d(0x235)][_0x4b631d(0x293)]>0x0||_0x120938[_0x4b631d(0x298)][_0x4b631d(0x200)][_0x4b631d(0x293)]>0x0;_0x4d2228&&(console[_0x4b631d(0x25b)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x120938[_0x4b631d(0x298)]['experimentalKnowledgeBases'])),console['log'](_0x4b631d(0x275)+formatCountSummary(_0x120938[_0x4b631d(0x298)]['experimentalArtifacts'])));console[_0x4b631d(0x25b)]('\x20\x20Target:\x20'+a4_0x282c7e['cyan'](_0x120938[_0x4b631d(0x26f)])),displayDiffs(_0x120938[_0x4b631d(0x20b)],_0x120938['knowledgeBases'],_0x120938[_0x4b631d(0x1eb)],_0x120938[_0x4b631d(0x24a)],_0x120938['integrations'],_0x120938['experimentalKnowledgeBases'],_0x120938['experimentalArtifacts']);if(_0x4fea08)return console[_0x4b631d(0x25b)](a4_0x282c7e[_0x4b631d(0x1f9)](_0x4b631d(0x27e))),0x0;if(_0x266ea6===0x0&&_0xc31fdb===0x0)return console[_0x4b631d(0x25b)](a4_0x282c7e[_0x4b631d(0x29a)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x120938[_0x4b631d(0x1f1)]},_0x470222['session']),console[_0x4b631d(0x25b)](a4_0x282c7e[_0x4b631d(0x29a)](_0x4b631d(0x22e)+a4_0x282c7e[_0x4b631d(0x233)](_0x4b631d(0x266))+_0x4b631d(0x228)+a4_0x282c7e['cyan'](_0x120938['projectName']))),0x0;if(!_0x55301c&&!_0x3e3c76){if(!isInteractive())return console['error'](a4_0x282c7e[_0x4b631d(0x23f)]('\x0aError:'),_0x4b631d(0x29b)),console['error'](a4_0x282c7e[_0x4b631d(0x233)](_0x4b631d(0x219))),0x1;const _0x38fab2=await confirmKey('\x0aWrite\x20'+(_0x266ea6+_0xc31fdb)+'\x20files?');if(!_0x38fab2)return console[_0x4b631d(0x25b)](a4_0x282c7e[_0x4b631d(0x1f9)](_0x4b631d(0x28d)),'-\x20no\x20files\x20written'),0x1;}const {data:_0x1d3fd0}=await withSpinner(_0x4b631d(0x23c),()=>_0x3e47d7[_0x4b631d(0x20a)][_0x4b631d(0x226)](_0x1a1d88,_0x574ed9,{'force':_0x3e3c76}));return console['log'](a4_0x282c7e[_0x4b631d(0x29a)]('\x0a✔\x20Pulled\x20'+(_0x266ea6+_0xc31fdb)+_0x4b631d(0x1f5)+_0x1d3fd0[_0x4b631d(0x26f)])),saveSessionContext({'llm_project':_0x1d3fd0[_0x4b631d(0x1f1)]},_0x470222[_0x4b631d(0x249)]),console[_0x4b631d(0x25b)](a4_0x282c7e[_0x4b631d(0x29a)](_0x4b631d(0x22e)+a4_0x282c7e[_0x4b631d(0x233)]('llm_project')+'\x20=\x20'+a4_0x282c7e[_0x4b631d(0x254)](_0x1d3fd0[_0x4b631d(0x1f1)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x3c89bd(0x1f4)]=a4_0x3c89bd(0x20d);[a4_0x3c89bd(0x227)]=a4_0x3c89bd(0x28e);async[a4_0x3c89bd(0x237)](_0xa26d4e){const _0x11cfe2=a4_0x3c89bd,{options:_0x50b595,args:_0x55c446,tdx:_0x193cf7}=_0xa26d4e,_0x59e4b6=_0x55c446[0x0],_0x3f7b80=_0x50b595[_0x11cfe2(0x1f4)],_0x3235bb=_0x50b595[_0x11cfe2(0x284)],_0x4764f7=_0x50b595[_0x11cfe2(0x276)],_0xb26468=_0x50b595['site'],_0x19905d=_0x50b595['llmProject'];let _0x36def7;const _0x18cce5=findAgentConfigPath(process[_0x11cfe2(0x294)]());if(_0x59e4b6){const _0x4f9423=a4_0x24c893['join'](_0x59e4b6,_0x11cfe2(0x280));existsSync(_0x4f9423)?(_0x36def7=_0x59e4b6,console[_0x11cfe2(0x25b)](a4_0x282c7e[_0x11cfe2(0x233)](_0x11cfe2(0x263)+_0x59e4b6))):_0x36def7=_0x59e4b6;}else{if(_0x18cce5)_0x36def7=a4_0x24c893['dirname'](_0x18cce5),console[_0x11cfe2(0x25b)](a4_0x282c7e[_0x11cfe2(0x233)](_0x11cfe2(0x232)+_0x36def7));else{if(_0x19905d){const _0x2f8172=sanitizeForFilesystem(_0x19905d);let _0x2d1a19=_0x2f8172,_0x4af032=a4_0x24c893[_0x11cfe2(0x231)](process[_0x11cfe2(0x294)](),_0x11cfe2(0x20b),_0x2f8172,_0x11cfe2(0x280));if(!existsSync(_0x4af032)){const _0x3dd32e=normalizeName(_0x19905d),_0x5cb0b5=a4_0x24c893[_0x11cfe2(0x231)](process['cwd'](),_0x11cfe2(0x20b),_0x3dd32e,_0x11cfe2(0x280));existsSync(_0x5cb0b5)&&(_0x2d1a19=_0x3dd32e,_0x4af032=_0x5cb0b5);}if(existsSync(_0x4af032))_0x36def7=a4_0x24c893[_0x11cfe2(0x1e7)](_0x4af032),console[_0x11cfe2(0x25b)](a4_0x282c7e[_0x11cfe2(0x233)]('Using\x20local\x20project:\x20'+_0x36def7));else{const _0x5ade47=_0x50b595[_0x11cfe2(0x279)];if(_0x5ade47)throw new SDKError(ErrorCode[_0x11cfe2(0x29d)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x19905d+_0x11cfe2(0x26e),undefined,{'helpText':_0x11cfe2(0x27c)+_0x11cfe2(0x23b)+(_0x11cfe2(0x251)+_0x19905d+'\x0a')+(_0x11cfe2(0x242)+_0x2d1a19+_0x11cfe2(0x295)+(_0x3f7b80||'<new-name>')+_0x11cfe2(0x24d)+_0x5ade47)});_0x36def7=_0x19905d,console['log'](a4_0x282c7e[_0x11cfe2(0x233)](_0x11cfe2(0x212)+_0x19905d));}}}}if(!_0x36def7)return console['log'](a4_0x282c7e[_0x11cfe2(0x1f9)](_0x11cfe2(0x22a))),console['log'](_0x11cfe2(0x282)),console[_0x11cfe2(0x25b)](_0x11cfe2(0x28b)),console[_0x11cfe2(0x25b)]('\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)'),console[_0x11cfe2(0x25b)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x3f7b80)throw new SDKError(ErrorCode[_0x11cfe2(0x22d)],_0x11cfe2(0x206),undefined,{'helpText':_0x11cfe2(0x222)});if(!_0x4764f7&&!_0x3235bb){if(!isInteractive())return console[_0x11cfe2(0x23d)](a4_0x282c7e['red'](_0x11cfe2(0x25c)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a4_0x282c7e[_0x11cfe2(0x233)](_0x11cfe2(0x219))),0x1;const _0x536fb3=await confirmKey(_0x11cfe2(0x297)+_0x36def7+_0x11cfe2(0x250)+_0x3f7b80+'\x22?');if(!_0x536fb3)return console[_0x11cfe2(0x25b)](a4_0x282c7e[_0x11cfe2(0x1f9)](_0x11cfe2(0x28d))),0x1;}const {data:_0x2b7247}=await withSpinner(_0x11cfe2(0x29c)+_0x36def7+_0x11cfe2(0x216)+_0x3f7b80+_0x11cfe2(0x224),()=>_0x193cf7['llm'][_0x11cfe2(0x253)](_0x36def7,_0x3f7b80,{'dryRun':_0x3235bb}));if(_0x3235bb){console[_0x11cfe2(0x25b)](a4_0x282c7e['yellow'](_0x11cfe2(0x1fb))),console[_0x11cfe2(0x25b)](_0x11cfe2(0x1f2)+_0x2b7247[_0x11cfe2(0x271)]),console['log'](_0x11cfe2(0x288)+_0x3f7b80),console[_0x11cfe2(0x25b)](_0x11cfe2(0x220)),console[_0x11cfe2(0x25b)](_0x11cfe2(0x234)+_0x2b7247[_0x11cfe2(0x298)]['agents'][_0x11cfe2(0x27d)]),console[_0x11cfe2(0x25b)](_0x11cfe2(0x287)+_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x208)][_0x11cfe2(0x27d)]),console[_0x11cfe2(0x25b)](_0x11cfe2(0x283)+_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x24a)][_0x11cfe2(0x27d)]);const _0x4be03a=_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x235)][_0x11cfe2(0x27d)]>0x0||_0x2b7247[_0x11cfe2(0x298)]['experimentalArtifacts']['created']>0x0;return _0x4be03a&&(console[_0x11cfe2(0x25b)](_0x11cfe2(0x24e)+_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x235)][_0x11cfe2(0x27d)]),console['log'](_0x11cfe2(0x275)+_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x200)][_0x11cfe2(0x27d)])),0x0;}const _0x358328=_0x2b7247[_0x11cfe2(0x298)]['agents'][_0x11cfe2(0x223)]>0x0||_0x2b7247['counts']['knowledgeBases'][_0x11cfe2(0x223)]>0x0||_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x24a)]['errors']>0x0||_0x2b7247['counts'][_0x11cfe2(0x235)]['errors']>0x0||_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x200)][_0x11cfe2(0x223)]>0x0;_0x358328?console[_0x11cfe2(0x25b)](a4_0x282c7e[_0x11cfe2(0x1f9)](_0x11cfe2(0x259))):console[_0x11cfe2(0x25b)](a4_0x282c7e[_0x11cfe2(0x29a)](_0x11cfe2(0x290)));console[_0x11cfe2(0x25b)](_0x11cfe2(0x1f2)+_0x2b7247[_0x11cfe2(0x271)]),console[_0x11cfe2(0x25b)](_0x11cfe2(0x288)+_0x2b7247[_0x11cfe2(0x257)]),console[_0x11cfe2(0x25b)](_0x11cfe2(0x26b)+_0x2b7247[_0x11cfe2(0x285)]),console[_0x11cfe2(0x25b)](),console['log'](_0x11cfe2(0x273)),console[_0x11cfe2(0x25b)](_0x11cfe2(0x234)+formatCountSummary(_0x2b7247[_0x11cfe2(0x298)]['agents'])),console[_0x11cfe2(0x25b)](_0x11cfe2(0x287)+formatCountSummary(_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x208)])),console[_0x11cfe2(0x25b)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x24a)])),console[_0x11cfe2(0x25b)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x204)]));const _0x5a1037=_0x2b7247[_0x11cfe2(0x298)]['experimentalKnowledgeBases'][_0x11cfe2(0x27d)]>0x0||_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x235)]['updated']>0x0||_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x235)][_0x11cfe2(0x210)]>0x0||_0x2b7247[_0x11cfe2(0x298)]['experimentalArtifacts'][_0x11cfe2(0x27d)]>0x0||_0x2b7247[_0x11cfe2(0x298)]['experimentalArtifacts'][_0x11cfe2(0x205)]>0x0||_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x200)][_0x11cfe2(0x210)]>0x0;_0x5a1037&&(console['log']('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x2b7247[_0x11cfe2(0x298)][_0x11cfe2(0x235)])),console[_0x11cfe2(0x25b)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x2b7247[_0x11cfe2(0x298)]['experimentalArtifacts'])));if(_0x358328){console[_0x11cfe2(0x25b)](),console[_0x11cfe2(0x25b)](a4_0x282c7e[_0x11cfe2(0x23f)]('Errors:'));for(const _0x2a8714 of _0x2b7247[_0x11cfe2(0x20b)]){_0x2a8714[_0x11cfe2(0x1f7)]===_0x11cfe2(0x23d)&&console[_0x11cfe2(0x25b)](a4_0x282c7e['red'](_0x11cfe2(0x24b)+_0x2a8714[_0x11cfe2(0x25d)]+_0x11cfe2(0x245)+_0x2a8714['error']));}for(const _0x27f0ca of _0x2b7247[_0x11cfe2(0x208)]){_0x27f0ca[_0x11cfe2(0x1f7)]===_0x11cfe2(0x23d)&&console[_0x11cfe2(0x25b)](a4_0x282c7e[_0x11cfe2(0x23f)](_0x11cfe2(0x1ef)+_0x27f0ca[_0x11cfe2(0x1f4)]+_0x11cfe2(0x245)+_0x27f0ca['error']));}for(const _0x447b10 of _0x2b7247['prompts']){_0x447b10['action']===_0x11cfe2(0x23d)&&console['log'](a4_0x282c7e[_0x11cfe2(0x23f)](_0x11cfe2(0x236)+_0x447b10['name']+'\x22:\x20'+_0x447b10['error']));}for(const _0x227053 of _0x2b7247[_0x11cfe2(0x204)]){_0x227053['action']===_0x11cfe2(0x23d)&&console[_0x11cfe2(0x25b)](a4_0x282c7e[_0x11cfe2(0x23f)](_0x11cfe2(0x27b)+_0x227053[_0x11cfe2(0x1f4)]+_0x11cfe2(0x245)+_0x227053[_0x11cfe2(0x23d)]));}for(const _0x451034 of _0x2b7247[_0x11cfe2(0x235)]){_0x451034[_0x11cfe2(0x1f7)]===_0x11cfe2(0x23d)&&console[_0x11cfe2(0x25b)](a4_0x282c7e[_0x11cfe2(0x23f)](_0x11cfe2(0x26c)+_0x451034[_0x11cfe2(0x1f4)]+_0x11cfe2(0x245)+_0x451034[_0x11cfe2(0x23d)]));}for(const _0x465f08 of _0x2b7247[_0x11cfe2(0x200)]){_0x465f08[_0x11cfe2(0x1f7)]==='error'&&console[_0x11cfe2(0x25b)](a4_0x282c7e[_0x11cfe2(0x23f)](_0x11cfe2(0x230)+_0x465f08['name']+'\x22:\x20'+_0x465f08['error']));}return 0x1;}console['log']();const _0x299eb1=getLLMProjectUrl(_0xb26468,_0x2b7247[_0x11cfe2(0x285)]);return console[_0x11cfe2(0x25b)](_0x11cfe2(0x20e)+a4_0x282c7e[_0x11cfe2(0x254)](_0x299eb1)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x3c89bd(0x1f4)]=a4_0x3c89bd(0x207);['description']=a4_0x3c89bd(0x21c);async[a4_0x3c89bd(0x237)](_0x457879){const _0x4408d5=a4_0x3c89bd,{options:_0x389e77,args:_0x17f8ee,tdx:_0x13cab8}=_0x457879;let _0x568ba4=_0x17f8ee[0x0]||process[_0x4408d5(0x294)]();const _0x2c62a2=_0x389e77['dryRun'],_0x52c6f5=_0x389e77[_0x4408d5(0x270)],_0x58bb01=_0x389e77[_0x4408d5(0x276)],_0x3e1d0e=_0x389e77['site'],_0x490728=a4_0x24c893[_0x4408d5(0x231)](_0x568ba4,_0x4408d5(0x286)),_0x32d4d8=existsSync(_0x490728);if(_0x32d4d8){const {data:_0x154e65}=await withSpinner(_0x4408d5(0x211)+_0x568ba4+_0x4408d5(0x224),()=>_0x13cab8[_0x4408d5(0x20a)]['pushAgent'](_0x568ba4,{'dryRun':_0x2c62a2,'force':_0x52c6f5}));if(_0x2c62a2)return console[_0x4408d5(0x25b)](a4_0x282c7e[_0x4408d5(0x1f9)](_0x4408d5(0x1fb))),console[_0x4408d5(0x25b)](_0x4408d5(0x243)+_0x154e65[_0x4408d5(0x25d)]),0x0;if(_0x154e65['action']===_0x4408d5(0x23d))return console['log'](a4_0x282c7e['red'](_0x4408d5(0x221)+_0x154e65[_0x4408d5(0x23d)])),0x1;console[_0x4408d5(0x25b)](a4_0x282c7e[_0x4408d5(0x29a)](_0x4408d5(0x1f0)+_0x154e65['action']+_0x4408d5(0x24c))),console[_0x4408d5(0x25b)](_0x4408d5(0x272)+_0x154e65['agentName']);if(_0x154e65['agentId']&&_0x154e65['projectId']){const _0x5965c0=getLLMAgentChatUrl(_0x3e1d0e,_0x154e65[_0x4408d5(0x1f8)],_0x154e65[_0x4408d5(0x209)]);console[_0x4408d5(0x25b)](_0x4408d5(0x255)+a4_0x282c7e[_0x4408d5(0x254)](_0x5965c0));}return 0x0;}const _0x3f6b26=_0x389e77[_0x4408d5(0x289)],_0x2f65bb=resolveProjectFromContext(_0x568ba4,_0x3f6b26);if(_0x2f65bb[_0x4408d5(0x291)])_0x568ba4=_0x2f65bb['projectDir'],_0x2f65bb[_0x4408d5(0x1fe)]===_0x4408d5(0x240)&&console[_0x4408d5(0x25b)](a4_0x282c7e[_0x4408d5(0x233)]('Using\x20project:\x20'+_0x568ba4));else{let _0x55f16d='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x2f65bb[_0x4408d5(0x22f)]===_0x4408d5(0x246)&&(_0x55f16d=_0x2f65bb[_0x4408d5(0x248)]+_0x4408d5(0x23a)+_0x2f65bb[_0x4408d5(0x289)]+_0x4408d5(0x299));throw new SDKError(ErrorCode[_0x4408d5(0x29d)],_0x2f65bb['reason']===_0x4408d5(0x20f)?_0x2f65bb['message']:_0x4408d5(0x1ff)+_0x568ba4,undefined,{'helpText':_0x55f16d});}const {data:_0x33f7ee}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x13cab8['llm']['pushProject'](_0x568ba4,{'dryRun':!![]})),_0x4b52de=_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x20b)][_0x4408d5(0x223)]>0x0;if(_0x4b52de){console['log'](a4_0x282c7e['red'](_0x4408d5(0x27a)));for(const _0xaca2b7 of _0x33f7ee[_0x4408d5(0x20b)]){_0xaca2b7[_0x4408d5(0x1f7)]===_0x4408d5(0x23d)&&console[_0x4408d5(0x25b)](a4_0x282c7e['red'](_0x4408d5(0x24b)+_0xaca2b7[_0x4408d5(0x25d)]+'\x22:\x20'+_0xaca2b7[_0x4408d5(0x23d)]));}return 0x1;}const _0x49b8ba=_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x20b)][_0x4408d5(0x27d)]+_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x208)][_0x4408d5(0x27d)]+_0x33f7ee['counts']['textKnowledgeBases'][_0x4408d5(0x27d)]+_0x33f7ee['counts'][_0x4408d5(0x24a)][_0x4408d5(0x27d)]+_0x33f7ee[_0x4408d5(0x298)]['integrations'][_0x4408d5(0x27d)]+_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x235)][_0x4408d5(0x27d)]+_0x33f7ee[_0x4408d5(0x298)]['experimentalArtifacts']['created'],_0x97d6af=_0x33f7ee[_0x4408d5(0x298)]['agents'][_0x4408d5(0x205)]+_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x208)][_0x4408d5(0x205)]+_0x33f7ee['counts'][_0x4408d5(0x1eb)][_0x4408d5(0x205)]+_0x33f7ee['counts'][_0x4408d5(0x24a)][_0x4408d5(0x205)]+_0x33f7ee['counts'][_0x4408d5(0x204)]['updated']+_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x235)][_0x4408d5(0x205)]+_0x33f7ee['counts']['experimentalArtifacts'][_0x4408d5(0x205)],_0x5973e3=_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x20b)]['unchanged']+_0x33f7ee[_0x4408d5(0x298)]['knowledgeBases'][_0x4408d5(0x210)]+_0x33f7ee[_0x4408d5(0x298)]['textKnowledgeBases'][_0x4408d5(0x210)]+_0x33f7ee[_0x4408d5(0x298)]['prompts'][_0x4408d5(0x210)]+_0x33f7ee['counts']['integrations'][_0x4408d5(0x210)]+_0x33f7ee['counts'][_0x4408d5(0x235)]['unchanged']+_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x200)][_0x4408d5(0x210)];console[_0x4408d5(0x25b)](_0x4408d5(0x20c)+_0x33f7ee[_0x4408d5(0x1f1)]+'\x27:'),console[_0x4408d5(0x25b)]('\x20\x20'+a4_0x282c7e[_0x4408d5(0x29a)]('+\x20'+_0x49b8ba+_0x4408d5(0x1e6))+_0x4408d5(0x241)+a4_0x282c7e['yellow']('~\x20'+_0x97d6af+_0x4408d5(0x21f))+_0x4408d5(0x241)+a4_0x282c7e[_0x4408d5(0x233)]('=\x20'+_0x5973e3+_0x4408d5(0x1fc))),console[_0x4408d5(0x25b)]('\x20\x20Agents:\x20'+formatCountSummary(_0x33f7ee[_0x4408d5(0x298)]['agents'])),console[_0x4408d5(0x25b)](_0x4408d5(0x287)+formatCountSummary(_0x33f7ee[_0x4408d5(0x298)]['knowledgeBases'])),console[_0x4408d5(0x25b)](_0x4408d5(0x260)+formatCountSummary(_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x1eb)])),console[_0x4408d5(0x25b)](_0x4408d5(0x283)+formatCountSummary(_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x24a)])),console[_0x4408d5(0x25b)](_0x4408d5(0x28f)+formatCountSummary(_0x33f7ee['counts']['integrations']));const _0xad94bd=_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x235)][_0x4408d5(0x27d)]>0x0||_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x235)][_0x4408d5(0x205)]>0x0||_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x235)][_0x4408d5(0x210)]>0x0||_0x33f7ee[_0x4408d5(0x298)]['experimentalArtifacts'][_0x4408d5(0x27d)]>0x0||_0x33f7ee[_0x4408d5(0x298)]['experimentalArtifacts'][_0x4408d5(0x205)]>0x0||_0x33f7ee[_0x4408d5(0x298)]['experimentalArtifacts']['unchanged']>0x0;_0xad94bd&&(console['log'](_0x4408d5(0x24e)+formatCountSummary(_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x235)])),console['log'](_0x4408d5(0x275)+formatCountSummary(_0x33f7ee[_0x4408d5(0x298)][_0x4408d5(0x200)])));console[_0x4408d5(0x25b)](_0x4408d5(0x277)+a4_0x282c7e[_0x4408d5(0x254)](_0x568ba4)),displayDiffs(_0x33f7ee[_0x4408d5(0x20b)],_0x33f7ee[_0x4408d5(0x208)],_0x33f7ee['textKnowledgeBases'],_0x33f7ee['prompts'],_0x33f7ee[_0x4408d5(0x204)],_0x33f7ee[_0x4408d5(0x235)],_0x33f7ee[_0x4408d5(0x200)]);if(_0x2c62a2)return console['log'](a4_0x282c7e[_0x4408d5(0x1f9)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x49b8ba===0x0&&_0x97d6af===0x0){console[_0x4408d5(0x25b)](a4_0x282c7e[_0x4408d5(0x29a)](_0x4408d5(0x26d)));const _0xe9231b=getLLMProjectUrl(_0x3e1d0e,_0x33f7ee['projectId']);return console[_0x4408d5(0x25b)](_0x4408d5(0x20e)+a4_0x282c7e[_0x4408d5(0x254)](_0xe9231b)),0x0;}if(!_0x58bb01&&!_0x52c6f5){if(!isInteractive())return console['error'](a4_0x282c7e[_0x4408d5(0x23f)](_0x4408d5(0x25c)),_0x4408d5(0x29b)),console[_0x4408d5(0x23d)](a4_0x282c7e['dim'](_0x4408d5(0x219))),0x1;const _0x10d164=await confirmKey(_0x4408d5(0x1f6)+(_0x49b8ba+_0x97d6af)+_0x4408d5(0x202));if(!_0x10d164)return console[_0x4408d5(0x25b)](a4_0x282c7e[_0x4408d5(0x1f9)]('Cancelled'),'-\x20nothing\x20pushed'),0x1;}const {data:_0x2d6a24}=await withSpinner(_0x4408d5(0x247),()=>_0x13cab8[_0x4408d5(0x20a)][_0x4408d5(0x25f)](_0x568ba4,{'force':_0x52c6f5})),_0x36b344=_0x2d6a24['counts']['agents']['errors']>0x0||_0x2d6a24['counts'][_0x4408d5(0x208)]['errors']>0x0||_0x2d6a24[_0x4408d5(0x298)][_0x4408d5(0x1eb)][_0x4408d5(0x223)]>0x0||_0x2d6a24[_0x4408d5(0x298)][_0x4408d5(0x24a)][_0x4408d5(0x223)]>0x0;if(_0x36b344){console[_0x4408d5(0x25b)](a4_0x282c7e['yellow'](_0x4408d5(0x23e))),console['log'](),console['log'](a4_0x282c7e[_0x4408d5(0x23f)](_0x4408d5(0x278)));for(const _0x1c9e42 of _0x2d6a24[_0x4408d5(0x20b)]){_0x1c9e42[_0x4408d5(0x1f7)]===_0x4408d5(0x23d)&&console['log'](a4_0x282c7e[_0x4408d5(0x23f)](_0x4408d5(0x24b)+_0x1c9e42[_0x4408d5(0x25d)]+_0x4408d5(0x245)+_0x1c9e42[_0x4408d5(0x23d)]));}for(const _0x23e3cd of _0x2d6a24[_0x4408d5(0x208)]){_0x23e3cd[_0x4408d5(0x1f7)]===_0x4408d5(0x23d)&&console[_0x4408d5(0x25b)](a4_0x282c7e[_0x4408d5(0x23f)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x23e3cd[_0x4408d5(0x1f4)]+_0x4408d5(0x245)+_0x23e3cd[_0x4408d5(0x23d)]));}for(const _0x3cac9f of _0x2d6a24[_0x4408d5(0x1eb)]){_0x3cac9f[_0x4408d5(0x1f7)]===_0x4408d5(0x23d)&&console[_0x4408d5(0x25b)](a4_0x282c7e[_0x4408d5(0x23f)](_0x4408d5(0x1e9)+_0x3cac9f[_0x4408d5(0x1f4)]+_0x4408d5(0x245)+_0x3cac9f[_0x4408d5(0x23d)]));}for(const _0x3c957b of _0x2d6a24[_0x4408d5(0x24a)]){_0x3c957b[_0x4408d5(0x1f7)]==='error'&&console['log'](a4_0x282c7e[_0x4408d5(0x23f)](_0x4408d5(0x236)+_0x3c957b[_0x4408d5(0x1f4)]+'\x22:\x20'+_0x3c957b[_0x4408d5(0x23d)]));}for(const _0x4e6c0a of _0x2d6a24['integrations']){_0x4e6c0a['action']===_0x4408d5(0x23d)&&console[_0x4408d5(0x25b)](a4_0x282c7e[_0x4408d5(0x23f)](_0x4408d5(0x27b)+_0x4e6c0a[_0x4408d5(0x1f4)]+_0x4408d5(0x245)+_0x4e6c0a['error']));}return 0x1;}console['log'](a4_0x282c7e[_0x4408d5(0x29a)](_0x4408d5(0x1fa)+(_0x49b8ba+_0x97d6af)+_0x4408d5(0x1f3)+_0x2d6a24[_0x4408d5(0x1f1)]+'\x27'));const _0x351dd8=getLLMProjectUrl(_0x3e1d0e,_0x2d6a24[_0x4408d5(0x1f8)]);return console[_0x4408d5(0x25b)](_0x4408d5(0x20e)+a4_0x282c7e['cyan'](_0x351dd8)),0x0;}}
|
|
1
|
+
const a4_0x46ea57=a4_0xb5f9;(function(_0x10b208,_0x3c4caf){const _0x45c9fe=a4_0xb5f9,_0x31377a=_0x10b208();while(!![]){try{const _0x25270e=-parseInt(_0x45c9fe(0x263))/0x1*(-parseInt(_0x45c9fe(0x264))/0x2)+-parseInt(_0x45c9fe(0x253))/0x3+parseInt(_0x45c9fe(0x215))/0x4+parseInt(_0x45c9fe(0x1fa))/0x5*(-parseInt(_0x45c9fe(0x1ee))/0x6)+parseInt(_0x45c9fe(0x1ef))/0x7+parseInt(_0x45c9fe(0x1ed))/0x8+-parseInt(_0x45c9fe(0x1de))/0x9;if(_0x25270e===_0x3c4caf)break;else _0x31377a['push'](_0x31377a['shift']());}catch(_0x5cca0e){_0x31377a['push'](_0x31377a['shift']());}}}(a4_0x392f,0x1af0c));import a4_0x5b7797 from'chalk';import a4_0xd83b37 from'path';import{existsSync,readFileSync}from'fs';function a4_0xb5f9(_0x1fe491,_0x1ddef5){_0x1fe491=_0x1fe491-0x1c6;const _0x392fb4=a4_0x392f();let _0xb5f944=_0x392fb4[_0x1fe491];return _0xb5f944;}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(_0x338ba6){const _0x38fa14=a4_0xb5f9,_0x5c869d=[];if(_0x338ba6[_0x38fa14(0x1fe)]!==undefined)_0x5c869d[_0x38fa14(0x1f5)](_0x338ba6['total']+_0x38fa14(0x268));if(_0x338ba6['new']!==undefined&&_0x338ba6[_0x38fa14(0x20d)]>0x0)_0x5c869d[_0x38fa14(0x1f5)](a4_0x5b7797[_0x38fa14(0x260)](_0x338ba6[_0x38fa14(0x20d)]+_0x38fa14(0x214)));if(_0x338ba6[_0x38fa14(0x259)]!==undefined&&_0x338ba6[_0x38fa14(0x259)]>0x0)_0x5c869d[_0x38fa14(0x1f5)](a4_0x5b7797['green'](_0x338ba6[_0x38fa14(0x259)]+_0x38fa14(0x1d3)));if(_0x338ba6[_0x38fa14(0x246)]!==undefined&&_0x338ba6[_0x38fa14(0x246)]>0x0)_0x5c869d['push'](a4_0x5b7797[_0x38fa14(0x221)](_0x338ba6['updated']+_0x38fa14(0x270)));if(_0x338ba6[_0x38fa14(0x258)]!==undefined&&_0x338ba6['unchanged']>0x0)_0x5c869d[_0x38fa14(0x1f5)](a4_0x5b7797[_0x38fa14(0x21c)](_0x338ba6[_0x38fa14(0x258)]+_0x38fa14(0x26a)));if(_0x338ba6[_0x38fa14(0x1d0)]!==undefined&&_0x338ba6[_0x38fa14(0x1d0)]>0x0)_0x5c869d[_0x38fa14(0x1f5)](a4_0x5b7797[_0x38fa14(0x1cf)](_0x338ba6[_0x38fa14(0x1d0)]+'\x20errors'));return _0x5c869d[_0x38fa14(0x272)](',\x20');}function displayDiffs(_0x3b090f,_0x587a01,_0x2a905d,_0x33669a,_0x1b52e9,_0x319bfe,_0x334c0f){const _0x5e0ccc=a4_0xb5f9;for(const _0x228d59 of _0x3b090f){if(_0x228d59[_0x5e0ccc(0x1ea)]){const _0x75a52a=_0x228d59[_0x5e0ccc(0x26b)]||_0x228d59[_0x5e0ccc(0x1d8)];console['log'](_0x5e0ccc(0x1fd)+_0x75a52a+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x5e0ccc(0x216)](_0x228d59['diff']),console[_0x5e0ccc(0x216)]('─'[_0x5e0ccc(0x26d)](0x3c));}}for(const _0x3776a5 of _0x587a01){_0x3776a5[_0x5e0ccc(0x1ea)]&&(console['log']('\x0aChanges\x20to\x20knowledge\x20base\x20\x27'+_0x3776a5[_0x5e0ccc(0x1d8)]+'\x27:'),console['log']('─'[_0x5e0ccc(0x26d)](0x3c)),console[_0x5e0ccc(0x216)](_0x3776a5[_0x5e0ccc(0x1ea)]),console[_0x5e0ccc(0x216)]('─'[_0x5e0ccc(0x26d)](0x3c)));}for(const _0x40f4c3 of _0x2a905d){_0x40f4c3['diff']&&(console[_0x5e0ccc(0x216)](_0x5e0ccc(0x209)+_0x40f4c3[_0x5e0ccc(0x1d8)]+'\x27:'),console['log']('─'[_0x5e0ccc(0x26d)](0x3c)),console['log'](_0x40f4c3[_0x5e0ccc(0x1ea)]),console[_0x5e0ccc(0x216)]('─'[_0x5e0ccc(0x26d)](0x3c)));}for(const _0x1f749b of _0x33669a){_0x1f749b[_0x5e0ccc(0x1ea)]&&(console[_0x5e0ccc(0x216)](_0x5e0ccc(0x1f6)+_0x1f749b[_0x5e0ccc(0x1d8)]+'\x27:'),console[_0x5e0ccc(0x216)]('─'[_0x5e0ccc(0x26d)](0x3c)),console[_0x5e0ccc(0x216)](_0x1f749b['diff']),console[_0x5e0ccc(0x216)]('─'[_0x5e0ccc(0x26d)](0x3c)));}for(const _0x597359 of _0x1b52e9){_0x597359[_0x5e0ccc(0x1ea)]&&(console[_0x5e0ccc(0x216)](_0x5e0ccc(0x282)+_0x597359['name']+'\x27:'),console[_0x5e0ccc(0x216)]('─'[_0x5e0ccc(0x26d)](0x3c)),console[_0x5e0ccc(0x216)](_0x597359['diff']),console['log']('─'[_0x5e0ccc(0x26d)](0x3c)));}for(const _0x3f4f5b of _0x319bfe){_0x3f4f5b[_0x5e0ccc(0x1ea)]&&(console[_0x5e0ccc(0x216)](_0x5e0ccc(0x222)+_0x3f4f5b['name']+'\x27:'),console[_0x5e0ccc(0x216)]('─'[_0x5e0ccc(0x26d)](0x3c)),console[_0x5e0ccc(0x216)](_0x3f4f5b[_0x5e0ccc(0x1ea)]),console[_0x5e0ccc(0x216)]('─'[_0x5e0ccc(0x26d)](0x3c)));}for(const _0x473028 of _0x334c0f){_0x473028['diff']&&(console[_0x5e0ccc(0x216)](_0x5e0ccc(0x1e6)+_0x473028['name']+'\x27:'),console[_0x5e0ccc(0x216)]('─'[_0x5e0ccc(0x26d)](0x3c)),console[_0x5e0ccc(0x216)](_0x473028['diff']),console[_0x5e0ccc(0x216)]('─'[_0x5e0ccc(0x26d)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x46ea57(0x1d8)]=a4_0x46ea57(0x1d2);[a4_0x46ea57(0x206)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async['execute'](_0x1e6ada){const _0x3674c7=a4_0x46ea57,{options:_0x4bc64d,args:_0x4a61b1,tdx:_0x5141e8}=_0x1e6ada,_0x3e5fc6=_0x4a61b1[0x0],_0xb5c4ba=_0x4a61b1[0x1],_0x3ec4f9=_0x4bc64d[_0x3674c7(0x27b)],_0x4876a2=_0x4bc64d['dryRun'],_0xb89f36=_0x4bc64d[_0x3674c7(0x1d4)],_0x3aaed5=_0x4bc64d['yes'],_0x4b4b2c=_0x4bc64d[_0x3674c7(0x21d)],_0x5eda98=_0x4bc64d[_0x3674c7(0x23e)];let _0x3cfbe5;if(_0x3e5fc6){const _0x45b8b8=a4_0xd83b37['join'](_0x3e5fc6,_0x3674c7(0x238));if(existsSync(_0x45b8b8))try{const _0x1d28c9=JSON[_0x3674c7(0x276)](readFileSync(_0x45b8b8,_0x3674c7(0x200)));_0x1d28c9[_0x3674c7(0x213)]&&(_0x3cfbe5={'llm_project':_0x1d28c9[_0x3674c7(0x213)]});}catch{}}const _0x445c51=findAgentConfigPath(process[_0x3674c7(0x25c)]());let _0x5ed261;if(_0x445c51)try{const _0x4570b5=JSON[_0x3674c7(0x276)](readFileSync(_0x445c51,'utf-8'));_0x4570b5[_0x3674c7(0x213)]&&(_0x5ed261={'llm_project':_0x4570b5[_0x3674c7(0x213)]});}catch{}const _0x219559=resolveAgentPullArgs({'arg':_0x3e5fc6,'agentNameArg':_0xb5c4ba,'agentFlag':_0x5eda98,'contextProject':_0x4b4b2c,'argDirConfig':_0x3cfbe5,'cwdConfigPath':_0x445c51||undefined,'cwdConfig':_0x5ed261}),{projectNameOrId:_0x5e7546,targetAgentName:_0x3c090e,existingOutputDir:_0x3a0e2e,source:_0x2ae868}=_0x219559;if(_0x2ae868===_0x3674c7(0x256))console['log'](a4_0x5b7797[_0x3674c7(0x1e1)](_0x3674c7(0x1d7)+a4_0xd83b37[_0x3674c7(0x272)](_0x3e5fc6,_0x3674c7(0x238))+':\x20'+_0x5e7546));else{if(_0x2ae868===_0x3674c7(0x1fc))console[_0x3674c7(0x216)](a4_0x5b7797[_0x3674c7(0x1e1)](_0x3674c7(0x255)+_0x5e7546));else _0x2ae868===_0x3674c7(0x257)&&console[_0x3674c7(0x216)](a4_0x5b7797[_0x3674c7(0x1e1)](_0x3674c7(0x23f)+_0x5e7546));}if(!_0x5e7546)return _0x5eda98?(console[_0x3674c7(0x216)](a4_0x5b7797['yellow']('The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a')),console['log'](_0x3674c7(0x1e9)),console[_0x3674c7(0x216)](_0x3674c7(0x278))):(console['log'](a4_0x5b7797[_0x3674c7(0x221)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x3674c7(0x216)](_0x3674c7(0x21b)),console[_0x3674c7(0x216)](_0x3674c7(0x1ce)),console[_0x3674c7(0x216)](_0x3674c7(0x1f8)),console[_0x3674c7(0x216)](_0x3674c7(0x231)),console['log'](_0x3674c7(0x224))),0x1;if(_0x3c090e){const {data:_0x467ac5}=await withSpinner('Pulling\x20agent\x20\x22'+_0x3c090e+_0x3674c7(0x250)+_0x5e7546+_0x3674c7(0x241),()=>_0x5141e8[_0x3674c7(0x23a)][_0x3674c7(0x1cb)](_0x5e7546,_0x3c090e,_0x3ec4f9,{'dryRun':_0x4876a2,'force':_0xb89f36}));if(_0x4876a2)return console[_0x3674c7(0x216)](a4_0x5b7797[_0x3674c7(0x221)](_0x3674c7(0x265))),console[_0x3674c7(0x216)]('Would\x20pull\x20agent:\x20'+_0x467ac5[_0x3674c7(0x26b)]),console[_0x3674c7(0x216)](_0x3674c7(0x24d)+_0x467ac5['outputPath']),_0x467ac5[_0x3674c7(0x1ea)]&&(console[_0x3674c7(0x216)](_0x3674c7(0x240)),console[_0x3674c7(0x216)]('─'[_0x3674c7(0x26d)](0x3c)),console[_0x3674c7(0x216)](_0x467ac5[_0x3674c7(0x1ea)]),console['log']('─'['repeat'](0x3c))),0x0;return console[_0x3674c7(0x216)](a4_0x5b7797[_0x3674c7(0x260)]('Agent\x20pulled\x20successfully')),console[_0x3674c7(0x216)](_0x3674c7(0x20c)+_0x467ac5['agentName']),console[_0x3674c7(0x216)](_0x3674c7(0x267)+_0x467ac5[_0x3674c7(0x1eb)]),console['log']('Status:\x20'+(_0x467ac5[_0x3674c7(0x1e5)]?a4_0x5b7797[_0x3674c7(0x260)](_0x3674c7(0x20d)):_0x467ac5[_0x3674c7(0x273)]?a4_0x5b7797[_0x3674c7(0x221)](_0x3674c7(0x246)):a4_0x5b7797[_0x3674c7(0x21c)](_0x3674c7(0x258)))),0x0;}const _0x2c13df=_0x3a0e2e||_0x3ec4f9,{data:_0x198925}=await withSpinner(_0x3674c7(0x1c7)+_0x5e7546+_0x3674c7(0x241),()=>_0x5141e8[_0x3674c7(0x23a)][_0x3674c7(0x244)](_0x5e7546,_0x2c13df,{'dryRun':!![]})),_0x1de87d=_0x198925[_0x3674c7(0x275)][_0x3674c7(0x203)]['new']+_0x198925[_0x3674c7(0x275)][_0x3674c7(0x1da)][_0x3674c7(0x20d)]+_0x198925[_0x3674c7(0x275)][_0x3674c7(0x23b)]['new']+_0x198925[_0x3674c7(0x275)][_0x3674c7(0x1ff)]['new']+_0x198925[_0x3674c7(0x275)][_0x3674c7(0x26e)][_0x3674c7(0x20d)]+_0x198925['counts'][_0x3674c7(0x207)][_0x3674c7(0x20d)]+_0x198925[_0x3674c7(0x275)][_0x3674c7(0x211)]['new'],_0x54e42f=_0x198925[_0x3674c7(0x275)]['agents'][_0x3674c7(0x246)]+_0x198925[_0x3674c7(0x275)]['knowledgeBases'][_0x3674c7(0x246)]+_0x198925[_0x3674c7(0x275)]['textKnowledgeBases'][_0x3674c7(0x246)]+_0x198925[_0x3674c7(0x275)][_0x3674c7(0x1ff)]['updated']+_0x198925[_0x3674c7(0x275)][_0x3674c7(0x26e)][_0x3674c7(0x246)]+_0x198925[_0x3674c7(0x275)]['experimentalKnowledgeBases'][_0x3674c7(0x246)]+_0x198925[_0x3674c7(0x275)][_0x3674c7(0x211)]['updated'],_0x1fc6d5=_0x198925['counts']['agents'][_0x3674c7(0x258)]+_0x198925[_0x3674c7(0x275)][_0x3674c7(0x1da)]['unchanged']+_0x198925[_0x3674c7(0x275)]['textKnowledgeBases'][_0x3674c7(0x258)]+_0x198925[_0x3674c7(0x275)][_0x3674c7(0x1ff)][_0x3674c7(0x258)]+_0x198925[_0x3674c7(0x275)][_0x3674c7(0x26e)][_0x3674c7(0x258)]+_0x198925['counts'][_0x3674c7(0x207)][_0x3674c7(0x258)]+_0x198925[_0x3674c7(0x275)]['experimentalArtifacts'][_0x3674c7(0x258)];console['log'](_0x3674c7(0x27f)+_0x198925['projectName']+'\x27:'),console['log']('\x20\x20'+a4_0x5b7797['green']('+\x20'+_0x1de87d+'\x20new')+_0x3674c7(0x1d9)+a4_0x5b7797['yellow']('~\x20'+_0x54e42f+_0x3674c7(0x1e4))+_0x3674c7(0x1d9)+a4_0x5b7797[_0x3674c7(0x1e1)]('=\x20'+_0x1fc6d5+_0x3674c7(0x26a))),console[_0x3674c7(0x216)](_0x3674c7(0x1dc)+formatCountSummary(_0x198925[_0x3674c7(0x275)][_0x3674c7(0x203)])),console[_0x3674c7(0x216)](_0x3674c7(0x1f4)+formatCountSummary(_0x198925[_0x3674c7(0x275)]['knowledgeBases'])),console['log'](_0x3674c7(0x227)+formatCountSummary(_0x198925[_0x3674c7(0x275)][_0x3674c7(0x23b)])),console[_0x3674c7(0x216)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x198925[_0x3674c7(0x275)][_0x3674c7(0x1ff)])),console['log'](_0x3674c7(0x22d)+formatCountSummary(_0x198925['counts'][_0x3674c7(0x26e)]));const _0x3fc6d0=_0x198925[_0x3674c7(0x275)][_0x3674c7(0x207)][_0x3674c7(0x1fe)]>0x0||_0x198925[_0x3674c7(0x275)][_0x3674c7(0x211)]['total']>0x0;_0x3fc6d0&&(console[_0x3674c7(0x216)](_0x3674c7(0x22e)+formatCountSummary(_0x198925[_0x3674c7(0x275)][_0x3674c7(0x207)])),console['log'](_0x3674c7(0x25f)+formatCountSummary(_0x198925[_0x3674c7(0x275)][_0x3674c7(0x211)])));console[_0x3674c7(0x216)]('\x20\x20Target:\x20'+a4_0x5b7797['cyan'](_0x198925[_0x3674c7(0x23d)])),displayDiffs(_0x198925['agents'],_0x198925[_0x3674c7(0x1da)],_0x198925['textKnowledgeBases'],_0x198925['prompts'],_0x198925['integrations'],_0x198925[_0x3674c7(0x207)],_0x198925[_0x3674c7(0x211)]);if(_0x4876a2)return console[_0x3674c7(0x216)](a4_0x5b7797[_0x3674c7(0x221)](_0x3674c7(0x277))),0x0;if(_0x1de87d===0x0&&_0x54e42f===0x0)return console[_0x3674c7(0x216)](a4_0x5b7797['green'](_0x3674c7(0x228))),saveSessionContext({'llm_project':_0x198925[_0x3674c7(0x20b)]},_0x4bc64d[_0x3674c7(0x26c)]),console['log'](a4_0x5b7797[_0x3674c7(0x260)]('✔\x20Context\x20set:\x20'+a4_0x5b7797[_0x3674c7(0x1e1)](_0x3674c7(0x213))+'\x20=\x20'+a4_0x5b7797[_0x3674c7(0x251)](_0x198925[_0x3674c7(0x20b)]))),0x0;if(!_0x3aaed5&&!_0xb89f36){if(!isInteractive())return console[_0x3674c7(0x212)](a4_0x5b7797[_0x3674c7(0x1cf)](_0x3674c7(0x229)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x3674c7(0x212)](a4_0x5b7797[_0x3674c7(0x1e1)](_0x3674c7(0x236))),0x1;const _0x5b27c5=await confirmKey('\x0aWrite\x20'+(_0x1de87d+_0x54e42f)+'\x20files?');if(!_0x5b27c5)return console[_0x3674c7(0x216)](a4_0x5b7797['yellow'](_0x3674c7(0x1fb)),'-\x20no\x20files\x20written'),0x1;}const {data:_0x1d1e3c}=await withSpinner(_0x3674c7(0x208),()=>_0x5141e8['llm']['pullProject'](_0x5e7546,_0x2c13df,{'force':_0xb89f36}));return console[_0x3674c7(0x216)](a4_0x5b7797[_0x3674c7(0x260)](_0x3674c7(0x1f2)+(_0x1de87d+_0x54e42f)+_0x3674c7(0x1ca)+_0x1d1e3c[_0x3674c7(0x23d)])),saveSessionContext({'llm_project':_0x1d1e3c[_0x3674c7(0x20b)]},_0x4bc64d[_0x3674c7(0x26c)]),console[_0x3674c7(0x216)](a4_0x5b7797[_0x3674c7(0x260)](_0x3674c7(0x24b)+a4_0x5b7797[_0x3674c7(0x1e1)]('llm_project')+_0x3674c7(0x239)+a4_0x5b7797['cyan'](_0x1d1e3c[_0x3674c7(0x20b)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x46ea57(0x1d8)]='agent:clone';['description']=a4_0x46ea57(0x1c6);async[a4_0x46ea57(0x242)](_0x403ec6){const _0x4bf35f=a4_0x46ea57,{options:_0x155f25,args:_0x58a17f,tdx:_0x1b4c95}=_0x403ec6,_0x352aaf=_0x58a17f[0x0],_0x50fe0d=_0x155f25[_0x4bf35f(0x1d8)],_0x5cdd86=_0x155f25['dryRun'],_0x34f9ff=_0x155f25[_0x4bf35f(0x269)],_0x445bd7=_0x155f25[_0x4bf35f(0x245)],_0x571013=_0x155f25[_0x4bf35f(0x21d)];let _0x37f246;const _0x5056ca=findAgentConfigPath(process[_0x4bf35f(0x25c)]());if(_0x352aaf){const _0x37156c=a4_0xd83b37['join'](_0x352aaf,'tdx.json');existsSync(_0x37156c)?(_0x37f246=_0x352aaf,console[_0x4bf35f(0x216)](a4_0x5b7797[_0x4bf35f(0x1e1)](_0x4bf35f(0x1e8)+_0x352aaf))):_0x37f246=_0x352aaf;}else{if(_0x5056ca)_0x37f246=a4_0xd83b37[_0x4bf35f(0x21a)](_0x5056ca),console[_0x4bf35f(0x216)](a4_0x5b7797[_0x4bf35f(0x1e1)](_0x4bf35f(0x1cc)+_0x37f246));else{if(_0x571013){const _0xb9014f=sanitizeForFilesystem(_0x571013);let _0x13a970=_0xb9014f,_0x1a4ea7=a4_0xd83b37['join'](process[_0x4bf35f(0x25c)](),_0x4bf35f(0x203),_0xb9014f,'tdx.json');if(!existsSync(_0x1a4ea7)){const _0x516a4f=normalizeName(_0x571013),_0x407ab7=a4_0xd83b37['join'](process[_0x4bf35f(0x25c)](),_0x4bf35f(0x203),_0x516a4f,_0x4bf35f(0x238));existsSync(_0x407ab7)&&(_0x13a970=_0x516a4f,_0x1a4ea7=_0x407ab7);}if(existsSync(_0x1a4ea7))_0x37f246=a4_0xd83b37[_0x4bf35f(0x21a)](_0x1a4ea7),console[_0x4bf35f(0x216)](a4_0x5b7797['dim'](_0x4bf35f(0x1e8)+_0x37f246));else{const _0x4e3d87=_0x155f25[_0x4bf35f(0x204)];if(_0x4e3d87)throw new SDKError(ErrorCode[_0x4bf35f(0x1ec)],_0x4bf35f(0x266)+_0x571013+_0x4bf35f(0x1f7),undefined,{'helpText':_0x4bf35f(0x1d6)+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+(_0x4bf35f(0x24e)+_0x571013+'\x0a')+(_0x4bf35f(0x25b)+_0x13a970+_0x4bf35f(0x232)+(_0x50fe0d||_0x4bf35f(0x25a))+_0x4bf35f(0x248)+_0x4e3d87)});_0x37f246=_0x571013,console[_0x4bf35f(0x216)](a4_0x5b7797['dim']('Using\x20context\x20project:\x20'+_0x571013));}}}}if(!_0x37f246)return console[_0x4bf35f(0x216)](a4_0x5b7797[_0x4bf35f(0x221)](_0x4bf35f(0x22a))),console['log'](_0x4bf35f(0x205)),console['log'](_0x4bf35f(0x24f)),console[_0x4bf35f(0x216)](_0x4bf35f(0x1f1)),console['log'](_0x4bf35f(0x1e2)),0x1;if(!_0x50fe0d)throw new SDKError(ErrorCode[_0x4bf35f(0x27d)],_0x4bf35f(0x21e),undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0x34f9ff&&!_0x5cdd86){if(!isInteractive())return console['error'](a4_0x5b7797['red'](_0x4bf35f(0x229)),_0x4bf35f(0x230)),console[_0x4bf35f(0x212)](a4_0x5b7797['dim'](_0x4bf35f(0x236))),0x1;const _0x2420c5=await confirmKey('Clone\x20\x22'+_0x37f246+_0x4bf35f(0x20a)+_0x50fe0d+'\x22?');if(!_0x2420c5)return console[_0x4bf35f(0x216)](a4_0x5b7797[_0x4bf35f(0x221)](_0x4bf35f(0x1fb))),0x1;}const {data:_0x19401a}=await withSpinner(_0x4bf35f(0x254)+_0x37f246+_0x4bf35f(0x27c)+_0x50fe0d+_0x4bf35f(0x241),()=>_0x1b4c95[_0x4bf35f(0x23a)][_0x4bf35f(0x24c)](_0x37f246,_0x50fe0d,{'dryRun':_0x5cdd86}));if(_0x5cdd86){console['log'](a4_0x5b7797[_0x4bf35f(0x221)](_0x4bf35f(0x1db))),console[_0x4bf35f(0x216)](_0x4bf35f(0x217)+_0x19401a['sourceProjectName']),console[_0x4bf35f(0x216)](_0x4bf35f(0x274)+_0x50fe0d),console['log'](_0x4bf35f(0x218)),console['log'](_0x4bf35f(0x1dc)+_0x19401a[_0x4bf35f(0x275)]['agents']['created']),console[_0x4bf35f(0x216)]('\x20\x20Knowledge\x20Bases:\x20'+_0x19401a[_0x4bf35f(0x275)][_0x4bf35f(0x1da)][_0x4bf35f(0x259)]),console[_0x4bf35f(0x216)]('\x20\x20Prompts:\x20'+_0x19401a[_0x4bf35f(0x275)][_0x4bf35f(0x1ff)][_0x4bf35f(0x259)]);const _0x1198ca=_0x19401a[_0x4bf35f(0x275)]['experimentalKnowledgeBases']['created']>0x0||_0x19401a['counts'][_0x4bf35f(0x211)][_0x4bf35f(0x259)]>0x0;return _0x1198ca&&(console[_0x4bf35f(0x216)](_0x4bf35f(0x22e)+_0x19401a[_0x4bf35f(0x275)][_0x4bf35f(0x207)][_0x4bf35f(0x259)]),console[_0x4bf35f(0x216)](_0x4bf35f(0x25f)+_0x19401a['counts'][_0x4bf35f(0x211)]['created'])),0x0;}const _0x26216b=_0x19401a[_0x4bf35f(0x275)]['agents'][_0x4bf35f(0x1d0)]>0x0||_0x19401a[_0x4bf35f(0x275)][_0x4bf35f(0x1da)]['errors']>0x0||_0x19401a[_0x4bf35f(0x275)][_0x4bf35f(0x1ff)][_0x4bf35f(0x1d0)]>0x0||_0x19401a[_0x4bf35f(0x275)][_0x4bf35f(0x207)]['errors']>0x0||_0x19401a[_0x4bf35f(0x275)]['experimentalArtifacts'][_0x4bf35f(0x1d0)]>0x0;_0x26216b?console[_0x4bf35f(0x216)](a4_0x5b7797[_0x4bf35f(0x221)](_0x4bf35f(0x233))):console[_0x4bf35f(0x216)](a4_0x5b7797['green'](_0x4bf35f(0x226)));console[_0x4bf35f(0x216)](_0x4bf35f(0x217)+_0x19401a[_0x4bf35f(0x1c8)]),console[_0x4bf35f(0x216)]('New\x20project:\x20'+_0x19401a[_0x4bf35f(0x262)]),console[_0x4bf35f(0x216)](_0x4bf35f(0x234)+_0x19401a['newProjectId']),console[_0x4bf35f(0x216)](),console[_0x4bf35f(0x216)](_0x4bf35f(0x261)),console['log'](_0x4bf35f(0x1dc)+formatCountSummary(_0x19401a['counts'][_0x4bf35f(0x203)])),console[_0x4bf35f(0x216)](_0x4bf35f(0x1f4)+formatCountSummary(_0x19401a[_0x4bf35f(0x275)][_0x4bf35f(0x1da)])),console[_0x4bf35f(0x216)](_0x4bf35f(0x279)+formatCountSummary(_0x19401a[_0x4bf35f(0x275)]['prompts'])),console[_0x4bf35f(0x216)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x19401a['counts'][_0x4bf35f(0x26e)]));const _0xc07566=_0x19401a[_0x4bf35f(0x275)]['experimentalKnowledgeBases'][_0x4bf35f(0x259)]>0x0||_0x19401a[_0x4bf35f(0x275)][_0x4bf35f(0x207)][_0x4bf35f(0x246)]>0x0||_0x19401a['counts']['experimentalKnowledgeBases'][_0x4bf35f(0x258)]>0x0||_0x19401a[_0x4bf35f(0x275)][_0x4bf35f(0x211)][_0x4bf35f(0x259)]>0x0||_0x19401a[_0x4bf35f(0x275)]['experimentalArtifacts'][_0x4bf35f(0x246)]>0x0||_0x19401a[_0x4bf35f(0x275)][_0x4bf35f(0x211)]['unchanged']>0x0;_0xc07566&&(console[_0x4bf35f(0x216)](_0x4bf35f(0x22e)+formatCountSummary(_0x19401a[_0x4bf35f(0x275)][_0x4bf35f(0x207)])),console['log'](_0x4bf35f(0x25f)+formatCountSummary(_0x19401a[_0x4bf35f(0x275)][_0x4bf35f(0x211)])));if(_0x26216b){console[_0x4bf35f(0x216)](),console[_0x4bf35f(0x216)](a4_0x5b7797['red'](_0x4bf35f(0x1f3)));for(const _0x23aac6 of _0x19401a[_0x4bf35f(0x203)]){_0x23aac6['action']===_0x4bf35f(0x212)&&console[_0x4bf35f(0x216)](a4_0x5b7797[_0x4bf35f(0x1cf)](_0x4bf35f(0x20f)+_0x23aac6['agentName']+'\x22:\x20'+_0x23aac6['error']));}for(const _0x47e5f9 of _0x19401a[_0x4bf35f(0x1da)]){_0x47e5f9[_0x4bf35f(0x27a)]===_0x4bf35f(0x212)&&console['log'](a4_0x5b7797['red'](_0x4bf35f(0x24a)+_0x47e5f9[_0x4bf35f(0x1d8)]+_0x4bf35f(0x220)+_0x47e5f9['error']));}for(const _0x52e499 of _0x19401a[_0x4bf35f(0x1ff)]){_0x52e499[_0x4bf35f(0x27a)]===_0x4bf35f(0x212)&&console['log'](a4_0x5b7797[_0x4bf35f(0x1cf)](_0x4bf35f(0x1f0)+_0x52e499['name']+_0x4bf35f(0x220)+_0x52e499[_0x4bf35f(0x212)]));}for(const _0x541de5 of _0x19401a[_0x4bf35f(0x26e)]){_0x541de5['action']===_0x4bf35f(0x212)&&console['log'](a4_0x5b7797[_0x4bf35f(0x1cf)](_0x4bf35f(0x1dd)+_0x541de5[_0x4bf35f(0x1d8)]+_0x4bf35f(0x220)+_0x541de5[_0x4bf35f(0x212)]));}for(const _0x4faef3 of _0x19401a[_0x4bf35f(0x207)]){_0x4faef3[_0x4bf35f(0x27a)]===_0x4bf35f(0x212)&&console[_0x4bf35f(0x216)](a4_0x5b7797[_0x4bf35f(0x1cf)](_0x4bf35f(0x1c9)+_0x4faef3[_0x4bf35f(0x1d8)]+_0x4bf35f(0x220)+_0x4faef3[_0x4bf35f(0x212)]));}for(const _0x18117f of _0x19401a['experimentalArtifacts']){_0x18117f[_0x4bf35f(0x27a)]===_0x4bf35f(0x212)&&console[_0x4bf35f(0x216)](a4_0x5b7797['red'](_0x4bf35f(0x21f)+_0x18117f[_0x4bf35f(0x1d8)]+_0x4bf35f(0x220)+_0x18117f[_0x4bf35f(0x212)]));}return 0x1;}console[_0x4bf35f(0x216)]();const _0x25f696=getLLMProjectUrl(_0x445bd7,_0x19401a[_0x4bf35f(0x283)]);return console[_0x4bf35f(0x216)](_0x4bf35f(0x22f)+a4_0x5b7797[_0x4bf35f(0x251)](_0x25f696)),0x0;}}function a4_0x392f(){const _0x33a0ce=['\x0aPull\x20summary\x20for\x20\x27','pushProject','\x20successfully','\x0aChanges\x20to\x20integration\x20\x27','newProjectId','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','Analyzing\x20project\x20\x22','sourceProjectName','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x20files\x20to\x20','pullAgent','Using\x20current\x20project:\x20','No\x20tdx.json\x20found\x20in\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','red','errors','agent.yml','agent:pull','\x20created','force','\x20\x20Text\x20Knowledge\x20Base\x20\x22','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','Using\x20project\x20from\x20','name','\x20|\x20','knowledgeBases','Dry\x20run\x20-\x20no\x20changes\x20made','\x20\x20Agents:\x20','\x20\x20Integration\x20\x22','1231299kzNvNd','\x20\x20Source:\x20','Pushing\x20to\x20project...','dim','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','no_context','\x20changed','isNew','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','Using\x20local\x20project:\x20','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','diff','outputPath','INVALID_ARGUMENT','326880HxcxNa','54DPlWrs','1507646FdnysD','\x20\x20Prompt\x20\x22','\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)','\x0a✔\x20Pulled\x20','Errors:','\x20\x20Knowledge\x20Bases:\x20','push','\x0aChanges\x20to\x20prompt\x20\x27','\x22\x20to\x20a\x20different\x20profile','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','85835BZwRjj','Cancelled','cwd-config','\x0aChanges\x20to\x20agent\x20\x27','total','prompts','utf-8','no_local_folder','Agent\x20','agents','profile','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','description','experimentalKnowledgeBases','Writing\x20files...','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x22\x20to\x20new\x20project\x20\x22','projectName','Agent:\x20','new','\x0aPush\x20','\x20\x20Agent\x20\x22','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','experimentalArtifacts','error','llm_project','\x20new','173336oYXBFF','log','Source:\x20','Would\x20clone:','Failed\x20to\x20push\x20agent:\x20','dirname','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)','gray','llmProject','New\x20project\x20name\x20is\x20required','\x20\x20Experimental\x20Artifact\x20\x22','\x22:\x20','yellow','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x0a✔\x20Pushed\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','\x20resources\x20to\x20\x27','Project\x20cloned\x20successfully','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','\x0aError:','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x0aErrors\x20found:','\x20\x20Integrations:\x20','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','Project:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\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','\x20--name\x20','Project\x20cloned\x20with\x20errors','New\x20project\x20ID:\x20','message','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','dryRun','tdx.json','\x20=\x20','llm','textKnowledgeBases','reason','outputDir','agent','Using\x20project\x20from\x20context:\x20','\x0aChanges:','\x22...','execute','projectDir','pullProject','site','updated','Analyzing\x20changes\x20to\x20push...','\x20--profile\x20','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','\x20\x20Knowledge\x20Base\x20\x22','✔\x20Context\x20set:\x20','cloneProject','Output\x20path:\x20','\x20\x20tdx\x20agent\x20pull\x20','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x22\x20from\x20project\x20\x22','cyan','\x0aProject\x20pushed\x20with\x20errors','202074TkMlNG','Cloning\x20\x22','Using\x20project:\x20','arg-dir','context','unchanged','created','<new-name>','\x20\x20tdx\x20agent\x20clone\x20agents/','cwd','projectId','agentId','\x20\x20Experimental\x20Artifacts:\x20','green','Summary:','newProjectName','42362PmWrmd','8IpmoCE','Dry\x20run\x20-\x20no\x20files\x20written','Cannot\x20clone\x20from\x20context\x20project\x20\x22','Output:\x20','\x20total','yes','\x20unchanged','agentName','session','repeat','integrations','\x0aPush\x20summary\x20for\x20\x27','\x20updated','Pushing\x20agent\x20from\x20\x22','join','hasChanges','New\x20project:\x20','counts','parse','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\x20\x20Prompts:\x20','action','output','\x22\x20to\x20\x22','MISSING_ARGUMENT','Chat:\x20'];a4_0x392f=function(){return _0x33a0ce;};return a4_0x392f();}export class AgentPushCommand extends BaseCommand{[a4_0x46ea57(0x1d8)]='agent:push';[a4_0x46ea57(0x206)]=a4_0x46ea57(0x1e7);async[a4_0x46ea57(0x242)](_0x2dc83d){const _0x4b5427=a4_0x46ea57,{options:_0x17a690,args:_0x3395c0,tdx:_0x82ec45}=_0x2dc83d;let _0x3a1f7b=_0x3395c0[0x0]||process[_0x4b5427(0x25c)]();const _0x3b65=_0x17a690[_0x4b5427(0x237)],_0x2fb24b=_0x17a690['force'],_0x2a51ea=_0x17a690[_0x4b5427(0x269)],_0x51c476=_0x17a690['site'],_0x394986=a4_0xd83b37[_0x4b5427(0x272)](_0x3a1f7b,_0x4b5427(0x1d1)),_0x4b83ab=existsSync(_0x394986);if(_0x4b83ab){const {data:_0x27391e}=await withSpinner(_0x4b5427(0x271)+_0x3a1f7b+'\x22...',()=>_0x82ec45[_0x4b5427(0x23a)]['pushAgent'](_0x3a1f7b,{'dryRun':_0x3b65,'force':_0x2fb24b}));if(_0x3b65)return console[_0x4b5427(0x216)](a4_0x5b7797['yellow'](_0x4b5427(0x1db))),console['log']('Would\x20push\x20agent:\x20'+_0x27391e[_0x4b5427(0x26b)]),0x0;if(_0x27391e[_0x4b5427(0x27a)]===_0x4b5427(0x212))return console[_0x4b5427(0x216)](a4_0x5b7797[_0x4b5427(0x1cf)](_0x4b5427(0x219)+_0x27391e['error'])),0x1;console['log'](a4_0x5b7797[_0x4b5427(0x260)](_0x4b5427(0x202)+_0x27391e[_0x4b5427(0x27a)]+_0x4b5427(0x281))),console['log']('Agent:\x20'+_0x27391e[_0x4b5427(0x26b)]);if(_0x27391e[_0x4b5427(0x25e)]&&_0x27391e[_0x4b5427(0x25d)]){const _0x15b7fd=getLLMAgentChatUrl(_0x51c476,_0x27391e[_0x4b5427(0x25d)],_0x27391e['agentId']);console[_0x4b5427(0x216)](_0x4b5427(0x27e)+a4_0x5b7797['cyan'](_0x15b7fd));}return 0x0;}const _0x31dc63=_0x17a690[_0x4b5427(0x21d)],_0x497180=resolveProjectFromContext(_0x3a1f7b,_0x31dc63);if(_0x497180['found'])_0x3a1f7b=_0x497180[_0x4b5427(0x243)],_0x497180['source']===_0x4b5427(0x257)&&console[_0x4b5427(0x216)](a4_0x5b7797[_0x4b5427(0x1e1)](_0x4b5427(0x255)+_0x3a1f7b));else{let _0x58ca41=_0x4b5427(0x1f9);_0x497180[_0x4b5427(0x23c)]===_0x4b5427(0x201)&&(_0x58ca41=_0x497180[_0x4b5427(0x235)]+_0x4b5427(0x249)+_0x497180['llmProject']+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode[_0x4b5427(0x1ec)],_0x497180[_0x4b5427(0x23c)]===_0x4b5427(0x1e3)?_0x497180[_0x4b5427(0x235)]:_0x4b5427(0x1cd)+_0x3a1f7b,undefined,{'helpText':_0x58ca41});}const {data:_0x18a6c9}=await withSpinner(_0x4b5427(0x247),()=>_0x82ec45[_0x4b5427(0x23a)][_0x4b5427(0x280)](_0x3a1f7b,{'dryRun':!![]})),_0x2ae98a=_0x18a6c9[_0x4b5427(0x275)][_0x4b5427(0x203)]['errors']>0x0;if(_0x2ae98a){console['log'](a4_0x5b7797[_0x4b5427(0x1cf)](_0x4b5427(0x22c)));for(const _0x34b81b of _0x18a6c9['agents']){_0x34b81b[_0x4b5427(0x27a)]===_0x4b5427(0x212)&&console[_0x4b5427(0x216)](a4_0x5b7797[_0x4b5427(0x1cf)](_0x4b5427(0x20f)+_0x34b81b[_0x4b5427(0x26b)]+_0x4b5427(0x220)+_0x34b81b[_0x4b5427(0x212)]));}return 0x1;}const _0x21c168=_0x18a6c9[_0x4b5427(0x275)][_0x4b5427(0x203)][_0x4b5427(0x259)]+_0x18a6c9[_0x4b5427(0x275)][_0x4b5427(0x1da)][_0x4b5427(0x259)]+_0x18a6c9[_0x4b5427(0x275)][_0x4b5427(0x23b)][_0x4b5427(0x259)]+_0x18a6c9['counts'][_0x4b5427(0x1ff)][_0x4b5427(0x259)]+_0x18a6c9[_0x4b5427(0x275)][_0x4b5427(0x26e)][_0x4b5427(0x259)]+_0x18a6c9[_0x4b5427(0x275)]['experimentalKnowledgeBases'][_0x4b5427(0x259)]+_0x18a6c9['counts'][_0x4b5427(0x211)][_0x4b5427(0x259)],_0x27adf2=_0x18a6c9[_0x4b5427(0x275)]['agents'][_0x4b5427(0x246)]+_0x18a6c9[_0x4b5427(0x275)][_0x4b5427(0x1da)][_0x4b5427(0x246)]+_0x18a6c9[_0x4b5427(0x275)][_0x4b5427(0x23b)][_0x4b5427(0x246)]+_0x18a6c9[_0x4b5427(0x275)]['prompts'][_0x4b5427(0x246)]+_0x18a6c9[_0x4b5427(0x275)][_0x4b5427(0x26e)][_0x4b5427(0x246)]+_0x18a6c9[_0x4b5427(0x275)][_0x4b5427(0x207)][_0x4b5427(0x246)]+_0x18a6c9[_0x4b5427(0x275)][_0x4b5427(0x211)][_0x4b5427(0x246)],_0x311f32=_0x18a6c9[_0x4b5427(0x275)][_0x4b5427(0x203)][_0x4b5427(0x258)]+_0x18a6c9[_0x4b5427(0x275)][_0x4b5427(0x1da)]['unchanged']+_0x18a6c9[_0x4b5427(0x275)][_0x4b5427(0x23b)][_0x4b5427(0x258)]+_0x18a6c9[_0x4b5427(0x275)][_0x4b5427(0x1ff)][_0x4b5427(0x258)]+_0x18a6c9[_0x4b5427(0x275)][_0x4b5427(0x26e)][_0x4b5427(0x258)]+_0x18a6c9[_0x4b5427(0x275)][_0x4b5427(0x207)][_0x4b5427(0x258)]+_0x18a6c9[_0x4b5427(0x275)]['experimentalArtifacts'][_0x4b5427(0x258)];console[_0x4b5427(0x216)](_0x4b5427(0x26f)+_0x18a6c9[_0x4b5427(0x20b)]+'\x27:'),console[_0x4b5427(0x216)]('\x20\x20'+a4_0x5b7797[_0x4b5427(0x260)]('+\x20'+_0x21c168+_0x4b5427(0x214))+_0x4b5427(0x1d9)+a4_0x5b7797[_0x4b5427(0x221)]('~\x20'+_0x27adf2+'\x20changed')+_0x4b5427(0x1d9)+a4_0x5b7797[_0x4b5427(0x1e1)]('=\x20'+_0x311f32+_0x4b5427(0x26a))),console[_0x4b5427(0x216)](_0x4b5427(0x1dc)+formatCountSummary(_0x18a6c9[_0x4b5427(0x275)][_0x4b5427(0x203)])),console[_0x4b5427(0x216)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x18a6c9[_0x4b5427(0x275)][_0x4b5427(0x1da)])),console[_0x4b5427(0x216)](_0x4b5427(0x227)+formatCountSummary(_0x18a6c9['counts'][_0x4b5427(0x23b)])),console[_0x4b5427(0x216)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x18a6c9[_0x4b5427(0x275)]['prompts'])),console[_0x4b5427(0x216)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x18a6c9[_0x4b5427(0x275)][_0x4b5427(0x26e)]));const _0x53b93e=_0x18a6c9[_0x4b5427(0x275)]['experimentalKnowledgeBases'][_0x4b5427(0x259)]>0x0||_0x18a6c9[_0x4b5427(0x275)][_0x4b5427(0x207)]['updated']>0x0||_0x18a6c9['counts'][_0x4b5427(0x207)][_0x4b5427(0x258)]>0x0||_0x18a6c9['counts'][_0x4b5427(0x211)][_0x4b5427(0x259)]>0x0||_0x18a6c9[_0x4b5427(0x275)][_0x4b5427(0x211)][_0x4b5427(0x246)]>0x0||_0x18a6c9[_0x4b5427(0x275)]['experimentalArtifacts']['unchanged']>0x0;_0x53b93e&&(console[_0x4b5427(0x216)](_0x4b5427(0x22e)+formatCountSummary(_0x18a6c9[_0x4b5427(0x275)]['experimentalKnowledgeBases'])),console[_0x4b5427(0x216)](_0x4b5427(0x25f)+formatCountSummary(_0x18a6c9['counts'][_0x4b5427(0x211)])));console[_0x4b5427(0x216)](_0x4b5427(0x1df)+a4_0x5b7797[_0x4b5427(0x251)](_0x3a1f7b)),displayDiffs(_0x18a6c9[_0x4b5427(0x203)],_0x18a6c9['knowledgeBases'],_0x18a6c9['textKnowledgeBases'],_0x18a6c9[_0x4b5427(0x1ff)],_0x18a6c9['integrations'],_0x18a6c9[_0x4b5427(0x207)],_0x18a6c9['experimentalArtifacts']);if(_0x3b65)return console[_0x4b5427(0x216)](a4_0x5b7797['yellow'](_0x4b5427(0x22b))),0x0;if(_0x21c168===0x0&&_0x27adf2===0x0){console[_0x4b5427(0x216)](a4_0x5b7797[_0x4b5427(0x260)](_0x4b5427(0x210)));const _0x2069e0=getLLMProjectUrl(_0x51c476,_0x18a6c9['projectId']);return console[_0x4b5427(0x216)]('Project:\x20'+a4_0x5b7797[_0x4b5427(0x251)](_0x2069e0)),0x0;}if(!_0x2a51ea&&!_0x2fb24b){if(!isInteractive())return console[_0x4b5427(0x212)](a4_0x5b7797[_0x4b5427(0x1cf)](_0x4b5427(0x229)),_0x4b5427(0x230)),console[_0x4b5427(0x212)](a4_0x5b7797['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x341581=await confirmKey(_0x4b5427(0x20e)+(_0x21c168+_0x27adf2)+'\x20resources?');if(!_0x341581)return console['log'](a4_0x5b7797[_0x4b5427(0x221)](_0x4b5427(0x1fb)),'-\x20nothing\x20pushed'),0x1;}const {data:_0x1c6597}=await withSpinner(_0x4b5427(0x1e0),()=>_0x82ec45[_0x4b5427(0x23a)][_0x4b5427(0x280)](_0x3a1f7b,{'force':_0x2fb24b})),_0x2615ed=_0x1c6597[_0x4b5427(0x275)][_0x4b5427(0x203)]['errors']>0x0||_0x1c6597['counts'][_0x4b5427(0x1da)][_0x4b5427(0x1d0)]>0x0||_0x1c6597['counts'][_0x4b5427(0x23b)]['errors']>0x0||_0x1c6597[_0x4b5427(0x275)]['prompts'][_0x4b5427(0x1d0)]>0x0;if(_0x2615ed){console['log'](a4_0x5b7797[_0x4b5427(0x221)](_0x4b5427(0x252))),console[_0x4b5427(0x216)](),console[_0x4b5427(0x216)](a4_0x5b7797[_0x4b5427(0x1cf)](_0x4b5427(0x1f3)));for(const _0x401e29 of _0x1c6597['agents']){_0x401e29['action']===_0x4b5427(0x212)&&console[_0x4b5427(0x216)](a4_0x5b7797['red'](_0x4b5427(0x20f)+_0x401e29[_0x4b5427(0x26b)]+_0x4b5427(0x220)+_0x401e29[_0x4b5427(0x212)]));}for(const _0x541a52 of _0x1c6597[_0x4b5427(0x1da)]){_0x541a52[_0x4b5427(0x27a)]==='error'&&console['log'](a4_0x5b7797['red']('\x20\x20Knowledge\x20Base\x20\x22'+_0x541a52[_0x4b5427(0x1d8)]+'\x22:\x20'+_0x541a52[_0x4b5427(0x212)]));}for(const _0x40ad0d of _0x1c6597[_0x4b5427(0x23b)]){_0x40ad0d[_0x4b5427(0x27a)]===_0x4b5427(0x212)&&console[_0x4b5427(0x216)](a4_0x5b7797['red'](_0x4b5427(0x1d5)+_0x40ad0d[_0x4b5427(0x1d8)]+_0x4b5427(0x220)+_0x40ad0d['error']));}for(const _0x401eef of _0x1c6597[_0x4b5427(0x1ff)]){_0x401eef[_0x4b5427(0x27a)]===_0x4b5427(0x212)&&console[_0x4b5427(0x216)](a4_0x5b7797['red'](_0x4b5427(0x1f0)+_0x401eef[_0x4b5427(0x1d8)]+_0x4b5427(0x220)+_0x401eef[_0x4b5427(0x212)]));}for(const _0x4e5f35 of _0x1c6597[_0x4b5427(0x26e)]){_0x4e5f35[_0x4b5427(0x27a)]===_0x4b5427(0x212)&&console[_0x4b5427(0x216)](a4_0x5b7797[_0x4b5427(0x1cf)]('\x20\x20Integration\x20\x22'+_0x4e5f35[_0x4b5427(0x1d8)]+_0x4b5427(0x220)+_0x4e5f35[_0x4b5427(0x212)]));}return 0x1;}console[_0x4b5427(0x216)](a4_0x5b7797[_0x4b5427(0x260)](_0x4b5427(0x223)+(_0x21c168+_0x27adf2)+_0x4b5427(0x225)+_0x1c6597[_0x4b5427(0x20b)]+'\x27'));const _0x3044e5=getLLMProjectUrl(_0x51c476,_0x1c6597['projectId']);return console[_0x4b5427(0x216)](_0x4b5427(0x22f)+a4_0x5b7797['cyan'](_0x3044e5)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x348df7=a5_0x422d;(function(_0x23d3bd,_0x45bdf9){const _0xf6772a=a5_0x422d,_0x2f7d4a=_0x23d3bd();while(!![]){try{const _0x5cc2d3=parseInt(_0xf6772a(0x168))/0x1+-parseInt(_0xf6772a(0x117))/0x2*(-parseInt(_0xf6772a(0x106))/0x3)+parseInt(_0xf6772a(0x103))/0x4+parseInt(_0xf6772a(0x17b))/0x5*(parseInt(_0xf6772a(0x170))/0x6)+-parseInt(_0xf6772a(0x119))/0x7*(parseInt(_0xf6772a(0x133))/0x8)+-parseInt(_0xf6772a(0x167))/0x9*(parseInt(_0xf6772a(0x13e))/0xa)+-parseInt(_0xf6772a(0x146))/0xb*(parseInt(_0xf6772a(0x134))/0xc);if(_0x5cc2d3===_0x45bdf9)break;else _0x2f7d4a['push'](_0x2f7d4a['shift']());}catch(_0xf32e71){_0x2f7d4a['push'](_0x2f7d4a['shift']());}}}(a5_0x829b,0x68952));import*as a5_0x1fa2e3 from'node:fs';import*as a5_0x496d65 from'node:path';import a5_0x312754 from'chalk';import{BaseCommand}from'./command.js';function a5_0x422d(_0x16be6e,_0x2dc89f){_0x16be6e=_0x16be6e-0xea;const _0x829bb9=a5_0x829b();let _0x422d77=_0x829bb9[_0x16be6e];return _0x422d77;}import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';function a5_0x829b(){const _0x4823b1=['agent','Re-evaluating\x20cached\x20test\x20run...','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','resolve','find','agentName','execute','stop','red','Executing\x20new\x20tests...','Round\x20','459212tRmhfN','conversation_url','Failed:\x20\x20\x20','16929bXjEMr','Error\x20writing\x20output\x20file:\x20','ERROR','\x20\x20Round\x20','json','Agent:\x20','Running\x20agent\x20tests...','tsv','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','Test\x20Configuration:','white','cyan','site','llm','PASS','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','Site:\x20','262Mtvkqt','no_context','14eJhTSd','\x20(cached)','now','executeReeval','resolveProjectId','length','Tests\x20found:\x20','green','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','FAIL','✗\x20ERROR:\x20','Total:\x20\x20\x20\x20','context','yellow','Evaluating\x20response...','Re-evaluation\x20Summary','no_local_folder','tags','Run\x20\x27tdx\x20agent\x20pull\x20','testYmlPath','\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','✓\x20PASS:\x20','toISOString','includes','/<agent-name>','reason','373064tQVqxs','12iYXKFP','resolveAgentId','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','source','projectDir','Conversation\x20URL:\x20','\x20\x20Project:\x20','message','Usage:','start','1430OiYFFy','\x20\x20Site:\x20','Re-evaluating\x20','Either\x20switch\x20to\x20the\x20\x22','tests','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','\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)','repeat','15985717TOlNuu','basename','Output\x20written\x20to:\x20','text','No\x20tests\x20have\x20tags\x20defined.','dim','filter','split','Using\x20agent:\x20','Running\x20test:\x20','has','Cached\x20run\x20is\x20from\x20site\x20\x22','join','Round\x201/','size','Passed:\x20\x20\x20','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','Errors:\x20\x20\x20','verbose','push','jsonl','Failed\x20Tests:','404','reeval','✗\x20ERROR:\x20Project\x20not\x20found:\x20','projectName','✗\x20FAIL:\x20','log','rounds','Available\x20tests:\x20','\x20-\x20','existsSync','New\x20tests\x20to\x20execute:\x20','6759nCUQlI','447110rfghdp','trim','utf-8','name','status','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','420GIcWmd','table','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','Error:\x20No\x20previous\x20test\x20run\x20found.','agentDirs','...\x20','multiple_agents','toLowerCase',':\x20Sending\x20user\x20input...','some','...','55795BuGWea','Test\x20','\x20(new)','\x27\x20to\x20create\x20the\x20folder\x20structure.','forEach','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x22:\x20','\x20\x20-\x20','\x20\x20Evaluating...\x20','llmProject','writeFileSync','Test\x20Summary','Cached\x20run\x20from:\x20','Running:\x20','\x20\x20Conversation:\x20','add','\x20\x20Agent:\x20'];a5_0x829b=function(){return _0x4823b1;};return a5_0x829b();}export class AgentTestCommand extends BaseCommand{[a5_0x348df7(0x16b)]='agent:test';['description']='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x348df7(0xfe)](_0x161c02){const _0x4cfe3f=a5_0x348df7,{options:_0x2c20fc,args:_0x227f93,tdx:_0x4f4ecb}=_0x161c02,_0x160634=_0x227f93[0x0]||'.',_0x48f8f4=_0x2c20fc['dryRun'],_0x27523d=_0x2c20fc,_0x3e0617=_0x27523d['eval']===![],_0x3f8618=_0x27523d[_0x4cfe3f(0x15d)],_0x4b0c48=_0x27523d[_0x4cfe3f(0x16b)],_0x5bd9c8=_0x27523d[_0x4cfe3f(0x12a)],_0x451c73=_0x2c20fc['site'],_0x4a8abf=_0x27523d['output'];if(_0x3f8618&&_0x3e0617)return console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x100)](_0x4cfe3f(0x156))),0x1;let _0x11b36b=_0x4cfe3f(0x171);if(_0x27523d[_0x4cfe3f(0x10a)])_0x11b36b='json';else{if(_0x27523d[_0x4cfe3f(0x15a)])_0x11b36b=_0x4cfe3f(0x15a);else{if(_0x27523d[_0x4cfe3f(0x10d)])_0x11b36b=_0x4cfe3f(0x10d);else{if(_0x27523d[_0x4cfe3f(0x171)])_0x11b36b='table';}}}const _0x34db8f=_0x27523d[_0x4cfe3f(0xf0)];let _0x4a301a=_0x160634;const _0x3a2a1e=a5_0x1fa2e3[_0x4cfe3f(0x165)](_0x160634),_0x5c01b9=_0x160634==='.';if(!_0x3a2a1e||_0x5c01b9){const _0xd004b0=resolveProjectFromContext(_0x160634,_0x34db8f,{'requireFile':'test.yml'});if(_0xd004b0['found'])_0x4a301a=_0xd004b0['projectDir'],_0xd004b0[_0x4cfe3f(0x137)]===_0x4cfe3f(0x125)&&console['log'](a5_0x312754[_0x4cfe3f(0x14b)](_0x4cfe3f(0x14e)+_0x4a301a));else switch(_0xd004b0['reason']){case _0x4cfe3f(0x118):console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x126)](_0xd004b0['message'])),console[_0x4cfe3f(0x161)](),console[_0x4cfe3f(0x161)](_0x4cfe3f(0x13c)),console[_0x4cfe3f(0x161)](_0x4cfe3f(0x12d)),console[_0x4cfe3f(0x161)](_0x4cfe3f(0x144)),console[_0x4cfe3f(0x161)](),console['log'](_0x4cfe3f(0xec));return 0x1;case _0x4cfe3f(0x129):console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x126)](_0xd004b0[_0x4cfe3f(0x13b)])),console['log'](),console[_0x4cfe3f(0x161)](_0x4cfe3f(0x12b)+_0xd004b0['llmProject']+_0x4cfe3f(0xea));return 0x1;case _0x4cfe3f(0x176):{const _0x213ef9=a5_0x496d65[_0x4cfe3f(0x147)](_0xd004b0[_0x4cfe3f(0x138)]);console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x126)](_0x4cfe3f(0x16d)+_0xd004b0['llmProject']+'\x22:'));for(const _0x1d43ff of _0xd004b0[_0x4cfe3f(0x174)]){console[_0x4cfe3f(0x161)](_0x4cfe3f(0xee)+_0x1d43ff);}return console['log'](),console[_0x4cfe3f(0x161)]('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x213ef9+_0x4cfe3f(0x131)),0x1;}case'no_tests':console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x126)](_0x4cfe3f(0x16e)+_0xd004b0[_0x4cfe3f(0xf0)]+'\x22.')),console[_0x4cfe3f(0x161)](a5_0x312754['dim']('Project\x20path:\x20'+_0xd004b0['projectDir'])),console[_0x4cfe3f(0x161)](),console[_0x4cfe3f(0x161)](_0x4cfe3f(0xfa));return 0x1;}}const {definition:_0xb5e38a,agentInfo:_0x18072c}=parseTestFile(_0x4a301a);let _0x363b6a=_0xb5e38a[_0x4cfe3f(0x142)];if(_0x4b0c48){const _0x5b9561=_0x4b0c48[_0x4cfe3f(0x14d)](',')['map'](_0x2db06b=>_0x2db06b[_0x4cfe3f(0x169)]());_0x363b6a=_0xb5e38a[_0x4cfe3f(0x142)]['filter'](_0x2ed19c=>_0x5b9561['includes'](_0x2ed19c['name']));if(_0x363b6a[_0x4cfe3f(0x11e)]===0x0)return console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x126)]('No\x20tests\x20found\x20matching:\x20'+_0x4b0c48)),console['log'](a5_0x312754[_0x4cfe3f(0x14b)](_0x4cfe3f(0x163)+_0xb5e38a[_0x4cfe3f(0x142)]['map'](_0x1b15bc=>_0x1b15bc[_0x4cfe3f(0x16b)])[_0x4cfe3f(0x152)](',\x20'))),0x1;}if(_0x5bd9c8){const _0x4af7e2=_0x5bd9c8[_0x4cfe3f(0x14d)](',')['map'](_0x5ce645=>_0x5ce645['trim']()[_0x4cfe3f(0x177)]());_0x363b6a=_0x363b6a[_0x4cfe3f(0x14c)](_0x1819d6=>_0x1819d6['tags']?.[_0x4cfe3f(0x179)](_0x25bede=>_0x4af7e2[_0x4cfe3f(0x130)](_0x25bede[_0x4cfe3f(0x177)]())));if(_0x363b6a[_0x4cfe3f(0x11e)]===0x0){console['log'](a5_0x312754[_0x4cfe3f(0x126)]('No\x20tests\x20found\x20with\x20tags:\x20'+_0x5bd9c8));const _0x1cef2a=new Set();return _0xb5e38a[_0x4cfe3f(0x142)]['forEach'](_0x20933c=>_0x20933c[_0x4cfe3f(0x12a)]?.[_0x4cfe3f(0xeb)](_0x706f04=>_0x1cef2a[_0x4cfe3f(0xf6)](_0x706f04))),_0x1cef2a[_0x4cfe3f(0x154)]>0x0?console['log'](a5_0x312754[_0x4cfe3f(0x14b)]('Available\x20tags:\x20'+[..._0x1cef2a][_0x4cfe3f(0x152)](',\x20'))):console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x14b)](_0x4cfe3f(0x14a))),0x1;}}if(_0x3f8618)return this[_0x4cfe3f(0x11c)](_0x161c02,{'definition':{'tests':_0x363b6a},'agentInfo':_0x18072c,'outputFormat':_0x11b36b,'outputFile':_0x4a8abf,'testNames':_0x4b0c48});if(_0x48f8f4){console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x111)](_0x4cfe3f(0x10f))),console[_0x4cfe3f(0x161)](_0x4cfe3f(0x13f)+a5_0x312754[_0x4cfe3f(0x110)](_0x451c73)),console[_0x4cfe3f(0x161)](_0x4cfe3f(0x13a)+a5_0x312754[_0x4cfe3f(0x110)](_0x18072c['projectName'])),console[_0x4cfe3f(0x161)](_0x4cfe3f(0xf7)+a5_0x312754[_0x4cfe3f(0x110)](_0x18072c[_0x4cfe3f(0xfd)])),console[_0x4cfe3f(0x161)](),console['log'](_0x4cfe3f(0x11f)+a5_0x312754['white'](_0x363b6a['length']));for(let _0x289caa=0x0;_0x289caa<_0x363b6a[_0x4cfe3f(0x11e)];_0x289caa++){const _0x53e376=_0x363b6a[_0x289caa],_0xfb927e=_0x53e376['rounds']['length']===0x1?'round':_0x4cfe3f(0x162),_0x239906=_0x53e376[_0x4cfe3f(0x12a)]?.[_0x4cfe3f(0x11e)]?'\x20['+_0x53e376[_0x4cfe3f(0x12a)][_0x4cfe3f(0x152)](',\x20')+']':'';console['log']('\x20\x20'+(_0x289caa+0x1)+'.\x20'+a5_0x312754[_0x4cfe3f(0x110)](_0x53e376['name'])+'\x20('+_0x53e376['rounds'][_0x4cfe3f(0x11e)]+'\x20'+_0xfb927e+')'+a5_0x312754['dim'](_0x239906));}return 0x0;}let _0x5c09ed,_0xeb5bf0;try{_0x5c09ed=await _0x4f4ecb[_0x4cfe3f(0x113)][_0x4cfe3f(0x11d)](_0x18072c['projectName']);}catch(_0x1cfcc4){const _0xb2dd55=_0x1cfcc4 instanceof Error?_0x1cfcc4[_0x4cfe3f(0x13b)]:String(_0x1cfcc4);return _0xb2dd55[_0x4cfe3f(0x130)]('404')||_0xb2dd55[_0x4cfe3f(0x177)]()[_0x4cfe3f(0x130)]('not\x20found')?console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x100)](_0x4cfe3f(0x15e)+_0x18072c[_0x4cfe3f(0x15f)])):console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x100)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0x18072c[_0x4cfe3f(0x15f)]+_0x4cfe3f(0xed)+_0xb2dd55)),0x1;}try{_0xeb5bf0=await _0x4f4ecb[_0x4cfe3f(0x113)][_0x4cfe3f(0x135)](_0x18072c[_0x4cfe3f(0xfd)],_0x5c09ed);}catch(_0x399a24){const _0xde00ff=_0x399a24 instanceof Error?_0x399a24[_0x4cfe3f(0x13b)]:String(_0x399a24);return _0xde00ff[_0x4cfe3f(0x130)](_0x4cfe3f(0x15c))||_0xde00ff[_0x4cfe3f(0x177)]()[_0x4cfe3f(0x130)]('not\x20found')?console['log'](a5_0x312754[_0x4cfe3f(0x100)](_0x4cfe3f(0x10e)+_0x18072c['agentName'])):console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x100)](_0x4cfe3f(0x16f)+_0x18072c[_0x4cfe3f(0xfd)]+'\x22:\x20'+_0xde00ff)),0x1;}let _0x25f3b2;if(!_0x3e0617)try{_0x25f3b2=await setupEvaluatorAgent(_0x4f4ecb['llm'],_0x2c20fc[_0x4cfe3f(0x158)]);}catch(_0x22efea){const _0x460bab=_0x22efea instanceof Error?_0x22efea['message']:String(_0x22efea);return console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x100)](_0x4cfe3f(0x115)+_0x460bab)),0x1;}console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x111)](_0x4cfe3f(0x10c))),console[_0x4cfe3f(0x161)](_0x4cfe3f(0x116)+a5_0x312754[_0x4cfe3f(0x110)](_0x451c73)),console[_0x4cfe3f(0x161)](_0x4cfe3f(0x10b)+a5_0x312754['white'](_0x18072c[_0x4cfe3f(0x15f)]+'/'+_0x18072c[_0x4cfe3f(0xfd)])),console[_0x4cfe3f(0x161)]();const _0x17c0a5=[],_0x2cd05d=[],_0xc6d242=Date[_0x4cfe3f(0x11b)]();for(let _0x317740=0x0;_0x317740<_0x363b6a['length'];_0x317740++){const _0x9c2e7c=_0x363b6a[_0x317740];_0x363b6a[_0x4cfe3f(0x11e)]>0x1?console['log'](_0x4cfe3f(0x17c)+(_0x317740+0x1)+'/'+_0x363b6a[_0x4cfe3f(0x11e)]+':\x20'+a5_0x312754[_0x4cfe3f(0x110)](_0x9c2e7c[_0x4cfe3f(0x16b)])):console[_0x4cfe3f(0x161)](_0x4cfe3f(0x14f)+a5_0x312754['white'](_0x9c2e7c[_0x4cfe3f(0x16b)]));const _0x4b8d3d=createCommandSpinner(_0x4cfe3f(0x153)+_0x9c2e7c[_0x4cfe3f(0x162)][_0x4cfe3f(0x11e)]+_0x4cfe3f(0x178));_0x4b8d3d['start']();try{const {result:_0x57a4f0,conversation:_0x156b7a}=await runTest(_0x4f4ecb['llm'],_0x9c2e7c,{'agentId':_0xeb5bf0,'projectId':_0x5c09ed,'site':_0x451c73,'noEval':_0x3e0617,'evaluatorId':_0x25f3b2,'onRoundStart':(_0x51c624,_0x42db25)=>{const _0x1ffc1a=_0x4cfe3f;_0x4b8d3d[_0x1ffc1a(0x149)]='Round\x20'+(_0x51c624+0x1)+'/'+_0x42db25+_0x1ffc1a(0x178);},'onRoundComplete':(_0x383afd,_0x560e1a,_0x1e52c3)=>{const _0x4908c2=_0x4cfe3f,_0x2f9226=formatElapsed(_0x560e1a);_0x1e52c3?console['log'](_0x4908c2(0x109)+(_0x383afd+0x1)+'/'+_0x9c2e7c[_0x4908c2(0x162)]['length']+'...\x20'+a5_0x312754[_0x4908c2(0x120)]('✓')+'\x20('+_0x2f9226+')'):console[_0x4908c2(0x161)](_0x4908c2(0x109)+(_0x383afd+0x1)+'/'+_0x9c2e7c[_0x4908c2(0x162)][_0x4908c2(0x11e)]+_0x4908c2(0x175)+a5_0x312754['red']('✗'));},'onEvaluationStart':()=>{const _0x4eee76=_0x4cfe3f;_0x4b8d3d[_0x4eee76(0x149)]=_0x4eee76(0x127);},'onEvaluationComplete':_0x5eeba4=>{const _0x40d7f8=_0x4cfe3f,_0xcfbf2=formatElapsed(_0x5eeba4);console[_0x40d7f8(0x161)]('\x20\x20Evaluating...\x20'+a5_0x312754[_0x40d7f8(0x120)]('✓')+'\x20('+_0xcfbf2+')');}});_0x4b8d3d[_0x4cfe3f(0xff)](),_0x17c0a5['push'](_0x57a4f0),_0x2cd05d[_0x4cfe3f(0x159)](_0x156b7a);if(_0x57a4f0[_0x4cfe3f(0x16c)]===_0x4cfe3f(0x114))console[_0x4cfe3f(0x161)](a5_0x312754['green'](_0x4cfe3f(0x12e)+_0x57a4f0[_0x4cfe3f(0x132)]));else _0x57a4f0[_0x4cfe3f(0x16c)]===_0x4cfe3f(0x122)?console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x100)](_0x4cfe3f(0x160)+_0x57a4f0[_0x4cfe3f(0x132)])):console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x100)]('✗\x20ERROR:\x20'+_0x57a4f0[_0x4cfe3f(0x132)]));_0x57a4f0[_0x4cfe3f(0x104)]&&console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x14b)](_0x4cfe3f(0x139)+_0x57a4f0[_0x4cfe3f(0x104)])),console[_0x4cfe3f(0x161)]();}catch(_0x26afc6){_0x4b8d3d[_0x4cfe3f(0xff)]();const _0x24a63f=_0x26afc6 instanceof Error?_0x26afc6[_0x4cfe3f(0x13b)]:String(_0x26afc6);console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x100)](_0x4cfe3f(0x123)+_0x24a63f)),console[_0x4cfe3f(0x161)](),_0x17c0a5[_0x4cfe3f(0x159)]({'name':_0x9c2e7c[_0x4cfe3f(0x16b)],'status':_0x4cfe3f(0x108),'reason':_0x24a63f,'timestamp':new Date()[_0x4cfe3f(0x12f)](),'duration_ms':0x0});}}const _0x4a000c=Date[_0x4cfe3f(0x11b)]()-_0xc6d242,_0x2245be=_0x17c0a5['filter'](_0x3dedd5=>_0x3dedd5[_0x4cfe3f(0x16c)]===_0x4cfe3f(0x114))[_0x4cfe3f(0x11e)],_0x3a827b=_0x17c0a5['filter'](_0x1ab91a=>_0x1ab91a[_0x4cfe3f(0x16c)]===_0x4cfe3f(0x122))[_0x4cfe3f(0x11e)],_0x5aa4a7=_0x17c0a5['filter'](_0x38f685=>_0x38f685['status']===_0x4cfe3f(0x108))[_0x4cfe3f(0x11e)];console['log']('━'['repeat'](0x3c)),console[_0x4cfe3f(0x161)](_0x4cfe3f(0xf2)),console[_0x4cfe3f(0x161)]('━'[_0x4cfe3f(0x145)](0x3c)),console[_0x4cfe3f(0x161)](_0x4cfe3f(0x124)+_0x17c0a5[_0x4cfe3f(0x11e)]),console['log'](_0x4cfe3f(0x155)+a5_0x312754[_0x4cfe3f(0x120)](_0x2245be)),console[_0x4cfe3f(0x161)](_0x4cfe3f(0x105)+a5_0x312754['red'](_0x3a827b));_0x5aa4a7>0x0&&console['log'](_0x4cfe3f(0x157)+a5_0x312754['red'](_0x5aa4a7));console[_0x4cfe3f(0x161)]('Duration:\x20'+formatElapsed(_0x4a000c)),console[_0x4cfe3f(0x161)]('━'[_0x4cfe3f(0x145)](0x3c));const _0x4f3ce8=_0x17c0a5['filter'](_0x481040=>_0x481040[_0x4cfe3f(0x16c)]!=='PASS');if(_0x4f3ce8[_0x4cfe3f(0x11e)]>0x0){console['log'](),console[_0x4cfe3f(0x161)](_0x4cfe3f(0x15b));for(const _0x118786 of _0x4f3ce8){const _0x2fa525=a5_0x312754['red']('✗'),_0x205567=_0x118786[_0x4cfe3f(0x132)][_0x4cfe3f(0x11e)]>0x32?_0x118786[_0x4cfe3f(0x132)]['substring'](0x0,0x32)+_0x4cfe3f(0x17a):_0x118786[_0x4cfe3f(0x132)];console[_0x4cfe3f(0x161)]('\x20\x20'+_0x2fa525+'\x20'+_0x118786[_0x4cfe3f(0x16b)]+':\x20'+_0x205567);}}const _0x36b878={'summary':{'total':_0x17c0a5['length'],'passed':_0x2245be,'failed':_0x3a827b,'errors':_0x5aa4a7>0x0?_0x5aa4a7:undefined,'duration_ms':_0x4a000c},'tests':_0x17c0a5,'agent':{'project':_0x18072c[_0x4cfe3f(0x15f)],'name':_0x18072c[_0x4cfe3f(0xfd)],'site':_0x451c73},'timestamp':new Date(_0xc6d242)[_0x4cfe3f(0x12f)]()};try{const _0x4105a2=buildCachedTestRun(_0x2cd05d,{'site':_0x451c73,'projectId':_0x5c09ed,'projectName':_0x18072c['projectName'],'agentId':_0xeb5bf0,'agentName':_0x18072c[_0x4cfe3f(0xfd)],'testYmlPath':a5_0x496d65[_0x4cfe3f(0xfb)](_0x18072c[_0x4cfe3f(0x12c)])});saveLastTestRun(_0x4105a2);}catch{}if(_0x11b36b!=='table'||_0x4a8abf){const _0x5a0c8d=formatResults(_0x36b878,_0x11b36b);if(_0x4a8abf)try{a5_0x1fa2e3[_0x4cfe3f(0xf1)](_0x4a8abf,_0x5a0c8d,_0x4cfe3f(0x16a)),console[_0x4cfe3f(0x161)](),console[_0x4cfe3f(0x161)](a5_0x312754[_0x4cfe3f(0x14b)](_0x4cfe3f(0x148)+_0x4a8abf));}catch(_0x215e1e){return console[_0x4cfe3f(0x161)](),console[_0x4cfe3f(0x161)](a5_0x312754['red'](_0x4cfe3f(0x107)+_0x215e1e)),0x1;}else console[_0x4cfe3f(0x161)](),console['log'](_0x5a0c8d);}return _0x4f3ce8['length']>0x0?0x1:0x0;}async['executeReeval'](_0x3c49a7,_0x3ab7f0){const _0x5023e6=a5_0x348df7,{options:_0x40fe57,tdx:_0x313e42}=_0x3c49a7,{definition:_0x40cdda,agentInfo:_0x2e9a88,outputFormat:_0x1c6bba,outputFile:_0x989c7a}=_0x3ab7f0,_0x41299c=_0x40fe57[_0x5023e6(0x112)],_0x509907=loadLastTestRun();if(!_0x509907)return console[_0x5023e6(0x161)](a5_0x312754[_0x5023e6(0x100)](_0x5023e6(0x173))),console[_0x5023e6(0x161)](a5_0x312754[_0x5023e6(0x14b)](_0x5023e6(0x121))),0x1;if(_0x509907[_0x5023e6(0xf8)][_0x5023e6(0xfd)]!==_0x2e9a88[_0x5023e6(0xfd)])return console['log'](a5_0x312754[_0x5023e6(0x100)](_0x5023e6(0x136)+_0x509907[_0x5023e6(0xf8)][_0x5023e6(0xfd)]+_0x5023e6(0x143)+_0x2e9a88['agentName']+'\x22.')),console[_0x5023e6(0x161)](a5_0x312754['dim']('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x223523=new Set(_0x509907['conversations']['map'](_0x4c624c=>_0x4c624c['testName'])),_0x4b4da9=_0x40cdda['tests']['filter'](_0x3facc5=>!_0x223523[_0x5023e6(0x150)](_0x3facc5[_0x5023e6(0x16b)]));if(_0x4b4da9['length']>0x0&&_0x509907[_0x5023e6(0x112)]!==_0x41299c)return console[_0x5023e6(0x161)](a5_0x312754[_0x5023e6(0x100)](_0x5023e6(0x172))),console[_0x5023e6(0x161)](a5_0x312754[_0x5023e6(0x14b)](_0x5023e6(0x151)+_0x509907[_0x5023e6(0x112)]+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x41299c+'\x22.')),console[_0x5023e6(0x161)](a5_0x312754[_0x5023e6(0x14b)](_0x5023e6(0x141)+_0x509907[_0x5023e6(0x112)]+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x4c6e56=_0x40cdda[_0x5023e6(0x142)][_0x5023e6(0x14c)](_0x1e634d=>_0x223523[_0x5023e6(0x150)](_0x1e634d[_0x5023e6(0x16b)])),_0x4e9804=_0x4b4da9;let _0x196bd4;try{_0x196bd4=await setupEvaluatorAgent(_0x313e42[_0x5023e6(0x113)],_0x40fe57[_0x5023e6(0x158)]);}catch(_0xe228c3){const _0x2944ca=_0xe228c3 instanceof Error?_0xe228c3[_0x5023e6(0x13b)]:String(_0xe228c3);return console[_0x5023e6(0x161)](a5_0x312754[_0x5023e6(0x100)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x2944ca)),0x1;}console[_0x5023e6(0x161)](a5_0x312754['cyan'](_0x5023e6(0xf9))),console[_0x5023e6(0x161)](_0x5023e6(0xf3)+a5_0x312754[_0x5023e6(0x110)](_0x509907['timestamp'])),console['log'](_0x5023e6(0x10b)+a5_0x312754[_0x5023e6(0x110)](_0x509907['agent'][_0x5023e6(0x15f)]+'/'+_0x509907[_0x5023e6(0xf8)][_0x5023e6(0xfd)]));_0x4e9804[_0x5023e6(0x11e)]>0x0&&console[_0x5023e6(0x161)](_0x5023e6(0x166)+a5_0x312754['yellow'](_0x4e9804[_0x5023e6(0x11e)]));console[_0x5023e6(0x161)]();const _0x2a13c0=[],_0x51b17a=Date[_0x5023e6(0x11b)](),_0x1df9a4=createCommandSpinner('Re-evaluating...');if(_0x4c6e56[_0x5023e6(0x11e)]>0x0)try{const _0x52c754=await reevaluateFromCache(_0x313e42[_0x5023e6(0x113)],_0x509907,{'tests':_0x4c6e56},{'evaluatorId':_0x196bd4,'onTestStart':(_0x450e30,_0x4feb88,_0xef6ef2)=>{const _0x18c15c=_0x5023e6;_0x1df9a4[_0x18c15c(0x149)]=_0x18c15c(0x140)+(_0x4feb88+0x1)+'/'+_0xef6ef2+':\x20'+_0x450e30+_0x18c15c(0x17a);if(!_0x1df9a4['isSpinning'])_0x1df9a4[_0x18c15c(0x13d)]();},'onTestComplete':(_0x266293,_0x177f36)=>{const _0x53fedf=_0x5023e6;_0x1df9a4['stop']();if(_0x177f36[_0x53fedf(0x16c)]==='PASS')console[_0x53fedf(0x161)](a5_0x312754['green'](_0x53fedf(0x12e)+_0x266293)+a5_0x312754['dim'](_0x53fedf(0x11a)));else _0x177f36['status']===_0x53fedf(0x122)?console[_0x53fedf(0x161)](a5_0x312754[_0x53fedf(0x100)](_0x53fedf(0x160)+_0x266293+'\x20-\x20'+_0x177f36['reason'])+a5_0x312754[_0x53fedf(0x14b)]('\x20(cached)')):console['log'](a5_0x312754[_0x53fedf(0x100)](_0x53fedf(0x123)+_0x266293+_0x53fedf(0x164)+_0x177f36[_0x53fedf(0x132)]));_0x177f36[_0x53fedf(0x104)]&&console['log'](a5_0x312754[_0x53fedf(0x14b)]('\x20\x20Conversation:\x20'+_0x177f36[_0x53fedf(0x104)])),_0x2a13c0[_0x53fedf(0x159)](_0x177f36);},'onTestSkipped':(_0x14d5cd,_0x580f0d)=>{const _0x10c9c3=_0x5023e6;_0x1df9a4[_0x10c9c3(0xff)](),console[_0x10c9c3(0x161)](a5_0x312754['yellow']('⚠\x20SKIPPED:\x20'+_0x14d5cd+_0x10c9c3(0x164)+_0x580f0d));}});for(const _0x512605 of _0x52c754){!_0x2a13c0[_0x5023e6(0xfc)](_0x5b3fa2=>_0x5b3fa2['name']===_0x512605['name'])&&_0x2a13c0[_0x5023e6(0x159)](_0x512605);}}catch(_0x195137){_0x1df9a4[_0x5023e6(0xff)]();const _0x1ffc18=_0x195137 instanceof Error?_0x195137[_0x5023e6(0x13b)]:String(_0x195137);return console['log'](a5_0x312754['red']('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0x1ffc18)),0x1;}_0x1df9a4[_0x5023e6(0xff)]();if(_0x4e9804[_0x5023e6(0x11e)]>0x0){console[_0x5023e6(0x161)](),console[_0x5023e6(0x161)](a5_0x312754['cyan'](_0x5023e6(0x101)));const {projectId:_0x260357,agentId:_0x1abb7b}=_0x509907['agent'];for(const _0x58cdec of _0x4e9804){console[_0x5023e6(0x161)](_0x5023e6(0xf4)+a5_0x312754['white'](_0x58cdec['name']));const _0x20cdef=createCommandSpinner(_0x5023e6(0x153)+_0x58cdec[_0x5023e6(0x162)][_0x5023e6(0x11e)]+_0x5023e6(0x178));_0x20cdef['start']();try{const {result:_0x922893}=await runTest(_0x313e42['llm'],_0x58cdec,{'agentId':_0x1abb7b,'projectId':_0x260357,'site':_0x509907[_0x5023e6(0x112)],'noEval':![],'evaluatorId':_0x196bd4,'onRoundStart':(_0x48a27c,_0x3b2840)=>{const _0x12abf6=_0x5023e6;_0x20cdef[_0x12abf6(0x149)]=_0x12abf6(0x102)+(_0x48a27c+0x1)+'/'+_0x3b2840+_0x12abf6(0x178);},'onRoundComplete':(_0xbe312e,_0x4fb5a2,_0x3e8979)=>{const _0x334580=_0x5023e6,_0x4d5982=formatElapsed(_0x4fb5a2);_0x3e8979?console[_0x334580(0x161)](_0x334580(0x109)+(_0xbe312e+0x1)+'/'+_0x58cdec['rounds']['length']+'...\x20'+a5_0x312754[_0x334580(0x120)]('✓')+'\x20('+_0x4d5982+')'):console[_0x334580(0x161)](_0x334580(0x109)+(_0xbe312e+0x1)+'/'+_0x58cdec[_0x334580(0x162)][_0x334580(0x11e)]+_0x334580(0x175)+a5_0x312754['red']('✗'));},'onEvaluationStart':()=>{const _0x2443c4=_0x5023e6;_0x20cdef[_0x2443c4(0x149)]='Evaluating\x20response...';},'onEvaluationComplete':_0x31d042=>{const _0x3cb182=_0x5023e6,_0x67605c=formatElapsed(_0x31d042);console[_0x3cb182(0x161)](_0x3cb182(0xef)+a5_0x312754[_0x3cb182(0x120)]('✓')+'\x20('+_0x67605c+')');}});_0x20cdef['stop'](),_0x2a13c0[_0x5023e6(0x159)](_0x922893);if(_0x922893[_0x5023e6(0x16c)]===_0x5023e6(0x114))console[_0x5023e6(0x161)](a5_0x312754['green']('✓\x20PASS:\x20'+_0x922893[_0x5023e6(0x132)])+a5_0x312754['dim'](_0x5023e6(0x17d)));else _0x922893[_0x5023e6(0x16c)]===_0x5023e6(0x122)?console[_0x5023e6(0x161)](a5_0x312754['red'](_0x5023e6(0x160)+_0x922893[_0x5023e6(0x132)])+a5_0x312754['dim'](_0x5023e6(0x17d))):console['log'](a5_0x312754[_0x5023e6(0x100)](_0x5023e6(0x123)+_0x922893[_0x5023e6(0x132)]));_0x922893[_0x5023e6(0x104)]&&console[_0x5023e6(0x161)](a5_0x312754[_0x5023e6(0x14b)](_0x5023e6(0xf5)+_0x922893[_0x5023e6(0x104)]));}catch(_0x3843e1){_0x20cdef[_0x5023e6(0xff)]();const _0x33cc33=_0x3843e1 instanceof Error?_0x3843e1[_0x5023e6(0x13b)]:String(_0x3843e1);console[_0x5023e6(0x161)](a5_0x312754['red'](_0x5023e6(0x123)+_0x33cc33)),_0x2a13c0[_0x5023e6(0x159)]({'name':_0x58cdec['name'],'status':_0x5023e6(0x108),'reason':_0x33cc33,'timestamp':new Date()[_0x5023e6(0x12f)](),'duration_ms':0x0});}}}console[_0x5023e6(0x161)]();const _0x2b61f5=Date[_0x5023e6(0x11b)]()-_0x51b17a,_0x1e4f02=_0x2a13c0[_0x5023e6(0x14c)](_0x5b1d81=>_0x5b1d81[_0x5023e6(0x16c)]===_0x5023e6(0x114))[_0x5023e6(0x11e)],_0x1f3c1e=_0x2a13c0[_0x5023e6(0x14c)](_0x3c1e6d=>_0x3c1e6d[_0x5023e6(0x16c)]===_0x5023e6(0x122))[_0x5023e6(0x11e)],_0x15650c=_0x2a13c0[_0x5023e6(0x14c)](_0x319faa=>_0x319faa[_0x5023e6(0x16c)]===_0x5023e6(0x108))['length'];console['log']('━'[_0x5023e6(0x145)](0x3c)),console[_0x5023e6(0x161)](_0x5023e6(0x128)),console['log']('━'[_0x5023e6(0x145)](0x3c)),console[_0x5023e6(0x161)](_0x5023e6(0x124)+_0x2a13c0['length']),console[_0x5023e6(0x161)](_0x5023e6(0x155)+a5_0x312754[_0x5023e6(0x120)](_0x1e4f02)),console['log'](_0x5023e6(0x105)+a5_0x312754['red'](_0x1f3c1e));_0x15650c>0x0&&console[_0x5023e6(0x161)](_0x5023e6(0x157)+a5_0x312754[_0x5023e6(0x100)](_0x15650c));console[_0x5023e6(0x161)]('Duration:\x20'+formatElapsed(_0x2b61f5)),console['log']('━'[_0x5023e6(0x145)](0x3c));const _0x4fef93={'summary':{'total':_0x2a13c0[_0x5023e6(0x11e)],'passed':_0x1e4f02,'failed':_0x1f3c1e,'errors':_0x15650c>0x0?_0x15650c:undefined,'duration_ms':_0x2b61f5},'tests':_0x2a13c0,'agent':{'project':_0x2e9a88['projectName'],'name':_0x2e9a88['agentName'],'site':_0x41299c},'timestamp':new Date(_0x51b17a)['toISOString']()};if(_0x1c6bba!==_0x5023e6(0x171)||_0x989c7a){const _0x55d43b=formatResults(_0x4fef93,_0x1c6bba);if(_0x989c7a)try{a5_0x1fa2e3[_0x5023e6(0xf1)](_0x989c7a,_0x55d43b,'utf-8'),console['log'](),console[_0x5023e6(0x161)](a5_0x312754[_0x5023e6(0x14b)](_0x5023e6(0x148)+_0x989c7a));}catch(_0x39c480){return console[_0x5023e6(0x161)](),console['log'](a5_0x312754['red'](_0x5023e6(0x107)+_0x39c480)),0x1;}else console['log'](),console[_0x5023e6(0x161)](_0x55d43b);}const _0x54d3fd=_0x2a13c0[_0x5023e6(0x14c)](_0x5c508f=>_0x5c508f['status']!==_0x5023e6(0x114));return _0x54d3fd['length']>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0x2240af=a5_0x40cd;function a5_0x40cd(_0x1c106b,_0x59f183){_0x1c106b=_0x1c106b-0x86;const _0x56410d=a5_0x5641();let _0x40cd56=_0x56410d[_0x1c106b];return _0x40cd56;}function a5_0x5641(){const _0x3f9194=['split','join','table','404','272630PTqSaA','agent:test','\x20(cached)','✗\x20FAIL:\x20','filter','tsv','writeFileSync','dryRun','resolveProjectId','agentDirs','utf-8','\x20\x20Project:\x20','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','Round\x201/','isSpinning','\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)','green','agent','⚠\x20SKIPPED:\x20','765338AUFeDj','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','Run\x20tests\x20for\x20an\x20LLM\x20agent','red','Agent:\x20','projectName','\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','no_tests','\x20\x20Evaluating...\x20','\x20\x20Agent:\x20','resolve','verbose','status','existsSync','66wURKjI','log','llmProject','map','Running\x20agent\x20tests...','yellow','Errors:\x20\x20\x20','source','✗\x20ERROR:\x20Project\x20not\x20found:\x20','16UiNAnf','tests','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','executeReeval','message','substring','...','size','12gHPvXY','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','start','Using\x20agent:\x20','Available\x20tests:\x20','site','✓\x20PASS:\x20','some','FAIL','Error\x20writing\x20output\x20file:\x20','Re-evaluating\x20cached\x20test\x20run...','ERROR','conversation_url','dim','214150Eirswt','Executing\x20new\x20tests...','Round\x20','Total:\x20\x20\x20\x20','Evaluating\x20response...','Available\x20tags:\x20','context','Site:\x20','1835872GrSbzN','No\x20tests\x20found\x20matching:\x20','Failed:\x20\x20\x20','toLowerCase','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','✗\x20ERROR:\x20','\x20\x20Conversation:\x20','forEach','Duration:\x20','Cached\x20run\x20from:\x20','\x20-\x20','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','...\x20','basename','Test\x20','text','Output\x20written\x20to:\x20','not\x20found','Project\x20path:\x20','conversations','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','2pWUUJe','\x20\x20Round\x20','push',':\x20Sending\x20user\x20input...','agentName','name','567759uvnldJ','reeval','Error:\x20No\x20previous\x20test\x20run\x20found.','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','now','projectDir','length','\x20\x20Site:\x20','No\x20tests\x20have\x20tags\x20defined.','round','1085004LBKmRr','has','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','rounds','Test\x20Configuration:','testName','toISOString','PASS','reason','trim','find','resolveAgentId','Run\x20\x27tdx\x20agent\x20pull\x20','llm','tags','139355ayxDGN','repeat','Running:\x20','eval','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','Tests\x20found:\x20','Running\x20test:\x20','\x20\x20-\x20','execute','\x22:\x20','stop','cyan','81rEMbsY','Passed:\x20\x20\x20','includes','white','\x27\x20to\x20create\x20the\x20folder\x20structure.','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','jsonl','test.yml','multiple_agents','Re-evaluating...','Test\x20Summary'];a5_0x5641=function(){return _0x3f9194;};return a5_0x5641();}(function(_0x1d8454,_0xeccc0e){const _0x2604f4=a5_0x40cd,_0xfd5d90=_0x1d8454();while(!![]){try{const _0x36a794=-parseInt(_0x2604f4(0x8d))/0x1+-parseInt(_0x2604f4(0xaa))/0x2*(parseInt(_0x2604f4(0xb0))/0x3)+-parseInt(_0x2604f4(0x10f))/0x4*(parseInt(_0x2604f4(0xca))/0x5)+parseInt(_0x2604f4(0x117))/0x6*(parseInt(_0x2604f4(0xf8))/0x7)+parseInt(_0x2604f4(0x95))/0x8+parseInt(_0x2604f4(0xd6))/0x9*(-parseInt(_0x2604f4(0xe5))/0xa)+-parseInt(_0x2604f4(0x106))/0xb*(-parseInt(_0x2604f4(0xba))/0xc);if(_0x36a794===_0xeccc0e)break;else _0xfd5d90['push'](_0xfd5d90['shift']());}catch(_0x4b3591){_0xfd5d90['push'](_0xfd5d90['shift']());}}}(a5_0x5641,0x38400));import*as a5_0x228e74 from'node:fs';import*as a5_0x5b5922 from'node:path';import a5_0x1dc59b from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{['name']=a5_0x2240af(0xe6);['description']=a5_0x2240af(0xfa);async[a5_0x2240af(0xd2)](_0x47e489){const _0x3c1166=a5_0x2240af,{options:_0x1f2d2d,args:_0x13d1cd,tdx:_0x366945}=_0x47e489,_0xb5ef1b=_0x13d1cd[0x0]||'.',_0x366558=_0x1f2d2d[_0x3c1166(0xec)],_0x331366=_0x1f2d2d,_0x1e51a7=_0x331366[_0x3c1166(0xcd)]===![],_0x1e0fca=_0x331366[_0x3c1166(0xb1)],_0x3251b2=_0x331366[_0x3c1166(0xaf)],_0xf310a1=_0x331366[_0x3c1166(0xc9)],_0x335adc=_0x1f2d2d[_0x3c1166(0x11c)],_0x2ffe10=_0x331366['output'];if(_0x1e0fca&&_0x1e51a7)return console[_0x3c1166(0x107)](a5_0x1dc59b[_0x3c1166(0xfb)](_0x3c1166(0xce))),0x1;let _0x4b6611=_0x3c1166(0xe3);if(_0x331366['json'])_0x4b6611='json';else{if(_0x331366[_0x3c1166(0xdc)])_0x4b6611=_0x3c1166(0xdc);else{if(_0x331366[_0x3c1166(0xea)])_0x4b6611=_0x3c1166(0xea);else{if(_0x331366[_0x3c1166(0xe3)])_0x4b6611=_0x3c1166(0xe3);}}}const _0xdd545c=_0x331366[_0x3c1166(0x108)];let _0x1b7e83=_0xb5ef1b;const _0x2cb53b=a5_0x228e74[_0x3c1166(0x105)](_0xb5ef1b),_0x4208f0=_0xb5ef1b==='.';if(!_0x2cb53b||_0x4208f0){const _0x23f02b=resolveProjectFromContext(_0xb5ef1b,_0xdd545c,{'requireFile':_0x3c1166(0xdd)});if(_0x23f02b['found'])_0x1b7e83=_0x23f02b['projectDir'],_0x23f02b[_0x3c1166(0x10d)]===_0x3c1166(0x93)&&console[_0x3c1166(0x107)](a5_0x1dc59b['dim'](_0x3c1166(0x11a)+_0x1b7e83));else switch(_0x23f02b[_0x3c1166(0xc3)]){case'no_context':console[_0x3c1166(0x107)](a5_0x1dc59b['yellow'](_0x23f02b['message'])),console[_0x3c1166(0x107)](),console[_0x3c1166(0x107)]('Usage:'),console['log'](_0x3c1166(0xfe)),console['log'](_0x3c1166(0xf4)),console[_0x3c1166(0x107)](),console[_0x3c1166(0x107)]('Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>');return 0x1;case'no_local_folder':console[_0x3c1166(0x107)](a5_0x1dc59b['yellow'](_0x23f02b[_0x3c1166(0x113)])),console['log'](),console['log'](_0x3c1166(0xc7)+_0x23f02b['llmProject']+_0x3c1166(0xda));return 0x1;case _0x3c1166(0xde):{const _0x255e06=a5_0x5b5922[_0x3c1166(0xa2)](_0x23f02b['projectDir']);console[_0x3c1166(0x107)](a5_0x1dc59b[_0x3c1166(0x10b)](_0x3c1166(0xf1)+_0x23f02b[_0x3c1166(0x108)]+'\x22:'));for(const _0x4d3eae of _0x23f02b[_0x3c1166(0xee)]){console[_0x3c1166(0x107)](_0x3c1166(0xd1)+_0x4d3eae);}return console[_0x3c1166(0x107)](),console[_0x3c1166(0x107)](_0x3c1166(0x118)+_0x255e06+'/<agent-name>'),0x1;}case _0x3c1166(0xff):console[_0x3c1166(0x107)](a5_0x1dc59b[_0x3c1166(0x10b)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x23f02b[_0x3c1166(0x108)]+'\x22.')),console[_0x3c1166(0x107)](a5_0x1dc59b[_0x3c1166(0x8c)](_0x3c1166(0xa7)+_0x23f02b[_0x3c1166(0xb5)])),console['log'](),console[_0x3c1166(0x107)]('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0x1d5e8e,agentInfo:_0x14b964}=parseTestFile(_0x1b7e83);let _0x233ef5=_0x1d5e8e[_0x3c1166(0x110)];if(_0x3251b2){const _0x497ddc=_0x3251b2[_0x3c1166(0xe1)](',')[_0x3c1166(0x109)](_0x3fb42f=>_0x3fb42f[_0x3c1166(0xc4)]());_0x233ef5=_0x1d5e8e[_0x3c1166(0x110)][_0x3c1166(0xe9)](_0x753ce6=>_0x497ddc[_0x3c1166(0xd8)](_0x753ce6['name']));if(_0x233ef5[_0x3c1166(0xb6)]===0x0)return console[_0x3c1166(0x107)](a5_0x1dc59b[_0x3c1166(0x10b)](_0x3c1166(0x96)+_0x3251b2)),console['log'](a5_0x1dc59b[_0x3c1166(0x8c)](_0x3c1166(0x11b)+_0x1d5e8e[_0x3c1166(0x110)][_0x3c1166(0x109)](_0x5b6df8=>_0x5b6df8[_0x3c1166(0xaf)])[_0x3c1166(0xe2)](',\x20'))),0x1;}if(_0xf310a1){const _0x10aa89=_0xf310a1['split'](',')[_0x3c1166(0x109)](_0x3d0e98=>_0x3d0e98[_0x3c1166(0xc4)]()[_0x3c1166(0x98)]());_0x233ef5=_0x233ef5[_0x3c1166(0xe9)](_0x1316b1=>_0x1316b1[_0x3c1166(0xc9)]?.[_0x3c1166(0x86)](_0x114290=>_0x10aa89[_0x3c1166(0xd8)](_0x114290[_0x3c1166(0x98)]())));if(_0x233ef5[_0x3c1166(0xb6)]===0x0){console['log'](a5_0x1dc59b[_0x3c1166(0x10b)]('No\x20tests\x20found\x20with\x20tags:\x20'+_0xf310a1));const _0x2ecec4=new Set();return _0x1d5e8e[_0x3c1166(0x110)]['forEach'](_0x1cab9e=>_0x1cab9e['tags']?.[_0x3c1166(0x9c)](_0x331dec=>_0x2ecec4['add'](_0x331dec))),_0x2ecec4[_0x3c1166(0x116)]>0x0?console[_0x3c1166(0x107)](a5_0x1dc59b[_0x3c1166(0x8c)](_0x3c1166(0x92)+[..._0x2ecec4]['join'](',\x20'))):console[_0x3c1166(0x107)](a5_0x1dc59b[_0x3c1166(0x8c)](_0x3c1166(0xb8))),0x1;}}if(_0x1e0fca)return this[_0x3c1166(0x112)](_0x47e489,{'definition':{'tests':_0x233ef5},'agentInfo':_0x14b964,'outputFormat':_0x4b6611,'outputFile':_0x2ffe10,'testNames':_0x3251b2});if(_0x366558){console['log'](a5_0x1dc59b[_0x3c1166(0xd5)](_0x3c1166(0xbf))),console['log'](_0x3c1166(0xb7)+a5_0x1dc59b[_0x3c1166(0xd9)](_0x335adc)),console[_0x3c1166(0x107)](_0x3c1166(0xf0)+a5_0x1dc59b[_0x3c1166(0xd9)](_0x14b964[_0x3c1166(0xfd)])),console[_0x3c1166(0x107)](_0x3c1166(0x101)+a5_0x1dc59b['white'](_0x14b964[_0x3c1166(0xae)])),console[_0x3c1166(0x107)](),console[_0x3c1166(0x107)](_0x3c1166(0xcf)+a5_0x1dc59b[_0x3c1166(0xd9)](_0x233ef5[_0x3c1166(0xb6)]));for(let _0x1d90bb=0x0;_0x1d90bb<_0x233ef5[_0x3c1166(0xb6)];_0x1d90bb++){const _0x19d97c=_0x233ef5[_0x1d90bb],_0xf79188=_0x19d97c[_0x3c1166(0xbe)]['length']===0x1?_0x3c1166(0xb9):'rounds',_0x2db847=_0x19d97c['tags']?.[_0x3c1166(0xb6)]?'\x20['+_0x19d97c[_0x3c1166(0xc9)][_0x3c1166(0xe2)](',\x20')+']':'';console[_0x3c1166(0x107)]('\x20\x20'+(_0x1d90bb+0x1)+'.\x20'+a5_0x1dc59b[_0x3c1166(0xd9)](_0x19d97c['name'])+'\x20('+_0x19d97c[_0x3c1166(0xbe)][_0x3c1166(0xb6)]+'\x20'+_0xf79188+')'+a5_0x1dc59b[_0x3c1166(0x8c)](_0x2db847));}return 0x0;}let _0x295514,_0x401388;try{_0x295514=await _0x366945[_0x3c1166(0xc8)][_0x3c1166(0xed)](_0x14b964[_0x3c1166(0xfd)]);}catch(_0x568721){const _0x2fa1c7=_0x568721 instanceof Error?_0x568721[_0x3c1166(0x113)]:String(_0x568721);return _0x2fa1c7[_0x3c1166(0xd8)](_0x3c1166(0xe4))||_0x2fa1c7[_0x3c1166(0x98)]()['includes'](_0x3c1166(0xa6))?console['log'](a5_0x1dc59b['red'](_0x3c1166(0x10e)+_0x14b964[_0x3c1166(0xfd)])):console[_0x3c1166(0x107)](a5_0x1dc59b[_0x3c1166(0xfb)](_0x3c1166(0xf9)+_0x14b964[_0x3c1166(0xfd)]+_0x3c1166(0xd3)+_0x2fa1c7)),0x1;}try{_0x401388=await _0x366945[_0x3c1166(0xc8)][_0x3c1166(0xc6)](_0x14b964[_0x3c1166(0xae)],_0x295514);}catch(_0x2015f8){const _0x4d8240=_0x2015f8 instanceof Error?_0x2015f8[_0x3c1166(0x113)]:String(_0x2015f8);return _0x4d8240[_0x3c1166(0xd8)](_0x3c1166(0xe4))||_0x4d8240[_0x3c1166(0x98)]()[_0x3c1166(0xd8)](_0x3c1166(0xa6))?console['log'](a5_0x1dc59b['red'](_0x3c1166(0xa0)+_0x14b964[_0x3c1166(0xae)])):console[_0x3c1166(0x107)](a5_0x1dc59b[_0x3c1166(0xfb)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x14b964[_0x3c1166(0xae)]+_0x3c1166(0xd3)+_0x4d8240)),0x1;}let _0x24bb26;if(!_0x1e51a7)try{_0x24bb26=await setupEvaluatorAgent(_0x366945[_0x3c1166(0xc8)],_0x1f2d2d[_0x3c1166(0x103)]);}catch(_0x277a56){const _0x4891a3=_0x277a56 instanceof Error?_0x277a56[_0x3c1166(0x113)]:String(_0x277a56);return console[_0x3c1166(0x107)](a5_0x1dc59b['red'](_0x3c1166(0x99)+_0x4891a3)),0x1;}console[_0x3c1166(0x107)](a5_0x1dc59b[_0x3c1166(0xd5)](_0x3c1166(0x10a))),console[_0x3c1166(0x107)](_0x3c1166(0x94)+a5_0x1dc59b[_0x3c1166(0xd9)](_0x335adc)),console[_0x3c1166(0x107)](_0x3c1166(0xfc)+a5_0x1dc59b[_0x3c1166(0xd9)](_0x14b964[_0x3c1166(0xfd)]+'/'+_0x14b964[_0x3c1166(0xae)])),console[_0x3c1166(0x107)]();const _0x742987=[],_0x305a9c=[],_0xbba474=Date[_0x3c1166(0xb4)]();for(let _0xd7aeeb=0x0;_0xd7aeeb<_0x233ef5[_0x3c1166(0xb6)];_0xd7aeeb++){const _0x27ef1d=_0x233ef5[_0xd7aeeb];_0x233ef5[_0x3c1166(0xb6)]>0x1?console['log'](_0x3c1166(0xa3)+(_0xd7aeeb+0x1)+'/'+_0x233ef5['length']+':\x20'+a5_0x1dc59b[_0x3c1166(0xd9)](_0x27ef1d[_0x3c1166(0xaf)])):console[_0x3c1166(0x107)](_0x3c1166(0xd0)+a5_0x1dc59b[_0x3c1166(0xd9)](_0x27ef1d[_0x3c1166(0xaf)]));const _0x4f59f7=createCommandSpinner(_0x3c1166(0xf2)+_0x27ef1d[_0x3c1166(0xbe)][_0x3c1166(0xb6)]+_0x3c1166(0xad));_0x4f59f7[_0x3c1166(0x119)]();try{const {result:_0x12eb1b,conversation:_0x13edfb}=await runTest(_0x366945[_0x3c1166(0xc8)],_0x27ef1d,{'agentId':_0x401388,'projectId':_0x295514,'site':_0x335adc,'noEval':_0x1e51a7,'evaluatorId':_0x24bb26,'onRoundStart':(_0x2b897b,_0x49d189)=>{const _0x40f63e=_0x3c1166;_0x4f59f7[_0x40f63e(0xa4)]=_0x40f63e(0x8f)+(_0x2b897b+0x1)+'/'+_0x49d189+_0x40f63e(0xad);},'onRoundComplete':(_0x4e9024,_0x3ff290,_0x3514ee)=>{const _0x283d93=_0x3c1166,_0x39677b=formatElapsed(_0x3ff290);_0x3514ee?console[_0x283d93(0x107)]('\x20\x20Round\x20'+(_0x4e9024+0x1)+'/'+_0x27ef1d[_0x283d93(0xbe)]['length']+_0x283d93(0xa1)+a5_0x1dc59b[_0x283d93(0xf5)]('✓')+'\x20('+_0x39677b+')'):console[_0x283d93(0x107)](_0x283d93(0xab)+(_0x4e9024+0x1)+'/'+_0x27ef1d[_0x283d93(0xbe)]['length']+'...\x20'+a5_0x1dc59b[_0x283d93(0xfb)]('✗'));},'onEvaluationStart':()=>{const _0x33dfb8=_0x3c1166;_0x4f59f7[_0x33dfb8(0xa4)]=_0x33dfb8(0x91);},'onEvaluationComplete':_0x37d80a=>{const _0x2cd999=_0x3c1166,_0x15dd56=formatElapsed(_0x37d80a);console[_0x2cd999(0x107)]('\x20\x20Evaluating...\x20'+a5_0x1dc59b[_0x2cd999(0xf5)]('✓')+'\x20('+_0x15dd56+')');}});_0x4f59f7[_0x3c1166(0xd4)](),_0x742987[_0x3c1166(0xac)](_0x12eb1b),_0x305a9c[_0x3c1166(0xac)](_0x13edfb);if(_0x12eb1b['status']===_0x3c1166(0xc2))console[_0x3c1166(0x107)](a5_0x1dc59b['green'](_0x3c1166(0x11d)+_0x12eb1b[_0x3c1166(0xc3)]));else _0x12eb1b[_0x3c1166(0x104)]==='FAIL'?console[_0x3c1166(0x107)](a5_0x1dc59b[_0x3c1166(0xfb)](_0x3c1166(0xe8)+_0x12eb1b[_0x3c1166(0xc3)])):console['log'](a5_0x1dc59b[_0x3c1166(0xfb)](_0x3c1166(0x9a)+_0x12eb1b[_0x3c1166(0xc3)]));_0x12eb1b[_0x3c1166(0x8b)]&&console[_0x3c1166(0x107)](a5_0x1dc59b[_0x3c1166(0x8c)]('Conversation\x20URL:\x20'+_0x12eb1b['conversation_url'])),console[_0x3c1166(0x107)]();}catch(_0x5f3e9c){_0x4f59f7['stop']();const _0x2bfb8b=_0x5f3e9c instanceof Error?_0x5f3e9c['message']:String(_0x5f3e9c);console['log'](a5_0x1dc59b['red'](_0x3c1166(0x9a)+_0x2bfb8b)),console['log'](),_0x742987['push']({'name':_0x27ef1d[_0x3c1166(0xaf)],'status':_0x3c1166(0x8a),'reason':_0x2bfb8b,'timestamp':new Date()[_0x3c1166(0xc1)](),'duration_ms':0x0});}}const _0x2d83c7=Date['now']()-_0xbba474,_0x5c18e1=_0x742987['filter'](_0x3e40fd=>_0x3e40fd['status']===_0x3c1166(0xc2))[_0x3c1166(0xb6)],_0x20a29f=_0x742987[_0x3c1166(0xe9)](_0x1944ba=>_0x1944ba[_0x3c1166(0x104)]===_0x3c1166(0x87))[_0x3c1166(0xb6)],_0x18c622=_0x742987[_0x3c1166(0xe9)](_0x46bf6e=>_0x46bf6e[_0x3c1166(0x104)]===_0x3c1166(0x8a))['length'];console[_0x3c1166(0x107)]('━'[_0x3c1166(0xcb)](0x3c)),console[_0x3c1166(0x107)](_0x3c1166(0xe0)),console[_0x3c1166(0x107)]('━'['repeat'](0x3c)),console[_0x3c1166(0x107)](_0x3c1166(0x90)+_0x742987[_0x3c1166(0xb6)]),console[_0x3c1166(0x107)](_0x3c1166(0xd7)+a5_0x1dc59b['green'](_0x5c18e1)),console[_0x3c1166(0x107)](_0x3c1166(0x97)+a5_0x1dc59b[_0x3c1166(0xfb)](_0x20a29f));_0x18c622>0x0&&console[_0x3c1166(0x107)](_0x3c1166(0x10c)+a5_0x1dc59b['red'](_0x18c622));console['log'](_0x3c1166(0x9d)+formatElapsed(_0x2d83c7)),console[_0x3c1166(0x107)]('━'['repeat'](0x3c));const _0x252005=_0x742987[_0x3c1166(0xe9)](_0x11231b=>_0x11231b[_0x3c1166(0x104)]!==_0x3c1166(0xc2));if(_0x252005[_0x3c1166(0xb6)]>0x0){console[_0x3c1166(0x107)](),console[_0x3c1166(0x107)]('Failed\x20Tests:');for(const _0x2a3852 of _0x252005){const _0x5c9eaf=a5_0x1dc59b[_0x3c1166(0xfb)]('✗'),_0xa59503=_0x2a3852[_0x3c1166(0xc3)]['length']>0x32?_0x2a3852[_0x3c1166(0xc3)][_0x3c1166(0x114)](0x0,0x32)+_0x3c1166(0x115):_0x2a3852[_0x3c1166(0xc3)];console[_0x3c1166(0x107)]('\x20\x20'+_0x5c9eaf+'\x20'+_0x2a3852[_0x3c1166(0xaf)]+':\x20'+_0xa59503);}}const _0x246a36={'summary':{'total':_0x742987[_0x3c1166(0xb6)],'passed':_0x5c18e1,'failed':_0x20a29f,'errors':_0x18c622>0x0?_0x18c622:undefined,'duration_ms':_0x2d83c7},'tests':_0x742987,'agent':{'project':_0x14b964[_0x3c1166(0xfd)],'name':_0x14b964[_0x3c1166(0xae)],'site':_0x335adc},'timestamp':new Date(_0xbba474)[_0x3c1166(0xc1)]()};try{const _0x108c57=buildCachedTestRun(_0x305a9c,{'site':_0x335adc,'projectId':_0x295514,'projectName':_0x14b964[_0x3c1166(0xfd)],'agentId':_0x401388,'agentName':_0x14b964[_0x3c1166(0xae)],'testYmlPath':a5_0x5b5922[_0x3c1166(0x102)](_0x14b964['testYmlPath'])});saveLastTestRun(_0x108c57);}catch{}if(_0x4b6611!==_0x3c1166(0xe3)||_0x2ffe10){const _0x149230=formatResults(_0x246a36,_0x4b6611);if(_0x2ffe10)try{a5_0x228e74[_0x3c1166(0xeb)](_0x2ffe10,_0x149230,'utf-8'),console[_0x3c1166(0x107)](),console[_0x3c1166(0x107)](a5_0x1dc59b['dim'](_0x3c1166(0xa5)+_0x2ffe10));}catch(_0x54a541){return console[_0x3c1166(0x107)](),console[_0x3c1166(0x107)](a5_0x1dc59b[_0x3c1166(0xfb)]('Error\x20writing\x20output\x20file:\x20'+_0x54a541)),0x1;}else console['log'](),console['log'](_0x149230);}return _0x252005['length']>0x0?0x1:0x0;}async[a5_0x2240af(0x112)](_0x58d6c5,_0x391045){const _0x312dd8=a5_0x2240af,{options:_0x23b5c7,tdx:_0x4c65ac}=_0x58d6c5,{definition:_0x1bd533,agentInfo:_0x378198,outputFormat:_0x3bab79,outputFile:_0x5303be}=_0x391045,_0x5481cd=_0x23b5c7[_0x312dd8(0x11c)],_0xa94df7=loadLastTestRun();if(!_0xa94df7)return console[_0x312dd8(0x107)](a5_0x1dc59b['red'](_0x312dd8(0xb2))),console[_0x312dd8(0x107)](a5_0x1dc59b[_0x312dd8(0x8c)](_0x312dd8(0xa9))),0x1;if(_0xa94df7['agent']['agentName']!==_0x378198[_0x312dd8(0xae)])return console[_0x312dd8(0x107)](a5_0x1dc59b['red'](_0x312dd8(0xdb)+_0xa94df7[_0x312dd8(0xf6)][_0x312dd8(0xae)]+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x378198['agentName']+'\x22.')),console[_0x312dd8(0x107)](a5_0x1dc59b[_0x312dd8(0x8c)](_0x312dd8(0x111))),0x1;const _0xf539a7=new Set(_0xa94df7[_0x312dd8(0xa8)]['map'](_0x4e362b=>_0x4e362b[_0x312dd8(0xc0)])),_0x1bc867=_0x1bd533['tests'][_0x312dd8(0xe9)](_0x25daf9=>!_0xf539a7['has'](_0x25daf9[_0x312dd8(0xaf)]));if(_0x1bc867['length']>0x0&&_0xa94df7[_0x312dd8(0x11c)]!==_0x5481cd)return console['log'](a5_0x1dc59b['red'](_0x312dd8(0xbc))),console[_0x312dd8(0x107)](a5_0x1dc59b[_0x312dd8(0x8c)]('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0xa94df7[_0x312dd8(0x11c)]+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x5481cd+'\x22.')),console['log'](a5_0x1dc59b[_0x312dd8(0x8c)]('Either\x20switch\x20to\x20the\x20\x22'+_0xa94df7[_0x312dd8(0x11c)]+_0x312dd8(0xb3))),0x1;const _0x4100ff=_0x1bd533[_0x312dd8(0x110)][_0x312dd8(0xe9)](_0x15592e=>_0xf539a7[_0x312dd8(0xbb)](_0x15592e['name'])),_0x5367a5=_0x1bc867;let _0x538589;try{_0x538589=await setupEvaluatorAgent(_0x4c65ac['llm'],_0x23b5c7['verbose']);}catch(_0xc9a209){const _0x2e5726=_0xc9a209 instanceof Error?_0xc9a209[_0x312dd8(0x113)]:String(_0xc9a209);return console[_0x312dd8(0x107)](a5_0x1dc59b['red'](_0x312dd8(0x99)+_0x2e5726)),0x1;}console[_0x312dd8(0x107)](a5_0x1dc59b[_0x312dd8(0xd5)](_0x312dd8(0x89))),console[_0x312dd8(0x107)](_0x312dd8(0x9e)+a5_0x1dc59b[_0x312dd8(0xd9)](_0xa94df7['timestamp'])),console[_0x312dd8(0x107)](_0x312dd8(0xfc)+a5_0x1dc59b[_0x312dd8(0xd9)](_0xa94df7[_0x312dd8(0xf6)][_0x312dd8(0xfd)]+'/'+_0xa94df7[_0x312dd8(0xf6)]['agentName']));_0x5367a5[_0x312dd8(0xb6)]>0x0&&console[_0x312dd8(0x107)]('New\x20tests\x20to\x20execute:\x20'+a5_0x1dc59b[_0x312dd8(0x10b)](_0x5367a5[_0x312dd8(0xb6)]));console[_0x312dd8(0x107)]();const _0xb15af9=[],_0x20f85e=Date[_0x312dd8(0xb4)](),_0x250586=createCommandSpinner(_0x312dd8(0xdf));if(_0x4100ff[_0x312dd8(0xb6)]>0x0)try{const _0x36a6b5=await reevaluateFromCache(_0x4c65ac[_0x312dd8(0xc8)],_0xa94df7,{'tests':_0x4100ff},{'evaluatorId':_0x538589,'onTestStart':(_0xfc0722,_0x549e4c,_0x28a9ae)=>{const _0x72acf=_0x312dd8;_0x250586['text']='Re-evaluating\x20'+(_0x549e4c+0x1)+'/'+_0x28a9ae+':\x20'+_0xfc0722+_0x72acf(0x115);if(!_0x250586[_0x72acf(0xf3)])_0x250586[_0x72acf(0x119)]();},'onTestComplete':(_0x497581,_0x5e9762)=>{const _0x59660c=_0x312dd8;_0x250586[_0x59660c(0xd4)]();if(_0x5e9762['status']===_0x59660c(0xc2))console[_0x59660c(0x107)](a5_0x1dc59b['green']('✓\x20PASS:\x20'+_0x497581)+a5_0x1dc59b[_0x59660c(0x8c)](_0x59660c(0xe7)));else _0x5e9762[_0x59660c(0x104)]===_0x59660c(0x87)?console[_0x59660c(0x107)](a5_0x1dc59b[_0x59660c(0xfb)](_0x59660c(0xe8)+_0x497581+_0x59660c(0x9f)+_0x5e9762['reason'])+a5_0x1dc59b[_0x59660c(0x8c)](_0x59660c(0xe7))):console[_0x59660c(0x107)](a5_0x1dc59b[_0x59660c(0xfb)](_0x59660c(0x9a)+_0x497581+'\x20-\x20'+_0x5e9762[_0x59660c(0xc3)]));_0x5e9762[_0x59660c(0x8b)]&&console['log'](a5_0x1dc59b[_0x59660c(0x8c)]('\x20\x20Conversation:\x20'+_0x5e9762[_0x59660c(0x8b)])),_0xb15af9['push'](_0x5e9762);},'onTestSkipped':(_0x36ebd5,_0x2a2428)=>{const _0x1b1120=_0x312dd8;_0x250586['stop'](),console[_0x1b1120(0x107)](a5_0x1dc59b[_0x1b1120(0x10b)](_0x1b1120(0xf7)+_0x36ebd5+_0x1b1120(0x9f)+_0x2a2428));}});for(const _0xe7a86d of _0x36a6b5){!_0xb15af9[_0x312dd8(0xc5)](_0x4bdaf0=>_0x4bdaf0[_0x312dd8(0xaf)]===_0xe7a86d[_0x312dd8(0xaf)])&&_0xb15af9[_0x312dd8(0xac)](_0xe7a86d);}}catch(_0x20728d){_0x250586[_0x312dd8(0xd4)]();const _0x1df7ab=_0x20728d instanceof Error?_0x20728d['message']:String(_0x20728d);return console[_0x312dd8(0x107)](a5_0x1dc59b['red'](_0x312dd8(0xbd)+_0x1df7ab)),0x1;}_0x250586[_0x312dd8(0xd4)]();if(_0x5367a5['length']>0x0){console[_0x312dd8(0x107)](),console[_0x312dd8(0x107)](a5_0x1dc59b['cyan'](_0x312dd8(0x8e)));const {projectId:_0x3ac13f,agentId:_0x44636d}=_0xa94df7[_0x312dd8(0xf6)];for(const _0x2b5054 of _0x5367a5){console[_0x312dd8(0x107)](_0x312dd8(0xcc)+a5_0x1dc59b[_0x312dd8(0xd9)](_0x2b5054[_0x312dd8(0xaf)]));const _0x5c0390=createCommandSpinner(_0x312dd8(0xf2)+_0x2b5054['rounds'][_0x312dd8(0xb6)]+':\x20Sending\x20user\x20input...');_0x5c0390[_0x312dd8(0x119)]();try{const {result:_0x3d7ac3}=await runTest(_0x4c65ac[_0x312dd8(0xc8)],_0x2b5054,{'agentId':_0x44636d,'projectId':_0x3ac13f,'site':_0xa94df7['site'],'noEval':![],'evaluatorId':_0x538589,'onRoundStart':(_0x5b1bd4,_0x284aab)=>{const _0x408da1=_0x312dd8;_0x5c0390[_0x408da1(0xa4)]=_0x408da1(0x8f)+(_0x5b1bd4+0x1)+'/'+_0x284aab+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x126893,_0x2059ae,_0x4d6c3b)=>{const _0x121cd8=_0x312dd8,_0x2eb103=formatElapsed(_0x2059ae);_0x4d6c3b?console[_0x121cd8(0x107)](_0x121cd8(0xab)+(_0x126893+0x1)+'/'+_0x2b5054[_0x121cd8(0xbe)][_0x121cd8(0xb6)]+'...\x20'+a5_0x1dc59b['green']('✓')+'\x20('+_0x2eb103+')'):console[_0x121cd8(0x107)](_0x121cd8(0xab)+(_0x126893+0x1)+'/'+_0x2b5054[_0x121cd8(0xbe)][_0x121cd8(0xb6)]+'...\x20'+a5_0x1dc59b[_0x121cd8(0xfb)]('✗'));},'onEvaluationStart':()=>{const _0x3e8479=_0x312dd8;_0x5c0390[_0x3e8479(0xa4)]=_0x3e8479(0x91);},'onEvaluationComplete':_0x26b63a=>{const _0x3df85a=_0x312dd8,_0x235dc4=formatElapsed(_0x26b63a);console[_0x3df85a(0x107)](_0x3df85a(0x100)+a5_0x1dc59b[_0x3df85a(0xf5)]('✓')+'\x20('+_0x235dc4+')');}});_0x5c0390[_0x312dd8(0xd4)](),_0xb15af9['push'](_0x3d7ac3);if(_0x3d7ac3[_0x312dd8(0x104)]==='PASS')console[_0x312dd8(0x107)](a5_0x1dc59b['green'](_0x312dd8(0x11d)+_0x3d7ac3[_0x312dd8(0xc3)])+a5_0x1dc59b[_0x312dd8(0x8c)]('\x20(new)'));else _0x3d7ac3['status']===_0x312dd8(0x87)?console[_0x312dd8(0x107)](a5_0x1dc59b[_0x312dd8(0xfb)](_0x312dd8(0xe8)+_0x3d7ac3[_0x312dd8(0xc3)])+a5_0x1dc59b[_0x312dd8(0x8c)]('\x20(new)')):console['log'](a5_0x1dc59b[_0x312dd8(0xfb)]('✗\x20ERROR:\x20'+_0x3d7ac3[_0x312dd8(0xc3)]));_0x3d7ac3[_0x312dd8(0x8b)]&&console[_0x312dd8(0x107)](a5_0x1dc59b[_0x312dd8(0x8c)](_0x312dd8(0x9b)+_0x3d7ac3[_0x312dd8(0x8b)]));}catch(_0x2c1541){_0x5c0390[_0x312dd8(0xd4)]();const _0x1f81b1=_0x2c1541 instanceof Error?_0x2c1541[_0x312dd8(0x113)]:String(_0x2c1541);console[_0x312dd8(0x107)](a5_0x1dc59b[_0x312dd8(0xfb)](_0x312dd8(0x9a)+_0x1f81b1)),_0xb15af9[_0x312dd8(0xac)]({'name':_0x2b5054[_0x312dd8(0xaf)],'status':'ERROR','reason':_0x1f81b1,'timestamp':new Date()[_0x312dd8(0xc1)](),'duration_ms':0x0});}}}console['log']();const _0xea9789=Date[_0x312dd8(0xb4)]()-_0x20f85e,_0x3b42d1=_0xb15af9['filter'](_0x2a40a0=>_0x2a40a0[_0x312dd8(0x104)]===_0x312dd8(0xc2))[_0x312dd8(0xb6)],_0x5471dd=_0xb15af9[_0x312dd8(0xe9)](_0x2c9fef=>_0x2c9fef[_0x312dd8(0x104)]===_0x312dd8(0x87))[_0x312dd8(0xb6)],_0x217919=_0xb15af9['filter'](_0xd7f2b9=>_0xd7f2b9[_0x312dd8(0x104)]===_0x312dd8(0x8a))[_0x312dd8(0xb6)];console[_0x312dd8(0x107)]('━'[_0x312dd8(0xcb)](0x3c)),console[_0x312dd8(0x107)]('Re-evaluation\x20Summary'),console['log']('━'[_0x312dd8(0xcb)](0x3c)),console['log'](_0x312dd8(0x90)+_0xb15af9[_0x312dd8(0xb6)]),console[_0x312dd8(0x107)]('Passed:\x20\x20\x20'+a5_0x1dc59b[_0x312dd8(0xf5)](_0x3b42d1)),console[_0x312dd8(0x107)](_0x312dd8(0x97)+a5_0x1dc59b[_0x312dd8(0xfb)](_0x5471dd));_0x217919>0x0&&console[_0x312dd8(0x107)](_0x312dd8(0x10c)+a5_0x1dc59b['red'](_0x217919));console[_0x312dd8(0x107)](_0x312dd8(0x9d)+formatElapsed(_0xea9789)),console['log']('━'['repeat'](0x3c));const _0x18c6ac={'summary':{'total':_0xb15af9[_0x312dd8(0xb6)],'passed':_0x3b42d1,'failed':_0x5471dd,'errors':_0x217919>0x0?_0x217919:undefined,'duration_ms':_0xea9789},'tests':_0xb15af9,'agent':{'project':_0x378198[_0x312dd8(0xfd)],'name':_0x378198['agentName'],'site':_0x5481cd},'timestamp':new Date(_0x20f85e)[_0x312dd8(0xc1)]()};if(_0x3bab79!==_0x312dd8(0xe3)||_0x5303be){const _0x4b92b5=formatResults(_0x18c6ac,_0x3bab79);if(_0x5303be)try{a5_0x228e74['writeFileSync'](_0x5303be,_0x4b92b5,_0x312dd8(0xef)),console[_0x312dd8(0x107)](),console['log'](a5_0x1dc59b['dim']('Output\x20written\x20to:\x20'+_0x5303be));}catch(_0x4f660d){return console[_0x312dd8(0x107)](),console[_0x312dd8(0x107)](a5_0x1dc59b['red'](_0x312dd8(0x88)+_0x4f660d)),0x1;}else console['log'](),console['log'](_0x4b92b5);}const _0x1f1b77=_0xb15af9[_0x312dd8(0xe9)](_0x15f846=>_0x15f846[_0x312dd8(0x104)]!=='PASS');return _0x1f1b77['length']>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x33b7c9=a6_0x56f4;(function(_0x271e91,_0x47b510){const _0x501f5c=a6_0x56f4,_0x89511f=_0x271e91();while(!![]){try{const _0x5b4fc3=-parseInt(_0x501f5c(0xb6))/0x1+-parseInt(_0x501f5c(0x9d))/0x2+parseInt(_0x501f5c(0xab))/0x3+-parseInt(_0x501f5c(0x80))/0x4*(-parseInt(_0x501f5c(0x8d))/0x5)+-parseInt(_0x501f5c(0x77))/0x6+-parseInt(_0x501f5c(0x9f))/0x7+parseInt(_0x501f5c(0xb4))/0x8*(parseInt(_0x501f5c(0x8b))/0x9);if(_0x5b4fc3===_0x47b510)break;else _0x89511f['push'](_0x89511f['shift']());}catch(_0x5da5c3){_0x89511f['push'](_0x89511f['shift']());}}}(a6_0x3899,0x9d4e1));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';function a6_0x3899(){const _0x31c8de=['execute','16irvQAG','x-auth-token','method','trim','Invalid\x20header\x20format:\x20\x22','Error:\x20','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','x-xsrf-token','join','log','includes','2157075qawYbm','has','1561670vFmlMZ','request','llm','PUT','cookie','file','workflow','entries','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','Invalid\x20HTTP\x20method:\x20','.\x20Valid\x20types:\x20','cdp','description','headers','x-trino-user','substring','1369002ZkMLcL','isArray','2759813HjYXpe','Results\x20saved\x20to\x20','set-cookie','.\x20Valid\x20methods:\x20','\x22.\x20','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','data','readBodyFromFile','type','header','noColor','POST','114966lgmacT','error','color','toUpperCase','length','GET','validate','status','trino','24qkTQtK','\x0aStack\x20trace:\x0a','213223qccXoJ','output','message','verbose','toLowerCase','stack','proxy-authorization','422274AWfluy','PATCH','set-cookie2','api','llm-proxy','indexOf','startsWith','Header\x20key\x20cannot\x20be\x20empty:\x20\x22'];a6_0x3899=function(){return _0x31c8de;};return a6_0x3899();}import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set(['authorization',a6_0x33b7c9(0x76),a6_0x33b7c9(0x91),a6_0x33b7c9(0xa1),a6_0x33b7c9(0x79),a6_0x33b7c9(0x87),a6_0x33b7c9(0x81),a6_0x33b7c9(0x9b)]);function a6_0x56f4(_0xc41d36,_0x5ef71a){_0xc41d36=_0xc41d36-0x75;const _0x389927=a6_0x3899();let _0x56f4a5=_0x389927[_0xc41d36];return _0x56f4a5;}function isSensitiveHeader(_0x23e0e6){const _0x37bcfd=a6_0x33b7c9;return SENSITIVE_HEADERS[_0x37bcfd(0x8c)](_0x23e0e6[_0x37bcfd(0xba)]());}function parseHeader(_0x16dc02){const _0x84392=a6_0x33b7c9,_0x54e853=_0x16dc02[_0x84392(0x7c)](':');if(_0x54e853===-0x1)throw new Error(_0x84392(0x84)+_0x16dc02+_0x84392(0xa3)+_0x84392(0xa4));const _0x582bf4=_0x16dc02[_0x84392(0x9c)](0x0,_0x54e853)[_0x84392(0x83)](),_0x1db205=_0x16dc02[_0x84392(0x9c)](_0x54e853+0x1)[_0x84392(0x83)]();if(!_0x582bf4)throw new Error(_0x84392(0x7e)+_0x16dc02+'\x22');return[_0x582bf4,_0x1db205];}export class ApiCommand extends BaseCommand{['name']='api';[a6_0x33b7c9(0x99)]='Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs';[a6_0x33b7c9(0xb1)](_0x1b048c){const _0x484503=a6_0x33b7c9,{args:_0x341fc4,options:_0x2f0e57}=_0x1b048c,_0x22090c=_0x2f0e57;if(_0x341fc4[_0x484503(0xaf)]===0x0)return _0x484503(0x95);const _0x795b43=_0x341fc4[0x0];if(!_0x795b43[_0x484503(0x7d)]('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0x795b43;const _0x205d64=_0x22090c[_0x484503(0xa5)],_0x4bc531=_0x22090c[_0x484503(0x92)];if(_0x205d64&&_0x4bc531)return _0x484503(0x86);const _0x5ebb1f=_0x22090c[_0x484503(0x82)]||_0x484503(0xb0),_0x5474fe=[_0x484503(0xb0),_0x484503(0xaa),_0x484503(0x90),'DELETE',_0x484503(0x78)];if(!_0x5474fe[_0x484503(0x8a)](_0x5ebb1f['toUpperCase']()))return _0x484503(0x96)+_0x5ebb1f+_0x484503(0xa2)+_0x5474fe['join'](',\x20');const _0x18c749=_0x22090c[_0x484503(0xa7)]||'td',_0x21418c=['td',_0x484503(0x98),_0x484503(0x93),_0x484503(0xb3),_0x484503(0x8f),_0x484503(0x7b)];if(!_0x21418c[_0x484503(0x8a)](_0x18c749))return'Invalid\x20API\x20type:\x20'+_0x18c749+_0x484503(0x97)+_0x21418c[_0x484503(0x88)](',\x20');return undefined;}async[a6_0x33b7c9(0x7f)](_0x6f886e){const _0x525733=a6_0x33b7c9,{options:_0x46d4a4,args:_0x2f80a5,tdx:_0x122693}=_0x6f886e,_0x341b90=_0x46d4a4,_0x5f518e=_0x2f80a5[0x0],_0x564342=(_0x341b90[_0x525733(0x82)]||_0x525733(0xb0))[_0x525733(0xae)](),_0x4a1f2b=_0x341b90[_0x525733(0xa5)],_0x4d03e2=_0x341b90['file'],_0x219df6=_0x341b90[_0x525733(0xa8)],_0x1070a0=_0x341b90['type']||'td';try{const _0x2ca344={};if(_0x219df6){const _0x11fd25=Array[_0x525733(0x9e)](_0x219df6)?_0x219df6:[_0x219df6];for(const _0x3afd1e of _0x11fd25){const [_0x19e600,_0x218afe]=parseHeader(_0x3afd1e);_0x2ca344[_0x19e600]=_0x218afe;}}let _0x3290e3;if(_0x4a1f2b)_0x3290e3=_0x4a1f2b;else{if(_0x4d03e2)try{_0x3290e3=RawAPI[_0x525733(0xa6)](_0x4d03e2);}catch(_0x755903){return console[_0x525733(0xac)](_0x525733(0x85)+(_0x755903 instanceof Error?_0x755903['message']:String(_0x755903))),0x1;}}const _0x48e189={'method':_0x564342,'apiType':_0x1070a0,'includeHeaders':_0x46d4a4['verbose']};_0x3290e3&&(_0x48e189['body']=_0x3290e3);Object['keys'](_0x2ca344)[_0x525733(0xaf)]>0x0&&(_0x48e189[_0x525733(0x9a)]=_0x2ca344);if(_0x46d4a4[_0x525733(0xb9)]){const _0x4d9251=resolveSite(_0x46d4a4['site']),_0x14bc59=getEndpoint(_0x4d9251,_0x1070a0),_0x2c3813=''+_0x14bc59+_0x5f518e;console['error']('>\x20'+_0x564342+'\x20'+_0x2c3813);const _0x437367=getAuthHeaders(_0x4d9251),_0x308791={..._0x437367,..._0x2ca344};for(const [_0x389383,_0x1aaec1]of Object[_0x525733(0x94)](_0x308791)){!isSensitiveHeader(_0x389383)&&console[_0x525733(0xac)]('>\x20'+_0x389383+':\x20'+_0x1aaec1);}_0x3290e3&&console[_0x525733(0xac)]('>'),console[_0x525733(0xac)]('');}const _0x3de3cb=await _0x122693[_0x525733(0x7a)][_0x525733(0x8e)](_0x5f518e,_0x48e189);if(_0x46d4a4[_0x525733(0xb9)]&&_0x3de3cb['headers']){console['error']('<\x20HTTP/1.1\x20'+_0x3de3cb[_0x525733(0xb2)]);for(const [_0x55b527,_0x1cfc41]of Object[_0x525733(0x94)](_0x3de3cb[_0x525733(0x9a)])){!isSensitiveHeader(_0x55b527)&&console[_0x525733(0xac)]('<\x20'+_0x55b527+':\x20'+_0x1cfc41);}console['error']('');}const _0x2025f8=Boolean(_0x46d4a4[_0x525733(0xb7)]),_0x33b640={'color':_0x46d4a4[_0x525733(0xad)],'noColor':_0x46d4a4[_0x525733(0xa9)]||_0x2025f8&&!_0x46d4a4[_0x525733(0xad)]},_0x100500=colorizeJSON(_0x3de3cb[_0x525733(0xa5)],_0x33b640);return _0x46d4a4[_0x525733(0xb7)]?(writeFileSync(_0x46d4a4[_0x525733(0xb7)],_0x100500),console['error'](_0x525733(0xa0)+_0x46d4a4[_0x525733(0xb7)])):console[_0x525733(0x89)](_0x100500),0x0;}catch(_0x100c4b){return _0x100c4b instanceof Error?(console[_0x525733(0xac)](_0x525733(0x85)+_0x100c4b[_0x525733(0xb8)]),_0x46d4a4[_0x525733(0xb9)]&&_0x100c4b[_0x525733(0x75)]&&console[_0x525733(0xac)](_0x525733(0xb5)+_0x100c4b['stack'])):console[_0x525733(0xac)](_0x525733(0x85)+String(_0x100c4b)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a7_0x2e483e=a7_0x3d49;(function(_0x4af5f9,_0x113f02){const _0x1e024c=a7_0x3d49,_0x1fc424=_0x4af5f9();while(!![]){try{const _0x211431=-parseInt(_0x1e024c(0x1be))/0x1*(parseInt(_0x1e024c(0x1a8))/0x2)+-parseInt(_0x1e024c(0x197))/0x3+-parseInt(_0x1e024c(0x1c7))/0x4+parseInt(_0x1e024c(0x1b1))/0x5+-parseInt(_0x1e024c(0x1a6))/0x6+-parseInt(_0x1e024c(0x183))/0x7*(parseInt(_0x1e024c(0x198))/0x8)+parseInt(_0x1e024c(0x1c1))/0x9;if(_0x211431===_0x113f02)break;else _0x1fc424['push'](_0x1fc424['shift']());}catch(_0x72d045){_0x1fc424['push'](_0x1fc424['shift']());}}}(a7_0x368a,0x451b9));import{BaseCommand,printAuthError}from'./command.js';function a7_0x3d49(_0x46cafb,_0x4ef423){_0x46cafb=_0x46cafb-0x183;const _0x368af5=a7_0x368a();let _0x3d49bf=_0x368af5[_0x46cafb];return _0x3d49bf;}import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{buildSiteChoices}from'../core/constants.js';import a7_0x53353b from'prompts';function a7_0x368a(){const _0x1157d2=['site','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','\x20--profile\x20','execute','logLevel','description','1499334nPXKsm','16MOQlJv','auth:setup','✓\x20API\x20key\x20removed\x20from\x20keychain','tdx:\x20auth\x20clear','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','Setup\x20API\x20key\x20authentication\x20interactively','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','API\x20key\x20cannot\x20be\x20empty','Read\x20credential\x20from\x20','other','name','customSite','492150rnwTHY','yellow','40GyTqcg','No\x20credential\x20found','tdx\x20profile:\x20','red','Name:\x20','us01','System\x20keychain\x20is\x20not\x20available','jobs','filter','1666410eWVBpw','create','error','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','auth:clear','You\x20can\x20find\x20your\x20API\x20key\x20at:','auth','apiKey','✓\x20Profile\x20\x27','Enter\x20site\x20name:','tdx:\x20auth\x20setup','\x20(profile:\x20','text','11131NCCoEy','trim','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','15292863NTcApg','log','Remove\x20API\x20key\x20from\x20system\x20keychain','✓\x20Authentication\x20successful\x0a','✗\x20Validation\x20failed:\x20','Setting\x20up\x20authentication\x20for\x20site:\x20','1671540nVbgUP','ERROR','/app/mp/ak','warn','profile','green','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','1844906NsMvpJ','\x0aSetup\x20cancelled','bold','getUserInfo','Site\x20name\x20cannot\x20be\x20empty','User:\x20','last_name','password','Select\x20your\x20Treasure\x20Data\x20site:','first_name','email','message','Validating\x20API\x20key...','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'];a7_0x368a=function(){return _0x1157d2;};return a7_0x368a();}import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a7_0x3ac5c3 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x2e483e(0x1a4)]=a7_0x2e483e(0x199);[a7_0x2e483e(0x196)]=a7_0x2e483e(0x19f);async['execute'](_0x27bfe9){const _0x189434=a7_0x2e483e,{options:_0x3dadd4}=_0x27bfe9,_0x47e05c=_0x3dadd4[_0x189434(0x1cb)];console[_0x189434(0x1c2)](a7_0x3ac5c3[_0x189434(0x185)](_0x189434(0x1bb)));const _0x3587ee=_0x3dadd4['site']||_0x189434(0x1ad),{choices:_0x147db0,initialIndex:_0x3247c3}=buildSiteChoices(_0x3587ee),_0x1806e8=_0x47e05c?'Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20'+_0x47e05c+'):':_0x189434(0x18b),_0x553169=await a7_0x53353b({'type':'select','name':'site','message':_0x1806e8,'choices':_0x147db0,'initial':_0x3247c3});if(!_0x553169[_0x189434(0x191)])return console[_0x189434(0x1c2)](_0x189434(0x184)),0x1;let _0x1c0372;if(_0x553169[_0x189434(0x191)]===_0x189434(0x1a3)){const _0x16ac18=await a7_0x53353b({'type':_0x189434(0x1bd),'name':_0x189434(0x1a5),'message':_0x189434(0x1ba),'initial':'us01','validate':_0x1dc3e2=>{const _0x280e93=_0x189434;if(!_0x1dc3e2||!_0x1dc3e2[_0x280e93(0x1bf)]())return _0x280e93(0x187);if(!/^[a-z0-9-]+$/['test'](_0x1dc3e2[_0x280e93(0x1bf)]()))return _0x280e93(0x1cd);return!![];}});if(!_0x16ac18[_0x189434(0x1a5)])return console[_0x189434(0x1c2)]('\x0aSetup\x20cancelled'),0x1;_0x1c0372=_0x16ac18[_0x189434(0x1a5)];}else _0x1c0372=_0x553169[_0x189434(0x191)];const _0x2e8b98=resolveSite(_0x1c0372);console['log'](_0x189434(0x1c6)+_0x2e8b98),console[_0x189434(0x1c2)](_0x189434(0x1b6)),console[_0x189434(0x1c2)]('\x20\x20'+getConsoleUrl(_0x2e8b98,_0x189434(0x1c9)));const _0xb65d=await a7_0x53353b({'type':_0x189434(0x18a),'name':'apiKey','message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x502231=>{const _0x426d2b=_0x189434;if(!_0x502231||!_0x502231[_0x426d2b(0x1bf)]())return _0x426d2b(0x1a1);return!![];}});if(!_0xb65d[_0x189434(0x1b8)])return console[_0x189434(0x1c2)]('\x0aSetup\x20cancelled'),0x1;const _0x4839fe=_0xb65d[_0x189434(0x1b8)];console['log'](_0x189434(0x18f));try{const _0x7a5697=TDX[_0x189434(0x1b2)]({'site':_0x2e8b98,'apiKey':_0x4839fe[_0x189434(0x1bf)](),'logLevel':_0x3dadd4[_0x189434(0x195)]??LogLevel[_0x189434(0x1c8)]}),_0x19a2ec=await _0x7a5697[_0x189434(0x1af)][_0x189434(0x186)]();console[_0x189434(0x1c2)](_0x189434(0x192)+_0x19a2ec[_0x189434(0x18d)]+')');const _0x54a8bd=await isKeychainAvailable();_0x54a8bd?(await saveAPIKeyAsync(_0x4839fe[_0x189434(0x1bf)](),_0x2e8b98,_0x47e05c),console['log'](_0x189434(0x1a0)+(_0x47e05c?_0x189434(0x1bc)+_0x47e05c+')':''))):(console[_0x189434(0x1ca)](a7_0x3ac5c3[_0x189434(0x1a7)](_0x189434(0x19e))),console[_0x189434(0x1ca)](a7_0x3ac5c3[_0x189434(0x1a7)](_0x189434(0x19d))));if(_0x47e05c){const _0x4892aa={'site':_0x2e8b98};saveProfileToUserConfig(_0x47e05c,_0x4892aa),console[_0x189434(0x1c2)](_0x189434(0x1b9)+_0x47e05c+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x2e8b98),console['log']('✓\x20Default\x20site\x20set\x20to\x20'+_0x2e8b98);const _0x1c7182=_0x47e05c?_0x189434(0x193)+_0x47e05c:'';return console[_0x189434(0x1c2)](),console[_0x189434(0x1c2)](_0x189434(0x190)),console[_0x189434(0x1c2)]('\x20\x20tdx'+_0x1c7182+_0x189434(0x1b4)),console[_0x189434(0x1c2)]('\x20\x20tdx'+_0x1c7182+_0x189434(0x1ce)),0x0;}catch(_0x1313f7){if(_0x1313f7 instanceof HTTPClientError&&_0x1313f7['status']===0x191)return printAuthError(_0x1313f7),0x1;return console[_0x189434(0x1b3)](a7_0x3ac5c3[_0x189434(0x1ab)](_0x189434(0x1c5)+(_0x1313f7 instanceof Error?_0x1313f7['message']:String(_0x1313f7)))),console[_0x189434(0x1b3)](_0x189434(0x19c)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x2e483e(0x1a4)]=a7_0x2e483e(0x1b7);[a7_0x2e483e(0x196)]=a7_0x2e483e(0x1c0);async[a7_0x2e483e(0x194)](_0x44a335){const _0x56e1e9=a7_0x2e483e,{options:_0x4284d1,tdx:_0x2c68dd}=_0x44a335,_0x2db7af=_0x4284d1[_0x56e1e9(0x191)],_0x1142b4=_0x4284d1[_0x56e1e9(0x1cb)],_0x30e1a0=_0x1142b4?_0x1142b4:'N/A';console['log'](_0x56e1e9(0x1aa)+_0x30e1a0+'\x20(site:\x20'+_0x2db7af+')');const _0x8d88ce=await resolveAPIKeyAsync(_0x2db7af,_0x1142b4);if(_0x8d88ce){const {source:_0x27a65c,isDeprecated:_0x1d0da7}=_0x8d88ce,_0xed0803=_0x56e1e9(0x1a2)+_0x27a65c;console[_0x56e1e9(0x1c2)](_0x1d0da7?a7_0x3ac5c3['yellow'](_0xed0803):_0xed0803);}else console['log'](a7_0x3ac5c3[_0x56e1e9(0x1a7)](_0x56e1e9(0x1a9)));try{const _0x271b81=await _0x2c68dd[_0x56e1e9(0x1af)][_0x56e1e9(0x186)]();return console[_0x56e1e9(0x1c2)](a7_0x3ac5c3[_0x56e1e9(0x1cc)](_0x56e1e9(0x1c4))),console[_0x56e1e9(0x1c2)](_0x56e1e9(0x188)+_0x271b81['email']),(_0x271b81[_0x56e1e9(0x18c)]||_0x271b81[_0x56e1e9(0x189)])&&console[_0x56e1e9(0x1c2)](_0x56e1e9(0x1ac)+[_0x271b81[_0x56e1e9(0x18c)],_0x271b81[_0x56e1e9(0x189)]][_0x56e1e9(0x1b0)](Boolean)['join']('\x20')),0x0;}catch(_0x42a1dd){return _0x42a1dd instanceof HTTPClientError&&_0x42a1dd['status']===0x191?printAuthError(_0x42a1dd,!![],_0x1142b4):console[_0x56e1e9(0x1b3)](a7_0x3ac5c3[_0x56e1e9(0x1ab)](_0x56e1e9(0x1c5)+(_0x42a1dd instanceof Error?_0x42a1dd[_0x56e1e9(0x18e)]:String(_0x42a1dd)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x2e483e(0x1a4)]=a7_0x2e483e(0x1b5);[a7_0x2e483e(0x196)]=a7_0x2e483e(0x1c3);async['execute'](_0x54e4c2){const _0x276a47=a7_0x2e483e,{options:_0x4dc839}=_0x54e4c2,_0x318202=_0x4dc839['profile'];console[_0x276a47(0x1c2)](a7_0x3ac5c3['bold'](_0x276a47(0x19b)));const _0x10e246=await isKeychainAvailable();if(!_0x10e246)return console['error'](a7_0x3ac5c3[_0x276a47(0x1ab)](_0x276a47(0x1ae))),0x1;const _0x570898=await deleteKeychainAPIKey(_0x318202);return _0x570898?(clearCredentialCache(),console[_0x276a47(0x1c2)](_0x276a47(0x19a)+(_0x318202?'\x20(profile:\x20'+_0x318202+')':'')),0x0):(console[_0x276a47(0x1c2)]('No\x20API\x20key\x20found\x20in\x20keychain'+(_0x318202?'\x20for\x20profile:\x20'+_0x318202:'')),0x1);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a8_0x5a85ea=a8_0x3abd;(function(_0x3872b5,_0x28d547){const _0x2c07ce=a8_0x3abd,_0x22e275=_0x3872b5();while(!![]){try{const _0x5bb4d9=parseInt(_0x2c07ce(0x1cb))/0x1*(-parseInt(_0x2c07ce(0x1bf))/0x2)+-parseInt(_0x2c07ce(0x1b1))/0x3+parseInt(_0x2c07ce(0x1ad))/0x4+parseInt(_0x2c07ce(0x1cf))/0x5*(-parseInt(_0x2c07ce(0x1c7))/0x6)+-parseInt(_0x2c07ce(0x1c9))/0x7*(parseInt(_0x2c07ce(0x1a3))/0x8)+-parseInt(_0x2c07ce(0x1b2))/0x9*(-parseInt(_0x2c07ce(0x1a2))/0xa)+-parseInt(_0x2c07ce(0x1d1))/0xb*(-parseInt(_0x2c07ce(0x1c3))/0xc);if(_0x5bb4d9===_0x28d547)break;else _0x22e275['push'](_0x22e275['shift']());}catch(_0x5ef677){_0x22e275['push'](_0x22e275['shift']());}}}(a8_0x27f8,0x86fb7));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 a8_0x3abd(_0x55fc40,_0x587816){_0x55fc40=_0x55fc40-0x190;const _0x27f868=a8_0x27f8();let _0x3abd74=_0x27f868[_0x55fc40];return _0x3abd74;}function a8_0x27f8(){const _0x381d1b=['targetWebSearchTool','1108368MFwXrV','1071153wkJjFm','done','write','description','string','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','chat-create','code','options','Using\x20cached\x20default\x20agent:\x20','name','Resolving\x20project\x20\x27','cause','9314jeAwCU','stdout','chat','data','12VTQmPM','includes','join','verbose','486xXxSDq','--agent\x20flag','49FWFbEL','Error:\x20Chat\x20session\x20\x27','111MBVcJZ','event','startChat','Error:\x20','44095tTExeb','chatId','19162594kDMiJy','streamChat','targetFunction','validate','Create\x20a\x20new\x20chat\x20session','execute','Chat\x20session:\x20','\x0aStack\x20trace:','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','site','projectId','metadata','CHAT_NOT_FOUND','message','getOrCreateDefaultAgent','slice','\x27\x20not\x20found','log','agentId','llmProject','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','tool_result','llmAgent','\x0aError:\x20','agent','tool_call','Using\x20agent\x20from\x20','streamChatJsonl','handleChatEvent','error','type','20UUtlUs','501848yduLmI','content','claude-4.5-haiku','stack','stringify','Resolving\x20agent\x20\x27','\x27...','resolveProjectId','tool','targetKnowledgeBase','2450552DSgjjr','llm','functionName'];a8_0x27f8=function(){return _0x381d1b;};return a8_0x27f8();}function handleSDKError(_0x54f4c7,_0xbc6792){const _0x443755=a8_0x3abd;if(_0x54f4c7 instanceof SDKError)console[_0x443755(0x1a0)](_0x443755(0x1ce)+_0x54f4c7['message']),_0xbc6792[_0x443755(0x1c6)]&&(_0x54f4c7[_0x443755(0x1be)]&&console[_0x443755(0x1a0)]('\x20\x20Cause:\x20'+_0x54f4c7[_0x443755(0x1be)]),_0x54f4c7[_0x443755(0x1a6)]&&(console[_0x443755(0x1a0)](_0x443755(0x1d8)),console['error'](_0x54f4c7['stack'])));else throw _0x54f4c7;}async function resolveAgentId(_0x2ab248,_0xf64e0c,_0x14f6df,_0x4d2952,_0x5b54fd){const _0x50934a=a8_0x3abd,_0x4525d0=_0xf64e0c||_0x14f6df;if(_0x4525d0){const {projectName:_0x44766a,agentName:_0x2c0733}=parseAgentRef(_0x4525d0),_0x2b8daa=_0x2c0733||_0x4525d0,_0x41a2fa=_0x2c0733?_0x44766a:_0x4d2952;if(!_0x41a2fa)throw new Error('No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22');if(_0x5b54fd){const _0x24328f=_0xf64e0c?_0x50934a(0x1c8):'session\x20context';console['error'](_0x50934a(0x19d)+_0x24328f+':\x20'+_0x41a2fa+'/'+_0x2b8daa);}const _0x943462=await withSpinner(_0x50934a(0x1bd)+_0x41a2fa+_0x50934a(0x1a9),()=>_0x2ab248[_0x50934a(0x1ae)][_0x50934a(0x1aa)](_0x41a2fa),{'verbose':_0x5b54fd}),_0x434e87=await withSpinner(_0x50934a(0x1a8)+_0x2b8daa+_0x50934a(0x1a9),()=>_0x2ab248[_0x50934a(0x1ae)]['resolveAgentId'](_0x2b8daa,_0x943462['data']),{'verbose':_0x5b54fd});return _0x434e87[_0x50934a(0x1c2)];}else{const _0x350489=_0x2ab248['llm']['getDefaultAgent']();if(_0x350489)return _0x5b54fd&&console['error'](_0x50934a(0x1bb)+_0x350489[_0x50934a(0x1bc)]),_0x350489['id'];const _0x1dfc18=await withSpinner('Getting\x20default\x20agent...',()=>_0x2ab248[_0x50934a(0x1ae)][_0x50934a(0x191)](_0x50934a(0x1a5),0x0),{'verbose':_0x5b54fd});return _0x1dfc18['data']['id'];}}export class ChatCommand extends BaseCommand{['name']=a8_0x5a85ea(0x1c1);[a8_0x5a85ea(0x1b5)]='Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)';['validate'](_0x4f83b7){const _0x137eaa=a8_0x5a85ea,_0x37cf0a=_0x4f83b7['args'][_0x137eaa(0x1c5)]('\x20');if(!_0x37cf0a)return'Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options';return undefined;}async[a8_0x5a85ea(0x1d2)](_0x2e7edc,_0x2443a7,_0x53eca7,_0x58a158,_0x4dd312){const _0x3d35bc=a8_0x5a85ea;for await(const _0x5f03c of _0x2e7edc[_0x3d35bc(0x1ae)][_0x3d35bc(0x1c1)](_0x2443a7,{'agentId':_0x53eca7,'chatId':_0x58a158})){if(_0x5f03c[_0x3d35bc(0x1a1)]===_0x3d35bc(0x1dc)){const _0x3284a3=_0x5f03c[_0x3d35bc(0x1c2)][_0x3d35bc(0x1d0)];saveLastChatId(_0x3284a3),_0x4dd312&&console[_0x3d35bc(0x1a0)](_0x3d35bc(0x1d7)+_0x3284a3);}else _0x5f03c[_0x3d35bc(0x1a1)]===_0x3d35bc(0x1cc)&&this[_0x3d35bc(0x19f)](_0x5f03c['data']);}}async[a8_0x5a85ea(0x19e)](_0x5079f0,_0x24380e,_0x4d0abc,_0x11d1ac){const _0x29ff13=a8_0x5a85ea,_0x5005f7=_0x5079f0['context'][_0x29ff13(0x1da)];let _0x1183c6=![];for await(const _0x65897 of _0x5079f0['llm'][_0x29ff13(0x1c1)](_0x24380e,{'agentId':_0x4d0abc,'chatId':_0x11d1ac})){if(_0x65897['type']===_0x29ff13(0x1dc)){const _0x52b8ec=_0x65897[_0x29ff13(0x1c2)];saveLastChatId(_0x52b8ec[_0x29ff13(0x1d0)]);const _0x30f470=_0x52b8ec[_0x29ff13(0x1db)]&&_0x52b8ec[_0x29ff13(0x195)]?getLLMConversationUrl(_0x5005f7,_0x52b8ec[_0x29ff13(0x1db)],_0x52b8ec['agentId'],_0x52b8ec[_0x29ff13(0x1d0)]):undefined;console[_0x29ff13(0x194)](JSON['stringify']({'type':'metadata','data':{'chatId':_0x52b8ec['chatId'],'agentId':_0x52b8ec[_0x29ff13(0x195)],'consoleUrl':_0x30f470}})),_0x1183c6=!![];}else{if(_0x65897['type']===_0x29ff13(0x1cc)){!_0x1183c6&&_0x11d1ac&&(console[_0x29ff13(0x194)](JSON['stringify']({'type':'metadata','data':{'chatId':_0x11d1ac}})),_0x1183c6=!![]);const _0x31fa0f=_0x65897[_0x29ff13(0x1c2)];if(_0x29ff13(0x1a4)in _0x31fa0f)console['log'](JSON[_0x29ff13(0x1a7)]({'type':'content','data':{'content':_0x31fa0f['content']}}));else{if(_0x29ff13(0x19c)in _0x31fa0f){const _0x2ca549=_0x31fa0f[_0x29ff13(0x19c)];console[_0x29ff13(0x194)](JSON[_0x29ff13(0x1a7)]({'type':'tool_call','data':{'id':_0x2ca549['id'],'name':_0x2ca549[_0x29ff13(0x1af)],'target':_0x2ca549[_0x29ff13(0x1ac)]?.['name']||_0x2ca549['targetAgent']?.[_0x29ff13(0x1bc)]||_0x2ca549[_0x29ff13(0x1b0)]?.[_0x29ff13(0x1bc)]||_0x2ca549[_0x29ff13(0x1d3)]}}));}else{if(_0x29ff13(0x1ab)in _0x31fa0f)console[_0x29ff13(0x194)](JSON[_0x29ff13(0x1a7)]({'type':_0x29ff13(0x198),'data':{'id':_0x31fa0f[_0x29ff13(0x1ab)]['id'],'name':_0x31fa0f['tool']['functionName'],'result':typeof _0x31fa0f[_0x29ff13(0x1ab)][_0x29ff13(0x1a4)]===_0x29ff13(0x1b6)?_0x31fa0f['tool'][_0x29ff13(0x1a4)][_0x29ff13(0x192)](0x0,0x1f4):''}}));else'error'in _0x31fa0f&&console['log'](JSON[_0x29ff13(0x1a7)]({'type':_0x29ff13(0x1a0),'data':{'error':_0x31fa0f[_0x29ff13(0x1a0)]}}));}}}}}console[_0x29ff13(0x194)](JSON[_0x29ff13(0x1a7)]({'type':_0x29ff13(0x1b3)}));}async['execute'](_0x4884d5){const _0x397d42=a8_0x5a85ea,{options:_0x574155,args:_0x267264,tdx:_0x468368}=_0x4884d5,_0x467cf1=_0x267264['join']('\x20'),_0x51f6a7=_0x574155,_0x21c0e3=_0x51f6a7[_0x397d42(0x19b)],_0x1fc411=_0x51f6a7[_0x397d42(0x199)],_0x50217=_0x51f6a7[_0x397d42(0x196)],_0x4341b0=_0x51f6a7['new'],_0x805c7a=_0x51f6a7[_0x397d42(0x1d0)],_0x56a5c1=_0x51f6a7['stream'];if(_0x4341b0&&_0x805c7a)return console['error'](_0x397d42(0x1d9)),0x1;try{let _0x8c371,_0x2979c0;if(_0x805c7a)_0x2979c0=_0x805c7a;else!_0x4341b0&&(_0x2979c0=loadLastChatId(),_0x2979c0&&_0x574155[_0x397d42(0x1c6)]&&console['error']('Continuing\x20chat:\x20'+_0x2979c0));!_0x805c7a&&(_0x4341b0||!_0x2979c0)&&(_0x8c371=await resolveAgentId(_0x468368,_0x21c0e3,_0x1fc411,_0x50217,_0x574155['verbose']));const _0x1e1543=_0x56a5c1?(_0x228391,_0x276272,_0x1dae6c)=>this[_0x397d42(0x19e)](_0x468368,_0x228391,_0x276272,_0x1dae6c):(_0x13f02f,_0x11bdbc,_0x4a6864)=>this[_0x397d42(0x1d2)](_0x468368,_0x13f02f,_0x11bdbc,_0x4a6864,_0x574155[_0x397d42(0x1c6)]);try{await _0x1e1543(_0x467cf1,_0x8c371,_0x2979c0);}catch(_0x1ad55d){const _0x273a2a=_0x1ad55d instanceof SDKError&&_0x1ad55d[_0x397d42(0x1b9)]===ErrorCode[_0x397d42(0x1dd)]||_0x1ad55d instanceof Error&&_0x1ad55d[_0x397d42(0x190)][_0x397d42(0x1c4)]('404');if(_0x273a2a&&_0x805c7a)return console[_0x397d42(0x1a0)](_0x397d42(0x1ca)+_0x805c7a+_0x397d42(0x193)),0x1;if(_0x273a2a)_0x574155['verbose']&&console[_0x397d42(0x1a0)](_0x397d42(0x197)),!_0x8c371&&(_0x8c371=await resolveAgentId(_0x468368,_0x21c0e3,_0x1fc411,_0x50217,_0x574155['verbose'])),await _0x1e1543(_0x467cf1,_0x8c371,undefined);else throw _0x1ad55d;}return!_0x56a5c1&&console[_0x397d42(0x194)](),0x0;}catch(_0x55aa1f){return console[_0x397d42(0x1a0)](),handleSDKError(_0x55aa1f,_0x574155),0x1;}}[a8_0x5a85ea(0x19f)](_0x774db1){const _0x243e13=a8_0x5a85ea;if(_0x243e13(0x1a4)in _0x774db1)process[_0x243e13(0x1c0)][_0x243e13(0x1b4)](_0x774db1[_0x243e13(0x1a4)]);else _0x243e13(0x1a0)in _0x774db1&&console['error'](_0x243e13(0x19a)+_0x774db1[_0x243e13(0x1a0)]);}}export class ChatCreateCommand extends BaseCommand{[a8_0x5a85ea(0x1bc)]=a8_0x5a85ea(0x1b8);[a8_0x5a85ea(0x1b5)]=a8_0x5a85ea(0x1d5);[a8_0x5a85ea(0x1d4)](_0xf6bf34){const _0x43fb0d=a8_0x5a85ea,_0x1cbdcb=_0xf6bf34[_0x43fb0d(0x1ba)],_0x5ae3b3=_0x1cbdcb[_0x43fb0d(0x19b)],_0x5c8c23=_0x1cbdcb[_0x43fb0d(0x199)];if(!_0x5ae3b3&&!_0x5c8c23)return _0x43fb0d(0x1b7);return undefined;}async[a8_0x5a85ea(0x1d6)](_0x4b33a2){const _0xfe5b72=a8_0x5a85ea,{options:_0x13113b,tdx:_0x853f8c}=_0x4b33a2,_0x59cc04=_0x13113b,_0x4fc9d9=_0x59cc04['agent'],_0x5461dd=_0x59cc04['llmAgent'],_0x17697d=_0x59cc04[_0xfe5b72(0x196)];try{const _0x543d0e=await resolveAgentId(_0x853f8c,_0x4fc9d9,_0x5461dd,_0x17697d,_0x13113b[_0xfe5b72(0x1c6)]),_0x56d29a=await _0x853f8c['llm'][_0xfe5b72(0x1cd)](_0x543d0e);return saveLastChatId(_0x56d29a['id']),console[_0xfe5b72(0x194)](JSON[_0xfe5b72(0x1a7)]({'chatId':_0x56d29a['id'],'agentId':_0x543d0e})),0x0;}catch(_0xd5152e){return handleSDKError(_0xd5152e,_0x13113b),0x1;}}}
|
|
1
|
+
const a8_0x4ba00c=a8_0x1c6b;(function(_0x26e361,_0x5c107c){const _0x368ecf=a8_0x1c6b,_0x3f02ae=_0x26e361();while(!![]){try{const _0x3935a9=-parseInt(_0x368ecf(0x1ed))/0x1*(parseInt(_0x368ecf(0x1eb))/0x2)+-parseInt(_0x368ecf(0x1c1))/0x3*(parseInt(_0x368ecf(0x1f1))/0x4)+parseInt(_0x368ecf(0x1d0))/0x5*(-parseInt(_0x368ecf(0x207))/0x6)+-parseInt(_0x368ecf(0x1c2))/0x7+-parseInt(_0x368ecf(0x1f2))/0x8+-parseInt(_0x368ecf(0x1c7))/0x9+parseInt(_0x368ecf(0x1cf))/0xa*(parseInt(_0x368ecf(0x1e2))/0xb);if(_0x3935a9===_0x5c107c)break;else _0x3f02ae['push'](_0x3f02ae['shift']());}catch(_0x2fc634){_0x3f02ae['push'](_0x3f02ae['shift']());}}}(a8_0xf0e2,0x450ea));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 a8_0xf0e2(){const _0x425d3a=['streamChatJsonl','\x27...','join','tool_call','log','2076hVpxYy','1196314IGaEkj','llmProject','\x20\x20Cause:\x20','Chat\x20session:\x20','type','602847KImkZj','agentId','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','Error:\x20Chat\x20session\x20\x27','llmAgent','done','404','chatId','290rNombO','15710jLwpND','\x0aError:\x20','functionName','handleChatEvent','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','Create\x20a\x20new\x20chat\x20session','targetAgent','streamChat','agent','llm','args','\x0aStack\x20trace:','execute','--agent\x20flag','Getting\x20default\x20agent...','site','stringify','Using\x20agent\x20from\x20','608476UPOkAv','context','startChat','code','Resolving\x20project\x20\x27','error','Resolving\x20agent\x20\x27','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','resolveAgentId','446pSqJfq','chat-create','734TTgzkr','content','message','data','2672CvKycI','1271944DTJXei','targetKnowledgeBase','validate','cause','stack','tool','metadata','new','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','description','verbose','CHAT_NOT_FOUND','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','targetFunction','name','write','projectId','Continuing\x20chat:\x20','Using\x20cached\x20default\x20agent:\x20','tool_result','options','570mXvQKn','getOrCreateDefaultAgent','chat','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','event'];a8_0xf0e2=function(){return _0x425d3a;};return a8_0xf0e2();}import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x522740,_0xf7fbdf){const _0xb4a03f=a8_0x1c6b;if(_0x522740 instanceof SDKError)console['error']('Error:\x20'+_0x522740['message']),_0xf7fbdf[_0xb4a03f(0x1fc)]&&(_0x522740[_0xb4a03f(0x1f5)]&&console['error'](_0xb4a03f(0x1c4)+_0x522740['cause']),_0x522740[_0xb4a03f(0x1f6)]&&(console[_0xb4a03f(0x1e7)](_0xb4a03f(0x1db)),console[_0xb4a03f(0x1e7)](_0x522740[_0xb4a03f(0x1f6)])));else throw _0x522740;}async function resolveAgentId(_0x1b0d32,_0x1f2ffc,_0x41282c,_0x1e1760,_0x4db397){const _0x5aa8c6=a8_0x1c6b,_0x5a71c2=_0x1f2ffc||_0x41282c;if(_0x5a71c2){const {projectName:_0xf96eec,agentName:_0x5a346d}=parseAgentRef(_0x5a71c2),_0x722564=_0x5a346d||_0x5a71c2,_0x24bcbb=_0x5a346d?_0xf96eec:_0x1e1760;if(!_0x24bcbb)throw new Error(_0x5aa8c6(0x1fe));if(_0x4db397){const _0x1fcc1d=_0x1f2ffc?_0x5aa8c6(0x1dd):'session\x20context';console[_0x5aa8c6(0x1e7)](_0x5aa8c6(0x1e1)+_0x1fcc1d+':\x20'+_0x24bcbb+'/'+_0x722564);}const _0x544905=await withSpinner(_0x5aa8c6(0x1e6)+_0x24bcbb+_0x5aa8c6(0x1bd),()=>_0x1b0d32[_0x5aa8c6(0x1d9)]['resolveProjectId'](_0x24bcbb),{'verbose':_0x4db397}),_0x3f2373=await withSpinner(_0x5aa8c6(0x1e8)+_0x722564+_0x5aa8c6(0x1bd),()=>_0x1b0d32[_0x5aa8c6(0x1d9)][_0x5aa8c6(0x1ea)](_0x722564,_0x544905[_0x5aa8c6(0x1f0)]),{'verbose':_0x4db397});return _0x3f2373[_0x5aa8c6(0x1f0)];}else{const _0x577714=_0x1b0d32['llm']['getDefaultAgent']();if(_0x577714)return _0x4db397&&console[_0x5aa8c6(0x1e7)](_0x5aa8c6(0x204)+_0x577714[_0x5aa8c6(0x200)]),_0x577714['id'];const _0xcf5ec=await withSpinner(_0x5aa8c6(0x1de),()=>_0x1b0d32[_0x5aa8c6(0x1d9)][_0x5aa8c6(0x208)]('claude-4.5-haiku',0x0),{'verbose':_0x4db397});return _0xcf5ec[_0x5aa8c6(0x1f0)]['id'];}}function a8_0x1c6b(_0x5ea5ee,_0x555c22){_0x5ea5ee=_0x5ea5ee-0x1bb;const _0xf0e2d9=a8_0xf0e2();let _0x1c6b9f=_0xf0e2d9[_0x5ea5ee];return _0x1c6b9f;}export class ChatCommand extends BaseCommand{[a8_0x4ba00c(0x200)]=a8_0x4ba00c(0x209);[a8_0x4ba00c(0x1fb)]=a8_0x4ba00c(0x1c9);[a8_0x4ba00c(0x1f4)](_0x5d8e68){const _0x21a3d0=a8_0x4ba00c,_0x55d0e2=_0x5d8e68[_0x21a3d0(0x1da)][_0x21a3d0(0x1be)]('\x20');if(!_0x55d0e2)return _0x21a3d0(0x1d4);return undefined;}async['streamChat'](_0x5a2d1d,_0x166049,_0x4a15b9,_0x13a614,_0x509a62){const _0x1bfba2=a8_0x4ba00c;for await(const _0x5dfe61 of _0x5a2d1d[_0x1bfba2(0x1d9)]['chat'](_0x166049,{'agentId':_0x4a15b9,'chatId':_0x13a614})){if(_0x5dfe61[_0x1bfba2(0x1c6)]===_0x1bfba2(0x1f8)){const _0x136840=_0x5dfe61[_0x1bfba2(0x1f0)]['chatId'];saveLastChatId(_0x136840),_0x509a62&&console[_0x1bfba2(0x1e7)](_0x1bfba2(0x1c5)+_0x136840);}else _0x5dfe61[_0x1bfba2(0x1c6)]===_0x1bfba2(0x1bb)&&this[_0x1bfba2(0x1d3)](_0x5dfe61[_0x1bfba2(0x1f0)]);}}async['streamChatJsonl'](_0x7bef53,_0x2210c2,_0x24db97,_0x561820){const _0x21acdd=a8_0x4ba00c,_0x1858af=_0x7bef53[_0x21acdd(0x1e3)][_0x21acdd(0x1df)];let _0x4bbdee=![];for await(const _0x1478b5 of _0x7bef53['llm'][_0x21acdd(0x209)](_0x2210c2,{'agentId':_0x24db97,'chatId':_0x561820})){if(_0x1478b5[_0x21acdd(0x1c6)]==='metadata'){const _0x19335f=_0x1478b5[_0x21acdd(0x1f0)];saveLastChatId(_0x19335f['chatId']);const _0xe4d27=_0x19335f[_0x21acdd(0x202)]&&_0x19335f['agentId']?getLLMConversationUrl(_0x1858af,_0x19335f[_0x21acdd(0x202)],_0x19335f[_0x21acdd(0x1c8)],_0x19335f[_0x21acdd(0x1ce)]):undefined;console[_0x21acdd(0x1c0)](JSON['stringify']({'type':_0x21acdd(0x1f8),'data':{'chatId':_0x19335f[_0x21acdd(0x1ce)],'agentId':_0x19335f[_0x21acdd(0x1c8)],'consoleUrl':_0xe4d27}})),_0x4bbdee=!![];}else{if(_0x1478b5[_0x21acdd(0x1c6)]==='event'){!_0x4bbdee&&_0x561820&&(console[_0x21acdd(0x1c0)](JSON[_0x21acdd(0x1e0)]({'type':_0x21acdd(0x1f8),'data':{'chatId':_0x561820}})),_0x4bbdee=!![]);const _0x856acf=_0x1478b5[_0x21acdd(0x1f0)];if(_0x21acdd(0x1ee)in _0x856acf)console[_0x21acdd(0x1c0)](JSON[_0x21acdd(0x1e0)]({'type':_0x21acdd(0x1ee),'data':{'content':_0x856acf[_0x21acdd(0x1ee)]}}));else{if(_0x21acdd(0x1bf)in _0x856acf){const _0x412435=_0x856acf['tool_call'];console[_0x21acdd(0x1c0)](JSON['stringify']({'type':'tool_call','data':{'id':_0x412435['id'],'name':_0x412435[_0x21acdd(0x1d2)],'target':_0x412435[_0x21acdd(0x1f3)]?.[_0x21acdd(0x200)]||_0x412435[_0x21acdd(0x1d6)]?.['name']||_0x412435['targetWebSearchTool']?.[_0x21acdd(0x200)]||_0x412435[_0x21acdd(0x1ff)]}}));}else{if(_0x21acdd(0x1f7)in _0x856acf)console[_0x21acdd(0x1c0)](JSON[_0x21acdd(0x1e0)]({'type':_0x21acdd(0x205),'data':{'id':_0x856acf[_0x21acdd(0x1f7)]['id'],'name':_0x856acf['tool'][_0x21acdd(0x1d2)],'result':typeof _0x856acf['tool'][_0x21acdd(0x1ee)]==='string'?_0x856acf[_0x21acdd(0x1f7)][_0x21acdd(0x1ee)]['slice'](0x0,0x1f4):''}}));else _0x21acdd(0x1e7)in _0x856acf&&console['log'](JSON[_0x21acdd(0x1e0)]({'type':_0x21acdd(0x1e7),'data':{'error':_0x856acf['error']}}));}}}}}console['log'](JSON[_0x21acdd(0x1e0)]({'type':_0x21acdd(0x1cc)}));}async[a8_0x4ba00c(0x1dc)](_0x595e86){const _0x39df27=a8_0x4ba00c,{options:_0x4230ee,args:_0x2aec92,tdx:_0x501f1e}=_0x595e86,_0x1f59c3=_0x2aec92[_0x39df27(0x1be)]('\x20'),_0x249ee1=_0x4230ee,_0x268a74=_0x249ee1['agent'],_0x21bc69=_0x249ee1[_0x39df27(0x1cb)],_0x4c4c95=_0x249ee1[_0x39df27(0x1c3)],_0x349f22=_0x249ee1[_0x39df27(0x1f9)],_0x216152=_0x249ee1[_0x39df27(0x1ce)],_0xc2eeeb=_0x249ee1['stream'];if(_0x349f22&&_0x216152)return console[_0x39df27(0x1e7)](_0x39df27(0x1e9)),0x1;try{let _0x299c01,_0x4f15b3;if(_0x216152)_0x4f15b3=_0x216152;else!_0x349f22&&(_0x4f15b3=loadLastChatId(),_0x4f15b3&&_0x4230ee[_0x39df27(0x1fc)]&&console[_0x39df27(0x1e7)](_0x39df27(0x203)+_0x4f15b3));!_0x216152&&(_0x349f22||!_0x4f15b3)&&(_0x299c01=await resolveAgentId(_0x501f1e,_0x268a74,_0x21bc69,_0x4c4c95,_0x4230ee[_0x39df27(0x1fc)]));const _0xe186fb=_0xc2eeeb?(_0x416f8d,_0x4be2dc,_0x50f179)=>this[_0x39df27(0x1bc)](_0x501f1e,_0x416f8d,_0x4be2dc,_0x50f179):(_0x25a294,_0x2cfc7a,_0x98d50b)=>this[_0x39df27(0x1d7)](_0x501f1e,_0x25a294,_0x2cfc7a,_0x98d50b,_0x4230ee[_0x39df27(0x1fc)]);try{await _0xe186fb(_0x1f59c3,_0x299c01,_0x4f15b3);}catch(_0x587f6d){const _0x117886=_0x587f6d instanceof SDKError&&_0x587f6d[_0x39df27(0x1e5)]===ErrorCode[_0x39df27(0x1fd)]||_0x587f6d instanceof Error&&_0x587f6d[_0x39df27(0x1ef)]['includes'](_0x39df27(0x1cd));if(_0x117886&&_0x216152)return console[_0x39df27(0x1e7)](_0x39df27(0x1ca)+_0x216152+'\x27\x20not\x20found'),0x1;if(_0x117886)_0x4230ee[_0x39df27(0x1fc)]&&console[_0x39df27(0x1e7)](_0x39df27(0x20a)),!_0x299c01&&(_0x299c01=await resolveAgentId(_0x501f1e,_0x268a74,_0x21bc69,_0x4c4c95,_0x4230ee[_0x39df27(0x1fc)])),await _0xe186fb(_0x1f59c3,_0x299c01,undefined);else throw _0x587f6d;}return!_0xc2eeeb&&console[_0x39df27(0x1c0)](),0x0;}catch(_0x223ae0){return console[_0x39df27(0x1e7)](),handleSDKError(_0x223ae0,_0x4230ee),0x1;}}['handleChatEvent'](_0x78f9aa){const _0x590df5=a8_0x4ba00c;if(_0x590df5(0x1ee)in _0x78f9aa)process['stdout'][_0x590df5(0x201)](_0x78f9aa[_0x590df5(0x1ee)]);else _0x590df5(0x1e7)in _0x78f9aa&&console[_0x590df5(0x1e7)](_0x590df5(0x1d1)+_0x78f9aa['error']);}}export class ChatCreateCommand extends BaseCommand{['name']=a8_0x4ba00c(0x1ec);[a8_0x4ba00c(0x1fb)]=a8_0x4ba00c(0x1d5);[a8_0x4ba00c(0x1f4)](_0x3bce1d){const _0x31c7ea=a8_0x4ba00c,_0x273264=_0x3bce1d[_0x31c7ea(0x206)],_0x1b7622=_0x273264['agent'],_0x37b96f=_0x273264[_0x31c7ea(0x1cb)];if(!_0x1b7622&&!_0x37b96f)return _0x31c7ea(0x1fa);return undefined;}async['execute'](_0x271398){const _0x5735de=a8_0x4ba00c,{options:_0x27f255,tdx:_0x5dddd8}=_0x271398,_0x3c3dcd=_0x27f255,_0x50c6f8=_0x3c3dcd[_0x5735de(0x1d8)],_0x3391d1=_0x3c3dcd[_0x5735de(0x1cb)],_0x83ec0b=_0x3c3dcd[_0x5735de(0x1c3)];try{const _0x13656f=await resolveAgentId(_0x5dddd8,_0x50c6f8,_0x3391d1,_0x83ec0b,_0x27f255[_0x5735de(0x1fc)]),_0x4e0a9c=await _0x5dddd8[_0x5735de(0x1d9)][_0x5735de(0x1e4)](_0x13656f);return saveLastChatId(_0x4e0a9c['id']),console[_0x5735de(0x1c0)](JSON[_0x5735de(0x1e0)]({'chatId':_0x4e0a9c['id'],'agentId':_0x13656f})),0x0;}catch(_0x285c37){return handleSDKError(_0x285c37,_0x27f255),0x1;}}}
|