@treasuredata/tdx 0.27.1 → 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_0x1bde89=a4_0x5dd1;(function(_0x1c1c86,_0x8c4e82){const _0x373ac9=a4_0x5dd1,_0xc2cb2b=_0x1c1c86();while(!![]){try{const _0x38b1bd=-parseInt(_0x373ac9(0x1b0))/0x1+-parseInt(_0x373ac9(0x148))/0x2+parseInt(_0x373ac9(0x127))/0x3*(parseInt(_0x373ac9(0x1ce))/0x4)+parseInt(_0x373ac9(0x166))/0x5*(-parseInt(_0x373ac9(0x1a6))/0x6)+-parseInt(_0x373ac9(0x134))/0x7+parseInt(_0x373ac9(0x170))/0x8*(-parseInt(_0x373ac9(0x11c))/0x9)+parseInt(_0x373ac9(0x19e))/0xa;if(_0x38b1bd===_0x8c4e82)break;else _0xc2cb2b['push'](_0xc2cb2b['shift']());}catch(_0x4a2bb8){_0xc2cb2b['push'](_0xc2cb2b['shift']());}}}(a4_0x1fa9,0xd77c2));import a4_0x47e7d2 from'chalk';import a4_0x170d36 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';function a4_0x1fa9(){const _0x35a133=['reason','\x0a✔\x20Pushed\x20','profile','pullProject','agent:pull','\x20files\x20to\x20','llm_project','agent.yml','Agent\x20pulled\x20successfully','Agent\x20','cyan','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','Output\x20path:\x20','2043410aMLCYO','no_local_folder','pushProject','\x27\x20to\x20create\x20the\x20folder\x20structure.','execute','Status:\x20','experimentalKnowledgeBases','\x20\x20Integration\x20\x22','action','found','Would\x20pull\x20agent:\x20','pullAgent','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','agent:push','\x20\x20Agent\x20\x22','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x20resources\x20to\x20\x27','llm','agent:clone','New\x20project:\x20','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','Analyzing\x20project\x20\x22','\x20=\x20','No\x20tdx.json\x20found\x20in\x20','\x20\x20Source:\x20','llmProject','new','experimentalArtifacts','Source:\x20','\x0aErrors\x20found:','70ghaHIQ','errors','\x0aChanges\x20to\x20agent\x20\x27','Errors:','cwd','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x20\x20tdx\x20agent\x20pull\x20','unchanged','source','agentId','878112WNacqB','\x20new','session','outputPath','Clone\x20\x22','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','error','cloneProject','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x0aProject\x20pushed\x20with\x20errors','Pulling\x20agent\x20\x22','dryRun','\x20resources?','site','dirname','\x0aError:','counts','\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)','dim','\x20updated','log','\x22\x20to\x20\x22','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','sourceProjectName','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x0a✔\x20Pulled\x20','\x0aChanges\x20to\x20integration\x20\x27','Using\x20local\x20project:\x20','created','\x20\x20Experimental\x20Artifact\x20\x22','\x20\x20Experimental\x20Artifacts:\x20','Using\x20context\x20project:\x20','tdx.json','agentName','\x20\x20Knowledge\x20Bases:\x20','textKnowledgeBases','Agent:\x20','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20#\x20Pull\x20specific\x20agent','Failed\x20to\x20push\x20agent:\x20','\x20\x20Prompt\x20\x22','Summary:','red','\x20unchanged','42006070JVVjAa','<new-name>','yellow','integrations','\x22\x20to\x20new\x20project\x20\x22','\x0aChanges\x20to\x20prompt\x20\x27','context','gray','92820zHoIVB','\x20\x20Integrations:\x20','Using\x20project:\x20','updated','description','prompts','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','force','Pushing\x20agent\x20from\x20\x22','\x20\x20Target:\x20','1642194kAwVva','Pushing\x20to\x20project...','knowledgeBases','\x22...','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','total','New\x20project\x20ID:\x20','message','Dry\x20run\x20-\x20no\x20files\x20written','\x20errors','\x20\x20Text\x20Knowledge\x20Base\x20\x22','name','\x20\x20Knowledge\x20Base\x20\x22','Cancelled','newProjectName','\x20\x20Prompts:\x20','\x20\x20tdx\x20agent\x20clone\x20agents/','pushAgent','Would\x20push\x20agent:\x20','\x20created','\x20--profile\x20','\x22\x20from\x20project\x20\x22','Dry\x20run\x20-\x20no\x20changes\x20made','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','Would\x20clone:','newProjectId','\x20|\x20','\x20\x20Agents:\x20','\x0aPush\x20','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','6439612iLTOlH','Project:\x20','green','New\x20project\x20name\x20is\x20required','projectName','projectDir','Project\x20cloned\x20with\x20errors','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','yes','126VWsjut','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x0aChanges:','projectId','Chat:\x20','✔\x20Context\x20set:\x20','agents','Project\x20cloned\x20successfully','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','INVALID_ARGUMENT','\x22:\x20','3FKbzCs','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20total','repeat','MISSING_ARGUMENT','parse','no_context','push','\x22\x20to\x20a\x20different\x20profile','outputDir','diff','Analyzing\x20changes\x20to\x20push...','Using\x20project\x20from\x20','3574963bBcWsp','Using\x20current\x20project:\x20','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x20--name\x20','join','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','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)'];a4_0x1fa9=function(){return _0x35a133;};return a4_0x1fa9();}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(_0x4309d5){const _0x25690e=a4_0x5dd1,_0x57edd6=[];if(_0x4309d5['total']!==undefined)_0x57edd6[_0x25690e(0x12e)](_0x4309d5[_0x25690e(0x1b5)]+_0x25690e(0x129));if(_0x4309d5[_0x25690e(0x162)]!==undefined&&_0x4309d5[_0x25690e(0x162)]>0x0)_0x57edd6[_0x25690e(0x12e)](a4_0x47e7d2[_0x25690e(0x1d0)](_0x4309d5[_0x25690e(0x162)]+_0x25690e(0x171)));if(_0x4309d5[_0x25690e(0x18d)]!==undefined&&_0x4309d5[_0x25690e(0x18d)]>0x0)_0x57edd6[_0x25690e(0x12e)](a4_0x47e7d2[_0x25690e(0x1d0)](_0x4309d5[_0x25690e(0x18d)]+_0x25690e(0x1c3)));if(_0x4309d5[_0x25690e(0x1a9)]!==undefined&&_0x4309d5[_0x25690e(0x1a9)]>0x0)_0x57edd6['push'](a4_0x47e7d2[_0x25690e(0x1a0)](_0x4309d5[_0x25690e(0x1a9)]+_0x25690e(0x183)));if(_0x4309d5[_0x25690e(0x16d)]!==undefined&&_0x4309d5[_0x25690e(0x16d)]>0x0)_0x57edd6[_0x25690e(0x12e)](a4_0x47e7d2[_0x25690e(0x1a5)](_0x4309d5[_0x25690e(0x16d)]+_0x25690e(0x19d)));if(_0x4309d5[_0x25690e(0x167)]!==undefined&&_0x4309d5[_0x25690e(0x167)]>0x0)_0x57edd6[_0x25690e(0x12e)](a4_0x47e7d2[_0x25690e(0x19c)](_0x4309d5[_0x25690e(0x167)]+_0x25690e(0x1b9)));return _0x57edd6[_0x25690e(0x138)](',\x20');}function displayDiffs(_0x50bf60,_0xafeb17,_0xcfd99f,_0x4fe973,_0x1206f1,_0x2e3cc9,_0x3db751){const _0x197628=a4_0x5dd1;for(const _0x17b567 of _0x50bf60){if(_0x17b567[_0x197628(0x131)]){const _0x3ba370=_0x17b567[_0x197628(0x192)]||_0x17b567[_0x197628(0x1bb)];console[_0x197628(0x184)](_0x197628(0x168)+_0x3ba370+'\x27:'),console[_0x197628(0x184)]('─'[_0x197628(0x12a)](0x3c)),console[_0x197628(0x184)](_0x17b567['diff']),console['log']('─'[_0x197628(0x12a)](0x3c));}}for(const _0x4b8943 of _0xafeb17){_0x4b8943[_0x197628(0x131)]&&(console[_0x197628(0x184)]('\x0aChanges\x20to\x20knowledge\x20base\x20\x27'+_0x4b8943[_0x197628(0x1bb)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x197628(0x184)](_0x4b8943[_0x197628(0x131)]),console[_0x197628(0x184)]('─'[_0x197628(0x12a)](0x3c)));}for(const _0x4e6f45 of _0xcfd99f){_0x4e6f45[_0x197628(0x131)]&&(console[_0x197628(0x184)](_0x197628(0x139)+_0x4e6f45[_0x197628(0x1bb)]+'\x27:'),console[_0x197628(0x184)]('─'[_0x197628(0x12a)](0x3c)),console[_0x197628(0x184)](_0x4e6f45['diff']),console[_0x197628(0x184)]('─'[_0x197628(0x12a)](0x3c)));}for(const _0x3ad577 of _0x4fe973){_0x3ad577[_0x197628(0x131)]&&(console['log'](_0x197628(0x1a3)+_0x3ad577[_0x197628(0x1bb)]+'\x27:'),console[_0x197628(0x184)]('─'[_0x197628(0x12a)](0x3c)),console[_0x197628(0x184)](_0x3ad577[_0x197628(0x131)]),console[_0x197628(0x184)]('─'[_0x197628(0x12a)](0x3c)));}for(const _0x4041f4 of _0x1206f1){_0x4041f4[_0x197628(0x131)]&&(console['log'](_0x197628(0x18b)+_0x4041f4[_0x197628(0x1bb)]+'\x27:'),console[_0x197628(0x184)]('─'[_0x197628(0x12a)](0x3c)),console['log'](_0x4041f4[_0x197628(0x131)]),console[_0x197628(0x184)]('─'['repeat'](0x3c)));}for(const _0x3ed833 of _0x2e3cc9){_0x3ed833[_0x197628(0x131)]&&(console['log'](_0x197628(0x186)+_0x3ed833['name']+'\x27:'),console[_0x197628(0x184)]('─'[_0x197628(0x12a)](0x3c)),console[_0x197628(0x184)](_0x3ed833[_0x197628(0x131)]),console[_0x197628(0x184)]('─'[_0x197628(0x12a)](0x3c)));}for(const _0x4ca291 of _0x3db751){_0x4ca291['diff']&&(console[_0x197628(0x184)](_0x197628(0x136)+_0x4ca291[_0x197628(0x1bb)]+'\x27:'),console[_0x197628(0x184)]('─'['repeat'](0x3c)),console[_0x197628(0x184)](_0x4ca291[_0x197628(0x131)]),console['log']('─'[_0x197628(0x12a)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x1bde89(0x1bb)]=a4_0x1bde89(0x13f);['description']=a4_0x1bde89(0x1ac);async[a4_0x1bde89(0x14c)](_0x4a6d52){const _0x1cc6d2=a4_0x1bde89,{options:_0x84348f,args:_0x451b86,tdx:_0x193f3a}=_0x4a6d52,_0x26d678=_0x451b86[0x0],_0x583015=_0x451b86[0x1],_0x242d09=_0x84348f['output'],_0x455182=_0x84348f[_0x1cc6d2(0x17b)],_0x438977=_0x84348f[_0x1cc6d2(0x1ad)],_0x5da69b=_0x84348f['yes'],_0x247c91=_0x84348f['llmProject'];let _0x426fb8,_0x51cf64;const _0x3665ff=findAgentConfigPath(process['cwd']());if(_0x26d678){const _0x3b3cb0=a4_0x170d36[_0x1cc6d2(0x138)](_0x26d678,'tdx.json');if(existsSync(_0x3b3cb0))try{const _0x256c1f=JSON[_0x1cc6d2(0x12c)](readFileSync(_0x3b3cb0,'utf-8'));_0x426fb8=_0x256c1f[_0x1cc6d2(0x141)],_0x51cf64=_0x26d678,console[_0x1cc6d2(0x184)](a4_0x47e7d2[_0x1cc6d2(0x182)](_0x1cc6d2(0x133)+_0x3b3cb0+':\x20'+_0x426fb8));}catch{_0x426fb8=_0x26d678;}else _0x426fb8=_0x26d678;}else{if(_0x3665ff)try{const _0x2223ca=JSON[_0x1cc6d2(0x12c)](readFileSync(_0x3665ff,'utf-8'));_0x426fb8=_0x2223ca[_0x1cc6d2(0x141)],_0x51cf64=a4_0x170d36['dirname'](_0x3665ff),console[_0x1cc6d2(0x184)](a4_0x47e7d2[_0x1cc6d2(0x182)](_0x1cc6d2(0x1a8)+_0x426fb8));}catch{_0x426fb8=_0x247c91;}else _0x426fb8=_0x247c91;}if(!_0x426fb8)return console['log'](a4_0x47e7d2['yellow']('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x1cc6d2(0x184)](_0x1cc6d2(0x13a)),console['log']('\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'),console[_0x1cc6d2(0x184)]('\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'),console[_0x1cc6d2(0x184)](_0x1cc6d2(0x198)),0x1;if(_0x583015){const {data:_0x5e56b3}=await withSpinner(_0x1cc6d2(0x17a)+_0x583015+_0x1cc6d2(0x1c5)+_0x426fb8+_0x1cc6d2(0x1b3),()=>_0x193f3a[_0x1cc6d2(0x159)][_0x1cc6d2(0x153)](_0x426fb8,_0x583015,_0x242d09,{'dryRun':_0x455182,'force':_0x438977}));if(_0x455182)return console[_0x1cc6d2(0x184)](a4_0x47e7d2[_0x1cc6d2(0x1a0)](_0x1cc6d2(0x1b8))),console[_0x1cc6d2(0x184)](_0x1cc6d2(0x152)+_0x5e56b3[_0x1cc6d2(0x192)]),console['log'](_0x1cc6d2(0x147)+_0x5e56b3[_0x1cc6d2(0x173)]),_0x5e56b3['diff']&&(console[_0x1cc6d2(0x184)](_0x1cc6d2(0x11e)),console['log']('─'[_0x1cc6d2(0x12a)](0x3c)),console['log'](_0x5e56b3[_0x1cc6d2(0x131)]),console[_0x1cc6d2(0x184)]('─'[_0x1cc6d2(0x12a)](0x3c))),0x0;return console[_0x1cc6d2(0x184)](a4_0x47e7d2['green'](_0x1cc6d2(0x143))),console[_0x1cc6d2(0x184)]('Agent:\x20'+_0x5e56b3['agentName']),console[_0x1cc6d2(0x184)]('Output:\x20'+_0x5e56b3[_0x1cc6d2(0x173)]),console[_0x1cc6d2(0x184)](_0x1cc6d2(0x14d)+(_0x5e56b3['isNew']?a4_0x47e7d2[_0x1cc6d2(0x1d0)]('new'):_0x5e56b3['hasChanges']?a4_0x47e7d2['yellow'](_0x1cc6d2(0x1a9)):a4_0x47e7d2[_0x1cc6d2(0x1a5)](_0x1cc6d2(0x16d)))),0x0;}const _0x4c2cfd=_0x51cf64||_0x242d09,{data:_0x232082}=await withSpinner(_0x1cc6d2(0x15d)+_0x426fb8+_0x1cc6d2(0x1b3),()=>_0x193f3a['llm'][_0x1cc6d2(0x13e)](_0x426fb8,_0x4c2cfd,{'dryRun':!![]})),_0x4417d0=_0x232082['counts']['agents']['new']+_0x232082[_0x1cc6d2(0x180)]['knowledgeBases'][_0x1cc6d2(0x162)]+_0x232082[_0x1cc6d2(0x180)][_0x1cc6d2(0x194)]['new']+_0x232082[_0x1cc6d2(0x180)]['prompts'][_0x1cc6d2(0x162)]+_0x232082[_0x1cc6d2(0x180)]['integrations'][_0x1cc6d2(0x162)]+_0x232082[_0x1cc6d2(0x180)]['experimentalKnowledgeBases'][_0x1cc6d2(0x162)]+_0x232082['counts'][_0x1cc6d2(0x163)][_0x1cc6d2(0x162)],_0x4b2def=_0x232082[_0x1cc6d2(0x180)][_0x1cc6d2(0x122)][_0x1cc6d2(0x1a9)]+_0x232082['counts'][_0x1cc6d2(0x1b2)]['updated']+_0x232082[_0x1cc6d2(0x180)][_0x1cc6d2(0x194)][_0x1cc6d2(0x1a9)]+_0x232082[_0x1cc6d2(0x180)][_0x1cc6d2(0x1ab)][_0x1cc6d2(0x1a9)]+_0x232082[_0x1cc6d2(0x180)][_0x1cc6d2(0x1a1)][_0x1cc6d2(0x1a9)]+_0x232082[_0x1cc6d2(0x180)][_0x1cc6d2(0x14e)][_0x1cc6d2(0x1a9)]+_0x232082[_0x1cc6d2(0x180)][_0x1cc6d2(0x163)][_0x1cc6d2(0x1a9)],_0x2005e5=_0x232082[_0x1cc6d2(0x180)][_0x1cc6d2(0x122)][_0x1cc6d2(0x16d)]+_0x232082['counts']['knowledgeBases'][_0x1cc6d2(0x16d)]+_0x232082[_0x1cc6d2(0x180)]['textKnowledgeBases'][_0x1cc6d2(0x16d)]+_0x232082['counts'][_0x1cc6d2(0x1ab)][_0x1cc6d2(0x16d)]+_0x232082[_0x1cc6d2(0x180)]['integrations']['unchanged']+_0x232082[_0x1cc6d2(0x180)][_0x1cc6d2(0x14e)][_0x1cc6d2(0x16d)]+_0x232082[_0x1cc6d2(0x180)][_0x1cc6d2(0x163)]['unchanged'];console[_0x1cc6d2(0x184)]('\x0aPull\x20summary\x20for\x20\x27'+_0x232082[_0x1cc6d2(0x117)]+'\x27:'),console[_0x1cc6d2(0x184)]('\x20\x20'+a4_0x47e7d2[_0x1cc6d2(0x1d0)]('+\x20'+_0x4417d0+'\x20new')+_0x1cc6d2(0x1ca)+a4_0x47e7d2[_0x1cc6d2(0x1a0)]('~\x20'+_0x4b2def+'\x20changed')+_0x1cc6d2(0x1ca)+a4_0x47e7d2[_0x1cc6d2(0x182)]('=\x20'+_0x2005e5+_0x1cc6d2(0x19d))),console['log'](_0x1cc6d2(0x1cb)+formatCountSummary(_0x232082[_0x1cc6d2(0x180)][_0x1cc6d2(0x122)])),console[_0x1cc6d2(0x184)](_0x1cc6d2(0x193)+formatCountSummary(_0x232082['counts'][_0x1cc6d2(0x1b2)])),console[_0x1cc6d2(0x184)](_0x1cc6d2(0x157)+formatCountSummary(_0x232082[_0x1cc6d2(0x180)][_0x1cc6d2(0x194)])),console[_0x1cc6d2(0x184)](_0x1cc6d2(0x1bf)+formatCountSummary(_0x232082['counts']['prompts'])),console[_0x1cc6d2(0x184)](_0x1cc6d2(0x1a7)+formatCountSummary(_0x232082['counts'][_0x1cc6d2(0x1a1)]));const _0x4b1b49=_0x232082['counts'][_0x1cc6d2(0x14e)]['total']>0x0||_0x232082['counts'][_0x1cc6d2(0x163)]['total']>0x0;_0x4b1b49&&(console[_0x1cc6d2(0x184)](_0x1cc6d2(0x124)+formatCountSummary(_0x232082[_0x1cc6d2(0x180)][_0x1cc6d2(0x14e)])),console['log'](_0x1cc6d2(0x18f)+formatCountSummary(_0x232082['counts'][_0x1cc6d2(0x163)])));console['log'](_0x1cc6d2(0x1af)+a4_0x47e7d2[_0x1cc6d2(0x145)](_0x232082[_0x1cc6d2(0x130)])),displayDiffs(_0x232082[_0x1cc6d2(0x122)],_0x232082[_0x1cc6d2(0x1b2)],_0x232082['textKnowledgeBases'],_0x232082[_0x1cc6d2(0x1ab)],_0x232082[_0x1cc6d2(0x1a1)],_0x232082[_0x1cc6d2(0x14e)],_0x232082[_0x1cc6d2(0x163)]);if(_0x455182)return console[_0x1cc6d2(0x184)](a4_0x47e7d2[_0x1cc6d2(0x1a0)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x4417d0===0x0&&_0x4b2def===0x0)return console[_0x1cc6d2(0x184)](a4_0x47e7d2[_0x1cc6d2(0x1d0)](_0x1cc6d2(0x175))),saveSessionContext({'llm_project':_0x232082[_0x1cc6d2(0x117)]},_0x84348f[_0x1cc6d2(0x172)]),console[_0x1cc6d2(0x184)](a4_0x47e7d2[_0x1cc6d2(0x1d0)]('✔\x20Context\x20set:\x20'+a4_0x47e7d2[_0x1cc6d2(0x182)](_0x1cc6d2(0x141))+_0x1cc6d2(0x15e)+a4_0x47e7d2[_0x1cc6d2(0x145)](_0x232082['projectName']))),0x0;if(!_0x5da69b&&!_0x438977){if(!isInteractive())return console['error'](a4_0x47e7d2[_0x1cc6d2(0x19c)]('\x0aError:'),_0x1cc6d2(0x154)),console['error'](a4_0x47e7d2[_0x1cc6d2(0x182)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x1407f2=await confirmKey('\x0aWrite\x20'+(_0x4417d0+_0x4b2def)+'\x20files?');if(!_0x1407f2)return console[_0x1cc6d2(0x184)](a4_0x47e7d2[_0x1cc6d2(0x1a0)]('Cancelled'),'-\x20no\x20files\x20written'),0x1;}const {data:_0x1e5403}=await withSpinner('Writing\x20files...',()=>_0x193f3a['llm'][_0x1cc6d2(0x13e)](_0x426fb8,_0x4c2cfd,{'force':_0x438977}));return console[_0x1cc6d2(0x184)](a4_0x47e7d2[_0x1cc6d2(0x1d0)](_0x1cc6d2(0x18a)+(_0x4417d0+_0x4b2def)+_0x1cc6d2(0x140)+_0x1e5403[_0x1cc6d2(0x130)])),saveSessionContext({'llm_project':_0x1e5403['projectName']},_0x84348f[_0x1cc6d2(0x172)]),console[_0x1cc6d2(0x184)](a4_0x47e7d2[_0x1cc6d2(0x1d0)](_0x1cc6d2(0x121)+a4_0x47e7d2[_0x1cc6d2(0x182)](_0x1cc6d2(0x141))+'\x20=\x20'+a4_0x47e7d2[_0x1cc6d2(0x145)](_0x1e5403[_0x1cc6d2(0x117)]))),0x0;}}function a4_0x5dd1(_0x180759,_0x37b7b8){_0x180759=_0x180759-0x116;const _0x1fa9c0=a4_0x1fa9();let _0x5dd183=_0x1fa9c0[_0x180759];return _0x5dd183;}export class AgentCloneCommand extends BaseCommand{[a4_0x1bde89(0x1bb)]=a4_0x1bde89(0x15a);['description']=a4_0x1bde89(0x1cd);async['execute'](_0x4f2ca3){const _0x1da0f0=a4_0x1bde89,{options:_0x5f24fd,args:_0x7bcea6,tdx:_0x59dd50}=_0x4f2ca3,_0x4afeb9=_0x7bcea6[0x0],_0x269677=_0x5f24fd[_0x1da0f0(0x1bb)],_0x17f592=_0x5f24fd[_0x1da0f0(0x17b)],_0x3b01a6=_0x5f24fd[_0x1da0f0(0x11b)],_0x18bdbe=_0x5f24fd['site'],_0x36e05b=_0x5f24fd[_0x1da0f0(0x161)];let _0x17de53;const _0x27dab9=findAgentConfigPath(process[_0x1da0f0(0x16a)]());if(_0x4afeb9){const _0x3caf82=a4_0x170d36[_0x1da0f0(0x138)](_0x4afeb9,_0x1da0f0(0x191));existsSync(_0x3caf82)?(_0x17de53=_0x4afeb9,console['log'](a4_0x47e7d2[_0x1da0f0(0x182)]('Using\x20local\x20project:\x20'+_0x4afeb9))):_0x17de53=_0x4afeb9;}else{if(_0x27dab9)_0x17de53=a4_0x170d36['dirname'](_0x27dab9),console[_0x1da0f0(0x184)](a4_0x47e7d2[_0x1da0f0(0x182)](_0x1da0f0(0x135)+_0x17de53));else{if(_0x36e05b){const _0x39e22f=sanitizeForFilesystem(_0x36e05b);let _0x13ca5d=_0x39e22f,_0x4989c4=a4_0x170d36[_0x1da0f0(0x138)](process[_0x1da0f0(0x16a)](),_0x1da0f0(0x122),_0x39e22f,'tdx.json');if(!existsSync(_0x4989c4)){const _0x2479e7=normalizeName(_0x36e05b),_0xd39aa5=a4_0x170d36[_0x1da0f0(0x138)](process[_0x1da0f0(0x16a)](),'agents',_0x2479e7,'tdx.json');existsSync(_0xd39aa5)&&(_0x13ca5d=_0x2479e7,_0x4989c4=_0xd39aa5);}if(existsSync(_0x4989c4))_0x17de53=a4_0x170d36[_0x1da0f0(0x17e)](_0x4989c4),console[_0x1da0f0(0x184)](a4_0x47e7d2[_0x1da0f0(0x182)](_0x1da0f0(0x18c)+_0x17de53));else{const _0xfa4999=_0x5f24fd[_0x1da0f0(0x13d)];if(_0xfa4999)throw new SDKError(ErrorCode[_0x1da0f0(0x125)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x36e05b+_0x1da0f0(0x12f),undefined,{'helpText':_0x1da0f0(0x11d)+_0x1da0f0(0x197)+(_0x1da0f0(0x16c)+_0x36e05b+'\x0a')+(_0x1da0f0(0x1c0)+_0x13ca5d+_0x1da0f0(0x137)+(_0x269677||_0x1da0f0(0x19f))+_0x1da0f0(0x1c4)+_0xfa4999)});_0x17de53=_0x36e05b,console['log'](a4_0x47e7d2[_0x1da0f0(0x182)](_0x1da0f0(0x190)+_0x36e05b));}}}}if(!_0x17de53)return console[_0x1da0f0(0x184)](a4_0x47e7d2[_0x1da0f0(0x1a0)](_0x1da0f0(0x11a))),console['log'](_0x1da0f0(0x196)),console[_0x1da0f0(0x184)](_0x1da0f0(0x146)),console[_0x1da0f0(0x184)](_0x1da0f0(0x181)),console[_0x1da0f0(0x184)](_0x1da0f0(0x189)),0x1;if(!_0x269677)throw new SDKError(ErrorCode[_0x1da0f0(0x12b)],_0x1da0f0(0x116),undefined,{'helpText':_0x1da0f0(0x16b)});if(!_0x3b01a6&&!_0x17f592){if(!isInteractive())return console['error'](a4_0x47e7d2[_0x1da0f0(0x19c)](_0x1da0f0(0x17f)),_0x1da0f0(0x154)),console[_0x1da0f0(0x176)](a4_0x47e7d2[_0x1da0f0(0x182)](_0x1da0f0(0x128))),0x1;const _0x373725=await confirmKey(_0x1da0f0(0x174)+_0x17de53+_0x1da0f0(0x1a2)+_0x269677+'\x22?');if(!_0x373725)return console[_0x1da0f0(0x184)](a4_0x47e7d2[_0x1da0f0(0x1a0)](_0x1da0f0(0x1bd))),0x1;}const {data:_0x1758c8}=await withSpinner('Cloning\x20\x22'+_0x17de53+_0x1da0f0(0x185)+_0x269677+_0x1da0f0(0x1b3),()=>_0x59dd50['llm'][_0x1da0f0(0x177)](_0x17de53,_0x269677,{'dryRun':_0x17f592}));if(_0x17f592){console[_0x1da0f0(0x184)](a4_0x47e7d2[_0x1da0f0(0x1a0)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x1da0f0(0x184)](_0x1da0f0(0x164)+_0x1758c8[_0x1da0f0(0x188)]),console[_0x1da0f0(0x184)](_0x1da0f0(0x15b)+_0x269677),console[_0x1da0f0(0x184)](_0x1da0f0(0x1c8)),console[_0x1da0f0(0x184)](_0x1da0f0(0x1cb)+_0x1758c8['counts'][_0x1da0f0(0x122)][_0x1da0f0(0x18d)]),console[_0x1da0f0(0x184)](_0x1da0f0(0x193)+_0x1758c8[_0x1da0f0(0x180)][_0x1da0f0(0x1b2)][_0x1da0f0(0x18d)]),console[_0x1da0f0(0x184)](_0x1da0f0(0x1bf)+_0x1758c8['counts'][_0x1da0f0(0x1ab)][_0x1da0f0(0x18d)]);const _0x43bf63=_0x1758c8[_0x1da0f0(0x180)][_0x1da0f0(0x14e)][_0x1da0f0(0x18d)]>0x0||_0x1758c8[_0x1da0f0(0x180)][_0x1da0f0(0x163)][_0x1da0f0(0x18d)]>0x0;return _0x43bf63&&(console['log'](_0x1da0f0(0x124)+_0x1758c8[_0x1da0f0(0x180)][_0x1da0f0(0x14e)][_0x1da0f0(0x18d)]),console[_0x1da0f0(0x184)](_0x1da0f0(0x18f)+_0x1758c8[_0x1da0f0(0x180)][_0x1da0f0(0x163)][_0x1da0f0(0x18d)])),0x0;}const _0x7fee8=_0x1758c8[_0x1da0f0(0x180)][_0x1da0f0(0x122)][_0x1da0f0(0x167)]>0x0||_0x1758c8[_0x1da0f0(0x180)][_0x1da0f0(0x1b2)][_0x1da0f0(0x167)]>0x0||_0x1758c8['counts'][_0x1da0f0(0x1ab)][_0x1da0f0(0x167)]>0x0||_0x1758c8[_0x1da0f0(0x180)][_0x1da0f0(0x14e)]['errors']>0x0||_0x1758c8[_0x1da0f0(0x180)]['experimentalArtifacts'][_0x1da0f0(0x167)]>0x0;_0x7fee8?console['log'](a4_0x47e7d2[_0x1da0f0(0x1a0)](_0x1da0f0(0x119))):console[_0x1da0f0(0x184)](a4_0x47e7d2[_0x1da0f0(0x1d0)](_0x1da0f0(0x123)));console[_0x1da0f0(0x184)](_0x1da0f0(0x164)+_0x1758c8['sourceProjectName']),console[_0x1da0f0(0x184)](_0x1da0f0(0x15b)+_0x1758c8[_0x1da0f0(0x1be)]),console['log'](_0x1da0f0(0x1b6)+_0x1758c8[_0x1da0f0(0x1c9)]),console[_0x1da0f0(0x184)](),console[_0x1da0f0(0x184)](_0x1da0f0(0x19b)),console[_0x1da0f0(0x184)]('\x20\x20Agents:\x20'+formatCountSummary(_0x1758c8['counts'][_0x1da0f0(0x122)])),console[_0x1da0f0(0x184)](_0x1da0f0(0x193)+formatCountSummary(_0x1758c8[_0x1da0f0(0x180)][_0x1da0f0(0x1b2)])),console[_0x1da0f0(0x184)](_0x1da0f0(0x1bf)+formatCountSummary(_0x1758c8['counts']['prompts'])),console['log'](_0x1da0f0(0x1a7)+formatCountSummary(_0x1758c8[_0x1da0f0(0x180)][_0x1da0f0(0x1a1)]));const _0x1624e4=_0x1758c8[_0x1da0f0(0x180)][_0x1da0f0(0x14e)][_0x1da0f0(0x18d)]>0x0||_0x1758c8[_0x1da0f0(0x180)][_0x1da0f0(0x14e)][_0x1da0f0(0x1a9)]>0x0||_0x1758c8['counts']['experimentalKnowledgeBases'][_0x1da0f0(0x16d)]>0x0||_0x1758c8[_0x1da0f0(0x180)]['experimentalArtifacts'][_0x1da0f0(0x18d)]>0x0||_0x1758c8[_0x1da0f0(0x180)][_0x1da0f0(0x163)][_0x1da0f0(0x1a9)]>0x0||_0x1758c8['counts'][_0x1da0f0(0x163)][_0x1da0f0(0x16d)]>0x0;_0x1624e4&&(console[_0x1da0f0(0x184)](_0x1da0f0(0x124)+formatCountSummary(_0x1758c8[_0x1da0f0(0x180)]['experimentalKnowledgeBases'])),console[_0x1da0f0(0x184)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x1758c8['counts'][_0x1da0f0(0x163)])));if(_0x7fee8){console[_0x1da0f0(0x184)](),console[_0x1da0f0(0x184)](a4_0x47e7d2['red'](_0x1da0f0(0x169)));for(const _0x2c61a3 of _0x1758c8[_0x1da0f0(0x122)]){_0x2c61a3[_0x1da0f0(0x150)]===_0x1da0f0(0x176)&&console[_0x1da0f0(0x184)](a4_0x47e7d2[_0x1da0f0(0x19c)](_0x1da0f0(0x156)+_0x2c61a3[_0x1da0f0(0x192)]+_0x1da0f0(0x126)+_0x2c61a3['error']));}for(const _0xdcd8cb of _0x1758c8[_0x1da0f0(0x1b2)]){_0xdcd8cb[_0x1da0f0(0x150)]===_0x1da0f0(0x176)&&console['log'](a4_0x47e7d2[_0x1da0f0(0x19c)](_0x1da0f0(0x1bc)+_0xdcd8cb['name']+_0x1da0f0(0x126)+_0xdcd8cb[_0x1da0f0(0x176)]));}for(const _0x336478 of _0x1758c8['prompts']){_0x336478['action']==='error'&&console['log'](a4_0x47e7d2[_0x1da0f0(0x19c)](_0x1da0f0(0x19a)+_0x336478[_0x1da0f0(0x1bb)]+_0x1da0f0(0x126)+_0x336478[_0x1da0f0(0x176)]));}for(const _0x44ae67 of _0x1758c8['integrations']){_0x44ae67[_0x1da0f0(0x150)]===_0x1da0f0(0x176)&&console[_0x1da0f0(0x184)](a4_0x47e7d2[_0x1da0f0(0x19c)](_0x1da0f0(0x14f)+_0x44ae67[_0x1da0f0(0x1bb)]+_0x1da0f0(0x126)+_0x44ae67[_0x1da0f0(0x176)]));}for(const _0x2a630b of _0x1758c8[_0x1da0f0(0x14e)]){_0x2a630b['action']===_0x1da0f0(0x176)&&console['log'](a4_0x47e7d2['red'](_0x1da0f0(0x187)+_0x2a630b['name']+_0x1da0f0(0x126)+_0x2a630b['error']));}for(const _0x137490 of _0x1758c8[_0x1da0f0(0x163)]){_0x137490[_0x1da0f0(0x150)]===_0x1da0f0(0x176)&&console['log'](a4_0x47e7d2['red'](_0x1da0f0(0x18e)+_0x137490[_0x1da0f0(0x1bb)]+_0x1da0f0(0x126)+_0x137490[_0x1da0f0(0x176)]));}return 0x1;}console['log']();const _0x5e2d99=getLLMProjectUrl(_0x18bdbe,_0x1758c8[_0x1da0f0(0x1c9)]);return console['log'](_0x1da0f0(0x1cf)+a4_0x47e7d2[_0x1da0f0(0x145)](_0x5e2d99)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x1bde89(0x1bb)]=a4_0x1bde89(0x155);[a4_0x1bde89(0x1aa)]='Push\x20local\x20agent\x20files\x20to\x20LLM\x20project';async[a4_0x1bde89(0x14c)](_0x59afb6){const _0x2f3d48=a4_0x1bde89,{options:_0x35de57,args:_0x2806ea,tdx:_0x117f54}=_0x59afb6;let _0x6ef5df=_0x2806ea[0x0]||process[_0x2f3d48(0x16a)]();const _0x4b66f1=_0x35de57[_0x2f3d48(0x17b)],_0x32a4d5=_0x35de57[_0x2f3d48(0x1ad)],_0x5a1056=_0x35de57['yes'],_0x65233d=_0x35de57[_0x2f3d48(0x17d)],_0x2718bf=a4_0x170d36['join'](_0x6ef5df,_0x2f3d48(0x142)),_0x257302=existsSync(_0x2718bf);if(_0x257302){const {data:_0x38e827}=await withSpinner(_0x2f3d48(0x1ae)+_0x6ef5df+_0x2f3d48(0x1b3),()=>_0x117f54[_0x2f3d48(0x159)][_0x2f3d48(0x1c1)](_0x6ef5df,{'dryRun':_0x4b66f1,'force':_0x32a4d5}));if(_0x4b66f1)return console[_0x2f3d48(0x184)](a4_0x47e7d2[_0x2f3d48(0x1a0)](_0x2f3d48(0x1c6))),console[_0x2f3d48(0x184)](_0x2f3d48(0x1c2)+_0x38e827[_0x2f3d48(0x192)]),0x0;if(_0x38e827[_0x2f3d48(0x150)]===_0x2f3d48(0x176))return console[_0x2f3d48(0x184)](a4_0x47e7d2[_0x2f3d48(0x19c)](_0x2f3d48(0x199)+_0x38e827['error'])),0x1;console['log'](a4_0x47e7d2[_0x2f3d48(0x1d0)](_0x2f3d48(0x144)+_0x38e827['action']+'\x20successfully')),console[_0x2f3d48(0x184)](_0x2f3d48(0x195)+_0x38e827[_0x2f3d48(0x192)]);if(_0x38e827[_0x2f3d48(0x16f)]&&_0x38e827[_0x2f3d48(0x11f)]){const _0x5c6643=getLLMAgentChatUrl(_0x65233d,_0x38e827[_0x2f3d48(0x11f)],_0x38e827[_0x2f3d48(0x16f)]);console[_0x2f3d48(0x184)](_0x2f3d48(0x120)+a4_0x47e7d2['cyan'](_0x5c6643));}return 0x0;}const _0x1ad51c=_0x35de57['llmProject'],_0x403993=resolveProjectFromContext(_0x6ef5df,_0x1ad51c);if(_0x403993[_0x2f3d48(0x151)])_0x6ef5df=_0x403993[_0x2f3d48(0x118)],_0x403993[_0x2f3d48(0x16e)]===_0x2f3d48(0x1a4)&&console['log'](a4_0x47e7d2[_0x2f3d48(0x182)](_0x2f3d48(0x1a8)+_0x6ef5df));else{let _0x25e581=_0x2f3d48(0x1b4);_0x403993[_0x2f3d48(0x13b)]===_0x2f3d48(0x149)&&(_0x25e581=_0x403993[_0x2f3d48(0x1b7)]+_0x2f3d48(0x15c)+_0x403993['llmProject']+_0x2f3d48(0x14b));throw new SDKError(ErrorCode[_0x2f3d48(0x125)],_0x403993[_0x2f3d48(0x13b)]===_0x2f3d48(0x12d)?_0x403993[_0x2f3d48(0x1b7)]:_0x2f3d48(0x15f)+_0x6ef5df,undefined,{'helpText':_0x25e581});}const {data:_0x553bd5}=await withSpinner(_0x2f3d48(0x132),()=>_0x117f54['llm'][_0x2f3d48(0x14a)](_0x6ef5df,{'dryRun':!![]})),_0x7b6661=_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x122)][_0x2f3d48(0x167)]>0x0;if(_0x7b6661){console[_0x2f3d48(0x184)](a4_0x47e7d2[_0x2f3d48(0x19c)](_0x2f3d48(0x165)));for(const _0x54777f of _0x553bd5[_0x2f3d48(0x122)]){_0x54777f[_0x2f3d48(0x150)]===_0x2f3d48(0x176)&&console[_0x2f3d48(0x184)](a4_0x47e7d2['red'](_0x2f3d48(0x156)+_0x54777f['agentName']+_0x2f3d48(0x126)+_0x54777f[_0x2f3d48(0x176)]));}return 0x1;}const _0x488513=_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x122)]['created']+_0x553bd5[_0x2f3d48(0x180)]['knowledgeBases'][_0x2f3d48(0x18d)]+_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x194)][_0x2f3d48(0x18d)]+_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x1ab)][_0x2f3d48(0x18d)]+_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x1a1)][_0x2f3d48(0x18d)]+_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x14e)][_0x2f3d48(0x18d)]+_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x163)]['created'],_0x1d7e7f=_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x122)][_0x2f3d48(0x1a9)]+_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x1b2)][_0x2f3d48(0x1a9)]+_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x194)][_0x2f3d48(0x1a9)]+_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x1ab)][_0x2f3d48(0x1a9)]+_0x553bd5['counts'][_0x2f3d48(0x1a1)]['updated']+_0x553bd5['counts'][_0x2f3d48(0x14e)][_0x2f3d48(0x1a9)]+_0x553bd5['counts']['experimentalArtifacts'][_0x2f3d48(0x1a9)],_0x318fc2=_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x122)][_0x2f3d48(0x16d)]+_0x553bd5['counts'][_0x2f3d48(0x1b2)][_0x2f3d48(0x16d)]+_0x553bd5['counts']['textKnowledgeBases'][_0x2f3d48(0x16d)]+_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x1ab)]['unchanged']+_0x553bd5[_0x2f3d48(0x180)]['integrations'][_0x2f3d48(0x16d)]+_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x14e)][_0x2f3d48(0x16d)]+_0x553bd5['counts'][_0x2f3d48(0x163)][_0x2f3d48(0x16d)];console[_0x2f3d48(0x184)]('\x0aPush\x20summary\x20for\x20\x27'+_0x553bd5[_0x2f3d48(0x117)]+'\x27:'),console[_0x2f3d48(0x184)]('\x20\x20'+a4_0x47e7d2[_0x2f3d48(0x1d0)]('+\x20'+_0x488513+_0x2f3d48(0x171))+_0x2f3d48(0x1ca)+a4_0x47e7d2[_0x2f3d48(0x1a0)]('~\x20'+_0x1d7e7f+'\x20changed')+_0x2f3d48(0x1ca)+a4_0x47e7d2[_0x2f3d48(0x182)]('=\x20'+_0x318fc2+_0x2f3d48(0x19d))),console[_0x2f3d48(0x184)](_0x2f3d48(0x1cb)+formatCountSummary(_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x122)])),console[_0x2f3d48(0x184)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x1b2)])),console[_0x2f3d48(0x184)](_0x2f3d48(0x157)+formatCountSummary(_0x553bd5['counts']['textKnowledgeBases'])),console[_0x2f3d48(0x184)](_0x2f3d48(0x1bf)+formatCountSummary(_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x1ab)])),console[_0x2f3d48(0x184)](_0x2f3d48(0x1a7)+formatCountSummary(_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x1a1)]));const _0x50018d=_0x553bd5['counts']['experimentalKnowledgeBases'][_0x2f3d48(0x18d)]>0x0||_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x14e)][_0x2f3d48(0x1a9)]>0x0||_0x553bd5[_0x2f3d48(0x180)]['experimentalKnowledgeBases'][_0x2f3d48(0x16d)]>0x0||_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x163)][_0x2f3d48(0x18d)]>0x0||_0x553bd5['counts'][_0x2f3d48(0x163)][_0x2f3d48(0x1a9)]>0x0||_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x163)][_0x2f3d48(0x16d)]>0x0;_0x50018d&&(console[_0x2f3d48(0x184)](_0x2f3d48(0x124)+formatCountSummary(_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x14e)])),console[_0x2f3d48(0x184)](_0x2f3d48(0x18f)+formatCountSummary(_0x553bd5[_0x2f3d48(0x180)][_0x2f3d48(0x163)])));console[_0x2f3d48(0x184)](_0x2f3d48(0x160)+a4_0x47e7d2[_0x2f3d48(0x145)](_0x6ef5df)),displayDiffs(_0x553bd5[_0x2f3d48(0x122)],_0x553bd5['knowledgeBases'],_0x553bd5[_0x2f3d48(0x194)],_0x553bd5[_0x2f3d48(0x1ab)],_0x553bd5[_0x2f3d48(0x1a1)],_0x553bd5[_0x2f3d48(0x14e)],_0x553bd5[_0x2f3d48(0x163)]);if(_0x4b66f1)return console[_0x2f3d48(0x184)](a4_0x47e7d2[_0x2f3d48(0x1a0)](_0x2f3d48(0x178))),0x0;if(_0x488513===0x0&&_0x1d7e7f===0x0){console[_0x2f3d48(0x184)](a4_0x47e7d2['green'](_0x2f3d48(0x1c7)));const _0x51e1b9=getLLMProjectUrl(_0x65233d,_0x553bd5[_0x2f3d48(0x11f)]);return console[_0x2f3d48(0x184)](_0x2f3d48(0x1cf)+a4_0x47e7d2[_0x2f3d48(0x145)](_0x51e1b9)),0x0;}if(!_0x5a1056&&!_0x32a4d5){if(!isInteractive())return console[_0x2f3d48(0x176)](a4_0x47e7d2[_0x2f3d48(0x19c)]('\x0aError:'),_0x2f3d48(0x154)),console[_0x2f3d48(0x176)](a4_0x47e7d2[_0x2f3d48(0x182)](_0x2f3d48(0x128))),0x1;const _0x566af6=await confirmKey(_0x2f3d48(0x1cc)+(_0x488513+_0x1d7e7f)+_0x2f3d48(0x17c));if(!_0x566af6)return console['log'](a4_0x47e7d2[_0x2f3d48(0x1a0)](_0x2f3d48(0x1bd)),'-\x20nothing\x20pushed'),0x1;}const {data:_0x5717a9}=await withSpinner(_0x2f3d48(0x1b1),()=>_0x117f54[_0x2f3d48(0x159)]['pushProject'](_0x6ef5df,{'force':_0x32a4d5})),_0x18b080=_0x5717a9[_0x2f3d48(0x180)][_0x2f3d48(0x122)][_0x2f3d48(0x167)]>0x0||_0x5717a9[_0x2f3d48(0x180)][_0x2f3d48(0x1b2)]['errors']>0x0||_0x5717a9[_0x2f3d48(0x180)]['textKnowledgeBases'][_0x2f3d48(0x167)]>0x0||_0x5717a9[_0x2f3d48(0x180)][_0x2f3d48(0x1ab)][_0x2f3d48(0x167)]>0x0;if(_0x18b080){console[_0x2f3d48(0x184)](a4_0x47e7d2['yellow'](_0x2f3d48(0x179))),console[_0x2f3d48(0x184)](),console['log'](a4_0x47e7d2[_0x2f3d48(0x19c)](_0x2f3d48(0x169)));for(const _0x1a5e85 of _0x5717a9[_0x2f3d48(0x122)]){_0x1a5e85[_0x2f3d48(0x150)]===_0x2f3d48(0x176)&&console[_0x2f3d48(0x184)](a4_0x47e7d2[_0x2f3d48(0x19c)](_0x2f3d48(0x156)+_0x1a5e85['agentName']+_0x2f3d48(0x126)+_0x1a5e85['error']));}for(const _0x34f477 of _0x5717a9['knowledgeBases']){_0x34f477[_0x2f3d48(0x150)]===_0x2f3d48(0x176)&&console['log'](a4_0x47e7d2[_0x2f3d48(0x19c)](_0x2f3d48(0x1bc)+_0x34f477['name']+'\x22:\x20'+_0x34f477[_0x2f3d48(0x176)]));}for(const _0x2e4c45 of _0x5717a9[_0x2f3d48(0x194)]){_0x2e4c45[_0x2f3d48(0x150)]===_0x2f3d48(0x176)&&console['log'](a4_0x47e7d2[_0x2f3d48(0x19c)](_0x2f3d48(0x1ba)+_0x2e4c45[_0x2f3d48(0x1bb)]+_0x2f3d48(0x126)+_0x2e4c45[_0x2f3d48(0x176)]));}for(const _0x2ce7c4 of _0x5717a9[_0x2f3d48(0x1ab)]){_0x2ce7c4[_0x2f3d48(0x150)]===_0x2f3d48(0x176)&&console['log'](a4_0x47e7d2['red'](_0x2f3d48(0x19a)+_0x2ce7c4[_0x2f3d48(0x1bb)]+'\x22:\x20'+_0x2ce7c4['error']));}for(const _0xeca6a4 of _0x5717a9[_0x2f3d48(0x1a1)]){_0xeca6a4[_0x2f3d48(0x150)]===_0x2f3d48(0x176)&&console[_0x2f3d48(0x184)](a4_0x47e7d2['red'](_0x2f3d48(0x14f)+_0xeca6a4['name']+_0x2f3d48(0x126)+_0xeca6a4[_0x2f3d48(0x176)]));}return 0x1;}console[_0x2f3d48(0x184)](a4_0x47e7d2[_0x2f3d48(0x1d0)](_0x2f3d48(0x13c)+(_0x488513+_0x1d7e7f)+_0x2f3d48(0x158)+_0x5717a9[_0x2f3d48(0x117)]+'\x27'));const _0x23910c=getLLMProjectUrl(_0x65233d,_0x5717a9[_0x2f3d48(0x11f)]);return console[_0x2f3d48(0x184)](_0x2f3d48(0x1cf)+a4_0x47e7d2[_0x2f3d48(0x145)](_0x23910c)),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_0x4fb7d6=a5_0x4d1d;(function(_0x313bf0,_0x2c46b7){const _0x5e0390=a5_0x4d1d,_0x576447=_0x313bf0();while(!![]){try{const _0x53ba5c=parseInt(_0x5e0390(0x188))/0x1+-parseInt(_0x5e0390(0x185))/0x2*(-parseInt(_0x5e0390(0x15f))/0x3)+parseInt(_0x5e0390(0x19b))/0x4+parseInt(_0x5e0390(0x180))/0x5+-parseInt(_0x5e0390(0x1ab))/0x6+parseInt(_0x5e0390(0x1e4))/0x7*(parseInt(_0x5e0390(0x1d0))/0x8)+-parseInt(_0x5e0390(0x19a))/0x9;if(_0x53ba5c===_0x2c46b7)break;else _0x576447['push'](_0x576447['shift']());}catch(_0x66aee5){_0x576447['push'](_0x576447['shift']());}}}(a5_0xb136,0x66f4d));import*as a5_0x572dac from'node:fs';import*as a5_0x234e02 from'node:path';import a5_0x14baf1 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';function a5_0x4d1d(_0x1fb384,_0x40a3a3){_0x1fb384=_0x1fb384-0x152;const _0xb13651=a5_0xb136();let _0x4d1d3f=_0xb13651[_0x1fb384];return _0x4d1d3f;}import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';function a5_0xb136(){const _0x1f55c5=['Round\x201/','description','\x20\x20Evaluating...\x20','dim','\x20\x20-\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','trim','\x20(cached)','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','3TYYpJf','New\x20tests\x20to\x20execute:\x20','agent','\x20-\x20','Using\x20agent:\x20','white','rounds','Failed:\x20\x20\x20','add','✗\x20FAIL:\x20','Error\x20writing\x20output\x20file:\x20','length','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','stop','no_tests','FAIL','\x20\x20Site:\x20','reason','isSpinning','no_local_folder','text','agentDirs','Project\x20path:\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','Test\x20Configuration:','Available\x20tests:\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','reeval','Site:\x20','json','repeat','log','site','1273640BagLyB','timestamp','yellow','Cached\x20run\x20is\x20from\x20site\x20\x22','Re-evaluation\x20Summary','1387654CrJmRa','agentName','\x27\x20to\x20create\x20the\x20folder\x20structure.','621169iwqUzU','executeReeval','llm','Running\x20agent\x20tests...','\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)','Test\x20Summary','cyan','name','testYmlPath','writeFileSync','Running:\x20','Output\x20written\x20to:\x20',':\x20Sending\x20user\x20input...','Re-evaluating\x20','Round\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','verbose','conversation_url','13269681iDWqQr','1501708NCAdId','No\x20tests\x20found\x20matching:\x20','✓\x20PASS:\x20','green','includes','Duration:\x20','round','eval','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','agent:test','existsSync','Run\x20tests\x20for\x20an\x20LLM\x20agent','Running\x20test:\x20','Agent:\x20','projectName','tests','1604628OkYjYo','\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','...','\x20\x20Round\x20','some','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','join','found','split','No\x20tests\x20have\x20tags\x20defined.','ERROR','⚠\x20SKIPPED:\x20','source','push','start','forEach','toLowerCase','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','context','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','toISOString','\x20\x20Agent:\x20','Failed\x20Tests:','no_context','utf-8','filter','Re-evaluating...','llmProject','PASS','...\x20','Conversation\x20URL:\x20','dryRun','Passed:\x20\x20\x20','Available\x20tags:\x20','\x22:\x20','404','output','31768BaHPbF','now','red','message','\x22,\x20but\x20current\x20site\x20is\x20\x22','table','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','No\x20tests\x20found\x20with\x20tags:\x20','\x20(new)','has','Error:\x20No\x20previous\x20test\x20run\x20found.','tags','Total:\x20\x20\x20\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','execute','basename','map','✗\x20ERROR:\x20','\x20\x20Project:\x20','Tests\x20found:\x20','385wZEuBf','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','tsv','status','multiple_agents','projectDir','Usage:','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','substring','size','/<agent-name>'];a5_0xb136=function(){return _0x1f55c5;};return a5_0xb136();}export class AgentTestCommand extends BaseCommand{[a5_0x4fb7d6(0x18f)]=a5_0x4fb7d6(0x1a4);[a5_0x4fb7d6(0x157)]=a5_0x4fb7d6(0x1a6);async[a5_0x4fb7d6(0x1de)](_0x208f11){const _0xa685ad=a5_0x4fb7d6,{options:_0x4a6608,args:_0x5a445c,tdx:_0x2181b9}=_0x208f11,_0x497726=_0x5a445c[0x0]||'.',_0x413829=_0x4a6608[_0xa685ad(0x1ca)],_0x214388=_0x4a6608,_0x113fbc=_0x214388[_0xa685ad(0x1a2)]===![],_0x31fa25=_0x214388[_0xa685ad(0x17a)],_0x406afb=_0x214388['name'],_0x277046=_0x214388[_0xa685ad(0x1db)],_0xcf1386=_0x4a6608['site'],_0x2e52f2=_0x214388[_0xa685ad(0x1cf)];if(_0x31fa25&&_0x113fbc)return console[_0xa685ad(0x17e)](a5_0x14baf1[_0xa685ad(0x1d2)](_0xa685ad(0x1a3))),0x1;let _0x3b835c=_0xa685ad(0x1d5);if(_0x214388[_0xa685ad(0x17c)])_0x3b835c=_0xa685ad(0x17c);else{if(_0x214388['jsonl'])_0x3b835c='jsonl';else{if(_0x214388[_0xa685ad(0x1e6)])_0x3b835c=_0xa685ad(0x1e6);else{if(_0x214388['table'])_0x3b835c=_0xa685ad(0x1d5);}}}const _0x27bb77=_0x214388[_0xa685ad(0x1c6)];let _0x27e3e2=_0x497726;const _0x1d4ec0=a5_0x572dac[_0xa685ad(0x1a5)](_0x497726),_0x1933df=_0x497726==='.';if(!_0x1d4ec0||_0x1933df){const _0x5a7b8f=resolveProjectFromContext(_0x497726,_0x27bb77,{'requireFile':'test.yml'});if(_0x5a7b8f[_0xa685ad(0x1b2)])_0x27e3e2=_0x5a7b8f[_0xa685ad(0x1e9)],_0x5a7b8f[_0xa685ad(0x1b7)]===_0xa685ad(0x1bd)&&console[_0xa685ad(0x17e)](a5_0x14baf1['dim'](_0xa685ad(0x163)+_0x27e3e2));else switch(_0x5a7b8f[_0xa685ad(0x170)]){case _0xa685ad(0x1c2):console[_0xa685ad(0x17e)](a5_0x14baf1['yellow'](_0x5a7b8f[_0xa685ad(0x1d3)])),console[_0xa685ad(0x17e)](),console[_0xa685ad(0x17e)](_0xa685ad(0x1ea)),console[_0xa685ad(0x17e)](_0xa685ad(0x1ac)),console['log'](_0xa685ad(0x18c)),console[_0xa685ad(0x17e)](),console[_0xa685ad(0x17e)]('Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>');return 0x1;case _0xa685ad(0x172):console[_0xa685ad(0x17e)](a5_0x14baf1[_0xa685ad(0x182)](_0x5a7b8f[_0xa685ad(0x1d3)])),console[_0xa685ad(0x17e)](),console[_0xa685ad(0x17e)]('Run\x20\x27tdx\x20agent\x20pull\x20'+_0x5a7b8f[_0xa685ad(0x1c6)]+_0xa685ad(0x187));return 0x1;case _0xa685ad(0x1e8):{const _0x1a8302=a5_0x234e02[_0xa685ad(0x1df)](_0x5a7b8f[_0xa685ad(0x1e9)]);console[_0xa685ad(0x17e)](a5_0x14baf1[_0xa685ad(0x182)](_0xa685ad(0x1be)+_0x5a7b8f[_0xa685ad(0x1c6)]+'\x22:'));for(const _0x238d2b of _0x5a7b8f[_0xa685ad(0x174)]){console[_0xa685ad(0x17e)](_0xa685ad(0x15a)+_0x238d2b);}return console[_0xa685ad(0x17e)](),console[_0xa685ad(0x17e)](_0xa685ad(0x152)+_0x1a8302+_0xa685ad(0x155)),0x1;}case _0xa685ad(0x16d):console['log'](a5_0x14baf1[_0xa685ad(0x182)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x5a7b8f[_0xa685ad(0x1c6)]+'\x22.')),console[_0xa685ad(0x17e)](a5_0x14baf1[_0xa685ad(0x159)](_0xa685ad(0x175)+_0x5a7b8f['projectDir'])),console[_0xa685ad(0x17e)](),console[_0xa685ad(0x17e)](_0xa685ad(0x1d6));return 0x1;}}const {definition:_0x224d3b,agentInfo:_0x1d95dc}=parseTestFile(_0x27e3e2);let _0x50d90a=_0x224d3b[_0xa685ad(0x1aa)];if(_0x406afb){const _0x3f2d82=_0x406afb[_0xa685ad(0x1b3)](',')[_0xa685ad(0x1e0)](_0x7c767b=>_0x7c767b['trim']());_0x50d90a=_0x224d3b[_0xa685ad(0x1aa)][_0xa685ad(0x1c4)](_0x461c7c=>_0x3f2d82[_0xa685ad(0x19f)](_0x461c7c['name']));if(_0x50d90a[_0xa685ad(0x16a)]===0x0)return console[_0xa685ad(0x17e)](a5_0x14baf1[_0xa685ad(0x182)](_0xa685ad(0x19c)+_0x406afb)),console['log'](a5_0x14baf1['dim'](_0xa685ad(0x178)+_0x224d3b[_0xa685ad(0x1aa)][_0xa685ad(0x1e0)](_0x5a5bb5=>_0x5a5bb5[_0xa685ad(0x18f)])[_0xa685ad(0x1b1)](',\x20'))),0x1;}if(_0x277046){const _0x7ec15=_0x277046[_0xa685ad(0x1b3)](',')[_0xa685ad(0x1e0)](_0x264a0e=>_0x264a0e[_0xa685ad(0x15c)]()['toLowerCase']());_0x50d90a=_0x50d90a[_0xa685ad(0x1c4)](_0x4c8475=>_0x4c8475[_0xa685ad(0x1db)]?.[_0xa685ad(0x1af)](_0x1237ea=>_0x7ec15['includes'](_0x1237ea[_0xa685ad(0x1bb)]())));if(_0x50d90a[_0xa685ad(0x16a)]===0x0){console['log'](a5_0x14baf1['yellow'](_0xa685ad(0x1d7)+_0x277046));const _0x5dab45=new Set();return _0x224d3b[_0xa685ad(0x1aa)][_0xa685ad(0x1ba)](_0x3b6717=>_0x3b6717[_0xa685ad(0x1db)]?.[_0xa685ad(0x1ba)](_0x1b1832=>_0x5dab45[_0xa685ad(0x167)](_0x1b1832))),_0x5dab45[_0xa685ad(0x154)]>0x0?console[_0xa685ad(0x17e)](a5_0x14baf1['dim'](_0xa685ad(0x1cc)+[..._0x5dab45][_0xa685ad(0x1b1)](',\x20'))):console['log'](a5_0x14baf1[_0xa685ad(0x159)](_0xa685ad(0x1b4))),0x1;}}if(_0x31fa25)return this[_0xa685ad(0x189)](_0x208f11,{'definition':{'tests':_0x50d90a},'agentInfo':_0x1d95dc,'outputFormat':_0x3b835c,'outputFile':_0x2e52f2,'testNames':_0x406afb});if(_0x413829){console[_0xa685ad(0x17e)](a5_0x14baf1['cyan'](_0xa685ad(0x177))),console['log'](_0xa685ad(0x16f)+a5_0x14baf1[_0xa685ad(0x164)](_0xcf1386)),console[_0xa685ad(0x17e)](_0xa685ad(0x1e2)+a5_0x14baf1[_0xa685ad(0x164)](_0x1d95dc['projectName'])),console[_0xa685ad(0x17e)](_0xa685ad(0x1c0)+a5_0x14baf1[_0xa685ad(0x164)](_0x1d95dc[_0xa685ad(0x186)])),console['log'](),console[_0xa685ad(0x17e)](_0xa685ad(0x1e3)+a5_0x14baf1[_0xa685ad(0x164)](_0x50d90a[_0xa685ad(0x16a)]));for(let _0x24c226=0x0;_0x24c226<_0x50d90a['length'];_0x24c226++){const _0x43cd82=_0x50d90a[_0x24c226],_0x21fbba=_0x43cd82[_0xa685ad(0x165)][_0xa685ad(0x16a)]===0x1?_0xa685ad(0x1a1):_0xa685ad(0x165),_0x1d8e21=_0x43cd82[_0xa685ad(0x1db)]?.[_0xa685ad(0x16a)]?'\x20['+_0x43cd82[_0xa685ad(0x1db)][_0xa685ad(0x1b1)](',\x20')+']':'';console['log']('\x20\x20'+(_0x24c226+0x1)+'.\x20'+a5_0x14baf1['white'](_0x43cd82[_0xa685ad(0x18f)])+'\x20('+_0x43cd82[_0xa685ad(0x165)][_0xa685ad(0x16a)]+'\x20'+_0x21fbba+')'+a5_0x14baf1['dim'](_0x1d8e21));}return 0x0;}let _0x36bb37,_0x5dec0b;try{_0x36bb37=await _0x2181b9[_0xa685ad(0x18a)]['resolveProjectId'](_0x1d95dc[_0xa685ad(0x1a9)]);}catch(_0x16437a){const _0x39e32c=_0x16437a instanceof Error?_0x16437a[_0xa685ad(0x1d3)]:String(_0x16437a);return _0x39e32c['includes'](_0xa685ad(0x1ce))||_0x39e32c[_0xa685ad(0x1bb)]()[_0xa685ad(0x19f)]('not\x20found')?console[_0xa685ad(0x17e)](a5_0x14baf1[_0xa685ad(0x1d2)](_0xa685ad(0x197)+_0x1d95dc[_0xa685ad(0x1a9)])):console[_0xa685ad(0x17e)](a5_0x14baf1[_0xa685ad(0x1d2)](_0xa685ad(0x15e)+_0x1d95dc[_0xa685ad(0x1a9)]+_0xa685ad(0x1cd)+_0x39e32c)),0x1;}try{_0x5dec0b=await _0x2181b9[_0xa685ad(0x18a)]['resolveAgentId'](_0x1d95dc[_0xa685ad(0x186)],_0x36bb37);}catch(_0x55807d){const _0xd3b173=_0x55807d instanceof Error?_0x55807d[_0xa685ad(0x1d3)]:String(_0x55807d);return _0xd3b173['includes'](_0xa685ad(0x1ce))||_0xd3b173[_0xa685ad(0x1bb)]()[_0xa685ad(0x19f)]('not\x20found')?console['log'](a5_0x14baf1[_0xa685ad(0x1d2)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x1d95dc[_0xa685ad(0x186)])):console[_0xa685ad(0x17e)](a5_0x14baf1[_0xa685ad(0x1d2)](_0xa685ad(0x15b)+_0x1d95dc[_0xa685ad(0x186)]+_0xa685ad(0x1cd)+_0xd3b173)),0x1;}let _0x52a00a;if(!_0x113fbc)try{_0x52a00a=await setupEvaluatorAgent(_0x2181b9[_0xa685ad(0x18a)],_0x4a6608['verbose']);}catch(_0x1e94b8){const _0x33ca4e=_0x1e94b8 instanceof Error?_0x1e94b8[_0xa685ad(0x1d3)]:String(_0x1e94b8);return console[_0xa685ad(0x17e)](a5_0x14baf1[_0xa685ad(0x1d2)](_0xa685ad(0x179)+_0x33ca4e)),0x1;}console[_0xa685ad(0x17e)](a5_0x14baf1['cyan'](_0xa685ad(0x18b))),console[_0xa685ad(0x17e)](_0xa685ad(0x17b)+a5_0x14baf1[_0xa685ad(0x164)](_0xcf1386)),console[_0xa685ad(0x17e)]('Agent:\x20'+a5_0x14baf1[_0xa685ad(0x164)](_0x1d95dc['projectName']+'/'+_0x1d95dc[_0xa685ad(0x186)])),console[_0xa685ad(0x17e)]();const _0x1840c6=[],_0x26fcc7=[],_0x5a9543=Date['now']();for(let _0xebe520=0x0;_0xebe520<_0x50d90a[_0xa685ad(0x16a)];_0xebe520++){const _0x3b8755=_0x50d90a[_0xebe520];_0x50d90a[_0xa685ad(0x16a)]>0x1?console[_0xa685ad(0x17e)]('Test\x20'+(_0xebe520+0x1)+'/'+_0x50d90a[_0xa685ad(0x16a)]+':\x20'+a5_0x14baf1[_0xa685ad(0x164)](_0x3b8755[_0xa685ad(0x18f)])):console[_0xa685ad(0x17e)](_0xa685ad(0x1a7)+a5_0x14baf1[_0xa685ad(0x164)](_0x3b8755[_0xa685ad(0x18f)]));const _0x49e5b3=createCommandSpinner(_0xa685ad(0x156)+_0x3b8755['rounds']['length']+_0xa685ad(0x194));_0x49e5b3[_0xa685ad(0x1b9)]();try{const {result:_0x4e6c66,conversation:_0xb2e525}=await runTest(_0x2181b9[_0xa685ad(0x18a)],_0x3b8755,{'agentId':_0x5dec0b,'projectId':_0x36bb37,'site':_0xcf1386,'noEval':_0x113fbc,'evaluatorId':_0x52a00a,'onRoundStart':(_0x374cac,_0xfd5aa)=>{const _0x5773cd=_0xa685ad;_0x49e5b3['text']=_0x5773cd(0x196)+(_0x374cac+0x1)+'/'+_0xfd5aa+_0x5773cd(0x194);},'onRoundComplete':(_0x1df05a,_0x4d857b,_0xda4cf1)=>{const _0xea3ea2=_0xa685ad,_0x23da77=formatElapsed(_0x4d857b);_0xda4cf1?console[_0xea3ea2(0x17e)]('\x20\x20Round\x20'+(_0x1df05a+0x1)+'/'+_0x3b8755[_0xea3ea2(0x165)][_0xea3ea2(0x16a)]+_0xea3ea2(0x1c8)+a5_0x14baf1[_0xea3ea2(0x19e)]('✓')+'\x20('+_0x23da77+')'):console['log'](_0xea3ea2(0x1ae)+(_0x1df05a+0x1)+'/'+_0x3b8755[_0xea3ea2(0x165)]['length']+_0xea3ea2(0x1c8)+a5_0x14baf1[_0xea3ea2(0x1d2)]('✗'));},'onEvaluationStart':()=>{_0x49e5b3['text']='Evaluating\x20response...';},'onEvaluationComplete':_0x4ca5c6=>{const _0x3e3553=_0xa685ad,_0x4d73d4=formatElapsed(_0x4ca5c6);console['log'](_0x3e3553(0x158)+a5_0x14baf1[_0x3e3553(0x19e)]('✓')+'\x20('+_0x4d73d4+')');}});_0x49e5b3[_0xa685ad(0x16c)](),_0x1840c6['push'](_0x4e6c66),_0x26fcc7[_0xa685ad(0x1b8)](_0xb2e525);if(_0x4e6c66[_0xa685ad(0x1e7)]===_0xa685ad(0x1c7))console[_0xa685ad(0x17e)](a5_0x14baf1[_0xa685ad(0x19e)]('✓\x20PASS:\x20'+_0x4e6c66[_0xa685ad(0x170)]));else _0x4e6c66[_0xa685ad(0x1e7)]===_0xa685ad(0x16e)?console['log'](a5_0x14baf1[_0xa685ad(0x1d2)](_0xa685ad(0x168)+_0x4e6c66[_0xa685ad(0x170)])):console['log'](a5_0x14baf1[_0xa685ad(0x1d2)](_0xa685ad(0x1e1)+_0x4e6c66[_0xa685ad(0x170)]));_0x4e6c66[_0xa685ad(0x199)]&&console[_0xa685ad(0x17e)](a5_0x14baf1[_0xa685ad(0x159)](_0xa685ad(0x1c9)+_0x4e6c66['conversation_url'])),console[_0xa685ad(0x17e)]();}catch(_0xbfce3d){_0x49e5b3[_0xa685ad(0x16c)]();const _0x15c51f=_0xbfce3d instanceof Error?_0xbfce3d[_0xa685ad(0x1d3)]:String(_0xbfce3d);console['log'](a5_0x14baf1['red'](_0xa685ad(0x1e1)+_0x15c51f)),console[_0xa685ad(0x17e)](),_0x1840c6[_0xa685ad(0x1b8)]({'name':_0x3b8755[_0xa685ad(0x18f)],'status':_0xa685ad(0x1b5),'reason':_0x15c51f,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x57d66b=Date[_0xa685ad(0x1d1)]()-_0x5a9543,_0x5ea404=_0x1840c6[_0xa685ad(0x1c4)](_0x22e381=>_0x22e381[_0xa685ad(0x1e7)]===_0xa685ad(0x1c7))[_0xa685ad(0x16a)],_0x35697c=_0x1840c6[_0xa685ad(0x1c4)](_0x1f0af2=>_0x1f0af2[_0xa685ad(0x1e7)]===_0xa685ad(0x16e))['length'],_0x7f7b5f=_0x1840c6['filter'](_0x3f1f6b=>_0x3f1f6b['status']===_0xa685ad(0x1b5))[_0xa685ad(0x16a)];console[_0xa685ad(0x17e)]('━'[_0xa685ad(0x17d)](0x3c)),console['log'](_0xa685ad(0x18d)),console[_0xa685ad(0x17e)]('━'[_0xa685ad(0x17d)](0x3c)),console['log'](_0xa685ad(0x1dc)+_0x1840c6[_0xa685ad(0x16a)]),console[_0xa685ad(0x17e)]('Passed:\x20\x20\x20'+a5_0x14baf1['green'](_0x5ea404)),console['log'](_0xa685ad(0x166)+a5_0x14baf1[_0xa685ad(0x1d2)](_0x35697c));_0x7f7b5f>0x0&&console[_0xa685ad(0x17e)]('Errors:\x20\x20\x20'+a5_0x14baf1[_0xa685ad(0x1d2)](_0x7f7b5f));console[_0xa685ad(0x17e)](_0xa685ad(0x1a0)+formatElapsed(_0x57d66b)),console[_0xa685ad(0x17e)]('━'[_0xa685ad(0x17d)](0x3c));const _0x59a452=_0x1840c6['filter'](_0xe38124=>_0xe38124[_0xa685ad(0x1e7)]!==_0xa685ad(0x1c7));if(_0x59a452[_0xa685ad(0x16a)]>0x0){console[_0xa685ad(0x17e)](),console['log'](_0xa685ad(0x1c1));for(const _0x1657e1 of _0x59a452){const _0x4596fd=a5_0x14baf1['red']('✗'),_0x47244d=_0x1657e1[_0xa685ad(0x170)][_0xa685ad(0x16a)]>0x32?_0x1657e1[_0xa685ad(0x170)][_0xa685ad(0x153)](0x0,0x32)+'...':_0x1657e1[_0xa685ad(0x170)];console[_0xa685ad(0x17e)]('\x20\x20'+_0x4596fd+'\x20'+_0x1657e1[_0xa685ad(0x18f)]+':\x20'+_0x47244d);}}const _0xc03702={'summary':{'total':_0x1840c6[_0xa685ad(0x16a)],'passed':_0x5ea404,'failed':_0x35697c,'errors':_0x7f7b5f>0x0?_0x7f7b5f:undefined,'duration_ms':_0x57d66b},'tests':_0x1840c6,'agent':{'project':_0x1d95dc[_0xa685ad(0x1a9)],'name':_0x1d95dc['agentName'],'site':_0xcf1386},'timestamp':new Date(_0x5a9543)['toISOString']()};try{const _0x3e002d=buildCachedTestRun(_0x26fcc7,{'site':_0xcf1386,'projectId':_0x36bb37,'projectName':_0x1d95dc[_0xa685ad(0x1a9)],'agentId':_0x5dec0b,'agentName':_0x1d95dc['agentName'],'testYmlPath':a5_0x234e02['resolve'](_0x1d95dc[_0xa685ad(0x190)])});saveLastTestRun(_0x3e002d);}catch{}if(_0x3b835c!=='table'||_0x2e52f2){const _0x355c43=formatResults(_0xc03702,_0x3b835c);if(_0x2e52f2)try{a5_0x572dac[_0xa685ad(0x191)](_0x2e52f2,_0x355c43,_0xa685ad(0x1c3)),console[_0xa685ad(0x17e)](),console[_0xa685ad(0x17e)](a5_0x14baf1[_0xa685ad(0x159)](_0xa685ad(0x193)+_0x2e52f2));}catch(_0x25423e){return console[_0xa685ad(0x17e)](),console[_0xa685ad(0x17e)](a5_0x14baf1[_0xa685ad(0x1d2)](_0xa685ad(0x169)+_0x25423e)),0x1;}else console[_0xa685ad(0x17e)](),console[_0xa685ad(0x17e)](_0x355c43);}return _0x59a452[_0xa685ad(0x16a)]>0x0?0x1:0x0;}async[a5_0x4fb7d6(0x189)](_0x45d2a4,_0x386c3d){const _0x4aecd0=a5_0x4fb7d6,{options:_0x410626,tdx:_0x5d214d}=_0x45d2a4,{definition:_0x901e4d,agentInfo:_0x5a1af9,outputFormat:_0x479067,outputFile:_0x500622}=_0x386c3d,_0x24cf08=_0x410626['site'],_0xdee21a=loadLastTestRun();if(!_0xdee21a)return console[_0x4aecd0(0x17e)](a5_0x14baf1[_0x4aecd0(0x1d2)](_0x4aecd0(0x1da))),console[_0x4aecd0(0x17e)](a5_0x14baf1[_0x4aecd0(0x159)](_0x4aecd0(0x1dd))),0x1;if(_0xdee21a[_0x4aecd0(0x161)]['agentName']!==_0x5a1af9['agentName'])return console[_0x4aecd0(0x17e)](a5_0x14baf1[_0x4aecd0(0x1d2)](_0x4aecd0(0x1e5)+_0xdee21a[_0x4aecd0(0x161)][_0x4aecd0(0x186)]+_0x4aecd0(0x1bc)+_0x5a1af9[_0x4aecd0(0x186)]+'\x22.')),console['log'](a5_0x14baf1[_0x4aecd0(0x159)](_0x4aecd0(0x16b))),0x1;const _0x573310=new Set(_0xdee21a['conversations']['map'](_0x54b0ad=>_0x54b0ad['testName'])),_0x19c55a=_0x901e4d[_0x4aecd0(0x1aa)]['filter'](_0x54d1fb=>!_0x573310[_0x4aecd0(0x1d9)](_0x54d1fb[_0x4aecd0(0x18f)]));if(_0x19c55a[_0x4aecd0(0x16a)]>0x0&&_0xdee21a[_0x4aecd0(0x17f)]!==_0x24cf08)return console['log'](a5_0x14baf1['red'](_0x4aecd0(0x1b0))),console[_0x4aecd0(0x17e)](a5_0x14baf1[_0x4aecd0(0x159)](_0x4aecd0(0x183)+_0xdee21a['site']+_0x4aecd0(0x1d4)+_0x24cf08+'\x22.')),console[_0x4aecd0(0x17e)](a5_0x14baf1[_0x4aecd0(0x159)]('Either\x20switch\x20to\x20the\x20\x22'+_0xdee21a[_0x4aecd0(0x17f)]+_0x4aecd0(0x176))),0x1;const _0x292e33=_0x901e4d['tests']['filter'](_0xbe574d=>_0x573310[_0x4aecd0(0x1d9)](_0xbe574d[_0x4aecd0(0x18f)])),_0x4978d6=_0x19c55a;let _0x2afe4f;try{_0x2afe4f=await setupEvaluatorAgent(_0x5d214d[_0x4aecd0(0x18a)],_0x410626[_0x4aecd0(0x198)]);}catch(_0x1b38f5){const _0x11c19c=_0x1b38f5 instanceof Error?_0x1b38f5[_0x4aecd0(0x1d3)]:String(_0x1b38f5);return console['log'](a5_0x14baf1[_0x4aecd0(0x1d2)](_0x4aecd0(0x179)+_0x11c19c)),0x1;}console[_0x4aecd0(0x17e)](a5_0x14baf1[_0x4aecd0(0x18e)]('Re-evaluating\x20cached\x20test\x20run...')),console[_0x4aecd0(0x17e)]('Cached\x20run\x20from:\x20'+a5_0x14baf1[_0x4aecd0(0x164)](_0xdee21a[_0x4aecd0(0x181)])),console[_0x4aecd0(0x17e)](_0x4aecd0(0x1a8)+a5_0x14baf1[_0x4aecd0(0x164)](_0xdee21a['agent'][_0x4aecd0(0x1a9)]+'/'+_0xdee21a[_0x4aecd0(0x161)][_0x4aecd0(0x186)]));_0x4978d6[_0x4aecd0(0x16a)]>0x0&&console[_0x4aecd0(0x17e)](_0x4aecd0(0x160)+a5_0x14baf1[_0x4aecd0(0x182)](_0x4978d6[_0x4aecd0(0x16a)]));console[_0x4aecd0(0x17e)]();const _0x6af31f=[],_0x30fe83=Date[_0x4aecd0(0x1d1)](),_0x37f995=createCommandSpinner(_0x4aecd0(0x1c5));if(_0x292e33[_0x4aecd0(0x16a)]>0x0)try{const _0x4c146f=await reevaluateFromCache(_0x5d214d[_0x4aecd0(0x18a)],_0xdee21a,{'tests':_0x292e33},{'evaluatorId':_0x2afe4f,'onTestStart':(_0x170259,_0x3433d7,_0x21d82d)=>{const _0x419f55=_0x4aecd0;_0x37f995[_0x419f55(0x173)]=_0x419f55(0x195)+(_0x3433d7+0x1)+'/'+_0x21d82d+':\x20'+_0x170259+_0x419f55(0x1ad);if(!_0x37f995[_0x419f55(0x171)])_0x37f995['start']();},'onTestComplete':(_0x10c9b0,_0xf528b4)=>{const _0x3b9b6e=_0x4aecd0;_0x37f995[_0x3b9b6e(0x16c)]();if(_0xf528b4[_0x3b9b6e(0x1e7)]===_0x3b9b6e(0x1c7))console['log'](a5_0x14baf1['green'](_0x3b9b6e(0x19d)+_0x10c9b0)+a5_0x14baf1[_0x3b9b6e(0x159)](_0x3b9b6e(0x15d)));else _0xf528b4[_0x3b9b6e(0x1e7)]===_0x3b9b6e(0x16e)?console[_0x3b9b6e(0x17e)](a5_0x14baf1[_0x3b9b6e(0x1d2)]('✗\x20FAIL:\x20'+_0x10c9b0+_0x3b9b6e(0x162)+_0xf528b4[_0x3b9b6e(0x170)])+a5_0x14baf1[_0x3b9b6e(0x159)](_0x3b9b6e(0x15d))):console[_0x3b9b6e(0x17e)](a5_0x14baf1['red']('✗\x20ERROR:\x20'+_0x10c9b0+_0x3b9b6e(0x162)+_0xf528b4['reason']));_0xf528b4[_0x3b9b6e(0x199)]&&console[_0x3b9b6e(0x17e)](a5_0x14baf1[_0x3b9b6e(0x159)]('\x20\x20Conversation:\x20'+_0xf528b4[_0x3b9b6e(0x199)])),_0x6af31f[_0x3b9b6e(0x1b8)](_0xf528b4);},'onTestSkipped':(_0xf82e9e,_0x2e1dfd)=>{const _0x36bd12=_0x4aecd0;_0x37f995[_0x36bd12(0x16c)](),console[_0x36bd12(0x17e)](a5_0x14baf1[_0x36bd12(0x182)](_0x36bd12(0x1b6)+_0xf82e9e+_0x36bd12(0x162)+_0x2e1dfd));}});for(const _0x36c679 of _0x4c146f){!_0x6af31f['find'](_0x10e7f7=>_0x10e7f7[_0x4aecd0(0x18f)]===_0x36c679['name'])&&_0x6af31f['push'](_0x36c679);}}catch(_0x21b604){_0x37f995[_0x4aecd0(0x16c)]();const _0x399c73=_0x21b604 instanceof Error?_0x21b604['message']:String(_0x21b604);return console['log'](a5_0x14baf1[_0x4aecd0(0x1d2)]('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0x399c73)),0x1;}_0x37f995[_0x4aecd0(0x16c)]();if(_0x4978d6[_0x4aecd0(0x16a)]>0x0){console[_0x4aecd0(0x17e)](),console[_0x4aecd0(0x17e)](a5_0x14baf1[_0x4aecd0(0x18e)]('Executing\x20new\x20tests...'));const {projectId:_0x19b953,agentId:_0x1a144a}=_0xdee21a[_0x4aecd0(0x161)];for(const _0x51b7fa of _0x4978d6){console[_0x4aecd0(0x17e)](_0x4aecd0(0x192)+a5_0x14baf1[_0x4aecd0(0x164)](_0x51b7fa[_0x4aecd0(0x18f)]));const _0x30119d=createCommandSpinner(_0x4aecd0(0x156)+_0x51b7fa['rounds'][_0x4aecd0(0x16a)]+':\x20Sending\x20user\x20input...');_0x30119d['start']();try{const {result:_0x512f6e}=await runTest(_0x5d214d[_0x4aecd0(0x18a)],_0x51b7fa,{'agentId':_0x1a144a,'projectId':_0x19b953,'site':_0xdee21a[_0x4aecd0(0x17f)],'noEval':![],'evaluatorId':_0x2afe4f,'onRoundStart':(_0x5d2e39,_0x34376d)=>{const _0x135af7=_0x4aecd0;_0x30119d['text']='Round\x20'+(_0x5d2e39+0x1)+'/'+_0x34376d+_0x135af7(0x194);},'onRoundComplete':(_0x1fe215,_0x9b29e,_0x161e71)=>{const _0x3d3324=_0x4aecd0,_0x52f70a=formatElapsed(_0x9b29e);_0x161e71?console['log']('\x20\x20Round\x20'+(_0x1fe215+0x1)+'/'+_0x51b7fa['rounds'][_0x3d3324(0x16a)]+'...\x20'+a5_0x14baf1[_0x3d3324(0x19e)]('✓')+'\x20('+_0x52f70a+')'):console[_0x3d3324(0x17e)](_0x3d3324(0x1ae)+(_0x1fe215+0x1)+'/'+_0x51b7fa[_0x3d3324(0x165)][_0x3d3324(0x16a)]+_0x3d3324(0x1c8)+a5_0x14baf1[_0x3d3324(0x1d2)]('✗'));},'onEvaluationStart':()=>{_0x30119d['text']='Evaluating\x20response...';},'onEvaluationComplete':_0xa8b82b=>{const _0x187bcb=_0x4aecd0,_0x52b78c=formatElapsed(_0xa8b82b);console['log'](_0x187bcb(0x158)+a5_0x14baf1['green']('✓')+'\x20('+_0x52b78c+')');}});_0x30119d[_0x4aecd0(0x16c)](),_0x6af31f[_0x4aecd0(0x1b8)](_0x512f6e);if(_0x512f6e['status']===_0x4aecd0(0x1c7))console[_0x4aecd0(0x17e)](a5_0x14baf1[_0x4aecd0(0x19e)](_0x4aecd0(0x19d)+_0x512f6e['reason'])+a5_0x14baf1[_0x4aecd0(0x159)](_0x4aecd0(0x1d8)));else _0x512f6e[_0x4aecd0(0x1e7)]===_0x4aecd0(0x16e)?console[_0x4aecd0(0x17e)](a5_0x14baf1[_0x4aecd0(0x1d2)]('✗\x20FAIL:\x20'+_0x512f6e[_0x4aecd0(0x170)])+a5_0x14baf1[_0x4aecd0(0x159)]('\x20(new)')):console[_0x4aecd0(0x17e)](a5_0x14baf1[_0x4aecd0(0x1d2)]('✗\x20ERROR:\x20'+_0x512f6e[_0x4aecd0(0x170)]));_0x512f6e['conversation_url']&&console[_0x4aecd0(0x17e)](a5_0x14baf1['dim']('\x20\x20Conversation:\x20'+_0x512f6e[_0x4aecd0(0x199)]));}catch(_0x13abf5){_0x30119d[_0x4aecd0(0x16c)]();const _0x132260=_0x13abf5 instanceof Error?_0x13abf5['message']:String(_0x13abf5);console[_0x4aecd0(0x17e)](a5_0x14baf1[_0x4aecd0(0x1d2)](_0x4aecd0(0x1e1)+_0x132260)),_0x6af31f[_0x4aecd0(0x1b8)]({'name':_0x51b7fa['name'],'status':'ERROR','reason':_0x132260,'timestamp':new Date()[_0x4aecd0(0x1bf)](),'duration_ms':0x0});}}}console[_0x4aecd0(0x17e)]();const _0x5c010f=Date[_0x4aecd0(0x1d1)]()-_0x30fe83,_0x3042fa=_0x6af31f[_0x4aecd0(0x1c4)](_0x144851=>_0x144851[_0x4aecd0(0x1e7)]===_0x4aecd0(0x1c7))[_0x4aecd0(0x16a)],_0x211bcb=_0x6af31f[_0x4aecd0(0x1c4)](_0x267177=>_0x267177[_0x4aecd0(0x1e7)]===_0x4aecd0(0x16e))[_0x4aecd0(0x16a)],_0x5bbfd0=_0x6af31f[_0x4aecd0(0x1c4)](_0x592423=>_0x592423[_0x4aecd0(0x1e7)]===_0x4aecd0(0x1b5))['length'];console['log']('━'[_0x4aecd0(0x17d)](0x3c)),console[_0x4aecd0(0x17e)](_0x4aecd0(0x184)),console[_0x4aecd0(0x17e)]('━'[_0x4aecd0(0x17d)](0x3c)),console[_0x4aecd0(0x17e)](_0x4aecd0(0x1dc)+_0x6af31f[_0x4aecd0(0x16a)]),console[_0x4aecd0(0x17e)](_0x4aecd0(0x1cb)+a5_0x14baf1[_0x4aecd0(0x19e)](_0x3042fa)),console['log'](_0x4aecd0(0x166)+a5_0x14baf1[_0x4aecd0(0x1d2)](_0x211bcb));_0x5bbfd0>0x0&&console[_0x4aecd0(0x17e)]('Errors:\x20\x20\x20'+a5_0x14baf1['red'](_0x5bbfd0));console[_0x4aecd0(0x17e)](_0x4aecd0(0x1a0)+formatElapsed(_0x5c010f)),console[_0x4aecd0(0x17e)]('━'['repeat'](0x3c));const _0x3ef326={'summary':{'total':_0x6af31f['length'],'passed':_0x3042fa,'failed':_0x211bcb,'errors':_0x5bbfd0>0x0?_0x5bbfd0:undefined,'duration_ms':_0x5c010f},'tests':_0x6af31f,'agent':{'project':_0x5a1af9['projectName'],'name':_0x5a1af9[_0x4aecd0(0x186)],'site':_0x24cf08},'timestamp':new Date(_0x30fe83)[_0x4aecd0(0x1bf)]()};if(_0x479067!==_0x4aecd0(0x1d5)||_0x500622){const _0x422709=formatResults(_0x3ef326,_0x479067);if(_0x500622)try{a5_0x572dac[_0x4aecd0(0x191)](_0x500622,_0x422709,_0x4aecd0(0x1c3)),console[_0x4aecd0(0x17e)](),console[_0x4aecd0(0x17e)](a5_0x14baf1[_0x4aecd0(0x159)](_0x4aecd0(0x193)+_0x500622));}catch(_0x4a60c8){return console['log'](),console['log'](a5_0x14baf1[_0x4aecd0(0x1d2)](_0x4aecd0(0x169)+_0x4a60c8)),0x1;}else console[_0x4aecd0(0x17e)](),console[_0x4aecd0(0x17e)](_0x422709);}const _0x2a1278=_0x6af31f['filter'](_0x4f3d37=>_0x4f3d37[_0x4aecd0(0x1e7)]!=='PASS');return _0x2a1278[_0x4aecd0(0x16a)]>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
|
-
function a8_0x468b(){const _0x1f866f=['3032802qyZmQB','name','Getting\x20default\x20agent...','event','171ZYDuFN','targetKnowledgeBase','done','Chat\x20session\x20not\x20found,\x20starting\x20new\x20chat...','session\x20context','type','6XNnico','new','streamChat','string','execute','Resolving\x20project\x20\x27','llmProject','resolveAgentId','Usage:\x20tdx\x20chat\x20\x22your\x20message\x22\x0a\x0aRun\x20\x27tdx\x20chat\x20--help\x27\x20for\x20more\x20options','message','description','resolveProjectId','metadata','targetAgent','content','8222074vArJbQ','--agent\x20flag','cause','chat-create','Using\x20cached\x20default\x20agent:\x20','Continuing\x20chat:\x20','streamChatJsonl','688628oLOouc','\x27\x20not\x20found','targetWebSearchTool','Error:\x20','slice','887770ovAtKP','2851732JyyyMo','log','tool','handleChatEvent','verbose','\x0aStack\x20trace:','getOrCreateDefaultAgent','chatId','Agent\x20required.\x20Use\x20--agent\x20\x22Project/Agent\x22\x20or\x20set\x20agent\x20with\x20\x22tdx\x20use\x20agent\x22','Error:\x20Chat\x20session\x20\x27','claude-4.5-haiku','context','getDefaultAgent','chat','tool_call','stream','927208Scjjpz','\x27...','Chat\x20session:\x20','Create\x20a\x20new\x20chat\x20session','CHAT_NOT_FOUND','llmAgent','Chat\x20with\x20an\x20LLM\x20agent\x20(simplified)','validate','code','Resolving\x20agent\x20\x27','functionName','args','agent','includes','\x0aError:\x20','data','agentId','targetFunction','Error:\x20Cannot\x20use\x20--new\x20and\x20--chat-id\x20together','6224795dVSJIp','site','llm','write','stack','404','\x20\x20Cause:\x20','stringify','error','join'];a8_0x468b=function(){return _0x1f866f;};return a8_0x468b();}const a8_0x508861=a8_0x5dbc;(function(_0x3a5ae4,_0xe58807){const _0xacc719=a8_0x5dbc,_0x3ddea9=_0x3a5ae4();while(!![]){try{const _0x5eed78=parseInt(_0xacc719(0x10b))/0x1+parseInt(_0xacc719(0x110))/0x2*(parseInt(_0xacc719(0xf5))/0x3)+parseInt(_0xacc719(0x111))/0x4+parseInt(_0xacc719(0xe1))/0x5+parseInt(_0xacc719(0xeb))/0x6+-parseInt(_0xacc719(0x104))/0x7+-parseInt(_0xacc719(0x121))/0x8*(parseInt(_0xacc719(0xef))/0x9);if(_0x5eed78===_0xe58807)break;else _0x3ddea9['push'](_0x3ddea9['shift']());}catch(_0x24cdec){_0x3ddea9['push'](_0x3ddea9['shift']());}}}(a8_0x468b,0xa1e10));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{withSpinner}from'../utils/spinner.js';import{parseAgentRef}from'../sdk/agent/agent-ref-parser.js';import{saveLastChatId,loadLastChatId}from'../sdk/llm/chat-cache.js';import{getLLMConversationUrl}from'../sdk/client/endpoints.js';function handleSDKError(_0x2dbf51,_0x2701f0){const _0x2462fe=a8_0x5dbc;if(_0x2dbf51 instanceof SDKError)console['error'](_0x2462fe(0x10e)+_0x2dbf51[_0x2462fe(0xfe)]),_0x2701f0[_0x2462fe(0x115)]&&(_0x2dbf51[_0x2462fe(0x106)]&&console[_0x2462fe(0xe9)](_0x2462fe(0xe7)+_0x2dbf51[_0x2462fe(0x106)]),_0x2dbf51[_0x2462fe(0xe5)]&&(console[_0x2462fe(0xe9)](_0x2462fe(0x116)),console['error'](_0x2dbf51[_0x2462fe(0xe5)])));else throw _0x2dbf51;}async function resolveAgentId(_0x5af050,_0x62b44,_0x3595b9,_0x224cfc,_0x1c236a){const _0x357ae0=a8_0x5dbc,_0x176b98=_0x62b44||_0x3595b9;if(_0x176b98){const {projectName:_0x4d9397,agentName:_0x27de40}=parseAgentRef(_0x176b98),_0x38fbe5=_0x27de40||_0x176b98,_0x2c693b=_0x27de40?_0x4d9397:_0x224cfc;if(!_0x2c693b)throw new Error('No\x20project\x20specified.\x20Use\x20\x22Project/Agent\x22\x20format\x20or\x20set\x20project\x20with\x20\x22tdx\x20use\x20llm_project\x22');if(_0x1c236a){const _0x5d6d24=_0x62b44?_0x357ae0(0x105):_0x357ae0(0xf3);console[_0x357ae0(0xe9)]('Using\x20agent\x20from\x20'+_0x5d6d24+':\x20'+_0x2c693b+'/'+_0x38fbe5);}const _0x34ebb1=await withSpinner(_0x357ae0(0xfa)+_0x2c693b+_0x357ae0(0x122),()=>_0x5af050[_0x357ae0(0xe3)][_0x357ae0(0x100)](_0x2c693b),{'verbose':_0x1c236a}),_0x27cb63=await withSpinner(_0x357ae0(0x12a)+_0x38fbe5+_0x357ae0(0x122),()=>_0x5af050['llm'][_0x357ae0(0xfc)](_0x38fbe5,_0x34ebb1[_0x357ae0(0xdd)]),{'verbose':_0x1c236a});return _0x27cb63[_0x357ae0(0xdd)];}else{const _0x5082a5=_0x5af050[_0x357ae0(0xe3)][_0x357ae0(0x11d)]();if(_0x5082a5)return _0x1c236a&&console[_0x357ae0(0xe9)](_0x357ae0(0x108)+_0x5082a5[_0x357ae0(0xec)]),_0x5082a5['id'];const _0x4e8990=await withSpinner(_0x357ae0(0xed),()=>_0x5af050[_0x357ae0(0xe3)][_0x357ae0(0x117)](_0x357ae0(0x11b),0x0),{'verbose':_0x1c236a});return _0x4e8990[_0x357ae0(0xdd)]['id'];}}function a8_0x5dbc(_0xa61152,_0x374e87){_0xa61152=_0xa61152-0xd8;const _0x468b03=a8_0x468b();let _0x5dbc88=_0x468b03[_0xa61152];return _0x5dbc88;}export class ChatCommand extends BaseCommand{[a8_0x508861(0xec)]=a8_0x508861(0x11e);[a8_0x508861(0xff)]=a8_0x508861(0x127);[a8_0x508861(0x128)](_0x3679ba){const _0x509e13=a8_0x508861,_0x47b6b5=_0x3679ba[_0x509e13(0xd9)][_0x509e13(0xea)]('\x20');if(!_0x47b6b5)return _0x509e13(0xfd);return undefined;}async['streamChat'](_0x22f858,_0x4f183c,_0xda42c2,_0x1ae738,_0x34c6f9){const _0x291802=a8_0x508861;for await(const _0x1b7b2c of _0x22f858[_0x291802(0xe3)]['chat'](_0x4f183c,{'agentId':_0xda42c2,'chatId':_0x1ae738})){if(_0x1b7b2c[_0x291802(0xf4)]===_0x291802(0x101)){const _0x1c8b38=_0x1b7b2c[_0x291802(0xdd)][_0x291802(0x118)];saveLastChatId(_0x1c8b38),_0x34c6f9&&console[_0x291802(0xe9)](_0x291802(0x123)+_0x1c8b38);}else _0x1b7b2c['type']===_0x291802(0xee)&&this[_0x291802(0x114)](_0x1b7b2c[_0x291802(0xdd)]);}}async[a8_0x508861(0x10a)](_0x5df0cc,_0x497657,_0x1f034e,_0x38239b){const _0x3900fb=a8_0x508861,_0x426a52=_0x5df0cc[_0x3900fb(0x11c)][_0x3900fb(0xe2)];let _0x69529=![];for await(const _0x913404 of _0x5df0cc['llm']['chat'](_0x497657,{'agentId':_0x1f034e,'chatId':_0x38239b})){if(_0x913404[_0x3900fb(0xf4)]===_0x3900fb(0x101)){const _0x57748d=_0x913404[_0x3900fb(0xdd)];saveLastChatId(_0x57748d['chatId']);const _0x52086a=_0x57748d['projectId']&&_0x57748d[_0x3900fb(0xde)]?getLLMConversationUrl(_0x426a52,_0x57748d['projectId'],_0x57748d[_0x3900fb(0xde)],_0x57748d[_0x3900fb(0x118)]):undefined;console[_0x3900fb(0x112)](JSON[_0x3900fb(0xe8)]({'type':_0x3900fb(0x101),'data':{'chatId':_0x57748d[_0x3900fb(0x118)],'agentId':_0x57748d[_0x3900fb(0xde)],'consoleUrl':_0x52086a}})),_0x69529=!![];}else{if(_0x913404[_0x3900fb(0xf4)]===_0x3900fb(0xee)){!_0x69529&&_0x38239b&&(console['log'](JSON['stringify']({'type':_0x3900fb(0x101),'data':{'chatId':_0x38239b}})),_0x69529=!![]);const _0x557cc9=_0x913404['data'];if(_0x3900fb(0x103)in _0x557cc9)console[_0x3900fb(0x112)](JSON['stringify']({'type':_0x3900fb(0x103),'data':{'content':_0x557cc9['content']}}));else{if(_0x3900fb(0x11f)in _0x557cc9){const _0x31acfd=_0x557cc9[_0x3900fb(0x11f)];console[_0x3900fb(0x112)](JSON[_0x3900fb(0xe8)]({'type':_0x3900fb(0x11f),'data':{'id':_0x31acfd['id'],'name':_0x31acfd[_0x3900fb(0xd8)],'target':_0x31acfd[_0x3900fb(0xf0)]?.[_0x3900fb(0xec)]||_0x31acfd[_0x3900fb(0x102)]?.[_0x3900fb(0xec)]||_0x31acfd[_0x3900fb(0x10d)]?.[_0x3900fb(0xec)]||_0x31acfd[_0x3900fb(0xdf)]}}));}else{if(_0x3900fb(0x113)in _0x557cc9)console['log'](JSON[_0x3900fb(0xe8)]({'type':'tool_result','data':{'id':_0x557cc9[_0x3900fb(0x113)]['id'],'name':_0x557cc9[_0x3900fb(0x113)][_0x3900fb(0xd8)],'result':typeof _0x557cc9[_0x3900fb(0x113)][_0x3900fb(0x103)]===_0x3900fb(0xf8)?_0x557cc9[_0x3900fb(0x113)][_0x3900fb(0x103)][_0x3900fb(0x10f)](0x0,0x1f4):''}}));else _0x3900fb(0xe9)in _0x557cc9&&console[_0x3900fb(0x112)](JSON[_0x3900fb(0xe8)]({'type':_0x3900fb(0xe9),'data':{'error':_0x557cc9[_0x3900fb(0xe9)]}}));}}}}}console[_0x3900fb(0x112)](JSON[_0x3900fb(0xe8)]({'type':_0x3900fb(0xf1)}));}async['execute'](_0x2f0309){const _0x25bfed=a8_0x508861,{options:_0x1aaebe,args:_0x486220,tdx:_0x4206ee}=_0x2f0309,_0x582392=_0x486220['join']('\x20'),_0x568fc2=_0x1aaebe,_0x2e613d=_0x568fc2[_0x25bfed(0xda)],_0x67baa8=_0x568fc2[_0x25bfed(0x126)],_0x57accb=_0x568fc2[_0x25bfed(0xfb)],_0x280dcd=_0x568fc2[_0x25bfed(0xf6)],_0xe182d5=_0x568fc2[_0x25bfed(0x118)],_0x1f01c7=_0x568fc2[_0x25bfed(0x120)];if(_0x280dcd&&_0xe182d5)return console[_0x25bfed(0xe9)](_0x25bfed(0xe0)),0x1;try{let _0x5e6caa,_0x309ff3;if(_0xe182d5)_0x309ff3=_0xe182d5;else!_0x280dcd&&(_0x309ff3=loadLastChatId(),_0x309ff3&&_0x1aaebe[_0x25bfed(0x115)]&&console[_0x25bfed(0xe9)](_0x25bfed(0x109)+_0x309ff3));!_0xe182d5&&(_0x280dcd||!_0x309ff3)&&(_0x5e6caa=await resolveAgentId(_0x4206ee,_0x2e613d,_0x67baa8,_0x57accb,_0x1aaebe[_0x25bfed(0x115)]));const _0x5005de=_0x1f01c7?(_0x24029d,_0x2a6e47,_0x220906)=>this[_0x25bfed(0x10a)](_0x4206ee,_0x24029d,_0x2a6e47,_0x220906):(_0xcc81cf,_0x5b917a,_0xbb349c)=>this[_0x25bfed(0xf7)](_0x4206ee,_0xcc81cf,_0x5b917a,_0xbb349c,_0x1aaebe[_0x25bfed(0x115)]);try{await _0x5005de(_0x582392,_0x5e6caa,_0x309ff3);}catch(_0xd0181b){const _0x3b5ff6=_0xd0181b instanceof SDKError&&_0xd0181b[_0x25bfed(0x129)]===ErrorCode[_0x25bfed(0x125)]||_0xd0181b instanceof Error&&_0xd0181b[_0x25bfed(0xfe)][_0x25bfed(0xdb)](_0x25bfed(0xe6));if(_0x3b5ff6&&_0xe182d5)return console[_0x25bfed(0xe9)](_0x25bfed(0x11a)+_0xe182d5+_0x25bfed(0x10c)),0x1;if(_0x3b5ff6)_0x1aaebe[_0x25bfed(0x115)]&&console['error'](_0x25bfed(0xf2)),!_0x5e6caa&&(_0x5e6caa=await resolveAgentId(_0x4206ee,_0x2e613d,_0x67baa8,_0x57accb,_0x1aaebe['verbose'])),await _0x5005de(_0x582392,_0x5e6caa,undefined);else throw _0xd0181b;}return!_0x1f01c7&&console['log'](),0x0;}catch(_0x517606){return console[_0x25bfed(0xe9)](),handleSDKError(_0x517606,_0x1aaebe),0x1;}}[a8_0x508861(0x114)](_0x5c935e){const _0x21dcfc=a8_0x508861;if(_0x21dcfc(0x103)in _0x5c935e)process['stdout'][_0x21dcfc(0xe4)](_0x5c935e[_0x21dcfc(0x103)]);else _0x21dcfc(0xe9)in _0x5c935e&&console[_0x21dcfc(0xe9)](_0x21dcfc(0xdc)+_0x5c935e[_0x21dcfc(0xe9)]);}}export class ChatCreateCommand extends BaseCommand{[a8_0x508861(0xec)]=a8_0x508861(0x107);['description']=a8_0x508861(0x124);[a8_0x508861(0x128)](_0x4f6da3){const _0x240688=a8_0x508861,_0x2d7c63=_0x4f6da3['options'],_0x3dc980=_0x2d7c63[_0x240688(0xda)],_0x49c6d5=_0x2d7c63[_0x240688(0x126)];if(!_0x3dc980&&!_0x49c6d5)return _0x240688(0x119);return undefined;}async[a8_0x508861(0xf9)](_0x6d16dd){const _0x55ab06=a8_0x508861,{options:_0x1ffeec,tdx:_0x597cf8}=_0x6d16dd,_0xc05c46=_0x1ffeec,_0x59d902=_0xc05c46[_0x55ab06(0xda)],_0x403dfc=_0xc05c46['llmAgent'],_0x545be9=_0xc05c46[_0x55ab06(0xfb)];try{const _0x35ed78=await resolveAgentId(_0x597cf8,_0x59d902,_0x403dfc,_0x545be9,_0x1ffeec['verbose']),_0x81588a=await _0x597cf8['llm']['startChat'](_0x35ed78);return saveLastChatId(_0x81588a['id']),console[_0x55ab06(0x112)](JSON[_0x55ab06(0xe8)]({'chatId':_0x81588a['id'],'agentId':_0x35ed78})),0x0;}catch(_0x57005f){return handleSDKError(_0x57005f,_0x1ffeec),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;}}}
|