@treasuredata/tdx 0.29.5 → 2026.3.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.d.ts.map +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/databases.js.map +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.d.ts +97 -1
- package/dist/commands/engage-command.d.ts.map +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-command.js.map +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.d.ts.map +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/job-command.js.map +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.d.ts.map +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/tables.js.map +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 +8 -5
- package/dist/core/auth.d.ts.map +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/auth.js.map +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.d.ts +38 -6
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/config.js.map +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.d.ts +1 -0
- package/dist/core/global-context.d.ts.map +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/global-context.js.map +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.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.d.ts +3 -3
- 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/api.js.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/delivery-api-client.js.map +1 -1
- package/dist/sdk/client/endpoints.d.ts +16 -0
- package/dist/sdk/client/endpoints.d.ts.map +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/endpoints.js.map +1 -1
- package/dist/sdk/client/engage-api-client.d.ts +47 -1
- package/dist/sdk/client/engage-api-client.d.ts.map +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/engage-api-client.js.map +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/llm-api-client.js.map +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/td-api-client.js.map +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js.map +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/client/workflow-client.js.map +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.d.ts +95 -4
- package/dist/sdk/engage.d.ts.map +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/engage.js.map +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.d.ts +10 -0
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.d.ts +2 -0
- package/dist/sdk/journey.d.ts.map +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/journey.js.map +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/personalization.js.map +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/realtime.js.map +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js.map +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/engage.d.ts +119 -0
- package/dist/sdk/types/engage.d.ts.map +1 -1
- package/dist/sdk/types/index.d.ts +1 -1
- 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.d.ts +1 -0
- package/dist/sdk/util/index.d.ts.map +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/index.js.map +1 -1
- package/dist/sdk/util/paginate.d.ts +18 -0
- package/dist/sdk/util/paginate.d.ts.map +1 -0
- package/dist/sdk/util/paginate.js +1 -0
- package/dist/sdk/util/paginate.js.map +1 -0
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.d.ts.map +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/index.js.map +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x107374=a4_0x4978;(function(_0x420ab9,_0x506fda){const _0x3a4948=a4_0x4978,_0x14d4e1=_0x420ab9();while(!![]){try{const _0xfde2d2=parseInt(_0x3a4948(0x20e))/0x1+parseInt(_0x3a4948(0x24f))/0x2*(parseInt(_0x3a4948(0x1fa))/0x3)+parseInt(_0x3a4948(0x28d))/0x4+parseInt(_0x3a4948(0x227))/0x5*(parseInt(_0x3a4948(0x208))/0x6)+-parseInt(_0x3a4948(0x21b))/0x7+parseInt(_0x3a4948(0x22d))/0x8*(parseInt(_0x3a4948(0x261))/0x9)+-parseInt(_0x3a4948(0x243))/0xa*(parseInt(_0x3a4948(0x1e4))/0xb);if(_0xfde2d2===_0x506fda)break;else _0x14d4e1['push'](_0x14d4e1['shift']());}catch(_0x13eeae){_0x14d4e1['push'](_0x14d4e1['shift']());}}}(a4_0x3576,0x388af));import a4_0x3092f2 from'chalk';import a4_0x53f33f from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a4_0x3576(){const _0x41e15a=['\x0aPull\x20summary\x20for\x20\x27','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','no_local_folder','Output:\x20','7551uiPiis','\x0aChanges\x20to\x20prompt\x20\x27','pullProject','llmProject','\x20successfully','parse','projectName','\x20\x20tdx\x20agent\x20clone\x20agents/','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','Summary:','INVALID_ARGUMENT','agentName','pushAgent','\x20\x20Source:\x20','prompts','projectDir','cloneProject','output','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','\x20=\x20','\x0aError:','\x0aWrite\x20','source','\x20\x20Experimental\x20Artifact\x20\x22','Using\x20project:\x20','name','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','error','\x0aChanges\x20to\x20integration\x20\x27','knowledgeBases','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x20\x20Text\x20Knowledge\x20Bases:\x20','<new-name>','Dry\x20run\x20-\x20no\x20files\x20written','reason','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Chat:\x20','push','gray','projectId','Pushing\x20to\x20project...','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x22\x20to\x20a\x20different\x20profile','\x20errors','1581728DYliRl','agent.yml','found','\x0aPush\x20','agent','action','\x20created','\x0aProject\x20pushed\x20with\x20errors','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','join','\x20|\x20','\x20\x20Integration\x20\x22','\x20\x20Experimental\x20Artifacts:\x20','log','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','agents','Would\x20pull\x20agent:\x20','description','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)','session','Using\x20project\x20from\x20context:\x20','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','1166njDrVy','\x0aErrors\x20found:','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','llm_project','\x20updated','-\x20nothing\x20pushed','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','Cloning\x20\x22','outputPath','Project\x20cloned\x20with\x20errors','\x20--profile\x20','errors','\x0aChanges\x20to\x20agent\x20\x27','\x20--name\x20','No\x20tdx.json\x20found\x20in\x20','sourceProjectName','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','profile','isNew','\x0a✔\x20Pushed\x20','Cancelled','integrations','42XkwtPC','agent:pull','-\x20no\x20files\x20written','agent:push','new','experimentalArtifacts','Agent\x20pulled\x20successfully','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','experimentalKnowledgeBases','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x20\x20Prompt\x20\x22','\x0aPush\x20summary\x20for\x20\x27','\x20\x20Integrations:\x20','created','1432986qprrZf','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','total','\x20\x20Knowledge\x20Base\x20\x22','Pushing\x20agent\x20from\x20\x22','pushProject','300412aqovfe','cwd-config','utf-8','yes','\x20new','force','✔\x20Context\x20set:\x20','\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','agentId','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','cwd','execute','Using\x20local\x20project:\x20','1591625gzyVDt','\x20files\x20to\x20','yellow','Pulling\x20agent\x20\x22','\x20unchanged','Source:\x20','\x20\x20Prompts:\x20','Clone\x20\x22','no_context','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','Errors:','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','5KYIDwK','counts','green','\x20\x20Agent\x20\x22','site','MISSING_ARGUMENT','2072MztuKY','pullAgent','\x0a✔\x20Pulled\x20','Using\x20current\x20project:\x20','\x20\x20Agents:\x20','Failed\x20to\x20push\x20agent:\x20','message','\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)','Would\x20clone:','\x20\x20Target:\x20','unchanged','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','dim','cyan','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','Dry\x20run\x20-\x20no\x20changes\x20made','tdx.json','\x20resources?','dirname','outputDir','repeat','Project:\x20','94590FaHxVh','newProjectName','\x22\x20to\x20new\x20project\x20\x22','textKnowledgeBases','\x20changed','\x22\x20from\x20project\x20\x22','Cannot\x20clone\x20from\x20context\x20project\x20\x22','\x22...','\x22:\x20','llm','\x20\x20Knowledge\x20Bases:\x20','updated','44236lNFeWj','New\x20project:\x20','red','New\x20project\x20ID:\x20','\x20resources\x20to\x20\x27','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','newProjectId','\x20files?','diff','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','dryRun','\x22\x20to\x20\x22','Agent:\x20','\x20\x20tdx\x20agent\x20pull\x20'];a4_0x3576=function(){return _0x41e15a;};return a4_0x3576();}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(_0x4bfe69){const _0x55daa7=a4_0x4978,_0x8e55fe=[];if(_0x4bfe69[_0x55daa7(0x20a)]!==undefined)_0x8e55fe['push'](_0x4bfe69['total']+'\x20total');if(_0x4bfe69['new']!==undefined&&_0x4bfe69[_0x55daa7(0x1fe)]>0x0)_0x8e55fe['push'](a4_0x3092f2['green'](_0x4bfe69[_0x55daa7(0x1fe)]+'\x20new'));if(_0x4bfe69[_0x55daa7(0x207)]!==undefined&&_0x4bfe69[_0x55daa7(0x207)]>0x0)_0x8e55fe[_0x55daa7(0x286)](a4_0x3092f2[_0x55daa7(0x229)](_0x4bfe69[_0x55daa7(0x207)]+_0x55daa7(0x293)));if(_0x4bfe69['updated']!==undefined&&_0x4bfe69[_0x55daa7(0x24e)]>0x0)_0x8e55fe[_0x55daa7(0x286)](a4_0x3092f2['yellow'](_0x4bfe69[_0x55daa7(0x24e)]+_0x55daa7(0x1e8)));if(_0x4bfe69[_0x55daa7(0x237)]!==undefined&&_0x4bfe69[_0x55daa7(0x237)]>0x0)_0x8e55fe[_0x55daa7(0x286)](a4_0x3092f2[_0x55daa7(0x287)](_0x4bfe69[_0x55daa7(0x237)]+_0x55daa7(0x21f)));if(_0x4bfe69[_0x55daa7(0x1ef)]!==undefined&&_0x4bfe69[_0x55daa7(0x1ef)]>0x0)_0x8e55fe['push'](a4_0x3092f2[_0x55daa7(0x251)](_0x4bfe69[_0x55daa7(0x1ef)]+_0x55daa7(0x28c)));return _0x8e55fe[_0x55daa7(0x296)](',\x20');}function displayDiffs(_0x28fe5d,_0x316a63,_0x46b4f6,_0x151302,_0x19db7d,_0x577ca,_0xb40d79){const _0x33fb14=a4_0x4978;for(const _0x1a5974 of _0x28fe5d){if(_0x1a5974[_0x33fb14(0x257)]){const _0xe87585=_0x1a5974[_0x33fb14(0x26c)]||_0x1a5974[_0x33fb14(0x27a)];console[_0x33fb14(0x29a)](_0x33fb14(0x1f0)+_0xe87585+'\x27:'),console['log']('─'[_0x33fb14(0x241)](0x3c)),console[_0x33fb14(0x29a)](_0x1a5974[_0x33fb14(0x257)]),console[_0x33fb14(0x29a)]('─'[_0x33fb14(0x241)](0x3c));}}for(const _0x4b9dbc of _0x316a63){_0x4b9dbc[_0x33fb14(0x257)]&&(console[_0x33fb14(0x29a)](_0x33fb14(0x27b)+_0x4b9dbc[_0x33fb14(0x27a)]+'\x27:'),console['log']('─'[_0x33fb14(0x241)](0x3c)),console[_0x33fb14(0x29a)](_0x4b9dbc[_0x33fb14(0x257)]),console[_0x33fb14(0x29a)]('─'[_0x33fb14(0x241)](0x3c)));}for(const _0x3ce532 of _0x46b4f6){_0x3ce532['diff']&&(console[_0x33fb14(0x29a)](_0x33fb14(0x209)+_0x3ce532[_0x33fb14(0x27a)]+'\x27:'),console[_0x33fb14(0x29a)]('─'[_0x33fb14(0x241)](0x3c)),console[_0x33fb14(0x29a)](_0x3ce532['diff']),console[_0x33fb14(0x29a)]('─'[_0x33fb14(0x241)](0x3c)));}for(const _0xd3f507 of _0x151302){_0xd3f507[_0x33fb14(0x257)]&&(console['log'](_0x33fb14(0x262)+_0xd3f507['name']+'\x27:'),console[_0x33fb14(0x29a)]('─'[_0x33fb14(0x241)](0x3c)),console['log'](_0xd3f507[_0x33fb14(0x257)]),console[_0x33fb14(0x29a)]('─'[_0x33fb14(0x241)](0x3c)));}for(const _0x4a938b of _0x19db7d){_0x4a938b[_0x33fb14(0x257)]&&(console['log'](_0x33fb14(0x27d)+_0x4a938b['name']+'\x27:'),console[_0x33fb14(0x29a)]('─'[_0x33fb14(0x241)](0x3c)),console[_0x33fb14(0x29a)](_0x4a938b[_0x33fb14(0x257)]),console['log']('─'['repeat'](0x3c)));}for(const _0x210231 of _0x577ca){_0x210231[_0x33fb14(0x257)]&&(console[_0x33fb14(0x29a)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x210231[_0x33fb14(0x27a)]+'\x27:'),console[_0x33fb14(0x29a)]('─'[_0x33fb14(0x241)](0x3c)),console[_0x33fb14(0x29a)](_0x210231[_0x33fb14(0x257)]),console[_0x33fb14(0x29a)]('─'[_0x33fb14(0x241)](0x3c)));}for(const _0x2d3500 of _0xb40d79){_0x2d3500[_0x33fb14(0x257)]&&(console['log']('\x0aChanges\x20to\x20experimental\x20artifact\x20\x27'+_0x2d3500[_0x33fb14(0x27a)]+'\x27:'),console[_0x33fb14(0x29a)]('─'[_0x33fb14(0x241)](0x3c)),console[_0x33fb14(0x29a)](_0x2d3500[_0x33fb14(0x257)]),console[_0x33fb14(0x29a)]('─'['repeat'](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x107374(0x27a)]=a4_0x107374(0x1fb);[a4_0x107374(0x1df)]=a4_0x107374(0x203);async['execute'](_0xf0cac0){const _0xd368fd=a4_0x107374,{options:_0x8ea149,args:_0x56c914,tdx:_0x3aba22}=_0xf0cac0,_0xb9bcd2=_0x56c914[0x0],_0x19b3ec=_0x56c914[0x1],_0xf6e343=_0x8ea149[_0xd368fd(0x272)],_0x4dca67=_0x8ea149[_0xd368fd(0x259)],_0x38ccf0=_0x8ea149[_0xd368fd(0x213)],_0x34e953=_0x8ea149['yes'],_0x46e813=_0x8ea149[_0xd368fd(0x264)],_0x4c43e1=_0x8ea149[_0xd368fd(0x291)];let _0x375447;if(_0xb9bcd2){const _0x23f8f9=a4_0x53f33f['join'](_0xb9bcd2,_0xd368fd(0x23d));if(existsSync(_0x23f8f9))try{const _0x1e4fef=JSON[_0xd368fd(0x266)](readFileSync(_0x23f8f9,_0xd368fd(0x210)));_0x1e4fef['llm_project']&&(_0x375447={'llm_project':_0x1e4fef[_0xd368fd(0x1e7)]});}catch{}}const _0x4a3304=findAgentConfigPath(process[_0xd368fd(0x218)]());let _0x302164;if(_0x4a3304)try{const _0x119bd8=JSON[_0xd368fd(0x266)](readFileSync(_0x4a3304,_0xd368fd(0x210)));_0x119bd8['llm_project']&&(_0x302164={'llm_project':_0x119bd8[_0xd368fd(0x1e7)]});}catch{}const _0x24bf32=resolveAgentPullArgs({'arg':_0xb9bcd2,'agentNameArg':_0x19b3ec,'agentFlag':_0x4c43e1,'contextProject':_0x46e813,'argDirConfig':_0x375447,'cwdConfigPath':_0x4a3304||undefined,'cwdConfig':_0x302164}),{projectNameOrId:_0x2ce616,targetAgentName:_0x5a0a16,existingOutputDir:_0x4a59cf,source:_0x23436c}=_0x24bf32;if(_0x23436c==='arg-dir')console[_0xd368fd(0x29a)](a4_0x3092f2['dim']('Using\x20project\x20from\x20'+a4_0x53f33f[_0xd368fd(0x296)](_0xb9bcd2,_0xd368fd(0x23d))+':\x20'+_0x2ce616));else{if(_0x23436c===_0xd368fd(0x20f))console[_0xd368fd(0x29a)](a4_0x3092f2[_0xd368fd(0x239)](_0xd368fd(0x279)+_0x2ce616));else _0x23436c==='context'&&console[_0xd368fd(0x29a)](a4_0x3092f2['dim'](_0xd368fd(0x1e2)+_0x2ce616));}if(!_0x2ce616)return _0x4c43e1?(console[_0xd368fd(0x29a)](a4_0x3092f2[_0xd368fd(0x21d)](_0xd368fd(0x1f4))),console[_0xd368fd(0x29a)](_0xd368fd(0x273)),console['log']('Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>')):(console[_0xd368fd(0x29a)](a4_0x3092f2[_0xd368fd(0x21d)](_0xd368fd(0x1e3))),console['log'](_0xd368fd(0x1e0)),console['log']('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project'),console[_0xd368fd(0x29a)](_0xd368fd(0x215)),console[_0xd368fd(0x29a)]('\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[_0xd368fd(0x29a)]('\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')),0x1;if(_0x5a0a16){const {data:_0x191af0}=await withSpinner(_0xd368fd(0x21e)+_0x5a0a16+_0xd368fd(0x248)+_0x2ce616+_0xd368fd(0x24a),()=>_0x3aba22['llm'][_0xd368fd(0x22e)](_0x2ce616,_0x5a0a16,_0xf6e343,{'dryRun':_0x4dca67,'force':_0x38ccf0}));if(_0x4dca67)return console[_0xd368fd(0x29a)](a4_0x3092f2[_0xd368fd(0x21d)](_0xd368fd(0x282))),console[_0xd368fd(0x29a)](_0xd368fd(0x1de)+_0x191af0[_0xd368fd(0x26c)]),console[_0xd368fd(0x29a)]('Output\x20path:\x20'+_0x191af0['outputPath']),_0x191af0[_0xd368fd(0x257)]&&(console['log']('\x0aChanges:'),console[_0xd368fd(0x29a)]('─'[_0xd368fd(0x241)](0x3c)),console[_0xd368fd(0x29a)](_0x191af0[_0xd368fd(0x257)]),console['log']('─'[_0xd368fd(0x241)](0x3c))),0x0;return console[_0xd368fd(0x29a)](a4_0x3092f2[_0xd368fd(0x229)](_0xd368fd(0x200))),console[_0xd368fd(0x29a)](_0xd368fd(0x25b)+_0x191af0[_0xd368fd(0x26c)]),console[_0xd368fd(0x29a)](_0xd368fd(0x260)+_0x191af0[_0xd368fd(0x1ec)]),console[_0xd368fd(0x29a)]('Status:\x20'+(_0x191af0[_0xd368fd(0x1f6)]?a4_0x3092f2[_0xd368fd(0x229)](_0xd368fd(0x1fe)):_0x191af0['hasChanges']?a4_0x3092f2['yellow'](_0xd368fd(0x24e)):a4_0x3092f2[_0xd368fd(0x287)](_0xd368fd(0x237)))),0x0;}const _0x514e8a=_0x4a59cf||_0xf6e343,{data:_0x3c5c7e}=await withSpinner('Analyzing\x20project\x20\x22'+_0x2ce616+_0xd368fd(0x24a),()=>_0x3aba22['llm'][_0xd368fd(0x263)](_0x2ce616,_0x514e8a,{'dryRun':!![]})),_0x411175=_0x3c5c7e[_0xd368fd(0x228)][_0xd368fd(0x1dd)][_0xd368fd(0x1fe)]+_0x3c5c7e[_0xd368fd(0x228)][_0xd368fd(0x27e)][_0xd368fd(0x1fe)]+_0x3c5c7e[_0xd368fd(0x228)][_0xd368fd(0x246)][_0xd368fd(0x1fe)]+_0x3c5c7e[_0xd368fd(0x228)][_0xd368fd(0x26f)][_0xd368fd(0x1fe)]+_0x3c5c7e[_0xd368fd(0x228)]['integrations'][_0xd368fd(0x1fe)]+_0x3c5c7e[_0xd368fd(0x228)][_0xd368fd(0x202)][_0xd368fd(0x1fe)]+_0x3c5c7e[_0xd368fd(0x228)][_0xd368fd(0x1ff)][_0xd368fd(0x1fe)],_0x26776d=_0x3c5c7e[_0xd368fd(0x228)]['agents'][_0xd368fd(0x24e)]+_0x3c5c7e[_0xd368fd(0x228)]['knowledgeBases'][_0xd368fd(0x24e)]+_0x3c5c7e[_0xd368fd(0x228)][_0xd368fd(0x246)][_0xd368fd(0x24e)]+_0x3c5c7e[_0xd368fd(0x228)][_0xd368fd(0x26f)][_0xd368fd(0x24e)]+_0x3c5c7e[_0xd368fd(0x228)][_0xd368fd(0x1f9)]['updated']+_0x3c5c7e[_0xd368fd(0x228)][_0xd368fd(0x202)]['updated']+_0x3c5c7e['counts'][_0xd368fd(0x1ff)]['updated'],_0x1bf8e9=_0x3c5c7e['counts'][_0xd368fd(0x1dd)][_0xd368fd(0x237)]+_0x3c5c7e[_0xd368fd(0x228)]['knowledgeBases'][_0xd368fd(0x237)]+_0x3c5c7e[_0xd368fd(0x228)][_0xd368fd(0x246)][_0xd368fd(0x237)]+_0x3c5c7e[_0xd368fd(0x228)][_0xd368fd(0x26f)][_0xd368fd(0x237)]+_0x3c5c7e['counts'][_0xd368fd(0x1f9)][_0xd368fd(0x237)]+_0x3c5c7e[_0xd368fd(0x228)][_0xd368fd(0x202)][_0xd368fd(0x237)]+_0x3c5c7e[_0xd368fd(0x228)]['experimentalArtifacts'][_0xd368fd(0x237)];console[_0xd368fd(0x29a)](_0xd368fd(0x25d)+_0x3c5c7e[_0xd368fd(0x267)]+'\x27:'),console[_0xd368fd(0x29a)]('\x20\x20'+a4_0x3092f2[_0xd368fd(0x229)]('+\x20'+_0x411175+_0xd368fd(0x212))+'\x20|\x20'+a4_0x3092f2[_0xd368fd(0x21d)]('~\x20'+_0x26776d+'\x20changed')+_0xd368fd(0x297)+a4_0x3092f2[_0xd368fd(0x239)]('=\x20'+_0x1bf8e9+_0xd368fd(0x21f))),console[_0xd368fd(0x29a)](_0xd368fd(0x231)+formatCountSummary(_0x3c5c7e[_0xd368fd(0x228)][_0xd368fd(0x1dd)])),console[_0xd368fd(0x29a)](_0xd368fd(0x24d)+formatCountSummary(_0x3c5c7e[_0xd368fd(0x228)][_0xd368fd(0x27e)])),console['log'](_0xd368fd(0x280)+formatCountSummary(_0x3c5c7e[_0xd368fd(0x228)]['textKnowledgeBases'])),console[_0xd368fd(0x29a)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x3c5c7e[_0xd368fd(0x228)]['prompts'])),console[_0xd368fd(0x29a)](_0xd368fd(0x206)+formatCountSummary(_0x3c5c7e[_0xd368fd(0x228)][_0xd368fd(0x1f9)]));const _0x591056=_0x3c5c7e[_0xd368fd(0x228)]['experimentalKnowledgeBases'][_0xd368fd(0x20a)]>0x0||_0x3c5c7e['counts']['experimentalArtifacts']['total']>0x0;_0x591056&&(console[_0xd368fd(0x29a)](_0xd368fd(0x224)+formatCountSummary(_0x3c5c7e[_0xd368fd(0x228)][_0xd368fd(0x202)])),console['log'](_0xd368fd(0x299)+formatCountSummary(_0x3c5c7e['counts']['experimentalArtifacts'])));console[_0xd368fd(0x29a)](_0xd368fd(0x236)+a4_0x3092f2[_0xd368fd(0x23a)](_0x3c5c7e[_0xd368fd(0x240)])),displayDiffs(_0x3c5c7e['agents'],_0x3c5c7e[_0xd368fd(0x27e)],_0x3c5c7e['textKnowledgeBases'],_0x3c5c7e[_0xd368fd(0x26f)],_0x3c5c7e[_0xd368fd(0x1f9)],_0x3c5c7e[_0xd368fd(0x202)],_0x3c5c7e[_0xd368fd(0x1ff)]);if(_0x4dca67)return console[_0xd368fd(0x29a)](a4_0x3092f2['yellow'](_0xd368fd(0x28a))),0x0;if(_0x411175===0x0&&_0x26776d===0x0)return console[_0xd368fd(0x29a)](a4_0x3092f2['green'](_0xd368fd(0x226))),saveSessionContext({'llm_project':_0x3c5c7e[_0xd368fd(0x267)]},_0x8ea149[_0xd368fd(0x1e1)]),console['log'](a4_0x3092f2[_0xd368fd(0x229)](_0xd368fd(0x214)+a4_0x3092f2[_0xd368fd(0x239)](_0xd368fd(0x1e7))+'\x20=\x20'+a4_0x3092f2[_0xd368fd(0x23a)](_0x3c5c7e[_0xd368fd(0x267)]))),0x0;if(!_0x34e953&&!_0x38ccf0){if(!isInteractive())return console['error'](a4_0x3092f2['red'](_0xd368fd(0x275)),_0xd368fd(0x258)),console['error'](a4_0x3092f2[_0xd368fd(0x239)](_0xd368fd(0x1e6))),0x1;const _0x575f17=await confirmKey(_0xd368fd(0x276)+(_0x411175+_0x26776d)+_0xd368fd(0x256));if(!_0x575f17)return console[_0xd368fd(0x29a)](a4_0x3092f2[_0xd368fd(0x21d)](_0xd368fd(0x1f8)),_0xd368fd(0x1fc)),0x1;}const {data:_0x416958}=await withSpinner('Writing\x20files...',()=>_0x3aba22[_0xd368fd(0x24c)][_0xd368fd(0x263)](_0x2ce616,_0x514e8a,{'force':_0x38ccf0}));return console['log'](a4_0x3092f2[_0xd368fd(0x229)](_0xd368fd(0x22f)+(_0x411175+_0x26776d)+_0xd368fd(0x21c)+_0x416958['outputDir'])),saveSessionContext({'llm_project':_0x416958[_0xd368fd(0x267)]},_0x8ea149[_0xd368fd(0x1e1)]),console[_0xd368fd(0x29a)](a4_0x3092f2[_0xd368fd(0x229)]('✔\x20Context\x20set:\x20'+a4_0x3092f2[_0xd368fd(0x239)](_0xd368fd(0x1e7))+_0xd368fd(0x274)+a4_0x3092f2['cyan'](_0x416958[_0xd368fd(0x267)]))),0x0;}}function a4_0x4978(_0x831721,_0x2d7e03){_0x831721=_0x831721-0x1dc;const _0x357615=a4_0x3576();let _0x497840=_0x357615[_0x831721];return _0x497840;}export class AgentCloneCommand extends BaseCommand{['name']='agent:clone';['description']=a4_0x107374(0x295);async[a4_0x107374(0x219)](_0x59ad97){const _0x5804ac=a4_0x107374,{options:_0x5bab8e,args:_0x559b9e,tdx:_0x32bb39}=_0x59ad97,_0xfc347f=_0x559b9e[0x0],_0x316968=_0x5bab8e[_0x5804ac(0x27a)],_0x31468d=_0x5bab8e[_0x5804ac(0x259)],_0x3faf99=_0x5bab8e[_0x5804ac(0x211)],_0x1a2e77=_0x5bab8e[_0x5804ac(0x22b)],_0xe2025e=_0x5bab8e['llmProject'];let _0x40c99f;const _0x3a66d8=findAgentConfigPath(process['cwd']());if(_0xfc347f){const _0x1f8c9f=a4_0x53f33f[_0x5804ac(0x296)](_0xfc347f,_0x5804ac(0x23d));existsSync(_0x1f8c9f)?(_0x40c99f=_0xfc347f,console['log'](a4_0x3092f2[_0x5804ac(0x239)](_0x5804ac(0x21a)+_0xfc347f))):_0x40c99f=_0xfc347f;}else{if(_0x3a66d8)_0x40c99f=a4_0x53f33f[_0x5804ac(0x23f)](_0x3a66d8),console[_0x5804ac(0x29a)](a4_0x3092f2[_0x5804ac(0x239)](_0x5804ac(0x230)+_0x40c99f));else{if(_0xe2025e){const _0x50ba48=sanitizeForFilesystem(_0xe2025e);let _0x1faddb=_0x50ba48,_0x8e943a=a4_0x53f33f[_0x5804ac(0x296)](process['cwd'](),_0x5804ac(0x1dd),_0x50ba48,_0x5804ac(0x23d));if(!existsSync(_0x8e943a)){const _0x11fd8b=normalizeName(_0xe2025e),_0xf2e675=a4_0x53f33f['join'](process[_0x5804ac(0x218)](),_0x5804ac(0x1dd),_0x11fd8b,'tdx.json');existsSync(_0xf2e675)&&(_0x1faddb=_0x11fd8b,_0x8e943a=_0xf2e675);}if(existsSync(_0x8e943a))_0x40c99f=a4_0x53f33f[_0x5804ac(0x23f)](_0x8e943a),console['log'](a4_0x3092f2['dim'](_0x5804ac(0x21a)+_0x40c99f));else{const _0x13ea01=_0x5bab8e[_0x5804ac(0x1f5)];if(_0x13ea01)throw new SDKError(ErrorCode[_0x5804ac(0x26b)],_0x5804ac(0x249)+_0xe2025e+_0x5804ac(0x28b),undefined,{'helpText':_0x5804ac(0x1dc)+_0x5804ac(0x1ea)+(_0x5804ac(0x25c)+_0xe2025e+'\x0a')+(_0x5804ac(0x268)+_0x1faddb+_0x5804ac(0x1f1)+(_0x316968||_0x5804ac(0x281))+_0x5804ac(0x1ee)+_0x13ea01)});_0x40c99f=_0xe2025e,console[_0x5804ac(0x29a)](a4_0x3092f2[_0x5804ac(0x239)]('Using\x20context\x20project:\x20'+_0xe2025e));}}}}if(!_0x40c99f)return console[_0x5804ac(0x29a)](a4_0x3092f2[_0x5804ac(0x21d)](_0x5804ac(0x217))),console[_0x5804ac(0x29a)](_0x5804ac(0x25e)),console[_0x5804ac(0x29a)](_0x5804ac(0x27f)),console['log'](_0x5804ac(0x234)),console[_0x5804ac(0x29a)](_0x5804ac(0x284)),0x1;if(!_0x316968)throw new SDKError(ErrorCode[_0x5804ac(0x22c)],'New\x20project\x20name\x20is\x20required',undefined,{'helpText':_0x5804ac(0x201)});if(!_0x3faf99&&!_0x31468d){if(!isInteractive())return console[_0x5804ac(0x27c)](a4_0x3092f2[_0x5804ac(0x251)](_0x5804ac(0x275)),_0x5804ac(0x258)),console['error'](a4_0x3092f2['dim'](_0x5804ac(0x1e6))),0x1;const _0x2498c2=await confirmKey(_0x5804ac(0x222)+_0x40c99f+_0x5804ac(0x245)+_0x316968+'\x22?');if(!_0x2498c2)return console[_0x5804ac(0x29a)](a4_0x3092f2[_0x5804ac(0x21d)](_0x5804ac(0x1f8))),0x1;}const {data:_0x4ca3f7}=await withSpinner(_0x5804ac(0x1eb)+_0x40c99f+_0x5804ac(0x25a)+_0x316968+'\x22...',()=>_0x32bb39[_0x5804ac(0x24c)][_0x5804ac(0x271)](_0x40c99f,_0x316968,{'dryRun':_0x31468d}));if(_0x31468d){console[_0x5804ac(0x29a)](a4_0x3092f2[_0x5804ac(0x21d)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x5804ac(0x29a)](_0x5804ac(0x220)+_0x4ca3f7[_0x5804ac(0x1f3)]),console[_0x5804ac(0x29a)](_0x5804ac(0x250)+_0x316968),console[_0x5804ac(0x29a)](_0x5804ac(0x235)),console[_0x5804ac(0x29a)](_0x5804ac(0x231)+_0x4ca3f7['counts'][_0x5804ac(0x1dd)][_0x5804ac(0x207)]),console[_0x5804ac(0x29a)](_0x5804ac(0x24d)+_0x4ca3f7['counts'][_0x5804ac(0x27e)][_0x5804ac(0x207)]),console[_0x5804ac(0x29a)](_0x5804ac(0x221)+_0x4ca3f7[_0x5804ac(0x228)][_0x5804ac(0x26f)][_0x5804ac(0x207)]);const _0xe52990=_0x4ca3f7['counts'][_0x5804ac(0x202)][_0x5804ac(0x207)]>0x0||_0x4ca3f7[_0x5804ac(0x228)][_0x5804ac(0x1ff)]['created']>0x0;return _0xe52990&&(console[_0x5804ac(0x29a)](_0x5804ac(0x224)+_0x4ca3f7[_0x5804ac(0x228)][_0x5804ac(0x202)][_0x5804ac(0x207)]),console['log'](_0x5804ac(0x299)+_0x4ca3f7[_0x5804ac(0x228)][_0x5804ac(0x1ff)]['created'])),0x0;}const _0x50b027=_0x4ca3f7[_0x5804ac(0x228)][_0x5804ac(0x1dd)][_0x5804ac(0x1ef)]>0x0||_0x4ca3f7[_0x5804ac(0x228)][_0x5804ac(0x27e)][_0x5804ac(0x1ef)]>0x0||_0x4ca3f7[_0x5804ac(0x228)]['prompts'][_0x5804ac(0x1ef)]>0x0||_0x4ca3f7[_0x5804ac(0x228)]['experimentalKnowledgeBases'][_0x5804ac(0x1ef)]>0x0||_0x4ca3f7[_0x5804ac(0x228)][_0x5804ac(0x1ff)][_0x5804ac(0x1ef)]>0x0;_0x50b027?console[_0x5804ac(0x29a)](a4_0x3092f2['yellow'](_0x5804ac(0x1ed))):console[_0x5804ac(0x29a)](a4_0x3092f2[_0x5804ac(0x229)]('Project\x20cloned\x20successfully'));console['log'](_0x5804ac(0x220)+_0x4ca3f7[_0x5804ac(0x1f3)]),console[_0x5804ac(0x29a)]('New\x20project:\x20'+_0x4ca3f7[_0x5804ac(0x244)]),console[_0x5804ac(0x29a)](_0x5804ac(0x252)+_0x4ca3f7[_0x5804ac(0x255)]),console[_0x5804ac(0x29a)](),console[_0x5804ac(0x29a)](_0x5804ac(0x26a)),console[_0x5804ac(0x29a)](_0x5804ac(0x231)+formatCountSummary(_0x4ca3f7[_0x5804ac(0x228)][_0x5804ac(0x1dd)])),console[_0x5804ac(0x29a)](_0x5804ac(0x24d)+formatCountSummary(_0x4ca3f7[_0x5804ac(0x228)]['knowledgeBases'])),console['log']('\x20\x20Prompts:\x20'+formatCountSummary(_0x4ca3f7['counts']['prompts'])),console['log'](_0x5804ac(0x206)+formatCountSummary(_0x4ca3f7['counts'][_0x5804ac(0x1f9)]));const _0x270175=_0x4ca3f7[_0x5804ac(0x228)]['experimentalKnowledgeBases'][_0x5804ac(0x207)]>0x0||_0x4ca3f7['counts']['experimentalKnowledgeBases'][_0x5804ac(0x24e)]>0x0||_0x4ca3f7['counts'][_0x5804ac(0x202)][_0x5804ac(0x237)]>0x0||_0x4ca3f7[_0x5804ac(0x228)]['experimentalArtifacts'][_0x5804ac(0x207)]>0x0||_0x4ca3f7[_0x5804ac(0x228)][_0x5804ac(0x1ff)][_0x5804ac(0x24e)]>0x0||_0x4ca3f7['counts'][_0x5804ac(0x1ff)][_0x5804ac(0x237)]>0x0;_0x270175&&(console['log'](_0x5804ac(0x224)+formatCountSummary(_0x4ca3f7[_0x5804ac(0x228)][_0x5804ac(0x202)])),console[_0x5804ac(0x29a)](_0x5804ac(0x299)+formatCountSummary(_0x4ca3f7[_0x5804ac(0x228)]['experimentalArtifacts'])));if(_0x50b027){console[_0x5804ac(0x29a)](),console['log'](a4_0x3092f2[_0x5804ac(0x251)](_0x5804ac(0x225)));for(const _0x3ccb08 of _0x4ca3f7['agents']){_0x3ccb08['action']==='error'&&console[_0x5804ac(0x29a)](a4_0x3092f2['red'](_0x5804ac(0x22a)+_0x3ccb08[_0x5804ac(0x26c)]+_0x5804ac(0x24b)+_0x3ccb08['error']));}for(const _0x184969 of _0x4ca3f7['knowledgeBases']){_0x184969[_0x5804ac(0x292)]===_0x5804ac(0x27c)&&console[_0x5804ac(0x29a)](a4_0x3092f2['red'](_0x5804ac(0x20b)+_0x184969[_0x5804ac(0x27a)]+_0x5804ac(0x24b)+_0x184969[_0x5804ac(0x27c)]));}for(const _0x4826aa of _0x4ca3f7[_0x5804ac(0x26f)]){_0x4826aa[_0x5804ac(0x292)]==='error'&&console[_0x5804ac(0x29a)](a4_0x3092f2[_0x5804ac(0x251)](_0x5804ac(0x204)+_0x4826aa[_0x5804ac(0x27a)]+_0x5804ac(0x24b)+_0x4826aa['error']));}for(const _0x5f334b of _0x4ca3f7[_0x5804ac(0x1f9)]){_0x5f334b[_0x5804ac(0x292)]===_0x5804ac(0x27c)&&console[_0x5804ac(0x29a)](a4_0x3092f2[_0x5804ac(0x251)]('\x20\x20Integration\x20\x22'+_0x5f334b[_0x5804ac(0x27a)]+'\x22:\x20'+_0x5f334b[_0x5804ac(0x27c)]));}for(const _0x5d2587 of _0x4ca3f7['experimentalKnowledgeBases']){_0x5d2587[_0x5804ac(0x292)]===_0x5804ac(0x27c)&&console['log'](a4_0x3092f2['red'](_0x5804ac(0x238)+_0x5d2587[_0x5804ac(0x27a)]+'\x22:\x20'+_0x5d2587[_0x5804ac(0x27c)]));}for(const _0x3142f4 of _0x4ca3f7[_0x5804ac(0x1ff)]){_0x3142f4['action']===_0x5804ac(0x27c)&&console['log'](a4_0x3092f2['red'](_0x5804ac(0x278)+_0x3142f4['name']+_0x5804ac(0x24b)+_0x3142f4[_0x5804ac(0x27c)]));}return 0x1;}console['log']();const _0x2b5d42=getLLMProjectUrl(_0x1a2e77,_0x4ca3f7[_0x5804ac(0x255)]);return console[_0x5804ac(0x29a)](_0x5804ac(0x242)+a4_0x3092f2[_0x5804ac(0x23a)](_0x2b5d42)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x107374(0x27a)]=a4_0x107374(0x1fd);[a4_0x107374(0x1df)]='Push\x20local\x20agent\x20files\x20to\x20LLM\x20project';async[a4_0x107374(0x219)](_0x13fb1f){const _0x58dfc7=a4_0x107374,{options:_0x5b6146,args:_0x35db3b,tdx:_0x2eb0f9}=_0x13fb1f;let _0x356826=_0x35db3b[0x0]||process[_0x58dfc7(0x218)]();const _0x96691=_0x5b6146[_0x58dfc7(0x259)],_0xfdece8=_0x5b6146['force'],_0x3b611e=_0x5b6146['yes'],_0x586cfd=_0x5b6146[_0x58dfc7(0x22b)],_0x4b9fcf=a4_0x53f33f[_0x58dfc7(0x296)](_0x356826,_0x58dfc7(0x28e)),_0x20575c=existsSync(_0x4b9fcf);if(_0x20575c){const {data:_0x9ea17a}=await withSpinner(_0x58dfc7(0x20c)+_0x356826+_0x58dfc7(0x24a),()=>_0x2eb0f9['llm'][_0x58dfc7(0x26d)](_0x356826,{'dryRun':_0x96691,'force':_0xfdece8}));if(_0x96691)return console[_0x58dfc7(0x29a)](a4_0x3092f2[_0x58dfc7(0x21d)](_0x58dfc7(0x23c))),console[_0x58dfc7(0x29a)]('Would\x20push\x20agent:\x20'+_0x9ea17a[_0x58dfc7(0x26c)]),0x0;if(_0x9ea17a[_0x58dfc7(0x292)]==='error')return console['log'](a4_0x3092f2[_0x58dfc7(0x251)](_0x58dfc7(0x232)+_0x9ea17a[_0x58dfc7(0x27c)])),0x1;console[_0x58dfc7(0x29a)](a4_0x3092f2[_0x58dfc7(0x229)]('Agent\x20'+_0x9ea17a[_0x58dfc7(0x292)]+_0x58dfc7(0x265))),console[_0x58dfc7(0x29a)]('Agent:\x20'+_0x9ea17a['agentName']);if(_0x9ea17a[_0x58dfc7(0x216)]&&_0x9ea17a['projectId']){const _0x1e81ea=getLLMAgentChatUrl(_0x586cfd,_0x9ea17a[_0x58dfc7(0x288)],_0x9ea17a[_0x58dfc7(0x216)]);console['log'](_0x58dfc7(0x285)+a4_0x3092f2['cyan'](_0x1e81ea));}return 0x0;}const _0x56c207=_0x5b6146['llmProject'],_0x174065=resolveProjectFromContext(_0x356826,_0x56c207);if(_0x174065[_0x58dfc7(0x28f)])_0x356826=_0x174065[_0x58dfc7(0x270)],_0x174065[_0x58dfc7(0x277)]==='context'&&console['log'](a4_0x3092f2[_0x58dfc7(0x239)](_0x58dfc7(0x279)+_0x356826));else{let _0x218fc7=_0x58dfc7(0x23b);_0x174065[_0x58dfc7(0x283)]===_0x58dfc7(0x25f)&&(_0x218fc7=_0x174065[_0x58dfc7(0x233)]+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x174065[_0x58dfc7(0x264)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode[_0x58dfc7(0x26b)],_0x174065[_0x58dfc7(0x283)]===_0x58dfc7(0x223)?_0x174065[_0x58dfc7(0x233)]:_0x58dfc7(0x1f2)+_0x356826,undefined,{'helpText':_0x218fc7});}const {data:_0x12cc7d}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x2eb0f9['llm'][_0x58dfc7(0x20d)](_0x356826,{'dryRun':!![]})),_0x33fc1f=_0x12cc7d[_0x58dfc7(0x228)][_0x58dfc7(0x1dd)][_0x58dfc7(0x1ef)]>0x0;if(_0x33fc1f){console[_0x58dfc7(0x29a)](a4_0x3092f2[_0x58dfc7(0x251)](_0x58dfc7(0x1e5)));for(const _0x59cc16 of _0x12cc7d[_0x58dfc7(0x1dd)]){_0x59cc16[_0x58dfc7(0x292)]===_0x58dfc7(0x27c)&&console[_0x58dfc7(0x29a)](a4_0x3092f2[_0x58dfc7(0x251)](_0x58dfc7(0x22a)+_0x59cc16['agentName']+'\x22:\x20'+_0x59cc16[_0x58dfc7(0x27c)]));}return 0x1;}const _0x1bbdea=_0x12cc7d[_0x58dfc7(0x228)][_0x58dfc7(0x1dd)][_0x58dfc7(0x207)]+_0x12cc7d['counts'][_0x58dfc7(0x27e)][_0x58dfc7(0x207)]+_0x12cc7d['counts']['textKnowledgeBases'][_0x58dfc7(0x207)]+_0x12cc7d[_0x58dfc7(0x228)][_0x58dfc7(0x26f)]['created']+_0x12cc7d[_0x58dfc7(0x228)][_0x58dfc7(0x1f9)][_0x58dfc7(0x207)]+_0x12cc7d[_0x58dfc7(0x228)][_0x58dfc7(0x202)][_0x58dfc7(0x207)]+_0x12cc7d[_0x58dfc7(0x228)]['experimentalArtifacts']['created'],_0x364c5c=_0x12cc7d[_0x58dfc7(0x228)]['agents'][_0x58dfc7(0x24e)]+_0x12cc7d[_0x58dfc7(0x228)]['knowledgeBases']['updated']+_0x12cc7d[_0x58dfc7(0x228)][_0x58dfc7(0x246)][_0x58dfc7(0x24e)]+_0x12cc7d[_0x58dfc7(0x228)][_0x58dfc7(0x26f)][_0x58dfc7(0x24e)]+_0x12cc7d[_0x58dfc7(0x228)]['integrations'][_0x58dfc7(0x24e)]+_0x12cc7d[_0x58dfc7(0x228)][_0x58dfc7(0x202)][_0x58dfc7(0x24e)]+_0x12cc7d[_0x58dfc7(0x228)][_0x58dfc7(0x1ff)][_0x58dfc7(0x24e)],_0x4e39d5=_0x12cc7d[_0x58dfc7(0x228)][_0x58dfc7(0x1dd)][_0x58dfc7(0x237)]+_0x12cc7d[_0x58dfc7(0x228)][_0x58dfc7(0x27e)][_0x58dfc7(0x237)]+_0x12cc7d[_0x58dfc7(0x228)][_0x58dfc7(0x246)]['unchanged']+_0x12cc7d[_0x58dfc7(0x228)]['prompts'][_0x58dfc7(0x237)]+_0x12cc7d[_0x58dfc7(0x228)]['integrations'][_0x58dfc7(0x237)]+_0x12cc7d[_0x58dfc7(0x228)][_0x58dfc7(0x202)][_0x58dfc7(0x237)]+_0x12cc7d[_0x58dfc7(0x228)][_0x58dfc7(0x1ff)][_0x58dfc7(0x237)];console[_0x58dfc7(0x29a)](_0x58dfc7(0x205)+_0x12cc7d[_0x58dfc7(0x267)]+'\x27:'),console[_0x58dfc7(0x29a)]('\x20\x20'+a4_0x3092f2[_0x58dfc7(0x229)]('+\x20'+_0x1bbdea+_0x58dfc7(0x212))+_0x58dfc7(0x297)+a4_0x3092f2[_0x58dfc7(0x21d)]('~\x20'+_0x364c5c+_0x58dfc7(0x247))+_0x58dfc7(0x297)+a4_0x3092f2['dim']('=\x20'+_0x4e39d5+'\x20unchanged')),console[_0x58dfc7(0x29a)](_0x58dfc7(0x231)+formatCountSummary(_0x12cc7d[_0x58dfc7(0x228)][_0x58dfc7(0x1dd)])),console[_0x58dfc7(0x29a)](_0x58dfc7(0x24d)+formatCountSummary(_0x12cc7d['counts'][_0x58dfc7(0x27e)])),console[_0x58dfc7(0x29a)](_0x58dfc7(0x280)+formatCountSummary(_0x12cc7d[_0x58dfc7(0x228)][_0x58dfc7(0x246)])),console[_0x58dfc7(0x29a)](_0x58dfc7(0x221)+formatCountSummary(_0x12cc7d[_0x58dfc7(0x228)][_0x58dfc7(0x26f)])),console[_0x58dfc7(0x29a)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x12cc7d['counts']['integrations']));const _0x1d2631=_0x12cc7d[_0x58dfc7(0x228)][_0x58dfc7(0x202)][_0x58dfc7(0x207)]>0x0||_0x12cc7d[_0x58dfc7(0x228)][_0x58dfc7(0x202)][_0x58dfc7(0x24e)]>0x0||_0x12cc7d[_0x58dfc7(0x228)][_0x58dfc7(0x202)][_0x58dfc7(0x237)]>0x0||_0x12cc7d[_0x58dfc7(0x228)]['experimentalArtifacts'][_0x58dfc7(0x207)]>0x0||_0x12cc7d[_0x58dfc7(0x228)][_0x58dfc7(0x1ff)][_0x58dfc7(0x24e)]>0x0||_0x12cc7d[_0x58dfc7(0x228)][_0x58dfc7(0x1ff)][_0x58dfc7(0x237)]>0x0;_0x1d2631&&(console[_0x58dfc7(0x29a)](_0x58dfc7(0x224)+formatCountSummary(_0x12cc7d[_0x58dfc7(0x228)][_0x58dfc7(0x202)])),console[_0x58dfc7(0x29a)](_0x58dfc7(0x299)+formatCountSummary(_0x12cc7d[_0x58dfc7(0x228)][_0x58dfc7(0x1ff)])));console[_0x58dfc7(0x29a)](_0x58dfc7(0x26e)+a4_0x3092f2['cyan'](_0x356826)),displayDiffs(_0x12cc7d[_0x58dfc7(0x1dd)],_0x12cc7d['knowledgeBases'],_0x12cc7d['textKnowledgeBases'],_0x12cc7d[_0x58dfc7(0x26f)],_0x12cc7d['integrations'],_0x12cc7d[_0x58dfc7(0x202)],_0x12cc7d[_0x58dfc7(0x1ff)]);if(_0x96691)return console[_0x58dfc7(0x29a)](a4_0x3092f2['yellow'](_0x58dfc7(0x254))),0x0;if(_0x1bbdea===0x0&&_0x364c5c===0x0){console[_0x58dfc7(0x29a)](a4_0x3092f2[_0x58dfc7(0x229)](_0x58dfc7(0x269)));const _0x107b20=getLLMProjectUrl(_0x586cfd,_0x12cc7d[_0x58dfc7(0x288)]);return console[_0x58dfc7(0x29a)](_0x58dfc7(0x242)+a4_0x3092f2[_0x58dfc7(0x23a)](_0x107b20)),0x0;}if(!_0x3b611e&&!_0xfdece8){if(!isInteractive())return console[_0x58dfc7(0x27c)](a4_0x3092f2[_0x58dfc7(0x251)](_0x58dfc7(0x275)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x58dfc7(0x27c)](a4_0x3092f2[_0x58dfc7(0x239)](_0x58dfc7(0x1e6))),0x1;const _0x44513b=await confirmKey(_0x58dfc7(0x290)+(_0x1bbdea+_0x364c5c)+_0x58dfc7(0x23e));if(!_0x44513b)return console[_0x58dfc7(0x29a)](a4_0x3092f2[_0x58dfc7(0x21d)](_0x58dfc7(0x1f8)),_0x58dfc7(0x1e9)),0x1;}const {data:_0x39f288}=await withSpinner(_0x58dfc7(0x289),()=>_0x2eb0f9[_0x58dfc7(0x24c)][_0x58dfc7(0x20d)](_0x356826,{'force':_0xfdece8})),_0x1dfd82=_0x39f288[_0x58dfc7(0x228)][_0x58dfc7(0x1dd)][_0x58dfc7(0x1ef)]>0x0||_0x39f288[_0x58dfc7(0x228)][_0x58dfc7(0x27e)][_0x58dfc7(0x1ef)]>0x0||_0x39f288[_0x58dfc7(0x228)][_0x58dfc7(0x246)][_0x58dfc7(0x1ef)]>0x0||_0x39f288[_0x58dfc7(0x228)][_0x58dfc7(0x26f)][_0x58dfc7(0x1ef)]>0x0;if(_0x1dfd82){console[_0x58dfc7(0x29a)](a4_0x3092f2['yellow'](_0x58dfc7(0x294))),console['log'](),console[_0x58dfc7(0x29a)](a4_0x3092f2[_0x58dfc7(0x251)](_0x58dfc7(0x225)));for(const _0x222f9f of _0x39f288[_0x58dfc7(0x1dd)]){_0x222f9f[_0x58dfc7(0x292)]===_0x58dfc7(0x27c)&&console['log'](a4_0x3092f2[_0x58dfc7(0x251)](_0x58dfc7(0x22a)+_0x222f9f[_0x58dfc7(0x26c)]+'\x22:\x20'+_0x222f9f[_0x58dfc7(0x27c)]));}for(const _0x4a1e46 of _0x39f288[_0x58dfc7(0x27e)]){_0x4a1e46['action']===_0x58dfc7(0x27c)&&console['log'](a4_0x3092f2[_0x58dfc7(0x251)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x4a1e46[_0x58dfc7(0x27a)]+'\x22:\x20'+_0x4a1e46['error']));}for(const _0x1cee23 of _0x39f288['textKnowledgeBases']){_0x1cee23[_0x58dfc7(0x292)]===_0x58dfc7(0x27c)&&console['log'](a4_0x3092f2['red']('\x20\x20Text\x20Knowledge\x20Base\x20\x22'+_0x1cee23['name']+_0x58dfc7(0x24b)+_0x1cee23['error']));}for(const _0x516ba3 of _0x39f288[_0x58dfc7(0x26f)]){_0x516ba3[_0x58dfc7(0x292)]===_0x58dfc7(0x27c)&&console['log'](a4_0x3092f2['red']('\x20\x20Prompt\x20\x22'+_0x516ba3[_0x58dfc7(0x27a)]+'\x22:\x20'+_0x516ba3[_0x58dfc7(0x27c)]));}for(const _0x2c5faf of _0x39f288[_0x58dfc7(0x1f9)]){_0x2c5faf[_0x58dfc7(0x292)]===_0x58dfc7(0x27c)&&console['log'](a4_0x3092f2[_0x58dfc7(0x251)](_0x58dfc7(0x298)+_0x2c5faf[_0x58dfc7(0x27a)]+_0x58dfc7(0x24b)+_0x2c5faf['error']));}return 0x1;}console['log'](a4_0x3092f2[_0x58dfc7(0x229)](_0x58dfc7(0x1f7)+(_0x1bbdea+_0x364c5c)+_0x58dfc7(0x253)+_0x39f288[_0x58dfc7(0x267)]+'\x27'));const _0x23cc95=getLLMProjectUrl(_0x586cfd,_0x39f288[_0x58dfc7(0x288)]);return console[_0x58dfc7(0x29a)](_0x58dfc7(0x242)+a4_0x3092f2[_0x58dfc7(0x23a)](_0x23cc95)),0x0;}}
|
|
1
|
+
const a4_0x48458a=a4_0x2f87;(function(_0x36d512,_0xc73dff){const _0x50c249=a4_0x2f87,_0x597b0a=_0x36d512();while(!![]){try{const _0x14343d=-parseInt(_0x50c249(0xd2))/0x1*(-parseInt(_0x50c249(0x13c))/0x2)+-parseInt(_0x50c249(0x12f))/0x3+parseInt(_0x50c249(0x173))/0x4+parseInt(_0x50c249(0x134))/0x5*(-parseInt(_0x50c249(0xef))/0x6)+parseInt(_0x50c249(0xd0))/0x7+-parseInt(_0x50c249(0x158))/0x8*(parseInt(_0x50c249(0x179))/0x9)+parseInt(_0x50c249(0xe3))/0xa*(-parseInt(_0x50c249(0xcd))/0xb);if(_0x14343d===_0xc73dff)break;else _0x597b0a['push'](_0x597b0a['shift']());}catch(_0x3e3d57){_0x597b0a['push'](_0x597b0a['shift']());}}}(a4_0x2fb7,0x9c09c));function a4_0x2f87(_0x5d5057,_0x1a360f){_0x5d5057=_0x5d5057-0xc9;const _0x2fb7cc=a4_0x2fb7();let _0x2f87e6=_0x2fb7cc[_0x5d5057];return _0x2f87e6;}import a4_0x19c80c from'chalk';import a4_0x155d79 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';function a4_0x2fb7(){const _0x1e9774=['yes','Pulling\x20agent\x20\x22','\x20|\x20','Dry\x20run\x20-\x20no\x20files\x20written','Project\x20cloned\x20with\x20errors','agent:clone','Cannot\x20clone\x20from\x20context\x20project\x20\x22','Agent:\x20','2248636AZAEKg','repeat','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','force','\x20total','1098JEZgIN','Would\x20pull\x20agent:\x20','sourceProjectName','\x20\x20Experimental\x20Artifact\x20\x22','cwd-config','no_local_folder','new','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','pushProject','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x0aPush\x20','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','MISSING_ARGUMENT','projectDir','44GXBLXE','output','projectName','8071679CVokBW','\x20files?','6XRikfy','experimentalArtifacts','\x0aPull\x20summary\x20for\x20\x27','agent.yml','Agent\x20pulled\x20successfully','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','green','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','experimentalKnowledgeBases','\x0aPush\x20summary\x20for\x20\x27','\x20\x20Prompts:\x20','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','isNew','no_context','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x20\x20Experimental\x20Artifacts:\x20','\x20\x20tdx\x20agent\x20clone\x20agents/','936560dgGkTm','yellow','outputPath','Would\x20clone:','\x20resources\x20to\x20\x27','agentId','Pushing\x20to\x20project...','\x20=\x20','session','\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','errors','\x0a✔\x20Pushed\x20','1077630CvKSYL','unchanged','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','Output:\x20','dim','found','agent','agents','Summary:','Using\x20project:\x20','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','reason','Chat:\x20','utf-8','Project:\x20','llm_project','Failed\x20to\x20push\x20agent:\x20','cyan','log','\x0aChanges\x20to\x20agent\x20\x27','\x20\x20Text\x20Knowledge\x20Base\x20\x22','newProjectName','action','\x20--profile\x20','\x20updated','\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','llm','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','Using\x20local\x20project:\x20','\x20\x20Agent\x20\x22','cloneProject','Dry\x20run\x20-\x20no\x20changes\x20made','\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\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x20files\x20to\x20','New\x20project:\x20','\x20\x20Source:\x20','\x20\x20Integration\x20\x22','red','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','Errors:','-\x20no\x20files\x20written','Using\x20project\x20from\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','Agent\x20','pushAgent','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','outputDir','\x20--name\x20','\x20resources?','projectId','Cloning\x20\x22','\x22...','Clone\x20\x22','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','New\x20project\x20name\x20is\x20required','context','knowledgeBases','pullAgent','Source:\x20','push','created','463188bTmjoP','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x20new','agentName','\x22\x20to\x20\x22','10JtthSU','\x20errors','Output\x20path:\x20','updated','name','newProjectId','\x22\x20from\x20project\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)','356276OEVsCv','\x20\x20Knowledge\x20Bases:\x20','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','textKnowledgeBases','counts','\x0aProject\x20pushed\x20with\x20errors','-\x20nothing\x20pushed','Would\x20push\x20agent:\x20','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','pullProject','hasChanges','description','Pushing\x20agent\x20from\x20\x22','Using\x20current\x20project:\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x20\x20tdx\x20agent\x20pull\x20','\x22:\x20','parse','total','\x20created','INVALID_ARGUMENT','Using\x20project\x20from\x20context:\x20','Cancelled','diff','Analyzing\x20project\x20\x22','error','prompts','\x20\x20Agents:\x20','82408BvIMXD','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','execute','tdx.json','integrations','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20changed','join','Analyzing\x20changes\x20to\x20push...','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','\x20\x20Integrations:\x20','agent:pull','\x0aError:','dryRun','dirname','profile','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','cwd','\x20\x20Prompt\x20\x22'];a4_0x2fb7=function(){return _0x1e9774;};return a4_0x2fb7();}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(_0x55d249){const _0x11b033=a4_0x2f87,_0x146373=[];if(_0x55d249[_0x11b033(0x14e)]!==undefined)_0x146373['push'](_0x55d249[_0x11b033(0x14e)]+_0x11b033(0x178));if(_0x55d249[_0x11b033(0x17f)]!==undefined&&_0x55d249[_0x11b033(0x17f)]>0x0)_0x146373[_0x11b033(0x12d)](a4_0x19c80c[_0x11b033(0xd8)](_0x55d249[_0x11b033(0x17f)]+'\x20new'));if(_0x55d249[_0x11b033(0x12e)]!==undefined&&_0x55d249[_0x11b033(0x12e)]>0x0)_0x146373[_0x11b033(0x12d)](a4_0x19c80c[_0x11b033(0xd8)](_0x55d249[_0x11b033(0x12e)]+_0x11b033(0x14f)));if(_0x55d249['updated']!==undefined&&_0x55d249[_0x11b033(0x137)]>0x0)_0x146373[_0x11b033(0x12d)](a4_0x19c80c['yellow'](_0x55d249[_0x11b033(0x137)]+_0x11b033(0x107)));if(_0x55d249[_0x11b033(0xf0)]!==undefined&&_0x55d249[_0x11b033(0xf0)]>0x0)_0x146373['push'](a4_0x19c80c['gray'](_0x55d249['unchanged']+'\x20unchanged'));if(_0x55d249['errors']!==undefined&&_0x55d249[_0x11b033(0xed)]>0x0)_0x146373[_0x11b033(0x12d)](a4_0x19c80c[_0x11b033(0x116)](_0x55d249['errors']+_0x11b033(0x135)));return _0x146373[_0x11b033(0x15f)](',\x20');}function displayDiffs(_0x6271c0,_0x1dba97,_0x3fe093,_0x2f8c2d,_0x4f45c0,_0x357ac6,_0x1bf95e){const _0x273d8d=a4_0x2f87;for(const _0x3f63a1 of _0x6271c0){if(_0x3f63a1[_0x273d8d(0x153)]){const _0x3ce3bb=_0x3f63a1[_0x273d8d(0x132)]||_0x3f63a1[_0x273d8d(0x138)];console['log'](_0x273d8d(0x102)+_0x3ce3bb+'\x27:'),console[_0x273d8d(0x101)]('─'[_0x273d8d(0x174)](0x3c)),console[_0x273d8d(0x101)](_0x3f63a1['diff']),console[_0x273d8d(0x101)]('─'['repeat'](0x3c));}}for(const _0x499ca2 of _0x1dba97){_0x499ca2[_0x273d8d(0x153)]&&(console['log'](_0x273d8d(0xca)+_0x499ca2[_0x273d8d(0x138)]+'\x27:'),console[_0x273d8d(0x101)]('─'[_0x273d8d(0x174)](0x3c)),console['log'](_0x499ca2['diff']),console[_0x273d8d(0x101)]('─'['repeat'](0x3c)));}for(const _0x2e9d4a of _0x3fe093){_0x2e9d4a[_0x273d8d(0x153)]&&(console[_0x273d8d(0x101)](_0x273d8d(0x111)+_0x2e9d4a[_0x273d8d(0x138)]+'\x27:'),console[_0x273d8d(0x101)]('─'[_0x273d8d(0x174)](0x3c)),console[_0x273d8d(0x101)](_0x2e9d4a[_0x273d8d(0x153)]),console[_0x273d8d(0x101)]('─'[_0x273d8d(0x174)](0x3c)));}for(const _0x5e1495 of _0x2f8c2d){_0x5e1495[_0x273d8d(0x153)]&&(console[_0x273d8d(0x101)]('\x0aChanges\x20to\x20prompt\x20\x27'+_0x5e1495['name']+'\x27:'),console[_0x273d8d(0x101)]('─'[_0x273d8d(0x174)](0x3c)),console['log'](_0x5e1495[_0x273d8d(0x153)]),console['log']('─'[_0x273d8d(0x174)](0x3c)));}for(const _0x6b9ae1 of _0x4f45c0){_0x6b9ae1[_0x273d8d(0x153)]&&(console[_0x273d8d(0x101)]('\x0aChanges\x20to\x20integration\x20\x27'+_0x6b9ae1[_0x273d8d(0x138)]+'\x27:'),console['log']('─'[_0x273d8d(0x174)](0x3c)),console[_0x273d8d(0x101)](_0x6b9ae1[_0x273d8d(0x153)]),console[_0x273d8d(0x101)]('─'['repeat'](0x3c)));}for(const _0x42adab of _0x357ac6){_0x42adab[_0x273d8d(0x153)]&&(console[_0x273d8d(0x101)](_0x273d8d(0x13e)+_0x42adab[_0x273d8d(0x138)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x273d8d(0x101)](_0x42adab[_0x273d8d(0x153)]),console[_0x273d8d(0x101)]('─'[_0x273d8d(0x174)](0x3c)));}for(const _0x3bc09b of _0x1bf95e){_0x3bc09b['diff']&&(console[_0x273d8d(0x101)](_0x273d8d(0x175)+_0x3bc09b[_0x273d8d(0x138)]+'\x27:'),console['log']('─'[_0x273d8d(0x174)](0x3c)),console['log'](_0x3bc09b['diff']),console[_0x273d8d(0x101)]('─'[_0x273d8d(0x174)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x48458a(0x138)]=a4_0x48458a(0x163);['description']=a4_0x48458a(0x130);async['execute'](_0x5b442a){const _0x115e0d=a4_0x48458a,{options:_0x58135a,args:_0x4e37de,tdx:_0x1ee97c}=_0x5b442a,_0x1c47c5=_0x4e37de[0x0],_0x219b74=_0x4e37de[0x1],_0x3b311f=_0x58135a[_0x115e0d(0xce)],_0x208593=_0x58135a['dryRun'],_0x53a468=_0x58135a['force'],_0x280738=_0x58135a[_0x115e0d(0x16b)],_0x46d683=_0x58135a['llmProject'],_0x3e458f=_0x58135a[_0x115e0d(0xf5)];let _0x20ae02;if(_0x1c47c5){const _0x1e2815=a4_0x155d79[_0x115e0d(0x15f)](_0x1c47c5,_0x115e0d(0x15b));if(existsSync(_0x1e2815))try{const _0x42e8e6=JSON[_0x115e0d(0x14d)](readFileSync(_0x1e2815,_0x115e0d(0xfc)));_0x42e8e6[_0x115e0d(0xfe)]&&(_0x20ae02={'llm_project':_0x42e8e6['llm_project']});}catch{}}const _0x520a63=findAgentConfigPath(process[_0x115e0d(0x169)]());let _0xb60dc5;if(_0x520a63)try{const _0x3bd402=JSON['parse'](readFileSync(_0x520a63,_0x115e0d(0xfc)));_0x3bd402[_0x115e0d(0xfe)]&&(_0xb60dc5={'llm_project':_0x3bd402[_0x115e0d(0xfe)]});}catch{}const _0x3e0598=resolveAgentPullArgs({'arg':_0x1c47c5,'agentNameArg':_0x219b74,'agentFlag':_0x3e458f,'contextProject':_0x46d683,'argDirConfig':_0x20ae02,'cwdConfigPath':_0x520a63||undefined,'cwdConfig':_0xb60dc5}),{projectNameOrId:_0x42f41a,targetAgentName:_0x266362,existingOutputDir:_0x284fad,source:_0xa569a2}=_0x3e0598;if(_0xa569a2==='arg-dir')console[_0x115e0d(0x101)](a4_0x19c80c[_0x115e0d(0xf3)](_0x115e0d(0x11a)+a4_0x155d79['join'](_0x1c47c5,_0x115e0d(0x15b))+':\x20'+_0x42f41a));else{if(_0xa569a2===_0x115e0d(0x17d))console[_0x115e0d(0x101)](a4_0x19c80c[_0x115e0d(0xf3)](_0x115e0d(0xf8)+_0x42f41a));else _0xa569a2===_0x115e0d(0x129)&&console[_0x115e0d(0x101)](a4_0x19c80c['dim'](_0x115e0d(0x151)+_0x42f41a));}if(!_0x42f41a)return _0x3e458f?(console['log'](a4_0x19c80c[_0x115e0d(0xe4)](_0x115e0d(0xdd))),console[_0x115e0d(0x101)](_0x115e0d(0xf9)),console[_0x115e0d(0x101)](_0x115e0d(0x144))):(console[_0x115e0d(0x101)](a4_0x19c80c[_0x115e0d(0xe4)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x115e0d(0x101)]('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)'),console[_0x115e0d(0x101)](_0x115e0d(0x11b)),console[_0x115e0d(0x101)](_0x115e0d(0x108)),console[_0x115e0d(0x101)](_0x115e0d(0x10f)),console[_0x115e0d(0x101)](_0x115e0d(0xec))),0x1;if(_0x266362){const {data:_0x1e77f0}=await withSpinner(_0x115e0d(0x16c)+_0x266362+_0x115e0d(0x13a)+_0x42f41a+'\x22...',()=>_0x1ee97c[_0x115e0d(0x109)][_0x115e0d(0x12b)](_0x42f41a,_0x266362,_0x3b311f,{'dryRun':_0x208593,'force':_0x53a468}));if(_0x208593)return console['log'](a4_0x19c80c['yellow'](_0x115e0d(0x16e))),console[_0x115e0d(0x101)](_0x115e0d(0x17a)+_0x1e77f0[_0x115e0d(0x132)]),console['log'](_0x115e0d(0x136)+_0x1e77f0[_0x115e0d(0xe5)]),_0x1e77f0[_0x115e0d(0x153)]&&(console['log']('\x0aChanges:'),console[_0x115e0d(0x101)]('─'[_0x115e0d(0x174)](0x3c)),console[_0x115e0d(0x101)](_0x1e77f0['diff']),console[_0x115e0d(0x101)]('─'['repeat'](0x3c))),0x0;return console[_0x115e0d(0x101)](a4_0x19c80c[_0x115e0d(0xd8)](_0x115e0d(0xd6))),console[_0x115e0d(0x101)](_0x115e0d(0x172)+_0x1e77f0[_0x115e0d(0x132)]),console['log'](_0x115e0d(0xf2)+_0x1e77f0['outputPath']),console[_0x115e0d(0x101)]('Status:\x20'+(_0x1e77f0[_0x115e0d(0xde)]?a4_0x19c80c[_0x115e0d(0xd8)](_0x115e0d(0x17f)):_0x1e77f0[_0x115e0d(0x146)]?a4_0x19c80c[_0x115e0d(0xe4)](_0x115e0d(0x137)):a4_0x19c80c['gray'](_0x115e0d(0xf0)))),0x0;}const _0x2a3cdf=_0x284fad||_0x3b311f,{data:_0x1bef86}=await withSpinner(_0x115e0d(0x154)+_0x42f41a+_0x115e0d(0x124),()=>_0x1ee97c[_0x115e0d(0x109)][_0x115e0d(0x145)](_0x42f41a,_0x2a3cdf,{'dryRun':!![]})),_0x36ed24=_0x1bef86[_0x115e0d(0x140)][_0x115e0d(0xf6)][_0x115e0d(0x17f)]+_0x1bef86[_0x115e0d(0x140)][_0x115e0d(0x12a)][_0x115e0d(0x17f)]+_0x1bef86[_0x115e0d(0x140)]['textKnowledgeBases']['new']+_0x1bef86['counts'][_0x115e0d(0x156)]['new']+_0x1bef86[_0x115e0d(0x140)][_0x115e0d(0x15c)][_0x115e0d(0x17f)]+_0x1bef86[_0x115e0d(0x140)]['experimentalKnowledgeBases'][_0x115e0d(0x17f)]+_0x1bef86[_0x115e0d(0x140)]['experimentalArtifacts'][_0x115e0d(0x17f)],_0x121ac6=_0x1bef86[_0x115e0d(0x140)][_0x115e0d(0xf6)]['updated']+_0x1bef86[_0x115e0d(0x140)][_0x115e0d(0x12a)]['updated']+_0x1bef86['counts'][_0x115e0d(0x13f)][_0x115e0d(0x137)]+_0x1bef86[_0x115e0d(0x140)][_0x115e0d(0x156)][_0x115e0d(0x137)]+_0x1bef86[_0x115e0d(0x140)][_0x115e0d(0x15c)][_0x115e0d(0x137)]+_0x1bef86[_0x115e0d(0x140)][_0x115e0d(0xda)][_0x115e0d(0x137)]+_0x1bef86['counts'][_0x115e0d(0xd3)][_0x115e0d(0x137)],_0x2341ff=_0x1bef86[_0x115e0d(0x140)]['agents']['unchanged']+_0x1bef86[_0x115e0d(0x140)][_0x115e0d(0x12a)][_0x115e0d(0xf0)]+_0x1bef86[_0x115e0d(0x140)]['textKnowledgeBases'][_0x115e0d(0xf0)]+_0x1bef86[_0x115e0d(0x140)][_0x115e0d(0x156)]['unchanged']+_0x1bef86[_0x115e0d(0x140)][_0x115e0d(0x15c)][_0x115e0d(0xf0)]+_0x1bef86[_0x115e0d(0x140)][_0x115e0d(0xda)]['unchanged']+_0x1bef86[_0x115e0d(0x140)][_0x115e0d(0xd3)][_0x115e0d(0xf0)];console['log'](_0x115e0d(0xd4)+_0x1bef86[_0x115e0d(0xcf)]+'\x27:'),console[_0x115e0d(0x101)]('\x20\x20'+a4_0x19c80c[_0x115e0d(0xd8)]('+\x20'+_0x36ed24+'\x20new')+_0x115e0d(0x16d)+a4_0x19c80c['yellow']('~\x20'+_0x121ac6+'\x20changed')+_0x115e0d(0x16d)+a4_0x19c80c[_0x115e0d(0xf3)]('=\x20'+_0x2341ff+'\x20unchanged')),console[_0x115e0d(0x101)]('\x20\x20Agents:\x20'+formatCountSummary(_0x1bef86[_0x115e0d(0x140)][_0x115e0d(0xf6)])),console[_0x115e0d(0x101)](_0x115e0d(0x13d)+formatCountSummary(_0x1bef86[_0x115e0d(0x140)][_0x115e0d(0x12a)])),console[_0x115e0d(0x101)](_0x115e0d(0x182)+formatCountSummary(_0x1bef86[_0x115e0d(0x140)][_0x115e0d(0x13f)])),console[_0x115e0d(0x101)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x1bef86['counts'][_0x115e0d(0x156)])),console[_0x115e0d(0x101)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x1bef86[_0x115e0d(0x140)][_0x115e0d(0x15c)]));const _0x273c35=_0x1bef86[_0x115e0d(0x140)][_0x115e0d(0xda)][_0x115e0d(0x14e)]>0x0||_0x1bef86[_0x115e0d(0x140)][_0x115e0d(0xd3)][_0x115e0d(0x14e)]>0x0;_0x273c35&&(console[_0x115e0d(0x101)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x1bef86[_0x115e0d(0x140)][_0x115e0d(0xda)])),console[_0x115e0d(0x101)](_0x115e0d(0xe1)+formatCountSummary(_0x1bef86[_0x115e0d(0x140)][_0x115e0d(0xd3)])));console['log']('\x20\x20Target:\x20'+a4_0x19c80c['cyan'](_0x1bef86[_0x115e0d(0x11f)])),displayDiffs(_0x1bef86[_0x115e0d(0xf6)],_0x1bef86[_0x115e0d(0x12a)],_0x1bef86['textKnowledgeBases'],_0x1bef86[_0x115e0d(0x156)],_0x1bef86[_0x115e0d(0x15c)],_0x1bef86['experimentalKnowledgeBases'],_0x1bef86[_0x115e0d(0xd3)]);if(_0x208593)return console[_0x115e0d(0x101)](a4_0x19c80c[_0x115e0d(0xe4)](_0x115e0d(0x168))),0x0;if(_0x36ed24===0x0&&_0x121ac6===0x0)return console['log'](a4_0x19c80c['green'](_0x115e0d(0xf1))),saveSessionContext({'llm_project':_0x1bef86[_0x115e0d(0xcf)]},_0x58135a[_0x115e0d(0xeb)]),console['log'](a4_0x19c80c[_0x115e0d(0xd8)]('✔\x20Context\x20set:\x20'+a4_0x19c80c[_0x115e0d(0xf3)](_0x115e0d(0xfe))+_0x115e0d(0xea)+a4_0x19c80c[_0x115e0d(0x100)](_0x1bef86[_0x115e0d(0xcf)]))),0x0;if(!_0x280738&&!_0x53a468){if(!isInteractive())return console[_0x115e0d(0x155)](a4_0x19c80c['red'](_0x115e0d(0x164)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x115e0d(0x155)](a4_0x19c80c[_0x115e0d(0xf3)](_0x115e0d(0x180))),0x1;const _0x56a5cd=await confirmKey('\x0aWrite\x20'+(_0x36ed24+_0x121ac6)+_0x115e0d(0xd1));if(!_0x56a5cd)return console['log'](a4_0x19c80c[_0x115e0d(0xe4)](_0x115e0d(0x152)),_0x115e0d(0x119)),0x1;}const {data:_0xad92c2}=await withSpinner('Writing\x20files...',()=>_0x1ee97c[_0x115e0d(0x109)]['pullProject'](_0x42f41a,_0x2a3cdf,{'force':_0x53a468}));return console[_0x115e0d(0x101)](a4_0x19c80c[_0x115e0d(0xd8)]('\x0a✔\x20Pulled\x20'+(_0x36ed24+_0x121ac6)+_0x115e0d(0x112)+_0xad92c2['outputDir'])),saveSessionContext({'llm_project':_0xad92c2['projectName']},_0x58135a[_0x115e0d(0xeb)]),console[_0x115e0d(0x101)](a4_0x19c80c[_0x115e0d(0xd8)]('✔\x20Context\x20set:\x20'+a4_0x19c80c['dim'](_0x115e0d(0xfe))+_0x115e0d(0xea)+a4_0x19c80c[_0x115e0d(0x100)](_0xad92c2[_0x115e0d(0xcf)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']=a4_0x48458a(0x170);[a4_0x48458a(0x147)]=a4_0x48458a(0x10a);async['execute'](_0x37052d){const _0x1224df=a4_0x48458a,{options:_0x1092b3,args:_0x316597,tdx:_0x14683a}=_0x37052d,_0x5f15e2=_0x316597[0x0],_0x160faf=_0x1092b3[_0x1224df(0x138)],_0x3456ff=_0x1092b3['dryRun'],_0x58d323=_0x1092b3[_0x1224df(0x16b)],_0x22074a=_0x1092b3['site'],_0x1e0e3b=_0x1092b3['llmProject'];let _0x424527;const _0x1f51ce=findAgentConfigPath(process[_0x1224df(0x169)]());if(_0x5f15e2){const _0x3924a7=a4_0x155d79[_0x1224df(0x15f)](_0x5f15e2,_0x1224df(0x15b));existsSync(_0x3924a7)?(_0x424527=_0x5f15e2,console[_0x1224df(0x101)](a4_0x19c80c[_0x1224df(0xf3)]('Using\x20local\x20project:\x20'+_0x5f15e2))):_0x424527=_0x5f15e2;}else{if(_0x1f51ce)_0x424527=a4_0x155d79[_0x1224df(0x166)](_0x1f51ce),console[_0x1224df(0x101)](a4_0x19c80c['dim'](_0x1224df(0x149)+_0x424527));else{if(_0x1e0e3b){const _0x1a07a8=sanitizeForFilesystem(_0x1e0e3b);let _0x494761=_0x1a07a8,_0x4a3e69=a4_0x155d79['join'](process[_0x1224df(0x169)](),_0x1224df(0xf6),_0x1a07a8,_0x1224df(0x15b));if(!existsSync(_0x4a3e69)){const _0x5b4f2c=normalizeName(_0x1e0e3b),_0x2803d5=a4_0x155d79[_0x1224df(0x15f)](process[_0x1224df(0x169)](),'agents',_0x5b4f2c,_0x1224df(0x15b));existsSync(_0x2803d5)&&(_0x494761=_0x5b4f2c,_0x4a3e69=_0x2803d5);}if(existsSync(_0x4a3e69))_0x424527=a4_0x155d79[_0x1224df(0x166)](_0x4a3e69),console[_0x1224df(0x101)](a4_0x19c80c[_0x1224df(0xf3)](_0x1224df(0x10b)+_0x424527));else{const _0x219707=_0x1092b3[_0x1224df(0x167)];if(_0x219707)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x1224df(0x171)+_0x1e0e3b+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x1224df(0x11e)+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+(_0x1224df(0x14b)+_0x1e0e3b+'\x0a')+(_0x1224df(0xe2)+_0x494761+_0x1224df(0x120)+(_0x160faf||'<new-name>')+_0x1224df(0x106)+_0x219707)});_0x424527=_0x1e0e3b,console[_0x1224df(0x101)](a4_0x19c80c[_0x1224df(0xf3)]('Using\x20context\x20project:\x20'+_0x1e0e3b));}}}}if(!_0x424527)return console[_0x1224df(0x101)](a4_0x19c80c[_0x1224df(0xe4)](_0x1224df(0x159))),console['log'](_0x1224df(0xc9)),console[_0x1224df(0x101)](_0x1224df(0x110)),console[_0x1224df(0x101)](_0x1224df(0x13b)),console[_0x1224df(0x101)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x160faf)throw new SDKError(ErrorCode[_0x1224df(0xcb)],_0x1224df(0x128),undefined,{'helpText':_0x1224df(0xd7)});if(!_0x58d323&&!_0x3456ff){if(!isInteractive())return console[_0x1224df(0x155)](a4_0x19c80c[_0x1224df(0x116)](_0x1224df(0x164)),_0x1224df(0x15d)),console['error'](a4_0x19c80c['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x2d1e37=await confirmKey(_0x1224df(0x125)+_0x424527+'\x22\x20to\x20new\x20project\x20\x22'+_0x160faf+'\x22?');if(!_0x2d1e37)return console[_0x1224df(0x101)](a4_0x19c80c[_0x1224df(0xe4)](_0x1224df(0x152))),0x1;}const {data:_0x559be6}=await withSpinner(_0x1224df(0x123)+_0x424527+_0x1224df(0x133)+_0x160faf+'\x22...',()=>_0x14683a[_0x1224df(0x109)][_0x1224df(0x10d)](_0x424527,_0x160faf,{'dryRun':_0x3456ff}));if(_0x3456ff){console['log'](a4_0x19c80c[_0x1224df(0xe4)](_0x1224df(0x10e))),console[_0x1224df(0x101)](_0x1224df(0x12c)+_0x559be6['sourceProjectName']),console[_0x1224df(0x101)](_0x1224df(0x113)+_0x160faf),console[_0x1224df(0x101)](_0x1224df(0xe6)),console[_0x1224df(0x101)](_0x1224df(0x157)+_0x559be6[_0x1224df(0x140)][_0x1224df(0xf6)][_0x1224df(0x12e)]),console[_0x1224df(0x101)](_0x1224df(0x13d)+_0x559be6['counts'][_0x1224df(0x12a)][_0x1224df(0x12e)]),console[_0x1224df(0x101)](_0x1224df(0xdc)+_0x559be6['counts'][_0x1224df(0x156)][_0x1224df(0x12e)]);const _0x1fc462=_0x559be6[_0x1224df(0x140)][_0x1224df(0xda)][_0x1224df(0x12e)]>0x0||_0x559be6[_0x1224df(0x140)][_0x1224df(0xd3)][_0x1224df(0x12e)]>0x0;return _0x1fc462&&(console[_0x1224df(0x101)](_0x1224df(0x117)+_0x559be6[_0x1224df(0x140)][_0x1224df(0xda)][_0x1224df(0x12e)]),console[_0x1224df(0x101)](_0x1224df(0xe1)+_0x559be6[_0x1224df(0x140)][_0x1224df(0xd3)][_0x1224df(0x12e)])),0x0;}const _0x3e7bac=_0x559be6[_0x1224df(0x140)][_0x1224df(0xf6)][_0x1224df(0xed)]>0x0||_0x559be6['counts'][_0x1224df(0x12a)]['errors']>0x0||_0x559be6[_0x1224df(0x140)][_0x1224df(0x156)][_0x1224df(0xed)]>0x0||_0x559be6[_0x1224df(0x140)][_0x1224df(0xda)][_0x1224df(0xed)]>0x0||_0x559be6[_0x1224df(0x140)][_0x1224df(0xd3)][_0x1224df(0xed)]>0x0;_0x3e7bac?console[_0x1224df(0x101)](a4_0x19c80c[_0x1224df(0xe4)](_0x1224df(0x16f))):console[_0x1224df(0x101)](a4_0x19c80c[_0x1224df(0xd8)]('Project\x20cloned\x20successfully'));console[_0x1224df(0x101)](_0x1224df(0x12c)+_0x559be6[_0x1224df(0x17b)]),console[_0x1224df(0x101)](_0x1224df(0x113)+_0x559be6[_0x1224df(0x104)]),console['log']('New\x20project\x20ID:\x20'+_0x559be6[_0x1224df(0x139)]),console[_0x1224df(0x101)](),console[_0x1224df(0x101)](_0x1224df(0xf7)),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x559be6[_0x1224df(0x140)][_0x1224df(0xf6)])),console['log']('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x559be6[_0x1224df(0x140)][_0x1224df(0x12a)])),console[_0x1224df(0x101)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x559be6[_0x1224df(0x140)][_0x1224df(0x156)])),console[_0x1224df(0x101)](_0x1224df(0x162)+formatCountSummary(_0x559be6[_0x1224df(0x140)][_0x1224df(0x15c)]));const _0x1962a5=_0x559be6[_0x1224df(0x140)][_0x1224df(0xda)][_0x1224df(0x12e)]>0x0||_0x559be6['counts'][_0x1224df(0xda)][_0x1224df(0x137)]>0x0||_0x559be6[_0x1224df(0x140)][_0x1224df(0xda)]['unchanged']>0x0||_0x559be6[_0x1224df(0x140)][_0x1224df(0xd3)][_0x1224df(0x12e)]>0x0||_0x559be6[_0x1224df(0x140)][_0x1224df(0xd3)][_0x1224df(0x137)]>0x0||_0x559be6[_0x1224df(0x140)][_0x1224df(0xd3)][_0x1224df(0xf0)]>0x0;_0x1962a5&&(console[_0x1224df(0x101)](_0x1224df(0x117)+formatCountSummary(_0x559be6['counts'][_0x1224df(0xda)])),console[_0x1224df(0x101)](_0x1224df(0xe1)+formatCountSummary(_0x559be6['counts']['experimentalArtifacts'])));if(_0x3e7bac){console[_0x1224df(0x101)](),console[_0x1224df(0x101)](a4_0x19c80c[_0x1224df(0x116)](_0x1224df(0x118)));for(const _0x557489 of _0x559be6['agents']){_0x557489[_0x1224df(0x105)]===_0x1224df(0x155)&&console[_0x1224df(0x101)](a4_0x19c80c[_0x1224df(0x116)](_0x1224df(0x10c)+_0x557489[_0x1224df(0x132)]+'\x22:\x20'+_0x557489[_0x1224df(0x155)]));}for(const _0x3ba671 of _0x559be6['knowledgeBases']){_0x3ba671[_0x1224df(0x105)]===_0x1224df(0x155)&&console[_0x1224df(0x101)](a4_0x19c80c[_0x1224df(0x116)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x3ba671[_0x1224df(0x138)]+_0x1224df(0x14c)+_0x3ba671[_0x1224df(0x155)]));}for(const _0x217bf0 of _0x559be6[_0x1224df(0x156)]){_0x217bf0['action']===_0x1224df(0x155)&&console['log'](a4_0x19c80c[_0x1224df(0x116)](_0x1224df(0x16a)+_0x217bf0[_0x1224df(0x138)]+_0x1224df(0x14c)+_0x217bf0[_0x1224df(0x155)]));}for(const _0x50c7ae of _0x559be6[_0x1224df(0x15c)]){_0x50c7ae[_0x1224df(0x105)]==='error'&&console[_0x1224df(0x101)](a4_0x19c80c[_0x1224df(0x116)]('\x20\x20Integration\x20\x22'+_0x50c7ae[_0x1224df(0x138)]+_0x1224df(0x14c)+_0x50c7ae[_0x1224df(0x155)]));}for(const _0x51c4c6 of _0x559be6[_0x1224df(0xda)]){_0x51c4c6[_0x1224df(0x105)]===_0x1224df(0x155)&&console[_0x1224df(0x101)](a4_0x19c80c[_0x1224df(0x116)](_0x1224df(0xe0)+_0x51c4c6[_0x1224df(0x138)]+_0x1224df(0x14c)+_0x51c4c6[_0x1224df(0x155)]));}for(const _0x5cea68 of _0x559be6['experimentalArtifacts']){_0x5cea68['action']===_0x1224df(0x155)&&console['log'](a4_0x19c80c[_0x1224df(0x116)](_0x1224df(0x17c)+_0x5cea68[_0x1224df(0x138)]+_0x1224df(0x14c)+_0x5cea68[_0x1224df(0x155)]));}return 0x1;}console[_0x1224df(0x101)]();const _0x3a798c=getLLMProjectUrl(_0x22074a,_0x559be6[_0x1224df(0x139)]);return console[_0x1224df(0x101)]('Project:\x20'+a4_0x19c80c[_0x1224df(0x100)](_0x3a798c)),0x0;}}export class AgentPushCommand extends BaseCommand{['name']='agent:push';[a4_0x48458a(0x147)]=a4_0x48458a(0xd9);async[a4_0x48458a(0x15a)](_0xd73fd1){const _0x5932a7=a4_0x48458a,{options:_0x7322de,args:_0x28001b,tdx:_0x2db746}=_0xd73fd1;let _0x19def2=_0x28001b[0x0]||process[_0x5932a7(0x169)]();const _0x113d77=_0x7322de[_0x5932a7(0x165)],_0x590757=_0x7322de[_0x5932a7(0x177)],_0x3d0ec5=_0x7322de[_0x5932a7(0x16b)],_0x5c10ba=_0x7322de['site'],_0x5eabbb=a4_0x155d79['join'](_0x19def2,_0x5932a7(0xd5)),_0x3e1128=existsSync(_0x5eabbb);if(_0x3e1128){const {data:_0x555464}=await withSpinner(_0x5932a7(0x148)+_0x19def2+_0x5932a7(0x124),()=>_0x2db746[_0x5932a7(0x109)][_0x5932a7(0x11d)](_0x19def2,{'dryRun':_0x113d77,'force':_0x590757}));if(_0x113d77)return console[_0x5932a7(0x101)](a4_0x19c80c[_0x5932a7(0xe4)](_0x5932a7(0x10e))),console[_0x5932a7(0x101)](_0x5932a7(0x143)+_0x555464[_0x5932a7(0x132)]),0x0;if(_0x555464[_0x5932a7(0x105)]===_0x5932a7(0x155))return console[_0x5932a7(0x101)](a4_0x19c80c[_0x5932a7(0x116)](_0x5932a7(0xff)+_0x555464['error'])),0x1;console[_0x5932a7(0x101)](a4_0x19c80c[_0x5932a7(0xd8)](_0x5932a7(0x11c)+_0x555464[_0x5932a7(0x105)]+'\x20successfully')),console[_0x5932a7(0x101)](_0x5932a7(0x172)+_0x555464[_0x5932a7(0x132)]);if(_0x555464[_0x5932a7(0xe8)]&&_0x555464[_0x5932a7(0x122)]){const _0x31b493=getLLMAgentChatUrl(_0x5c10ba,_0x555464[_0x5932a7(0x122)],_0x555464['agentId']);console[_0x5932a7(0x101)](_0x5932a7(0xfb)+a4_0x19c80c[_0x5932a7(0x100)](_0x31b493));}return 0x0;}const _0x378a05=_0x7322de['llmProject'],_0x2a8197=resolveProjectFromContext(_0x19def2,_0x378a05);if(_0x2a8197[_0x5932a7(0xf4)])_0x19def2=_0x2a8197[_0x5932a7(0xcc)],_0x2a8197['source']===_0x5932a7(0x129)&&console[_0x5932a7(0x101)](a4_0x19c80c['dim'](_0x5932a7(0xf8)+_0x19def2));else{let _0x5a7080=_0x5932a7(0x176);_0x2a8197['reason']===_0x5932a7(0x17e)&&(_0x5a7080=_0x2a8197['message']+_0x5932a7(0x161)+_0x2a8197['llmProject']+_0x5932a7(0x126));throw new SDKError(ErrorCode[_0x5932a7(0x150)],_0x2a8197[_0x5932a7(0xfa)]===_0x5932a7(0xdf)?_0x2a8197['message']:'No\x20tdx.json\x20found\x20in\x20'+_0x19def2,undefined,{'helpText':_0x5a7080});}const {data:_0x51cc15}=await withSpinner(_0x5932a7(0x160),()=>_0x2db746[_0x5932a7(0x109)][_0x5932a7(0x181)](_0x19def2,{'dryRun':!![]})),_0x2b2501=_0x51cc15[_0x5932a7(0x140)][_0x5932a7(0xf6)]['errors']>0x0;if(_0x2b2501){console[_0x5932a7(0x101)](a4_0x19c80c[_0x5932a7(0x116)]('\x0aErrors\x20found:'));for(const _0x3c13a5 of _0x51cc15[_0x5932a7(0xf6)]){_0x3c13a5[_0x5932a7(0x105)]===_0x5932a7(0x155)&&console[_0x5932a7(0x101)](a4_0x19c80c[_0x5932a7(0x116)](_0x5932a7(0x10c)+_0x3c13a5[_0x5932a7(0x132)]+_0x5932a7(0x14c)+_0x3c13a5[_0x5932a7(0x155)]));}return 0x1;}const _0x181ea3=_0x51cc15[_0x5932a7(0x140)][_0x5932a7(0xf6)][_0x5932a7(0x12e)]+_0x51cc15[_0x5932a7(0x140)][_0x5932a7(0x12a)][_0x5932a7(0x12e)]+_0x51cc15['counts'][_0x5932a7(0x13f)][_0x5932a7(0x12e)]+_0x51cc15[_0x5932a7(0x140)]['prompts'][_0x5932a7(0x12e)]+_0x51cc15[_0x5932a7(0x140)][_0x5932a7(0x15c)][_0x5932a7(0x12e)]+_0x51cc15[_0x5932a7(0x140)][_0x5932a7(0xda)][_0x5932a7(0x12e)]+_0x51cc15[_0x5932a7(0x140)][_0x5932a7(0xd3)]['created'],_0x22a47b=_0x51cc15[_0x5932a7(0x140)]['agents'][_0x5932a7(0x137)]+_0x51cc15[_0x5932a7(0x140)][_0x5932a7(0x12a)][_0x5932a7(0x137)]+_0x51cc15[_0x5932a7(0x140)]['textKnowledgeBases'][_0x5932a7(0x137)]+_0x51cc15[_0x5932a7(0x140)][_0x5932a7(0x156)][_0x5932a7(0x137)]+_0x51cc15[_0x5932a7(0x140)][_0x5932a7(0x15c)]['updated']+_0x51cc15[_0x5932a7(0x140)]['experimentalKnowledgeBases'][_0x5932a7(0x137)]+_0x51cc15['counts'][_0x5932a7(0xd3)][_0x5932a7(0x137)],_0x1f640b=_0x51cc15[_0x5932a7(0x140)][_0x5932a7(0xf6)][_0x5932a7(0xf0)]+_0x51cc15[_0x5932a7(0x140)][_0x5932a7(0x12a)][_0x5932a7(0xf0)]+_0x51cc15['counts']['textKnowledgeBases'][_0x5932a7(0xf0)]+_0x51cc15[_0x5932a7(0x140)]['prompts'][_0x5932a7(0xf0)]+_0x51cc15[_0x5932a7(0x140)][_0x5932a7(0x15c)]['unchanged']+_0x51cc15[_0x5932a7(0x140)]['experimentalKnowledgeBases']['unchanged']+_0x51cc15['counts'][_0x5932a7(0xd3)][_0x5932a7(0xf0)];console[_0x5932a7(0x101)](_0x5932a7(0xdb)+_0x51cc15['projectName']+'\x27:'),console[_0x5932a7(0x101)]('\x20\x20'+a4_0x19c80c['green']('+\x20'+_0x181ea3+_0x5932a7(0x131))+_0x5932a7(0x16d)+a4_0x19c80c[_0x5932a7(0xe4)]('~\x20'+_0x22a47b+_0x5932a7(0x15e))+_0x5932a7(0x16d)+a4_0x19c80c[_0x5932a7(0xf3)]('=\x20'+_0x1f640b+'\x20unchanged')),console[_0x5932a7(0x101)](_0x5932a7(0x157)+formatCountSummary(_0x51cc15[_0x5932a7(0x140)][_0x5932a7(0xf6)])),console[_0x5932a7(0x101)](_0x5932a7(0x13d)+formatCountSummary(_0x51cc15[_0x5932a7(0x140)][_0x5932a7(0x12a)])),console['log'](_0x5932a7(0x182)+formatCountSummary(_0x51cc15[_0x5932a7(0x140)][_0x5932a7(0x13f)])),console[_0x5932a7(0x101)](_0x5932a7(0xdc)+formatCountSummary(_0x51cc15['counts']['prompts'])),console[_0x5932a7(0x101)](_0x5932a7(0x162)+formatCountSummary(_0x51cc15[_0x5932a7(0x140)]['integrations']));const _0x5baccd=_0x51cc15[_0x5932a7(0x140)][_0x5932a7(0xda)]['created']>0x0||_0x51cc15[_0x5932a7(0x140)][_0x5932a7(0xda)]['updated']>0x0||_0x51cc15[_0x5932a7(0x140)][_0x5932a7(0xda)]['unchanged']>0x0||_0x51cc15['counts'][_0x5932a7(0xd3)][_0x5932a7(0x12e)]>0x0||_0x51cc15[_0x5932a7(0x140)][_0x5932a7(0xd3)][_0x5932a7(0x137)]>0x0||_0x51cc15['counts'][_0x5932a7(0xd3)][_0x5932a7(0xf0)]>0x0;_0x5baccd&&(console['log']('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x51cc15[_0x5932a7(0x140)]['experimentalKnowledgeBases'])),console[_0x5932a7(0x101)](_0x5932a7(0xe1)+formatCountSummary(_0x51cc15[_0x5932a7(0x140)][_0x5932a7(0xd3)])));console[_0x5932a7(0x101)](_0x5932a7(0x114)+a4_0x19c80c[_0x5932a7(0x100)](_0x19def2)),displayDiffs(_0x51cc15[_0x5932a7(0xf6)],_0x51cc15[_0x5932a7(0x12a)],_0x51cc15[_0x5932a7(0x13f)],_0x51cc15[_0x5932a7(0x156)],_0x51cc15['integrations'],_0x51cc15[_0x5932a7(0xda)],_0x51cc15[_0x5932a7(0xd3)]);if(_0x113d77)return console[_0x5932a7(0x101)](a4_0x19c80c[_0x5932a7(0xe4)](_0x5932a7(0x14a))),0x0;if(_0x181ea3===0x0&&_0x22a47b===0x0){console[_0x5932a7(0x101)](a4_0x19c80c[_0x5932a7(0xd8)](_0x5932a7(0x127)));const _0x3a8b77=getLLMProjectUrl(_0x5c10ba,_0x51cc15['projectId']);return console[_0x5932a7(0x101)]('Project:\x20'+a4_0x19c80c[_0x5932a7(0x100)](_0x3a8b77)),0x0;}if(!_0x3d0ec5&&!_0x590757){if(!isInteractive())return console[_0x5932a7(0x155)](a4_0x19c80c[_0x5932a7(0x116)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x5932a7(0x155)](a4_0x19c80c[_0x5932a7(0xf3)](_0x5932a7(0x180))),0x1;const _0x37030e=await confirmKey(_0x5932a7(0x183)+(_0x181ea3+_0x22a47b)+_0x5932a7(0x121));if(!_0x37030e)return console[_0x5932a7(0x101)](a4_0x19c80c[_0x5932a7(0xe4)](_0x5932a7(0x152)),_0x5932a7(0x142)),0x1;}const {data:_0x4280b9}=await withSpinner(_0x5932a7(0xe9),()=>_0x2db746[_0x5932a7(0x109)][_0x5932a7(0x181)](_0x19def2,{'force':_0x590757})),_0x3618c0=_0x4280b9[_0x5932a7(0x140)]['agents'][_0x5932a7(0xed)]>0x0||_0x4280b9['counts']['knowledgeBases']['errors']>0x0||_0x4280b9[_0x5932a7(0x140)][_0x5932a7(0x13f)][_0x5932a7(0xed)]>0x0||_0x4280b9[_0x5932a7(0x140)][_0x5932a7(0x156)][_0x5932a7(0xed)]>0x0;if(_0x3618c0){console[_0x5932a7(0x101)](a4_0x19c80c[_0x5932a7(0xe4)](_0x5932a7(0x141))),console['log'](),console[_0x5932a7(0x101)](a4_0x19c80c[_0x5932a7(0x116)](_0x5932a7(0x118)));for(const _0x54ffab of _0x4280b9[_0x5932a7(0xf6)]){_0x54ffab[_0x5932a7(0x105)]===_0x5932a7(0x155)&&console[_0x5932a7(0x101)](a4_0x19c80c[_0x5932a7(0x116)](_0x5932a7(0x10c)+_0x54ffab[_0x5932a7(0x132)]+_0x5932a7(0x14c)+_0x54ffab['error']));}for(const _0x36a576 of _0x4280b9[_0x5932a7(0x12a)]){_0x36a576[_0x5932a7(0x105)]===_0x5932a7(0x155)&&console[_0x5932a7(0x101)](a4_0x19c80c[_0x5932a7(0x116)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x36a576[_0x5932a7(0x138)]+_0x5932a7(0x14c)+_0x36a576[_0x5932a7(0x155)]));}for(const _0x40f540 of _0x4280b9[_0x5932a7(0x13f)]){_0x40f540['action']===_0x5932a7(0x155)&&console['log'](a4_0x19c80c[_0x5932a7(0x116)](_0x5932a7(0x103)+_0x40f540['name']+'\x22:\x20'+_0x40f540[_0x5932a7(0x155)]));}for(const _0x26ded5 of _0x4280b9[_0x5932a7(0x156)]){_0x26ded5['action']===_0x5932a7(0x155)&&console[_0x5932a7(0x101)](a4_0x19c80c[_0x5932a7(0x116)]('\x20\x20Prompt\x20\x22'+_0x26ded5[_0x5932a7(0x138)]+_0x5932a7(0x14c)+_0x26ded5[_0x5932a7(0x155)]));}for(const _0x5ccb68 of _0x4280b9[_0x5932a7(0x15c)]){_0x5ccb68['action']===_0x5932a7(0x155)&&console[_0x5932a7(0x101)](a4_0x19c80c[_0x5932a7(0x116)](_0x5932a7(0x115)+_0x5ccb68[_0x5932a7(0x138)]+_0x5932a7(0x14c)+_0x5ccb68[_0x5932a7(0x155)]));}return 0x1;}console['log'](a4_0x19c80c[_0x5932a7(0xd8)](_0x5932a7(0xee)+(_0x181ea3+_0x22a47b)+_0x5932a7(0xe7)+_0x4280b9['projectName']+'\x27'));const _0x18e638=getLLMProjectUrl(_0x5c10ba,_0x4280b9[_0x5932a7(0x122)]);return console[_0x5932a7(0x101)](_0x5932a7(0xfd)+a4_0x19c80c[_0x5932a7(0x100)](_0x18e638)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x1f264c=a5_0x3122;(function(_0x2e0da3,_0x248fc4){const _0x32053d=a5_0x3122,_0x3b4d72=_0x2e0da3();while(!![]){try{const _0x2ec120=-parseInt(_0x32053d(0xde))/0x1+-parseInt(_0x32053d(0x162))/0x2*(parseInt(_0x32053d(0xdb))/0x3)+-parseInt(_0x32053d(0x124))/0x4*(parseInt(_0x32053d(0x143))/0x5)+parseInt(_0x32053d(0x112))/0x6*(parseInt(_0x32053d(0x140))/0x7)+-parseInt(_0x32053d(0x154))/0x8*(parseInt(_0x32053d(0x15b))/0x9)+parseInt(_0x32053d(0xf1))/0xa*(-parseInt(_0x32053d(0xdd))/0xb)+parseInt(_0x32053d(0x151))/0xc;if(_0x2ec120===_0x248fc4)break;else _0x3b4d72['push'](_0x3b4d72['shift']());}catch(_0x10844c){_0x3b4d72['push'](_0x3b4d72['shift']());}}}(a5_0x1982,0x657ee));import*as a5_0x25b993 from'node:fs';function a5_0x3122(_0x2e41d8,_0x28a33c){_0x2e41d8=_0x2e41d8-0xd9;const _0x198277=a5_0x1982();let _0x3122e5=_0x198277[_0x2e41d8];return _0x3122e5;}import*as a5_0x35a1f6 from'node:path';import a5_0x7d4dc8 from'chalk';import{BaseCommand}from'./command.js';function a5_0x1982(){const _0x2f7998=['633784mAEATb','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','llmProject','conversation_url','tags','map','Errors:\x20\x20\x20','llm','reeval','json','Round\x20','basename','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','trim','cyan','execute','agentName','eval','some','123730oRRgzf','No\x20tests\x20have\x20tags\x20defined.','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','site','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','start','projectDir','\x20\x20-\x20','size','Running\x20agent\x20tests...','✓\x20PASS:\x20','Test\x20','✗\x20FAIL:\x20','resolve','Passed:\x20\x20\x20','...','conversations','404','Total:\x20\x20\x20\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','not\x20found','⚠\x20SKIPPED:\x20','\x20(new)','Available\x20tags:\x20','Agent:\x20','utf-8','Site:\x20','forEach','Re-evaluation\x20Summary','\x20\x20Evaluating...\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','FAIL','22350XjLdhu','description','Round\x201/','Test\x20Configuration:','split','tests','\x22:\x20','ERROR','filter','Test\x20Summary','Cached\x20run\x20is\x20from\x20site\x20\x22','find','\x20\x20Conversation:\x20','rounds','\x20\x20Round\x20','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Either\x20switch\x20to\x20the\x20\x22','Available\x20tests:\x20','2876TvzhdV','Output\x20written\x20to:\x20','has','Using\x20agent:\x20','repeat','No\x20tests\x20found\x20with\x20tags:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','status','existsSync','timestamp','found','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','Error:\x20No\x20previous\x20test\x20run\x20found.','Re-evaluating\x20cached\x20test\x20run...','jsonl','writeFileSync','\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','log','message','output','source','includes','verbose','join','round','add','no_tests','stop','490zYsQyb','\x27\x20to\x20create\x20the\x20folder\x20structure.','name','2245jeLHHB','no_context','...\x20','dim','yellow','no_local_folder','green','PASS','No\x20tests\x20found\x20matching:\x20','Evaluating\x20response...','✗\x20ERROR:\x20','length','Run\x20\x27tdx\x20agent\x20pull\x20','\x20(cached)','31896708JTFBiF','agent:test','toISOString','3703376svcoUk','text','reason','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22',':\x20Sending\x20user\x20input...','Duration:\x20','Running\x20test:\x20','9EpHfGy','white','Tests\x20found:\x20','executeReeval','table','tsv','/<agent-name>','62eWpRmu','agentDirs','\x20-\x20','\x20\x20Agent:\x20','substring','push','\x22,\x20but\x20current\x20site\x20is\x20\x22','now','red','projectName','✗\x20ERROR:\x20Project\x20not\x20found:\x20','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','toLowerCase','Error\x20writing\x20output\x20file:\x20','Failed:\x20\x20\x20','multiple_agents','isSpinning','39003PlNjoM','agent','605TRcUkL'];a5_0x1982=function(){return _0x2f7998;};return a5_0x1982();}import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x1f264c(0x142)]=a5_0x1f264c(0x152);[a5_0x1f264c(0x113)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x1f264c(0xed)](_0x404cf4){const _0xb5c755=a5_0x1f264c,{options:_0x86721f,args:_0x80dc98,tdx:_0x49dbbd}=_0x404cf4,_0x2a854b=_0x80dc98[0x0]||'.',_0x552bcb=_0x86721f['dryRun'],_0x293248=_0x86721f,_0x39dfb0=_0x293248[_0xb5c755(0xef)]===![],_0x4287c3=_0x293248[_0xb5c755(0xe6)],_0x2f9ade=_0x293248[_0xb5c755(0x142)],_0x4d3dde=_0x293248[_0xb5c755(0xe2)],_0x3874dd=_0x86721f[_0xb5c755(0xf5)],_0x204743=_0x293248[_0xb5c755(0x137)];if(_0x4287c3&&_0x39dfb0)return console[_0xb5c755(0x135)](a5_0x7d4dc8[_0xb5c755(0x16a)](_0xb5c755(0x16d))),0x1;let _0x38ff77=_0xb5c755(0x15f);if(_0x293248['json'])_0x38ff77=_0xb5c755(0xe7);else{if(_0x293248['jsonl'])_0x38ff77=_0xb5c755(0x132);else{if(_0x293248[_0xb5c755(0x160)])_0x38ff77=_0xb5c755(0x160);else{if(_0x293248[_0xb5c755(0x15f)])_0x38ff77=_0xb5c755(0x15f);}}}const _0x500ca2=_0x293248[_0xb5c755(0xe0)];let _0xf0ac84=_0x2a854b;const _0x1bf868=a5_0x25b993[_0xb5c755(0x12c)](_0x2a854b),_0x538088=_0x2a854b==='.';if(!_0x1bf868||_0x538088){const _0x39dee1=resolveProjectFromContext(_0x2a854b,_0x500ca2,{'requireFile':'test.yml'});if(_0x39dee1[_0xb5c755(0x12e)])_0xf0ac84=_0x39dee1['projectDir'],_0x39dee1[_0xb5c755(0x138)]==='context'&&console[_0xb5c755(0x135)](a5_0x7d4dc8[_0xb5c755(0x146)](_0xb5c755(0x127)+_0xf0ac84));else switch(_0x39dee1[_0xb5c755(0x156)]){case _0xb5c755(0x144):console[_0xb5c755(0x135)](a5_0x7d4dc8[_0xb5c755(0x147)](_0x39dee1[_0xb5c755(0x136)])),console[_0xb5c755(0x135)](),console[_0xb5c755(0x135)]('Usage:'),console[_0xb5c755(0x135)](_0xb5c755(0x134)),console[_0xb5c755(0x135)]('\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)'),console['log'](),console[_0xb5c755(0x135)](_0xb5c755(0x121));return 0x1;case _0xb5c755(0x148):console[_0xb5c755(0x135)](a5_0x7d4dc8[_0xb5c755(0x147)](_0x39dee1[_0xb5c755(0x136)])),console[_0xb5c755(0x135)](),console[_0xb5c755(0x135)](_0xb5c755(0x14f)+_0x39dee1[_0xb5c755(0xe0)]+_0xb5c755(0x141));return 0x1;case _0xb5c755(0xd9):{const _0x2e8419=a5_0x35a1f6[_0xb5c755(0xe9)](_0x39dee1[_0xb5c755(0xf8)]);console['log'](a5_0x7d4dc8[_0xb5c755(0x147)](_0xb5c755(0x157)+_0x39dee1[_0xb5c755(0xe0)]+'\x22:'));for(const _0x3a7283 of _0x39dee1[_0xb5c755(0x163)]){console[_0xb5c755(0x135)](_0xb5c755(0xf9)+_0x3a7283);}return console['log'](),console[_0xb5c755(0x135)](_0xb5c755(0xf6)+_0x2e8419+_0xb5c755(0x161)),0x1;}case _0xb5c755(0x13e):console['log'](a5_0x7d4dc8[_0xb5c755(0x147)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x39dee1[_0xb5c755(0xe0)]+'\x22.')),console['log'](a5_0x7d4dc8[_0xb5c755(0x146)]('Project\x20path:\x20'+_0x39dee1[_0xb5c755(0xf8)])),console[_0xb5c755(0x135)](),console[_0xb5c755(0x135)](_0xb5c755(0xf4));return 0x1;}}const {definition:_0x11fc5b,agentInfo:_0x9ced1e}=parseTestFile(_0xf0ac84);let _0x416890=_0x11fc5b[_0xb5c755(0x117)];if(_0x2f9ade){const _0x51d96d=_0x2f9ade[_0xb5c755(0x116)](',')['map'](_0x19bfcc=>_0x19bfcc[_0xb5c755(0xeb)]());_0x416890=_0x11fc5b[_0xb5c755(0x117)][_0xb5c755(0x11a)](_0x498593=>_0x51d96d[_0xb5c755(0x139)](_0x498593[_0xb5c755(0x142)]));if(_0x416890['length']===0x0)return console[_0xb5c755(0x135)](a5_0x7d4dc8[_0xb5c755(0x147)](_0xb5c755(0x14b)+_0x2f9ade)),console[_0xb5c755(0x135)](a5_0x7d4dc8[_0xb5c755(0x146)](_0xb5c755(0x123)+_0x11fc5b['tests']['map'](_0xadfc1=>_0xadfc1[_0xb5c755(0x142)])[_0xb5c755(0x13b)](',\x20'))),0x1;}if(_0x4d3dde){const _0x45ce84=_0x4d3dde['split'](',')[_0xb5c755(0xe3)](_0x288cd7=>_0x288cd7[_0xb5c755(0xeb)]()[_0xb5c755(0x16e)]());_0x416890=_0x416890[_0xb5c755(0x11a)](_0x562f47=>_0x562f47[_0xb5c755(0xe2)]?.[_0xb5c755(0xf0)](_0x532a7e=>_0x45ce84[_0xb5c755(0x139)](_0x532a7e['toLowerCase']())));if(_0x416890[_0xb5c755(0x14e)]===0x0){console[_0xb5c755(0x135)](a5_0x7d4dc8['yellow'](_0xb5c755(0x129)+_0x4d3dde));const _0x5876bd=new Set();return _0x11fc5b['tests']['forEach'](_0x2e9815=>_0x2e9815[_0xb5c755(0xe2)]?.[_0xb5c755(0x10d)](_0x47e519=>_0x5876bd[_0xb5c755(0x13d)](_0x47e519))),_0x5876bd[_0xb5c755(0xfa)]>0x0?console[_0xb5c755(0x135)](a5_0x7d4dc8[_0xb5c755(0x146)](_0xb5c755(0x109)+[..._0x5876bd][_0xb5c755(0x13b)](',\x20'))):console[_0xb5c755(0x135)](a5_0x7d4dc8[_0xb5c755(0x146)](_0xb5c755(0xf2))),0x1;}}if(_0x4287c3)return this[_0xb5c755(0x15e)](_0x404cf4,{'definition':{'tests':_0x416890},'agentInfo':_0x9ced1e,'outputFormat':_0x38ff77,'outputFile':_0x204743,'testNames':_0x2f9ade});if(_0x552bcb){console[_0xb5c755(0x135)](a5_0x7d4dc8[_0xb5c755(0xec)](_0xb5c755(0x115))),console[_0xb5c755(0x135)]('\x20\x20Site:\x20'+a5_0x7d4dc8['white'](_0x3874dd)),console[_0xb5c755(0x135)]('\x20\x20Project:\x20'+a5_0x7d4dc8['white'](_0x9ced1e['projectName'])),console['log'](_0xb5c755(0x165)+a5_0x7d4dc8['white'](_0x9ced1e[_0xb5c755(0xee)])),console[_0xb5c755(0x135)](),console[_0xb5c755(0x135)](_0xb5c755(0x15d)+a5_0x7d4dc8[_0xb5c755(0x15c)](_0x416890[_0xb5c755(0x14e)]));for(let _0x328fca=0x0;_0x328fca<_0x416890[_0xb5c755(0x14e)];_0x328fca++){const _0x319834=_0x416890[_0x328fca],_0x293a2d=_0x319834[_0xb5c755(0x11f)][_0xb5c755(0x14e)]===0x1?_0xb5c755(0x13c):_0xb5c755(0x11f),_0x205647=_0x319834[_0xb5c755(0xe2)]?.[_0xb5c755(0x14e)]?'\x20['+_0x319834['tags'][_0xb5c755(0x13b)](',\x20')+']':'';console[_0xb5c755(0x135)]('\x20\x20'+(_0x328fca+0x1)+'.\x20'+a5_0x7d4dc8[_0xb5c755(0x15c)](_0x319834[_0xb5c755(0x142)])+'\x20('+_0x319834[_0xb5c755(0x11f)][_0xb5c755(0x14e)]+'\x20'+_0x293a2d+')'+a5_0x7d4dc8[_0xb5c755(0x146)](_0x205647));}return 0x0;}let _0x405998,_0x5781dd;try{_0x405998=await _0x49dbbd[_0xb5c755(0xe5)]['resolveProjectId'](_0x9ced1e[_0xb5c755(0x16b)]);}catch(_0x201b31){const _0x69f148=_0x201b31 instanceof Error?_0x201b31[_0xb5c755(0x136)]:String(_0x201b31);return _0x69f148['includes'](_0xb5c755(0x103))||_0x69f148[_0xb5c755(0x16e)]()[_0xb5c755(0x139)](_0xb5c755(0x106))?console['log'](a5_0x7d4dc8['red'](_0xb5c755(0x16c)+_0x9ced1e[_0xb5c755(0x16b)])):console[_0xb5c755(0x135)](a5_0x7d4dc8['red'](_0xb5c755(0x12a)+_0x9ced1e['projectName']+_0xb5c755(0x118)+_0x69f148)),0x1;}try{_0x5781dd=await _0x49dbbd['llm']['resolveAgentId'](_0x9ced1e['agentName'],_0x405998);}catch(_0xe61fd6){const _0x33ae64=_0xe61fd6 instanceof Error?_0xe61fd6[_0xb5c755(0x136)]:String(_0xe61fd6);return _0x33ae64[_0xb5c755(0x139)]('404')||_0x33ae64[_0xb5c755(0x16e)]()['includes'](_0xb5c755(0x106))?console[_0xb5c755(0x135)](a5_0x7d4dc8['red']('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x9ced1e[_0xb5c755(0xee)])):console[_0xb5c755(0x135)](a5_0x7d4dc8['red'](_0xb5c755(0x105)+_0x9ced1e[_0xb5c755(0xee)]+_0xb5c755(0x118)+_0x33ae64)),0x1;}let _0x5c9eab;if(!_0x39dfb0)try{_0x5c9eab=await setupEvaluatorAgent(_0x49dbbd[_0xb5c755(0xe5)],_0x86721f[_0xb5c755(0x13a)]);}catch(_0x4f5e2b){const _0x18a94e=_0x4f5e2b instanceof Error?_0x4f5e2b[_0xb5c755(0x136)]:String(_0x4f5e2b);return console[_0xb5c755(0x135)](a5_0x7d4dc8[_0xb5c755(0x16a)](_0xb5c755(0x110)+_0x18a94e)),0x1;}console['log'](a5_0x7d4dc8[_0xb5c755(0xec)](_0xb5c755(0xfb))),console[_0xb5c755(0x135)](_0xb5c755(0x10c)+a5_0x7d4dc8[_0xb5c755(0x15c)](_0x3874dd)),console['log']('Agent:\x20'+a5_0x7d4dc8[_0xb5c755(0x15c)](_0x9ced1e[_0xb5c755(0x16b)]+'/'+_0x9ced1e['agentName'])),console[_0xb5c755(0x135)]();const _0x3f8550=[],_0x2021c1=[],_0x19fbcf=Date[_0xb5c755(0x169)]();for(let _0x343cb8=0x0;_0x343cb8<_0x416890[_0xb5c755(0x14e)];_0x343cb8++){const _0x1e5c72=_0x416890[_0x343cb8];_0x416890[_0xb5c755(0x14e)]>0x1?console[_0xb5c755(0x135)](_0xb5c755(0xfd)+(_0x343cb8+0x1)+'/'+_0x416890[_0xb5c755(0x14e)]+':\x20'+a5_0x7d4dc8['white'](_0x1e5c72[_0xb5c755(0x142)])):console[_0xb5c755(0x135)](_0xb5c755(0x15a)+a5_0x7d4dc8['white'](_0x1e5c72['name']));const _0x543add=createCommandSpinner(_0xb5c755(0x114)+_0x1e5c72[_0xb5c755(0x11f)][_0xb5c755(0x14e)]+_0xb5c755(0x158));_0x543add[_0xb5c755(0xf7)]();try{const {result:_0x223609,conversation:_0x16101a}=await runTest(_0x49dbbd[_0xb5c755(0xe5)],_0x1e5c72,{'agentId':_0x5781dd,'projectId':_0x405998,'site':_0x3874dd,'noEval':_0x39dfb0,'evaluatorId':_0x5c9eab,'onRoundStart':(_0x550199,_0x2f525d)=>{const _0x2a353a=_0xb5c755;_0x543add['text']=_0x2a353a(0xe8)+(_0x550199+0x1)+'/'+_0x2f525d+_0x2a353a(0x158);},'onRoundComplete':(_0xe653d3,_0x2ef936,_0x273a44)=>{const _0x5dede9=_0xb5c755,_0xc068a3=formatElapsed(_0x2ef936);_0x273a44?console[_0x5dede9(0x135)](_0x5dede9(0x120)+(_0xe653d3+0x1)+'/'+_0x1e5c72['rounds']['length']+_0x5dede9(0x145)+a5_0x7d4dc8['green']('✓')+'\x20('+_0xc068a3+')'):console[_0x5dede9(0x135)](_0x5dede9(0x120)+(_0xe653d3+0x1)+'/'+_0x1e5c72[_0x5dede9(0x11f)]['length']+_0x5dede9(0x145)+a5_0x7d4dc8['red']('✗'));},'onEvaluationStart':()=>{const _0x32c09b=_0xb5c755;_0x543add[_0x32c09b(0x155)]=_0x32c09b(0x14c);},'onEvaluationComplete':_0x5e4957=>{const _0x1d4f81=_0xb5c755,_0x2929de=formatElapsed(_0x5e4957);console[_0x1d4f81(0x135)]('\x20\x20Evaluating...\x20'+a5_0x7d4dc8['green']('✓')+'\x20('+_0x2929de+')');}});_0x543add['stop'](),_0x3f8550[_0xb5c755(0x167)](_0x223609),_0x2021c1['push'](_0x16101a);if(_0x223609[_0xb5c755(0x12b)]===_0xb5c755(0x14a))console[_0xb5c755(0x135)](a5_0x7d4dc8[_0xb5c755(0x149)](_0xb5c755(0xfc)+_0x223609['reason']));else _0x223609[_0xb5c755(0x12b)]===_0xb5c755(0x111)?console[_0xb5c755(0x135)](a5_0x7d4dc8[_0xb5c755(0x16a)]('✗\x20FAIL:\x20'+_0x223609[_0xb5c755(0x156)])):console[_0xb5c755(0x135)](a5_0x7d4dc8[_0xb5c755(0x16a)](_0xb5c755(0x14d)+_0x223609['reason']));_0x223609[_0xb5c755(0xe1)]&&console['log'](a5_0x7d4dc8[_0xb5c755(0x146)]('Conversation\x20URL:\x20'+_0x223609[_0xb5c755(0xe1)])),console[_0xb5c755(0x135)]();}catch(_0x201a56){_0x543add[_0xb5c755(0x13f)]();const _0x378887=_0x201a56 instanceof Error?_0x201a56[_0xb5c755(0x136)]:String(_0x201a56);console['log'](a5_0x7d4dc8[_0xb5c755(0x16a)]('✗\x20ERROR:\x20'+_0x378887)),console[_0xb5c755(0x135)](),_0x3f8550[_0xb5c755(0x167)]({'name':_0x1e5c72['name'],'status':'ERROR','reason':_0x378887,'timestamp':new Date()[_0xb5c755(0x153)](),'duration_ms':0x0});}}const _0x3a8d29=Date[_0xb5c755(0x169)]()-_0x19fbcf,_0x7118e4=_0x3f8550['filter'](_0xfac40a=>_0xfac40a[_0xb5c755(0x12b)]===_0xb5c755(0x14a))[_0xb5c755(0x14e)],_0x1e9320=_0x3f8550[_0xb5c755(0x11a)](_0x2bc11b=>_0x2bc11b[_0xb5c755(0x12b)]===_0xb5c755(0x111))[_0xb5c755(0x14e)],_0x5a9aa5=_0x3f8550[_0xb5c755(0x11a)](_0x51fae3=>_0x51fae3[_0xb5c755(0x12b)]===_0xb5c755(0x119))['length'];console[_0xb5c755(0x135)]('━'['repeat'](0x3c)),console[_0xb5c755(0x135)](_0xb5c755(0x11b)),console[_0xb5c755(0x135)]('━'[_0xb5c755(0x128)](0x3c)),console[_0xb5c755(0x135)](_0xb5c755(0x104)+_0x3f8550[_0xb5c755(0x14e)]),console[_0xb5c755(0x135)](_0xb5c755(0x100)+a5_0x7d4dc8[_0xb5c755(0x149)](_0x7118e4)),console[_0xb5c755(0x135)](_0xb5c755(0x170)+a5_0x7d4dc8[_0xb5c755(0x16a)](_0x1e9320));_0x5a9aa5>0x0&&console[_0xb5c755(0x135)]('Errors:\x20\x20\x20'+a5_0x7d4dc8[_0xb5c755(0x16a)](_0x5a9aa5));console[_0xb5c755(0x135)](_0xb5c755(0x159)+formatElapsed(_0x3a8d29)),console[_0xb5c755(0x135)]('━'['repeat'](0x3c));const _0x2ec59b=_0x3f8550['filter'](_0x1a0e95=>_0x1a0e95[_0xb5c755(0x12b)]!==_0xb5c755(0x14a));if(_0x2ec59b[_0xb5c755(0x14e)]>0x0){console['log'](),console[_0xb5c755(0x135)]('Failed\x20Tests:');for(const _0x52847e of _0x2ec59b){const _0x3f70bf=a5_0x7d4dc8[_0xb5c755(0x16a)]('✗'),_0xa8de19=_0x52847e['reason'][_0xb5c755(0x14e)]>0x32?_0x52847e[_0xb5c755(0x156)][_0xb5c755(0x166)](0x0,0x32)+'...':_0x52847e[_0xb5c755(0x156)];console['log']('\x20\x20'+_0x3f70bf+'\x20'+_0x52847e['name']+':\x20'+_0xa8de19);}}const _0xc444c5={'summary':{'total':_0x3f8550[_0xb5c755(0x14e)],'passed':_0x7118e4,'failed':_0x1e9320,'errors':_0x5a9aa5>0x0?_0x5a9aa5:undefined,'duration_ms':_0x3a8d29},'tests':_0x3f8550,'agent':{'project':_0x9ced1e[_0xb5c755(0x16b)],'name':_0x9ced1e[_0xb5c755(0xee)],'site':_0x3874dd},'timestamp':new Date(_0x19fbcf)[_0xb5c755(0x153)]()};try{const _0x232c6e=buildCachedTestRun(_0x2021c1,{'site':_0x3874dd,'projectId':_0x405998,'projectName':_0x9ced1e[_0xb5c755(0x16b)],'agentId':_0x5781dd,'agentName':_0x9ced1e[_0xb5c755(0xee)],'testYmlPath':a5_0x35a1f6[_0xb5c755(0xff)](_0x9ced1e['testYmlPath'])});saveLastTestRun(_0x232c6e);}catch{}if(_0x38ff77!==_0xb5c755(0x15f)||_0x204743){const _0x188b07=formatResults(_0xc444c5,_0x38ff77);if(_0x204743)try{a5_0x25b993[_0xb5c755(0x133)](_0x204743,_0x188b07,_0xb5c755(0x10b)),console[_0xb5c755(0x135)](),console[_0xb5c755(0x135)](a5_0x7d4dc8['dim'](_0xb5c755(0x125)+_0x204743));}catch(_0x191f2b){return console['log'](),console[_0xb5c755(0x135)](a5_0x7d4dc8[_0xb5c755(0x16a)](_0xb5c755(0x16f)+_0x191f2b)),0x1;}else console[_0xb5c755(0x135)](),console[_0xb5c755(0x135)](_0x188b07);}return _0x2ec59b[_0xb5c755(0x14e)]>0x0?0x1:0x0;}async[a5_0x1f264c(0x15e)](_0x13bb27,_0x2f66a9){const _0x1f2c51=a5_0x1f264c,{options:_0x4f03ed,tdx:_0x2a2b52}=_0x13bb27,{definition:_0x339cd6,agentInfo:_0x25c28c,outputFormat:_0x4f2769,outputFile:_0x3fb84f}=_0x2f66a9,_0x254cbf=_0x4f03ed[_0x1f2c51(0xf5)],_0x37ccbb=loadLastTestRun();if(!_0x37ccbb)return console[_0x1f2c51(0x135)](a5_0x7d4dc8['red'](_0x1f2c51(0x130))),console[_0x1f2c51(0x135)](a5_0x7d4dc8[_0x1f2c51(0x146)]('Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.')),0x1;if(_0x37ccbb[_0x1f2c51(0xdc)]['agentName']!==_0x25c28c[_0x1f2c51(0xee)])return console[_0x1f2c51(0x135)](a5_0x7d4dc8[_0x1f2c51(0x16a)](_0x1f2c51(0xf3)+_0x37ccbb[_0x1f2c51(0xdc)][_0x1f2c51(0xee)]+_0x1f2c51(0x12f)+_0x25c28c[_0x1f2c51(0xee)]+'\x22.')),console['log'](a5_0x7d4dc8[_0x1f2c51(0x146)]('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x8c4d5c=new Set(_0x37ccbb[_0x1f2c51(0x102)][_0x1f2c51(0xe3)](_0x353162=>_0x353162['testName'])),_0x1b4df8=_0x339cd6[_0x1f2c51(0x117)][_0x1f2c51(0x11a)](_0x39e990=>!_0x8c4d5c[_0x1f2c51(0x126)](_0x39e990[_0x1f2c51(0x142)]));if(_0x1b4df8[_0x1f2c51(0x14e)]>0x0&&_0x37ccbb['site']!==_0x254cbf)return console[_0x1f2c51(0x135)](a5_0x7d4dc8[_0x1f2c51(0x16a)]('Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.')),console['log'](a5_0x7d4dc8[_0x1f2c51(0x146)](_0x1f2c51(0x11c)+_0x37ccbb[_0x1f2c51(0xf5)]+_0x1f2c51(0x168)+_0x254cbf+'\x22.')),console['log'](a5_0x7d4dc8['dim'](_0x1f2c51(0x122)+_0x37ccbb[_0x1f2c51(0xf5)]+_0x1f2c51(0xdf))),0x1;const _0x29a1a6=_0x339cd6[_0x1f2c51(0x117)][_0x1f2c51(0x11a)](_0x2ac75d=>_0x8c4d5c[_0x1f2c51(0x126)](_0x2ac75d['name'])),_0xccdd23=_0x1b4df8;let _0x1e58b0;try{_0x1e58b0=await setupEvaluatorAgent(_0x2a2b52[_0x1f2c51(0xe5)],_0x4f03ed['verbose']);}catch(_0x50b4a1){const _0x1691b2=_0x50b4a1 instanceof Error?_0x50b4a1[_0x1f2c51(0x136)]:String(_0x50b4a1);return console[_0x1f2c51(0x135)](a5_0x7d4dc8['red']('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x1691b2)),0x1;}console[_0x1f2c51(0x135)](a5_0x7d4dc8[_0x1f2c51(0xec)](_0x1f2c51(0x131))),console[_0x1f2c51(0x135)]('Cached\x20run\x20from:\x20'+a5_0x7d4dc8[_0x1f2c51(0x15c)](_0x37ccbb[_0x1f2c51(0x12d)])),console[_0x1f2c51(0x135)](_0x1f2c51(0x10a)+a5_0x7d4dc8[_0x1f2c51(0x15c)](_0x37ccbb[_0x1f2c51(0xdc)]['projectName']+'/'+_0x37ccbb['agent'][_0x1f2c51(0xee)]));_0xccdd23[_0x1f2c51(0x14e)]>0x0&&console[_0x1f2c51(0x135)]('New\x20tests\x20to\x20execute:\x20'+a5_0x7d4dc8[_0x1f2c51(0x147)](_0xccdd23['length']));console['log']();const _0x2292b2=[],_0x20a5f1=Date[_0x1f2c51(0x169)](),_0x1b907d=createCommandSpinner('Re-evaluating...');if(_0x29a1a6[_0x1f2c51(0x14e)]>0x0)try{const _0x5a0efa=await reevaluateFromCache(_0x2a2b52[_0x1f2c51(0xe5)],_0x37ccbb,{'tests':_0x29a1a6},{'evaluatorId':_0x1e58b0,'onTestStart':(_0x4c39f1,_0x10a8c2,_0x53fbdc)=>{const _0x3693c0=_0x1f2c51;_0x1b907d[_0x3693c0(0x155)]='Re-evaluating\x20'+(_0x10a8c2+0x1)+'/'+_0x53fbdc+':\x20'+_0x4c39f1+_0x3693c0(0x101);if(!_0x1b907d[_0x3693c0(0xda)])_0x1b907d[_0x3693c0(0xf7)]();},'onTestComplete':(_0x544fa2,_0x1bfeed)=>{const _0xb6bfbf=_0x1f2c51;_0x1b907d[_0xb6bfbf(0x13f)]();if(_0x1bfeed['status']==='PASS')console[_0xb6bfbf(0x135)](a5_0x7d4dc8[_0xb6bfbf(0x149)](_0xb6bfbf(0xfc)+_0x544fa2)+a5_0x7d4dc8[_0xb6bfbf(0x146)](_0xb6bfbf(0x150)));else _0x1bfeed[_0xb6bfbf(0x12b)]===_0xb6bfbf(0x111)?console[_0xb6bfbf(0x135)](a5_0x7d4dc8[_0xb6bfbf(0x16a)](_0xb6bfbf(0xfe)+_0x544fa2+_0xb6bfbf(0x164)+_0x1bfeed['reason'])+a5_0x7d4dc8[_0xb6bfbf(0x146)]('\x20(cached)')):console[_0xb6bfbf(0x135)](a5_0x7d4dc8[_0xb6bfbf(0x16a)](_0xb6bfbf(0x14d)+_0x544fa2+_0xb6bfbf(0x164)+_0x1bfeed[_0xb6bfbf(0x156)]));_0x1bfeed[_0xb6bfbf(0xe1)]&&console['log'](a5_0x7d4dc8[_0xb6bfbf(0x146)](_0xb6bfbf(0x11e)+_0x1bfeed[_0xb6bfbf(0xe1)])),_0x2292b2[_0xb6bfbf(0x167)](_0x1bfeed);},'onTestSkipped':(_0x2cabed,_0x3f68d7)=>{const _0x5713be=_0x1f2c51;_0x1b907d['stop'](),console[_0x5713be(0x135)](a5_0x7d4dc8['yellow'](_0x5713be(0x107)+_0x2cabed+_0x5713be(0x164)+_0x3f68d7));}});for(const _0x41e2eb of _0x5a0efa){!_0x2292b2[_0x1f2c51(0x11d)](_0x2b9199=>_0x2b9199[_0x1f2c51(0x142)]===_0x41e2eb[_0x1f2c51(0x142)])&&_0x2292b2['push'](_0x41e2eb);}}catch(_0x4473ef){_0x1b907d[_0x1f2c51(0x13f)]();const _0x7073b=_0x4473ef instanceof Error?_0x4473ef[_0x1f2c51(0x136)]:String(_0x4473ef);return console[_0x1f2c51(0x135)](a5_0x7d4dc8[_0x1f2c51(0x16a)](_0x1f2c51(0xea)+_0x7073b)),0x1;}_0x1b907d[_0x1f2c51(0x13f)]();if(_0xccdd23[_0x1f2c51(0x14e)]>0x0){console[_0x1f2c51(0x135)](),console[_0x1f2c51(0x135)](a5_0x7d4dc8[_0x1f2c51(0xec)]('Executing\x20new\x20tests...'));const {projectId:_0x45b6f3,agentId:_0x1e7d3e}=_0x37ccbb['agent'];for(const _0x21dcbb of _0xccdd23){console['log']('Running:\x20'+a5_0x7d4dc8[_0x1f2c51(0x15c)](_0x21dcbb[_0x1f2c51(0x142)]));const _0x1233c8=createCommandSpinner('Round\x201/'+_0x21dcbb[_0x1f2c51(0x11f)]['length']+_0x1f2c51(0x158));_0x1233c8['start']();try{const {result:_0x31240b}=await runTest(_0x2a2b52[_0x1f2c51(0xe5)],_0x21dcbb,{'agentId':_0x1e7d3e,'projectId':_0x45b6f3,'site':_0x37ccbb[_0x1f2c51(0xf5)],'noEval':![],'evaluatorId':_0x1e58b0,'onRoundStart':(_0x7dce7e,_0x4922d8)=>{const _0x46ab08=_0x1f2c51;_0x1233c8[_0x46ab08(0x155)]='Round\x20'+(_0x7dce7e+0x1)+'/'+_0x4922d8+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0xc28aa1,_0x2da61c,_0x3873df)=>{const _0x446799=_0x1f2c51,_0x5439af=formatElapsed(_0x2da61c);_0x3873df?console[_0x446799(0x135)](_0x446799(0x120)+(_0xc28aa1+0x1)+'/'+_0x21dcbb['rounds'][_0x446799(0x14e)]+_0x446799(0x145)+a5_0x7d4dc8[_0x446799(0x149)]('✓')+'\x20('+_0x5439af+')'):console['log'](_0x446799(0x120)+(_0xc28aa1+0x1)+'/'+_0x21dcbb['rounds'][_0x446799(0x14e)]+_0x446799(0x145)+a5_0x7d4dc8[_0x446799(0x16a)]('✗'));},'onEvaluationStart':()=>{const _0x228d1c=_0x1f2c51;_0x1233c8[_0x228d1c(0x155)]=_0x228d1c(0x14c);},'onEvaluationComplete':_0x5333bb=>{const _0x4d6808=_0x1f2c51,_0x15cb6b=formatElapsed(_0x5333bb);console[_0x4d6808(0x135)](_0x4d6808(0x10f)+a5_0x7d4dc8[_0x4d6808(0x149)]('✓')+'\x20('+_0x15cb6b+')');}});_0x1233c8[_0x1f2c51(0x13f)](),_0x2292b2[_0x1f2c51(0x167)](_0x31240b);if(_0x31240b['status']==='PASS')console['log'](a5_0x7d4dc8[_0x1f2c51(0x149)](_0x1f2c51(0xfc)+_0x31240b[_0x1f2c51(0x156)])+a5_0x7d4dc8[_0x1f2c51(0x146)](_0x1f2c51(0x108)));else _0x31240b[_0x1f2c51(0x12b)]===_0x1f2c51(0x111)?console['log'](a5_0x7d4dc8[_0x1f2c51(0x16a)](_0x1f2c51(0xfe)+_0x31240b[_0x1f2c51(0x156)])+a5_0x7d4dc8['dim']('\x20(new)')):console[_0x1f2c51(0x135)](a5_0x7d4dc8['red'](_0x1f2c51(0x14d)+_0x31240b[_0x1f2c51(0x156)]));_0x31240b[_0x1f2c51(0xe1)]&&console['log'](a5_0x7d4dc8[_0x1f2c51(0x146)]('\x20\x20Conversation:\x20'+_0x31240b['conversation_url']));}catch(_0x24eef4){_0x1233c8[_0x1f2c51(0x13f)]();const _0xc68d82=_0x24eef4 instanceof Error?_0x24eef4[_0x1f2c51(0x136)]:String(_0x24eef4);console[_0x1f2c51(0x135)](a5_0x7d4dc8['red']('✗\x20ERROR:\x20'+_0xc68d82)),_0x2292b2[_0x1f2c51(0x167)]({'name':_0x21dcbb[_0x1f2c51(0x142)],'status':_0x1f2c51(0x119),'reason':_0xc68d82,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console[_0x1f2c51(0x135)]();const _0x5d778f=Date[_0x1f2c51(0x169)]()-_0x20a5f1,_0x3e1e07=_0x2292b2[_0x1f2c51(0x11a)](_0x144c2e=>_0x144c2e[_0x1f2c51(0x12b)]===_0x1f2c51(0x14a))[_0x1f2c51(0x14e)],_0x5cf785=_0x2292b2['filter'](_0x3ccf64=>_0x3ccf64['status']===_0x1f2c51(0x111))[_0x1f2c51(0x14e)],_0x5c9945=_0x2292b2[_0x1f2c51(0x11a)](_0x2c4874=>_0x2c4874[_0x1f2c51(0x12b)]==='ERROR')[_0x1f2c51(0x14e)];console[_0x1f2c51(0x135)]('━'[_0x1f2c51(0x128)](0x3c)),console[_0x1f2c51(0x135)](_0x1f2c51(0x10e)),console[_0x1f2c51(0x135)]('━'[_0x1f2c51(0x128)](0x3c)),console[_0x1f2c51(0x135)](_0x1f2c51(0x104)+_0x2292b2[_0x1f2c51(0x14e)]),console['log']('Passed:\x20\x20\x20'+a5_0x7d4dc8[_0x1f2c51(0x149)](_0x3e1e07)),console[_0x1f2c51(0x135)]('Failed:\x20\x20\x20'+a5_0x7d4dc8['red'](_0x5cf785));_0x5c9945>0x0&&console[_0x1f2c51(0x135)](_0x1f2c51(0xe4)+a5_0x7d4dc8[_0x1f2c51(0x16a)](_0x5c9945));console['log'](_0x1f2c51(0x159)+formatElapsed(_0x5d778f)),console[_0x1f2c51(0x135)]('━'['repeat'](0x3c));const _0x4157f6={'summary':{'total':_0x2292b2['length'],'passed':_0x3e1e07,'failed':_0x5cf785,'errors':_0x5c9945>0x0?_0x5c9945:undefined,'duration_ms':_0x5d778f},'tests':_0x2292b2,'agent':{'project':_0x25c28c[_0x1f2c51(0x16b)],'name':_0x25c28c[_0x1f2c51(0xee)],'site':_0x254cbf},'timestamp':new Date(_0x20a5f1)['toISOString']()};if(_0x4f2769!=='table'||_0x3fb84f){const _0x3c955b=formatResults(_0x4157f6,_0x4f2769);if(_0x3fb84f)try{a5_0x25b993['writeFileSync'](_0x3fb84f,_0x3c955b,'utf-8'),console[_0x1f2c51(0x135)](),console[_0x1f2c51(0x135)](a5_0x7d4dc8[_0x1f2c51(0x146)](_0x1f2c51(0x125)+_0x3fb84f));}catch(_0x53e3c0){return console[_0x1f2c51(0x135)](),console['log'](a5_0x7d4dc8[_0x1f2c51(0x16a)](_0x1f2c51(0x16f)+_0x53e3c0)),0x1;}else console['log'](),console[_0x1f2c51(0x135)](_0x3c955b);}const _0x29fb0f=_0x2292b2[_0x1f2c51(0x11a)](_0x3be36e=>_0x3be36e[_0x1f2c51(0x12b)]!==_0x1f2c51(0x14a));return _0x29fb0f[_0x1f2c51(0x14e)]>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0xfc51c3=a5_0x5cb3;function a5_0x5cb3(_0x496b7f,_0x458eb8){_0x496b7f=_0x496b7f-0x1da;const _0x416bf9=a5_0x416b();let _0x5cb382=_0x416bf9[_0x496b7f];return _0x5cb382;}(function(_0x31fdc6,_0x515ce5){const _0x5f3eb7=a5_0x5cb3,_0x44701e=_0x31fdc6();while(!![]){try{const _0x1a6e6f=parseInt(_0x5f3eb7(0x214))/0x1*(parseInt(_0x5f3eb7(0x26c))/0x2)+parseInt(_0x5f3eb7(0x246))/0x3+parseInt(_0x5f3eb7(0x268))/0x4+-parseInt(_0x5f3eb7(0x228))/0x5*(-parseInt(_0x5f3eb7(0x261))/0x6)+-parseInt(_0x5f3eb7(0x24a))/0x7+parseInt(_0x5f3eb7(0x252))/0x8+-parseInt(_0x5f3eb7(0x23a))/0x9*(parseInt(_0x5f3eb7(0x1e8))/0xa);if(_0x1a6e6f===_0x515ce5)break;else _0x44701e['push'](_0x44701e['shift']());}catch(_0x15bc61){_0x44701e['push'](_0x44701e['shift']());}}}(a5_0x416b,0x25710));import*as a5_0x318812 from'node:fs';import*as a5_0x77a59b from'node:path';import a5_0x1cdcfc from'chalk';function a5_0x416b(){const _0xc08cdb=['projectName','substring','721371bcrONI','✗\x20ERROR:\x20','green','FAIL','\x20\x20Project:\x20','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','\x20(cached)','log','2360464ijiBMG','json','table','PASS','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','reason','white','testName','...\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','Agent:\x20','resolveAgentId','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','tsv','context','72120ZDNYTi','trim','projectDir','\x20\x20Evaluating...\x20','text','writeFileSync','length','332852KzyYTN','Usage:','testYmlPath','name','7826RIcfKU','New\x20tests\x20to\x20execute:\x20','Re-evaluation\x20Summary','toISOString','Failed:\x20\x20\x20','\x20-\x20','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','output','size','Re-evaluating...','conversation_url','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','Tests\x20found:\x20','\x22:\x20','llmProject','10lVDjkQ','\x20\x20Round\x20','jsonl','Running:\x20','agent:test','Evaluating\x20response...','\x27\x20to\x20create\x20the\x20folder\x20structure.','basename',':\x20Sending\x20user\x20input...','source','Error:\x20No\x20previous\x20test\x20run\x20found.','status','reeval','\x20\x20Conversation:\x20','multiple_agents','site','Output\x20written\x20to:\x20','existsSync','dim','no_local_folder','add','yellow','Cached\x20run\x20from:\x20','start','Executing\x20new\x20tests...','Error\x20writing\x20output\x20file:\x20','no_tests','Available\x20tests:\x20','agent','Round\x201/','✗\x20FAIL:\x20','Run\x20tests\x20for\x20an\x20LLM\x20agent','split','repeat','includes','Re-evaluating\x20','/<agent-name>','tags','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','test.yml','Passed:\x20\x20\x20','Total:\x20\x20\x20\x20','\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path','agentDirs','49ZAYvBD','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','map','Round\x20','✓\x20PASS:\x20','Project\x20path:\x20','isSpinning','now','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Run\x20\x27tdx\x20agent\x20pull\x20','agentName','filter','ERROR','no_context','red','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','\x20\x20Agent:\x20','llm','Cached\x20run\x20is\x20from\x20site\x20\x22','Re-evaluating\x20cached\x20test\x20run...','95hXmKVz','forEach','executeReeval','\x20(new)','eval','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','Conversation\x20URL:\x20','join','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','...','dryRun','conversations','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','push','stop','round','not\x20found','7277121EjpaSw','✗\x20ERROR:\x20Project\x20not\x20found:\x20','404','\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)','toLowerCase','message','utf-8','cyan','Failed\x20Tests:','execute','\x22,\x20but\x20current\x20site\x20is\x20\x22','tests','799782TkLdYH','rounds'];a5_0x416b=function(){return _0xc08cdb;};return a5_0x416b();}import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0xfc51c3(0x26b)]=a5_0xfc51c3(0x1ec);['description']=a5_0xfc51c3(0x207);async[a5_0xfc51c3(0x243)](_0x1161e8){const _0x461f6b=a5_0xfc51c3,{options:_0x1223c5,args:_0x374b6e,tdx:_0x2898c7}=_0x1161e8,_0x65a708=_0x374b6e[0x0]||'.',_0x3a08b0=_0x1223c5[_0x461f6b(0x233)],_0x140e81=_0x1223c5,_0x5484fa=_0x140e81[_0x461f6b(0x22c)]===![],_0x4680b1=_0x140e81[_0x461f6b(0x1f4)],_0x19dc1c=_0x140e81['name'],_0x2e66a7=_0x140e81[_0x461f6b(0x20d)],_0x5d2efc=_0x1223c5[_0x461f6b(0x1f7)],_0x5154d2=_0x140e81[_0x461f6b(0x1e0)];if(_0x4680b1&&_0x5484fa)return console[_0x461f6b(0x251)](a5_0x1cdcfc[_0x461f6b(0x222)](_0x461f6b(0x25e))),0x1;let _0x2ad6c0=_0x461f6b(0x254);if(_0x140e81[_0x461f6b(0x253)])_0x2ad6c0=_0x461f6b(0x253);else{if(_0x140e81[_0x461f6b(0x1ea)])_0x2ad6c0=_0x461f6b(0x1ea);else{if(_0x140e81[_0x461f6b(0x25f)])_0x2ad6c0=_0x461f6b(0x25f);else{if(_0x140e81[_0x461f6b(0x254)])_0x2ad6c0='table';}}}const _0x56e1c8=_0x140e81[_0x461f6b(0x1e7)];let _0x2e29f0=_0x65a708;const _0x284fee=a5_0x318812[_0x461f6b(0x1f9)](_0x65a708),_0x565687=_0x65a708==='.';if(!_0x284fee||_0x565687){const _0x3b610f=resolveProjectFromContext(_0x65a708,_0x56e1c8,{'requireFile':_0x461f6b(0x20f)});if(_0x3b610f['found'])_0x2e29f0=_0x3b610f['projectDir'],_0x3b610f[_0x461f6b(0x1f1)]===_0x461f6b(0x260)&&console['log'](a5_0x1cdcfc[_0x461f6b(0x1fa)]('Using\x20agent:\x20'+_0x2e29f0));else switch(_0x3b610f[_0x461f6b(0x257)]){case _0x461f6b(0x221):console[_0x461f6b(0x251)](a5_0x1cdcfc['yellow'](_0x3b610f[_0x461f6b(0x23f)])),console[_0x461f6b(0x251)](),console['log'](_0x461f6b(0x269)),console[_0x461f6b(0x251)](_0x461f6b(0x212)),console[_0x461f6b(0x251)](_0x461f6b(0x23d)),console[_0x461f6b(0x251)](),console[_0x461f6b(0x251)](_0x461f6b(0x21c));return 0x1;case _0x461f6b(0x1fb):console['log'](a5_0x1cdcfc['yellow'](_0x3b610f[_0x461f6b(0x23f)])),console[_0x461f6b(0x251)](),console['log'](_0x461f6b(0x21d)+_0x3b610f[_0x461f6b(0x1e7)]+_0x461f6b(0x1ee));return 0x1;case _0x461f6b(0x1f6):{const _0x115db8=a5_0x77a59b[_0x461f6b(0x1ef)](_0x3b610f[_0x461f6b(0x263)]);console[_0x461f6b(0x251)](a5_0x1cdcfc[_0x461f6b(0x1fd)](_0x461f6b(0x1df)+_0x3b610f[_0x461f6b(0x1e7)]+'\x22:'));for(const _0x475c53 of _0x3b610f[_0x461f6b(0x213)]){console[_0x461f6b(0x251)]('\x20\x20-\x20'+_0x475c53);}return console[_0x461f6b(0x251)](),console[_0x461f6b(0x251)](_0x461f6b(0x223)+_0x115db8+_0x461f6b(0x20c)),0x1;}case _0x461f6b(0x202):console[_0x461f6b(0x251)](a5_0x1cdcfc[_0x461f6b(0x1fd)](_0x461f6b(0x235)+_0x3b610f[_0x461f6b(0x1e7)]+'\x22.')),console['log'](a5_0x1cdcfc[_0x461f6b(0x1fa)](_0x461f6b(0x219)+_0x3b610f[_0x461f6b(0x263)])),console[_0x461f6b(0x251)](),console[_0x461f6b(0x251)]('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0x134d89,agentInfo:_0x803de3}=parseTestFile(_0x2e29f0);let _0x1ba0da=_0x134d89['tests'];if(_0x19dc1c){const _0x39d734=_0x19dc1c['split'](',')[_0x461f6b(0x216)](_0x141289=>_0x141289[_0x461f6b(0x262)]());_0x1ba0da=_0x134d89['tests'][_0x461f6b(0x21f)](_0x2d1fa5=>_0x39d734[_0x461f6b(0x20a)](_0x2d1fa5['name']));if(_0x1ba0da['length']===0x0)return console[_0x461f6b(0x251)](a5_0x1cdcfc['yellow']('No\x20tests\x20found\x20matching:\x20'+_0x19dc1c)),console['log'](a5_0x1cdcfc['dim'](_0x461f6b(0x203)+_0x134d89[_0x461f6b(0x245)][_0x461f6b(0x216)](_0x1c7afc=>_0x1c7afc[_0x461f6b(0x26b)])[_0x461f6b(0x22f)](',\x20'))),0x1;}if(_0x2e66a7){const _0x188dd4=_0x2e66a7[_0x461f6b(0x208)](',')[_0x461f6b(0x216)](_0x2bf055=>_0x2bf055[_0x461f6b(0x262)]()[_0x461f6b(0x23e)]());_0x1ba0da=_0x1ba0da['filter'](_0xc64f0d=>_0xc64f0d[_0x461f6b(0x20d)]?.['some'](_0x423384=>_0x188dd4[_0x461f6b(0x20a)](_0x423384['toLowerCase']())));if(_0x1ba0da[_0x461f6b(0x267)]===0x0){console[_0x461f6b(0x251)](a5_0x1cdcfc[_0x461f6b(0x1fd)]('No\x20tests\x20found\x20with\x20tags:\x20'+_0x2e66a7));const _0x30bbb8=new Set();return _0x134d89[_0x461f6b(0x245)][_0x461f6b(0x229)](_0x2ca1b1=>_0x2ca1b1['tags']?.[_0x461f6b(0x229)](_0x5649fb=>_0x30bbb8[_0x461f6b(0x1fc)](_0x5649fb))),_0x30bbb8[_0x461f6b(0x1e1)]>0x0?console[_0x461f6b(0x251)](a5_0x1cdcfc['dim']('Available\x20tags:\x20'+[..._0x30bbb8][_0x461f6b(0x22f)](',\x20'))):console[_0x461f6b(0x251)](a5_0x1cdcfc[_0x461f6b(0x1fa)]('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0x4680b1)return this[_0x461f6b(0x22a)](_0x1161e8,{'definition':{'tests':_0x1ba0da},'agentInfo':_0x803de3,'outputFormat':_0x2ad6c0,'outputFile':_0x5154d2,'testNames':_0x19dc1c});if(_0x3a08b0){console[_0x461f6b(0x251)](a5_0x1cdcfc[_0x461f6b(0x241)]('Test\x20Configuration:')),console['log']('\x20\x20Site:\x20'+a5_0x1cdcfc['white'](_0x5d2efc)),console[_0x461f6b(0x251)](_0x461f6b(0x24e)+a5_0x1cdcfc[_0x461f6b(0x258)](_0x803de3[_0x461f6b(0x248)])),console['log'](_0x461f6b(0x224)+a5_0x1cdcfc[_0x461f6b(0x258)](_0x803de3[_0x461f6b(0x21e)])),console[_0x461f6b(0x251)](),console['log'](_0x461f6b(0x1e5)+a5_0x1cdcfc[_0x461f6b(0x258)](_0x1ba0da[_0x461f6b(0x267)]));for(let _0x43e728=0x0;_0x43e728<_0x1ba0da[_0x461f6b(0x267)];_0x43e728++){const _0x35b8c9=_0x1ba0da[_0x43e728],_0xa65e7b=_0x35b8c9[_0x461f6b(0x247)]['length']===0x1?_0x461f6b(0x238):_0x461f6b(0x247),_0x4dc5da=_0x35b8c9['tags']?.[_0x461f6b(0x267)]?'\x20['+_0x35b8c9[_0x461f6b(0x20d)]['join'](',\x20')+']':'';console[_0x461f6b(0x251)]('\x20\x20'+(_0x43e728+0x1)+'.\x20'+a5_0x1cdcfc['white'](_0x35b8c9[_0x461f6b(0x26b)])+'\x20('+_0x35b8c9[_0x461f6b(0x247)][_0x461f6b(0x267)]+'\x20'+_0xa65e7b+')'+a5_0x1cdcfc['dim'](_0x4dc5da));}return 0x0;}let _0x5239a7,_0x3e5243;try{_0x5239a7=await _0x2898c7[_0x461f6b(0x225)]['resolveProjectId'](_0x803de3[_0x461f6b(0x248)]);}catch(_0x3aef88){const _0x5b739e=_0x3aef88 instanceof Error?_0x3aef88['message']:String(_0x3aef88);return _0x5b739e[_0x461f6b(0x20a)](_0x461f6b(0x23c))||_0x5b739e['toLowerCase']()[_0x461f6b(0x20a)](_0x461f6b(0x239))?console[_0x461f6b(0x251)](a5_0x1cdcfc['red'](_0x461f6b(0x23b)+_0x803de3[_0x461f6b(0x248)])):console['log'](a5_0x1cdcfc[_0x461f6b(0x222)](_0x461f6b(0x215)+_0x803de3[_0x461f6b(0x248)]+_0x461f6b(0x1e6)+_0x5b739e)),0x1;}try{_0x3e5243=await _0x2898c7[_0x461f6b(0x225)][_0x461f6b(0x25d)](_0x803de3[_0x461f6b(0x21e)],_0x5239a7);}catch(_0x41274c){const _0xd3993b=_0x41274c instanceof Error?_0x41274c[_0x461f6b(0x23f)]:String(_0x41274c);return _0xd3993b[_0x461f6b(0x20a)](_0x461f6b(0x23c))||_0xd3993b[_0x461f6b(0x23e)]()['includes'](_0x461f6b(0x239))?console[_0x461f6b(0x251)](a5_0x1cdcfc[_0x461f6b(0x222)](_0x461f6b(0x24f)+_0x803de3[_0x461f6b(0x21e)])):console['log'](a5_0x1cdcfc[_0x461f6b(0x222)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x803de3[_0x461f6b(0x21e)]+_0x461f6b(0x1e6)+_0xd3993b)),0x1;}let _0x5b3339;if(!_0x5484fa)try{_0x5b3339=await setupEvaluatorAgent(_0x2898c7[_0x461f6b(0x225)],_0x1223c5['verbose']);}catch(_0x486e35){const _0x5a369a=_0x486e35 instanceof Error?_0x486e35[_0x461f6b(0x23f)]:String(_0x486e35);return console[_0x461f6b(0x251)](a5_0x1cdcfc[_0x461f6b(0x222)](_0x461f6b(0x20e)+_0x5a369a)),0x1;}console[_0x461f6b(0x251)](a5_0x1cdcfc[_0x461f6b(0x241)]('Running\x20agent\x20tests...')),console[_0x461f6b(0x251)]('Site:\x20'+a5_0x1cdcfc[_0x461f6b(0x258)](_0x5d2efc)),console['log'](_0x461f6b(0x25c)+a5_0x1cdcfc['white'](_0x803de3[_0x461f6b(0x248)]+'/'+_0x803de3[_0x461f6b(0x21e)])),console['log']();const _0x43e843=[],_0x322b78=[],_0x35c88f=Date[_0x461f6b(0x21b)]();for(let _0x238ae7=0x0;_0x238ae7<_0x1ba0da['length'];_0x238ae7++){const _0x5904ac=_0x1ba0da[_0x238ae7];_0x1ba0da[_0x461f6b(0x267)]>0x1?console[_0x461f6b(0x251)]('Test\x20'+(_0x238ae7+0x1)+'/'+_0x1ba0da[_0x461f6b(0x267)]+':\x20'+a5_0x1cdcfc[_0x461f6b(0x258)](_0x5904ac[_0x461f6b(0x26b)])):console[_0x461f6b(0x251)]('Running\x20test:\x20'+a5_0x1cdcfc[_0x461f6b(0x258)](_0x5904ac[_0x461f6b(0x26b)]));const _0x30ece1=createCommandSpinner(_0x461f6b(0x205)+_0x5904ac[_0x461f6b(0x247)]['length']+':\x20Sending\x20user\x20input...');_0x30ece1[_0x461f6b(0x1ff)]();try{const {result:_0x4962c9,conversation:_0x5db45c}=await runTest(_0x2898c7[_0x461f6b(0x225)],_0x5904ac,{'agentId':_0x3e5243,'projectId':_0x5239a7,'site':_0x5d2efc,'noEval':_0x5484fa,'evaluatorId':_0x5b3339,'onRoundStart':(_0x510d90,_0x5defbb)=>{const _0x41591f=_0x461f6b;_0x30ece1['text']=_0x41591f(0x217)+(_0x510d90+0x1)+'/'+_0x5defbb+_0x41591f(0x1f0);},'onRoundComplete':(_0x26702e,_0xff4f48,_0x10a93d)=>{const _0x17bbfa=_0x461f6b,_0x1afdf0=formatElapsed(_0xff4f48);_0x10a93d?console[_0x17bbfa(0x251)](_0x17bbfa(0x1e9)+(_0x26702e+0x1)+'/'+_0x5904ac[_0x17bbfa(0x247)][_0x17bbfa(0x267)]+'...\x20'+a5_0x1cdcfc[_0x17bbfa(0x24c)]('✓')+'\x20('+_0x1afdf0+')'):console['log'](_0x17bbfa(0x1e9)+(_0x26702e+0x1)+'/'+_0x5904ac[_0x17bbfa(0x247)][_0x17bbfa(0x267)]+_0x17bbfa(0x25a)+a5_0x1cdcfc['red']('✗'));},'onEvaluationStart':()=>{const _0x449d19=_0x461f6b;_0x30ece1[_0x449d19(0x265)]=_0x449d19(0x1ed);},'onEvaluationComplete':_0x4a3833=>{const _0x8bde59=_0x461f6b,_0x5f4c46=formatElapsed(_0x4a3833);console['log']('\x20\x20Evaluating...\x20'+a5_0x1cdcfc[_0x8bde59(0x24c)]('✓')+'\x20('+_0x5f4c46+')');}});_0x30ece1['stop'](),_0x43e843['push'](_0x4962c9),_0x322b78['push'](_0x5db45c);if(_0x4962c9[_0x461f6b(0x1f3)]==='PASS')console[_0x461f6b(0x251)](a5_0x1cdcfc[_0x461f6b(0x24c)]('✓\x20PASS:\x20'+_0x4962c9[_0x461f6b(0x257)]));else _0x4962c9[_0x461f6b(0x1f3)]===_0x461f6b(0x24d)?console[_0x461f6b(0x251)](a5_0x1cdcfc[_0x461f6b(0x222)]('✗\x20FAIL:\x20'+_0x4962c9['reason'])):console[_0x461f6b(0x251)](a5_0x1cdcfc[_0x461f6b(0x222)](_0x461f6b(0x24b)+_0x4962c9[_0x461f6b(0x257)]));_0x4962c9[_0x461f6b(0x1e3)]&&console[_0x461f6b(0x251)](a5_0x1cdcfc['dim'](_0x461f6b(0x22e)+_0x4962c9[_0x461f6b(0x1e3)])),console[_0x461f6b(0x251)]();}catch(_0x1f3349){_0x30ece1[_0x461f6b(0x237)]();const _0x17ad77=_0x1f3349 instanceof Error?_0x1f3349[_0x461f6b(0x23f)]:String(_0x1f3349);console[_0x461f6b(0x251)](a5_0x1cdcfc['red'](_0x461f6b(0x24b)+_0x17ad77)),console[_0x461f6b(0x251)](),_0x43e843['push']({'name':_0x5904ac[_0x461f6b(0x26b)],'status':'ERROR','reason':_0x17ad77,'timestamp':new Date()[_0x461f6b(0x1dc)](),'duration_ms':0x0});}}const _0x4116c2=Date['now']()-_0x35c88f,_0x474bce=_0x43e843[_0x461f6b(0x21f)](_0x26a78d=>_0x26a78d[_0x461f6b(0x1f3)]===_0x461f6b(0x255))[_0x461f6b(0x267)],_0x285069=_0x43e843[_0x461f6b(0x21f)](_0x4c7372=>_0x4c7372['status']===_0x461f6b(0x24d))['length'],_0x337c28=_0x43e843[_0x461f6b(0x21f)](_0x88504f=>_0x88504f['status']===_0x461f6b(0x220))[_0x461f6b(0x267)];console['log']('━'[_0x461f6b(0x209)](0x3c)),console[_0x461f6b(0x251)]('Test\x20Summary'),console[_0x461f6b(0x251)]('━'['repeat'](0x3c)),console['log'](_0x461f6b(0x211)+_0x43e843[_0x461f6b(0x267)]),console[_0x461f6b(0x251)](_0x461f6b(0x210)+a5_0x1cdcfc[_0x461f6b(0x24c)](_0x474bce)),console[_0x461f6b(0x251)](_0x461f6b(0x1dd)+a5_0x1cdcfc[_0x461f6b(0x222)](_0x285069));_0x337c28>0x0&&console[_0x461f6b(0x251)]('Errors:\x20\x20\x20'+a5_0x1cdcfc['red'](_0x337c28));console['log']('Duration:\x20'+formatElapsed(_0x4116c2)),console['log']('━'[_0x461f6b(0x209)](0x3c));const _0x33b67c=_0x43e843[_0x461f6b(0x21f)](_0x49f3a4=>_0x49f3a4['status']!==_0x461f6b(0x255));if(_0x33b67c[_0x461f6b(0x267)]>0x0){console[_0x461f6b(0x251)](),console[_0x461f6b(0x251)](_0x461f6b(0x242));for(const _0xca1db5 of _0x33b67c){const _0xdcd272=a5_0x1cdcfc[_0x461f6b(0x222)]('✗'),_0x35e8fc=_0xca1db5[_0x461f6b(0x257)][_0x461f6b(0x267)]>0x32?_0xca1db5[_0x461f6b(0x257)][_0x461f6b(0x249)](0x0,0x32)+'...':_0xca1db5[_0x461f6b(0x257)];console[_0x461f6b(0x251)]('\x20\x20'+_0xdcd272+'\x20'+_0xca1db5[_0x461f6b(0x26b)]+':\x20'+_0x35e8fc);}}const _0x300cd1={'summary':{'total':_0x43e843[_0x461f6b(0x267)],'passed':_0x474bce,'failed':_0x285069,'errors':_0x337c28>0x0?_0x337c28:undefined,'duration_ms':_0x4116c2},'tests':_0x43e843,'agent':{'project':_0x803de3[_0x461f6b(0x248)],'name':_0x803de3[_0x461f6b(0x21e)],'site':_0x5d2efc},'timestamp':new Date(_0x35c88f)['toISOString']()};try{const _0x4141eb=buildCachedTestRun(_0x322b78,{'site':_0x5d2efc,'projectId':_0x5239a7,'projectName':_0x803de3[_0x461f6b(0x248)],'agentId':_0x3e5243,'agentName':_0x803de3[_0x461f6b(0x21e)],'testYmlPath':a5_0x77a59b['resolve'](_0x803de3[_0x461f6b(0x26a)])});saveLastTestRun(_0x4141eb);}catch{}if(_0x2ad6c0!=='table'||_0x5154d2){const _0x4f1ed0=formatResults(_0x300cd1,_0x2ad6c0);if(_0x5154d2)try{a5_0x318812[_0x461f6b(0x266)](_0x5154d2,_0x4f1ed0,_0x461f6b(0x240)),console['log'](),console['log'](a5_0x1cdcfc[_0x461f6b(0x1fa)](_0x461f6b(0x1f8)+_0x5154d2));}catch(_0x160602){return console[_0x461f6b(0x251)](),console[_0x461f6b(0x251)](a5_0x1cdcfc['red']('Error\x20writing\x20output\x20file:\x20'+_0x160602)),0x1;}else console[_0x461f6b(0x251)](),console['log'](_0x4f1ed0);}return _0x33b67c[_0x461f6b(0x267)]>0x0?0x1:0x0;}async[a5_0xfc51c3(0x22a)](_0x2a97cd,_0x31e21e){const _0x3ae425=a5_0xfc51c3,{options:_0xad058a,tdx:_0x32edf2}=_0x2a97cd,{definition:_0x1a3b59,agentInfo:_0x4a6bcc,outputFormat:_0x3b8799,outputFile:_0x31e72c}=_0x31e21e,_0x2aeb24=_0xad058a['site'],_0x383376=loadLastTestRun();if(!_0x383376)return console['log'](a5_0x1cdcfc['red'](_0x3ae425(0x1f2))),console[_0x3ae425(0x251)](a5_0x1cdcfc[_0x3ae425(0x1fa)](_0x3ae425(0x231))),0x1;if(_0x383376['agent']['agentName']!==_0x4a6bcc[_0x3ae425(0x21e)])return console['log'](a5_0x1cdcfc[_0x3ae425(0x222)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x383376[_0x3ae425(0x204)][_0x3ae425(0x21e)]+_0x3ae425(0x256)+_0x4a6bcc[_0x3ae425(0x21e)]+'\x22.')),console[_0x3ae425(0x251)](a5_0x1cdcfc['dim'](_0x3ae425(0x22d))),0x1;const _0x4d0237=new Set(_0x383376[_0x3ae425(0x234)][_0x3ae425(0x216)](_0xc1a29=>_0xc1a29[_0x3ae425(0x259)])),_0x37f710=_0x1a3b59[_0x3ae425(0x245)][_0x3ae425(0x21f)](_0x5268df=>!_0x4d0237['has'](_0x5268df[_0x3ae425(0x26b)]));if(_0x37f710[_0x3ae425(0x267)]>0x0&&_0x383376[_0x3ae425(0x1f7)]!==_0x2aeb24)return console['log'](a5_0x1cdcfc['red'](_0x3ae425(0x1e4))),console[_0x3ae425(0x251)](a5_0x1cdcfc[_0x3ae425(0x1fa)](_0x3ae425(0x226)+_0x383376['site']+_0x3ae425(0x244)+_0x2aeb24+'\x22.')),console['log'](a5_0x1cdcfc[_0x3ae425(0x1fa)]('Either\x20switch\x20to\x20the\x20\x22'+_0x383376[_0x3ae425(0x1f7)]+_0x3ae425(0x25b))),0x1;const _0x34fbd5=_0x1a3b59[_0x3ae425(0x245)]['filter'](_0x1fd808=>_0x4d0237['has'](_0x1fd808[_0x3ae425(0x26b)])),_0x2d344f=_0x37f710;let _0x3ed8a8;try{_0x3ed8a8=await setupEvaluatorAgent(_0x32edf2[_0x3ae425(0x225)],_0xad058a['verbose']);}catch(_0x30fa3b){const _0x5f37e2=_0x30fa3b instanceof Error?_0x30fa3b[_0x3ae425(0x23f)]:String(_0x30fa3b);return console['log'](a5_0x1cdcfc[_0x3ae425(0x222)](_0x3ae425(0x20e)+_0x5f37e2)),0x1;}console[_0x3ae425(0x251)](a5_0x1cdcfc[_0x3ae425(0x241)](_0x3ae425(0x227))),console[_0x3ae425(0x251)](_0x3ae425(0x1fe)+a5_0x1cdcfc['white'](_0x383376['timestamp'])),console[_0x3ae425(0x251)](_0x3ae425(0x25c)+a5_0x1cdcfc[_0x3ae425(0x258)](_0x383376[_0x3ae425(0x204)]['projectName']+'/'+_0x383376['agent'][_0x3ae425(0x21e)]));_0x2d344f[_0x3ae425(0x267)]>0x0&&console[_0x3ae425(0x251)](_0x3ae425(0x1da)+a5_0x1cdcfc['yellow'](_0x2d344f[_0x3ae425(0x267)]));console[_0x3ae425(0x251)]();const _0x178da9=[],_0x42cd9b=Date['now'](),_0x41bfe5=createCommandSpinner(_0x3ae425(0x1e2));if(_0x34fbd5['length']>0x0)try{const _0xce77a=await reevaluateFromCache(_0x32edf2['llm'],_0x383376,{'tests':_0x34fbd5},{'evaluatorId':_0x3ed8a8,'onTestStart':(_0x24fc19,_0xbf65ad,_0xfc770d)=>{const _0x92b474=_0x3ae425;_0x41bfe5['text']=_0x92b474(0x20b)+(_0xbf65ad+0x1)+'/'+_0xfc770d+':\x20'+_0x24fc19+_0x92b474(0x232);if(!_0x41bfe5[_0x92b474(0x21a)])_0x41bfe5[_0x92b474(0x1ff)]();},'onTestComplete':(_0x16a558,_0x599137)=>{const _0x4b3964=_0x3ae425;_0x41bfe5[_0x4b3964(0x237)]();if(_0x599137['status']===_0x4b3964(0x255))console[_0x4b3964(0x251)](a5_0x1cdcfc['green'](_0x4b3964(0x218)+_0x16a558)+a5_0x1cdcfc['dim'](_0x4b3964(0x250)));else _0x599137[_0x4b3964(0x1f3)]===_0x4b3964(0x24d)?console['log'](a5_0x1cdcfc[_0x4b3964(0x222)](_0x4b3964(0x206)+_0x16a558+_0x4b3964(0x1de)+_0x599137[_0x4b3964(0x257)])+a5_0x1cdcfc[_0x4b3964(0x1fa)]('\x20(cached)')):console[_0x4b3964(0x251)](a5_0x1cdcfc[_0x4b3964(0x222)](_0x4b3964(0x24b)+_0x16a558+_0x4b3964(0x1de)+_0x599137[_0x4b3964(0x257)]));_0x599137[_0x4b3964(0x1e3)]&&console[_0x4b3964(0x251)](a5_0x1cdcfc[_0x4b3964(0x1fa)](_0x4b3964(0x1f5)+_0x599137['conversation_url'])),_0x178da9[_0x4b3964(0x236)](_0x599137);},'onTestSkipped':(_0x3d3966,_0x9aec07)=>{const _0x37c277=_0x3ae425;_0x41bfe5['stop'](),console['log'](a5_0x1cdcfc[_0x37c277(0x1fd)]('⚠\x20SKIPPED:\x20'+_0x3d3966+_0x37c277(0x1de)+_0x9aec07));}});for(const _0x7aa217 of _0xce77a){!_0x178da9['find'](_0x247727=>_0x247727[_0x3ae425(0x26b)]===_0x7aa217['name'])&&_0x178da9[_0x3ae425(0x236)](_0x7aa217);}}catch(_0x577d92){_0x41bfe5[_0x3ae425(0x237)]();const _0x205e9f=_0x577d92 instanceof Error?_0x577d92['message']:String(_0x577d92);return console[_0x3ae425(0x251)](a5_0x1cdcfc['red'](_0x3ae425(0x230)+_0x205e9f)),0x1;}_0x41bfe5[_0x3ae425(0x237)]();if(_0x2d344f[_0x3ae425(0x267)]>0x0){console[_0x3ae425(0x251)](),console[_0x3ae425(0x251)](a5_0x1cdcfc[_0x3ae425(0x241)](_0x3ae425(0x200)));const {projectId:_0x3278f4,agentId:_0xd56cca}=_0x383376[_0x3ae425(0x204)];for(const _0x4546aa of _0x2d344f){console[_0x3ae425(0x251)](_0x3ae425(0x1eb)+a5_0x1cdcfc[_0x3ae425(0x258)](_0x4546aa[_0x3ae425(0x26b)]));const _0x531ad8=createCommandSpinner('Round\x201/'+_0x4546aa[_0x3ae425(0x247)][_0x3ae425(0x267)]+_0x3ae425(0x1f0));_0x531ad8['start']();try{const {result:_0x5e8eef}=await runTest(_0x32edf2['llm'],_0x4546aa,{'agentId':_0xd56cca,'projectId':_0x3278f4,'site':_0x383376[_0x3ae425(0x1f7)],'noEval':![],'evaluatorId':_0x3ed8a8,'onRoundStart':(_0x43b575,_0x3e0c71)=>{const _0x252ece=_0x3ae425;_0x531ad8[_0x252ece(0x265)]=_0x252ece(0x217)+(_0x43b575+0x1)+'/'+_0x3e0c71+_0x252ece(0x1f0);},'onRoundComplete':(_0x446484,_0x33a7ea,_0x47c6ae)=>{const _0x1998fe=_0x3ae425,_0x2c36af=formatElapsed(_0x33a7ea);_0x47c6ae?console[_0x1998fe(0x251)](_0x1998fe(0x1e9)+(_0x446484+0x1)+'/'+_0x4546aa[_0x1998fe(0x247)][_0x1998fe(0x267)]+_0x1998fe(0x25a)+a5_0x1cdcfc[_0x1998fe(0x24c)]('✓')+'\x20('+_0x2c36af+')'):console[_0x1998fe(0x251)](_0x1998fe(0x1e9)+(_0x446484+0x1)+'/'+_0x4546aa['rounds'][_0x1998fe(0x267)]+_0x1998fe(0x25a)+a5_0x1cdcfc[_0x1998fe(0x222)]('✗'));},'onEvaluationStart':()=>{const _0x805827=_0x3ae425;_0x531ad8['text']=_0x805827(0x1ed);},'onEvaluationComplete':_0x4e35bf=>{const _0xc9f48c=_0x3ae425,_0x5d9401=formatElapsed(_0x4e35bf);console[_0xc9f48c(0x251)](_0xc9f48c(0x264)+a5_0x1cdcfc[_0xc9f48c(0x24c)]('✓')+'\x20('+_0x5d9401+')');}});_0x531ad8[_0x3ae425(0x237)](),_0x178da9[_0x3ae425(0x236)](_0x5e8eef);if(_0x5e8eef['status']===_0x3ae425(0x255))console[_0x3ae425(0x251)](a5_0x1cdcfc[_0x3ae425(0x24c)](_0x3ae425(0x218)+_0x5e8eef['reason'])+a5_0x1cdcfc['dim'](_0x3ae425(0x22b)));else _0x5e8eef[_0x3ae425(0x1f3)]==='FAIL'?console[_0x3ae425(0x251)](a5_0x1cdcfc[_0x3ae425(0x222)](_0x3ae425(0x206)+_0x5e8eef[_0x3ae425(0x257)])+a5_0x1cdcfc[_0x3ae425(0x1fa)]('\x20(new)')):console[_0x3ae425(0x251)](a5_0x1cdcfc['red'](_0x3ae425(0x24b)+_0x5e8eef[_0x3ae425(0x257)]));_0x5e8eef['conversation_url']&&console[_0x3ae425(0x251)](a5_0x1cdcfc['dim']('\x20\x20Conversation:\x20'+_0x5e8eef[_0x3ae425(0x1e3)]));}catch(_0x2e60ac){_0x531ad8[_0x3ae425(0x237)]();const _0x432bbe=_0x2e60ac instanceof Error?_0x2e60ac[_0x3ae425(0x23f)]:String(_0x2e60ac);console['log'](a5_0x1cdcfc[_0x3ae425(0x222)](_0x3ae425(0x24b)+_0x432bbe)),_0x178da9[_0x3ae425(0x236)]({'name':_0x4546aa[_0x3ae425(0x26b)],'status':_0x3ae425(0x220),'reason':_0x432bbe,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console[_0x3ae425(0x251)]();const _0xa0aa9c=Date[_0x3ae425(0x21b)]()-_0x42cd9b,_0x57cc8c=_0x178da9[_0x3ae425(0x21f)](_0x2d85f5=>_0x2d85f5[_0x3ae425(0x1f3)]===_0x3ae425(0x255))[_0x3ae425(0x267)],_0x20c4e2=_0x178da9[_0x3ae425(0x21f)](_0x481b85=>_0x481b85[_0x3ae425(0x1f3)]===_0x3ae425(0x24d))[_0x3ae425(0x267)],_0x5dfc80=_0x178da9[_0x3ae425(0x21f)](_0x43a5e3=>_0x43a5e3['status']===_0x3ae425(0x220))[_0x3ae425(0x267)];console['log']('━'['repeat'](0x3c)),console[_0x3ae425(0x251)](_0x3ae425(0x1db)),console[_0x3ae425(0x251)]('━'[_0x3ae425(0x209)](0x3c)),console[_0x3ae425(0x251)](_0x3ae425(0x211)+_0x178da9[_0x3ae425(0x267)]),console[_0x3ae425(0x251)](_0x3ae425(0x210)+a5_0x1cdcfc[_0x3ae425(0x24c)](_0x57cc8c)),console[_0x3ae425(0x251)]('Failed:\x20\x20\x20'+a5_0x1cdcfc[_0x3ae425(0x222)](_0x20c4e2));_0x5dfc80>0x0&&console[_0x3ae425(0x251)]('Errors:\x20\x20\x20'+a5_0x1cdcfc[_0x3ae425(0x222)](_0x5dfc80));console[_0x3ae425(0x251)]('Duration:\x20'+formatElapsed(_0xa0aa9c)),console['log']('━'['repeat'](0x3c));const _0x528d62={'summary':{'total':_0x178da9['length'],'passed':_0x57cc8c,'failed':_0x20c4e2,'errors':_0x5dfc80>0x0?_0x5dfc80:undefined,'duration_ms':_0xa0aa9c},'tests':_0x178da9,'agent':{'project':_0x4a6bcc[_0x3ae425(0x248)],'name':_0x4a6bcc[_0x3ae425(0x21e)],'site':_0x2aeb24},'timestamp':new Date(_0x42cd9b)['toISOString']()};if(_0x3b8799!==_0x3ae425(0x254)||_0x31e72c){const _0x4e5826=formatResults(_0x528d62,_0x3b8799);if(_0x31e72c)try{a5_0x318812[_0x3ae425(0x266)](_0x31e72c,_0x4e5826,_0x3ae425(0x240)),console[_0x3ae425(0x251)](),console[_0x3ae425(0x251)](a5_0x1cdcfc[_0x3ae425(0x1fa)](_0x3ae425(0x1f8)+_0x31e72c));}catch(_0x212035){return console[_0x3ae425(0x251)](),console['log'](a5_0x1cdcfc['red'](_0x3ae425(0x201)+_0x212035)),0x1;}else console['log'](),console[_0x3ae425(0x251)](_0x4e5826);}const _0x268075=_0x178da9[_0x3ae425(0x21f)](_0x3cb75f=>_0x3cb75f['status']!==_0x3ae425(0x255));return _0x268075[_0x3ae425(0x267)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x24b2bd=a6_0x209a;(function(_0x3f19c6,_0x218260){const _0x40e54d=a6_0x209a,_0x21dcfc=_0x3f19c6();while(!![]){try{const _0x1809e9=parseInt(_0x40e54d(0x1e1))/0x1*(-parseInt(_0x40e54d(0x1d1))/0x2)+parseInt(_0x40e54d(0x1f5))/0x3*(-parseInt(_0x40e54d(0x1e5))/0x4)+parseInt(_0x40e54d(0x1dc))/0x5+parseInt(_0x40e54d(0x1d3))/0x6+-parseInt(_0x40e54d(0x1d5))/0x7+parseInt(_0x40e54d(0x209))/0x8+-parseInt(_0x40e54d(0x20d))/0x9*(-parseInt(_0x40e54d(0x1ee))/0xa);if(_0x1809e9===_0x218260)break;else _0x21dcfc['push'](_0x21dcfc['shift']());}catch(_0x2fe554){_0x21dcfc['push'](_0x21dcfc['shift']());}}}(a6_0x1690,0x2223e));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';function a6_0x209a(_0x78f948,_0x2d0322){_0x78f948=_0x78f948-0x1c9;const _0x1690d7=a6_0x1690();let _0x209a28=_0x1690d7[_0x78f948];return _0x209a28;}import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set(['authorization','proxy-authorization',a6_0x24b2bd(0x20e),a6_0x24b2bd(0x1ff),'set-cookie2',a6_0x24b2bd(0x1dd),a6_0x24b2bd(0x1f0),a6_0x24b2bd(0x204)]);function isSensitiveHeader(_0x263783){const _0x5c993d=a6_0x24b2bd;return SENSITIVE_HEADERS['has'](_0x263783[_0x5c993d(0x1cd)]());}function parseHeader(_0x30ce88){const _0x3b269e=a6_0x24b2bd,_0xdf9186=_0x30ce88[_0x3b269e(0x1f3)](':');if(_0xdf9186===-0x1)throw new Error('Invalid\x20header\x20format:\x20\x22'+_0x30ce88+_0x3b269e(0x1fc)+_0x3b269e(0x1d6));const _0x167467=_0x30ce88['substring'](0x0,_0xdf9186)[_0x3b269e(0x1e9)](),_0x1f3c83=_0x30ce88[_0x3b269e(0x1d7)](_0xdf9186+0x1)[_0x3b269e(0x1e9)]();if(!_0x167467)throw new Error(_0x3b269e(0x1da)+_0x30ce88+'\x22');return[_0x167467,_0x1f3c83];}function a6_0x1690(){const _0x451bce=['x-trino-user','llm','cdp','includes','color','1845008OzJXGD','isArray','PATCH','Invalid\x20API\x20type:\x20','469998MTIFlL','cookie','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','description','header','workflow','validate','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','toLowerCase','message','DELETE','error','2ncFydH','file','985350QwiSgG','startsWith','1578528RGUAyt','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','substring','.\x20Valid\x20methods:\x20','GET','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','443580zrJLjE','x-xsrf-token','stack','join','data','21627xNaYJN','method','body','\x0aStack\x20trace:\x0a','560Ppalpn','length','Invalid\x20HTTP\x20method:\x20','log','trim','verbose','name','headers','entries','10UTRYVr','readBodyFromFile','x-auth-token','trino','Error:\x20','indexOf','keys','3189NjqriH','Endpoint\x20must\x20start\x20with\x20/:\x20','POST','request','type','site','api','\x22.\x20','output','.\x20Valid\x20types:\x20','set-cookie','execute','status','PUT','toUpperCase'];a6_0x1690=function(){return _0x451bce;};return a6_0x1690();}export class ApiCommand extends BaseCommand{[a6_0x24b2bd(0x1eb)]=a6_0x24b2bd(0x1fb);[a6_0x24b2bd(0x210)]=a6_0x24b2bd(0x1cc);[a6_0x24b2bd(0x1cb)](_0x436fe5){const _0x3af69a=a6_0x24b2bd,{args:_0x278d2b,options:_0x32c48f}=_0x436fe5,_0x490461=_0x32c48f;if(_0x278d2b[_0x3af69a(0x1e6)]===0x0)return _0x3af69a(0x1db);const _0x1fcfa4=_0x278d2b[0x0];if(!_0x1fcfa4[_0x3af69a(0x1d4)]('/'))return _0x3af69a(0x1f6)+_0x1fcfa4;const _0x3d136d=_0x490461[_0x3af69a(0x1e0)],_0x24be6c=_0x490461['file'];if(_0x3d136d&&_0x24be6c)return _0x3af69a(0x20f);const _0x24df71=_0x490461[_0x3af69a(0x1e2)]||_0x3af69a(0x1d9),_0x549604=['GET',_0x3af69a(0x1f7),_0x3af69a(0x202),_0x3af69a(0x1cf),_0x3af69a(0x20b)];if(!_0x549604[_0x3af69a(0x207)](_0x24df71[_0x3af69a(0x203)]()))return _0x3af69a(0x1e7)+_0x24df71+_0x3af69a(0x1d8)+_0x549604[_0x3af69a(0x1df)](',\x20');const _0x240f3f=_0x490461[_0x3af69a(0x1f9)]||'td',_0x5f0625=['td',_0x3af69a(0x206),_0x3af69a(0x1ca),_0x3af69a(0x1f1),_0x3af69a(0x205),'llm-proxy'];if(!_0x5f0625[_0x3af69a(0x207)](_0x240f3f))return _0x3af69a(0x20c)+_0x240f3f+_0x3af69a(0x1fe)+_0x5f0625[_0x3af69a(0x1df)](',\x20');return undefined;}async[a6_0x24b2bd(0x200)](_0x41c28d){const _0x5255e3=a6_0x24b2bd,{options:_0x342c79,args:_0x39901d,tdx:_0x36148b}=_0x41c28d,_0x1104f5=_0x342c79,_0x1f98b1=_0x39901d[0x0],_0x58ff64=(_0x1104f5[_0x5255e3(0x1e2)]||_0x5255e3(0x1d9))['toUpperCase'](),_0x1ddf85=_0x1104f5[_0x5255e3(0x1e0)],_0x102e16=_0x1104f5[_0x5255e3(0x1d2)],_0x4e8274=_0x1104f5[_0x5255e3(0x1c9)],_0x338357=_0x1104f5[_0x5255e3(0x1f9)]||'td';try{const _0x213cf2={};if(_0x4e8274){const _0x4fe59c=Array[_0x5255e3(0x20a)](_0x4e8274)?_0x4e8274:[_0x4e8274];for(const _0x5c43d6 of _0x4fe59c){const [_0x506036,_0x12be6b]=parseHeader(_0x5c43d6);_0x213cf2[_0x506036]=_0x12be6b;}}let _0x80d232;if(_0x1ddf85)_0x80d232=_0x1ddf85;else{if(_0x102e16)try{_0x80d232=RawAPI[_0x5255e3(0x1ef)](_0x102e16);}catch(_0x40447c){return console[_0x5255e3(0x1d0)](_0x5255e3(0x1f2)+(_0x40447c instanceof Error?_0x40447c[_0x5255e3(0x1ce)]:String(_0x40447c))),0x1;}}const _0x44fa52={'method':_0x58ff64,'apiType':_0x338357,'includeHeaders':_0x342c79[_0x5255e3(0x1ea)]};_0x80d232&&(_0x44fa52[_0x5255e3(0x1e3)]=_0x80d232);Object[_0x5255e3(0x1f4)](_0x213cf2)[_0x5255e3(0x1e6)]>0x0&&(_0x44fa52[_0x5255e3(0x1ec)]=_0x213cf2);if(_0x342c79['verbose']){const _0x42539d=resolveSite(_0x342c79[_0x5255e3(0x1fa)]),_0x18e6bd=getEndpoint(_0x42539d,_0x338357),_0x451132=''+_0x18e6bd+_0x1f98b1;console[_0x5255e3(0x1d0)]('>\x20'+_0x58ff64+'\x20'+_0x451132);const _0x28085a=getAuthHeaders(_0x42539d),_0x4cd120={..._0x28085a,..._0x213cf2};for(const [_0x7c5263,_0x4059aa]of Object[_0x5255e3(0x1ed)](_0x4cd120)){!isSensitiveHeader(_0x7c5263)&&console[_0x5255e3(0x1d0)]('>\x20'+_0x7c5263+':\x20'+_0x4059aa);}_0x80d232&&console[_0x5255e3(0x1d0)]('>'),console[_0x5255e3(0x1d0)]('');}const _0x3306be=await _0x36148b['api'][_0x5255e3(0x1f8)](_0x1f98b1,_0x44fa52);if(_0x342c79[_0x5255e3(0x1ea)]&&_0x3306be[_0x5255e3(0x1ec)]){console[_0x5255e3(0x1d0)]('<\x20HTTP/1.1\x20'+_0x3306be[_0x5255e3(0x201)]);for(const [_0xaf9114,_0x5d00ca]of Object[_0x5255e3(0x1ed)](_0x3306be[_0x5255e3(0x1ec)])){!isSensitiveHeader(_0xaf9114)&&console['error']('<\x20'+_0xaf9114+':\x20'+_0x5d00ca);}console[_0x5255e3(0x1d0)]('');}const _0x4181e9=Boolean(_0x342c79[_0x5255e3(0x1fd)]),_0x229123={'color':_0x342c79[_0x5255e3(0x208)],'noColor':_0x342c79['noColor']||_0x4181e9&&!_0x342c79[_0x5255e3(0x208)]},_0x18eb65=colorizeJSON(_0x3306be[_0x5255e3(0x1e0)],_0x229123);return _0x342c79['output']?(writeFileSync(_0x342c79[_0x5255e3(0x1fd)],_0x18eb65),console[_0x5255e3(0x1d0)]('Results\x20saved\x20to\x20'+_0x342c79[_0x5255e3(0x1fd)])):console[_0x5255e3(0x1e8)](_0x18eb65),0x0;}catch(_0x10044a){return _0x10044a instanceof Error?(console[_0x5255e3(0x1d0)](_0x5255e3(0x1f2)+_0x10044a[_0x5255e3(0x1ce)]),_0x342c79['verbose']&&_0x10044a[_0x5255e3(0x1de)]&&console['error'](_0x5255e3(0x1e4)+_0x10044a[_0x5255e3(0x1de)])):console[_0x5255e3(0x1d0)](_0x5255e3(0x1f2)+String(_0x10044a)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a7_0x533bce=a7_0x4512;(function(_0x2abe04,_0x41c05a){const _0xf1dc47=a7_0x4512,_0x5e5f11=_0x2abe04();while(!![]){try{const _0x58f520=parseInt(_0xf1dc47(0x221))/0x1+parseInt(_0xf1dc47(0x20d))/0x2*(-parseInt(_0xf1dc47(0x200))/0x3)+-parseInt(_0xf1dc47(0x1f9))/0x4+parseInt(_0xf1dc47(0x226))/0x5+-parseInt(_0xf1dc47(0x21b))/0x6+-parseInt(_0xf1dc47(0x1f8))/0x7+parseInt(_0xf1dc47(0x1ef))/0x8*(parseInt(_0xf1dc47(0x201))/0x9);if(_0x58f520===_0x41c05a)break;else _0x5e5f11['push'](_0x5e5f11['shift']());}catch(_0x4dd51b){_0x5e5f11['push'](_0x5e5f11['shift']());}}}(a7_0x37d9,0xaebbc));function a7_0x4512(_0x2c3510,_0x40391f){_0x2c3510=_0x2c3510-0x1e7;const _0x37d97f=a7_0x37d9();let _0x45124f=_0x37d97f[_0x2c3510];return _0x45124f;}import{BaseCommand,printAuthError}from'./command.js';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_0x1108af from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a7_0x25ca08 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x533bce(0x204)]=a7_0x533bce(0x1f4);[a7_0x533bce(0x1f3)]=a7_0x533bce(0x20f);async[a7_0x533bce(0x219)](_0x17115c){const _0x5d1b1b=a7_0x533bce,{options:_0x35576d}=_0x17115c,_0x5568d4=_0x35576d[_0x5d1b1b(0x218)];console[_0x5d1b1b(0x1ea)](a7_0x25ca08[_0x5d1b1b(0x1fd)]('tdx:\x20auth\x20setup'));const _0x277624=_0x35576d[_0x5d1b1b(0x1e9)]||'us01',{choices:_0x53945e,initialIndex:_0x5b00e8}=buildSiteChoices(_0x277624),_0x2ffc4d=_0x5568d4?'Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20'+_0x5568d4+'):':_0x5d1b1b(0x1fa),_0x2c2807=await a7_0x1108af({'type':'select','name':'site','message':_0x2ffc4d,'choices':_0x53945e,'initial':_0x5b00e8});if(!_0x2c2807[_0x5d1b1b(0x1e9)])return console['log']('\x0aSetup\x20cancelled'),0x1;let _0x11b11a;if(_0x2c2807[_0x5d1b1b(0x1e9)]===_0x5d1b1b(0x1f6)){const _0x540f41=await a7_0x1108af({'type':_0x5d1b1b(0x21e),'name':'customSite','message':_0x5d1b1b(0x21d),'initial':_0x5d1b1b(0x22b),'validate':_0x5d8af6=>{const _0x3cfb3d=_0x5d1b1b;if(!_0x5d8af6||!_0x5d8af6[_0x3cfb3d(0x21a)]())return _0x3cfb3d(0x215);if(!/^[a-z0-9-]+$/[_0x3cfb3d(0x1eb)](_0x5d8af6['trim']()))return _0x3cfb3d(0x1ed);return!![];}});if(!_0x540f41[_0x5d1b1b(0x211)])return console[_0x5d1b1b(0x1ea)]('\x0aSetup\x20cancelled'),0x1;_0x11b11a=_0x540f41[_0x5d1b1b(0x211)];}else _0x11b11a=_0x2c2807[_0x5d1b1b(0x1e9)];const _0x370781=resolveSite(_0x11b11a);console[_0x5d1b1b(0x1ea)](_0x5d1b1b(0x205)+_0x370781),console[_0x5d1b1b(0x1ea)](_0x5d1b1b(0x229)),console['log']('\x20\x20'+getConsoleUrl(_0x370781,'/app/mp/ak'));const _0x5825f8=await a7_0x1108af({'type':'password','name':_0x5d1b1b(0x224),'message':_0x5d1b1b(0x222),'validate':_0x337511=>{if(!_0x337511||!_0x337511['trim']())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x5825f8[_0x5d1b1b(0x224)])return console[_0x5d1b1b(0x1ea)](_0x5d1b1b(0x212)),0x1;const _0x4c4df0=_0x5825f8[_0x5d1b1b(0x224)];console[_0x5d1b1b(0x1ea)]('Validating\x20API\x20key...');try{const _0x1ebb60=TDX['create']({'site':_0x370781,'apiKey':_0x4c4df0[_0x5d1b1b(0x21a)](),'logLevel':_0x35576d[_0x5d1b1b(0x203)]??LogLevel[_0x5d1b1b(0x213)]}),_0x421798=await _0x1ebb60['jobs'][_0x5d1b1b(0x20b)]();console[_0x5d1b1b(0x1ea)](_0x5d1b1b(0x223)+_0x421798[_0x5d1b1b(0x207)]+')');const _0x1b0177=await isKeychainAvailable();_0x1b0177?(await saveAPIKeyAsync(_0x4c4df0[_0x5d1b1b(0x21a)](),_0x370781,_0x5568d4),console[_0x5d1b1b(0x1ea)]('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0x5568d4?'\x20(profile:\x20'+_0x5568d4+')':''))):(console[_0x5d1b1b(0x22a)](a7_0x25ca08[_0x5d1b1b(0x216)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0x5d1b1b(0x22a)](a7_0x25ca08['yellow'](_0x5d1b1b(0x220))));if(_0x5568d4){const _0x770b46={'site':_0x370781};saveProfileToUserConfig(_0x5568d4,_0x770b46),console['log'](_0x5d1b1b(0x21f)+_0x5568d4+_0x5d1b1b(0x20e));}else saveDefaultSiteToUserConfig(_0x370781),console[_0x5d1b1b(0x1ea)]('✓\x20Default\x20site\x20set\x20to\x20'+_0x370781);const _0x4b43af=_0x5568d4?_0x5d1b1b(0x1f7)+_0x5568d4:'';return console['log'](),console[_0x5d1b1b(0x1ea)](_0x5d1b1b(0x225)),console[_0x5d1b1b(0x1ea)]('\x20\x20tdx'+_0x4b43af+_0x5d1b1b(0x1fb)),console[_0x5d1b1b(0x1ea)](_0x5d1b1b(0x1e8)+_0x4b43af+_0x5d1b1b(0x1f1)),0x0;}catch(_0x18efce){if(_0x18efce instanceof HTTPClientError&&_0x18efce[_0x5d1b1b(0x206)]===0x191)return printAuthError(_0x18efce),0x1;return console[_0x5d1b1b(0x21c)](a7_0x25ca08[_0x5d1b1b(0x1f2)](_0x5d1b1b(0x20c)+(_0x18efce instanceof Error?_0x18efce[_0x5d1b1b(0x227)]:String(_0x18efce)))),console[_0x5d1b1b(0x21c)]('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x533bce(0x204)]=a7_0x533bce(0x1fc);[a7_0x533bce(0x1f3)]='Show\x20authentication\x20status\x20and\x20validate\x20API\x20key';async['execute'](_0x166cbf){const _0x56a10c=a7_0x533bce,{options:_0x446bbe,tdx:_0x334133}=_0x166cbf,_0x2dec42=_0x446bbe[_0x56a10c(0x1e9)],_0x187ac8=_0x446bbe['profile'],_0x4b3c1d=_0x187ac8?_0x187ac8:'N/A';console['log'](_0x56a10c(0x1e7)+_0x4b3c1d+_0x56a10c(0x202)+_0x2dec42+')');const _0x1729cf=await resolveAPIKeyAsync(_0x2dec42,_0x187ac8);if(_0x1729cf){const {source:_0x1ca0a5,isDeprecated:_0x4d72cd}=_0x1729cf,_0x431635='Read\x20credential\x20from\x20'+_0x1ca0a5;console[_0x56a10c(0x1ea)](_0x4d72cd?a7_0x25ca08[_0x56a10c(0x216)](_0x431635):_0x431635);}else console[_0x56a10c(0x1ea)](a7_0x25ca08[_0x56a10c(0x216)](_0x56a10c(0x1f0)));try{const _0x5d1b49=await _0x334133[_0x56a10c(0x209)]['getUserInfo']();return console['log'](a7_0x25ca08['green'](_0x56a10c(0x1ee))),console[_0x56a10c(0x1ea)](_0x56a10c(0x208)+_0x5d1b49[_0x56a10c(0x207)]),(_0x5d1b49['first_name']||_0x5d1b49['last_name'])&&console[_0x56a10c(0x1ea)]('Name:\x20'+[_0x5d1b49[_0x56a10c(0x1fe)],_0x5d1b49[_0x56a10c(0x1f5)]]['filter'](Boolean)[_0x56a10c(0x1ff)]('\x20')),0x0;}catch(_0x1c69a7){return _0x1c69a7 instanceof HTTPClientError&&_0x1c69a7[_0x56a10c(0x206)]===0x191?printAuthError(_0x1c69a7,!![],_0x187ac8):console[_0x56a10c(0x21c)](a7_0x25ca08[_0x56a10c(0x1f2)](_0x56a10c(0x20c)+(_0x1c69a7 instanceof Error?_0x1c69a7[_0x56a10c(0x227)]:String(_0x1c69a7)))),0x1;}}}function a7_0x37d9(){const _0x1af95e=['Site\x20name\x20cannot\x20be\x20empty','yellow','tdx:\x20auth\x20clear','profile','execute','trim','5749398RmaDpk','error','Enter\x20site\x20name:','text','✓\x20Profile\x20\x27','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','1356264QnYAum','Enter\x20your\x20TD\x20API\x20key:','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','apiKey','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','1082175tJoCMT','message','\x20for\x20profile:\x20','You\x20can\x20find\x20your\x20API\x20key\x20at:','warn','us01','tdx\x20profile:\x20','\x20\x20tdx','site','log','test','\x20(profile:\x20','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','✓\x20Authentication\x20successful\x0a','7496fYOund','No\x20credential\x20found','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','red','description','auth:setup','last_name','other','\x20--profile\x20','8194858HtaLPw','4959156izmnLw','Select\x20your\x20Treasure\x20Data\x20site:','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','auth','bold','first_name','join','1209288bbdDXH','31869PEONBH','\x20(site:\x20','logLevel','name','Setting\x20up\x20authentication\x20for\x20site:\x20','status','email','User:\x20','jobs','✓\x20API\x20key\x20removed\x20from\x20keychain','getUserInfo','✗\x20Validation\x20failed:\x20','4KSlILo','\x27\x20registered','Setup\x20API\x20key\x20authentication\x20interactively','System\x20keychain\x20is\x20not\x20available','customSite','\x0aSetup\x20cancelled','ERROR','No\x20API\x20key\x20found\x20in\x20keychain'];a7_0x37d9=function(){return _0x1af95e;};return a7_0x37d9();}export class AuthClearCommand extends BaseCommand{[a7_0x533bce(0x204)]='auth:clear';['description']='Remove\x20API\x20key\x20from\x20system\x20keychain';async[a7_0x533bce(0x219)](_0x58f980){const _0x3d6474=a7_0x533bce,{options:_0x21e841}=_0x58f980,_0x856e7c=_0x21e841['profile'];console['log'](a7_0x25ca08['bold'](_0x3d6474(0x217)));const _0x7fc551=await isKeychainAvailable();if(!_0x7fc551)return console[_0x3d6474(0x21c)](a7_0x25ca08[_0x3d6474(0x1f2)](_0x3d6474(0x210))),0x1;const _0x1ed321=await deleteKeychainAPIKey(_0x856e7c);return _0x1ed321?(clearCredentialCache(),console['log'](_0x3d6474(0x20a)+(_0x856e7c?_0x3d6474(0x1ec)+_0x856e7c+')':'')),0x0):(console[_0x3d6474(0x1ea)](_0x3d6474(0x214)+(_0x856e7c?_0x3d6474(0x228)+_0x856e7c:'')),0x1);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a8_0x81974c=a8_0x4cfb;(function(_0x4897a6,_0x397fbf){const _0x4c5cee=a8_0x4cfb,_0x2023ca=_0x4897a6();while(!![]){try{const _0x12a1e0=-parseInt(_0x4c5cee(0x1a5))/0x1+parseInt(_0x4c5cee(0x1bd))/0x2*(-parseInt(_0x4c5cee(0x191))/0x3)+parseInt(_0x4c5cee(0x1cb))/0x4*(-parseInt(_0x4c5cee(0x193))/0x5)+-parseInt(_0x4c5cee(0x1b9))/0x6*(parseInt(_0x4c5cee(0x1a0))/0x7)+-parseInt(_0x4c5cee(0x1c5))/0x8+-parseInt(_0x4c5cee(0x1cc))/0x9+parseInt(_0x4c5cee(0x1ac))/0xa;if(_0x12a1e0===_0x397fbf)break;else _0x2023ca['push'](_0x2023ca['shift']());}catch(_0x3abacd){_0x2023ca['push'](_0x2023ca['shift']());}}}(a8_0x4ac7,0x67159));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_0x4ac7(){const _0x4b32e8=['done','Using\x20cached\x20default\x20agent:\x20','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','targetKnowledgeBase','stringify','claude-4.5-haiku','includes','execute','\x0aError:\x20','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','9678FTKgZv','cause','15zeczws','tool','name','getOrCreateDefaultAgent','session\x20context','streamChat','\x0aStack\x20trace:','event','llmAgent','agentId','stream','agent','404','2341164xWXWcl','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','targetAgent','new','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','176839LQzids','llm','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','metadata','targetWebSearchTool','stdout','message','30517900IwyZIJ','verbose','llmProject','context','data','Resolving\x20project\x20\x27','Continuing\x20chat:\x20','\x27...','chatId','validate','write','join','options','6WfwTbY','content','\x20\x20Cause:\x20','log','30bVcEWE','targetFunction','code','CHAT_NOT_FOUND','type','functionName','\x27\x20not\x20found','projectId','6637256AlHMcn','streamChatJsonl','Error:\x20Chat\x20session\x20\x27','error','startChat','tool_result','1083908AyJtSX','3845592JAqCJq','getDefaultAgent','Getting\x20default\x20agent...','chat','site','stack','tool_call'];a8_0x4ac7=function(){return _0x4b32e8;};return a8_0x4ac7();}function handleSDKError(_0x4c7a21,_0x40fdc0){const _0x39bcbb=a8_0x4cfb;if(_0x4c7a21 instanceof SDKError)console[_0x39bcbb(0x1c8)]('Error:\x20'+_0x4c7a21['message']),_0x40fdc0[_0x39bcbb(0x1ad)]&&(_0x4c7a21[_0x39bcbb(0x192)]&&console[_0x39bcbb(0x1c8)](_0x39bcbb(0x1bb)+_0x4c7a21[_0x39bcbb(0x192)]),_0x4c7a21[_0x39bcbb(0x185)]&&(console[_0x39bcbb(0x1c8)](_0x39bcbb(0x199)),console[_0x39bcbb(0x1c8)](_0x4c7a21['stack'])));else throw _0x4c7a21;}function a8_0x4cfb(_0xb2681a,_0x5cd914){_0xb2681a=_0xb2681a-0x182;const _0x4ac7ea=a8_0x4ac7();let _0x4cfb03=_0x4ac7ea[_0xb2681a];return _0x4cfb03;}async function resolveAgentId(_0x1f76e3,_0x20d662,_0x371b48,_0x8127c3,_0x1128f4){const _0x3b677d=a8_0x4cfb,_0x4f1516=_0x20d662||_0x371b48;if(_0x4f1516){const {projectName:_0x268f76,agentName:_0xc91604}=parseAgentRef(_0x4f1516),_0x4d289b=_0xc91604||_0x4f1516,_0x14ce87=_0xc91604?_0x268f76:_0x8127c3;if(!_0x14ce87)throw new Error(_0x3b677d(0x1a4));if(_0x1128f4){const _0x435427=_0x20d662?'--agent\x20flag':_0x3b677d(0x197);console[_0x3b677d(0x1c8)]('Using\x20agent\x20from\x20'+_0x435427+':\x20'+_0x14ce87+'/'+_0x4d289b);}const _0x5e8881=await withSpinner(_0x3b677d(0x1b1)+_0x14ce87+'\x27...',()=>_0x1f76e3[_0x3b677d(0x1a6)]['resolveProjectId'](_0x14ce87),{'verbose':_0x1128f4}),_0xb7cc7b=await withSpinner('Resolving\x20agent\x20\x27'+_0x4d289b+_0x3b677d(0x1b3),()=>_0x1f76e3['llm']['resolveAgentId'](_0x4d289b,_0x5e8881[_0x3b677d(0x1b0)]),{'verbose':_0x1128f4});return _0xb7cc7b[_0x3b677d(0x1b0)];}else{const _0x10e9d3=_0x1f76e3[_0x3b677d(0x1a6)][_0x3b677d(0x1cd)]();if(_0x10e9d3)return _0x1128f4&&console[_0x3b677d(0x1c8)](_0x3b677d(0x188)+_0x10e9d3[_0x3b677d(0x195)]),_0x10e9d3['id'];const _0x517d77=await withSpinner(_0x3b677d(0x182),()=>_0x1f76e3[_0x3b677d(0x1a6)][_0x3b677d(0x196)](_0x3b677d(0x18c),0x0),{'verbose':_0x1128f4});return _0x517d77[_0x3b677d(0x1b0)]['id'];}}export class ChatCommand extends BaseCommand{[a8_0x81974c(0x195)]=a8_0x81974c(0x183);['description']=a8_0x81974c(0x1a1);['validate'](_0x5b43e6){const _0x2c2c98=a8_0x81974c,_0x1f3475=_0x5b43e6['args'][_0x2c2c98(0x1b7)]('\x20');if(!_0x1f3475)return _0x2c2c98(0x189);return undefined;}async['streamChat'](_0x27215f,_0x2340d9,_0x392eb9,_0x5ebf03,_0x3d60dc){const _0x4b7771=a8_0x81974c;for await(const _0x2459da of _0x27215f[_0x4b7771(0x1a6)][_0x4b7771(0x183)](_0x2340d9,{'agentId':_0x392eb9,'chatId':_0x5ebf03})){if(_0x2459da['type']==='metadata'){const _0x185454=_0x2459da[_0x4b7771(0x1b0)][_0x4b7771(0x1b4)];saveLastChatId(_0x185454),_0x3d60dc&&console[_0x4b7771(0x1c8)]('Chat\x20session:\x20'+_0x185454);}else _0x2459da[_0x4b7771(0x1c1)]==='event'&&this['handleChatEvent'](_0x2459da['data']);}}async[a8_0x81974c(0x1c6)](_0x3084ab,_0x3e3bf2,_0x3aca4f,_0x28be47){const _0x45918a=a8_0x81974c,_0x42bcde=_0x3084ab[_0x45918a(0x1af)][_0x45918a(0x184)];let _0x4affee=![];for await(const _0x23b2de of _0x3084ab['llm'][_0x45918a(0x183)](_0x3e3bf2,{'agentId':_0x3aca4f,'chatId':_0x28be47})){if(_0x23b2de[_0x45918a(0x1c1)]===_0x45918a(0x1a8)){const _0x5c2f24=_0x23b2de[_0x45918a(0x1b0)];saveLastChatId(_0x5c2f24[_0x45918a(0x1b4)]);const _0x59a1a4=_0x5c2f24[_0x45918a(0x1c4)]&&_0x5c2f24[_0x45918a(0x19c)]?getLLMConversationUrl(_0x42bcde,_0x5c2f24[_0x45918a(0x1c4)],_0x5c2f24[_0x45918a(0x19c)],_0x5c2f24['chatId']):undefined;console[_0x45918a(0x1bc)](JSON[_0x45918a(0x18b)]({'type':_0x45918a(0x1a8),'data':{'chatId':_0x5c2f24[_0x45918a(0x1b4)],'agentId':_0x5c2f24['agentId'],'consoleUrl':_0x59a1a4}})),_0x4affee=!![];}else{if(_0x23b2de[_0x45918a(0x1c1)]===_0x45918a(0x19a)){!_0x4affee&&_0x28be47&&(console[_0x45918a(0x1bc)](JSON[_0x45918a(0x18b)]({'type':_0x45918a(0x1a8),'data':{'chatId':_0x28be47}})),_0x4affee=!![]);const _0x18719e=_0x23b2de[_0x45918a(0x1b0)];if('content'in _0x18719e)console['log'](JSON[_0x45918a(0x18b)]({'type':_0x45918a(0x1ba),'data':{'content':_0x18719e[_0x45918a(0x1ba)]}}));else{if(_0x45918a(0x186)in _0x18719e){const _0x3e4e90=_0x18719e[_0x45918a(0x186)];console[_0x45918a(0x1bc)](JSON['stringify']({'type':_0x45918a(0x186),'data':{'id':_0x3e4e90['id'],'name':_0x3e4e90[_0x45918a(0x1c2)],'target':_0x3e4e90[_0x45918a(0x18a)]?.[_0x45918a(0x195)]||_0x3e4e90[_0x45918a(0x1a2)]?.['name']||_0x3e4e90[_0x45918a(0x1a9)]?.[_0x45918a(0x195)]||_0x3e4e90[_0x45918a(0x1be)]}}));}else{if(_0x45918a(0x194)in _0x18719e)console['log'](JSON[_0x45918a(0x18b)]({'type':_0x45918a(0x1ca),'data':{'id':_0x18719e[_0x45918a(0x194)]['id'],'name':_0x18719e['tool']['functionName'],'result':typeof _0x18719e[_0x45918a(0x194)]['content']==='string'?_0x18719e[_0x45918a(0x194)][_0x45918a(0x1ba)]['slice'](0x0,0x1f4):''}}));else _0x45918a(0x1c8)in _0x18719e&&console[_0x45918a(0x1bc)](JSON['stringify']({'type':_0x45918a(0x1c8),'data':{'error':_0x18719e[_0x45918a(0x1c8)]}}));}}}}}console[_0x45918a(0x1bc)](JSON[_0x45918a(0x18b)]({'type':_0x45918a(0x187)}));}async[a8_0x81974c(0x18e)](_0x126eca){const _0x27f214=a8_0x81974c,{options:_0xc742ec,args:_0x405037,tdx:_0x554d06}=_0x126eca,_0x22bbe1=_0x405037[_0x27f214(0x1b7)]('\x20'),_0x4940d4=_0xc742ec,_0x11e932=_0x4940d4[_0x27f214(0x19e)],_0x28af0c=_0x4940d4[_0x27f214(0x19b)],_0x3fc63a=_0x4940d4[_0x27f214(0x1ae)],_0x281d24=_0x4940d4[_0x27f214(0x1a3)],_0x14ce37=_0x4940d4['chatId'],_0x2902f9=_0x4940d4[_0x27f214(0x19d)];if(_0x281d24&&_0x14ce37)return console[_0x27f214(0x1c8)]('Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together'),0x1;try{let _0x33b20a,_0x32124c;if(_0x14ce37)_0x32124c=_0x14ce37;else!_0x281d24&&(_0x32124c=loadLastChatId(),_0x32124c&&_0xc742ec['verbose']&&console[_0x27f214(0x1c8)](_0x27f214(0x1b2)+_0x32124c));!_0x14ce37&&(_0x281d24||!_0x32124c)&&(_0x33b20a=await resolveAgentId(_0x554d06,_0x11e932,_0x28af0c,_0x3fc63a,_0xc742ec['verbose']));const _0x2963f1=_0x2902f9?(_0x292813,_0x23f9d3,_0x2a60fa)=>this[_0x27f214(0x1c6)](_0x554d06,_0x292813,_0x23f9d3,_0x2a60fa):(_0x274d11,_0x51742f,_0x48e626)=>this[_0x27f214(0x198)](_0x554d06,_0x274d11,_0x51742f,_0x48e626,_0xc742ec['verbose']);try{await _0x2963f1(_0x22bbe1,_0x33b20a,_0x32124c);}catch(_0x35f02e){const _0x327be8=_0x35f02e instanceof SDKError&&_0x35f02e[_0x27f214(0x1bf)]===ErrorCode[_0x27f214(0x1c0)]||_0x35f02e instanceof Error&&_0x35f02e[_0x27f214(0x1ab)][_0x27f214(0x18d)](_0x27f214(0x19f));if(_0x327be8&&_0x14ce37)return console[_0x27f214(0x1c8)](_0x27f214(0x1c7)+_0x14ce37+_0x27f214(0x1c3)),0x1;if(_0x327be8)_0xc742ec[_0x27f214(0x1ad)]&&console[_0x27f214(0x1c8)](_0x27f214(0x1a7)),!_0x33b20a&&(_0x33b20a=await resolveAgentId(_0x554d06,_0x11e932,_0x28af0c,_0x3fc63a,_0xc742ec[_0x27f214(0x1ad)])),await _0x2963f1(_0x22bbe1,_0x33b20a,undefined);else throw _0x35f02e;}return!_0x2902f9&&console[_0x27f214(0x1bc)](),0x0;}catch(_0xbc5ecd){return console[_0x27f214(0x1c8)](),handleSDKError(_0xbc5ecd,_0xc742ec),0x1;}}['handleChatEvent'](_0x17cbcd){const _0x16d802=a8_0x81974c;if('content'in _0x17cbcd)process[_0x16d802(0x1aa)][_0x16d802(0x1b6)](_0x17cbcd[_0x16d802(0x1ba)]);else'error'in _0x17cbcd&&console[_0x16d802(0x1c8)](_0x16d802(0x18f)+_0x17cbcd['error']);}}export class ChatCreateCommand extends BaseCommand{[a8_0x81974c(0x195)]='chat-create';['description']='Create\x20a\x20new\x20chat\x20session';[a8_0x81974c(0x1b5)](_0x1ee24d){const _0x3ac54f=a8_0x81974c,_0x2d89f4=_0x1ee24d[_0x3ac54f(0x1b8)],_0x55da28=_0x2d89f4[_0x3ac54f(0x19e)],_0x213dcb=_0x2d89f4['llmAgent'];if(!_0x55da28&&!_0x213dcb)return _0x3ac54f(0x190);return undefined;}async[a8_0x81974c(0x18e)](_0x36bf42){const _0x277bfd=a8_0x81974c,{options:_0x382403,tdx:_0x15aa2c}=_0x36bf42,_0xcd9dd5=_0x382403,_0x8cca0c=_0xcd9dd5[_0x277bfd(0x19e)],_0x13a1df=_0xcd9dd5[_0x277bfd(0x19b)],_0xf63ba4=_0xcd9dd5[_0x277bfd(0x1ae)];try{const _0x5df2c0=await resolveAgentId(_0x15aa2c,_0x8cca0c,_0x13a1df,_0xf63ba4,_0x382403['verbose']),_0x5a5364=await _0x15aa2c['llm'][_0x277bfd(0x1c9)](_0x5df2c0);return saveLastChatId(_0x5a5364['id']),console[_0x277bfd(0x1bc)](JSON[_0x277bfd(0x18b)]({'chatId':_0x5a5364['id'],'agentId':_0x5df2c0})),0x0;}catch(_0x1752b4){return handleSDKError(_0x1752b4,_0x382403),0x1;}}}
|
|
1
|
+
function a8_0x549d(_0x540afc,_0x57b201){_0x540afc=_0x540afc-0x71;const _0x5a2fba=a8_0x5a2f();let _0x549d7e=_0x5a2fba[_0x540afc];return _0x549d7e;}const a8_0x4faa2f=a8_0x549d;(function(_0x5d4561,_0x39c6f7){const _0x3e025e=a8_0x549d,_0x1b8438=_0x5d4561();while(!![]){try{const _0x393640=parseInt(_0x3e025e(0xaa))/0x1+parseInt(_0x3e025e(0xbe))/0x2+parseInt(_0x3e025e(0x80))/0x3*(parseInt(_0x3e025e(0x8e))/0x4)+parseInt(_0x3e025e(0x8b))/0x5*(parseInt(_0x3e025e(0x7a))/0x6)+parseInt(_0x3e025e(0x85))/0x7*(parseInt(_0x3e025e(0x7c))/0x8)+parseInt(_0x3e025e(0xbb))/0x9*(-parseInt(_0x3e025e(0xb0))/0xa)+parseInt(_0x3e025e(0x95))/0xb*(-parseInt(_0x3e025e(0x89))/0xc);if(_0x393640===_0x39c6f7)break;else _0x1b8438['push'](_0x1b8438['shift']());}catch(_0x5f5c9a){_0x1b8438['push'](_0x1b8438['shift']());}}}(a8_0x5a2f,0xe2e20));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_0x5a2f(){const _0x542057=['16JgNFiK','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','stack','targetWebSearchTool','tool','description','CHAT_NOT_FOUND','12518KofdPn','type','code','functionName','session\x20context','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','write','targetAgent','Using\x20cached\x20default\x20agent:\x20','stream','handleChatEvent','stdout','llm','\x27...','Continuing\x20chat:\x20','stringify','chatId','Using\x20agent\x20from\x20','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','error','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','150343oJLPEH','join','tool_call','\x20\x20Cause:\x20','projectId','llmAgent','12499870GHZZgW','verbose','tool_result','claude-4.5-haiku','event','content','streamChat','name','cause','chat','404','9dLbynh','Error:\x20','Create\x20a\x20new\x20chat\x20session','16310zNHUVl','args','includes','validate','Error:\x20Chat\x20session\x20\x27','resolveProjectId','chat-create','Getting\x20default\x20agent...','llmProject','\x0aStack\x20trace:','3832764XevJxv','execute','13233416TmHNrk','targetKnowledgeBase','streamChatJsonl','metadata','1143549DrbBvX','done','agent','getOrCreateDefaultAgent','\x0aError:\x20','7JZpVJH','\x27\x20not\x20found','data','log','18948OFzieB','Chat\x20session:\x20','5PqQiQx','string','agentId'];a8_0x5a2f=function(){return _0x542057;};return a8_0x5a2f();}import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x37ae54,_0x4a0de8){const _0x532691=a8_0x549d;if(_0x37ae54 instanceof SDKError)console[_0x532691(0xa8)](_0x532691(0xbc)+_0x37ae54['message']),_0x4a0de8[_0x532691(0xb1)]&&(_0x37ae54[_0x532691(0xb8)]&&console['error'](_0x532691(0xad)+_0x37ae54[_0x532691(0xb8)]),_0x37ae54[_0x532691(0x90)]&&(console['error'](_0x532691(0x79)),console['error'](_0x37ae54[_0x532691(0x90)])));else throw _0x37ae54;}async function resolveAgentId(_0x3ae219,_0x3ebf7f,_0x1122ab,_0x28e442,_0xaa13b){const _0x378d5e=a8_0x549d,_0x459425=_0x3ebf7f||_0x1122ab;if(_0x459425){const {projectName:_0x33588c,agentName:_0x5dae6f}=parseAgentRef(_0x459425),_0x215f39=_0x5dae6f||_0x459425,_0x567f58=_0x5dae6f?_0x33588c:_0x28e442;if(!_0x567f58)throw new Error(_0x378d5e(0xa9));if(_0xaa13b){const _0x801817=_0x3ebf7f?'--agent\x20flag':_0x378d5e(0x99);console['error'](_0x378d5e(0xa6)+_0x801817+':\x20'+_0x567f58+'/'+_0x215f39);}const _0x1966da=await withSpinner('Resolving\x20project\x20\x27'+_0x567f58+_0x378d5e(0xa2),()=>_0x3ae219[_0x378d5e(0xa1)][_0x378d5e(0x75)](_0x567f58),{'verbose':_0xaa13b}),_0x177f47=await withSpinner('Resolving\x20agent\x20\x27'+_0x215f39+_0x378d5e(0xa2),()=>_0x3ae219[_0x378d5e(0xa1)]['resolveAgentId'](_0x215f39,_0x1966da['data']),{'verbose':_0xaa13b});return _0x177f47[_0x378d5e(0x87)];}else{const _0x511082=_0x3ae219[_0x378d5e(0xa1)]['getDefaultAgent']();if(_0x511082)return _0xaa13b&&console[_0x378d5e(0xa8)](_0x378d5e(0x9d)+_0x511082[_0x378d5e(0xb7)]),_0x511082['id'];const _0x3be84e=await withSpinner(_0x378d5e(0x77),()=>_0x3ae219[_0x378d5e(0xa1)][_0x378d5e(0x83)](_0x378d5e(0xb3),0x0),{'verbose':_0xaa13b});return _0x3be84e['data']['id'];}}export class ChatCommand extends BaseCommand{[a8_0x4faa2f(0xb7)]='chat';[a8_0x4faa2f(0x93)]=a8_0x4faa2f(0x9a);[a8_0x4faa2f(0x73)](_0x5a02cb){const _0x5ed7e8=a8_0x4faa2f,_0x4fdb82=_0x5a02cb[_0x5ed7e8(0x71)][_0x5ed7e8(0xab)]('\x20');if(!_0x4fdb82)return'Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options';return undefined;}async[a8_0x4faa2f(0xb6)](_0x4ccc4c,_0x452620,_0x161c2e,_0x2b5e01,_0x13f1d8){const _0x440b02=a8_0x4faa2f;for await(const _0x37ff5b of _0x4ccc4c['llm'][_0x440b02(0xb9)](_0x452620,{'agentId':_0x161c2e,'chatId':_0x2b5e01})){if(_0x37ff5b[_0x440b02(0x96)]==='metadata'){const _0x59df9d=_0x37ff5b[_0x440b02(0x87)][_0x440b02(0xa5)];saveLastChatId(_0x59df9d),_0x13f1d8&&console[_0x440b02(0xa8)](_0x440b02(0x8a)+_0x59df9d);}else _0x37ff5b[_0x440b02(0x96)]===_0x440b02(0xb4)&&this[_0x440b02(0x9f)](_0x37ff5b[_0x440b02(0x87)]);}}async['streamChatJsonl'](_0x256ef5,_0x336aac,_0x4379ac,_0x5a9d13){const _0x19197a=a8_0x4faa2f,_0x3edf7c=_0x256ef5['context']['site'];let _0x1f4fc2=![];for await(const _0xa2bded of _0x256ef5['llm']['chat'](_0x336aac,{'agentId':_0x4379ac,'chatId':_0x5a9d13})){if(_0xa2bded[_0x19197a(0x96)]===_0x19197a(0x7f)){const _0xbb67f9=_0xa2bded['data'];saveLastChatId(_0xbb67f9[_0x19197a(0xa5)]);const _0x289b3e=_0xbb67f9['projectId']&&_0xbb67f9[_0x19197a(0x8d)]?getLLMConversationUrl(_0x3edf7c,_0xbb67f9[_0x19197a(0xae)],_0xbb67f9['agentId'],_0xbb67f9['chatId']):undefined;console[_0x19197a(0x88)](JSON[_0x19197a(0xa4)]({'type':'metadata','data':{'chatId':_0xbb67f9[_0x19197a(0xa5)],'agentId':_0xbb67f9['agentId'],'consoleUrl':_0x289b3e}})),_0x1f4fc2=!![];}else{if(_0xa2bded[_0x19197a(0x96)]===_0x19197a(0xb4)){!_0x1f4fc2&&_0x5a9d13&&(console['log'](JSON['stringify']({'type':_0x19197a(0x7f),'data':{'chatId':_0x5a9d13}})),_0x1f4fc2=!![]);const _0x5bc147=_0xa2bded[_0x19197a(0x87)];if('content'in _0x5bc147)console[_0x19197a(0x88)](JSON['stringify']({'type':'content','data':{'content':_0x5bc147[_0x19197a(0xb5)]}}));else{if(_0x19197a(0xac)in _0x5bc147){const _0x4bef04=_0x5bc147[_0x19197a(0xac)];console[_0x19197a(0x88)](JSON[_0x19197a(0xa4)]({'type':_0x19197a(0xac),'data':{'id':_0x4bef04['id'],'name':_0x4bef04[_0x19197a(0x98)],'target':_0x4bef04[_0x19197a(0x7d)]?.[_0x19197a(0xb7)]||_0x4bef04[_0x19197a(0x9c)]?.[_0x19197a(0xb7)]||_0x4bef04[_0x19197a(0x91)]?.['name']||_0x4bef04['targetFunction']}}));}else{if('tool'in _0x5bc147)console[_0x19197a(0x88)](JSON[_0x19197a(0xa4)]({'type':_0x19197a(0xb2),'data':{'id':_0x5bc147['tool']['id'],'name':_0x5bc147[_0x19197a(0x92)][_0x19197a(0x98)],'result':typeof _0x5bc147[_0x19197a(0x92)][_0x19197a(0xb5)]===_0x19197a(0x8c)?_0x5bc147[_0x19197a(0x92)][_0x19197a(0xb5)]['slice'](0x0,0x1f4):''}}));else'error'in _0x5bc147&&console['log'](JSON['stringify']({'type':_0x19197a(0xa8),'data':{'error':_0x5bc147['error']}}));}}}}}console['log'](JSON['stringify']({'type':_0x19197a(0x81)}));}async['execute'](_0x11dd3f){const _0x269a18=a8_0x4faa2f,{options:_0x12541c,args:_0x160f65,tdx:_0x2747b6}=_0x11dd3f,_0x128d28=_0x160f65[_0x269a18(0xab)]('\x20'),_0x18b4ea=_0x12541c,_0x41531f=_0x18b4ea[_0x269a18(0x82)],_0x4e70bc=_0x18b4ea[_0x269a18(0xaf)],_0x37439d=_0x18b4ea['llmProject'],_0x3375ca=_0x18b4ea['new'],_0x4ad92b=_0x18b4ea['chatId'],_0xf61c23=_0x18b4ea[_0x269a18(0x9e)];if(_0x3375ca&&_0x4ad92b)return console[_0x269a18(0xa8)](_0x269a18(0x8f)),0x1;try{let _0x2dff60,_0x219995;if(_0x4ad92b)_0x219995=_0x4ad92b;else!_0x3375ca&&(_0x219995=loadLastChatId(),_0x219995&&_0x12541c[_0x269a18(0xb1)]&&console[_0x269a18(0xa8)](_0x269a18(0xa3)+_0x219995));!_0x4ad92b&&(_0x3375ca||!_0x219995)&&(_0x2dff60=await resolveAgentId(_0x2747b6,_0x41531f,_0x4e70bc,_0x37439d,_0x12541c['verbose']));const _0x4c9f22=_0xf61c23?(_0x2b2dc2,_0x5dde45,_0x2394af)=>this[_0x269a18(0x7e)](_0x2747b6,_0x2b2dc2,_0x5dde45,_0x2394af):(_0x3cdd43,_0xbfbbc7,_0x3ef45d)=>this[_0x269a18(0xb6)](_0x2747b6,_0x3cdd43,_0xbfbbc7,_0x3ef45d,_0x12541c[_0x269a18(0xb1)]);try{await _0x4c9f22(_0x128d28,_0x2dff60,_0x219995);}catch(_0x475bf8){const _0x372edd=_0x475bf8 instanceof SDKError&&_0x475bf8[_0x269a18(0x97)]===ErrorCode[_0x269a18(0x94)]||_0x475bf8 instanceof Error&&_0x475bf8['message'][_0x269a18(0x72)](_0x269a18(0xba));if(_0x372edd&&_0x4ad92b)return console[_0x269a18(0xa8)](_0x269a18(0x74)+_0x4ad92b+_0x269a18(0x86)),0x1;if(_0x372edd)_0x12541c['verbose']&&console[_0x269a18(0xa8)](_0x269a18(0xa7)),!_0x2dff60&&(_0x2dff60=await resolveAgentId(_0x2747b6,_0x41531f,_0x4e70bc,_0x37439d,_0x12541c[_0x269a18(0xb1)])),await _0x4c9f22(_0x128d28,_0x2dff60,undefined);else throw _0x475bf8;}return!_0xf61c23&&console['log'](),0x0;}catch(_0x172fcd){return console[_0x269a18(0xa8)](),handleSDKError(_0x172fcd,_0x12541c),0x1;}}['handleChatEvent'](_0x8659cd){const _0x4e43b0=a8_0x4faa2f;if(_0x4e43b0(0xb5)in _0x8659cd)process[_0x4e43b0(0xa0)][_0x4e43b0(0x9b)](_0x8659cd[_0x4e43b0(0xb5)]);else'error'in _0x8659cd&&console['error'](_0x4e43b0(0x84)+_0x8659cd[_0x4e43b0(0xa8)]);}}export class ChatCreateCommand extends BaseCommand{[a8_0x4faa2f(0xb7)]=a8_0x4faa2f(0x76);['description']=a8_0x4faa2f(0xbd);[a8_0x4faa2f(0x73)](_0x15f242){const _0x294e31=a8_0x4faa2f,_0x1bcda9=_0x15f242['options'],_0x40308e=_0x1bcda9[_0x294e31(0x82)],_0x3c3210=_0x1bcda9['llmAgent'];if(!_0x40308e&&!_0x3c3210)return'Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22';return undefined;}async[a8_0x4faa2f(0x7b)](_0x2ab10f){const _0x117d6d=a8_0x4faa2f,{options:_0x4d61ac,tdx:_0x36253e}=_0x2ab10f,_0x550dac=_0x4d61ac,_0x4ccca=_0x550dac['agent'],_0x24dc3f=_0x550dac[_0x117d6d(0xaf)],_0x117027=_0x550dac[_0x117d6d(0x78)];try{const _0x274301=await resolveAgentId(_0x36253e,_0x4ccca,_0x24dc3f,_0x117027,_0x4d61ac['verbose']),_0x291cbb=await _0x36253e['llm']['startChat'](_0x274301);return saveLastChatId(_0x291cbb['id']),console[_0x117d6d(0x88)](JSON['stringify']({'chatId':_0x291cbb['id'],'agentId':_0x274301})),0x0;}catch(_0x4c036f){return handleSDKError(_0x4c036f,_0x4d61ac),0x1;}}}
|