@treasuredata/tdx 2026.3.39 → 2026.3.40
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/cas-command.js +1 -1
- package/dist/commands/cas-segment-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/policy-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/work-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/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.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/policy.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/types/workspace.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/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.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
|
-
|
|
1
|
+
const a3_0x5211ec=a3_0x3361;(function(_0x5a842c,_0x453c96){const _0x25d0b8=a3_0x3361,_0x4a27a7=_0x5a842c();while(!![]){try{const _0x497ee5=-parseInt(_0x25d0b8(0x10f))/0x1+parseInt(_0x25d0b8(0x121))/0x2*(parseInt(_0x25d0b8(0x11f))/0x3)+-parseInt(_0x25d0b8(0x114))/0x4*(-parseInt(_0x25d0b8(0x10a))/0x5)+parseInt(_0x25d0b8(0x10c))/0x6*(-parseInt(_0x25d0b8(0x109))/0x7)+-parseInt(_0x25d0b8(0x11d))/0x8*(-parseInt(_0x25d0b8(0x122))/0x9)+-parseInt(_0x25d0b8(0x113))/0xa+parseInt(_0x25d0b8(0x110))/0xb;if(_0x497ee5===_0x453c96)break;else _0x4a27a7['push'](_0x4a27a7['shift']());}catch(_0x5800da){_0x4a27a7['push'](_0x4a27a7['shift']());}}}(a3_0x2b70,0x56194));import{BaseCommand}from'./command.js';function a3_0x3361(_0x1dfd69,_0x4c2de0){_0x1dfd69=_0x1dfd69-0x107;const _0x2b70a3=a3_0x2b70();let _0x3361db=_0x2b70a3[_0x1dfd69];return _0x3361db;}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a3_0x2b70(){const _0x478b06=['segment','Error:\x20Segment\x20name\x20is\x20required','\x27...','✔\x20Found\x20','listActivations','Error:\x20','286736NMrjPI','List\x20activations\x20for\x20a\x20segment','31950xovzzt','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','22NZbWFt','126lzgsJW','Child\x20name:\x20','cause','Listing\x20activations\x20for\x20segment\x20\x27','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','error','245MLUwxF','2870pgqNhT','execute','38022HxzqMz','length','Resolved\x20parent\x20ID:\x20','702609cUgcUG','8264663MZKIZm','data','Resolved\x20child\x20ID:\x20','5248550oYqAXs','3008hKYpmE','verbose','name'];a3_0x2b70=function(){return _0x478b06;};return a3_0x2b70();}import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x5211ec(0x116)]='activations';['description']=a3_0x5211ec(0x11e);async[a3_0x5211ec(0x10b)](_0x34f8a5){const _0x16936d=a3_0x5211ec,{options:_0x2440fa,args:_0x33e60c,tdx:_0x26800f}=_0x34f8a5;if(_0x33e60c[_0x16936d(0x10d)]===0x0)return console[_0x16936d(0x108)](_0x16936d(0x118)),console['error']('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;try{const {parentId:_0x43fdb2,childId:_0x3e7870}=parseSegmentRef(_0x33e60c[0x0]);if(!_0x3e7870)return console[_0x16936d(0x108)](_0x16936d(0x120)),console['error'](_0x16936d(0x107)),0x1;_0x2440fa['verbose']&&(console['error']('Site:\x20'+_0x2440fa['site']),console[_0x16936d(0x108)]('Parent\x20name:\x20'+_0x43fdb2),console[_0x16936d(0x108)](_0x16936d(0x123)+_0x3e7870));const _0x39a114=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x43fdb2+_0x16936d(0x119),()=>_0x26800f['segment']['resolveParentId'](_0x43fdb2),{'verbose':_0x2440fa[_0x16936d(0x115)]}),_0x327ad7=_0x39a114[_0x16936d(0x111)];_0x2440fa[_0x16936d(0x115)]&&console[_0x16936d(0x108)](_0x16936d(0x10e)+_0x327ad7);const _0x1d2eb8=await withSpinner('Resolving\x20child\x20segment\x20\x27'+_0x3e7870+_0x16936d(0x119),()=>_0x26800f[_0x16936d(0x117)]['resolveSegmentId'](_0x327ad7,_0x3e7870),{'verbose':_0x2440fa['verbose']}),_0x2524ff=_0x1d2eb8[_0x16936d(0x111)];_0x2440fa[_0x16936d(0x115)]&&console[_0x16936d(0x108)](_0x16936d(0x112)+_0x2524ff);const _0x47f926=await withSpinner(_0x16936d(0x125)+_0x3e7870+_0x16936d(0x119),()=>_0x26800f[_0x16936d(0x117)][_0x16936d(0x11b)](_0x327ad7,_0x2524ff),{'verbose':_0x2440fa[_0x16936d(0x115)]}),_0x3d05cd=_0x47f926[_0x16936d(0x111)];return console['error'](_0x16936d(0x11a)+_0x3d05cd[_0x16936d(0x10d)]+'\x20activation'+(_0x3d05cd['length']!==0x1?'s':'')),await handleSDKOutput(_0x3d05cd,_0x2440fa),0x0;}catch(_0x49b038){if(_0x49b038 instanceof SDKError)return console[_0x16936d(0x108)](_0x16936d(0x11c)+_0x49b038['message']),_0x49b038[_0x16936d(0x124)]&&console['error']('\x20\x20Cause:\x20'+_0x49b038[_0x16936d(0x124)]),0x1;throw _0x49b038;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x5ef285=a4_0x3072;(function(_0x2a4e38,_0xf6c6b0){const _0x2e3728=a4_0x3072,_0x4c71c7=_0x2a4e38();while(!![]){try{const _0x897a03=parseInt(_0x2e3728(0x195))/0x1*(parseInt(_0x2e3728(0x19a))/0x2)+-parseInt(_0x2e3728(0x198))/0x3+parseInt(_0x2e3728(0x1d4))/0x4+-parseInt(_0x2e3728(0x19f))/0x5*(-parseInt(_0x2e3728(0x1e1))/0x6)+-parseInt(_0x2e3728(0x1ec))/0x7*(-parseInt(_0x2e3728(0x1f4))/0x8)+parseInt(_0x2e3728(0x14d))/0x9+-parseInt(_0x2e3728(0x1a7))/0xa;if(_0x897a03===_0xf6c6b0)break;else _0x4c71c7['push'](_0x4c71c7['shift']());}catch(_0x11190d){_0x4c71c7['push'](_0x4c71c7['shift']());}}}(a4_0x521a,0xa6f62));import a4_0x29ffea from'chalk';import a4_0x3f29c1 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a4_0x521a(){const _0x19f3e3=['\x20updated','newProjectId','cloneProject','\x0aError:','unchanged','llmProject','created','pushAgent','Status:\x20','Agent:\x20','\x22...','\x0a✔\x20Pulled\x20','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x20\x20Target:\x20','Pushing\x20to\x20project...','Dry\x20run\x20-\x20no\x20files\x20written','Agent\x20pulled\x20successfully','Project:\x20','\x20\x20Knowledge\x20Bases:\x20','yellow','\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','no_local_folder','\x20errors','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','Using\x20project:\x20','\x20=\x20','name','dirname','\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','\x20changed','\x0aProject\x20pushed\x20with\x20errors','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','red','\x20\x20Text\x20Knowledge\x20Bases:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20unchanged','found','new','\x20\x20Knowledge\x20Base\x20\x22','pullProject','session','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','\x0aChanges\x20to\x20agent\x20\x27','projectName','\x20\x20Prompts:\x20','\x20\x20Integrations:\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x20\x20Agents:\x20','experimentalKnowledgeBases','Project\x20cloned\x20with\x20errors','dim','agent.yml','Clone\x20\x22','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','\x0aChanges\x20to\x20prompt\x20\x27','\x20|\x20','\x20--name\x20','isNew','\x0aErrors\x20found:','<new-name>','agentName','\x20files?','INVALID_ARGUMENT','newProjectName','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','2iIeeLb','Output:\x20','action','1138833AwPVnX','errors','797992hKKOCy','llm_project','force','New\x20project\x20ID:\x20','outputDir','5pJtHmV','Using\x20current\x20project:\x20','agent','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','prompts','projectDir','site','Would\x20pull\x20agent:\x20','19951650uvAbyJ','error','profile','integrations','agents','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)','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','execute','yes','\x22\x20to\x20a\x20different\x20profile','cyan','log','sourceProjectName','Pulling\x20agent\x20\x22','projectId','\x0aPush\x20summary\x20for\x20\x27','\x20\x20Integration\x20\x22','Summary:','\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','\x20\x20Experimental\x20Artifact\x20\x22','source','Cancelled','knowledgeBases','New\x20project:\x20','cwd','counts','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','repeat','agentId','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','gray','Pushing\x20agent\x20from\x20\x22','MISSING_ARGUMENT','\x22\x20from\x20project\x20\x22','Using\x20context\x20project:\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','agent:pull','\x20\x20Prompt\x20\x22','parse','Errors:','agent:push','Using\x20local\x20project:\x20','\x20created','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','3637804FUwbNU','\x22\x20to\x20\x22','Failed\x20to\x20push\x20agent:\x20','\x20\x20tdx\x20agent\x20clone\x20agents/','utf-8','diff','\x22:\x20','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','textKnowledgeBases','\x20\x20Agent\x20\x22','✔\x20Context\x20set:\x20','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','experimentalArtifacts','5493252qRmUSN','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\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)','Chat:\x20','Project\x20cloned\x20successfully','\x20total','\x22\x20to\x20new\x20project\x20\x22','\x0a✔\x20Pushed\x20','tdx.json','dryRun','llm','91168qRptzN','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','outputPath','Analyzing\x20project\x20\x22','updated','Using\x20project\x20from\x20','\x20files\x20to\x20','\x0aChanges\x20to\x20integration\x20\x27','80kPsAqH','Cloning\x20\x22','green','\x20new','join','Analyzing\x20changes\x20to\x20push...','description','\x20\x20tdx\x20agent\x20pull\x20','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','total','Source:\x20','2748825hXIkDD','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','hasChanges','push','-\x20no\x20files\x20written','No\x20tdx.json\x20found\x20in\x20','message'];a4_0x521a=function(){return _0x19f3e3;};return a4_0x521a();}function a4_0x3072(_0x429b9b,_0x390f57){_0x429b9b=_0x429b9b-0x146;const _0x521af0=a4_0x521a();let _0x30727e=_0x521af0[_0x429b9b];return _0x30727e;}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(_0x295f6a){const _0x16fd5f=a4_0x3072,_0x5dcba4=[];if(_0x295f6a[_0x16fd5f(0x14b)]!==undefined)_0x5dcba4[_0x16fd5f(0x150)](_0x295f6a[_0x16fd5f(0x14b)]+_0x16fd5f(0x1e6));if(_0x295f6a[_0x16fd5f(0x179)]!==undefined&&_0x295f6a[_0x16fd5f(0x179)]>0x0)_0x5dcba4[_0x16fd5f(0x150)](a4_0x29ffea[_0x16fd5f(0x1f6)](_0x295f6a[_0x16fd5f(0x179)]+_0x16fd5f(0x1f7)));if(_0x295f6a[_0x16fd5f(0x15a)]!==undefined&&_0x295f6a['created']>0x0)_0x5dcba4[_0x16fd5f(0x150)](a4_0x29ffea['green'](_0x295f6a['created']+_0x16fd5f(0x1d2)));if(_0x295f6a[_0x16fd5f(0x1f0)]!==undefined&&_0x295f6a[_0x16fd5f(0x1f0)]>0x0)_0x5dcba4['push'](a4_0x29ffea[_0x16fd5f(0x167)](_0x295f6a[_0x16fd5f(0x1f0)]+_0x16fd5f(0x154)));if(_0x295f6a[_0x16fd5f(0x158)]!==undefined&&_0x295f6a['unchanged']>0x0)_0x5dcba4[_0x16fd5f(0x150)](a4_0x29ffea[_0x16fd5f(0x1c6)](_0x295f6a[_0x16fd5f(0x158)]+_0x16fd5f(0x177)));if(_0x295f6a[_0x16fd5f(0x199)]!==undefined&&_0x295f6a['errors']>0x0)_0x5dcba4[_0x16fd5f(0x150)](a4_0x29ffea['red'](_0x295f6a['errors']+_0x16fd5f(0x16a)));return _0x5dcba4['join'](',\x20');}function displayDiffs(_0x5f4b1a,_0x50bc1b,_0x8186db,_0x412bad,_0x49ab9e,_0x507d4e,_0x108d82){const _0x5700f9=a4_0x3072;for(const _0x3fe34a of _0x5f4b1a){if(_0x3fe34a[_0x5700f9(0x1d9)]){const _0x4a1655=_0x3fe34a[_0x5700f9(0x190)]||_0x3fe34a[_0x5700f9(0x16e)];console[_0x5700f9(0x1b2)](_0x5700f9(0x17e)+_0x4a1655+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x5700f9(0x1b2)](_0x3fe34a[_0x5700f9(0x1d9)]),console[_0x5700f9(0x1b2)]('─'[_0x5700f9(0x1c2)](0x3c));}}for(const _0x2960ff of _0x50bc1b){_0x2960ff[_0x5700f9(0x1d9)]&&(console[_0x5700f9(0x1b2)]('\x0aChanges\x20to\x20knowledge\x20base\x20\x27'+_0x2960ff[_0x5700f9(0x16e)]+'\x27:'),console[_0x5700f9(0x1b2)]('─'[_0x5700f9(0x1c2)](0x3c)),console[_0x5700f9(0x1b2)](_0x2960ff[_0x5700f9(0x1d9)]),console[_0x5700f9(0x1b2)]('─'[_0x5700f9(0x1c2)](0x3c)));}for(const _0x5d60f3 of _0x8186db){_0x5d60f3[_0x5700f9(0x1d9)]&&(console[_0x5700f9(0x1b2)](_0x5700f9(0x1d3)+_0x5d60f3[_0x5700f9(0x16e)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x5700f9(0x1b2)](_0x5d60f3[_0x5700f9(0x1d9)]),console[_0x5700f9(0x1b2)]('─'['repeat'](0x3c)));}for(const _0xb1ca4f of _0x412bad){_0xb1ca4f[_0x5700f9(0x1d9)]&&(console[_0x5700f9(0x1b2)](_0x5700f9(0x18a)+_0xb1ca4f[_0x5700f9(0x16e)]+'\x27:'),console[_0x5700f9(0x1b2)]('─'[_0x5700f9(0x1c2)](0x3c)),console[_0x5700f9(0x1b2)](_0xb1ca4f['diff']),console[_0x5700f9(0x1b2)]('─'[_0x5700f9(0x1c2)](0x3c)));}for(const _0x93c0da of _0x49ab9e){_0x93c0da['diff']&&(console[_0x5700f9(0x1b2)](_0x5700f9(0x1f3)+_0x93c0da[_0x5700f9(0x16e)]+'\x27:'),console[_0x5700f9(0x1b2)]('─'[_0x5700f9(0x1c2)](0x3c)),console[_0x5700f9(0x1b2)](_0x93c0da[_0x5700f9(0x1d9)]),console['log']('─'[_0x5700f9(0x1c2)](0x3c)));}for(const _0x1cd3bc of _0x507d4e){_0x1cd3bc['diff']&&(console[_0x5700f9(0x1b2)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x1cd3bc[_0x5700f9(0x16e)]+'\x27:'),console[_0x5700f9(0x1b2)]('─'[_0x5700f9(0x1c2)](0x3c)),console[_0x5700f9(0x1b2)](_0x1cd3bc[_0x5700f9(0x1d9)]),console[_0x5700f9(0x1b2)]('─'['repeat'](0x3c)));}for(const _0x2cf665 of _0x108d82){_0x2cf665[_0x5700f9(0x1d9)]&&(console[_0x5700f9(0x1b2)](_0x5700f9(0x14a)+_0x2cf665[_0x5700f9(0x16e)]+'\x27:'),console[_0x5700f9(0x1b2)]('─'[_0x5700f9(0x1c2)](0x3c)),console[_0x5700f9(0x1b2)](_0x2cf665[_0x5700f9(0x1d9)]),console[_0x5700f9(0x1b2)]('─'[_0x5700f9(0x1c2)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x5ef285(0x16e)]=a4_0x5ef285(0x1cc);[a4_0x5ef285(0x148)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x5ef285(0x1ae)](_0x24bffb){const _0x453e96=a4_0x5ef285,{options:_0x584f4b,args:_0x36ce94,tdx:_0x1a7345}=_0x24bffb,_0x858d10=_0x36ce94[0x0],_0x1b2518=_0x36ce94[0x1],_0x76bbfc=_0x584f4b['output'],_0x31ede5=_0x584f4b[_0x453e96(0x1ea)],_0x985549=_0x584f4b['force'],_0x29911f=_0x584f4b['yes'],_0x12e83f=_0x584f4b['llmProject'],_0x30a00f=_0x584f4b[_0x453e96(0x1a1)];let _0xe75adb;if(_0x858d10){const _0x591cff=a4_0x3f29c1[_0x453e96(0x146)](_0x858d10,'tdx.json');if(existsSync(_0x591cff))try{const _0x1ed810=JSON[_0x453e96(0x1ce)](readFileSync(_0x591cff,_0x453e96(0x1d8)));_0x1ed810[_0x453e96(0x19b)]&&(_0xe75adb={'llm_project':_0x1ed810[_0x453e96(0x19b)]});}catch{}}const _0x5e4106=findAgentConfigPath(process[_0x453e96(0x1bf)]());let _0x2a19ee;if(_0x5e4106)try{const _0x556374=JSON[_0x453e96(0x1ce)](readFileSync(_0x5e4106,'utf-8'));_0x556374['llm_project']&&(_0x2a19ee={'llm_project':_0x556374[_0x453e96(0x19b)]});}catch{}const _0x53c91e=resolveAgentPullArgs({'arg':_0x858d10,'agentNameArg':_0x1b2518,'agentFlag':_0x30a00f,'contextProject':_0x12e83f,'argDirConfig':_0xe75adb,'cwdConfigPath':_0x5e4106||undefined,'cwdConfig':_0x2a19ee}),{projectNameOrId:_0x415642,targetAgentName:_0xca346b,existingOutputDir:_0x2399f1,source:_0x3d739c}=_0x53c91e;if(_0x3d739c==='arg-dir')console['log'](a4_0x29ffea['dim'](_0x453e96(0x1f1)+a4_0x3f29c1[_0x453e96(0x146)](_0x858d10,_0x453e96(0x1e9))+':\x20'+_0x415642));else{if(_0x3d739c==='cwd-config')console['log'](a4_0x29ffea[_0x453e96(0x186)](_0x453e96(0x16c)+_0x415642));else _0x3d739c==='context'&&console['log'](a4_0x29ffea['dim']('Using\x20project\x20from\x20context:\x20'+_0x415642));}if(!_0x415642)return _0x30a00f?(console[_0x453e96(0x1b2)](a4_0x29ffea[_0x453e96(0x167)](_0x453e96(0x189))),console[_0x453e96(0x1b2)]('Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>'),console[_0x453e96(0x1b2)](_0x453e96(0x1e2))):(console[_0x453e96(0x1b2)](a4_0x29ffea[_0x453e96(0x167)](_0x453e96(0x173))),console[_0x453e96(0x1b2)](_0x453e96(0x1ac)),console[_0x453e96(0x1b2)](_0x453e96(0x168)),console['log'](_0x453e96(0x170)),console['log']('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project'),console[_0x453e96(0x1b2)](_0x453e96(0x1b9))),0x1;if(_0xca346b){const {data:_0x5a813a}=await withSpinner(_0x453e96(0x1b4)+_0xca346b+_0x453e96(0x1c9)+_0x415642+_0x453e96(0x15e),()=>_0x1a7345['llm']['pullAgent'](_0x415642,_0xca346b,_0x76bbfc,{'dryRun':_0x31ede5,'force':_0x985549}));if(_0x31ede5)return console['log'](a4_0x29ffea[_0x453e96(0x167)](_0x453e96(0x163))),console['log'](_0x453e96(0x1a6)+_0x5a813a[_0x453e96(0x190)]),console[_0x453e96(0x1b2)]('Output\x20path:\x20'+_0x5a813a[_0x453e96(0x1ee)]),_0x5a813a['diff']&&(console['log']('\x0aChanges:'),console[_0x453e96(0x1b2)]('─'[_0x453e96(0x1c2)](0x3c)),console[_0x453e96(0x1b2)](_0x5a813a[_0x453e96(0x1d9)]),console[_0x453e96(0x1b2)]('─'[_0x453e96(0x1c2)](0x3c))),0x0;return console[_0x453e96(0x1b2)](a4_0x29ffea[_0x453e96(0x1f6)](_0x453e96(0x164))),console[_0x453e96(0x1b2)](_0x453e96(0x15d)+_0x5a813a[_0x453e96(0x190)]),console['log'](_0x453e96(0x196)+_0x5a813a['outputPath']),console[_0x453e96(0x1b2)](_0x453e96(0x15c)+(_0x5a813a[_0x453e96(0x18d)]?a4_0x29ffea[_0x453e96(0x1f6)](_0x453e96(0x179)):_0x5a813a[_0x453e96(0x14f)]?a4_0x29ffea[_0x453e96(0x167)]('updated'):a4_0x29ffea[_0x453e96(0x1c6)]('unchanged'))),0x0;}const _0x5cba88=_0x2399f1||_0x76bbfc,{data:_0x417639}=await withSpinner(_0x453e96(0x1ef)+_0x415642+_0x453e96(0x15e),()=>_0x1a7345['llm']['pullProject'](_0x415642,_0x5cba88,{'dryRun':!![]})),_0x3fbf21=_0x417639[_0x453e96(0x1c0)][_0x453e96(0x1ab)]['new']+_0x417639[_0x453e96(0x1c0)][_0x453e96(0x1bd)][_0x453e96(0x179)]+_0x417639[_0x453e96(0x1c0)][_0x453e96(0x1dc)][_0x453e96(0x179)]+_0x417639[_0x453e96(0x1c0)][_0x453e96(0x1a3)]['new']+_0x417639[_0x453e96(0x1c0)][_0x453e96(0x1aa)]['new']+_0x417639[_0x453e96(0x1c0)][_0x453e96(0x184)][_0x453e96(0x179)]+_0x417639[_0x453e96(0x1c0)]['experimentalArtifacts'][_0x453e96(0x179)],_0x4fbbc1=_0x417639[_0x453e96(0x1c0)]['agents'][_0x453e96(0x1f0)]+_0x417639[_0x453e96(0x1c0)]['knowledgeBases'][_0x453e96(0x1f0)]+_0x417639[_0x453e96(0x1c0)]['textKnowledgeBases'][_0x453e96(0x1f0)]+_0x417639[_0x453e96(0x1c0)][_0x453e96(0x1a3)]['updated']+_0x417639[_0x453e96(0x1c0)][_0x453e96(0x1aa)][_0x453e96(0x1f0)]+_0x417639['counts']['experimentalKnowledgeBases'][_0x453e96(0x1f0)]+_0x417639[_0x453e96(0x1c0)][_0x453e96(0x1e0)][_0x453e96(0x1f0)],_0x40dcfd=_0x417639['counts'][_0x453e96(0x1ab)][_0x453e96(0x158)]+_0x417639[_0x453e96(0x1c0)][_0x453e96(0x1bd)][_0x453e96(0x158)]+_0x417639[_0x453e96(0x1c0)][_0x453e96(0x1dc)][_0x453e96(0x158)]+_0x417639[_0x453e96(0x1c0)][_0x453e96(0x1a3)][_0x453e96(0x158)]+_0x417639['counts'][_0x453e96(0x1aa)][_0x453e96(0x158)]+_0x417639[_0x453e96(0x1c0)]['experimentalKnowledgeBases'][_0x453e96(0x158)]+_0x417639[_0x453e96(0x1c0)][_0x453e96(0x1e0)][_0x453e96(0x158)];console[_0x453e96(0x1b2)]('\x0aPull\x20summary\x20for\x20\x27'+_0x417639['projectName']+'\x27:'),console[_0x453e96(0x1b2)]('\x20\x20'+a4_0x29ffea[_0x453e96(0x1f6)]('+\x20'+_0x3fbf21+_0x453e96(0x1f7))+'\x20|\x20'+a4_0x29ffea[_0x453e96(0x167)]('~\x20'+_0x4fbbc1+_0x453e96(0x171))+_0x453e96(0x18b)+a4_0x29ffea[_0x453e96(0x186)]('=\x20'+_0x40dcfd+_0x453e96(0x177))),console[_0x453e96(0x1b2)](_0x453e96(0x183)+formatCountSummary(_0x417639['counts'][_0x453e96(0x1ab)])),console[_0x453e96(0x1b2)](_0x453e96(0x166)+formatCountSummary(_0x417639[_0x453e96(0x1c0)]['knowledgeBases'])),console[_0x453e96(0x1b2)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x417639['counts'][_0x453e96(0x1dc)])),console[_0x453e96(0x1b2)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x417639[_0x453e96(0x1c0)]['prompts'])),console[_0x453e96(0x1b2)](_0x453e96(0x181)+formatCountSummary(_0x417639[_0x453e96(0x1c0)][_0x453e96(0x1aa)]));const _0xe97bd7=_0x417639[_0x453e96(0x1c0)][_0x453e96(0x184)][_0x453e96(0x14b)]>0x0||_0x417639['counts'][_0x453e96(0x1e0)]['total']>0x0;_0xe97bd7&&(console[_0x453e96(0x1b2)](_0x453e96(0x1c1)+formatCountSummary(_0x417639[_0x453e96(0x1c0)][_0x453e96(0x184)])),console[_0x453e96(0x1b2)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x417639['counts']['experimentalArtifacts'])));console[_0x453e96(0x1b2)](_0x453e96(0x161)+a4_0x29ffea['cyan'](_0x417639[_0x453e96(0x19e)])),displayDiffs(_0x417639[_0x453e96(0x1ab)],_0x417639[_0x453e96(0x1bd)],_0x417639[_0x453e96(0x1dc)],_0x417639[_0x453e96(0x1a3)],_0x417639[_0x453e96(0x1aa)],_0x417639[_0x453e96(0x184)],_0x417639[_0x453e96(0x1e0)]);if(_0x31ede5)return console['log'](a4_0x29ffea[_0x453e96(0x167)](_0x453e96(0x1c4))),0x0;if(_0x3fbf21===0x0&&_0x4fbbc1===0x0)return console[_0x453e96(0x1b2)](a4_0x29ffea[_0x453e96(0x1f6)](_0x453e96(0x1a2))),saveSessionContext({'llm_project':_0x417639[_0x453e96(0x17f)]},_0x584f4b[_0x453e96(0x17c)]),console[_0x453e96(0x1b2)](a4_0x29ffea[_0x453e96(0x1f6)](_0x453e96(0x1de)+a4_0x29ffea[_0x453e96(0x186)](_0x453e96(0x19b))+_0x453e96(0x16d)+a4_0x29ffea['cyan'](_0x417639[_0x453e96(0x17f)]))),0x0;if(!_0x29911f&&!_0x985549){if(!isInteractive())return console['error'](a4_0x29ffea['red']('\x0aError:'),_0x453e96(0x176)),console[_0x453e96(0x1a8)](a4_0x29ffea[_0x453e96(0x186)](_0x453e96(0x1c5))),0x1;const _0x35da6a=await confirmKey('\x0aWrite\x20'+(_0x3fbf21+_0x4fbbc1)+_0x453e96(0x191));if(!_0x35da6a)return console[_0x453e96(0x1b2)](a4_0x29ffea[_0x453e96(0x167)](_0x453e96(0x1bc)),_0x453e96(0x151)),0x1;}const {data:_0x4e653c}=await withSpinner('Writing\x20files...',()=>_0x1a7345[_0x453e96(0x1eb)][_0x453e96(0x17b)](_0x415642,_0x5cba88,{'force':_0x985549}));return console[_0x453e96(0x1b2)](a4_0x29ffea[_0x453e96(0x1f6)](_0x453e96(0x15f)+(_0x3fbf21+_0x4fbbc1)+_0x453e96(0x1f2)+_0x4e653c[_0x453e96(0x19e)])),saveSessionContext({'llm_project':_0x4e653c[_0x453e96(0x17f)]},_0x584f4b[_0x453e96(0x17c)]),console['log'](a4_0x29ffea[_0x453e96(0x1f6)](_0x453e96(0x1de)+a4_0x29ffea[_0x453e96(0x186)](_0x453e96(0x19b))+_0x453e96(0x16d)+a4_0x29ffea['cyan'](_0x4e653c['projectName']))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']='agent:clone';[a4_0x5ef285(0x148)]=a4_0x5ef285(0x14e);async[a4_0x5ef285(0x1ae)](_0x36139f){const _0x275b76=a4_0x5ef285,{options:_0x590e59,args:_0x1039aa,tdx:_0x4d12e8}=_0x36139f,_0x2ac4e3=_0x1039aa[0x0],_0x126323=_0x590e59[_0x275b76(0x16e)],_0xf28f71=_0x590e59['dryRun'],_0x35ebf9=_0x590e59[_0x275b76(0x1af)],_0x714342=_0x590e59[_0x275b76(0x1a5)],_0xb6281=_0x590e59[_0x275b76(0x159)];let _0x229e14;const _0x3b48e2=findAgentConfigPath(process[_0x275b76(0x1bf)]());if(_0x2ac4e3){const _0x346dff=a4_0x3f29c1[_0x275b76(0x146)](_0x2ac4e3,_0x275b76(0x1e9));existsSync(_0x346dff)?(_0x229e14=_0x2ac4e3,console['log'](a4_0x29ffea[_0x275b76(0x186)](_0x275b76(0x1d1)+_0x2ac4e3))):_0x229e14=_0x2ac4e3;}else{if(_0x3b48e2)_0x229e14=a4_0x3f29c1[_0x275b76(0x16f)](_0x3b48e2),console[_0x275b76(0x1b2)](a4_0x29ffea[_0x275b76(0x186)](_0x275b76(0x1a0)+_0x229e14));else{if(_0xb6281){const _0x1709fc=sanitizeForFilesystem(_0xb6281);let _0x1c03df=_0x1709fc,_0x4fee1b=a4_0x3f29c1[_0x275b76(0x146)](process[_0x275b76(0x1bf)](),_0x275b76(0x1ab),_0x1709fc,_0x275b76(0x1e9));if(!existsSync(_0x4fee1b)){const _0x33d4e0=normalizeName(_0xb6281),_0x3fb35f=a4_0x3f29c1['join'](process['cwd'](),_0x275b76(0x1ab),_0x33d4e0,_0x275b76(0x1e9));existsSync(_0x3fb35f)&&(_0x1c03df=_0x33d4e0,_0x4fee1b=_0x3fb35f);}if(existsSync(_0x4fee1b))_0x229e14=a4_0x3f29c1[_0x275b76(0x16f)](_0x4fee1b),console[_0x275b76(0x1b2)](a4_0x29ffea[_0x275b76(0x186)](_0x275b76(0x1d1)+_0x229e14));else{const _0x28166d=_0x590e59[_0x275b76(0x1a9)];if(_0x28166d)throw new SDKError(ErrorCode[_0x275b76(0x192)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0xb6281+_0x275b76(0x1b0),undefined,{'helpText':_0x275b76(0x16b)+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+(_0x275b76(0x149)+_0xb6281+'\x0a')+(_0x275b76(0x1d7)+_0x1c03df+_0x275b76(0x18c)+(_0x126323||_0x275b76(0x18f))+'\x20--profile\x20'+_0x28166d)});_0x229e14=_0xb6281,console[_0x275b76(0x1b2)](a4_0x29ffea[_0x275b76(0x186)](_0x275b76(0x1ca)+_0xb6281));}}}}if(!_0x229e14)return console[_0x275b76(0x1b2)](a4_0x29ffea[_0x275b76(0x167)](_0x275b76(0x1df))),console['log'](_0x275b76(0x1ad)),console[_0x275b76(0x1b2)]('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console['log'](_0x275b76(0x1e3)),console[_0x275b76(0x1b2)](_0x275b76(0x194)),0x1;if(!_0x126323)throw new SDKError(ErrorCode[_0x275b76(0x1c8)],'New\x20project\x20name\x20is\x20required',undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0x35ebf9&&!_0xf28f71){if(!isInteractive())return console[_0x275b76(0x1a8)](a4_0x29ffea[_0x275b76(0x174)](_0x275b76(0x157)),_0x275b76(0x176)),console[_0x275b76(0x1a8)](a4_0x29ffea['dim'](_0x275b76(0x1c5))),0x1;const _0xcb0689=await confirmKey(_0x275b76(0x188)+_0x229e14+_0x275b76(0x1e7)+_0x126323+'\x22?');if(!_0xcb0689)return console[_0x275b76(0x1b2)](a4_0x29ffea['yellow'](_0x275b76(0x1bc))),0x1;}const {data:_0x3d95a1}=await withSpinner(_0x275b76(0x1f5)+_0x229e14+_0x275b76(0x1d5)+_0x126323+_0x275b76(0x15e),()=>_0x4d12e8[_0x275b76(0x1eb)][_0x275b76(0x156)](_0x229e14,_0x126323,{'dryRun':_0xf28f71}));if(_0xf28f71){console['log'](a4_0x29ffea[_0x275b76(0x167)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x275b76(0x1b2)](_0x275b76(0x14c)+_0x3d95a1[_0x275b76(0x1b3)]),console[_0x275b76(0x1b2)](_0x275b76(0x1be)+_0x126323),console[_0x275b76(0x1b2)]('Would\x20clone:'),console['log'](_0x275b76(0x183)+_0x3d95a1['counts'][_0x275b76(0x1ab)][_0x275b76(0x15a)]),console['log']('\x20\x20Knowledge\x20Bases:\x20'+_0x3d95a1[_0x275b76(0x1c0)][_0x275b76(0x1bd)]['created']),console[_0x275b76(0x1b2)](_0x275b76(0x180)+_0x3d95a1[_0x275b76(0x1c0)][_0x275b76(0x1a3)][_0x275b76(0x15a)]);const _0x1b0da2=_0x3d95a1['counts']['experimentalKnowledgeBases'][_0x275b76(0x15a)]>0x0||_0x3d95a1[_0x275b76(0x1c0)][_0x275b76(0x1e0)][_0x275b76(0x15a)]>0x0;return _0x1b0da2&&(console[_0x275b76(0x1b2)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+_0x3d95a1[_0x275b76(0x1c0)]['experimentalKnowledgeBases']['created']),console[_0x275b76(0x1b2)]('\x20\x20Experimental\x20Artifacts:\x20'+_0x3d95a1['counts'][_0x275b76(0x1e0)][_0x275b76(0x15a)])),0x0;}const _0x1a6e79=_0x3d95a1[_0x275b76(0x1c0)][_0x275b76(0x1ab)][_0x275b76(0x199)]>0x0||_0x3d95a1[_0x275b76(0x1c0)][_0x275b76(0x1bd)][_0x275b76(0x199)]>0x0||_0x3d95a1['counts']['prompts'][_0x275b76(0x199)]>0x0||_0x3d95a1[_0x275b76(0x1c0)]['experimentalKnowledgeBases'][_0x275b76(0x199)]>0x0||_0x3d95a1[_0x275b76(0x1c0)]['experimentalArtifacts'][_0x275b76(0x199)]>0x0;_0x1a6e79?console[_0x275b76(0x1b2)](a4_0x29ffea[_0x275b76(0x167)](_0x275b76(0x185))):console[_0x275b76(0x1b2)](a4_0x29ffea[_0x275b76(0x1f6)](_0x275b76(0x1e5)));console[_0x275b76(0x1b2)](_0x275b76(0x14c)+_0x3d95a1[_0x275b76(0x1b3)]),console[_0x275b76(0x1b2)](_0x275b76(0x1be)+_0x3d95a1[_0x275b76(0x193)]),console[_0x275b76(0x1b2)](_0x275b76(0x19d)+_0x3d95a1['newProjectId']),console[_0x275b76(0x1b2)](),console[_0x275b76(0x1b2)](_0x275b76(0x1b8)),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x3d95a1[_0x275b76(0x1c0)][_0x275b76(0x1ab)])),console[_0x275b76(0x1b2)](_0x275b76(0x166)+formatCountSummary(_0x3d95a1['counts'][_0x275b76(0x1bd)])),console[_0x275b76(0x1b2)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x3d95a1[_0x275b76(0x1c0)]['prompts'])),console[_0x275b76(0x1b2)](_0x275b76(0x181)+formatCountSummary(_0x3d95a1['counts'][_0x275b76(0x1aa)]));const _0x306369=_0x3d95a1[_0x275b76(0x1c0)]['experimentalKnowledgeBases']['created']>0x0||_0x3d95a1[_0x275b76(0x1c0)][_0x275b76(0x184)][_0x275b76(0x1f0)]>0x0||_0x3d95a1['counts'][_0x275b76(0x184)][_0x275b76(0x158)]>0x0||_0x3d95a1[_0x275b76(0x1c0)][_0x275b76(0x1e0)][_0x275b76(0x15a)]>0x0||_0x3d95a1[_0x275b76(0x1c0)]['experimentalArtifacts']['updated']>0x0||_0x3d95a1[_0x275b76(0x1c0)][_0x275b76(0x1e0)]['unchanged']>0x0;_0x306369&&(console['log'](_0x275b76(0x1c1)+formatCountSummary(_0x3d95a1[_0x275b76(0x1c0)][_0x275b76(0x184)])),console['log']('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x3d95a1[_0x275b76(0x1c0)][_0x275b76(0x1e0)])));if(_0x1a6e79){console[_0x275b76(0x1b2)](),console['log'](a4_0x29ffea['red'](_0x275b76(0x1cf)));for(const _0x4a6d3f of _0x3d95a1[_0x275b76(0x1ab)]){_0x4a6d3f[_0x275b76(0x197)]===_0x275b76(0x1a8)&&console['log'](a4_0x29ffea['red'](_0x275b76(0x1dd)+_0x4a6d3f[_0x275b76(0x190)]+_0x275b76(0x1da)+_0x4a6d3f['error']));}for(const _0x498946 of _0x3d95a1[_0x275b76(0x1bd)]){_0x498946[_0x275b76(0x197)]===_0x275b76(0x1a8)&&console[_0x275b76(0x1b2)](a4_0x29ffea[_0x275b76(0x174)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x498946[_0x275b76(0x16e)]+_0x275b76(0x1da)+_0x498946['error']));}for(const _0x340c18 of _0x3d95a1['prompts']){_0x340c18[_0x275b76(0x197)]===_0x275b76(0x1a8)&&console['log'](a4_0x29ffea[_0x275b76(0x174)](_0x275b76(0x1cd)+_0x340c18[_0x275b76(0x16e)]+_0x275b76(0x1da)+_0x340c18[_0x275b76(0x1a8)]));}for(const _0x434865 of _0x3d95a1[_0x275b76(0x1aa)]){_0x434865[_0x275b76(0x197)]==='error'&&console[_0x275b76(0x1b2)](a4_0x29ffea['red'](_0x275b76(0x1b7)+_0x434865[_0x275b76(0x16e)]+_0x275b76(0x1da)+_0x434865['error']));}for(const _0x181221 of _0x3d95a1[_0x275b76(0x184)]){_0x181221[_0x275b76(0x197)]===_0x275b76(0x1a8)&&console[_0x275b76(0x1b2)](a4_0x29ffea[_0x275b76(0x174)](_0x275b76(0x1ed)+_0x181221[_0x275b76(0x16e)]+_0x275b76(0x1da)+_0x181221[_0x275b76(0x1a8)]));}for(const _0x38d8c1 of _0x3d95a1[_0x275b76(0x1e0)]){_0x38d8c1[_0x275b76(0x197)]===_0x275b76(0x1a8)&&console[_0x275b76(0x1b2)](a4_0x29ffea[_0x275b76(0x174)](_0x275b76(0x1ba)+_0x38d8c1['name']+_0x275b76(0x1da)+_0x38d8c1[_0x275b76(0x1a8)]));}return 0x1;}console[_0x275b76(0x1b2)]();const _0x142172=getLLMProjectUrl(_0x714342,_0x3d95a1[_0x275b76(0x155)]);return console[_0x275b76(0x1b2)](_0x275b76(0x165)+a4_0x29ffea['cyan'](_0x142172)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x5ef285(0x16e)]=a4_0x5ef285(0x1d0);[a4_0x5ef285(0x148)]=a4_0x5ef285(0x1db);async[a4_0x5ef285(0x1ae)](_0x451b78){const _0x50e751=a4_0x5ef285,{options:_0x3c4a5d,args:_0x37b0a3,tdx:_0xeee452}=_0x451b78;let _0x2a3c26=_0x37b0a3[0x0]||process[_0x50e751(0x1bf)]();const _0x2e288a=_0x3c4a5d[_0x50e751(0x1ea)],_0x5250fe=_0x3c4a5d[_0x50e751(0x19c)],_0x52c4f3=_0x3c4a5d[_0x50e751(0x1af)],_0x23fef5=_0x3c4a5d[_0x50e751(0x1a5)],_0x1b1a68=a4_0x3f29c1[_0x50e751(0x146)](_0x2a3c26,_0x50e751(0x187)),_0x559a8e=existsSync(_0x1b1a68);if(_0x559a8e){const {data:_0x1746ad}=await withSpinner(_0x50e751(0x1c7)+_0x2a3c26+_0x50e751(0x15e),()=>_0xeee452[_0x50e751(0x1eb)][_0x50e751(0x15b)](_0x2a3c26,{'dryRun':_0x2e288a,'force':_0x5250fe}));if(_0x2e288a)return console[_0x50e751(0x1b2)](a4_0x29ffea['yellow']('Dry\x20run\x20-\x20no\x20changes\x20made')),console['log']('Would\x20push\x20agent:\x20'+_0x1746ad[_0x50e751(0x190)]),0x0;if(_0x1746ad['action']===_0x50e751(0x1a8))return console[_0x50e751(0x1b2)](a4_0x29ffea[_0x50e751(0x174)](_0x50e751(0x1d6)+_0x1746ad[_0x50e751(0x1a8)])),0x1;console['log'](a4_0x29ffea[_0x50e751(0x1f6)]('Agent\x20'+_0x1746ad['action']+'\x20successfully')),console[_0x50e751(0x1b2)](_0x50e751(0x15d)+_0x1746ad['agentName']);if(_0x1746ad[_0x50e751(0x1c3)]&&_0x1746ad['projectId']){const _0x2582d3=getLLMAgentChatUrl(_0x23fef5,_0x1746ad[_0x50e751(0x1b5)],_0x1746ad[_0x50e751(0x1c3)]);console[_0x50e751(0x1b2)](_0x50e751(0x1e4)+a4_0x29ffea[_0x50e751(0x1b1)](_0x2582d3));}return 0x0;}const _0x199ad9=_0x3c4a5d[_0x50e751(0x159)],_0x3ce43f=resolveProjectFromContext(_0x2a3c26,_0x199ad9);if(_0x3ce43f[_0x50e751(0x178)])_0x2a3c26=_0x3ce43f[_0x50e751(0x1a4)],_0x3ce43f[_0x50e751(0x1bb)]==='context'&&console[_0x50e751(0x1b2)](a4_0x29ffea[_0x50e751(0x186)]('Using\x20project:\x20'+_0x2a3c26));else{let _0x535bc1='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x3ce43f['reason']===_0x50e751(0x169)&&(_0x535bc1=_0x3ce43f[_0x50e751(0x153)]+_0x50e751(0x17d)+_0x3ce43f['llmProject']+_0x50e751(0x1cb));throw new SDKError(ErrorCode[_0x50e751(0x192)],_0x3ce43f['reason']==='no_context'?_0x3ce43f[_0x50e751(0x153)]:_0x50e751(0x152)+_0x2a3c26,undefined,{'helpText':_0x535bc1});}const {data:_0xfbc01c}=await withSpinner(_0x50e751(0x147),()=>_0xeee452['llm']['pushProject'](_0x2a3c26,{'dryRun':!![]})),_0x34c703=_0xfbc01c[_0x50e751(0x1c0)][_0x50e751(0x1ab)][_0x50e751(0x199)]>0x0;if(_0x34c703){console[_0x50e751(0x1b2)](a4_0x29ffea[_0x50e751(0x174)](_0x50e751(0x18e)));for(const _0x2b1409 of _0xfbc01c[_0x50e751(0x1ab)]){_0x2b1409[_0x50e751(0x197)]===_0x50e751(0x1a8)&&console[_0x50e751(0x1b2)](a4_0x29ffea['red'](_0x50e751(0x1dd)+_0x2b1409[_0x50e751(0x190)]+_0x50e751(0x1da)+_0x2b1409[_0x50e751(0x1a8)]));}return 0x1;}const _0x4e0b17=_0xfbc01c[_0x50e751(0x1c0)][_0x50e751(0x1ab)][_0x50e751(0x15a)]+_0xfbc01c[_0x50e751(0x1c0)][_0x50e751(0x1bd)][_0x50e751(0x15a)]+_0xfbc01c[_0x50e751(0x1c0)][_0x50e751(0x1dc)][_0x50e751(0x15a)]+_0xfbc01c[_0x50e751(0x1c0)][_0x50e751(0x1a3)][_0x50e751(0x15a)]+_0xfbc01c[_0x50e751(0x1c0)][_0x50e751(0x1aa)][_0x50e751(0x15a)]+_0xfbc01c['counts'][_0x50e751(0x184)][_0x50e751(0x15a)]+_0xfbc01c['counts'][_0x50e751(0x1e0)][_0x50e751(0x15a)],_0x2f36ca=_0xfbc01c[_0x50e751(0x1c0)][_0x50e751(0x1ab)][_0x50e751(0x1f0)]+_0xfbc01c[_0x50e751(0x1c0)]['knowledgeBases']['updated']+_0xfbc01c[_0x50e751(0x1c0)][_0x50e751(0x1dc)][_0x50e751(0x1f0)]+_0xfbc01c[_0x50e751(0x1c0)][_0x50e751(0x1a3)]['updated']+_0xfbc01c[_0x50e751(0x1c0)][_0x50e751(0x1aa)][_0x50e751(0x1f0)]+_0xfbc01c[_0x50e751(0x1c0)]['experimentalKnowledgeBases']['updated']+_0xfbc01c[_0x50e751(0x1c0)][_0x50e751(0x1e0)][_0x50e751(0x1f0)],_0xc232e8=_0xfbc01c[_0x50e751(0x1c0)][_0x50e751(0x1ab)][_0x50e751(0x158)]+_0xfbc01c[_0x50e751(0x1c0)][_0x50e751(0x1bd)][_0x50e751(0x158)]+_0xfbc01c[_0x50e751(0x1c0)][_0x50e751(0x1dc)][_0x50e751(0x158)]+_0xfbc01c[_0x50e751(0x1c0)][_0x50e751(0x1a3)][_0x50e751(0x158)]+_0xfbc01c[_0x50e751(0x1c0)][_0x50e751(0x1aa)][_0x50e751(0x158)]+_0xfbc01c[_0x50e751(0x1c0)]['experimentalKnowledgeBases'][_0x50e751(0x158)]+_0xfbc01c[_0x50e751(0x1c0)]['experimentalArtifacts'][_0x50e751(0x158)];console[_0x50e751(0x1b2)](_0x50e751(0x1b6)+_0xfbc01c[_0x50e751(0x17f)]+'\x27:'),console['log']('\x20\x20'+a4_0x29ffea[_0x50e751(0x1f6)]('+\x20'+_0x4e0b17+_0x50e751(0x1f7))+_0x50e751(0x18b)+a4_0x29ffea['yellow']('~\x20'+_0x2f36ca+_0x50e751(0x171))+'\x20|\x20'+a4_0x29ffea[_0x50e751(0x186)]('=\x20'+_0xc232e8+_0x50e751(0x177))),console['log'](_0x50e751(0x183)+formatCountSummary(_0xfbc01c['counts'][_0x50e751(0x1ab)])),console[_0x50e751(0x1b2)](_0x50e751(0x166)+formatCountSummary(_0xfbc01c[_0x50e751(0x1c0)][_0x50e751(0x1bd)])),console['log'](_0x50e751(0x175)+formatCountSummary(_0xfbc01c['counts'][_0x50e751(0x1dc)])),console[_0x50e751(0x1b2)](_0x50e751(0x180)+formatCountSummary(_0xfbc01c[_0x50e751(0x1c0)][_0x50e751(0x1a3)])),console[_0x50e751(0x1b2)](_0x50e751(0x181)+formatCountSummary(_0xfbc01c[_0x50e751(0x1c0)][_0x50e751(0x1aa)]));const _0x61801c=_0xfbc01c[_0x50e751(0x1c0)][_0x50e751(0x184)][_0x50e751(0x15a)]>0x0||_0xfbc01c[_0x50e751(0x1c0)][_0x50e751(0x184)][_0x50e751(0x1f0)]>0x0||_0xfbc01c[_0x50e751(0x1c0)][_0x50e751(0x184)][_0x50e751(0x158)]>0x0||_0xfbc01c[_0x50e751(0x1c0)]['experimentalArtifacts']['created']>0x0||_0xfbc01c[_0x50e751(0x1c0)][_0x50e751(0x1e0)][_0x50e751(0x1f0)]>0x0||_0xfbc01c[_0x50e751(0x1c0)][_0x50e751(0x1e0)][_0x50e751(0x158)]>0x0;_0x61801c&&(console[_0x50e751(0x1b2)](_0x50e751(0x1c1)+formatCountSummary(_0xfbc01c[_0x50e751(0x1c0)][_0x50e751(0x184)])),console[_0x50e751(0x1b2)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0xfbc01c['counts']['experimentalArtifacts'])));console[_0x50e751(0x1b2)]('\x20\x20Source:\x20'+a4_0x29ffea[_0x50e751(0x1b1)](_0x2a3c26)),displayDiffs(_0xfbc01c[_0x50e751(0x1ab)],_0xfbc01c[_0x50e751(0x1bd)],_0xfbc01c[_0x50e751(0x1dc)],_0xfbc01c[_0x50e751(0x1a3)],_0xfbc01c['integrations'],_0xfbc01c[_0x50e751(0x184)],_0xfbc01c[_0x50e751(0x1e0)]);if(_0x2e288a)return console['log'](a4_0x29ffea[_0x50e751(0x167)](_0x50e751(0x182))),0x0;if(_0x4e0b17===0x0&&_0x2f36ca===0x0){console[_0x50e751(0x1b2)](a4_0x29ffea[_0x50e751(0x1f6)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x93f5f=getLLMProjectUrl(_0x23fef5,_0xfbc01c[_0x50e751(0x1b5)]);return console[_0x50e751(0x1b2)](_0x50e751(0x165)+a4_0x29ffea[_0x50e751(0x1b1)](_0x93f5f)),0x0;}if(!_0x52c4f3&&!_0x5250fe){if(!isInteractive())return console[_0x50e751(0x1a8)](a4_0x29ffea['red']('\x0aError:'),_0x50e751(0x176)),console[_0x50e751(0x1a8)](a4_0x29ffea[_0x50e751(0x186)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x3ba34d=await confirmKey('\x0aPush\x20'+(_0x4e0b17+_0x2f36ca)+'\x20resources?');if(!_0x3ba34d)return console[_0x50e751(0x1b2)](a4_0x29ffea[_0x50e751(0x167)](_0x50e751(0x1bc)),'-\x20nothing\x20pushed'),0x1;}const {data:_0x50c2c3}=await withSpinner(_0x50e751(0x162),()=>_0xeee452['llm']['pushProject'](_0x2a3c26,{'force':_0x5250fe})),_0x1107d3=_0x50c2c3['counts']['agents'][_0x50e751(0x199)]>0x0||_0x50c2c3[_0x50e751(0x1c0)][_0x50e751(0x1bd)][_0x50e751(0x199)]>0x0||_0x50c2c3[_0x50e751(0x1c0)][_0x50e751(0x1dc)][_0x50e751(0x199)]>0x0||_0x50c2c3[_0x50e751(0x1c0)][_0x50e751(0x1a3)][_0x50e751(0x199)]>0x0;if(_0x1107d3){console[_0x50e751(0x1b2)](a4_0x29ffea[_0x50e751(0x167)](_0x50e751(0x172))),console['log'](),console[_0x50e751(0x1b2)](a4_0x29ffea['red'](_0x50e751(0x1cf)));for(const _0x140ec5 of _0x50c2c3[_0x50e751(0x1ab)]){_0x140ec5[_0x50e751(0x197)]===_0x50e751(0x1a8)&&console[_0x50e751(0x1b2)](a4_0x29ffea[_0x50e751(0x174)](_0x50e751(0x1dd)+_0x140ec5[_0x50e751(0x190)]+_0x50e751(0x1da)+_0x140ec5[_0x50e751(0x1a8)]));}for(const _0xed01ca of _0x50c2c3[_0x50e751(0x1bd)]){_0xed01ca[_0x50e751(0x197)]===_0x50e751(0x1a8)&&console[_0x50e751(0x1b2)](a4_0x29ffea[_0x50e751(0x174)](_0x50e751(0x17a)+_0xed01ca[_0x50e751(0x16e)]+'\x22:\x20'+_0xed01ca['error']));}for(const _0x61dfa7 of _0x50c2c3[_0x50e751(0x1dc)]){_0x61dfa7[_0x50e751(0x197)]===_0x50e751(0x1a8)&&console[_0x50e751(0x1b2)](a4_0x29ffea[_0x50e751(0x174)](_0x50e751(0x160)+_0x61dfa7[_0x50e751(0x16e)]+_0x50e751(0x1da)+_0x61dfa7[_0x50e751(0x1a8)]));}for(const _0x62e3a4 of _0x50c2c3[_0x50e751(0x1a3)]){_0x62e3a4['action']===_0x50e751(0x1a8)&&console[_0x50e751(0x1b2)](a4_0x29ffea['red']('\x20\x20Prompt\x20\x22'+_0x62e3a4[_0x50e751(0x16e)]+_0x50e751(0x1da)+_0x62e3a4[_0x50e751(0x1a8)]));}for(const _0x6552fd of _0x50c2c3[_0x50e751(0x1aa)]){_0x6552fd[_0x50e751(0x197)]===_0x50e751(0x1a8)&&console['log'](a4_0x29ffea['red'](_0x50e751(0x1b7)+_0x6552fd[_0x50e751(0x16e)]+_0x50e751(0x1da)+_0x6552fd[_0x50e751(0x1a8)]));}return 0x1;}console[_0x50e751(0x1b2)](a4_0x29ffea[_0x50e751(0x1f6)](_0x50e751(0x1e8)+(_0x4e0b17+_0x2f36ca)+'\x20resources\x20to\x20\x27'+_0x50c2c3[_0x50e751(0x17f)]+'\x27'));const _0x3ac8a8=getLLMProjectUrl(_0x23fef5,_0x50c2c3[_0x50e751(0x1b5)]);return console[_0x50e751(0x1b2)]('Project:\x20'+a4_0x29ffea[_0x50e751(0x1b1)](_0x3ac8a8)),0x0;}}
|
|
1
|
+
const a4_0xdddc94=a4_0x1c1f;(function(_0x32fa1d,_0x3ba4d7){const _0x2b8cff=a4_0x1c1f,_0x438672=_0x32fa1d();while(!![]){try{const _0x108850=-parseInt(_0x2b8cff(0x244))/0x1+-parseInt(_0x2b8cff(0x1ce))/0x2*(-parseInt(_0x2b8cff(0x23a))/0x3)+-parseInt(_0x2b8cff(0x1ba))/0x4*(parseInt(_0x2b8cff(0x1c7))/0x5)+-parseInt(_0x2b8cff(0x1f8))/0x6*(parseInt(_0x2b8cff(0x251))/0x7)+parseInt(_0x2b8cff(0x1f5))/0x8*(-parseInt(_0x2b8cff(0x24d))/0x9)+parseInt(_0x2b8cff(0x1eb))/0xa*(-parseInt(_0x2b8cff(0x1b8))/0xb)+parseInt(_0x2b8cff(0x237))/0xc*(parseInt(_0x2b8cff(0x1c1))/0xd);if(_0x108850===_0x3ba4d7)break;else _0x438672['push'](_0x438672['shift']());}catch(_0x179ad0){_0x438672['push'](_0x438672['shift']());}}}(a4_0x1929,0xc797d));import a4_0x6bacc from'chalk';import a4_0x5584d4 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_0x1929(){const _0x4dd992=['Project\x20cloned\x20successfully','output','49LMcuPR','Using\x20context\x20project:\x20','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x20\x20Experimental\x20Artifact\x20\x22','\x22:\x20','\x0aErrors\x20found:','yes','projectName','experimentalKnowledgeBases','Using\x20project:\x20','\x20\x20Agent\x20\x22','site','\x20\x20Knowledge\x20Base\x20\x22','Using\x20current\x20project:\x20','\x0aProject\x20pushed\x20with\x20errors','pullProject','projectId','Would\x20push\x20agent:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Failed\x20to\x20push\x20agent:\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','dim','dirname','\x20=\x20','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','parse','\x20total','agent:push','prompts','\x0aPull\x20summary\x20for\x20\x27','14486714zExunz','red','1316MTnpof','\x20\x20Integration\x20\x22','description','name','\x20|\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','join','5525MJVrrL','agent:pull','\x20\x20Knowledge\x20Bases:\x20','Dry\x20run\x20-\x20no\x20changes\x20made','execute','\x20--name\x20','15085oUIcqL','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','outputDir','\x20successfully','updated','yellow','push','2522024mZHEMu','reason','\x20new','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','\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)','arg-dir','experimentalArtifacts','utf-8','gray','green','counts','Pulling\x20agent\x20\x22','integrations','\x20files?','repeat','Agent:\x20','created','Cancelled','profile','MISSING_ARGUMENT','\x0aPush\x20summary\x20for\x20\x27','\x20\x20Experimental\x20Artifacts:\x20','knowledgeBases','\x20files\x20to\x20','error','force','Errors:','pullAgent','new','10ILEDWL','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x20\x20Prompt\x20\x22','cyan','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','newProjectId','agentName','-\x20no\x20files\x20written','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','296RBuYze','\x20\x20Agents:\x20','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','235890iZpEKC','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','source','errors','\x22\x20to\x20\x22','Output\x20path:\x20','\x0a✔\x20Pushed\x20','cwd','-\x20nothing\x20pushed','\x0aChanges:','unchanged','\x20\x20Source:\x20','\x0aPush\x20','sourceProjectName','projectDir','Agent\x20','✔\x20Context\x20set:\x20','\x20resources\x20to\x20\x27','Would\x20clone:','\x20\x20Target:\x20','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','message','action','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)','INVALID_ARGUMENT','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','found','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','\x22\x20to\x20a\x20different\x20profile','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','context','\x20\x20Prompts:\x20','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x20changed','log','cloneProject','\x0aChanges\x20to\x20prompt\x20\x27','Agent\x20pulled\x20successfully','No\x20tdx.json\x20found\x20in\x20','outputPath','dryRun','New\x20project:\x20','\x20\x20Integrations:\x20','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x0aError:','\x20unchanged','\x20\x20Text\x20Knowledge\x20Base\x20\x22','New\x20project\x20name\x20is\x20required','Status:\x20','\x0aChanges\x20to\x20agent\x20\x27','llm','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','no_local_folder','\x22\x20from\x20project\x20\x22','agent.yml','diff','pushProject','\x20created','agentId','session','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','81912ZMjrwe','hasChanges','agents','3uLZOIg','textKnowledgeBases','Using\x20local\x20project:\x20','tdx.json','Cannot\x20clone\x20from\x20context\x20project\x20\x22','Output:\x20','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x0a✔\x20Pulled\x20','llm_project','Pushing\x20agent\x20from\x20\x22','360009VQXUPn','\x22...','Source:\x20','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','total','llmProject','\x20resources?','Writing\x20files...','Analyzing\x20project\x20\x22','97236NJlDNF','\x22\x20to\x20new\x20project\x20\x22'];a4_0x1929=function(){return _0x4dd992;};return a4_0x1929();}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(_0x28cd43){const _0x5189b9=a4_0x1c1f,_0x1e19b1=[];if(_0x28cd43[_0x5189b9(0x248)]!==undefined)_0x1e19b1[_0x5189b9(0x1cd)](_0x28cd43['total']+_0x5189b9(0x26b));if(_0x28cd43[_0x5189b9(0x1ea)]!==undefined&&_0x28cd43['new']>0x0)_0x1e19b1['push'](a4_0x6bacc[_0x5189b9(0x1d7)](_0x28cd43['new']+_0x5189b9(0x1d0)));if(_0x28cd43[_0x5189b9(0x1de)]!==undefined&&_0x28cd43[_0x5189b9(0x1de)]>0x0)_0x1e19b1[_0x5189b9(0x1cd)](a4_0x6bacc[_0x5189b9(0x1d7)](_0x28cd43['created']+_0x5189b9(0x232)));if(_0x28cd43['updated']!==undefined&&_0x28cd43[_0x5189b9(0x1cb)]>0x0)_0x1e19b1[_0x5189b9(0x1cd)](a4_0x6bacc['yellow'](_0x28cd43[_0x5189b9(0x1cb)]+'\x20updated'));if(_0x28cd43['unchanged']!==undefined&&_0x28cd43[_0x5189b9(0x202)]>0x0)_0x1e19b1[_0x5189b9(0x1cd)](a4_0x6bacc[_0x5189b9(0x1d6)](_0x28cd43['unchanged']+_0x5189b9(0x226)));if(_0x28cd43[_0x5189b9(0x1fb)]!==undefined&&_0x28cd43[_0x5189b9(0x1fb)]>0x0)_0x1e19b1['push'](a4_0x6bacc[_0x5189b9(0x1b9)](_0x28cd43[_0x5189b9(0x1fb)]+'\x20errors'));return _0x1e19b1[_0x5189b9(0x1c0)](',\x20');}function displayDiffs(_0x3cb820,_0x476105,_0x1451ff,_0x53e2bf,_0x47d790,_0x3e8629,_0x35fdf4){const _0x1ebc0b=a4_0x1c1f;for(const _0x408604 of _0x3cb820){if(_0x408604[_0x1ebc0b(0x230)]){const _0x159941=_0x408604['agentName']||_0x408604[_0x1ebc0b(0x1bd)];console['log'](_0x1ebc0b(0x22a)+_0x159941+'\x27:'),console[_0x1ebc0b(0x21b)]('─'['repeat'](0x3c)),console[_0x1ebc0b(0x21b)](_0x408604[_0x1ebc0b(0x230)]),console['log']('─'[_0x1ebc0b(0x1dc)](0x3c));}}for(const _0x3ae780 of _0x476105){_0x3ae780[_0x1ebc0b(0x230)]&&(console[_0x1ebc0b(0x21b)](_0x1ebc0b(0x219)+_0x3ae780[_0x1ebc0b(0x1bd)]+'\x27:'),console[_0x1ebc0b(0x21b)]('─'[_0x1ebc0b(0x1dc)](0x3c)),console[_0x1ebc0b(0x21b)](_0x3ae780['diff']),console[_0x1ebc0b(0x21b)]('─'[_0x1ebc0b(0x1dc)](0x3c)));}for(const _0x59c651 of _0x1451ff){_0x59c651[_0x1ebc0b(0x230)]&&(console[_0x1ebc0b(0x21b)]('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x59c651[_0x1ebc0b(0x1bd)]+'\x27:'),console[_0x1ebc0b(0x21b)]('─'[_0x1ebc0b(0x1dc)](0x3c)),console[_0x1ebc0b(0x21b)](_0x59c651[_0x1ebc0b(0x230)]),console[_0x1ebc0b(0x21b)]('─'['repeat'](0x3c)));}for(const _0x21232b of _0x53e2bf){_0x21232b[_0x1ebc0b(0x230)]&&(console['log'](_0x1ebc0b(0x21d)+_0x21232b['name']+'\x27:'),console[_0x1ebc0b(0x21b)]('─'[_0x1ebc0b(0x1dc)](0x3c)),console[_0x1ebc0b(0x21b)](_0x21232b[_0x1ebc0b(0x230)]),console[_0x1ebc0b(0x21b)]('─'[_0x1ebc0b(0x1dc)](0x3c)));}for(const _0x434374 of _0x47d790){_0x434374[_0x1ebc0b(0x230)]&&(console[_0x1ebc0b(0x21b)]('\x0aChanges\x20to\x20integration\x20\x27'+_0x434374[_0x1ebc0b(0x1bd)]+'\x27:'),console[_0x1ebc0b(0x21b)]('─'[_0x1ebc0b(0x1dc)](0x3c)),console[_0x1ebc0b(0x21b)](_0x434374[_0x1ebc0b(0x230)]),console['log']('─'[_0x1ebc0b(0x1dc)](0x3c)));}for(const _0x190e2c of _0x3e8629){_0x190e2c[_0x1ebc0b(0x230)]&&(console['log'](_0x1ebc0b(0x269)+_0x190e2c[_0x1ebc0b(0x1bd)]+'\x27:'),console['log']('─'[_0x1ebc0b(0x1dc)](0x3c)),console['log'](_0x190e2c[_0x1ebc0b(0x230)]),console[_0x1ebc0b(0x21b)]('─'[_0x1ebc0b(0x1dc)](0x3c)));}for(const _0x28d332 of _0x35fdf4){_0x28d332[_0x1ebc0b(0x230)]&&(console[_0x1ebc0b(0x21b)](_0x1ebc0b(0x22c)+_0x28d332['name']+'\x27:'),console[_0x1ebc0b(0x21b)]('─'[_0x1ebc0b(0x1dc)](0x3c)),console[_0x1ebc0b(0x21b)](_0x28d332[_0x1ebc0b(0x230)]),console[_0x1ebc0b(0x21b)]('─'[_0x1ebc0b(0x1dc)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0xdddc94(0x1bd)]=a4_0xdddc94(0x1c2);['description']=a4_0xdddc94(0x253);async[a4_0xdddc94(0x1c5)](_0x57fc58){const _0x185eb4=a4_0xdddc94,{options:_0x46f498,args:_0x296d9a,tdx:_0x1ed030}=_0x57fc58,_0x317b84=_0x296d9a[0x0],_0xb54777=_0x296d9a[0x1],_0x3f5a10=_0x46f498[_0x185eb4(0x250)],_0x2828b0=_0x46f498[_0x185eb4(0x221)],_0x4f638a=_0x46f498[_0x185eb4(0x1e7)],_0x38372c=_0x46f498[_0x185eb4(0x257)],_0x463943=_0x46f498[_0x185eb4(0x249)],_0x303e80=_0x46f498['agent'];let _0x77dea;if(_0x317b84){const _0x11a987=a4_0x5584d4['join'](_0x317b84,_0x185eb4(0x23d));if(existsSync(_0x11a987))try{const _0x2a3a48=JSON[_0x185eb4(0x26a)](readFileSync(_0x11a987,_0x185eb4(0x1d5)));_0x2a3a48[_0x185eb4(0x242)]&&(_0x77dea={'llm_project':_0x2a3a48[_0x185eb4(0x242)]});}catch{}}const _0x1ba6e5=findAgentConfigPath(process[_0x185eb4(0x1ff)]());let _0x5cdb38;if(_0x1ba6e5)try{const _0xdcc8d=JSON[_0x185eb4(0x26a)](readFileSync(_0x1ba6e5,'utf-8'));_0xdcc8d[_0x185eb4(0x242)]&&(_0x5cdb38={'llm_project':_0xdcc8d[_0x185eb4(0x242)]});}catch{}const _0x320d71=resolveAgentPullArgs({'arg':_0x317b84,'agentNameArg':_0xb54777,'agentFlag':_0x303e80,'contextProject':_0x463943,'argDirConfig':_0x77dea,'cwdConfigPath':_0x1ba6e5||undefined,'cwdConfig':_0x5cdb38}),{projectNameOrId:_0x21c1bf,targetAgentName:_0x10340b,existingOutputDir:_0x372b45,source:_0x34697c}=_0x320d71;if(_0x34697c===_0x185eb4(0x1d3))console['log'](a4_0x6bacc[_0x185eb4(0x266)]('Using\x20project\x20from\x20'+a4_0x5584d4['join'](_0x317b84,_0x185eb4(0x23d))+':\x20'+_0x21c1bf));else{if(_0x34697c==='cwd-config')console[_0x185eb4(0x21b)](a4_0x6bacc[_0x185eb4(0x266)](_0x185eb4(0x25a)+_0x21c1bf));else _0x34697c===_0x185eb4(0x217)&&console['log'](a4_0x6bacc['dim']('Using\x20project\x20from\x20context:\x20'+_0x21c1bf));}if(!_0x21c1bf)return _0x303e80?(console['log'](a4_0x6bacc[_0x185eb4(0x1cc)](_0x185eb4(0x214))),console[_0x185eb4(0x21b)](_0x185eb4(0x20c)),console['log'](_0x185eb4(0x1ef))):(console[_0x185eb4(0x21b)](a4_0x6bacc[_0x185eb4(0x1cc)](_0x185eb4(0x211))),console['log'](_0x185eb4(0x20f)),console[_0x185eb4(0x21b)](_0x185eb4(0x1f4)),console[_0x185eb4(0x21b)](_0x185eb4(0x1bf)),console[_0x185eb4(0x21b)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project'),console[_0x185eb4(0x21b)](_0x185eb4(0x235))),0x1;if(_0x10340b){const {data:_0x2abe3f}=await withSpinner(_0x185eb4(0x1d9)+_0x10340b+_0x185eb4(0x22e)+_0x21c1bf+_0x185eb4(0x245),()=>_0x1ed030[_0x185eb4(0x22b)][_0x185eb4(0x1e9)](_0x21c1bf,_0x10340b,_0x3f5a10,{'dryRun':_0x2828b0,'force':_0x4f638a}));if(_0x2828b0)return console[_0x185eb4(0x21b)](a4_0x6bacc[_0x185eb4(0x1cc)]('Dry\x20run\x20-\x20no\x20files\x20written')),console[_0x185eb4(0x21b)]('Would\x20pull\x20agent:\x20'+_0x2abe3f[_0x185eb4(0x1f1)]),console['log'](_0x185eb4(0x1fd)+_0x2abe3f[_0x185eb4(0x220)]),_0x2abe3f[_0x185eb4(0x230)]&&(console[_0x185eb4(0x21b)](_0x185eb4(0x201)),console[_0x185eb4(0x21b)]('─'[_0x185eb4(0x1dc)](0x3c)),console[_0x185eb4(0x21b)](_0x2abe3f['diff']),console[_0x185eb4(0x21b)]('─'[_0x185eb4(0x1dc)](0x3c))),0x0;return console['log'](a4_0x6bacc[_0x185eb4(0x1d7)](_0x185eb4(0x21e))),console[_0x185eb4(0x21b)](_0x185eb4(0x1dd)+_0x2abe3f[_0x185eb4(0x1f1)]),console[_0x185eb4(0x21b)](_0x185eb4(0x23f)+_0x2abe3f[_0x185eb4(0x220)]),console['log'](_0x185eb4(0x229)+(_0x2abe3f['isNew']?a4_0x6bacc[_0x185eb4(0x1d7)](_0x185eb4(0x1ea)):_0x2abe3f[_0x185eb4(0x238)]?a4_0x6bacc[_0x185eb4(0x1cc)](_0x185eb4(0x1cb)):a4_0x6bacc[_0x185eb4(0x1d6)](_0x185eb4(0x202)))),0x0;}const _0x1eb64e=_0x372b45||_0x3f5a10,{data:_0x36b5df}=await withSpinner(_0x185eb4(0x24c)+_0x21c1bf+_0x185eb4(0x245),()=>_0x1ed030[_0x185eb4(0x22b)][_0x185eb4(0x260)](_0x21c1bf,_0x1eb64e,{'dryRun':!![]})),_0x828f33=_0x36b5df['counts']['agents'][_0x185eb4(0x1ea)]+_0x36b5df[_0x185eb4(0x1d8)]['knowledgeBases'][_0x185eb4(0x1ea)]+_0x36b5df[_0x185eb4(0x1d8)][_0x185eb4(0x23b)][_0x185eb4(0x1ea)]+_0x36b5df[_0x185eb4(0x1d8)]['prompts'][_0x185eb4(0x1ea)]+_0x36b5df[_0x185eb4(0x1d8)]['integrations'][_0x185eb4(0x1ea)]+_0x36b5df[_0x185eb4(0x1d8)][_0x185eb4(0x259)][_0x185eb4(0x1ea)]+_0x36b5df[_0x185eb4(0x1d8)]['experimentalArtifacts'][_0x185eb4(0x1ea)],_0x5e0d3c=_0x36b5df[_0x185eb4(0x1d8)]['agents'][_0x185eb4(0x1cb)]+_0x36b5df[_0x185eb4(0x1d8)][_0x185eb4(0x1e4)]['updated']+_0x36b5df[_0x185eb4(0x1d8)][_0x185eb4(0x23b)][_0x185eb4(0x1cb)]+_0x36b5df['counts']['prompts']['updated']+_0x36b5df[_0x185eb4(0x1d8)][_0x185eb4(0x1da)][_0x185eb4(0x1cb)]+_0x36b5df[_0x185eb4(0x1d8)]['experimentalKnowledgeBases']['updated']+_0x36b5df[_0x185eb4(0x1d8)][_0x185eb4(0x1d4)][_0x185eb4(0x1cb)],_0x169f3b=_0x36b5df[_0x185eb4(0x1d8)][_0x185eb4(0x239)][_0x185eb4(0x202)]+_0x36b5df[_0x185eb4(0x1d8)][_0x185eb4(0x1e4)][_0x185eb4(0x202)]+_0x36b5df['counts'][_0x185eb4(0x23b)][_0x185eb4(0x202)]+_0x36b5df[_0x185eb4(0x1d8)][_0x185eb4(0x1b6)]['unchanged']+_0x36b5df[_0x185eb4(0x1d8)][_0x185eb4(0x1da)]['unchanged']+_0x36b5df[_0x185eb4(0x1d8)][_0x185eb4(0x259)][_0x185eb4(0x202)]+_0x36b5df['counts'][_0x185eb4(0x1d4)]['unchanged'];console[_0x185eb4(0x21b)](_0x185eb4(0x1b7)+_0x36b5df[_0x185eb4(0x258)]+'\x27:'),console[_0x185eb4(0x21b)]('\x20\x20'+a4_0x6bacc[_0x185eb4(0x1d7)]('+\x20'+_0x828f33+_0x185eb4(0x1d0))+_0x185eb4(0x1be)+a4_0x6bacc[_0x185eb4(0x1cc)]('~\x20'+_0x5e0d3c+_0x185eb4(0x21a))+_0x185eb4(0x1be)+a4_0x6bacc['dim']('=\x20'+_0x169f3b+_0x185eb4(0x226))),console['log'](_0x185eb4(0x1f6)+formatCountSummary(_0x36b5df[_0x185eb4(0x1d8)][_0x185eb4(0x239)])),console['log'](_0x185eb4(0x1c3)+formatCountSummary(_0x36b5df[_0x185eb4(0x1d8)][_0x185eb4(0x1e4)])),console[_0x185eb4(0x21b)](_0x185eb4(0x1f3)+formatCountSummary(_0x36b5df[_0x185eb4(0x1d8)][_0x185eb4(0x23b)])),console[_0x185eb4(0x21b)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x36b5df[_0x185eb4(0x1d8)][_0x185eb4(0x1b6)])),console[_0x185eb4(0x21b)](_0x185eb4(0x223)+formatCountSummary(_0x36b5df[_0x185eb4(0x1d8)]['integrations']));const _0xb6e778=_0x36b5df[_0x185eb4(0x1d8)][_0x185eb4(0x259)][_0x185eb4(0x248)]>0x0||_0x36b5df['counts'][_0x185eb4(0x1d4)][_0x185eb4(0x248)]>0x0;_0xb6e778&&(console[_0x185eb4(0x21b)](_0x185eb4(0x236)+formatCountSummary(_0x36b5df[_0x185eb4(0x1d8)][_0x185eb4(0x259)])),console[_0x185eb4(0x21b)](_0x185eb4(0x1e3)+formatCountSummary(_0x36b5df[_0x185eb4(0x1d8)]['experimentalArtifacts'])));console['log'](_0x185eb4(0x20b)+a4_0x6bacc['cyan'](_0x36b5df[_0x185eb4(0x1c9)])),displayDiffs(_0x36b5df[_0x185eb4(0x239)],_0x36b5df['knowledgeBases'],_0x36b5df[_0x185eb4(0x23b)],_0x36b5df[_0x185eb4(0x1b6)],_0x36b5df[_0x185eb4(0x1da)],_0x36b5df[_0x185eb4(0x259)],_0x36b5df[_0x185eb4(0x1d4)]);if(_0x2828b0)return console[_0x185eb4(0x21b)](a4_0x6bacc['yellow']('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x828f33===0x0&&_0x5e0d3c===0x0)return console[_0x185eb4(0x21b)](a4_0x6bacc[_0x185eb4(0x1d7)](_0x185eb4(0x1d1))),saveSessionContext({'llm_project':_0x36b5df[_0x185eb4(0x258)]},_0x46f498[_0x185eb4(0x234)]),console[_0x185eb4(0x21b)](a4_0x6bacc[_0x185eb4(0x1d7)]('✔\x20Context\x20set:\x20'+a4_0x6bacc[_0x185eb4(0x266)]('llm_project')+_0x185eb4(0x268)+a4_0x6bacc['cyan'](_0x36b5df[_0x185eb4(0x258)]))),0x0;if(!_0x38372c&&!_0x4f638a){if(!isInteractive())return console[_0x185eb4(0x1e6)](a4_0x6bacc['red'](_0x185eb4(0x225)),_0x185eb4(0x263)),console[_0x185eb4(0x1e6)](a4_0x6bacc[_0x185eb4(0x266)](_0x185eb4(0x1f9))),0x1;const _0x5458a5=await confirmKey('\x0aWrite\x20'+(_0x828f33+_0x5e0d3c)+_0x185eb4(0x1db));if(!_0x5458a5)return console[_0x185eb4(0x21b)](a4_0x6bacc[_0x185eb4(0x1cc)](_0x185eb4(0x1df)),_0x185eb4(0x1f2)),0x1;}const {data:_0x1e13f0}=await withSpinner(_0x185eb4(0x24b),()=>_0x1ed030['llm'][_0x185eb4(0x260)](_0x21c1bf,_0x1eb64e,{'force':_0x4f638a}));return console[_0x185eb4(0x21b)](a4_0x6bacc['green'](_0x185eb4(0x241)+(_0x828f33+_0x5e0d3c)+_0x185eb4(0x1e5)+_0x1e13f0[_0x185eb4(0x1c9)])),saveSessionContext({'llm_project':_0x1e13f0[_0x185eb4(0x258)]},_0x46f498[_0x185eb4(0x234)]),console[_0x185eb4(0x21b)](a4_0x6bacc['green'](_0x185eb4(0x208)+a4_0x6bacc[_0x185eb4(0x266)](_0x185eb4(0x242))+_0x185eb4(0x268)+a4_0x6bacc[_0x185eb4(0x1ee)](_0x1e13f0['projectName']))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0xdddc94(0x1bd)]='agent:clone';[a4_0xdddc94(0x1bc)]=a4_0xdddc94(0x240);async[a4_0xdddc94(0x1c5)](_0x32a1f1){const _0x533782=a4_0xdddc94,{options:_0x4bf4ce,args:_0x437ecd,tdx:_0x46bd14}=_0x32a1f1,_0x3e7ac7=_0x437ecd[0x0],_0x378569=_0x4bf4ce[_0x533782(0x1bd)],_0x4c329f=_0x4bf4ce['dryRun'],_0xcf54c0=_0x4bf4ce['yes'],_0x1b629a=_0x4bf4ce['site'],_0x448b62=_0x4bf4ce[_0x533782(0x249)];let _0xc5a795;const _0x36aaec=findAgentConfigPath(process[_0x533782(0x1ff)]());if(_0x3e7ac7){const _0x1fae2b=a4_0x5584d4[_0x533782(0x1c0)](_0x3e7ac7,_0x533782(0x23d));existsSync(_0x1fae2b)?(_0xc5a795=_0x3e7ac7,console[_0x533782(0x21b)](a4_0x6bacc['dim'](_0x533782(0x23c)+_0x3e7ac7))):_0xc5a795=_0x3e7ac7;}else{if(_0x36aaec)_0xc5a795=a4_0x5584d4[_0x533782(0x267)](_0x36aaec),console[_0x533782(0x21b)](a4_0x6bacc[_0x533782(0x266)](_0x533782(0x25e)+_0xc5a795));else{if(_0x448b62){const _0x297bb2=sanitizeForFilesystem(_0x448b62);let _0x3f198e=_0x297bb2,_0x2e84c1=a4_0x5584d4[_0x533782(0x1c0)](process[_0x533782(0x1ff)](),'agents',_0x297bb2,_0x533782(0x23d));if(!existsSync(_0x2e84c1)){const _0x2bd2e0=normalizeName(_0x448b62),_0x59f2a5=a4_0x5584d4[_0x533782(0x1c0)](process['cwd'](),_0x533782(0x239),_0x2bd2e0,_0x533782(0x23d));existsSync(_0x59f2a5)&&(_0x3f198e=_0x2bd2e0,_0x2e84c1=_0x59f2a5);}if(existsSync(_0x2e84c1))_0xc5a795=a4_0x5584d4[_0x533782(0x267)](_0x2e84c1),console[_0x533782(0x21b)](a4_0x6bacc[_0x533782(0x266)](_0x533782(0x23c)+_0xc5a795));else{const _0x1a429e=_0x4bf4ce[_0x533782(0x1e0)];if(_0x1a429e)throw new SDKError(ErrorCode[_0x533782(0x210)],_0x533782(0x23e)+_0x448b62+_0x533782(0x215),undefined,{'helpText':'When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a'+_0x533782(0x224)+('\x20\x20tdx\x20agent\x20pull\x20'+_0x448b62+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x3f198e+_0x533782(0x1c6)+(_0x378569||'<new-name>')+'\x20--profile\x20'+_0x1a429e)});_0xc5a795=_0x448b62,console[_0x533782(0x21b)](a4_0x6bacc[_0x533782(0x266)](_0x533782(0x252)+_0x448b62));}}}}if(!_0xc5a795)return console['log'](a4_0x6bacc[_0x533782(0x1cc)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x533782(0x21b)](_0x533782(0x1f7)),console[_0x533782(0x21b)](_0x533782(0x1c8)),console[_0x533782(0x21b)](_0x533782(0x1d2)),console[_0x533782(0x21b)](_0x533782(0x247)),0x1;if(!_0x378569)throw new SDKError(ErrorCode[_0x533782(0x1e1)],_0x533782(0x228),undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0xcf54c0&&!_0x4c329f){if(!isInteractive())return console[_0x533782(0x1e6)](a4_0x6bacc[_0x533782(0x1b9)](_0x533782(0x225)),_0x533782(0x263)),console[_0x533782(0x1e6)](a4_0x6bacc[_0x533782(0x266)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0xef42=await confirmKey('Clone\x20\x22'+_0xc5a795+_0x533782(0x24e)+_0x378569+'\x22?');if(!_0xef42)return console[_0x533782(0x21b)](a4_0x6bacc['yellow']('Cancelled')),0x1;}const {data:_0x1d1731}=await withSpinner('Cloning\x20\x22'+_0xc5a795+_0x533782(0x1fc)+_0x378569+'\x22...',()=>_0x46bd14[_0x533782(0x22b)][_0x533782(0x21c)](_0xc5a795,_0x378569,{'dryRun':_0x4c329f}));if(_0x4c329f){console[_0x533782(0x21b)](a4_0x6bacc[_0x533782(0x1cc)](_0x533782(0x1c4))),console[_0x533782(0x21b)]('Source:\x20'+_0x1d1731['sourceProjectName']),console[_0x533782(0x21b)](_0x533782(0x222)+_0x378569),console[_0x533782(0x21b)](_0x533782(0x20a)),console['log'](_0x533782(0x1f6)+_0x1d1731['counts'][_0x533782(0x239)][_0x533782(0x1de)]),console[_0x533782(0x21b)]('\x20\x20Knowledge\x20Bases:\x20'+_0x1d1731[_0x533782(0x1d8)][_0x533782(0x1e4)]['created']),console[_0x533782(0x21b)](_0x533782(0x218)+_0x1d1731[_0x533782(0x1d8)][_0x533782(0x1b6)][_0x533782(0x1de)]);const _0x6fcf5f=_0x1d1731[_0x533782(0x1d8)][_0x533782(0x259)]['created']>0x0||_0x1d1731[_0x533782(0x1d8)]['experimentalArtifacts'][_0x533782(0x1de)]>0x0;return _0x6fcf5f&&(console[_0x533782(0x21b)](_0x533782(0x236)+_0x1d1731[_0x533782(0x1d8)][_0x533782(0x259)][_0x533782(0x1de)]),console[_0x533782(0x21b)](_0x533782(0x1e3)+_0x1d1731[_0x533782(0x1d8)]['experimentalArtifacts'][_0x533782(0x1de)])),0x0;}const _0x109f5d=_0x1d1731[_0x533782(0x1d8)][_0x533782(0x239)][_0x533782(0x1fb)]>0x0||_0x1d1731[_0x533782(0x1d8)]['knowledgeBases']['errors']>0x0||_0x1d1731[_0x533782(0x1d8)][_0x533782(0x1b6)][_0x533782(0x1fb)]>0x0||_0x1d1731['counts'][_0x533782(0x259)][_0x533782(0x1fb)]>0x0||_0x1d1731[_0x533782(0x1d8)][_0x533782(0x1d4)][_0x533782(0x1fb)]>0x0;_0x109f5d?console[_0x533782(0x21b)](a4_0x6bacc[_0x533782(0x1cc)]('Project\x20cloned\x20with\x20errors')):console[_0x533782(0x21b)](a4_0x6bacc[_0x533782(0x1d7)](_0x533782(0x24f)));console['log'](_0x533782(0x246)+_0x1d1731[_0x533782(0x205)]),console[_0x533782(0x21b)]('New\x20project:\x20'+_0x1d1731['newProjectName']),console['log']('New\x20project\x20ID:\x20'+_0x1d1731[_0x533782(0x1f0)]),console[_0x533782(0x21b)](),console[_0x533782(0x21b)]('Summary:'),console[_0x533782(0x21b)](_0x533782(0x1f6)+formatCountSummary(_0x1d1731[_0x533782(0x1d8)][_0x533782(0x239)])),console[_0x533782(0x21b)](_0x533782(0x1c3)+formatCountSummary(_0x1d1731[_0x533782(0x1d8)][_0x533782(0x1e4)])),console['log'](_0x533782(0x218)+formatCountSummary(_0x1d1731[_0x533782(0x1d8)][_0x533782(0x1b6)])),console[_0x533782(0x21b)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x1d1731[_0x533782(0x1d8)][_0x533782(0x1da)]));const _0x34f967=_0x1d1731[_0x533782(0x1d8)]['experimentalKnowledgeBases'][_0x533782(0x1de)]>0x0||_0x1d1731[_0x533782(0x1d8)]['experimentalKnowledgeBases'][_0x533782(0x1cb)]>0x0||_0x1d1731['counts']['experimentalKnowledgeBases'][_0x533782(0x202)]>0x0||_0x1d1731[_0x533782(0x1d8)][_0x533782(0x1d4)][_0x533782(0x1de)]>0x0||_0x1d1731['counts'][_0x533782(0x1d4)][_0x533782(0x1cb)]>0x0||_0x1d1731[_0x533782(0x1d8)][_0x533782(0x1d4)][_0x533782(0x202)]>0x0;_0x34f967&&(console[_0x533782(0x21b)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x1d1731[_0x533782(0x1d8)][_0x533782(0x259)])),console[_0x533782(0x21b)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x1d1731['counts']['experimentalArtifacts'])));if(_0x109f5d){console['log'](),console[_0x533782(0x21b)](a4_0x6bacc[_0x533782(0x1b9)](_0x533782(0x1e8)));for(const _0x2541b3 of _0x1d1731['agents']){_0x2541b3[_0x533782(0x20e)]===_0x533782(0x1e6)&&console[_0x533782(0x21b)](a4_0x6bacc[_0x533782(0x1b9)](_0x533782(0x25b)+_0x2541b3['agentName']+_0x533782(0x255)+_0x2541b3[_0x533782(0x1e6)]));}for(const _0x3a98d1 of _0x1d1731[_0x533782(0x1e4)]){_0x3a98d1[_0x533782(0x20e)]===_0x533782(0x1e6)&&console[_0x533782(0x21b)](a4_0x6bacc['red']('\x20\x20Knowledge\x20Base\x20\x22'+_0x3a98d1[_0x533782(0x1bd)]+_0x533782(0x255)+_0x3a98d1[_0x533782(0x1e6)]));}for(const _0xd628fa of _0x1d1731[_0x533782(0x1b6)]){_0xd628fa[_0x533782(0x20e)]===_0x533782(0x1e6)&&console[_0x533782(0x21b)](a4_0x6bacc[_0x533782(0x1b9)](_0x533782(0x1ed)+_0xd628fa[_0x533782(0x1bd)]+_0x533782(0x255)+_0xd628fa['error']));}for(const _0x468f3d of _0x1d1731[_0x533782(0x1da)]){_0x468f3d[_0x533782(0x20e)]===_0x533782(0x1e6)&&console[_0x533782(0x21b)](a4_0x6bacc[_0x533782(0x1b9)](_0x533782(0x1bb)+_0x468f3d['name']+'\x22:\x20'+_0x468f3d[_0x533782(0x1e6)]));}for(const _0x4d54d0 of _0x1d1731[_0x533782(0x259)]){_0x4d54d0[_0x533782(0x20e)]===_0x533782(0x1e6)&&console[_0x533782(0x21b)](a4_0x6bacc[_0x533782(0x1b9)](_0x533782(0x216)+_0x4d54d0['name']+'\x22:\x20'+_0x4d54d0[_0x533782(0x1e6)]));}for(const _0xaf3eae of _0x1d1731['experimentalArtifacts']){_0xaf3eae[_0x533782(0x20e)]===_0x533782(0x1e6)&&console[_0x533782(0x21b)](a4_0x6bacc[_0x533782(0x1b9)](_0x533782(0x254)+_0xaf3eae[_0x533782(0x1bd)]+'\x22:\x20'+_0xaf3eae['error']));}return 0x1;}console['log']();const _0x62cebc=getLLMProjectUrl(_0x1b629a,_0x1d1731['newProjectId']);return console[_0x533782(0x21b)]('Project:\x20'+a4_0x6bacc['cyan'](_0x62cebc)),0x0;}}function a4_0x1c1f(_0x30128f,_0x259904){_0x30128f=_0x30128f-0x1b6;const _0x1929e7=a4_0x1929();let _0x1c1ffe=_0x1929e7[_0x30128f];return _0x1c1ffe;}export class AgentPushCommand extends BaseCommand{['name']=a4_0xdddc94(0x26c);[a4_0xdddc94(0x1bc)]=a4_0xdddc94(0x1ec);async[a4_0xdddc94(0x1c5)](_0x440da0){const _0x381d9e=a4_0xdddc94,{options:_0x36f36a,args:_0x3ca19b,tdx:_0xdc8a1c}=_0x440da0;let _0x4a94ba=_0x3ca19b[0x0]||process['cwd']();const _0x284615=_0x36f36a[_0x381d9e(0x221)],_0x470925=_0x36f36a[_0x381d9e(0x1e7)],_0x37a0e6=_0x36f36a['yes'],_0x34a065=_0x36f36a[_0x381d9e(0x25c)],_0x1ee1ff=a4_0x5584d4['join'](_0x4a94ba,_0x381d9e(0x22f)),_0x416f6f=existsSync(_0x1ee1ff);if(_0x416f6f){const {data:_0x1d4b2f}=await withSpinner(_0x381d9e(0x243)+_0x4a94ba+'\x22...',()=>_0xdc8a1c[_0x381d9e(0x22b)]['pushAgent'](_0x4a94ba,{'dryRun':_0x284615,'force':_0x470925}));if(_0x284615)return console[_0x381d9e(0x21b)](a4_0x6bacc[_0x381d9e(0x1cc)](_0x381d9e(0x1c4))),console[_0x381d9e(0x21b)](_0x381d9e(0x262)+_0x1d4b2f[_0x381d9e(0x1f1)]),0x0;if(_0x1d4b2f[_0x381d9e(0x20e)]===_0x381d9e(0x1e6))return console[_0x381d9e(0x21b)](a4_0x6bacc[_0x381d9e(0x1b9)](_0x381d9e(0x264)+_0x1d4b2f[_0x381d9e(0x1e6)])),0x1;console[_0x381d9e(0x21b)](a4_0x6bacc[_0x381d9e(0x1d7)](_0x381d9e(0x207)+_0x1d4b2f[_0x381d9e(0x20e)]+_0x381d9e(0x1ca))),console[_0x381d9e(0x21b)](_0x381d9e(0x1dd)+_0x1d4b2f[_0x381d9e(0x1f1)]);if(_0x1d4b2f['agentId']&&_0x1d4b2f[_0x381d9e(0x261)]){const _0xf7daa5=getLLMAgentChatUrl(_0x34a065,_0x1d4b2f[_0x381d9e(0x261)],_0x1d4b2f[_0x381d9e(0x233)]);console['log']('Chat:\x20'+a4_0x6bacc[_0x381d9e(0x1ee)](_0xf7daa5));}return 0x0;}const _0xb03ff3=_0x36f36a[_0x381d9e(0x249)],_0x53ae73=resolveProjectFromContext(_0x4a94ba,_0xb03ff3);if(_0x53ae73[_0x381d9e(0x212)])_0x4a94ba=_0x53ae73[_0x381d9e(0x206)],_0x53ae73[_0x381d9e(0x1fa)]==='context'&&console['log'](a4_0x6bacc[_0x381d9e(0x266)](_0x381d9e(0x25a)+_0x4a94ba));else{let _0x342dae='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x53ae73[_0x381d9e(0x1cf)]===_0x381d9e(0x22d)&&(_0x342dae=_0x53ae73[_0x381d9e(0x20d)]+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x53ae73[_0x381d9e(0x249)]+_0x381d9e(0x265));throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x53ae73[_0x381d9e(0x1cf)]==='no_context'?_0x53ae73[_0x381d9e(0x20d)]:_0x381d9e(0x21f)+_0x4a94ba,undefined,{'helpText':_0x342dae});}const {data:_0x20598e}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0xdc8a1c[_0x381d9e(0x22b)][_0x381d9e(0x231)](_0x4a94ba,{'dryRun':!![]})),_0x589bd5=_0x20598e['counts'][_0x381d9e(0x239)][_0x381d9e(0x1fb)]>0x0;if(_0x589bd5){console['log'](a4_0x6bacc[_0x381d9e(0x1b9)](_0x381d9e(0x256)));for(const _0x3cab0e of _0x20598e[_0x381d9e(0x239)]){_0x3cab0e[_0x381d9e(0x20e)]==='error'&&console['log'](a4_0x6bacc[_0x381d9e(0x1b9)](_0x381d9e(0x25b)+_0x3cab0e[_0x381d9e(0x1f1)]+_0x381d9e(0x255)+_0x3cab0e[_0x381d9e(0x1e6)]));}return 0x1;}const _0xe708c6=_0x20598e[_0x381d9e(0x1d8)][_0x381d9e(0x239)]['created']+_0x20598e['counts'][_0x381d9e(0x1e4)]['created']+_0x20598e['counts'][_0x381d9e(0x23b)][_0x381d9e(0x1de)]+_0x20598e['counts'][_0x381d9e(0x1b6)]['created']+_0x20598e[_0x381d9e(0x1d8)]['integrations'][_0x381d9e(0x1de)]+_0x20598e['counts'][_0x381d9e(0x259)]['created']+_0x20598e[_0x381d9e(0x1d8)][_0x381d9e(0x1d4)]['created'],_0x2624b6=_0x20598e[_0x381d9e(0x1d8)][_0x381d9e(0x239)][_0x381d9e(0x1cb)]+_0x20598e[_0x381d9e(0x1d8)][_0x381d9e(0x1e4)][_0x381d9e(0x1cb)]+_0x20598e[_0x381d9e(0x1d8)][_0x381d9e(0x23b)][_0x381d9e(0x1cb)]+_0x20598e[_0x381d9e(0x1d8)][_0x381d9e(0x1b6)]['updated']+_0x20598e['counts'][_0x381d9e(0x1da)][_0x381d9e(0x1cb)]+_0x20598e['counts'][_0x381d9e(0x259)][_0x381d9e(0x1cb)]+_0x20598e[_0x381d9e(0x1d8)]['experimentalArtifacts'][_0x381d9e(0x1cb)],_0x101d68=_0x20598e[_0x381d9e(0x1d8)]['agents'][_0x381d9e(0x202)]+_0x20598e[_0x381d9e(0x1d8)][_0x381d9e(0x1e4)]['unchanged']+_0x20598e['counts'][_0x381d9e(0x23b)]['unchanged']+_0x20598e['counts'][_0x381d9e(0x1b6)][_0x381d9e(0x202)]+_0x20598e['counts'][_0x381d9e(0x1da)][_0x381d9e(0x202)]+_0x20598e[_0x381d9e(0x1d8)][_0x381d9e(0x259)]['unchanged']+_0x20598e['counts'][_0x381d9e(0x1d4)][_0x381d9e(0x202)];console[_0x381d9e(0x21b)](_0x381d9e(0x1e2)+_0x20598e[_0x381d9e(0x258)]+'\x27:'),console['log']('\x20\x20'+a4_0x6bacc[_0x381d9e(0x1d7)]('+\x20'+_0xe708c6+_0x381d9e(0x1d0))+_0x381d9e(0x1be)+a4_0x6bacc[_0x381d9e(0x1cc)]('~\x20'+_0x2624b6+'\x20changed')+_0x381d9e(0x1be)+a4_0x6bacc[_0x381d9e(0x266)]('=\x20'+_0x101d68+_0x381d9e(0x226))),console[_0x381d9e(0x21b)]('\x20\x20Agents:\x20'+formatCountSummary(_0x20598e[_0x381d9e(0x1d8)][_0x381d9e(0x239)])),console[_0x381d9e(0x21b)](_0x381d9e(0x1c3)+formatCountSummary(_0x20598e[_0x381d9e(0x1d8)]['knowledgeBases'])),console['log'](_0x381d9e(0x1f3)+formatCountSummary(_0x20598e['counts'][_0x381d9e(0x23b)])),console[_0x381d9e(0x21b)](_0x381d9e(0x218)+formatCountSummary(_0x20598e['counts'][_0x381d9e(0x1b6)])),console[_0x381d9e(0x21b)](_0x381d9e(0x223)+formatCountSummary(_0x20598e[_0x381d9e(0x1d8)][_0x381d9e(0x1da)]));const _0x22da06=_0x20598e[_0x381d9e(0x1d8)]['experimentalKnowledgeBases'][_0x381d9e(0x1de)]>0x0||_0x20598e[_0x381d9e(0x1d8)][_0x381d9e(0x259)][_0x381d9e(0x1cb)]>0x0||_0x20598e['counts'][_0x381d9e(0x259)]['unchanged']>0x0||_0x20598e[_0x381d9e(0x1d8)][_0x381d9e(0x1d4)]['created']>0x0||_0x20598e[_0x381d9e(0x1d8)][_0x381d9e(0x1d4)][_0x381d9e(0x1cb)]>0x0||_0x20598e['counts'][_0x381d9e(0x1d4)][_0x381d9e(0x202)]>0x0;_0x22da06&&(console[_0x381d9e(0x21b)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x20598e['counts']['experimentalKnowledgeBases'])),console[_0x381d9e(0x21b)](_0x381d9e(0x1e3)+formatCountSummary(_0x20598e[_0x381d9e(0x1d8)][_0x381d9e(0x1d4)])));console[_0x381d9e(0x21b)](_0x381d9e(0x203)+a4_0x6bacc[_0x381d9e(0x1ee)](_0x4a94ba)),displayDiffs(_0x20598e[_0x381d9e(0x239)],_0x20598e[_0x381d9e(0x1e4)],_0x20598e[_0x381d9e(0x23b)],_0x20598e['prompts'],_0x20598e[_0x381d9e(0x1da)],_0x20598e[_0x381d9e(0x259)],_0x20598e[_0x381d9e(0x1d4)]);if(_0x284615)return console[_0x381d9e(0x21b)](a4_0x6bacc[_0x381d9e(0x1cc)](_0x381d9e(0x213))),0x0;if(_0xe708c6===0x0&&_0x2624b6===0x0){console[_0x381d9e(0x21b)](a4_0x6bacc['green']('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x26b863=getLLMProjectUrl(_0x34a065,_0x20598e['projectId']);return console[_0x381d9e(0x21b)]('Project:\x20'+a4_0x6bacc[_0x381d9e(0x1ee)](_0x26b863)),0x0;}if(!_0x37a0e6&&!_0x470925){if(!isInteractive())return console[_0x381d9e(0x1e6)](a4_0x6bacc['red'](_0x381d9e(0x225)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x381d9e(0x1e6)](a4_0x6bacc[_0x381d9e(0x266)](_0x381d9e(0x1f9))),0x1;const _0x5a7a7b=await confirmKey(_0x381d9e(0x204)+(_0xe708c6+_0x2624b6)+_0x381d9e(0x24a));if(!_0x5a7a7b)return console[_0x381d9e(0x21b)](a4_0x6bacc[_0x381d9e(0x1cc)](_0x381d9e(0x1df)),_0x381d9e(0x200)),0x1;}const {data:_0x24d48f}=await withSpinner('Pushing\x20to\x20project...',()=>_0xdc8a1c[_0x381d9e(0x22b)]['pushProject'](_0x4a94ba,{'force':_0x470925})),_0x461485=_0x24d48f[_0x381d9e(0x1d8)][_0x381d9e(0x239)]['errors']>0x0||_0x24d48f[_0x381d9e(0x1d8)]['knowledgeBases']['errors']>0x0||_0x24d48f[_0x381d9e(0x1d8)][_0x381d9e(0x23b)][_0x381d9e(0x1fb)]>0x0||_0x24d48f[_0x381d9e(0x1d8)][_0x381d9e(0x1b6)][_0x381d9e(0x1fb)]>0x0;if(_0x461485){console[_0x381d9e(0x21b)](a4_0x6bacc[_0x381d9e(0x1cc)](_0x381d9e(0x25f))),console['log'](),console['log'](a4_0x6bacc[_0x381d9e(0x1b9)](_0x381d9e(0x1e8)));for(const _0x277e25 of _0x24d48f[_0x381d9e(0x239)]){_0x277e25[_0x381d9e(0x20e)]==='error'&&console[_0x381d9e(0x21b)](a4_0x6bacc[_0x381d9e(0x1b9)](_0x381d9e(0x25b)+_0x277e25['agentName']+_0x381d9e(0x255)+_0x277e25[_0x381d9e(0x1e6)]));}for(const _0x2b8679 of _0x24d48f[_0x381d9e(0x1e4)]){_0x2b8679['action']===_0x381d9e(0x1e6)&&console['log'](a4_0x6bacc[_0x381d9e(0x1b9)](_0x381d9e(0x25d)+_0x2b8679['name']+_0x381d9e(0x255)+_0x2b8679[_0x381d9e(0x1e6)]));}for(const _0xf130d2 of _0x24d48f[_0x381d9e(0x23b)]){_0xf130d2[_0x381d9e(0x20e)]==='error'&&console[_0x381d9e(0x21b)](a4_0x6bacc[_0x381d9e(0x1b9)](_0x381d9e(0x227)+_0xf130d2[_0x381d9e(0x1bd)]+'\x22:\x20'+_0xf130d2[_0x381d9e(0x1e6)]));}for(const _0xe918ed of _0x24d48f[_0x381d9e(0x1b6)]){_0xe918ed[_0x381d9e(0x20e)]==='error'&&console[_0x381d9e(0x21b)](a4_0x6bacc[_0x381d9e(0x1b9)](_0x381d9e(0x1ed)+_0xe918ed['name']+'\x22:\x20'+_0xe918ed['error']));}for(const _0x2d9e1a of _0x24d48f['integrations']){_0x2d9e1a[_0x381d9e(0x20e)]==='error'&&console[_0x381d9e(0x21b)](a4_0x6bacc[_0x381d9e(0x1b9)](_0x381d9e(0x1bb)+_0x2d9e1a[_0x381d9e(0x1bd)]+'\x22:\x20'+_0x2d9e1a['error']));}return 0x1;}console[_0x381d9e(0x21b)](a4_0x6bacc[_0x381d9e(0x1d7)](_0x381d9e(0x1fe)+(_0xe708c6+_0x2624b6)+_0x381d9e(0x209)+_0x24d48f[_0x381d9e(0x258)]+'\x27'));const _0x2127bc=getLLMProjectUrl(_0x34a065,_0x24d48f['projectId']);return console[_0x381d9e(0x21b)]('Project:\x20'+a4_0x6bacc[_0x381d9e(0x1ee)](_0x2127bc)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x4c4efc=a5_0x2d9a;(function(_0x13cb94,_0x291cf8){const _0x1a583b=a5_0x2d9a,_0x4e1c0d=_0x13cb94();while(!![]){try{const _0x3e6083=parseInt(_0x1a583b(0x155))/0x1+parseInt(_0x1a583b(0x139))/0x2*(-parseInt(_0x1a583b(0x148))/0x3)+-parseInt(_0x1a583b(0x16f))/0x4+parseInt(_0x1a583b(0x156))/0x5+parseInt(_0x1a583b(0x166))/0x6+parseInt(_0x1a583b(0x123))/0x7+-parseInt(_0x1a583b(0x12f))/0x8*(-parseInt(_0x1a583b(0x163))/0x9);if(_0x3e6083===_0x291cf8)break;else _0x4e1c0d['push'](_0x4e1c0d['shift']());}catch(_0x2c01f4){_0x4e1c0d['push'](_0x4e1c0d['shift']());}}}(a5_0x21bd,0x57e3e));function a5_0x2d9a(_0x30a00c,_0x5a6e32){_0x30a00c=_0x30a00c-0x102;const _0x21bd57=a5_0x21bd();let _0x2d9a31=_0x21bd57[_0x30a00c];return _0x2d9a31;}import*as a5_0x176059 from'node:fs';import*as a5_0x2ff967 from'node:path';import a5_0x5797fc from'chalk';function a5_0x21bd(){const _0x164d5a=['cyan','map','agent','projectDir','green','split','resolveAgentId','Evaluating\x20response...','Duration:\x20','now','llm','filter','Site:\x20','rounds','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','start','includes','timestamp','add','text','Failed\x20Tests:','✗\x20FAIL:\x20','Usage:','found','projectName','Re-evaluating\x20cached\x20test\x20run...','Executing\x20new\x20tests...','table','⚠\x20SKIPPED:\x20','has','404','trim','toLowerCase','size','\x20\x20Project:\x20','existsSync','/<agent-name>','log','Test\x20Summary','\x20\x20-\x20','Test\x20','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','testYmlPath','Project\x20path:\x20','Re-evaluation\x20Summary','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22',':\x20Sending\x20user\x20input...','\x20\x20Conversation:\x20','tests','join','message','Available\x20tags:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)','tsv','\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','Using\x20agent:\x20','ERROR','Total:\x20\x20\x20\x20','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','4775512jxHiZo','length','site','\x20\x20Round\x20','Conversation\x20URL:\x20','\x20(cached)','output','execute','no_context','name','yellow','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','42416urlQKQ','reason','agentDirs','white','json','description','no_local_folder','llmProject','utf-8','New\x20tests\x20to\x20execute:\x20','2wsRyom','Test\x20Configuration:','\x27\x20to\x20create\x20the\x20folder\x20structure.','Round\x201/','\x20\x20Agent:\x20','dim','Running\x20agent\x20tests...','Re-evaluating...','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','No\x20tests\x20found\x20with\x20tags:\x20','Tests\x20found:\x20','...','agent:test','✗\x20ERROR:\x20','\x22:\x20','1046217GesFRm','stop','Error\x20writing\x20output\x20file:\x20','no_tests','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','✓\x20PASS:\x20','Re-evaluating\x20','conversation_url','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','resolveProjectId','Run\x20\x27tdx\x20agent\x20pull\x20','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','Available\x20tests:\x20','23362PMBkPW','1652995SFeqQC','toISOString','forEach','testName','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','Agent:\x20','Passed:\x20\x20\x20','not\x20found','PASS','find','\x20-\x20','isSpinning','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','423GlfPdY','executeReeval','FAIL','429048WgYpii','repeat','No\x20tests\x20found\x20matching:\x20','\x20(new)','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','...\x20','source','eval','Running\x20test:\x20','2592568sARPzn','tags','status','Failed:\x20\x20\x20','push','Errors:\x20\x20\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','some','jsonl','agentName','Round\x20','red','Output\x20written\x20to:\x20'];a5_0x21bd=function(){return _0x164d5a;};return a5_0x21bd();}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_0x4c4efc(0x12c)]=a5_0x4c4efc(0x145);[a5_0x4c4efc(0x134)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x4c4efc(0x12a)](_0xe160a8){const _0x4b7a7c=a5_0x4c4efc,{options:_0x1f5b3b,args:_0x289dba,tdx:_0x567fc4}=_0xe160a8,_0x4e5599=_0x289dba[0x0]||'.',_0x4c9c71=_0x1f5b3b['dryRun'],_0x22fda8=_0x1f5b3b,_0x1284e3=_0x22fda8[_0x4b7a7c(0x16d)]===![],_0x320524=_0x22fda8['reeval'],_0xb02d89=_0x22fda8[_0x4b7a7c(0x12c)],_0x373db7=_0x22fda8['tags'],_0x191779=_0x1f5b3b[_0x4b7a7c(0x125)],_0x2b8988=_0x22fda8[_0x4b7a7c(0x129)];if(_0x320524&&_0x1284e3)return console['log'](a5_0x5797fc[_0x4b7a7c(0x17a)](_0x4b7a7c(0x153))),0x1;let _0x22d8e4='table';if(_0x22fda8[_0x4b7a7c(0x133)])_0x22d8e4=_0x4b7a7c(0x133);else{if(_0x22fda8[_0x4b7a7c(0x177)])_0x22d8e4=_0x4b7a7c(0x177);else{if(_0x22fda8[_0x4b7a7c(0x11d)])_0x22d8e4='tsv';else{if(_0x22fda8[_0x4b7a7c(0x102)])_0x22d8e4=_0x4b7a7c(0x102);}}}const _0x16785d=_0x22fda8[_0x4b7a7c(0x136)];let _0x5c3335=_0x4e5599;const _0x2f3faf=a5_0x176059[_0x4b7a7c(0x10a)](_0x4e5599),_0x35097f=_0x4e5599==='.';if(!_0x2f3faf||_0x35097f){const _0x19f818=resolveProjectFromContext(_0x4e5599,_0x16785d,{'requireFile':'test.yml'});if(_0x19f818[_0x4b7a7c(0x193)])_0x5c3335=_0x19f818[_0x4b7a7c(0x17f)],_0x19f818[_0x4b7a7c(0x16c)]==='context'&&console[_0x4b7a7c(0x10c)](a5_0x5797fc[_0x4b7a7c(0x13e)](_0x4b7a7c(0x11f)+_0x5c3335));else switch(_0x19f818[_0x4b7a7c(0x130)]){case _0x4b7a7c(0x12b):console[_0x4b7a7c(0x10c)](a5_0x5797fc[_0x4b7a7c(0x12d)](_0x19f818['message'])),console[_0x4b7a7c(0x10c)](),console[_0x4b7a7c(0x10c)](_0x4b7a7c(0x192)),console[_0x4b7a7c(0x10c)](_0x4b7a7c(0x11e)),console[_0x4b7a7c(0x10c)](_0x4b7a7c(0x11c)),console[_0x4b7a7c(0x10c)](),console['log'](_0x4b7a7c(0x122));return 0x1;case _0x4b7a7c(0x135):console[_0x4b7a7c(0x10c)](a5_0x5797fc['yellow'](_0x19f818[_0x4b7a7c(0x119)])),console[_0x4b7a7c(0x10c)](),console['log'](_0x4b7a7c(0x152)+_0x19f818['llmProject']+_0x4b7a7c(0x13b));return 0x1;case'multiple_agents':{const _0x5cf7f2=a5_0x2ff967['basename'](_0x19f818[_0x4b7a7c(0x17f)]);console[_0x4b7a7c(0x10c)](a5_0x5797fc[_0x4b7a7c(0x12d)](_0x4b7a7c(0x110)+_0x19f818[_0x4b7a7c(0x136)]+'\x22:'));for(const _0x34868d of _0x19f818[_0x4b7a7c(0x131)]){console['log'](_0x4b7a7c(0x10e)+_0x34868d);}return console[_0x4b7a7c(0x10c)](),console[_0x4b7a7c(0x10c)](_0x4b7a7c(0x14c)+_0x5cf7f2+_0x4b7a7c(0x10b)),0x1;}case _0x4b7a7c(0x14b):console[_0x4b7a7c(0x10c)](a5_0x5797fc[_0x4b7a7c(0x12d)](_0x4b7a7c(0x18a)+_0x19f818['llmProject']+'\x22.')),console[_0x4b7a7c(0x10c)](a5_0x5797fc[_0x4b7a7c(0x13e)](_0x4b7a7c(0x112)+_0x19f818[_0x4b7a7c(0x17f)])),console[_0x4b7a7c(0x10c)](),console['log'](_0x4b7a7c(0x141));return 0x1;}}const {definition:_0x2f6791,agentInfo:_0x5f535b}=parseTestFile(_0x5c3335);let _0xe2b823=_0x2f6791[_0x4b7a7c(0x117)];if(_0xb02d89){const _0x56bc36=_0xb02d89[_0x4b7a7c(0x181)](',')[_0x4b7a7c(0x17d)](_0x4792b3=>_0x4792b3[_0x4b7a7c(0x106)]());_0xe2b823=_0x2f6791['tests'][_0x4b7a7c(0x187)](_0x2b9d96=>_0x56bc36['includes'](_0x2b9d96[_0x4b7a7c(0x12c)]));if(_0xe2b823[_0x4b7a7c(0x124)]===0x0)return console[_0x4b7a7c(0x10c)](a5_0x5797fc[_0x4b7a7c(0x12d)](_0x4b7a7c(0x168)+_0xb02d89)),console[_0x4b7a7c(0x10c)](a5_0x5797fc[_0x4b7a7c(0x13e)](_0x4b7a7c(0x154)+_0x2f6791['tests']['map'](_0x2654f8=>_0x2654f8[_0x4b7a7c(0x12c)])[_0x4b7a7c(0x118)](',\x20'))),0x1;}if(_0x373db7){const _0x1fdccb=_0x373db7['split'](',')[_0x4b7a7c(0x17d)](_0x4c223c=>_0x4c223c['trim']()['toLowerCase']());_0xe2b823=_0xe2b823[_0x4b7a7c(0x187)](_0x75b5fd=>_0x75b5fd[_0x4b7a7c(0x170)]?.[_0x4b7a7c(0x176)](_0x45b314=>_0x1fdccb[_0x4b7a7c(0x18c)](_0x45b314[_0x4b7a7c(0x107)]())));if(_0xe2b823[_0x4b7a7c(0x124)]===0x0){console[_0x4b7a7c(0x10c)](a5_0x5797fc['yellow'](_0x4b7a7c(0x142)+_0x373db7));const _0x303f0b=new Set();return _0x2f6791[_0x4b7a7c(0x117)][_0x4b7a7c(0x158)](_0x27864d=>_0x27864d['tags']?.[_0x4b7a7c(0x158)](_0x24eea9=>_0x303f0b[_0x4b7a7c(0x18e)](_0x24eea9))),_0x303f0b[_0x4b7a7c(0x108)]>0x0?console['log'](a5_0x5797fc[_0x4b7a7c(0x13e)](_0x4b7a7c(0x11a)+[..._0x303f0b][_0x4b7a7c(0x118)](',\x20'))):console[_0x4b7a7c(0x10c)](a5_0x5797fc['dim']('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0x320524)return this['executeReeval'](_0xe160a8,{'definition':{'tests':_0xe2b823},'agentInfo':_0x5f535b,'outputFormat':_0x22d8e4,'outputFile':_0x2b8988,'testNames':_0xb02d89});if(_0x4c9c71){console[_0x4b7a7c(0x10c)](a5_0x5797fc[_0x4b7a7c(0x17c)](_0x4b7a7c(0x13a))),console[_0x4b7a7c(0x10c)]('\x20\x20Site:\x20'+a5_0x5797fc['white'](_0x191779)),console[_0x4b7a7c(0x10c)](_0x4b7a7c(0x109)+a5_0x5797fc[_0x4b7a7c(0x132)](_0x5f535b[_0x4b7a7c(0x194)])),console[_0x4b7a7c(0x10c)](_0x4b7a7c(0x13d)+a5_0x5797fc[_0x4b7a7c(0x132)](_0x5f535b[_0x4b7a7c(0x178)])),console[_0x4b7a7c(0x10c)](),console[_0x4b7a7c(0x10c)](_0x4b7a7c(0x143)+a5_0x5797fc[_0x4b7a7c(0x132)](_0xe2b823[_0x4b7a7c(0x124)]));for(let _0x5458c1=0x0;_0x5458c1<_0xe2b823['length'];_0x5458c1++){const _0x21b489=_0xe2b823[_0x5458c1],_0x185e1b=_0x21b489['rounds'][_0x4b7a7c(0x124)]===0x1?'round':_0x4b7a7c(0x189),_0x3440b9=_0x21b489[_0x4b7a7c(0x170)]?.[_0x4b7a7c(0x124)]?'\x20['+_0x21b489['tags'][_0x4b7a7c(0x118)](',\x20')+']':'';console[_0x4b7a7c(0x10c)]('\x20\x20'+(_0x5458c1+0x1)+'.\x20'+a5_0x5797fc[_0x4b7a7c(0x132)](_0x21b489[_0x4b7a7c(0x12c)])+'\x20('+_0x21b489[_0x4b7a7c(0x189)][_0x4b7a7c(0x124)]+'\x20'+_0x185e1b+')'+a5_0x5797fc[_0x4b7a7c(0x13e)](_0x3440b9));}return 0x0;}let _0x405cc6,_0x5ed978;try{_0x405cc6=await _0x567fc4[_0x4b7a7c(0x186)][_0x4b7a7c(0x151)](_0x5f535b[_0x4b7a7c(0x194)]);}catch(_0x414e01){const _0x5288bc=_0x414e01 instanceof Error?_0x414e01[_0x4b7a7c(0x119)]:String(_0x414e01);return _0x5288bc[_0x4b7a7c(0x18c)](_0x4b7a7c(0x105))||_0x5288bc[_0x4b7a7c(0x107)]()['includes'](_0x4b7a7c(0x15d))?console[_0x4b7a7c(0x10c)](a5_0x5797fc[_0x4b7a7c(0x17a)](_0x4b7a7c(0x175)+_0x5f535b['projectName'])):console[_0x4b7a7c(0x10c)](a5_0x5797fc[_0x4b7a7c(0x17a)](_0x4b7a7c(0x11b)+_0x5f535b[_0x4b7a7c(0x194)]+_0x4b7a7c(0x147)+_0x5288bc)),0x1;}try{_0x5ed978=await _0x567fc4[_0x4b7a7c(0x186)][_0x4b7a7c(0x182)](_0x5f535b[_0x4b7a7c(0x178)],_0x405cc6);}catch(_0x5c55e7){const _0x265691=_0x5c55e7 instanceof Error?_0x5c55e7[_0x4b7a7c(0x119)]:String(_0x5c55e7);return _0x265691[_0x4b7a7c(0x18c)](_0x4b7a7c(0x105))||_0x265691[_0x4b7a7c(0x107)]()[_0x4b7a7c(0x18c)]('not\x20found')?console[_0x4b7a7c(0x10c)](a5_0x5797fc[_0x4b7a7c(0x17a)](_0x4b7a7c(0x16a)+_0x5f535b['agentName'])):console['log'](a5_0x5797fc[_0x4b7a7c(0x17a)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x5f535b['agentName']+_0x4b7a7c(0x147)+_0x265691)),0x1;}let _0x252183;if(!_0x1284e3)try{_0x252183=await setupEvaluatorAgent(_0x567fc4[_0x4b7a7c(0x186)],_0x1f5b3b['verbose']);}catch(_0x505d5b){const _0x100afb=_0x505d5b instanceof Error?_0x505d5b[_0x4b7a7c(0x119)]:String(_0x505d5b);return console['log'](a5_0x5797fc[_0x4b7a7c(0x17a)](_0x4b7a7c(0x15a)+_0x100afb)),0x1;}console['log'](a5_0x5797fc[_0x4b7a7c(0x17c)](_0x4b7a7c(0x13f))),console['log'](_0x4b7a7c(0x188)+a5_0x5797fc[_0x4b7a7c(0x132)](_0x191779)),console[_0x4b7a7c(0x10c)](_0x4b7a7c(0x15b)+a5_0x5797fc[_0x4b7a7c(0x132)](_0x5f535b[_0x4b7a7c(0x194)]+'/'+_0x5f535b['agentName'])),console['log']();const _0x5bf82e=[],_0x5e7615=[],_0x5e1cb2=Date[_0x4b7a7c(0x185)]();for(let _0x27ffb0=0x0;_0x27ffb0<_0xe2b823[_0x4b7a7c(0x124)];_0x27ffb0++){const _0x1ae1ca=_0xe2b823[_0x27ffb0];_0xe2b823['length']>0x1?console[_0x4b7a7c(0x10c)](_0x4b7a7c(0x10f)+(_0x27ffb0+0x1)+'/'+_0xe2b823['length']+':\x20'+a5_0x5797fc[_0x4b7a7c(0x132)](_0x1ae1ca[_0x4b7a7c(0x12c)])):console[_0x4b7a7c(0x10c)](_0x4b7a7c(0x16e)+a5_0x5797fc[_0x4b7a7c(0x132)](_0x1ae1ca[_0x4b7a7c(0x12c)]));const _0x24633c=createCommandSpinner(_0x4b7a7c(0x13c)+_0x1ae1ca[_0x4b7a7c(0x189)][_0x4b7a7c(0x124)]+_0x4b7a7c(0x115));_0x24633c['start']();try{const {result:_0xe03126,conversation:_0x3a73b4}=await runTest(_0x567fc4[_0x4b7a7c(0x186)],_0x1ae1ca,{'agentId':_0x5ed978,'projectId':_0x405cc6,'site':_0x191779,'noEval':_0x1284e3,'evaluatorId':_0x252183,'onRoundStart':(_0x1f7564,_0x4e9fdd)=>{const _0x40ae87=_0x4b7a7c;_0x24633c[_0x40ae87(0x18f)]=_0x40ae87(0x179)+(_0x1f7564+0x1)+'/'+_0x4e9fdd+_0x40ae87(0x115);},'onRoundComplete':(_0x5e346d,_0x2f6da2,_0x4c5bc6)=>{const _0x48df64=_0x4b7a7c,_0x179d66=formatElapsed(_0x2f6da2);_0x4c5bc6?console[_0x48df64(0x10c)](_0x48df64(0x126)+(_0x5e346d+0x1)+'/'+_0x1ae1ca[_0x48df64(0x189)][_0x48df64(0x124)]+_0x48df64(0x16b)+a5_0x5797fc['green']('✓')+'\x20('+_0x179d66+')'):console[_0x48df64(0x10c)](_0x48df64(0x126)+(_0x5e346d+0x1)+'/'+_0x1ae1ca[_0x48df64(0x189)]['length']+'...\x20'+a5_0x5797fc[_0x48df64(0x17a)]('✗'));},'onEvaluationStart':()=>{const _0x495fdc=_0x4b7a7c;_0x24633c['text']=_0x495fdc(0x183);},'onEvaluationComplete':_0x3950ce=>{const _0x2878a1=_0x4b7a7c,_0x2851bd=formatElapsed(_0x3950ce);console['log']('\x20\x20Evaluating...\x20'+a5_0x5797fc[_0x2878a1(0x180)]('✓')+'\x20('+_0x2851bd+')');}});_0x24633c['stop'](),_0x5bf82e[_0x4b7a7c(0x173)](_0xe03126),_0x5e7615[_0x4b7a7c(0x173)](_0x3a73b4);if(_0xe03126[_0x4b7a7c(0x171)]===_0x4b7a7c(0x15e))console[_0x4b7a7c(0x10c)](a5_0x5797fc[_0x4b7a7c(0x180)](_0x4b7a7c(0x14d)+_0xe03126['reason']));else _0xe03126['status']===_0x4b7a7c(0x165)?console['log'](a5_0x5797fc['red'](_0x4b7a7c(0x191)+_0xe03126[_0x4b7a7c(0x130)])):console[_0x4b7a7c(0x10c)](a5_0x5797fc[_0x4b7a7c(0x17a)](_0x4b7a7c(0x146)+_0xe03126[_0x4b7a7c(0x130)]));_0xe03126[_0x4b7a7c(0x14f)]&&console[_0x4b7a7c(0x10c)](a5_0x5797fc[_0x4b7a7c(0x13e)](_0x4b7a7c(0x127)+_0xe03126[_0x4b7a7c(0x14f)])),console['log']();}catch(_0x55c0cc){_0x24633c[_0x4b7a7c(0x149)]();const _0x24a767=_0x55c0cc instanceof Error?_0x55c0cc[_0x4b7a7c(0x119)]:String(_0x55c0cc);console['log'](a5_0x5797fc[_0x4b7a7c(0x17a)](_0x4b7a7c(0x146)+_0x24a767)),console['log'](),_0x5bf82e[_0x4b7a7c(0x173)]({'name':_0x1ae1ca[_0x4b7a7c(0x12c)],'status':_0x4b7a7c(0x120),'reason':_0x24a767,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x55fbfc=Date[_0x4b7a7c(0x185)]()-_0x5e1cb2,_0x40e83a=_0x5bf82e[_0x4b7a7c(0x187)](_0x3d83d9=>_0x3d83d9[_0x4b7a7c(0x171)]==='PASS')[_0x4b7a7c(0x124)],_0x9f0f37=_0x5bf82e[_0x4b7a7c(0x187)](_0x1c28d7=>_0x1c28d7[_0x4b7a7c(0x171)]==='FAIL')[_0x4b7a7c(0x124)],_0x477799=_0x5bf82e[_0x4b7a7c(0x187)](_0x1c2c3d=>_0x1c2c3d['status']===_0x4b7a7c(0x120))['length'];console['log']('━'[_0x4b7a7c(0x167)](0x3c)),console[_0x4b7a7c(0x10c)](_0x4b7a7c(0x10d)),console['log']('━'[_0x4b7a7c(0x167)](0x3c)),console['log']('Total:\x20\x20\x20\x20'+_0x5bf82e['length']),console[_0x4b7a7c(0x10c)](_0x4b7a7c(0x15c)+a5_0x5797fc[_0x4b7a7c(0x180)](_0x40e83a)),console['log']('Failed:\x20\x20\x20'+a5_0x5797fc['red'](_0x9f0f37));_0x477799>0x0&&console['log'](_0x4b7a7c(0x174)+a5_0x5797fc['red'](_0x477799));console[_0x4b7a7c(0x10c)](_0x4b7a7c(0x184)+formatElapsed(_0x55fbfc)),console[_0x4b7a7c(0x10c)]('━'[_0x4b7a7c(0x167)](0x3c));const _0x1fbe4e=_0x5bf82e[_0x4b7a7c(0x187)](_0x59fd91=>_0x59fd91[_0x4b7a7c(0x171)]!==_0x4b7a7c(0x15e));if(_0x1fbe4e['length']>0x0){console[_0x4b7a7c(0x10c)](),console[_0x4b7a7c(0x10c)](_0x4b7a7c(0x190));for(const _0x1fb9c3 of _0x1fbe4e){const _0x504e7f=a5_0x5797fc[_0x4b7a7c(0x17a)]('✗'),_0x2d79bf=_0x1fb9c3['reason']['length']>0x32?_0x1fb9c3['reason']['substring'](0x0,0x32)+'...':_0x1fb9c3[_0x4b7a7c(0x130)];console['log']('\x20\x20'+_0x504e7f+'\x20'+_0x1fb9c3[_0x4b7a7c(0x12c)]+':\x20'+_0x2d79bf);}}const _0x5b1ca8={'summary':{'total':_0x5bf82e[_0x4b7a7c(0x124)],'passed':_0x40e83a,'failed':_0x9f0f37,'errors':_0x477799>0x0?_0x477799:undefined,'duration_ms':_0x55fbfc},'tests':_0x5bf82e,'agent':{'project':_0x5f535b[_0x4b7a7c(0x194)],'name':_0x5f535b[_0x4b7a7c(0x178)],'site':_0x191779},'timestamp':new Date(_0x5e1cb2)[_0x4b7a7c(0x157)]()};try{const _0x183484=buildCachedTestRun(_0x5e7615,{'site':_0x191779,'projectId':_0x405cc6,'projectName':_0x5f535b[_0x4b7a7c(0x194)],'agentId':_0x5ed978,'agentName':_0x5f535b[_0x4b7a7c(0x178)],'testYmlPath':a5_0x2ff967['resolve'](_0x5f535b[_0x4b7a7c(0x111)])});saveLastTestRun(_0x183484);}catch{}if(_0x22d8e4!==_0x4b7a7c(0x102)||_0x2b8988){const _0x3f8e13=formatResults(_0x5b1ca8,_0x22d8e4);if(_0x2b8988)try{a5_0x176059['writeFileSync'](_0x2b8988,_0x3f8e13,'utf-8'),console[_0x4b7a7c(0x10c)](),console[_0x4b7a7c(0x10c)](a5_0x5797fc[_0x4b7a7c(0x13e)](_0x4b7a7c(0x17b)+_0x2b8988));}catch(_0xd6d1){return console[_0x4b7a7c(0x10c)](),console[_0x4b7a7c(0x10c)](a5_0x5797fc[_0x4b7a7c(0x17a)](_0x4b7a7c(0x14a)+_0xd6d1)),0x1;}else console[_0x4b7a7c(0x10c)](),console['log'](_0x3f8e13);}return _0x1fbe4e[_0x4b7a7c(0x124)]>0x0?0x1:0x0;}async[a5_0x4c4efc(0x164)](_0x651d1b,_0x10dbc0){const _0x29ba69=a5_0x4c4efc,{options:_0x53732b,tdx:_0x297201}=_0x651d1b,{definition:_0x53a03e,agentInfo:_0x1f3dc9,outputFormat:_0x4ed67c,outputFile:_0x9e4a35}=_0x10dbc0,_0x52de63=_0x53732b[_0x29ba69(0x125)],_0x4d07aa=loadLastTestRun();if(!_0x4d07aa)return console['log'](a5_0x5797fc[_0x29ba69(0x17a)]('Error:\x20No\x20previous\x20test\x20run\x20found.')),console['log'](a5_0x5797fc['dim'](_0x29ba69(0x150))),0x1;if(_0x4d07aa['agent'][_0x29ba69(0x178)]!==_0x1f3dc9[_0x29ba69(0x178)])return console[_0x29ba69(0x10c)](a5_0x5797fc[_0x29ba69(0x17a)](_0x29ba69(0x114)+_0x4d07aa['agent'][_0x29ba69(0x178)]+_0x29ba69(0x162)+_0x1f3dc9['agentName']+'\x22.')),console[_0x29ba69(0x10c)](a5_0x5797fc[_0x29ba69(0x13e)]('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x200cab=new Set(_0x4d07aa['conversations'][_0x29ba69(0x17d)](_0x110b52=>_0x110b52[_0x29ba69(0x159)])),_0x370a6d=_0x53a03e[_0x29ba69(0x117)][_0x29ba69(0x187)](_0x7a946d=>!_0x200cab['has'](_0x7a946d[_0x29ba69(0x12c)]));if(_0x370a6d['length']>0x0&&_0x4d07aa[_0x29ba69(0x125)]!==_0x52de63)return console[_0x29ba69(0x10c)](a5_0x5797fc[_0x29ba69(0x17a)](_0x29ba69(0x12e))),console[_0x29ba69(0x10c)](a5_0x5797fc[_0x29ba69(0x13e)]('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x4d07aa[_0x29ba69(0x125)]+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x52de63+'\x22.')),console[_0x29ba69(0x10c)](a5_0x5797fc[_0x29ba69(0x13e)]('Either\x20switch\x20to\x20the\x20\x22'+_0x4d07aa[_0x29ba69(0x125)]+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x1d5dd9=_0x53a03e[_0x29ba69(0x117)]['filter'](_0x2f52bc=>_0x200cab[_0x29ba69(0x104)](_0x2f52bc['name'])),_0x3cdb6e=_0x370a6d;let _0x331028;try{_0x331028=await setupEvaluatorAgent(_0x297201['llm'],_0x53732b['verbose']);}catch(_0x32e1f1){const _0x11de09=_0x32e1f1 instanceof Error?_0x32e1f1[_0x29ba69(0x119)]:String(_0x32e1f1);return console[_0x29ba69(0x10c)](a5_0x5797fc['red'](_0x29ba69(0x15a)+_0x11de09)),0x1;}console[_0x29ba69(0x10c)](a5_0x5797fc[_0x29ba69(0x17c)](_0x29ba69(0x195))),console[_0x29ba69(0x10c)]('Cached\x20run\x20from:\x20'+a5_0x5797fc[_0x29ba69(0x132)](_0x4d07aa[_0x29ba69(0x18d)])),console[_0x29ba69(0x10c)](_0x29ba69(0x15b)+a5_0x5797fc[_0x29ba69(0x132)](_0x4d07aa[_0x29ba69(0x17e)][_0x29ba69(0x194)]+'/'+_0x4d07aa['agent']['agentName']));_0x3cdb6e[_0x29ba69(0x124)]>0x0&&console[_0x29ba69(0x10c)](_0x29ba69(0x138)+a5_0x5797fc[_0x29ba69(0x12d)](_0x3cdb6e[_0x29ba69(0x124)]));console['log']();const _0x35cf40=[],_0x3f64e5=Date[_0x29ba69(0x185)](),_0x27cf5c=createCommandSpinner(_0x29ba69(0x140));if(_0x1d5dd9[_0x29ba69(0x124)]>0x0)try{const _0x7f286a=await reevaluateFromCache(_0x297201[_0x29ba69(0x186)],_0x4d07aa,{'tests':_0x1d5dd9},{'evaluatorId':_0x331028,'onTestStart':(_0x991306,_0x37d23b,_0x1d6b25)=>{const _0x18274a=_0x29ba69;_0x27cf5c['text']=_0x18274a(0x14e)+(_0x37d23b+0x1)+'/'+_0x1d6b25+':\x20'+_0x991306+_0x18274a(0x144);if(!_0x27cf5c[_0x18274a(0x161)])_0x27cf5c['start']();},'onTestComplete':(_0x968c8b,_0x274f76)=>{const _0x1e2825=_0x29ba69;_0x27cf5c[_0x1e2825(0x149)]();if(_0x274f76[_0x1e2825(0x171)]==='PASS')console[_0x1e2825(0x10c)](a5_0x5797fc[_0x1e2825(0x180)](_0x1e2825(0x14d)+_0x968c8b)+a5_0x5797fc[_0x1e2825(0x13e)]('\x20(cached)'));else _0x274f76[_0x1e2825(0x171)]==='FAIL'?console[_0x1e2825(0x10c)](a5_0x5797fc[_0x1e2825(0x17a)](_0x1e2825(0x191)+_0x968c8b+'\x20-\x20'+_0x274f76['reason'])+a5_0x5797fc[_0x1e2825(0x13e)](_0x1e2825(0x128))):console[_0x1e2825(0x10c)](a5_0x5797fc[_0x1e2825(0x17a)]('✗\x20ERROR:\x20'+_0x968c8b+'\x20-\x20'+_0x274f76[_0x1e2825(0x130)]));_0x274f76['conversation_url']&&console['log'](a5_0x5797fc[_0x1e2825(0x13e)]('\x20\x20Conversation:\x20'+_0x274f76[_0x1e2825(0x14f)])),_0x35cf40[_0x1e2825(0x173)](_0x274f76);},'onTestSkipped':(_0xf8320d,_0xfc7534)=>{const _0x1a526c=_0x29ba69;_0x27cf5c[_0x1a526c(0x149)](),console[_0x1a526c(0x10c)](a5_0x5797fc[_0x1a526c(0x12d)](_0x1a526c(0x103)+_0xf8320d+_0x1a526c(0x160)+_0xfc7534));}});for(const _0x391dc4 of _0x7f286a){!_0x35cf40[_0x29ba69(0x15f)](_0x1682d6=>_0x1682d6[_0x29ba69(0x12c)]===_0x391dc4[_0x29ba69(0x12c)])&&_0x35cf40[_0x29ba69(0x173)](_0x391dc4);}}catch(_0x2f442f){_0x27cf5c[_0x29ba69(0x149)]();const _0x566fb0=_0x2f442f instanceof Error?_0x2f442f[_0x29ba69(0x119)]:String(_0x2f442f);return console[_0x29ba69(0x10c)](a5_0x5797fc['red']('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0x566fb0)),0x1;}_0x27cf5c[_0x29ba69(0x149)]();if(_0x3cdb6e[_0x29ba69(0x124)]>0x0){console[_0x29ba69(0x10c)](),console['log'](a5_0x5797fc[_0x29ba69(0x17c)](_0x29ba69(0x196)));const {projectId:_0x1fb21d,agentId:_0x26f0c0}=_0x4d07aa['agent'];for(const _0x562a00 of _0x3cdb6e){console[_0x29ba69(0x10c)]('Running:\x20'+a5_0x5797fc[_0x29ba69(0x132)](_0x562a00[_0x29ba69(0x12c)]));const _0x565807=createCommandSpinner(_0x29ba69(0x13c)+_0x562a00[_0x29ba69(0x189)]['length']+_0x29ba69(0x115));_0x565807[_0x29ba69(0x18b)]();try{const {result:_0x3b98a4}=await runTest(_0x297201[_0x29ba69(0x186)],_0x562a00,{'agentId':_0x26f0c0,'projectId':_0x1fb21d,'site':_0x4d07aa['site'],'noEval':![],'evaluatorId':_0x331028,'onRoundStart':(_0x44254b,_0x50857b)=>{const _0x5bb4ac=_0x29ba69;_0x565807[_0x5bb4ac(0x18f)]=_0x5bb4ac(0x179)+(_0x44254b+0x1)+'/'+_0x50857b+_0x5bb4ac(0x115);},'onRoundComplete':(_0x69e3d8,_0x54b8c3,_0x4ae29c)=>{const _0xdcea9a=_0x29ba69,_0x17d888=formatElapsed(_0x54b8c3);_0x4ae29c?console['log']('\x20\x20Round\x20'+(_0x69e3d8+0x1)+'/'+_0x562a00[_0xdcea9a(0x189)][_0xdcea9a(0x124)]+_0xdcea9a(0x16b)+a5_0x5797fc['green']('✓')+'\x20('+_0x17d888+')'):console['log'](_0xdcea9a(0x126)+(_0x69e3d8+0x1)+'/'+_0x562a00[_0xdcea9a(0x189)]['length']+'...\x20'+a5_0x5797fc[_0xdcea9a(0x17a)]('✗'));},'onEvaluationStart':()=>{const _0x454265=_0x29ba69;_0x565807[_0x454265(0x18f)]=_0x454265(0x183);},'onEvaluationComplete':_0x403aa1=>{const _0x518441=_0x29ba69,_0x103d6e=formatElapsed(_0x403aa1);console[_0x518441(0x10c)]('\x20\x20Evaluating...\x20'+a5_0x5797fc['green']('✓')+'\x20('+_0x103d6e+')');}});_0x565807['stop'](),_0x35cf40['push'](_0x3b98a4);if(_0x3b98a4[_0x29ba69(0x171)]===_0x29ba69(0x15e))console[_0x29ba69(0x10c)](a5_0x5797fc[_0x29ba69(0x180)](_0x29ba69(0x14d)+_0x3b98a4[_0x29ba69(0x130)])+a5_0x5797fc[_0x29ba69(0x13e)](_0x29ba69(0x169)));else _0x3b98a4[_0x29ba69(0x171)]===_0x29ba69(0x165)?console[_0x29ba69(0x10c)](a5_0x5797fc[_0x29ba69(0x17a)](_0x29ba69(0x191)+_0x3b98a4[_0x29ba69(0x130)])+a5_0x5797fc[_0x29ba69(0x13e)]('\x20(new)')):console['log'](a5_0x5797fc[_0x29ba69(0x17a)](_0x29ba69(0x146)+_0x3b98a4['reason']));_0x3b98a4[_0x29ba69(0x14f)]&&console[_0x29ba69(0x10c)](a5_0x5797fc[_0x29ba69(0x13e)](_0x29ba69(0x116)+_0x3b98a4[_0x29ba69(0x14f)]));}catch(_0x55b05e){_0x565807['stop']();const _0xc761e2=_0x55b05e instanceof Error?_0x55b05e[_0x29ba69(0x119)]:String(_0x55b05e);console[_0x29ba69(0x10c)](a5_0x5797fc['red'](_0x29ba69(0x146)+_0xc761e2)),_0x35cf40[_0x29ba69(0x173)]({'name':_0x562a00[_0x29ba69(0x12c)],'status':'ERROR','reason':_0xc761e2,'timestamp':new Date()[_0x29ba69(0x157)](),'duration_ms':0x0});}}}console[_0x29ba69(0x10c)]();const _0x35a5b4=Date[_0x29ba69(0x185)]()-_0x3f64e5,_0xacf699=_0x35cf40['filter'](_0x2e4f66=>_0x2e4f66[_0x29ba69(0x171)]===_0x29ba69(0x15e))['length'],_0x5de57b=_0x35cf40[_0x29ba69(0x187)](_0x53d18b=>_0x53d18b[_0x29ba69(0x171)]==='FAIL')[_0x29ba69(0x124)],_0x4e20a9=_0x35cf40[_0x29ba69(0x187)](_0x5e7970=>_0x5e7970[_0x29ba69(0x171)]===_0x29ba69(0x120))[_0x29ba69(0x124)];console['log']('━'[_0x29ba69(0x167)](0x3c)),console['log'](_0x29ba69(0x113)),console[_0x29ba69(0x10c)]('━'[_0x29ba69(0x167)](0x3c)),console['log'](_0x29ba69(0x121)+_0x35cf40[_0x29ba69(0x124)]),console['log'](_0x29ba69(0x15c)+a5_0x5797fc[_0x29ba69(0x180)](_0xacf699)),console[_0x29ba69(0x10c)](_0x29ba69(0x172)+a5_0x5797fc[_0x29ba69(0x17a)](_0x5de57b));_0x4e20a9>0x0&&console['log'](_0x29ba69(0x174)+a5_0x5797fc[_0x29ba69(0x17a)](_0x4e20a9));console[_0x29ba69(0x10c)](_0x29ba69(0x184)+formatElapsed(_0x35a5b4)),console[_0x29ba69(0x10c)]('━'[_0x29ba69(0x167)](0x3c));const _0x437dd6={'summary':{'total':_0x35cf40[_0x29ba69(0x124)],'passed':_0xacf699,'failed':_0x5de57b,'errors':_0x4e20a9>0x0?_0x4e20a9:undefined,'duration_ms':_0x35a5b4},'tests':_0x35cf40,'agent':{'project':_0x1f3dc9[_0x29ba69(0x194)],'name':_0x1f3dc9['agentName'],'site':_0x52de63},'timestamp':new Date(_0x3f64e5)[_0x29ba69(0x157)]()};if(_0x4ed67c!==_0x29ba69(0x102)||_0x9e4a35){const _0x16ab9f=formatResults(_0x437dd6,_0x4ed67c);if(_0x9e4a35)try{a5_0x176059['writeFileSync'](_0x9e4a35,_0x16ab9f,_0x29ba69(0x137)),console[_0x29ba69(0x10c)](),console[_0x29ba69(0x10c)](a5_0x5797fc[_0x29ba69(0x13e)](_0x29ba69(0x17b)+_0x9e4a35));}catch(_0x83f303){return console[_0x29ba69(0x10c)](),console['log'](a5_0x5797fc[_0x29ba69(0x17a)]('Error\x20writing\x20output\x20file:\x20'+_0x83f303)),0x1;}else console[_0x29ba69(0x10c)](),console[_0x29ba69(0x10c)](_0x16ab9f);}const _0x320a35=_0x35cf40[_0x29ba69(0x187)](_0x2535b2=>_0x2535b2[_0x29ba69(0x171)]!==_0x29ba69(0x15e));return _0x320a35[_0x29ba69(0x124)]>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0x218a66=a5_0x50d7;(function(_0x3c73ff,_0x1454e0){const _0x3dd1ed=a5_0x50d7,_0x199b7c=_0x3c73ff();while(!![]){try{const _0x3d4639=parseInt(_0x3dd1ed(0x236))/0x1+-parseInt(_0x3dd1ed(0x22e))/0x2*(parseInt(_0x3dd1ed(0x209))/0x3)+parseInt(_0x3dd1ed(0x21b))/0x4+parseInt(_0x3dd1ed(0x1d3))/0x5*(parseInt(_0x3dd1ed(0x257))/0x6)+-parseInt(_0x3dd1ed(0x243))/0x7*(-parseInt(_0x3dd1ed(0x205))/0x8)+parseInt(_0x3dd1ed(0x211))/0x9+-parseInt(_0x3dd1ed(0x24c))/0xa;if(_0x3d4639===_0x1454e0)break;else _0x199b7c['push'](_0x199b7c['shift']());}catch(_0x386f2a){_0x199b7c['push'](_0x199b7c['shift']());}}}(a5_0x2ee9,0xb8655));import*as a5_0x3895a8 from'node:fs';import*as a5_0x4c929d from'node:path';import a5_0xbb67a4 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';function a5_0x2ee9(){const _0x341c42=['add','Re-evaluation\x20Summary','filter','resolveAgentId','length','...\x20','tsv','✗\x20FAIL:\x20','no_tests','✗\x20ERROR:\x20','resolve','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','agentName','projectDir','808EHloSL','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','resolveProjectId','Errors:\x20\x20\x20','145974wNQfqP','/<agent-name>','executeReeval','red','Re-evaluating...','✓\x20PASS:\x20','dim','site','1531476gEqWPb','\x20(new)','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval',':\x20Sending\x20user\x20input...','multiple_agents','Passed:\x20\x20\x20','basename','ERROR','Either\x20switch\x20to\x20the\x20\x22','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','5288984iPjRea','utf-8','white','\x22,\x20but\x20current\x20site\x20is\x20\x22','Test\x20Configuration:','Total:\x20\x20\x20\x20','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','output','existsSync','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','found','jsonl','FAIL','now','Cached\x20run\x20is\x20from\x20site\x20\x22','Round\x201/','Test\x20Summary','repeat','Round\x20','62fQjfjX','cyan','Evaluating\x20response...','tests','includes','Site:\x20','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','No\x20tests\x20found\x20with\x20tags:\x20','289217ieaHBE','No\x20tests\x20have\x20tags\x20defined.','join','...','\x20(cached)','size','push','\x20\x20Conversation:\x20','map','projectName','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','toISOString','\x20\x20Evaluating...\x20','100856RCjBdt','no_local_folder','forEach','Error:\x20No\x20previous\x20test\x20run\x20found.','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','eval','llmProject','18002650zZjYsG','Run\x20\x27tdx\x20agent\x20pull\x20','not\x20found','\x22:\x20','split','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','json','\x20\x20Site:\x20','rounds','Available\x20tags:\x20','table','4962678mrWQJu','conversation_url','testYmlPath','stop','404','Output\x20written\x20to:\x20','reason','toLowerCase','description','Re-evaluating\x20','no_context','llm','5FvTOIr','context','log','verbose','No\x20tests\x20found\x20matching:\x20','conversations','testName','Error\x20writing\x20output\x20file:\x20','Agent:\x20','agent','source','⚠\x20SKIPPED:\x20','tags','yellow','message','status','text','Re-evaluating\x20cached\x20test\x20run...','has','name','New\x20tests\x20to\x20execute:\x20','\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)','reeval','\x20\x20Round\x20','PASS','Project\x20path:\x20','\x20-\x20','start','green','agentDirs','find','Conversation\x20URL:\x20','Failed:\x20\x20\x20','\x20\x20Project:\x20','Tests\x20found:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'];a5_0x2ee9=function(){return _0x341c42;};return a5_0x2ee9();}function a5_0x50d7(_0x50210a,_0x52ef95){_0x50210a=_0x50210a-0x1d3;const _0x2ee971=a5_0x2ee9();let _0x50d78d=_0x2ee971[_0x50210a];return _0x50d78d;}export class AgentTestCommand extends BaseCommand{['name']='agent:test';[a5_0x218a66(0x25f)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async['execute'](_0xf2ae35){const _0x359cae=a5_0x218a66,{options:_0x299263,args:_0x134629,tdx:_0x37daa8}=_0xf2ae35,_0x2ecbb6=_0x134629[0x0]||'.',_0x53e934=_0x299263['dryRun'],_0x41c8a4=_0x299263,_0x270141=_0x41c8a4[_0x359cae(0x24a)]===![],_0x2b8edd=_0x41c8a4[_0x359cae(0x1e9)],_0x39e656=_0x41c8a4['name'],_0x1f68a8=_0x41c8a4[_0x359cae(0x1df)],_0x1096eb=_0x299263[_0x359cae(0x210)],_0x5e0167=_0x41c8a4[_0x359cae(0x222)];if(_0x2b8edd&&_0x270141)return console[_0x359cae(0x1d5)](a5_0xbb67a4[_0x359cae(0x20c)](_0x359cae(0x213))),0x1;let _0x2e51a6=_0x359cae(0x256);if(_0x41c8a4[_0x359cae(0x252)])_0x2e51a6=_0x359cae(0x252);else{if(_0x41c8a4[_0x359cae(0x226)])_0x2e51a6='jsonl';else{if(_0x41c8a4[_0x359cae(0x1fd)])_0x2e51a6=_0x359cae(0x1fd);else{if(_0x41c8a4[_0x359cae(0x256)])_0x2e51a6=_0x359cae(0x256);}}}const _0x4b5e71=_0x41c8a4[_0x359cae(0x24b)];let _0x3d5287=_0x2ecbb6;const _0x2db542=a5_0x3895a8[_0x359cae(0x223)](_0x2ecbb6),_0x4dc245=_0x2ecbb6==='.';if(!_0x2db542||_0x4dc245){const _0x32e6a2=resolveProjectFromContext(_0x2ecbb6,_0x4b5e71,{'requireFile':'test.yml'});if(_0x32e6a2[_0x359cae(0x225)])_0x3d5287=_0x32e6a2[_0x359cae(0x204)],_0x32e6a2[_0x359cae(0x1dd)]===_0x359cae(0x1d4)&&console[_0x359cae(0x1d5)](a5_0xbb67a4[_0x359cae(0x20f)]('Using\x20agent:\x20'+_0x3d5287));else switch(_0x32e6a2[_0x359cae(0x25d)]){case _0x359cae(0x261):console[_0x359cae(0x1d5)](a5_0xbb67a4[_0x359cae(0x1e0)](_0x32e6a2[_0x359cae(0x1e1)])),console[_0x359cae(0x1d5)](),console[_0x359cae(0x1d5)]('Usage:'),console['log']('\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'),console[_0x359cae(0x1d5)](_0x359cae(0x1e8)),console[_0x359cae(0x1d5)](),console[_0x359cae(0x1d5)](_0x359cae(0x221));return 0x1;case _0x359cae(0x244):console[_0x359cae(0x1d5)](a5_0xbb67a4[_0x359cae(0x1e0)](_0x32e6a2[_0x359cae(0x1e1)])),console[_0x359cae(0x1d5)](),console[_0x359cae(0x1d5)](_0x359cae(0x24d)+_0x32e6a2[_0x359cae(0x24b)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');return 0x1;case _0x359cae(0x215):{const _0x3977be=a5_0x4c929d[_0x359cae(0x217)](_0x32e6a2[_0x359cae(0x204)]);console[_0x359cae(0x1d5)](a5_0xbb67a4[_0x359cae(0x1e0)](_0x359cae(0x240)+_0x32e6a2[_0x359cae(0x24b)]+'\x22:'));for(const _0x2a66a5 of _0x32e6a2[_0x359cae(0x1f0)]){console[_0x359cae(0x1d5)]('\x20\x20-\x20'+_0x2a66a5);}return console[_0x359cae(0x1d5)](),console[_0x359cae(0x1d5)]('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x3977be+_0x359cae(0x20a)),0x1;}case _0x359cae(0x1ff):console['log'](a5_0xbb67a4[_0x359cae(0x1e0)](_0x359cae(0x206)+_0x32e6a2[_0x359cae(0x24b)]+'\x22.')),console[_0x359cae(0x1d5)](a5_0xbb67a4[_0x359cae(0x20f)](_0x359cae(0x1ec)+_0x32e6a2['projectDir'])),console['log'](),console[_0x359cae(0x1d5)](_0x359cae(0x224));return 0x1;}}const {definition:_0x114444,agentInfo:_0x338b51}=parseTestFile(_0x3d5287);let _0x49ee94=_0x114444[_0x359cae(0x231)];if(_0x39e656){const _0x471a3f=_0x39e656[_0x359cae(0x250)](',')[_0x359cae(0x23e)](_0x5d9158=>_0x5d9158['trim']());_0x49ee94=_0x114444['tests']['filter'](_0x1b31fe=>_0x471a3f[_0x359cae(0x232)](_0x1b31fe[_0x359cae(0x1e6)]));if(_0x49ee94['length']===0x0)return console[_0x359cae(0x1d5)](a5_0xbb67a4[_0x359cae(0x1e0)](_0x359cae(0x1d7)+_0x39e656)),console[_0x359cae(0x1d5)](a5_0xbb67a4['dim']('Available\x20tests:\x20'+_0x114444[_0x359cae(0x231)][_0x359cae(0x23e)](_0x59161e=>_0x59161e[_0x359cae(0x1e6)])[_0x359cae(0x238)](',\x20'))),0x1;}if(_0x1f68a8){const _0x16f725=_0x1f68a8[_0x359cae(0x250)](',')[_0x359cae(0x23e)](_0x3e3f75=>_0x3e3f75['trim']()[_0x359cae(0x25e)]());_0x49ee94=_0x49ee94[_0x359cae(0x1f9)](_0xe7d7c3=>_0xe7d7c3[_0x359cae(0x1df)]?.['some'](_0x21644c=>_0x16f725[_0x359cae(0x232)](_0x21644c[_0x359cae(0x25e)]())));if(_0x49ee94[_0x359cae(0x1fb)]===0x0){console['log'](a5_0xbb67a4[_0x359cae(0x1e0)](_0x359cae(0x235)+_0x1f68a8));const _0x119811=new Set();return _0x114444[_0x359cae(0x231)][_0x359cae(0x245)](_0x534d2e=>_0x534d2e[_0x359cae(0x1df)]?.['forEach'](_0x157eb0=>_0x119811[_0x359cae(0x1f7)](_0x157eb0))),_0x119811[_0x359cae(0x23b)]>0x0?console['log'](a5_0xbb67a4[_0x359cae(0x20f)](_0x359cae(0x255)+[..._0x119811][_0x359cae(0x238)](',\x20'))):console[_0x359cae(0x1d5)](a5_0xbb67a4[_0x359cae(0x20f)](_0x359cae(0x237))),0x1;}}if(_0x2b8edd)return this[_0x359cae(0x20b)](_0xf2ae35,{'definition':{'tests':_0x49ee94},'agentInfo':_0x338b51,'outputFormat':_0x2e51a6,'outputFile':_0x5e0167,'testNames':_0x39e656});if(_0x53e934){console[_0x359cae(0x1d5)](a5_0xbb67a4['cyan'](_0x359cae(0x21f))),console[_0x359cae(0x1d5)](_0x359cae(0x253)+a5_0xbb67a4['white'](_0x1096eb)),console[_0x359cae(0x1d5)](_0x359cae(0x1f4)+a5_0xbb67a4[_0x359cae(0x21d)](_0x338b51[_0x359cae(0x23f)])),console[_0x359cae(0x1d5)]('\x20\x20Agent:\x20'+a5_0xbb67a4['white'](_0x338b51[_0x359cae(0x203)])),console[_0x359cae(0x1d5)](),console[_0x359cae(0x1d5)](_0x359cae(0x1f5)+a5_0xbb67a4[_0x359cae(0x21d)](_0x49ee94[_0x359cae(0x1fb)]));for(let _0x27a20e=0x0;_0x27a20e<_0x49ee94[_0x359cae(0x1fb)];_0x27a20e++){const _0x3d311c=_0x49ee94[_0x27a20e],_0x330246=_0x3d311c[_0x359cae(0x254)][_0x359cae(0x1fb)]===0x1?'round':'rounds',_0x2f7972=_0x3d311c[_0x359cae(0x1df)]?.[_0x359cae(0x1fb)]?'\x20['+_0x3d311c['tags'][_0x359cae(0x238)](',\x20')+']':'';console[_0x359cae(0x1d5)]('\x20\x20'+(_0x27a20e+0x1)+'.\x20'+a5_0xbb67a4[_0x359cae(0x21d)](_0x3d311c['name'])+'\x20('+_0x3d311c['rounds'][_0x359cae(0x1fb)]+'\x20'+_0x330246+')'+a5_0xbb67a4[_0x359cae(0x20f)](_0x2f7972));}return 0x0;}let _0x42c564,_0x1f1d53;try{_0x42c564=await _0x37daa8[_0x359cae(0x262)][_0x359cae(0x207)](_0x338b51[_0x359cae(0x23f)]);}catch(_0x2d57fa){const _0x54e453=_0x2d57fa instanceof Error?_0x2d57fa[_0x359cae(0x1e1)]:String(_0x2d57fa);return _0x54e453[_0x359cae(0x232)](_0x359cae(0x25b))||_0x54e453[_0x359cae(0x25e)]()['includes'](_0x359cae(0x24e))?console[_0x359cae(0x1d5)](a5_0xbb67a4[_0x359cae(0x20c)](_0x359cae(0x249)+_0x338b51[_0x359cae(0x23f)])):console[_0x359cae(0x1d5)](a5_0xbb67a4['red'](_0x359cae(0x202)+_0x338b51[_0x359cae(0x23f)]+_0x359cae(0x24f)+_0x54e453)),0x1;}try{_0x1f1d53=await _0x37daa8[_0x359cae(0x262)][_0x359cae(0x1fa)](_0x338b51[_0x359cae(0x203)],_0x42c564);}catch(_0x1d9ec3){const _0x3d9f3e=_0x1d9ec3 instanceof Error?_0x1d9ec3[_0x359cae(0x1e1)]:String(_0x1d9ec3);return _0x3d9f3e[_0x359cae(0x232)]('404')||_0x3d9f3e[_0x359cae(0x25e)]()[_0x359cae(0x232)](_0x359cae(0x24e))?console[_0x359cae(0x1d5)](a5_0xbb67a4['red']('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x338b51[_0x359cae(0x203)])):console[_0x359cae(0x1d5)](a5_0xbb67a4[_0x359cae(0x20c)](_0x359cae(0x1f6)+_0x338b51[_0x359cae(0x203)]+_0x359cae(0x24f)+_0x3d9f3e)),0x1;}let _0x5b2f22;if(!_0x270141)try{_0x5b2f22=await setupEvaluatorAgent(_0x37daa8[_0x359cae(0x262)],_0x299263[_0x359cae(0x1d6)]);}catch(_0x587669){const _0x5b816a=_0x587669 instanceof Error?_0x587669[_0x359cae(0x1e1)]:String(_0x587669);return console[_0x359cae(0x1d5)](a5_0xbb67a4[_0x359cae(0x20c)](_0x359cae(0x248)+_0x5b816a)),0x1;}console[_0x359cae(0x1d5)](a5_0xbb67a4['cyan']('Running\x20agent\x20tests...')),console[_0x359cae(0x1d5)](_0x359cae(0x233)+a5_0xbb67a4[_0x359cae(0x21d)](_0x1096eb)),console['log'](_0x359cae(0x1db)+a5_0xbb67a4[_0x359cae(0x21d)](_0x338b51[_0x359cae(0x23f)]+'/'+_0x338b51[_0x359cae(0x203)])),console[_0x359cae(0x1d5)]();const _0x42c146=[],_0x56ae5a=[],_0x745ba=Date[_0x359cae(0x228)]();for(let _0x50df2a=0x0;_0x50df2a<_0x49ee94[_0x359cae(0x1fb)];_0x50df2a++){const _0x4356d4=_0x49ee94[_0x50df2a];_0x49ee94['length']>0x1?console[_0x359cae(0x1d5)]('Test\x20'+(_0x50df2a+0x1)+'/'+_0x49ee94['length']+':\x20'+a5_0xbb67a4[_0x359cae(0x21d)](_0x4356d4[_0x359cae(0x1e6)])):console['log']('Running\x20test:\x20'+a5_0xbb67a4['white'](_0x4356d4[_0x359cae(0x1e6)]));const _0x2fde68=createCommandSpinner('Round\x201/'+_0x4356d4[_0x359cae(0x254)]['length']+':\x20Sending\x20user\x20input...');_0x2fde68[_0x359cae(0x1ee)]();try{const {result:_0x2fea1f,conversation:_0x2f3faf}=await runTest(_0x37daa8[_0x359cae(0x262)],_0x4356d4,{'agentId':_0x1f1d53,'projectId':_0x42c564,'site':_0x1096eb,'noEval':_0x270141,'evaluatorId':_0x5b2f22,'onRoundStart':(_0x3700e2,_0xb9e456)=>{const _0x53c28a=_0x359cae;_0x2fde68[_0x53c28a(0x1e3)]=_0x53c28a(0x22d)+(_0x3700e2+0x1)+'/'+_0xb9e456+_0x53c28a(0x214);},'onRoundComplete':(_0x2ad0ad,_0x16f39e,_0x4ef1f8)=>{const _0x1da93a=_0x359cae,_0x4ee079=formatElapsed(_0x16f39e);_0x4ef1f8?console[_0x1da93a(0x1d5)](_0x1da93a(0x1ea)+(_0x2ad0ad+0x1)+'/'+_0x4356d4[_0x1da93a(0x254)][_0x1da93a(0x1fb)]+_0x1da93a(0x1fc)+a5_0xbb67a4[_0x1da93a(0x1ef)]('✓')+'\x20('+_0x4ee079+')'):console['log']('\x20\x20Round\x20'+(_0x2ad0ad+0x1)+'/'+_0x4356d4[_0x1da93a(0x254)][_0x1da93a(0x1fb)]+_0x1da93a(0x1fc)+a5_0xbb67a4['red']('✗'));},'onEvaluationStart':()=>{const _0x3161e1=_0x359cae;_0x2fde68['text']=_0x3161e1(0x230);},'onEvaluationComplete':_0x57b997=>{const _0x1e96e7=_0x359cae,_0x56432d=formatElapsed(_0x57b997);console[_0x1e96e7(0x1d5)](_0x1e96e7(0x242)+a5_0xbb67a4[_0x1e96e7(0x1ef)]('✓')+'\x20('+_0x56432d+')');}});_0x2fde68[_0x359cae(0x25a)](),_0x42c146[_0x359cae(0x23c)](_0x2fea1f),_0x56ae5a[_0x359cae(0x23c)](_0x2f3faf);if(_0x2fea1f[_0x359cae(0x1e2)]===_0x359cae(0x1eb))console[_0x359cae(0x1d5)](a5_0xbb67a4[_0x359cae(0x1ef)]('✓\x20PASS:\x20'+_0x2fea1f['reason']));else _0x2fea1f['status']===_0x359cae(0x227)?console['log'](a5_0xbb67a4['red'](_0x359cae(0x1fe)+_0x2fea1f[_0x359cae(0x25d)])):console[_0x359cae(0x1d5)](a5_0xbb67a4[_0x359cae(0x20c)](_0x359cae(0x200)+_0x2fea1f[_0x359cae(0x25d)]));_0x2fea1f[_0x359cae(0x258)]&&console[_0x359cae(0x1d5)](a5_0xbb67a4[_0x359cae(0x20f)](_0x359cae(0x1f2)+_0x2fea1f[_0x359cae(0x258)])),console[_0x359cae(0x1d5)]();}catch(_0x536446){_0x2fde68[_0x359cae(0x25a)]();const _0x26e9cf=_0x536446 instanceof Error?_0x536446[_0x359cae(0x1e1)]:String(_0x536446);console[_0x359cae(0x1d5)](a5_0xbb67a4[_0x359cae(0x20c)](_0x359cae(0x200)+_0x26e9cf)),console[_0x359cae(0x1d5)](),_0x42c146[_0x359cae(0x23c)]({'name':_0x4356d4[_0x359cae(0x1e6)],'status':_0x359cae(0x218),'reason':_0x26e9cf,'timestamp':new Date()[_0x359cae(0x241)](),'duration_ms':0x0});}}const _0x162d89=Date[_0x359cae(0x228)]()-_0x745ba,_0x51abf4=_0x42c146[_0x359cae(0x1f9)](_0x3a6814=>_0x3a6814['status']===_0x359cae(0x1eb))[_0x359cae(0x1fb)],_0x14a6a8=_0x42c146[_0x359cae(0x1f9)](_0x2a5f67=>_0x2a5f67[_0x359cae(0x1e2)]==='FAIL')[_0x359cae(0x1fb)],_0x2917e8=_0x42c146[_0x359cae(0x1f9)](_0x3b02e1=>_0x3b02e1['status']==='ERROR')['length'];console[_0x359cae(0x1d5)]('━'['repeat'](0x3c)),console[_0x359cae(0x1d5)](_0x359cae(0x22b)),console[_0x359cae(0x1d5)]('━'[_0x359cae(0x22c)](0x3c)),console[_0x359cae(0x1d5)](_0x359cae(0x220)+_0x42c146[_0x359cae(0x1fb)]),console['log'](_0x359cae(0x216)+a5_0xbb67a4[_0x359cae(0x1ef)](_0x51abf4)),console[_0x359cae(0x1d5)](_0x359cae(0x1f3)+a5_0xbb67a4[_0x359cae(0x20c)](_0x14a6a8));_0x2917e8>0x0&&console[_0x359cae(0x1d5)]('Errors:\x20\x20\x20'+a5_0xbb67a4[_0x359cae(0x20c)](_0x2917e8));console[_0x359cae(0x1d5)]('Duration:\x20'+formatElapsed(_0x162d89)),console[_0x359cae(0x1d5)]('━'[_0x359cae(0x22c)](0x3c));const _0x488404=_0x42c146[_0x359cae(0x1f9)](_0x502d3b=>_0x502d3b['status']!==_0x359cae(0x1eb));if(_0x488404[_0x359cae(0x1fb)]>0x0){console[_0x359cae(0x1d5)](),console[_0x359cae(0x1d5)]('Failed\x20Tests:');for(const _0x46a09b of _0x488404){const _0x58e0c6=a5_0xbb67a4['red']('✗'),_0x34632b=_0x46a09b[_0x359cae(0x25d)][_0x359cae(0x1fb)]>0x32?_0x46a09b[_0x359cae(0x25d)]['substring'](0x0,0x32)+_0x359cae(0x239):_0x46a09b[_0x359cae(0x25d)];console[_0x359cae(0x1d5)]('\x20\x20'+_0x58e0c6+'\x20'+_0x46a09b[_0x359cae(0x1e6)]+':\x20'+_0x34632b);}}const _0x584b92={'summary':{'total':_0x42c146['length'],'passed':_0x51abf4,'failed':_0x14a6a8,'errors':_0x2917e8>0x0?_0x2917e8:undefined,'duration_ms':_0x162d89},'tests':_0x42c146,'agent':{'project':_0x338b51[_0x359cae(0x23f)],'name':_0x338b51['agentName'],'site':_0x1096eb},'timestamp':new Date(_0x745ba)[_0x359cae(0x241)]()};try{const _0x5d8edf=buildCachedTestRun(_0x56ae5a,{'site':_0x1096eb,'projectId':_0x42c564,'projectName':_0x338b51['projectName'],'agentId':_0x1f1d53,'agentName':_0x338b51[_0x359cae(0x203)],'testYmlPath':a5_0x4c929d[_0x359cae(0x201)](_0x338b51[_0x359cae(0x259)])});saveLastTestRun(_0x5d8edf);}catch{}if(_0x2e51a6!=='table'||_0x5e0167){const _0x1a9789=formatResults(_0x584b92,_0x2e51a6);if(_0x5e0167)try{a5_0x3895a8['writeFileSync'](_0x5e0167,_0x1a9789,_0x359cae(0x21c)),console['log'](),console[_0x359cae(0x1d5)](a5_0xbb67a4[_0x359cae(0x20f)]('Output\x20written\x20to:\x20'+_0x5e0167));}catch(_0x1ce855){return console['log'](),console['log'](a5_0xbb67a4[_0x359cae(0x20c)](_0x359cae(0x1da)+_0x1ce855)),0x1;}else console[_0x359cae(0x1d5)](),console[_0x359cae(0x1d5)](_0x1a9789);}return _0x488404['length']>0x0?0x1:0x0;}async[a5_0x218a66(0x20b)](_0x12685a,_0x447b21){const _0x3f4080=a5_0x218a66,{options:_0x14b5ee,tdx:_0x46b2b8}=_0x12685a,{definition:_0x51909e,agentInfo:_0x3861f5,outputFormat:_0x56d2f3,outputFile:_0x18789c}=_0x447b21,_0x335e55=_0x14b5ee[_0x3f4080(0x210)],_0x2ea448=loadLastTestRun();if(!_0x2ea448)return console[_0x3f4080(0x1d5)](a5_0xbb67a4['red'](_0x3f4080(0x246))),console['log'](a5_0xbb67a4[_0x3f4080(0x20f)](_0x3f4080(0x247))),0x1;if(_0x2ea448[_0x3f4080(0x1dc)]['agentName']!==_0x3861f5[_0x3f4080(0x203)])return console[_0x3f4080(0x1d5)](a5_0xbb67a4['red'](_0x3f4080(0x234)+_0x2ea448[_0x3f4080(0x1dc)][_0x3f4080(0x203)]+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x3861f5[_0x3f4080(0x203)]+'\x22.')),console['log'](a5_0xbb67a4[_0x3f4080(0x20f)](_0x3f4080(0x251))),0x1;const _0x5aa76f=new Set(_0x2ea448[_0x3f4080(0x1d8)][_0x3f4080(0x23e)](_0x4da8ec=>_0x4da8ec[_0x3f4080(0x1d9)])),_0x3a33cd=_0x51909e['tests'][_0x3f4080(0x1f9)](_0x28a38e=>!_0x5aa76f[_0x3f4080(0x1e5)](_0x28a38e[_0x3f4080(0x1e6)]));if(_0x3a33cd['length']>0x0&&_0x2ea448['site']!==_0x335e55)return console[_0x3f4080(0x1d5)](a5_0xbb67a4[_0x3f4080(0x20c)]('Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.')),console[_0x3f4080(0x1d5)](a5_0xbb67a4[_0x3f4080(0x20f)](_0x3f4080(0x229)+_0x2ea448[_0x3f4080(0x210)]+_0x3f4080(0x21e)+_0x335e55+'\x22.')),console[_0x3f4080(0x1d5)](a5_0xbb67a4[_0x3f4080(0x20f)](_0x3f4080(0x219)+_0x2ea448[_0x3f4080(0x210)]+_0x3f4080(0x21a))),0x1;const _0xcde5bd=_0x51909e[_0x3f4080(0x231)]['filter'](_0x2bc678=>_0x5aa76f[_0x3f4080(0x1e5)](_0x2bc678[_0x3f4080(0x1e6)])),_0x5c67cc=_0x3a33cd;let _0x36bf3a;try{_0x36bf3a=await setupEvaluatorAgent(_0x46b2b8[_0x3f4080(0x262)],_0x14b5ee[_0x3f4080(0x1d6)]);}catch(_0x1fb901){const _0xc2c88a=_0x1fb901 instanceof Error?_0x1fb901[_0x3f4080(0x1e1)]:String(_0x1fb901);return console[_0x3f4080(0x1d5)](a5_0xbb67a4['red'](_0x3f4080(0x248)+_0xc2c88a)),0x1;}console[_0x3f4080(0x1d5)](a5_0xbb67a4[_0x3f4080(0x22f)](_0x3f4080(0x1e4))),console[_0x3f4080(0x1d5)]('Cached\x20run\x20from:\x20'+a5_0xbb67a4[_0x3f4080(0x21d)](_0x2ea448['timestamp'])),console[_0x3f4080(0x1d5)](_0x3f4080(0x1db)+a5_0xbb67a4[_0x3f4080(0x21d)](_0x2ea448['agent'][_0x3f4080(0x23f)]+'/'+_0x2ea448[_0x3f4080(0x1dc)]['agentName']));_0x5c67cc[_0x3f4080(0x1fb)]>0x0&&console[_0x3f4080(0x1d5)](_0x3f4080(0x1e7)+a5_0xbb67a4['yellow'](_0x5c67cc[_0x3f4080(0x1fb)]));console[_0x3f4080(0x1d5)]();const _0x5b78af=[],_0x107377=Date['now'](),_0x34c33e=createCommandSpinner(_0x3f4080(0x20d));if(_0xcde5bd[_0x3f4080(0x1fb)]>0x0)try{const _0x1423ab=await reevaluateFromCache(_0x46b2b8[_0x3f4080(0x262)],_0x2ea448,{'tests':_0xcde5bd},{'evaluatorId':_0x36bf3a,'onTestStart':(_0x435feb,_0x32ffb8,_0x26c64a)=>{const _0x4767a2=_0x3f4080;_0x34c33e[_0x4767a2(0x1e3)]=_0x4767a2(0x260)+(_0x32ffb8+0x1)+'/'+_0x26c64a+':\x20'+_0x435feb+_0x4767a2(0x239);if(!_0x34c33e['isSpinning'])_0x34c33e['start']();},'onTestComplete':(_0x18172a,_0x58a0a2)=>{const _0x2a0174=_0x3f4080;_0x34c33e[_0x2a0174(0x25a)]();if(_0x58a0a2[_0x2a0174(0x1e2)]===_0x2a0174(0x1eb))console[_0x2a0174(0x1d5)](a5_0xbb67a4[_0x2a0174(0x1ef)](_0x2a0174(0x20e)+_0x18172a)+a5_0xbb67a4['dim'](_0x2a0174(0x23a)));else _0x58a0a2[_0x2a0174(0x1e2)]===_0x2a0174(0x227)?console['log'](a5_0xbb67a4['red']('✗\x20FAIL:\x20'+_0x18172a+_0x2a0174(0x1ed)+_0x58a0a2['reason'])+a5_0xbb67a4[_0x2a0174(0x20f)](_0x2a0174(0x23a))):console['log'](a5_0xbb67a4[_0x2a0174(0x20c)]('✗\x20ERROR:\x20'+_0x18172a+_0x2a0174(0x1ed)+_0x58a0a2[_0x2a0174(0x25d)]));_0x58a0a2[_0x2a0174(0x258)]&&console[_0x2a0174(0x1d5)](a5_0xbb67a4[_0x2a0174(0x20f)]('\x20\x20Conversation:\x20'+_0x58a0a2[_0x2a0174(0x258)])),_0x5b78af[_0x2a0174(0x23c)](_0x58a0a2);},'onTestSkipped':(_0x8465d1,_0x126e76)=>{const _0x55834e=_0x3f4080;_0x34c33e[_0x55834e(0x25a)](),console[_0x55834e(0x1d5)](a5_0xbb67a4['yellow'](_0x55834e(0x1de)+_0x8465d1+_0x55834e(0x1ed)+_0x126e76));}});for(const _0x1953fe of _0x1423ab){!_0x5b78af[_0x3f4080(0x1f1)](_0x2ddded=>_0x2ddded[_0x3f4080(0x1e6)]===_0x1953fe[_0x3f4080(0x1e6)])&&_0x5b78af['push'](_0x1953fe);}}catch(_0x2ea1e9){_0x34c33e['stop']();const _0x2cb513=_0x2ea1e9 instanceof Error?_0x2ea1e9[_0x3f4080(0x1e1)]:String(_0x2ea1e9);return console[_0x3f4080(0x1d5)](a5_0xbb67a4[_0x3f4080(0x20c)]('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0x2cb513)),0x1;}_0x34c33e['stop']();if(_0x5c67cc[_0x3f4080(0x1fb)]>0x0){console[_0x3f4080(0x1d5)](),console[_0x3f4080(0x1d5)](a5_0xbb67a4[_0x3f4080(0x22f)]('Executing\x20new\x20tests...'));const {projectId:_0x51a750,agentId:_0x6d2a74}=_0x2ea448[_0x3f4080(0x1dc)];for(const _0x289d76 of _0x5c67cc){console[_0x3f4080(0x1d5)]('Running:\x20'+a5_0xbb67a4[_0x3f4080(0x21d)](_0x289d76[_0x3f4080(0x1e6)]));const _0x3a434c=createCommandSpinner(_0x3f4080(0x22a)+_0x289d76[_0x3f4080(0x254)][_0x3f4080(0x1fb)]+_0x3f4080(0x214));_0x3a434c['start']();try{const {result:_0x3deb36}=await runTest(_0x46b2b8['llm'],_0x289d76,{'agentId':_0x6d2a74,'projectId':_0x51a750,'site':_0x2ea448[_0x3f4080(0x210)],'noEval':![],'evaluatorId':_0x36bf3a,'onRoundStart':(_0x13d922,_0x687a60)=>{const _0x1c2542=_0x3f4080;_0x3a434c[_0x1c2542(0x1e3)]=_0x1c2542(0x22d)+(_0x13d922+0x1)+'/'+_0x687a60+_0x1c2542(0x214);},'onRoundComplete':(_0xb8c4ad,_0x589cd5,_0x93f23b)=>{const _0x3dd7a4=_0x3f4080,_0x51cc32=formatElapsed(_0x589cd5);_0x93f23b?console[_0x3dd7a4(0x1d5)](_0x3dd7a4(0x1ea)+(_0xb8c4ad+0x1)+'/'+_0x289d76[_0x3dd7a4(0x254)]['length']+_0x3dd7a4(0x1fc)+a5_0xbb67a4[_0x3dd7a4(0x1ef)]('✓')+'\x20('+_0x51cc32+')'):console[_0x3dd7a4(0x1d5)](_0x3dd7a4(0x1ea)+(_0xb8c4ad+0x1)+'/'+_0x289d76[_0x3dd7a4(0x254)][_0x3dd7a4(0x1fb)]+'...\x20'+a5_0xbb67a4[_0x3dd7a4(0x20c)]('✗'));},'onEvaluationStart':()=>{const _0x55c040=_0x3f4080;_0x3a434c[_0x55c040(0x1e3)]=_0x55c040(0x230);},'onEvaluationComplete':_0x32a21a=>{const _0x41f52f=_0x3f4080,_0x38cb3b=formatElapsed(_0x32a21a);console[_0x41f52f(0x1d5)]('\x20\x20Evaluating...\x20'+a5_0xbb67a4[_0x41f52f(0x1ef)]('✓')+'\x20('+_0x38cb3b+')');}});_0x3a434c[_0x3f4080(0x25a)](),_0x5b78af[_0x3f4080(0x23c)](_0x3deb36);if(_0x3deb36[_0x3f4080(0x1e2)]===_0x3f4080(0x1eb))console[_0x3f4080(0x1d5)](a5_0xbb67a4[_0x3f4080(0x1ef)](_0x3f4080(0x20e)+_0x3deb36['reason'])+a5_0xbb67a4[_0x3f4080(0x20f)](_0x3f4080(0x212)));else _0x3deb36[_0x3f4080(0x1e2)]==='FAIL'?console[_0x3f4080(0x1d5)](a5_0xbb67a4[_0x3f4080(0x20c)](_0x3f4080(0x1fe)+_0x3deb36[_0x3f4080(0x25d)])+a5_0xbb67a4[_0x3f4080(0x20f)](_0x3f4080(0x212))):console['log'](a5_0xbb67a4[_0x3f4080(0x20c)](_0x3f4080(0x200)+_0x3deb36[_0x3f4080(0x25d)]));_0x3deb36[_0x3f4080(0x258)]&&console[_0x3f4080(0x1d5)](a5_0xbb67a4[_0x3f4080(0x20f)](_0x3f4080(0x23d)+_0x3deb36['conversation_url']));}catch(_0x3a41b3){_0x3a434c[_0x3f4080(0x25a)]();const _0x4c4339=_0x3a41b3 instanceof Error?_0x3a41b3['message']:String(_0x3a41b3);console[_0x3f4080(0x1d5)](a5_0xbb67a4[_0x3f4080(0x20c)]('✗\x20ERROR:\x20'+_0x4c4339)),_0x5b78af[_0x3f4080(0x23c)]({'name':_0x289d76[_0x3f4080(0x1e6)],'status':_0x3f4080(0x218),'reason':_0x4c4339,'timestamp':new Date()[_0x3f4080(0x241)](),'duration_ms':0x0});}}}console['log']();const _0x1c9b12=Date[_0x3f4080(0x228)]()-_0x107377,_0x4e83a5=_0x5b78af['filter'](_0x351aa0=>_0x351aa0[_0x3f4080(0x1e2)]==='PASS')['length'],_0x4b64fe=_0x5b78af[_0x3f4080(0x1f9)](_0x4fa10d=>_0x4fa10d[_0x3f4080(0x1e2)]==='FAIL')['length'],_0x3292ed=_0x5b78af[_0x3f4080(0x1f9)](_0x360db5=>_0x360db5[_0x3f4080(0x1e2)]===_0x3f4080(0x218))[_0x3f4080(0x1fb)];console[_0x3f4080(0x1d5)]('━'['repeat'](0x3c)),console[_0x3f4080(0x1d5)](_0x3f4080(0x1f8)),console[_0x3f4080(0x1d5)]('━'[_0x3f4080(0x22c)](0x3c)),console[_0x3f4080(0x1d5)](_0x3f4080(0x220)+_0x5b78af[_0x3f4080(0x1fb)]),console[_0x3f4080(0x1d5)]('Passed:\x20\x20\x20'+a5_0xbb67a4[_0x3f4080(0x1ef)](_0x4e83a5)),console[_0x3f4080(0x1d5)](_0x3f4080(0x1f3)+a5_0xbb67a4[_0x3f4080(0x20c)](_0x4b64fe));_0x3292ed>0x0&&console['log'](_0x3f4080(0x208)+a5_0xbb67a4['red'](_0x3292ed));console[_0x3f4080(0x1d5)]('Duration:\x20'+formatElapsed(_0x1c9b12)),console['log']('━'['repeat'](0x3c));const _0x516f4e={'summary':{'total':_0x5b78af[_0x3f4080(0x1fb)],'passed':_0x4e83a5,'failed':_0x4b64fe,'errors':_0x3292ed>0x0?_0x3292ed:undefined,'duration_ms':_0x1c9b12},'tests':_0x5b78af,'agent':{'project':_0x3861f5['projectName'],'name':_0x3861f5[_0x3f4080(0x203)],'site':_0x335e55},'timestamp':new Date(_0x107377)[_0x3f4080(0x241)]()};if(_0x56d2f3!==_0x3f4080(0x256)||_0x18789c){const _0x4624c2=formatResults(_0x516f4e,_0x56d2f3);if(_0x18789c)try{a5_0x3895a8['writeFileSync'](_0x18789c,_0x4624c2,_0x3f4080(0x21c)),console[_0x3f4080(0x1d5)](),console[_0x3f4080(0x1d5)](a5_0xbb67a4[_0x3f4080(0x20f)](_0x3f4080(0x25c)+_0x18789c));}catch(_0x314db9){return console['log'](),console[_0x3f4080(0x1d5)](a5_0xbb67a4[_0x3f4080(0x20c)](_0x3f4080(0x1da)+_0x314db9)),0x1;}else console['log'](),console[_0x3f4080(0x1d5)](_0x4624c2);}const _0x1d6526=_0x5b78af[_0x3f4080(0x1f9)](_0x4e28fd=>_0x4e28fd[_0x3f4080(0x1e2)]!==_0x3f4080(0x1eb));return _0x1d6526[_0x3f4080(0x1fb)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a6_0xe94d(){const _0x5c6da5=['method','Endpoint\x20must\x20start\x20with\x20/:\x20','623440VTCyrP','toUpperCase','workflow','21tdoyKC','output','Invalid\x20API\x20type:\x20','file','x-trino-user','set-cookie2','5275917SJmhpG','179540tRFRdI','isArray','length','x-xsrf-token','api','log','cdp','1702728Wnwuzf','.\x20Valid\x20types:\x20','request','Invalid\x20HTTP\x20method:\x20','566kYkJcN','validate','has','proxy-authorization','description','PATCH','keys','data','includes','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','GET','Error:\x20','901932gVfqbs','startsWith','\x22.\x20','headers','5pNWRVH','substring','error','join','body','header','color','execute','\x0aStack\x20trace:\x0a','site','authorization','type','PUT','readBodyFromFile','name','trim','stack','set-cookie','1903643eEAvjf','Results\x20saved\x20to\x20','llm-proxy','cookie','DELETE','trino','verbose','message','toLowerCase','llm','cas'];a6_0xe94d=function(){return _0x5c6da5;};return a6_0xe94d();}const a6_0x375794=a6_0x3904;(function(_0x463a70,_0x508987){const _0x4a6dbf=a6_0x3904,_0x500fef=_0x463a70();while(!![]){try{const _0x3ca0f6=-parseInt(_0x4a6dbf(0x1c1))/0x1+parseInt(_0x4a6dbf(0x1cc))/0x2*(parseInt(_0x4a6dbf(0x1ba))/0x3)+parseInt(_0x4a6dbf(0x1d8))/0x4*(parseInt(_0x4a6dbf(0x1dc))/0x5)+-parseInt(_0x4a6dbf(0x1c8))/0x6+-parseInt(_0x4a6dbf(0x1aa))/0x7+parseInt(_0x4a6dbf(0x1b7))/0x8+parseInt(_0x4a6dbf(0x1c0))/0x9;if(_0x3ca0f6===_0x508987)break;else _0x500fef['push'](_0x500fef['shift']());}catch(_0xe71e2d){_0x500fef['push'](_0x500fef['shift']());}}}(a6_0xe94d,0x262aa));function a6_0x3904(_0x2be4ee,_0x32d8d9){_0x2be4ee=_0x2be4ee-0x1a1;const _0xe94d39=a6_0xe94d();let _0x3904f9=_0xe94d39[_0x2be4ee];return _0x3904f9;}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';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x375794(0x1a2),a6_0x375794(0x1cf),a6_0x375794(0x1ad),a6_0x375794(0x1a9),a6_0x375794(0x1bf),a6_0x375794(0x1c4),'x-auth-token',a6_0x375794(0x1be)]);function isSensitiveHeader(_0x556360){const _0x1a01dd=a6_0x375794;return SENSITIVE_HEADERS[_0x1a01dd(0x1ce)](_0x556360[_0x1a01dd(0x1b2)]());}function parseHeader(_0x2981a6){const _0x357dbe=a6_0x375794,_0x3e9ed4=_0x2981a6['indexOf'](':');if(_0x3e9ed4===-0x1)throw new Error('Invalid\x20header\x20format:\x20\x22'+_0x2981a6+_0x357dbe(0x1da)+'Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22');const _0x3282d4=_0x2981a6[_0x357dbe(0x1dd)](0x0,_0x3e9ed4)[_0x357dbe(0x1a7)](),_0x1ffc07=_0x2981a6[_0x357dbe(0x1dd)](_0x3e9ed4+0x1)[_0x357dbe(0x1a7)]();if(!_0x3282d4)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0x2981a6+'\x22');return[_0x3282d4,_0x1ffc07];}export class ApiCommand extends BaseCommand{[a6_0x375794(0x1a6)]=a6_0x375794(0x1c5);[a6_0x375794(0x1d0)]='Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs';[a6_0x375794(0x1cd)](_0x3e5b25){const _0x33ee5d=a6_0x375794,{args:_0x25f35c,options:_0x106479}=_0x3e5b25,_0x358d07=_0x106479;if(_0x25f35c[_0x33ee5d(0x1c3)]===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x4bf3d3=_0x25f35c[0x0];if(!_0x4bf3d3[_0x33ee5d(0x1d9)]('/'))return _0x33ee5d(0x1b6)+_0x4bf3d3;const _0x21aba2=_0x358d07['data'],_0x483fda=_0x358d07[_0x33ee5d(0x1bd)];if(_0x21aba2&&_0x483fda)return _0x33ee5d(0x1d5);const _0x392eba=_0x358d07[_0x33ee5d(0x1b5)]||_0x33ee5d(0x1d6),_0x21e366=[_0x33ee5d(0x1d6),'POST',_0x33ee5d(0x1a4),_0x33ee5d(0x1ae),_0x33ee5d(0x1d1)];if(!_0x21e366[_0x33ee5d(0x1d4)](_0x392eba[_0x33ee5d(0x1b8)]()))return _0x33ee5d(0x1cb)+_0x392eba+'.\x20Valid\x20methods:\x20'+_0x21e366[_0x33ee5d(0x1df)](',\x20');const _0xa56e6f=_0x358d07[_0x33ee5d(0x1a3)]||'td',_0x20ae36=['td',_0x33ee5d(0x1c7),_0x33ee5d(0x1b9),_0x33ee5d(0x1af),_0x33ee5d(0x1b3),_0x33ee5d(0x1ac),_0x33ee5d(0x1b4)];if(!_0x20ae36[_0x33ee5d(0x1d4)](_0xa56e6f))return _0x33ee5d(0x1bc)+_0xa56e6f+_0x33ee5d(0x1c9)+_0x20ae36[_0x33ee5d(0x1df)](',\x20');return undefined;}async[a6_0x375794(0x1e3)](_0x2634fe){const _0x4fac4e=a6_0x375794,{options:_0x9891ad,args:_0x3801c3,tdx:_0x289853}=_0x2634fe,_0x3e934b=_0x9891ad,_0x57c907=_0x3801c3[0x0],_0x40ce77=(_0x3e934b[_0x4fac4e(0x1b5)]||_0x4fac4e(0x1d6))[_0x4fac4e(0x1b8)](),_0x2708aa=_0x3e934b['data'],_0xdf18e4=_0x3e934b[_0x4fac4e(0x1bd)],_0x369c99=_0x3e934b[_0x4fac4e(0x1e1)],_0x5d28c5=_0x3e934b['type']||'td';try{const _0x139662={};if(_0x369c99){const _0x32428d=Array[_0x4fac4e(0x1c2)](_0x369c99)?_0x369c99:[_0x369c99];for(const _0x2778d2 of _0x32428d){const [_0x2e0fb4,_0x58623d]=parseHeader(_0x2778d2);_0x139662[_0x2e0fb4]=_0x58623d;}}let _0x10cf03;if(_0x2708aa)_0x10cf03=_0x2708aa;else{if(_0xdf18e4)try{_0x10cf03=RawAPI[_0x4fac4e(0x1a5)](_0xdf18e4);}catch(_0x161ee8){return console[_0x4fac4e(0x1de)](_0x4fac4e(0x1d7)+(_0x161ee8 instanceof Error?_0x161ee8[_0x4fac4e(0x1b1)]:String(_0x161ee8))),0x1;}}const _0x3cdc72={'method':_0x40ce77,'apiType':_0x5d28c5,'includeHeaders':_0x9891ad[_0x4fac4e(0x1b0)]};_0x10cf03&&(_0x3cdc72[_0x4fac4e(0x1e0)]=_0x10cf03);Object[_0x4fac4e(0x1d2)](_0x139662)[_0x4fac4e(0x1c3)]>0x0&&(_0x3cdc72[_0x4fac4e(0x1db)]=_0x139662);if(_0x9891ad[_0x4fac4e(0x1b0)]){const _0x297a26=resolveSite(_0x9891ad[_0x4fac4e(0x1a1)]),_0x1c154c=getEndpoint(_0x297a26,_0x5d28c5),_0x1e4d54=''+_0x1c154c+_0x57c907;console['error']('>\x20'+_0x40ce77+'\x20'+_0x1e4d54);const _0x49b3c7=getAuthHeaders(_0x297a26),_0x17cdcb={..._0x49b3c7,..._0x139662};for(const [_0x338c83,_0x14bacf]of Object['entries'](_0x17cdcb)){!isSensitiveHeader(_0x338c83)&&console[_0x4fac4e(0x1de)]('>\x20'+_0x338c83+':\x20'+_0x14bacf);}_0x10cf03&&console[_0x4fac4e(0x1de)]('>'),console['error']('');}const _0x3f13d8=await _0x289853['api'][_0x4fac4e(0x1ca)](_0x57c907,_0x3cdc72);if(_0x9891ad[_0x4fac4e(0x1b0)]&&_0x3f13d8[_0x4fac4e(0x1db)]){console[_0x4fac4e(0x1de)]('<\x20HTTP/1.1\x20'+_0x3f13d8['status']);for(const [_0x4b6af6,_0x300f11]of Object['entries'](_0x3f13d8[_0x4fac4e(0x1db)])){!isSensitiveHeader(_0x4b6af6)&&console[_0x4fac4e(0x1de)]('<\x20'+_0x4b6af6+':\x20'+_0x300f11);}console['error']('');}const _0x4334e7=Boolean(_0x9891ad[_0x4fac4e(0x1bb)]),_0x375027={'color':_0x9891ad[_0x4fac4e(0x1e2)],'noColor':_0x9891ad['noColor']||_0x4334e7&&!_0x9891ad[_0x4fac4e(0x1e2)]},_0x26a102=colorizeJSON(_0x3f13d8[_0x4fac4e(0x1d3)],_0x375027);return _0x9891ad['output']?(writeFileSync(_0x9891ad[_0x4fac4e(0x1bb)],_0x26a102),console[_0x4fac4e(0x1de)](_0x4fac4e(0x1ab)+_0x9891ad['output'])):console[_0x4fac4e(0x1c6)](_0x26a102),0x0;}catch(_0x2e4fa3){return _0x2e4fa3 instanceof Error?(console[_0x4fac4e(0x1de)](_0x4fac4e(0x1d7)+_0x2e4fa3[_0x4fac4e(0x1b1)]),_0x9891ad[_0x4fac4e(0x1b0)]&&_0x2e4fa3[_0x4fac4e(0x1a8)]&&console[_0x4fac4e(0x1de)](_0x4fac4e(0x1e4)+_0x2e4fa3[_0x4fac4e(0x1a8)])):console[_0x4fac4e(0x1de)](_0x4fac4e(0x1d7)+String(_0x2e4fa3)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a7_0x260f85=a7_0x1a2f;(function(_0x549ef8,_0x473fff){const _0x45e2d4=a7_0x1a2f,_0xfb264f=_0x549ef8();while(!![]){try{const _0x21694d=-parseInt(_0x45e2d4(0x170))/0x1*(parseInt(_0x45e2d4(0x19f))/0x2)+parseInt(_0x45e2d4(0x17c))/0x3+parseInt(_0x45e2d4(0x1a5))/0x4*(-parseInt(_0x45e2d4(0x177))/0x5)+-parseInt(_0x45e2d4(0x197))/0x6+-parseInt(_0x45e2d4(0x1a9))/0x7+-parseInt(_0x45e2d4(0x16c))/0x8*(-parseInt(_0x45e2d4(0x17a))/0x9)+parseInt(_0x45e2d4(0x1b0))/0xa;if(_0x21694d===_0x473fff)break;else _0xfb264f['push'](_0xfb264f['shift']());}catch(_0x5d2c2b){_0xfb264f['push'](_0xfb264f['shift']());}}}(a7_0x5895,0xeb3f1));import{BaseCommand,printAuthError}from'./command.js';function a7_0x1a2f(_0x38adf8,_0x4c915e){_0x38adf8=_0x38adf8-0x169;const _0x589546=a7_0x5895();let _0x1a2f83=_0x589546[_0x38adf8];return _0x1a2f83;}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';function a7_0x5895(){const _0x349752=['Setup\x20API\x20key\x20authentication\x20interactively','name','✗\x20Validation\x20failed:\x20','API\x20Key','No\x20credential\x20found','trim','Enter\x20your\x20TD\x20API\x20key:','tdx:\x20auth\x20setup','message','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','N/A','Setting\x20up\x20authentication\x20for\x20site:\x20','\x20\x20tdx','\x27\x20registered','filter','\x20(site:\x20','Name:\x20','\x0aSetup\x20cancelled','logLevel','auth:setup','status','ERROR','\x20and\x20','1451808NUfJRG','API\x20key\x20cannot\x20be\x20empty','join','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','✓\x20Default\x20site\x20set\x20to\x20','\x20for\x20profile:\x20','us01','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','12jbvxFa','profile','\x20--profile\x20','last_name','\x20removed\x20from\x20keychain','apiKey','32276bekIZw','execute','yellow','No\x20credentials\x20found\x20in\x20keychain','5343429WjrobX','site','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','log','You\x20can\x20find\x20your\x20API\x20key\x20at:','OAuth\x20(browser\x20login)','select','11679130LiGKhg','Setup\x20cancelled','error','OAuth\x20tokens','oauth','password','all','first_name','getUserInfo','32moCOfn','Remove\x20API\x20key\x20from\x20system\x20keychain','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','method','32978aEtiqG','Credential\x20type:\x20OAuth','Validating\x20API\x20key...','description','✓\x20Profile\x20\x27','warn','API\x20key','1095EYZpdW','\x20(profile:\x20','tdx:\x20auth\x20clear','2051802nqbzyZ','email','5562114LVYCBv','User:\x20','red','Choose\x20authentication\x20method:'];a7_0x5895=function(){return _0x349752;};return a7_0x5895();}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_0x474426 from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a7_0x4b10ac from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x260f85(0x181)]=a7_0x260f85(0x193);[a7_0x260f85(0x173)]=a7_0x260f85(0x180);async[a7_0x260f85(0x1a6)](_0x46f47d){const _0x100944=a7_0x260f85,{options:_0x3d4351}=_0x46f47d,_0x932f9=_0x3d4351[_0x100944(0x1a0)];console[_0x100944(0x1ac)](a7_0x4b10ac['bold'](_0x100944(0x187)));const _0x3df697=_0x3d4351['site']||_0x100944(0x19d),_0x18ed1e=await promptSiteSelection(_0x3df697,_0x932f9,_0x100944(0x1b1));if(!_0x18ed1e)return 0x1;const _0x3048c0=resolveSite(_0x18ed1e);if(isOAuthSupported(_0x3048c0)){const _0x290d94=await a7_0x474426({'type':_0x100944(0x1af),'name':'method','message':_0x100944(0x17f),'choices':[{'title':_0x100944(0x1ae),'value':_0x100944(0x1b4)},{'title':_0x100944(0x183),'value':'apikey'}]});if(!_0x290d94[_0x100944(0x16f)])return console[_0x100944(0x1ac)](_0x100944(0x191)),0x1;if(_0x290d94['method']===_0x100944(0x1b4))return await runOAuthLoginFlow(_0x3048c0,_0x932f9,_0x3d4351[_0x100944(0x192)]??LogLevel[_0x100944(0x195)]),0x0;}console[_0x100944(0x1ac)](_0x100944(0x18b)+_0x3048c0),console['log'](_0x100944(0x1ad)),console['log']('\x20\x20'+getConsoleUrl(_0x3048c0,'/app/mp/ak'));const _0x30ed5d=await a7_0x474426({'type':_0x100944(0x1b5),'name':_0x100944(0x1a4),'message':_0x100944(0x186),'validate':_0x4a3010=>{const _0x3e78a6=_0x100944;if(!_0x4a3010||!_0x4a3010['trim']())return _0x3e78a6(0x198);return!![];}});if(!_0x30ed5d[_0x100944(0x1a4)])return console[_0x100944(0x1ac)](_0x100944(0x191)),0x1;const _0x3be5c9=_0x30ed5d[_0x100944(0x1a4)];console[_0x100944(0x1ac)](_0x100944(0x172));try{const _0x4f7307=TDX['create']({'site':_0x3048c0,'apiKey':_0x3be5c9[_0x100944(0x185)](),'logLevel':_0x3d4351['logLevel']??LogLevel[_0x100944(0x195)]}),_0x1b8e4e=await _0x4f7307['jobs']['getUserInfo']();console[_0x100944(0x1ac)](_0x100944(0x1ab)+_0x1b8e4e['email']+')');const _0x344b1c=await isKeychainAvailable();_0x344b1c?(await saveAPIKeyAsync(_0x3be5c9[_0x100944(0x185)](),_0x3048c0,_0x932f9),console['log']('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0x932f9?_0x100944(0x178)+_0x932f9+')':''))):(console[_0x100944(0x175)](a7_0x4b10ac['yellow'](_0x100944(0x16e))),console[_0x100944(0x175)](a7_0x4b10ac[_0x100944(0x1a7)](_0x100944(0x19e))));if(_0x932f9){const _0x50f379={'site':_0x3048c0};saveProfileToUserConfig(_0x932f9,_0x50f379),console[_0x100944(0x1ac)](_0x100944(0x174)+_0x932f9+_0x100944(0x18d));}else saveDefaultSiteToUserConfig(_0x3048c0),console[_0x100944(0x1ac)](_0x100944(0x19b)+_0x3048c0);const _0x1cab20=_0x932f9?_0x100944(0x1a1)+_0x932f9:'';return console['log'](),console['log']('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console['log'](_0x100944(0x18c)+_0x1cab20+_0x100944(0x189)),console['log']('\x20\x20tdx'+_0x1cab20+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x6961ed){if(_0x6961ed instanceof HTTPClientError&&_0x6961ed[_0x100944(0x194)]===0x191)return printAuthError(_0x6961ed),0x1;return console[_0x100944(0x1b2)](a7_0x4b10ac[_0x100944(0x17e)](_0x100944(0x182)+(_0x6961ed instanceof Error?_0x6961ed[_0x100944(0x188)]:String(_0x6961ed)))),console[_0x100944(0x1b2)](_0x100944(0x19a)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x260f85(0x181)]='auth';[a7_0x260f85(0x173)]='Show\x20authentication\x20status\x20and\x20validate\x20API\x20key';async[a7_0x260f85(0x1a6)](_0x238d17){const _0x32ea88=a7_0x260f85,{options:_0x2d1a23,tdx:_0x88befd}=_0x238d17,_0x1d38ea=_0x2d1a23[_0x32ea88(0x1aa)],_0x3b6c16=_0x2d1a23[_0x32ea88(0x1a0)],_0x2c32a7=_0x3b6c16?_0x3b6c16:_0x32ea88(0x18a);console[_0x32ea88(0x1ac)]('tdx\x20profile:\x20'+_0x2c32a7+_0x32ea88(0x18f)+_0x1d38ea+')');const _0x21cf49=await getOAuthTokens(_0x3b6c16);if(_0x21cf49)console[_0x32ea88(0x1ac)](_0x32ea88(0x171)),console[_0x32ea88(0x1ac)]('Read\x20credential\x20from\x20keychain'+(_0x3b6c16?_0x32ea88(0x178)+_0x3b6c16+')':''));else{const _0x2b8225=await resolveAPIKeyAsync(_0x1d38ea,_0x3b6c16);if(_0x2b8225){const {source:_0xa56d27,isDeprecated:_0x172e64}=_0x2b8225,_0x248713='Read\x20credential\x20from\x20'+_0xa56d27;console[_0x32ea88(0x1ac)](_0x172e64?a7_0x4b10ac[_0x32ea88(0x1a7)](_0x248713):_0x248713);}else console['log'](a7_0x4b10ac[_0x32ea88(0x1a7)](_0x32ea88(0x184)));}try{const _0x4bdfb6=await _0x88befd['jobs'][_0x32ea88(0x16b)]();return console['log'](a7_0x4b10ac['green']('✓\x20Authentication\x20successful\x0a')),console['log'](_0x32ea88(0x17d)+_0x4bdfb6[_0x32ea88(0x17b)]),(_0x4bdfb6[_0x32ea88(0x16a)]||_0x4bdfb6['last_name'])&&console[_0x32ea88(0x1ac)](_0x32ea88(0x190)+[_0x4bdfb6['first_name'],_0x4bdfb6[_0x32ea88(0x1a2)]][_0x32ea88(0x18e)](Boolean)[_0x32ea88(0x199)]('\x20')),0x0;}catch(_0x5ba76b){return _0x5ba76b instanceof HTTPClientError&&_0x5ba76b[_0x32ea88(0x194)]===0x191?printAuthError(_0x5ba76b,!![],_0x3b6c16):console[_0x32ea88(0x1b2)](a7_0x4b10ac['red'](_0x32ea88(0x182)+(_0x5ba76b instanceof Error?_0x5ba76b[_0x32ea88(0x188)]:String(_0x5ba76b)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x260f85(0x181)]='auth:clear';['description']=a7_0x260f85(0x16d);async[a7_0x260f85(0x1a6)](_0xced9b3){const _0x461888=a7_0x260f85,{options:_0x76c1f4}=_0xced9b3,_0x3b2cef=_0x76c1f4[_0x461888(0x1a0)];console['log'](a7_0x4b10ac['bold'](_0x461888(0x179)));const _0x29f8c8=await isKeychainAvailable();if(!_0x29f8c8)return console[_0x461888(0x1b2)](a7_0x4b10ac['red']('System\x20keychain\x20is\x20not\x20available')),0x1;const [_0x47e6a4,_0x4534a2]=await Promise[_0x461888(0x169)]([deleteKeychainAPIKey(_0x3b2cef),deleteOAuthTokens(_0x3b2cef)]);if(_0x47e6a4||_0x4534a2){clearCredentialCache();const _0x3ebeba=[_0x47e6a4&&_0x461888(0x176),_0x4534a2&&_0x461888(0x1b3)][_0x461888(0x18e)](Boolean)['join'](_0x461888(0x196));return console[_0x461888(0x1ac)]('✓\x20'+_0x3ebeba+_0x461888(0x1a3)+(_0x3b2cef?_0x461888(0x178)+_0x3b2cef+')':'')),0x0;}else return console[_0x461888(0x1ac)](_0x461888(0x1a8)+(_0x3b2cef?_0x461888(0x19c)+_0x3b2cef:'')),0x1;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a8_0x10a004=a8_0x4cf2;function a8_0x4cf2(_0x36a866,_0x3c3fbc){_0x36a866=_0x36a866-0x1c3;const _0x570e97=a8_0x570e();let _0x4cf2e2=_0x570e97[_0x36a866];return _0x4cf2e2;}(function(_0x5e8cc2,_0x1b453f){const _0x1af75c=a8_0x4cf2,_0x1e3020=_0x5e8cc2();while(!![]){try{const _0x5e6447=parseInt(_0x1af75c(0x1dc))/0x1*(-parseInt(_0x1af75c(0x1de))/0x2)+parseInt(_0x1af75c(0x1d1))/0x3*(parseInt(_0x1af75c(0x1d8))/0x4)+-parseInt(_0x1af75c(0x1cd))/0x5*(-parseInt(_0x1af75c(0x1e1))/0x6)+parseInt(_0x1af75c(0x1c7))/0x7*(-parseInt(_0x1af75c(0x1e6))/0x8)+-parseInt(_0x1af75c(0x1c6))/0x9*(-parseInt(_0x1af75c(0x1e8))/0xa)+-parseInt(_0x1af75c(0x1ea))/0xb*(-parseInt(_0x1af75c(0x1ef))/0xc)+parseInt(_0x1af75c(0x1d4))/0xd*(-parseInt(_0x1af75c(0x1ed))/0xe);if(_0x5e6447===_0x1b453f)break;else _0x1e3020['push'](_0x1e3020['shift']());}catch(_0x5d8acc){_0x1e3020['push'](_0x1e3020['shift']());}}}(a8_0x570e,0x35b9c));import{BaseCommand}from'./command.js';import{resolveSite}from'../core/config.js';function a8_0x570e(){const _0xc69de1=['create','57951tARMUx','35UWDSSM','email','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','Login\x20cancelled','✓\x20Profile\x20\x27','Opening\x20browser\x20for\x20authentication...','301890hoIvoL','tdx:\x20auth\x20login','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','Login\x20via\x20OAuth\x20(opens\x20browser)','21senwsF','\x20(profile:\x20','\x27\x20registered','78rldqIb','logLevel','profile','Validating\x20OAuth\x20tokens...','24692YNUWRo','\x20--profile\x20','getUserInfo','execute','1BkJXBt','ERROR','873494Qedqtp','bold','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','12FXGAJl','Authenticating\x20via\x20OAuth\x20for\x20site:\x20','/oauth/authorize','green','\x20\x20tdx','297424fufxsQ','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','590yEuYbC','name','319SsrDkQ','us01','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','10458lVjuSn','access_token','125508xpzYqT','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','OAuth\x20is\x20currently\x20supported\x20on\x20dev-us01\x20and\x20dev-eu01\x20only.\x20','log'];a8_0x570e=function(){return _0xc69de1;};return a8_0x570e();}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';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_0xd6ea54 from'chalk';export async function runOAuthLoginFlow(_0x150c4f,_0xe49107,_0x390b65){const _0x2c3eb6=a8_0x4cf2;if(!isOAuthSupported(_0x150c4f))throw new Error('OAuth\x20login\x20is\x20not\x20yet\x20available\x20for\x20site:\x20'+_0x150c4f+'.\x20'+_0x2c3eb6(0x1c3)+_0x2c3eb6(0x1e0));const _0x5b4188=await isKeychainAvailable();if(!_0x5b4188)throw new Error(_0x2c3eb6(0x1cf)+_0x2c3eb6(0x1e0));const _0x4e998f=getConsoleUrl(_0x150c4f);console['log'](_0x2c3eb6(0x1cc)),console[_0x2c3eb6(0x1c4)]('\x20\x20'+_0x4e998f+_0x2c3eb6(0x1e3)),console['log'](_0x2c3eb6(0x1c9));const _0x2fc723=await startOAuthFlow(_0x150c4f);console[_0x2c3eb6(0x1c4)](_0x2c3eb6(0x1d7));const _0x32f8b9=TDX[_0x2c3eb6(0x1c5)]({'site':_0x150c4f,'accessToken':_0x2fc723[_0x2c3eb6(0x1ee)],'logLevel':_0x390b65??LogLevel['ERROR']}),_0x1e66ba=await _0x32f8b9['jobs'][_0x2c3eb6(0x1da)]();console['log'](a8_0xd6ea54[_0x2c3eb6(0x1e4)]('✓\x20Authentication\x20successful\x20(User:\x20'+_0x1e66ba[_0x2c3eb6(0x1c8)]+')')),await saveOAuthTokens(_0x2fc723,_0xe49107),console[_0x2c3eb6(0x1c4)](_0x2c3eb6(0x1f0)+(_0xe49107?_0x2c3eb6(0x1d2)+_0xe49107+')':''));if(_0xe49107){const _0x2ed06a={'site':_0x150c4f};saveProfileToUserConfig(_0xe49107,_0x2ed06a),console[_0x2c3eb6(0x1c4)](_0x2c3eb6(0x1cb)+_0xe49107+_0x2c3eb6(0x1d3));}const _0x55682a=_0xe49107?_0x2c3eb6(0x1d9)+_0xe49107:'';console[_0x2c3eb6(0x1c4)](),console[_0x2c3eb6(0x1c4)](_0x2c3eb6(0x1e7)),console[_0x2c3eb6(0x1c4)](_0x2c3eb6(0x1e5)+_0x55682a+_0x2c3eb6(0x1ec)),console[_0x2c3eb6(0x1c4)](_0x2c3eb6(0x1e5)+_0x55682a+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases');}export class AuthLoginCommand extends BaseCommand{[a8_0x10a004(0x1e9)]='auth:login';['description']=a8_0x10a004(0x1d0);async[a8_0x10a004(0x1db)](_0xa4cb08){const _0x16086b=a8_0x10a004,{options:_0x307530}=_0xa4cb08,_0x1e3781=_0x307530[_0x16086b(0x1d6)];console[_0x16086b(0x1c4)](a8_0xd6ea54[_0x16086b(0x1df)](_0x16086b(0x1ce)));const _0x4f3238=_0x307530['site']||_0x16086b(0x1eb),_0x162525=await promptSiteSelection(_0x4f3238,_0x1e3781,_0x16086b(0x1ca));if(!_0x162525)return 0x1;const _0x1ffe23=resolveSite(_0x162525);return console['log'](_0x16086b(0x1e2)+_0x1ffe23),await runOAuthLoginFlow(_0x1ffe23,_0x1e3781,_0x307530[_0x16086b(0x1d5)]??LogLevel[_0x16086b(0x1dd)]),0x0;}}
|