@treasuredata/tdx 2026.4.11 → 2026.4.13
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/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.d.ts +1 -0
- package/dist/core/profile.d.ts.map +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/profile.js.map +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/tools/work-create-item.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.d.ts +6 -0
- package/dist/sdk/journey.d.ts.map +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/journey.js.map +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/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.d.ts +2 -0
- package/dist/sdk/types/workspace.d.ts.map +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/access-tracker.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.d.ts.map +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/index.js.map +1 -1
- package/dist/sdk/workspace/templates.d.ts.map +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/templates.js.map +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
|
-
const
|
|
1
|
+
const a3_0x3d93c1=a3_0x40ee;function a3_0x41c6(){const _0x1c1a69=['List\x20activations\x20for\x20a\x20segment','execute','name','Resolving\x20child\x20segment\x20\x27','10gkqOIa','error','verbose','\x20\x20Cause:\x20','description','Resolved\x20parent\x20ID:\x20','site','segment','cause','1376bMlyFC','Resolved\x20child\x20ID:\x20','message','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','102TOLSUe','resolveSegmentId','Resolving\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','1226514lVeRdg','data','activations','Parent\x20name:\x20','1043702otytCs','12663NqAoIQ','42DjRVmz','139724EzuyHJ','length','3966193rnjUCL','resolveParentId','Error:\x20Segment\x20name\x20is\x20required','Listing\x20activations\x20for\x20segment\x20\x27','listActivations','88500TXLBZz','4916250uYSYby'];a3_0x41c6=function(){return _0x1c1a69;};return a3_0x41c6();}(function(_0xc5e1d6,_0x168875){const _0x180aa4=a3_0x40ee,_0x3e1728=_0xc5e1d6();while(!![]){try{const _0x28d8d5=parseInt(_0x180aa4(0x1b2))/0x1+-parseInt(_0x180aa4(0x1bc))/0x2+parseInt(_0x180aa4(0x1aa))/0x3*(-parseInt(_0x180aa4(0x1b5))/0x4)+-parseInt(_0x180aa4(0x1bd))/0x5+parseInt(_0x180aa4(0x1ae))/0x6*(parseInt(_0x180aa4(0x1b4))/0x7)+-parseInt(_0x180aa4(0x1a6))/0x8*(-parseInt(_0x180aa4(0x1b3))/0x9)+-parseInt(_0x180aa4(0x1c2))/0xa*(-parseInt(_0x180aa4(0x1b7))/0xb);if(_0x28d8d5===_0x168875)break;else _0x3e1728['push'](_0x3e1728['shift']());}catch(_0x4ad2b4){_0x3e1728['push'](_0x3e1728['shift']());}}}(a3_0x41c6,0xa08dd));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a3_0x40ee(_0x59d50f,_0x508e9d){_0x59d50f=_0x59d50f-0x19e;const _0x41c6c8=a3_0x41c6();let _0x40ee19=_0x41c6c8[_0x59d50f];return _0x40ee19;}import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x3d93c1(0x1c0)]=a3_0x3d93c1(0x1b0);[a3_0x3d93c1(0x1a1)]=a3_0x3d93c1(0x1be);async[a3_0x3d93c1(0x1bf)](_0x3b5164){const _0x451933=a3_0x3d93c1,{options:_0x59b447,args:_0x5282de,tdx:_0x14a49c}=_0x3b5164;if(_0x5282de[_0x451933(0x1b6)]===0x0)return console[_0x451933(0x19e)](_0x451933(0x1b9)),console[_0x451933(0x19e)](_0x451933(0x1ad)),0x1;try{const {parentId:_0xa59332,childId:_0x288f93}=parseSegmentRef(_0x5282de[0x0]);if(!_0x288f93)return console[_0x451933(0x19e)](_0x451933(0x1a9)),console['error'](_0x451933(0x1ad)),0x1;_0x59b447[_0x451933(0x19f)]&&(console[_0x451933(0x19e)]('Site:\x20'+_0x59b447[_0x451933(0x1a3)]),console[_0x451933(0x19e)](_0x451933(0x1b1)+_0xa59332),console[_0x451933(0x19e)]('Child\x20name:\x20'+_0x288f93));const _0x5ee323=await withSpinner(_0x451933(0x1ac)+_0xa59332+'\x27...',()=>_0x14a49c[_0x451933(0x1a4)][_0x451933(0x1b8)](_0xa59332),{'verbose':_0x59b447[_0x451933(0x19f)]}),_0x5443d9=_0x5ee323[_0x451933(0x1af)];_0x59b447[_0x451933(0x19f)]&&console[_0x451933(0x19e)](_0x451933(0x1a2)+_0x5443d9);const _0x2f7095=await withSpinner(_0x451933(0x1c1)+_0x288f93+'\x27...',()=>_0x14a49c['segment'][_0x451933(0x1ab)](_0x5443d9,_0x288f93),{'verbose':_0x59b447[_0x451933(0x19f)]}),_0x5a3659=_0x2f7095[_0x451933(0x1af)];_0x59b447[_0x451933(0x19f)]&&console['error'](_0x451933(0x1a7)+_0x5a3659);const _0x14a417=await withSpinner(_0x451933(0x1ba)+_0x288f93+'\x27...',()=>_0x14a49c[_0x451933(0x1a4)][_0x451933(0x1bb)](_0x5443d9,_0x5a3659),{'verbose':_0x59b447[_0x451933(0x19f)]}),_0x5a27d9=_0x14a417[_0x451933(0x1af)];return console[_0x451933(0x19e)]('✔\x20Found\x20'+_0x5a27d9['length']+'\x20activation'+(_0x5a27d9[_0x451933(0x1b6)]!==0x1?'s':'')),await handleSDKOutput(_0x5a27d9,_0x59b447),0x0;}catch(_0x40f5d0){if(_0x40f5d0 instanceof SDKError)return console[_0x451933(0x19e)]('Error:\x20'+_0x40f5d0[_0x451933(0x1a8)]),_0x40f5d0[_0x451933(0x1a5)]&&console[_0x451933(0x19e)](_0x451933(0x1a0)+_0x40f5d0[_0x451933(0x1a5)]),0x1;throw _0x40f5d0;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x4e85d1=a4_0x35e5;(function(_0x1ee4fe,_0x10e81a){const _0x18d610=a4_0x35e5,_0x705e00=_0x1ee4fe();while(!![]){try{const _0x1de0f2=-parseInt(_0x18d610(0x1c8))/0x1+parseInt(_0x18d610(0x162))/0x2+parseInt(_0x18d610(0x1c5))/0x3+-parseInt(_0x18d610(0x180))/0x4+parseInt(_0x18d610(0x18a))/0x5+-parseInt(_0x18d610(0x175))/0x6+parseInt(_0x18d610(0x161))/0x7;if(_0x1de0f2===_0x10e81a)break;else _0x705e00['push'](_0x705e00['shift']());}catch(_0x3053fa){_0x705e00['push'](_0x705e00['shift']());}}}(a4_0x358c,0x74018));import a4_0x584ae5 from'chalk';import a4_0xb9399 from'path';import{existsSync,readFileSync}from'fs';function a4_0x35e5(_0x10c590,_0x57c72f){_0x10c590=_0x10c590-0x151;const _0x358cfc=a4_0x358c();let _0x35e577=_0x358cfc[_0x10c590];return _0x35e577;}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';function a4_0x358c(){const _0x101daf=['agentId','INVALID_ARGUMENT','execute','<new-name>','push','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\x20\x20tdx\x20agent\x20pull\x20','\x0aChanges\x20to\x20integration\x20\x27','agents','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x20files\x20to\x20','force','dryRun','projectId','-\x20no\x20files\x20written','created','llm','Analyzing\x20project\x20\x22','\x20updated','description','pushProject','parse','\x0a✔\x20Pulled\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x20changed','Dry\x20run\x20-\x20no\x20changes\x20made','output','Project\x20cloned\x20with\x20errors','Using\x20local\x20project:\x20','message','Output:\x20','\x0aChanges\x20to\x20chat\x20interface\x20\x27','Using\x20current\x20project:\x20','green','isNew','\x22\x20to\x20a\x20different\x20profile','Using\x20project\x20from\x20','539070XUlpPn','New\x20project\x20ID:\x20','integrations','406316HXmcYq','textKnowledgeBases','\x20new','dim','\x20\x20Prompt\x20\x22','\x20\x20tdx\x20agent\x20clone\x20agents/','outputPath','New\x20project\x20name\x20is\x20required','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','Source:\x20','updated','errors','\x20resources\x20to\x20\x27','sourceProjectName','utf-8','Output\x20path:\x20','\x20errors','cwd','no_local_folder','\x0aPull\x20summary\x20for\x20\x27','repeat','\x20\x20Form\x20Interface\x20\x22','-\x20nothing\x20pushed','formInterfaces','\x20\x20Form\x20Interfaces:\x20','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x0aProject\x20pushed\x20with\x20errors','Using\x20project\x20from\x20context:\x20','New\x20project:\x20','\x22\x20to\x20new\x20project\x20\x22','Errors:','unchanged','Cloning\x20\x22','agentName','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x20\x20Prompts:\x20','\x20resources?','\x0aPush\x20summary\x20for\x20\x27','Project\x20cloned\x20successfully','cloneProject','reason','site','\x20successfully','dirname','Writing\x20files...','prompts','\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)','\x0a✔\x20Pushed\x20','\x0aWrite\x20','Project:\x20','projectName','experimentalKnowledgeBases','\x0aError:','\x20=\x20','newProjectId','pullProject','\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','\x22:\x20','\x22\x20from\x20project\x20\x22','log','No\x20tdx.json\x20found\x20in\x20','Failed\x20to\x20push\x20agent:\x20','context','\x20|\x20','\x20\x20Integrations:\x20','\x20\x20Chat\x20Interfaces:\x20','Agent\x20','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','tdx.json','\x20--name\x20','\x20\x20Target:\x20','arg-dir','\x27\x20to\x20create\x20the\x20folder\x20structure.','llmProject','counts','agent:push','\x22...','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','experimentalArtifacts','\x20\x20Chat\x20Interface\x20\x22','new','action','knowledgeBases','Would\x20clone:','Analyzing\x20changes\x20to\x20push...','Chat:\x20','\x20\x20Integration\x20\x22','3538766hqQxvr','274700yBrUrQ','diff','Pushing\x20agent\x20from\x20\x22','\x0aChanges:','\x20\x20Agent\x20\x22','\x22\x20to\x20\x22','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','chatInterfaces','found','Pulling\x20agent\x20\x22','Would\x20push\x20agent:\x20','\x0aErrors\x20found:','\x20\x20Source:\x20','cyan','yellow','llm_project','\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','join','\x0aPush\x20','373266eHXJTP','pushAgent','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','Agent:\x20','profile','\x20\x20Experimental\x20Artifacts:\x20','total','pullAgent','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','Pushing\x20to\x20project...','\x20\x20Text\x20Knowledge\x20Bases:\x20','546364XVqVop','newProjectName','\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','source','hasChanges','\x20unchanged','Using\x20context\x20project:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Cannot\x20clone\x20from\x20context\x20project\x20\x22','cwd-config','1288500zZZOeE','error','\x20\x20Agents:\x20','Using\x20project:\x20','outputDir','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x0aChanges\x20to\x20agent\x20\x27','red','\x20\x20Knowledge\x20Bases:\x20','session','name','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','gray','✔\x20Context\x20set:\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x20files?','Dry\x20run\x20-\x20no\x20files\x20written','agent:pull','yes','Cancelled'];a4_0x358c=function(){return _0x101daf;};return a4_0x358c();}import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x4099ba){const _0x2291a4=a4_0x35e5,_0x5d6bd4=[];if(_0x4099ba[_0x2291a4(0x17b)]!==undefined)_0x5d6bd4[_0x2291a4(0x1a4)](_0x4099ba['total']+'\x20total');if(_0x4099ba['new']!==undefined&&_0x4099ba[_0x2291a4(0x15a)]>0x0)_0x5d6bd4['push'](a4_0x584ae5[_0x2291a4(0x1c1)](_0x4099ba[_0x2291a4(0x15a)]+_0x2291a4(0x1ca)));if(_0x4099ba[_0x2291a4(0x1af)]!==undefined&&_0x4099ba[_0x2291a4(0x1af)]>0x0)_0x5d6bd4[_0x2291a4(0x1a4)](a4_0x584ae5[_0x2291a4(0x1c1)](_0x4099ba[_0x2291a4(0x1af)]+'\x20created'));if(_0x4099ba['updated']!==undefined&&_0x4099ba[_0x2291a4(0x1d2)]>0x0)_0x5d6bd4[_0x2291a4(0x1a4)](a4_0x584ae5[_0x2291a4(0x170)](_0x4099ba[_0x2291a4(0x1d2)]+_0x2291a4(0x1b2)));if(_0x4099ba['unchanged']!==undefined&&_0x4099ba[_0x2291a4(0x1e7)]>0x0)_0x5d6bd4[_0x2291a4(0x1a4)](a4_0x584ae5[_0x2291a4(0x196)](_0x4099ba[_0x2291a4(0x1e7)]+_0x2291a4(0x185)));if(_0x4099ba['errors']!==undefined&&_0x4099ba[_0x2291a4(0x1d3)]>0x0)_0x5d6bd4[_0x2291a4(0x1a4)](a4_0x584ae5[_0x2291a4(0x191)](_0x4099ba[_0x2291a4(0x1d3)]+_0x2291a4(0x1d8)));return _0x5d6bd4[_0x2291a4(0x173)](',\x20');}function displayDiffs(_0x4fa5b5,_0x3a3b01,_0x5f207d,_0x25c6f0,_0x37ce88,_0x1167b3,_0x436765,_0x2af8e1,_0x95ca2e){const _0x517fa0=a4_0x35e5;for(const _0xf32ff of _0x4fa5b5){if(_0xf32ff[_0x517fa0(0x163)]){const _0x4dd7a9=_0xf32ff['agentName']||_0xf32ff[_0x517fa0(0x194)];console['log'](_0x517fa0(0x190)+_0x4dd7a9+'\x27:'),console[_0x517fa0(0x203)]('─'['repeat'](0x3c)),console[_0x517fa0(0x203)](_0xf32ff[_0x517fa0(0x163)]),console[_0x517fa0(0x203)]('─'[_0x517fa0(0x1dc)](0x3c));}}for(const _0x5de3e0 of _0x3a3b01){_0x5de3e0[_0x517fa0(0x163)]&&(console[_0x517fa0(0x203)](_0x517fa0(0x19a)+_0x5de3e0[_0x517fa0(0x194)]+'\x27:'),console[_0x517fa0(0x203)]('─'[_0x517fa0(0x1dc)](0x3c)),console[_0x517fa0(0x203)](_0x5de3e0[_0x517fa0(0x163)]),console[_0x517fa0(0x203)]('─'[_0x517fa0(0x1dc)](0x3c)));}for(const _0x82bb0c of _0x5f207d){_0x82bb0c[_0x517fa0(0x163)]&&(console['log'](_0x517fa0(0x199)+_0x82bb0c[_0x517fa0(0x194)]+'\x27:'),console['log']('─'[_0x517fa0(0x1dc)](0x3c)),console[_0x517fa0(0x203)](_0x82bb0c[_0x517fa0(0x163)]),console[_0x517fa0(0x203)]('─'[_0x517fa0(0x1dc)](0x3c)));}for(const _0x2a7817 of _0x25c6f0){_0x2a7817['diff']&&(console[_0x517fa0(0x203)]('\x0aChanges\x20to\x20prompt\x20\x27'+_0x2a7817[_0x517fa0(0x194)]+'\x27:'),console[_0x517fa0(0x203)]('─'[_0x517fa0(0x1dc)](0x3c)),console[_0x517fa0(0x203)](_0x2a7817[_0x517fa0(0x163)]),console[_0x517fa0(0x203)]('─'[_0x517fa0(0x1dc)](0x3c)));}for(const _0x2f1b18 of _0x37ce88){_0x2f1b18['diff']&&(console[_0x517fa0(0x203)](_0x517fa0(0x1a7)+_0x2f1b18[_0x517fa0(0x194)]+'\x27:'),console[_0x517fa0(0x203)]('─'[_0x517fa0(0x1dc)](0x3c)),console[_0x517fa0(0x203)](_0x2f1b18['diff']),console['log']('─'[_0x517fa0(0x1dc)](0x3c)));}for(const _0x48aafe of _0x1167b3){_0x48aafe[_0x517fa0(0x163)]&&(console[_0x517fa0(0x203)](_0x517fa0(0x1ea)+_0x48aafe[_0x517fa0(0x194)]+'\x27:'),console['log']('─'[_0x517fa0(0x1dc)](0x3c)),console[_0x517fa0(0x203)](_0x48aafe['diff']),console['log']('─'[_0x517fa0(0x1dc)](0x3c)));}for(const _0x19407c of _0x436765){_0x19407c['diff']&&(console['log'](_0x517fa0(0x1a9)+_0x19407c['name']+'\x27:'),console['log']('─'[_0x517fa0(0x1dc)](0x3c)),console[_0x517fa0(0x203)](_0x19407c['diff']),console[_0x517fa0(0x203)]('─'[_0x517fa0(0x1dc)](0x3c)));}for(const _0x4d0d9c of _0x2af8e1){_0x4d0d9c['diff']&&(console[_0x517fa0(0x203)]('\x0aChanges\x20to\x20form\x20interface\x20\x27'+_0x4d0d9c[_0x517fa0(0x194)]+'\x27:'),console[_0x517fa0(0x203)]('─'[_0x517fa0(0x1dc)](0x3c)),console[_0x517fa0(0x203)](_0x4d0d9c[_0x517fa0(0x163)]),console[_0x517fa0(0x203)]('─'[_0x517fa0(0x1dc)](0x3c)));}for(const _0x15bdc3 of _0x95ca2e){_0x15bdc3[_0x517fa0(0x163)]&&(console['log'](_0x517fa0(0x1bf)+_0x15bdc3[_0x517fa0(0x194)]+'\x27:'),console[_0x517fa0(0x203)]('─'[_0x517fa0(0x1dc)](0x3c)),console[_0x517fa0(0x203)](_0x15bdc3[_0x517fa0(0x163)]),console[_0x517fa0(0x203)]('─'[_0x517fa0(0x1dc)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x4e85d1(0x194)]=a4_0x4e85d1(0x19d);[a4_0x4e85d1(0x1b3)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async['execute'](_0x495339){const _0x12e6fc=a4_0x4e85d1,{options:_0x136068,args:_0x22dfc8,tdx:_0x5d5126}=_0x495339,_0x52ba78=_0x22dfc8[0x0],_0x18fc02=_0x22dfc8[0x1],_0x2fc601=_0x136068[_0x12e6fc(0x1ba)],_0x5d548a=_0x136068[_0x12e6fc(0x1ac)],_0x472513=_0x136068[_0x12e6fc(0x1ab)],_0x2abceb=_0x136068[_0x12e6fc(0x19e)],_0x34b64b=_0x136068[_0x12e6fc(0x153)],_0x19614c=_0x136068['agent'];let _0x539b32;if(_0x52ba78){const _0x443471=a4_0xb9399[_0x12e6fc(0x173)](_0x52ba78,_0x12e6fc(0x20d));if(existsSync(_0x443471))try{const _0x3e13ae=JSON[_0x12e6fc(0x1b5)](readFileSync(_0x443471,_0x12e6fc(0x1d6)));_0x3e13ae[_0x12e6fc(0x171)]&&(_0x539b32={'llm_project':_0x3e13ae[_0x12e6fc(0x171)]});}catch{}}const _0x55e1cc=findAgentConfigPath(process[_0x12e6fc(0x1d9)]());let _0x2fe8ba;if(_0x55e1cc)try{const _0xcc33af=JSON['parse'](readFileSync(_0x55e1cc,_0x12e6fc(0x1d6)));_0xcc33af[_0x12e6fc(0x171)]&&(_0x2fe8ba={'llm_project':_0xcc33af[_0x12e6fc(0x171)]});}catch{}const _0x3c0c6f=resolveAgentPullArgs({'arg':_0x52ba78,'agentNameArg':_0x18fc02,'agentFlag':_0x19614c,'contextProject':_0x34b64b,'argDirConfig':_0x539b32,'cwdConfigPath':_0x55e1cc||undefined,'cwdConfig':_0x2fe8ba}),{projectNameOrId:_0x109af8,targetAgentName:_0x4e959e,existingOutputDir:_0x113734,source:_0x2a40c5}=_0x3c0c6f;if(_0x2a40c5===_0x12e6fc(0x151))console[_0x12e6fc(0x203)](a4_0x584ae5[_0x12e6fc(0x1cb)](_0x12e6fc(0x1c4)+a4_0xb9399[_0x12e6fc(0x173)](_0x52ba78,_0x12e6fc(0x20d))+':\x20'+_0x109af8));else{if(_0x2a40c5===_0x12e6fc(0x189))console[_0x12e6fc(0x203)](a4_0x584ae5[_0x12e6fc(0x1cb)](_0x12e6fc(0x18d)+_0x109af8));else _0x2a40c5===_0x12e6fc(0x206)&&console[_0x12e6fc(0x203)](a4_0x584ae5[_0x12e6fc(0x1cb)](_0x12e6fc(0x1e3)+_0x109af8));}if(!_0x109af8)return _0x19614c?(console[_0x12e6fc(0x203)](a4_0x584ae5['yellow']('The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a')),console['log'](_0x12e6fc(0x1d0)),console[_0x12e6fc(0x203)]('Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>')):(console[_0x12e6fc(0x203)](a4_0x584ae5[_0x12e6fc(0x170)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x12e6fc(0x203)]('Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x12e6fc(0x203)](_0x12e6fc(0x200)),console[_0x12e6fc(0x203)](_0x12e6fc(0x182)),console[_0x12e6fc(0x203)]('\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[_0x12e6fc(0x203)](_0x12e6fc(0x172))),0x1;if(_0x4e959e){const {data:_0x1042b9}=await withSpinner(_0x12e6fc(0x16b)+_0x4e959e+_0x12e6fc(0x202)+_0x109af8+_0x12e6fc(0x156),()=>_0x5d5126[_0x12e6fc(0x1b0)][_0x12e6fc(0x17c)](_0x109af8,_0x4e959e,_0x2fc601,{'dryRun':_0x5d548a,'force':_0x472513}));if(_0x5d548a)return console[_0x12e6fc(0x203)](a4_0x584ae5[_0x12e6fc(0x170)](_0x12e6fc(0x19c))),console[_0x12e6fc(0x203)]('Would\x20pull\x20agent:\x20'+_0x1042b9['agentName']),console[_0x12e6fc(0x203)](_0x12e6fc(0x1d7)+_0x1042b9[_0x12e6fc(0x1ce)]),_0x1042b9[_0x12e6fc(0x163)]&&(console['log'](_0x12e6fc(0x165)),console[_0x12e6fc(0x203)]('─'[_0x12e6fc(0x1dc)](0x3c)),console[_0x12e6fc(0x203)](_0x1042b9[_0x12e6fc(0x163)]),console[_0x12e6fc(0x203)]('─'[_0x12e6fc(0x1dc)](0x3c))),0x0;return console[_0x12e6fc(0x203)](a4_0x584ae5['green']('Agent\x20pulled\x20successfully')),console[_0x12e6fc(0x203)](_0x12e6fc(0x178)+_0x1042b9[_0x12e6fc(0x1e9)]),console[_0x12e6fc(0x203)](_0x12e6fc(0x1be)+_0x1042b9['outputPath']),console['log']('Status:\x20'+(_0x1042b9[_0x12e6fc(0x1c2)]?a4_0x584ae5['green']('new'):_0x1042b9[_0x12e6fc(0x184)]?a4_0x584ae5[_0x12e6fc(0x170)](_0x12e6fc(0x1d2)):a4_0x584ae5['gray']('unchanged'))),0x0;}const _0x34352b=_0x113734||_0x2fc601,{data:_0x57b648}=await withSpinner(_0x12e6fc(0x1b1)+_0x109af8+'\x22...',()=>_0x5d5126['llm']['pullProject'](_0x109af8,_0x34352b,{'dryRun':!![]})),_0x4cc555=_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x1a8)][_0x12e6fc(0x15a)]+_0x57b648['counts'][_0x12e6fc(0x15c)][_0x12e6fc(0x15a)]+_0x57b648['counts'][_0x12e6fc(0x1c9)][_0x12e6fc(0x15a)]+_0x57b648['counts'][_0x12e6fc(0x1f5)][_0x12e6fc(0x15a)]+_0x57b648[_0x12e6fc(0x154)]['integrations']['new']+_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x1fb)][_0x12e6fc(0x15a)]+_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x158)][_0x12e6fc(0x15a)]+_0x57b648[_0x12e6fc(0x154)]['formInterfaces']['new']+_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x169)][_0x12e6fc(0x15a)],_0x4810f6=_0x57b648['counts']['agents'][_0x12e6fc(0x1d2)]+_0x57b648['counts']['knowledgeBases'][_0x12e6fc(0x1d2)]+_0x57b648[_0x12e6fc(0x154)]['textKnowledgeBases']['updated']+_0x57b648['counts'][_0x12e6fc(0x1f5)][_0x12e6fc(0x1d2)]+_0x57b648[_0x12e6fc(0x154)]['integrations']['updated']+_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x1fb)][_0x12e6fc(0x1d2)]+_0x57b648['counts'][_0x12e6fc(0x158)][_0x12e6fc(0x1d2)]+_0x57b648['counts'][_0x12e6fc(0x1df)][_0x12e6fc(0x1d2)]+_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x169)][_0x12e6fc(0x1d2)],_0x5e8698=_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x1a8)][_0x12e6fc(0x1e7)]+_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x15c)][_0x12e6fc(0x1e7)]+_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x1c9)][_0x12e6fc(0x1e7)]+_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x1f5)]['unchanged']+_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x1c7)]['unchanged']+_0x57b648[_0x12e6fc(0x154)]['experimentalKnowledgeBases'][_0x12e6fc(0x1e7)]+_0x57b648['counts'][_0x12e6fc(0x158)][_0x12e6fc(0x1e7)]+_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x1df)][_0x12e6fc(0x1e7)]+_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x169)][_0x12e6fc(0x1e7)];console[_0x12e6fc(0x203)](_0x12e6fc(0x1db)+_0x57b648[_0x12e6fc(0x1fa)]+'\x27:'),console['log']('\x20\x20'+a4_0x584ae5[_0x12e6fc(0x1c1)]('+\x20'+_0x4cc555+_0x12e6fc(0x1ca))+_0x12e6fc(0x207)+a4_0x584ae5['yellow']('~\x20'+_0x4810f6+'\x20changed')+_0x12e6fc(0x207)+a4_0x584ae5[_0x12e6fc(0x1cb)]('=\x20'+_0x5e8698+_0x12e6fc(0x185))),console[_0x12e6fc(0x203)](_0x12e6fc(0x18c)+formatCountSummary(_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x1a8)])),console[_0x12e6fc(0x203)](_0x12e6fc(0x192)+formatCountSummary(_0x57b648[_0x12e6fc(0x154)]['knowledgeBases'])),console[_0x12e6fc(0x203)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x57b648['counts'][_0x12e6fc(0x1c9)])),console['log']('\x20\x20Prompts:\x20'+formatCountSummary(_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x1f5)])),console['log'](_0x12e6fc(0x208)+formatCountSummary(_0x57b648[_0x12e6fc(0x154)]['integrations'])),console[_0x12e6fc(0x203)](_0x12e6fc(0x1e0)+formatCountSummary(_0x57b648['counts'][_0x12e6fc(0x1df)])),console[_0x12e6fc(0x203)](_0x12e6fc(0x209)+formatCountSummary(_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x169)]));const _0x5bc1d3=_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x1fb)][_0x12e6fc(0x17b)]>0x0||_0x57b648['counts'][_0x12e6fc(0x158)][_0x12e6fc(0x17b)]>0x0;_0x5bc1d3&&(console[_0x12e6fc(0x203)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x57b648[_0x12e6fc(0x154)]['experimentalKnowledgeBases'])),console[_0x12e6fc(0x203)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x57b648[_0x12e6fc(0x154)][_0x12e6fc(0x158)])));console[_0x12e6fc(0x203)](_0x12e6fc(0x20f)+a4_0x584ae5[_0x12e6fc(0x16f)](_0x57b648[_0x12e6fc(0x18e)])),displayDiffs(_0x57b648[_0x12e6fc(0x1a8)],_0x57b648['knowledgeBases'],_0x57b648[_0x12e6fc(0x1c9)],_0x57b648[_0x12e6fc(0x1f5)],_0x57b648['integrations'],_0x57b648[_0x12e6fc(0x1fb)],_0x57b648[_0x12e6fc(0x158)],_0x57b648[_0x12e6fc(0x1df)],_0x57b648[_0x12e6fc(0x169)]);if(_0x5d548a)return console['log'](a4_0x584ae5['yellow'](_0x12e6fc(0x198))),0x0;if(_0x4cc555===0x0&&_0x4810f6===0x0)return console[_0x12e6fc(0x203)](a4_0x584ae5[_0x12e6fc(0x1c1)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x57b648[_0x12e6fc(0x1fa)]},_0x136068[_0x12e6fc(0x193)]),console[_0x12e6fc(0x203)](a4_0x584ae5[_0x12e6fc(0x1c1)](_0x12e6fc(0x197)+a4_0x584ae5['dim'](_0x12e6fc(0x171))+_0x12e6fc(0x1fd)+a4_0x584ae5[_0x12e6fc(0x16f)](_0x57b648[_0x12e6fc(0x1fa)]))),0x0;if(!_0x2abceb&&!_0x472513){if(!isInteractive())return console['error'](a4_0x584ae5['red'](_0x12e6fc(0x1fc)),_0x12e6fc(0x187)),console[_0x12e6fc(0x18b)](a4_0x584ae5[_0x12e6fc(0x1cb)](_0x12e6fc(0x195))),0x1;const _0x615c9f=await confirmKey(_0x12e6fc(0x1f8)+(_0x4cc555+_0x4810f6)+_0x12e6fc(0x19b));if(!_0x615c9f)return console[_0x12e6fc(0x203)](a4_0x584ae5[_0x12e6fc(0x170)](_0x12e6fc(0x19f)),_0x12e6fc(0x1ae)),0x1;}const {data:_0x54ca95}=await withSpinner(_0x12e6fc(0x1f4),()=>_0x5d5126['llm'][_0x12e6fc(0x1ff)](_0x109af8,_0x34352b,{'force':_0x472513}));return console[_0x12e6fc(0x203)](a4_0x584ae5[_0x12e6fc(0x1c1)](_0x12e6fc(0x1b6)+(_0x4cc555+_0x4810f6)+_0x12e6fc(0x1aa)+_0x54ca95[_0x12e6fc(0x18e)])),saveSessionContext({'llm_project':_0x54ca95[_0x12e6fc(0x1fa)]},_0x136068[_0x12e6fc(0x193)]),console['log'](a4_0x584ae5[_0x12e6fc(0x1c1)](_0x12e6fc(0x197)+a4_0x584ae5['dim'](_0x12e6fc(0x171))+_0x12e6fc(0x1fd)+a4_0x584ae5[_0x12e6fc(0x16f)](_0x54ca95['projectName']))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x4e85d1(0x194)]='agent:clone';[a4_0x4e85d1(0x1b3)]='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async[a4_0x4e85d1(0x1a2)](_0x54bac1){const _0x23d90a=a4_0x4e85d1,{options:_0x39f3c7,args:_0x2f184b,tdx:_0x10cc78}=_0x54bac1,_0x38a444=_0x2f184b[0x0],_0x25391b=_0x39f3c7[_0x23d90a(0x194)],_0x31aef3=_0x39f3c7[_0x23d90a(0x1ac)],_0x469402=_0x39f3c7[_0x23d90a(0x19e)],_0x34b9a3=_0x39f3c7[_0x23d90a(0x1f1)],_0x4f5faf=_0x39f3c7[_0x23d90a(0x153)];let _0x4f604e;const _0x22081d=findAgentConfigPath(process[_0x23d90a(0x1d9)]());if(_0x38a444){const _0x998087=a4_0xb9399['join'](_0x38a444,_0x23d90a(0x20d));existsSync(_0x998087)?(_0x4f604e=_0x38a444,console[_0x23d90a(0x203)](a4_0x584ae5[_0x23d90a(0x1cb)](_0x23d90a(0x1bc)+_0x38a444))):_0x4f604e=_0x38a444;}else{if(_0x22081d)_0x4f604e=a4_0xb9399['dirname'](_0x22081d),console['log'](a4_0x584ae5[_0x23d90a(0x1cb)](_0x23d90a(0x1c0)+_0x4f604e));else{if(_0x4f5faf){const _0x341cec=sanitizeForFilesystem(_0x4f5faf);let _0x152bf4=_0x341cec,_0x21e899=a4_0xb9399['join'](process[_0x23d90a(0x1d9)](),_0x23d90a(0x1a8),_0x341cec,_0x23d90a(0x20d));if(!existsSync(_0x21e899)){const _0x3ba8d9=normalizeName(_0x4f5faf),_0x54f5e3=a4_0xb9399[_0x23d90a(0x173)](process['cwd'](),'agents',_0x3ba8d9,_0x23d90a(0x20d));existsSync(_0x54f5e3)&&(_0x152bf4=_0x3ba8d9,_0x21e899=_0x54f5e3);}if(existsSync(_0x21e899))_0x4f604e=a4_0xb9399[_0x23d90a(0x1f3)](_0x21e899),console[_0x23d90a(0x203)](a4_0x584ae5[_0x23d90a(0x1cb)](_0x23d90a(0x1bc)+_0x4f604e));else{const _0x18ac40=_0x39f3c7[_0x23d90a(0x179)];if(_0x18ac40)throw new SDKError(ErrorCode[_0x23d90a(0x1a1)],_0x23d90a(0x188)+_0x4f5faf+_0x23d90a(0x1c3),undefined,{'helpText':_0x23d90a(0x20c)+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+(_0x23d90a(0x1a6)+_0x4f5faf+'\x0a')+(_0x23d90a(0x1cd)+_0x152bf4+_0x23d90a(0x20e)+(_0x25391b||_0x23d90a(0x1a3))+'\x20--profile\x20'+_0x18ac40)});_0x4f604e=_0x4f5faf,console['log'](a4_0x584ae5['dim'](_0x23d90a(0x186)+_0x4f5faf));}}}}if(!_0x4f604e)return console[_0x23d90a(0x203)](a4_0x584ae5[_0x23d90a(0x170)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x23d90a(0x203)](_0x23d90a(0x17d)),console[_0x23d90a(0x203)](_0x23d90a(0x157)),console['log'](_0x23d90a(0x1f6)),console[_0x23d90a(0x203)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x25391b)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x23d90a(0x1cf),undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0x469402&&!_0x31aef3){if(!isInteractive())return console[_0x23d90a(0x18b)](a4_0x584ae5[_0x23d90a(0x191)](_0x23d90a(0x1fc)),_0x23d90a(0x187)),console[_0x23d90a(0x18b)](a4_0x584ae5[_0x23d90a(0x1cb)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x29f59b=await confirmKey('Clone\x20\x22'+_0x4f604e+_0x23d90a(0x1e5)+_0x25391b+'\x22?');if(!_0x29f59b)return console[_0x23d90a(0x203)](a4_0x584ae5[_0x23d90a(0x170)](_0x23d90a(0x19f))),0x1;}const {data:_0x3eee0f}=await withSpinner(_0x23d90a(0x1e8)+_0x4f604e+_0x23d90a(0x167)+_0x25391b+_0x23d90a(0x156),()=>_0x10cc78[_0x23d90a(0x1b0)][_0x23d90a(0x1ef)](_0x4f604e,_0x25391b,{'dryRun':_0x31aef3}));if(_0x31aef3){console[_0x23d90a(0x203)](a4_0x584ae5['yellow'](_0x23d90a(0x1b9))),console[_0x23d90a(0x203)](_0x23d90a(0x1d1)+_0x3eee0f[_0x23d90a(0x1d5)]),console[_0x23d90a(0x203)](_0x23d90a(0x1e4)+_0x25391b),console[_0x23d90a(0x203)](_0x23d90a(0x15d)),console['log'](_0x23d90a(0x18c)+_0x3eee0f['counts']['agents'][_0x23d90a(0x1af)]),console[_0x23d90a(0x203)](_0x23d90a(0x192)+_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x15c)][_0x23d90a(0x1af)]),console['log'](_0x23d90a(0x1eb)+_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x1f5)]['created']),console[_0x23d90a(0x203)](_0x23d90a(0x1e0)+_0x3eee0f['counts'][_0x23d90a(0x1df)]['created']),console['log']('\x20\x20Chat\x20Interfaces:\x20'+_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x169)]['created']);const _0x151163=_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x1fb)]['created']>0x0||_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x158)][_0x23d90a(0x1af)]>0x0;return _0x151163&&(console[_0x23d90a(0x203)](_0x23d90a(0x177)+_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x1fb)][_0x23d90a(0x1af)]),console[_0x23d90a(0x203)]('\x20\x20Experimental\x20Artifacts:\x20'+_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x158)][_0x23d90a(0x1af)])),0x0;}const _0x3d8f25=_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x1a8)][_0x23d90a(0x1d3)]>0x0||_0x3eee0f[_0x23d90a(0x154)]['knowledgeBases']['errors']>0x0||_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x1f5)][_0x23d90a(0x1d3)]>0x0||_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x1df)][_0x23d90a(0x1d3)]>0x0||_0x3eee0f['counts'][_0x23d90a(0x169)][_0x23d90a(0x1d3)]>0x0||_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x1fb)][_0x23d90a(0x1d3)]>0x0||_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x158)][_0x23d90a(0x1d3)]>0x0;_0x3d8f25?console['log'](a4_0x584ae5['yellow'](_0x23d90a(0x1bb))):console[_0x23d90a(0x203)](a4_0x584ae5[_0x23d90a(0x1c1)](_0x23d90a(0x1ee)));console[_0x23d90a(0x203)]('Source:\x20'+_0x3eee0f[_0x23d90a(0x1d5)]),console[_0x23d90a(0x203)](_0x23d90a(0x1e4)+_0x3eee0f[_0x23d90a(0x181)]),console[_0x23d90a(0x203)](_0x23d90a(0x1c6)+_0x3eee0f[_0x23d90a(0x1fe)]),console['log'](),console[_0x23d90a(0x203)]('Summary:'),console['log'](_0x23d90a(0x18c)+formatCountSummary(_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x1a8)])),console[_0x23d90a(0x203)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x3eee0f[_0x23d90a(0x154)]['knowledgeBases'])),console[_0x23d90a(0x203)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x1f5)])),console['log']('\x20\x20Integrations:\x20'+formatCountSummary(_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x1c7)])),console[_0x23d90a(0x203)](_0x23d90a(0x1e0)+formatCountSummary(_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x1df)])),console['log'](_0x23d90a(0x209)+formatCountSummary(_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x169)]));const _0x58bf41=_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x1fb)][_0x23d90a(0x1af)]>0x0||_0x3eee0f[_0x23d90a(0x154)]['experimentalKnowledgeBases'][_0x23d90a(0x1d2)]>0x0||_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x1fb)][_0x23d90a(0x1e7)]>0x0||_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x158)][_0x23d90a(0x1af)]>0x0||_0x3eee0f[_0x23d90a(0x154)]['experimentalArtifacts'][_0x23d90a(0x1d2)]>0x0||_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x158)][_0x23d90a(0x1e7)]>0x0;_0x58bf41&&(console['log'](_0x23d90a(0x177)+formatCountSummary(_0x3eee0f[_0x23d90a(0x154)][_0x23d90a(0x1fb)])),console[_0x23d90a(0x203)](_0x23d90a(0x17a)+formatCountSummary(_0x3eee0f[_0x23d90a(0x154)]['experimentalArtifacts'])));if(_0x3d8f25){console[_0x23d90a(0x203)](),console['log'](a4_0x584ae5['red'](_0x23d90a(0x1e6)));for(const _0x34c9f0 of _0x3eee0f[_0x23d90a(0x1a8)]){_0x34c9f0[_0x23d90a(0x15b)]===_0x23d90a(0x18b)&&console[_0x23d90a(0x203)](a4_0x584ae5[_0x23d90a(0x191)](_0x23d90a(0x166)+_0x34c9f0[_0x23d90a(0x1e9)]+_0x23d90a(0x201)+_0x34c9f0[_0x23d90a(0x18b)]));}for(const _0x5bd708 of _0x3eee0f['knowledgeBases']){_0x5bd708[_0x23d90a(0x15b)]===_0x23d90a(0x18b)&&console[_0x23d90a(0x203)](a4_0x584ae5['red']('\x20\x20Knowledge\x20Base\x20\x22'+_0x5bd708[_0x23d90a(0x194)]+'\x22:\x20'+_0x5bd708['error']));}for(const _0x154f1b of _0x3eee0f['prompts']){_0x154f1b[_0x23d90a(0x15b)]===_0x23d90a(0x18b)&&console['log'](a4_0x584ae5[_0x23d90a(0x191)](_0x23d90a(0x1cc)+_0x154f1b['name']+_0x23d90a(0x201)+_0x154f1b[_0x23d90a(0x18b)]));}for(const _0xe85486 of _0x3eee0f[_0x23d90a(0x1c7)]){_0xe85486[_0x23d90a(0x15b)]===_0x23d90a(0x18b)&&console[_0x23d90a(0x203)](a4_0x584ae5[_0x23d90a(0x191)]('\x20\x20Integration\x20\x22'+_0xe85486[_0x23d90a(0x194)]+_0x23d90a(0x201)+_0xe85486['error']));}for(const _0x55287d of _0x3eee0f[_0x23d90a(0x1df)]){_0x55287d[_0x23d90a(0x15b)]===_0x23d90a(0x18b)&&console['log'](a4_0x584ae5[_0x23d90a(0x191)](_0x23d90a(0x1dd)+_0x55287d[_0x23d90a(0x194)]+'\x22:\x20'+_0x55287d[_0x23d90a(0x18b)]));}for(const _0x20fd88 of _0x3eee0f[_0x23d90a(0x169)]){_0x20fd88[_0x23d90a(0x15b)]==='error'&&console[_0x23d90a(0x203)](a4_0x584ae5[_0x23d90a(0x191)]('\x20\x20Chat\x20Interface\x20\x22'+_0x20fd88[_0x23d90a(0x194)]+_0x23d90a(0x201)+_0x20fd88[_0x23d90a(0x18b)]));}for(const _0x377fec of _0x3eee0f[_0x23d90a(0x1fb)]){_0x377fec[_0x23d90a(0x15b)]===_0x23d90a(0x18b)&&console[_0x23d90a(0x203)](a4_0x584ae5[_0x23d90a(0x191)](_0x23d90a(0x1e1)+_0x377fec[_0x23d90a(0x194)]+'\x22:\x20'+_0x377fec['error']));}for(const _0xd055eb of _0x3eee0f['experimentalArtifacts']){_0xd055eb['action']===_0x23d90a(0x18b)&&console[_0x23d90a(0x203)](a4_0x584ae5[_0x23d90a(0x191)]('\x20\x20Experimental\x20Artifact\x20\x22'+_0xd055eb[_0x23d90a(0x194)]+_0x23d90a(0x201)+_0xd055eb[_0x23d90a(0x18b)]));}return 0x1;}console[_0x23d90a(0x203)]();const _0x4d5b3b=getLLMProjectUrl(_0x34b9a3,_0x3eee0f[_0x23d90a(0x1fe)]);return console[_0x23d90a(0x203)](_0x23d90a(0x1f9)+a4_0x584ae5['cyan'](_0x4d5b3b)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x4e85d1(0x194)]=a4_0x4e85d1(0x155);['description']=a4_0x4e85d1(0x20b);async[a4_0x4e85d1(0x1a2)](_0xee2229){const _0x2d6379=a4_0x4e85d1,{options:_0x5bfdc2,args:_0x5d1957,tdx:_0x12ed4e}=_0xee2229;let _0x73de72=_0x5d1957[0x0]||process['cwd']();const _0x16687b=_0x5bfdc2[_0x2d6379(0x1ac)],_0x35dd33=_0x5bfdc2[_0x2d6379(0x1ab)],_0x3b5ae2=_0x5bfdc2['yes'],_0xaace85=_0x5bfdc2['site'],_0x3b83fc=a4_0xb9399[_0x2d6379(0x173)](_0x73de72,'agent.yml'),_0xf4ac48=existsSync(_0x3b83fc);if(_0xf4ac48){const {data:_0x44cfa9}=await withSpinner(_0x2d6379(0x164)+_0x73de72+_0x2d6379(0x156),()=>_0x12ed4e[_0x2d6379(0x1b0)][_0x2d6379(0x176)](_0x73de72,{'dryRun':_0x16687b,'force':_0x35dd33}));if(_0x16687b)return console[_0x2d6379(0x203)](a4_0x584ae5[_0x2d6379(0x170)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x2d6379(0x203)](_0x2d6379(0x16c)+_0x44cfa9[_0x2d6379(0x1e9)]),0x0;if(_0x44cfa9[_0x2d6379(0x15b)]===_0x2d6379(0x18b))return console[_0x2d6379(0x203)](a4_0x584ae5[_0x2d6379(0x191)](_0x2d6379(0x205)+_0x44cfa9[_0x2d6379(0x18b)])),0x1;console[_0x2d6379(0x203)](a4_0x584ae5['green'](_0x2d6379(0x20a)+_0x44cfa9[_0x2d6379(0x15b)]+_0x2d6379(0x1f2))),console[_0x2d6379(0x203)](_0x2d6379(0x178)+_0x44cfa9[_0x2d6379(0x1e9)]);if(_0x44cfa9[_0x2d6379(0x1a0)]&&_0x44cfa9['projectId']){const _0x247b54=getLLMAgentChatUrl(_0xaace85,_0x44cfa9[_0x2d6379(0x1ad)],_0x44cfa9[_0x2d6379(0x1a0)]);console['log'](_0x2d6379(0x15f)+a4_0x584ae5[_0x2d6379(0x16f)](_0x247b54));}return 0x0;}const _0x4f36e2=_0x5bfdc2['llmProject'],_0x4d6714=resolveProjectFromContext(_0x73de72,_0x4f36e2);if(_0x4d6714[_0x2d6379(0x16a)])_0x73de72=_0x4d6714['projectDir'],_0x4d6714[_0x2d6379(0x183)]===_0x2d6379(0x206)&&console[_0x2d6379(0x203)](a4_0x584ae5[_0x2d6379(0x1cb)](_0x2d6379(0x18d)+_0x73de72));else{let _0x164aad=_0x2d6379(0x1a5);_0x4d6714[_0x2d6379(0x1f0)]===_0x2d6379(0x1da)&&(_0x164aad=_0x4d6714[_0x2d6379(0x1bd)]+_0x2d6379(0x168)+_0x4d6714[_0x2d6379(0x153)]+_0x2d6379(0x152));throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x4d6714['reason']==='no_context'?_0x4d6714[_0x2d6379(0x1bd)]:_0x2d6379(0x204)+_0x73de72,undefined,{'helpText':_0x164aad});}const {data:_0x4692d6}=await withSpinner(_0x2d6379(0x15e),()=>_0x12ed4e[_0x2d6379(0x1b0)][_0x2d6379(0x1b4)](_0x73de72,{'dryRun':!![]})),_0x2cb7a3=_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x1a8)]['errors']>0x0;if(_0x2cb7a3){console[_0x2d6379(0x203)](a4_0x584ae5[_0x2d6379(0x191)](_0x2d6379(0x16d)));for(const _0x3b06ee of _0x4692d6[_0x2d6379(0x1a8)]){_0x3b06ee[_0x2d6379(0x15b)]===_0x2d6379(0x18b)&&console[_0x2d6379(0x203)](a4_0x584ae5[_0x2d6379(0x191)](_0x2d6379(0x166)+_0x3b06ee[_0x2d6379(0x1e9)]+'\x22:\x20'+_0x3b06ee[_0x2d6379(0x18b)]));}return 0x1;}const _0x335234=_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x1a8)][_0x2d6379(0x1af)]+_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x15c)][_0x2d6379(0x1af)]+_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x1c9)][_0x2d6379(0x1af)]+_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x1f5)][_0x2d6379(0x1af)]+_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x1c7)][_0x2d6379(0x1af)]+_0x4692d6[_0x2d6379(0x154)]['experimentalKnowledgeBases'][_0x2d6379(0x1af)]+_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x158)][_0x2d6379(0x1af)]+_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x1df)]['created']+_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x169)][_0x2d6379(0x1af)],_0x29c2e4=_0x4692d6['counts'][_0x2d6379(0x1a8)][_0x2d6379(0x1d2)]+_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x15c)]['updated']+_0x4692d6[_0x2d6379(0x154)]['textKnowledgeBases'][_0x2d6379(0x1d2)]+_0x4692d6['counts']['prompts'][_0x2d6379(0x1d2)]+_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x1c7)]['updated']+_0x4692d6[_0x2d6379(0x154)]['experimentalKnowledgeBases'][_0x2d6379(0x1d2)]+_0x4692d6[_0x2d6379(0x154)]['experimentalArtifacts'][_0x2d6379(0x1d2)]+_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x1df)][_0x2d6379(0x1d2)]+_0x4692d6[_0x2d6379(0x154)]['chatInterfaces']['updated'],_0x5c66d1=_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x1a8)][_0x2d6379(0x1e7)]+_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x15c)][_0x2d6379(0x1e7)]+_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x1c9)]['unchanged']+_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x1f5)][_0x2d6379(0x1e7)]+_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x1c7)][_0x2d6379(0x1e7)]+_0x4692d6['counts'][_0x2d6379(0x1fb)][_0x2d6379(0x1e7)]+_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x158)]['unchanged']+_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x1df)][_0x2d6379(0x1e7)]+_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x169)]['unchanged'];console[_0x2d6379(0x203)](_0x2d6379(0x1ed)+_0x4692d6[_0x2d6379(0x1fa)]+'\x27:'),console[_0x2d6379(0x203)]('\x20\x20'+a4_0x584ae5[_0x2d6379(0x1c1)]('+\x20'+_0x335234+_0x2d6379(0x1ca))+'\x20|\x20'+a4_0x584ae5[_0x2d6379(0x170)]('~\x20'+_0x29c2e4+_0x2d6379(0x1b8))+'\x20|\x20'+a4_0x584ae5[_0x2d6379(0x1cb)]('=\x20'+_0x5c66d1+'\x20unchanged')),console['log'](_0x2d6379(0x18c)+formatCountSummary(_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x1a8)])),console[_0x2d6379(0x203)](_0x2d6379(0x192)+formatCountSummary(_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x15c)])),console[_0x2d6379(0x203)](_0x2d6379(0x17f)+formatCountSummary(_0x4692d6['counts'][_0x2d6379(0x1c9)])),console[_0x2d6379(0x203)](_0x2d6379(0x1eb)+formatCountSummary(_0x4692d6['counts'][_0x2d6379(0x1f5)])),console[_0x2d6379(0x203)](_0x2d6379(0x208)+formatCountSummary(_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x1c7)])),console[_0x2d6379(0x203)]('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x1df)])),console[_0x2d6379(0x203)]('\x20\x20Chat\x20Interfaces:\x20'+formatCountSummary(_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x169)]));const _0x366260=_0x4692d6['counts']['experimentalKnowledgeBases'][_0x2d6379(0x1af)]>0x0||_0x4692d6['counts'][_0x2d6379(0x1fb)][_0x2d6379(0x1d2)]>0x0||_0x4692d6['counts'][_0x2d6379(0x1fb)]['unchanged']>0x0||_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x158)][_0x2d6379(0x1af)]>0x0||_0x4692d6[_0x2d6379(0x154)]['experimentalArtifacts']['updated']>0x0||_0x4692d6['counts'][_0x2d6379(0x158)]['unchanged']>0x0;_0x366260&&(console[_0x2d6379(0x203)](_0x2d6379(0x177)+formatCountSummary(_0x4692d6['counts'][_0x2d6379(0x1fb)])),console[_0x2d6379(0x203)](_0x2d6379(0x17a)+formatCountSummary(_0x4692d6[_0x2d6379(0x154)][_0x2d6379(0x158)])));console[_0x2d6379(0x203)](_0x2d6379(0x16e)+a4_0x584ae5[_0x2d6379(0x16f)](_0x73de72)),displayDiffs(_0x4692d6[_0x2d6379(0x1a8)],_0x4692d6[_0x2d6379(0x15c)],_0x4692d6[_0x2d6379(0x1c9)],_0x4692d6['prompts'],_0x4692d6[_0x2d6379(0x1c7)],_0x4692d6[_0x2d6379(0x1fb)],_0x4692d6[_0x2d6379(0x158)],_0x4692d6[_0x2d6379(0x1df)],_0x4692d6[_0x2d6379(0x169)]);if(_0x16687b)return console[_0x2d6379(0x203)](a4_0x584ae5[_0x2d6379(0x170)](_0x2d6379(0x1b7))),0x0;if(_0x335234===0x0&&_0x29c2e4===0x0){console[_0x2d6379(0x203)](a4_0x584ae5[_0x2d6379(0x1c1)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x3d90b2=getLLMProjectUrl(_0xaace85,_0x4692d6[_0x2d6379(0x1ad)]);return console[_0x2d6379(0x203)](_0x2d6379(0x1f9)+a4_0x584ae5[_0x2d6379(0x16f)](_0x3d90b2)),0x0;}if(!_0x3b5ae2&&!_0x35dd33){if(!isInteractive())return console['error'](a4_0x584ae5[_0x2d6379(0x191)](_0x2d6379(0x1fc)),_0x2d6379(0x187)),console['error'](a4_0x584ae5[_0x2d6379(0x1cb)](_0x2d6379(0x195))),0x1;const _0x38b2ce=await confirmKey(_0x2d6379(0x174)+(_0x335234+_0x29c2e4)+_0x2d6379(0x1ec));if(!_0x38b2ce)return console[_0x2d6379(0x203)](a4_0x584ae5['yellow'](_0x2d6379(0x19f)),_0x2d6379(0x1de)),0x1;}const {data:_0xb88828}=await withSpinner(_0x2d6379(0x17e),()=>_0x12ed4e[_0x2d6379(0x1b0)][_0x2d6379(0x1b4)](_0x73de72,{'force':_0x35dd33})),_0x1e83a0=_0xb88828[_0x2d6379(0x154)][_0x2d6379(0x1a8)]['errors']>0x0||_0xb88828[_0x2d6379(0x154)]['knowledgeBases'][_0x2d6379(0x1d3)]>0x0||_0xb88828[_0x2d6379(0x154)][_0x2d6379(0x1c9)][_0x2d6379(0x1d3)]>0x0||_0xb88828[_0x2d6379(0x154)][_0x2d6379(0x1f5)]['errors']>0x0||_0xb88828[_0x2d6379(0x154)][_0x2d6379(0x1df)][_0x2d6379(0x1d3)]>0x0||_0xb88828[_0x2d6379(0x154)]['chatInterfaces'][_0x2d6379(0x1d3)]>0x0;if(_0x1e83a0){console['log'](a4_0x584ae5['yellow'](_0x2d6379(0x1e2))),console[_0x2d6379(0x203)](),console[_0x2d6379(0x203)](a4_0x584ae5['red']('Errors:'));for(const _0x282b79 of _0xb88828['agents']){_0x282b79['action']===_0x2d6379(0x18b)&&console['log'](a4_0x584ae5[_0x2d6379(0x191)]('\x20\x20Agent\x20\x22'+_0x282b79[_0x2d6379(0x1e9)]+_0x2d6379(0x201)+_0x282b79[_0x2d6379(0x18b)]));}for(const _0x40c3cd of _0xb88828[_0x2d6379(0x15c)]){_0x40c3cd[_0x2d6379(0x15b)]==='error'&&console[_0x2d6379(0x203)](a4_0x584ae5[_0x2d6379(0x191)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x40c3cd[_0x2d6379(0x194)]+_0x2d6379(0x201)+_0x40c3cd['error']));}for(const _0x14d448 of _0xb88828['textKnowledgeBases']){_0x14d448[_0x2d6379(0x15b)]==='error'&&console[_0x2d6379(0x203)](a4_0x584ae5['red'](_0x2d6379(0x18f)+_0x14d448[_0x2d6379(0x194)]+_0x2d6379(0x201)+_0x14d448['error']));}for(const _0x42f106 of _0xb88828[_0x2d6379(0x1f5)]){_0x42f106[_0x2d6379(0x15b)]===_0x2d6379(0x18b)&&console[_0x2d6379(0x203)](a4_0x584ae5[_0x2d6379(0x191)](_0x2d6379(0x1cc)+_0x42f106[_0x2d6379(0x194)]+'\x22:\x20'+_0x42f106[_0x2d6379(0x18b)]));}for(const _0x4acbb4 of _0xb88828[_0x2d6379(0x1c7)]){_0x4acbb4['action']==='error'&&console[_0x2d6379(0x203)](a4_0x584ae5['red'](_0x2d6379(0x160)+_0x4acbb4['name']+_0x2d6379(0x201)+_0x4acbb4[_0x2d6379(0x18b)]));}for(const _0x1df98b of _0xb88828['formInterfaces']){_0x1df98b[_0x2d6379(0x15b)]===_0x2d6379(0x18b)&&console[_0x2d6379(0x203)](a4_0x584ae5['red']('\x20\x20Form\x20Interface\x20\x22'+_0x1df98b[_0x2d6379(0x194)]+'\x22:\x20'+_0x1df98b[_0x2d6379(0x18b)]));}for(const _0x3ae24c of _0xb88828[_0x2d6379(0x169)]){_0x3ae24c[_0x2d6379(0x15b)]===_0x2d6379(0x18b)&&console[_0x2d6379(0x203)](a4_0x584ae5[_0x2d6379(0x191)](_0x2d6379(0x159)+_0x3ae24c[_0x2d6379(0x194)]+'\x22:\x20'+_0x3ae24c[_0x2d6379(0x18b)]));}return 0x1;}console[_0x2d6379(0x203)](a4_0x584ae5[_0x2d6379(0x1c1)](_0x2d6379(0x1f7)+(_0x335234+_0x29c2e4)+_0x2d6379(0x1d4)+_0xb88828[_0x2d6379(0x1fa)]+'\x27'));const _0x1753b6=getLLMProjectUrl(_0xaace85,_0xb88828[_0x2d6379(0x1ad)]);return console['log'](_0x2d6379(0x1f9)+a4_0x584ae5[_0x2d6379(0x16f)](_0x1753b6)),0x0;}}
|
|
1
|
+
function a4_0x3376(_0x25cf17,_0x413f7b){_0x25cf17=_0x25cf17-0x1b3;const _0x30a112=a4_0x30a1();let _0x3376b7=_0x30a112[_0x25cf17];return _0x3376b7;}const a4_0xc37a6a=a4_0x3376;(function(_0x25ea34,_0x1f089c){const _0x369d13=a4_0x3376,_0x20b9e3=_0x25ea34();while(!![]){try{const _0x504101=-parseInt(_0x369d13(0x233))/0x1+parseInt(_0x369d13(0x229))/0x2*(-parseInt(_0x369d13(0x25a))/0x3)+parseInt(_0x369d13(0x212))/0x4*(-parseInt(_0x369d13(0x260))/0x5)+-parseInt(_0x369d13(0x256))/0x6*(parseInt(_0x369d13(0x232))/0x7)+parseInt(_0x369d13(0x1ef))/0x8+parseInt(_0x369d13(0x1bd))/0x9*(parseInt(_0x369d13(0x1c5))/0xa)+parseInt(_0x369d13(0x1e0))/0xb;if(_0x504101===_0x1f089c)break;else _0x20b9e3['push'](_0x20b9e3['shift']());}catch(_0x280945){_0x20b9e3['push'](_0x20b9e3['shift']());}}}(a4_0x30a1,0xbcf02));import a4_0x1140fa from'chalk';import a4_0x3f8ec3 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x25986a){const _0x1ce2ba=a4_0x3376,_0x256660=[];if(_0x25986a[_0x1ce2ba(0x22e)]!==undefined)_0x256660[_0x1ce2ba(0x20c)](_0x25986a[_0x1ce2ba(0x22e)]+'\x20total');if(_0x25986a['new']!==undefined&&_0x25986a[_0x1ce2ba(0x1d4)]>0x0)_0x256660[_0x1ce2ba(0x20c)](a4_0x1140fa[_0x1ce2ba(0x24e)](_0x25986a[_0x1ce2ba(0x1d4)]+_0x1ce2ba(0x21f)));if(_0x25986a[_0x1ce2ba(0x1ff)]!==undefined&&_0x25986a[_0x1ce2ba(0x1ff)]>0x0)_0x256660[_0x1ce2ba(0x20c)](a4_0x1140fa['green'](_0x25986a[_0x1ce2ba(0x1ff)]+_0x1ce2ba(0x1d0)));if(_0x25986a['updated']!==undefined&&_0x25986a[_0x1ce2ba(0x227)]>0x0)_0x256660[_0x1ce2ba(0x20c)](a4_0x1140fa[_0x1ce2ba(0x1ea)](_0x25986a['updated']+_0x1ce2ba(0x254)));if(_0x25986a[_0x1ce2ba(0x226)]!==undefined&&_0x25986a[_0x1ce2ba(0x226)]>0x0)_0x256660[_0x1ce2ba(0x20c)](a4_0x1140fa[_0x1ce2ba(0x1b4)](_0x25986a[_0x1ce2ba(0x226)]+_0x1ce2ba(0x1c6)));if(_0x25986a[_0x1ce2ba(0x1e1)]!==undefined&&_0x25986a[_0x1ce2ba(0x1e1)]>0x0)_0x256660['push'](a4_0x1140fa['red'](_0x25986a[_0x1ce2ba(0x1e1)]+_0x1ce2ba(0x210)));return _0x256660[_0x1ce2ba(0x202)](',\x20');}function displayDiffs(_0x5b2868,_0x49c085,_0x50d6b5,_0x2c272d,_0xa9b500,_0x22d3d2,_0x3aac49,_0x22d466,_0x48add5){const _0x30992a=a4_0x3376;for(const _0x38636b of _0x5b2868){if(_0x38636b['diff']){const _0x17d673=_0x38636b[_0x30992a(0x20d)]||_0x38636b[_0x30992a(0x1c1)];console[_0x30992a(0x258)]('\x0aChanges\x20to\x20agent\x20\x27'+_0x17d673+'\x27:'),console[_0x30992a(0x258)]('─'[_0x30992a(0x1c2)](0x3c)),console['log'](_0x38636b[_0x30992a(0x1e9)]),console[_0x30992a(0x258)]('─'[_0x30992a(0x1c2)](0x3c));}}for(const _0x26bb15 of _0x49c085){_0x26bb15[_0x30992a(0x1e9)]&&(console['log'](_0x30992a(0x1b8)+_0x26bb15[_0x30992a(0x1c1)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console['log'](_0x26bb15[_0x30992a(0x1e9)]),console[_0x30992a(0x258)]('─'[_0x30992a(0x1c2)](0x3c)));}for(const _0x2ec620 of _0x50d6b5){_0x2ec620['diff']&&(console[_0x30992a(0x258)](_0x30992a(0x1da)+_0x2ec620[_0x30992a(0x1c1)]+'\x27:'),console[_0x30992a(0x258)]('─'[_0x30992a(0x1c2)](0x3c)),console[_0x30992a(0x258)](_0x2ec620[_0x30992a(0x1e9)]),console[_0x30992a(0x258)]('─'[_0x30992a(0x1c2)](0x3c)));}for(const _0x1bd359 of _0x2c272d){_0x1bd359[_0x30992a(0x1e9)]&&(console[_0x30992a(0x258)]('\x0aChanges\x20to\x20prompt\x20\x27'+_0x1bd359[_0x30992a(0x1c1)]+'\x27:'),console[_0x30992a(0x258)]('─'[_0x30992a(0x1c2)](0x3c)),console[_0x30992a(0x258)](_0x1bd359[_0x30992a(0x1e9)]),console[_0x30992a(0x258)]('─'[_0x30992a(0x1c2)](0x3c)));}for(const _0x49560b of _0xa9b500){_0x49560b[_0x30992a(0x1e9)]&&(console[_0x30992a(0x258)]('\x0aChanges\x20to\x20integration\x20\x27'+_0x49560b['name']+'\x27:'),console['log']('─'[_0x30992a(0x1c2)](0x3c)),console[_0x30992a(0x258)](_0x49560b[_0x30992a(0x1e9)]),console[_0x30992a(0x258)]('─'[_0x30992a(0x1c2)](0x3c)));}for(const _0x47f8ca of _0x22d3d2){_0x47f8ca[_0x30992a(0x1e9)]&&(console[_0x30992a(0x258)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x47f8ca['name']+'\x27:'),console['log']('─'[_0x30992a(0x1c2)](0x3c)),console[_0x30992a(0x258)](_0x47f8ca[_0x30992a(0x1e9)]),console[_0x30992a(0x258)]('─'[_0x30992a(0x1c2)](0x3c)));}for(const _0x1f5270 of _0x3aac49){_0x1f5270[_0x30992a(0x1e9)]&&(console[_0x30992a(0x258)](_0x30992a(0x1fa)+_0x1f5270[_0x30992a(0x1c1)]+'\x27:'),console[_0x30992a(0x258)]('─'['repeat'](0x3c)),console['log'](_0x1f5270['diff']),console[_0x30992a(0x258)]('─'[_0x30992a(0x1c2)](0x3c)));}for(const _0x56a7ca of _0x22d466){_0x56a7ca[_0x30992a(0x1e9)]&&(console[_0x30992a(0x258)]('\x0aChanges\x20to\x20form\x20interface\x20\x27'+_0x56a7ca[_0x30992a(0x1c1)]+'\x27:'),console[_0x30992a(0x258)]('─'['repeat'](0x3c)),console[_0x30992a(0x258)](_0x56a7ca[_0x30992a(0x1e9)]),console[_0x30992a(0x258)]('─'[_0x30992a(0x1c2)](0x3c)));}for(const _0x3efb79 of _0x48add5){_0x3efb79[_0x30992a(0x1e9)]&&(console['log'](_0x30992a(0x1f6)+_0x3efb79[_0x30992a(0x1c1)]+'\x27:'),console[_0x30992a(0x258)]('─'[_0x30992a(0x1c2)](0x3c)),console[_0x30992a(0x258)](_0x3efb79[_0x30992a(0x1e9)]),console[_0x30992a(0x258)]('─'[_0x30992a(0x1c2)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']=a4_0xc37a6a(0x240);[a4_0xc37a6a(0x1b7)]=a4_0xc37a6a(0x1c8);async['execute'](_0x289fa0){const _0x3b021b=a4_0xc37a6a,{options:_0x15840a,args:_0x17c6f4,tdx:_0x1e43c7}=_0x289fa0,_0x1f3f54=_0x17c6f4[0x0],_0x315801=_0x17c6f4[0x1],_0x43257d=_0x15840a[_0x3b021b(0x1c0)],_0x3bcfc9=_0x15840a['dryRun'],_0x53f2d8=_0x15840a[_0x3b021b(0x252)],_0x26f686=_0x15840a[_0x3b021b(0x20f)],_0x397cb8=_0x15840a[_0x3b021b(0x1d6)],_0x4e6b43=_0x15840a['agent'];let _0x3b3ddc;if(_0x1f3f54){const _0x3a9788=a4_0x3f8ec3[_0x3b021b(0x202)](_0x1f3f54,_0x3b021b(0x1ce));if(existsSync(_0x3a9788))try{const _0x1c1b97=JSON[_0x3b021b(0x24a)](readFileSync(_0x3a9788,'utf-8'));_0x1c1b97[_0x3b021b(0x238)]&&(_0x3b3ddc={'llm_project':_0x1c1b97[_0x3b021b(0x238)]});}catch{}}const _0x5606ae=findAgentConfigPath(process[_0x3b021b(0x20e)]());let _0x302124;if(_0x5606ae)try{const _0x84ec20=JSON[_0x3b021b(0x24a)](readFileSync(_0x5606ae,_0x3b021b(0x242)));_0x84ec20[_0x3b021b(0x238)]&&(_0x302124={'llm_project':_0x84ec20[_0x3b021b(0x238)]});}catch{}const _0x2d5c30=resolveAgentPullArgs({'arg':_0x1f3f54,'agentNameArg':_0x315801,'agentFlag':_0x4e6b43,'contextProject':_0x397cb8,'argDirConfig':_0x3b3ddc,'cwdConfigPath':_0x5606ae||undefined,'cwdConfig':_0x302124}),{projectNameOrId:_0x1a10a5,targetAgentName:_0x14ba8d,existingOutputDir:_0x895d85,source:_0x33eae3}=_0x2d5c30;if(_0x33eae3==='arg-dir')console[_0x3b021b(0x258)](a4_0x1140fa[_0x3b021b(0x216)]('Using\x20project\x20from\x20'+a4_0x3f8ec3[_0x3b021b(0x202)](_0x1f3f54,'tdx.json')+':\x20'+_0x1a10a5));else{if(_0x33eae3===_0x3b021b(0x244))console[_0x3b021b(0x258)](a4_0x1140fa[_0x3b021b(0x216)](_0x3b021b(0x1d8)+_0x1a10a5));else _0x33eae3===_0x3b021b(0x217)&&console[_0x3b021b(0x258)](a4_0x1140fa[_0x3b021b(0x216)]('Using\x20project\x20from\x20context:\x20'+_0x1a10a5));}if(!_0x1a10a5)return _0x4e6b43?(console['log'](a4_0x1140fa[_0x3b021b(0x1ea)](_0x3b021b(0x1f4))),console[_0x3b021b(0x258)]('Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>'),console['log'](_0x3b021b(0x23d))):(console[_0x3b021b(0x258)](a4_0x1140fa[_0x3b021b(0x1ea)](_0x3b021b(0x1c3))),console[_0x3b021b(0x258)](_0x3b021b(0x1f1)),console[_0x3b021b(0x258)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project'),console[_0x3b021b(0x258)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory'),console[_0x3b021b(0x258)](_0x3b021b(0x24b)),console[_0x3b021b(0x258)](_0x3b021b(0x206))),0x1;if(_0x14ba8d){const {data:_0x4d148e}=await withSpinner(_0x3b021b(0x1c4)+_0x14ba8d+'\x22\x20from\x20project\x20\x22'+_0x1a10a5+'\x22...',()=>_0x1e43c7[_0x3b021b(0x23b)][_0x3b021b(0x239)](_0x1a10a5,_0x14ba8d,_0x43257d,{'dryRun':_0x3bcfc9,'force':_0x53f2d8}));if(_0x3bcfc9)return console[_0x3b021b(0x258)](a4_0x1140fa[_0x3b021b(0x1ea)]('Dry\x20run\x20-\x20no\x20files\x20written')),console[_0x3b021b(0x258)](_0x3b021b(0x20a)+_0x4d148e[_0x3b021b(0x20d)]),console[_0x3b021b(0x258)](_0x3b021b(0x1fe)+_0x4d148e[_0x3b021b(0x25d)]),_0x4d148e[_0x3b021b(0x1e9)]&&(console[_0x3b021b(0x258)](_0x3b021b(0x23e)),console[_0x3b021b(0x258)]('─'[_0x3b021b(0x1c2)](0x3c)),console['log'](_0x4d148e[_0x3b021b(0x1e9)]),console[_0x3b021b(0x258)]('─'[_0x3b021b(0x1c2)](0x3c))),0x0;return console[_0x3b021b(0x258)](a4_0x1140fa[_0x3b021b(0x24e)](_0x3b021b(0x21c))),console['log'](_0x3b021b(0x24c)+_0x4d148e[_0x3b021b(0x20d)]),console[_0x3b021b(0x258)](_0x3b021b(0x21a)+_0x4d148e[_0x3b021b(0x25d)]),console[_0x3b021b(0x258)](_0x3b021b(0x251)+(_0x4d148e[_0x3b021b(0x1dd)]?a4_0x1140fa['green'](_0x3b021b(0x1d4)):_0x4d148e[_0x3b021b(0x223)]?a4_0x1140fa[_0x3b021b(0x1ea)](_0x3b021b(0x227)):a4_0x1140fa['gray'](_0x3b021b(0x226)))),0x0;}const _0x59ec1a=_0x895d85||_0x43257d,{data:_0x30a9f4}=await withSpinner('Analyzing\x20project\x20\x22'+_0x1a10a5+'\x22...',()=>_0x1e43c7[_0x3b021b(0x23b)][_0x3b021b(0x1c9)](_0x1a10a5,_0x59ec1a,{'dryRun':!![]})),_0x402a35=_0x30a9f4['counts']['agents']['new']+_0x30a9f4[_0x3b021b(0x1cf)][_0x3b021b(0x269)]['new']+_0x30a9f4[_0x3b021b(0x1cf)]['textKnowledgeBases'][_0x3b021b(0x1d4)]+_0x30a9f4[_0x3b021b(0x1cf)][_0x3b021b(0x246)][_0x3b021b(0x1d4)]+_0x30a9f4[_0x3b021b(0x1cf)][_0x3b021b(0x22f)][_0x3b021b(0x1d4)]+_0x30a9f4[_0x3b021b(0x1cf)]['experimentalKnowledgeBases'][_0x3b021b(0x1d4)]+_0x30a9f4[_0x3b021b(0x1cf)][_0x3b021b(0x22b)][_0x3b021b(0x1d4)]+_0x30a9f4['counts']['formInterfaces'][_0x3b021b(0x1d4)]+_0x30a9f4[_0x3b021b(0x1cf)][_0x3b021b(0x25f)]['new'],_0x4a0961=_0x30a9f4[_0x3b021b(0x1cf)]['agents'][_0x3b021b(0x227)]+_0x30a9f4[_0x3b021b(0x1cf)][_0x3b021b(0x269)]['updated']+_0x30a9f4[_0x3b021b(0x1cf)][_0x3b021b(0x224)][_0x3b021b(0x227)]+_0x30a9f4[_0x3b021b(0x1cf)][_0x3b021b(0x246)][_0x3b021b(0x227)]+_0x30a9f4['counts'][_0x3b021b(0x22f)][_0x3b021b(0x227)]+_0x30a9f4[_0x3b021b(0x1cf)][_0x3b021b(0x268)][_0x3b021b(0x227)]+_0x30a9f4[_0x3b021b(0x1cf)]['experimentalArtifacts'][_0x3b021b(0x227)]+_0x30a9f4[_0x3b021b(0x1cf)][_0x3b021b(0x21e)][_0x3b021b(0x227)]+_0x30a9f4[_0x3b021b(0x1cf)]['chatInterfaces'][_0x3b021b(0x227)],_0x33a425=_0x30a9f4['counts'][_0x3b021b(0x234)][_0x3b021b(0x226)]+_0x30a9f4[_0x3b021b(0x1cf)][_0x3b021b(0x269)]['unchanged']+_0x30a9f4[_0x3b021b(0x1cf)]['textKnowledgeBases'][_0x3b021b(0x226)]+_0x30a9f4['counts'][_0x3b021b(0x246)]['unchanged']+_0x30a9f4['counts']['integrations']['unchanged']+_0x30a9f4['counts'][_0x3b021b(0x268)][_0x3b021b(0x226)]+_0x30a9f4['counts'][_0x3b021b(0x22b)]['unchanged']+_0x30a9f4[_0x3b021b(0x1cf)][_0x3b021b(0x21e)][_0x3b021b(0x226)]+_0x30a9f4[_0x3b021b(0x1cf)][_0x3b021b(0x25f)][_0x3b021b(0x226)];console[_0x3b021b(0x258)](_0x3b021b(0x231)+_0x30a9f4['projectName']+'\x27:'),console[_0x3b021b(0x258)]('\x20\x20'+a4_0x1140fa[_0x3b021b(0x24e)]('+\x20'+_0x402a35+_0x3b021b(0x21f))+_0x3b021b(0x1fc)+a4_0x1140fa['yellow']('~\x20'+_0x4a0961+_0x3b021b(0x1ca))+_0x3b021b(0x1fc)+a4_0x1140fa[_0x3b021b(0x216)]('=\x20'+_0x33a425+_0x3b021b(0x1c6))),console[_0x3b021b(0x258)](_0x3b021b(0x23c)+formatCountSummary(_0x30a9f4['counts'][_0x3b021b(0x234)])),console[_0x3b021b(0x258)](_0x3b021b(0x265)+formatCountSummary(_0x30a9f4[_0x3b021b(0x1cf)][_0x3b021b(0x269)])),console['log']('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x30a9f4['counts']['textKnowledgeBases'])),console[_0x3b021b(0x258)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x30a9f4[_0x3b021b(0x1cf)][_0x3b021b(0x246)])),console[_0x3b021b(0x258)](_0x3b021b(0x1fd)+formatCountSummary(_0x30a9f4[_0x3b021b(0x1cf)][_0x3b021b(0x22f)])),console[_0x3b021b(0x258)]('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0x30a9f4['counts'][_0x3b021b(0x21e)])),console[_0x3b021b(0x258)](_0x3b021b(0x26d)+formatCountSummary(_0x30a9f4[_0x3b021b(0x1cf)][_0x3b021b(0x25f)]));const _0x4cfd34=_0x30a9f4[_0x3b021b(0x1cf)]['experimentalKnowledgeBases'][_0x3b021b(0x22e)]>0x0||_0x30a9f4[_0x3b021b(0x1cf)]['experimentalArtifacts'][_0x3b021b(0x22e)]>0x0;_0x4cfd34&&(console[_0x3b021b(0x258)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x30a9f4[_0x3b021b(0x1cf)][_0x3b021b(0x268)])),console['log']('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x30a9f4[_0x3b021b(0x1cf)][_0x3b021b(0x22b)])));console[_0x3b021b(0x258)](_0x3b021b(0x1eb)+a4_0x1140fa[_0x3b021b(0x1cb)](_0x30a9f4[_0x3b021b(0x1b5)])),displayDiffs(_0x30a9f4[_0x3b021b(0x234)],_0x30a9f4[_0x3b021b(0x269)],_0x30a9f4[_0x3b021b(0x224)],_0x30a9f4[_0x3b021b(0x246)],_0x30a9f4[_0x3b021b(0x22f)],_0x30a9f4[_0x3b021b(0x268)],_0x30a9f4[_0x3b021b(0x22b)],_0x30a9f4[_0x3b021b(0x21e)],_0x30a9f4[_0x3b021b(0x25f)]);if(_0x3bcfc9)return console[_0x3b021b(0x258)](a4_0x1140fa['yellow'](_0x3b021b(0x1be))),0x0;if(_0x402a35===0x0&&_0x4a0961===0x0)return console['log'](a4_0x1140fa[_0x3b021b(0x24e)](_0x3b021b(0x200))),saveSessionContext({'llm_project':_0x30a9f4[_0x3b021b(0x267)]},_0x15840a[_0x3b021b(0x243)]),console[_0x3b021b(0x258)](a4_0x1140fa['green'](_0x3b021b(0x1d3)+a4_0x1140fa[_0x3b021b(0x216)](_0x3b021b(0x238))+_0x3b021b(0x221)+a4_0x1140fa['cyan'](_0x30a9f4[_0x3b021b(0x267)]))),0x0;if(!_0x26f686&&!_0x53f2d8){if(!isInteractive())return console[_0x3b021b(0x262)](a4_0x1140fa[_0x3b021b(0x23a)]('\x0aError:'),_0x3b021b(0x205)),console[_0x3b021b(0x262)](a4_0x1140fa[_0x3b021b(0x216)](_0x3b021b(0x21d))),0x1;const _0x146edb=await confirmKey('\x0aWrite\x20'+(_0x402a35+_0x4a0961)+_0x3b021b(0x1f7));if(!_0x146edb)return console[_0x3b021b(0x258)](a4_0x1140fa['yellow']('Cancelled'),_0x3b021b(0x266)),0x1;}const {data:_0x1df425}=await withSpinner('Writing\x20files...',()=>_0x1e43c7[_0x3b021b(0x23b)][_0x3b021b(0x1c9)](_0x1a10a5,_0x59ec1a,{'force':_0x53f2d8}));return console[_0x3b021b(0x258)](a4_0x1140fa['green'](_0x3b021b(0x264)+(_0x402a35+_0x4a0961)+_0x3b021b(0x22d)+_0x1df425[_0x3b021b(0x1b5)])),saveSessionContext({'llm_project':_0x1df425['projectName']},_0x15840a['session']),console[_0x3b021b(0x258)](a4_0x1140fa[_0x3b021b(0x24e)](_0x3b021b(0x1d3)+a4_0x1140fa[_0x3b021b(0x216)](_0x3b021b(0x238))+_0x3b021b(0x221)+a4_0x1140fa['cyan'](_0x1df425[_0x3b021b(0x267)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']='agent:clone';[a4_0xc37a6a(0x1b7)]='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async['execute'](_0x381cf6){const _0x1a6be5=a4_0xc37a6a,{options:_0x3f8ede,args:_0x3d1a37,tdx:_0x33ff13}=_0x381cf6,_0x4a4b37=_0x3d1a37[0x0],_0xfcbe7=_0x3f8ede[_0x1a6be5(0x1c1)],_0x2fa998=_0x3f8ede[_0x1a6be5(0x1dc)],_0x27e9a8=_0x3f8ede[_0x1a6be5(0x20f)],_0x18d932=_0x3f8ede[_0x1a6be5(0x219)],_0x2f20af=_0x3f8ede['llmProject'];let _0x3e5291;const _0x2ead77=findAgentConfigPath(process[_0x1a6be5(0x20e)]());if(_0x4a4b37){const _0x2274af=a4_0x3f8ec3['join'](_0x4a4b37,_0x1a6be5(0x1ce));existsSync(_0x2274af)?(_0x3e5291=_0x4a4b37,console[_0x1a6be5(0x258)](a4_0x1140fa['dim'](_0x1a6be5(0x1ed)+_0x4a4b37))):_0x3e5291=_0x4a4b37;}else{if(_0x2ead77)_0x3e5291=a4_0x3f8ec3['dirname'](_0x2ead77),console[_0x1a6be5(0x258)](a4_0x1140fa[_0x1a6be5(0x216)]('Using\x20current\x20project:\x20'+_0x3e5291));else{if(_0x2f20af){const _0x1de73f=sanitizeForFilesystem(_0x2f20af);let _0x29578b=_0x1de73f,_0x559f5d=a4_0x3f8ec3[_0x1a6be5(0x202)](process[_0x1a6be5(0x20e)](),_0x1a6be5(0x234),_0x1de73f,_0x1a6be5(0x1ce));if(!existsSync(_0x559f5d)){const _0x29b49b=normalizeName(_0x2f20af),_0x41f0cb=a4_0x3f8ec3[_0x1a6be5(0x202)](process[_0x1a6be5(0x20e)](),_0x1a6be5(0x234),_0x29b49b,_0x1a6be5(0x1ce));existsSync(_0x41f0cb)&&(_0x29578b=_0x29b49b,_0x559f5d=_0x41f0cb);}if(existsSync(_0x559f5d))_0x3e5291=a4_0x3f8ec3[_0x1a6be5(0x241)](_0x559f5d),console[_0x1a6be5(0x258)](a4_0x1140fa['dim']('Using\x20local\x20project:\x20'+_0x3e5291));else{const _0x4cc418=_0x3f8ede[_0x1a6be5(0x1cd)];if(_0x4cc418)throw new SDKError(ErrorCode[_0x1a6be5(0x237)],_0x1a6be5(0x25c)+_0x2f20af+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x1a6be5(0x249)+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+(_0x1a6be5(0x222)+_0x2f20af+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x29578b+'\x20--name\x20'+(_0xfcbe7||_0x1a6be5(0x25e))+_0x1a6be5(0x1bc)+_0x4cc418)});_0x3e5291=_0x2f20af,console[_0x1a6be5(0x258)](a4_0x1140fa['dim'](_0x1a6be5(0x26b)+_0x2f20af));}}}}if(!_0x3e5291)return console[_0x1a6be5(0x258)](a4_0x1140fa[_0x1a6be5(0x1ea)](_0x1a6be5(0x214))),console[_0x1a6be5(0x258)](_0x1a6be5(0x1d2)),console[_0x1a6be5(0x258)](_0x1a6be5(0x218)),console['log'](_0x1a6be5(0x21b)),console[_0x1a6be5(0x258)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0xfcbe7)throw new SDKError(ErrorCode[_0x1a6be5(0x1d1)],'New\x20project\x20name\x20is\x20required',undefined,{'helpText':_0x1a6be5(0x1bf)});if(!_0x27e9a8&&!_0x2fa998){if(!isInteractive())return console[_0x1a6be5(0x262)](a4_0x1140fa[_0x1a6be5(0x23a)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x1a6be5(0x262)](a4_0x1140fa[_0x1a6be5(0x216)](_0x1a6be5(0x21d))),0x1;const _0x5ba3b9=await confirmKey(_0x1a6be5(0x245)+_0x3e5291+_0x1a6be5(0x1b9)+_0xfcbe7+'\x22?');if(!_0x5ba3b9)return console['log'](a4_0x1140fa[_0x1a6be5(0x1ea)](_0x1a6be5(0x1e8))),0x1;}const {data:_0x43a78c}=await withSpinner(_0x1a6be5(0x1b6)+_0x3e5291+_0x1a6be5(0x203)+_0xfcbe7+'\x22...',()=>_0x33ff13[_0x1a6be5(0x23b)][_0x1a6be5(0x1bb)](_0x3e5291,_0xfcbe7,{'dryRun':_0x2fa998}));if(_0x2fa998){console[_0x1a6be5(0x258)](a4_0x1140fa['yellow'](_0x1a6be5(0x1c7))),console[_0x1a6be5(0x258)]('Source:\x20'+_0x43a78c[_0x1a6be5(0x207)]),console[_0x1a6be5(0x258)](_0x1a6be5(0x1ba)+_0xfcbe7),console[_0x1a6be5(0x258)]('Would\x20clone:'),console['log'](_0x1a6be5(0x23c)+_0x43a78c[_0x1a6be5(0x1cf)][_0x1a6be5(0x234)][_0x1a6be5(0x1ff)]),console[_0x1a6be5(0x258)](_0x1a6be5(0x265)+_0x43a78c[_0x1a6be5(0x1cf)][_0x1a6be5(0x269)][_0x1a6be5(0x1ff)]),console[_0x1a6be5(0x258)](_0x1a6be5(0x1f5)+_0x43a78c[_0x1a6be5(0x1cf)][_0x1a6be5(0x246)]['created']),console[_0x1a6be5(0x258)](_0x1a6be5(0x1db)+_0x43a78c[_0x1a6be5(0x1cf)]['formInterfaces'][_0x1a6be5(0x1ff)]),console[_0x1a6be5(0x258)](_0x1a6be5(0x26d)+_0x43a78c['counts'][_0x1a6be5(0x25f)]['created']);const _0x4df055=_0x43a78c[_0x1a6be5(0x1cf)][_0x1a6be5(0x268)][_0x1a6be5(0x1ff)]>0x0||_0x43a78c['counts'][_0x1a6be5(0x22b)][_0x1a6be5(0x1ff)]>0x0;return _0x4df055&&(console[_0x1a6be5(0x258)](_0x1a6be5(0x22a)+_0x43a78c[_0x1a6be5(0x1cf)][_0x1a6be5(0x268)]['created']),console[_0x1a6be5(0x258)](_0x1a6be5(0x1f3)+_0x43a78c[_0x1a6be5(0x1cf)]['experimentalArtifacts'][_0x1a6be5(0x1ff)])),0x0;}const _0xd7da43=_0x43a78c[_0x1a6be5(0x1cf)][_0x1a6be5(0x234)][_0x1a6be5(0x1e1)]>0x0||_0x43a78c[_0x1a6be5(0x1cf)]['knowledgeBases']['errors']>0x0||_0x43a78c['counts'][_0x1a6be5(0x246)]['errors']>0x0||_0x43a78c[_0x1a6be5(0x1cf)]['formInterfaces'][_0x1a6be5(0x1e1)]>0x0||_0x43a78c[_0x1a6be5(0x1cf)][_0x1a6be5(0x25f)][_0x1a6be5(0x1e1)]>0x0||_0x43a78c[_0x1a6be5(0x1cf)]['experimentalKnowledgeBases'][_0x1a6be5(0x1e1)]>0x0||_0x43a78c[_0x1a6be5(0x1cf)][_0x1a6be5(0x22b)][_0x1a6be5(0x1e1)]>0x0;_0xd7da43?console[_0x1a6be5(0x258)](a4_0x1140fa['yellow'](_0x1a6be5(0x24f))):console[_0x1a6be5(0x258)](a4_0x1140fa[_0x1a6be5(0x24e)]('Project\x20cloned\x20successfully'));console[_0x1a6be5(0x258)](_0x1a6be5(0x1e7)+_0x43a78c['sourceProjectName']),console[_0x1a6be5(0x258)](_0x1a6be5(0x1ba)+_0x43a78c[_0x1a6be5(0x25b)]),console[_0x1a6be5(0x258)](_0x1a6be5(0x1e6)+_0x43a78c[_0x1a6be5(0x22c)]),console['log'](),console[_0x1a6be5(0x258)](_0x1a6be5(0x1f9)),console[_0x1a6be5(0x258)]('\x20\x20Agents:\x20'+formatCountSummary(_0x43a78c[_0x1a6be5(0x1cf)]['agents'])),console['log'](_0x1a6be5(0x265)+formatCountSummary(_0x43a78c[_0x1a6be5(0x1cf)][_0x1a6be5(0x269)])),console['log'](_0x1a6be5(0x1f5)+formatCountSummary(_0x43a78c[_0x1a6be5(0x1cf)]['prompts'])),console[_0x1a6be5(0x258)](_0x1a6be5(0x1fd)+formatCountSummary(_0x43a78c[_0x1a6be5(0x1cf)][_0x1a6be5(0x22f)])),console[_0x1a6be5(0x258)](_0x1a6be5(0x1db)+formatCountSummary(_0x43a78c[_0x1a6be5(0x1cf)][_0x1a6be5(0x21e)])),console['log'](_0x1a6be5(0x26d)+formatCountSummary(_0x43a78c['counts'][_0x1a6be5(0x25f)]));const _0x1942d1=_0x43a78c[_0x1a6be5(0x1cf)][_0x1a6be5(0x268)]['created']>0x0||_0x43a78c['counts']['experimentalKnowledgeBases'][_0x1a6be5(0x227)]>0x0||_0x43a78c[_0x1a6be5(0x1cf)]['experimentalKnowledgeBases'][_0x1a6be5(0x226)]>0x0||_0x43a78c[_0x1a6be5(0x1cf)][_0x1a6be5(0x22b)][_0x1a6be5(0x1ff)]>0x0||_0x43a78c['counts'][_0x1a6be5(0x22b)][_0x1a6be5(0x227)]>0x0||_0x43a78c[_0x1a6be5(0x1cf)][_0x1a6be5(0x22b)]['unchanged']>0x0;_0x1942d1&&(console[_0x1a6be5(0x258)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x43a78c['counts'][_0x1a6be5(0x268)])),console[_0x1a6be5(0x258)](_0x1a6be5(0x1f3)+formatCountSummary(_0x43a78c['counts'][_0x1a6be5(0x22b)])));if(_0xd7da43){console['log'](),console[_0x1a6be5(0x258)](a4_0x1140fa[_0x1a6be5(0x23a)](_0x1a6be5(0x1b3)));for(const _0xbc8f88 of _0x43a78c[_0x1a6be5(0x234)]){_0xbc8f88[_0x1a6be5(0x24d)]===_0x1a6be5(0x262)&&console[_0x1a6be5(0x258)](a4_0x1140fa['red'](_0x1a6be5(0x1d5)+_0xbc8f88['agentName']+_0x1a6be5(0x261)+_0xbc8f88[_0x1a6be5(0x262)]));}for(const _0x17bd09 of _0x43a78c[_0x1a6be5(0x269)]){_0x17bd09[_0x1a6be5(0x24d)]===_0x1a6be5(0x262)&&console['log'](a4_0x1140fa[_0x1a6be5(0x23a)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x17bd09[_0x1a6be5(0x1c1)]+_0x1a6be5(0x261)+_0x17bd09[_0x1a6be5(0x262)]));}for(const _0x4ed9d8 of _0x43a78c[_0x1a6be5(0x246)]){_0x4ed9d8[_0x1a6be5(0x24d)]==='error'&&console[_0x1a6be5(0x258)](a4_0x1140fa[_0x1a6be5(0x23a)](_0x1a6be5(0x235)+_0x4ed9d8[_0x1a6be5(0x1c1)]+_0x1a6be5(0x261)+_0x4ed9d8['error']));}for(const _0x5dde76 of _0x43a78c[_0x1a6be5(0x22f)]){_0x5dde76['action']==='error'&&console[_0x1a6be5(0x258)](a4_0x1140fa[_0x1a6be5(0x23a)](_0x1a6be5(0x263)+_0x5dde76[_0x1a6be5(0x1c1)]+'\x22:\x20'+_0x5dde76['error']));}for(const _0x5f3ab4 of _0x43a78c['formInterfaces']){_0x5f3ab4['action']===_0x1a6be5(0x262)&&console[_0x1a6be5(0x258)](a4_0x1140fa[_0x1a6be5(0x23a)](_0x1a6be5(0x215)+_0x5f3ab4[_0x1a6be5(0x1c1)]+'\x22:\x20'+_0x5f3ab4[_0x1a6be5(0x262)]));}for(const _0x105557 of _0x43a78c[_0x1a6be5(0x25f)]){_0x105557[_0x1a6be5(0x24d)]==='error'&&console[_0x1a6be5(0x258)](a4_0x1140fa['red'](_0x1a6be5(0x1e5)+_0x105557[_0x1a6be5(0x1c1)]+_0x1a6be5(0x261)+_0x105557[_0x1a6be5(0x262)]));}for(const _0x1600a3 of _0x43a78c['experimentalKnowledgeBases']){_0x1600a3[_0x1a6be5(0x24d)]===_0x1a6be5(0x262)&&console['log'](a4_0x1140fa[_0x1a6be5(0x23a)](_0x1a6be5(0x230)+_0x1600a3[_0x1a6be5(0x1c1)]+_0x1a6be5(0x261)+_0x1600a3['error']));}for(const _0x400b00 of _0x43a78c[_0x1a6be5(0x22b)]){_0x400b00[_0x1a6be5(0x24d)]===_0x1a6be5(0x262)&&console['log'](a4_0x1140fa[_0x1a6be5(0x23a)](_0x1a6be5(0x1ee)+_0x400b00['name']+_0x1a6be5(0x261)+_0x400b00['error']));}return 0x1;}console[_0x1a6be5(0x258)]();const _0x42e675=getLLMProjectUrl(_0x18d932,_0x43a78c[_0x1a6be5(0x22c)]);return console[_0x1a6be5(0x258)](_0x1a6be5(0x1d7)+a4_0x1140fa['cyan'](_0x42e675)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0xc37a6a(0x1c1)]='agent:push';[a4_0xc37a6a(0x1b7)]=a4_0xc37a6a(0x1ec);async[a4_0xc37a6a(0x1f8)](_0x47483e){const _0x4721a5=a4_0xc37a6a,{options:_0x33a740,args:_0x1cbed1,tdx:_0x4194e8}=_0x47483e;let _0x596d24=_0x1cbed1[0x0]||process['cwd']();const _0x1008ea=_0x33a740[_0x4721a5(0x1dc)],_0x4a61ad=_0x33a740[_0x4721a5(0x252)],_0x3bc897=_0x33a740[_0x4721a5(0x20f)],_0x2206a6=_0x33a740[_0x4721a5(0x219)],_0x2a6d6f=a4_0x3f8ec3['join'](_0x596d24,_0x4721a5(0x20b)),_0x27c465=existsSync(_0x2a6d6f);if(_0x27c465){const {data:_0x4203ed}=await withSpinner(_0x4721a5(0x257)+_0x596d24+_0x4721a5(0x1f2),()=>_0x4194e8[_0x4721a5(0x23b)]['pushAgent'](_0x596d24,{'dryRun':_0x1008ea,'force':_0x4a61ad}));if(_0x1008ea)return console[_0x4721a5(0x258)](a4_0x1140fa[_0x4721a5(0x1ea)](_0x4721a5(0x1c7))),console['log'](_0x4721a5(0x23f)+_0x4203ed[_0x4721a5(0x20d)]),0x0;if(_0x4203ed[_0x4721a5(0x24d)]==='error')return console[_0x4721a5(0x258)](a4_0x1140fa['red']('Failed\x20to\x20push\x20agent:\x20'+_0x4203ed['error'])),0x1;console[_0x4721a5(0x258)](a4_0x1140fa[_0x4721a5(0x24e)](_0x4721a5(0x208)+_0x4203ed[_0x4721a5(0x24d)]+_0x4721a5(0x1e2))),console[_0x4721a5(0x258)](_0x4721a5(0x24c)+_0x4203ed[_0x4721a5(0x20d)]);if(_0x4203ed[_0x4721a5(0x213)]&&_0x4203ed[_0x4721a5(0x220)]){const _0x5a54a6=getLLMAgentChatUrl(_0x2206a6,_0x4203ed[_0x4721a5(0x220)],_0x4203ed[_0x4721a5(0x213)]);console['log']('Chat:\x20'+a4_0x1140fa[_0x4721a5(0x1cb)](_0x5a54a6));}return 0x0;}const _0x47f25b=_0x33a740[_0x4721a5(0x1d6)],_0x1d3ccd=resolveProjectFromContext(_0x596d24,_0x47f25b);if(_0x1d3ccd[_0x4721a5(0x236)])_0x596d24=_0x1d3ccd[_0x4721a5(0x26c)],_0x1d3ccd['source']===_0x4721a5(0x217)&&console[_0x4721a5(0x258)](a4_0x1140fa['dim'](_0x4721a5(0x1d8)+_0x596d24));else{let _0x4952cc=_0x4721a5(0x259);_0x1d3ccd['reason']===_0x4721a5(0x26a)&&(_0x4952cc=_0x1d3ccd['message']+_0x4721a5(0x248)+_0x1d3ccd[_0x4721a5(0x1d6)]+_0x4721a5(0x1e4));throw new SDKError(ErrorCode[_0x4721a5(0x237)],_0x1d3ccd['reason']==='no_context'?_0x1d3ccd['message']:_0x4721a5(0x255)+_0x596d24,undefined,{'helpText':_0x4952cc});}const {data:_0x48fb0d}=await withSpinner(_0x4721a5(0x1cc),()=>_0x4194e8[_0x4721a5(0x23b)][_0x4721a5(0x225)](_0x596d24,{'dryRun':!![]})),_0x2485a7=_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x234)]['errors']>0x0;if(_0x2485a7){console[_0x4721a5(0x258)](a4_0x1140fa[_0x4721a5(0x23a)]('\x0aErrors\x20found:'));for(const _0x449153 of _0x48fb0d[_0x4721a5(0x234)]){_0x449153[_0x4721a5(0x24d)]===_0x4721a5(0x262)&&console[_0x4721a5(0x258)](a4_0x1140fa[_0x4721a5(0x23a)](_0x4721a5(0x1d5)+_0x449153[_0x4721a5(0x20d)]+_0x4721a5(0x261)+_0x449153[_0x4721a5(0x262)]));}return 0x1;}const _0x589ef1=_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x234)][_0x4721a5(0x1ff)]+_0x48fb0d[_0x4721a5(0x1cf)]['knowledgeBases'][_0x4721a5(0x1ff)]+_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x224)]['created']+_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x246)][_0x4721a5(0x1ff)]+_0x48fb0d[_0x4721a5(0x1cf)]['integrations'][_0x4721a5(0x1ff)]+_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x268)][_0x4721a5(0x1ff)]+_0x48fb0d[_0x4721a5(0x1cf)]['experimentalArtifacts'][_0x4721a5(0x1ff)]+_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x21e)][_0x4721a5(0x1ff)]+_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x25f)][_0x4721a5(0x1ff)],_0x3e6eb6=_0x48fb0d['counts'][_0x4721a5(0x234)]['updated']+_0x48fb0d['counts'][_0x4721a5(0x269)][_0x4721a5(0x227)]+_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x224)][_0x4721a5(0x227)]+_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x246)][_0x4721a5(0x227)]+_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x22f)][_0x4721a5(0x227)]+_0x48fb0d['counts']['experimentalKnowledgeBases'][_0x4721a5(0x227)]+_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x22b)][_0x4721a5(0x227)]+_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x21e)][_0x4721a5(0x227)]+_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x25f)][_0x4721a5(0x227)],_0x19d1f2=_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x234)][_0x4721a5(0x226)]+_0x48fb0d['counts'][_0x4721a5(0x269)][_0x4721a5(0x226)]+_0x48fb0d[_0x4721a5(0x1cf)]['textKnowledgeBases'][_0x4721a5(0x226)]+_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x246)]['unchanged']+_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x22f)][_0x4721a5(0x226)]+_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x268)][_0x4721a5(0x226)]+_0x48fb0d['counts'][_0x4721a5(0x22b)][_0x4721a5(0x226)]+_0x48fb0d[_0x4721a5(0x1cf)]['formInterfaces'][_0x4721a5(0x226)]+_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x25f)][_0x4721a5(0x226)];console[_0x4721a5(0x258)](_0x4721a5(0x253)+_0x48fb0d[_0x4721a5(0x267)]+'\x27:'),console['log']('\x20\x20'+a4_0x1140fa['green']('+\x20'+_0x589ef1+_0x4721a5(0x21f))+_0x4721a5(0x1fc)+a4_0x1140fa[_0x4721a5(0x1ea)]('~\x20'+_0x3e6eb6+_0x4721a5(0x1ca))+_0x4721a5(0x1fc)+a4_0x1140fa[_0x4721a5(0x216)]('=\x20'+_0x19d1f2+'\x20unchanged')),console['log'](_0x4721a5(0x23c)+formatCountSummary(_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x234)])),console[_0x4721a5(0x258)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x269)])),console['log'](_0x4721a5(0x1de)+formatCountSummary(_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x224)])),console[_0x4721a5(0x258)](_0x4721a5(0x1f5)+formatCountSummary(_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x246)])),console[_0x4721a5(0x258)](_0x4721a5(0x1fd)+formatCountSummary(_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x22f)])),console[_0x4721a5(0x258)](_0x4721a5(0x1db)+formatCountSummary(_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x21e)])),console[_0x4721a5(0x258)](_0x4721a5(0x26d)+formatCountSummary(_0x48fb0d[_0x4721a5(0x1cf)]['chatInterfaces']));const _0x208b09=_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x268)][_0x4721a5(0x1ff)]>0x0||_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x268)]['updated']>0x0||_0x48fb0d[_0x4721a5(0x1cf)]['experimentalKnowledgeBases']['unchanged']>0x0||_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x22b)][_0x4721a5(0x1ff)]>0x0||_0x48fb0d[_0x4721a5(0x1cf)]['experimentalArtifacts'][_0x4721a5(0x227)]>0x0||_0x48fb0d['counts']['experimentalArtifacts'][_0x4721a5(0x226)]>0x0;_0x208b09&&(console[_0x4721a5(0x258)](_0x4721a5(0x22a)+formatCountSummary(_0x48fb0d['counts'][_0x4721a5(0x268)])),console[_0x4721a5(0x258)](_0x4721a5(0x1f3)+formatCountSummary(_0x48fb0d[_0x4721a5(0x1cf)][_0x4721a5(0x22b)])));console[_0x4721a5(0x258)](_0x4721a5(0x1d9)+a4_0x1140fa[_0x4721a5(0x1cb)](_0x596d24)),displayDiffs(_0x48fb0d[_0x4721a5(0x234)],_0x48fb0d['knowledgeBases'],_0x48fb0d[_0x4721a5(0x224)],_0x48fb0d[_0x4721a5(0x246)],_0x48fb0d[_0x4721a5(0x22f)],_0x48fb0d[_0x4721a5(0x268)],_0x48fb0d[_0x4721a5(0x22b)],_0x48fb0d[_0x4721a5(0x21e)],_0x48fb0d['chatInterfaces']);if(_0x1008ea)return console[_0x4721a5(0x258)](a4_0x1140fa[_0x4721a5(0x1ea)](_0x4721a5(0x1df))),0x0;if(_0x589ef1===0x0&&_0x3e6eb6===0x0){console[_0x4721a5(0x258)](a4_0x1140fa[_0x4721a5(0x24e)](_0x4721a5(0x1e3)));const _0x30916f=getLLMProjectUrl(_0x2206a6,_0x48fb0d['projectId']);return console[_0x4721a5(0x258)](_0x4721a5(0x1d7)+a4_0x1140fa[_0x4721a5(0x1cb)](_0x30916f)),0x0;}if(!_0x3bc897&&!_0x4a61ad){if(!isInteractive())return console[_0x4721a5(0x262)](a4_0x1140fa['red'](_0x4721a5(0x211)),_0x4721a5(0x205)),console[_0x4721a5(0x262)](a4_0x1140fa[_0x4721a5(0x216)](_0x4721a5(0x21d))),0x1;const _0x5f0728=await confirmKey(_0x4721a5(0x204)+(_0x589ef1+_0x3e6eb6)+_0x4721a5(0x247));if(!_0x5f0728)return console[_0x4721a5(0x258)](a4_0x1140fa[_0x4721a5(0x1ea)](_0x4721a5(0x1e8)),_0x4721a5(0x228)),0x1;}const {data:_0x2dffa1}=await withSpinner(_0x4721a5(0x1f0),()=>_0x4194e8['llm'][_0x4721a5(0x225)](_0x596d24,{'force':_0x4a61ad})),_0x30ea2c=_0x2dffa1[_0x4721a5(0x1cf)]['agents']['errors']>0x0||_0x2dffa1[_0x4721a5(0x1cf)][_0x4721a5(0x269)]['errors']>0x0||_0x2dffa1[_0x4721a5(0x1cf)][_0x4721a5(0x224)][_0x4721a5(0x1e1)]>0x0||_0x2dffa1[_0x4721a5(0x1cf)]['prompts'][_0x4721a5(0x1e1)]>0x0||_0x2dffa1['counts'][_0x4721a5(0x21e)][_0x4721a5(0x1e1)]>0x0||_0x2dffa1[_0x4721a5(0x1cf)][_0x4721a5(0x25f)][_0x4721a5(0x1e1)]>0x0;if(_0x30ea2c){console['log'](a4_0x1140fa[_0x4721a5(0x1ea)](_0x4721a5(0x201))),console[_0x4721a5(0x258)](),console['log'](a4_0x1140fa[_0x4721a5(0x23a)](_0x4721a5(0x1b3)));for(const _0x1d0ec9 of _0x2dffa1[_0x4721a5(0x234)]){_0x1d0ec9[_0x4721a5(0x24d)]===_0x4721a5(0x262)&&console[_0x4721a5(0x258)](a4_0x1140fa[_0x4721a5(0x23a)]('\x20\x20Agent\x20\x22'+_0x1d0ec9['agentName']+'\x22:\x20'+_0x1d0ec9['error']));}for(const _0x1783ee of _0x2dffa1[_0x4721a5(0x269)]){_0x1783ee['action']==='error'&&console[_0x4721a5(0x258)](a4_0x1140fa['red'](_0x4721a5(0x250)+_0x1783ee[_0x4721a5(0x1c1)]+'\x22:\x20'+_0x1783ee[_0x4721a5(0x262)]));}for(const _0x16c63e of _0x2dffa1[_0x4721a5(0x224)]){_0x16c63e[_0x4721a5(0x24d)]===_0x4721a5(0x262)&&console[_0x4721a5(0x258)](a4_0x1140fa[_0x4721a5(0x23a)](_0x4721a5(0x1fb)+_0x16c63e['name']+_0x4721a5(0x261)+_0x16c63e['error']));}for(const _0x2c3efe of _0x2dffa1[_0x4721a5(0x246)]){_0x2c3efe[_0x4721a5(0x24d)]===_0x4721a5(0x262)&&console[_0x4721a5(0x258)](a4_0x1140fa['red'](_0x4721a5(0x235)+_0x2c3efe[_0x4721a5(0x1c1)]+_0x4721a5(0x261)+_0x2c3efe[_0x4721a5(0x262)]));}for(const _0x391deb of _0x2dffa1[_0x4721a5(0x22f)]){_0x391deb[_0x4721a5(0x24d)]===_0x4721a5(0x262)&&console[_0x4721a5(0x258)](a4_0x1140fa[_0x4721a5(0x23a)]('\x20\x20Integration\x20\x22'+_0x391deb[_0x4721a5(0x1c1)]+_0x4721a5(0x261)+_0x391deb[_0x4721a5(0x262)]));}for(const _0x5b51cf of _0x2dffa1[_0x4721a5(0x21e)]){_0x5b51cf[_0x4721a5(0x24d)]===_0x4721a5(0x262)&&console['log'](a4_0x1140fa[_0x4721a5(0x23a)](_0x4721a5(0x215)+_0x5b51cf[_0x4721a5(0x1c1)]+'\x22:\x20'+_0x5b51cf['error']));}for(const _0xb3c309 of _0x2dffa1[_0x4721a5(0x25f)]){_0xb3c309[_0x4721a5(0x24d)]===_0x4721a5(0x262)&&console['log'](a4_0x1140fa[_0x4721a5(0x23a)](_0x4721a5(0x1e5)+_0xb3c309[_0x4721a5(0x1c1)]+_0x4721a5(0x261)+_0xb3c309[_0x4721a5(0x262)]));}return 0x1;}console[_0x4721a5(0x258)](a4_0x1140fa['green']('\x0a✔\x20Pushed\x20'+(_0x589ef1+_0x3e6eb6)+_0x4721a5(0x209)+_0x2dffa1['projectName']+'\x27'));const _0x570616=getLLMProjectUrl(_0x2206a6,_0x2dffa1['projectId']);return console[_0x4721a5(0x258)](_0x4721a5(0x1d7)+a4_0x1140fa[_0x4721a5(0x1cb)](_0x570616)),0x0;}}function a4_0x30a1(){const _0xc11550=['-\x20nothing\x20pushed','2506YfTIxw','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','experimentalArtifacts','newProjectId','\x20files\x20to\x20','total','integrations','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x0aPull\x20summary\x20for\x20\x27','23492IUUgsw','1118132yFYgNW','agents','\x20\x20Prompt\x20\x22','found','INVALID_ARGUMENT','llm_project','pullAgent','red','llm','\x20\x20Agents:\x20','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\x0aChanges:','Would\x20push\x20agent:\x20','agent:pull','dirname','utf-8','session','cwd-config','Clone\x20\x22','prompts','\x20resources?','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','parse','\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','Agent:\x20','action','green','Project\x20cloned\x20with\x20errors','\x20\x20Knowledge\x20Base\x20\x22','Status:\x20','force','\x0aPush\x20summary\x20for\x20\x27','\x20updated','No\x20tdx.json\x20found\x20in\x20','1638iKGhoX','Pushing\x20agent\x20from\x20\x22','log','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','2736AZKIOn','newProjectName','Cannot\x20clone\x20from\x20context\x20project\x20\x22','outputPath','<new-name>','chatInterfaces','55fuYFpA','\x22:\x20','error','\x20\x20Integration\x20\x22','\x0a✔\x20Pulled\x20','\x20\x20Knowledge\x20Bases:\x20','-\x20no\x20files\x20written','projectName','experimentalKnowledgeBases','knowledgeBases','no_local_folder','Using\x20context\x20project:\x20','projectDir','\x20\x20Chat\x20Interfaces:\x20','Errors:','gray','outputDir','Cloning\x20\x22','description','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x22\x20to\x20new\x20project\x20\x22','New\x20project:\x20','cloneProject','\x20--profile\x20','9LnktSE','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','output','name','repeat','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','Pulling\x20agent\x20\x22','1712150JvawWj','\x20unchanged','Dry\x20run\x20-\x20no\x20changes\x20made','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','pullProject','\x20changed','cyan','Analyzing\x20changes\x20to\x20push...','profile','tdx.json','counts','\x20created','MISSING_ARGUMENT','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','✔\x20Context\x20set:\x20','new','\x20\x20Agent\x20\x22','llmProject','Project:\x20','Using\x20project:\x20','\x20\x20Source:\x20','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x20\x20Form\x20Interfaces:\x20','dryRun','isNew','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','36736535hRyKhu','errors','\x20successfully','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x20\x20Chat\x20Interface\x20\x22','New\x20project\x20ID:\x20','Source:\x20','Cancelled','diff','yellow','\x20\x20Target:\x20','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','Using\x20local\x20project:\x20','\x20\x20Experimental\x20Artifact\x20\x22','10141752TVMOTI','Pushing\x20to\x20project...','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)','\x22...','\x20\x20Experimental\x20Artifacts:\x20','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','\x20\x20Prompts:\x20','\x0aChanges\x20to\x20chat\x20interface\x20\x27','\x20files?','execute','Summary:','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x20|\x20','\x20\x20Integrations:\x20','Output\x20path:\x20','created','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','\x0aProject\x20pushed\x20with\x20errors','join','\x22\x20to\x20\x22','\x0aPush\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\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','sourceProjectName','Agent\x20','\x20resources\x20to\x20\x27','Would\x20pull\x20agent:\x20','agent.yml','push','agentName','cwd','yes','\x20errors','\x0aError:','300972LXbHqd','agentId','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','\x20\x20Form\x20Interface\x20\x22','dim','context','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','site','Output:\x20','\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)','Agent\x20pulled\x20successfully','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','formInterfaces','\x20new','projectId','\x20=\x20','\x20\x20tdx\x20agent\x20pull\x20','hasChanges','textKnowledgeBases','pushProject','unchanged','updated'];a4_0x30a1=function(){return _0xc11550;};return a4_0x30a1();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x3f0b29=a5_0x58d7;(function(_0x792dff,_0x95bf72){const _0x370ee6=a5_0x58d7,_0x28de38=_0x792dff();while(!![]){try{const _0x5711b4=parseInt(_0x370ee6(0x1a3))/0x1*(parseInt(_0x370ee6(0x1f6))/0x2)+-parseInt(_0x370ee6(0x1e9))/0x3*(parseInt(_0x370ee6(0x17e))/0x4)+-parseInt(_0x370ee6(0x1db))/0x5+parseInt(_0x370ee6(0x1b1))/0x6+parseInt(_0x370ee6(0x172))/0x7*(-parseInt(_0x370ee6(0x178))/0x8)+parseInt(_0x370ee6(0x173))/0x9+parseInt(_0x370ee6(0x1ca))/0xa*(parseInt(_0x370ee6(0x16f))/0xb);if(_0x5711b4===_0x95bf72)break;else _0x28de38['push'](_0x28de38['shift']());}catch(_0x240403){_0x28de38['push'](_0x28de38['shift']());}}}(a5_0x1187,0x6d17e));import*as a5_0x2a94c5 from'node:fs';import*as a5_0x439b96 from'node:path';function a5_0x58d7(_0x1563b4,_0x2cdf4a){_0x1563b4=_0x1563b4-0x162;const _0x11874d=a5_0x1187();let _0x58d7f6=_0x11874d[_0x1563b4];return _0x58d7f6;}import a5_0x809fd0 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_0x1187(){const _0x57691f=['projectDir','tests','\x20\x20Agent:\x20','rounds','\x20-\x20','Re-evaluation\x20Summary','json','\x20\x20Project:\x20','message','agent','start','some','\x20\x20Site:\x20',':\x20Sending\x20user\x20input...','Re-evaluating\x20cached\x20test\x20run...','writeFileSync','substring','No\x20tests\x20found\x20matching:\x20','Error\x20writing\x20output\x20file:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','587807IjodAS','Running:\x20','agentDirs','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','No\x20tests\x20found\x20with\x20tags:\x20','stop','Cached\x20run\x20from:\x20','toLowerCase','Errors:\x20\x20\x20','basename','✗\x20ERROR:\x20','white','testYmlPath','isSpinning','859260LxNkEV','\x20\x20Conversation:\x20','llm','name','Executing\x20new\x20tests...','now','not\x20found','dryRun','red','eval','resolveAgentId','tags','join','size','PASS','projectName','...\x20','404','\x20(new)','Output\x20written\x20to:\x20','Conversation\x20URL:\x20','reeval','has','Failed\x20Tests:','utf-8','270oeMgDT','conversations','find','\x20\x20Round\x20','Run\x20tests\x20for\x20an\x20LLM\x20agent','status','Evaluating\x20response...','\x20\x20-\x20','agent:test','FAIL','\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','Running\x20agent\x20tests...','...','toISOString','existsSync','resolveProjectId','Available\x20tags:\x20','2874990hzPFvt','Error:\x20No\x20previous\x20test\x20run\x20found.','\x20\x20Evaluating...\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','agentName','Test\x20Summary','length','Usage:','Re-evaluating...','verbose','no_local_folder','ERROR','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','Test\x20Configuration:','8097MZmwkm','✓\x20PASS:\x20','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)','green','jsonl','conversation_url','Agent:\x20','Round\x20','reason','output','✗\x20ERROR:\x20Project\x20not\x20found:\x20','\x22:\x20','2ztyokv','timestamp','cyan','llmProject','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','map','resolve','✗\x20FAIL:\x20','table','\x27\x20to\x20create\x20the\x20folder\x20structure.','log','no_tests','Site:\x20','execute','test.yml','\x20(cached)','Passed:\x20\x20\x20','filter','push','Running\x20test:\x20','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','354827vDVHEW','/<agent-name>','Available\x20tests:\x20','7mNVoip','6861006FzbHOF','includes','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','multiple_agents','split','5773408AIeBEf','found','Re-evaluating\x20','Round\x201/','site','description','920tGVLhb','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','dim','context','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','Test\x20','add','Total:\x20\x20\x20\x20','repeat','No\x20tests\x20have\x20tags\x20defined.','Duration:\x20','yellow','executeReeval','text','source'];a5_0x1187=function(){return _0x57691f;};return a5_0x1187();}export class AgentTestCommand extends BaseCommand{[a5_0x3f0b29(0x1b4)]=a5_0x3f0b29(0x1d2);[a5_0x3f0b29(0x17d)]=a5_0x3f0b29(0x1ce);async[a5_0x3f0b29(0x167)](_0x3d37bf){const _0x30576c=a5_0x3f0b29,{options:_0x26664c,args:_0x3a1eaa,tdx:_0x1f1d77}=_0x3d37bf,_0x5f2b1a=_0x3a1eaa[0x0]||'.',_0x29f628=_0x26664c[_0x30576c(0x1b8)],_0x21a43d=_0x26664c,_0x484cc9=_0x21a43d[_0x30576c(0x1ba)]===![],_0x161d23=_0x21a43d[_0x30576c(0x1c6)],_0x257a4a=_0x21a43d['name'],_0x336b04=_0x21a43d['tags'],_0x4f7359=_0x26664c[_0x30576c(0x17c)],_0x3f55bf=_0x21a43d[_0x30576c(0x1f3)];if(_0x161d23&&_0x484cc9)return console['log'](a5_0x809fd0[_0x30576c(0x1b9)](_0x30576c(0x1fa))),0x1;let _0x1305ca=_0x30576c(0x162);if(_0x21a43d['json'])_0x1305ca=_0x30576c(0x193);else{if(_0x21a43d[_0x30576c(0x1ee)])_0x1305ca=_0x30576c(0x1ee);else{if(_0x21a43d['tsv'])_0x1305ca='tsv';else{if(_0x21a43d[_0x30576c(0x162)])_0x1305ca='table';}}}const _0x5ddb1e=_0x21a43d['llmProject'];let _0x324ac7=_0x5f2b1a;const _0x2c8286=a5_0x2a94c5[_0x30576c(0x1d8)](_0x5f2b1a),_0xc45613=_0x5f2b1a==='.';if(!_0x2c8286||_0xc45613){const _0xe87cfb=resolveProjectFromContext(_0x5f2b1a,_0x5ddb1e,{'requireFile':_0x30576c(0x168)});if(_0xe87cfb[_0x30576c(0x179)])_0x324ac7=_0xe87cfb['projectDir'],_0xe87cfb[_0x30576c(0x18c)]===_0x30576c(0x181)&&console[_0x30576c(0x164)](a5_0x809fd0[_0x30576c(0x180)]('Using\x20agent:\x20'+_0x324ac7));else switch(_0xe87cfb[_0x30576c(0x1f2)]){case'no_context':console[_0x30576c(0x164)](a5_0x809fd0[_0x30576c(0x189)](_0xe87cfb[_0x30576c(0x195)])),console['log'](),console['log'](_0x30576c(0x1e2)),console[_0x30576c(0x164)](_0x30576c(0x1d4)),console[_0x30576c(0x164)](_0x30576c(0x1ec)),console[_0x30576c(0x164)](),console[_0x30576c(0x164)](_0x30576c(0x1a1));return 0x1;case _0x30576c(0x1e5):console[_0x30576c(0x164)](a5_0x809fd0[_0x30576c(0x189)](_0xe87cfb[_0x30576c(0x195)])),console['log'](),console[_0x30576c(0x164)]('Run\x20\x27tdx\x20agent\x20pull\x20'+_0xe87cfb['llmProject']+_0x30576c(0x163));return 0x1;case _0x30576c(0x176):{const _0x5dc075=a5_0x439b96[_0x30576c(0x1ac)](_0xe87cfb[_0x30576c(0x18d)]);console[_0x30576c(0x164)](a5_0x809fd0[_0x30576c(0x189)]('Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22'+_0xe87cfb[_0x30576c(0x1f9)]+'\x22:'));for(const _0x73df1a of _0xe87cfb[_0x30576c(0x1a5)]){console[_0x30576c(0x164)](_0x30576c(0x1d1)+_0x73df1a);}return console[_0x30576c(0x164)](),console[_0x30576c(0x164)](_0x30576c(0x16e)+_0x5dc075+_0x30576c(0x170)),0x1;}case _0x30576c(0x165):console['log'](a5_0x809fd0[_0x30576c(0x189)](_0x30576c(0x175)+_0xe87cfb[_0x30576c(0x1f9)]+'\x22.')),console[_0x30576c(0x164)](a5_0x809fd0['dim']('Project\x20path:\x20'+_0xe87cfb['projectDir'])),console[_0x30576c(0x164)](),console[_0x30576c(0x164)](_0x30576c(0x1e7));return 0x1;}}const {definition:_0x6939a5,agentInfo:_0x4d67ad}=parseTestFile(_0x324ac7);let _0x483b22=_0x6939a5[_0x30576c(0x18e)];if(_0x257a4a){const _0x31ee7e=_0x257a4a[_0x30576c(0x177)](',')[_0x30576c(0x1fb)](_0x2fe466=>_0x2fe466['trim']());_0x483b22=_0x6939a5[_0x30576c(0x18e)][_0x30576c(0x16b)](_0x4edac6=>_0x31ee7e[_0x30576c(0x174)](_0x4edac6[_0x30576c(0x1b4)]));if(_0x483b22[_0x30576c(0x1e1)]===0x0)return console[_0x30576c(0x164)](a5_0x809fd0[_0x30576c(0x189)](_0x30576c(0x19e)+_0x257a4a)),console['log'](a5_0x809fd0[_0x30576c(0x180)](_0x30576c(0x171)+_0x6939a5[_0x30576c(0x18e)][_0x30576c(0x1fb)](_0x158354=>_0x158354['name'])[_0x30576c(0x1bd)](',\x20'))),0x1;}if(_0x336b04){const _0x2f4518=_0x336b04[_0x30576c(0x177)](',')[_0x30576c(0x1fb)](_0x15fb67=>_0x15fb67['trim']()['toLowerCase']());_0x483b22=_0x483b22[_0x30576c(0x16b)](_0x321299=>_0x321299[_0x30576c(0x1bc)]?.[_0x30576c(0x198)](_0xa8feff=>_0x2f4518[_0x30576c(0x174)](_0xa8feff[_0x30576c(0x1aa)]())));if(_0x483b22[_0x30576c(0x1e1)]===0x0){console['log'](a5_0x809fd0[_0x30576c(0x189)](_0x30576c(0x1a7)+_0x336b04));const _0x374bf6=new Set();return _0x6939a5['tests']['forEach'](_0x1cbede=>_0x1cbede['tags']?.['forEach'](_0x283e57=>_0x374bf6[_0x30576c(0x184)](_0x283e57))),_0x374bf6[_0x30576c(0x1be)]>0x0?console[_0x30576c(0x164)](a5_0x809fd0[_0x30576c(0x180)](_0x30576c(0x1da)+[..._0x374bf6][_0x30576c(0x1bd)](',\x20'))):console['log'](a5_0x809fd0[_0x30576c(0x180)](_0x30576c(0x187))),0x1;}}if(_0x161d23)return this[_0x30576c(0x18a)](_0x3d37bf,{'definition':{'tests':_0x483b22},'agentInfo':_0x4d67ad,'outputFormat':_0x1305ca,'outputFile':_0x3f55bf,'testNames':_0x257a4a});if(_0x29f628){console[_0x30576c(0x164)](a5_0x809fd0['cyan'](_0x30576c(0x1e8))),console[_0x30576c(0x164)](_0x30576c(0x199)+a5_0x809fd0[_0x30576c(0x1ae)](_0x4f7359)),console[_0x30576c(0x164)](_0x30576c(0x194)+a5_0x809fd0[_0x30576c(0x1ae)](_0x4d67ad[_0x30576c(0x1c0)])),console[_0x30576c(0x164)](_0x30576c(0x18f)+a5_0x809fd0[_0x30576c(0x1ae)](_0x4d67ad['agentName'])),console[_0x30576c(0x164)](),console[_0x30576c(0x164)]('Tests\x20found:\x20'+a5_0x809fd0[_0x30576c(0x1ae)](_0x483b22['length']));for(let _0x3ed139=0x0;_0x3ed139<_0x483b22[_0x30576c(0x1e1)];_0x3ed139++){const _0x181c2e=_0x483b22[_0x3ed139],_0x152127=_0x181c2e['rounds'][_0x30576c(0x1e1)]===0x1?'round':_0x30576c(0x190),_0x359dcf=_0x181c2e[_0x30576c(0x1bc)]?.['length']?'\x20['+_0x181c2e[_0x30576c(0x1bc)]['join'](',\x20')+']':'';console[_0x30576c(0x164)]('\x20\x20'+(_0x3ed139+0x1)+'.\x20'+a5_0x809fd0[_0x30576c(0x1ae)](_0x181c2e[_0x30576c(0x1b4)])+'\x20('+_0x181c2e[_0x30576c(0x190)]['length']+'\x20'+_0x152127+')'+a5_0x809fd0[_0x30576c(0x180)](_0x359dcf));}return 0x0;}let _0x293a31,_0x439653;try{_0x293a31=await _0x1f1d77[_0x30576c(0x1b3)][_0x30576c(0x1d9)](_0x4d67ad['projectName']);}catch(_0x3b1305){const _0x3c50df=_0x3b1305 instanceof Error?_0x3b1305['message']:String(_0x3b1305);return _0x3c50df[_0x30576c(0x174)](_0x30576c(0x1c2))||_0x3c50df[_0x30576c(0x1aa)]()[_0x30576c(0x174)](_0x30576c(0x1b7))?console['log'](a5_0x809fd0[_0x30576c(0x1b9)](_0x30576c(0x1f4)+_0x4d67ad[_0x30576c(0x1c0)])):console[_0x30576c(0x164)](a5_0x809fd0[_0x30576c(0x1b9)](_0x30576c(0x1a0)+_0x4d67ad[_0x30576c(0x1c0)]+_0x30576c(0x1f5)+_0x3c50df)),0x1;}try{_0x439653=await _0x1f1d77[_0x30576c(0x1b3)][_0x30576c(0x1bb)](_0x4d67ad[_0x30576c(0x1df)],_0x293a31);}catch(_0x2d2f61){const _0x2c0024=_0x2d2f61 instanceof Error?_0x2d2f61[_0x30576c(0x195)]:String(_0x2d2f61);return _0x2c0024['includes']('404')||_0x2c0024[_0x30576c(0x1aa)]()['includes'](_0x30576c(0x1b7))?console['log'](a5_0x809fd0[_0x30576c(0x1b9)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x4d67ad['agentName'])):console['log'](a5_0x809fd0[_0x30576c(0x1b9)](_0x30576c(0x1a6)+_0x4d67ad['agentName']+_0x30576c(0x1f5)+_0x2c0024)),0x1;}let _0x260687;if(!_0x484cc9)try{_0x260687=await setupEvaluatorAgent(_0x1f1d77[_0x30576c(0x1b3)],_0x26664c[_0x30576c(0x1e4)]);}catch(_0x473a96){const _0x5cbc15=_0x473a96 instanceof Error?_0x473a96[_0x30576c(0x195)]:String(_0x473a96);return console['log'](a5_0x809fd0[_0x30576c(0x1b9)](_0x30576c(0x17f)+_0x5cbc15)),0x1;}console[_0x30576c(0x164)](a5_0x809fd0[_0x30576c(0x1f8)](_0x30576c(0x1d5))),console['log'](_0x30576c(0x166)+a5_0x809fd0[_0x30576c(0x1ae)](_0x4f7359)),console[_0x30576c(0x164)]('Agent:\x20'+a5_0x809fd0[_0x30576c(0x1ae)](_0x4d67ad[_0x30576c(0x1c0)]+'/'+_0x4d67ad['agentName'])),console[_0x30576c(0x164)]();const _0x5288c7=[],_0x4db4c8=[],_0x4c6ad4=Date[_0x30576c(0x1b6)]();for(let _0xf56221=0x0;_0xf56221<_0x483b22[_0x30576c(0x1e1)];_0xf56221++){const _0x1b25f8=_0x483b22[_0xf56221];_0x483b22[_0x30576c(0x1e1)]>0x1?console[_0x30576c(0x164)](_0x30576c(0x183)+(_0xf56221+0x1)+'/'+_0x483b22['length']+':\x20'+a5_0x809fd0[_0x30576c(0x1ae)](_0x1b25f8[_0x30576c(0x1b4)])):console[_0x30576c(0x164)](_0x30576c(0x16d)+a5_0x809fd0[_0x30576c(0x1ae)](_0x1b25f8[_0x30576c(0x1b4)]));const _0x34b29c=createCommandSpinner(_0x30576c(0x17b)+_0x1b25f8[_0x30576c(0x190)][_0x30576c(0x1e1)]+_0x30576c(0x19a));_0x34b29c[_0x30576c(0x197)]();try{const {result:_0x19f29d,conversation:_0x259c76}=await runTest(_0x1f1d77['llm'],_0x1b25f8,{'agentId':_0x439653,'projectId':_0x293a31,'site':_0x4f7359,'noEval':_0x484cc9,'evaluatorId':_0x260687,'onRoundStart':(_0x4b59de,_0x2c51c6)=>{const _0x21e425=_0x30576c;_0x34b29c['text']='Round\x20'+(_0x4b59de+0x1)+'/'+_0x2c51c6+_0x21e425(0x19a);},'onRoundComplete':(_0x47dbd6,_0xd415ad,_0x307eed)=>{const _0xf8441d=_0x30576c,_0x466b14=formatElapsed(_0xd415ad);_0x307eed?console[_0xf8441d(0x164)](_0xf8441d(0x1cd)+(_0x47dbd6+0x1)+'/'+_0x1b25f8[_0xf8441d(0x190)][_0xf8441d(0x1e1)]+_0xf8441d(0x1c1)+a5_0x809fd0[_0xf8441d(0x1ed)]('✓')+'\x20('+_0x466b14+')'):console['log'](_0xf8441d(0x1cd)+(_0x47dbd6+0x1)+'/'+_0x1b25f8[_0xf8441d(0x190)]['length']+_0xf8441d(0x1c1)+a5_0x809fd0['red']('✗'));},'onEvaluationStart':()=>{const _0x2e240c=_0x30576c;_0x34b29c['text']=_0x2e240c(0x1d0);},'onEvaluationComplete':_0x488582=>{const _0x2eca8d=_0x30576c,_0x5def32=formatElapsed(_0x488582);console['log'](_0x2eca8d(0x1dd)+a5_0x809fd0[_0x2eca8d(0x1ed)]('✓')+'\x20('+_0x5def32+')');}});_0x34b29c[_0x30576c(0x1a8)](),_0x5288c7[_0x30576c(0x16c)](_0x19f29d),_0x4db4c8[_0x30576c(0x16c)](_0x259c76);if(_0x19f29d[_0x30576c(0x1cf)]==='PASS')console[_0x30576c(0x164)](a5_0x809fd0['green'](_0x30576c(0x1ea)+_0x19f29d[_0x30576c(0x1f2)]));else _0x19f29d[_0x30576c(0x1cf)]===_0x30576c(0x1d3)?console[_0x30576c(0x164)](a5_0x809fd0[_0x30576c(0x1b9)](_0x30576c(0x1fd)+_0x19f29d['reason'])):console[_0x30576c(0x164)](a5_0x809fd0['red'](_0x30576c(0x1ad)+_0x19f29d[_0x30576c(0x1f2)]));_0x19f29d[_0x30576c(0x1ef)]&&console['log'](a5_0x809fd0[_0x30576c(0x180)](_0x30576c(0x1c5)+_0x19f29d[_0x30576c(0x1ef)])),console[_0x30576c(0x164)]();}catch(_0x54fb17){_0x34b29c['stop']();const _0x551bab=_0x54fb17 instanceof Error?_0x54fb17[_0x30576c(0x195)]:String(_0x54fb17);console['log'](a5_0x809fd0[_0x30576c(0x1b9)]('✗\x20ERROR:\x20'+_0x551bab)),console[_0x30576c(0x164)](),_0x5288c7[_0x30576c(0x16c)]({'name':_0x1b25f8[_0x30576c(0x1b4)],'status':_0x30576c(0x1e6),'reason':_0x551bab,'timestamp':new Date()[_0x30576c(0x1d7)](),'duration_ms':0x0});}}const _0x55657e=Date[_0x30576c(0x1b6)]()-_0x4c6ad4,_0x3fc24e=_0x5288c7['filter'](_0x3bcfda=>_0x3bcfda[_0x30576c(0x1cf)]===_0x30576c(0x1bf))[_0x30576c(0x1e1)],_0x4f4590=_0x5288c7['filter'](_0x4893e6=>_0x4893e6[_0x30576c(0x1cf)]==='FAIL')['length'],_0x4653b=_0x5288c7['filter'](_0x4bffc8=>_0x4bffc8[_0x30576c(0x1cf)]===_0x30576c(0x1e6))[_0x30576c(0x1e1)];console[_0x30576c(0x164)]('━'[_0x30576c(0x186)](0x3c)),console[_0x30576c(0x164)](_0x30576c(0x1e0)),console[_0x30576c(0x164)]('━'[_0x30576c(0x186)](0x3c)),console[_0x30576c(0x164)](_0x30576c(0x185)+_0x5288c7['length']),console[_0x30576c(0x164)](_0x30576c(0x16a)+a5_0x809fd0['green'](_0x3fc24e)),console['log']('Failed:\x20\x20\x20'+a5_0x809fd0['red'](_0x4f4590));_0x4653b>0x0&&console[_0x30576c(0x164)](_0x30576c(0x1ab)+a5_0x809fd0[_0x30576c(0x1b9)](_0x4653b));console[_0x30576c(0x164)](_0x30576c(0x188)+formatElapsed(_0x55657e)),console[_0x30576c(0x164)]('━'[_0x30576c(0x186)](0x3c));const _0x221403=_0x5288c7[_0x30576c(0x16b)](_0x3e4e4e=>_0x3e4e4e[_0x30576c(0x1cf)]!=='PASS');if(_0x221403['length']>0x0){console[_0x30576c(0x164)](),console['log'](_0x30576c(0x1c8));for(const _0x9ea1d5 of _0x221403){const _0x4ccb7f=a5_0x809fd0[_0x30576c(0x1b9)]('✗'),_0x3df8b3=_0x9ea1d5[_0x30576c(0x1f2)][_0x30576c(0x1e1)]>0x32?_0x9ea1d5[_0x30576c(0x1f2)][_0x30576c(0x19d)](0x0,0x32)+_0x30576c(0x1d6):_0x9ea1d5[_0x30576c(0x1f2)];console[_0x30576c(0x164)]('\x20\x20'+_0x4ccb7f+'\x20'+_0x9ea1d5['name']+':\x20'+_0x3df8b3);}}const _0x44e875={'summary':{'total':_0x5288c7[_0x30576c(0x1e1)],'passed':_0x3fc24e,'failed':_0x4f4590,'errors':_0x4653b>0x0?_0x4653b:undefined,'duration_ms':_0x55657e},'tests':_0x5288c7,'agent':{'project':_0x4d67ad[_0x30576c(0x1c0)],'name':_0x4d67ad[_0x30576c(0x1df)],'site':_0x4f7359},'timestamp':new Date(_0x4c6ad4)[_0x30576c(0x1d7)]()};try{const _0x58b170=buildCachedTestRun(_0x4db4c8,{'site':_0x4f7359,'projectId':_0x293a31,'projectName':_0x4d67ad[_0x30576c(0x1c0)],'agentId':_0x439653,'agentName':_0x4d67ad[_0x30576c(0x1df)],'testYmlPath':a5_0x439b96[_0x30576c(0x1fc)](_0x4d67ad[_0x30576c(0x1af)])});saveLastTestRun(_0x58b170);}catch{}if(_0x1305ca!=='table'||_0x3f55bf){const _0x20f441=formatResults(_0x44e875,_0x1305ca);if(_0x3f55bf)try{a5_0x2a94c5[_0x30576c(0x19c)](_0x3f55bf,_0x20f441,_0x30576c(0x1c9)),console['log'](),console['log'](a5_0x809fd0['dim'](_0x30576c(0x1c4)+_0x3f55bf));}catch(_0x1d9c7c){return console[_0x30576c(0x164)](),console[_0x30576c(0x164)](a5_0x809fd0[_0x30576c(0x1b9)]('Error\x20writing\x20output\x20file:\x20'+_0x1d9c7c)),0x1;}else console[_0x30576c(0x164)](),console[_0x30576c(0x164)](_0x20f441);}return _0x221403[_0x30576c(0x1e1)]>0x0?0x1:0x0;}async[a5_0x3f0b29(0x18a)](_0x5c6e02,_0x98b6e1){const _0x4dd8b9=a5_0x3f0b29,{options:_0x2e27da,tdx:_0x579122}=_0x5c6e02,{definition:_0x3577d5,agentInfo:_0x118bd2,outputFormat:_0x328f46,outputFile:_0x2c2182}=_0x98b6e1,_0x47fe31=_0x2e27da['site'],_0x3a0b64=loadLastTestRun();if(!_0x3a0b64)return console['log'](a5_0x809fd0['red'](_0x4dd8b9(0x1dc))),console[_0x4dd8b9(0x164)](a5_0x809fd0[_0x4dd8b9(0x180)](_0x4dd8b9(0x1de))),0x1;if(_0x3a0b64[_0x4dd8b9(0x196)][_0x4dd8b9(0x1df)]!==_0x118bd2[_0x4dd8b9(0x1df)])return console['log'](a5_0x809fd0['red']('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x3a0b64[_0x4dd8b9(0x196)]['agentName']+_0x4dd8b9(0x182)+_0x118bd2['agentName']+'\x22.')),console[_0x4dd8b9(0x164)](a5_0x809fd0[_0x4dd8b9(0x180)](_0x4dd8b9(0x1a2))),0x1;const _0x15f693=new Set(_0x3a0b64[_0x4dd8b9(0x1cb)]['map'](_0x151747=>_0x151747['testName'])),_0x35f4b3=_0x3577d5[_0x4dd8b9(0x18e)][_0x4dd8b9(0x16b)](_0x5926b5=>!_0x15f693[_0x4dd8b9(0x1c7)](_0x5926b5[_0x4dd8b9(0x1b4)]));if(_0x35f4b3[_0x4dd8b9(0x1e1)]>0x0&&_0x3a0b64['site']!==_0x47fe31)return console[_0x4dd8b9(0x164)](a5_0x809fd0[_0x4dd8b9(0x1b9)]('Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.')),console[_0x4dd8b9(0x164)](a5_0x809fd0[_0x4dd8b9(0x180)]('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x3a0b64[_0x4dd8b9(0x17c)]+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x47fe31+'\x22.')),console[_0x4dd8b9(0x164)](a5_0x809fd0['dim']('Either\x20switch\x20to\x20the\x20\x22'+_0x3a0b64['site']+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x1086b5=_0x3577d5['tests'][_0x4dd8b9(0x16b)](_0x496655=>_0x15f693['has'](_0x496655['name'])),_0x241a2a=_0x35f4b3;let _0xd19f03;try{_0xd19f03=await setupEvaluatorAgent(_0x579122[_0x4dd8b9(0x1b3)],_0x2e27da[_0x4dd8b9(0x1e4)]);}catch(_0x17f81d){const _0xeeb73=_0x17f81d instanceof Error?_0x17f81d['message']:String(_0x17f81d);return console[_0x4dd8b9(0x164)](a5_0x809fd0[_0x4dd8b9(0x1b9)](_0x4dd8b9(0x17f)+_0xeeb73)),0x1;}console[_0x4dd8b9(0x164)](a5_0x809fd0[_0x4dd8b9(0x1f8)](_0x4dd8b9(0x19b))),console[_0x4dd8b9(0x164)](_0x4dd8b9(0x1a9)+a5_0x809fd0['white'](_0x3a0b64[_0x4dd8b9(0x1f7)])),console['log'](_0x4dd8b9(0x1f0)+a5_0x809fd0[_0x4dd8b9(0x1ae)](_0x3a0b64[_0x4dd8b9(0x196)][_0x4dd8b9(0x1c0)]+'/'+_0x3a0b64[_0x4dd8b9(0x196)][_0x4dd8b9(0x1df)]));_0x241a2a[_0x4dd8b9(0x1e1)]>0x0&&console[_0x4dd8b9(0x164)](_0x4dd8b9(0x1eb)+a5_0x809fd0['yellow'](_0x241a2a['length']));console[_0x4dd8b9(0x164)]();const _0xec4570=[],_0x2819fd=Date[_0x4dd8b9(0x1b6)](),_0x1da302=createCommandSpinner(_0x4dd8b9(0x1e3));if(_0x1086b5['length']>0x0)try{const _0x53ed0f=await reevaluateFromCache(_0x579122['llm'],_0x3a0b64,{'tests':_0x1086b5},{'evaluatorId':_0xd19f03,'onTestStart':(_0x3a0de3,_0x52bd94,_0x296a83)=>{const _0x176d0a=_0x4dd8b9;_0x1da302[_0x176d0a(0x18b)]=_0x176d0a(0x17a)+(_0x52bd94+0x1)+'/'+_0x296a83+':\x20'+_0x3a0de3+_0x176d0a(0x1d6);if(!_0x1da302[_0x176d0a(0x1b0)])_0x1da302[_0x176d0a(0x197)]();},'onTestComplete':(_0x325b27,_0x286a2c)=>{const _0x22715c=_0x4dd8b9;_0x1da302[_0x22715c(0x1a8)]();if(_0x286a2c['status']===_0x22715c(0x1bf))console[_0x22715c(0x164)](a5_0x809fd0[_0x22715c(0x1ed)]('✓\x20PASS:\x20'+_0x325b27)+a5_0x809fd0['dim'](_0x22715c(0x169)));else _0x286a2c[_0x22715c(0x1cf)]===_0x22715c(0x1d3)?console[_0x22715c(0x164)](a5_0x809fd0[_0x22715c(0x1b9)](_0x22715c(0x1fd)+_0x325b27+_0x22715c(0x191)+_0x286a2c[_0x22715c(0x1f2)])+a5_0x809fd0['dim'](_0x22715c(0x169))):console[_0x22715c(0x164)](a5_0x809fd0[_0x22715c(0x1b9)](_0x22715c(0x1ad)+_0x325b27+'\x20-\x20'+_0x286a2c[_0x22715c(0x1f2)]));_0x286a2c['conversation_url']&&console[_0x22715c(0x164)](a5_0x809fd0[_0x22715c(0x180)](_0x22715c(0x1b2)+_0x286a2c['conversation_url'])),_0xec4570[_0x22715c(0x16c)](_0x286a2c);},'onTestSkipped':(_0x5158f3,_0x1f3822)=>{const _0x4d3272=_0x4dd8b9;_0x1da302['stop'](),console[_0x4d3272(0x164)](a5_0x809fd0[_0x4d3272(0x189)]('⚠\x20SKIPPED:\x20'+_0x5158f3+_0x4d3272(0x191)+_0x1f3822));}});for(const _0x2306a6 of _0x53ed0f){!_0xec4570[_0x4dd8b9(0x1cc)](_0x37de69=>_0x37de69['name']===_0x2306a6[_0x4dd8b9(0x1b4)])&&_0xec4570['push'](_0x2306a6);}}catch(_0x250386){_0x1da302['stop']();const _0x4d9608=_0x250386 instanceof Error?_0x250386[_0x4dd8b9(0x195)]:String(_0x250386);return console['log'](a5_0x809fd0[_0x4dd8b9(0x1b9)]('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0x4d9608)),0x1;}_0x1da302[_0x4dd8b9(0x1a8)]();if(_0x241a2a[_0x4dd8b9(0x1e1)]>0x0){console[_0x4dd8b9(0x164)](),console['log'](a5_0x809fd0[_0x4dd8b9(0x1f8)](_0x4dd8b9(0x1b5)));const {projectId:_0x50630b,agentId:_0x4c377a}=_0x3a0b64['agent'];for(const _0x24f326 of _0x241a2a){console[_0x4dd8b9(0x164)](_0x4dd8b9(0x1a4)+a5_0x809fd0[_0x4dd8b9(0x1ae)](_0x24f326[_0x4dd8b9(0x1b4)]));const _0x14aee2=createCommandSpinner(_0x4dd8b9(0x17b)+_0x24f326[_0x4dd8b9(0x190)]['length']+_0x4dd8b9(0x19a));_0x14aee2[_0x4dd8b9(0x197)]();try{const {result:_0x3beee5}=await runTest(_0x579122[_0x4dd8b9(0x1b3)],_0x24f326,{'agentId':_0x4c377a,'projectId':_0x50630b,'site':_0x3a0b64['site'],'noEval':![],'evaluatorId':_0xd19f03,'onRoundStart':(_0x1f10ac,_0x2d0852)=>{const _0x2ff675=_0x4dd8b9;_0x14aee2[_0x2ff675(0x18b)]=_0x2ff675(0x1f1)+(_0x1f10ac+0x1)+'/'+_0x2d0852+_0x2ff675(0x19a);},'onRoundComplete':(_0x30765a,_0x481263,_0x59edd6)=>{const _0x3e91a1=_0x4dd8b9,_0x1db375=formatElapsed(_0x481263);_0x59edd6?console[_0x3e91a1(0x164)](_0x3e91a1(0x1cd)+(_0x30765a+0x1)+'/'+_0x24f326['rounds'][_0x3e91a1(0x1e1)]+_0x3e91a1(0x1c1)+a5_0x809fd0[_0x3e91a1(0x1ed)]('✓')+'\x20('+_0x1db375+')'):console[_0x3e91a1(0x164)](_0x3e91a1(0x1cd)+(_0x30765a+0x1)+'/'+_0x24f326['rounds'][_0x3e91a1(0x1e1)]+'...\x20'+a5_0x809fd0['red']('✗'));},'onEvaluationStart':()=>{const _0x2b2b28=_0x4dd8b9;_0x14aee2[_0x2b2b28(0x18b)]=_0x2b2b28(0x1d0);},'onEvaluationComplete':_0x138940=>{const _0x4124a2=_0x4dd8b9,_0x397c1e=formatElapsed(_0x138940);console[_0x4124a2(0x164)](_0x4124a2(0x1dd)+a5_0x809fd0[_0x4124a2(0x1ed)]('✓')+'\x20('+_0x397c1e+')');}});_0x14aee2[_0x4dd8b9(0x1a8)](),_0xec4570[_0x4dd8b9(0x16c)](_0x3beee5);if(_0x3beee5[_0x4dd8b9(0x1cf)]==='PASS')console[_0x4dd8b9(0x164)](a5_0x809fd0[_0x4dd8b9(0x1ed)](_0x4dd8b9(0x1ea)+_0x3beee5[_0x4dd8b9(0x1f2)])+a5_0x809fd0[_0x4dd8b9(0x180)](_0x4dd8b9(0x1c3)));else _0x3beee5['status']===_0x4dd8b9(0x1d3)?console[_0x4dd8b9(0x164)](a5_0x809fd0['red']('✗\x20FAIL:\x20'+_0x3beee5[_0x4dd8b9(0x1f2)])+a5_0x809fd0[_0x4dd8b9(0x180)](_0x4dd8b9(0x1c3))):console['log'](a5_0x809fd0[_0x4dd8b9(0x1b9)]('✗\x20ERROR:\x20'+_0x3beee5[_0x4dd8b9(0x1f2)]));_0x3beee5[_0x4dd8b9(0x1ef)]&&console[_0x4dd8b9(0x164)](a5_0x809fd0[_0x4dd8b9(0x180)](_0x4dd8b9(0x1b2)+_0x3beee5[_0x4dd8b9(0x1ef)]));}catch(_0x2fb8cf){_0x14aee2[_0x4dd8b9(0x1a8)]();const _0x40820b=_0x2fb8cf instanceof Error?_0x2fb8cf[_0x4dd8b9(0x195)]:String(_0x2fb8cf);console[_0x4dd8b9(0x164)](a5_0x809fd0[_0x4dd8b9(0x1b9)](_0x4dd8b9(0x1ad)+_0x40820b)),_0xec4570[_0x4dd8b9(0x16c)]({'name':_0x24f326[_0x4dd8b9(0x1b4)],'status':_0x4dd8b9(0x1e6),'reason':_0x40820b,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console['log']();const _0x1a88f7=Date['now']()-_0x2819fd,_0x14f481=_0xec4570['filter'](_0x4accb3=>_0x4accb3[_0x4dd8b9(0x1cf)]===_0x4dd8b9(0x1bf))['length'],_0x129e0f=_0xec4570['filter'](_0x327f78=>_0x327f78[_0x4dd8b9(0x1cf)]===_0x4dd8b9(0x1d3))[_0x4dd8b9(0x1e1)],_0x14c2bc=_0xec4570[_0x4dd8b9(0x16b)](_0x4db3e3=>_0x4db3e3[_0x4dd8b9(0x1cf)]===_0x4dd8b9(0x1e6))[_0x4dd8b9(0x1e1)];console[_0x4dd8b9(0x164)]('━'[_0x4dd8b9(0x186)](0x3c)),console[_0x4dd8b9(0x164)](_0x4dd8b9(0x192)),console[_0x4dd8b9(0x164)]('━'[_0x4dd8b9(0x186)](0x3c)),console[_0x4dd8b9(0x164)](_0x4dd8b9(0x185)+_0xec4570['length']),console[_0x4dd8b9(0x164)]('Passed:\x20\x20\x20'+a5_0x809fd0['green'](_0x14f481)),console[_0x4dd8b9(0x164)]('Failed:\x20\x20\x20'+a5_0x809fd0[_0x4dd8b9(0x1b9)](_0x129e0f));_0x14c2bc>0x0&&console[_0x4dd8b9(0x164)](_0x4dd8b9(0x1ab)+a5_0x809fd0['red'](_0x14c2bc));console['log']('Duration:\x20'+formatElapsed(_0x1a88f7)),console[_0x4dd8b9(0x164)]('━'[_0x4dd8b9(0x186)](0x3c));const _0x523ba1={'summary':{'total':_0xec4570['length'],'passed':_0x14f481,'failed':_0x129e0f,'errors':_0x14c2bc>0x0?_0x14c2bc:undefined,'duration_ms':_0x1a88f7},'tests':_0xec4570,'agent':{'project':_0x118bd2['projectName'],'name':_0x118bd2[_0x4dd8b9(0x1df)],'site':_0x47fe31},'timestamp':new Date(_0x2819fd)['toISOString']()};if(_0x328f46!==_0x4dd8b9(0x162)||_0x2c2182){const _0x26b329=formatResults(_0x523ba1,_0x328f46);if(_0x2c2182)try{a5_0x2a94c5[_0x4dd8b9(0x19c)](_0x2c2182,_0x26b329,_0x4dd8b9(0x1c9)),console[_0x4dd8b9(0x164)](),console['log'](a5_0x809fd0[_0x4dd8b9(0x180)]('Output\x20written\x20to:\x20'+_0x2c2182));}catch(_0x438299){return console['log'](),console['log'](a5_0x809fd0[_0x4dd8b9(0x1b9)](_0x4dd8b9(0x19f)+_0x438299)),0x1;}else console[_0x4dd8b9(0x164)](),console[_0x4dd8b9(0x164)](_0x26b329);}const _0x3305b4=_0xec4570[_0x4dd8b9(0x16b)](_0x70b784=>_0x70b784['status']!==_0x4dd8b9(0x1bf));return _0x3305b4['length']>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0x635f2f=a5_0x2233;function a5_0x2233(_0x5abb0c,_0x4f2516){_0x5abb0c=_0x5abb0c-0xac;const _0x35fcf0=a5_0x35fc();let _0x22335b=_0x35fcf0[_0x5abb0c];return _0x22335b;}(function(_0x4f4835,_0x5a2924){const _0x4f0fd6=a5_0x2233,_0x347888=_0x4f4835();while(!![]){try{const _0x4fa8b6=parseInt(_0x4f0fd6(0xb4))/0x1+parseInt(_0x4f0fd6(0xf9))/0x2*(parseInt(_0x4f0fd6(0xac))/0x3)+-parseInt(_0x4f0fd6(0x11f))/0x4+-parseInt(_0x4f0fd6(0x12f))/0x5*(-parseInt(_0x4f0fd6(0xe0))/0x6)+parseInt(_0x4f0fd6(0x129))/0x7*(parseInt(_0x4f0fd6(0x13c))/0x8)+-parseInt(_0x4f0fd6(0xad))/0x9+parseInt(_0x4f0fd6(0xce))/0xa*(-parseInt(_0x4f0fd6(0x118))/0xb);if(_0x4fa8b6===_0x5a2924)break;else _0x347888['push'](_0x347888['shift']());}catch(_0x16745b){_0x347888['push'](_0x347888['shift']());}}}(a5_0x35fc,0x22afe));import*as a5_0x2b90ad from'node:fs';import*as a5_0x30dedb from'node:path';function a5_0x35fc(){const _0xad4774=['source','agent:test','294456xJiZIl','Conversation\x20URL:\x20','\x20\x20Evaluating...\x20','tests','✓\x20PASS:\x20','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','Running\x20agent\x20tests...','FAIL','timestamp','dryRun','Re-evaluation\x20Summary','⚠\x20SKIPPED:\x20','rounds','description','writeFileSync','log','isSpinning','\x20(cached)','Round\x20','Re-evaluating\x20','length','Total:\x20\x20\x20\x20','Re-evaluating\x20cached\x20test\x20run...','\x20\x20Round\x20','87166QyEKky','tsv','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','verbose','has','Errors:\x20\x20\x20','Failed\x20Tests:','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','trim','Site:\x20','output','text','conversation_url','llmProject','\x27\x20to\x20create\x20the\x20folder\x20structure.','projectDir','white','Round\x201/','round','projectName','Output\x20written\x20to:\x20','No\x20tests\x20found\x20matching:\x20','name','join','cyan','...','not\x20found','filter','includes','json','✗\x20ERROR:\x20Project\x20not\x20found:\x20','110gTLgcb','push','message','site','forEach','reeval','split','566704oSaXMH','\x20\x20Conversation:\x20','executeReeval','context','dim','✗\x20FAIL:\x20','reason','start','PASS','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','79702eFWcpN','No\x20tests\x20found\x20with\x20tags:\x20','\x20(new)','\x22,\x20but\x20current\x20site\x20is\x20\x22','tags','ERROR','20FmDCAU','Test\x20Summary','resolve','size','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','red','jsonl','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','resolveProjectId','Failed:\x20\x20\x20','Available\x20tags:\x20','Passed:\x20\x20\x20','agentName','184xumVJc',':\x20Sending\x20user\x20input...','utf-8','Error\x20writing\x20output\x20file:\x20','15AiRznW','885087CCrdQi','toLowerCase','Agent:\x20','Executing\x20new\x20tests...','status','Evaluating\x20response...','Run\x20tests\x20for\x20an\x20LLM\x20agent','169180BbdUrT','testName','green','basename','\x20\x20Agent:\x20','agent','llm','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','Using\x20agent:\x20','eval','no_local_folder','\x22:\x20','No\x20tests\x20have\x20tags\x20defined.','toISOString','...\x20','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','\x20\x20Project:\x20','execute','\x20-\x20','✗\x20ERROR:\x20','/<agent-name>','add','yellow','\x20\x20-\x20','Available\x20tests:\x20','map','463180ThrPQr','Either\x20switch\x20to\x20the\x20\x22','some','\x20\x20Site:\x20','New\x20tests\x20to\x20execute:\x20','Duration:\x20','repeat','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','multiple_agents','table','testYmlPath','stop','now','Error:\x20No\x20previous\x20test\x20run\x20found.','Tests\x20found:\x20','404'];a5_0x35fc=function(){return _0xad4774;};return a5_0x35fc();}import a5_0x329cbf from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x635f2f(0x10f)]=a5_0x635f2f(0xdf);[a5_0x635f2f(0xee)]=a5_0x635f2f(0xb3);async[a5_0x635f2f(0xc5)](_0x2603ac){const _0x4244e5=a5_0x635f2f,{options:_0x577383,args:_0xc1fbc7,tdx:_0x35a6d7}=_0x2603ac,_0x21322e=_0xc1fbc7[0x0]||'.',_0x1b98d8=_0x577383[_0x4244e5(0xea)],_0x5f3c65=_0x577383,_0x217cda=_0x5f3c65[_0x4244e5(0xbd)]===![],_0x488785=_0x5f3c65[_0x4244e5(0x11d)],_0x3572fc=_0x5f3c65[_0x4244e5(0x10f)],_0x976296=_0x5f3c65[_0x4244e5(0x12d)],_0x53453a=_0x577383[_0x4244e5(0x11b)],_0x478983=_0x5f3c65[_0x4244e5(0x103)];if(_0x488785&&_0x217cda)return console[_0x4244e5(0xf0)](a5_0x329cbf[_0x4244e5(0x134)]('Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval')),0x1;let _0x4c06a4='table';if(_0x5f3c65[_0x4244e5(0x116)])_0x4c06a4=_0x4244e5(0x116);else{if(_0x5f3c65[_0x4244e5(0x135)])_0x4c06a4=_0x4244e5(0x135);else{if(_0x5f3c65['tsv'])_0x4c06a4=_0x4244e5(0xfa);else{if(_0x5f3c65[_0x4244e5(0xd7)])_0x4c06a4=_0x4244e5(0xd7);}}}const _0x5c2858=_0x5f3c65['llmProject'];let _0x5b2dd1=_0x21322e;const _0x57789d=a5_0x2b90ad['existsSync'](_0x21322e),_0x22e611=_0x21322e==='.';if(!_0x57789d||_0x22e611){const _0x4fabb8=resolveProjectFromContext(_0x21322e,_0x5c2858,{'requireFile':'test.yml'});if(_0x4fabb8['found'])_0x5b2dd1=_0x4fabb8[_0x4244e5(0x108)],_0x4fabb8[_0x4244e5(0xde)]===_0x4244e5(0x122)&&console['log'](a5_0x329cbf[_0x4244e5(0x123)](_0x4244e5(0xbc)+_0x5b2dd1));else switch(_0x4fabb8[_0x4244e5(0x125)]){case'no_context':console[_0x4244e5(0xf0)](a5_0x329cbf[_0x4244e5(0xca)](_0x4fabb8['message'])),console['log'](),console[_0x4244e5(0xf0)]('Usage:'),console[_0x4244e5(0xf0)]('\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[_0x4244e5(0xf0)]('\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x4244e5(0xf0)](),console['log'](_0x4244e5(0x136));return 0x1;case _0x4244e5(0xbe):console[_0x4244e5(0xf0)](a5_0x329cbf[_0x4244e5(0xca)](_0x4fabb8[_0x4244e5(0x11a)])),console[_0x4244e5(0xf0)](),console['log']('Run\x20\x27tdx\x20agent\x20pull\x20'+_0x4fabb8['llmProject']+_0x4244e5(0x107));return 0x1;case _0x4244e5(0xd6):{const _0x442a12=a5_0x30dedb[_0x4244e5(0xb7)](_0x4fabb8[_0x4244e5(0x108)]);console['log'](a5_0x329cbf[_0x4244e5(0xca)](_0x4244e5(0xe5)+_0x4fabb8[_0x4244e5(0x106)]+'\x22:'));for(const _0x34af15 of _0x4fabb8['agentDirs']){console[_0x4244e5(0xf0)](_0x4244e5(0xcb)+_0x34af15);}return console[_0x4244e5(0xf0)](),console[_0x4244e5(0xf0)]('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x442a12+_0x4244e5(0xc8)),0x1;}case'no_tests':console[_0x4244e5(0xf0)](a5_0x329cbf['yellow'](_0x4244e5(0xc3)+_0x4fabb8[_0x4244e5(0x106)]+'\x22.')),console[_0x4244e5(0xf0)](a5_0x329cbf[_0x4244e5(0x123)]('Project\x20path:\x20'+_0x4fabb8[_0x4244e5(0x108)])),console[_0x4244e5(0xf0)](),console[_0x4244e5(0xf0)](_0x4244e5(0xd5));return 0x1;}}const {definition:_0x24d078,agentInfo:_0x32c432}=parseTestFile(_0x5b2dd1);let _0x4edc08=_0x24d078[_0x4244e5(0xe3)];if(_0x3572fc){const _0x19b73a=_0x3572fc[_0x4244e5(0x11e)](',')['map'](_0x31e875=>_0x31e875['trim']());_0x4edc08=_0x24d078[_0x4244e5(0xe3)][_0x4244e5(0x114)](_0x453ed3=>_0x19b73a[_0x4244e5(0x115)](_0x453ed3['name']));if(_0x4edc08[_0x4244e5(0xf5)]===0x0)return console[_0x4244e5(0xf0)](a5_0x329cbf[_0x4244e5(0xca)](_0x4244e5(0x10e)+_0x3572fc)),console[_0x4244e5(0xf0)](a5_0x329cbf[_0x4244e5(0x123)](_0x4244e5(0xcc)+_0x24d078[_0x4244e5(0xe3)][_0x4244e5(0xcd)](_0x3c2000=>_0x3c2000['name'])[_0x4244e5(0x110)](',\x20'))),0x1;}if(_0x976296){const _0x5e0abc=_0x976296[_0x4244e5(0x11e)](',')['map'](_0x19062a=>_0x19062a[_0x4244e5(0x101)]()[_0x4244e5(0xae)]());_0x4edc08=_0x4edc08[_0x4244e5(0x114)](_0x5aa876=>_0x5aa876[_0x4244e5(0x12d)]?.[_0x4244e5(0xd0)](_0x4b50cd=>_0x5e0abc[_0x4244e5(0x115)](_0x4b50cd[_0x4244e5(0xae)]())));if(_0x4edc08['length']===0x0){console[_0x4244e5(0xf0)](a5_0x329cbf['yellow'](_0x4244e5(0x12a)+_0x976296));const _0x55f65a=new Set();return _0x24d078[_0x4244e5(0xe3)][_0x4244e5(0x11c)](_0x59f109=>_0x59f109[_0x4244e5(0x12d)]?.[_0x4244e5(0x11c)](_0xa52366=>_0x55f65a[_0x4244e5(0xc9)](_0xa52366))),_0x55f65a[_0x4244e5(0x132)]>0x0?console[_0x4244e5(0xf0)](a5_0x329cbf[_0x4244e5(0x123)](_0x4244e5(0x139)+[..._0x55f65a][_0x4244e5(0x110)](',\x20'))):console[_0x4244e5(0xf0)](a5_0x329cbf[_0x4244e5(0x123)](_0x4244e5(0xc0))),0x1;}}if(_0x488785)return this['executeReeval'](_0x2603ac,{'definition':{'tests':_0x4edc08},'agentInfo':_0x32c432,'outputFormat':_0x4c06a4,'outputFile':_0x478983,'testNames':_0x3572fc});if(_0x1b98d8){console[_0x4244e5(0xf0)](a5_0x329cbf[_0x4244e5(0x111)]('Test\x20Configuration:')),console['log'](_0x4244e5(0xd1)+a5_0x329cbf[_0x4244e5(0x109)](_0x53453a)),console[_0x4244e5(0xf0)](_0x4244e5(0xc4)+a5_0x329cbf[_0x4244e5(0x109)](_0x32c432[_0x4244e5(0x10c)])),console[_0x4244e5(0xf0)](_0x4244e5(0xb8)+a5_0x329cbf[_0x4244e5(0x109)](_0x32c432[_0x4244e5(0x13b)])),console[_0x4244e5(0xf0)](),console[_0x4244e5(0xf0)](_0x4244e5(0xdc)+a5_0x329cbf[_0x4244e5(0x109)](_0x4edc08[_0x4244e5(0xf5)]));for(let _0x41e15b=0x0;_0x41e15b<_0x4edc08[_0x4244e5(0xf5)];_0x41e15b++){const _0x3db7b4=_0x4edc08[_0x41e15b],_0xbae653=_0x3db7b4['rounds'][_0x4244e5(0xf5)]===0x1?_0x4244e5(0x10b):_0x4244e5(0xed),_0x1ca9a5=_0x3db7b4[_0x4244e5(0x12d)]?.['length']?'\x20['+_0x3db7b4['tags'][_0x4244e5(0x110)](',\x20')+']':'';console[_0x4244e5(0xf0)]('\x20\x20'+(_0x41e15b+0x1)+'.\x20'+a5_0x329cbf[_0x4244e5(0x109)](_0x3db7b4[_0x4244e5(0x10f)])+'\x20('+_0x3db7b4['rounds']['length']+'\x20'+_0xbae653+')'+a5_0x329cbf[_0x4244e5(0x123)](_0x1ca9a5));}return 0x0;}let _0x342239,_0xf7f5c2;try{_0x342239=await _0x35a6d7[_0x4244e5(0xba)][_0x4244e5(0x137)](_0x32c432[_0x4244e5(0x10c)]);}catch(_0xfd2026){const _0x19c060=_0xfd2026 instanceof Error?_0xfd2026[_0x4244e5(0x11a)]:String(_0xfd2026);return _0x19c060[_0x4244e5(0x115)](_0x4244e5(0xdd))||_0x19c060[_0x4244e5(0xae)]()[_0x4244e5(0x115)]('not\x20found')?console[_0x4244e5(0xf0)](a5_0x329cbf[_0x4244e5(0x134)](_0x4244e5(0x117)+_0x32c432[_0x4244e5(0x10c)])):console['log'](a5_0x329cbf['red'](_0x4244e5(0x128)+_0x32c432[_0x4244e5(0x10c)]+'\x22:\x20'+_0x19c060)),0x1;}try{_0xf7f5c2=await _0x35a6d7[_0x4244e5(0xba)]['resolveAgentId'](_0x32c432[_0x4244e5(0x13b)],_0x342239);}catch(_0x19ed28){const _0xc52372=_0x19ed28 instanceof Error?_0x19ed28[_0x4244e5(0x11a)]:String(_0x19ed28);return _0xc52372[_0x4244e5(0x115)](_0x4244e5(0xdd))||_0xc52372[_0x4244e5(0xae)]()[_0x4244e5(0x115)](_0x4244e5(0x113))?console[_0x4244e5(0xf0)](a5_0x329cbf[_0x4244e5(0x134)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x32c432[_0x4244e5(0x13b)])):console[_0x4244e5(0xf0)](a5_0x329cbf[_0x4244e5(0x134)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x32c432['agentName']+_0x4244e5(0xbf)+_0xc52372)),0x1;}let _0xd3866f;if(!_0x217cda)try{_0xd3866f=await setupEvaluatorAgent(_0x35a6d7[_0x4244e5(0xba)],_0x577383[_0x4244e5(0xfc)]);}catch(_0x5165b7){const _0x205b57=_0x5165b7 instanceof Error?_0x5165b7['message']:String(_0x5165b7);return console[_0x4244e5(0xf0)](a5_0x329cbf[_0x4244e5(0x134)](_0x4244e5(0xbb)+_0x205b57)),0x1;}console[_0x4244e5(0xf0)](a5_0x329cbf[_0x4244e5(0x111)](_0x4244e5(0xe7))),console[_0x4244e5(0xf0)](_0x4244e5(0x102)+a5_0x329cbf[_0x4244e5(0x109)](_0x53453a)),console['log'](_0x4244e5(0xaf)+a5_0x329cbf[_0x4244e5(0x109)](_0x32c432['projectName']+'/'+_0x32c432[_0x4244e5(0x13b)])),console[_0x4244e5(0xf0)]();const _0x961728=[],_0x80c657=[],_0x57108e=Date[_0x4244e5(0xda)]();for(let _0x6407be=0x0;_0x6407be<_0x4edc08[_0x4244e5(0xf5)];_0x6407be++){const _0x4230e6=_0x4edc08[_0x6407be];_0x4edc08['length']>0x1?console[_0x4244e5(0xf0)]('Test\x20'+(_0x6407be+0x1)+'/'+_0x4edc08['length']+':\x20'+a5_0x329cbf[_0x4244e5(0x109)](_0x4230e6[_0x4244e5(0x10f)])):console[_0x4244e5(0xf0)]('Running\x20test:\x20'+a5_0x329cbf[_0x4244e5(0x109)](_0x4230e6[_0x4244e5(0x10f)]));const _0x187e8a=createCommandSpinner(_0x4244e5(0x10a)+_0x4230e6['rounds'][_0x4244e5(0xf5)]+_0x4244e5(0x13d));_0x187e8a[_0x4244e5(0x126)]();try{const {result:_0x31711e,conversation:_0x1208cc}=await runTest(_0x35a6d7['llm'],_0x4230e6,{'agentId':_0xf7f5c2,'projectId':_0x342239,'site':_0x53453a,'noEval':_0x217cda,'evaluatorId':_0xd3866f,'onRoundStart':(_0xdaa03,_0x1f0d12)=>{const _0x131272=_0x4244e5;_0x187e8a[_0x131272(0x104)]='Round\x20'+(_0xdaa03+0x1)+'/'+_0x1f0d12+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x57479c,_0x2cafd9,_0x353625)=>{const _0x58d2f8=_0x4244e5,_0x16aab6=formatElapsed(_0x2cafd9);_0x353625?console['log'](_0x58d2f8(0xf8)+(_0x57479c+0x1)+'/'+_0x4230e6[_0x58d2f8(0xed)][_0x58d2f8(0xf5)]+_0x58d2f8(0xc2)+a5_0x329cbf[_0x58d2f8(0xb6)]('✓')+'\x20('+_0x16aab6+')'):console[_0x58d2f8(0xf0)](_0x58d2f8(0xf8)+(_0x57479c+0x1)+'/'+_0x4230e6[_0x58d2f8(0xed)][_0x58d2f8(0xf5)]+_0x58d2f8(0xc2)+a5_0x329cbf[_0x58d2f8(0x134)]('✗'));},'onEvaluationStart':()=>{const _0x483213=_0x4244e5;_0x187e8a['text']=_0x483213(0xb2);},'onEvaluationComplete':_0x213614=>{const _0x89a7ca=_0x4244e5,_0x5b7fef=formatElapsed(_0x213614);console['log'](_0x89a7ca(0xe2)+a5_0x329cbf[_0x89a7ca(0xb6)]('✓')+'\x20('+_0x5b7fef+')');}});_0x187e8a['stop'](),_0x961728[_0x4244e5(0x119)](_0x31711e),_0x80c657[_0x4244e5(0x119)](_0x1208cc);if(_0x31711e[_0x4244e5(0xb1)]===_0x4244e5(0x127))console[_0x4244e5(0xf0)](a5_0x329cbf[_0x4244e5(0xb6)](_0x4244e5(0xe4)+_0x31711e[_0x4244e5(0x125)]));else _0x31711e[_0x4244e5(0xb1)]===_0x4244e5(0xe8)?console[_0x4244e5(0xf0)](a5_0x329cbf['red']('✗\x20FAIL:\x20'+_0x31711e[_0x4244e5(0x125)])):console[_0x4244e5(0xf0)](a5_0x329cbf[_0x4244e5(0x134)](_0x4244e5(0xc7)+_0x31711e['reason']));_0x31711e[_0x4244e5(0x105)]&&console[_0x4244e5(0xf0)](a5_0x329cbf[_0x4244e5(0x123)](_0x4244e5(0xe1)+_0x31711e[_0x4244e5(0x105)])),console[_0x4244e5(0xf0)]();}catch(_0x3aa39c){_0x187e8a[_0x4244e5(0xd9)]();const _0x210856=_0x3aa39c instanceof Error?_0x3aa39c[_0x4244e5(0x11a)]:String(_0x3aa39c);console[_0x4244e5(0xf0)](a5_0x329cbf[_0x4244e5(0x134)](_0x4244e5(0xc7)+_0x210856)),console[_0x4244e5(0xf0)](),_0x961728[_0x4244e5(0x119)]({'name':_0x4230e6['name'],'status':'ERROR','reason':_0x210856,'timestamp':new Date()[_0x4244e5(0xc1)](),'duration_ms':0x0});}}const _0x5c67c3=Date[_0x4244e5(0xda)]()-_0x57108e,_0xd963a9=_0x961728[_0x4244e5(0x114)](_0x430b72=>_0x430b72['status']===_0x4244e5(0x127))[_0x4244e5(0xf5)],_0x15b7cb=_0x961728[_0x4244e5(0x114)](_0x2198dd=>_0x2198dd[_0x4244e5(0xb1)]===_0x4244e5(0xe8))[_0x4244e5(0xf5)],_0x5c9612=_0x961728['filter'](_0x49165f=>_0x49165f['status']===_0x4244e5(0x12e))[_0x4244e5(0xf5)];console[_0x4244e5(0xf0)]('━'[_0x4244e5(0xd4)](0x3c)),console[_0x4244e5(0xf0)](_0x4244e5(0x130)),console[_0x4244e5(0xf0)]('━'[_0x4244e5(0xd4)](0x3c)),console['log'](_0x4244e5(0xf6)+_0x961728[_0x4244e5(0xf5)]),console[_0x4244e5(0xf0)](_0x4244e5(0x13a)+a5_0x329cbf[_0x4244e5(0xb6)](_0xd963a9)),console[_0x4244e5(0xf0)](_0x4244e5(0x138)+a5_0x329cbf[_0x4244e5(0x134)](_0x15b7cb));_0x5c9612>0x0&&console[_0x4244e5(0xf0)]('Errors:\x20\x20\x20'+a5_0x329cbf['red'](_0x5c9612));console[_0x4244e5(0xf0)]('Duration:\x20'+formatElapsed(_0x5c67c3)),console['log']('━'[_0x4244e5(0xd4)](0x3c));const _0x36e7f5=_0x961728[_0x4244e5(0x114)](_0x198cf8=>_0x198cf8[_0x4244e5(0xb1)]!==_0x4244e5(0x127));if(_0x36e7f5['length']>0x0){console[_0x4244e5(0xf0)](),console[_0x4244e5(0xf0)](_0x4244e5(0xff));for(const _0x253ae8 of _0x36e7f5){const _0x21c39d=a5_0x329cbf[_0x4244e5(0x134)]('✗'),_0x236355=_0x253ae8[_0x4244e5(0x125)][_0x4244e5(0xf5)]>0x32?_0x253ae8[_0x4244e5(0x125)]['substring'](0x0,0x32)+_0x4244e5(0x112):_0x253ae8[_0x4244e5(0x125)];console[_0x4244e5(0xf0)]('\x20\x20'+_0x21c39d+'\x20'+_0x253ae8[_0x4244e5(0x10f)]+':\x20'+_0x236355);}}const _0x467eb6={'summary':{'total':_0x961728[_0x4244e5(0xf5)],'passed':_0xd963a9,'failed':_0x15b7cb,'errors':_0x5c9612>0x0?_0x5c9612:undefined,'duration_ms':_0x5c67c3},'tests':_0x961728,'agent':{'project':_0x32c432['projectName'],'name':_0x32c432[_0x4244e5(0x13b)],'site':_0x53453a},'timestamp':new Date(_0x57108e)[_0x4244e5(0xc1)]()};try{const _0x345707=buildCachedTestRun(_0x80c657,{'site':_0x53453a,'projectId':_0x342239,'projectName':_0x32c432['projectName'],'agentId':_0xf7f5c2,'agentName':_0x32c432[_0x4244e5(0x13b)],'testYmlPath':a5_0x30dedb[_0x4244e5(0x131)](_0x32c432[_0x4244e5(0xd8)])});saveLastTestRun(_0x345707);}catch{}if(_0x4c06a4!==_0x4244e5(0xd7)||_0x478983){const _0x4e6b7c=formatResults(_0x467eb6,_0x4c06a4);if(_0x478983)try{a5_0x2b90ad[_0x4244e5(0xef)](_0x478983,_0x4e6b7c,_0x4244e5(0x13e)),console[_0x4244e5(0xf0)](),console[_0x4244e5(0xf0)](a5_0x329cbf[_0x4244e5(0x123)](_0x4244e5(0x10d)+_0x478983));}catch(_0x3bbace){return console[_0x4244e5(0xf0)](),console[_0x4244e5(0xf0)](a5_0x329cbf[_0x4244e5(0x134)](_0x4244e5(0x13f)+_0x3bbace)),0x1;}else console[_0x4244e5(0xf0)](),console[_0x4244e5(0xf0)](_0x4e6b7c);}return _0x36e7f5[_0x4244e5(0xf5)]>0x0?0x1:0x0;}async[a5_0x635f2f(0x121)](_0x3a8bd6,_0x4e99f4){const _0x412766=a5_0x635f2f,{options:_0x4d5173,tdx:_0x3d2d3a}=_0x3a8bd6,{definition:_0x2ebb6c,agentInfo:_0x3bffd6,outputFormat:_0x596bdf,outputFile:_0x40c177}=_0x4e99f4,_0x5a5bb7=_0x4d5173[_0x412766(0x11b)],_0x28efaf=loadLastTestRun();if(!_0x28efaf)return console[_0x412766(0xf0)](a5_0x329cbf['red'](_0x412766(0xdb))),console[_0x412766(0xf0)](a5_0x329cbf[_0x412766(0x123)](_0x412766(0x100))),0x1;if(_0x28efaf[_0x412766(0xb9)][_0x412766(0x13b)]!==_0x3bffd6[_0x412766(0x13b)])return console[_0x412766(0xf0)](a5_0x329cbf[_0x412766(0x134)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x28efaf[_0x412766(0xb9)][_0x412766(0x13b)]+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x3bffd6['agentName']+'\x22.')),console[_0x412766(0xf0)](a5_0x329cbf[_0x412766(0x123)](_0x412766(0xe6))),0x1;const _0xf412d4=new Set(_0x28efaf['conversations'][_0x412766(0xcd)](_0x37dd33=>_0x37dd33[_0x412766(0xb5)])),_0x469b7c=_0x2ebb6c[_0x412766(0xe3)][_0x412766(0x114)](_0x1cceba=>!_0xf412d4['has'](_0x1cceba[_0x412766(0x10f)]));if(_0x469b7c['length']>0x0&&_0x28efaf[_0x412766(0x11b)]!==_0x5a5bb7)return console[_0x412766(0xf0)](a5_0x329cbf['red']('Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.')),console[_0x412766(0xf0)](a5_0x329cbf[_0x412766(0x123)]('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x28efaf[_0x412766(0x11b)]+_0x412766(0x12c)+_0x5a5bb7+'\x22.')),console['log'](a5_0x329cbf[_0x412766(0x123)](_0x412766(0xcf)+_0x28efaf[_0x412766(0x11b)]+_0x412766(0x133))),0x1;const _0x31d770=_0x2ebb6c['tests'][_0x412766(0x114)](_0x222352=>_0xf412d4[_0x412766(0xfd)](_0x222352['name'])),_0x4e4133=_0x469b7c;let _0x4e371d;try{_0x4e371d=await setupEvaluatorAgent(_0x3d2d3a[_0x412766(0xba)],_0x4d5173[_0x412766(0xfc)]);}catch(_0xcf7972){const _0x4d0e64=_0xcf7972 instanceof Error?_0xcf7972[_0x412766(0x11a)]:String(_0xcf7972);return console[_0x412766(0xf0)](a5_0x329cbf[_0x412766(0x134)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x4d0e64)),0x1;}console['log'](a5_0x329cbf[_0x412766(0x111)](_0x412766(0xf7))),console[_0x412766(0xf0)]('Cached\x20run\x20from:\x20'+a5_0x329cbf[_0x412766(0x109)](_0x28efaf[_0x412766(0xe9)])),console[_0x412766(0xf0)](_0x412766(0xaf)+a5_0x329cbf[_0x412766(0x109)](_0x28efaf['agent'][_0x412766(0x10c)]+'/'+_0x28efaf[_0x412766(0xb9)][_0x412766(0x13b)]));_0x4e4133[_0x412766(0xf5)]>0x0&&console['log'](_0x412766(0xd2)+a5_0x329cbf['yellow'](_0x4e4133[_0x412766(0xf5)]));console[_0x412766(0xf0)]();const _0x53d034=[],_0x3768de=Date[_0x412766(0xda)](),_0x54b035=createCommandSpinner('Re-evaluating...');if(_0x31d770[_0x412766(0xf5)]>0x0)try{const _0xbb27f4=await reevaluateFromCache(_0x3d2d3a[_0x412766(0xba)],_0x28efaf,{'tests':_0x31d770},{'evaluatorId':_0x4e371d,'onTestStart':(_0x5b9998,_0x5f1e2e,_0x3a61b7)=>{const _0x54806a=_0x412766;_0x54b035[_0x54806a(0x104)]=_0x54806a(0xf4)+(_0x5f1e2e+0x1)+'/'+_0x3a61b7+':\x20'+_0x5b9998+_0x54806a(0x112);if(!_0x54b035[_0x54806a(0xf1)])_0x54b035[_0x54806a(0x126)]();},'onTestComplete':(_0x1af1d9,_0x3f452a)=>{const _0x1e8cd9=_0x412766;_0x54b035[_0x1e8cd9(0xd9)]();if(_0x3f452a['status']==='PASS')console[_0x1e8cd9(0xf0)](a5_0x329cbf['green'](_0x1e8cd9(0xe4)+_0x1af1d9)+a5_0x329cbf[_0x1e8cd9(0x123)](_0x1e8cd9(0xf2)));else _0x3f452a[_0x1e8cd9(0xb1)]===_0x1e8cd9(0xe8)?console['log'](a5_0x329cbf[_0x1e8cd9(0x134)](_0x1e8cd9(0x124)+_0x1af1d9+_0x1e8cd9(0xc6)+_0x3f452a[_0x1e8cd9(0x125)])+a5_0x329cbf[_0x1e8cd9(0x123)](_0x1e8cd9(0xf2))):console[_0x1e8cd9(0xf0)](a5_0x329cbf[_0x1e8cd9(0x134)](_0x1e8cd9(0xc7)+_0x1af1d9+_0x1e8cd9(0xc6)+_0x3f452a[_0x1e8cd9(0x125)]));_0x3f452a[_0x1e8cd9(0x105)]&&console[_0x1e8cd9(0xf0)](a5_0x329cbf[_0x1e8cd9(0x123)](_0x1e8cd9(0x120)+_0x3f452a[_0x1e8cd9(0x105)])),_0x53d034[_0x1e8cd9(0x119)](_0x3f452a);},'onTestSkipped':(_0x3eaf76,_0x40aaa3)=>{const _0x14537b=_0x412766;_0x54b035[_0x14537b(0xd9)](),console[_0x14537b(0xf0)](a5_0x329cbf[_0x14537b(0xca)](_0x14537b(0xec)+_0x3eaf76+_0x14537b(0xc6)+_0x40aaa3));}});for(const _0x129baa of _0xbb27f4){!_0x53d034['find'](_0x129820=>_0x129820[_0x412766(0x10f)]===_0x129baa[_0x412766(0x10f)])&&_0x53d034[_0x412766(0x119)](_0x129baa);}}catch(_0x4598f7){_0x54b035[_0x412766(0xd9)]();const _0x1641b3=_0x4598f7 instanceof Error?_0x4598f7['message']:String(_0x4598f7);return console[_0x412766(0xf0)](a5_0x329cbf[_0x412766(0x134)](_0x412766(0xfb)+_0x1641b3)),0x1;}_0x54b035[_0x412766(0xd9)]();if(_0x4e4133[_0x412766(0xf5)]>0x0){console[_0x412766(0xf0)](),console['log'](a5_0x329cbf['cyan'](_0x412766(0xb0)));const {projectId:_0x423283,agentId:_0x20d783}=_0x28efaf[_0x412766(0xb9)];for(const _0x49c448 of _0x4e4133){console[_0x412766(0xf0)]('Running:\x20'+a5_0x329cbf[_0x412766(0x109)](_0x49c448[_0x412766(0x10f)]));const _0x458e88=createCommandSpinner(_0x412766(0x10a)+_0x49c448[_0x412766(0xed)][_0x412766(0xf5)]+_0x412766(0x13d));_0x458e88['start']();try{const {result:_0x4239f1}=await runTest(_0x3d2d3a['llm'],_0x49c448,{'agentId':_0x20d783,'projectId':_0x423283,'site':_0x28efaf[_0x412766(0x11b)],'noEval':![],'evaluatorId':_0x4e371d,'onRoundStart':(_0x5f3d78,_0x3ea5c0)=>{const _0x56e981=_0x412766;_0x458e88[_0x56e981(0x104)]=_0x56e981(0xf3)+(_0x5f3d78+0x1)+'/'+_0x3ea5c0+_0x56e981(0x13d);},'onRoundComplete':(_0x54a167,_0x7968a3,_0x26220a)=>{const _0x2a1718=_0x412766,_0x97ccc7=formatElapsed(_0x7968a3);_0x26220a?console['log']('\x20\x20Round\x20'+(_0x54a167+0x1)+'/'+_0x49c448[_0x2a1718(0xed)][_0x2a1718(0xf5)]+_0x2a1718(0xc2)+a5_0x329cbf[_0x2a1718(0xb6)]('✓')+'\x20('+_0x97ccc7+')'):console[_0x2a1718(0xf0)](_0x2a1718(0xf8)+(_0x54a167+0x1)+'/'+_0x49c448['rounds']['length']+'...\x20'+a5_0x329cbf[_0x2a1718(0x134)]('✗'));},'onEvaluationStart':()=>{const _0x22e0b6=_0x412766;_0x458e88['text']=_0x22e0b6(0xb2);},'onEvaluationComplete':_0x1f98fa=>{const _0x4b0d61=_0x412766,_0x3554f3=formatElapsed(_0x1f98fa);console['log']('\x20\x20Evaluating...\x20'+a5_0x329cbf[_0x4b0d61(0xb6)]('✓')+'\x20('+_0x3554f3+')');}});_0x458e88['stop'](),_0x53d034[_0x412766(0x119)](_0x4239f1);if(_0x4239f1[_0x412766(0xb1)]==='PASS')console[_0x412766(0xf0)](a5_0x329cbf['green'](_0x412766(0xe4)+_0x4239f1[_0x412766(0x125)])+a5_0x329cbf[_0x412766(0x123)]('\x20(new)'));else _0x4239f1[_0x412766(0xb1)]===_0x412766(0xe8)?console[_0x412766(0xf0)](a5_0x329cbf[_0x412766(0x134)](_0x412766(0x124)+_0x4239f1[_0x412766(0x125)])+a5_0x329cbf['dim'](_0x412766(0x12b))):console[_0x412766(0xf0)](a5_0x329cbf[_0x412766(0x134)]('✗\x20ERROR:\x20'+_0x4239f1[_0x412766(0x125)]));_0x4239f1['conversation_url']&&console[_0x412766(0xf0)](a5_0x329cbf[_0x412766(0x123)](_0x412766(0x120)+_0x4239f1[_0x412766(0x105)]));}catch(_0x4d97d4){_0x458e88['stop']();const _0x1b7c05=_0x4d97d4 instanceof Error?_0x4d97d4['message']:String(_0x4d97d4);console[_0x412766(0xf0)](a5_0x329cbf[_0x412766(0x134)](_0x412766(0xc7)+_0x1b7c05)),_0x53d034[_0x412766(0x119)]({'name':_0x49c448[_0x412766(0x10f)],'status':_0x412766(0x12e),'reason':_0x1b7c05,'timestamp':new Date()[_0x412766(0xc1)](),'duration_ms':0x0});}}}console['log']();const _0x11ab2d=Date['now']()-_0x3768de,_0x4be95c=_0x53d034[_0x412766(0x114)](_0x974d0=>_0x974d0[_0x412766(0xb1)]===_0x412766(0x127))[_0x412766(0xf5)],_0x20d58d=_0x53d034[_0x412766(0x114)](_0x11355b=>_0x11355b[_0x412766(0xb1)]==='FAIL')[_0x412766(0xf5)],_0x1ad998=_0x53d034[_0x412766(0x114)](_0x477617=>_0x477617[_0x412766(0xb1)]===_0x412766(0x12e))['length'];console[_0x412766(0xf0)]('━'[_0x412766(0xd4)](0x3c)),console[_0x412766(0xf0)](_0x412766(0xeb)),console[_0x412766(0xf0)]('━'[_0x412766(0xd4)](0x3c)),console[_0x412766(0xf0)](_0x412766(0xf6)+_0x53d034[_0x412766(0xf5)]),console[_0x412766(0xf0)](_0x412766(0x13a)+a5_0x329cbf['green'](_0x4be95c)),console[_0x412766(0xf0)]('Failed:\x20\x20\x20'+a5_0x329cbf[_0x412766(0x134)](_0x20d58d));_0x1ad998>0x0&&console[_0x412766(0xf0)](_0x412766(0xfe)+a5_0x329cbf['red'](_0x1ad998));console['log'](_0x412766(0xd3)+formatElapsed(_0x11ab2d)),console[_0x412766(0xf0)]('━'[_0x412766(0xd4)](0x3c));const _0x1b1f10={'summary':{'total':_0x53d034['length'],'passed':_0x4be95c,'failed':_0x20d58d,'errors':_0x1ad998>0x0?_0x1ad998:undefined,'duration_ms':_0x11ab2d},'tests':_0x53d034,'agent':{'project':_0x3bffd6[_0x412766(0x10c)],'name':_0x3bffd6['agentName'],'site':_0x5a5bb7},'timestamp':new Date(_0x3768de)[_0x412766(0xc1)]()};if(_0x596bdf!==_0x412766(0xd7)||_0x40c177){const _0x159f92=formatResults(_0x1b1f10,_0x596bdf);if(_0x40c177)try{a5_0x2b90ad[_0x412766(0xef)](_0x40c177,_0x159f92,_0x412766(0x13e)),console[_0x412766(0xf0)](),console[_0x412766(0xf0)](a5_0x329cbf[_0x412766(0x123)](_0x412766(0x10d)+_0x40c177));}catch(_0x22c9ad){return console[_0x412766(0xf0)](),console[_0x412766(0xf0)](a5_0x329cbf[_0x412766(0x134)](_0x412766(0x13f)+_0x22c9ad)),0x1;}else console[_0x412766(0xf0)](),console[_0x412766(0xf0)](_0x159f92);}const _0x26661b=_0x53d034[_0x412766(0x114)](_0x3ecf4b=>_0x3ecf4b[_0x412766(0xb1)]!==_0x412766(0x127));return _0x26661b[_0x412766(0xf5)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x16936a=a6_0x4624;function a6_0x1233(){const _0x53e556=['includes','file','keys','cas','cookie','25549614vpDpVp','body','api','indexOf','GET','authorization','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','Error:\x20','output','headers','verbose','set-cookie2','description','3345496OeGTgS','\x0aStack\x20trace:\x0a','Invalid\x20header\x20format:\x20\x22','llm','set-cookie','error','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','substring','status','3333534zBZlif','890770tCgDaP','log','Invalid\x20HTTP\x20method:\x20','message','noColor','stack','.\x20Valid\x20methods:\x20','join','isArray','PUT','proxy-authorization','trim','1243827lWVvFD','llm-proxy','1169264wxCWaT','Results\x20saved\x20to\x20','startsWith','x-trino-user','14YJRSgg','length','Endpoint\x20must\x20start\x20with\x20/:\x20','toUpperCase','request','name','validate','PATCH','10715XsTrXZ','data','x-auth-token','method','\x22.\x20','x-xsrf-token','3792dwEaYV','has','site','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','entries','trino','header'];a6_0x1233=function(){return _0x53e556;};return a6_0x1233();}(function(_0x4f08dc,_0x5a9cfc){const _0x176921=a6_0x4624,_0x33f181=_0x4f08dc();while(!![]){try{const _0xd3fb14=-parseInt(_0x176921(0xe4))/0x1+parseInt(_0x176921(0xd8))/0x2+-parseInt(_0x176921(0xd7))/0x3+parseInt(_0x176921(0xce))/0x4+parseInt(_0x176921(0xaf))/0x5*(-parseInt(_0x176921(0xb5))/0x6)+-parseInt(_0x176921(0xea))/0x7*(-parseInt(_0x176921(0xe6))/0x8)+parseInt(_0x176921(0xc1))/0x9;if(_0xd3fb14===_0x5a9cfc)break;else _0x33f181['push'](_0x33f181['shift']());}catch(_0x45a620){_0x33f181['push'](_0x33f181['shift']());}}}(a6_0x1233,0xabc34));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';function a6_0x4624(_0x117acc,_0x49f743){_0x117acc=_0x117acc-0xaf;const _0x12337b=a6_0x1233();let _0x46244a=_0x12337b[_0x117acc];return _0x46244a;}import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x16936a(0xc6),a6_0x16936a(0xe2),a6_0x16936a(0xc0),a6_0x16936a(0xd2),a6_0x16936a(0xcc),a6_0x16936a(0xb4),a6_0x16936a(0xb1),a6_0x16936a(0xe9)]);function isSensitiveHeader(_0x5a134b){const _0x27bd35=a6_0x16936a;return SENSITIVE_HEADERS[_0x27bd35(0xb6)](_0x5a134b['toLowerCase']());}function parseHeader(_0x5a18bc){const _0x4315b9=a6_0x16936a,_0xa6bddd=_0x5a18bc[_0x4315b9(0xc4)](':');if(_0xa6bddd===-0x1)throw new Error(_0x4315b9(0xd0)+_0x5a18bc+_0x4315b9(0xb3)+'Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22');const _0x30f63d=_0x5a18bc['substring'](0x0,_0xa6bddd)['trim'](),_0x2e54d3=_0x5a18bc[_0x4315b9(0xd5)](_0xa6bddd+0x1)[_0x4315b9(0xe3)]();if(!_0x30f63d)throw new Error(_0x4315b9(0xd4)+_0x5a18bc+'\x22');return[_0x30f63d,_0x2e54d3];}export class ApiCommand extends BaseCommand{[a6_0x16936a(0xef)]=a6_0x16936a(0xc3);[a6_0x16936a(0xcd)]=a6_0x16936a(0xb8);[a6_0x16936a(0xf0)](_0x578385){const _0x28520c=a6_0x16936a,{args:_0x542701,options:_0x2a0a8e}=_0x578385,_0x4922a5=_0x2a0a8e;if(_0x542701[_0x28520c(0xeb)]===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x4e0fbc=_0x542701[0x0];if(!_0x4e0fbc[_0x28520c(0xe8)]('/'))return _0x28520c(0xec)+_0x4e0fbc;const _0x554cba=_0x4922a5[_0x28520c(0xb0)],_0x4c638d=_0x4922a5['file'];if(_0x554cba&&_0x4c638d)return _0x28520c(0xc7);const _0x342edd=_0x4922a5[_0x28520c(0xb2)]||_0x28520c(0xc5),_0x2e10a6=['GET','POST',_0x28520c(0xe1),'DELETE',_0x28520c(0xf1)];if(!_0x2e10a6[_0x28520c(0xbc)](_0x342edd[_0x28520c(0xed)]()))return _0x28520c(0xda)+_0x342edd+_0x28520c(0xde)+_0x2e10a6[_0x28520c(0xdf)](',\x20');const _0x4dfb84=_0x4922a5['type']||'td',_0x452e75=['td','cdp','workflow',_0x28520c(0xba),_0x28520c(0xd1),_0x28520c(0xe5),_0x28520c(0xbf)];if(!_0x452e75[_0x28520c(0xbc)](_0x4dfb84))return'Invalid\x20API\x20type:\x20'+_0x4dfb84+'.\x20Valid\x20types:\x20'+_0x452e75[_0x28520c(0xdf)](',\x20');return undefined;}async['execute'](_0x2e79ba){const _0x245606=a6_0x16936a,{options:_0x4f8b9d,args:_0x339b0e,tdx:_0x2c78a1}=_0x2e79ba,_0x26a818=_0x4f8b9d,_0x38bb70=_0x339b0e[0x0],_0x56fc5e=(_0x26a818[_0x245606(0xb2)]||_0x245606(0xc5))['toUpperCase'](),_0x462201=_0x26a818['data'],_0x47213f=_0x26a818[_0x245606(0xbd)],_0x4ae89b=_0x26a818[_0x245606(0xbb)],_0x3eb0fa=_0x26a818['type']||'td';try{const _0x3fede3={};if(_0x4ae89b){const _0x2ae02f=Array[_0x245606(0xe0)](_0x4ae89b)?_0x4ae89b:[_0x4ae89b];for(const _0x393eec of _0x2ae02f){const [_0x251bfc,_0x44e65f]=parseHeader(_0x393eec);_0x3fede3[_0x251bfc]=_0x44e65f;}}let _0x461dfe;if(_0x462201)_0x461dfe=_0x462201;else{if(_0x47213f)try{_0x461dfe=RawAPI['readBodyFromFile'](_0x47213f);}catch(_0x2d7073){return console[_0x245606(0xd3)](_0x245606(0xc8)+(_0x2d7073 instanceof Error?_0x2d7073[_0x245606(0xdb)]:String(_0x2d7073))),0x1;}}const _0x182d79={'method':_0x56fc5e,'apiType':_0x3eb0fa,'includeHeaders':_0x4f8b9d['verbose']};_0x461dfe&&(_0x182d79[_0x245606(0xc2)]=_0x461dfe);Object[_0x245606(0xbe)](_0x3fede3)['length']>0x0&&(_0x182d79['headers']=_0x3fede3);if(_0x4f8b9d[_0x245606(0xcb)]){const _0x1785df=resolveSite(_0x4f8b9d[_0x245606(0xb7)]),_0xa727f6=getEndpoint(_0x1785df,_0x3eb0fa),_0x2aa66b=''+_0xa727f6+_0x38bb70;console[_0x245606(0xd3)]('>\x20'+_0x56fc5e+'\x20'+_0x2aa66b);const _0x2af403=getAuthHeaders(_0x1785df),_0x45446e={..._0x2af403,..._0x3fede3};for(const [_0x263c5e,_0x4e4cae]of Object[_0x245606(0xb9)](_0x45446e)){!isSensitiveHeader(_0x263c5e)&&console[_0x245606(0xd3)]('>\x20'+_0x263c5e+':\x20'+_0x4e4cae);}_0x461dfe&&console[_0x245606(0xd3)]('>'),console['error']('');}const _0x35e42b=await _0x2c78a1[_0x245606(0xc3)][_0x245606(0xee)](_0x38bb70,_0x182d79);if(_0x4f8b9d[_0x245606(0xcb)]&&_0x35e42b[_0x245606(0xca)]){console[_0x245606(0xd3)]('<\x20HTTP/1.1\x20'+_0x35e42b[_0x245606(0xd6)]);for(const [_0x47ca33,_0x56c6b5]of Object[_0x245606(0xb9)](_0x35e42b['headers'])){!isSensitiveHeader(_0x47ca33)&&console['error']('<\x20'+_0x47ca33+':\x20'+_0x56c6b5);}console[_0x245606(0xd3)]('');}const _0x1c0e99=Boolean(_0x4f8b9d[_0x245606(0xc9)]),_0x5bc249={'color':_0x4f8b9d['color'],'noColor':_0x4f8b9d[_0x245606(0xdc)]||_0x1c0e99&&!_0x4f8b9d['color']},_0x3fadac=colorizeJSON(_0x35e42b[_0x245606(0xb0)],_0x5bc249);return _0x4f8b9d[_0x245606(0xc9)]?(writeFileSync(_0x4f8b9d[_0x245606(0xc9)],_0x3fadac),console[_0x245606(0xd3)](_0x245606(0xe7)+_0x4f8b9d[_0x245606(0xc9)])):console[_0x245606(0xd9)](_0x3fadac),0x0;}catch(_0x2539cb){return _0x2539cb instanceof Error?(console[_0x245606(0xd3)](_0x245606(0xc8)+_0x2539cb[_0x245606(0xdb)]),_0x4f8b9d[_0x245606(0xcb)]&&_0x2539cb['stack']&&console[_0x245606(0xd3)](_0x245606(0xcf)+_0x2539cb[_0x245606(0xdd)])):console[_0x245606(0xd3)](_0x245606(0xc8)+String(_0x2539cb)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a7_0x1c3326=a7_0xc00d;(function(_0x23e948,_0x4af7d5){const _0x13c1bb=a7_0xc00d,_0x538c92=_0x23e948();while(!![]){try{const _0x482f2f=parseInt(_0x13c1bb(0x124))/0x1+-parseInt(_0x13c1bb(0x127))/0x2+-parseInt(_0x13c1bb(0x139))/0x3+-parseInt(_0x13c1bb(0x122))/0x4*(parseInt(_0x13c1bb(0x113))/0x5)+-parseInt(_0x13c1bb(0x120))/0x6*(-parseInt(_0x13c1bb(0x143))/0x7)+parseInt(_0x13c1bb(0x13f))/0x8+parseInt(_0x13c1bb(0x121))/0x9;if(_0x482f2f===_0x4af7d5)break;else _0x538c92['push'](_0x538c92['shift']());}catch(_0x2b68fb){_0x538c92['push'](_0x538c92['shift']());}}}(a7_0x194b,0x58a86));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';function a7_0x194b(){const _0x39c0af=['bold','accountName','jobs','status','API\x20key\x20cannot\x20be\x20empty','logLevel','create','filter','Enter\x20your\x20TD\x20API\x20key:','error','✓\x20Authentication\x20successful\x0a','Choose\x20how\x20to\x20sign\x20in:','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','yellow','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','tdx:\x20auth\x20setup','dim','profile','name','Credential\x20type:\x20OAuth','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','160ODHiaV','No\x20credential\x20found','apiKey','/app/mp/ak','For\x20scripts\x20or\x20headless\x20servers','site','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','Read\x20credential\x20from\x20','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','email','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','\x20(site:\x20','13254iYqMaR','7634205oDphNg','76644mOzxrW','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','212392ZvzrKO','text','\x20(profile:\x20','727162kKocAH','first_name','apikey','No\x20credentials\x20found\x20in\x20keychain','\x20\x20user_id:','Sign\x20in\x20with\x20browser\x20(recommended)','last_name','ERROR','tdx\x20profile:\x20','Setup\x20cancelled','\x20--profile\x20','You\x20can\x20find\x20your\x20API\x20key\x20at:','✓\x20Default\x20site\x20set\x20to\x20','account_id','warn','Read\x20credential\x20from\x20keychain','User:\x20','access_token','1624521OqwzqM','✗\x20Validation\x20failed:\x20','\x20\x20tdx','Remove\x20API\x20key\x20from\x20system\x20keychain','green','getUserInfo','963936CFUUmf','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','auth','2219nSVUzf','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','all','log','\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','method','auth:clear','oauth','N/A','Validating\x20API\x20key...','\x20and\x20','✓\x20Profile\x20\x27','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','trim','Use\x20an\x20API\x20key','/oauth/authorize','\x20removed\x20from\x20keychain','execute','description','red','\x27\x20registered'];a7_0x194b=function(){return _0x39c0af;};return a7_0x194b();}import{getOAuthTokens,saveOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{startOAuthFlow}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x5ef294 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_0x13f29f from'chalk';export async function runOAuthLoginFlow(_0x5f0703,_0x2b3bbe,_0x259eaf,_0x2d624c){const _0x2a203f=a7_0xc00d,_0x19a2d6=await isKeychainAvailable();if(!_0x19a2d6)throw new Error(_0x2a203f(0x141)+_0x2a203f(0x123));let _0x3d7f34=_0x2d624c?.[_0x2a203f(0xff)];if(!_0x3d7f34){const _0x6ccaf3=await a7_0x5ef294({'type':_0x2a203f(0x125),'name':_0x2a203f(0xff),'message':_0x2a203f(0xf5)});if(_0x6ccaf3[_0x2a203f(0xff)]===undefined)throw new Error(_0x2a203f(0x130));_0x3d7f34=_0x6ccaf3[_0x2a203f(0xff)][_0x2a203f(0xf6)]()||undefined;}const _0x2e7db0=getConsoleUrl(_0x5f0703);console[_0x2a203f(0x146)]('Opening\x20browser\x20for\x20authentication...');_0x3d7f34?console[_0x2a203f(0x146)]('\x20\x20'+_0x2e7db0+'/users/initiate_sso\x20(account:\x20'+_0x3d7f34+')'):console[_0x2a203f(0x146)]('\x20\x20'+_0x2e7db0+_0x2a203f(0xf8));console[_0x2a203f(0x146)]('Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...');const _0x1d85fd=await startOAuthFlow(_0x5f0703,{'accountName':_0x3d7f34});console[_0x2a203f(0x146)]('Validating\x20OAuth\x20tokens...');const _0x42d1c9=TDX[_0x2a203f(0x104)]({'site':_0x5f0703,'accessToken':_0x1d85fd[_0x2a203f(0x138)],'logLevel':_0x259eaf??LogLevel[_0x2a203f(0x12e)]}),_0x36eb4c=await _0x42d1c9['jobs']['getUserInfo']();console[_0x2a203f(0x146)](a7_0x13f29f[_0x2a203f(0x13d)]('✓\x20Signed\x20in\x20successfully')),console[_0x2a203f(0x146)]('\x20\x20'+a7_0x13f29f['cyan'](_0x5f0703+':'+_0x36eb4c[_0x2a203f(0x134)])+_0x2a203f(0x12b)+_0x36eb4c['id']+'\x20\x20('+_0x36eb4c[_0x2a203f(0x11c)]+')');!_0x3d7f34&&(console['log'](a7_0x13f29f[_0x2a203f(0x10e)](_0x2a203f(0x147))),console[_0x2a203f(0x146)](a7_0x13f29f[_0x2a203f(0x10e)]('\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>')),console['log'](a7_0x13f29f['dim'](_0x2a203f(0x119))));await saveOAuthTokens(_0x1d85fd,_0x2b3bbe),console[_0x2a203f(0x146)](_0x2a203f(0x11b)+(_0x2b3bbe?_0x2a203f(0x126)+_0x2b3bbe+')':''));if(_0x2b3bbe){const _0x231a30={'site':_0x5f0703};saveProfileToUserConfig(_0x2b3bbe,_0x231a30),console[_0x2a203f(0x146)](_0x2a203f(0xf4)+_0x2b3bbe+_0x2a203f(0xfd));}else saveDefaultSiteToUserConfig(_0x5f0703),console[_0x2a203f(0x146)](_0x2a203f(0x133)+_0x5f0703);const _0x36d7d6=_0x2b3bbe?_0x2a203f(0x131)+_0x2b3bbe:'';console['log'](),console[_0x2a203f(0x146)](_0x2a203f(0x10c)),console['log'](_0x2a203f(0x13b)+_0x36d7d6+_0x2a203f(0x10a)),console[_0x2a203f(0x146)]('\x20\x20tdx'+_0x36d7d6+_0x2a203f(0x140));}export async function promptAuthMethod(){const _0x1f6a7d=a7_0xc00d,_0x139537=await a7_0x5ef294({'type':'select','name':_0x1f6a7d(0x148),'message':_0x1f6a7d(0x109),'choices':[{'title':_0x1f6a7d(0x12c),'description':'Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','value':_0x1f6a7d(0x14a)},{'title':_0x1f6a7d(0xf7),'description':_0x1f6a7d(0x117),'value':_0x1f6a7d(0x129)}]});return _0x139537['method']||null;}export class AuthSetupCommand extends BaseCommand{['name']='auth:setup';[a7_0x1c3326(0xfb)]='Setup\x20API\x20key\x20authentication\x20interactively';async[a7_0x1c3326(0xfa)](_0x476730){const _0x262dbe=a7_0x1c3326,{options:_0x373a07}=_0x476730,_0x5dfa74=_0x373a07[_0x262dbe(0x10f)];console[_0x262dbe(0x146)](a7_0x13f29f[_0x262dbe(0xfe)](_0x262dbe(0x10d)));const _0xda6aec=_0x373a07[_0x262dbe(0x118)]||'us01',_0x20d855=await promptSiteSelection(_0xda6aec,_0x5dfa74,'Setup\x20cancelled');if(!_0x20d855)return 0x1;const _0x29e87f=resolveSite(_0x20d855),_0x47732a=await promptAuthMethod();if(!_0x47732a)return console[_0x262dbe(0x146)]('\x0aSetup\x20cancelled'),0x1;if(_0x47732a===_0x262dbe(0x14a)){const {accountName:_0x719ef}=_0x373a07;return await runOAuthLoginFlow(_0x29e87f,_0x5dfa74,_0x373a07[_0x262dbe(0x103)]??LogLevel[_0x262dbe(0x12e)],{'accountName':_0x719ef}),0x0;}console[_0x262dbe(0x146)]('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x29e87f),console[_0x262dbe(0x146)](_0x262dbe(0x132)),console['log']('\x20\x20'+getConsoleUrl(_0x29e87f,_0x262dbe(0x116)));const _0xa51d33=await a7_0x5ef294({'type':'password','name':_0x262dbe(0x115),'message':_0x262dbe(0x106),'validate':_0x5e7922=>{const _0x1a0038=_0x262dbe;if(!_0x5e7922||!_0x5e7922[_0x1a0038(0xf6)]())return _0x1a0038(0x102);return!![];}});if(!_0xa51d33['apiKey'])return console[_0x262dbe(0x146)]('\x0aSetup\x20cancelled'),0x1;const _0x127acb=_0xa51d33[_0x262dbe(0x115)];console[_0x262dbe(0x146)](_0x262dbe(0x14c));try{const _0x2da5c9=TDX['create']({'site':_0x29e87f,'apiKey':_0x127acb[_0x262dbe(0xf6)](),'logLevel':_0x373a07[_0x262dbe(0x103)]??LogLevel['ERROR']}),_0x401023=await _0x2da5c9[_0x262dbe(0x100)][_0x262dbe(0x13e)]();console['log'](_0x262dbe(0x112)+_0x401023['email']+')');const _0x3e8a52=await isKeychainAvailable();_0x3e8a52?(await saveAPIKeyAsync(_0x127acb[_0x262dbe(0xf6)](),_0x29e87f,_0x5dfa74),console[_0x262dbe(0x146)](_0x262dbe(0x144)+(_0x5dfa74?_0x262dbe(0x126)+_0x5dfa74+')':''))):(console[_0x262dbe(0x135)](a7_0x13f29f['yellow'](_0x262dbe(0x11e))),console[_0x262dbe(0x135)](a7_0x13f29f[_0x262dbe(0x10b)](_0x262dbe(0x11d))));if(_0x5dfa74){const _0x50161b={'site':_0x29e87f};saveProfileToUserConfig(_0x5dfa74,_0x50161b),console['log'](_0x262dbe(0xf4)+_0x5dfa74+_0x262dbe(0xfd));}else saveDefaultSiteToUserConfig(_0x29e87f),console[_0x262dbe(0x146)](_0x262dbe(0x133)+_0x29e87f);const _0x3639ca=_0x5dfa74?'\x20--profile\x20'+_0x5dfa74:'';return console[_0x262dbe(0x146)](),console[_0x262dbe(0x146)](_0x262dbe(0x10c)),console['log'](_0x262dbe(0x13b)+_0x3639ca+_0x262dbe(0x10a)),console[_0x262dbe(0x146)]('\x20\x20tdx'+_0x3639ca+_0x262dbe(0x140)),0x0;}catch(_0x3a8557){if(_0x3a8557 instanceof HTTPClientError&&_0x3a8557[_0x262dbe(0x101)]===0x191)return printAuthError(_0x3a8557),0x1;return console[_0x262dbe(0x107)](a7_0x13f29f['red'](_0x262dbe(0x13a)+(_0x3a8557 instanceof Error?_0x3a8557['message']:String(_0x3a8557)))),console['error']('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}function a7_0xc00d(_0x1bf3c2,_0x2e11d9){_0x1bf3c2=_0x1bf3c2-0xf3;const _0x194bf9=a7_0x194b();let _0xc00d87=_0x194bf9[_0x1bf3c2];return _0xc00d87;}export class AuthStatusCommand extends BaseCommand{[a7_0x1c3326(0x110)]=a7_0x1c3326(0x142);['description']='Show\x20authentication\x20status\x20and\x20validate\x20API\x20key';async[a7_0x1c3326(0xfa)](_0x55512f){const _0x502cf8=a7_0x1c3326,{options:_0x3886a5,tdx:_0x1670a2}=_0x55512f,_0x34db80=_0x3886a5[_0x502cf8(0x118)],_0x274488=_0x3886a5[_0x502cf8(0x10f)],_0x11304a=_0x274488?_0x274488:_0x502cf8(0x14b);console[_0x502cf8(0x146)](_0x502cf8(0x12f)+_0x11304a+_0x502cf8(0x11f)+_0x34db80+')');const _0x2d2bc1=await getOAuthTokens(_0x274488);if(_0x2d2bc1)console[_0x502cf8(0x146)](_0x502cf8(0x111)),console[_0x502cf8(0x146)](_0x502cf8(0x136)+(_0x274488?_0x502cf8(0x126)+_0x274488+')':''));else{const _0x4f3021=await resolveAPIKeyAsync(_0x34db80,_0x274488);if(_0x4f3021){const {source:_0x5adbac,isDeprecated:_0x266067}=_0x4f3021,_0x45b58c=_0x502cf8(0x11a)+_0x5adbac;console[_0x502cf8(0x146)](_0x266067?a7_0x13f29f['yellow'](_0x45b58c):_0x45b58c);}else console[_0x502cf8(0x146)](a7_0x13f29f[_0x502cf8(0x10b)](_0x502cf8(0x114)));}try{const _0x3a007d=await _0x1670a2[_0x502cf8(0x100)][_0x502cf8(0x13e)]();return console[_0x502cf8(0x146)](a7_0x13f29f['green'](_0x502cf8(0x108))),console[_0x502cf8(0x146)](_0x502cf8(0x137)+_0x3a007d[_0x502cf8(0x11c)]),(_0x3a007d[_0x502cf8(0x128)]||_0x3a007d[_0x502cf8(0x12d)])&&console[_0x502cf8(0x146)]('Name:\x20'+[_0x3a007d[_0x502cf8(0x128)],_0x3a007d[_0x502cf8(0x12d)]][_0x502cf8(0x105)](Boolean)['join']('\x20')),0x0;}catch(_0x384559){return _0x384559 instanceof HTTPClientError&&_0x384559['status']===0x191?printAuthError(_0x384559,!![],_0x274488):console[_0x502cf8(0x107)](a7_0x13f29f[_0x502cf8(0xfc)](_0x502cf8(0x13a)+(_0x384559 instanceof Error?_0x384559['message']:String(_0x384559)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x1c3326(0x110)]=a7_0x1c3326(0x149);['description']=a7_0x1c3326(0x13c);async['execute'](_0x403127){const _0x5eb2a3=a7_0x1c3326,{options:_0x327b87}=_0x403127,_0x26e577=_0x327b87[_0x5eb2a3(0x10f)];console[_0x5eb2a3(0x146)](a7_0x13f29f[_0x5eb2a3(0xfe)]('tdx:\x20auth\x20clear'));const _0x119b7a=await isKeychainAvailable();if(!_0x119b7a)return console[_0x5eb2a3(0x107)](a7_0x13f29f[_0x5eb2a3(0xfc)]('System\x20keychain\x20is\x20not\x20available')),0x1;const [_0x2f78bf,_0x5b57f2]=await Promise[_0x5eb2a3(0x145)]([deleteKeychainAPIKey(_0x26e577),deleteOAuthTokens(_0x26e577)]);if(_0x2f78bf||_0x5b57f2){clearCredentialCache();const _0x5831d9=[_0x2f78bf&&'API\x20key',_0x5b57f2&&'OAuth\x20tokens'][_0x5eb2a3(0x105)](Boolean)['join'](_0x5eb2a3(0xf3));return console[_0x5eb2a3(0x146)]('✓\x20'+_0x5831d9+_0x5eb2a3(0xf9)+(_0x26e577?_0x5eb2a3(0x126)+_0x26e577+')':'')),0x0;}else return console['log'](_0x5eb2a3(0x12a)+(_0x26e577?'\x20for\x20profile:\x20'+_0x26e577:'')),0x1;}}
|
|
1
|
+
const a7_0x2c0928=a7_0x7ddb;(function(_0x7983ff,_0x5f3179){const _0x3057d7=a7_0x7ddb,_0x40df29=_0x7983ff();while(!![]){try{const _0x2d88f2=parseInt(_0x3057d7(0x1f8))/0x1*(parseInt(_0x3057d7(0x1ba))/0x2)+-parseInt(_0x3057d7(0x1c8))/0x3*(parseInt(_0x3057d7(0x1e5))/0x4)+parseInt(_0x3057d7(0x1bb))/0x5*(-parseInt(_0x3057d7(0x1ea))/0x6)+-parseInt(_0x3057d7(0x1d9))/0x7+-parseInt(_0x3057d7(0x205))/0x8+parseInt(_0x3057d7(0x202))/0x9+parseInt(_0x3057d7(0x20f))/0xa;if(_0x2d88f2===_0x5f3179)break;else _0x40df29['push'](_0x40df29['shift']());}catch(_0x455c6a){_0x40df29['push'](_0x40df29['shift']());}}}(a7_0xb8b3,0xb3bee));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens,saveOAuthTokens}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_0xb8b3(){const _0x4bdf2d=['System\x20keychain\x20is\x20not\x20available','\x20\x20(','9957120gTrFHN','tdx:\x20auth\x20clear','You\x20can\x20find\x20your\x20API\x20key\x20at:','Read\x20credential\x20from\x20','Validating\x20OAuth\x20tokens...','yellow','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','method','\x20for\x20profile:\x20','email','\x0aSetup\x20cancelled','\x27\x20registered','error','Credential\x20type:\x20OAuth','No\x20credential\x20found','profile','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','2748404ttdvpI','1809295dfweez','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','Name:\x20','filter','auth:setup','jobs','Setup\x20API\x20key\x20authentication\x20interactively','tdx\x20profile:\x20','✓\x20Default\x20site\x20set\x20to\x20','API\x20key\x20cannot\x20be\x20empty','warn','OAuth\x20tokens','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','110943EZSSUg','✗\x20Validation\x20failed:\x20','Remove\x20API\x20key\x20from\x20system\x20keychain','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','Setting\x20up\x20authentication\x20for\x20site:\x20','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','logLevel','site','name','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','/app/mp/ak','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','ERROR','getUserInfo','Read\x20credential\x20from\x20keychain','auth','red','1041180EILYmC','\x20(profile:\x20','green','\x20(site:\x20','access_token','auth:clear','User:\x20','✓\x20Signed\x20in\x20successfully','join','/users/initiate_sso\x20(account:\x20','Enter\x20your\x20TD\x20API\x20key:','description','12rsBeGc','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','\x20\x20tdx','create','last_name','24ZjKccl','apikey','text','Sign\x20in\x20with\x20browser\x20(recommended)','Opening\x20browser\x20for\x20authentication...','first_name','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','status','trim','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','/oauth/authorize','Choose\x20how\x20to\x20sign\x20in:','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','1IoJIou','accountName','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','message','log','tdx:\x20auth\x20setup','password','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','bold','\x20and\x20','821520NjcGrE','\x20removed\x20from\x20keychain','us01','142696KzJkuz','\x20--profile\x20','For\x20scripts\x20or\x20headless\x20servers','oauth','Setup\x20cancelled','apiKey','dim','execute'];a7_0xb8b3=function(){return _0x4bdf2d;};return a7_0xb8b3();}import{clearCredentialCache}from'../core/credential-cache.js';import{startOAuthFlow}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x55a2d6 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_0x47d18e from'chalk';export async function runOAuthLoginFlow(_0x193732,_0x2555c9,_0x4a4b0,_0x26106a){const _0x53ac58=a7_0x7ddb,_0x28f2da=await isKeychainAvailable();if(!_0x28f2da)throw new Error(_0x53ac58(0x1bc)+_0x53ac58(0x1d3));let _0x1e568f=_0x26106a?.[_0x53ac58(0x1f9)];if(!_0x1e568f){const _0x244200=await a7_0x55a2d6({'type':_0x53ac58(0x1ec),'name':_0x53ac58(0x1f9),'message':_0x53ac58(0x1d1)});if(_0x244200['accountName']===undefined)throw new Error(_0x53ac58(0x209));_0x1e568f=_0x244200['accountName'][_0x53ac58(0x1f3)]()||undefined;}const _0x4f4c79=getConsoleUrl(_0x193732);console[_0x53ac58(0x1fc)](_0x53ac58(0x1ee));_0x1e568f?console['log']('\x20\x20'+_0x4f4c79+_0x53ac58(0x1e2)+_0x1e568f+')'):console['log']('\x20\x20'+_0x4f4c79+_0x53ac58(0x1f5));console['log'](_0x53ac58(0x1fa));const _0x3ca154=await startOAuthFlow(_0x193732,{'accountName':_0x1e568f});console[_0x53ac58(0x1fc)](_0x53ac58(0x213));const _0x500140=TDX[_0x53ac58(0x1e8)]({'site':_0x193732,'accessToken':_0x3ca154[_0x53ac58(0x1dd)],'logLevel':_0x4a4b0??LogLevel[_0x53ac58(0x1d4)]}),_0x1a45d4=await _0x500140[_0x53ac58(0x1c0)][_0x53ac58(0x1d5)]();console[_0x53ac58(0x1fc)](a7_0x47d18e[_0x53ac58(0x1db)](_0x53ac58(0x1e0))),console[_0x53ac58(0x1fc)]('\x20\x20'+a7_0x47d18e['cyan'](_0x193732+':'+_0x1a45d4['account_id'])+'\x20\x20user_id:'+_0x1a45d4['id']+_0x53ac58(0x20e)+_0x1a45d4['email']+')');!_0x1e568f&&(console[_0x53ac58(0x1fc)](a7_0x47d18e['dim']('\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:')),console[_0x53ac58(0x1fc)](a7_0x47d18e[_0x53ac58(0x20b)](_0x53ac58(0x1ff))),console['log'](a7_0x47d18e[_0x53ac58(0x20b)](_0x53ac58(0x1af))));await saveOAuthTokens(_0x3ca154,_0x2555c9),console['log'](_0x53ac58(0x1e6)+(_0x2555c9?_0x53ac58(0x1da)+_0x2555c9+')':''));if(_0x2555c9){const _0x615429={'site':_0x193732};saveProfileToUserConfig(_0x2555c9,_0x615429),console[_0x53ac58(0x1fc)]('✓\x20Profile\x20\x27'+_0x2555c9+_0x53ac58(0x1b4));}else saveDefaultSiteToUserConfig(_0x193732),console[_0x53ac58(0x1fc)](_0x53ac58(0x1c3)+_0x193732);const _0x8c80b3=_0x2555c9?'\x20--profile\x20'+_0x2555c9:'';console[_0x53ac58(0x1fc)](),console[_0x53ac58(0x1fc)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x53ac58(0x1fc)](_0x53ac58(0x1e7)+_0x8c80b3+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console['log']('\x20\x20tdx'+_0x8c80b3+_0x53ac58(0x1b9));}function a7_0x7ddb(_0x3425e2,_0x2f146a){_0x3425e2=_0x3425e2-0x1af;const _0xb8b3cf=a7_0xb8b3();let _0x7ddb14=_0xb8b3cf[_0x3425e2];return _0x7ddb14;}export async function promptAuthMethod(){const _0x36af77=a7_0x7ddb,_0x5b4c9b=await a7_0x55a2d6({'type':'select','name':_0x36af77(0x1b0),'message':_0x36af77(0x1f6),'choices':[{'title':_0x36af77(0x1ed),'description':'Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','value':_0x36af77(0x208)},{'title':'Use\x20an\x20API\x20key','description':_0x36af77(0x207),'value':_0x36af77(0x1eb)}]});return _0x5b4c9b[_0x36af77(0x1b0)]||null;}export class AuthSetupCommand extends BaseCommand{['name']=a7_0x2c0928(0x1bf);[a7_0x2c0928(0x1e4)]=a7_0x2c0928(0x1c1);async[a7_0x2c0928(0x20c)](_0x5b464e){const _0x554804=a7_0x2c0928,{options:_0x3a34f2}=_0x5b464e,_0x4c68bf=_0x3a34f2[_0x554804(0x1b8)];console[_0x554804(0x1fc)](a7_0x47d18e[_0x554804(0x200)](_0x554804(0x1fd)));const _0x47dc84=_0x3a34f2[_0x554804(0x1cf)]||_0x554804(0x204),_0x508a14=await promptSiteSelection(_0x47dc84,_0x4c68bf,_0x554804(0x209));if(!_0x508a14)return 0x1;const _0x2440e2=resolveSite(_0x508a14),_0x14369f=await promptAuthMethod();if(!_0x14369f)return console[_0x554804(0x1fc)](_0x554804(0x1b3)),0x1;if(_0x14369f===_0x554804(0x208)){const {accountName:_0x12aa74}=_0x3a34f2;return await runOAuthLoginFlow(_0x2440e2,_0x4c68bf,_0x3a34f2[_0x554804(0x1ce)]??LogLevel[_0x554804(0x1d4)],{'accountName':_0x12aa74}),0x0;}console[_0x554804(0x1fc)](_0x554804(0x1cc)+_0x2440e2),console[_0x554804(0x1fc)](_0x554804(0x211)),console[_0x554804(0x1fc)]('\x20\x20'+getConsoleUrl(_0x2440e2,_0x554804(0x1d2)));const _0x5b552b=await a7_0x55a2d6({'type':_0x554804(0x1fe),'name':_0x554804(0x20a),'message':_0x554804(0x1e3),'validate':_0x1fc6c1=>{const _0x15e95e=_0x554804;if(!_0x1fc6c1||!_0x1fc6c1[_0x15e95e(0x1f3)]())return _0x15e95e(0x1c4);return!![];}});if(!_0x5b552b['apiKey'])return console[_0x554804(0x1fc)](_0x554804(0x1b3)),0x1;const _0xe57ca6=_0x5b552b['apiKey'];console[_0x554804(0x1fc)]('Validating\x20API\x20key...');try{const _0x40239e=TDX['create']({'site':_0x2440e2,'apiKey':_0xe57ca6[_0x554804(0x1f3)](),'logLevel':_0x3a34f2[_0x554804(0x1ce)]??LogLevel[_0x554804(0x1d4)]}),_0x3ff0ff=await _0x40239e[_0x554804(0x1c0)]['getUserInfo']();console[_0x554804(0x1fc)](_0x554804(0x1f1)+_0x3ff0ff[_0x554804(0x1b2)]+')');const _0x4a02c4=await isKeychainAvailable();_0x4a02c4?(await saveAPIKeyAsync(_0xe57ca6[_0x554804(0x1f3)](),_0x2440e2,_0x4c68bf),console[_0x554804(0x1fc)]('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0x4c68bf?_0x554804(0x1da)+_0x4c68bf+')':''))):(console[_0x554804(0x1c5)](a7_0x47d18e[_0x554804(0x214)](_0x554804(0x1cb))),console['warn'](a7_0x47d18e['yellow'](_0x554804(0x1cd))));if(_0x4c68bf){const _0x42c405={'site':_0x2440e2};saveProfileToUserConfig(_0x4c68bf,_0x42c405),console['log']('✓\x20Profile\x20\x27'+_0x4c68bf+_0x554804(0x1b4));}else saveDefaultSiteToUserConfig(_0x2440e2),console[_0x554804(0x1fc)]('✓\x20Default\x20site\x20set\x20to\x20'+_0x2440e2);const _0x3cdd08=_0x4c68bf?_0x554804(0x206)+_0x4c68bf:'';return console[_0x554804(0x1fc)](),console[_0x554804(0x1fc)](_0x554804(0x1f0)),console[_0x554804(0x1fc)](_0x554804(0x1e7)+_0x3cdd08+_0x554804(0x1c7)),console[_0x554804(0x1fc)](_0x554804(0x1e7)+_0x3cdd08+_0x554804(0x1b9)),0x0;}catch(_0x95d9f0){if(_0x95d9f0 instanceof HTTPClientError&&_0x95d9f0[_0x554804(0x1f2)]===0x191)return printAuthError(_0x95d9f0),0x1;return console[_0x554804(0x1b5)](a7_0x47d18e[_0x554804(0x1d8)]('✗\x20Validation\x20failed:\x20'+(_0x95d9f0 instanceof Error?_0x95d9f0[_0x554804(0x1fb)]:String(_0x95d9f0)))),console[_0x554804(0x1b5)](_0x554804(0x1f4)),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']=a7_0x2c0928(0x1d7);[a7_0x2c0928(0x1e4)]=a7_0x2c0928(0x1f7);async[a7_0x2c0928(0x20c)](_0x5837f2){const _0x9789f8=a7_0x2c0928,{options:_0x11a294,tdx:_0x45dd75}=_0x5837f2,_0x705504=_0x11a294[_0x9789f8(0x1cf)],_0xeb6323=_0x11a294[_0x9789f8(0x1b8)],_0x220c65=_0xeb6323?_0xeb6323:'N/A';console[_0x9789f8(0x1fc)](_0x9789f8(0x1c2)+_0x220c65+_0x9789f8(0x1dc)+_0x705504+')');const _0x1c1cf9=await getOAuthTokens(_0xeb6323);if(_0x1c1cf9)console[_0x9789f8(0x1fc)](_0x9789f8(0x1b6)),console[_0x9789f8(0x1fc)](_0x9789f8(0x1d6)+(_0xeb6323?'\x20(profile:\x20'+_0xeb6323+')':''));else{const _0x55bdc0=await resolveAPIKeyAsync(_0x705504,_0xeb6323);if(_0x55bdc0){const {source:_0x1290fd,isDeprecated:_0x474c5f}=_0x55bdc0,_0x3a1253=_0x9789f8(0x212)+_0x1290fd;console[_0x9789f8(0x1fc)](_0x474c5f?a7_0x47d18e[_0x9789f8(0x214)](_0x3a1253):_0x3a1253);}else console[_0x9789f8(0x1fc)](a7_0x47d18e['yellow'](_0x9789f8(0x1b7)));}try{const _0x5e9a7f=await _0x45dd75[_0x9789f8(0x1c0)]['getUserInfo']();return console[_0x9789f8(0x1fc)](a7_0x47d18e[_0x9789f8(0x1db)]('✓\x20Authentication\x20successful\x0a')),console[_0x9789f8(0x1fc)](_0x9789f8(0x1df)+_0x5e9a7f[_0x9789f8(0x1b2)]),(_0x5e9a7f['first_name']||_0x5e9a7f[_0x9789f8(0x1e9)])&&console[_0x9789f8(0x1fc)](_0x9789f8(0x1bd)+[_0x5e9a7f[_0x9789f8(0x1ef)],_0x5e9a7f[_0x9789f8(0x1e9)]][_0x9789f8(0x1be)](Boolean)[_0x9789f8(0x1e1)]('\x20')),0x0;}catch(_0x250623){return _0x250623 instanceof HTTPClientError&&_0x250623[_0x9789f8(0x1f2)]===0x191?printAuthError(_0x250623,!![],_0xeb6323):console[_0x9789f8(0x1b5)](a7_0x47d18e['red'](_0x9789f8(0x1c9)+(_0x250623 instanceof Error?_0x250623[_0x9789f8(0x1fb)]:String(_0x250623)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x2c0928(0x1d0)]=a7_0x2c0928(0x1de);[a7_0x2c0928(0x1e4)]=a7_0x2c0928(0x1ca);async[a7_0x2c0928(0x20c)](_0xafb3c8){const _0x5c5af0=a7_0x2c0928,{options:_0x33088d}=_0xafb3c8,_0x11512d=_0x33088d['profile'];console[_0x5c5af0(0x1fc)](a7_0x47d18e[_0x5c5af0(0x200)](_0x5c5af0(0x210)));const _0x352752=await isKeychainAvailable();if(!_0x352752)return console[_0x5c5af0(0x1b5)](a7_0x47d18e[_0x5c5af0(0x1d8)](_0x5c5af0(0x20d))),0x1;const [_0x1ce178,_0x529416]=await Promise['all']([deleteKeychainAPIKey(_0x11512d),deleteOAuthTokens(_0x11512d)]);if(_0x1ce178||_0x529416){clearCredentialCache();const _0x5651c5=[_0x1ce178&&'API\x20key',_0x529416&&_0x5c5af0(0x1c6)]['filter'](Boolean)['join'](_0x5c5af0(0x201));return console[_0x5c5af0(0x1fc)]('✓\x20'+_0x5651c5+_0x5c5af0(0x203)+(_0x11512d?_0x5c5af0(0x1da)+_0x11512d+')':'')),0x0;}else return console[_0x5c5af0(0x1fc)]('No\x20credentials\x20found\x20in\x20keychain'+(_0x11512d?_0x5c5af0(0x1b1)+_0x11512d:'')),0x1;}}
|