@treasuredata/tdx 2026.3.13 → 2026.3.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-login-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.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/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.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/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a3_0x2a84(_0x504d38,_0x2366bd){_0x504d38=_0x504d38-0x110;const _0x40fa50=a3_0x40fa();let _0x2a845a=_0x40fa50[_0x504d38];return _0x2a845a;}const a3_0x573811=a3_0x2a84;(function(_0x4cb59d,_0x3fa09f){const _0x2b9f71=a3_0x2a84,_0x3ffa16=_0x4cb59d();while(!![]){try{const _0x45d979=parseInt(_0x2b9f71(0x121))/0x1+parseInt(_0x2b9f71(0x127))/0x2+-parseInt(_0x2b9f71(0x11b))/0x3*(-parseInt(_0x2b9f71(0x133))/0x4)+parseInt(_0x2b9f71(0x130))/0x5+parseInt(_0x2b9f71(0x114))/0x6*(parseInt(_0x2b9f71(0x122))/0x7)+parseInt(_0x2b9f71(0x132))/0x8*(-parseInt(_0x2b9f71(0x12f))/0x9)+parseInt(_0x2b9f71(0x12b))/0xa*(-parseInt(_0x2b9f71(0x11e))/0xb);if(_0x45d979===_0x3fa09f)break;else _0x3ffa16['push'](_0x3ffa16['shift']());}catch(_0x5f352d){_0x3ffa16['push'](_0x3ffa16['shift']());}}}(a3_0x40fa,0x38b1f));function a3_0x40fa(){const _0x2b2eca=['Usage:\x20tdx\x20activations\x20<parent_name/child_name>','9171wfYExo','1171370BFdCbx','activations','424eSqwXn','932xfMbop','cause','Resolving\x20child\x20segment\x20\x27','Resolved\x20child\x20ID:\x20','error','296202yqgnMx','verbose','resolveSegmentId','length','✔\x20Found\x20','Listing\x20activations\x20for\x20segment\x20\x27','message','1119kyYJqN','segment','Site:\x20','3212ufeCIe','Child\x20name:\x20','data','454435yDKJfy','42Cmsyat','Error:\x20','execute','List\x20activations\x20for\x20a\x20segment','\x20\x20Cause:\x20','646852jLJDOT','\x27...','description','\x20activation','37980BQenkI','Parent\x20name:\x20','Resolving\x20parent\x20segment\x20\x27'];a3_0x40fa=function(){return _0x2b2eca;};return a3_0x40fa();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{['name']=a3_0x573811(0x131);[a3_0x573811(0x129)]=a3_0x573811(0x125);async[a3_0x573811(0x124)](_0x5c10bc){const _0x5b08b0=a3_0x573811,{options:_0x5da102,args:_0x235758,tdx:_0x4f4b01}=_0x5c10bc;if(_0x235758['length']===0x0)return console[_0x5b08b0(0x113)]('Error:\x20Segment\x20name\x20is\x20required'),console[_0x5b08b0(0x113)](_0x5b08b0(0x12e)),0x1;try{const {parentId:_0x40e5fe,childId:_0x51fcdf}=parseSegmentRef(_0x235758[0x0]);if(!_0x51fcdf)return console['error']('Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations'),console['error'](_0x5b08b0(0x12e)),0x1;_0x5da102[_0x5b08b0(0x115)]&&(console[_0x5b08b0(0x113)](_0x5b08b0(0x11d)+_0x5da102['site']),console['error'](_0x5b08b0(0x12c)+_0x40e5fe),console[_0x5b08b0(0x113)](_0x5b08b0(0x11f)+_0x51fcdf));const _0x25b6ed=await withSpinner(_0x5b08b0(0x12d)+_0x40e5fe+_0x5b08b0(0x128),()=>_0x4f4b01[_0x5b08b0(0x11c)]['resolveParentId'](_0x40e5fe),{'verbose':_0x5da102[_0x5b08b0(0x115)]}),_0x2c8825=_0x25b6ed[_0x5b08b0(0x120)];_0x5da102[_0x5b08b0(0x115)]&&console[_0x5b08b0(0x113)]('Resolved\x20parent\x20ID:\x20'+_0x2c8825);const _0x29945c=await withSpinner(_0x5b08b0(0x111)+_0x51fcdf+'\x27...',()=>_0x4f4b01[_0x5b08b0(0x11c)][_0x5b08b0(0x116)](_0x2c8825,_0x51fcdf),{'verbose':_0x5da102[_0x5b08b0(0x115)]}),_0x15df64=_0x29945c[_0x5b08b0(0x120)];_0x5da102[_0x5b08b0(0x115)]&&console[_0x5b08b0(0x113)](_0x5b08b0(0x112)+_0x15df64);const _0x194f26=await withSpinner(_0x5b08b0(0x119)+_0x51fcdf+_0x5b08b0(0x128),()=>_0x4f4b01[_0x5b08b0(0x11c)]['listActivations'](_0x2c8825,_0x15df64),{'verbose':_0x5da102['verbose']}),_0x21668f=_0x194f26[_0x5b08b0(0x120)];return console[_0x5b08b0(0x113)](_0x5b08b0(0x118)+_0x21668f[_0x5b08b0(0x117)]+_0x5b08b0(0x12a)+(_0x21668f[_0x5b08b0(0x117)]!==0x1?'s':'')),await handleSDKOutput(_0x21668f,_0x5da102),0x0;}catch(_0x57c4f5){if(_0x57c4f5 instanceof SDKError)return console[_0x5b08b0(0x113)](_0x5b08b0(0x123)+_0x57c4f5[_0x5b08b0(0x11a)]),_0x57c4f5[_0x5b08b0(0x110)]&&console[_0x5b08b0(0x113)](_0x5b08b0(0x126)+_0x57c4f5['cause']),0x1;throw _0x57c4f5;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x32ab7b=a4_0x2ecc;(function(_0x1cad84,_0x58f866){const _0x2bbf5c=a4_0x2ecc,_0x364a4e=_0x1cad84();while(!![]){try{const _0x1c0ea0=-parseInt(_0x2bbf5c(0x20d))/0x1*(parseInt(_0x2bbf5c(0x1fc))/0x2)+-parseInt(_0x2bbf5c(0x175))/0x3*(parseInt(_0x2bbf5c(0x1ba))/0x4)+-parseInt(_0x2bbf5c(0x1ee))/0x5*(-parseInt(_0x2bbf5c(0x1f6))/0x6)+-parseInt(_0x2bbf5c(0x1e1))/0x7+-parseInt(_0x2bbf5c(0x1a8))/0x8*(parseInt(_0x2bbf5c(0x222))/0x9)+-parseInt(_0x2bbf5c(0x1b7))/0xa*(parseInt(_0x2bbf5c(0x226))/0xb)+parseInt(_0x2bbf5c(0x20e))/0xc;if(_0x1c0ea0===_0x58f866)break;else _0x364a4e['push'](_0x364a4e['shift']());}catch(_0x1373b3){_0x364a4e['push'](_0x364a4e['shift']());}}}(a4_0xca79,0xdf8e5));import a4_0x2a6b51 from'chalk';import a4_0xa48faf from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';function a4_0x2ecc(_0x256d0f,_0x587073){_0x256d0f=_0x256d0f-0x172;const _0xca7962=a4_0xca79();let _0x2ecc74=_0xca7962[_0x256d0f];return _0x2ecc74;}function a4_0xca79(){const _0x7b8da2=['Errors:','Agent:\x20','<new-name>','hasChanges','outputPath','knowledgeBases','6EpOMZd','message','\x22\x20to\x20new\x20project\x20\x22','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project','Pulling\x20agent\x20\x22','2qhadIO','join','execute','dryRun','\x0aWrite\x20','cyan','\x0aPull\x20summary\x20for\x20\x27','✔\x20Context\x20set:\x20','integrations','\x20updated','site','action','\x20\x20Knowledge\x20Base\x20\x22','pushAgent','Output\x20path:\x20','dim','newProjectName','1727014KMWKRe','67777152kAJJSc','new','\x20\x20Knowledge\x20Bases:\x20','\x22\x20from\x20project\x20\x22','experimentalKnowledgeBases','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','newProjectId','Chat:\x20','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','created','agent:clone','-\x20nothing\x20pushed','\x0aChanges\x20to\x20agent\x20\x27','projectId','total','Status:\x20','New\x20project:\x20','Project:\x20','cloneProject','1053153tQIPrr','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','cwd-config','\x20changed','4941299HlVzff','\x0aProject\x20pushed\x20with\x20errors','\x20resources?','\x22\x20to\x20a\x20different\x20profile','1169340qrATsO','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','errors','\x0aChanges\x20to\x20integration\x20\x27','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','textKnowledgeBases','\x20created','Would\x20pull\x20agent:\x20','yellow','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','gray','cwd','Agent\x20','name','Writing\x20files...','\x20\x20Target:\x20','llm_project','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','No\x20tdx.json\x20found\x20in\x20','projectName','\x0aError:','no_context','\x20new','description','Using\x20current\x20project:\x20','\x0aPush\x20','INVALID_ARGUMENT','\x20\x20Integrations:\x20','green','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','Analyzing\x20project\x20\x22','repeat','New\x20project\x20name\x20is\x20required','\x20successfully','Summary:','\x20files?','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','Would\x20push\x20agent:\x20','\x0aChanges\x20to\x20prompt\x20\x27','\x20|\x20','Cancelled','context','diff','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','\x20\x20Agents:\x20','Using\x20context\x20project:\x20','\x20=\x20','\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)','log','\x20--name\x20','error','32AxrXpd','\x20unchanged','Source:\x20','\x20\x20Prompts:\x20','Pushing\x20to\x20project...','agentName','prompts','push','Dry\x20run\x20-\x20no\x20files\x20written','Project\x20cloned\x20with\x20errors','counts','\x20--profile\x20','agentId','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20errors','10cFaVok','yes','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','8ygROHr','utf-8','pullProject','agent.yml','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','arg-dir','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','outputDir','Using\x20project\x20from\x20','agent:push','\x20\x20Experimental\x20Artifact\x20\x22','\x22\x20to\x20\x22','Using\x20project:\x20','red','session','pushProject','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x20\x20Integration\x20\x22','parse','llm','sourceProjectName','experimentalArtifacts','Cannot\x20clone\x20from\x20context\x20project\x20\x22','\x0a✔\x20Pushed\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project','Using\x20local\x20project:\x20','agent:pull','\x20total','unchanged','Dry\x20run\x20-\x20no\x20changes\x20made','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','tdx.json','reason','\x20\x20tdx\x20agent\x20clone\x20agents/','\x20\x20Experimental\x20Artifacts:\x20','MISSING_ARGUMENT','-\x20no\x20files\x20written','\x22:\x20','11613091wsIreW','\x22...','\x20\x20Prompt\x20\x22','dirname','llmProject','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','updated','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','agents','\x0aPush\x20summary\x20for\x20\x27','Pushing\x20agent\x20from\x20\x22','force','projectDir','1752265glUVpO','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project'];a4_0xca79=function(){return _0x7b8da2;};return a4_0xca79();}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(_0x2ecc74){const _0x1045d7=a4_0x2ecc,_0x548536=[];if(_0x2ecc74[_0x1045d7(0x21d)]!==undefined)_0x548536[_0x1045d7(0x1af)](_0x2ecc74[_0x1045d7(0x21d)]+_0x1045d7(0x1d5));if(_0x2ecc74[_0x1045d7(0x20f)]!==undefined&&_0x2ecc74[_0x1045d7(0x20f)]>0x0)_0x548536[_0x1045d7(0x1af)](a4_0x2a6b51['green'](_0x2ecc74[_0x1045d7(0x20f)]+'\x20new'));if(_0x2ecc74[_0x1045d7(0x218)]!==undefined&&_0x2ecc74['created']>0x0)_0x548536['push'](a4_0x2a6b51[_0x1045d7(0x191)](_0x2ecc74[_0x1045d7(0x218)]+_0x1045d7(0x17b)));if(_0x2ecc74[_0x1045d7(0x1e7)]!==undefined&&_0x2ecc74[_0x1045d7(0x1e7)]>0x0)_0x548536[_0x1045d7(0x1af)](a4_0x2a6b51['yellow'](_0x2ecc74['updated']+_0x1045d7(0x205)));if(_0x2ecc74[_0x1045d7(0x1d6)]!==undefined&&_0x2ecc74[_0x1045d7(0x1d6)]>0x0)_0x548536[_0x1045d7(0x1af)](a4_0x2a6b51[_0x1045d7(0x17f)](_0x2ecc74[_0x1045d7(0x1d6)]+'\x20unchanged'));if(_0x2ecc74[_0x1045d7(0x177)]!==undefined&&_0x2ecc74[_0x1045d7(0x177)]>0x0)_0x548536['push'](a4_0x2a6b51[_0x1045d7(0x1c7)](_0x2ecc74[_0x1045d7(0x177)]+_0x1045d7(0x1b6)));return _0x548536[_0x1045d7(0x1fd)](',\x20');}function displayDiffs(_0x5a72b1,_0x507505,_0x1e596d,_0x19f890,_0x2f4706,_0x44794f,_0x415693){const _0x4cbb1b=a4_0x2ecc;for(const _0x1578d3 of _0x5a72b1){if(_0x1578d3['diff']){const _0x126402=_0x1578d3[_0x4cbb1b(0x1ad)]||_0x1578d3['name'];console[_0x4cbb1b(0x1a5)](_0x4cbb1b(0x21b)+_0x126402+'\x27:'),console['log']('─'[_0x4cbb1b(0x194)](0x3c)),console[_0x4cbb1b(0x1a5)](_0x1578d3[_0x4cbb1b(0x19f)]),console[_0x4cbb1b(0x1a5)]('─'['repeat'](0x3c));}}for(const _0x2cfa24 of _0x507505){_0x2cfa24[_0x4cbb1b(0x19f)]&&(console[_0x4cbb1b(0x1a5)]('\x0aChanges\x20to\x20knowledge\x20base\x20\x27'+_0x2cfa24['name']+'\x27:'),console[_0x4cbb1b(0x1a5)]('─'[_0x4cbb1b(0x194)](0x3c)),console[_0x4cbb1b(0x1a5)](_0x2cfa24['diff']),console[_0x4cbb1b(0x1a5)]('─'[_0x4cbb1b(0x194)](0x3c)));}for(const _0x3c7d73 of _0x1e596d){_0x3c7d73['diff']&&(console[_0x4cbb1b(0x1a5)](_0x4cbb1b(0x17e)+_0x3c7d73[_0x4cbb1b(0x182)]+'\x27:'),console[_0x4cbb1b(0x1a5)]('─'[_0x4cbb1b(0x194)](0x3c)),console[_0x4cbb1b(0x1a5)](_0x3c7d73[_0x4cbb1b(0x19f)]),console[_0x4cbb1b(0x1a5)]('─'['repeat'](0x3c)));}for(const _0x30025a of _0x19f890){_0x30025a[_0x4cbb1b(0x19f)]&&(console[_0x4cbb1b(0x1a5)](_0x4cbb1b(0x19b)+_0x30025a[_0x4cbb1b(0x182)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x4cbb1b(0x1a5)](_0x30025a[_0x4cbb1b(0x19f)]),console[_0x4cbb1b(0x1a5)]('─'[_0x4cbb1b(0x194)](0x3c)));}for(const _0xb3f26c of _0x2f4706){_0xb3f26c[_0x4cbb1b(0x19f)]&&(console['log'](_0x4cbb1b(0x178)+_0xb3f26c['name']+'\x27:'),console['log']('─'[_0x4cbb1b(0x194)](0x3c)),console[_0x4cbb1b(0x1a5)](_0xb3f26c[_0x4cbb1b(0x19f)]),console[_0x4cbb1b(0x1a5)]('─'['repeat'](0x3c)));}for(const _0x134c33 of _0x44794f){_0x134c33[_0x4cbb1b(0x19f)]&&(console['log'](_0x4cbb1b(0x216)+_0x134c33[_0x4cbb1b(0x182)]+'\x27:'),console[_0x4cbb1b(0x1a5)]('─'[_0x4cbb1b(0x194)](0x3c)),console[_0x4cbb1b(0x1a5)](_0x134c33[_0x4cbb1b(0x19f)]),console[_0x4cbb1b(0x1a5)]('─'['repeat'](0x3c)));}for(const _0x5f22fe of _0x415693){_0x5f22fe[_0x4cbb1b(0x19f)]&&(console[_0x4cbb1b(0x1a5)]('\x0aChanges\x20to\x20experimental\x20artifact\x20\x27'+_0x5f22fe[_0x4cbb1b(0x182)]+'\x27:'),console[_0x4cbb1b(0x1a5)]('─'[_0x4cbb1b(0x194)](0x3c)),console['log'](_0x5f22fe[_0x4cbb1b(0x19f)]),console[_0x4cbb1b(0x1a5)]('─'[_0x4cbb1b(0x194)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x32ab7b(0x182)]=a4_0x32ab7b(0x1d4);[a4_0x32ab7b(0x18c)]=a4_0x32ab7b(0x223);async[a4_0x32ab7b(0x1fe)](_0x141f2d){const _0x14a7fe=a4_0x32ab7b,{options:_0x1b9dff,args:_0x4f7a69,tdx:_0x26551f}=_0x141f2d,_0x141bef=_0x4f7a69[0x0],_0x5a2010=_0x4f7a69[0x1],_0x52950f=_0x1b9dff['output'],_0x4bf253=_0x1b9dff[_0x14a7fe(0x1ff)],_0x4c4a00=_0x1b9dff[_0x14a7fe(0x1ec)],_0x52fd54=_0x1b9dff['yes'],_0x28d81b=_0x1b9dff[_0x14a7fe(0x1e5)],_0x4e56f3=_0x1b9dff['agent'];let _0x10f45d;if(_0x141bef){const _0x295c4e=a4_0xa48faf[_0x14a7fe(0x1fd)](_0x141bef,_0x14a7fe(0x1da));if(existsSync(_0x295c4e))try{const _0x40de10=JSON[_0x14a7fe(0x1cc)](readFileSync(_0x295c4e,_0x14a7fe(0x1bb)));_0x40de10[_0x14a7fe(0x185)]&&(_0x10f45d={'llm_project':_0x40de10[_0x14a7fe(0x185)]});}catch{}}const _0x2b87ce=findAgentConfigPath(process[_0x14a7fe(0x180)]());let _0x575c01;if(_0x2b87ce)try{const _0x554168=JSON[_0x14a7fe(0x1cc)](readFileSync(_0x2b87ce,_0x14a7fe(0x1bb)));_0x554168['llm_project']&&(_0x575c01={'llm_project':_0x554168['llm_project']});}catch{}const _0x337e04=resolveAgentPullArgs({'arg':_0x141bef,'agentNameArg':_0x5a2010,'agentFlag':_0x4e56f3,'contextProject':_0x28d81b,'argDirConfig':_0x10f45d,'cwdConfigPath':_0x2b87ce||undefined,'cwdConfig':_0x575c01}),{projectNameOrId:_0x46b24d,targetAgentName:_0x57e29e,existingOutputDir:_0x3e33fe,source:_0x1cc744}=_0x337e04;if(_0x1cc744===_0x14a7fe(0x1bf))console[_0x14a7fe(0x1a5)](a4_0x2a6b51[_0x14a7fe(0x20b)](_0x14a7fe(0x1c2)+a4_0xa48faf[_0x14a7fe(0x1fd)](_0x141bef,_0x14a7fe(0x1da))+':\x20'+_0x46b24d));else{if(_0x1cc744===_0x14a7fe(0x224))console['log'](a4_0x2a6b51[_0x14a7fe(0x20b)](_0x14a7fe(0x1c6)+_0x46b24d));else _0x1cc744==='context'&&console['log'](a4_0x2a6b51['dim']('Using\x20project\x20from\x20context:\x20'+_0x46b24d));}if(!_0x46b24d)return _0x4e56f3?(console[_0x14a7fe(0x1a5)](a4_0x2a6b51[_0x14a7fe(0x17d)]('The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a')),console['log']('Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>'),console[_0x14a7fe(0x1a5)]('Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>')):(console[_0x14a7fe(0x1a5)](a4_0x2a6b51[_0x14a7fe(0x17d)](_0x14a7fe(0x199))),console[_0x14a7fe(0x1a5)]('Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)'),console['log']('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project'),console[_0x14a7fe(0x1a5)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory'),console[_0x14a7fe(0x1a5)](_0x14a7fe(0x1fa)),console[_0x14a7fe(0x1a5)](_0x14a7fe(0x1d2))),0x1;if(_0x57e29e){const {data:_0x36e89d}=await withSpinner(_0x14a7fe(0x1fb)+_0x57e29e+_0x14a7fe(0x211)+_0x46b24d+_0x14a7fe(0x1e2),()=>_0x26551f[_0x14a7fe(0x1cd)]['pullAgent'](_0x46b24d,_0x57e29e,_0x52950f,{'dryRun':_0x4bf253,'force':_0x4c4a00}));if(_0x4bf253)return console[_0x14a7fe(0x1a5)](a4_0x2a6b51[_0x14a7fe(0x17d)](_0x14a7fe(0x1b0))),console[_0x14a7fe(0x1a5)](_0x14a7fe(0x17c)+_0x36e89d[_0x14a7fe(0x1ad)]),console[_0x14a7fe(0x1a5)](_0x14a7fe(0x20a)+_0x36e89d[_0x14a7fe(0x1f4)]),_0x36e89d[_0x14a7fe(0x19f)]&&(console[_0x14a7fe(0x1a5)]('\x0aChanges:'),console[_0x14a7fe(0x1a5)]('─'[_0x14a7fe(0x194)](0x3c)),console['log'](_0x36e89d[_0x14a7fe(0x19f)]),console[_0x14a7fe(0x1a5)]('─'[_0x14a7fe(0x194)](0x3c))),0x0;return console[_0x14a7fe(0x1a5)](a4_0x2a6b51['green']('Agent\x20pulled\x20successfully')),console['log'](_0x14a7fe(0x1f1)+_0x36e89d[_0x14a7fe(0x1ad)]),console[_0x14a7fe(0x1a5)]('Output:\x20'+_0x36e89d[_0x14a7fe(0x1f4)]),console['log'](_0x14a7fe(0x21e)+(_0x36e89d['isNew']?a4_0x2a6b51['green'](_0x14a7fe(0x20f)):_0x36e89d[_0x14a7fe(0x1f3)]?a4_0x2a6b51[_0x14a7fe(0x17d)](_0x14a7fe(0x1e7)):a4_0x2a6b51[_0x14a7fe(0x17f)]('unchanged'))),0x0;}const _0x58065f=_0x3e33fe||_0x52950f,{data:_0x3236dc}=await withSpinner(_0x14a7fe(0x193)+_0x46b24d+_0x14a7fe(0x1e2),()=>_0x26551f[_0x14a7fe(0x1cd)][_0x14a7fe(0x1bc)](_0x46b24d,_0x58065f,{'dryRun':!![]})),_0x59ed0d=_0x3236dc[_0x14a7fe(0x1b2)][_0x14a7fe(0x1e9)][_0x14a7fe(0x20f)]+_0x3236dc[_0x14a7fe(0x1b2)][_0x14a7fe(0x1f5)][_0x14a7fe(0x20f)]+_0x3236dc['counts'][_0x14a7fe(0x17a)][_0x14a7fe(0x20f)]+_0x3236dc[_0x14a7fe(0x1b2)][_0x14a7fe(0x1ae)][_0x14a7fe(0x20f)]+_0x3236dc['counts'][_0x14a7fe(0x204)][_0x14a7fe(0x20f)]+_0x3236dc[_0x14a7fe(0x1b2)][_0x14a7fe(0x212)][_0x14a7fe(0x20f)]+_0x3236dc[_0x14a7fe(0x1b2)]['experimentalArtifacts']['new'],_0x24491d=_0x3236dc[_0x14a7fe(0x1b2)]['agents'][_0x14a7fe(0x1e7)]+_0x3236dc[_0x14a7fe(0x1b2)][_0x14a7fe(0x1f5)][_0x14a7fe(0x1e7)]+_0x3236dc['counts']['textKnowledgeBases'][_0x14a7fe(0x1e7)]+_0x3236dc[_0x14a7fe(0x1b2)][_0x14a7fe(0x1ae)][_0x14a7fe(0x1e7)]+_0x3236dc['counts'][_0x14a7fe(0x204)][_0x14a7fe(0x1e7)]+_0x3236dc[_0x14a7fe(0x1b2)][_0x14a7fe(0x212)][_0x14a7fe(0x1e7)]+_0x3236dc[_0x14a7fe(0x1b2)][_0x14a7fe(0x1cf)][_0x14a7fe(0x1e7)],_0x4db0f9=_0x3236dc[_0x14a7fe(0x1b2)][_0x14a7fe(0x1e9)]['unchanged']+_0x3236dc[_0x14a7fe(0x1b2)]['knowledgeBases'][_0x14a7fe(0x1d6)]+_0x3236dc['counts']['textKnowledgeBases'][_0x14a7fe(0x1d6)]+_0x3236dc[_0x14a7fe(0x1b2)][_0x14a7fe(0x1ae)][_0x14a7fe(0x1d6)]+_0x3236dc[_0x14a7fe(0x1b2)][_0x14a7fe(0x204)][_0x14a7fe(0x1d6)]+_0x3236dc['counts']['experimentalKnowledgeBases'][_0x14a7fe(0x1d6)]+_0x3236dc[_0x14a7fe(0x1b2)]['experimentalArtifacts'][_0x14a7fe(0x1d6)];console[_0x14a7fe(0x1a5)](_0x14a7fe(0x202)+_0x3236dc[_0x14a7fe(0x188)]+'\x27:'),console[_0x14a7fe(0x1a5)]('\x20\x20'+a4_0x2a6b51[_0x14a7fe(0x191)]('+\x20'+_0x59ed0d+'\x20new')+_0x14a7fe(0x19c)+a4_0x2a6b51[_0x14a7fe(0x17d)]('~\x20'+_0x24491d+_0x14a7fe(0x225))+_0x14a7fe(0x19c)+a4_0x2a6b51[_0x14a7fe(0x20b)]('=\x20'+_0x4db0f9+_0x14a7fe(0x1a9))),console[_0x14a7fe(0x1a5)]('\x20\x20Agents:\x20'+formatCountSummary(_0x3236dc[_0x14a7fe(0x1b2)][_0x14a7fe(0x1e9)])),console[_0x14a7fe(0x1a5)](_0x14a7fe(0x210)+formatCountSummary(_0x3236dc[_0x14a7fe(0x1b2)][_0x14a7fe(0x1f5)])),console[_0x14a7fe(0x1a5)](_0x14a7fe(0x1f9)+formatCountSummary(_0x3236dc[_0x14a7fe(0x1b2)][_0x14a7fe(0x17a)])),console[_0x14a7fe(0x1a5)](_0x14a7fe(0x1ab)+formatCountSummary(_0x3236dc['counts'][_0x14a7fe(0x1ae)])),console[_0x14a7fe(0x1a5)](_0x14a7fe(0x190)+formatCountSummary(_0x3236dc['counts']['integrations']));const _0x10c1a7=_0x3236dc[_0x14a7fe(0x1b2)][_0x14a7fe(0x212)]['total']>0x0||_0x3236dc[_0x14a7fe(0x1b2)][_0x14a7fe(0x1cf)]['total']>0x0;_0x10c1a7&&(console[_0x14a7fe(0x1a5)](_0x14a7fe(0x1c0)+formatCountSummary(_0x3236dc['counts'][_0x14a7fe(0x212)])),console[_0x14a7fe(0x1a5)](_0x14a7fe(0x1dd)+formatCountSummary(_0x3236dc[_0x14a7fe(0x1b2)][_0x14a7fe(0x1cf)])));console[_0x14a7fe(0x1a5)](_0x14a7fe(0x184)+a4_0x2a6b51[_0x14a7fe(0x201)](_0x3236dc[_0x14a7fe(0x1c1)])),displayDiffs(_0x3236dc['agents'],_0x3236dc['knowledgeBases'],_0x3236dc[_0x14a7fe(0x17a)],_0x3236dc['prompts'],_0x3236dc[_0x14a7fe(0x204)],_0x3236dc[_0x14a7fe(0x212)],_0x3236dc[_0x14a7fe(0x1cf)]);if(_0x4bf253)return console[_0x14a7fe(0x1a5)](a4_0x2a6b51['yellow']('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x59ed0d===0x0&&_0x24491d===0x0)return console[_0x14a7fe(0x1a5)](a4_0x2a6b51[_0x14a7fe(0x191)](_0x14a7fe(0x213))),saveSessionContext({'llm_project':_0x3236dc['projectName']},_0x1b9dff['session']),console[_0x14a7fe(0x1a5)](a4_0x2a6b51[_0x14a7fe(0x191)]('✔\x20Context\x20set:\x20'+a4_0x2a6b51['dim'](_0x14a7fe(0x185))+_0x14a7fe(0x1a3)+a4_0x2a6b51[_0x14a7fe(0x201)](_0x3236dc[_0x14a7fe(0x188)]))),0x0;if(!_0x52fd54&&!_0x4c4a00){if(!isInteractive())return console[_0x14a7fe(0x1a7)](a4_0x2a6b51[_0x14a7fe(0x1c7)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x14a7fe(0x1a7)](a4_0x2a6b51[_0x14a7fe(0x20b)](_0x14a7fe(0x1b5))),0x1;const _0x3b48e5=await confirmKey(_0x14a7fe(0x200)+(_0x59ed0d+_0x24491d)+_0x14a7fe(0x198));if(!_0x3b48e5)return console[_0x14a7fe(0x1a5)](a4_0x2a6b51[_0x14a7fe(0x17d)]('Cancelled'),_0x14a7fe(0x1df)),0x1;}const {data:_0x2240c4}=await withSpinner(_0x14a7fe(0x183),()=>_0x26551f[_0x14a7fe(0x1cd)]['pullProject'](_0x46b24d,_0x58065f,{'force':_0x4c4a00}));return console[_0x14a7fe(0x1a5)](a4_0x2a6b51[_0x14a7fe(0x191)]('\x0a✔\x20Pulled\x20'+(_0x59ed0d+_0x24491d)+'\x20files\x20to\x20'+_0x2240c4[_0x14a7fe(0x1c1)])),saveSessionContext({'llm_project':_0x2240c4[_0x14a7fe(0x188)]},_0x1b9dff[_0x14a7fe(0x1c8)]),console[_0x14a7fe(0x1a5)](a4_0x2a6b51['green'](_0x14a7fe(0x203)+a4_0x2a6b51[_0x14a7fe(0x20b)](_0x14a7fe(0x185))+'\x20=\x20'+a4_0x2a6b51[_0x14a7fe(0x201)](_0x2240c4[_0x14a7fe(0x188)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']=a4_0x32ab7b(0x219);['description']=a4_0x32ab7b(0x1e6);async[a4_0x32ab7b(0x1fe)](_0xadd488){const _0x2390c1=a4_0x32ab7b,{options:_0x1764f3,args:_0x154608,tdx:_0x3f6256}=_0xadd488,_0x1618b3=_0x154608[0x0],_0x4f23eb=_0x1764f3[_0x2390c1(0x182)],_0x42df3f=_0x1764f3[_0x2390c1(0x1ff)],_0xe460e4=_0x1764f3[_0x2390c1(0x1b8)],_0x1377fd=_0x1764f3[_0x2390c1(0x206)],_0xf11b80=_0x1764f3[_0x2390c1(0x1e5)];let _0x2b0626;const _0x3c8ddc=findAgentConfigPath(process[_0x2390c1(0x180)]());if(_0x1618b3){const _0x318c93=a4_0xa48faf['join'](_0x1618b3,'tdx.json');existsSync(_0x318c93)?(_0x2b0626=_0x1618b3,console['log'](a4_0x2a6b51[_0x2390c1(0x20b)](_0x2390c1(0x1d3)+_0x1618b3))):_0x2b0626=_0x1618b3;}else{if(_0x3c8ddc)_0x2b0626=a4_0xa48faf[_0x2390c1(0x1e4)](_0x3c8ddc),console[_0x2390c1(0x1a5)](a4_0x2a6b51[_0x2390c1(0x20b)](_0x2390c1(0x18d)+_0x2b0626));else{if(_0xf11b80){const _0x3ddd5b=sanitizeForFilesystem(_0xf11b80);let _0x65f2dd=_0x3ddd5b,_0x3fd542=a4_0xa48faf['join'](process[_0x2390c1(0x180)](),_0x2390c1(0x1e9),_0x3ddd5b,_0x2390c1(0x1da));if(!existsSync(_0x3fd542)){const _0x4996a9=normalizeName(_0xf11b80),_0xaddd2=a4_0xa48faf['join'](process[_0x2390c1(0x180)](),_0x2390c1(0x1e9),_0x4996a9,_0x2390c1(0x1da));existsSync(_0xaddd2)&&(_0x65f2dd=_0x4996a9,_0x3fd542=_0xaddd2);}if(existsSync(_0x3fd542))_0x2b0626=a4_0xa48faf[_0x2390c1(0x1e4)](_0x3fd542),console[_0x2390c1(0x1a5)](a4_0x2a6b51['dim'](_0x2390c1(0x1d3)+_0x2b0626));else{const _0x2579dc=_0x1764f3['profile'];if(_0x2579dc)throw new SDKError(ErrorCode[_0x2390c1(0x18f)],_0x2390c1(0x1d0)+_0xf11b80+_0x2390c1(0x174),undefined,{'helpText':'When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a'+_0x2390c1(0x1ca)+('\x20\x20tdx\x20agent\x20pull\x20'+_0xf11b80+'\x0a')+(_0x2390c1(0x1dc)+_0x65f2dd+_0x2390c1(0x1a6)+(_0x4f23eb||_0x2390c1(0x1f2))+_0x2390c1(0x1b3)+_0x2579dc)});_0x2b0626=_0xf11b80,console[_0x2390c1(0x1a5)](a4_0x2a6b51['dim'](_0x2390c1(0x1a2)+_0xf11b80));}}}}if(!_0x2b0626)return console['log'](a4_0x2a6b51['yellow'](_0x2390c1(0x1a0))),console[_0x2390c1(0x1a5)](_0x2390c1(0x1e8)),console[_0x2390c1(0x1a5)](_0x2390c1(0x192)),console[_0x2390c1(0x1a5)](_0x2390c1(0x1a4)),console[_0x2390c1(0x1a5)](_0x2390c1(0x1b9)),0x1;if(!_0x4f23eb)throw new SDKError(ErrorCode[_0x2390c1(0x1de)],_0x2390c1(0x195),undefined,{'helpText':_0x2390c1(0x176)});if(!_0xe460e4&&!_0x42df3f){if(!isInteractive())return console[_0x2390c1(0x1a7)](a4_0x2a6b51['red'](_0x2390c1(0x189)),_0x2390c1(0x186)),console[_0x2390c1(0x1a7)](a4_0x2a6b51['dim'](_0x2390c1(0x1b5))),0x1;const _0xa8618e=await confirmKey('Clone\x20\x22'+_0x2b0626+_0x2390c1(0x1f8)+_0x4f23eb+'\x22?');if(!_0xa8618e)return console[_0x2390c1(0x1a5)](a4_0x2a6b51[_0x2390c1(0x17d)](_0x2390c1(0x19d))),0x1;}const {data:_0x579aaf}=await withSpinner('Cloning\x20\x22'+_0x2b0626+_0x2390c1(0x1c5)+_0x4f23eb+_0x2390c1(0x1e2),()=>_0x3f6256[_0x2390c1(0x1cd)][_0x2390c1(0x221)](_0x2b0626,_0x4f23eb,{'dryRun':_0x42df3f}));if(_0x42df3f){console['log'](a4_0x2a6b51['yellow']('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x2390c1(0x1a5)](_0x2390c1(0x1aa)+_0x579aaf[_0x2390c1(0x1ce)]),console['log'](_0x2390c1(0x21f)+_0x4f23eb),console[_0x2390c1(0x1a5)]('Would\x20clone:'),console['log']('\x20\x20Agents:\x20'+_0x579aaf[_0x2390c1(0x1b2)]['agents'][_0x2390c1(0x218)]),console['log']('\x20\x20Knowledge\x20Bases:\x20'+_0x579aaf[_0x2390c1(0x1b2)][_0x2390c1(0x1f5)][_0x2390c1(0x218)]),console[_0x2390c1(0x1a5)](_0x2390c1(0x1ab)+_0x579aaf[_0x2390c1(0x1b2)][_0x2390c1(0x1ae)][_0x2390c1(0x218)]);const _0x2d3bf0=_0x579aaf[_0x2390c1(0x1b2)][_0x2390c1(0x212)]['created']>0x0||_0x579aaf['counts'][_0x2390c1(0x1cf)]['created']>0x0;return _0x2d3bf0&&(console['log'](_0x2390c1(0x1c0)+_0x579aaf[_0x2390c1(0x1b2)][_0x2390c1(0x212)]['created']),console[_0x2390c1(0x1a5)]('\x20\x20Experimental\x20Artifacts:\x20'+_0x579aaf[_0x2390c1(0x1b2)][_0x2390c1(0x1cf)][_0x2390c1(0x218)])),0x0;}const _0x1dc0f6=_0x579aaf[_0x2390c1(0x1b2)][_0x2390c1(0x1e9)][_0x2390c1(0x177)]>0x0||_0x579aaf[_0x2390c1(0x1b2)][_0x2390c1(0x1f5)][_0x2390c1(0x177)]>0x0||_0x579aaf[_0x2390c1(0x1b2)][_0x2390c1(0x1ae)][_0x2390c1(0x177)]>0x0||_0x579aaf[_0x2390c1(0x1b2)][_0x2390c1(0x212)][_0x2390c1(0x177)]>0x0||_0x579aaf['counts'][_0x2390c1(0x1cf)][_0x2390c1(0x177)]>0x0;_0x1dc0f6?console[_0x2390c1(0x1a5)](a4_0x2a6b51['yellow'](_0x2390c1(0x1b1))):console[_0x2390c1(0x1a5)](a4_0x2a6b51['green']('Project\x20cloned\x20successfully'));console['log']('Source:\x20'+_0x579aaf['sourceProjectName']),console[_0x2390c1(0x1a5)](_0x2390c1(0x21f)+_0x579aaf[_0x2390c1(0x20c)]),console[_0x2390c1(0x1a5)]('New\x20project\x20ID:\x20'+_0x579aaf[_0x2390c1(0x214)]),console[_0x2390c1(0x1a5)](),console[_0x2390c1(0x1a5)](_0x2390c1(0x197)),console[_0x2390c1(0x1a5)](_0x2390c1(0x1a1)+formatCountSummary(_0x579aaf[_0x2390c1(0x1b2)][_0x2390c1(0x1e9)])),console[_0x2390c1(0x1a5)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x579aaf[_0x2390c1(0x1b2)]['knowledgeBases'])),console['log'](_0x2390c1(0x1ab)+formatCountSummary(_0x579aaf[_0x2390c1(0x1b2)][_0x2390c1(0x1ae)])),console[_0x2390c1(0x1a5)](_0x2390c1(0x190)+formatCountSummary(_0x579aaf[_0x2390c1(0x1b2)][_0x2390c1(0x204)]));const _0x2cf564=_0x579aaf[_0x2390c1(0x1b2)]['experimentalKnowledgeBases']['created']>0x0||_0x579aaf[_0x2390c1(0x1b2)][_0x2390c1(0x212)][_0x2390c1(0x1e7)]>0x0||_0x579aaf[_0x2390c1(0x1b2)][_0x2390c1(0x212)][_0x2390c1(0x1d6)]>0x0||_0x579aaf[_0x2390c1(0x1b2)][_0x2390c1(0x1cf)][_0x2390c1(0x218)]>0x0||_0x579aaf[_0x2390c1(0x1b2)][_0x2390c1(0x1cf)][_0x2390c1(0x1e7)]>0x0||_0x579aaf[_0x2390c1(0x1b2)]['experimentalArtifacts']['unchanged']>0x0;_0x2cf564&&(console['log'](_0x2390c1(0x1c0)+formatCountSummary(_0x579aaf[_0x2390c1(0x1b2)][_0x2390c1(0x212)])),console['log'](_0x2390c1(0x1dd)+formatCountSummary(_0x579aaf[_0x2390c1(0x1b2)]['experimentalArtifacts'])));if(_0x1dc0f6){console['log'](),console['log'](a4_0x2a6b51[_0x2390c1(0x1c7)](_0x2390c1(0x1f0)));for(const _0x594f6f of _0x579aaf[_0x2390c1(0x1e9)]){_0x594f6f[_0x2390c1(0x207)]===_0x2390c1(0x1a7)&&console[_0x2390c1(0x1a5)](a4_0x2a6b51[_0x2390c1(0x1c7)]('\x20\x20Agent\x20\x22'+_0x594f6f[_0x2390c1(0x1ad)]+_0x2390c1(0x1e0)+_0x594f6f[_0x2390c1(0x1a7)]));}for(const _0x73711a of _0x579aaf['knowledgeBases']){_0x73711a[_0x2390c1(0x207)]==='error'&&console['log'](a4_0x2a6b51['red'](_0x2390c1(0x208)+_0x73711a['name']+_0x2390c1(0x1e0)+_0x73711a['error']));}for(const _0x120189 of _0x579aaf['prompts']){_0x120189[_0x2390c1(0x207)]===_0x2390c1(0x1a7)&&console[_0x2390c1(0x1a5)](a4_0x2a6b51[_0x2390c1(0x1c7)](_0x2390c1(0x1e3)+_0x120189[_0x2390c1(0x182)]+_0x2390c1(0x1e0)+_0x120189[_0x2390c1(0x1a7)]));}for(const _0x2356a5 of _0x579aaf['integrations']){_0x2356a5[_0x2390c1(0x207)]===_0x2390c1(0x1a7)&&console[_0x2390c1(0x1a5)](a4_0x2a6b51[_0x2390c1(0x1c7)](_0x2390c1(0x1cb)+_0x2356a5[_0x2390c1(0x182)]+_0x2390c1(0x1e0)+_0x2356a5[_0x2390c1(0x1a7)]));}for(const _0x3155b6 of _0x579aaf[_0x2390c1(0x212)]){_0x3155b6[_0x2390c1(0x207)]===_0x2390c1(0x1a7)&&console[_0x2390c1(0x1a5)](a4_0x2a6b51[_0x2390c1(0x1c7)](_0x2390c1(0x1be)+_0x3155b6[_0x2390c1(0x182)]+_0x2390c1(0x1e0)+_0x3155b6[_0x2390c1(0x1a7)]));}for(const _0x2952c9 of _0x579aaf[_0x2390c1(0x1cf)]){_0x2952c9[_0x2390c1(0x207)]===_0x2390c1(0x1a7)&&console[_0x2390c1(0x1a5)](a4_0x2a6b51[_0x2390c1(0x1c7)](_0x2390c1(0x1c4)+_0x2952c9[_0x2390c1(0x182)]+_0x2390c1(0x1e0)+_0x2952c9[_0x2390c1(0x1a7)]));}return 0x1;}console['log']();const _0x5ea99a=getLLMProjectUrl(_0x1377fd,_0x579aaf[_0x2390c1(0x214)]);return console[_0x2390c1(0x1a5)](_0x2390c1(0x220)+a4_0x2a6b51[_0x2390c1(0x201)](_0x5ea99a)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x32ab7b(0x182)]=a4_0x32ab7b(0x1c3);[a4_0x32ab7b(0x18c)]=a4_0x32ab7b(0x1ef);async[a4_0x32ab7b(0x1fe)](_0x40a637){const _0x33b039=a4_0x32ab7b,{options:_0x3a8730,args:_0x14b324,tdx:_0x293a1c}=_0x40a637;let _0x1657dc=_0x14b324[0x0]||process['cwd']();const _0x58bda8=_0x3a8730['dryRun'],_0x11c350=_0x3a8730[_0x33b039(0x1ec)],_0x29999f=_0x3a8730['yes'],_0x4dc9f3=_0x3a8730[_0x33b039(0x206)],_0x284465=a4_0xa48faf['join'](_0x1657dc,_0x33b039(0x1bd)),_0x27fbeb=existsSync(_0x284465);if(_0x27fbeb){const {data:_0x1033f4}=await withSpinner(_0x33b039(0x1eb)+_0x1657dc+'\x22...',()=>_0x293a1c['llm'][_0x33b039(0x209)](_0x1657dc,{'dryRun':_0x58bda8,'force':_0x11c350}));if(_0x58bda8)return console[_0x33b039(0x1a5)](a4_0x2a6b51['yellow'](_0x33b039(0x1d7))),console[_0x33b039(0x1a5)](_0x33b039(0x19a)+_0x1033f4[_0x33b039(0x1ad)]),0x0;if(_0x1033f4[_0x33b039(0x207)]===_0x33b039(0x1a7))return console[_0x33b039(0x1a5)](a4_0x2a6b51['red']('Failed\x20to\x20push\x20agent:\x20'+_0x1033f4[_0x33b039(0x1a7)])),0x1;console[_0x33b039(0x1a5)](a4_0x2a6b51[_0x33b039(0x191)](_0x33b039(0x181)+_0x1033f4[_0x33b039(0x207)]+_0x33b039(0x196))),console[_0x33b039(0x1a5)](_0x33b039(0x1f1)+_0x1033f4[_0x33b039(0x1ad)]);if(_0x1033f4[_0x33b039(0x1b4)]&&_0x1033f4['projectId']){const _0x21a912=getLLMAgentChatUrl(_0x4dc9f3,_0x1033f4[_0x33b039(0x21c)],_0x1033f4[_0x33b039(0x1b4)]);console['log'](_0x33b039(0x215)+a4_0x2a6b51[_0x33b039(0x201)](_0x21a912));}return 0x0;}const _0x2560e9=_0x3a8730[_0x33b039(0x1e5)],_0xec0b7b=resolveProjectFromContext(_0x1657dc,_0x2560e9);if(_0xec0b7b['found'])_0x1657dc=_0xec0b7b[_0x33b039(0x1ed)],_0xec0b7b['source']===_0x33b039(0x19e)&&console['log'](a4_0x2a6b51[_0x33b039(0x20b)](_0x33b039(0x1c6)+_0x1657dc));else{let _0x24b676=_0x33b039(0x179);_0xec0b7b['reason']==='no_local_folder'&&(_0x24b676=_0xec0b7b[_0x33b039(0x1f7)]+_0x33b039(0x1d8)+_0xec0b7b['llmProject']+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode[_0x33b039(0x18f)],_0xec0b7b[_0x33b039(0x1db)]===_0x33b039(0x18a)?_0xec0b7b[_0x33b039(0x1f7)]:_0x33b039(0x187)+_0x1657dc,undefined,{'helpText':_0x24b676});}const {data:_0x5eea2e}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x293a1c[_0x33b039(0x1cd)]['pushProject'](_0x1657dc,{'dryRun':!![]})),_0x5ec701=_0x5eea2e[_0x33b039(0x1b2)][_0x33b039(0x1e9)][_0x33b039(0x177)]>0x0;if(_0x5ec701){console[_0x33b039(0x1a5)](a4_0x2a6b51[_0x33b039(0x1c7)]('\x0aErrors\x20found:'));for(const _0x17fc17 of _0x5eea2e[_0x33b039(0x1e9)]){_0x17fc17[_0x33b039(0x207)]===_0x33b039(0x1a7)&&console['log'](a4_0x2a6b51['red']('\x20\x20Agent\x20\x22'+_0x17fc17[_0x33b039(0x1ad)]+'\x22:\x20'+_0x17fc17[_0x33b039(0x1a7)]));}return 0x1;}const _0x4ab97c=_0x5eea2e[_0x33b039(0x1b2)]['agents']['created']+_0x5eea2e['counts'][_0x33b039(0x1f5)][_0x33b039(0x218)]+_0x5eea2e[_0x33b039(0x1b2)][_0x33b039(0x17a)]['created']+_0x5eea2e['counts'][_0x33b039(0x1ae)][_0x33b039(0x218)]+_0x5eea2e[_0x33b039(0x1b2)][_0x33b039(0x204)][_0x33b039(0x218)]+_0x5eea2e[_0x33b039(0x1b2)][_0x33b039(0x212)][_0x33b039(0x218)]+_0x5eea2e[_0x33b039(0x1b2)][_0x33b039(0x1cf)]['created'],_0x16dda3=_0x5eea2e['counts'][_0x33b039(0x1e9)]['updated']+_0x5eea2e['counts'][_0x33b039(0x1f5)][_0x33b039(0x1e7)]+_0x5eea2e['counts'][_0x33b039(0x17a)][_0x33b039(0x1e7)]+_0x5eea2e[_0x33b039(0x1b2)][_0x33b039(0x1ae)][_0x33b039(0x1e7)]+_0x5eea2e[_0x33b039(0x1b2)]['integrations'][_0x33b039(0x1e7)]+_0x5eea2e[_0x33b039(0x1b2)][_0x33b039(0x212)][_0x33b039(0x1e7)]+_0x5eea2e['counts'][_0x33b039(0x1cf)][_0x33b039(0x1e7)],_0xf1d143=_0x5eea2e['counts'][_0x33b039(0x1e9)]['unchanged']+_0x5eea2e[_0x33b039(0x1b2)][_0x33b039(0x1f5)][_0x33b039(0x1d6)]+_0x5eea2e['counts'][_0x33b039(0x17a)][_0x33b039(0x1d6)]+_0x5eea2e[_0x33b039(0x1b2)][_0x33b039(0x1ae)][_0x33b039(0x1d6)]+_0x5eea2e[_0x33b039(0x1b2)]['integrations']['unchanged']+_0x5eea2e[_0x33b039(0x1b2)][_0x33b039(0x212)][_0x33b039(0x1d6)]+_0x5eea2e[_0x33b039(0x1b2)][_0x33b039(0x1cf)]['unchanged'];console['log'](_0x33b039(0x1ea)+_0x5eea2e[_0x33b039(0x188)]+'\x27:'),console[_0x33b039(0x1a5)]('\x20\x20'+a4_0x2a6b51[_0x33b039(0x191)]('+\x20'+_0x4ab97c+_0x33b039(0x18b))+_0x33b039(0x19c)+a4_0x2a6b51[_0x33b039(0x17d)]('~\x20'+_0x16dda3+'\x20changed')+_0x33b039(0x19c)+a4_0x2a6b51['dim']('=\x20'+_0xf1d143+_0x33b039(0x1a9))),console[_0x33b039(0x1a5)]('\x20\x20Agents:\x20'+formatCountSummary(_0x5eea2e['counts'][_0x33b039(0x1e9)])),console[_0x33b039(0x1a5)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x5eea2e['counts'][_0x33b039(0x1f5)])),console[_0x33b039(0x1a5)](_0x33b039(0x1f9)+formatCountSummary(_0x5eea2e[_0x33b039(0x1b2)]['textKnowledgeBases'])),console[_0x33b039(0x1a5)](_0x33b039(0x1ab)+formatCountSummary(_0x5eea2e[_0x33b039(0x1b2)][_0x33b039(0x1ae)])),console[_0x33b039(0x1a5)](_0x33b039(0x190)+formatCountSummary(_0x5eea2e['counts'][_0x33b039(0x204)]));const _0x920b77=_0x5eea2e[_0x33b039(0x1b2)][_0x33b039(0x212)][_0x33b039(0x218)]>0x0||_0x5eea2e['counts'][_0x33b039(0x212)][_0x33b039(0x1e7)]>0x0||_0x5eea2e[_0x33b039(0x1b2)][_0x33b039(0x212)][_0x33b039(0x1d6)]>0x0||_0x5eea2e[_0x33b039(0x1b2)][_0x33b039(0x1cf)][_0x33b039(0x218)]>0x0||_0x5eea2e[_0x33b039(0x1b2)]['experimentalArtifacts'][_0x33b039(0x1e7)]>0x0||_0x5eea2e[_0x33b039(0x1b2)][_0x33b039(0x1cf)][_0x33b039(0x1d6)]>0x0;_0x920b77&&(console[_0x33b039(0x1a5)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x5eea2e[_0x33b039(0x1b2)][_0x33b039(0x212)])),console[_0x33b039(0x1a5)](_0x33b039(0x1dd)+formatCountSummary(_0x5eea2e[_0x33b039(0x1b2)][_0x33b039(0x1cf)])));console['log']('\x20\x20Source:\x20'+a4_0x2a6b51[_0x33b039(0x201)](_0x1657dc)),displayDiffs(_0x5eea2e[_0x33b039(0x1e9)],_0x5eea2e[_0x33b039(0x1f5)],_0x5eea2e['textKnowledgeBases'],_0x5eea2e[_0x33b039(0x1ae)],_0x5eea2e[_0x33b039(0x204)],_0x5eea2e[_0x33b039(0x212)],_0x5eea2e[_0x33b039(0x1cf)]);if(_0x58bda8)return console[_0x33b039(0x1a5)](a4_0x2a6b51[_0x33b039(0x17d)](_0x33b039(0x1d9))),0x0;if(_0x4ab97c===0x0&&_0x16dda3===0x0){console[_0x33b039(0x1a5)](a4_0x2a6b51['green'](_0x33b039(0x217)));const _0x394988=getLLMProjectUrl(_0x4dc9f3,_0x5eea2e[_0x33b039(0x21c)]);return console[_0x33b039(0x1a5)](_0x33b039(0x220)+a4_0x2a6b51['cyan'](_0x394988)),0x0;}if(!_0x29999f&&!_0x11c350){if(!isInteractive())return console[_0x33b039(0x1a7)](a4_0x2a6b51[_0x33b039(0x1c7)](_0x33b039(0x189)),_0x33b039(0x186)),console['error'](a4_0x2a6b51[_0x33b039(0x20b)](_0x33b039(0x1b5))),0x1;const _0x55f147=await confirmKey(_0x33b039(0x18e)+(_0x4ab97c+_0x16dda3)+_0x33b039(0x173));if(!_0x55f147)return console[_0x33b039(0x1a5)](a4_0x2a6b51[_0x33b039(0x17d)](_0x33b039(0x19d)),_0x33b039(0x21a)),0x1;}const {data:_0x29940b}=await withSpinner(_0x33b039(0x1ac),()=>_0x293a1c[_0x33b039(0x1cd)][_0x33b039(0x1c9)](_0x1657dc,{'force':_0x11c350})),_0x5ac7db=_0x29940b[_0x33b039(0x1b2)]['agents'][_0x33b039(0x177)]>0x0||_0x29940b['counts'][_0x33b039(0x1f5)][_0x33b039(0x177)]>0x0||_0x29940b[_0x33b039(0x1b2)]['textKnowledgeBases']['errors']>0x0||_0x29940b[_0x33b039(0x1b2)][_0x33b039(0x1ae)][_0x33b039(0x177)]>0x0;if(_0x5ac7db){console[_0x33b039(0x1a5)](a4_0x2a6b51[_0x33b039(0x17d)](_0x33b039(0x172))),console[_0x33b039(0x1a5)](),console[_0x33b039(0x1a5)](a4_0x2a6b51['red'](_0x33b039(0x1f0)));for(const _0xe35d57 of _0x29940b[_0x33b039(0x1e9)]){_0xe35d57[_0x33b039(0x207)]==='error'&&console[_0x33b039(0x1a5)](a4_0x2a6b51['red']('\x20\x20Agent\x20\x22'+_0xe35d57['agentName']+_0x33b039(0x1e0)+_0xe35d57[_0x33b039(0x1a7)]));}for(const _0x27ea12 of _0x29940b[_0x33b039(0x1f5)]){_0x27ea12['action']===_0x33b039(0x1a7)&&console[_0x33b039(0x1a5)](a4_0x2a6b51[_0x33b039(0x1c7)](_0x33b039(0x208)+_0x27ea12[_0x33b039(0x182)]+_0x33b039(0x1e0)+_0x27ea12[_0x33b039(0x1a7)]));}for(const _0x4e6a57 of _0x29940b[_0x33b039(0x17a)]){_0x4e6a57[_0x33b039(0x207)]===_0x33b039(0x1a7)&&console[_0x33b039(0x1a5)](a4_0x2a6b51[_0x33b039(0x1c7)]('\x20\x20Text\x20Knowledge\x20Base\x20\x22'+_0x4e6a57['name']+'\x22:\x20'+_0x4e6a57[_0x33b039(0x1a7)]));}for(const _0x31dacc of _0x29940b[_0x33b039(0x1ae)]){_0x31dacc[_0x33b039(0x207)]===_0x33b039(0x1a7)&&console[_0x33b039(0x1a5)](a4_0x2a6b51[_0x33b039(0x1c7)]('\x20\x20Prompt\x20\x22'+_0x31dacc['name']+_0x33b039(0x1e0)+_0x31dacc['error']));}for(const _0xae1120 of _0x29940b[_0x33b039(0x204)]){_0xae1120[_0x33b039(0x207)]===_0x33b039(0x1a7)&&console[_0x33b039(0x1a5)](a4_0x2a6b51[_0x33b039(0x1c7)](_0x33b039(0x1cb)+_0xae1120[_0x33b039(0x182)]+_0x33b039(0x1e0)+_0xae1120[_0x33b039(0x1a7)]));}return 0x1;}console[_0x33b039(0x1a5)](a4_0x2a6b51[_0x33b039(0x191)](_0x33b039(0x1d1)+(_0x4ab97c+_0x16dda3)+'\x20resources\x20to\x20\x27'+_0x29940b[_0x33b039(0x188)]+'\x27'));const _0x4d69f0=getLLMProjectUrl(_0x4dc9f3,_0x29940b[_0x33b039(0x21c)]);return console[_0x33b039(0x1a5)](_0x33b039(0x220)+a4_0x2a6b51[_0x33b039(0x201)](_0x4d69f0)),0x0;}}
|
|
1
|
+
function a4_0x2a95(_0x12f1a9,_0x44378b){_0x12f1a9=_0x12f1a9-0x199;const _0x495556=a4_0x4955();let _0x2a9553=_0x495556[_0x12f1a9];return _0x2a9553;}const a4_0x4f8b7d=a4_0x2a95;(function(_0x4a5998,_0x5a11ff){const _0x1089b9=a4_0x2a95,_0x186744=_0x4a5998();while(!![]){try{const _0x1aa6ba=-parseInt(_0x1089b9(0x1d1))/0x1+-parseInt(_0x1089b9(0x213))/0x2+-parseInt(_0x1089b9(0x24a))/0x3*(parseInt(_0x1089b9(0x1c0))/0x4)+parseInt(_0x1089b9(0x1f8))/0x5+-parseInt(_0x1089b9(0x1e1))/0x6*(parseInt(_0x1089b9(0x1c7))/0x7)+-parseInt(_0x1089b9(0x1c1))/0x8*(parseInt(_0x1089b9(0x21a))/0x9)+parseInt(_0x1089b9(0x234))/0xa*(parseInt(_0x1089b9(0x1a8))/0xb);if(_0x1aa6ba===_0x5a11ff)break;else _0x186744['push'](_0x186744['shift']());}catch(_0x23ebc5){_0x186744['push'](_0x186744['shift']());}}}(a4_0x4955,0x5d8de));function a4_0x4955(){const _0x1adc11=['context','\x0aChanges:','New\x20project:\x20','outputDir','196rMBsJS','40hyuUuI','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','agentId','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\x20\x20Prompt\x20\x22','47691vlttnR','Output:\x20','total','\x20=\x20','error','\x20successfully','experimentalArtifacts','\x20changed','Cancelled','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','73405JDZwZs','Project:\x20','errors','red','Status:\x20','\x20\x20Integration\x20\x22','\x20updated','reason','log','\x20files?','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','agent:clone','description','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','MISSING_ARGUMENT','<new-name>','246pXDRTa','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','\x20resources\x20to\x20\x27','\x22\x20to\x20new\x20project\x20\x22','\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)','parse','\x22\x20to\x20a\x20different\x20profile','\x20\x20Text\x20Knowledge\x20Base\x20\x22','profile','Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','output','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','\x20files\x20to\x20','yes','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x0aChanges\x20to\x20prompt\x20\x27','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','Agent:\x20','✔\x20Context\x20set:\x20','dim','\x0aChanges\x20to\x20integration\x20\x27','\x20--name\x20','Using\x20local\x20project:\x20','568020fbIxUM','source','Clone\x20\x22','\x20new','\x0aProject\x20pushed\x20with\x20errors','\x20\x20tdx\x20agent\x20clone\x20agents/','created','tdx.json','\x20--profile\x20','green','Output\x20path:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project','prompts','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','outputPath','\x0a✔\x20Pulled\x20','Using\x20project\x20from\x20context:\x20','\x0aWrite\x20','action','arg-dir','agent:pull','\x0aChanges\x20to\x20agent\x20\x27','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','force','Cannot\x20clone\x20from\x20context\x20project\x20\x22','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','new','1362134QrNZRx','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','llmProject','Writing\x20files...','Using\x20context\x20project:\x20','\x20resources?','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','80181apAfwy','\x20\x20Knowledge\x20Bases:\x20','gray','pushProject','counts','\x0aPush\x20','agents','newProjectName','Would\x20push\x20agent:\x20','dryRun','\x0aError:','\x20\x20Experimental\x20Artifacts:\x20','-\x20nothing\x20pushed','hasChanges','llm_project','join','message','repeat','dirname','isNew','cloneProject','execute','\x0aPull\x20summary\x20for\x20\x27','unchanged','\x22:\x20','Errors:','89550WdpiBg','found','Using\x20project:\x20','textKnowledgeBases','pullProject','\x22\x20to\x20\x22','llm','cyan','New\x20project\x20name\x20is\x20required','\x22\x20from\x20project\x20\x22','Pushing\x20agent\x20from\x20\x22','Dry\x20run\x20-\x20no\x20changes\x20made','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','Cloning\x20\x22','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','\x20\x20Target:\x20','Analyzing\x20project\x20\x22','experimentalKnowledgeBases','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','agentName','Using\x20current\x20project:\x20','4647rvMdYo','Pushing\x20to\x20project...','name','Agent\x20','Source:\x20','\x20\x20tdx\x20agent\x20pull\x20','projectName','knowledgeBases','-\x20no\x20files\x20written','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x20unchanged','\x20\x20Agents:\x20','sourceProjectName','cwd-config','\x20\x20Knowledge\x20Base\x20\x22','\x20errors','newProjectId','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','pullAgent','updated','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','yellow','cwd','site','\x20\x20Integrations:\x20','\x22...','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x0aPush\x20summary\x20for\x20\x27','Pulling\x20agent\x20\x22','agent:push','1749AIGKdg','\x20total','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','push','Chat:\x20','\x20\x20Prompts:\x20','integrations','INVALID_ARGUMENT','projectId','Project\x20cloned\x20successfully','utf-8','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x20|\x20','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','agent','session','projectDir','diff'];a4_0x4955=function(){return _0x1adc11;};return a4_0x4955();}import a4_0x566038 from'chalk';import a4_0x4e99f2 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x215a61){const _0x4cafbe=a4_0x2a95,_0x2f4ff5=[];if(_0x215a61[_0x4cafbe(0x1c9)]!==undefined)_0x2f4ff5[_0x4cafbe(0x1ad)](_0x215a61[_0x4cafbe(0x1c9)]+_0x4cafbe(0x1a9));if(_0x215a61['new']!==undefined&&_0x215a61[_0x4cafbe(0x212)]>0x0)_0x2f4ff5[_0x4cafbe(0x1ad)](a4_0x566038[_0x4cafbe(0x201)](_0x215a61['new']+_0x4cafbe(0x1fb)));if(_0x215a61[_0x4cafbe(0x1fe)]!==undefined&&_0x215a61[_0x4cafbe(0x1fe)]>0x0)_0x2f4ff5['push'](a4_0x566038[_0x4cafbe(0x201)](_0x215a61[_0x4cafbe(0x1fe)]+'\x20created'));if(_0x215a61[_0x4cafbe(0x19d)]!==undefined&&_0x215a61[_0x4cafbe(0x19d)]>0x0)_0x2f4ff5['push'](a4_0x566038[_0x4cafbe(0x19f)](_0x215a61[_0x4cafbe(0x19d)]+_0x4cafbe(0x1d7)));if(_0x215a61[_0x4cafbe(0x231)]!==undefined&&_0x215a61[_0x4cafbe(0x231)]>0x0)_0x2f4ff5[_0x4cafbe(0x1ad)](a4_0x566038['gray'](_0x215a61[_0x4cafbe(0x231)]+_0x4cafbe(0x254)));if(_0x215a61[_0x4cafbe(0x1d3)]!==undefined&&_0x215a61[_0x4cafbe(0x1d3)]>0x0)_0x2f4ff5['push'](a4_0x566038[_0x4cafbe(0x1d4)](_0x215a61[_0x4cafbe(0x1d3)]+_0x4cafbe(0x199)));return _0x2f4ff5[_0x4cafbe(0x229)](',\x20');}function displayDiffs(_0x16e7be,_0x10ac5a,_0x4a508a,_0x3fe99c,_0x4049a5,_0x3d9133,_0x17f1d3){const _0x43f810=a4_0x2a95;for(const _0x5d08a9 of _0x16e7be){if(_0x5d08a9[_0x43f810(0x1bb)]){const _0x4c03c8=_0x5d08a9[_0x43f810(0x248)]||_0x5d08a9[_0x43f810(0x24c)];console[_0x43f810(0x1d9)](_0x43f810(0x20d)+_0x4c03c8+'\x27:'),console[_0x43f810(0x1d9)]('─'[_0x43f810(0x22b)](0x3c)),console['log'](_0x5d08a9['diff']),console[_0x43f810(0x1d9)]('─'[_0x43f810(0x22b)](0x3c));}}for(const _0x173fbd of _0x10ac5a){_0x173fbd['diff']&&(console['log'](_0x43f810(0x214)+_0x173fbd[_0x43f810(0x24c)]+'\x27:'),console[_0x43f810(0x1d9)]('─'[_0x43f810(0x22b)](0x3c)),console[_0x43f810(0x1d9)](_0x173fbd[_0x43f810(0x1bb)]),console['log']('─'['repeat'](0x3c)));}for(const _0x1dcc0d of _0x4a508a){_0x1dcc0d[_0x43f810(0x1bb)]&&(console[_0x43f810(0x1d9)](_0x43f810(0x246)+_0x1dcc0d[_0x43f810(0x24c)]+'\x27:'),console[_0x43f810(0x1d9)]('─'['repeat'](0x3c)),console['log'](_0x1dcc0d[_0x43f810(0x1bb)]),console['log']('─'[_0x43f810(0x22b)](0x3c)));}for(const _0x389f30 of _0x3fe99c){_0x389f30['diff']&&(console[_0x43f810(0x1d9)](_0x43f810(0x1f0)+_0x389f30[_0x43f810(0x24c)]+'\x27:'),console[_0x43f810(0x1d9)]('─'[_0x43f810(0x22b)](0x3c)),console[_0x43f810(0x1d9)](_0x389f30[_0x43f810(0x1bb)]),console[_0x43f810(0x1d9)]('─'[_0x43f810(0x22b)](0x3c)));}for(const _0x414634 of _0x4049a5){_0x414634[_0x43f810(0x1bb)]&&(console[_0x43f810(0x1d9)](_0x43f810(0x1f5)+_0x414634[_0x43f810(0x24c)]+'\x27:'),console[_0x43f810(0x1d9)]('─'[_0x43f810(0x22b)](0x3c)),console[_0x43f810(0x1d9)](_0x414634['diff']),console[_0x43f810(0x1d9)]('─'[_0x43f810(0x22b)](0x3c)));}for(const _0x3368ad of _0x3d9133){_0x3368ad['diff']&&(console['log'](_0x43f810(0x253)+_0x3368ad['name']+'\x27:'),console[_0x43f810(0x1d9)]('─'['repeat'](0x3c)),console[_0x43f810(0x1d9)](_0x3368ad[_0x43f810(0x1bb)]),console[_0x43f810(0x1d9)]('─'[_0x43f810(0x22b)](0x3c)));}for(const _0x281001 of _0x17f1d3){_0x281001[_0x43f810(0x1bb)]&&(console['log'](_0x43f810(0x19b)+_0x281001[_0x43f810(0x24c)]+'\x27:'),console[_0x43f810(0x1d9)]('─'[_0x43f810(0x22b)](0x3c)),console['log'](_0x281001[_0x43f810(0x1bb)]),console[_0x43f810(0x1d9)]('─'[_0x43f810(0x22b)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x4f8b7d(0x24c)]=a4_0x4f8b7d(0x20c);['description']=a4_0x4f8b7d(0x247);async[a4_0x4f8b7d(0x22f)](_0x4dc246){const _0xfb25c6=a4_0x4f8b7d,{options:_0x1d1b9b,args:_0x20e6ce,tdx:_0x79061b}=_0x4dc246,_0x232320=_0x20e6ce[0x0],_0x1b2206=_0x20e6ce[0x1],_0x6d46d=_0x1d1b9b[_0xfb25c6(0x1eb)],_0xe2b36e=_0x1d1b9b[_0xfb25c6(0x223)],_0x37def3=_0x1d1b9b['force'],_0x4b6d32=_0x1d1b9b[_0xfb25c6(0x1ee)],_0x5ea8c3=_0x1d1b9b[_0xfb25c6(0x215)],_0xf5be9=_0x1d1b9b[_0xfb25c6(0x1b8)];let _0x10bb82;if(_0x232320){const _0x3ffa78=a4_0x4e99f2['join'](_0x232320,_0xfb25c6(0x1ff));if(existsSync(_0x3ffa78))try{const _0x3d2e7e=JSON[_0xfb25c6(0x1e6)](readFileSync(_0x3ffa78,'utf-8'));_0x3d2e7e['llm_project']&&(_0x10bb82={'llm_project':_0x3d2e7e[_0xfb25c6(0x228)]});}catch{}}const _0x1eec07=findAgentConfigPath(process[_0xfb25c6(0x1a0)]());let _0x41c13f;if(_0x1eec07)try{const _0x4f373f=JSON[_0xfb25c6(0x1e6)](readFileSync(_0x1eec07,_0xfb25c6(0x1b4)));_0x4f373f[_0xfb25c6(0x228)]&&(_0x41c13f={'llm_project':_0x4f373f[_0xfb25c6(0x228)]});}catch{}const _0x2364e6=resolveAgentPullArgs({'arg':_0x232320,'agentNameArg':_0x1b2206,'agentFlag':_0xf5be9,'contextProject':_0x5ea8c3,'argDirConfig':_0x10bb82,'cwdConfigPath':_0x1eec07||undefined,'cwdConfig':_0x41c13f}),{projectNameOrId:_0x567e3a,targetAgentName:_0xee308e,existingOutputDir:_0x57bb95,source:_0x5d821e}=_0x2364e6;if(_0x5d821e===_0xfb25c6(0x20b))console[_0xfb25c6(0x1d9)](a4_0x566038['dim']('Using\x20project\x20from\x20'+a4_0x4e99f2['join'](_0x232320,'tdx.json')+':\x20'+_0x567e3a));else{if(_0x5d821e===_0xfb25c6(0x257))console['log'](a4_0x566038[_0xfb25c6(0x1f4)](_0xfb25c6(0x236)+_0x567e3a));else _0x5d821e===_0xfb25c6(0x1bc)&&console[_0xfb25c6(0x1d9)](a4_0x566038['dim'](_0xfb25c6(0x208)+_0x567e3a));}if(!_0x567e3a)return _0xf5be9?(console[_0xfb25c6(0x1d9)](a4_0x566038['yellow'](_0xfb25c6(0x1ac))),console[_0xfb25c6(0x1d9)](_0xfb25c6(0x240)),console['log'](_0xfb25c6(0x1f1))):(console[_0xfb25c6(0x1d9)](a4_0x566038['yellow'](_0xfb25c6(0x1ec))),console[_0xfb25c6(0x1d9)](_0xfb25c6(0x1ea)),console[_0xfb25c6(0x1d9)](_0xfb25c6(0x1e2)),console[_0xfb25c6(0x1d9)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory'),console[_0xfb25c6(0x1d9)](_0xfb25c6(0x203)),console[_0xfb25c6(0x1d9)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project')),0x1;if(_0xee308e){const {data:_0x20c08b}=await withSpinner(_0xfb25c6(0x1a6)+_0xee308e+_0xfb25c6(0x23d)+_0x567e3a+'\x22...',()=>_0x79061b[_0xfb25c6(0x23a)][_0xfb25c6(0x19c)](_0x567e3a,_0xee308e,_0x6d46d,{'dryRun':_0xe2b36e,'force':_0x37def3}));if(_0xe2b36e)return console[_0xfb25c6(0x1d9)](a4_0x566038[_0xfb25c6(0x19f)]('Dry\x20run\x20-\x20no\x20files\x20written')),console['log']('Would\x20pull\x20agent:\x20'+_0x20c08b[_0xfb25c6(0x248)]),console[_0xfb25c6(0x1d9)](_0xfb25c6(0x202)+_0x20c08b['outputPath']),_0x20c08b['diff']&&(console[_0xfb25c6(0x1d9)](_0xfb25c6(0x1bd)),console[_0xfb25c6(0x1d9)]('─'[_0xfb25c6(0x22b)](0x3c)),console[_0xfb25c6(0x1d9)](_0x20c08b[_0xfb25c6(0x1bb)]),console[_0xfb25c6(0x1d9)]('─'['repeat'](0x3c))),0x0;return console[_0xfb25c6(0x1d9)](a4_0x566038['green']('Agent\x20pulled\x20successfully')),console[_0xfb25c6(0x1d9)](_0xfb25c6(0x1f2)+_0x20c08b[_0xfb25c6(0x248)]),console[_0xfb25c6(0x1d9)](_0xfb25c6(0x1c8)+_0x20c08b[_0xfb25c6(0x206)]),console[_0xfb25c6(0x1d9)](_0xfb25c6(0x1d5)+(_0x20c08b[_0xfb25c6(0x22d)]?a4_0x566038[_0xfb25c6(0x201)](_0xfb25c6(0x212)):_0x20c08b[_0xfb25c6(0x227)]?a4_0x566038[_0xfb25c6(0x19f)](_0xfb25c6(0x19d)):a4_0x566038[_0xfb25c6(0x21c)](_0xfb25c6(0x231)))),0x0;}const _0x5eb1a3=_0x57bb95||_0x6d46d,{data:_0x2d21cc}=await withSpinner(_0xfb25c6(0x244)+_0x567e3a+_0xfb25c6(0x1a3),()=>_0x79061b['llm'][_0xfb25c6(0x238)](_0x567e3a,_0x5eb1a3,{'dryRun':!![]})),_0x33dcc7=_0x2d21cc['counts']['agents']['new']+_0x2d21cc[_0xfb25c6(0x21e)]['knowledgeBases'][_0xfb25c6(0x212)]+_0x2d21cc[_0xfb25c6(0x21e)][_0xfb25c6(0x237)][_0xfb25c6(0x212)]+_0x2d21cc['counts']['prompts'][_0xfb25c6(0x212)]+_0x2d21cc['counts']['integrations'][_0xfb25c6(0x212)]+_0x2d21cc[_0xfb25c6(0x21e)][_0xfb25c6(0x245)][_0xfb25c6(0x212)]+_0x2d21cc['counts']['experimentalArtifacts'][_0xfb25c6(0x212)],_0x25ab75=_0x2d21cc[_0xfb25c6(0x21e)][_0xfb25c6(0x220)]['updated']+_0x2d21cc[_0xfb25c6(0x21e)][_0xfb25c6(0x251)][_0xfb25c6(0x19d)]+_0x2d21cc[_0xfb25c6(0x21e)]['textKnowledgeBases'][_0xfb25c6(0x19d)]+_0x2d21cc['counts'][_0xfb25c6(0x204)]['updated']+_0x2d21cc[_0xfb25c6(0x21e)][_0xfb25c6(0x1b0)]['updated']+_0x2d21cc[_0xfb25c6(0x21e)]['experimentalKnowledgeBases'][_0xfb25c6(0x19d)]+_0x2d21cc['counts'][_0xfb25c6(0x1cd)][_0xfb25c6(0x19d)],_0x1a22a9=_0x2d21cc['counts'][_0xfb25c6(0x220)][_0xfb25c6(0x231)]+_0x2d21cc[_0xfb25c6(0x21e)]['knowledgeBases'][_0xfb25c6(0x231)]+_0x2d21cc[_0xfb25c6(0x21e)]['textKnowledgeBases'][_0xfb25c6(0x231)]+_0x2d21cc[_0xfb25c6(0x21e)]['prompts'][_0xfb25c6(0x231)]+_0x2d21cc[_0xfb25c6(0x21e)]['integrations'][_0xfb25c6(0x231)]+_0x2d21cc[_0xfb25c6(0x21e)][_0xfb25c6(0x245)][_0xfb25c6(0x231)]+_0x2d21cc[_0xfb25c6(0x21e)]['experimentalArtifacts'][_0xfb25c6(0x231)];console[_0xfb25c6(0x1d9)](_0xfb25c6(0x230)+_0x2d21cc['projectName']+'\x27:'),console[_0xfb25c6(0x1d9)]('\x20\x20'+a4_0x566038['green']('+\x20'+_0x33dcc7+_0xfb25c6(0x1fb))+'\x20|\x20'+a4_0x566038[_0xfb25c6(0x19f)]('~\x20'+_0x25ab75+'\x20changed')+_0xfb25c6(0x1b6)+a4_0x566038['dim']('=\x20'+_0x1a22a9+_0xfb25c6(0x254))),console['log'](_0xfb25c6(0x255)+formatCountSummary(_0x2d21cc[_0xfb25c6(0x21e)]['agents'])),console[_0xfb25c6(0x1d9)](_0xfb25c6(0x21b)+formatCountSummary(_0x2d21cc[_0xfb25c6(0x21e)]['knowledgeBases'])),console['log'](_0xfb25c6(0x1b5)+formatCountSummary(_0x2d21cc['counts'][_0xfb25c6(0x237)])),console['log'](_0xfb25c6(0x1af)+formatCountSummary(_0x2d21cc[_0xfb25c6(0x21e)][_0xfb25c6(0x204)])),console[_0xfb25c6(0x1d9)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x2d21cc[_0xfb25c6(0x21e)][_0xfb25c6(0x1b0)]));const _0x349da0=_0x2d21cc['counts'][_0xfb25c6(0x245)][_0xfb25c6(0x1c9)]>0x0||_0x2d21cc[_0xfb25c6(0x21e)][_0xfb25c6(0x1cd)][_0xfb25c6(0x1c9)]>0x0;_0x349da0&&(console[_0xfb25c6(0x1d9)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x2d21cc[_0xfb25c6(0x21e)][_0xfb25c6(0x245)])),console['log'](_0xfb25c6(0x225)+formatCountSummary(_0x2d21cc['counts'][_0xfb25c6(0x1cd)])));console['log'](_0xfb25c6(0x243)+a4_0x566038[_0xfb25c6(0x23b)](_0x2d21cc['outputDir'])),displayDiffs(_0x2d21cc[_0xfb25c6(0x220)],_0x2d21cc[_0xfb25c6(0x251)],_0x2d21cc[_0xfb25c6(0x237)],_0x2d21cc['prompts'],_0x2d21cc['integrations'],_0x2d21cc[_0xfb25c6(0x245)],_0x2d21cc[_0xfb25c6(0x1cd)]);if(_0xe2b36e)return console[_0xfb25c6(0x1d9)](a4_0x566038['yellow'](_0xfb25c6(0x1db))),0x0;if(_0x33dcc7===0x0&&_0x25ab75===0x0)return console[_0xfb25c6(0x1d9)](a4_0x566038['green'](_0xfb25c6(0x1c2))),saveSessionContext({'llm_project':_0x2d21cc['projectName']},_0x1d1b9b[_0xfb25c6(0x1b9)]),console[_0xfb25c6(0x1d9)](a4_0x566038[_0xfb25c6(0x201)]('✔\x20Context\x20set:\x20'+a4_0x566038['dim'](_0xfb25c6(0x228))+_0xfb25c6(0x1ca)+a4_0x566038[_0xfb25c6(0x23b)](_0x2d21cc['projectName']))),0x0;if(!_0x4b6d32&&!_0x37def3){if(!isInteractive())return console['error'](a4_0x566038['red'](_0xfb25c6(0x224)),_0xfb25c6(0x20e)),console[_0xfb25c6(0x1cb)](a4_0x566038[_0xfb25c6(0x1f4)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x2918e1=await confirmKey(_0xfb25c6(0x209)+(_0x33dcc7+_0x25ab75)+_0xfb25c6(0x1da));if(!_0x2918e1)return console[_0xfb25c6(0x1d9)](a4_0x566038[_0xfb25c6(0x19f)](_0xfb25c6(0x1cf)),_0xfb25c6(0x252)),0x1;}const {data:_0x145901}=await withSpinner(_0xfb25c6(0x216),()=>_0x79061b['llm'][_0xfb25c6(0x238)](_0x567e3a,_0x5eb1a3,{'force':_0x37def3}));return console['log'](a4_0x566038[_0xfb25c6(0x201)](_0xfb25c6(0x207)+(_0x33dcc7+_0x25ab75)+_0xfb25c6(0x1ed)+_0x145901[_0xfb25c6(0x1bf)])),saveSessionContext({'llm_project':_0x145901[_0xfb25c6(0x250)]},_0x1d1b9b['session']),console[_0xfb25c6(0x1d9)](a4_0x566038[_0xfb25c6(0x201)](_0xfb25c6(0x1f3)+a4_0x566038['dim'](_0xfb25c6(0x228))+_0xfb25c6(0x1ca)+a4_0x566038['cyan'](_0x145901[_0xfb25c6(0x250)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']=a4_0x4f8b7d(0x1dc);[a4_0x4f8b7d(0x1dd)]=a4_0x4f8b7d(0x1de);async[a4_0x4f8b7d(0x22f)](_0x198209){const _0x28ad2d=a4_0x4f8b7d,{options:_0x43a4e9,args:_0x520dc1,tdx:_0x65f791}=_0x198209,_0x55bf82=_0x520dc1[0x0],_0xfe6891=_0x43a4e9[_0x28ad2d(0x24c)],_0x4c3982=_0x43a4e9[_0x28ad2d(0x223)],_0x4fb1a=_0x43a4e9['yes'],_0x4e8868=_0x43a4e9[_0x28ad2d(0x1a1)],_0x418396=_0x43a4e9[_0x28ad2d(0x215)];let _0x571a68;const _0x39b9ba=findAgentConfigPath(process[_0x28ad2d(0x1a0)]());if(_0x55bf82){const _0x828fc3=a4_0x4e99f2['join'](_0x55bf82,_0x28ad2d(0x1ff));existsSync(_0x828fc3)?(_0x571a68=_0x55bf82,console[_0x28ad2d(0x1d9)](a4_0x566038[_0x28ad2d(0x1f4)](_0x28ad2d(0x1f7)+_0x55bf82))):_0x571a68=_0x55bf82;}else{if(_0x39b9ba)_0x571a68=a4_0x4e99f2['dirname'](_0x39b9ba),console[_0x28ad2d(0x1d9)](a4_0x566038['dim'](_0x28ad2d(0x249)+_0x571a68));else{if(_0x418396){const _0x408cd2=sanitizeForFilesystem(_0x418396);let _0x12ee8a=_0x408cd2,_0xdbed5e=a4_0x4e99f2['join'](process['cwd'](),_0x28ad2d(0x220),_0x408cd2,_0x28ad2d(0x1ff));if(!existsSync(_0xdbed5e)){const _0x5dd38f=normalizeName(_0x418396),_0x132074=a4_0x4e99f2[_0x28ad2d(0x229)](process['cwd'](),_0x28ad2d(0x220),_0x5dd38f,_0x28ad2d(0x1ff));existsSync(_0x132074)&&(_0x12ee8a=_0x5dd38f,_0xdbed5e=_0x132074);}if(existsSync(_0xdbed5e))_0x571a68=a4_0x4e99f2[_0x28ad2d(0x22c)](_0xdbed5e),console[_0x28ad2d(0x1d9)](a4_0x566038['dim'](_0x28ad2d(0x1f7)+_0x571a68));else{const _0x17cdd1=_0x43a4e9[_0x28ad2d(0x1e9)];if(_0x17cdd1)throw new SDKError(ErrorCode[_0x28ad2d(0x1b1)],_0x28ad2d(0x210)+_0x418396+_0x28ad2d(0x1e7),undefined,{'helpText':_0x28ad2d(0x1d0)+_0x28ad2d(0x205)+(_0x28ad2d(0x24f)+_0x418396+'\x0a')+(_0x28ad2d(0x1fd)+_0x12ee8a+_0x28ad2d(0x1f6)+(_0xfe6891||_0x28ad2d(0x1e0))+_0x28ad2d(0x200)+_0x17cdd1)});_0x571a68=_0x418396,console[_0x28ad2d(0x1d9)](a4_0x566038['dim'](_0x28ad2d(0x217)+_0x418396));}}}}if(!_0x571a68)return console[_0x28ad2d(0x1d9)](a4_0x566038[_0x28ad2d(0x19f)](_0x28ad2d(0x242))),console[_0x28ad2d(0x1d9)](_0x28ad2d(0x1a4)),console[_0x28ad2d(0x1d9)]('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console[_0x28ad2d(0x1d9)](_0x28ad2d(0x1e5)),console[_0x28ad2d(0x1d9)](_0x28ad2d(0x219)),0x1;if(!_0xfe6891)throw new SDKError(ErrorCode[_0x28ad2d(0x1df)],_0x28ad2d(0x23c),undefined,{'helpText':_0x28ad2d(0x211)});if(!_0x4fb1a&&!_0x4c3982){if(!isInteractive())return console[_0x28ad2d(0x1cb)](a4_0x566038['red']('\x0aError:'),_0x28ad2d(0x20e)),console[_0x28ad2d(0x1cb)](a4_0x566038['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x57d121=await confirmKey(_0x28ad2d(0x1fa)+_0x571a68+_0x28ad2d(0x1e4)+_0xfe6891+'\x22?');if(!_0x57d121)return console[_0x28ad2d(0x1d9)](a4_0x566038[_0x28ad2d(0x19f)](_0x28ad2d(0x1cf))),0x1;}const {data:_0x58137a}=await withSpinner(_0x28ad2d(0x241)+_0x571a68+_0x28ad2d(0x239)+_0xfe6891+_0x28ad2d(0x1a3),()=>_0x65f791[_0x28ad2d(0x23a)][_0x28ad2d(0x22e)](_0x571a68,_0xfe6891,{'dryRun':_0x4c3982}));if(_0x4c3982){console[_0x28ad2d(0x1d9)](a4_0x566038[_0x28ad2d(0x19f)](_0x28ad2d(0x23f))),console['log'](_0x28ad2d(0x24e)+_0x58137a[_0x28ad2d(0x256)]),console[_0x28ad2d(0x1d9)](_0x28ad2d(0x1be)+_0xfe6891),console[_0x28ad2d(0x1d9)]('Would\x20clone:'),console[_0x28ad2d(0x1d9)](_0x28ad2d(0x255)+_0x58137a[_0x28ad2d(0x21e)][_0x28ad2d(0x220)][_0x28ad2d(0x1fe)]),console[_0x28ad2d(0x1d9)](_0x28ad2d(0x21b)+_0x58137a[_0x28ad2d(0x21e)]['knowledgeBases'][_0x28ad2d(0x1fe)]),console[_0x28ad2d(0x1d9)](_0x28ad2d(0x1af)+_0x58137a[_0x28ad2d(0x21e)][_0x28ad2d(0x204)]['created']);const _0x38068a=_0x58137a['counts'][_0x28ad2d(0x245)][_0x28ad2d(0x1fe)]>0x0||_0x58137a[_0x28ad2d(0x21e)]['experimentalArtifacts']['created']>0x0;return _0x38068a&&(console[_0x28ad2d(0x1d9)](_0x28ad2d(0x1ab)+_0x58137a[_0x28ad2d(0x21e)][_0x28ad2d(0x245)][_0x28ad2d(0x1fe)]),console[_0x28ad2d(0x1d9)](_0x28ad2d(0x225)+_0x58137a[_0x28ad2d(0x21e)][_0x28ad2d(0x1cd)]['created'])),0x0;}const _0x2d910b=_0x58137a[_0x28ad2d(0x21e)]['agents'][_0x28ad2d(0x1d3)]>0x0||_0x58137a[_0x28ad2d(0x21e)]['knowledgeBases'][_0x28ad2d(0x1d3)]>0x0||_0x58137a[_0x28ad2d(0x21e)][_0x28ad2d(0x204)][_0x28ad2d(0x1d3)]>0x0||_0x58137a['counts']['experimentalKnowledgeBases'][_0x28ad2d(0x1d3)]>0x0||_0x58137a[_0x28ad2d(0x21e)][_0x28ad2d(0x1cd)][_0x28ad2d(0x1d3)]>0x0;_0x2d910b?console[_0x28ad2d(0x1d9)](a4_0x566038[_0x28ad2d(0x19f)]('Project\x20cloned\x20with\x20errors')):console[_0x28ad2d(0x1d9)](a4_0x566038[_0x28ad2d(0x201)](_0x28ad2d(0x1b3)));console[_0x28ad2d(0x1d9)]('Source:\x20'+_0x58137a['sourceProjectName']),console['log']('New\x20project:\x20'+_0x58137a[_0x28ad2d(0x221)]),console[_0x28ad2d(0x1d9)]('New\x20project\x20ID:\x20'+_0x58137a['newProjectId']),console['log'](),console[_0x28ad2d(0x1d9)]('Summary:'),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x58137a[_0x28ad2d(0x21e)]['agents'])),console[_0x28ad2d(0x1d9)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x58137a['counts'][_0x28ad2d(0x251)])),console[_0x28ad2d(0x1d9)](_0x28ad2d(0x1af)+formatCountSummary(_0x58137a[_0x28ad2d(0x21e)][_0x28ad2d(0x204)])),console['log'](_0x28ad2d(0x1a2)+formatCountSummary(_0x58137a[_0x28ad2d(0x21e)][_0x28ad2d(0x1b0)]));const _0x36b5bd=_0x58137a['counts']['experimentalKnowledgeBases'][_0x28ad2d(0x1fe)]>0x0||_0x58137a['counts'][_0x28ad2d(0x245)][_0x28ad2d(0x19d)]>0x0||_0x58137a['counts'][_0x28ad2d(0x245)][_0x28ad2d(0x231)]>0x0||_0x58137a[_0x28ad2d(0x21e)]['experimentalArtifacts'][_0x28ad2d(0x1fe)]>0x0||_0x58137a['counts'][_0x28ad2d(0x1cd)][_0x28ad2d(0x19d)]>0x0||_0x58137a[_0x28ad2d(0x21e)]['experimentalArtifacts'][_0x28ad2d(0x231)]>0x0;_0x36b5bd&&(console[_0x28ad2d(0x1d9)](_0x28ad2d(0x1ab)+formatCountSummary(_0x58137a[_0x28ad2d(0x21e)]['experimentalKnowledgeBases'])),console[_0x28ad2d(0x1d9)](_0x28ad2d(0x225)+formatCountSummary(_0x58137a['counts'][_0x28ad2d(0x1cd)])));if(_0x2d910b){console[_0x28ad2d(0x1d9)](),console[_0x28ad2d(0x1d9)](a4_0x566038['red']('Errors:'));for(const _0x182c72 of _0x58137a[_0x28ad2d(0x220)]){_0x182c72[_0x28ad2d(0x20a)]==='error'&&console['log'](a4_0x566038[_0x28ad2d(0x1d4)]('\x20\x20Agent\x20\x22'+_0x182c72['agentName']+'\x22:\x20'+_0x182c72[_0x28ad2d(0x1cb)]));}for(const _0x6197dc of _0x58137a[_0x28ad2d(0x251)]){_0x6197dc[_0x28ad2d(0x20a)]==='error'&&console['log'](a4_0x566038['red'](_0x28ad2d(0x258)+_0x6197dc[_0x28ad2d(0x24c)]+_0x28ad2d(0x232)+_0x6197dc[_0x28ad2d(0x1cb)]));}for(const _0x1abfa6 of _0x58137a[_0x28ad2d(0x204)]){_0x1abfa6[_0x28ad2d(0x20a)]===_0x28ad2d(0x1cb)&&console[_0x28ad2d(0x1d9)](a4_0x566038['red'](_0x28ad2d(0x1c6)+_0x1abfa6['name']+'\x22:\x20'+_0x1abfa6[_0x28ad2d(0x1cb)]));}for(const _0x92cac3 of _0x58137a['integrations']){_0x92cac3[_0x28ad2d(0x20a)]===_0x28ad2d(0x1cb)&&console[_0x28ad2d(0x1d9)](a4_0x566038[_0x28ad2d(0x1d4)](_0x28ad2d(0x1d6)+_0x92cac3['name']+_0x28ad2d(0x232)+_0x92cac3['error']));}for(const _0x455a6d of _0x58137a[_0x28ad2d(0x245)]){_0x455a6d['action']===_0x28ad2d(0x1cb)&&console['log'](a4_0x566038[_0x28ad2d(0x1d4)](_0x28ad2d(0x1b7)+_0x455a6d['name']+_0x28ad2d(0x232)+_0x455a6d['error']));}for(const _0x5770f6 of _0x58137a[_0x28ad2d(0x1cd)]){_0x5770f6[_0x28ad2d(0x20a)]===_0x28ad2d(0x1cb)&&console[_0x28ad2d(0x1d9)](a4_0x566038['red']('\x20\x20Experimental\x20Artifact\x20\x22'+_0x5770f6[_0x28ad2d(0x24c)]+_0x28ad2d(0x232)+_0x5770f6['error']));}return 0x1;}console['log']();const _0x2c4456=getLLMProjectUrl(_0x4e8868,_0x58137a[_0x28ad2d(0x19a)]);return console[_0x28ad2d(0x1d9)](_0x28ad2d(0x1d2)+a4_0x566038[_0x28ad2d(0x23b)](_0x2c4456)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x4f8b7d(0x24c)]=a4_0x4f8b7d(0x1a7);['description']=a4_0x4f8b7d(0x1ef);async[a4_0x4f8b7d(0x22f)](_0x57f399){const _0x41d354=a4_0x4f8b7d,{options:_0x15750c,args:_0x3c6b4b,tdx:_0x562ae1}=_0x57f399;let _0x3c3222=_0x3c6b4b[0x0]||process[_0x41d354(0x1a0)]();const _0x21ecf5=_0x15750c[_0x41d354(0x223)],_0x3a98c7=_0x15750c[_0x41d354(0x20f)],_0x354509=_0x15750c[_0x41d354(0x1ee)],_0x52f021=_0x15750c[_0x41d354(0x1a1)],_0x4ab8be=a4_0x4e99f2[_0x41d354(0x229)](_0x3c3222,'agent.yml'),_0x261d61=existsSync(_0x4ab8be);if(_0x261d61){const {data:_0x31ef91}=await withSpinner(_0x41d354(0x23e)+_0x3c3222+_0x41d354(0x1a3),()=>_0x562ae1[_0x41d354(0x23a)]['pushAgent'](_0x3c3222,{'dryRun':_0x21ecf5,'force':_0x3a98c7}));if(_0x21ecf5)return console['log'](a4_0x566038[_0x41d354(0x19f)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x41d354(0x1d9)](_0x41d354(0x222)+_0x31ef91[_0x41d354(0x248)]),0x0;if(_0x31ef91[_0x41d354(0x20a)]===_0x41d354(0x1cb))return console[_0x41d354(0x1d9)](a4_0x566038[_0x41d354(0x1d4)]('Failed\x20to\x20push\x20agent:\x20'+_0x31ef91[_0x41d354(0x1cb)])),0x1;console[_0x41d354(0x1d9)](a4_0x566038[_0x41d354(0x201)](_0x41d354(0x24d)+_0x31ef91[_0x41d354(0x20a)]+_0x41d354(0x1cc))),console['log'](_0x41d354(0x1f2)+_0x31ef91['agentName']);if(_0x31ef91[_0x41d354(0x1c4)]&&_0x31ef91[_0x41d354(0x1b2)]){const _0x26ffca=getLLMAgentChatUrl(_0x52f021,_0x31ef91[_0x41d354(0x1b2)],_0x31ef91[_0x41d354(0x1c4)]);console[_0x41d354(0x1d9)](_0x41d354(0x1ae)+a4_0x566038[_0x41d354(0x23b)](_0x26ffca));}return 0x0;}const _0x51d3c2=_0x15750c[_0x41d354(0x215)],_0x44ec42=resolveProjectFromContext(_0x3c3222,_0x51d3c2);if(_0x44ec42[_0x41d354(0x235)])_0x3c3222=_0x44ec42[_0x41d354(0x1ba)],_0x44ec42[_0x41d354(0x1f9)]===_0x41d354(0x1bc)&&console[_0x41d354(0x1d9)](a4_0x566038[_0x41d354(0x1f4)](_0x41d354(0x236)+_0x3c3222));else{let _0xa6a0cb=_0x41d354(0x1c5);_0x44ec42[_0x41d354(0x1d8)]==='no_local_folder'&&(_0xa6a0cb=_0x44ec42[_0x41d354(0x22a)]+_0x41d354(0x19e)+_0x44ec42[_0x41d354(0x215)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode[_0x41d354(0x1b1)],_0x44ec42[_0x41d354(0x1d8)]==='no_context'?_0x44ec42['message']:'No\x20tdx.json\x20found\x20in\x20'+_0x3c3222,undefined,{'helpText':_0xa6a0cb});}const {data:_0x5f3e40}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x562ae1[_0x41d354(0x23a)][_0x41d354(0x21d)](_0x3c3222,{'dryRun':!![]})),_0x163fde=_0x5f3e40['counts'][_0x41d354(0x220)][_0x41d354(0x1d3)]>0x0;if(_0x163fde){console[_0x41d354(0x1d9)](a4_0x566038['red']('\x0aErrors\x20found:'));for(const _0x13b8a0 of _0x5f3e40['agents']){_0x13b8a0['action']==='error'&&console[_0x41d354(0x1d9)](a4_0x566038[_0x41d354(0x1d4)]('\x20\x20Agent\x20\x22'+_0x13b8a0[_0x41d354(0x248)]+'\x22:\x20'+_0x13b8a0['error']));}return 0x1;}const _0x4876bb=_0x5f3e40['counts'][_0x41d354(0x220)][_0x41d354(0x1fe)]+_0x5f3e40['counts'][_0x41d354(0x251)][_0x41d354(0x1fe)]+_0x5f3e40[_0x41d354(0x21e)][_0x41d354(0x237)][_0x41d354(0x1fe)]+_0x5f3e40[_0x41d354(0x21e)][_0x41d354(0x204)][_0x41d354(0x1fe)]+_0x5f3e40[_0x41d354(0x21e)][_0x41d354(0x1b0)][_0x41d354(0x1fe)]+_0x5f3e40[_0x41d354(0x21e)][_0x41d354(0x245)][_0x41d354(0x1fe)]+_0x5f3e40[_0x41d354(0x21e)][_0x41d354(0x1cd)]['created'],_0x371ae6=_0x5f3e40[_0x41d354(0x21e)][_0x41d354(0x220)][_0x41d354(0x19d)]+_0x5f3e40[_0x41d354(0x21e)][_0x41d354(0x251)][_0x41d354(0x19d)]+_0x5f3e40['counts']['textKnowledgeBases']['updated']+_0x5f3e40[_0x41d354(0x21e)]['prompts'][_0x41d354(0x19d)]+_0x5f3e40[_0x41d354(0x21e)][_0x41d354(0x1b0)][_0x41d354(0x19d)]+_0x5f3e40[_0x41d354(0x21e)][_0x41d354(0x245)]['updated']+_0x5f3e40[_0x41d354(0x21e)][_0x41d354(0x1cd)][_0x41d354(0x19d)],_0x3f1848=_0x5f3e40[_0x41d354(0x21e)][_0x41d354(0x220)][_0x41d354(0x231)]+_0x5f3e40[_0x41d354(0x21e)][_0x41d354(0x251)]['unchanged']+_0x5f3e40[_0x41d354(0x21e)][_0x41d354(0x237)][_0x41d354(0x231)]+_0x5f3e40[_0x41d354(0x21e)][_0x41d354(0x204)]['unchanged']+_0x5f3e40[_0x41d354(0x21e)][_0x41d354(0x1b0)][_0x41d354(0x231)]+_0x5f3e40['counts'][_0x41d354(0x245)][_0x41d354(0x231)]+_0x5f3e40['counts']['experimentalArtifacts'][_0x41d354(0x231)];console[_0x41d354(0x1d9)](_0x41d354(0x1a5)+_0x5f3e40[_0x41d354(0x250)]+'\x27:'),console['log']('\x20\x20'+a4_0x566038['green']('+\x20'+_0x4876bb+_0x41d354(0x1fb))+_0x41d354(0x1b6)+a4_0x566038[_0x41d354(0x19f)]('~\x20'+_0x371ae6+_0x41d354(0x1ce))+_0x41d354(0x1b6)+a4_0x566038[_0x41d354(0x1f4)]('=\x20'+_0x3f1848+_0x41d354(0x254))),console[_0x41d354(0x1d9)](_0x41d354(0x255)+formatCountSummary(_0x5f3e40[_0x41d354(0x21e)][_0x41d354(0x220)])),console[_0x41d354(0x1d9)](_0x41d354(0x21b)+formatCountSummary(_0x5f3e40['counts']['knowledgeBases'])),console[_0x41d354(0x1d9)](_0x41d354(0x1b5)+formatCountSummary(_0x5f3e40['counts']['textKnowledgeBases'])),console['log'](_0x41d354(0x1af)+formatCountSummary(_0x5f3e40[_0x41d354(0x21e)][_0x41d354(0x204)])),console['log'](_0x41d354(0x1a2)+formatCountSummary(_0x5f3e40[_0x41d354(0x21e)][_0x41d354(0x1b0)]));const _0x291e0e=_0x5f3e40['counts'][_0x41d354(0x245)]['created']>0x0||_0x5f3e40[_0x41d354(0x21e)][_0x41d354(0x245)][_0x41d354(0x19d)]>0x0||_0x5f3e40['counts']['experimentalKnowledgeBases'][_0x41d354(0x231)]>0x0||_0x5f3e40[_0x41d354(0x21e)][_0x41d354(0x1cd)][_0x41d354(0x1fe)]>0x0||_0x5f3e40[_0x41d354(0x21e)]['experimentalArtifacts'][_0x41d354(0x19d)]>0x0||_0x5f3e40[_0x41d354(0x21e)][_0x41d354(0x1cd)][_0x41d354(0x231)]>0x0;_0x291e0e&&(console[_0x41d354(0x1d9)](_0x41d354(0x1ab)+formatCountSummary(_0x5f3e40[_0x41d354(0x21e)]['experimentalKnowledgeBases'])),console[_0x41d354(0x1d9)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x5f3e40[_0x41d354(0x21e)][_0x41d354(0x1cd)])));console[_0x41d354(0x1d9)]('\x20\x20Source:\x20'+a4_0x566038['cyan'](_0x3c3222)),displayDiffs(_0x5f3e40[_0x41d354(0x220)],_0x5f3e40[_0x41d354(0x251)],_0x5f3e40[_0x41d354(0x237)],_0x5f3e40[_0x41d354(0x204)],_0x5f3e40[_0x41d354(0x1b0)],_0x5f3e40[_0x41d354(0x245)],_0x5f3e40[_0x41d354(0x1cd)]);if(_0x21ecf5)return console['log'](a4_0x566038[_0x41d354(0x19f)](_0x41d354(0x1aa))),0x0;if(_0x4876bb===0x0&&_0x371ae6===0x0){console[_0x41d354(0x1d9)](a4_0x566038['green']('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x4ab541=getLLMProjectUrl(_0x52f021,_0x5f3e40['projectId']);return console[_0x41d354(0x1d9)](_0x41d354(0x1d2)+a4_0x566038['cyan'](_0x4ab541)),0x0;}if(!_0x354509&&!_0x3a98c7){if(!isInteractive())return console[_0x41d354(0x1cb)](a4_0x566038[_0x41d354(0x1d4)](_0x41d354(0x224)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x41d354(0x1cb)](a4_0x566038[_0x41d354(0x1f4)](_0x41d354(0x1c3))),0x1;const _0x5b838a=await confirmKey(_0x41d354(0x21f)+(_0x4876bb+_0x371ae6)+_0x41d354(0x218));if(!_0x5b838a)return console[_0x41d354(0x1d9)](a4_0x566038['yellow'](_0x41d354(0x1cf)),_0x41d354(0x226)),0x1;}const {data:_0x314929}=await withSpinner(_0x41d354(0x24b),()=>_0x562ae1[_0x41d354(0x23a)][_0x41d354(0x21d)](_0x3c3222,{'force':_0x3a98c7})),_0x3364cc=_0x314929[_0x41d354(0x21e)][_0x41d354(0x220)][_0x41d354(0x1d3)]>0x0||_0x314929[_0x41d354(0x21e)][_0x41d354(0x251)][_0x41d354(0x1d3)]>0x0||_0x314929[_0x41d354(0x21e)][_0x41d354(0x237)][_0x41d354(0x1d3)]>0x0||_0x314929[_0x41d354(0x21e)][_0x41d354(0x204)][_0x41d354(0x1d3)]>0x0;if(_0x3364cc){console[_0x41d354(0x1d9)](a4_0x566038[_0x41d354(0x19f)](_0x41d354(0x1fc))),console[_0x41d354(0x1d9)](),console['log'](a4_0x566038[_0x41d354(0x1d4)](_0x41d354(0x233)));for(const _0x3772d2 of _0x314929['agents']){_0x3772d2[_0x41d354(0x20a)]===_0x41d354(0x1cb)&&console[_0x41d354(0x1d9)](a4_0x566038[_0x41d354(0x1d4)]('\x20\x20Agent\x20\x22'+_0x3772d2[_0x41d354(0x248)]+'\x22:\x20'+_0x3772d2[_0x41d354(0x1cb)]));}for(const _0x4b2f80 of _0x314929['knowledgeBases']){_0x4b2f80['action']===_0x41d354(0x1cb)&&console[_0x41d354(0x1d9)](a4_0x566038[_0x41d354(0x1d4)](_0x41d354(0x258)+_0x4b2f80['name']+_0x41d354(0x232)+_0x4b2f80[_0x41d354(0x1cb)]));}for(const _0x158052 of _0x314929[_0x41d354(0x237)]){_0x158052['action']==='error'&&console['log'](a4_0x566038[_0x41d354(0x1d4)](_0x41d354(0x1e8)+_0x158052[_0x41d354(0x24c)]+_0x41d354(0x232)+_0x158052[_0x41d354(0x1cb)]));}for(const _0x31f41c of _0x314929[_0x41d354(0x204)]){_0x31f41c[_0x41d354(0x20a)]===_0x41d354(0x1cb)&&console[_0x41d354(0x1d9)](a4_0x566038[_0x41d354(0x1d4)](_0x41d354(0x1c6)+_0x31f41c['name']+_0x41d354(0x232)+_0x31f41c[_0x41d354(0x1cb)]));}for(const _0x52b677 of _0x314929[_0x41d354(0x1b0)]){_0x52b677[_0x41d354(0x20a)]===_0x41d354(0x1cb)&&console[_0x41d354(0x1d9)](a4_0x566038[_0x41d354(0x1d4)](_0x41d354(0x1d6)+_0x52b677['name']+_0x41d354(0x232)+_0x52b677[_0x41d354(0x1cb)]));}return 0x1;}console[_0x41d354(0x1d9)](a4_0x566038[_0x41d354(0x201)]('\x0a✔\x20Pushed\x20'+(_0x4876bb+_0x371ae6)+_0x41d354(0x1e3)+_0x314929[_0x41d354(0x250)]+'\x27'));const _0x2f3b26=getLLMProjectUrl(_0x52f021,_0x314929[_0x41d354(0x1b2)]);return console[_0x41d354(0x1d9)]('Project:\x20'+a4_0x566038['cyan'](_0x2f3b26)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x45a8d5=a5_0x1dd7;(function(_0x4b5f11,_0x107208){const _0x4ead6b=a5_0x1dd7,_0x376af4=_0x4b5f11();while(!![]){try{const _0x4d227d=-parseInt(_0x4ead6b(0xa5))/0x1*(-parseInt(_0x4ead6b(0xdc))/0x2)+parseInt(_0x4ead6b(0x111))/0x3+parseInt(_0x4ead6b(0xca))/0x4*(-parseInt(_0x4ead6b(0x107))/0x5)+-parseInt(_0x4ead6b(0xdb))/0x6*(-parseInt(_0x4ead6b(0xc6))/0x7)+parseInt(_0x4ead6b(0xa6))/0x8+-parseInt(_0x4ead6b(0xaf))/0x9*(parseInt(_0x4ead6b(0xad))/0xa)+-parseInt(_0x4ead6b(0xd4))/0xb*(parseInt(_0x4ead6b(0xd3))/0xc);if(_0x4d227d===_0x107208)break;else _0x376af4['push'](_0x376af4['shift']());}catch(_0x251904){_0x376af4['push'](_0x376af4['shift']());}}}(a5_0x175a,0x50572));import*as a5_0x5ca225 from'node:fs';import*as a5_0x2b3251 from'node:path';function a5_0x1dd7(_0x39ab5d,_0x331b45){_0x39ab5d=_0x39ab5d-0x9c;const _0x175a33=a5_0x175a();let _0x1dd70d=_0x175a33[_0x39ab5d];return _0x1dd70d;}function a5_0x175a(){const _0x4eb93b=['add','Run\x20tests\x20for\x20an\x20LLM\x20agent','\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','40qZQhGz',':\x20Sending\x20user\x20input...','406863OhjJje','executeReeval','trim','Test\x20','red','Passed:\x20\x20\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','push','Error\x20writing\x20output\x20file:\x20','isSpinning','table','\x20(cached)','yellow','test.yml','\x20\x20-\x20','\x22:\x20','verbose','eval','Failed\x20Tests:','no_context','context','...\x20','Site:\x20','4589137HFZCOu','\x20\x20Agent:\x20','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','✗\x20ERROR:\x20Project\x20not\x20found:\x20','216xWxEiH','json','dryRun','llmProject','Duration:\x20','Round\x201/','toISOString','Total:\x20\x20\x20\x20','jsonl','2478936SoxyWx','55Wclwce','Cached\x20run\x20from:\x20','writeFileSync','Agent:\x20','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','join','filter','6SbWpph','9014XpoEvq','Test\x20Summary','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','site','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','repeat','PASS','Re-evaluating...','has','agent','Output\x20written\x20to:\x20','map','Evaluating\x20response...','basename','testYmlPath','dim','Re-evaluating\x20','rounds','Executing\x20new\x20tests...','utf-8','not\x20found','...','projectDir','message','Re-evaluation\x20Summary','Failed:\x20\x20\x20','now','Errors:\x20\x20\x20','✓\x20PASS:\x20','execute','round','green','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','includes','Running\x20agent\x20tests...','conversation_url','Conversation\x20URL:\x20','log','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','size','No\x20tests\x20found\x20with\x20tags:\x20','existsSync','14285LwJoSr','testName','Round\x20','No\x20tests\x20found\x20matching:\x20','some','Running\x20test:\x20','\x20\x20Project:\x20','substring','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','white','527550PfCtwT','toLowerCase','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','ERROR','start','Project\x20path:\x20','text','FAIL','llm','\x20\x20Site:\x20','status','split','Tests\x20found:\x20','Running:\x20','\x20\x20Round\x20','\x20\x20Conversation:\x20','Test\x20Configuration:','⚠\x20SKIPPED:\x20','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','description','timestamp','✗\x20ERROR:\x20','\x20-\x20','resolve','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','Either\x20switch\x20to\x20the\x20\x22','Available\x20tests:\x20','\x22,\x20but\x20current\x20site\x20is\x20\x22','reason','/<agent-name>','404','found','Available\x20tags:\x20','\x20(new)','cyan','projectName','agentName','✗\x20FAIL:\x20','stop','tsv','tests','source','no_tests','name','find','length','67asJvVV','4509280pkzkZm','tags','\x20\x20Evaluating...\x20','New\x20tests\x20to\x20execute:\x20'];a5_0x175a=function(){return _0x4eb93b;};return a5_0x175a();}import a5_0x3a3fc5 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{[a5_0x45a8d5(0xa2)]='agent:test';[a5_0x45a8d5(0x124)]=a5_0x45a8d5(0xab);async[a5_0x45a8d5(0xfa)](_0x5c6eaa){const _0x33c30c=a5_0x45a8d5,{options:_0x32d331,args:_0x35449c,tdx:_0x51d36f}=_0x5c6eaa,_0x6d926c=_0x35449c[0x0]||'.',_0x3a5344=_0x32d331[_0x33c30c(0xcc)],_0x482611=_0x32d331,_0x423c43=_0x482611[_0x33c30c(0xc0)]===![],_0x3db73b=_0x482611['reeval'],_0x2d23c2=_0x482611['name'],_0x260392=_0x482611[_0x33c30c(0xa7)],_0x365c35=_0x32d331[_0x33c30c(0xe0)],_0xf8f27d=_0x482611['output'];if(_0x3db73b&&_0x423c43)return console[_0x33c30c(0x102)](a5_0x3a3fc5[_0x33c30c(0xb3)](_0x33c30c(0xd8))),0x1;let _0x339e89='table';if(_0x482611['json'])_0x339e89=_0x33c30c(0xcb);else{if(_0x482611[_0x33c30c(0xd2)])_0x339e89='jsonl';else{if(_0x482611['tsv'])_0x339e89=_0x33c30c(0x9e);else{if(_0x482611[_0x33c30c(0xb9)])_0x339e89=_0x33c30c(0xb9);}}}const _0x15fda8=_0x482611[_0x33c30c(0xcd)];let _0x58536d=_0x6d926c;const _0x2a2a47=a5_0x5ca225[_0x33c30c(0x106)](_0x6d926c),_0x451c0c=_0x6d926c==='.';if(!_0x2a2a47||_0x451c0c){const _0x35b8d9=resolveProjectFromContext(_0x6d926c,_0x15fda8,{'requireFile':_0x33c30c(0xbc)});if(_0x35b8d9[_0x33c30c(0x130)])_0x58536d=_0x35b8d9['projectDir'],_0x35b8d9[_0x33c30c(0xa0)]===_0x33c30c(0xc3)&&console[_0x33c30c(0x102)](a5_0x3a3fc5[_0x33c30c(0xec)]('Using\x20agent:\x20'+_0x58536d));else switch(_0x35b8d9[_0x33c30c(0x12d)]){case _0x33c30c(0xc2):console[_0x33c30c(0x102)](a5_0x3a3fc5[_0x33c30c(0xbb)](_0x35b8d9[_0x33c30c(0xf4)])),console[_0x33c30c(0x102)](),console[_0x33c30c(0x102)]('Usage:'),console[_0x33c30c(0x102)](_0x33c30c(0xac)),console[_0x33c30c(0x102)]('\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x33c30c(0x102)](),console[_0x33c30c(0x102)](_0x33c30c(0xc8));return 0x1;case'no_local_folder':console[_0x33c30c(0x102)](a5_0x3a3fc5[_0x33c30c(0xbb)](_0x35b8d9[_0x33c30c(0xf4)])),console[_0x33c30c(0x102)](),console[_0x33c30c(0x102)]('Run\x20\x27tdx\x20agent\x20pull\x20'+_0x35b8d9[_0x33c30c(0xcd)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');return 0x1;case'multiple_agents':{const _0x5bf2cb=a5_0x2b3251[_0x33c30c(0xea)](_0x35b8d9['projectDir']);console[_0x33c30c(0x102)](a5_0x3a3fc5[_0x33c30c(0xbb)](_0x33c30c(0x123)+_0x35b8d9[_0x33c30c(0xcd)]+'\x22:'));for(const _0x245544 of _0x35b8d9['agentDirs']){console[_0x33c30c(0x102)](_0x33c30c(0xbd)+_0x245544);}return console[_0x33c30c(0x102)](),console[_0x33c30c(0x102)](_0x33c30c(0xde)+_0x5bf2cb+_0x33c30c(0x12e)),0x1;}case _0x33c30c(0xa1):console['log'](a5_0x3a3fc5[_0x33c30c(0xbb)](_0x33c30c(0x129)+_0x35b8d9[_0x33c30c(0xcd)]+'\x22.')),console['log'](a5_0x3a3fc5[_0x33c30c(0xec)](_0x33c30c(0x116)+_0x35b8d9[_0x33c30c(0xf3)])),console[_0x33c30c(0x102)](),console['log']('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0x1e71b5,agentInfo:_0xf8e561}=parseTestFile(_0x58536d);let _0x38ee92=_0x1e71b5[_0x33c30c(0x9f)];if(_0x2d23c2){const _0x320428=_0x2d23c2[_0x33c30c(0x11c)](',')['map'](_0x19b9be=>_0x19b9be[_0x33c30c(0xb1)]());_0x38ee92=_0x1e71b5[_0x33c30c(0x9f)]['filter'](_0xa106b4=>_0x320428[_0x33c30c(0xfe)](_0xa106b4[_0x33c30c(0xa2)]));if(_0x38ee92[_0x33c30c(0xa4)]===0x0)return console['log'](a5_0x3a3fc5[_0x33c30c(0xbb)](_0x33c30c(0x10a)+_0x2d23c2)),console[_0x33c30c(0x102)](a5_0x3a3fc5[_0x33c30c(0xec)](_0x33c30c(0x12b)+_0x1e71b5[_0x33c30c(0x9f)][_0x33c30c(0xe8)](_0x4e7763=>_0x4e7763[_0x33c30c(0xa2)])['join'](',\x20'))),0x1;}if(_0x260392){const _0x6c6f6a=_0x260392[_0x33c30c(0x11c)](',')[_0x33c30c(0xe8)](_0x45fd1c=>_0x45fd1c[_0x33c30c(0xb1)]()['toLowerCase']());_0x38ee92=_0x38ee92[_0x33c30c(0xda)](_0x331f42=>_0x331f42[_0x33c30c(0xa7)]?.[_0x33c30c(0x10b)](_0x4ccba3=>_0x6c6f6a[_0x33c30c(0xfe)](_0x4ccba3[_0x33c30c(0x112)]())));if(_0x38ee92[_0x33c30c(0xa4)]===0x0){console[_0x33c30c(0x102)](a5_0x3a3fc5[_0x33c30c(0xbb)](_0x33c30c(0x105)+_0x260392));const _0x4390ca=new Set();return _0x1e71b5[_0x33c30c(0x9f)]['forEach'](_0x38d504=>_0x38d504[_0x33c30c(0xa7)]?.['forEach'](_0x1c37bf=>_0x4390ca[_0x33c30c(0xaa)](_0x1c37bf))),_0x4390ca[_0x33c30c(0x104)]>0x0?console[_0x33c30c(0x102)](a5_0x3a3fc5[_0x33c30c(0xec)](_0x33c30c(0x131)+[..._0x4390ca][_0x33c30c(0xd9)](',\x20'))):console[_0x33c30c(0x102)](a5_0x3a3fc5[_0x33c30c(0xec)]('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0x3db73b)return this['executeReeval'](_0x5c6eaa,{'definition':{'tests':_0x38ee92},'agentInfo':_0xf8e561,'outputFormat':_0x339e89,'outputFile':_0xf8f27d,'testNames':_0x2d23c2});if(_0x3a5344){console[_0x33c30c(0x102)](a5_0x3a3fc5[_0x33c30c(0x133)](_0x33c30c(0x121))),console['log'](_0x33c30c(0x11a)+a5_0x3a3fc5[_0x33c30c(0x110)](_0x365c35)),console[_0x33c30c(0x102)](_0x33c30c(0x10d)+a5_0x3a3fc5[_0x33c30c(0x110)](_0xf8e561[_0x33c30c(0x134)])),console[_0x33c30c(0x102)](_0x33c30c(0xc7)+a5_0x3a3fc5[_0x33c30c(0x110)](_0xf8e561[_0x33c30c(0x135)])),console[_0x33c30c(0x102)](),console[_0x33c30c(0x102)](_0x33c30c(0x11d)+a5_0x3a3fc5[_0x33c30c(0x110)](_0x38ee92[_0x33c30c(0xa4)]));for(let _0x442a09=0x0;_0x442a09<_0x38ee92[_0x33c30c(0xa4)];_0x442a09++){const _0x2f5001=_0x38ee92[_0x442a09],_0x5f5d80=_0x2f5001[_0x33c30c(0xee)][_0x33c30c(0xa4)]===0x1?_0x33c30c(0xfb):_0x33c30c(0xee),_0x4a8beb=_0x2f5001[_0x33c30c(0xa7)]?.['length']?'\x20['+_0x2f5001['tags'][_0x33c30c(0xd9)](',\x20')+']':'';console['log']('\x20\x20'+(_0x442a09+0x1)+'.\x20'+a5_0x3a3fc5['white'](_0x2f5001[_0x33c30c(0xa2)])+'\x20('+_0x2f5001['rounds']['length']+'\x20'+_0x5f5d80+')'+a5_0x3a3fc5[_0x33c30c(0xec)](_0x4a8beb));}return 0x0;}let _0x5ef393,_0x4c559c;try{_0x5ef393=await _0x51d36f[_0x33c30c(0x119)]['resolveProjectId'](_0xf8e561[_0x33c30c(0x134)]);}catch(_0x22aa2c){const _0x4dc193=_0x22aa2c instanceof Error?_0x22aa2c[_0x33c30c(0xf4)]:String(_0x22aa2c);return _0x4dc193[_0x33c30c(0xfe)](_0x33c30c(0x12f))||_0x4dc193[_0x33c30c(0x112)]()[_0x33c30c(0xfe)](_0x33c30c(0xf1))?console[_0x33c30c(0x102)](a5_0x3a3fc5[_0x33c30c(0xb3)](_0x33c30c(0xc9)+_0xf8e561['projectName'])):console[_0x33c30c(0x102)](a5_0x3a3fc5[_0x33c30c(0xb3)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0xf8e561['projectName']+_0x33c30c(0xbe)+_0x4dc193)),0x1;}try{_0x4c559c=await _0x51d36f['llm']['resolveAgentId'](_0xf8e561[_0x33c30c(0x135)],_0x5ef393);}catch(_0x4a8541){const _0x3ac1fb=_0x4a8541 instanceof Error?_0x4a8541[_0x33c30c(0xf4)]:String(_0x4a8541);return _0x3ac1fb[_0x33c30c(0xfe)](_0x33c30c(0x12f))||_0x3ac1fb[_0x33c30c(0x112)]()[_0x33c30c(0xfe)](_0x33c30c(0xf1))?console[_0x33c30c(0x102)](a5_0x3a3fc5[_0x33c30c(0xb3)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0xf8e561[_0x33c30c(0x135)])):console['log'](a5_0x3a3fc5[_0x33c30c(0xb3)](_0x33c30c(0x103)+_0xf8e561['agentName']+_0x33c30c(0xbe)+_0x3ac1fb)),0x1;}let _0x584747;if(!_0x423c43)try{_0x584747=await setupEvaluatorAgent(_0x51d36f[_0x33c30c(0x119)],_0x32d331['verbose']);}catch(_0x4aef6b){const _0x45def7=_0x4aef6b instanceof Error?_0x4aef6b['message']:String(_0x4aef6b);return console[_0x33c30c(0x102)](a5_0x3a3fc5[_0x33c30c(0xb3)](_0x33c30c(0x10f)+_0x45def7)),0x1;}console[_0x33c30c(0x102)](a5_0x3a3fc5[_0x33c30c(0x133)](_0x33c30c(0xff))),console['log'](_0x33c30c(0xc5)+a5_0x3a3fc5[_0x33c30c(0x110)](_0x365c35)),console[_0x33c30c(0x102)](_0x33c30c(0xd7)+a5_0x3a3fc5[_0x33c30c(0x110)](_0xf8e561[_0x33c30c(0x134)]+'/'+_0xf8e561[_0x33c30c(0x135)])),console[_0x33c30c(0x102)]();const _0x561a1a=[],_0x4898f5=[],_0x4e6207=Date[_0x33c30c(0xf7)]();for(let _0x2e2610=0x0;_0x2e2610<_0x38ee92[_0x33c30c(0xa4)];_0x2e2610++){const _0x1f69f0=_0x38ee92[_0x2e2610];_0x38ee92[_0x33c30c(0xa4)]>0x1?console['log'](_0x33c30c(0xb2)+(_0x2e2610+0x1)+'/'+_0x38ee92['length']+':\x20'+a5_0x3a3fc5[_0x33c30c(0x110)](_0x1f69f0[_0x33c30c(0xa2)])):console[_0x33c30c(0x102)](_0x33c30c(0x10c)+a5_0x3a3fc5['white'](_0x1f69f0['name']));const _0x462a08=createCommandSpinner(_0x33c30c(0xcf)+_0x1f69f0[_0x33c30c(0xee)][_0x33c30c(0xa4)]+_0x33c30c(0xae));_0x462a08[_0x33c30c(0x115)]();try{const {result:_0x4f8c07,conversation:_0x596c4e}=await runTest(_0x51d36f[_0x33c30c(0x119)],_0x1f69f0,{'agentId':_0x4c559c,'projectId':_0x5ef393,'site':_0x365c35,'noEval':_0x423c43,'evaluatorId':_0x584747,'onRoundStart':(_0x3327ad,_0x3ea42a)=>{const _0x1fda4b=_0x33c30c;_0x462a08['text']=_0x1fda4b(0x109)+(_0x3327ad+0x1)+'/'+_0x3ea42a+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x330cac,_0x1e11ac,_0x2905ab)=>{const _0x49d52a=_0x33c30c,_0x545bd8=formatElapsed(_0x1e11ac);_0x2905ab?console[_0x49d52a(0x102)](_0x49d52a(0x11f)+(_0x330cac+0x1)+'/'+_0x1f69f0['rounds'][_0x49d52a(0xa4)]+'...\x20'+a5_0x3a3fc5[_0x49d52a(0xfc)]('✓')+'\x20('+_0x545bd8+')'):console['log'](_0x49d52a(0x11f)+(_0x330cac+0x1)+'/'+_0x1f69f0[_0x49d52a(0xee)]['length']+_0x49d52a(0xc4)+a5_0x3a3fc5[_0x49d52a(0xb3)]('✗'));},'onEvaluationStart':()=>{const _0x437668=_0x33c30c;_0x462a08['text']=_0x437668(0xe9);},'onEvaluationComplete':_0x84d558=>{const _0x126f43=_0x33c30c,_0x5e7d14=formatElapsed(_0x84d558);console['log']('\x20\x20Evaluating...\x20'+a5_0x3a3fc5[_0x126f43(0xfc)]('✓')+'\x20('+_0x5e7d14+')');}});_0x462a08[_0x33c30c(0x9d)](),_0x561a1a[_0x33c30c(0xb6)](_0x4f8c07),_0x4898f5['push'](_0x596c4e);if(_0x4f8c07['status']===_0x33c30c(0xe3))console['log'](a5_0x3a3fc5['green'](_0x33c30c(0xf9)+_0x4f8c07['reason']));else _0x4f8c07[_0x33c30c(0x11b)]===_0x33c30c(0x118)?console[_0x33c30c(0x102)](a5_0x3a3fc5[_0x33c30c(0xb3)](_0x33c30c(0x9c)+_0x4f8c07['reason'])):console[_0x33c30c(0x102)](a5_0x3a3fc5[_0x33c30c(0xb3)]('✗\x20ERROR:\x20'+_0x4f8c07[_0x33c30c(0x12d)]));_0x4f8c07[_0x33c30c(0x100)]&&console[_0x33c30c(0x102)](a5_0x3a3fc5[_0x33c30c(0xec)](_0x33c30c(0x101)+_0x4f8c07[_0x33c30c(0x100)])),console[_0x33c30c(0x102)]();}catch(_0x5dc35b){_0x462a08[_0x33c30c(0x9d)]();const _0x5c3937=_0x5dc35b instanceof Error?_0x5dc35b[_0x33c30c(0xf4)]:String(_0x5dc35b);console[_0x33c30c(0x102)](a5_0x3a3fc5['red']('✗\x20ERROR:\x20'+_0x5c3937)),console[_0x33c30c(0x102)](),_0x561a1a['push']({'name':_0x1f69f0[_0x33c30c(0xa2)],'status':'ERROR','reason':_0x5c3937,'timestamp':new Date()[_0x33c30c(0xd0)](),'duration_ms':0x0});}}const _0x456aa1=Date[_0x33c30c(0xf7)]()-_0x4e6207,_0x18dd1a=_0x561a1a[_0x33c30c(0xda)](_0x507176=>_0x507176[_0x33c30c(0x11b)]===_0x33c30c(0xe3))['length'],_0x322f39=_0x561a1a[_0x33c30c(0xda)](_0x25a73a=>_0x25a73a[_0x33c30c(0x11b)]===_0x33c30c(0x118))['length'],_0x2fbe98=_0x561a1a[_0x33c30c(0xda)](_0x36a749=>_0x36a749[_0x33c30c(0x11b)]===_0x33c30c(0x114))['length'];console[_0x33c30c(0x102)]('━'[_0x33c30c(0xe2)](0x3c)),console[_0x33c30c(0x102)](_0x33c30c(0xdd)),console[_0x33c30c(0x102)]('━'[_0x33c30c(0xe2)](0x3c)),console['log'](_0x33c30c(0xd1)+_0x561a1a[_0x33c30c(0xa4)]),console[_0x33c30c(0x102)]('Passed:\x20\x20\x20'+a5_0x3a3fc5[_0x33c30c(0xfc)](_0x18dd1a)),console[_0x33c30c(0x102)](_0x33c30c(0xf6)+a5_0x3a3fc5[_0x33c30c(0xb3)](_0x322f39));_0x2fbe98>0x0&&console['log'](_0x33c30c(0xf8)+a5_0x3a3fc5[_0x33c30c(0xb3)](_0x2fbe98));console['log'](_0x33c30c(0xce)+formatElapsed(_0x456aa1)),console['log']('━'[_0x33c30c(0xe2)](0x3c));const _0x3187d3=_0x561a1a[_0x33c30c(0xda)](_0x5e230d=>_0x5e230d[_0x33c30c(0x11b)]!==_0x33c30c(0xe3));if(_0x3187d3[_0x33c30c(0xa4)]>0x0){console['log'](),console['log'](_0x33c30c(0xc1));for(const _0x527063 of _0x3187d3){const _0xe2a838=a5_0x3a3fc5[_0x33c30c(0xb3)]('✗'),_0x57ae14=_0x527063[_0x33c30c(0x12d)][_0x33c30c(0xa4)]>0x32?_0x527063[_0x33c30c(0x12d)][_0x33c30c(0x10e)](0x0,0x32)+'...':_0x527063[_0x33c30c(0x12d)];console[_0x33c30c(0x102)]('\x20\x20'+_0xe2a838+'\x20'+_0x527063['name']+':\x20'+_0x57ae14);}}const _0x26bf6c={'summary':{'total':_0x561a1a[_0x33c30c(0xa4)],'passed':_0x18dd1a,'failed':_0x322f39,'errors':_0x2fbe98>0x0?_0x2fbe98:undefined,'duration_ms':_0x456aa1},'tests':_0x561a1a,'agent':{'project':_0xf8e561[_0x33c30c(0x134)],'name':_0xf8e561[_0x33c30c(0x135)],'site':_0x365c35},'timestamp':new Date(_0x4e6207)[_0x33c30c(0xd0)]()};try{const _0x213cb7=buildCachedTestRun(_0x4898f5,{'site':_0x365c35,'projectId':_0x5ef393,'projectName':_0xf8e561[_0x33c30c(0x134)],'agentId':_0x4c559c,'agentName':_0xf8e561[_0x33c30c(0x135)],'testYmlPath':a5_0x2b3251[_0x33c30c(0x128)](_0xf8e561[_0x33c30c(0xeb)])});saveLastTestRun(_0x213cb7);}catch{}if(_0x339e89!==_0x33c30c(0xb9)||_0xf8f27d){const _0x3b7e47=formatResults(_0x26bf6c,_0x339e89);if(_0xf8f27d)try{a5_0x5ca225[_0x33c30c(0xd6)](_0xf8f27d,_0x3b7e47,'utf-8'),console['log'](),console[_0x33c30c(0x102)](a5_0x3a3fc5[_0x33c30c(0xec)]('Output\x20written\x20to:\x20'+_0xf8f27d));}catch(_0x120b61){return console[_0x33c30c(0x102)](),console[_0x33c30c(0x102)](a5_0x3a3fc5[_0x33c30c(0xb3)](_0x33c30c(0xb7)+_0x120b61)),0x1;}else console[_0x33c30c(0x102)](),console[_0x33c30c(0x102)](_0x3b7e47);}return _0x3187d3[_0x33c30c(0xa4)]>0x0?0x1:0x0;}async[a5_0x45a8d5(0xb0)](_0x3cb9c7,_0x1dfbe7){const _0x340f6d=a5_0x45a8d5,{options:_0x188d53,tdx:_0x59285e}=_0x3cb9c7,{definition:_0x4a55a8,agentInfo:_0x54533b,outputFormat:_0x3528da,outputFile:_0xb9ca9d}=_0x1dfbe7,_0x5af4f3=_0x188d53['site'],_0x4ef744=loadLastTestRun();if(!_0x4ef744)return console[_0x340f6d(0x102)](a5_0x3a3fc5['red']('Error:\x20No\x20previous\x20test\x20run\x20found.')),console[_0x340f6d(0x102)](a5_0x3a3fc5[_0x340f6d(0xec)](_0x340f6d(0x113))),0x1;if(_0x4ef744['agent'][_0x340f6d(0x135)]!==_0x54533b[_0x340f6d(0x135)])return console[_0x340f6d(0x102)](a5_0x3a3fc5['red']('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x4ef744[_0x340f6d(0xe6)]['agentName']+_0x340f6d(0xfd)+_0x54533b[_0x340f6d(0x135)]+'\x22.')),console[_0x340f6d(0x102)](a5_0x3a3fc5['dim'](_0x340f6d(0xdf))),0x1;const _0x2c1397=new Set(_0x4ef744['conversations'][_0x340f6d(0xe8)](_0x2cbda4=>_0x2cbda4[_0x340f6d(0x108)])),_0x2672f8=_0x4a55a8[_0x340f6d(0x9f)][_0x340f6d(0xda)](_0x17cf40=>!_0x2c1397[_0x340f6d(0xe5)](_0x17cf40[_0x340f6d(0xa2)]));if(_0x2672f8['length']>0x0&&_0x4ef744[_0x340f6d(0xe0)]!==_0x5af4f3)return console[_0x340f6d(0x102)](a5_0x3a3fc5[_0x340f6d(0xb3)](_0x340f6d(0xb5))),console['log'](a5_0x3a3fc5[_0x340f6d(0xec)]('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x4ef744[_0x340f6d(0xe0)]+_0x340f6d(0x12c)+_0x5af4f3+'\x22.')),console[_0x340f6d(0x102)](a5_0x3a3fc5[_0x340f6d(0xec)](_0x340f6d(0x12a)+_0x4ef744[_0x340f6d(0xe0)]+_0x340f6d(0xe1))),0x1;const _0x270fda=_0x4a55a8[_0x340f6d(0x9f)]['filter'](_0x30ee25=>_0x2c1397[_0x340f6d(0xe5)](_0x30ee25[_0x340f6d(0xa2)])),_0x3cb80e=_0x2672f8;let _0x488082;try{_0x488082=await setupEvaluatorAgent(_0x59285e[_0x340f6d(0x119)],_0x188d53[_0x340f6d(0xbf)]);}catch(_0x41d6f8){const _0x4e6901=_0x41d6f8 instanceof Error?_0x41d6f8[_0x340f6d(0xf4)]:String(_0x41d6f8);return console[_0x340f6d(0x102)](a5_0x3a3fc5[_0x340f6d(0xb3)](_0x340f6d(0x10f)+_0x4e6901)),0x1;}console[_0x340f6d(0x102)](a5_0x3a3fc5['cyan']('Re-evaluating\x20cached\x20test\x20run...')),console['log'](_0x340f6d(0xd5)+a5_0x3a3fc5['white'](_0x4ef744[_0x340f6d(0x125)])),console[_0x340f6d(0x102)](_0x340f6d(0xd7)+a5_0x3a3fc5['white'](_0x4ef744[_0x340f6d(0xe6)][_0x340f6d(0x134)]+'/'+_0x4ef744[_0x340f6d(0xe6)][_0x340f6d(0x135)]));_0x3cb80e[_0x340f6d(0xa4)]>0x0&&console[_0x340f6d(0x102)](_0x340f6d(0xa9)+a5_0x3a3fc5[_0x340f6d(0xbb)](_0x3cb80e['length']));console[_0x340f6d(0x102)]();const _0x2b34f3=[],_0x4d9d84=Date['now'](),_0x330624=createCommandSpinner(_0x340f6d(0xe4));if(_0x270fda[_0x340f6d(0xa4)]>0x0)try{const _0x5cea73=await reevaluateFromCache(_0x59285e['llm'],_0x4ef744,{'tests':_0x270fda},{'evaluatorId':_0x488082,'onTestStart':(_0x5d5e2a,_0x425e87,_0x1341ef)=>{const _0x58458b=_0x340f6d;_0x330624[_0x58458b(0x117)]=_0x58458b(0xed)+(_0x425e87+0x1)+'/'+_0x1341ef+':\x20'+_0x5d5e2a+_0x58458b(0xf2);if(!_0x330624[_0x58458b(0xb8)])_0x330624[_0x58458b(0x115)]();},'onTestComplete':(_0x533ae7,_0x43e920)=>{const _0x55ce6f=_0x340f6d;_0x330624[_0x55ce6f(0x9d)]();if(_0x43e920[_0x55ce6f(0x11b)]===_0x55ce6f(0xe3))console[_0x55ce6f(0x102)](a5_0x3a3fc5[_0x55ce6f(0xfc)]('✓\x20PASS:\x20'+_0x533ae7)+a5_0x3a3fc5[_0x55ce6f(0xec)](_0x55ce6f(0xba)));else _0x43e920[_0x55ce6f(0x11b)]==='FAIL'?console[_0x55ce6f(0x102)](a5_0x3a3fc5['red']('✗\x20FAIL:\x20'+_0x533ae7+_0x55ce6f(0x127)+_0x43e920[_0x55ce6f(0x12d)])+a5_0x3a3fc5[_0x55ce6f(0xec)]('\x20(cached)')):console[_0x55ce6f(0x102)](a5_0x3a3fc5[_0x55ce6f(0xb3)]('✗\x20ERROR:\x20'+_0x533ae7+_0x55ce6f(0x127)+_0x43e920[_0x55ce6f(0x12d)]));_0x43e920['conversation_url']&&console['log'](a5_0x3a3fc5[_0x55ce6f(0xec)](_0x55ce6f(0x120)+_0x43e920[_0x55ce6f(0x100)])),_0x2b34f3[_0x55ce6f(0xb6)](_0x43e920);},'onTestSkipped':(_0x421317,_0x23cce0)=>{const _0x4cc5e1=_0x340f6d;_0x330624[_0x4cc5e1(0x9d)](),console['log'](a5_0x3a3fc5['yellow'](_0x4cc5e1(0x122)+_0x421317+_0x4cc5e1(0x127)+_0x23cce0));}});for(const _0x554777 of _0x5cea73){!_0x2b34f3[_0x340f6d(0xa3)](_0x27d042=>_0x27d042[_0x340f6d(0xa2)]===_0x554777[_0x340f6d(0xa2)])&&_0x2b34f3[_0x340f6d(0xb6)](_0x554777);}}catch(_0x1daf17){_0x330624[_0x340f6d(0x9d)]();const _0x2e5cf8=_0x1daf17 instanceof Error?_0x1daf17[_0x340f6d(0xf4)]:String(_0x1daf17);return console['log'](a5_0x3a3fc5[_0x340f6d(0xb3)]('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0x2e5cf8)),0x1;}_0x330624[_0x340f6d(0x9d)]();if(_0x3cb80e[_0x340f6d(0xa4)]>0x0){console[_0x340f6d(0x102)](),console[_0x340f6d(0x102)](a5_0x3a3fc5['cyan'](_0x340f6d(0xef)));const {projectId:_0xddda61,agentId:_0x35b030}=_0x4ef744[_0x340f6d(0xe6)];for(const _0x109b9b of _0x3cb80e){console[_0x340f6d(0x102)](_0x340f6d(0x11e)+a5_0x3a3fc5[_0x340f6d(0x110)](_0x109b9b['name']));const _0xb7f4f9=createCommandSpinner(_0x340f6d(0xcf)+_0x109b9b[_0x340f6d(0xee)][_0x340f6d(0xa4)]+_0x340f6d(0xae));_0xb7f4f9[_0x340f6d(0x115)]();try{const {result:_0x1edd92}=await runTest(_0x59285e['llm'],_0x109b9b,{'agentId':_0x35b030,'projectId':_0xddda61,'site':_0x4ef744[_0x340f6d(0xe0)],'noEval':![],'evaluatorId':_0x488082,'onRoundStart':(_0x2904d3,_0x13241f)=>{const _0x454f5d=_0x340f6d;_0xb7f4f9[_0x454f5d(0x117)]='Round\x20'+(_0x2904d3+0x1)+'/'+_0x13241f+_0x454f5d(0xae);},'onRoundComplete':(_0x6ee397,_0x3c4cba,_0x2084a5)=>{const _0x28c4a3=_0x340f6d,_0x163c42=formatElapsed(_0x3c4cba);_0x2084a5?console['log']('\x20\x20Round\x20'+(_0x6ee397+0x1)+'/'+_0x109b9b[_0x28c4a3(0xee)][_0x28c4a3(0xa4)]+_0x28c4a3(0xc4)+a5_0x3a3fc5[_0x28c4a3(0xfc)]('✓')+'\x20('+_0x163c42+')'):console['log'](_0x28c4a3(0x11f)+(_0x6ee397+0x1)+'/'+_0x109b9b['rounds'][_0x28c4a3(0xa4)]+_0x28c4a3(0xc4)+a5_0x3a3fc5[_0x28c4a3(0xb3)]('✗'));},'onEvaluationStart':()=>{const _0x357f08=_0x340f6d;_0xb7f4f9['text']=_0x357f08(0xe9);},'onEvaluationComplete':_0x563cef=>{const _0x56516b=_0x340f6d,_0x569af6=formatElapsed(_0x563cef);console[_0x56516b(0x102)](_0x56516b(0xa8)+a5_0x3a3fc5['green']('✓')+'\x20('+_0x569af6+')');}});_0xb7f4f9[_0x340f6d(0x9d)](),_0x2b34f3[_0x340f6d(0xb6)](_0x1edd92);if(_0x1edd92[_0x340f6d(0x11b)]==='PASS')console[_0x340f6d(0x102)](a5_0x3a3fc5[_0x340f6d(0xfc)](_0x340f6d(0xf9)+_0x1edd92[_0x340f6d(0x12d)])+a5_0x3a3fc5[_0x340f6d(0xec)](_0x340f6d(0x132)));else _0x1edd92['status']==='FAIL'?console[_0x340f6d(0x102)](a5_0x3a3fc5[_0x340f6d(0xb3)](_0x340f6d(0x9c)+_0x1edd92[_0x340f6d(0x12d)])+a5_0x3a3fc5[_0x340f6d(0xec)](_0x340f6d(0x132))):console[_0x340f6d(0x102)](a5_0x3a3fc5[_0x340f6d(0xb3)](_0x340f6d(0x126)+_0x1edd92[_0x340f6d(0x12d)]));_0x1edd92[_0x340f6d(0x100)]&&console[_0x340f6d(0x102)](a5_0x3a3fc5[_0x340f6d(0xec)](_0x340f6d(0x120)+_0x1edd92[_0x340f6d(0x100)]));}catch(_0x3c881b){_0xb7f4f9[_0x340f6d(0x9d)]();const _0x5c2113=_0x3c881b instanceof Error?_0x3c881b[_0x340f6d(0xf4)]:String(_0x3c881b);console[_0x340f6d(0x102)](a5_0x3a3fc5[_0x340f6d(0xb3)](_0x340f6d(0x126)+_0x5c2113)),_0x2b34f3[_0x340f6d(0xb6)]({'name':_0x109b9b[_0x340f6d(0xa2)],'status':_0x340f6d(0x114),'reason':_0x5c2113,'timestamp':new Date()[_0x340f6d(0xd0)](),'duration_ms':0x0});}}}console[_0x340f6d(0x102)]();const _0x2a6208=Date['now']()-_0x4d9d84,_0x28c2c1=_0x2b34f3['filter'](_0x9fc06b=>_0x9fc06b['status']===_0x340f6d(0xe3))[_0x340f6d(0xa4)],_0x58fa95=_0x2b34f3['filter'](_0xbd820d=>_0xbd820d[_0x340f6d(0x11b)]===_0x340f6d(0x118))[_0x340f6d(0xa4)],_0x526896=_0x2b34f3[_0x340f6d(0xda)](_0xde0bfd=>_0xde0bfd[_0x340f6d(0x11b)]===_0x340f6d(0x114))[_0x340f6d(0xa4)];console[_0x340f6d(0x102)]('━'[_0x340f6d(0xe2)](0x3c)),console[_0x340f6d(0x102)](_0x340f6d(0xf5)),console[_0x340f6d(0x102)]('━'[_0x340f6d(0xe2)](0x3c)),console[_0x340f6d(0x102)](_0x340f6d(0xd1)+_0x2b34f3[_0x340f6d(0xa4)]),console[_0x340f6d(0x102)](_0x340f6d(0xb4)+a5_0x3a3fc5[_0x340f6d(0xfc)](_0x28c2c1)),console[_0x340f6d(0x102)](_0x340f6d(0xf6)+a5_0x3a3fc5[_0x340f6d(0xb3)](_0x58fa95));_0x526896>0x0&&console['log'](_0x340f6d(0xf8)+a5_0x3a3fc5[_0x340f6d(0xb3)](_0x526896));console['log'](_0x340f6d(0xce)+formatElapsed(_0x2a6208)),console[_0x340f6d(0x102)]('━'[_0x340f6d(0xe2)](0x3c));const _0x1b1e39={'summary':{'total':_0x2b34f3[_0x340f6d(0xa4)],'passed':_0x28c2c1,'failed':_0x58fa95,'errors':_0x526896>0x0?_0x526896:undefined,'duration_ms':_0x2a6208},'tests':_0x2b34f3,'agent':{'project':_0x54533b[_0x340f6d(0x134)],'name':_0x54533b[_0x340f6d(0x135)],'site':_0x5af4f3},'timestamp':new Date(_0x4d9d84)[_0x340f6d(0xd0)]()};if(_0x3528da!==_0x340f6d(0xb9)||_0xb9ca9d){const _0x315236=formatResults(_0x1b1e39,_0x3528da);if(_0xb9ca9d)try{a5_0x5ca225[_0x340f6d(0xd6)](_0xb9ca9d,_0x315236,_0x340f6d(0xf0)),console[_0x340f6d(0x102)](),console[_0x340f6d(0x102)](a5_0x3a3fc5[_0x340f6d(0xec)](_0x340f6d(0xe7)+_0xb9ca9d));}catch(_0x48a398){return console[_0x340f6d(0x102)](),console[_0x340f6d(0x102)](a5_0x3a3fc5[_0x340f6d(0xb3)](_0x340f6d(0xb7)+_0x48a398)),0x1;}else console[_0x340f6d(0x102)](),console[_0x340f6d(0x102)](_0x315236);}const _0x2a70a8=_0x2b34f3[_0x340f6d(0xda)](_0x597220=>_0x597220[_0x340f6d(0x11b)]!==_0x340f6d(0xe3));return _0x2a70a8['length']>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0x426be0=a5_0x4d11;function a5_0x4d11(_0x2f59f2,_0x34ae5b){_0x2f59f2=_0x2f59f2-0x82;const _0x335093=a5_0x3350();let _0x4d1199=_0x335093[_0x2f59f2];return _0x4d1199;}(function(_0x2dddfb,_0x31de0a){const _0x1035d4=a5_0x4d11,_0x38d2f4=_0x2dddfb();while(!![]){try{const _0x2758bb=parseInt(_0x1035d4(0xf0))/0x1*(parseInt(_0x1035d4(0x93))/0x2)+parseInt(_0x1035d4(0xf7))/0x3*(parseInt(_0x1035d4(0xdc))/0x4)+parseInt(_0x1035d4(0xdd))/0x5*(parseInt(_0x1035d4(0xab))/0x6)+parseInt(_0x1035d4(0xd6))/0x7+parseInt(_0x1035d4(0xc3))/0x8*(-parseInt(_0x1035d4(0xb2))/0x9)+parseInt(_0x1035d4(0xc7))/0xa+-parseInt(_0x1035d4(0xe5))/0xb;if(_0x2758bb===_0x31de0a)break;else _0x38d2f4['push'](_0x38d2f4['shift']());}catch(_0x4ec4db){_0x38d2f4['push'](_0x38d2f4['shift']());}}}(a5_0x3350,0x40a39));import*as a5_0x1fc096 from'node:fs';import*as a5_0x546db6 from'node:path';import a5_0x9bed33 from'chalk';function a5_0x3350(){const _0x563422=['FAIL','white','No\x20tests\x20found\x20with\x20tags:\x20','PASS','no_tests','510344jWLAKb','red','Errors:\x20\x20\x20','resolve','4111540JaRmqm','round','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','toLowerCase','conversations','Tests\x20found:\x20','test.yml','has','...','Error\x20writing\x20output\x20file:\x20','\x22,\x20but\x20current\x20site\x20is\x20\x22','\x20-\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','Test\x20Configuration:','\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','3445911sCvdEb','\x20\x20Site:\x20','existsSync','not\x20found','tests','tags','970804sjXgta','205235WVLFHx','executeReeval','/<agent-name>','Cached\x20run\x20is\x20from\x20site\x20\x22','Round\x20','✓\x20PASS:\x20','projectName','conversation_url','15410065AbhKhV','\x20\x20-\x20','Output\x20written\x20to:\x20','basename','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','size','\x20(cached)','Running\x20agent\x20tests...','green','status','194xRqBms','ERROR','writeFileSync','Available\x20tests:\x20','multiple_agents','dryRun','map','3AlUMyX','toISOString','reason','found','Round\x201/','find','...\x20','join','Evaluating\x20response...','Failed\x20Tests:','push','\x20(new)','start','Test\x20Summary','agentName','Cached\x20run\x20from:\x20',':\x20Sending\x20user\x20input...','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','⚠\x20SKIPPED:\x20','tsv','projectDir','✗\x20ERROR:\x20Project\x20not\x20found:\x20','text','Re-evaluation\x20Summary','trim','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','includes','Project\x20path:\x20','No\x20tests\x20have\x20tags\x20defined.','Run\x20tests\x20for\x20an\x20LLM\x20agent','yellow','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','site','Agent:\x20','Usage:','\x20\x20Round\x20','source','\x20\x20Conversation:\x20','repeat','rounds','Duration:\x20','reeval','\x20\x20Project:\x20','context','table','agentDirs','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','execute','json','✗\x20FAIL:\x20','agent','\x20\x20Evaluating...\x20','verbose','testName','Running\x20test:\x20','3898eMDsTX','Failed:\x20\x20\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','filter','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','jsonl','No\x20tests\x20found\x20matching:\x20','llmProject','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','llm','Error:\x20No\x20previous\x20test\x20run\x20found.','stop','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','Re-evaluating\x20','substring','Either\x20switch\x20to\x20the\x20\x22','eval','Run\x20\x27tdx\x20agent\x20pull\x20','Total:\x20\x20\x20\x20','Using\x20agent:\x20','log','Re-evaluating\x20cached\x20test\x20run...','dim','\x22:\x20','30jUxYBD','add','resolveAgentId','✗\x20ERROR:\x20','Passed:\x20\x20\x20','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','cyan','9fWOrvE','utf-8','name','message','length','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','Test\x20','now','resolveProjectId','split','description','forEach'];a5_0x3350=function(){return _0x563422;};return a5_0x3350();}import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x426be0(0xb4)]='agent:test';[a5_0x426be0(0xbc)]=a5_0x426be0(0x114);async[a5_0x426be0(0x8b)](_0x2fe4cb){const _0x3557b9=a5_0x426be0,{options:_0x3ba134,args:_0x40712c,tdx:_0x2564bb}=_0x2fe4cb,_0x202bb3=_0x40712c[0x0]||'.',_0x4faa9c=_0x3ba134[_0x3557b9(0xf5)],_0x2a54e=_0x3ba134,_0x4700b6=_0x2a54e[_0x3557b9(0xa3)]===![],_0x301a2f=_0x2a54e[_0x3557b9(0x85)],_0x517062=_0x2a54e[_0x3557b9(0xb4)],_0x512515=_0x2a54e[_0x3557b9(0xdb)],_0x2f1f18=_0x3ba134['site'],_0x181cd8=_0x2a54e['output'];if(_0x301a2f&&_0x4700b6)return console['log'](a5_0x9bed33[_0x3557b9(0xc4)](_0x3557b9(0xb7))),0x1;let _0xbcbffe=_0x3557b9(0x88);if(_0x2a54e[_0x3557b9(0x8c)])_0xbcbffe='json';else{if(_0x2a54e[_0x3557b9(0x98)])_0xbcbffe=_0x3557b9(0x98);else{if(_0x2a54e[_0x3557b9(0x10a)])_0xbcbffe=_0x3557b9(0x10a);else{if(_0x2a54e['table'])_0xbcbffe=_0x3557b9(0x88);}}}const _0x334ec8=_0x2a54e['llmProject'];let _0xb8f5cd=_0x202bb3;const _0x4a9ccc=a5_0x1fc096[_0x3557b9(0xd8)](_0x202bb3),_0x5b9c53=_0x202bb3==='.';if(!_0x4a9ccc||_0x5b9c53){const _0x26db46=resolveProjectFromContext(_0x202bb3,_0x334ec8,{'requireFile':_0x3557b9(0xcd)});if(_0x26db46[_0x3557b9(0xfa)])_0xb8f5cd=_0x26db46[_0x3557b9(0x10b)],_0x26db46[_0x3557b9(0x11b)]===_0x3557b9(0x87)&&console[_0x3557b9(0xa7)](a5_0x9bed33['dim'](_0x3557b9(0xa6)+_0xb8f5cd));else switch(_0x26db46[_0x3557b9(0xf9)]){case'no_context':console[_0x3557b9(0xa7)](a5_0x9bed33[_0x3557b9(0x115)](_0x26db46['message'])),console[_0x3557b9(0xa7)](),console['log'](_0x3557b9(0x119)),console['log'](_0x3557b9(0xd5)),console[_0x3557b9(0xa7)]('\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x3557b9(0xa7)](),console[_0x3557b9(0xa7)]('Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>');return 0x1;case'no_local_folder':console[_0x3557b9(0xa7)](a5_0x9bed33[_0x3557b9(0x115)](_0x26db46[_0x3557b9(0xb5)])),console[_0x3557b9(0xa7)](),console[_0x3557b9(0xa7)](_0x3557b9(0xa4)+_0x26db46[_0x3557b9(0x9a)]+_0x3557b9(0x95));return 0x1;case _0x3557b9(0xf4):{const _0x57531b=a5_0x546db6[_0x3557b9(0xe8)](_0x26db46[_0x3557b9(0x10b)]);console[_0x3557b9(0xa7)](a5_0x9bed33['yellow'](_0x3557b9(0x97)+_0x26db46[_0x3557b9(0x9a)]+'\x22:'));for(const _0x782a99 of _0x26db46[_0x3557b9(0x89)]){console['log'](_0x3557b9(0xe6)+_0x782a99);}return console[_0x3557b9(0xa7)](),console[_0x3557b9(0xa7)](_0x3557b9(0x8a)+_0x57531b+_0x3557b9(0xdf)),0x1;}case _0x3557b9(0xc2):console[_0x3557b9(0xa7)](a5_0x9bed33[_0x3557b9(0x115)](_0x3557b9(0x116)+_0x26db46['llmProject']+'\x22.')),console[_0x3557b9(0xa7)](a5_0x9bed33[_0x3557b9(0xa9)](_0x3557b9(0x112)+_0x26db46[_0x3557b9(0x10b)])),console[_0x3557b9(0xa7)](),console[_0x3557b9(0xa7)](_0x3557b9(0xe9));return 0x1;}}const {definition:_0x3b56f4,agentInfo:_0x24c3ee}=parseTestFile(_0xb8f5cd);let _0x5e5626=_0x3b56f4[_0x3557b9(0xda)];if(_0x517062){const _0x346c01=_0x517062['split'](',')[_0x3557b9(0xf6)](_0x1c805e=>_0x1c805e[_0x3557b9(0x10f)]());_0x5e5626=_0x3b56f4['tests'][_0x3557b9(0x96)](_0x513d21=>_0x346c01[_0x3557b9(0x111)](_0x513d21[_0x3557b9(0xb4)]));if(_0x5e5626['length']===0x0)return console[_0x3557b9(0xa7)](a5_0x9bed33['yellow'](_0x3557b9(0x99)+_0x517062)),console[_0x3557b9(0xa7)](a5_0x9bed33[_0x3557b9(0xa9)](_0x3557b9(0xf3)+_0x3b56f4[_0x3557b9(0xda)][_0x3557b9(0xf6)](_0x3737d8=>_0x3737d8['name'])[_0x3557b9(0xfe)](',\x20'))),0x1;}if(_0x512515){const _0x2a4a46=_0x512515[_0x3557b9(0xbb)](',')[_0x3557b9(0xf6)](_0x1b9363=>_0x1b9363['trim']()[_0x3557b9(0xca)]());_0x5e5626=_0x5e5626[_0x3557b9(0x96)](_0x23840a=>_0x23840a[_0x3557b9(0xdb)]?.['some'](_0x159f57=>_0x2a4a46[_0x3557b9(0x111)](_0x159f57[_0x3557b9(0xca)]())));if(_0x5e5626[_0x3557b9(0xb6)]===0x0){console[_0x3557b9(0xa7)](a5_0x9bed33['yellow'](_0x3557b9(0xc0)+_0x512515));const _0x57cc1b=new Set();return _0x3b56f4[_0x3557b9(0xda)][_0x3557b9(0xbd)](_0x42df19=>_0x42df19['tags']?.[_0x3557b9(0xbd)](_0x538763=>_0x57cc1b[_0x3557b9(0xac)](_0x538763))),_0x57cc1b[_0x3557b9(0xeb)]>0x0?console[_0x3557b9(0xa7)](a5_0x9bed33[_0x3557b9(0xa9)]('Available\x20tags:\x20'+[..._0x57cc1b][_0x3557b9(0xfe)](',\x20'))):console['log'](a5_0x9bed33[_0x3557b9(0xa9)](_0x3557b9(0x113))),0x1;}}if(_0x301a2f)return this[_0x3557b9(0xde)](_0x2fe4cb,{'definition':{'tests':_0x5e5626},'agentInfo':_0x24c3ee,'outputFormat':_0xbcbffe,'outputFile':_0x181cd8,'testNames':_0x517062});if(_0x4faa9c){console[_0x3557b9(0xa7)](a5_0x9bed33[_0x3557b9(0xb1)](_0x3557b9(0xd4))),console['log'](_0x3557b9(0xd7)+a5_0x9bed33[_0x3557b9(0xbf)](_0x2f1f18)),console[_0x3557b9(0xa7)](_0x3557b9(0x86)+a5_0x9bed33[_0x3557b9(0xbf)](_0x24c3ee['projectName'])),console[_0x3557b9(0xa7)]('\x20\x20Agent:\x20'+a5_0x9bed33[_0x3557b9(0xbf)](_0x24c3ee[_0x3557b9(0x105)])),console[_0x3557b9(0xa7)](),console[_0x3557b9(0xa7)](_0x3557b9(0xcc)+a5_0x9bed33['white'](_0x5e5626[_0x3557b9(0xb6)]));for(let _0x307d2d=0x0;_0x307d2d<_0x5e5626['length'];_0x307d2d++){const _0x108c67=_0x5e5626[_0x307d2d],_0x291a01=_0x108c67[_0x3557b9(0x83)][_0x3557b9(0xb6)]===0x1?_0x3557b9(0xc8):_0x3557b9(0x83),_0xdae57a=_0x108c67[_0x3557b9(0xdb)]?.['length']?'\x20['+_0x108c67[_0x3557b9(0xdb)][_0x3557b9(0xfe)](',\x20')+']':'';console[_0x3557b9(0xa7)]('\x20\x20'+(_0x307d2d+0x1)+'.\x20'+a5_0x9bed33[_0x3557b9(0xbf)](_0x108c67['name'])+'\x20('+_0x108c67['rounds']['length']+'\x20'+_0x291a01+')'+a5_0x9bed33['dim'](_0xdae57a));}return 0x0;}let _0x402a6,_0x366b50;try{_0x402a6=await _0x2564bb['llm'][_0x3557b9(0xba)](_0x24c3ee['projectName']);}catch(_0xc71ef7){const _0xababa6=_0xc71ef7 instanceof Error?_0xc71ef7[_0x3557b9(0xb5)]:String(_0xc71ef7);return _0xababa6['includes']('404')||_0xababa6['toLowerCase']()[_0x3557b9(0x111)]('not\x20found')?console['log'](a5_0x9bed33[_0x3557b9(0xc4)](_0x3557b9(0x10c)+_0x24c3ee[_0x3557b9(0xe3)])):console[_0x3557b9(0xa7)](a5_0x9bed33[_0x3557b9(0xc4)](_0x3557b9(0xea)+_0x24c3ee[_0x3557b9(0xe3)]+'\x22:\x20'+_0xababa6)),0x1;}try{_0x366b50=await _0x2564bb[_0x3557b9(0x9c)][_0x3557b9(0xad)](_0x24c3ee[_0x3557b9(0x105)],_0x402a6);}catch(_0x53f35f){const _0x26c4b5=_0x53f35f instanceof Error?_0x53f35f['message']:String(_0x53f35f);return _0x26c4b5[_0x3557b9(0x111)]('404')||_0x26c4b5[_0x3557b9(0xca)]()['includes'](_0x3557b9(0xd9))?console[_0x3557b9(0xa7)](a5_0x9bed33['red']('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x24c3ee['agentName'])):console[_0x3557b9(0xa7)](a5_0x9bed33[_0x3557b9(0xc4)](_0x3557b9(0x9f)+_0x24c3ee['agentName']+_0x3557b9(0xaa)+_0x26c4b5)),0x1;}let _0x2f979a;if(!_0x4700b6)try{_0x2f979a=await setupEvaluatorAgent(_0x2564bb[_0x3557b9(0x9c)],_0x3ba134['verbose']);}catch(_0x207b58){const _0x5af426=_0x207b58 instanceof Error?_0x207b58[_0x3557b9(0xb5)]:String(_0x207b58);return console[_0x3557b9(0xa7)](a5_0x9bed33['red'](_0x3557b9(0xc9)+_0x5af426)),0x1;}console[_0x3557b9(0xa7)](a5_0x9bed33['cyan'](_0x3557b9(0xed))),console[_0x3557b9(0xa7)]('Site:\x20'+a5_0x9bed33['white'](_0x2f1f18)),console[_0x3557b9(0xa7)](_0x3557b9(0x118)+a5_0x9bed33[_0x3557b9(0xbf)](_0x24c3ee[_0x3557b9(0xe3)]+'/'+_0x24c3ee[_0x3557b9(0x105)])),console[_0x3557b9(0xa7)]();const _0x5f01c3=[],_0x32c74e=[],_0x1ffe2a=Date[_0x3557b9(0xb9)]();for(let _0x2b80d5=0x0;_0x2b80d5<_0x5e5626[_0x3557b9(0xb6)];_0x2b80d5++){const _0x19e967=_0x5e5626[_0x2b80d5];_0x5e5626[_0x3557b9(0xb6)]>0x1?console['log'](_0x3557b9(0xb8)+(_0x2b80d5+0x1)+'/'+_0x5e5626['length']+':\x20'+a5_0x9bed33['white'](_0x19e967[_0x3557b9(0xb4)])):console['log'](_0x3557b9(0x92)+a5_0x9bed33[_0x3557b9(0xbf)](_0x19e967['name']));const _0x5950b3=createCommandSpinner(_0x3557b9(0xfb)+_0x19e967['rounds'][_0x3557b9(0xb6)]+':\x20Sending\x20user\x20input...');_0x5950b3[_0x3557b9(0x103)]();try{const {result:_0x1dc88a,conversation:_0x2a89c3}=await runTest(_0x2564bb['llm'],_0x19e967,{'agentId':_0x366b50,'projectId':_0x402a6,'site':_0x2f1f18,'noEval':_0x4700b6,'evaluatorId':_0x2f979a,'onRoundStart':(_0xac0814,_0x2a7137)=>{const _0x302d44=_0x3557b9;_0x5950b3[_0x302d44(0x10d)]=_0x302d44(0xe1)+(_0xac0814+0x1)+'/'+_0x2a7137+_0x302d44(0x107);},'onRoundComplete':(_0x9ebb87,_0x40f850,_0x52f20e)=>{const _0x16bea2=_0x3557b9,_0x2bf496=formatElapsed(_0x40f850);_0x52f20e?console[_0x16bea2(0xa7)](_0x16bea2(0x11a)+(_0x9ebb87+0x1)+'/'+_0x19e967[_0x16bea2(0x83)][_0x16bea2(0xb6)]+_0x16bea2(0xfd)+a5_0x9bed33['green']('✓')+'\x20('+_0x2bf496+')'):console[_0x16bea2(0xa7)](_0x16bea2(0x11a)+(_0x9ebb87+0x1)+'/'+_0x19e967[_0x16bea2(0x83)][_0x16bea2(0xb6)]+_0x16bea2(0xfd)+a5_0x9bed33[_0x16bea2(0xc4)]('✗'));},'onEvaluationStart':()=>{const _0x1ca75e=_0x3557b9;_0x5950b3[_0x1ca75e(0x10d)]='Evaluating\x20response...';},'onEvaluationComplete':_0x779e4d=>{const _0x6f2840=_0x3557b9,_0x1d2bee=formatElapsed(_0x779e4d);console[_0x6f2840(0xa7)](_0x6f2840(0x8f)+a5_0x9bed33[_0x6f2840(0xee)]('✓')+'\x20('+_0x1d2bee+')');}});_0x5950b3['stop'](),_0x5f01c3[_0x3557b9(0x101)](_0x1dc88a),_0x32c74e['push'](_0x2a89c3);if(_0x1dc88a['status']==='PASS')console['log'](a5_0x9bed33[_0x3557b9(0xee)](_0x3557b9(0xe2)+_0x1dc88a['reason']));else _0x1dc88a['status']===_0x3557b9(0xbe)?console['log'](a5_0x9bed33['red']('✗\x20FAIL:\x20'+_0x1dc88a['reason'])):console[_0x3557b9(0xa7)](a5_0x9bed33[_0x3557b9(0xc4)](_0x3557b9(0xae)+_0x1dc88a['reason']));_0x1dc88a[_0x3557b9(0xe4)]&&console[_0x3557b9(0xa7)](a5_0x9bed33['dim']('Conversation\x20URL:\x20'+_0x1dc88a[_0x3557b9(0xe4)])),console[_0x3557b9(0xa7)]();}catch(_0x4ceb08){_0x5950b3['stop']();const _0x13c9e6=_0x4ceb08 instanceof Error?_0x4ceb08[_0x3557b9(0xb5)]:String(_0x4ceb08);console[_0x3557b9(0xa7)](a5_0x9bed33[_0x3557b9(0xc4)](_0x3557b9(0xae)+_0x13c9e6)),console[_0x3557b9(0xa7)](),_0x5f01c3[_0x3557b9(0x101)]({'name':_0x19e967[_0x3557b9(0xb4)],'status':_0x3557b9(0xf1),'reason':_0x13c9e6,'timestamp':new Date()[_0x3557b9(0xf8)](),'duration_ms':0x0});}}const _0x4a5074=Date[_0x3557b9(0xb9)]()-_0x1ffe2a,_0x5e3fab=_0x5f01c3[_0x3557b9(0x96)](_0x4f8470=>_0x4f8470['status']==='PASS')[_0x3557b9(0xb6)],_0x1bcba0=_0x5f01c3[_0x3557b9(0x96)](_0x3d2369=>_0x3d2369[_0x3557b9(0xef)]==='FAIL')[_0x3557b9(0xb6)],_0xbde6f5=_0x5f01c3[_0x3557b9(0x96)](_0x5c65f1=>_0x5c65f1[_0x3557b9(0xef)]==='ERROR')[_0x3557b9(0xb6)];console[_0x3557b9(0xa7)]('━'[_0x3557b9(0x82)](0x3c)),console[_0x3557b9(0xa7)](_0x3557b9(0x104)),console[_0x3557b9(0xa7)]('━'['repeat'](0x3c)),console[_0x3557b9(0xa7)](_0x3557b9(0xa5)+_0x5f01c3[_0x3557b9(0xb6)]),console[_0x3557b9(0xa7)]('Passed:\x20\x20\x20'+a5_0x9bed33[_0x3557b9(0xee)](_0x5e3fab)),console['log'](_0x3557b9(0x94)+a5_0x9bed33[_0x3557b9(0xc4)](_0x1bcba0));_0xbde6f5>0x0&&console[_0x3557b9(0xa7)](_0x3557b9(0xc5)+a5_0x9bed33[_0x3557b9(0xc4)](_0xbde6f5));console[_0x3557b9(0xa7)](_0x3557b9(0x84)+formatElapsed(_0x4a5074)),console[_0x3557b9(0xa7)]('━'[_0x3557b9(0x82)](0x3c));const _0x44efb8=_0x5f01c3[_0x3557b9(0x96)](_0x2b5d4c=>_0x2b5d4c[_0x3557b9(0xef)]!==_0x3557b9(0xc1));if(_0x44efb8[_0x3557b9(0xb6)]>0x0){console['log'](),console[_0x3557b9(0xa7)](_0x3557b9(0x100));for(const _0x4acf10 of _0x44efb8){const _0xc527be=a5_0x9bed33['red']('✗'),_0xe7a85e=_0x4acf10[_0x3557b9(0xf9)][_0x3557b9(0xb6)]>0x32?_0x4acf10[_0x3557b9(0xf9)][_0x3557b9(0xa1)](0x0,0x32)+'...':_0x4acf10[_0x3557b9(0xf9)];console['log']('\x20\x20'+_0xc527be+'\x20'+_0x4acf10[_0x3557b9(0xb4)]+':\x20'+_0xe7a85e);}}const _0x41df2a={'summary':{'total':_0x5f01c3[_0x3557b9(0xb6)],'passed':_0x5e3fab,'failed':_0x1bcba0,'errors':_0xbde6f5>0x0?_0xbde6f5:undefined,'duration_ms':_0x4a5074},'tests':_0x5f01c3,'agent':{'project':_0x24c3ee['projectName'],'name':_0x24c3ee['agentName'],'site':_0x2f1f18},'timestamp':new Date(_0x1ffe2a)[_0x3557b9(0xf8)]()};try{const _0x49534b=buildCachedTestRun(_0x32c74e,{'site':_0x2f1f18,'projectId':_0x402a6,'projectName':_0x24c3ee[_0x3557b9(0xe3)],'agentId':_0x366b50,'agentName':_0x24c3ee['agentName'],'testYmlPath':a5_0x546db6[_0x3557b9(0xc6)](_0x24c3ee['testYmlPath'])});saveLastTestRun(_0x49534b);}catch{}if(_0xbcbffe!==_0x3557b9(0x88)||_0x181cd8){const _0x17486d=formatResults(_0x41df2a,_0xbcbffe);if(_0x181cd8)try{a5_0x1fc096[_0x3557b9(0xf2)](_0x181cd8,_0x17486d,'utf-8'),console[_0x3557b9(0xa7)](),console[_0x3557b9(0xa7)](a5_0x9bed33['dim'](_0x3557b9(0xe7)+_0x181cd8));}catch(_0x47aaad){return console[_0x3557b9(0xa7)](),console['log'](a5_0x9bed33[_0x3557b9(0xc4)](_0x3557b9(0xd0)+_0x47aaad)),0x1;}else console['log'](),console['log'](_0x17486d);}return _0x44efb8[_0x3557b9(0xb6)]>0x0?0x1:0x0;}async[a5_0x426be0(0xde)](_0xf9dc6f,_0xdb5bb5){const _0x338fa9=a5_0x426be0,{options:_0x71fb99,tdx:_0x3a78cf}=_0xf9dc6f,{definition:_0x2930ef,agentInfo:_0x4ff427,outputFormat:_0x19bccb,outputFile:_0x1dc783}=_0xdb5bb5,_0x33a61b=_0x71fb99[_0x338fa9(0x117)],_0x200735=loadLastTestRun();if(!_0x200735)return console[_0x338fa9(0xa7)](a5_0x9bed33[_0x338fa9(0xc4)](_0x338fa9(0x9d))),console['log'](a5_0x9bed33[_0x338fa9(0xa9)]('Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.')),0x1;if(_0x200735['agent'][_0x338fa9(0x105)]!==_0x4ff427[_0x338fa9(0x105)])return console[_0x338fa9(0xa7)](a5_0x9bed33['red'](_0x338fa9(0x108)+_0x200735[_0x338fa9(0x8e)][_0x338fa9(0x105)]+_0x338fa9(0x110)+_0x4ff427[_0x338fa9(0x105)]+'\x22.')),console[_0x338fa9(0xa7)](a5_0x9bed33['dim'](_0x338fa9(0xb0))),0x1;const _0x364fb6=new Set(_0x200735[_0x338fa9(0xcb)][_0x338fa9(0xf6)](_0xce546b=>_0xce546b[_0x338fa9(0x91)])),_0x2e09d3=_0x2930ef[_0x338fa9(0xda)][_0x338fa9(0x96)](_0xbab928=>!_0x364fb6[_0x338fa9(0xce)](_0xbab928[_0x338fa9(0xb4)]));if(_0x2e09d3[_0x338fa9(0xb6)]>0x0&&_0x200735[_0x338fa9(0x117)]!==_0x33a61b)return console[_0x338fa9(0xa7)](a5_0x9bed33[_0x338fa9(0xc4)]('Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.')),console[_0x338fa9(0xa7)](a5_0x9bed33[_0x338fa9(0xa9)](_0x338fa9(0xe0)+_0x200735[_0x338fa9(0x117)]+_0x338fa9(0xd1)+_0x33a61b+'\x22.')),console[_0x338fa9(0xa7)](a5_0x9bed33[_0x338fa9(0xa9)](_0x338fa9(0xa2)+_0x200735[_0x338fa9(0x117)]+_0x338fa9(0xd3))),0x1;const _0x5a6d17=_0x2930ef[_0x338fa9(0xda)]['filter'](_0x48eaf3=>_0x364fb6['has'](_0x48eaf3[_0x338fa9(0xb4)])),_0x11de3b=_0x2e09d3;let _0x972592;try{_0x972592=await setupEvaluatorAgent(_0x3a78cf[_0x338fa9(0x9c)],_0x71fb99[_0x338fa9(0x90)]);}catch(_0x6d028c){const _0x56251c=_0x6d028c instanceof Error?_0x6d028c[_0x338fa9(0xb5)]:String(_0x6d028c);return console['log'](a5_0x9bed33[_0x338fa9(0xc4)](_0x338fa9(0xc9)+_0x56251c)),0x1;}console[_0x338fa9(0xa7)](a5_0x9bed33[_0x338fa9(0xb1)](_0x338fa9(0xa8))),console[_0x338fa9(0xa7)](_0x338fa9(0x106)+a5_0x9bed33[_0x338fa9(0xbf)](_0x200735['timestamp'])),console[_0x338fa9(0xa7)](_0x338fa9(0x118)+a5_0x9bed33[_0x338fa9(0xbf)](_0x200735[_0x338fa9(0x8e)][_0x338fa9(0xe3)]+'/'+_0x200735[_0x338fa9(0x8e)][_0x338fa9(0x105)]));_0x11de3b['length']>0x0&&console[_0x338fa9(0xa7)]('New\x20tests\x20to\x20execute:\x20'+a5_0x9bed33[_0x338fa9(0x115)](_0x11de3b[_0x338fa9(0xb6)]));console['log']();const _0x82773e=[],_0x6d8ff9=Date[_0x338fa9(0xb9)](),_0x166612=createCommandSpinner('Re-evaluating...');if(_0x5a6d17[_0x338fa9(0xb6)]>0x0)try{const _0x405711=await reevaluateFromCache(_0x3a78cf[_0x338fa9(0x9c)],_0x200735,{'tests':_0x5a6d17},{'evaluatorId':_0x972592,'onTestStart':(_0x1e0a0b,_0x52f6dc,_0x123d58)=>{const _0x120fcf=_0x338fa9;_0x166612[_0x120fcf(0x10d)]=_0x120fcf(0xa0)+(_0x52f6dc+0x1)+'/'+_0x123d58+':\x20'+_0x1e0a0b+_0x120fcf(0xcf);if(!_0x166612['isSpinning'])_0x166612['start']();},'onTestComplete':(_0xd0ad18,_0x336ea4)=>{const _0x1bb4a6=_0x338fa9;_0x166612[_0x1bb4a6(0x9e)]();if(_0x336ea4[_0x1bb4a6(0xef)]===_0x1bb4a6(0xc1))console[_0x1bb4a6(0xa7)](a5_0x9bed33[_0x1bb4a6(0xee)]('✓\x20PASS:\x20'+_0xd0ad18)+a5_0x9bed33[_0x1bb4a6(0xa9)](_0x1bb4a6(0xec)));else _0x336ea4[_0x1bb4a6(0xef)]===_0x1bb4a6(0xbe)?console[_0x1bb4a6(0xa7)](a5_0x9bed33[_0x1bb4a6(0xc4)](_0x1bb4a6(0x8d)+_0xd0ad18+_0x1bb4a6(0xd2)+_0x336ea4['reason'])+a5_0x9bed33[_0x1bb4a6(0xa9)]('\x20(cached)')):console['log'](a5_0x9bed33['red']('✗\x20ERROR:\x20'+_0xd0ad18+_0x1bb4a6(0xd2)+_0x336ea4[_0x1bb4a6(0xf9)]));_0x336ea4['conversation_url']&&console[_0x1bb4a6(0xa7)](a5_0x9bed33[_0x1bb4a6(0xa9)](_0x1bb4a6(0x11c)+_0x336ea4[_0x1bb4a6(0xe4)])),_0x82773e[_0x1bb4a6(0x101)](_0x336ea4);},'onTestSkipped':(_0x3016bd,_0x116246)=>{const _0xf0f485=_0x338fa9;_0x166612[_0xf0f485(0x9e)](),console[_0xf0f485(0xa7)](a5_0x9bed33[_0xf0f485(0x115)](_0xf0f485(0x109)+_0x3016bd+_0xf0f485(0xd2)+_0x116246));}});for(const _0x55bf36 of _0x405711){!_0x82773e[_0x338fa9(0xfc)](_0x404bac=>_0x404bac[_0x338fa9(0xb4)]===_0x55bf36[_0x338fa9(0xb4)])&&_0x82773e[_0x338fa9(0x101)](_0x55bf36);}}catch(_0x57fabb){_0x166612[_0x338fa9(0x9e)]();const _0x1b1c6f=_0x57fabb instanceof Error?_0x57fabb[_0x338fa9(0xb5)]:String(_0x57fabb);return console[_0x338fa9(0xa7)](a5_0x9bed33[_0x338fa9(0xc4)](_0x338fa9(0x9b)+_0x1b1c6f)),0x1;}_0x166612[_0x338fa9(0x9e)]();if(_0x11de3b['length']>0x0){console[_0x338fa9(0xa7)](),console[_0x338fa9(0xa7)](a5_0x9bed33[_0x338fa9(0xb1)]('Executing\x20new\x20tests...'));const {projectId:_0x41fc13,agentId:_0x3332ab}=_0x200735['agent'];for(const _0x414f8e of _0x11de3b){console[_0x338fa9(0xa7)]('Running:\x20'+a5_0x9bed33[_0x338fa9(0xbf)](_0x414f8e[_0x338fa9(0xb4)]));const _0x1ae1d6=createCommandSpinner(_0x338fa9(0xfb)+_0x414f8e[_0x338fa9(0x83)][_0x338fa9(0xb6)]+_0x338fa9(0x107));_0x1ae1d6[_0x338fa9(0x103)]();try{const {result:_0x590e28}=await runTest(_0x3a78cf['llm'],_0x414f8e,{'agentId':_0x3332ab,'projectId':_0x41fc13,'site':_0x200735['site'],'noEval':![],'evaluatorId':_0x972592,'onRoundStart':(_0x1d50b8,_0x1343fc)=>{const _0x313c97=_0x338fa9;_0x1ae1d6[_0x313c97(0x10d)]=_0x313c97(0xe1)+(_0x1d50b8+0x1)+'/'+_0x1343fc+_0x313c97(0x107);},'onRoundComplete':(_0x1e8e3a,_0x51dff6,_0x2cfc87)=>{const _0x2feac5=_0x338fa9,_0x5d4896=formatElapsed(_0x51dff6);_0x2cfc87?console['log']('\x20\x20Round\x20'+(_0x1e8e3a+0x1)+'/'+_0x414f8e[_0x2feac5(0x83)]['length']+_0x2feac5(0xfd)+a5_0x9bed33[_0x2feac5(0xee)]('✓')+'\x20('+_0x5d4896+')'):console[_0x2feac5(0xa7)](_0x2feac5(0x11a)+(_0x1e8e3a+0x1)+'/'+_0x414f8e[_0x2feac5(0x83)]['length']+_0x2feac5(0xfd)+a5_0x9bed33['red']('✗'));},'onEvaluationStart':()=>{const _0x169c07=_0x338fa9;_0x1ae1d6[_0x169c07(0x10d)]=_0x169c07(0xff);},'onEvaluationComplete':_0x2b325a=>{const _0x293a00=_0x338fa9,_0x5eeb49=formatElapsed(_0x2b325a);console[_0x293a00(0xa7)]('\x20\x20Evaluating...\x20'+a5_0x9bed33[_0x293a00(0xee)]('✓')+'\x20('+_0x5eeb49+')');}});_0x1ae1d6[_0x338fa9(0x9e)](),_0x82773e[_0x338fa9(0x101)](_0x590e28);if(_0x590e28[_0x338fa9(0xef)]===_0x338fa9(0xc1))console[_0x338fa9(0xa7)](a5_0x9bed33[_0x338fa9(0xee)](_0x338fa9(0xe2)+_0x590e28['reason'])+a5_0x9bed33['dim']('\x20(new)'));else _0x590e28[_0x338fa9(0xef)]===_0x338fa9(0xbe)?console[_0x338fa9(0xa7)](a5_0x9bed33[_0x338fa9(0xc4)]('✗\x20FAIL:\x20'+_0x590e28[_0x338fa9(0xf9)])+a5_0x9bed33[_0x338fa9(0xa9)](_0x338fa9(0x102))):console[_0x338fa9(0xa7)](a5_0x9bed33['red'](_0x338fa9(0xae)+_0x590e28[_0x338fa9(0xf9)]));_0x590e28['conversation_url']&&console['log'](a5_0x9bed33[_0x338fa9(0xa9)](_0x338fa9(0x11c)+_0x590e28[_0x338fa9(0xe4)]));}catch(_0x423932){_0x1ae1d6[_0x338fa9(0x9e)]();const _0x5a16b3=_0x423932 instanceof Error?_0x423932[_0x338fa9(0xb5)]:String(_0x423932);console[_0x338fa9(0xa7)](a5_0x9bed33[_0x338fa9(0xc4)](_0x338fa9(0xae)+_0x5a16b3)),_0x82773e[_0x338fa9(0x101)]({'name':_0x414f8e['name'],'status':_0x338fa9(0xf1),'reason':_0x5a16b3,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console[_0x338fa9(0xa7)]();const _0x34c004=Date[_0x338fa9(0xb9)]()-_0x6d8ff9,_0x122469=_0x82773e[_0x338fa9(0x96)](_0x558a31=>_0x558a31[_0x338fa9(0xef)]==='PASS')[_0x338fa9(0xb6)],_0x302d60=_0x82773e[_0x338fa9(0x96)](_0x3430ad=>_0x3430ad[_0x338fa9(0xef)]===_0x338fa9(0xbe))[_0x338fa9(0xb6)],_0x292c3e=_0x82773e[_0x338fa9(0x96)](_0x35ae57=>_0x35ae57['status']===_0x338fa9(0xf1))[_0x338fa9(0xb6)];console[_0x338fa9(0xa7)]('━'[_0x338fa9(0x82)](0x3c)),console['log'](_0x338fa9(0x10e)),console[_0x338fa9(0xa7)]('━'[_0x338fa9(0x82)](0x3c)),console[_0x338fa9(0xa7)]('Total:\x20\x20\x20\x20'+_0x82773e[_0x338fa9(0xb6)]),console[_0x338fa9(0xa7)](_0x338fa9(0xaf)+a5_0x9bed33[_0x338fa9(0xee)](_0x122469)),console['log'](_0x338fa9(0x94)+a5_0x9bed33['red'](_0x302d60));_0x292c3e>0x0&&console['log'](_0x338fa9(0xc5)+a5_0x9bed33[_0x338fa9(0xc4)](_0x292c3e));console[_0x338fa9(0xa7)](_0x338fa9(0x84)+formatElapsed(_0x34c004)),console[_0x338fa9(0xa7)]('━'[_0x338fa9(0x82)](0x3c));const _0x20d45e={'summary':{'total':_0x82773e[_0x338fa9(0xb6)],'passed':_0x122469,'failed':_0x302d60,'errors':_0x292c3e>0x0?_0x292c3e:undefined,'duration_ms':_0x34c004},'tests':_0x82773e,'agent':{'project':_0x4ff427[_0x338fa9(0xe3)],'name':_0x4ff427[_0x338fa9(0x105)],'site':_0x33a61b},'timestamp':new Date(_0x6d8ff9)[_0x338fa9(0xf8)]()};if(_0x19bccb!=='table'||_0x1dc783){const _0x51f155=formatResults(_0x20d45e,_0x19bccb);if(_0x1dc783)try{a5_0x1fc096[_0x338fa9(0xf2)](_0x1dc783,_0x51f155,_0x338fa9(0xb3)),console[_0x338fa9(0xa7)](),console[_0x338fa9(0xa7)](a5_0x9bed33[_0x338fa9(0xa9)](_0x338fa9(0xe7)+_0x1dc783));}catch(_0x461c01){return console[_0x338fa9(0xa7)](),console[_0x338fa9(0xa7)](a5_0x9bed33[_0x338fa9(0xc4)](_0x338fa9(0xd0)+_0x461c01)),0x1;}else console[_0x338fa9(0xa7)](),console[_0x338fa9(0xa7)](_0x51f155);}const _0x1da72e=_0x82773e['filter'](_0x919c2=>_0x919c2[_0x338fa9(0xef)]!==_0x338fa9(0xc1));return _0x1da72e[_0x338fa9(0xb6)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x2f3882=a6_0x3d8c;(function(_0x5426e3,_0x534c38){const _0x1dedbb=a6_0x3d8c,_0x4c2b88=_0x5426e3();while(!![]){try{const _0x3b0ec2=parseInt(_0x1dedbb(0xcb))/0x1+-parseInt(_0x1dedbb(0xb3))/0x2+-parseInt(_0x1dedbb(0xe5))/0x3+-parseInt(_0x1dedbb(0xd2))/0x4*(parseInt(_0x1dedbb(0xe6))/0x5)+-parseInt(_0x1dedbb(0xc5))/0x6*(parseInt(_0x1dedbb(0xa9))/0x7)+parseInt(_0x1dedbb(0xdc))/0x8+parseInt(_0x1dedbb(0xd0))/0x9*(parseInt(_0x1dedbb(0xda))/0xa);if(_0x3b0ec2===_0x534c38)break;else _0x4c2b88['push'](_0x4c2b88['shift']());}catch(_0x3d44d5){_0x4c2b88['push'](_0x4c2b88['shift']());}}}(a6_0x4f86,0x22da6));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';function a6_0x3d8c(_0x573bff,_0x4dab85){_0x573bff=_0x573bff-0xa3;const _0x4f8699=a6_0x4f86();let _0x3d8c90=_0x4f8699[_0x573bff];return _0x3d8c90;}import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x2f3882(0xad),a6_0x2f3882(0xd9),'cookie',a6_0x2f3882(0xcc),a6_0x2f3882(0xdd),a6_0x2f3882(0xa6),a6_0x2f3882(0xce),'x-trino-user']);function isSensitiveHeader(_0x5d5583){const _0x486043=a6_0x2f3882;return SENSITIVE_HEADERS[_0x486043(0xaf)](_0x5d5583['toLowerCase']());}function a6_0x4f86(){const _0xdecf90=['Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','request','data','.\x20Valid\x20types:\x20','69445sIsqBf','set-cookie','noColor','x-auth-token','stack','1017uxpcGF','join','572gAEFvg','Error:\x20','DELETE','type','<\x20HTTP/1.1\x20','PATCH','method','proxy-authorization','36910obGcmh','\x22.\x20','1540352BRscBd','set-cookie2','output','POST','body','error','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','Endpoint\x20must\x20start\x20with\x20/:\x20','name','90669QqipuS','7315QKTLWS','file','includes','substring','x-xsrf-token','header','readBodyFromFile','21kbUrvg','Results\x20saved\x20to\x20','headers','GET','authorization','validate','has','length','verbose','trim','318196DnMXLX','PUT','description','keys','.\x20Valid\x20methods:\x20','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','Invalid\x20API\x20type:\x20','site','execute','status','toUpperCase','cdp','message','llm-proxy','entries','Invalid\x20header\x20format:\x20\x22','\x0aStack\x20trace:\x0a','Invalid\x20HTTP\x20method:\x20','275568pDXdzK','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs'];a6_0x4f86=function(){return _0xdecf90;};return a6_0x4f86();}function parseHeader(_0x5a1e58){const _0x7f5921=a6_0x2f3882,_0x52c73f=_0x5a1e58['indexOf'](':');if(_0x52c73f===-0x1)throw new Error(_0x7f5921(0xc2)+_0x5a1e58+_0x7f5921(0xdb)+_0x7f5921(0xc7));const _0x257770=_0x5a1e58[_0x7f5921(0xa5)](0x0,_0x52c73f)['trim'](),_0x5e9e80=_0x5a1e58[_0x7f5921(0xa5)](_0x52c73f+0x1)[_0x7f5921(0xb2)]();if(!_0x257770)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0x5a1e58+'\x22');return[_0x257770,_0x5e9e80];}export class ApiCommand extends BaseCommand{[a6_0x2f3882(0xe4)]='api';[a6_0x2f3882(0xb5)]=a6_0x2f3882(0xc6);[a6_0x2f3882(0xae)](_0x4215b5){const _0x42859f=a6_0x2f3882,{args:_0x36fd4b,options:_0x446aec}=_0x4215b5,_0xef0ea6=_0x446aec;if(_0x36fd4b[_0x42859f(0xb0)]===0x0)return _0x42859f(0xb8);const _0x46eeb7=_0x36fd4b[0x0];if(!_0x46eeb7['startsWith']('/'))return _0x42859f(0xe3)+_0x46eeb7;const _0x56d852=_0xef0ea6[_0x42859f(0xc9)],_0x5bb32e=_0xef0ea6[_0x42859f(0xa3)];if(_0x56d852&&_0x5bb32e)return _0x42859f(0xe2);const _0x1395a8=_0xef0ea6[_0x42859f(0xd8)]||_0x42859f(0xac),_0x8cd9fb=['GET',_0x42859f(0xdf),_0x42859f(0xb4),_0x42859f(0xd4),_0x42859f(0xd7)];if(!_0x8cd9fb['includes'](_0x1395a8[_0x42859f(0xbd)]()))return _0x42859f(0xc4)+_0x1395a8+_0x42859f(0xb7)+_0x8cd9fb['join'](',\x20');const _0xe30140=_0xef0ea6[_0x42859f(0xd5)]||'td',_0x39c492=['td',_0x42859f(0xbe),'workflow','trino','llm',_0x42859f(0xc0)];if(!_0x39c492[_0x42859f(0xa4)](_0xe30140))return _0x42859f(0xb9)+_0xe30140+_0x42859f(0xca)+_0x39c492[_0x42859f(0xd1)](',\x20');return undefined;}async[a6_0x2f3882(0xbb)](_0xc32b1b){const _0x50affc=a6_0x2f3882,{options:_0x4dbeff,args:_0x46e781,tdx:_0x1addbd}=_0xc32b1b,_0x13b38c=_0x4dbeff,_0x542306=_0x46e781[0x0],_0x413b23=(_0x13b38c[_0x50affc(0xd8)]||_0x50affc(0xac))['toUpperCase'](),_0x38734a=_0x13b38c[_0x50affc(0xc9)],_0x2f348d=_0x13b38c['file'],_0x3e927d=_0x13b38c[_0x50affc(0xa7)],_0xc30ec=_0x13b38c[_0x50affc(0xd5)]||'td';try{const _0xd99f21={};if(_0x3e927d){const _0x333f5d=Array['isArray'](_0x3e927d)?_0x3e927d:[_0x3e927d];for(const _0xaf54fa of _0x333f5d){const [_0x4de365,_0x2cabac]=parseHeader(_0xaf54fa);_0xd99f21[_0x4de365]=_0x2cabac;}}let _0x166f21;if(_0x38734a)_0x166f21=_0x38734a;else{if(_0x2f348d)try{_0x166f21=RawAPI[_0x50affc(0xa8)](_0x2f348d);}catch(_0x2bef01){return console['error'](_0x50affc(0xd3)+(_0x2bef01 instanceof Error?_0x2bef01[_0x50affc(0xbf)]:String(_0x2bef01))),0x1;}}const _0x5c750f={'method':_0x413b23,'apiType':_0xc30ec,'includeHeaders':_0x4dbeff[_0x50affc(0xb1)]};_0x166f21&&(_0x5c750f[_0x50affc(0xe0)]=_0x166f21);Object[_0x50affc(0xb6)](_0xd99f21)[_0x50affc(0xb0)]>0x0&&(_0x5c750f[_0x50affc(0xab)]=_0xd99f21);if(_0x4dbeff['verbose']){const _0x59175e=resolveSite(_0x4dbeff[_0x50affc(0xba)]),_0x1781f3=getEndpoint(_0x59175e,_0xc30ec),_0x3458a0=''+_0x1781f3+_0x542306;console[_0x50affc(0xe1)]('>\x20'+_0x413b23+'\x20'+_0x3458a0);const _0x3d8823=getAuthHeaders(_0x59175e),_0x5c8cd3={..._0x3d8823,..._0xd99f21};for(const [_0x5f209e,_0x43c9c2]of Object[_0x50affc(0xc1)](_0x5c8cd3)){!isSensitiveHeader(_0x5f209e)&&console[_0x50affc(0xe1)]('>\x20'+_0x5f209e+':\x20'+_0x43c9c2);}_0x166f21&&console[_0x50affc(0xe1)]('>'),console[_0x50affc(0xe1)]('');}const _0x5759ad=await _0x1addbd['api'][_0x50affc(0xc8)](_0x542306,_0x5c750f);if(_0x4dbeff[_0x50affc(0xb1)]&&_0x5759ad[_0x50affc(0xab)]){console['error'](_0x50affc(0xd6)+_0x5759ad[_0x50affc(0xbc)]);for(const [_0x2c50f2,_0x28ba1d]of Object['entries'](_0x5759ad[_0x50affc(0xab)])){!isSensitiveHeader(_0x2c50f2)&&console[_0x50affc(0xe1)]('<\x20'+_0x2c50f2+':\x20'+_0x28ba1d);}console['error']('');}const _0xad42b9=Boolean(_0x4dbeff[_0x50affc(0xde)]),_0x1556f6={'color':_0x4dbeff['color'],'noColor':_0x4dbeff[_0x50affc(0xcd)]||_0xad42b9&&!_0x4dbeff['color']},_0x5719da=colorizeJSON(_0x5759ad[_0x50affc(0xc9)],_0x1556f6);return _0x4dbeff[_0x50affc(0xde)]?(writeFileSync(_0x4dbeff['output'],_0x5719da),console[_0x50affc(0xe1)](_0x50affc(0xaa)+_0x4dbeff[_0x50affc(0xde)])):console['log'](_0x5719da),0x0;}catch(_0x370af4){return _0x370af4 instanceof Error?(console['error'](_0x50affc(0xd3)+_0x370af4[_0x50affc(0xbf)]),_0x4dbeff[_0x50affc(0xb1)]&&_0x370af4[_0x50affc(0xcf)]&&console[_0x50affc(0xe1)](_0x50affc(0xc3)+_0x370af4[_0x50affc(0xcf)])):console[_0x50affc(0xe1)](_0x50affc(0xd3)+String(_0x370af4)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a7_0x47cdb6=a7_0x4911;(function(_0x50a8c2,_0x4d21ea){const _0x22c5aa=a7_0x4911,_0x335093=_0x50a8c2();while(!![]){try{const _0x5ee531=parseInt(_0x22c5aa(0x128))/0x1+parseInt(_0x22c5aa(0x122))/0x2+parseInt(_0x22c5aa(0x15a))/0x3*(parseInt(_0x22c5aa(0x157))/0x4)+-parseInt(_0x22c5aa(0x166))/0x5*(-parseInt(_0x22c5aa(0x160))/0x6)+-parseInt(_0x22c5aa(0x142))/0x7+-parseInt(_0x22c5aa(0x12b))/0x8+-parseInt(_0x22c5aa(0x151))/0x9;if(_0x5ee531===_0x4d21ea)break;else _0x335093['push'](_0x335093['shift']());}catch(_0x2699f2){_0x335093['push'](_0x335093['shift']());}}}(a7_0x1068,0x2d09d));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{isOAuthSupported}from'../core/oauth.js';import{runOAuthLoginFlow}from'./auth-login-command.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x46cc54 from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';function a7_0x1068(){const _0x17b166=['6051rkVUSi','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','N/A','OAuth\x20(browser\x20login)','auth:clear','name','26310pbMcuf','email','oauth','\x0aSetup\x20cancelled','yellow','\x20(site:\x20','375khASYW','first_name','tdx\x20profile:\x20','\x20for\x20profile:\x20','Remove\x20API\x20key\x20from\x20system\x20keychain','message','417190NlknMF','status','Read\x20credential\x20from\x20keychain','No\x20credential\x20found','profile','User:\x20','263067BbJFIm','Setup\x20API\x20key\x20authentication\x20interactively','You\x20can\x20find\x20your\x20API\x20key\x20at:','408952wpaedb','warn','join','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','description','error','\x20--profile\x20','red','Setting\x20up\x20authentication\x20for\x20site:\x20','trim','OAuth\x20tokens','✓\x20Default\x20site\x20set\x20to\x20','filter','green','log','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','site','last_name','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','getUserInfo','jobs','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','1767325IljBeg','create','✓\x20Profile\x20\x27','API\x20Key','apiKey','No\x20credentials\x20found\x20in\x20keychain','method','Enter\x20your\x20TD\x20API\x20key:','tdx:\x20auth\x20setup','Name:\x20','\x20and\x20','bold','execute','Setup\x20cancelled','\x20\x20tdx','5190237UNNgoX','Read\x20credential\x20from\x20','API\x20key\x20cannot\x20be\x20empty','Credential\x20type:\x20OAuth','password','apikey','524vKweCw','ERROR','\x20(profile:\x20'];a7_0x1068=function(){return _0x17b166;};return a7_0x1068();}function a7_0x4911(_0x1e8332,_0x38d450){_0x1e8332=_0x1e8332-0x11e;const _0x106806=a7_0x1068();let _0x4911f3=_0x106806[_0x1e8332];return _0x4911f3;}import{LogLevel}from'../utils/tdx-logger.js';import a7_0x53352d from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x47cdb6(0x15f)]='auth:setup';[a7_0x47cdb6(0x12f)]=a7_0x47cdb6(0x129);async['execute'](_0x1063ed){const _0x3ea027=a7_0x47cdb6,{options:_0xc9e65}=_0x1063ed,_0x346096=_0xc9e65['profile'];console[_0x3ea027(0x139)](a7_0x53352d[_0x3ea027(0x14d)](_0x3ea027(0x14a)));const _0x25085b=_0xc9e65[_0x3ea027(0x13c)]||'us01',_0x386289=await promptSiteSelection(_0x25085b,_0x346096,_0x3ea027(0x14f));if(!_0x386289)return 0x1;const _0x3b0487=resolveSite(_0x386289);if(isOAuthSupported(_0x3b0487)){const _0x5a8197=await a7_0x46cc54({'type':'select','name':_0x3ea027(0x148),'message':'Choose\x20authentication\x20method:','choices':[{'title':_0x3ea027(0x15d),'value':_0x3ea027(0x162)},{'title':_0x3ea027(0x145),'value':_0x3ea027(0x156)}]});if(!_0x5a8197['method'])return console[_0x3ea027(0x139)](_0x3ea027(0x163)),0x1;if(_0x5a8197['method']===_0x3ea027(0x162))return await runOAuthLoginFlow(_0x3b0487,_0x346096,_0xc9e65['logLevel']??LogLevel[_0x3ea027(0x158)]),0x0;}console['log'](_0x3ea027(0x133)+_0x3b0487),console[_0x3ea027(0x139)](_0x3ea027(0x12a)),console[_0x3ea027(0x139)]('\x20\x20'+getConsoleUrl(_0x3b0487,'/app/mp/ak'));const _0x4b3bb2=await a7_0x46cc54({'type':_0x3ea027(0x155),'name':_0x3ea027(0x146),'message':_0x3ea027(0x149),'validate':_0x55a919=>{const _0x290a45=_0x3ea027;if(!_0x55a919||!_0x55a919[_0x290a45(0x134)]())return _0x290a45(0x153);return!![];}});if(!_0x4b3bb2[_0x3ea027(0x146)])return console[_0x3ea027(0x139)](_0x3ea027(0x163)),0x1;const _0x49f6c3=_0x4b3bb2['apiKey'];console[_0x3ea027(0x139)]('Validating\x20API\x20key...');try{const _0x1e7eff=TDX[_0x3ea027(0x143)]({'site':_0x3b0487,'apiKey':_0x49f6c3[_0x3ea027(0x134)](),'logLevel':_0xc9e65['logLevel']??LogLevel[_0x3ea027(0x158)]}),_0x230d70=await _0x1e7eff[_0x3ea027(0x140)]['getUserInfo']();console[_0x3ea027(0x139)](_0x3ea027(0x15b)+_0x230d70[_0x3ea027(0x161)]+')');const _0x283ced=await isKeychainAvailable();_0x283ced?(await saveAPIKeyAsync(_0x49f6c3[_0x3ea027(0x134)](),_0x3b0487,_0x346096),console[_0x3ea027(0x139)](_0x3ea027(0x13b)+(_0x346096?_0x3ea027(0x159)+_0x346096+')':''))):(console[_0x3ea027(0x12c)](a7_0x53352d['yellow'](_0x3ea027(0x13a))),console[_0x3ea027(0x12c)](a7_0x53352d[_0x3ea027(0x164)](_0x3ea027(0x141))));if(_0x346096){const _0x5521a4={'site':_0x3b0487};saveProfileToUserConfig(_0x346096,_0x5521a4),console[_0x3ea027(0x139)](_0x3ea027(0x144)+_0x346096+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x3b0487),console[_0x3ea027(0x139)](_0x3ea027(0x136)+_0x3b0487);const _0x4e591f=_0x346096?_0x3ea027(0x131)+_0x346096:'';return console['log'](),console['log']('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x3ea027(0x139)](_0x3ea027(0x150)+_0x4e591f+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console['log'](_0x3ea027(0x150)+_0x4e591f+_0x3ea027(0x13e)),0x0;}catch(_0x5eb1ab){if(_0x5eb1ab instanceof HTTPClientError&&_0x5eb1ab[_0x3ea027(0x123)]===0x191)return printAuthError(_0x5eb1ab),0x1;return console[_0x3ea027(0x130)](a7_0x53352d[_0x3ea027(0x132)]('✗\x20Validation\x20failed:\x20'+(_0x5eb1ab instanceof Error?_0x5eb1ab[_0x3ea027(0x121)]:String(_0x5eb1ab)))),console[_0x3ea027(0x130)](_0x3ea027(0x12e)),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']='auth';[a7_0x47cdb6(0x12f)]='Show\x20authentication\x20status\x20and\x20validate\x20API\x20key';async[a7_0x47cdb6(0x14e)](_0x484e66){const _0x2ed7b9=a7_0x47cdb6,{options:_0x4f9ccd,tdx:_0x10bd5f}=_0x484e66,_0x1c808f=_0x4f9ccd[_0x2ed7b9(0x13c)],_0x3ae4bf=_0x4f9ccd[_0x2ed7b9(0x126)],_0x33a7b4=_0x3ae4bf?_0x3ae4bf:_0x2ed7b9(0x15c);console[_0x2ed7b9(0x139)](_0x2ed7b9(0x11e)+_0x33a7b4+_0x2ed7b9(0x165)+_0x1c808f+')');const _0x3f2bfe=await getOAuthTokens(_0x3ae4bf);if(_0x3f2bfe)console[_0x2ed7b9(0x139)](_0x2ed7b9(0x154)),console[_0x2ed7b9(0x139)](_0x2ed7b9(0x124)+(_0x3ae4bf?_0x2ed7b9(0x159)+_0x3ae4bf+')':''));else{const _0x2e26b6=await resolveAPIKeyAsync(_0x1c808f,_0x3ae4bf);if(_0x2e26b6){const {source:_0x410b54,isDeprecated:_0x2bc9f0}=_0x2e26b6,_0x132e88=_0x2ed7b9(0x152)+_0x410b54;console[_0x2ed7b9(0x139)](_0x2bc9f0?a7_0x53352d[_0x2ed7b9(0x164)](_0x132e88):_0x132e88);}else console['log'](a7_0x53352d['yellow'](_0x2ed7b9(0x125)));}try{const _0x151fe5=await _0x10bd5f[_0x2ed7b9(0x140)][_0x2ed7b9(0x13f)]();return console[_0x2ed7b9(0x139)](a7_0x53352d[_0x2ed7b9(0x138)]('✓\x20Authentication\x20successful\x0a')),console[_0x2ed7b9(0x139)](_0x2ed7b9(0x127)+_0x151fe5[_0x2ed7b9(0x161)]),(_0x151fe5['first_name']||_0x151fe5['last_name'])&&console[_0x2ed7b9(0x139)](_0x2ed7b9(0x14b)+[_0x151fe5[_0x2ed7b9(0x167)],_0x151fe5[_0x2ed7b9(0x13d)]][_0x2ed7b9(0x137)](Boolean)[_0x2ed7b9(0x12d)]('\x20')),0x0;}catch(_0x345f1f){return _0x345f1f instanceof HTTPClientError&&_0x345f1f[_0x2ed7b9(0x123)]===0x191?printAuthError(_0x345f1f,!![],_0x3ae4bf):console['error'](a7_0x53352d[_0x2ed7b9(0x132)]('✗\x20Validation\x20failed:\x20'+(_0x345f1f instanceof Error?_0x345f1f['message']:String(_0x345f1f)))),0x1;}}}export class AuthClearCommand extends BaseCommand{['name']=a7_0x47cdb6(0x15e);[a7_0x47cdb6(0x12f)]=a7_0x47cdb6(0x120);async['execute'](_0x48c997){const _0x4a7b8a=a7_0x47cdb6,{options:_0x2b6f8a}=_0x48c997,_0x290fe5=_0x2b6f8a[_0x4a7b8a(0x126)];console['log'](a7_0x53352d[_0x4a7b8a(0x14d)]('tdx:\x20auth\x20clear'));const _0x2979e9=await isKeychainAvailable();if(!_0x2979e9)return console[_0x4a7b8a(0x130)](a7_0x53352d[_0x4a7b8a(0x132)]('System\x20keychain\x20is\x20not\x20available')),0x1;const [_0x12cd25,_0xbd0128]=await Promise['all']([deleteKeychainAPIKey(_0x290fe5),deleteOAuthTokens(_0x290fe5)]);if(_0x12cd25||_0xbd0128){clearCredentialCache();const _0x13e770=[_0x12cd25&&'API\x20key',_0xbd0128&&_0x4a7b8a(0x135)]['filter'](Boolean)['join'](_0x4a7b8a(0x14c));return console[_0x4a7b8a(0x139)]('✓\x20'+_0x13e770+'\x20removed\x20from\x20keychain'+(_0x290fe5?_0x4a7b8a(0x159)+_0x290fe5+')':'')),0x0;}else return console[_0x4a7b8a(0x139)](_0x4a7b8a(0x147)+(_0x290fe5?_0x4a7b8a(0x11f)+_0x290fe5:'')),0x1;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a8_0xbbc15c=a8_0x3fe6;(function(_0x5c2dff,_0x2cb7d1){const _0x2db302=a8_0x3fe6,_0x418822=_0x5c2dff();while(!![]){try{const _0x2396ff=parseInt(_0x2db302(0x160))/0x1*(-parseInt(_0x2db302(0x153))/0x2)+parseInt(_0x2db302(0x157))/0x3*(-parseInt(_0x2db302(0x146))/0x4)+-parseInt(_0x2db302(0x148))/0x5+-parseInt(_0x2db302(0x164))/0x6+-parseInt(_0x2db302(0x16d))/0x7+parseInt(_0x2db302(0x169))/0x8*(parseInt(_0x2db302(0x16a))/0x9)+parseInt(_0x2db302(0x15a))/0xa*(parseInt(_0x2db302(0x15b))/0xb);if(_0x2396ff===_0x2cb7d1)break;else _0x418822['push'](_0x418822['shift']());}catch(_0x42a262){_0x418822['push'](_0x418822['shift']());}}}(a8_0x57cf,0xc62b4));import{BaseCommand}from'./command.js';import{resolveSite}from'../core/config.js';function a8_0x3fe6(_0x217509,_0x1340d1){_0x217509=_0x217509-0x145;const _0x57cfcb=a8_0x57cf();let _0x3fe6cb=_0x57cfcb[_0x217509];return _0x3fe6cb;}import{saveProfileToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{isKeychainAvailable}from'../core/keychain.js';import{saveOAuthTokens}from'../core/oauth-keychain.js';function a8_0x57cf(){const _0x376986=['email','execute','OAuth\x20login\x20is\x20not\x20yet\x20available\x20for\x20site:\x20','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','\x20--profile\x20','create','Authenticating\x20via\x20OAuth\x20for\x20site:\x20','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','bold','getUserInfo','2168sGIvKN','✓\x20Authentication\x20successful\x20(User:\x20','/oauth/authorize','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','2488167yToQVf','site','\x20\x20tdx','575420tHJpXV','605SUNraa','green','ERROR','tdx:\x20auth\x20login','access_token','1237cvZxbN','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','log','auth:login','4740774cyXCQY','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','description','Login\x20cancelled','jobs','216FwKhkK','393777mJJArp','OAuth\x20is\x20currently\x20supported\x20on\x20dev-us01\x20and\x20dev-eu01\x20only.\x20','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','2391949uemnjh','Validating\x20OAuth\x20tokens...','logLevel','name','4TZGiav','✓\x20Profile\x20\x27','1161540rrAjqt'];a8_0x57cf=function(){return _0x376986;};return a8_0x57cf();}import{startOAuthFlow,isOAuthSupported}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a8_0x252b2d from'chalk';export async function runOAuthLoginFlow(_0x38330f,_0x534f1c,_0x4788bd){const _0xe7dc85=a8_0x3fe6;if(!isOAuthSupported(_0x38330f))throw new Error(_0xe7dc85(0x14b)+_0x38330f+'.\x20'+_0xe7dc85(0x16b)+'Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.');const _0x246c81=await isKeychainAvailable();if(!_0x246c81)throw new Error(_0xe7dc85(0x150)+_0xe7dc85(0x161));const _0x418776=getConsoleUrl(_0x38330f);console['log']('Opening\x20browser\x20for\x20authentication...'),console['log']('\x20\x20'+_0x418776+_0xe7dc85(0x155)),console[_0xe7dc85(0x162)](_0xe7dc85(0x16c));const _0x26584f=await startOAuthFlow(_0x38330f);console[_0xe7dc85(0x162)](_0xe7dc85(0x16e));const _0x404b1d=TDX[_0xe7dc85(0x14e)]({'site':_0x38330f,'accessToken':_0x26584f[_0xe7dc85(0x15f)],'logLevel':_0x4788bd??LogLevel[_0xe7dc85(0x15d)]}),_0x5ebea8=await _0x404b1d[_0xe7dc85(0x168)][_0xe7dc85(0x152)]();console[_0xe7dc85(0x162)](a8_0x252b2d[_0xe7dc85(0x15c)](_0xe7dc85(0x154)+_0x5ebea8[_0xe7dc85(0x149)]+')')),await saveOAuthTokens(_0x26584f,_0x534f1c),console['log'](_0xe7dc85(0x14c)+(_0x534f1c?'\x20(profile:\x20'+_0x534f1c+')':''));if(_0x534f1c){const _0x113df9={'site':_0x38330f};saveProfileToUserConfig(_0x534f1c,_0x113df9),console[_0xe7dc85(0x162)](_0xe7dc85(0x147)+_0x534f1c+'\x27\x20registered');}const _0x255930=_0x534f1c?_0xe7dc85(0x14d)+_0x534f1c:'';console[_0xe7dc85(0x162)](),console[_0xe7dc85(0x162)](_0xe7dc85(0x156)),console[_0xe7dc85(0x162)](_0xe7dc85(0x159)+_0x255930+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0xe7dc85(0x162)](_0xe7dc85(0x159)+_0x255930+_0xe7dc85(0x165));}export class AuthLoginCommand extends BaseCommand{[a8_0xbbc15c(0x145)]=a8_0xbbc15c(0x163);[a8_0xbbc15c(0x166)]='Login\x20via\x20OAuth\x20(opens\x20browser)';async[a8_0xbbc15c(0x14a)](_0x546800){const _0x51936f=a8_0xbbc15c,{options:_0xdc09da}=_0x546800,_0x2f3b91=_0xdc09da['profile'];console[_0x51936f(0x162)](a8_0x252b2d[_0x51936f(0x151)](_0x51936f(0x15e)));const _0x408179=_0xdc09da[_0x51936f(0x158)]||'us01',_0x1f3e98=await promptSiteSelection(_0x408179,_0x2f3b91,_0x51936f(0x167));if(!_0x1f3e98)return 0x1;const _0x2a0c56=resolveSite(_0x1f3e98);return console[_0x51936f(0x162)](_0x51936f(0x14f)+_0x2a0c56),await runOAuthLoginFlow(_0x2a0c56,_0x2f3b91,_0xdc09da[_0x51936f(0x16f)]??LogLevel['ERROR']),0x0;}}
|