@treasuredata/tdx 0.27.2 → 0.27.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.d.ts +1 -1
- package/dist/cli-categories.js +1 -1
- package/dist/cli-categories.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.d.ts +17 -0
- package/dist/commands/delivery-command.d.ts.map +1 -0
- package/dist/commands/delivery-command.js +1 -0
- package/dist/commands/delivery-command.js.map +1 -0
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.d.ts +16 -0
- package/dist/commands/engage-campaign-pull-command.d.ts.map +1 -0
- package/dist/commands/engage-campaign-pull-command.js +1 -0
- package/dist/commands/engage-campaign-pull-command.js.map +1 -0
- package/dist/commands/engage-campaign-push-command.d.ts +16 -0
- package/dist/commands/engage-campaign-push-command.d.ts.map +1 -0
- package/dist/commands/engage-campaign-push-command.js +1 -0
- package/dist/commands/engage-campaign-push-command.js.map +1 -0
- package/dist/commands/engage-campaign-validate-command.d.ts +19 -0
- package/dist/commands/engage-campaign-validate-command.d.ts.map +1 -0
- package/dist/commands/engage-campaign-validate-command.js +1 -0
- package/dist/commands/engage-campaign-validate-command.js.map +1 -0
- package/dist/commands/engage-command.d.ts +15 -0
- 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/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.d.ts +31 -0
- package/dist/sdk/client/delivery-api-client.d.ts.map +1 -0
- package/dist/sdk/client/delivery-api-client.js +1 -0
- package/dist/sdk/client/delivery-api-client.js.map +1 -0
- package/dist/sdk/client/endpoints.d.ts +24 -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.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.d.ts +38 -0
- package/dist/sdk/delivery.d.ts.map +1 -0
- package/dist/sdk/delivery.js +1 -0
- package/dist/sdk/delivery.js.map +1 -0
- package/dist/sdk/engage/campaign-pull.d.ts +69 -0
- package/dist/sdk/engage/campaign-pull.d.ts.map +1 -0
- package/dist/sdk/engage/campaign-pull.js +1 -0
- package/dist/sdk/engage/campaign-pull.js.map +1 -0
- package/dist/sdk/engage/campaign-push.d.ts +100 -0
- package/dist/sdk/engage/campaign-push.d.ts.map +1 -0
- package/dist/sdk/engage/campaign-push.js +1 -0
- package/dist/sdk/engage/campaign-push.js.map +1 -0
- package/dist/sdk/engage/campaign-validator.d.ts +18 -0
- package/dist/sdk/engage/campaign-validator.d.ts.map +1 -0
- package/dist/sdk/engage/campaign-validator.js +1 -0
- package/dist/sdk/engage/campaign-validator.js.map +1 -0
- package/dist/sdk/engage/campaign-yaml.d.ts +78 -0
- package/dist/sdk/engage/campaign-yaml.d.ts.map +1 -0
- package/dist/sdk/engage/campaign-yaml.js +1 -0
- package/dist/sdk/engage/campaign-yaml.js.map +1 -0
- package/dist/sdk/engage/types/campaign-def.d.ts +12 -0
- package/dist/sdk/engage/types/campaign-def.d.ts.map +1 -0
- package/dist/sdk/engage/types/campaign-def.js +1 -0
- package/dist/sdk/engage/types/campaign-def.js.map +1 -0
- package/dist/sdk/engage/types/campaign-schema.d.ts +143 -0
- package/dist/sdk/engage/types/campaign-schema.d.ts.map +1 -0
- package/dist/sdk/engage/types/campaign-schema.js +1 -0
- package/dist/sdk/engage/types/campaign-schema.js.map +1 -0
- package/dist/sdk/engage.d.ts +19 -2
- 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 +7 -0
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.d.ts +13 -1
- package/dist/sdk/segment/tdx-config.d.ts.map +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/tdx-config.js.map +1 -1
- package/dist/sdk/segment/validate-files.d.ts +8 -1
- package/dist/sdk/segment/validate-files.d.ts.map +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/validate-files.js.map +1 -1
- package/dist/sdk/segment/yaml-validator.d.ts +1 -1
- package/dist/sdk/segment/yaml-validator.d.ts.map +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment/yaml-validator.js.map +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/engage.d.ts +36 -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.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x19e74f=a4_0x557c;(function(_0x20e12e,_0x24213d){const _0x16cf61=a4_0x557c,_0xe83c7a=_0x20e12e();while(!![]){try{const _0x389125=-parseInt(_0x16cf61(0x160))/0x1*(parseInt(_0x16cf61(0x196))/0x2)+parseInt(_0x16cf61(0x15d))/0x3+parseInt(_0x16cf61(0x10c))/0x4*(parseInt(_0x16cf61(0x10f))/0x5)+parseInt(_0x16cf61(0xfa))/0x6+-parseInt(_0x16cf61(0x143))/0x7*(-parseInt(_0x16cf61(0x156))/0x8)+parseInt(_0x16cf61(0x137))/0x9*(-parseInt(_0x16cf61(0x1a1))/0xa)+-parseInt(_0x16cf61(0x11a))/0xb;if(_0x389125===_0x24213d)break;else _0xe83c7a['push'](_0xe83c7a['shift']());}catch(_0x156907){_0xe83c7a['push'](_0xe83c7a['shift']());}}}(a4_0x5ad9,0xc2d53));import a4_0x2ecb38 from'chalk';import a4_0x57cc7d from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function a4_0x5ad9(){const _0x4de95d=['Using\x20project\x20from\x20','execute','Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','pullProject','Dry\x20run\x20-\x20no\x20files\x20written','573417mwStYg','\x20\x20Knowledge\x20Bases:\x20','profile','Output\x20path:\x20','new','-\x20nothing\x20pushed','yes','\x0aError:','outputDir','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','repeat','\x20\x20Prompt\x20\x22','7SoHwKm','cwd','llm_project','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x20\x20Agent\x20\x22','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x20updated','\x20\x20Source:\x20','llm','outputPath','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','output','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','cloneProject','\x20\x20Text\x20Knowledge\x20Base\x20\x22','Dry\x20run\x20-\x20no\x20changes\x20made','reason','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','1913608RYIYhw','\x20successfully','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','total','llmProject','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','prompts','3670212bCxckh','\x22...','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','3541jAmmrY','\x0aProject\x20pushed\x20with\x20errors','MISSING_ARGUMENT','\x20\x20Integrations:\x20','\x20total','error','pullAgent','site','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','Project:\x20','\x0aChanges\x20to\x20agent\x20\x27','\x20|\x20','sourceProjectName','\x20resources\x20to\x20\x27','log','\x0aChanges:','\x0aChanges\x20to\x20integration\x20\x27','\x20\x20Experimental\x20Artifacts:\x20','integrations','New\x20project:\x20','No\x20tdx.json\x20found\x20in\x20','\x20changed','dim','yellow','newProjectId','cyan','\x20\x20Knowledge\x20Base\x20\x22','Pulling\x20agent\x20\x22','force','\x20unchanged','projectName','Project\x20cloned\x20with\x20errors','agents','Pushing\x20to\x20project...','\x20--profile\x20','\x20\x20Agents:\x20','\x0aErrors\x20found:','INVALID_ARGUMENT','tdx.json','New\x20project\x20ID:\x20','created','Clone\x20\x22','updated','Agent:\x20','Using\x20current\x20project:\x20','\x22:\x20','utf-8','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Using\x20context\x20project:\x20','experimentalKnowledgeBases','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent','Pushing\x20agent\x20from\x20\x22','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','466VwxXXm','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','found','agent:pull','\x22\x20to\x20a\x20different\x20profile','\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)','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x20new','\x20created','agent:clone','pushAgent','230gexjBl','\x0aPull\x20summary\x20for\x20\x27','unchanged','join','Would\x20pull\x20agent:\x20','Cancelled','\x20files\x20to\x20','action','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','session','Using\x20project:\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','textKnowledgeBases','counts','Summary:','\x0aChanges\x20to\x20prompt\x20\x27','\x0aPush\x20summary\x20for\x20\x27','Project\x20cloned\x20successfully','2366406zjzokW','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','source','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','green','isNew','projectId','agent.yml','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','diff','Source:\x20','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','\x20files?','\x20=\x20','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','knowledgeBases','6239356bgmZVt','Writing\x20files...','Failed\x20to\x20push\x20agent:\x20','5aOakRZ','push','experimentalArtifacts','\x20\x20Integration\x20\x22','\x0aWrite\x20','\x20\x20Prompts:\x20','Using\x20local\x20project:\x20','name','hasChanges','agentName','red','3611938uTQwGU','✔\x20Context\x20set:\x20','agentId','errors','<new-name>','context','gray','\x20--name\x20','\x22\x20to\x20new\x20project\x20\x22','pushProject','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','\x20\x20tdx\x20agent\x20pull\x20','description','dirname','message','no_context','Analyzing\x20project\x20\x22','Errors:','parse','Agent\x20','Status:\x20','\x0a✔\x20Pushed\x20','Would\x20push\x20agent:\x20'];a4_0x5ad9=function(){return _0x4de95d;};return a4_0x5ad9();}function formatCountSummary(_0x335f80){const _0x26c6e1=a4_0x557c,_0x2532d6=[];if(_0x335f80[_0x26c6e1(0x159)]!==undefined)_0x2532d6[_0x26c6e1(0x110)](_0x335f80['total']+_0x26c6e1(0x164));if(_0x335f80['new']!==undefined&&_0x335f80['new']>0x0)_0x2532d6[_0x26c6e1(0x110)](a4_0x2ecb38['green'](_0x335f80['new']+_0x26c6e1(0x19d)));if(_0x335f80[_0x26c6e1(0x188)]!==undefined&&_0x335f80['created']>0x0)_0x2532d6[_0x26c6e1(0x110)](a4_0x2ecb38['green'](_0x335f80[_0x26c6e1(0x188)]+_0x26c6e1(0x19e)));if(_0x335f80[_0x26c6e1(0x18a)]!==undefined&&_0x335f80['updated']>0x0)_0x2532d6[_0x26c6e1(0x110)](a4_0x2ecb38['yellow'](_0x335f80[_0x26c6e1(0x18a)]+_0x26c6e1(0x149)));if(_0x335f80[_0x26c6e1(0x1a3)]!==undefined&&_0x335f80[_0x26c6e1(0x1a3)]>0x0)_0x2532d6[_0x26c6e1(0x110)](a4_0x2ecb38[_0x26c6e1(0x120)](_0x335f80[_0x26c6e1(0x1a3)]+_0x26c6e1(0x17d)));if(_0x335f80[_0x26c6e1(0x11d)]!==undefined&&_0x335f80[_0x26c6e1(0x11d)]>0x0)_0x2532d6[_0x26c6e1(0x110)](a4_0x2ecb38[_0x26c6e1(0x119)](_0x335f80[_0x26c6e1(0x11d)]+'\x20errors'));return _0x2532d6[_0x26c6e1(0x1a4)](',\x20');}function displayDiffs(_0x45b5d2,_0x38f017,_0x4b8c74,_0x38afda,_0x47a299,_0x2a7e89,_0x31be38){const _0x201aa1=a4_0x557c;for(const _0x197ee4 of _0x45b5d2){if(_0x197ee4[_0x201aa1(0x105)]){const _0x18012a=_0x197ee4[_0x201aa1(0x118)]||_0x197ee4[_0x201aa1(0x116)];console[_0x201aa1(0x16e)](_0x201aa1(0x16a)+_0x18012a+'\x27:'),console[_0x201aa1(0x16e)]('─'[_0x201aa1(0x141)](0x3c)),console['log'](_0x197ee4[_0x201aa1(0x105)]),console[_0x201aa1(0x16e)]('─'[_0x201aa1(0x141)](0x3c));}}for(const _0x321437 of _0x38f017){_0x321437[_0x201aa1(0x105)]&&(console[_0x201aa1(0x16e)](_0x201aa1(0x195)+_0x321437[_0x201aa1(0x116)]+'\x27:'),console[_0x201aa1(0x16e)]('─'[_0x201aa1(0x141)](0x3c)),console[_0x201aa1(0x16e)](_0x321437[_0x201aa1(0x105)]),console['log']('─'['repeat'](0x3c)));}for(const _0x3d5924 of _0x4b8c74){_0x3d5924['diff']&&(console[_0x201aa1(0x16e)]('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x3d5924[_0x201aa1(0x116)]+'\x27:'),console[_0x201aa1(0x16e)]('─'[_0x201aa1(0x141)](0x3c)),console[_0x201aa1(0x16e)](_0x3d5924[_0x201aa1(0x105)]),console[_0x201aa1(0x16e)]('─'[_0x201aa1(0x141)](0x3c)));}for(const _0x1754d5 of _0x38afda){_0x1754d5[_0x201aa1(0x105)]&&(console[_0x201aa1(0x16e)](_0x201aa1(0xf7)+_0x1754d5[_0x201aa1(0x116)]+'\x27:'),console[_0x201aa1(0x16e)]('─'[_0x201aa1(0x141)](0x3c)),console['log'](_0x1754d5[_0x201aa1(0x105)]),console[_0x201aa1(0x16e)]('─'[_0x201aa1(0x141)](0x3c)));}for(const _0xe985be of _0x47a299){_0xe985be[_0x201aa1(0x105)]&&(console[_0x201aa1(0x16e)](_0x201aa1(0x170)+_0xe985be[_0x201aa1(0x116)]+'\x27:'),console[_0x201aa1(0x16e)]('─'[_0x201aa1(0x141)](0x3c)),console[_0x201aa1(0x16e)](_0xe985be[_0x201aa1(0x105)]),console['log']('─'[_0x201aa1(0x141)](0x3c)));}for(const _0x5876b6 of _0x2a7e89){_0x5876b6['diff']&&(console[_0x201aa1(0x16e)](_0x201aa1(0x104)+_0x5876b6[_0x201aa1(0x116)]+'\x27:'),console[_0x201aa1(0x16e)]('─'[_0x201aa1(0x141)](0x3c)),console['log'](_0x5876b6[_0x201aa1(0x105)]),console['log']('─'[_0x201aa1(0x141)](0x3c)));}for(const _0x4abdf9 of _0x31be38){_0x4abdf9[_0x201aa1(0x105)]&&(console[_0x201aa1(0x16e)](_0x201aa1(0xfd)+_0x4abdf9[_0x201aa1(0x116)]+'\x27:'),console[_0x201aa1(0x16e)]('─'[_0x201aa1(0x141)](0x3c)),console[_0x201aa1(0x16e)](_0x4abdf9[_0x201aa1(0x105)]),console[_0x201aa1(0x16e)]('─'['repeat'](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x19e74f(0x116)]=a4_0x19e74f(0x199);[a4_0x19e74f(0x126)]=a4_0x19e74f(0x15b);async[a4_0x19e74f(0x132)](_0x1a32e2){const _0x588cd8=a4_0x19e74f,{options:_0x81048c,args:_0x576111,tdx:_0x28007c}=_0x1a32e2,_0x3b4b2c=_0x576111[0x0],_0x128bdc=_0x576111[0x1],_0x3217a7=_0x81048c[_0x588cd8(0x14e)],_0x44dd92=_0x81048c['dryRun'],_0x2c1358=_0x81048c['force'],_0xf7e9b0=_0x81048c[_0x588cd8(0x13d)],_0x4ee193=_0x81048c[_0x588cd8(0x15a)];let _0x531989,_0x411f23;const _0x8cf633=findAgentConfigPath(process[_0x588cd8(0x144)]());if(_0x3b4b2c){const _0x4d266a=a4_0x57cc7d[_0x588cd8(0x1a4)](_0x3b4b2c,_0x588cd8(0x186));if(existsSync(_0x4d266a))try{const _0x302bba=JSON['parse'](readFileSync(_0x4d266a,_0x588cd8(0x18e)));_0x531989=_0x302bba[_0x588cd8(0x145)],_0x411f23=_0x3b4b2c,console['log'](a4_0x2ecb38[_0x588cd8(0x176)](_0x588cd8(0x131)+_0x4d266a+':\x20'+_0x531989));}catch{_0x531989=_0x3b4b2c;}else _0x531989=_0x3b4b2c;}else{if(_0x8cf633)try{const _0x26fc3a=JSON[_0x588cd8(0x12c)](readFileSync(_0x8cf633,_0x588cd8(0x18e)));_0x531989=_0x26fc3a['llm_project'],_0x411f23=a4_0x57cc7d[_0x588cd8(0x127)](_0x8cf633),console[_0x588cd8(0x16e)](a4_0x2ecb38['dim'](_0x588cd8(0xf2)+_0x531989));}catch{_0x531989=_0x4ee193;}else _0x531989=_0x4ee193;}if(!_0x531989)return console['log'](a4_0x2ecb38['yellow'](_0x588cd8(0x10a))),console[_0x588cd8(0x16e)](_0x588cd8(0x133)),console[_0x588cd8(0x16e)](_0x588cd8(0x134)),console[_0x588cd8(0x16e)](_0x588cd8(0x124)),console[_0x588cd8(0x16e)](_0x588cd8(0x193)),0x1;if(_0x128bdc){const {data:_0x44bbea}=await withSpinner(_0x588cd8(0x17b)+_0x128bdc+'\x22\x20from\x20project\x20\x22'+_0x531989+_0x588cd8(0x15e),()=>_0x28007c[_0x588cd8(0x14b)][_0x588cd8(0x166)](_0x531989,_0x128bdc,_0x3217a7,{'dryRun':_0x44dd92,'force':_0x2c1358}));if(_0x44dd92)return console[_0x588cd8(0x16e)](a4_0x2ecb38['yellow'](_0x588cd8(0x136))),console[_0x588cd8(0x16e)](_0x588cd8(0x1a5)+_0x44bbea[_0x588cd8(0x118)]),console[_0x588cd8(0x16e)](_0x588cd8(0x13a)+_0x44bbea[_0x588cd8(0x14c)]),_0x44bbea[_0x588cd8(0x105)]&&(console[_0x588cd8(0x16e)](_0x588cd8(0x16f)),console[_0x588cd8(0x16e)]('─'[_0x588cd8(0x141)](0x3c)),console[_0x588cd8(0x16e)](_0x44bbea['diff']),console['log']('─'[_0x588cd8(0x141)](0x3c))),0x0;return console[_0x588cd8(0x16e)](a4_0x2ecb38[_0x588cd8(0xfe)]('Agent\x20pulled\x20successfully')),console['log'](_0x588cd8(0x18b)+_0x44bbea[_0x588cd8(0x118)]),console['log']('Output:\x20'+_0x44bbea[_0x588cd8(0x14c)]),console[_0x588cd8(0x16e)](_0x588cd8(0x12e)+(_0x44bbea[_0x588cd8(0xff)]?a4_0x2ecb38[_0x588cd8(0xfe)](_0x588cd8(0x13b)):_0x44bbea[_0x588cd8(0x117)]?a4_0x2ecb38[_0x588cd8(0x177)]('updated'):a4_0x2ecb38[_0x588cd8(0x120)](_0x588cd8(0x1a3)))),0x0;}const _0x18de3d=_0x411f23||_0x3217a7,{data:_0x54ca88}=await withSpinner(_0x588cd8(0x12a)+_0x531989+_0x588cd8(0x15e),()=>_0x28007c['llm'][_0x588cd8(0x135)](_0x531989,_0x18de3d,{'dryRun':!![]})),_0x48e503=_0x54ca88[_0x588cd8(0xf5)][_0x588cd8(0x180)][_0x588cd8(0x13b)]+_0x54ca88[_0x588cd8(0xf5)][_0x588cd8(0x10b)][_0x588cd8(0x13b)]+_0x54ca88['counts']['textKnowledgeBases'][_0x588cd8(0x13b)]+_0x54ca88[_0x588cd8(0xf5)]['prompts'][_0x588cd8(0x13b)]+_0x54ca88[_0x588cd8(0xf5)][_0x588cd8(0x172)][_0x588cd8(0x13b)]+_0x54ca88['counts'][_0x588cd8(0x191)][_0x588cd8(0x13b)]+_0x54ca88['counts'][_0x588cd8(0x111)][_0x588cd8(0x13b)],_0x13ae90=_0x54ca88[_0x588cd8(0xf5)][_0x588cd8(0x180)][_0x588cd8(0x18a)]+_0x54ca88['counts']['knowledgeBases'][_0x588cd8(0x18a)]+_0x54ca88[_0x588cd8(0xf5)][_0x588cd8(0xf4)][_0x588cd8(0x18a)]+_0x54ca88[_0x588cd8(0xf5)]['prompts']['updated']+_0x54ca88['counts'][_0x588cd8(0x172)][_0x588cd8(0x18a)]+_0x54ca88[_0x588cd8(0xf5)]['experimentalKnowledgeBases']['updated']+_0x54ca88[_0x588cd8(0xf5)][_0x588cd8(0x111)]['updated'],_0x55572b=_0x54ca88['counts'][_0x588cd8(0x180)][_0x588cd8(0x1a3)]+_0x54ca88[_0x588cd8(0xf5)][_0x588cd8(0x10b)][_0x588cd8(0x1a3)]+_0x54ca88[_0x588cd8(0xf5)]['textKnowledgeBases'][_0x588cd8(0x1a3)]+_0x54ca88[_0x588cd8(0xf5)][_0x588cd8(0x15c)][_0x588cd8(0x1a3)]+_0x54ca88[_0x588cd8(0xf5)][_0x588cd8(0x172)][_0x588cd8(0x1a3)]+_0x54ca88['counts'][_0x588cd8(0x191)][_0x588cd8(0x1a3)]+_0x54ca88[_0x588cd8(0xf5)][_0x588cd8(0x111)][_0x588cd8(0x1a3)];console[_0x588cd8(0x16e)](_0x588cd8(0x1a2)+_0x54ca88[_0x588cd8(0x17e)]+'\x27:'),console[_0x588cd8(0x16e)]('\x20\x20'+a4_0x2ecb38[_0x588cd8(0xfe)]('+\x20'+_0x48e503+'\x20new')+_0x588cd8(0x16b)+a4_0x2ecb38[_0x588cd8(0x177)]('~\x20'+_0x13ae90+'\x20changed')+_0x588cd8(0x16b)+a4_0x2ecb38[_0x588cd8(0x176)]('=\x20'+_0x55572b+_0x588cd8(0x17d))),console[_0x588cd8(0x16e)](_0x588cd8(0x183)+formatCountSummary(_0x54ca88['counts'][_0x588cd8(0x180)])),console[_0x588cd8(0x16e)](_0x588cd8(0x138)+formatCountSummary(_0x54ca88[_0x588cd8(0xf5)][_0x588cd8(0x10b)])),console['log']('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x54ca88[_0x588cd8(0xf5)][_0x588cd8(0xf4)])),console['log'](_0x588cd8(0x114)+formatCountSummary(_0x54ca88[_0x588cd8(0xf5)]['prompts'])),console[_0x588cd8(0x16e)](_0x588cd8(0x163)+formatCountSummary(_0x54ca88['counts']['integrations']));const _0x30664a=_0x54ca88[_0x588cd8(0xf5)]['experimentalKnowledgeBases'][_0x588cd8(0x159)]>0x0||_0x54ca88[_0x588cd8(0xf5)][_0x588cd8(0x111)][_0x588cd8(0x159)]>0x0;_0x30664a&&(console[_0x588cd8(0x16e)](_0x588cd8(0x168)+formatCountSummary(_0x54ca88[_0x588cd8(0xf5)][_0x588cd8(0x191)])),console[_0x588cd8(0x16e)](_0x588cd8(0x171)+formatCountSummary(_0x54ca88[_0x588cd8(0xf5)][_0x588cd8(0x111)])));console[_0x588cd8(0x16e)]('\x20\x20Target:\x20'+a4_0x2ecb38[_0x588cd8(0x179)](_0x54ca88['outputDir'])),displayDiffs(_0x54ca88[_0x588cd8(0x180)],_0x54ca88[_0x588cd8(0x10b)],_0x54ca88[_0x588cd8(0xf4)],_0x54ca88['prompts'],_0x54ca88[_0x588cd8(0x172)],_0x54ca88[_0x588cd8(0x191)],_0x54ca88['experimentalArtifacts']);if(_0x44dd92)return console[_0x588cd8(0x16e)](a4_0x2ecb38[_0x588cd8(0x177)](_0x588cd8(0x14f))),0x0;if(_0x48e503===0x0&&_0x13ae90===0x0)return console[_0x588cd8(0x16e)](a4_0x2ecb38['green'](_0x588cd8(0xfb))),saveSessionContext({'llm_project':_0x54ca88[_0x588cd8(0x17e)]},_0x81048c['session']),console[_0x588cd8(0x16e)](a4_0x2ecb38[_0x588cd8(0xfe)](_0x588cd8(0x11b)+a4_0x2ecb38['dim'](_0x588cd8(0x145))+_0x588cd8(0x109)+a4_0x2ecb38[_0x588cd8(0x179)](_0x54ca88[_0x588cd8(0x17e)]))),0x0;if(!_0xf7e9b0&&!_0x2c1358){if(!isInteractive())return console[_0x588cd8(0x165)](a4_0x2ecb38[_0x588cd8(0x119)](_0x588cd8(0x13e)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x588cd8(0x165)](a4_0x2ecb38[_0x588cd8(0x176)](_0x588cd8(0x15f))),0x1;const _0x49cdbc=await confirmKey(_0x588cd8(0x113)+(_0x48e503+_0x13ae90)+_0x588cd8(0x108));if(!_0x49cdbc)return console[_0x588cd8(0x16e)](a4_0x2ecb38[_0x588cd8(0x177)](_0x588cd8(0x1a6)),'-\x20no\x20files\x20written'),0x1;}const {data:_0x29d25a}=await withSpinner(_0x588cd8(0x10d),()=>_0x28007c['llm']['pullProject'](_0x531989,_0x18de3d,{'force':_0x2c1358}));return console[_0x588cd8(0x16e)](a4_0x2ecb38[_0x588cd8(0xfe)]('\x0a✔\x20Pulled\x20'+(_0x48e503+_0x13ae90)+_0x588cd8(0xee)+_0x29d25a[_0x588cd8(0x13f)])),saveSessionContext({'llm_project':_0x29d25a['projectName']},_0x81048c[_0x588cd8(0xf1)]),console['log'](a4_0x2ecb38[_0x588cd8(0xfe)](_0x588cd8(0x11b)+a4_0x2ecb38[_0x588cd8(0x176)](_0x588cd8(0x145))+_0x588cd8(0x109)+a4_0x2ecb38[_0x588cd8(0x179)](_0x29d25a[_0x588cd8(0x17e)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']=a4_0x19e74f(0x19f);['description']=a4_0x19e74f(0x146);async[a4_0x19e74f(0x132)](_0x1ce253){const _0x432f39=a4_0x19e74f,{options:_0x52ba84,args:_0x4f16bb,tdx:_0x42edbe}=_0x1ce253,_0x539c0d=_0x4f16bb[0x0],_0x54319b=_0x52ba84[_0x432f39(0x116)],_0x360711=_0x52ba84['dryRun'],_0x3155eb=_0x52ba84[_0x432f39(0x13d)],_0x19b12c=_0x52ba84[_0x432f39(0x167)],_0x2eef1a=_0x52ba84['llmProject'];let _0xdbadee;const _0xf825db=findAgentConfigPath(process[_0x432f39(0x144)]());if(_0x539c0d){const _0x8739a3=a4_0x57cc7d[_0x432f39(0x1a4)](_0x539c0d,_0x432f39(0x186));existsSync(_0x8739a3)?(_0xdbadee=_0x539c0d,console[_0x432f39(0x16e)](a4_0x2ecb38['dim'](_0x432f39(0x115)+_0x539c0d))):_0xdbadee=_0x539c0d;}else{if(_0xf825db)_0xdbadee=a4_0x57cc7d[_0x432f39(0x127)](_0xf825db),console[_0x432f39(0x16e)](a4_0x2ecb38[_0x432f39(0x176)](_0x432f39(0x18c)+_0xdbadee));else{if(_0x2eef1a){const _0x50e348=sanitizeForFilesystem(_0x2eef1a);let _0x2216bb=_0x50e348,_0xb6437a=a4_0x57cc7d[_0x432f39(0x1a4)](process['cwd'](),_0x432f39(0x180),_0x50e348,_0x432f39(0x186));if(!existsSync(_0xb6437a)){const _0x1992ac=normalizeName(_0x2eef1a),_0x3d148b=a4_0x57cc7d[_0x432f39(0x1a4)](process[_0x432f39(0x144)](),'agents',_0x1992ac,_0x432f39(0x186));existsSync(_0x3d148b)&&(_0x2216bb=_0x1992ac,_0xb6437a=_0x3d148b);}if(existsSync(_0xb6437a))_0xdbadee=a4_0x57cc7d['dirname'](_0xb6437a),console['log'](a4_0x2ecb38[_0x432f39(0x176)](_0x432f39(0x115)+_0xdbadee));else{const _0x1d68c4=_0x52ba84[_0x432f39(0x139)];if(_0x1d68c4)throw new SDKError(ErrorCode[_0x432f39(0x185)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x2eef1a+_0x432f39(0x19a),undefined,{'helpText':_0x432f39(0x148)+_0x432f39(0x103)+(_0x432f39(0x125)+_0x2eef1a+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x2216bb+_0x432f39(0x121)+(_0x54319b||_0x432f39(0x11e))+_0x432f39(0x182)+_0x1d68c4)});_0xdbadee=_0x2eef1a,console[_0x432f39(0x16e)](a4_0x2ecb38['dim'](_0x432f39(0x190)+_0x2eef1a));}}}}if(!_0xdbadee)return console['log'](a4_0x2ecb38[_0x432f39(0x177)](_0x432f39(0x107))),console[_0x432f39(0x16e)](_0x432f39(0x14d)),console[_0x432f39(0x16e)](_0x432f39(0x140)),console['log'](_0x432f39(0x19b)),console[_0x432f39(0x16e)](_0x432f39(0x18f)),0x1;if(!_0x54319b)throw new SDKError(ErrorCode[_0x432f39(0x162)],'New\x20project\x20name\x20is\x20required',undefined,{'helpText':_0x432f39(0x19c)});if(!_0x3155eb&&!_0x360711){if(!isInteractive())return console[_0x432f39(0x165)](a4_0x2ecb38['red']('\x0aError:'),_0x432f39(0x197)),console['error'](a4_0x2ecb38[_0x432f39(0x176)](_0x432f39(0x15f))),0x1;const _0x130d33=await confirmKey(_0x432f39(0x189)+_0xdbadee+_0x432f39(0x122)+_0x54319b+'\x22?');if(!_0x130d33)return console[_0x432f39(0x16e)](a4_0x2ecb38[_0x432f39(0x177)](_0x432f39(0x1a6))),0x1;}const {data:_0x42cf85}=await withSpinner('Cloning\x20\x22'+_0xdbadee+'\x22\x20to\x20\x22'+_0x54319b+_0x432f39(0x15e),()=>_0x42edbe[_0x432f39(0x14b)][_0x432f39(0x150)](_0xdbadee,_0x54319b,{'dryRun':_0x360711}));if(_0x360711){console[_0x432f39(0x16e)](a4_0x2ecb38[_0x432f39(0x177)](_0x432f39(0x152))),console[_0x432f39(0x16e)]('Source:\x20'+_0x42cf85[_0x432f39(0x16c)]),console['log'](_0x432f39(0x173)+_0x54319b),console[_0x432f39(0x16e)]('Would\x20clone:'),console[_0x432f39(0x16e)](_0x432f39(0x183)+_0x42cf85[_0x432f39(0xf5)]['agents'][_0x432f39(0x188)]),console[_0x432f39(0x16e)]('\x20\x20Knowledge\x20Bases:\x20'+_0x42cf85['counts']['knowledgeBases'][_0x432f39(0x188)]),console['log'](_0x432f39(0x114)+_0x42cf85[_0x432f39(0xf5)][_0x432f39(0x15c)][_0x432f39(0x188)]);const _0x4b6e67=_0x42cf85['counts'][_0x432f39(0x191)][_0x432f39(0x188)]>0x0||_0x42cf85[_0x432f39(0xf5)][_0x432f39(0x111)][_0x432f39(0x188)]>0x0;return _0x4b6e67&&(console['log']('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+_0x42cf85['counts']['experimentalKnowledgeBases'][_0x432f39(0x188)]),console['log'](_0x432f39(0x171)+_0x42cf85['counts'][_0x432f39(0x111)][_0x432f39(0x188)])),0x0;}const _0x52af44=_0x42cf85[_0x432f39(0xf5)][_0x432f39(0x180)][_0x432f39(0x11d)]>0x0||_0x42cf85[_0x432f39(0xf5)][_0x432f39(0x10b)][_0x432f39(0x11d)]>0x0||_0x42cf85['counts'][_0x432f39(0x15c)][_0x432f39(0x11d)]>0x0||_0x42cf85[_0x432f39(0xf5)][_0x432f39(0x191)][_0x432f39(0x11d)]>0x0||_0x42cf85['counts'][_0x432f39(0x111)][_0x432f39(0x11d)]>0x0;_0x52af44?console[_0x432f39(0x16e)](a4_0x2ecb38[_0x432f39(0x177)](_0x432f39(0x17f))):console[_0x432f39(0x16e)](a4_0x2ecb38[_0x432f39(0xfe)](_0x432f39(0xf9)));console[_0x432f39(0x16e)](_0x432f39(0x106)+_0x42cf85[_0x432f39(0x16c)]),console['log']('New\x20project:\x20'+_0x42cf85['newProjectName']),console[_0x432f39(0x16e)](_0x432f39(0x187)+_0x42cf85[_0x432f39(0x178)]),console[_0x432f39(0x16e)](),console[_0x432f39(0x16e)](_0x432f39(0xf6)),console['log'](_0x432f39(0x183)+formatCountSummary(_0x42cf85[_0x432f39(0xf5)]['agents'])),console[_0x432f39(0x16e)](_0x432f39(0x138)+formatCountSummary(_0x42cf85[_0x432f39(0xf5)]['knowledgeBases'])),console['log'](_0x432f39(0x114)+formatCountSummary(_0x42cf85[_0x432f39(0xf5)]['prompts'])),console[_0x432f39(0x16e)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x42cf85[_0x432f39(0xf5)]['integrations']));const _0x351437=_0x42cf85['counts'][_0x432f39(0x191)][_0x432f39(0x188)]>0x0||_0x42cf85[_0x432f39(0xf5)][_0x432f39(0x191)]['updated']>0x0||_0x42cf85[_0x432f39(0xf5)][_0x432f39(0x191)][_0x432f39(0x1a3)]>0x0||_0x42cf85[_0x432f39(0xf5)][_0x432f39(0x111)][_0x432f39(0x188)]>0x0||_0x42cf85['counts'][_0x432f39(0x111)][_0x432f39(0x18a)]>0x0||_0x42cf85['counts'][_0x432f39(0x111)][_0x432f39(0x1a3)]>0x0;_0x351437&&(console[_0x432f39(0x16e)](_0x432f39(0x168)+formatCountSummary(_0x42cf85[_0x432f39(0xf5)][_0x432f39(0x191)])),console[_0x432f39(0x16e)](_0x432f39(0x171)+formatCountSummary(_0x42cf85[_0x432f39(0xf5)]['experimentalArtifacts'])));if(_0x52af44){console['log'](),console[_0x432f39(0x16e)](a4_0x2ecb38[_0x432f39(0x119)](_0x432f39(0x12b)));for(const _0xea7a0c of _0x42cf85['agents']){_0xea7a0c[_0x432f39(0xef)]===_0x432f39(0x165)&&console[_0x432f39(0x16e)](a4_0x2ecb38['red']('\x20\x20Agent\x20\x22'+_0xea7a0c[_0x432f39(0x118)]+_0x432f39(0x18d)+_0xea7a0c[_0x432f39(0x165)]));}for(const _0xe7b8aa of _0x42cf85[_0x432f39(0x10b)]){_0xe7b8aa[_0x432f39(0xef)]===_0x432f39(0x165)&&console[_0x432f39(0x16e)](a4_0x2ecb38[_0x432f39(0x119)]('\x20\x20Knowledge\x20Base\x20\x22'+_0xe7b8aa[_0x432f39(0x116)]+_0x432f39(0x18d)+_0xe7b8aa[_0x432f39(0x165)]));}for(const _0x365425 of _0x42cf85[_0x432f39(0x15c)]){_0x365425['action']===_0x432f39(0x165)&&console[_0x432f39(0x16e)](a4_0x2ecb38[_0x432f39(0x119)](_0x432f39(0x142)+_0x365425[_0x432f39(0x116)]+_0x432f39(0x18d)+_0x365425[_0x432f39(0x165)]));}for(const _0x7668a0 of _0x42cf85['integrations']){_0x7668a0[_0x432f39(0xef)]===_0x432f39(0x165)&&console['log'](a4_0x2ecb38[_0x432f39(0x119)](_0x432f39(0x112)+_0x7668a0[_0x432f39(0x116)]+_0x432f39(0x18d)+_0x7668a0[_0x432f39(0x165)]));}for(const _0x2c5fb6 of _0x42cf85['experimentalKnowledgeBases']){_0x2c5fb6[_0x432f39(0xef)]===_0x432f39(0x165)&&console['log'](a4_0x2ecb38['red'](_0x432f39(0x158)+_0x2c5fb6[_0x432f39(0x116)]+_0x432f39(0x18d)+_0x2c5fb6['error']));}for(const _0x5d6752 of _0x42cf85[_0x432f39(0x111)]){_0x5d6752[_0x432f39(0xef)]===_0x432f39(0x165)&&console[_0x432f39(0x16e)](a4_0x2ecb38[_0x432f39(0x119)]('\x20\x20Experimental\x20Artifact\x20\x22'+_0x5d6752[_0x432f39(0x116)]+_0x432f39(0x18d)+_0x5d6752[_0x432f39(0x165)]));}return 0x1;}console[_0x432f39(0x16e)]();const _0x4e4955=getLLMProjectUrl(_0x19b12c,_0x42cf85[_0x432f39(0x178)]);return console[_0x432f39(0x16e)](_0x432f39(0x169)+a4_0x2ecb38[_0x432f39(0x179)](_0x4e4955)),0x0;}}function a4_0x557c(_0xe5e429,_0x371a0f){_0xe5e429=_0xe5e429-0xee;const _0x5ad9eb=a4_0x5ad9();let _0x557c7e=_0x5ad9eb[_0xe5e429];return _0x557c7e;}export class AgentPushCommand extends BaseCommand{['name']='agent:push';[a4_0x19e74f(0x126)]=a4_0x19e74f(0x102);async[a4_0x19e74f(0x132)](_0x19a00b){const _0x43e77c=a4_0x19e74f,{options:_0x17c377,args:_0x572933,tdx:_0x5d7419}=_0x19a00b;let _0x40d056=_0x572933[0x0]||process[_0x43e77c(0x144)]();const _0x34aa66=_0x17c377['dryRun'],_0x2bf2d3=_0x17c377[_0x43e77c(0x17c)],_0x2e4fb2=_0x17c377[_0x43e77c(0x13d)],_0x31792f=_0x17c377[_0x43e77c(0x167)],_0x228783=a4_0x57cc7d[_0x43e77c(0x1a4)](_0x40d056,_0x43e77c(0x101)),_0x455138=existsSync(_0x228783);if(_0x455138){const {data:_0x54156e}=await withSpinner(_0x43e77c(0x194)+_0x40d056+_0x43e77c(0x15e),()=>_0x5d7419[_0x43e77c(0x14b)][_0x43e77c(0x1a0)](_0x40d056,{'dryRun':_0x34aa66,'force':_0x2bf2d3}));if(_0x34aa66)return console['log'](a4_0x2ecb38[_0x43e77c(0x177)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x43e77c(0x16e)](_0x43e77c(0x130)+_0x54156e['agentName']),0x0;if(_0x54156e[_0x43e77c(0xef)]===_0x43e77c(0x165))return console['log'](a4_0x2ecb38[_0x43e77c(0x119)](_0x43e77c(0x10e)+_0x54156e[_0x43e77c(0x165)])),0x1;console[_0x43e77c(0x16e)](a4_0x2ecb38[_0x43e77c(0xfe)](_0x43e77c(0x12d)+_0x54156e['action']+_0x43e77c(0x157))),console[_0x43e77c(0x16e)]('Agent:\x20'+_0x54156e['agentName']);if(_0x54156e[_0x43e77c(0x11c)]&&_0x54156e[_0x43e77c(0x100)]){const _0x4f7091=getLLMAgentChatUrl(_0x31792f,_0x54156e['projectId'],_0x54156e[_0x43e77c(0x11c)]);console['log']('Chat:\x20'+a4_0x2ecb38[_0x43e77c(0x179)](_0x4f7091));}return 0x0;}const _0x14b1e6=_0x17c377['llmProject'],_0x1136ee=resolveProjectFromContext(_0x40d056,_0x14b1e6);if(_0x1136ee[_0x43e77c(0x198)])_0x40d056=_0x1136ee['projectDir'],_0x1136ee[_0x43e77c(0xfc)]===_0x43e77c(0x11f)&&console['log'](a4_0x2ecb38[_0x43e77c(0x176)](_0x43e77c(0xf2)+_0x40d056));else{let _0x151ca2=_0x43e77c(0xf0);_0x1136ee[_0x43e77c(0x153)]==='no_local_folder'&&(_0x151ca2=_0x1136ee[_0x43e77c(0x128)]+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x1136ee[_0x43e77c(0x15a)]+_0x43e77c(0x154));throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x1136ee['reason']===_0x43e77c(0x129)?_0x1136ee[_0x43e77c(0x128)]:_0x43e77c(0x174)+_0x40d056,undefined,{'helpText':_0x151ca2});}const {data:_0x3d49b4}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x5d7419[_0x43e77c(0x14b)]['pushProject'](_0x40d056,{'dryRun':!![]})),_0x33d12c=_0x3d49b4[_0x43e77c(0xf5)][_0x43e77c(0x180)]['errors']>0x0;if(_0x33d12c){console[_0x43e77c(0x16e)](a4_0x2ecb38[_0x43e77c(0x119)](_0x43e77c(0x184)));for(const _0x57a326 of _0x3d49b4[_0x43e77c(0x180)]){_0x57a326[_0x43e77c(0xef)]===_0x43e77c(0x165)&&console[_0x43e77c(0x16e)](a4_0x2ecb38['red'](_0x43e77c(0x147)+_0x57a326[_0x43e77c(0x118)]+_0x43e77c(0x18d)+_0x57a326['error']));}return 0x1;}const _0x350c6f=_0x3d49b4[_0x43e77c(0xf5)]['agents'][_0x43e77c(0x188)]+_0x3d49b4['counts'][_0x43e77c(0x10b)][_0x43e77c(0x188)]+_0x3d49b4[_0x43e77c(0xf5)][_0x43e77c(0xf4)][_0x43e77c(0x188)]+_0x3d49b4[_0x43e77c(0xf5)]['prompts'][_0x43e77c(0x188)]+_0x3d49b4[_0x43e77c(0xf5)][_0x43e77c(0x172)][_0x43e77c(0x188)]+_0x3d49b4[_0x43e77c(0xf5)]['experimentalKnowledgeBases'][_0x43e77c(0x188)]+_0x3d49b4[_0x43e77c(0xf5)]['experimentalArtifacts'][_0x43e77c(0x188)],_0x201166=_0x3d49b4[_0x43e77c(0xf5)][_0x43e77c(0x180)]['updated']+_0x3d49b4[_0x43e77c(0xf5)][_0x43e77c(0x10b)]['updated']+_0x3d49b4[_0x43e77c(0xf5)][_0x43e77c(0xf4)][_0x43e77c(0x18a)]+_0x3d49b4[_0x43e77c(0xf5)][_0x43e77c(0x15c)][_0x43e77c(0x18a)]+_0x3d49b4[_0x43e77c(0xf5)][_0x43e77c(0x172)][_0x43e77c(0x18a)]+_0x3d49b4['counts'][_0x43e77c(0x191)][_0x43e77c(0x18a)]+_0x3d49b4[_0x43e77c(0xf5)][_0x43e77c(0x111)][_0x43e77c(0x18a)],_0x305801=_0x3d49b4[_0x43e77c(0xf5)]['agents'][_0x43e77c(0x1a3)]+_0x3d49b4[_0x43e77c(0xf5)][_0x43e77c(0x10b)]['unchanged']+_0x3d49b4[_0x43e77c(0xf5)]['textKnowledgeBases'][_0x43e77c(0x1a3)]+_0x3d49b4[_0x43e77c(0xf5)][_0x43e77c(0x15c)]['unchanged']+_0x3d49b4[_0x43e77c(0xf5)][_0x43e77c(0x172)]['unchanged']+_0x3d49b4[_0x43e77c(0xf5)][_0x43e77c(0x191)][_0x43e77c(0x1a3)]+_0x3d49b4[_0x43e77c(0xf5)]['experimentalArtifacts'][_0x43e77c(0x1a3)];console['log'](_0x43e77c(0xf8)+_0x3d49b4['projectName']+'\x27:'),console[_0x43e77c(0x16e)]('\x20\x20'+a4_0x2ecb38[_0x43e77c(0xfe)]('+\x20'+_0x350c6f+_0x43e77c(0x19d))+_0x43e77c(0x16b)+a4_0x2ecb38['yellow']('~\x20'+_0x201166+_0x43e77c(0x175))+'\x20|\x20'+a4_0x2ecb38['dim']('=\x20'+_0x305801+_0x43e77c(0x17d))),console[_0x43e77c(0x16e)](_0x43e77c(0x183)+formatCountSummary(_0x3d49b4[_0x43e77c(0xf5)][_0x43e77c(0x180)])),console[_0x43e77c(0x16e)](_0x43e77c(0x138)+formatCountSummary(_0x3d49b4[_0x43e77c(0xf5)][_0x43e77c(0x10b)])),console['log'](_0x43e77c(0x192)+formatCountSummary(_0x3d49b4[_0x43e77c(0xf5)][_0x43e77c(0xf4)])),console['log']('\x20\x20Prompts:\x20'+formatCountSummary(_0x3d49b4[_0x43e77c(0xf5)][_0x43e77c(0x15c)])),console[_0x43e77c(0x16e)](_0x43e77c(0x163)+formatCountSummary(_0x3d49b4['counts'][_0x43e77c(0x172)]));const _0x1e6263=_0x3d49b4[_0x43e77c(0xf5)][_0x43e77c(0x191)][_0x43e77c(0x188)]>0x0||_0x3d49b4[_0x43e77c(0xf5)][_0x43e77c(0x191)]['updated']>0x0||_0x3d49b4[_0x43e77c(0xf5)]['experimentalKnowledgeBases']['unchanged']>0x0||_0x3d49b4['counts'][_0x43e77c(0x111)]['created']>0x0||_0x3d49b4[_0x43e77c(0xf5)][_0x43e77c(0x111)][_0x43e77c(0x18a)]>0x0||_0x3d49b4[_0x43e77c(0xf5)][_0x43e77c(0x111)]['unchanged']>0x0;_0x1e6263&&(console[_0x43e77c(0x16e)](_0x43e77c(0x168)+formatCountSummary(_0x3d49b4[_0x43e77c(0xf5)]['experimentalKnowledgeBases'])),console[_0x43e77c(0x16e)](_0x43e77c(0x171)+formatCountSummary(_0x3d49b4['counts'][_0x43e77c(0x111)])));console['log'](_0x43e77c(0x14a)+a4_0x2ecb38['cyan'](_0x40d056)),displayDiffs(_0x3d49b4[_0x43e77c(0x180)],_0x3d49b4[_0x43e77c(0x10b)],_0x3d49b4[_0x43e77c(0xf4)],_0x3d49b4['prompts'],_0x3d49b4['integrations'],_0x3d49b4['experimentalKnowledgeBases'],_0x3d49b4['experimentalArtifacts']);if(_0x34aa66)return console[_0x43e77c(0x16e)](a4_0x2ecb38[_0x43e77c(0x177)](_0x43e77c(0xf3))),0x0;if(_0x350c6f===0x0&&_0x201166===0x0){console[_0x43e77c(0x16e)](a4_0x2ecb38[_0x43e77c(0xfe)](_0x43e77c(0x155)));const _0x6f2a5e=getLLMProjectUrl(_0x31792f,_0x3d49b4[_0x43e77c(0x100)]);return console[_0x43e77c(0x16e)]('Project:\x20'+a4_0x2ecb38[_0x43e77c(0x179)](_0x6f2a5e)),0x0;}if(!_0x2e4fb2&&!_0x2bf2d3){if(!isInteractive())return console[_0x43e77c(0x165)](a4_0x2ecb38[_0x43e77c(0x119)](_0x43e77c(0x13e)),_0x43e77c(0x197)),console[_0x43e77c(0x165)](a4_0x2ecb38[_0x43e77c(0x176)](_0x43e77c(0x15f))),0x1;const _0x2f6176=await confirmKey('\x0aPush\x20'+(_0x350c6f+_0x201166)+'\x20resources?');if(!_0x2f6176)return console[_0x43e77c(0x16e)](a4_0x2ecb38[_0x43e77c(0x177)](_0x43e77c(0x1a6)),_0x43e77c(0x13c)),0x1;}const {data:_0x4752b3}=await withSpinner(_0x43e77c(0x181),()=>_0x5d7419[_0x43e77c(0x14b)][_0x43e77c(0x123)](_0x40d056,{'force':_0x2bf2d3})),_0x495142=_0x4752b3['counts']['agents']['errors']>0x0||_0x4752b3[_0x43e77c(0xf5)][_0x43e77c(0x10b)][_0x43e77c(0x11d)]>0x0||_0x4752b3[_0x43e77c(0xf5)]['textKnowledgeBases'][_0x43e77c(0x11d)]>0x0||_0x4752b3[_0x43e77c(0xf5)][_0x43e77c(0x15c)][_0x43e77c(0x11d)]>0x0;if(_0x495142){console['log'](a4_0x2ecb38[_0x43e77c(0x177)](_0x43e77c(0x161))),console[_0x43e77c(0x16e)](),console['log'](a4_0x2ecb38[_0x43e77c(0x119)](_0x43e77c(0x12b)));for(const _0x510154 of _0x4752b3[_0x43e77c(0x180)]){_0x510154[_0x43e77c(0xef)]===_0x43e77c(0x165)&&console['log'](a4_0x2ecb38[_0x43e77c(0x119)](_0x43e77c(0x147)+_0x510154[_0x43e77c(0x118)]+_0x43e77c(0x18d)+_0x510154[_0x43e77c(0x165)]));}for(const _0x29d67d of _0x4752b3['knowledgeBases']){_0x29d67d[_0x43e77c(0xef)]==='error'&&console['log'](a4_0x2ecb38[_0x43e77c(0x119)](_0x43e77c(0x17a)+_0x29d67d[_0x43e77c(0x116)]+'\x22:\x20'+_0x29d67d[_0x43e77c(0x165)]));}for(const _0x1fb0ef of _0x4752b3['textKnowledgeBases']){_0x1fb0ef[_0x43e77c(0xef)]===_0x43e77c(0x165)&&console[_0x43e77c(0x16e)](a4_0x2ecb38[_0x43e77c(0x119)](_0x43e77c(0x151)+_0x1fb0ef[_0x43e77c(0x116)]+_0x43e77c(0x18d)+_0x1fb0ef['error']));}for(const _0x1ff9e of _0x4752b3['prompts']){_0x1ff9e[_0x43e77c(0xef)]===_0x43e77c(0x165)&&console[_0x43e77c(0x16e)](a4_0x2ecb38[_0x43e77c(0x119)](_0x43e77c(0x142)+_0x1ff9e['name']+'\x22:\x20'+_0x1ff9e['error']));}for(const _0x30e737 of _0x4752b3[_0x43e77c(0x172)]){_0x30e737[_0x43e77c(0xef)]===_0x43e77c(0x165)&&console['log'](a4_0x2ecb38[_0x43e77c(0x119)](_0x43e77c(0x112)+_0x30e737[_0x43e77c(0x116)]+_0x43e77c(0x18d)+_0x30e737[_0x43e77c(0x165)]));}return 0x1;}console[_0x43e77c(0x16e)](a4_0x2ecb38[_0x43e77c(0xfe)](_0x43e77c(0x12f)+(_0x350c6f+_0x201166)+_0x43e77c(0x16d)+_0x4752b3[_0x43e77c(0x17e)]+'\x27'));const _0x278fb1=getLLMProjectUrl(_0x31792f,_0x4752b3[_0x43e77c(0x100)]);return console[_0x43e77c(0x16e)](_0x43e77c(0x169)+a4_0x2ecb38[_0x43e77c(0x179)](_0x278fb1)),0x0;}}
|
|
1
|
+
const a4_0x457c82=a4_0x57fd;(function(_0x5c865c,_0x50cd9b){const _0x393b36=a4_0x57fd,_0x548edb=_0x5c865c();while(!![]){try{const _0x3e8de3=parseInt(_0x393b36(0xa5))/0x1+-parseInt(_0x393b36(0x8b))/0x2+-parseInt(_0x393b36(0x114))/0x3*(parseInt(_0x393b36(0x127))/0x4)+parseInt(_0x393b36(0xe6))/0x5+-parseInt(_0x393b36(0xf3))/0x6+-parseInt(_0x393b36(0xe2))/0x7+parseInt(_0x393b36(0x86))/0x8*(parseInt(_0x393b36(0xcd))/0x9);if(_0x3e8de3===_0x50cd9b)break;else _0x548edb['push'](_0x548edb['shift']());}catch(_0x2e81b7){_0x548edb['push'](_0x548edb['shift']());}}}(a4_0x2c33,0x301f2));import a4_0x45057d from'chalk';import a4_0x38f1c2 from'path';function a4_0x57fd(_0x35f3b6,_0x20646b){_0x35f3b6=_0x35f3b6-0x79;const _0x2c339d=a4_0x2c33();let _0x57fdeb=_0x2c339d[_0x35f3b6];return _0x57fdeb;}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_0x2c33(){const _0x1370e3=['llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x20\x20Prompt\x20\x22','\x20\x20Experimental\x20Artifacts:\x20','Project:\x20','-\x20nothing\x20pushed','pullAgent','yellow','experimentalKnowledgeBases','MISSING_ARGUMENT','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','Analyzing\x20project\x20\x22','\x20\x20Integrations:\x20','\x0aPull\x20summary\x20for\x20\x27','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','\x22\x20to\x20\x22','textKnowledgeBases','3553896JIqAJB','Dry\x20run\x20-\x20no\x20changes\x20made','cwd','New\x20project:\x20','total','639210BXjhiv','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x20\x20Text\x20Knowledge\x20Bases:\x20','Errors:','updated','projectName','\x0a✔\x20Pulled\x20','llmProject','context','outputPath','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','agentId','agents','unchanged','\x0aChanges\x20to\x20prompt\x20\x27','Project\x20cloned\x20successfully','Using\x20project:\x20','\x0aChanges\x20to\x20agent\x20\x27','projectId','\x20\x20tdx\x20agent\x20pull\x20','description','Agent:\x20','prompts','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','pushProject','agent:pull','318493xBgXwT','\x0a✔\x20Pushed\x20','parse','Summary:','\x22\x20from\x20project\x20\x22','no_local_folder','action','name','INVALID_ARGUMENT','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','experimentalArtifacts','\x20\x20Prompts:\x20','\x20--profile\x20','integrations','dirname','\x22...','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Using\x20current\x20project:\x20','error','Source:\x20','pullProject','✔\x20Context\x20set:\x20','Would\x20clone:','Cannot\x20clone\x20from\x20context\x20project\x20\x22','dim','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','session','no_context','\x20\x20Knowledge\x20Base\x20\x22','red','execute','Would\x20pull\x20agent:\x20','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x20\x20Knowledge\x20Bases:\x20','Output:\x20','\x20|\x20','yes','agent:clone','Clone\x20\x22','Output\x20path:\x20','9wdIKsa','llm_project','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','log','\x0aChanges\x20to\x20integration\x20\x27','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','outputDir','Agent\x20pulled\x20successfully','counts','agentName','Writing\x20files...','pushAgent','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','\x20=\x20','\x20files?','\x20--name\x20','No\x20tdx.json\x20found\x20in\x20','agent:push','push','Would\x20push\x20agent:\x20','\x20\x20Agent\x20\x22','947513WqoHie','tdx.json','Failed\x20to\x20push\x20agent:\x20','new','1378730jNGMTr','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x0aPush\x20summary\x20for\x20\x27','\x20\x20Integration\x20\x22','\x22:\x20','message','repeat','Pushing\x20to\x20project...','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','join','\x22\x20to\x20a\x20different\x20profile','Pushing\x20agent\x20from\x20\x22','\x22\x20to\x20new\x20project\x20\x22','1808868kvpJIh','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','cyan','found','reason','\x0aError:','\x20files\x20to\x20','\x20\x20Text\x20Knowledge\x20Base\x20\x22','Agent\x20','\x0aWrite\x20','\x20\x20tdx\x20agent\x20clone\x20agents/','force','created','diff','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','\x20\x20Target:\x20','\x0aProject\x20pushed\x20with\x20errors','\x20changed','Cancelled','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','knowledgeBases','green','\x20unchanged','\x20successfully','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\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)','Analyzing\x20changes\x20to\x20push...','\x20resources?','Using\x20context\x20project:\x20','\x20\x20Agents:\x20','dryRun','\x20errors','newProjectName','3OtabnJ','utf-8','errors','agent.yml','llm','sourceProjectName','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','Using\x20local\x20project:\x20','\x20updated','New\x20project\x20ID:\x20','\x20total','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x0aChanges:','\x20new','\x20\x20Experimental\x20Artifact\x20\x22','newProjectId','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Dry\x20run\x20-\x20no\x20files\x20written','339712YqgoTq','\x20resources\x20to\x20\x27'];a4_0x2c33=function(){return _0x1370e3;};return a4_0x2c33();}import{findAgentConfigPath,resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x442be0){const _0x432640=a4_0x57fd,_0x207314=[];if(_0x442be0[_0x432640(0x8a)]!==undefined)_0x207314[_0x432640(0xdf)](_0x442be0[_0x432640(0x8a)]+_0x432640(0x11e));if(_0x442be0[_0x432640(0xe5)]!==undefined&&_0x442be0[_0x432640(0xe5)]>0x0)_0x207314[_0x432640(0xdf)](a4_0x45057d[_0x432640(0x108)](_0x442be0[_0x432640(0xe5)]+_0x432640(0x121)));if(_0x442be0['created']!==undefined&&_0x442be0['created']>0x0)_0x207314[_0x432640(0xdf)](a4_0x45057d['green'](_0x442be0[_0x432640(0xff)]+'\x20created'));if(_0x442be0[_0x432640(0x8f)]!==undefined&&_0x442be0[_0x432640(0x8f)]>0x0)_0x207314[_0x432640(0xdf)](a4_0x45057d[_0x432640(0x7c)](_0x442be0[_0x432640(0x8f)]+_0x432640(0x11c)));if(_0x442be0[_0x432640(0x98)]!==undefined&&_0x442be0[_0x432640(0x98)]>0x0)_0x207314[_0x432640(0xdf)](a4_0x45057d['gray'](_0x442be0['unchanged']+_0x432640(0x109)));if(_0x442be0[_0x432640(0x116)]!==undefined&&_0x442be0[_0x432640(0x116)]>0x0)_0x207314[_0x432640(0xdf)](a4_0x45057d['red'](_0x442be0['errors']+_0x432640(0x112)));return _0x207314[_0x432640(0xef)](',\x20');}function displayDiffs(_0x186207,_0xb7bf45,_0x3f4f80,_0x45e6b4,_0x1b62f1,_0x1f24b9,_0x5e3583){const _0x13b44c=a4_0x57fd;for(const _0x25fee7 of _0x186207){if(_0x25fee7[_0x13b44c(0x100)]){const _0x2940cb=_0x25fee7[_0x13b44c(0xd6)]||_0x25fee7[_0x13b44c(0xac)];console[_0x13b44c(0xd0)](_0x13b44c(0x9c)+_0x2940cb+'\x27:'),console[_0x13b44c(0xd0)]('─'[_0x13b44c(0xec)](0x3c)),console['log'](_0x25fee7[_0x13b44c(0x100)]),console['log']('─'['repeat'](0x3c));}}for(const _0x17d378 of _0xb7bf45){_0x17d378[_0x13b44c(0x100)]&&(console[_0x13b44c(0xd0)](_0x13b44c(0x106)+_0x17d378[_0x13b44c(0xac)]+'\x27:'),console[_0x13b44c(0xd0)]('─'[_0x13b44c(0xec)](0x3c)),console[_0x13b44c(0xd0)](_0x17d378[_0x13b44c(0x100)]),console['log']('─'[_0x13b44c(0xec)](0x3c)));}for(const _0x3ad7b8 of _0x3f4f80){_0x3ad7b8[_0x13b44c(0x100)]&&(console[_0x13b44c(0xd0)](_0x13b44c(0xbe)+_0x3ad7b8[_0x13b44c(0xac)]+'\x27:'),console['log']('─'[_0x13b44c(0xec)](0x3c)),console[_0x13b44c(0xd0)](_0x3ad7b8[_0x13b44c(0x100)]),console[_0x13b44c(0xd0)]('─'['repeat'](0x3c)));}for(const _0x2eb1fc of _0x45e6b4){_0x2eb1fc[_0x13b44c(0x100)]&&(console[_0x13b44c(0xd0)](_0x13b44c(0x99)+_0x2eb1fc[_0x13b44c(0xac)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console['log'](_0x2eb1fc[_0x13b44c(0x100)]),console[_0x13b44c(0xd0)]('─'[_0x13b44c(0xec)](0x3c)));}for(const _0xf83874 of _0x1b62f1){_0xf83874[_0x13b44c(0x100)]&&(console[_0x13b44c(0xd0)](_0x13b44c(0xd1)+_0xf83874[_0x13b44c(0xac)]+'\x27:'),console['log']('─'[_0x13b44c(0xec)](0x3c)),console[_0x13b44c(0xd0)](_0xf83874[_0x13b44c(0x100)]),console[_0x13b44c(0xd0)]('─'[_0x13b44c(0xec)](0x3c)));}for(const _0x438d2f of _0x1f24b9){_0x438d2f[_0x13b44c(0x100)]&&(console[_0x13b44c(0xd0)](_0x13b44c(0xd2)+_0x438d2f['name']+'\x27:'),console[_0x13b44c(0xd0)]('─'[_0x13b44c(0xec)](0x3c)),console[_0x13b44c(0xd0)](_0x438d2f['diff']),console[_0x13b44c(0xd0)]('─'[_0x13b44c(0xec)](0x3c)));}for(const _0x59d1fb of _0x5e3583){_0x59d1fb['diff']&&(console['log']('\x0aChanges\x20to\x20experimental\x20artifact\x20\x27'+_0x59d1fb['name']+'\x27:'),console[_0x13b44c(0xd0)]('─'[_0x13b44c(0xec)](0x3c)),console['log'](_0x59d1fb[_0x13b44c(0x100)]),console[_0x13b44c(0xd0)]('─'[_0x13b44c(0xec)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x457c82(0xac)]=a4_0x457c82(0xa4);[a4_0x457c82(0x9f)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async['execute'](_0x260552){const _0x581d42=a4_0x457c82,{options:_0x55802f,args:_0x8d71dd,tdx:_0x3df52f}=_0x260552,_0x30ef56=_0x8d71dd[0x0],_0x38591d=_0x8d71dd[0x1],_0xd17ae7=_0x55802f['output'],_0x26bc06=_0x55802f[_0x581d42(0x111)],_0xc2cdfd=_0x55802f[_0x581d42(0xfe)],_0x1bf5d2=_0x55802f[_0x581d42(0xc9)],_0x5b62d7=_0x55802f[_0x581d42(0x92)];let _0xf83de2,_0x3f2069;const _0x5e9b2f=findAgentConfigPath(process[_0x581d42(0x88)]());if(_0x30ef56){const _0x40948c=a4_0x38f1c2[_0x581d42(0xef)](_0x30ef56,_0x581d42(0xe3));if(existsSync(_0x40948c))try{const _0x30da13=JSON[_0x581d42(0xa7)](readFileSync(_0x40948c,_0x581d42(0x115)));_0xf83de2=_0x30da13[_0x581d42(0xce)],_0x3f2069=_0x30ef56,console[_0x581d42(0xd0)](a4_0x45057d['dim']('Using\x20project\x20from\x20'+_0x40948c+':\x20'+_0xf83de2));}catch{_0xf83de2=_0x30ef56;}else _0xf83de2=_0x30ef56;}else{if(_0x5e9b2f)try{const _0x5d7d0d=JSON['parse'](readFileSync(_0x5e9b2f,_0x581d42(0x115)));_0xf83de2=_0x5d7d0d[_0x581d42(0xce)],_0x3f2069=a4_0x38f1c2['dirname'](_0x5e9b2f),console[_0x581d42(0xd0)](a4_0x45057d['dim'](_0x581d42(0x9b)+_0xf83de2));}catch{_0xf83de2=_0x5b62d7;}else _0xf83de2=_0x5b62d7;}if(!_0xf83de2)return console['log'](a4_0x45057d[_0x581d42(0x7c)](_0x581d42(0x129))),console[_0x581d42(0xd0)]('Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x581d42(0xd0)](_0x581d42(0x95)),console[_0x581d42(0xd0)](_0x581d42(0xae)),console['log']('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent'),0x1;if(_0x38591d){const {data:_0x100277}=await withSpinner('Pulling\x20agent\x20\x22'+_0x38591d+_0x581d42(0xa9)+_0xf83de2+_0x581d42(0xb4),()=>_0x3df52f[_0x581d42(0x118)][_0x581d42(0x7b)](_0xf83de2,_0x38591d,_0xd17ae7,{'dryRun':_0x26bc06,'force':_0xc2cdfd}));if(_0x26bc06)return console['log'](a4_0x45057d[_0x581d42(0x7c)](_0x581d42(0x126))),console[_0x581d42(0xd0)](_0x581d42(0xc4)+_0x100277[_0x581d42(0xd6)]),console[_0x581d42(0xd0)](_0x581d42(0xcc)+_0x100277['outputPath']),_0x100277[_0x581d42(0x100)]&&(console['log'](_0x581d42(0x120)),console[_0x581d42(0xd0)]('─'[_0x581d42(0xec)](0x3c)),console[_0x581d42(0xd0)](_0x100277[_0x581d42(0x100)]),console[_0x581d42(0xd0)]('─'[_0x581d42(0xec)](0x3c))),0x0;return console[_0x581d42(0xd0)](a4_0x45057d[_0x581d42(0x108)](_0x581d42(0xd4))),console[_0x581d42(0xd0)](_0x581d42(0xa0)+_0x100277[_0x581d42(0xd6)]),console[_0x581d42(0xd0)](_0x581d42(0xc7)+_0x100277[_0x581d42(0x94)]),console[_0x581d42(0xd0)]('Status:\x20'+(_0x100277['isNew']?a4_0x45057d[_0x581d42(0x108)](_0x581d42(0xe5)):_0x100277['hasChanges']?a4_0x45057d[_0x581d42(0x7c)]('updated'):a4_0x45057d['gray']('unchanged'))),0x0;}const _0x1faf72=_0x3f2069||_0xd17ae7,{data:_0x212872}=await withSpinner(_0x581d42(0x80)+_0xf83de2+_0x581d42(0xb4),()=>_0x3df52f[_0x581d42(0x118)][_0x581d42(0xb9)](_0xf83de2,_0x1faf72,{'dryRun':!![]})),_0x2aef24=_0x212872[_0x581d42(0xd5)][_0x581d42(0x97)][_0x581d42(0xe5)]+_0x212872['counts'][_0x581d42(0x107)][_0x581d42(0xe5)]+_0x212872[_0x581d42(0xd5)][_0x581d42(0x85)]['new']+_0x212872[_0x581d42(0xd5)][_0x581d42(0xa1)][_0x581d42(0xe5)]+_0x212872[_0x581d42(0xd5)]['integrations'][_0x581d42(0xe5)]+_0x212872[_0x581d42(0xd5)][_0x581d42(0x7d)][_0x581d42(0xe5)]+_0x212872[_0x581d42(0xd5)][_0x581d42(0xaf)][_0x581d42(0xe5)],_0x5af5fa=_0x212872[_0x581d42(0xd5)][_0x581d42(0x97)][_0x581d42(0x8f)]+_0x212872[_0x581d42(0xd5)]['knowledgeBases'][_0x581d42(0x8f)]+_0x212872['counts'][_0x581d42(0x85)][_0x581d42(0x8f)]+_0x212872[_0x581d42(0xd5)][_0x581d42(0xa1)][_0x581d42(0x8f)]+_0x212872[_0x581d42(0xd5)][_0x581d42(0xb2)]['updated']+_0x212872[_0x581d42(0xd5)][_0x581d42(0x7d)][_0x581d42(0x8f)]+_0x212872[_0x581d42(0xd5)]['experimentalArtifacts'][_0x581d42(0x8f)],_0xddc1ee=_0x212872[_0x581d42(0xd5)]['agents']['unchanged']+_0x212872['counts'][_0x581d42(0x107)][_0x581d42(0x98)]+_0x212872[_0x581d42(0xd5)][_0x581d42(0x85)][_0x581d42(0x98)]+_0x212872[_0x581d42(0xd5)][_0x581d42(0xa1)][_0x581d42(0x98)]+_0x212872[_0x581d42(0xd5)][_0x581d42(0xb2)][_0x581d42(0x98)]+_0x212872[_0x581d42(0xd5)][_0x581d42(0x7d)][_0x581d42(0x98)]+_0x212872[_0x581d42(0xd5)][_0x581d42(0xaf)][_0x581d42(0x98)];console['log'](_0x581d42(0x82)+_0x212872[_0x581d42(0x90)]+'\x27:'),console[_0x581d42(0xd0)]('\x20\x20'+a4_0x45057d['green']('+\x20'+_0x2aef24+_0x581d42(0x121))+'\x20|\x20'+a4_0x45057d[_0x581d42(0x7c)]('~\x20'+_0x5af5fa+_0x581d42(0x104))+_0x581d42(0xc8)+a4_0x45057d[_0x581d42(0xbd)]('=\x20'+_0xddc1ee+_0x581d42(0x109))),console[_0x581d42(0xd0)](_0x581d42(0x110)+formatCountSummary(_0x212872[_0x581d42(0xd5)][_0x581d42(0x97)])),console['log']('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x212872[_0x581d42(0xd5)][_0x581d42(0x107)])),console[_0x581d42(0xd0)](_0x581d42(0x8d)+formatCountSummary(_0x212872['counts'][_0x581d42(0x85)])),console[_0x581d42(0xd0)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x212872[_0x581d42(0xd5)]['prompts'])),console[_0x581d42(0xd0)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x212872[_0x581d42(0xd5)][_0x581d42(0xb2)]));const _0x41abc9=_0x212872[_0x581d42(0xd5)]['experimentalKnowledgeBases'][_0x581d42(0x8a)]>0x0||_0x212872[_0x581d42(0xd5)][_0x581d42(0xaf)][_0x581d42(0x8a)]>0x0;_0x41abc9&&(console[_0x581d42(0xd0)](_0x581d42(0x7f)+formatCountSummary(_0x212872['counts'][_0x581d42(0x7d)])),console[_0x581d42(0xd0)](_0x581d42(0x12d)+formatCountSummary(_0x212872[_0x581d42(0xd5)][_0x581d42(0xaf)])));console[_0x581d42(0xd0)](_0x581d42(0x102)+a4_0x45057d[_0x581d42(0xf5)](_0x212872[_0x581d42(0xd3)])),displayDiffs(_0x212872[_0x581d42(0x97)],_0x212872[_0x581d42(0x107)],_0x212872[_0x581d42(0x85)],_0x212872[_0x581d42(0xa1)],_0x212872[_0x581d42(0xb2)],_0x212872[_0x581d42(0x7d)],_0x212872[_0x581d42(0xaf)]);if(_0x26bc06)return console[_0x581d42(0xd0)](a4_0x45057d[_0x581d42(0x7c)](_0x581d42(0xee))),0x0;if(_0x2aef24===0x0&&_0x5af5fa===0x0)return console[_0x581d42(0xd0)](a4_0x45057d[_0x581d42(0x108)](_0x581d42(0x101))),saveSessionContext({'llm_project':_0x212872[_0x581d42(0x90)]},_0x55802f[_0x581d42(0xbf)]),console['log'](a4_0x45057d['green'](_0x581d42(0xba)+a4_0x45057d[_0x581d42(0xbd)](_0x581d42(0xce))+_0x581d42(0xda)+a4_0x45057d['cyan'](_0x212872[_0x581d42(0x90)]))),0x0;if(!_0x1bf5d2&&!_0xc2cdfd){if(!isInteractive())return console[_0x581d42(0xb7)](a4_0x45057d[_0x581d42(0xc2)](_0x581d42(0xf8)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x581d42(0xb7)](a4_0x45057d[_0x581d42(0xbd)](_0x581d42(0x125))),0x1;const _0x2d17c2=await confirmKey(_0x581d42(0xfc)+(_0x2aef24+_0x5af5fa)+_0x581d42(0xdb));if(!_0x2d17c2)return console['log'](a4_0x45057d['yellow'](_0x581d42(0x105)),'-\x20no\x20files\x20written'),0x1;}const {data:_0x16df02}=await withSpinner(_0x581d42(0xd7),()=>_0x3df52f[_0x581d42(0x118)]['pullProject'](_0xf83de2,_0x1faf72,{'force':_0xc2cdfd}));return console['log'](a4_0x45057d['green'](_0x581d42(0x91)+(_0x2aef24+_0x5af5fa)+_0x581d42(0xf9)+_0x16df02[_0x581d42(0xd3)])),saveSessionContext({'llm_project':_0x16df02['projectName']},_0x55802f[_0x581d42(0xbf)]),console[_0x581d42(0xd0)](a4_0x45057d[_0x581d42(0x108)](_0x581d42(0xba)+a4_0x45057d['dim'](_0x581d42(0xce))+_0x581d42(0xda)+a4_0x45057d[_0x581d42(0xf5)](_0x16df02[_0x581d42(0x90)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']=a4_0x457c82(0xca);[a4_0x457c82(0x9f)]=a4_0x457c82(0x12b);async[a4_0x457c82(0xc3)](_0x472a20){const _0x10b97f=a4_0x457c82,{options:_0x558332,args:_0x4af7a9,tdx:_0x3d6bd7}=_0x472a20,_0x12fb95=_0x4af7a9[0x0],_0x362d2d=_0x558332['name'],_0x5934df=_0x558332[_0x10b97f(0x111)],_0x13fa2e=_0x558332[_0x10b97f(0xc9)],_0x30afd5=_0x558332['site'],_0x453a0b=_0x558332[_0x10b97f(0x92)];let _0x2f74f1;const _0x50b975=findAgentConfigPath(process['cwd']());if(_0x12fb95){const _0x12f1c1=a4_0x38f1c2[_0x10b97f(0xef)](_0x12fb95,_0x10b97f(0xe3));existsSync(_0x12f1c1)?(_0x2f74f1=_0x12fb95,console[_0x10b97f(0xd0)](a4_0x45057d[_0x10b97f(0xbd)]('Using\x20local\x20project:\x20'+_0x12fb95))):_0x2f74f1=_0x12fb95;}else{if(_0x50b975)_0x2f74f1=a4_0x38f1c2[_0x10b97f(0xb3)](_0x50b975),console[_0x10b97f(0xd0)](a4_0x45057d[_0x10b97f(0xbd)](_0x10b97f(0xb6)+_0x2f74f1));else{if(_0x453a0b){const _0x2e7a17=sanitizeForFilesystem(_0x453a0b);let _0x51e1ba=_0x2e7a17,_0x1edb05=a4_0x38f1c2[_0x10b97f(0xef)](process['cwd'](),'agents',_0x2e7a17,_0x10b97f(0xe3));if(!existsSync(_0x1edb05)){const _0x4ed36f=normalizeName(_0x453a0b),_0x5522d4=a4_0x38f1c2[_0x10b97f(0xef)](process[_0x10b97f(0x88)](),_0x10b97f(0x97),_0x4ed36f,'tdx.json');existsSync(_0x5522d4)&&(_0x51e1ba=_0x4ed36f,_0x1edb05=_0x5522d4);}if(existsSync(_0x1edb05))_0x2f74f1=a4_0x38f1c2[_0x10b97f(0xb3)](_0x1edb05),console[_0x10b97f(0xd0)](a4_0x45057d['dim'](_0x10b97f(0x11b)+_0x2f74f1));else{const _0x280e33=_0x558332['profile'];if(_0x280e33)throw new SDKError(ErrorCode[_0x10b97f(0xad)],_0x10b97f(0xbc)+_0x453a0b+_0x10b97f(0xf0),undefined,{'helpText':_0x10b97f(0xa2)+_0x10b97f(0x10b)+(_0x10b97f(0x9e)+_0x453a0b+'\x0a')+(_0x10b97f(0xfd)+_0x51e1ba+_0x10b97f(0xdc)+(_0x362d2d||'<new-name>')+_0x10b97f(0xb1)+_0x280e33)});_0x2f74f1=_0x453a0b,console['log'](a4_0x45057d[_0x10b97f(0xbd)](_0x10b97f(0x10f)+_0x453a0b));}}}}if(!_0x2f74f1)return console['log'](a4_0x45057d[_0x10b97f(0x7c)](_0x10b97f(0x83))),console[_0x10b97f(0xd0)](_0x10b97f(0x8c)),console[_0x10b97f(0xd0)](_0x10b97f(0x124)),console[_0x10b97f(0xd0)](_0x10b97f(0x10c)),console[_0x10b97f(0xd0)](_0x10b97f(0xb5)),0x1;if(!_0x362d2d)throw new SDKError(ErrorCode[_0x10b97f(0x7e)],'New\x20project\x20name\x20is\x20required',undefined,{'helpText':_0x10b97f(0xc5)});if(!_0x13fa2e&&!_0x5934df){if(!isInteractive())return console[_0x10b97f(0xb7)](a4_0x45057d['red']('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a4_0x45057d[_0x10b97f(0xbd)](_0x10b97f(0x125))),0x1;const _0x338eb6=await confirmKey(_0x10b97f(0xcb)+_0x2f74f1+_0x10b97f(0xf2)+_0x362d2d+'\x22?');if(!_0x338eb6)return console[_0x10b97f(0xd0)](a4_0x45057d[_0x10b97f(0x7c)]('Cancelled')),0x1;}const {data:_0x392343}=await withSpinner('Cloning\x20\x22'+_0x2f74f1+_0x10b97f(0x84)+_0x362d2d+_0x10b97f(0xb4),()=>_0x3d6bd7[_0x10b97f(0x118)]['cloneProject'](_0x2f74f1,_0x362d2d,{'dryRun':_0x5934df}));if(_0x5934df){console[_0x10b97f(0xd0)](a4_0x45057d['yellow']('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x10b97f(0xd0)](_0x10b97f(0xb8)+_0x392343[_0x10b97f(0x119)]),console[_0x10b97f(0xd0)](_0x10b97f(0x89)+_0x362d2d),console[_0x10b97f(0xd0)](_0x10b97f(0xbb)),console[_0x10b97f(0xd0)]('\x20\x20Agents:\x20'+_0x392343[_0x10b97f(0xd5)][_0x10b97f(0x97)][_0x10b97f(0xff)]),console[_0x10b97f(0xd0)](_0x10b97f(0xc6)+_0x392343[_0x10b97f(0xd5)][_0x10b97f(0x107)][_0x10b97f(0xff)]),console[_0x10b97f(0xd0)](_0x10b97f(0xb0)+_0x392343[_0x10b97f(0xd5)][_0x10b97f(0xa1)][_0x10b97f(0xff)]);const _0x36d587=_0x392343[_0x10b97f(0xd5)]['experimentalKnowledgeBases']['created']>0x0||_0x392343[_0x10b97f(0xd5)][_0x10b97f(0xaf)][_0x10b97f(0xff)]>0x0;return _0x36d587&&(console[_0x10b97f(0xd0)](_0x10b97f(0x7f)+_0x392343[_0x10b97f(0xd5)][_0x10b97f(0x7d)][_0x10b97f(0xff)]),console[_0x10b97f(0xd0)](_0x10b97f(0x12d)+_0x392343['counts'][_0x10b97f(0xaf)]['created'])),0x0;}const _0x1533e9=_0x392343[_0x10b97f(0xd5)]['agents'][_0x10b97f(0x116)]>0x0||_0x392343[_0x10b97f(0xd5)][_0x10b97f(0x107)]['errors']>0x0||_0x392343['counts'][_0x10b97f(0xa1)][_0x10b97f(0x116)]>0x0||_0x392343[_0x10b97f(0xd5)][_0x10b97f(0x7d)]['errors']>0x0||_0x392343[_0x10b97f(0xd5)][_0x10b97f(0xaf)][_0x10b97f(0x116)]>0x0;_0x1533e9?console[_0x10b97f(0xd0)](a4_0x45057d[_0x10b97f(0x7c)]('Project\x20cloned\x20with\x20errors')):console[_0x10b97f(0xd0)](a4_0x45057d['green'](_0x10b97f(0x9a)));console['log']('Source:\x20'+_0x392343['sourceProjectName']),console['log'](_0x10b97f(0x89)+_0x392343[_0x10b97f(0x113)]),console[_0x10b97f(0xd0)](_0x10b97f(0x11d)+_0x392343['newProjectId']),console['log'](),console['log'](_0x10b97f(0xa8)),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x392343[_0x10b97f(0xd5)]['agents'])),console[_0x10b97f(0xd0)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x392343[_0x10b97f(0xd5)]['knowledgeBases'])),console[_0x10b97f(0xd0)](_0x10b97f(0xb0)+formatCountSummary(_0x392343['counts'][_0x10b97f(0xa1)])),console[_0x10b97f(0xd0)](_0x10b97f(0x81)+formatCountSummary(_0x392343['counts'][_0x10b97f(0xb2)]));const _0x1f4da7=_0x392343['counts'][_0x10b97f(0x7d)][_0x10b97f(0xff)]>0x0||_0x392343[_0x10b97f(0xd5)][_0x10b97f(0x7d)][_0x10b97f(0x8f)]>0x0||_0x392343[_0x10b97f(0xd5)]['experimentalKnowledgeBases']['unchanged']>0x0||_0x392343[_0x10b97f(0xd5)][_0x10b97f(0xaf)][_0x10b97f(0xff)]>0x0||_0x392343['counts']['experimentalArtifacts'][_0x10b97f(0x8f)]>0x0||_0x392343[_0x10b97f(0xd5)][_0x10b97f(0xaf)][_0x10b97f(0x98)]>0x0;_0x1f4da7&&(console['log'](_0x10b97f(0x7f)+formatCountSummary(_0x392343['counts'][_0x10b97f(0x7d)])),console[_0x10b97f(0xd0)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x392343[_0x10b97f(0xd5)][_0x10b97f(0xaf)])));if(_0x1533e9){console[_0x10b97f(0xd0)](),console[_0x10b97f(0xd0)](a4_0x45057d[_0x10b97f(0xc2)](_0x10b97f(0x8e)));for(const _0x380cff of _0x392343['agents']){_0x380cff['action']==='error'&&console[_0x10b97f(0xd0)](a4_0x45057d['red'](_0x10b97f(0xe1)+_0x380cff[_0x10b97f(0xd6)]+_0x10b97f(0xea)+_0x380cff[_0x10b97f(0xb7)]));}for(const _0x41187c of _0x392343[_0x10b97f(0x107)]){_0x41187c[_0x10b97f(0xab)]===_0x10b97f(0xb7)&&console['log'](a4_0x45057d['red'](_0x10b97f(0xc1)+_0x41187c[_0x10b97f(0xac)]+_0x10b97f(0xea)+_0x41187c[_0x10b97f(0xb7)]));}for(const _0x1b9b80 of _0x392343[_0x10b97f(0xa1)]){_0x1b9b80[_0x10b97f(0xab)]==='error'&&console[_0x10b97f(0xd0)](a4_0x45057d[_0x10b97f(0xc2)](_0x10b97f(0x12c)+_0x1b9b80['name']+_0x10b97f(0xea)+_0x1b9b80[_0x10b97f(0xb7)]));}for(const _0x5755af of _0x392343[_0x10b97f(0xb2)]){_0x5755af[_0x10b97f(0xab)]==='error'&&console[_0x10b97f(0xd0)](a4_0x45057d[_0x10b97f(0xc2)](_0x10b97f(0xe9)+_0x5755af[_0x10b97f(0xac)]+_0x10b97f(0xea)+_0x5755af[_0x10b97f(0xb7)]));}for(const _0x1e9f93 of _0x392343[_0x10b97f(0x7d)]){_0x1e9f93['action']===_0x10b97f(0xb7)&&console[_0x10b97f(0xd0)](a4_0x45057d[_0x10b97f(0xc2)](_0x10b97f(0x11a)+_0x1e9f93['name']+_0x10b97f(0xea)+_0x1e9f93[_0x10b97f(0xb7)]));}for(const _0x45163a of _0x392343[_0x10b97f(0xaf)]){_0x45163a['action']===_0x10b97f(0xb7)&&console[_0x10b97f(0xd0)](a4_0x45057d['red'](_0x10b97f(0x122)+_0x45163a['name']+_0x10b97f(0xea)+_0x45163a[_0x10b97f(0xb7)]));}return 0x1;}console[_0x10b97f(0xd0)]();const _0xf9e873=getLLMProjectUrl(_0x30afd5,_0x392343[_0x10b97f(0x123)]);return console['log']('Project:\x20'+a4_0x45057d['cyan'](_0xf9e873)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x457c82(0xac)]=a4_0x457c82(0xde);[a4_0x457c82(0x9f)]=a4_0x457c82(0xe7);async[a4_0x457c82(0xc3)](_0x565088){const _0xf4143b=a4_0x457c82,{options:_0x160f1c,args:_0x281c7f,tdx:_0x5bacb6}=_0x565088;let _0x451261=_0x281c7f[0x0]||process[_0xf4143b(0x88)]();const _0x24ef7b=_0x160f1c[_0xf4143b(0x111)],_0x203066=_0x160f1c[_0xf4143b(0xfe)],_0x2e866f=_0x160f1c[_0xf4143b(0xc9)],_0xfd04b2=_0x160f1c['site'],_0x8b1b8a=a4_0x38f1c2[_0xf4143b(0xef)](_0x451261,_0xf4143b(0x117)),_0x5c78d9=existsSync(_0x8b1b8a);if(_0x5c78d9){const {data:_0x185205}=await withSpinner(_0xf4143b(0xf1)+_0x451261+_0xf4143b(0xb4),()=>_0x5bacb6[_0xf4143b(0x118)][_0xf4143b(0xd8)](_0x451261,{'dryRun':_0x24ef7b,'force':_0x203066}));if(_0x24ef7b)return console[_0xf4143b(0xd0)](a4_0x45057d[_0xf4143b(0x7c)](_0xf4143b(0x87))),console[_0xf4143b(0xd0)](_0xf4143b(0xe0)+_0x185205[_0xf4143b(0xd6)]),0x0;if(_0x185205[_0xf4143b(0xab)]==='error')return console['log'](a4_0x45057d[_0xf4143b(0xc2)](_0xf4143b(0xe4)+_0x185205[_0xf4143b(0xb7)])),0x1;console[_0xf4143b(0xd0)](a4_0x45057d[_0xf4143b(0x108)](_0xf4143b(0xfb)+_0x185205['action']+_0xf4143b(0x10a))),console[_0xf4143b(0xd0)]('Agent:\x20'+_0x185205[_0xf4143b(0xd6)]);if(_0x185205[_0xf4143b(0x96)]&&_0x185205[_0xf4143b(0x9d)]){const _0x214cf3=getLLMAgentChatUrl(_0xfd04b2,_0x185205[_0xf4143b(0x9d)],_0x185205[_0xf4143b(0x96)]);console['log']('Chat:\x20'+a4_0x45057d[_0xf4143b(0xf5)](_0x214cf3));}return 0x0;}const _0x41dc3e=_0x160f1c['llmProject'],_0x1fe1ff=resolveProjectFromContext(_0x451261,_0x41dc3e);if(_0x1fe1ff[_0xf4143b(0xf6)])_0x451261=_0x1fe1ff['projectDir'],_0x1fe1ff['source']===_0xf4143b(0x93)&&console['log'](a4_0x45057d[_0xf4143b(0xbd)]('Using\x20project:\x20'+_0x451261));else{let _0x2a6463=_0xf4143b(0xf4);_0x1fe1ff[_0xf4143b(0xf7)]===_0xf4143b(0xaa)&&(_0x2a6463=_0x1fe1ff['message']+_0xf4143b(0xd9)+_0x1fe1ff[_0xf4143b(0x92)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode[_0xf4143b(0xad)],_0x1fe1ff[_0xf4143b(0xf7)]===_0xf4143b(0xc0)?_0x1fe1ff[_0xf4143b(0xeb)]:_0xf4143b(0xdd)+_0x451261,undefined,{'helpText':_0x2a6463});}const {data:_0x4e2411}=await withSpinner(_0xf4143b(0x10d),()=>_0x5bacb6[_0xf4143b(0x118)][_0xf4143b(0xa3)](_0x451261,{'dryRun':!![]})),_0x214934=_0x4e2411[_0xf4143b(0xd5)][_0xf4143b(0x97)][_0xf4143b(0x116)]>0x0;if(_0x214934){console[_0xf4143b(0xd0)](a4_0x45057d[_0xf4143b(0xc2)]('\x0aErrors\x20found:'));for(const _0x39516a of _0x4e2411[_0xf4143b(0x97)]){_0x39516a[_0xf4143b(0xab)]==='error'&&console[_0xf4143b(0xd0)](a4_0x45057d['red']('\x20\x20Agent\x20\x22'+_0x39516a[_0xf4143b(0xd6)]+_0xf4143b(0xea)+_0x39516a[_0xf4143b(0xb7)]));}return 0x1;}const _0x497c7d=_0x4e2411[_0xf4143b(0xd5)][_0xf4143b(0x97)][_0xf4143b(0xff)]+_0x4e2411['counts'][_0xf4143b(0x107)][_0xf4143b(0xff)]+_0x4e2411[_0xf4143b(0xd5)][_0xf4143b(0x85)]['created']+_0x4e2411[_0xf4143b(0xd5)][_0xf4143b(0xa1)]['created']+_0x4e2411[_0xf4143b(0xd5)][_0xf4143b(0xb2)][_0xf4143b(0xff)]+_0x4e2411[_0xf4143b(0xd5)]['experimentalKnowledgeBases'][_0xf4143b(0xff)]+_0x4e2411[_0xf4143b(0xd5)][_0xf4143b(0xaf)]['created'],_0x1ecf13=_0x4e2411[_0xf4143b(0xd5)][_0xf4143b(0x97)][_0xf4143b(0x8f)]+_0x4e2411[_0xf4143b(0xd5)][_0xf4143b(0x107)][_0xf4143b(0x8f)]+_0x4e2411['counts'][_0xf4143b(0x85)][_0xf4143b(0x8f)]+_0x4e2411['counts'][_0xf4143b(0xa1)][_0xf4143b(0x8f)]+_0x4e2411['counts'][_0xf4143b(0xb2)][_0xf4143b(0x8f)]+_0x4e2411[_0xf4143b(0xd5)][_0xf4143b(0x7d)][_0xf4143b(0x8f)]+_0x4e2411[_0xf4143b(0xd5)][_0xf4143b(0xaf)][_0xf4143b(0x8f)],_0x3225fa=_0x4e2411[_0xf4143b(0xd5)][_0xf4143b(0x97)][_0xf4143b(0x98)]+_0x4e2411[_0xf4143b(0xd5)][_0xf4143b(0x107)][_0xf4143b(0x98)]+_0x4e2411['counts']['textKnowledgeBases']['unchanged']+_0x4e2411['counts'][_0xf4143b(0xa1)][_0xf4143b(0x98)]+_0x4e2411['counts']['integrations'][_0xf4143b(0x98)]+_0x4e2411[_0xf4143b(0xd5)][_0xf4143b(0x7d)][_0xf4143b(0x98)]+_0x4e2411[_0xf4143b(0xd5)][_0xf4143b(0xaf)][_0xf4143b(0x98)];console['log'](_0xf4143b(0xe8)+_0x4e2411['projectName']+'\x27:'),console[_0xf4143b(0xd0)]('\x20\x20'+a4_0x45057d['green']('+\x20'+_0x497c7d+'\x20new')+_0xf4143b(0xc8)+a4_0x45057d[_0xf4143b(0x7c)]('~\x20'+_0x1ecf13+_0xf4143b(0x104))+_0xf4143b(0xc8)+a4_0x45057d[_0xf4143b(0xbd)]('=\x20'+_0x3225fa+_0xf4143b(0x109))),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x4e2411[_0xf4143b(0xd5)]['agents'])),console[_0xf4143b(0xd0)](_0xf4143b(0xc6)+formatCountSummary(_0x4e2411['counts'][_0xf4143b(0x107)])),console[_0xf4143b(0xd0)](_0xf4143b(0x8d)+formatCountSummary(_0x4e2411[_0xf4143b(0xd5)][_0xf4143b(0x85)])),console['log'](_0xf4143b(0xb0)+formatCountSummary(_0x4e2411['counts']['prompts'])),console['log'](_0xf4143b(0x81)+formatCountSummary(_0x4e2411['counts'][_0xf4143b(0xb2)]));const _0x295677=_0x4e2411[_0xf4143b(0xd5)][_0xf4143b(0x7d)][_0xf4143b(0xff)]>0x0||_0x4e2411[_0xf4143b(0xd5)][_0xf4143b(0x7d)][_0xf4143b(0x8f)]>0x0||_0x4e2411[_0xf4143b(0xd5)][_0xf4143b(0x7d)][_0xf4143b(0x98)]>0x0||_0x4e2411[_0xf4143b(0xd5)][_0xf4143b(0xaf)][_0xf4143b(0xff)]>0x0||_0x4e2411[_0xf4143b(0xd5)][_0xf4143b(0xaf)][_0xf4143b(0x8f)]>0x0||_0x4e2411['counts'][_0xf4143b(0xaf)][_0xf4143b(0x98)]>0x0;_0x295677&&(console[_0xf4143b(0xd0)](_0xf4143b(0x7f)+formatCountSummary(_0x4e2411[_0xf4143b(0xd5)][_0xf4143b(0x7d)])),console['log'](_0xf4143b(0x12d)+formatCountSummary(_0x4e2411[_0xf4143b(0xd5)][_0xf4143b(0xaf)])));console[_0xf4143b(0xd0)]('\x20\x20Source:\x20'+a4_0x45057d[_0xf4143b(0xf5)](_0x451261)),displayDiffs(_0x4e2411[_0xf4143b(0x97)],_0x4e2411[_0xf4143b(0x107)],_0x4e2411['textKnowledgeBases'],_0x4e2411['prompts'],_0x4e2411[_0xf4143b(0xb2)],_0x4e2411[_0xf4143b(0x7d)],_0x4e2411[_0xf4143b(0xaf)]);if(_0x24ef7b)return console[_0xf4143b(0xd0)](a4_0x45057d[_0xf4143b(0x7c)](_0xf4143b(0x11f))),0x0;if(_0x497c7d===0x0&&_0x1ecf13===0x0){console[_0xf4143b(0xd0)](a4_0x45057d[_0xf4143b(0x108)](_0xf4143b(0x12a)));const _0x370270=getLLMProjectUrl(_0xfd04b2,_0x4e2411['projectId']);return console[_0xf4143b(0xd0)](_0xf4143b(0x79)+a4_0x45057d[_0xf4143b(0xf5)](_0x370270)),0x0;}if(!_0x2e866f&&!_0x203066){if(!isInteractive())return console[_0xf4143b(0xb7)](a4_0x45057d[_0xf4143b(0xc2)](_0xf4143b(0xf8)),_0xf4143b(0xcf)),console[_0xf4143b(0xb7)](a4_0x45057d['dim'](_0xf4143b(0x125))),0x1;const _0x6a7f3c=await confirmKey('\x0aPush\x20'+(_0x497c7d+_0x1ecf13)+_0xf4143b(0x10e));if(!_0x6a7f3c)return console[_0xf4143b(0xd0)](a4_0x45057d[_0xf4143b(0x7c)](_0xf4143b(0x105)),_0xf4143b(0x7a)),0x1;}const {data:_0x8bae6e}=await withSpinner(_0xf4143b(0xed),()=>_0x5bacb6[_0xf4143b(0x118)][_0xf4143b(0xa3)](_0x451261,{'force':_0x203066})),_0x1b7a1c=_0x8bae6e[_0xf4143b(0xd5)]['agents']['errors']>0x0||_0x8bae6e[_0xf4143b(0xd5)]['knowledgeBases'][_0xf4143b(0x116)]>0x0||_0x8bae6e[_0xf4143b(0xd5)][_0xf4143b(0x85)][_0xf4143b(0x116)]>0x0||_0x8bae6e[_0xf4143b(0xd5)][_0xf4143b(0xa1)]['errors']>0x0;if(_0x1b7a1c){console[_0xf4143b(0xd0)](a4_0x45057d[_0xf4143b(0x7c)](_0xf4143b(0x103))),console['log'](),console['log'](a4_0x45057d['red'](_0xf4143b(0x8e)));for(const _0x56070e of _0x8bae6e[_0xf4143b(0x97)]){_0x56070e[_0xf4143b(0xab)]===_0xf4143b(0xb7)&&console[_0xf4143b(0xd0)](a4_0x45057d[_0xf4143b(0xc2)](_0xf4143b(0xe1)+_0x56070e[_0xf4143b(0xd6)]+_0xf4143b(0xea)+_0x56070e['error']));}for(const _0x2d6a2b of _0x8bae6e[_0xf4143b(0x107)]){_0x2d6a2b[_0xf4143b(0xab)]===_0xf4143b(0xb7)&&console[_0xf4143b(0xd0)](a4_0x45057d[_0xf4143b(0xc2)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x2d6a2b['name']+_0xf4143b(0xea)+_0x2d6a2b[_0xf4143b(0xb7)]));}for(const _0x2b177a of _0x8bae6e[_0xf4143b(0x85)]){_0x2b177a[_0xf4143b(0xab)]===_0xf4143b(0xb7)&&console[_0xf4143b(0xd0)](a4_0x45057d['red'](_0xf4143b(0xfa)+_0x2b177a[_0xf4143b(0xac)]+_0xf4143b(0xea)+_0x2b177a['error']));}for(const _0x55b395 of _0x8bae6e['prompts']){_0x55b395[_0xf4143b(0xab)]===_0xf4143b(0xb7)&&console[_0xf4143b(0xd0)](a4_0x45057d[_0xf4143b(0xc2)](_0xf4143b(0x12c)+_0x55b395[_0xf4143b(0xac)]+_0xf4143b(0xea)+_0x55b395[_0xf4143b(0xb7)]));}for(const _0x1d38e4 of _0x8bae6e['integrations']){_0x1d38e4[_0xf4143b(0xab)]==='error'&&console['log'](a4_0x45057d[_0xf4143b(0xc2)](_0xf4143b(0xe9)+_0x1d38e4[_0xf4143b(0xac)]+'\x22:\x20'+_0x1d38e4[_0xf4143b(0xb7)]));}return 0x1;}console[_0xf4143b(0xd0)](a4_0x45057d[_0xf4143b(0x108)](_0xf4143b(0xa6)+(_0x497c7d+_0x1ecf13)+_0xf4143b(0x128)+_0x8bae6e[_0xf4143b(0x90)]+'\x27'));const _0x3ecfc2=getLLMProjectUrl(_0xfd04b2,_0x8bae6e[_0xf4143b(0x9d)]);return console[_0xf4143b(0xd0)](_0xf4143b(0x79)+a4_0x45057d[_0xf4143b(0xf5)](_0x3ecfc2)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0xce3f60=a5_0x23be;(function(_0x5a29c7,_0x2e29aa){const _0x119a6a=a5_0x23be,_0x43a176=_0x5a29c7();while(!![]){try{const _0x5b0740=parseInt(_0x119a6a(0x26a))/0x1+-parseInt(_0x119a6a(0x25d))/0x2*(-parseInt(_0x119a6a(0x206))/0x3)+-parseInt(_0x119a6a(0x242))/0x4+-parseInt(_0x119a6a(0x26f))/0x5+-parseInt(_0x119a6a(0x283))/0x6+parseInt(_0x119a6a(0x227))/0x7*(parseInt(_0x119a6a(0x284))/0x8)+parseInt(_0x119a6a(0x1f2))/0x9;if(_0x5b0740===_0x2e29aa)break;else _0x43a176['push'](_0x43a176['shift']());}catch(_0x5140da){_0x43a176['push'](_0x43a176['shift']());}}}(a5_0x2334,0x29eb2));import*as a5_0x2f1d8d from'node:fs';import*as a5_0x458406 from'node:path';import a5_0x5e5441 from'chalk';function a5_0x2334(){const _0x409cbf=['Test\x20Configuration:','includes','stop','\x20-\x20','utf-8','description','writeFileSync','Duration:\x20','has','Cached\x20run\x20from:\x20','reeval','now','Project\x20path:\x20','toISOString','yellow','agent','FAIL','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','Output\x20written\x20to:\x20','json','conversations','projectName','split','4nGcjcR','Tests\x20found:\x20','existsSync','push','Usage:','isSpinning','No\x20tests\x20have\x20tags\x20defined.','white','New\x20tests\x20to\x20execute:\x20','404','no_local_folder','tests','\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)','118954IGLLZi','✗\x20FAIL:\x20','Either\x20switch\x20to\x20the\x20\x22','Re-evaluating...','Site:\x20','663565khwGup','\x22,\x20but\x20current\x20site\x20is\x20\x22','log','toLowerCase','testName','Running:\x20','Failed:\x20\x20\x20','agent:test','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','no_context','multiple_agents','\x20(new)','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','start','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','projectDir','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','Re-evaluation\x20Summary','Run\x20tests\x20for\x20an\x20LLM\x20agent','1852836aysRnT','133192qMOCRX','Conversation\x20URL:\x20','source','dryRun','table','Round\x20','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','agentDirs','Test\x20Summary','\x20\x20-\x20','4603158BqKYkI','PASS','Run\x20\x27tdx\x20agent\x20pull\x20','llmProject','rounds','\x20\x20Agent:\x20','\x22:\x20','conversation_url','Using\x20agent:\x20','Test\x20','...','\x20\x20Conversation:\x20','\x20\x20Evaluating...\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','repeat','message','Passed:\x20\x20\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','dim','agentName','144429hazuMR','tsv','\x20(cached)','Evaluating\x20response...','Re-evaluating\x20','Executing\x20new\x20tests...','output','filter','status','resolve','trim','Failed\x20Tests:','Total:\x20\x20\x20\x20','\x20\x20Project:\x20',':\x20Sending\x20user\x20input...','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','red','\x20\x20Round\x20','name','✗\x20ERROR:\x20','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','ERROR','verbose','Round\x201/','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','\x20\x20Site:\x20','Error\x20writing\x20output\x20file:\x20','/<agent-name>','Available\x20tests:\x20','Re-evaluating\x20cached\x20test\x20run...','Available\x20tags:\x20','⚠\x20SKIPPED:\x20','49vUTDsH','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','cyan','tags','join','resolveProjectId','map','resolveAgentId','reason','\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','timestamp','round','some','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','Running\x20test:\x20','site','jsonl','length','...\x20','Agent:\x20','llm','executeReeval','\x27\x20to\x20create\x20the\x20folder\x20structure.','text','add','No\x20tests\x20found\x20matching:\x20','not\x20found','920112jMIZJd','forEach','✓\x20PASS:\x20','green'];a5_0x2334=function(){return _0x409cbf;};return a5_0x2334();}import{BaseCommand}from'./command.js';function a5_0x23be(_0x580039,_0x32915f){_0x580039=_0x580039-0x1e9;const _0x2334be=a5_0x2334();let _0x23befd=_0x2334be[_0x580039];return _0x23befd;}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_0xce3f60(0x218)]=a5_0xce3f60(0x276);[a5_0xce3f60(0x24b)]=a5_0xce3f60(0x282);async['execute'](_0x358796){const _0x1fd36c=a5_0xce3f60,{options:_0x295407,args:_0x2eb9a5,tdx:_0x51f815}=_0x358796,_0x1dea72=_0x2eb9a5[0x0]||'.',_0x116606=_0x295407[_0x1fd36c(0x1eb)],_0x5dee77=_0x295407,_0x5dc7ec=_0x5dee77['eval']===![],_0x9720d5=_0x5dee77[_0x1fd36c(0x250)],_0x204f4f=_0x5dee77[_0x1fd36c(0x218)],_0x2e955f=_0x5dee77[_0x1fd36c(0x22a)],_0x55e405=_0x295407['site'],_0x2679a5=_0x5dee77[_0x1fd36c(0x20c)];if(_0x9720d5&&_0x5dc7ec)return console['log'](a5_0x5e5441[_0x1fd36c(0x216)]('Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval')),0x1;let _0x3384cf=_0x1fd36c(0x1ec);if(_0x5dee77[_0x1fd36c(0x259)])_0x3384cf='json';else{if(_0x5dee77[_0x1fd36c(0x237)])_0x3384cf='jsonl';else{if(_0x5dee77[_0x1fd36c(0x207)])_0x3384cf=_0x1fd36c(0x207);else{if(_0x5dee77[_0x1fd36c(0x1ec)])_0x3384cf=_0x1fd36c(0x1ec);}}}const _0x530139=_0x5dee77[_0x1fd36c(0x1f5)];let _0x340793=_0x1dea72;const _0x560172=a5_0x2f1d8d[_0x1fd36c(0x25f)](_0x1dea72),_0x331e8c=_0x1dea72==='.';if(!_0x560172||_0x331e8c){const _0xea88b8=resolveProjectFromContext(_0x1dea72,_0x530139,{'requireFile':'test.yml'});if(_0xea88b8['found'])_0x340793=_0xea88b8[_0x1fd36c(0x27e)],_0xea88b8[_0x1fd36c(0x1ea)]==='context'&&console['log'](a5_0x5e5441[_0x1fd36c(0x204)](_0x1fd36c(0x1fa)+_0x340793));else switch(_0xea88b8[_0x1fd36c(0x22f)]){case _0x1fd36c(0x278):console['log'](a5_0x5e5441[_0x1fd36c(0x254)](_0xea88b8['message'])),console[_0x1fd36c(0x271)](),console[_0x1fd36c(0x271)](_0x1fd36c(0x261)),console[_0x1fd36c(0x271)](_0x1fd36c(0x230)),console['log'](_0x1fd36c(0x269)),console[_0x1fd36c(0x271)](),console['log'](_0x1fd36c(0x215));return 0x1;case _0x1fd36c(0x267):console[_0x1fd36c(0x271)](a5_0x5e5441[_0x1fd36c(0x254)](_0xea88b8[_0x1fd36c(0x201)])),console['log'](),console[_0x1fd36c(0x271)](_0x1fd36c(0x1f4)+_0xea88b8[_0x1fd36c(0x1f5)]+_0x1fd36c(0x23d));return 0x1;case _0x1fd36c(0x279):{const _0x196270=a5_0x458406['basename'](_0xea88b8['projectDir']);console['log'](a5_0x5e5441[_0x1fd36c(0x254)](_0x1fd36c(0x277)+_0xea88b8[_0x1fd36c(0x1f5)]+'\x22:'));for(const _0x59c20e of _0xea88b8[_0x1fd36c(0x1ef)]){console[_0x1fd36c(0x271)](_0x1fd36c(0x1f1)+_0x59c20e);}return console[_0x1fd36c(0x271)](),console['log']('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x196270+_0x1fd36c(0x222)),0x1;}case'no_tests':console[_0x1fd36c(0x271)](a5_0x5e5441[_0x1fd36c(0x254)](_0x1fd36c(0x228)+_0xea88b8[_0x1fd36c(0x1f5)]+'\x22.')),console[_0x1fd36c(0x271)](a5_0x5e5441[_0x1fd36c(0x204)](_0x1fd36c(0x252)+_0xea88b8[_0x1fd36c(0x27e)])),console['log'](),console[_0x1fd36c(0x271)](_0x1fd36c(0x257));return 0x1;}}const {definition:_0x418128,agentInfo:_0x3d2472}=parseTestFile(_0x340793);let _0x1a4eb5=_0x418128[_0x1fd36c(0x268)];if(_0x204f4f){const _0x26454a=_0x204f4f['split'](',')[_0x1fd36c(0x22d)](_0x15fe4b=>_0x15fe4b[_0x1fd36c(0x210)]());_0x1a4eb5=_0x418128[_0x1fd36c(0x268)][_0x1fd36c(0x20d)](_0x435843=>_0x26454a[_0x1fd36c(0x247)](_0x435843[_0x1fd36c(0x218)]));if(_0x1a4eb5[_0x1fd36c(0x238)]===0x0)return console[_0x1fd36c(0x271)](a5_0x5e5441['yellow'](_0x1fd36c(0x240)+_0x204f4f)),console['log'](a5_0x5e5441[_0x1fd36c(0x204)](_0x1fd36c(0x223)+_0x418128[_0x1fd36c(0x268)][_0x1fd36c(0x22d)](_0x5ae43b=>_0x5ae43b[_0x1fd36c(0x218)])[_0x1fd36c(0x22b)](',\x20'))),0x1;}if(_0x2e955f){const _0x2c9a47=_0x2e955f[_0x1fd36c(0x25c)](',')[_0x1fd36c(0x22d)](_0x56e412=>_0x56e412['trim']()['toLowerCase']());_0x1a4eb5=_0x1a4eb5[_0x1fd36c(0x20d)](_0x2e61ca=>_0x2e61ca['tags']?.[_0x1fd36c(0x233)](_0x3f8082=>_0x2c9a47['includes'](_0x3f8082[_0x1fd36c(0x272)]())));if(_0x1a4eb5[_0x1fd36c(0x238)]===0x0){console[_0x1fd36c(0x271)](a5_0x5e5441[_0x1fd36c(0x254)]('No\x20tests\x20found\x20with\x20tags:\x20'+_0x2e955f));const _0x46b835=new Set();return _0x418128[_0x1fd36c(0x268)]['forEach'](_0x506c15=>_0x506c15[_0x1fd36c(0x22a)]?.[_0x1fd36c(0x243)](_0x12d28b=>_0x46b835[_0x1fd36c(0x23f)](_0x12d28b))),_0x46b835['size']>0x0?console[_0x1fd36c(0x271)](a5_0x5e5441[_0x1fd36c(0x204)](_0x1fd36c(0x225)+[..._0x46b835][_0x1fd36c(0x22b)](',\x20'))):console[_0x1fd36c(0x271)](a5_0x5e5441[_0x1fd36c(0x204)](_0x1fd36c(0x263))),0x1;}}if(_0x9720d5)return this[_0x1fd36c(0x23c)](_0x358796,{'definition':{'tests':_0x1a4eb5},'agentInfo':_0x3d2472,'outputFormat':_0x3384cf,'outputFile':_0x2679a5,'testNames':_0x204f4f});if(_0x116606){console['log'](a5_0x5e5441[_0x1fd36c(0x229)](_0x1fd36c(0x246))),console['log'](_0x1fd36c(0x220)+a5_0x5e5441['white'](_0x55e405)),console[_0x1fd36c(0x271)](_0x1fd36c(0x213)+a5_0x5e5441[_0x1fd36c(0x264)](_0x3d2472[_0x1fd36c(0x25b)])),console[_0x1fd36c(0x271)](_0x1fd36c(0x1f7)+a5_0x5e5441['white'](_0x3d2472['agentName'])),console[_0x1fd36c(0x271)](),console[_0x1fd36c(0x271)](_0x1fd36c(0x25e)+a5_0x5e5441[_0x1fd36c(0x264)](_0x1a4eb5[_0x1fd36c(0x238)]));for(let _0x512d4f=0x0;_0x512d4f<_0x1a4eb5[_0x1fd36c(0x238)];_0x512d4f++){const _0x4f2b6f=_0x1a4eb5[_0x512d4f],_0x4ec4f3=_0x4f2b6f['rounds'][_0x1fd36c(0x238)]===0x1?_0x1fd36c(0x232):_0x1fd36c(0x1f6),_0x2c1121=_0x4f2b6f[_0x1fd36c(0x22a)]?.[_0x1fd36c(0x238)]?'\x20['+_0x4f2b6f['tags'][_0x1fd36c(0x22b)](',\x20')+']':'';console['log']('\x20\x20'+(_0x512d4f+0x1)+'.\x20'+a5_0x5e5441[_0x1fd36c(0x264)](_0x4f2b6f['name'])+'\x20('+_0x4f2b6f[_0x1fd36c(0x1f6)][_0x1fd36c(0x238)]+'\x20'+_0x4ec4f3+')'+a5_0x5e5441[_0x1fd36c(0x204)](_0x2c1121));}return 0x0;}let _0x4d4c5f,_0x50ae1f;try{_0x4d4c5f=await _0x51f815[_0x1fd36c(0x23b)][_0x1fd36c(0x22c)](_0x3d2472[_0x1fd36c(0x25b)]);}catch(_0x4651c8){const _0x853201=_0x4651c8 instanceof Error?_0x4651c8[_0x1fd36c(0x201)]:String(_0x4651c8);return _0x853201[_0x1fd36c(0x247)](_0x1fd36c(0x266))||_0x853201['toLowerCase']()[_0x1fd36c(0x247)]('not\x20found')?console[_0x1fd36c(0x271)](a5_0x5e5441['red'](_0x1fd36c(0x203)+_0x3d2472['projectName'])):console[_0x1fd36c(0x271)](a5_0x5e5441['red'](_0x1fd36c(0x21b)+_0x3d2472[_0x1fd36c(0x25b)]+_0x1fd36c(0x1f8)+_0x853201)),0x1;}try{_0x50ae1f=await _0x51f815['llm'][_0x1fd36c(0x22e)](_0x3d2472[_0x1fd36c(0x205)],_0x4d4c5f);}catch(_0x73023){const _0x5d58c9=_0x73023 instanceof Error?_0x73023[_0x1fd36c(0x201)]:String(_0x73023);return _0x5d58c9[_0x1fd36c(0x247)](_0x1fd36c(0x266))||_0x5d58c9[_0x1fd36c(0x272)]()[_0x1fd36c(0x247)](_0x1fd36c(0x241))?console['log'](a5_0x5e5441['red'](_0x1fd36c(0x21a)+_0x3d2472[_0x1fd36c(0x205)])):console[_0x1fd36c(0x271)](a5_0x5e5441[_0x1fd36c(0x216)](_0x1fd36c(0x27f)+_0x3d2472[_0x1fd36c(0x205)]+_0x1fd36c(0x1f8)+_0x5d58c9)),0x1;}let _0x4e9a02;if(!_0x5dc7ec)try{_0x4e9a02=await setupEvaluatorAgent(_0x51f815[_0x1fd36c(0x23b)],_0x295407['verbose']);}catch(_0x2760c2){const _0x5c0f5c=_0x2760c2 instanceof Error?_0x2760c2[_0x1fd36c(0x201)]:String(_0x2760c2);return console['log'](a5_0x5e5441['red'](_0x1fd36c(0x234)+_0x5c0f5c)),0x1;}console[_0x1fd36c(0x271)](a5_0x5e5441[_0x1fd36c(0x229)]('Running\x20agent\x20tests...')),console['log'](_0x1fd36c(0x26e)+a5_0x5e5441[_0x1fd36c(0x264)](_0x55e405)),console[_0x1fd36c(0x271)](_0x1fd36c(0x23a)+a5_0x5e5441[_0x1fd36c(0x264)](_0x3d2472[_0x1fd36c(0x25b)]+'/'+_0x3d2472['agentName'])),console[_0x1fd36c(0x271)]();const _0x26454e=[],_0x3213d5=[],_0x159e9f=Date['now']();for(let _0x3e6cad=0x0;_0x3e6cad<_0x1a4eb5[_0x1fd36c(0x238)];_0x3e6cad++){const _0xb3e39d=_0x1a4eb5[_0x3e6cad];_0x1a4eb5['length']>0x1?console['log'](_0x1fd36c(0x1fb)+(_0x3e6cad+0x1)+'/'+_0x1a4eb5[_0x1fd36c(0x238)]+':\x20'+a5_0x5e5441['white'](_0xb3e39d[_0x1fd36c(0x218)])):console['log'](_0x1fd36c(0x235)+a5_0x5e5441['white'](_0xb3e39d[_0x1fd36c(0x218)]));const _0x1bf737=createCommandSpinner(_0x1fd36c(0x21e)+_0xb3e39d['rounds'][_0x1fd36c(0x238)]+_0x1fd36c(0x214));_0x1bf737['start']();try{const {result:_0x83d9f2,conversation:_0x6a1ea8}=await runTest(_0x51f815['llm'],_0xb3e39d,{'agentId':_0x50ae1f,'projectId':_0x4d4c5f,'site':_0x55e405,'noEval':_0x5dc7ec,'evaluatorId':_0x4e9a02,'onRoundStart':(_0x338003,_0x56f4fe)=>{const _0xf02ef3=_0x1fd36c;_0x1bf737['text']=_0xf02ef3(0x1ed)+(_0x338003+0x1)+'/'+_0x56f4fe+_0xf02ef3(0x214);},'onRoundComplete':(_0x281c78,_0x272061,_0x272872)=>{const _0x23df67=_0x1fd36c,_0x4d6c91=formatElapsed(_0x272061);_0x272872?console[_0x23df67(0x271)](_0x23df67(0x217)+(_0x281c78+0x1)+'/'+_0xb3e39d[_0x23df67(0x1f6)][_0x23df67(0x238)]+_0x23df67(0x239)+a5_0x5e5441[_0x23df67(0x245)]('✓')+'\x20('+_0x4d6c91+')'):console[_0x23df67(0x271)]('\x20\x20Round\x20'+(_0x281c78+0x1)+'/'+_0xb3e39d[_0x23df67(0x1f6)][_0x23df67(0x238)]+'...\x20'+a5_0x5e5441[_0x23df67(0x216)]('✗'));},'onEvaluationStart':()=>{const _0x57d0f1=_0x1fd36c;_0x1bf737['text']=_0x57d0f1(0x209);},'onEvaluationComplete':_0x534456=>{const _0x4659b4=formatElapsed(_0x534456);console['log']('\x20\x20Evaluating...\x20'+a5_0x5e5441['green']('✓')+'\x20('+_0x4659b4+')');}});_0x1bf737[_0x1fd36c(0x248)](),_0x26454e[_0x1fd36c(0x260)](_0x83d9f2),_0x3213d5[_0x1fd36c(0x260)](_0x6a1ea8);if(_0x83d9f2[_0x1fd36c(0x20e)]===_0x1fd36c(0x1f3))console[_0x1fd36c(0x271)](a5_0x5e5441[_0x1fd36c(0x245)](_0x1fd36c(0x244)+_0x83d9f2[_0x1fd36c(0x22f)]));else _0x83d9f2['status']===_0x1fd36c(0x256)?console[_0x1fd36c(0x271)](a5_0x5e5441[_0x1fd36c(0x216)](_0x1fd36c(0x26b)+_0x83d9f2[_0x1fd36c(0x22f)])):console[_0x1fd36c(0x271)](a5_0x5e5441[_0x1fd36c(0x216)](_0x1fd36c(0x219)+_0x83d9f2[_0x1fd36c(0x22f)]));_0x83d9f2['conversation_url']&&console[_0x1fd36c(0x271)](a5_0x5e5441['dim'](_0x1fd36c(0x1e9)+_0x83d9f2['conversation_url'])),console[_0x1fd36c(0x271)]();}catch(_0x2f1ef5){_0x1bf737['stop']();const _0x5cf1c1=_0x2f1ef5 instanceof Error?_0x2f1ef5[_0x1fd36c(0x201)]:String(_0x2f1ef5);console[_0x1fd36c(0x271)](a5_0x5e5441['red'](_0x1fd36c(0x219)+_0x5cf1c1)),console[_0x1fd36c(0x271)](),_0x26454e[_0x1fd36c(0x260)]({'name':_0xb3e39d[_0x1fd36c(0x218)],'status':_0x1fd36c(0x21c),'reason':_0x5cf1c1,'timestamp':new Date()[_0x1fd36c(0x253)](),'duration_ms':0x0});}}const _0xe301e2=Date[_0x1fd36c(0x251)]()-_0x159e9f,_0x505257=_0x26454e['filter'](_0x50ba94=>_0x50ba94[_0x1fd36c(0x20e)]===_0x1fd36c(0x1f3))[_0x1fd36c(0x238)],_0x39b170=_0x26454e[_0x1fd36c(0x20d)](_0x5bd7fa=>_0x5bd7fa[_0x1fd36c(0x20e)]==='FAIL')['length'],_0x196e06=_0x26454e[_0x1fd36c(0x20d)](_0x53106f=>_0x53106f['status']===_0x1fd36c(0x21c))[_0x1fd36c(0x238)];console[_0x1fd36c(0x271)]('━'[_0x1fd36c(0x200)](0x3c)),console[_0x1fd36c(0x271)](_0x1fd36c(0x1f0)),console['log']('━'['repeat'](0x3c)),console['log'](_0x1fd36c(0x212)+_0x26454e[_0x1fd36c(0x238)]),console['log'](_0x1fd36c(0x202)+a5_0x5e5441[_0x1fd36c(0x245)](_0x505257)),console[_0x1fd36c(0x271)](_0x1fd36c(0x275)+a5_0x5e5441[_0x1fd36c(0x216)](_0x39b170));_0x196e06>0x0&&console['log']('Errors:\x20\x20\x20'+a5_0x5e5441[_0x1fd36c(0x216)](_0x196e06));console[_0x1fd36c(0x271)](_0x1fd36c(0x24d)+formatElapsed(_0xe301e2)),console[_0x1fd36c(0x271)]('━'[_0x1fd36c(0x200)](0x3c));const _0x4e403e=_0x26454e[_0x1fd36c(0x20d)](_0x40bde9=>_0x40bde9[_0x1fd36c(0x20e)]!==_0x1fd36c(0x1f3));if(_0x4e403e[_0x1fd36c(0x238)]>0x0){console['log'](),console[_0x1fd36c(0x271)](_0x1fd36c(0x211));for(const _0x7b43e2 of _0x4e403e){const _0x18f50b=a5_0x5e5441[_0x1fd36c(0x216)]('✗'),_0x53ff2c=_0x7b43e2['reason'][_0x1fd36c(0x238)]>0x32?_0x7b43e2[_0x1fd36c(0x22f)]['substring'](0x0,0x32)+_0x1fd36c(0x1fc):_0x7b43e2[_0x1fd36c(0x22f)];console['log']('\x20\x20'+_0x18f50b+'\x20'+_0x7b43e2[_0x1fd36c(0x218)]+':\x20'+_0x53ff2c);}}const _0x1e122e={'summary':{'total':_0x26454e[_0x1fd36c(0x238)],'passed':_0x505257,'failed':_0x39b170,'errors':_0x196e06>0x0?_0x196e06:undefined,'duration_ms':_0xe301e2},'tests':_0x26454e,'agent':{'project':_0x3d2472['projectName'],'name':_0x3d2472[_0x1fd36c(0x205)],'site':_0x55e405},'timestamp':new Date(_0x159e9f)[_0x1fd36c(0x253)]()};try{const _0x2616fd=buildCachedTestRun(_0x3213d5,{'site':_0x55e405,'projectId':_0x4d4c5f,'projectName':_0x3d2472['projectName'],'agentId':_0x50ae1f,'agentName':_0x3d2472[_0x1fd36c(0x205)],'testYmlPath':a5_0x458406[_0x1fd36c(0x20f)](_0x3d2472['testYmlPath'])});saveLastTestRun(_0x2616fd);}catch{}if(_0x3384cf!==_0x1fd36c(0x1ec)||_0x2679a5){const _0x10279b=formatResults(_0x1e122e,_0x3384cf);if(_0x2679a5)try{a5_0x2f1d8d[_0x1fd36c(0x24c)](_0x2679a5,_0x10279b,_0x1fd36c(0x24a)),console[_0x1fd36c(0x271)](),console[_0x1fd36c(0x271)](a5_0x5e5441[_0x1fd36c(0x204)](_0x1fd36c(0x258)+_0x2679a5));}catch(_0x30fa77){return console['log'](),console['log'](a5_0x5e5441[_0x1fd36c(0x216)](_0x1fd36c(0x221)+_0x30fa77)),0x1;}else console['log'](),console[_0x1fd36c(0x271)](_0x10279b);}return _0x4e403e[_0x1fd36c(0x238)]>0x0?0x1:0x0;}async[a5_0xce3f60(0x23c)](_0x198bf7,_0x5d0077){const _0x3bef7b=a5_0xce3f60,{options:_0x4017c0,tdx:_0x665ba}=_0x198bf7,{definition:_0x3429fd,agentInfo:_0x5bb7ac,outputFormat:_0x376d6a,outputFile:_0x19711f}=_0x5d0077,_0x3b4b25=_0x4017c0[_0x3bef7b(0x236)],_0x31d51a=loadLastTestRun();if(!_0x31d51a)return console[_0x3bef7b(0x271)](a5_0x5e5441[_0x3bef7b(0x216)]('Error:\x20No\x20previous\x20test\x20run\x20found.')),console[_0x3bef7b(0x271)](a5_0x5e5441['dim'](_0x3bef7b(0x1ff))),0x1;if(_0x31d51a[_0x3bef7b(0x255)][_0x3bef7b(0x205)]!==_0x5bb7ac[_0x3bef7b(0x205)])return console[_0x3bef7b(0x271)](a5_0x5e5441['red'](_0x3bef7b(0x280)+_0x31d51a[_0x3bef7b(0x255)]['agentName']+_0x3bef7b(0x1ee)+_0x5bb7ac[_0x3bef7b(0x205)]+'\x22.')),console[_0x3bef7b(0x271)](a5_0x5e5441[_0x3bef7b(0x204)](_0x3bef7b(0x21f))),0x1;const _0xdacb8e=new Set(_0x31d51a[_0x3bef7b(0x25a)]['map'](_0x1aca76=>_0x1aca76[_0x3bef7b(0x273)])),_0x1efcd1=_0x3429fd['tests'][_0x3bef7b(0x20d)](_0x133ef2=>!_0xdacb8e[_0x3bef7b(0x24e)](_0x133ef2[_0x3bef7b(0x218)]));if(_0x1efcd1['length']>0x0&&_0x31d51a[_0x3bef7b(0x236)]!==_0x3b4b25)return console[_0x3bef7b(0x271)](a5_0x5e5441[_0x3bef7b(0x216)](_0x3bef7b(0x27d))),console['log'](a5_0x5e5441['dim']('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x31d51a['site']+_0x3bef7b(0x270)+_0x3b4b25+'\x22.')),console['log'](a5_0x5e5441[_0x3bef7b(0x204)](_0x3bef7b(0x26c)+_0x31d51a[_0x3bef7b(0x236)]+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0xe81ee6=_0x3429fd['tests'][_0x3bef7b(0x20d)](_0x37bd89=>_0xdacb8e[_0x3bef7b(0x24e)](_0x37bd89['name'])),_0x590588=_0x1efcd1;let _0x47ae32;try{_0x47ae32=await setupEvaluatorAgent(_0x665ba[_0x3bef7b(0x23b)],_0x4017c0[_0x3bef7b(0x21d)]);}catch(_0x4c225f){const _0xd15db5=_0x4c225f instanceof Error?_0x4c225f['message']:String(_0x4c225f);return console[_0x3bef7b(0x271)](a5_0x5e5441[_0x3bef7b(0x216)](_0x3bef7b(0x234)+_0xd15db5)),0x1;}console[_0x3bef7b(0x271)](a5_0x5e5441[_0x3bef7b(0x229)](_0x3bef7b(0x224))),console[_0x3bef7b(0x271)](_0x3bef7b(0x24f)+a5_0x5e5441[_0x3bef7b(0x264)](_0x31d51a[_0x3bef7b(0x231)])),console[_0x3bef7b(0x271)](_0x3bef7b(0x23a)+a5_0x5e5441['white'](_0x31d51a[_0x3bef7b(0x255)][_0x3bef7b(0x25b)]+'/'+_0x31d51a[_0x3bef7b(0x255)][_0x3bef7b(0x205)]));_0x590588[_0x3bef7b(0x238)]>0x0&&console[_0x3bef7b(0x271)](_0x3bef7b(0x265)+a5_0x5e5441[_0x3bef7b(0x254)](_0x590588['length']));console[_0x3bef7b(0x271)]();const _0x4bc4bf=[],_0x52ba9a=Date['now'](),_0x41acd7=createCommandSpinner(_0x3bef7b(0x26d));if(_0xe81ee6[_0x3bef7b(0x238)]>0x0)try{const _0x2b8c72=await reevaluateFromCache(_0x665ba['llm'],_0x31d51a,{'tests':_0xe81ee6},{'evaluatorId':_0x47ae32,'onTestStart':(_0x49937a,_0x387e73,_0x387662)=>{const _0x443981=_0x3bef7b;_0x41acd7[_0x443981(0x23e)]=_0x443981(0x20a)+(_0x387e73+0x1)+'/'+_0x387662+':\x20'+_0x49937a+_0x443981(0x1fc);if(!_0x41acd7[_0x443981(0x262)])_0x41acd7['start']();},'onTestComplete':(_0x5ce081,_0x1c2291)=>{const _0x4a9fd1=_0x3bef7b;_0x41acd7[_0x4a9fd1(0x248)]();if(_0x1c2291['status']===_0x4a9fd1(0x1f3))console[_0x4a9fd1(0x271)](a5_0x5e5441[_0x4a9fd1(0x245)](_0x4a9fd1(0x244)+_0x5ce081)+a5_0x5e5441[_0x4a9fd1(0x204)](_0x4a9fd1(0x208)));else _0x1c2291['status']==='FAIL'?console[_0x4a9fd1(0x271)](a5_0x5e5441[_0x4a9fd1(0x216)](_0x4a9fd1(0x26b)+_0x5ce081+_0x4a9fd1(0x249)+_0x1c2291[_0x4a9fd1(0x22f)])+a5_0x5e5441[_0x4a9fd1(0x204)]('\x20(cached)')):console[_0x4a9fd1(0x271)](a5_0x5e5441['red'](_0x4a9fd1(0x219)+_0x5ce081+_0x4a9fd1(0x249)+_0x1c2291[_0x4a9fd1(0x22f)]));_0x1c2291[_0x4a9fd1(0x1f9)]&&console[_0x4a9fd1(0x271)](a5_0x5e5441[_0x4a9fd1(0x204)](_0x4a9fd1(0x1fd)+_0x1c2291['conversation_url'])),_0x4bc4bf[_0x4a9fd1(0x260)](_0x1c2291);},'onTestSkipped':(_0x15604b,_0x5c0b11)=>{const _0x3ab381=_0x3bef7b;_0x41acd7['stop'](),console[_0x3ab381(0x271)](a5_0x5e5441[_0x3ab381(0x254)](_0x3ab381(0x226)+_0x15604b+_0x3ab381(0x249)+_0x5c0b11));}});for(const _0x4ebab3 of _0x2b8c72){!_0x4bc4bf['find'](_0x264162=>_0x264162[_0x3bef7b(0x218)]===_0x4ebab3['name'])&&_0x4bc4bf[_0x3bef7b(0x260)](_0x4ebab3);}}catch(_0x22d55c){_0x41acd7['stop']();const _0x5f2db8=_0x22d55c instanceof Error?_0x22d55c['message']:String(_0x22d55c);return console[_0x3bef7b(0x271)](a5_0x5e5441[_0x3bef7b(0x216)](_0x3bef7b(0x27b)+_0x5f2db8)),0x1;}_0x41acd7[_0x3bef7b(0x248)]();if(_0x590588[_0x3bef7b(0x238)]>0x0){console[_0x3bef7b(0x271)](),console[_0x3bef7b(0x271)](a5_0x5e5441[_0x3bef7b(0x229)](_0x3bef7b(0x20b)));const {projectId:_0x2e31a2,agentId:_0x1276bc}=_0x31d51a[_0x3bef7b(0x255)];for(const _0x724aa2 of _0x590588){console[_0x3bef7b(0x271)](_0x3bef7b(0x274)+a5_0x5e5441[_0x3bef7b(0x264)](_0x724aa2[_0x3bef7b(0x218)]));const _0x1ae745=createCommandSpinner(_0x3bef7b(0x21e)+_0x724aa2[_0x3bef7b(0x1f6)][_0x3bef7b(0x238)]+':\x20Sending\x20user\x20input...');_0x1ae745[_0x3bef7b(0x27c)]();try{const {result:_0xca8820}=await runTest(_0x665ba['llm'],_0x724aa2,{'agentId':_0x1276bc,'projectId':_0x2e31a2,'site':_0x31d51a[_0x3bef7b(0x236)],'noEval':![],'evaluatorId':_0x47ae32,'onRoundStart':(_0x3656b8,_0x231075)=>{const _0x121b38=_0x3bef7b;_0x1ae745['text']=_0x121b38(0x1ed)+(_0x3656b8+0x1)+'/'+_0x231075+_0x121b38(0x214);},'onRoundComplete':(_0x3d7227,_0x6e93b4,_0x8ca538)=>{const _0x2c11da=_0x3bef7b,_0xbebf52=formatElapsed(_0x6e93b4);_0x8ca538?console[_0x2c11da(0x271)](_0x2c11da(0x217)+(_0x3d7227+0x1)+'/'+_0x724aa2['rounds']['length']+'...\x20'+a5_0x5e5441['green']('✓')+'\x20('+_0xbebf52+')'):console[_0x2c11da(0x271)](_0x2c11da(0x217)+(_0x3d7227+0x1)+'/'+_0x724aa2[_0x2c11da(0x1f6)]['length']+_0x2c11da(0x239)+a5_0x5e5441[_0x2c11da(0x216)]('✗'));},'onEvaluationStart':()=>{const _0xe06ee6=_0x3bef7b;_0x1ae745[_0xe06ee6(0x23e)]='Evaluating\x20response...';},'onEvaluationComplete':_0x24a4a6=>{const _0x2e8d1e=_0x3bef7b,_0x3e415f=formatElapsed(_0x24a4a6);console[_0x2e8d1e(0x271)](_0x2e8d1e(0x1fe)+a5_0x5e5441['green']('✓')+'\x20('+_0x3e415f+')');}});_0x1ae745[_0x3bef7b(0x248)](),_0x4bc4bf[_0x3bef7b(0x260)](_0xca8820);if(_0xca8820[_0x3bef7b(0x20e)]===_0x3bef7b(0x1f3))console['log'](a5_0x5e5441['green'](_0x3bef7b(0x244)+_0xca8820[_0x3bef7b(0x22f)])+a5_0x5e5441['dim'](_0x3bef7b(0x27a)));else _0xca8820[_0x3bef7b(0x20e)]===_0x3bef7b(0x256)?console[_0x3bef7b(0x271)](a5_0x5e5441[_0x3bef7b(0x216)](_0x3bef7b(0x26b)+_0xca8820[_0x3bef7b(0x22f)])+a5_0x5e5441[_0x3bef7b(0x204)](_0x3bef7b(0x27a))):console[_0x3bef7b(0x271)](a5_0x5e5441[_0x3bef7b(0x216)](_0x3bef7b(0x219)+_0xca8820['reason']));_0xca8820[_0x3bef7b(0x1f9)]&&console[_0x3bef7b(0x271)](a5_0x5e5441[_0x3bef7b(0x204)](_0x3bef7b(0x1fd)+_0xca8820[_0x3bef7b(0x1f9)]));}catch(_0x48f7d2){_0x1ae745[_0x3bef7b(0x248)]();const _0x5265d7=_0x48f7d2 instanceof Error?_0x48f7d2[_0x3bef7b(0x201)]:String(_0x48f7d2);console[_0x3bef7b(0x271)](a5_0x5e5441['red']('✗\x20ERROR:\x20'+_0x5265d7)),_0x4bc4bf[_0x3bef7b(0x260)]({'name':_0x724aa2['name'],'status':'ERROR','reason':_0x5265d7,'timestamp':new Date()[_0x3bef7b(0x253)](),'duration_ms':0x0});}}}console['log']();const _0x42895f=Date[_0x3bef7b(0x251)]()-_0x52ba9a,_0xebe026=_0x4bc4bf[_0x3bef7b(0x20d)](_0x7e7f26=>_0x7e7f26[_0x3bef7b(0x20e)]===_0x3bef7b(0x1f3))[_0x3bef7b(0x238)],_0x55b4f8=_0x4bc4bf[_0x3bef7b(0x20d)](_0x2e1854=>_0x2e1854[_0x3bef7b(0x20e)]==='FAIL')[_0x3bef7b(0x238)],_0xee60da=_0x4bc4bf[_0x3bef7b(0x20d)](_0x3dbe69=>_0x3dbe69['status']===_0x3bef7b(0x21c))[_0x3bef7b(0x238)];console[_0x3bef7b(0x271)]('━'[_0x3bef7b(0x200)](0x3c)),console[_0x3bef7b(0x271)](_0x3bef7b(0x281)),console[_0x3bef7b(0x271)]('━'['repeat'](0x3c)),console[_0x3bef7b(0x271)](_0x3bef7b(0x212)+_0x4bc4bf[_0x3bef7b(0x238)]),console[_0x3bef7b(0x271)](_0x3bef7b(0x202)+a5_0x5e5441[_0x3bef7b(0x245)](_0xebe026)),console[_0x3bef7b(0x271)](_0x3bef7b(0x275)+a5_0x5e5441[_0x3bef7b(0x216)](_0x55b4f8));_0xee60da>0x0&&console['log']('Errors:\x20\x20\x20'+a5_0x5e5441[_0x3bef7b(0x216)](_0xee60da));console[_0x3bef7b(0x271)](_0x3bef7b(0x24d)+formatElapsed(_0x42895f)),console[_0x3bef7b(0x271)]('━'[_0x3bef7b(0x200)](0x3c));const _0x56ba47={'summary':{'total':_0x4bc4bf[_0x3bef7b(0x238)],'passed':_0xebe026,'failed':_0x55b4f8,'errors':_0xee60da>0x0?_0xee60da:undefined,'duration_ms':_0x42895f},'tests':_0x4bc4bf,'agent':{'project':_0x5bb7ac[_0x3bef7b(0x25b)],'name':_0x5bb7ac['agentName'],'site':_0x3b4b25},'timestamp':new Date(_0x52ba9a)[_0x3bef7b(0x253)]()};if(_0x376d6a!==_0x3bef7b(0x1ec)||_0x19711f){const _0x410f2e=formatResults(_0x56ba47,_0x376d6a);if(_0x19711f)try{a5_0x2f1d8d['writeFileSync'](_0x19711f,_0x410f2e,_0x3bef7b(0x24a)),console[_0x3bef7b(0x271)](),console[_0x3bef7b(0x271)](a5_0x5e5441[_0x3bef7b(0x204)](_0x3bef7b(0x258)+_0x19711f));}catch(_0x2d660e){return console[_0x3bef7b(0x271)](),console[_0x3bef7b(0x271)](a5_0x5e5441[_0x3bef7b(0x216)]('Error\x20writing\x20output\x20file:\x20'+_0x2d660e)),0x1;}else console[_0x3bef7b(0x271)](),console[_0x3bef7b(0x271)](_0x410f2e);}const _0x34979f=_0x4bc4bf[_0x3bef7b(0x20d)](_0x187509=>_0x187509[_0x3bef7b(0x20e)]!==_0x3bef7b(0x1f3));return _0x34979f[_0x3bef7b(0x238)]>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0x5e3838=a5_0x1b8f;(function(_0x3ae7d0,_0x44d0a8){const _0x1a731c=a5_0x1b8f,_0x5d995b=_0x3ae7d0();while(!![]){try{const _0x5ae39d=parseInt(_0x1a731c(0x161))/0x1+-parseInt(_0x1a731c(0x17f))/0x2*(-parseInt(_0x1a731c(0x13a))/0x3)+parseInt(_0x1a731c(0x11b))/0x4+parseInt(_0x1a731c(0x124))/0x5+-parseInt(_0x1a731c(0x17b))/0x6+parseInt(_0x1a731c(0x16d))/0x7*(parseInt(_0x1a731c(0x1a8))/0x8)+-parseInt(_0x1a731c(0x1aa))/0x9*(parseInt(_0x1a731c(0x163))/0xa);if(_0x5ae39d===_0x44d0a8)break;else _0x5d995b['push'](_0x5d995b['shift']());}catch(_0x149d06){_0x5d995b['push'](_0x5d995b['shift']());}}}(a5_0x300c,0x2a434));function a5_0x1b8f(_0x48c9ca,_0x366f5b){_0x48c9ca=_0x48c9ca-0x118;const _0x300cea=a5_0x300c();let _0x1b8fe2=_0x300cea[_0x48c9ca];return _0x1b8fe2;}function a5_0x300c(){const _0xe054d4=['isSpinning','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','ERROR','log','dim','120964BcILWs','Failed\x20Tests:','5464090vNxJdL','tags','✓\x20PASS:\x20','Conversation\x20URL:\x20','\x20\x20Agent:\x20','Either\x20switch\x20to\x20the\x20\x22','includes','\x22,\x20but\x20current\x20site\x20is\x20\x22','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','projectDir','96929cFIrrY','Duration:\x20','length','Failed:\x20\x20\x20','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','toLowerCase','agent:test','resolveProjectId','trim','red','Total:\x20\x20\x20\x20','Errors:\x20\x20\x20','verbose','/<agent-name>','329514glxFzs','Cached\x20run\x20from:\x20','Run\x20tests\x20for\x20an\x20LLM\x20agent','Available\x20tags:\x20','238EmYZCo','join','Agent:\x20','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','forEach','\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)','resolve','cyan','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','\x20\x20Project:\x20','has','text','Using\x20agent:\x20','substring','Evaluating\x20response...','\x20\x20-\x20','stop','llmProject','\x20-\x20','rounds','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','map','Round\x201/','start','Output\x20written\x20to:\x20','push','New\x20tests\x20to\x20execute:\x20','yellow','resolveAgentId','\x20\x20Conversation:\x20','tests','\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path','conversation_url','green','\x27\x20to\x20create\x20the\x20folder\x20structure.','message','Passed:\x20\x20\x20','size','✗\x20ERROR:\x20Project\x20not\x20found:\x20','Re-evaluating\x20cached\x20test\x20run...','Test\x20Configuration:','88zuaqzE','no_local_folder','9mxVvMk','agentDirs','FAIL','Test\x20','dryRun','404','\x20(cached)','split','white','✗\x20ERROR:\x20','json','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','1057592KEVnfG','...','no_tests',':\x20Sending\x20user\x20input...','Re-evaluation\x20Summary','reason','now','Tests\x20found:\x20','llm','382915MRXmUk','agent','filter','PASS','add','\x20\x20Round\x20','conversations','basename','...\x20','repeat','Running\x20test:\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','testName','status','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','projectName','✗\x20FAIL:\x20','Available\x20tests:\x20','eval','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','Site:\x20','agentName','4038AsvUpi','\x20(new)','writeFileSync','description','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','\x22:\x20','source','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','not\x20found','testYmlPath','Executing\x20new\x20tests...','jsonl','\x20\x20Evaluating...\x20','site','reeval','executeReeval','test.yml','toISOString','no_context','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','name','table','Re-evaluating\x20','Running\x20agent\x20tests...','No\x20tests\x20found\x20matching:\x20','Round\x20','Error\x20writing\x20output\x20file:\x20','existsSync','execute','⚠\x20SKIPPED:\x20','utf-8'];a5_0x300c=function(){return _0xe054d4;};return a5_0x300c();}import*as a5_0xf8c4fe from'node:fs';import*as a5_0x36c225 from'node:path';import a5_0x66c22 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{['name']=a5_0x5e3838(0x173);[a5_0x5e3838(0x13d)]=a5_0x5e3838(0x17d);async[a5_0x5e3838(0x159)](_0x3dda81){const _0x409c9e=a5_0x5e3838,{options:_0x25a204,args:_0x504f10,tdx:_0x59d475}=_0x3dda81,_0x3be38b=_0x504f10[0x0]||'.',_0x1eb081=_0x25a204[_0x409c9e(0x1ae)],_0x2a22d9=_0x25a204,_0x10b82f=_0x2a22d9[_0x409c9e(0x136)]===![],_0x5a3104=_0x2a22d9[_0x409c9e(0x14b)],_0x51d1ad=_0x2a22d9[_0x409c9e(0x151)],_0x4f97e1=_0x2a22d9['tags'],_0x1608a2=_0x25a204[_0x409c9e(0x14a)],_0xf734f8=_0x2a22d9['output'];if(_0x5a3104&&_0x10b82f)return console[_0x409c9e(0x15f)](a5_0x66c22[_0x409c9e(0x176)](_0x409c9e(0x141))),0x1;let _0xa9c73d=_0x409c9e(0x152);if(_0x2a22d9[_0x409c9e(0x119)])_0xa9c73d=_0x409c9e(0x119);else{if(_0x2a22d9[_0x409c9e(0x148)])_0xa9c73d=_0x409c9e(0x148);else{if(_0x2a22d9['tsv'])_0xa9c73d='tsv';else{if(_0x2a22d9[_0x409c9e(0x152)])_0xa9c73d=_0x409c9e(0x152);}}}const _0x407f41=_0x2a22d9['llmProject'];let _0x393b2d=_0x3be38b;const _0x3cde9e=a5_0xf8c4fe[_0x409c9e(0x158)](_0x3be38b),_0x2fa452=_0x3be38b==='.';if(!_0x3cde9e||_0x2fa452){const _0xb2dba1=resolveProjectFromContext(_0x3be38b,_0x407f41,{'requireFile':_0x409c9e(0x14d)});if(_0xb2dba1['found'])_0x393b2d=_0xb2dba1[_0x409c9e(0x16c)],_0xb2dba1[_0x409c9e(0x143)]==='context'&&console[_0x409c9e(0x15f)](a5_0x66c22[_0x409c9e(0x160)](_0x409c9e(0x18b)+_0x393b2d));else switch(_0xb2dba1[_0x409c9e(0x120)]){case _0x409c9e(0x14f):console[_0x409c9e(0x15f)](a5_0x66c22[_0x409c9e(0x19a)](_0xb2dba1[_0x409c9e(0x1a2)])),console[_0x409c9e(0x15f)](),console[_0x409c9e(0x15f)]('Usage:'),console[_0x409c9e(0x15f)](_0x409c9e(0x19e)),console[_0x409c9e(0x15f)](_0x409c9e(0x184)),console[_0x409c9e(0x15f)](),console[_0x409c9e(0x15f)](_0x409c9e(0x15d));return 0x1;case _0x409c9e(0x1a9):console[_0x409c9e(0x15f)](a5_0x66c22[_0x409c9e(0x19a)](_0xb2dba1[_0x409c9e(0x1a2)])),console[_0x409c9e(0x15f)](),console['log']('Run\x20\x27tdx\x20agent\x20pull\x20'+_0xb2dba1[_0x409c9e(0x190)]+_0x409c9e(0x1a1));return 0x1;case'multiple_agents':{const _0x31bd5e=a5_0x36c225[_0x409c9e(0x12b)](_0xb2dba1[_0x409c9e(0x16c)]);console[_0x409c9e(0x15f)](a5_0x66c22[_0x409c9e(0x19a)](_0x409c9e(0x11a)+_0xb2dba1[_0x409c9e(0x190)]+'\x22:'));for(const _0x1bcc10 of _0xb2dba1[_0x409c9e(0x1ab)]){console[_0x409c9e(0x15f)](_0x409c9e(0x18e)+_0x1bcc10);}return console[_0x409c9e(0x15f)](),console[_0x409c9e(0x15f)](_0x409c9e(0x13f)+_0x31bd5e+_0x409c9e(0x17a)),0x1;}case _0x409c9e(0x11d):console[_0x409c9e(0x15f)](a5_0x66c22[_0x409c9e(0x19a)](_0x409c9e(0x182)+_0xb2dba1[_0x409c9e(0x190)]+'\x22.')),console['log'](a5_0x66c22[_0x409c9e(0x160)]('Project\x20path:\x20'+_0xb2dba1[_0x409c9e(0x16c)])),console[_0x409c9e(0x15f)](),console[_0x409c9e(0x15f)](_0x409c9e(0x187));return 0x1;}}const {definition:_0x1eeed5,agentInfo:_0x32e23e}=parseTestFile(_0x393b2d);let _0x1ea555=_0x1eeed5[_0x409c9e(0x19d)];if(_0x51d1ad){const _0x56318c=_0x51d1ad[_0x409c9e(0x1b1)](',')[_0x409c9e(0x194)](_0x39e102=>_0x39e102['trim']());_0x1ea555=_0x1eeed5[_0x409c9e(0x19d)][_0x409c9e(0x126)](_0x5ddc91=>_0x56318c[_0x409c9e(0x169)](_0x5ddc91[_0x409c9e(0x151)]));if(_0x1ea555['length']===0x0)return console['log'](a5_0x66c22[_0x409c9e(0x19a)](_0x409c9e(0x155)+_0x51d1ad)),console['log'](a5_0x66c22[_0x409c9e(0x160)](_0x409c9e(0x135)+_0x1eeed5[_0x409c9e(0x19d)]['map'](_0x3b16ec=>_0x3b16ec[_0x409c9e(0x151)])[_0x409c9e(0x180)](',\x20'))),0x1;}if(_0x4f97e1){const _0x5cce6e=_0x4f97e1[_0x409c9e(0x1b1)](',')[_0x409c9e(0x194)](_0x57f4b9=>_0x57f4b9[_0x409c9e(0x175)]()[_0x409c9e(0x172)]());_0x1ea555=_0x1ea555[_0x409c9e(0x126)](_0x545721=>_0x545721[_0x409c9e(0x164)]?.['some'](_0x908218=>_0x5cce6e[_0x409c9e(0x169)](_0x908218[_0x409c9e(0x172)]())));if(_0x1ea555['length']===0x0){console[_0x409c9e(0x15f)](a5_0x66c22['yellow']('No\x20tests\x20found\x20with\x20tags:\x20'+_0x4f97e1));const _0x53abfe=new Set();return _0x1eeed5[_0x409c9e(0x19d)][_0x409c9e(0x183)](_0xc358f1=>_0xc358f1[_0x409c9e(0x164)]?.[_0x409c9e(0x183)](_0x200d58=>_0x53abfe[_0x409c9e(0x128)](_0x200d58))),_0x53abfe[_0x409c9e(0x1a4)]>0x0?console[_0x409c9e(0x15f)](a5_0x66c22['dim'](_0x409c9e(0x17e)+[..._0x53abfe][_0x409c9e(0x180)](',\x20'))):console[_0x409c9e(0x15f)](a5_0x66c22['dim']('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0x5a3104)return this[_0x409c9e(0x14c)](_0x3dda81,{'definition':{'tests':_0x1ea555},'agentInfo':_0x32e23e,'outputFormat':_0xa9c73d,'outputFile':_0xf734f8,'testNames':_0x51d1ad});if(_0x1eb081){console['log'](a5_0x66c22['cyan'](_0x409c9e(0x1a7))),console[_0x409c9e(0x15f)]('\x20\x20Site:\x20'+a5_0x66c22[_0x409c9e(0x1b2)](_0x1608a2)),console['log'](_0x409c9e(0x188)+a5_0x66c22[_0x409c9e(0x1b2)](_0x32e23e[_0x409c9e(0x133)])),console[_0x409c9e(0x15f)](_0x409c9e(0x167)+a5_0x66c22[_0x409c9e(0x1b2)](_0x32e23e[_0x409c9e(0x139)])),console[_0x409c9e(0x15f)](),console[_0x409c9e(0x15f)](_0x409c9e(0x122)+a5_0x66c22[_0x409c9e(0x1b2)](_0x1ea555[_0x409c9e(0x16f)]));for(let _0x47aa05=0x0;_0x47aa05<_0x1ea555[_0x409c9e(0x16f)];_0x47aa05++){const _0x2c1320=_0x1ea555[_0x47aa05],_0x1da851=_0x2c1320[_0x409c9e(0x192)][_0x409c9e(0x16f)]===0x1?'round':'rounds',_0xa01d47=_0x2c1320[_0x409c9e(0x164)]?.['length']?'\x20['+_0x2c1320[_0x409c9e(0x164)][_0x409c9e(0x180)](',\x20')+']':'';console[_0x409c9e(0x15f)]('\x20\x20'+(_0x47aa05+0x1)+'.\x20'+a5_0x66c22[_0x409c9e(0x1b2)](_0x2c1320[_0x409c9e(0x151)])+'\x20('+_0x2c1320[_0x409c9e(0x192)][_0x409c9e(0x16f)]+'\x20'+_0x1da851+')'+a5_0x66c22[_0x409c9e(0x160)](_0xa01d47));}return 0x0;}let _0x3a5266,_0x321383;try{_0x3a5266=await _0x59d475[_0x409c9e(0x123)][_0x409c9e(0x174)](_0x32e23e[_0x409c9e(0x133)]);}catch(_0x301230){const _0x41433c=_0x301230 instanceof Error?_0x301230[_0x409c9e(0x1a2)]:String(_0x301230);return _0x41433c['includes'](_0x409c9e(0x1af))||_0x41433c[_0x409c9e(0x172)]()['includes'](_0x409c9e(0x145))?console[_0x409c9e(0x15f)](a5_0x66c22['red'](_0x409c9e(0x1a5)+_0x32e23e[_0x409c9e(0x133)])):console[_0x409c9e(0x15f)](a5_0x66c22[_0x409c9e(0x176)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0x32e23e[_0x409c9e(0x133)]+_0x409c9e(0x142)+_0x41433c)),0x1;}try{_0x321383=await _0x59d475['llm'][_0x409c9e(0x19b)](_0x32e23e[_0x409c9e(0x139)],_0x3a5266);}catch(_0x182284){const _0x5dc7ad=_0x182284 instanceof Error?_0x182284['message']:String(_0x182284);return _0x5dc7ad['includes'](_0x409c9e(0x1af))||_0x5dc7ad['toLowerCase']()['includes'](_0x409c9e(0x145))?console[_0x409c9e(0x15f)](a5_0x66c22[_0x409c9e(0x176)](_0x409c9e(0x132)+_0x32e23e[_0x409c9e(0x139)])):console[_0x409c9e(0x15f)](a5_0x66c22[_0x409c9e(0x176)](_0x409c9e(0x193)+_0x32e23e[_0x409c9e(0x139)]+_0x409c9e(0x142)+_0x5dc7ad)),0x1;}let _0x5302c1;if(!_0x10b82f)try{_0x5302c1=await setupEvaluatorAgent(_0x59d475[_0x409c9e(0x123)],_0x25a204[_0x409c9e(0x179)]);}catch(_0x2f5be8){const _0x15dc2a=_0x2f5be8 instanceof Error?_0x2f5be8[_0x409c9e(0x1a2)]:String(_0x2f5be8);return console[_0x409c9e(0x15f)](a5_0x66c22[_0x409c9e(0x176)](_0x409c9e(0x137)+_0x15dc2a)),0x1;}console[_0x409c9e(0x15f)](a5_0x66c22[_0x409c9e(0x186)](_0x409c9e(0x154))),console['log'](_0x409c9e(0x138)+a5_0x66c22[_0x409c9e(0x1b2)](_0x1608a2)),console[_0x409c9e(0x15f)](_0x409c9e(0x181)+a5_0x66c22[_0x409c9e(0x1b2)](_0x32e23e[_0x409c9e(0x133)]+'/'+_0x32e23e[_0x409c9e(0x139)])),console[_0x409c9e(0x15f)]();const _0x3052cf=[],_0x942ac1=[],_0x1156dc=Date[_0x409c9e(0x121)]();for(let _0x480940=0x0;_0x480940<_0x1ea555[_0x409c9e(0x16f)];_0x480940++){const _0x5d9757=_0x1ea555[_0x480940];_0x1ea555[_0x409c9e(0x16f)]>0x1?console[_0x409c9e(0x15f)](_0x409c9e(0x1ad)+(_0x480940+0x1)+'/'+_0x1ea555[_0x409c9e(0x16f)]+':\x20'+a5_0x66c22[_0x409c9e(0x1b2)](_0x5d9757[_0x409c9e(0x151)])):console[_0x409c9e(0x15f)](_0x409c9e(0x12e)+a5_0x66c22['white'](_0x5d9757['name']));const _0x554243=createCommandSpinner(_0x409c9e(0x195)+_0x5d9757[_0x409c9e(0x192)][_0x409c9e(0x16f)]+':\x20Sending\x20user\x20input...');_0x554243[_0x409c9e(0x196)]();try{const {result:_0x4d9688,conversation:_0x41b399}=await runTest(_0x59d475[_0x409c9e(0x123)],_0x5d9757,{'agentId':_0x321383,'projectId':_0x3a5266,'site':_0x1608a2,'noEval':_0x10b82f,'evaluatorId':_0x5302c1,'onRoundStart':(_0x570aec,_0x3f43d0)=>{const _0x16183e=_0x409c9e;_0x554243[_0x16183e(0x18a)]=_0x16183e(0x156)+(_0x570aec+0x1)+'/'+_0x3f43d0+_0x16183e(0x11e);},'onRoundComplete':(_0x40bc0f,_0x3dc2eb,_0x1112a0)=>{const _0x401778=_0x409c9e,_0x2a773f=formatElapsed(_0x3dc2eb);_0x1112a0?console[_0x401778(0x15f)]('\x20\x20Round\x20'+(_0x40bc0f+0x1)+'/'+_0x5d9757['rounds'][_0x401778(0x16f)]+_0x401778(0x12c)+a5_0x66c22[_0x401778(0x1a0)]('✓')+'\x20('+_0x2a773f+')'):console[_0x401778(0x15f)](_0x401778(0x129)+(_0x40bc0f+0x1)+'/'+_0x5d9757[_0x401778(0x192)][_0x401778(0x16f)]+_0x401778(0x12c)+a5_0x66c22[_0x401778(0x176)]('✗'));},'onEvaluationStart':()=>{const _0x22e4dc=_0x409c9e;_0x554243[_0x22e4dc(0x18a)]=_0x22e4dc(0x18d);},'onEvaluationComplete':_0x4dac35=>{const _0xd7815=_0x409c9e,_0x6d000c=formatElapsed(_0x4dac35);console[_0xd7815(0x15f)](_0xd7815(0x149)+a5_0x66c22[_0xd7815(0x1a0)]('✓')+'\x20('+_0x6d000c+')');}});_0x554243['stop'](),_0x3052cf[_0x409c9e(0x198)](_0x4d9688),_0x942ac1['push'](_0x41b399);if(_0x4d9688[_0x409c9e(0x131)]===_0x409c9e(0x127))console['log'](a5_0x66c22[_0x409c9e(0x1a0)]('✓\x20PASS:\x20'+_0x4d9688[_0x409c9e(0x120)]));else _0x4d9688[_0x409c9e(0x131)]==='FAIL'?console[_0x409c9e(0x15f)](a5_0x66c22[_0x409c9e(0x176)]('✗\x20FAIL:\x20'+_0x4d9688[_0x409c9e(0x120)])):console[_0x409c9e(0x15f)](a5_0x66c22['red']('✗\x20ERROR:\x20'+_0x4d9688[_0x409c9e(0x120)]));_0x4d9688[_0x409c9e(0x19f)]&&console[_0x409c9e(0x15f)](a5_0x66c22[_0x409c9e(0x160)](_0x409c9e(0x166)+_0x4d9688[_0x409c9e(0x19f)])),console[_0x409c9e(0x15f)]();}catch(_0x48af37){_0x554243['stop']();const _0x2614a5=_0x48af37 instanceof Error?_0x48af37[_0x409c9e(0x1a2)]:String(_0x48af37);console[_0x409c9e(0x15f)](a5_0x66c22[_0x409c9e(0x176)](_0x409c9e(0x118)+_0x2614a5)),console[_0x409c9e(0x15f)](),_0x3052cf[_0x409c9e(0x198)]({'name':_0x5d9757[_0x409c9e(0x151)],'status':_0x409c9e(0x15e),'reason':_0x2614a5,'timestamp':new Date()[_0x409c9e(0x14e)](),'duration_ms':0x0});}}const _0x51fba2=Date[_0x409c9e(0x121)]()-_0x1156dc,_0x271e4c=_0x3052cf[_0x409c9e(0x126)](_0x2d6ce7=>_0x2d6ce7[_0x409c9e(0x131)]===_0x409c9e(0x127))['length'],_0x285f78=_0x3052cf['filter'](_0x136992=>_0x136992['status']===_0x409c9e(0x1ac))[_0x409c9e(0x16f)],_0x30bae3=_0x3052cf[_0x409c9e(0x126)](_0x1f7926=>_0x1f7926[_0x409c9e(0x131)]==='ERROR')[_0x409c9e(0x16f)];console['log']('━'[_0x409c9e(0x12d)](0x3c)),console[_0x409c9e(0x15f)]('Test\x20Summary'),console[_0x409c9e(0x15f)]('━'[_0x409c9e(0x12d)](0x3c)),console['log'](_0x409c9e(0x177)+_0x3052cf['length']),console[_0x409c9e(0x15f)](_0x409c9e(0x1a3)+a5_0x66c22[_0x409c9e(0x1a0)](_0x271e4c)),console['log'](_0x409c9e(0x170)+a5_0x66c22[_0x409c9e(0x176)](_0x285f78));_0x30bae3>0x0&&console['log'](_0x409c9e(0x178)+a5_0x66c22[_0x409c9e(0x176)](_0x30bae3));console[_0x409c9e(0x15f)]('Duration:\x20'+formatElapsed(_0x51fba2)),console[_0x409c9e(0x15f)]('━'[_0x409c9e(0x12d)](0x3c));const _0x471f00=_0x3052cf['filter'](_0x22199f=>_0x22199f[_0x409c9e(0x131)]!==_0x409c9e(0x127));if(_0x471f00[_0x409c9e(0x16f)]>0x0){console[_0x409c9e(0x15f)](),console[_0x409c9e(0x15f)](_0x409c9e(0x162));for(const _0x5ccc58 of _0x471f00){const _0x944ff8=a5_0x66c22['red']('✗'),_0xd8e797=_0x5ccc58[_0x409c9e(0x120)]['length']>0x32?_0x5ccc58[_0x409c9e(0x120)][_0x409c9e(0x18c)](0x0,0x32)+_0x409c9e(0x11c):_0x5ccc58[_0x409c9e(0x120)];console['log']('\x20\x20'+_0x944ff8+'\x20'+_0x5ccc58['name']+':\x20'+_0xd8e797);}}const _0x5c89e1={'summary':{'total':_0x3052cf[_0x409c9e(0x16f)],'passed':_0x271e4c,'failed':_0x285f78,'errors':_0x30bae3>0x0?_0x30bae3:undefined,'duration_ms':_0x51fba2},'tests':_0x3052cf,'agent':{'project':_0x32e23e[_0x409c9e(0x133)],'name':_0x32e23e[_0x409c9e(0x139)],'site':_0x1608a2},'timestamp':new Date(_0x1156dc)['toISOString']()};try{const _0x487357=buildCachedTestRun(_0x942ac1,{'site':_0x1608a2,'projectId':_0x3a5266,'projectName':_0x32e23e['projectName'],'agentId':_0x321383,'agentName':_0x32e23e['agentName'],'testYmlPath':a5_0x36c225[_0x409c9e(0x185)](_0x32e23e[_0x409c9e(0x146)])});saveLastTestRun(_0x487357);}catch{}if(_0xa9c73d!=='table'||_0xf734f8){const _0x25975a=formatResults(_0x5c89e1,_0xa9c73d);if(_0xf734f8)try{a5_0xf8c4fe[_0x409c9e(0x13c)](_0xf734f8,_0x25975a,_0x409c9e(0x15b)),console[_0x409c9e(0x15f)](),console[_0x409c9e(0x15f)](a5_0x66c22[_0x409c9e(0x160)]('Output\x20written\x20to:\x20'+_0xf734f8));}catch(_0x372bc2){return console[_0x409c9e(0x15f)](),console[_0x409c9e(0x15f)](a5_0x66c22[_0x409c9e(0x176)](_0x409c9e(0x157)+_0x372bc2)),0x1;}else console[_0x409c9e(0x15f)](),console['log'](_0x25975a);}return _0x471f00[_0x409c9e(0x16f)]>0x0?0x1:0x0;}async[a5_0x5e3838(0x14c)](_0x5b096f,_0x44926c){const _0x3f971d=a5_0x5e3838,{options:_0x561020,tdx:_0x15ba28}=_0x5b096f,{definition:_0x3c80dc,agentInfo:_0x55a0f8,outputFormat:_0x1ad437,outputFile:_0x36a234}=_0x44926c,_0x16715a=_0x561020[_0x3f971d(0x14a)],_0x41f35d=loadLastTestRun();if(!_0x41f35d)return console['log'](a5_0x66c22[_0x3f971d(0x176)]('Error:\x20No\x20previous\x20test\x20run\x20found.')),console[_0x3f971d(0x15f)](a5_0x66c22[_0x3f971d(0x160)](_0x3f971d(0x16b))),0x1;if(_0x41f35d['agent'][_0x3f971d(0x139)]!==_0x55a0f8[_0x3f971d(0x139)])return console[_0x3f971d(0x15f)](a5_0x66c22['red'](_0x3f971d(0x171)+_0x41f35d[_0x3f971d(0x125)]['agentName']+_0x3f971d(0x150)+_0x55a0f8[_0x3f971d(0x139)]+'\x22.')),console['log'](a5_0x66c22['dim'](_0x3f971d(0x13e))),0x1;const _0x44049f=new Set(_0x41f35d[_0x3f971d(0x12a)][_0x3f971d(0x194)](_0x31c914=>_0x31c914[_0x3f971d(0x130)])),_0x53410e=_0x3c80dc[_0x3f971d(0x19d)][_0x3f971d(0x126)](_0x594f86=>!_0x44049f['has'](_0x594f86['name']));if(_0x53410e[_0x3f971d(0x16f)]>0x0&&_0x41f35d['site']!==_0x16715a)return console[_0x3f971d(0x15f)](a5_0x66c22['red'](_0x3f971d(0x144))),console[_0x3f971d(0x15f)](a5_0x66c22[_0x3f971d(0x160)]('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x41f35d[_0x3f971d(0x14a)]+_0x3f971d(0x16a)+_0x16715a+'\x22.')),console[_0x3f971d(0x15f)](a5_0x66c22['dim'](_0x3f971d(0x168)+_0x41f35d['site']+_0x3f971d(0x12f))),0x1;const _0x836db3=_0x3c80dc[_0x3f971d(0x19d)][_0x3f971d(0x126)](_0x45304e=>_0x44049f[_0x3f971d(0x189)](_0x45304e[_0x3f971d(0x151)])),_0x17eb78=_0x53410e;let _0x999c35;try{_0x999c35=await setupEvaluatorAgent(_0x15ba28[_0x3f971d(0x123)],_0x561020[_0x3f971d(0x179)]);}catch(_0x8d87f7){const _0x4faf3a=_0x8d87f7 instanceof Error?_0x8d87f7['message']:String(_0x8d87f7);return console[_0x3f971d(0x15f)](a5_0x66c22['red'](_0x3f971d(0x137)+_0x4faf3a)),0x1;}console[_0x3f971d(0x15f)](a5_0x66c22['cyan'](_0x3f971d(0x1a6))),console[_0x3f971d(0x15f)](_0x3f971d(0x17c)+a5_0x66c22[_0x3f971d(0x1b2)](_0x41f35d['timestamp'])),console[_0x3f971d(0x15f)]('Agent:\x20'+a5_0x66c22[_0x3f971d(0x1b2)](_0x41f35d[_0x3f971d(0x125)]['projectName']+'/'+_0x41f35d[_0x3f971d(0x125)]['agentName']));_0x17eb78[_0x3f971d(0x16f)]>0x0&&console[_0x3f971d(0x15f)](_0x3f971d(0x199)+a5_0x66c22['yellow'](_0x17eb78['length']));console[_0x3f971d(0x15f)]();const _0x294f60=[],_0x3daf00=Date[_0x3f971d(0x121)](),_0x5548b0=createCommandSpinner('Re-evaluating...');if(_0x836db3[_0x3f971d(0x16f)]>0x0)try{const _0xa9c120=await reevaluateFromCache(_0x15ba28[_0x3f971d(0x123)],_0x41f35d,{'tests':_0x836db3},{'evaluatorId':_0x999c35,'onTestStart':(_0x4d395c,_0x658ff8,_0xb6778c)=>{const _0xd253e1=_0x3f971d;_0x5548b0['text']=_0xd253e1(0x153)+(_0x658ff8+0x1)+'/'+_0xb6778c+':\x20'+_0x4d395c+_0xd253e1(0x11c);if(!_0x5548b0[_0xd253e1(0x15c)])_0x5548b0[_0xd253e1(0x196)]();},'onTestComplete':(_0x7613b6,_0x5e178e)=>{const _0x26cab2=_0x3f971d;_0x5548b0[_0x26cab2(0x18f)]();if(_0x5e178e[_0x26cab2(0x131)]===_0x26cab2(0x127))console[_0x26cab2(0x15f)](a5_0x66c22[_0x26cab2(0x1a0)](_0x26cab2(0x165)+_0x7613b6)+a5_0x66c22['dim'](_0x26cab2(0x1b0)));else _0x5e178e[_0x26cab2(0x131)]==='FAIL'?console[_0x26cab2(0x15f)](a5_0x66c22[_0x26cab2(0x176)](_0x26cab2(0x134)+_0x7613b6+_0x26cab2(0x191)+_0x5e178e[_0x26cab2(0x120)])+a5_0x66c22[_0x26cab2(0x160)](_0x26cab2(0x1b0))):console[_0x26cab2(0x15f)](a5_0x66c22[_0x26cab2(0x176)](_0x26cab2(0x118)+_0x7613b6+_0x26cab2(0x191)+_0x5e178e[_0x26cab2(0x120)]));_0x5e178e[_0x26cab2(0x19f)]&&console[_0x26cab2(0x15f)](a5_0x66c22[_0x26cab2(0x160)](_0x26cab2(0x19c)+_0x5e178e[_0x26cab2(0x19f)])),_0x294f60[_0x26cab2(0x198)](_0x5e178e);},'onTestSkipped':(_0x2ee615,_0x3223c8)=>{const _0x10bfd3=_0x3f971d;_0x5548b0[_0x10bfd3(0x18f)](),console[_0x10bfd3(0x15f)](a5_0x66c22[_0x10bfd3(0x19a)](_0x10bfd3(0x15a)+_0x2ee615+_0x10bfd3(0x191)+_0x3223c8));}});for(const _0x276c9f of _0xa9c120){!_0x294f60['find'](_0x360008=>_0x360008[_0x3f971d(0x151)]===_0x276c9f[_0x3f971d(0x151)])&&_0x294f60[_0x3f971d(0x198)](_0x276c9f);}}catch(_0x477851){_0x5548b0[_0x3f971d(0x18f)]();const _0x575bf2=_0x477851 instanceof Error?_0x477851[_0x3f971d(0x1a2)]:String(_0x477851);return console[_0x3f971d(0x15f)](a5_0x66c22[_0x3f971d(0x176)](_0x3f971d(0x140)+_0x575bf2)),0x1;}_0x5548b0[_0x3f971d(0x18f)]();if(_0x17eb78[_0x3f971d(0x16f)]>0x0){console[_0x3f971d(0x15f)](),console['log'](a5_0x66c22[_0x3f971d(0x186)](_0x3f971d(0x147)));const {projectId:_0x1c3332,agentId:_0x317242}=_0x41f35d[_0x3f971d(0x125)];for(const _0x496466 of _0x17eb78){console[_0x3f971d(0x15f)]('Running:\x20'+a5_0x66c22[_0x3f971d(0x1b2)](_0x496466['name']));const _0x386de1=createCommandSpinner(_0x3f971d(0x195)+_0x496466[_0x3f971d(0x192)][_0x3f971d(0x16f)]+_0x3f971d(0x11e));_0x386de1[_0x3f971d(0x196)]();try{const {result:_0x3e1b34}=await runTest(_0x15ba28[_0x3f971d(0x123)],_0x496466,{'agentId':_0x317242,'projectId':_0x1c3332,'site':_0x41f35d[_0x3f971d(0x14a)],'noEval':![],'evaluatorId':_0x999c35,'onRoundStart':(_0x53e0c3,_0x2afec8)=>{const _0x1039c2=_0x3f971d;_0x386de1[_0x1039c2(0x18a)]=_0x1039c2(0x156)+(_0x53e0c3+0x1)+'/'+_0x2afec8+_0x1039c2(0x11e);},'onRoundComplete':(_0x2f0e7f,_0x2931e3,_0x4815d7)=>{const _0x3517d2=_0x3f971d,_0x38eb4d=formatElapsed(_0x2931e3);_0x4815d7?console[_0x3517d2(0x15f)]('\x20\x20Round\x20'+(_0x2f0e7f+0x1)+'/'+_0x496466['rounds']['length']+_0x3517d2(0x12c)+a5_0x66c22['green']('✓')+'\x20('+_0x38eb4d+')'):console[_0x3517d2(0x15f)](_0x3517d2(0x129)+(_0x2f0e7f+0x1)+'/'+_0x496466['rounds']['length']+_0x3517d2(0x12c)+a5_0x66c22['red']('✗'));},'onEvaluationStart':()=>{const _0x2f47ae=_0x3f971d;_0x386de1[_0x2f47ae(0x18a)]=_0x2f47ae(0x18d);},'onEvaluationComplete':_0x418290=>{const _0xf45bc0=_0x3f971d,_0x465168=formatElapsed(_0x418290);console[_0xf45bc0(0x15f)](_0xf45bc0(0x149)+a5_0x66c22[_0xf45bc0(0x1a0)]('✓')+'\x20('+_0x465168+')');}});_0x386de1[_0x3f971d(0x18f)](),_0x294f60['push'](_0x3e1b34);if(_0x3e1b34[_0x3f971d(0x131)]==='PASS')console[_0x3f971d(0x15f)](a5_0x66c22[_0x3f971d(0x1a0)](_0x3f971d(0x165)+_0x3e1b34[_0x3f971d(0x120)])+a5_0x66c22[_0x3f971d(0x160)](_0x3f971d(0x13b)));else _0x3e1b34['status']==='FAIL'?console['log'](a5_0x66c22[_0x3f971d(0x176)](_0x3f971d(0x134)+_0x3e1b34[_0x3f971d(0x120)])+a5_0x66c22[_0x3f971d(0x160)](_0x3f971d(0x13b))):console['log'](a5_0x66c22['red'](_0x3f971d(0x118)+_0x3e1b34[_0x3f971d(0x120)]));_0x3e1b34[_0x3f971d(0x19f)]&&console[_0x3f971d(0x15f)](a5_0x66c22[_0x3f971d(0x160)](_0x3f971d(0x19c)+_0x3e1b34[_0x3f971d(0x19f)]));}catch(_0xff8f0a){_0x386de1[_0x3f971d(0x18f)]();const _0x4af17b=_0xff8f0a instanceof Error?_0xff8f0a['message']:String(_0xff8f0a);console[_0x3f971d(0x15f)](a5_0x66c22[_0x3f971d(0x176)]('✗\x20ERROR:\x20'+_0x4af17b)),_0x294f60[_0x3f971d(0x198)]({'name':_0x496466[_0x3f971d(0x151)],'status':_0x3f971d(0x15e),'reason':_0x4af17b,'timestamp':new Date()[_0x3f971d(0x14e)](),'duration_ms':0x0});}}}console[_0x3f971d(0x15f)]();const _0x15948a=Date[_0x3f971d(0x121)]()-_0x3daf00,_0xa6f0b6=_0x294f60[_0x3f971d(0x126)](_0x280c01=>_0x280c01[_0x3f971d(0x131)]===_0x3f971d(0x127))[_0x3f971d(0x16f)],_0x33671d=_0x294f60[_0x3f971d(0x126)](_0xa3e599=>_0xa3e599[_0x3f971d(0x131)]===_0x3f971d(0x1ac))[_0x3f971d(0x16f)],_0x37bacf=_0x294f60[_0x3f971d(0x126)](_0x1a2724=>_0x1a2724[_0x3f971d(0x131)]==='ERROR')[_0x3f971d(0x16f)];console[_0x3f971d(0x15f)]('━'[_0x3f971d(0x12d)](0x3c)),console[_0x3f971d(0x15f)](_0x3f971d(0x11f)),console[_0x3f971d(0x15f)]('━'[_0x3f971d(0x12d)](0x3c)),console[_0x3f971d(0x15f)](_0x3f971d(0x177)+_0x294f60[_0x3f971d(0x16f)]),console[_0x3f971d(0x15f)](_0x3f971d(0x1a3)+a5_0x66c22['green'](_0xa6f0b6)),console[_0x3f971d(0x15f)](_0x3f971d(0x170)+a5_0x66c22[_0x3f971d(0x176)](_0x33671d));_0x37bacf>0x0&&console[_0x3f971d(0x15f)](_0x3f971d(0x178)+a5_0x66c22[_0x3f971d(0x176)](_0x37bacf));console['log'](_0x3f971d(0x16e)+formatElapsed(_0x15948a)),console[_0x3f971d(0x15f)]('━'[_0x3f971d(0x12d)](0x3c));const _0x2b695f={'summary':{'total':_0x294f60[_0x3f971d(0x16f)],'passed':_0xa6f0b6,'failed':_0x33671d,'errors':_0x37bacf>0x0?_0x37bacf:undefined,'duration_ms':_0x15948a},'tests':_0x294f60,'agent':{'project':_0x55a0f8['projectName'],'name':_0x55a0f8[_0x3f971d(0x139)],'site':_0x16715a},'timestamp':new Date(_0x3daf00)[_0x3f971d(0x14e)]()};if(_0x1ad437!==_0x3f971d(0x152)||_0x36a234){const _0x48b9cf=formatResults(_0x2b695f,_0x1ad437);if(_0x36a234)try{a5_0xf8c4fe[_0x3f971d(0x13c)](_0x36a234,_0x48b9cf,_0x3f971d(0x15b)),console[_0x3f971d(0x15f)](),console['log'](a5_0x66c22[_0x3f971d(0x160)](_0x3f971d(0x197)+_0x36a234));}catch(_0x29c30a){return console[_0x3f971d(0x15f)](),console[_0x3f971d(0x15f)](a5_0x66c22[_0x3f971d(0x176)](_0x3f971d(0x157)+_0x29c30a)),0x1;}else console[_0x3f971d(0x15f)](),console[_0x3f971d(0x15f)](_0x48b9cf);}const _0x2b4505=_0x294f60[_0x3f971d(0x126)](_0x1d797a=>_0x1d797a[_0x3f971d(0x131)]!=='PASS');return _0x2b4505['length']>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x18948b=a6_0x1f00;(function(_0x25f2fd,_0x1e2c83){const _0x117f8e=a6_0x1f00,_0x6e1660=_0x25f2fd();while(!![]){try{const _0x189d79=parseInt(_0x117f8e(0x15b))/0x1+-parseInt(_0x117f8e(0x164))/0x2*(-parseInt(_0x117f8e(0x16b))/0x3)+-parseInt(_0x117f8e(0x175))/0x4+-parseInt(_0x117f8e(0x144))/0x5*(parseInt(_0x117f8e(0x149))/0x6)+parseInt(_0x117f8e(0x145))/0x7+-parseInt(_0x117f8e(0x155))/0x8*(-parseInt(_0x117f8e(0x16e))/0x9)+parseInt(_0x117f8e(0x158))/0xa;if(_0x189d79===_0x1e2c83)break;else _0x6e1660['push'](_0x6e1660['shift']());}catch(_0x18a6c0){_0x6e1660['push'](_0x6e1660['shift']());}}}(a6_0x5517,0x39fca));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';function a6_0x5517(){const _0x15d90b=['headers','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','230970ZNCuOY','1566131JGcOhG','join','has','startsWith','18PGVzRy','type','.\x20Valid\x20methods:\x20','verbose','substring','set-cookie2','Results\x20saved\x20to\x20','toUpperCase','stack','color','description','<\x20HTTP/1.1\x20','8XWZIxT','data','method','2310340eUyGYi','\x0aStack\x20trace:\x0a','DELETE','168126wTAilw','file','Invalid\x20header\x20format:\x20\x22','trim','execute','validate','status','request','log','12wUgWmX','message','Error:\x20','readBodyFromFile','entries','isArray','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','42819cpETUw','api','Invalid\x20HTTP\x20method:\x20','1135458BDhdVN','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','proxy-authorization','x-trino-user','x-auth-token','trino','Endpoint\x20must\x20start\x20with\x20/:\x20','1834388QurzeF','error','output','POST','length','GET','Invalid\x20API\x20type:\x20','body','PUT','set-cookie','indexOf'];a6_0x5517=function(){return _0x15d90b;};return a6_0x5517();}import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';function a6_0x1f00(_0x42e9d3,_0x2a092d){_0x42e9d3=_0x42e9d3-0x141;const _0x5517ca=a6_0x5517();let _0x1f00c6=_0x5517ca[_0x42e9d3];return _0x1f00c6;}const SENSITIVE_HEADERS=new Set(['authorization',a6_0x18948b(0x170),'cookie',a6_0x18948b(0x17e),a6_0x18948b(0x14e),'x-xsrf-token',a6_0x18948b(0x172),a6_0x18948b(0x171)]);function isSensitiveHeader(_0x150391){const _0x1c0400=a6_0x18948b;return SENSITIVE_HEADERS[_0x1c0400(0x147)](_0x150391['toLowerCase']());}function parseHeader(_0x3a1d75){const _0x58a3c2=a6_0x18948b,_0x172232=_0x3a1d75[_0x58a3c2(0x141)](':');if(_0x172232===-0x1)throw new Error(_0x58a3c2(0x15d)+_0x3a1d75+'\x22.\x20'+'Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22');const _0x27ea1c=_0x3a1d75[_0x58a3c2(0x14d)](0x0,_0x172232)[_0x58a3c2(0x15e)](),_0x1b648f=_0x3a1d75['substring'](_0x172232+0x1)['trim']();if(!_0x27ea1c)throw new Error(_0x58a3c2(0x16f)+_0x3a1d75+'\x22');return[_0x27ea1c,_0x1b648f];}export class ApiCommand extends BaseCommand{['name']=a6_0x18948b(0x16c);[a6_0x18948b(0x153)]=a6_0x18948b(0x16a);[a6_0x18948b(0x160)](_0x301803){const _0xfdd7fa=a6_0x18948b,{args:_0x4a5880,options:_0x14a649}=_0x301803,_0x187d0a=_0x14a649;if(_0x4a5880[_0xfdd7fa(0x179)]===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x13285b=_0x4a5880[0x0];if(!_0x13285b[_0xfdd7fa(0x148)]('/'))return _0xfdd7fa(0x174)+_0x13285b;const _0x3f8e0e=_0x187d0a[_0xfdd7fa(0x156)],_0x2a4d15=_0x187d0a[_0xfdd7fa(0x15c)];if(_0x3f8e0e&&_0x2a4d15)return _0xfdd7fa(0x143);const _0x1e8da5=_0x187d0a[_0xfdd7fa(0x157)]||_0xfdd7fa(0x17a),_0x4cc56f=[_0xfdd7fa(0x17a),_0xfdd7fa(0x178),_0xfdd7fa(0x17d),_0xfdd7fa(0x15a),'PATCH'];if(!_0x4cc56f['includes'](_0x1e8da5[_0xfdd7fa(0x150)]()))return _0xfdd7fa(0x16d)+_0x1e8da5+_0xfdd7fa(0x14b)+_0x4cc56f[_0xfdd7fa(0x146)](',\x20');const _0x2db00b=_0x187d0a[_0xfdd7fa(0x14a)]||'td',_0x4fb2b3=['td','cdp','workflow',_0xfdd7fa(0x173),'llm','llm-proxy'];if(!_0x4fb2b3['includes'](_0x2db00b))return _0xfdd7fa(0x17b)+_0x2db00b+'.\x20Valid\x20types:\x20'+_0x4fb2b3[_0xfdd7fa(0x146)](',\x20');return undefined;}async[a6_0x18948b(0x15f)](_0x993ec6){const _0x203dbb=a6_0x18948b,{options:_0x8dce23,args:_0x23ba23,tdx:_0x4ff55d}=_0x993ec6,_0x51dd0a=_0x8dce23,_0x173fc6=_0x23ba23[0x0],_0x4909f7=(_0x51dd0a[_0x203dbb(0x157)]||_0x203dbb(0x17a))[_0x203dbb(0x150)](),_0x6f3277=_0x51dd0a['data'],_0xd2ae96=_0x51dd0a[_0x203dbb(0x15c)],_0x484b79=_0x51dd0a['header'],_0x56e6fc=_0x51dd0a[_0x203dbb(0x14a)]||'td';try{const _0x478882={};if(_0x484b79){const _0x4083e7=Array[_0x203dbb(0x169)](_0x484b79)?_0x484b79:[_0x484b79];for(const _0x49e893 of _0x4083e7){const [_0x1382d1,_0x4b96ab]=parseHeader(_0x49e893);_0x478882[_0x1382d1]=_0x4b96ab;}}let _0xf19fc1;if(_0x6f3277)_0xf19fc1=_0x6f3277;else{if(_0xd2ae96)try{_0xf19fc1=RawAPI[_0x203dbb(0x167)](_0xd2ae96);}catch(_0x5f0017){return console['error'](_0x203dbb(0x166)+(_0x5f0017 instanceof Error?_0x5f0017['message']:String(_0x5f0017))),0x1;}}const _0xa7e5eb={'method':_0x4909f7,'apiType':_0x56e6fc,'includeHeaders':_0x8dce23[_0x203dbb(0x14c)]};_0xf19fc1&&(_0xa7e5eb[_0x203dbb(0x17c)]=_0xf19fc1);Object['keys'](_0x478882)[_0x203dbb(0x179)]>0x0&&(_0xa7e5eb[_0x203dbb(0x142)]=_0x478882);if(_0x8dce23[_0x203dbb(0x14c)]){const _0x3a6635=resolveSite(_0x8dce23['site']),_0x272b6e=getEndpoint(_0x3a6635,_0x56e6fc),_0x54d176=''+_0x272b6e+_0x173fc6;console[_0x203dbb(0x176)]('>\x20'+_0x4909f7+'\x20'+_0x54d176);const _0x4aa1c9=getAuthHeaders(_0x3a6635),_0x2b2fa8={..._0x4aa1c9,..._0x478882};for(const [_0x42eda7,_0xe46765]of Object[_0x203dbb(0x168)](_0x2b2fa8)){!isSensitiveHeader(_0x42eda7)&&console[_0x203dbb(0x176)]('>\x20'+_0x42eda7+':\x20'+_0xe46765);}_0xf19fc1&&console[_0x203dbb(0x176)]('>'),console['error']('');}const _0x1e7a65=await _0x4ff55d[_0x203dbb(0x16c)][_0x203dbb(0x162)](_0x173fc6,_0xa7e5eb);if(_0x8dce23['verbose']&&_0x1e7a65[_0x203dbb(0x142)]){console['error'](_0x203dbb(0x154)+_0x1e7a65[_0x203dbb(0x161)]);for(const [_0x53b935,_0x4885b9]of Object[_0x203dbb(0x168)](_0x1e7a65[_0x203dbb(0x142)])){!isSensitiveHeader(_0x53b935)&&console[_0x203dbb(0x176)]('<\x20'+_0x53b935+':\x20'+_0x4885b9);}console[_0x203dbb(0x176)]('');}const _0x123bde=Boolean(_0x8dce23[_0x203dbb(0x177)]),_0x2eed6c={'color':_0x8dce23[_0x203dbb(0x152)],'noColor':_0x8dce23['noColor']||_0x123bde&&!_0x8dce23[_0x203dbb(0x152)]},_0x1a965b=colorizeJSON(_0x1e7a65[_0x203dbb(0x156)],_0x2eed6c);return _0x8dce23[_0x203dbb(0x177)]?(writeFileSync(_0x8dce23[_0x203dbb(0x177)],_0x1a965b),console[_0x203dbb(0x176)](_0x203dbb(0x14f)+_0x8dce23[_0x203dbb(0x177)])):console[_0x203dbb(0x163)](_0x1a965b),0x0;}catch(_0x337a75){return _0x337a75 instanceof Error?(console[_0x203dbb(0x176)](_0x203dbb(0x166)+_0x337a75[_0x203dbb(0x165)]),_0x8dce23['verbose']&&_0x337a75[_0x203dbb(0x151)]&&console[_0x203dbb(0x176)](_0x203dbb(0x159)+_0x337a75['stack'])):console[_0x203dbb(0x176)]('Error:\x20'+String(_0x337a75)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a7_0x8bf214=a7_0x1c82;(function(_0x5b64d6,_0x3554e0){const _0x586cea=a7_0x1c82,_0x535e09=_0x5b64d6();while(!![]){try{const _0x4c19c6=-parseInt(_0x586cea(0xc8))/0x1*(-parseInt(_0x586cea(0xac))/0x2)+-parseInt(_0x586cea(0xcd))/0x3*(-parseInt(_0x586cea(0xca))/0x4)+-parseInt(_0x586cea(0x95))/0x5*(-parseInt(_0x586cea(0xa8))/0x6)+-parseInt(_0x586cea(0x98))/0x7+-parseInt(_0x586cea(0xc2))/0x8*(-parseInt(_0x586cea(0xb9))/0x9)+parseInt(_0x586cea(0xa3))/0xa+-parseInt(_0x586cea(0xa6))/0xb;if(_0x4c19c6===_0x3554e0)break;else _0x535e09['push'](_0x535e09['shift']());}catch(_0x1e453b){_0x535e09['push'](_0x535e09['shift']());}}}(a7_0x5527,0xc6a68));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_0x4f2a1d 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_0xbba68e from'chalk';function a7_0x1c82(_0x3bbabf,_0x52729b){_0x3bbabf=_0x3bbabf-0x8e;const _0x552708=a7_0x5527();let _0x1c822e=_0x552708[_0x3bbabf];return _0x1c822e;}export class AuthSetupCommand extends BaseCommand{['name']=a7_0x8bf214(0xa2);[a7_0x8bf214(0xb7)]='Setup\x20API\x20key\x20authentication\x20interactively';async['execute'](_0x54f625){const _0xc552ab=a7_0x8bf214,{options:_0x2a5cf6}=_0x54f625,_0x1339e2=_0x2a5cf6[_0xc552ab(0xc7)];console['log'](a7_0xbba68e[_0xc552ab(0xd4)](_0xc552ab(0xab)));const _0x5b7bfe=_0x2a5cf6[_0xc552ab(0xd6)]||_0xc552ab(0x90),{choices:_0x21f23e,initialIndex:_0x426d0a}=buildSiteChoices(_0x5b7bfe),_0x4cd05c=_0x1339e2?'Select\x20your\x20Treasure\x20Data\x20site\x20(for\x20profile:\x20'+_0x1339e2+'):':'Select\x20your\x20Treasure\x20Data\x20site:',_0x484d06=await a7_0x4f2a1d({'type':_0xc552ab(0x99),'name':'site','message':_0x4cd05c,'choices':_0x21f23e,'initial':_0x426d0a});if(!_0x484d06[_0xc552ab(0xd6)])return console['log'](_0xc552ab(0xda)),0x1;let _0x47f9a6;if(_0x484d06[_0xc552ab(0xd6)]===_0xc552ab(0xa5)){const _0x57f4b9=await a7_0x4f2a1d({'type':_0xc552ab(0x91),'name':_0xc552ab(0xa1),'message':'Enter\x20site\x20name:','initial':_0xc552ab(0x90),'validate':_0x1fb271=>{const _0xde9b93=_0xc552ab;if(!_0x1fb271||!_0x1fb271[_0xde9b93(0x9b)]())return _0xde9b93(0xbb);if(!/^[a-z0-9-]+$/[_0xde9b93(0x9a)](_0x1fb271['trim']()))return _0xde9b93(0xbf);return!![];}});if(!_0x57f4b9['customSite'])return console['log']('\x0aSetup\x20cancelled'),0x1;_0x47f9a6=_0x57f4b9[_0xc552ab(0xa1)];}else _0x47f9a6=_0x484d06[_0xc552ab(0xd6)];const _0x3771d9=resolveSite(_0x47f9a6);console['log'](_0xc552ab(0xbd)+_0x3771d9),console['log'](_0xc552ab(0xc4)),console[_0xc552ab(0xa7)]('\x20\x20'+getConsoleUrl(_0x3771d9,_0xc552ab(0xd9)));const _0x1736e6=await a7_0x4f2a1d({'type':_0xc552ab(0x9c),'name':_0xc552ab(0xc0),'message':_0xc552ab(0xd7),'validate':_0x340fbe=>{const _0x193bf=_0xc552ab;if(!_0x340fbe||!_0x340fbe[_0x193bf(0x9b)]())return _0x193bf(0xcc);return!![];}});if(!_0x1736e6['apiKey'])return console['log']('\x0aSetup\x20cancelled'),0x1;const _0x177eaf=_0x1736e6['apiKey'];console[_0xc552ab(0xa7)]('Validating\x20API\x20key...');try{const _0x3c0a38=TDX[_0xc552ab(0xbe)]({'site':_0x3771d9,'apiKey':_0x177eaf[_0xc552ab(0x9b)](),'logLevel':_0x2a5cf6[_0xc552ab(0x8f)]??LogLevel[_0xc552ab(0xbc)]}),_0x5da152=await _0x3c0a38[_0xc552ab(0xc9)]['getUserInfo']();console['log'](_0xc552ab(0xc3)+_0x5da152[_0xc552ab(0xa9)]+')');const _0x5fe4cf=await isKeychainAvailable();_0x5fe4cf?(await saveAPIKeyAsync(_0x177eaf['trim'](),_0x3771d9,_0x1339e2),console['log'](_0xc552ab(0xc1)+(_0x1339e2?_0xc552ab(0x97)+_0x1339e2+')':''))):(console[_0xc552ab(0xaa)](a7_0xbba68e[_0xc552ab(0xc6)](_0xc552ab(0xb3))),console[_0xc552ab(0xaa)](a7_0xbba68e[_0xc552ab(0xc6)]('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0x1339e2){const _0x298fff={'site':_0x3771d9};saveProfileToUserConfig(_0x1339e2,_0x298fff),console[_0xc552ab(0xa7)]('✓\x20Profile\x20\x27'+_0x1339e2+_0xc552ab(0x92));}else saveDefaultSiteToUserConfig(_0x3771d9),console[_0xc552ab(0xa7)](_0xc552ab(0xce)+_0x3771d9);const _0x51d8fc=_0x1339e2?_0xc552ab(0x8e)+_0x1339e2:'';return console[_0xc552ab(0xa7)](),console[_0xc552ab(0xa7)](_0xc552ab(0x96)),console[_0xc552ab(0xa7)](_0xc552ab(0x94)+_0x51d8fc+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0xc552ab(0xa7)](_0xc552ab(0x94)+_0x51d8fc+_0xc552ab(0x9f)),0x0;}catch(_0x47cb4a){if(_0x47cb4a instanceof HTTPClientError&&_0x47cb4a[_0xc552ab(0xd8)]===0x191)return printAuthError(_0x47cb4a),0x1;return console[_0xc552ab(0xb0)](a7_0xbba68e[_0xc552ab(0xba)](_0xc552ab(0xa0)+(_0x47cb4a instanceof Error?_0x47cb4a[_0xc552ab(0xad)]:String(_0x47cb4a)))),console[_0xc552ab(0xb0)](_0xc552ab(0xb4)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x8bf214(0xd0)]=a7_0x8bf214(0xb8);[a7_0x8bf214(0xb7)]=a7_0x8bf214(0xb2);async[a7_0x8bf214(0xcb)](_0x49b9b7){const _0xd09dbc=a7_0x8bf214,{options:_0x122c4c,tdx:_0x670ceb}=_0x49b9b7,_0x4c6b9d=_0x122c4c[_0xd09dbc(0xd6)],_0x5175fd=_0x122c4c[_0xd09dbc(0xc7)],_0x192389=_0x5175fd?_0x5175fd:'N/A';console[_0xd09dbc(0xa7)](_0xd09dbc(0xd2)+_0x192389+_0xd09dbc(0x93)+_0x4c6b9d+')');const _0x253eea=await resolveAPIKeyAsync(_0x4c6b9d,_0x5175fd);if(_0x253eea){const {source:_0x148767,isDeprecated:_0x94d94c}=_0x253eea,_0x53fbdb=_0xd09dbc(0xa4)+_0x148767;console['log'](_0x94d94c?a7_0xbba68e[_0xd09dbc(0xc6)](_0x53fbdb):_0x53fbdb);}else console[_0xd09dbc(0xa7)](a7_0xbba68e['yellow'](_0xd09dbc(0xb6)));try{const _0x57a7ec=await _0x670ceb['jobs'][_0xd09dbc(0xd3)]();return console[_0xd09dbc(0xa7)](a7_0xbba68e[_0xd09dbc(0x9d)]('✓\x20Authentication\x20successful\x0a')),console[_0xd09dbc(0xa7)](_0xd09dbc(0xae)+_0x57a7ec['email']),(_0x57a7ec['first_name']||_0x57a7ec[_0xd09dbc(0xd1)])&&console[_0xd09dbc(0xa7)]('Name:\x20'+[_0x57a7ec['first_name'],_0x57a7ec[_0xd09dbc(0xd1)]][_0xd09dbc(0xc5)](Boolean)[_0xd09dbc(0xd5)]('\x20')),0x0;}catch(_0x7deafa){return _0x7deafa instanceof HTTPClientError&&_0x7deafa[_0xd09dbc(0xd8)]===0x191?printAuthError(_0x7deafa,!![],_0x5175fd):console[_0xd09dbc(0xb0)](a7_0xbba68e['red'](_0xd09dbc(0xa0)+(_0x7deafa instanceof Error?_0x7deafa[_0xd09dbc(0xad)]:String(_0x7deafa)))),0x1;}}}export class AuthClearCommand extends BaseCommand{['name']=a7_0x8bf214(0xaf);[a7_0x8bf214(0xb7)]=a7_0x8bf214(0xcf);async['execute'](_0x51b03d){const _0x40085a=a7_0x8bf214,{options:_0x2791c4}=_0x51b03d,_0x39418b=_0x2791c4['profile'];console[_0x40085a(0xa7)](a7_0xbba68e[_0x40085a(0xd4)]('tdx:\x20auth\x20clear'));const _0x1b6acd=await isKeychainAvailable();if(!_0x1b6acd)return console[_0x40085a(0xb0)](a7_0xbba68e[_0x40085a(0xba)](_0x40085a(0xb5))),0x1;const _0x5328e1=await deleteKeychainAPIKey(_0x39418b);return _0x5328e1?(clearCredentialCache(),console[_0x40085a(0xa7)](_0x40085a(0x9e)+(_0x39418b?_0x40085a(0x97)+_0x39418b+')':'')),0x0):(console['log']('No\x20API\x20key\x20found\x20in\x20keychain'+(_0x39418b?_0x40085a(0xb1)+_0x39418b:'')),0x1);}}function a7_0x5527(){const _0x5df012=['\x20(site:\x20','\x20\x20tdx','81365lcXHuU','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','\x20(profile:\x20','4179602xgvnCp','select','test','trim','password','green','✓\x20API\x20key\x20removed\x20from\x20keychain','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','✗\x20Validation\x20failed:\x20','customSite','auth:setup','9257710BLeTFL','Read\x20credential\x20from\x20','other','13520771wIJjBp','log','102orUPqV','email','warn','tdx:\x20auth\x20setup','4cTpbpP','message','User:\x20','auth:clear','error','\x20for\x20profile:\x20','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','System\x20keychain\x20is\x20not\x20available','No\x20credential\x20found','description','auth','2301813vpCOFe','red','Site\x20name\x20cannot\x20be\x20empty','ERROR','Setting\x20up\x20authentication\x20for\x20site:\x20','create','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','apiKey','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','24Jjgusl','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','You\x20can\x20find\x20your\x20API\x20key\x20at:','filter','yellow','profile','242988GfRdkX','jobs','296kAtMXY','execute','API\x20key\x20cannot\x20be\x20empty','7470yrcAtD','✓\x20Default\x20site\x20set\x20to\x20','Remove\x20API\x20key\x20from\x20system\x20keychain','name','last_name','tdx\x20profile:\x20','getUserInfo','bold','join','site','Enter\x20your\x20TD\x20API\x20key:','status','/app/mp/ak','\x0aSetup\x20cancelled','\x20--profile\x20','logLevel','us01','text','\x27\x20registered'];a7_0x5527=function(){return _0x5df012;};return a7_0x5527();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a8_0x2db0c1=a8_0x226f;function a8_0x32f9(){const _0xfc6ee=['Using\x20agent\x20from\x20','2824576WYxpEs','claude-4.5-haiku','\x0aStack\x20trace:','chat','CHAT_NOT_FOUND','llmAgent','content','getOrCreateDefaultAgent','targetKnowledgeBase','llm','Create\x20a\x20new\x20chat\x20session','context','verbose','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','Getting\x20default\x20agent...','validate','code','write','tool_call','chatId','10422062isKOue','streamChat','11769NuUWhn','10ARkQIq','2547FYBikz','handleChatEvent','name','event','targetAgent','stack','new','\x27...','tool_result','Using\x20cached\x20default\x20agent:\x20','getDefaultAgent','agent','llmProject','slice','5TpaKGg','resolveProjectId','stdout','cause','tool','--agent\x20flag','metadata','streamChatJsonl','chat-create','250cIavuV','Error:\x20','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','error','functionName','stringify','5725806RCRxLL','options','log','join','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','1418043tOBwqb','type','404','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','stream','targetFunction','data','1150166RJxIum','string','message','396lebSFl','projectId','agentId','resolveAgentId','8OkZOEJ','includes','description'];a8_0x32f9=function(){return _0xfc6ee;};return a8_0x32f9();}(function(_0x5b7a80,_0x28eaf8){const _0x3bcdcc=a8_0x226f,_0x2122e8=_0x5b7a80();while(!![]){try{const _0x343202=-parseInt(_0x3bcdcc(0x122))/0x1+parseInt(_0x3bcdcc(0x110))/0x2*(-parseInt(_0x3bcdcc(0xf7))/0x3)+parseInt(_0x3bcdcc(0x12d))/0x4+-parseInt(_0x3bcdcc(0x107))/0x5*(parseInt(_0x3bcdcc(0x116))/0x6)+parseInt(_0x3bcdcc(0xf5))/0x7*(-parseInt(_0x3bcdcc(0x129))/0x8)+parseInt(_0x3bcdcc(0xf9))/0x9*(-parseInt(_0x3bcdcc(0xf8))/0xa)+-parseInt(_0x3bcdcc(0x11b))/0xb*(-parseInt(_0x3bcdcc(0x125))/0xc);if(_0x343202===_0x28eaf8)break;else _0x2122e8['push'](_0x2122e8['shift']());}catch(_0x2900bc){_0x2122e8['push'](_0x2122e8['shift']());}}}(a8_0x32f9,0xd5efa));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';function a8_0x226f(_0x1beacc,_0x4a7734){_0x1beacc=_0x1beacc-0xef;const _0x32f918=a8_0x32f9();let _0x226fb5=_0x32f918[_0x1beacc];return _0x226fb5;}import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x94b929,_0x498f92){const _0x3e97d7=a8_0x226f;if(_0x94b929 instanceof SDKError)console[_0x3e97d7(0x113)](_0x3e97d7(0x111)+_0x94b929[_0x3e97d7(0x124)]),_0x498f92[_0x3e97d7(0x139)]&&(_0x94b929[_0x3e97d7(0x10a)]&&console[_0x3e97d7(0x113)]('\x20\x20Cause:\x20'+_0x94b929['cause']),_0x94b929[_0x3e97d7(0xfe)]&&(console[_0x3e97d7(0x113)](_0x3e97d7(0x12f)),console[_0x3e97d7(0x113)](_0x94b929[_0x3e97d7(0xfe)])));else throw _0x94b929;}async function resolveAgentId(_0x22c26f,_0x1127fd,_0x187673,_0x1f5ce5,_0x13d6bd){const _0x2a1195=a8_0x226f,_0x1d592e=_0x1127fd||_0x187673;if(_0x1d592e){const {projectName:_0x1b2abf,agentName:_0x297db7}=parseAgentRef(_0x1d592e),_0x34ab47=_0x297db7||_0x1d592e,_0xe97e04=_0x297db7?_0x1b2abf:_0x1f5ce5;if(!_0xe97e04)throw new Error(_0x2a1195(0x11a));if(_0x13d6bd){const _0x38847b=_0x1127fd?_0x2a1195(0x10c):'session\x20context';console[_0x2a1195(0x113)](_0x2a1195(0x12c)+_0x38847b+':\x20'+_0xe97e04+'/'+_0x34ab47);}const _0x317241=await withSpinner('Resolving\x20project\x20\x27'+_0xe97e04+_0x2a1195(0x100),()=>_0x22c26f[_0x2a1195(0x136)][_0x2a1195(0x108)](_0xe97e04),{'verbose':_0x13d6bd}),_0x57cb9f=await withSpinner('Resolving\x20agent\x20\x27'+_0x34ab47+'\x27...',()=>_0x22c26f[_0x2a1195(0x136)][_0x2a1195(0x128)](_0x34ab47,_0x317241[_0x2a1195(0x121)]),{'verbose':_0x13d6bd});return _0x57cb9f['data'];}else{const _0x1d429c=_0x22c26f[_0x2a1195(0x136)][_0x2a1195(0x103)]();if(_0x1d429c)return _0x13d6bd&&console[_0x2a1195(0x113)](_0x2a1195(0x102)+_0x1d429c[_0x2a1195(0xfb)]),_0x1d429c['id'];const _0x599a07=await withSpinner(_0x2a1195(0xef),()=>_0x22c26f[_0x2a1195(0x136)][_0x2a1195(0x134)](_0x2a1195(0x12e),0x0),{'verbose':_0x13d6bd});return _0x599a07[_0x2a1195(0x121)]['id'];}}export class ChatCommand extends BaseCommand{[a8_0x2db0c1(0xfb)]=a8_0x2db0c1(0x130);['description']=a8_0x2db0c1(0x11e);[a8_0x2db0c1(0xf0)](_0x271642){const _0x372763=a8_0x2db0c1,_0x3c21f6=_0x271642['args'][_0x372763(0x119)]('\x20');if(!_0x3c21f6)return _0x372763(0x112);return undefined;}async[a8_0x2db0c1(0xf6)](_0x210ee9,_0x200ce9,_0x1ea8b8,_0x14b587,_0xa725c3){const _0x574c47=a8_0x2db0c1;for await(const _0x281f2b of _0x210ee9[_0x574c47(0x136)][_0x574c47(0x130)](_0x200ce9,{'agentId':_0x1ea8b8,'chatId':_0x14b587})){if(_0x281f2b['type']==='metadata'){const _0x2ba234=_0x281f2b['data'][_0x574c47(0xf4)];saveLastChatId(_0x2ba234),_0xa725c3&&console[_0x574c47(0x113)]('Chat\x20session:\x20'+_0x2ba234);}else _0x281f2b[_0x574c47(0x11c)]===_0x574c47(0xfc)&&this[_0x574c47(0xfa)](_0x281f2b['data']);}}async['streamChatJsonl'](_0x3c0b19,_0x1508d3,_0x3f8afb,_0x48c33b){const _0x12ccb1=a8_0x2db0c1,_0x56f669=_0x3c0b19[_0x12ccb1(0x138)]['site'];let _0xb4b0cf=![];for await(const _0xb20a21 of _0x3c0b19[_0x12ccb1(0x136)][_0x12ccb1(0x130)](_0x1508d3,{'agentId':_0x3f8afb,'chatId':_0x48c33b})){if(_0xb20a21[_0x12ccb1(0x11c)]===_0x12ccb1(0x10d)){const _0x41570e=_0xb20a21['data'];saveLastChatId(_0x41570e[_0x12ccb1(0xf4)]);const _0x157cfb=_0x41570e[_0x12ccb1(0x126)]&&_0x41570e[_0x12ccb1(0x127)]?getLLMConversationUrl(_0x56f669,_0x41570e[_0x12ccb1(0x126)],_0x41570e[_0x12ccb1(0x127)],_0x41570e['chatId']):undefined;console[_0x12ccb1(0x118)](JSON[_0x12ccb1(0x115)]({'type':_0x12ccb1(0x10d),'data':{'chatId':_0x41570e[_0x12ccb1(0xf4)],'agentId':_0x41570e['agentId'],'consoleUrl':_0x157cfb}})),_0xb4b0cf=!![];}else{if(_0xb20a21[_0x12ccb1(0x11c)]===_0x12ccb1(0xfc)){!_0xb4b0cf&&_0x48c33b&&(console['log'](JSON[_0x12ccb1(0x115)]({'type':'metadata','data':{'chatId':_0x48c33b}})),_0xb4b0cf=!![]);const _0x8da4be=_0xb20a21[_0x12ccb1(0x121)];if('content'in _0x8da4be)console[_0x12ccb1(0x118)](JSON[_0x12ccb1(0x115)]({'type':_0x12ccb1(0x133),'data':{'content':_0x8da4be[_0x12ccb1(0x133)]}}));else{if(_0x12ccb1(0xf3)in _0x8da4be){const _0x578d0f=_0x8da4be[_0x12ccb1(0xf3)];console[_0x12ccb1(0x118)](JSON[_0x12ccb1(0x115)]({'type':_0x12ccb1(0xf3),'data':{'id':_0x578d0f['id'],'name':_0x578d0f['functionName'],'target':_0x578d0f[_0x12ccb1(0x135)]?.[_0x12ccb1(0xfb)]||_0x578d0f[_0x12ccb1(0xfd)]?.[_0x12ccb1(0xfb)]||_0x578d0f['targetWebSearchTool']?.[_0x12ccb1(0xfb)]||_0x578d0f[_0x12ccb1(0x120)]}}));}else{if(_0x12ccb1(0x10b)in _0x8da4be)console['log'](JSON[_0x12ccb1(0x115)]({'type':_0x12ccb1(0x101),'data':{'id':_0x8da4be[_0x12ccb1(0x10b)]['id'],'name':_0x8da4be[_0x12ccb1(0x10b)][_0x12ccb1(0x114)],'result':typeof _0x8da4be['tool'][_0x12ccb1(0x133)]===_0x12ccb1(0x123)?_0x8da4be[_0x12ccb1(0x10b)][_0x12ccb1(0x133)][_0x12ccb1(0x106)](0x0,0x1f4):''}}));else'error'in _0x8da4be&&console[_0x12ccb1(0x118)](JSON[_0x12ccb1(0x115)]({'type':_0x12ccb1(0x113),'data':{'error':_0x8da4be[_0x12ccb1(0x113)]}}));}}}}}console['log'](JSON[_0x12ccb1(0x115)]({'type':'done'}));}async['execute'](_0x1112f7){const _0x503021=a8_0x2db0c1,{options:_0x46df0b,args:_0xb7724d,tdx:_0x21ab73}=_0x1112f7,_0x1a566f=_0xb7724d[_0x503021(0x119)]('\x20'),_0x3ce664=_0x46df0b,_0x137df5=_0x3ce664[_0x503021(0x104)],_0x5d82d9=_0x3ce664[_0x503021(0x132)],_0xaad0fc=_0x3ce664[_0x503021(0x105)],_0x5e59ef=_0x3ce664[_0x503021(0xff)],_0x367a2b=_0x3ce664[_0x503021(0xf4)],_0x156ff5=_0x3ce664[_0x503021(0x11f)];if(_0x5e59ef&&_0x367a2b)return console[_0x503021(0x113)](_0x503021(0x13a)),0x1;try{let _0x534125,_0xc896f8;if(_0x367a2b)_0xc896f8=_0x367a2b;else!_0x5e59ef&&(_0xc896f8=loadLastChatId(),_0xc896f8&&_0x46df0b[_0x503021(0x139)]&&console[_0x503021(0x113)]('Continuing\x20chat:\x20'+_0xc896f8));!_0x367a2b&&(_0x5e59ef||!_0xc896f8)&&(_0x534125=await resolveAgentId(_0x21ab73,_0x137df5,_0x5d82d9,_0xaad0fc,_0x46df0b[_0x503021(0x139)]));const _0x143239=_0x156ff5?(_0x5dbe7e,_0x25834c,_0x3d2bca)=>this[_0x503021(0x10e)](_0x21ab73,_0x5dbe7e,_0x25834c,_0x3d2bca):(_0x1ff284,_0x931e9f,_0x1ddf3a)=>this['streamChat'](_0x21ab73,_0x1ff284,_0x931e9f,_0x1ddf3a,_0x46df0b['verbose']);try{await _0x143239(_0x1a566f,_0x534125,_0xc896f8);}catch(_0x2e0d63){const _0x1363aa=_0x2e0d63 instanceof SDKError&&_0x2e0d63[_0x503021(0xf1)]===ErrorCode[_0x503021(0x131)]||_0x2e0d63 instanceof Error&&_0x2e0d63['message'][_0x503021(0x12a)](_0x503021(0x11d));if(_0x1363aa&&_0x367a2b)return console['error']('Error:\x20Chat\x20session\x20\x27'+_0x367a2b+'\x27\x20not\x20found'),0x1;if(_0x1363aa)_0x46df0b[_0x503021(0x139)]&&console['error']('Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...'),!_0x534125&&(_0x534125=await resolveAgentId(_0x21ab73,_0x137df5,_0x5d82d9,_0xaad0fc,_0x46df0b[_0x503021(0x139)])),await _0x143239(_0x1a566f,_0x534125,undefined);else throw _0x2e0d63;}return!_0x156ff5&&console[_0x503021(0x118)](),0x0;}catch(_0x35a3ee){return console[_0x503021(0x113)](),handleSDKError(_0x35a3ee,_0x46df0b),0x1;}}[a8_0x2db0c1(0xfa)](_0x317f36){const _0x179927=a8_0x2db0c1;if(_0x179927(0x133)in _0x317f36)process[_0x179927(0x109)][_0x179927(0xf2)](_0x317f36[_0x179927(0x133)]);else _0x179927(0x113)in _0x317f36&&console[_0x179927(0x113)]('\x0aError:\x20'+_0x317f36[_0x179927(0x113)]);}}export class ChatCreateCommand extends BaseCommand{['name']=a8_0x2db0c1(0x10f);[a8_0x2db0c1(0x12b)]=a8_0x2db0c1(0x137);[a8_0x2db0c1(0xf0)](_0x8e03eb){const _0x10d683=a8_0x2db0c1,_0x11b31a=_0x8e03eb[_0x10d683(0x117)],_0x304b5c=_0x11b31a['agent'],_0x53d66c=_0x11b31a[_0x10d683(0x132)];if(!_0x304b5c&&!_0x53d66c)return'Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22';return undefined;}async['execute'](_0x59e07e){const _0x5f4838=a8_0x2db0c1,{options:_0x5cd44f,tdx:_0x5408e6}=_0x59e07e,_0x98347d=_0x5cd44f,_0x428510=_0x98347d[_0x5f4838(0x104)],_0x32ffa1=_0x98347d['llmAgent'],_0x3b2ba4=_0x98347d[_0x5f4838(0x105)];try{const _0x5c6638=await resolveAgentId(_0x5408e6,_0x428510,_0x32ffa1,_0x3b2ba4,_0x5cd44f[_0x5f4838(0x139)]),_0xade4b1=await _0x5408e6[_0x5f4838(0x136)]['startChat'](_0x5c6638);return saveLastChatId(_0xade4b1['id']),console[_0x5f4838(0x118)](JSON[_0x5f4838(0x115)]({'chatId':_0xade4b1['id'],'agentId':_0x5c6638})),0x0;}catch(_0x9f44dc){return handleSDKError(_0x9f44dc,_0x5cd44f),0x1;}}}
|
|
1
|
+
function a8_0x3ac0(){const _0x43f349=['Resolving\x20agent\x20\x27','\x0aStack\x20trace:','handleChatEvent','write','projectId','--agent\x20flag','llmAgent','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','code','agentId','74YDVfwj','join','name','33680YuxJqW','No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22','stdout','Chat\x20session:\x20','6213672liqlHL','done','validate','execute','resolveProjectId','stack','verbose','startChat','streamChatJsonl','metadata','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','404','Getting\x20default\x20agent...','message','stream','includes','description','content','chat','296HvaotX','llmProject','tool','site','context','log','data','cause','Create\x20a\x20new\x20chat\x20session','options','error','getDefaultAgent','stringify','201642YGHsAr','22371ypFBvQ','args','\x20\x20Cause:\x20','chatId','string','llm','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','targetFunction','functionName','Using\x20agent\x20from\x20','\x27\x20not\x20found','streamChat','tool_call','241705CMVKOv','new','Resolving\x20project\x20\x27','chat-create','agent','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','Error:\x20Chat\x20session\x20\x27','event','Error:\x20','10318HDTwGj','135769gFyHZB'];a8_0x3ac0=function(){return _0x43f349;};return a8_0x3ac0();}const a8_0x162b6b=a8_0x3090;(function(_0xb17a,_0x5521bc){const _0x39757e=a8_0x3090,_0x487f4a=_0xb17a();while(!![]){try{const _0x44a487=-parseInt(_0x39757e(0xb2))/0x1+-parseInt(_0x39757e(0xbd))/0x2*(parseInt(_0x39757e(0x9b))/0x3)+parseInt(_0x39757e(0x76))/0x4+-parseInt(_0x39757e(0xa8))/0x5+-parseInt(_0x39757e(0x9a))/0x6+-parseInt(_0x39757e(0xb1))/0x7*(parseInt(_0x39757e(0x8d))/0x8)+parseInt(_0x39757e(0x7a))/0x9;if(_0x44a487===_0x5521bc)break;else _0x487f4a['push'](_0x487f4a['shift']());}catch(_0xcb362f){_0x487f4a['push'](_0x487f4a['shift']());}}}(a8_0x3ac0,0x24c88));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';function a8_0x3090(_0x587afd,_0xa2d76f){_0x587afd=_0x587afd-0x76;const _0x3ac0e8=a8_0x3ac0();let _0x30905a=_0x3ac0e8[_0x587afd];return _0x30905a;}import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x2d139f,_0x3a8fdb){const _0x2243a4=a8_0x3090;if(_0x2d139f instanceof SDKError)console[_0x2243a4(0x97)](_0x2243a4(0xb0)+_0x2d139f[_0x2243a4(0x87)]),_0x3a8fdb[_0x2243a4(0x80)]&&(_0x2d139f['cause']&&console[_0x2243a4(0x97)](_0x2243a4(0x9d)+_0x2d139f[_0x2243a4(0x94)]),_0x2d139f[_0x2243a4(0x7f)]&&(console['error'](_0x2243a4(0xb4)),console['error'](_0x2d139f[_0x2243a4(0x7f)])));else throw _0x2d139f;}async function resolveAgentId(_0x20c447,_0x5ef0f0,_0x186e3b,_0x5e5dc0,_0x3f1acc){const _0x5df2f9=a8_0x3090,_0x1698ec=_0x5ef0f0||_0x186e3b;if(_0x1698ec){const {projectName:_0x59266d,agentName:_0x3b530e}=parseAgentRef(_0x1698ec),_0x58557a=_0x3b530e||_0x1698ec,_0x5a3dd8=_0x3b530e?_0x59266d:_0x5e5dc0;if(!_0x5a3dd8)throw new Error(_0x5df2f9(0x77));if(_0x3f1acc){const _0xdd789f=_0x5ef0f0?_0x5df2f9(0xb8):'session\x20context';console[_0x5df2f9(0x97)](_0x5df2f9(0xa4)+_0xdd789f+':\x20'+_0x5a3dd8+'/'+_0x58557a);}const _0x5d7b08=await withSpinner(_0x5df2f9(0xaa)+_0x5a3dd8+'\x27...',()=>_0x20c447[_0x5df2f9(0xa0)][_0x5df2f9(0x7e)](_0x5a3dd8),{'verbose':_0x3f1acc}),_0x37ef5d=await withSpinner(_0x5df2f9(0xb3)+_0x58557a+'\x27...',()=>_0x20c447[_0x5df2f9(0xa0)]['resolveAgentId'](_0x58557a,_0x5d7b08[_0x5df2f9(0x93)]),{'verbose':_0x3f1acc});return _0x37ef5d['data'];}else{const _0x3c0a52=_0x20c447[_0x5df2f9(0xa0)][_0x5df2f9(0x98)]();if(_0x3c0a52)return _0x3f1acc&&console[_0x5df2f9(0x97)]('Using\x20cached\x20default\x20agent:\x20'+_0x3c0a52[_0x5df2f9(0xbf)]),_0x3c0a52['id'];const _0x307aac=await withSpinner(_0x5df2f9(0x86),()=>_0x20c447['llm']['getOrCreateDefaultAgent']('claude-4.5-haiku',0x0),{'verbose':_0x3f1acc});return _0x307aac[_0x5df2f9(0x93)]['id'];}}export class ChatCommand extends BaseCommand{[a8_0x162b6b(0xbf)]=a8_0x162b6b(0x8c);[a8_0x162b6b(0x8a)]=a8_0x162b6b(0xad);[a8_0x162b6b(0x7c)](_0x5929b9){const _0x4b924a=a8_0x162b6b,_0x324a8b=_0x5929b9[_0x4b924a(0x9c)][_0x4b924a(0xbe)]('\x20');if(!_0x324a8b)return _0x4b924a(0x84);return undefined;}async[a8_0x162b6b(0xa6)](_0x5af071,_0x5477c2,_0x196ed0,_0x4a7999,_0x21ed63){const _0x1de4d6=a8_0x162b6b;for await(const _0x3ace98 of _0x5af071[_0x1de4d6(0xa0)][_0x1de4d6(0x8c)](_0x5477c2,{'agentId':_0x196ed0,'chatId':_0x4a7999})){if(_0x3ace98['type']===_0x1de4d6(0x83)){const _0x1a4370=_0x3ace98[_0x1de4d6(0x93)][_0x1de4d6(0x9e)];saveLastChatId(_0x1a4370),_0x21ed63&&console[_0x1de4d6(0x97)](_0x1de4d6(0x79)+_0x1a4370);}else _0x3ace98['type']===_0x1de4d6(0xaf)&&this[_0x1de4d6(0xb5)](_0x3ace98[_0x1de4d6(0x93)]);}}async[a8_0x162b6b(0x82)](_0x107c99,_0xd63ea9,_0x4615b6,_0x560c6b){const _0x503657=a8_0x162b6b,_0x26f495=_0x107c99[_0x503657(0x91)][_0x503657(0x90)];let _0x2be1bc=![];for await(const _0x46a443 of _0x107c99[_0x503657(0xa0)][_0x503657(0x8c)](_0xd63ea9,{'agentId':_0x4615b6,'chatId':_0x560c6b})){if(_0x46a443['type']===_0x503657(0x83)){const _0x2db8ad=_0x46a443['data'];saveLastChatId(_0x2db8ad[_0x503657(0x9e)]);const _0x3fb237=_0x2db8ad[_0x503657(0xb7)]&&_0x2db8ad['agentId']?getLLMConversationUrl(_0x26f495,_0x2db8ad[_0x503657(0xb7)],_0x2db8ad[_0x503657(0xbc)],_0x2db8ad[_0x503657(0x9e)]):undefined;console['log'](JSON[_0x503657(0x99)]({'type':_0x503657(0x83),'data':{'chatId':_0x2db8ad[_0x503657(0x9e)],'agentId':_0x2db8ad[_0x503657(0xbc)],'consoleUrl':_0x3fb237}})),_0x2be1bc=!![];}else{if(_0x46a443['type']===_0x503657(0xaf)){!_0x2be1bc&&_0x560c6b&&(console['log'](JSON[_0x503657(0x99)]({'type':_0x503657(0x83),'data':{'chatId':_0x560c6b}})),_0x2be1bc=!![]);const _0x3139d1=_0x46a443['data'];if(_0x503657(0x8b)in _0x3139d1)console['log'](JSON[_0x503657(0x99)]({'type':'content','data':{'content':_0x3139d1[_0x503657(0x8b)]}}));else{if(_0x503657(0xa7)in _0x3139d1){const _0x1bdc9d=_0x3139d1[_0x503657(0xa7)];console[_0x503657(0x92)](JSON[_0x503657(0x99)]({'type':_0x503657(0xa7),'data':{'id':_0x1bdc9d['id'],'name':_0x1bdc9d[_0x503657(0xa3)],'target':_0x1bdc9d['targetKnowledgeBase']?.[_0x503657(0xbf)]||_0x1bdc9d['targetAgent']?.['name']||_0x1bdc9d['targetWebSearchTool']?.[_0x503657(0xbf)]||_0x1bdc9d[_0x503657(0xa2)]}}));}else{if('tool'in _0x3139d1)console['log'](JSON[_0x503657(0x99)]({'type':'tool_result','data':{'id':_0x3139d1['tool']['id'],'name':_0x3139d1[_0x503657(0x8f)][_0x503657(0xa3)],'result':typeof _0x3139d1['tool']['content']===_0x503657(0x9f)?_0x3139d1[_0x503657(0x8f)]['content']['slice'](0x0,0x1f4):''}}));else'error'in _0x3139d1&&console['log'](JSON[_0x503657(0x99)]({'type':_0x503657(0x97),'data':{'error':_0x3139d1[_0x503657(0x97)]}}));}}}}}console[_0x503657(0x92)](JSON[_0x503657(0x99)]({'type':_0x503657(0x7b)}));}async['execute'](_0x3a84c1){const _0x41cc54=a8_0x162b6b,{options:_0x54c313,args:_0xee70c5,tdx:_0x36d874}=_0x3a84c1,_0x29130a=_0xee70c5[_0x41cc54(0xbe)]('\x20'),_0x524b10=_0x54c313,_0x5bec2f=_0x524b10[_0x41cc54(0xac)],_0x41eeb7=_0x524b10[_0x41cc54(0xb9)],_0x49e2b7=_0x524b10[_0x41cc54(0x8e)],_0x5b70be=_0x524b10[_0x41cc54(0xa9)],_0x37ffbe=_0x524b10[_0x41cc54(0x9e)],_0x4a5e47=_0x524b10[_0x41cc54(0x88)];if(_0x5b70be&&_0x37ffbe)return console['error'](_0x41cc54(0xba)),0x1;try{let _0x396010,_0xb59537;if(_0x37ffbe)_0xb59537=_0x37ffbe;else!_0x5b70be&&(_0xb59537=loadLastChatId(),_0xb59537&&_0x54c313[_0x41cc54(0x80)]&&console['error']('Continuing\x20chat:\x20'+_0xb59537));!_0x37ffbe&&(_0x5b70be||!_0xb59537)&&(_0x396010=await resolveAgentId(_0x36d874,_0x5bec2f,_0x41eeb7,_0x49e2b7,_0x54c313['verbose']));const _0x11644c=_0x4a5e47?(_0x41de7a,_0x568b65,_0x31d125)=>this[_0x41cc54(0x82)](_0x36d874,_0x41de7a,_0x568b65,_0x31d125):(_0x4be135,_0x4448ff,_0x4faaf3)=>this[_0x41cc54(0xa6)](_0x36d874,_0x4be135,_0x4448ff,_0x4faaf3,_0x54c313[_0x41cc54(0x80)]);try{await _0x11644c(_0x29130a,_0x396010,_0xb59537);}catch(_0x4db059){const _0x3baabf=_0x4db059 instanceof SDKError&&_0x4db059[_0x41cc54(0xbb)]===ErrorCode['CHAT_NOT_FOUND']||_0x4db059 instanceof Error&&_0x4db059['message'][_0x41cc54(0x89)](_0x41cc54(0x85));if(_0x3baabf&&_0x37ffbe)return console[_0x41cc54(0x97)](_0x41cc54(0xae)+_0x37ffbe+_0x41cc54(0xa5)),0x1;if(_0x3baabf)_0x54c313[_0x41cc54(0x80)]&&console['error']('Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...'),!_0x396010&&(_0x396010=await resolveAgentId(_0x36d874,_0x5bec2f,_0x41eeb7,_0x49e2b7,_0x54c313[_0x41cc54(0x80)])),await _0x11644c(_0x29130a,_0x396010,undefined);else throw _0x4db059;}return!_0x4a5e47&&console[_0x41cc54(0x92)](),0x0;}catch(_0x257755){return console[_0x41cc54(0x97)](),handleSDKError(_0x257755,_0x54c313),0x1;}}[a8_0x162b6b(0xb5)](_0x1a4119){const _0x5337c4=a8_0x162b6b;if(_0x5337c4(0x8b)in _0x1a4119)process[_0x5337c4(0x78)][_0x5337c4(0xb6)](_0x1a4119[_0x5337c4(0x8b)]);else'error'in _0x1a4119&&console[_0x5337c4(0x97)]('\x0aError:\x20'+_0x1a4119[_0x5337c4(0x97)]);}}export class ChatCreateCommand extends BaseCommand{[a8_0x162b6b(0xbf)]=a8_0x162b6b(0xab);['description']=a8_0x162b6b(0x95);[a8_0x162b6b(0x7c)](_0x1b8aed){const _0x94893c=a8_0x162b6b,_0x36be81=_0x1b8aed[_0x94893c(0x96)],_0x396fe9=_0x36be81['agent'],_0x2fde23=_0x36be81[_0x94893c(0xb9)];if(!_0x396fe9&&!_0x2fde23)return _0x94893c(0xa1);return undefined;}async[a8_0x162b6b(0x7d)](_0x227ff9){const _0x5bc2b6=a8_0x162b6b,{options:_0x442bcd,tdx:_0x4a4791}=_0x227ff9,_0x46dbb8=_0x442bcd,_0x2550ff=_0x46dbb8[_0x5bc2b6(0xac)],_0x486aae=_0x46dbb8['llmAgent'],_0xc84129=_0x46dbb8['llmProject'];try{const _0x118fed=await resolveAgentId(_0x4a4791,_0x2550ff,_0x486aae,_0xc84129,_0x442bcd[_0x5bc2b6(0x80)]),_0x2264a4=await _0x4a4791['llm'][_0x5bc2b6(0x81)](_0x118fed);return saveLastChatId(_0x2264a4['id']),console[_0x5bc2b6(0x92)](JSON[_0x5bc2b6(0x99)]({'chatId':_0x2264a4['id'],'agentId':_0x118fed})),0x0;}catch(_0x9d8a20){return handleSDKError(_0x9d8a20,_0x442bcd),0x1;}}}
|