@treasuredata/tdx 2026.4.21 → 2026.4.22
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.d.ts.map +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-command.js.map +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/tools/work-create-item.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.d.ts.map +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/claude-usage-tracker.js.map +1 -1
- package/dist/proxy/passthrough-server.d.ts +10 -0
- package/dist/proxy/passthrough-server.d.ts.map +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/passthrough-server.js.map +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.d.ts +33 -9
- package/dist/sdk/llm/model-factors.d.ts.map +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/llm/model-factors.js.map +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/task-graph.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.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a3_0x4ef6c4=a3_0x2e43;(function(_0x4c0ef6,_0x458487){const _0x484ce4=a3_0x2e43,_0x5bf65c=_0x4c0ef6();while(!![]){try{const _0x30f132=-parseInt(_0x484ce4(0xc3))/0x1*(parseInt(_0x484ce4(0xbd))/0x2)+parseInt(_0x484ce4(0xd2))/0x3*(-parseInt(_0x484ce4(0xc8))/0x4)+parseInt(_0x484ce4(0xbe))/0x5+parseInt(_0x484ce4(0xc1))/0x6*(-parseInt(_0x484ce4(0xd6))/0x7)+-parseInt(_0x484ce4(0xc9))/0x8+parseInt(_0x484ce4(0xcd))/0x9+parseInt(_0x484ce4(0xc6))/0xa;if(_0x30f132===_0x458487)break;else _0x5bf65c['push'](_0x5bf65c['shift']());}catch(_0x46eb0a){_0x5bf65c['push'](_0x5bf65c['shift']());}}}(a3_0x468f,0x2478e));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_0x468f(){const _0x35f288=['118MAnZNy','1481105IPDEdF','verbose','site','54822iRJPHj','Resolved\x20child\x20ID:\x20','257tGtsAE','Listing\x20activations\x20for\x20segment\x20\x27','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','567050GLDBgO','segment','52kKmkLB','808352DdNWpw','Site:\x20','Error:\x20Segment\x20name\x20is\x20required','listActivations','2383065KGWLeD','activations','name','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','description','49629BsreQP','data','length','List\x20activations\x20for\x20a\x20segment','105yCDzGD','Parent\x20name:\x20','cause','message','Error:\x20','Resolving\x20parent\x20segment\x20\x27','Child\x20name:\x20','error','\x27...','\x20activation'];a3_0x468f=function(){return _0x35f288;};return a3_0x468f();}function a3_0x2e43(_0x3365fd,_0x360ec1){_0x3365fd=_0x3365fd-0xb5;const _0x468fd5=a3_0x468f();let _0x2e4390=_0x468fd5[_0x3365fd];return _0x2e4390;}import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x4ef6c4(0xcf)]=a3_0x4ef6c4(0xce);[a3_0x4ef6c4(0xd1)]=a3_0x4ef6c4(0xd5);async['execute'](_0x1fc29d){const _0x54cc4f=a3_0x4ef6c4,{options:_0x37a3c5,args:_0x441d5a,tdx:_0x4257b0}=_0x1fc29d;if(_0x441d5a[_0x54cc4f(0xd4)]===0x0)return console[_0x54cc4f(0xba)](_0x54cc4f(0xcb)),console['error'](_0x54cc4f(0xc5)),0x1;try{const {parentId:_0x8f73d5,childId:_0x24faf0}=parseSegmentRef(_0x441d5a[0x0]);if(!_0x24faf0)return console[_0x54cc4f(0xba)](_0x54cc4f(0xd0)),console[_0x54cc4f(0xba)](_0x54cc4f(0xc5)),0x1;_0x37a3c5[_0x54cc4f(0xbf)]&&(console['error'](_0x54cc4f(0xca)+_0x37a3c5[_0x54cc4f(0xc0)]),console[_0x54cc4f(0xba)](_0x54cc4f(0xd7)+_0x8f73d5),console[_0x54cc4f(0xba)](_0x54cc4f(0xb9)+_0x24faf0));const _0x34c17f=await withSpinner(_0x54cc4f(0xb8)+_0x8f73d5+_0x54cc4f(0xbb),()=>_0x4257b0['segment']['resolveParentId'](_0x8f73d5),{'verbose':_0x37a3c5['verbose']}),_0x128e6b=_0x34c17f['data'];_0x37a3c5[_0x54cc4f(0xbf)]&&console[_0x54cc4f(0xba)]('Resolved\x20parent\x20ID:\x20'+_0x128e6b);const _0x389d73=await withSpinner('Resolving\x20child\x20segment\x20\x27'+_0x24faf0+_0x54cc4f(0xbb),()=>_0x4257b0[_0x54cc4f(0xc7)]['resolveSegmentId'](_0x128e6b,_0x24faf0),{'verbose':_0x37a3c5[_0x54cc4f(0xbf)]}),_0x453a4c=_0x389d73[_0x54cc4f(0xd3)];_0x37a3c5[_0x54cc4f(0xbf)]&&console[_0x54cc4f(0xba)](_0x54cc4f(0xc2)+_0x453a4c);const _0x3410f7=await withSpinner(_0x54cc4f(0xc4)+_0x24faf0+_0x54cc4f(0xbb),()=>_0x4257b0[_0x54cc4f(0xc7)][_0x54cc4f(0xcc)](_0x128e6b,_0x453a4c),{'verbose':_0x37a3c5[_0x54cc4f(0xbf)]}),_0xf8ad8f=_0x3410f7['data'];return console['error']('✔\x20Found\x20'+_0xf8ad8f[_0x54cc4f(0xd4)]+_0x54cc4f(0xbc)+(_0xf8ad8f['length']!==0x1?'s':'')),await handleSDKOutput(_0xf8ad8f,_0x37a3c5),0x0;}catch(_0x45aa0d){if(_0x45aa0d instanceof SDKError)return console['error'](_0x54cc4f(0xb7)+_0x45aa0d[_0x54cc4f(0xb6)]),_0x45aa0d[_0x54cc4f(0xb5)]&&console[_0x54cc4f(0xba)]('\x20\x20Cause:\x20'+_0x45aa0d[_0x54cc4f(0xb5)]),0x1;throw _0x45aa0d;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x3b9a29=a4_0x1f67;(function(_0x8d7cb2,_0x5ac736){const _0x3d1509=a4_0x1f67,_0x3d1cb0=_0x8d7cb2();while(!![]){try{const _0x4dfce7=-parseInt(_0x3d1509(0x18b))/0x1+parseInt(_0x3d1509(0x159))/0x2*(parseInt(_0x3d1509(0x167))/0x3)+parseInt(_0x3d1509(0x16c))/0x4*(parseInt(_0x3d1509(0x16e))/0x5)+-parseInt(_0x3d1509(0x175))/0x6*(parseInt(_0x3d1509(0x13b))/0x7)+parseInt(_0x3d1509(0x1ae))/0x8+-parseInt(_0x3d1509(0x139))/0x9*(-parseInt(_0x3d1509(0x1a5))/0xa)+-parseInt(_0x3d1509(0x18e))/0xb;if(_0x4dfce7===_0x5ac736)break;else _0x3d1cb0['push'](_0x3d1cb0['shift']());}catch(_0x35492d){_0x3d1cb0['push'](_0x3d1cb0['shift']());}}}(a4_0x5152,0x96b91));import a4_0x4fecd4 from'chalk';import a4_0x2c330a 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';function a4_0x5152(){const _0x4def6f=['\x20\x20Form\x20Interfaces:\x20','\x0aChanges\x20to\x20prompt\x20\x27','dim','experimentalArtifacts','source','experimentalKnowledgeBases','hasChanges','cwd','\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','outputPath','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','agentId','\x22\x20to\x20new\x20project\x20\x22','\x0aChanges\x20to\x20agent\x20\x27','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','agent:push','textKnowledgeBases','\x20\x20Target:\x20','Project\x20cloned\x20successfully','✔\x20Context\x20set:\x20','Dry\x20run\x20-\x20no\x20changes\x20made','execute','\x27\x20to\x20create\x20the\x20folder\x20structure.','Using\x20project:\x20','error','unchanged','name','join','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x20\x20Chat\x20Interfaces:\x20','yellow','total','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x0aProject\x20pushed\x20with\x20errors','\x0aError:','Using\x20context\x20project:\x20','chatInterfaces','Analyzing\x20changes\x20to\x20push...','\x20\x20Knowledge\x20Bases:\x20','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','Would\x20clone:','Chat:\x20','Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','\x20\x20Knowledge\x20Base\x20\x22','\x0a✔\x20Pushed\x20','errors','\x20\x20Agent\x20\x22','\x20\x20Integrations:\x20','\x20\x20Source:\x20','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','profile','context','newProjectId','created','green','\x20changed','agent:clone','formInterfaces','1051119IQunBp','dirname','1848763qKRddL','\x0aPush\x20summary\x20for\x20\x27','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','New\x20project\x20name\x20is\x20required','red','reason','Agent:\x20','\x20\x20Prompt\x20\x22','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','Source:\x20','projectName','Project:\x20','dryRun','\x20\x20Experimental\x20Artifacts:\x20','agent:pull','\x20resources\x20to\x20\x27','site','\x20\x20Agents:\x20','output','\x0aChanges\x20to\x20form\x20interface\x20\x27','\x0aChanges:','sourceProjectName','pullAgent','cloneProject','\x20files\x20to\x20','\x0aPush\x20','Would\x20pull\x20agent:\x20','MISSING_ARGUMENT','Analyzing\x20project\x20\x22','agents','3518bCNvxk','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','cyan','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','Using\x20local\x20project:\x20','integrations','no_local_folder','Summary:','\x22:\x20','\x20new','\x20\x20Form\x20Interface\x20\x22','diff','projectId','\x20\x20Experimental\x20Artifact\x20\x22','864CBaRjE','Errors:','\x0aChanges\x20to\x20integration\x20\x27','prompts','\x20unchanged','4oEluHi','action','1191815bVaZRZ','utf-8','session','\x0aErrors\x20found:','\x20\x20Text\x20Knowledge\x20Base\x20\x22','Using\x20current\x20project:\x20','New\x20project:\x20','6jBOOgM','\x22\x20to\x20\x22','\x20\x20Integration\x20\x22','pullProject','\x20\x20tdx\x20agent\x20pull\x20','INVALID_ARGUMENT','llmProject','Pulling\x20agent\x20\x22','\x20created','yes','\x22...','Output\x20path:\x20','description','log','newProjectName','\x20updated','Cancelled','\x0a✔\x20Pulled\x20','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','Would\x20push\x20agent:\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','61970RTjcxw','Agent\x20','New\x20project\x20ID:\x20','10430695TzWNnN','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','isNew','outputDir','Status:\x20','message','\x20\x20Text\x20Knowledge\x20Bases:\x20','new','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','no_context','\x20--profile\x20','\x20files?','\x20|\x20','\x20\x20Prompts:\x20','Clone\x20\x22','-\x20no\x20files\x20written','agent','No\x20tdx.json\x20found\x20in\x20','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','arg-dir','counts','pushProject','50EXzkze','llm','Project\x20cloned\x20with\x20errors','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','<new-name>','\x20\x20Chat\x20Interface\x20\x22','repeat','Agent\x20pulled\x20successfully','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','4502200bAJMej','\x22\x20to\x20a\x20different\x20profile','knowledgeBases','Output:\x20','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','updated','tdx.json','projectDir','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','-\x20nothing\x20pushed','\x20successfully','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','agentName','push','gray','Pushing\x20to\x20project...','llm_project','\x20\x20tdx\x20agent\x20clone\x20agents/','force'];a4_0x5152=function(){return _0x4def6f;};return a4_0x5152();}import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';function a4_0x1f67(_0x1c78fe,_0x5b0f64){_0x1c78fe=_0x1c78fe-0x12c;const _0x5152e3=a4_0x5152();let _0x1f6767=_0x5152e3[_0x1c78fe];return _0x1f6767;}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(_0x2e43d8){const _0x38550a=a4_0x1f67,_0x1bc2f1=[];if(_0x2e43d8[_0x38550a(0x1e0)]!==undefined)_0x1bc2f1[_0x38550a(0x1bb)](_0x2e43d8['total']+'\x20total');if(_0x2e43d8['new']!==undefined&&_0x2e43d8[_0x38550a(0x195)]>0x0)_0x1bc2f1[_0x38550a(0x1bb)](a4_0x4fecd4[_0x38550a(0x135)](_0x2e43d8[_0x38550a(0x195)]+'\x20new'));if(_0x2e43d8['created']!==undefined&&_0x2e43d8[_0x38550a(0x134)]>0x0)_0x1bc2f1[_0x38550a(0x1bb)](a4_0x4fecd4[_0x38550a(0x135)](_0x2e43d8['created']+_0x38550a(0x17d)));if(_0x2e43d8[_0x38550a(0x1b3)]!==undefined&&_0x2e43d8[_0x38550a(0x1b3)]>0x0)_0x1bc2f1[_0x38550a(0x1bb)](a4_0x4fecd4[_0x38550a(0x1df)](_0x2e43d8[_0x38550a(0x1b3)]+_0x38550a(0x184)));if(_0x2e43d8[_0x38550a(0x1da)]!==undefined&&_0x2e43d8['unchanged']>0x0)_0x1bc2f1[_0x38550a(0x1bb)](a4_0x4fecd4[_0x38550a(0x1bc)](_0x2e43d8[_0x38550a(0x1da)]+_0x38550a(0x16b)));if(_0x2e43d8[_0x38550a(0x12c)]!==undefined&&_0x2e43d8[_0x38550a(0x12c)]>0x0)_0x1bc2f1[_0x38550a(0x1bb)](a4_0x4fecd4[_0x38550a(0x13f)](_0x2e43d8[_0x38550a(0x12c)]+'\x20errors'));return _0x1bc2f1[_0x38550a(0x1dc)](',\x20');}function displayDiffs(_0x1b11bd,_0x1942c9,_0x24ef15,_0x46c186,_0x1e835a,_0x5cb8b9,_0x17984c,_0x47cf14,_0xd59cb4){const _0x256678=a4_0x1f67;for(const _0x8709c1 of _0x1b11bd){if(_0x8709c1[_0x256678(0x164)]){const _0x411e13=_0x8709c1[_0x256678(0x1ba)]||_0x8709c1[_0x256678(0x1db)];console[_0x256678(0x182)](_0x256678(0x1ce)+_0x411e13+'\x27:'),console[_0x256678(0x182)]('─'['repeat'](0x3c)),console[_0x256678(0x182)](_0x8709c1[_0x256678(0x164)]),console[_0x256678(0x182)]('─'[_0x256678(0x1ab)](0x3c));}}for(const _0x266cec of _0x1942c9){_0x266cec[_0x256678(0x164)]&&(console['log'](_0x256678(0x1b2)+_0x266cec['name']+'\x27:'),console[_0x256678(0x182)]('─'[_0x256678(0x1ab)](0x3c)),console[_0x256678(0x182)](_0x266cec[_0x256678(0x164)]),console[_0x256678(0x182)]('─'[_0x256678(0x1ab)](0x3c)));}for(const _0x373a1f of _0x24ef15){_0x373a1f[_0x256678(0x164)]&&(console[_0x256678(0x182)](_0x256678(0x1dd)+_0x373a1f[_0x256678(0x1db)]+'\x27:'),console[_0x256678(0x182)]('─'[_0x256678(0x1ab)](0x3c)),console[_0x256678(0x182)](_0x373a1f[_0x256678(0x164)]),console[_0x256678(0x182)]('─'[_0x256678(0x1ab)](0x3c)));}for(const _0x147f4b of _0x46c186){_0x147f4b['diff']&&(console[_0x256678(0x182)](_0x256678(0x1c2)+_0x147f4b[_0x256678(0x1db)]+'\x27:'),console['log']('─'[_0x256678(0x1ab)](0x3c)),console[_0x256678(0x182)](_0x147f4b[_0x256678(0x164)]),console[_0x256678(0x182)]('─'[_0x256678(0x1ab)](0x3c)));}for(const _0x2a23dc of _0x1e835a){_0x2a23dc[_0x256678(0x164)]&&(console[_0x256678(0x182)](_0x256678(0x169)+_0x2a23dc[_0x256678(0x1db)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x256678(0x182)](_0x2a23dc[_0x256678(0x164)]),console[_0x256678(0x182)]('─'['repeat'](0x3c)));}for(const _0x341892 of _0x5cb8b9){_0x341892[_0x256678(0x164)]&&(console[_0x256678(0x182)](_0x256678(0x15c)+_0x341892['name']+'\x27:'),console[_0x256678(0x182)]('─'[_0x256678(0x1ab)](0x3c)),console[_0x256678(0x182)](_0x341892[_0x256678(0x164)]),console['log']('─'[_0x256678(0x1ab)](0x3c)));}for(const _0x226744 of _0x17984c){_0x226744['diff']&&(console[_0x256678(0x182)](_0x256678(0x143)+_0x226744['name']+'\x27:'),console[_0x256678(0x182)]('─'[_0x256678(0x1ab)](0x3c)),console[_0x256678(0x182)](_0x226744['diff']),console['log']('─'[_0x256678(0x1ab)](0x3c)));}for(const _0x19f753 of _0x47cf14){_0x19f753[_0x256678(0x164)]&&(console[_0x256678(0x182)](_0x256678(0x14e)+_0x19f753['name']+'\x27:'),console[_0x256678(0x182)]('─'['repeat'](0x3c)),console[_0x256678(0x182)](_0x19f753['diff']),console[_0x256678(0x182)]('─'['repeat'](0x3c)));}for(const _0xd7901d of _0xd59cb4){_0xd7901d['diff']&&(console[_0x256678(0x182)]('\x0aChanges\x20to\x20chat\x20interface\x20\x27'+_0xd7901d[_0x256678(0x1db)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x256678(0x182)](_0xd7901d[_0x256678(0x164)]),console[_0x256678(0x182)]('─'[_0x256678(0x1ab)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x3b9a29(0x1db)]=a4_0x3b9a29(0x149);[a4_0x3b9a29(0x181)]=a4_0x3b9a29(0x1a8);async[a4_0x3b9a29(0x1d6)](_0x3024eb){const _0x333c48=a4_0x3b9a29,{options:_0x2d4350,args:_0x1d9421,tdx:_0x56623b}=_0x3024eb,_0x41c6fe=_0x1d9421[0x0],_0x489792=_0x1d9421[0x1],_0x1484ef=_0x2d4350[_0x333c48(0x14d)],_0x29ff06=_0x2d4350[_0x333c48(0x147)],_0x17e598=_0x2d4350['force'],_0x269c3a=_0x2d4350['yes'],_0xfded78=_0x2d4350['llmProject'],_0x188459=_0x2d4350[_0x333c48(0x19e)];let _0x184c32;if(_0x41c6fe){const _0x2fad53=a4_0x2c330a['join'](_0x41c6fe,_0x333c48(0x1b4));if(existsSync(_0x2fad53))try{const _0x3fa603=JSON['parse'](readFileSync(_0x2fad53,_0x333c48(0x16f)));_0x3fa603['llm_project']&&(_0x184c32={'llm_project':_0x3fa603[_0x333c48(0x1be)]});}catch{}}const _0x34ad1a=findAgentConfigPath(process[_0x333c48(0x1c8)]());let _0x463cbc;if(_0x34ad1a)try{const _0x47bba6=JSON['parse'](readFileSync(_0x34ad1a,_0x333c48(0x16f)));_0x47bba6[_0x333c48(0x1be)]&&(_0x463cbc={'llm_project':_0x47bba6[_0x333c48(0x1be)]});}catch{}const _0x55c04d=resolveAgentPullArgs({'arg':_0x41c6fe,'agentNameArg':_0x489792,'agentFlag':_0x188459,'contextProject':_0xfded78,'argDirConfig':_0x184c32,'cwdConfigPath':_0x34ad1a||undefined,'cwdConfig':_0x463cbc}),{projectNameOrId:_0xadb0ba,targetAgentName:_0x199156,existingOutputDir:_0x2da121,source:_0xe3b9e9}=_0x55c04d;if(_0xe3b9e9===_0x333c48(0x1a2))console[_0x333c48(0x182)](a4_0x4fecd4[_0x333c48(0x1c3)]('Using\x20project\x20from\x20'+a4_0x2c330a[_0x333c48(0x1dc)](_0x41c6fe,'tdx.json')+':\x20'+_0xadb0ba));else{if(_0xe3b9e9==='cwd-config')console['log'](a4_0x4fecd4[_0x333c48(0x1c3)](_0x333c48(0x1d8)+_0xadb0ba));else _0xe3b9e9==='context'&&console['log'](a4_0x4fecd4[_0x333c48(0x1c3)]('Using\x20project\x20from\x20context:\x20'+_0xadb0ba));}if(!_0xadb0ba)return _0x188459?(console[_0x333c48(0x182)](a4_0x4fecd4[_0x333c48(0x1df)](_0x333c48(0x1b6))),console[_0x333c48(0x182)](_0x333c48(0x130)),console[_0x333c48(0x182)](_0x333c48(0x1a0))):(console[_0x333c48(0x182)](a4_0x4fecd4['yellow'](_0x333c48(0x1b9))),console[_0x333c48(0x182)](_0x333c48(0x1eb)),console[_0x333c48(0x182)](_0x333c48(0x1c9)),console[_0x333c48(0x182)]('\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['log']('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project'),console['log']('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project')),0x1;if(_0x199156){const {data:_0x57c285}=await withSpinner(_0x333c48(0x17c)+_0x199156+'\x22\x20from\x20project\x20\x22'+_0xadb0ba+_0x333c48(0x17f),()=>_0x56623b[_0x333c48(0x1a6)][_0x333c48(0x151)](_0xadb0ba,_0x199156,_0x1484ef,{'dryRun':_0x29ff06,'force':_0x17e598}));if(_0x29ff06)return console[_0x333c48(0x182)](a4_0x4fecd4[_0x333c48(0x1df)]('Dry\x20run\x20-\x20no\x20files\x20written')),console[_0x333c48(0x182)](_0x333c48(0x155)+_0x57c285[_0x333c48(0x1ba)]),console['log'](_0x333c48(0x180)+_0x57c285[_0x333c48(0x1ca)]),_0x57c285['diff']&&(console[_0x333c48(0x182)](_0x333c48(0x14f)),console[_0x333c48(0x182)]('─'[_0x333c48(0x1ab)](0x3c)),console[_0x333c48(0x182)](_0x57c285[_0x333c48(0x164)]),console['log']('─'[_0x333c48(0x1ab)](0x3c))),0x0;return console[_0x333c48(0x182)](a4_0x4fecd4['green'](_0x333c48(0x1ac))),console[_0x333c48(0x182)]('Agent:\x20'+_0x57c285[_0x333c48(0x1ba)]),console[_0x333c48(0x182)](_0x333c48(0x1b1)+_0x57c285[_0x333c48(0x1ca)]),console[_0x333c48(0x182)](_0x333c48(0x192)+(_0x57c285[_0x333c48(0x190)]?a4_0x4fecd4['green'](_0x333c48(0x195)):_0x57c285[_0x333c48(0x1c7)]?a4_0x4fecd4[_0x333c48(0x1df)](_0x333c48(0x1b3)):a4_0x4fecd4[_0x333c48(0x1bc)]('unchanged'))),0x0;}const _0x5e5593=_0x2da121||_0x1484ef,{data:_0x33b33e}=await withSpinner(_0x333c48(0x157)+_0xadb0ba+'\x22...',()=>_0x56623b[_0x333c48(0x1a6)]['pullProject'](_0xadb0ba,_0x5e5593,{'dryRun':!![]})),_0x1da561=_0x33b33e[_0x333c48(0x1a3)]['agents'][_0x333c48(0x195)]+_0x33b33e[_0x333c48(0x1a3)][_0x333c48(0x1b0)][_0x333c48(0x195)]+_0x33b33e[_0x333c48(0x1a3)][_0x333c48(0x1d1)][_0x333c48(0x195)]+_0x33b33e[_0x333c48(0x1a3)][_0x333c48(0x16a)][_0x333c48(0x195)]+_0x33b33e[_0x333c48(0x1a3)][_0x333c48(0x15e)][_0x333c48(0x195)]+_0x33b33e[_0x333c48(0x1a3)][_0x333c48(0x1c6)][_0x333c48(0x195)]+_0x33b33e[_0x333c48(0x1a3)][_0x333c48(0x1c4)][_0x333c48(0x195)]+_0x33b33e[_0x333c48(0x1a3)]['formInterfaces'][_0x333c48(0x195)]+_0x33b33e[_0x333c48(0x1a3)][_0x333c48(0x1e5)][_0x333c48(0x195)],_0xc6a427=_0x33b33e['counts'][_0x333c48(0x158)][_0x333c48(0x1b3)]+_0x33b33e[_0x333c48(0x1a3)]['knowledgeBases']['updated']+_0x33b33e[_0x333c48(0x1a3)][_0x333c48(0x1d1)][_0x333c48(0x1b3)]+_0x33b33e['counts'][_0x333c48(0x16a)]['updated']+_0x33b33e['counts']['integrations'][_0x333c48(0x1b3)]+_0x33b33e['counts']['experimentalKnowledgeBases'][_0x333c48(0x1b3)]+_0x33b33e[_0x333c48(0x1a3)][_0x333c48(0x1c4)][_0x333c48(0x1b3)]+_0x33b33e[_0x333c48(0x1a3)]['formInterfaces']['updated']+_0x33b33e[_0x333c48(0x1a3)][_0x333c48(0x1e5)][_0x333c48(0x1b3)],_0x50bafa=_0x33b33e['counts'][_0x333c48(0x158)][_0x333c48(0x1da)]+_0x33b33e[_0x333c48(0x1a3)]['knowledgeBases'][_0x333c48(0x1da)]+_0x33b33e[_0x333c48(0x1a3)][_0x333c48(0x1d1)][_0x333c48(0x1da)]+_0x33b33e[_0x333c48(0x1a3)][_0x333c48(0x16a)]['unchanged']+_0x33b33e[_0x333c48(0x1a3)]['integrations'][_0x333c48(0x1da)]+_0x33b33e['counts'][_0x333c48(0x1c6)][_0x333c48(0x1da)]+_0x33b33e['counts'][_0x333c48(0x1c4)][_0x333c48(0x1da)]+_0x33b33e[_0x333c48(0x1a3)][_0x333c48(0x138)]['unchanged']+_0x33b33e['counts'][_0x333c48(0x1e5)]['unchanged'];console['log']('\x0aPull\x20summary\x20for\x20\x27'+_0x33b33e['projectName']+'\x27:'),console[_0x333c48(0x182)]('\x20\x20'+a4_0x4fecd4[_0x333c48(0x135)]('+\x20'+_0x1da561+_0x333c48(0x162))+'\x20|\x20'+a4_0x4fecd4[_0x333c48(0x1df)]('~\x20'+_0xc6a427+_0x333c48(0x136))+_0x333c48(0x19a)+a4_0x4fecd4['dim']('=\x20'+_0x50bafa+_0x333c48(0x16b))),console['log'](_0x333c48(0x14c)+formatCountSummary(_0x33b33e['counts'][_0x333c48(0x158)])),console[_0x333c48(0x182)](_0x333c48(0x1e7)+formatCountSummary(_0x33b33e[_0x333c48(0x1a3)]['knowledgeBases'])),console[_0x333c48(0x182)](_0x333c48(0x194)+formatCountSummary(_0x33b33e[_0x333c48(0x1a3)][_0x333c48(0x1d1)])),console[_0x333c48(0x182)](_0x333c48(0x19b)+formatCountSummary(_0x33b33e[_0x333c48(0x1a3)]['prompts'])),console[_0x333c48(0x182)](_0x333c48(0x12e)+formatCountSummary(_0x33b33e['counts'][_0x333c48(0x15e)])),console[_0x333c48(0x182)](_0x333c48(0x1c1)+formatCountSummary(_0x33b33e['counts'][_0x333c48(0x138)])),console['log']('\x20\x20Chat\x20Interfaces:\x20'+formatCountSummary(_0x33b33e[_0x333c48(0x1a3)][_0x333c48(0x1e5)]));const _0x3c5ca2=_0x33b33e[_0x333c48(0x1a3)][_0x333c48(0x1c6)][_0x333c48(0x1e0)]>0x0||_0x33b33e[_0x333c48(0x1a3)]['experimentalArtifacts'][_0x333c48(0x1e0)]>0x0;_0x3c5ca2&&(console[_0x333c48(0x182)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x33b33e['counts'][_0x333c48(0x1c6)])),console[_0x333c48(0x182)](_0x333c48(0x148)+formatCountSummary(_0x33b33e['counts'][_0x333c48(0x1c4)])));console[_0x333c48(0x182)](_0x333c48(0x1d2)+a4_0x4fecd4[_0x333c48(0x15b)](_0x33b33e[_0x333c48(0x191)])),displayDiffs(_0x33b33e[_0x333c48(0x158)],_0x33b33e[_0x333c48(0x1b0)],_0x33b33e[_0x333c48(0x1d1)],_0x33b33e[_0x333c48(0x16a)],_0x33b33e[_0x333c48(0x15e)],_0x33b33e['experimentalKnowledgeBases'],_0x33b33e[_0x333c48(0x1c4)],_0x33b33e[_0x333c48(0x138)],_0x33b33e[_0x333c48(0x1e5)]);if(_0x29ff06)return console[_0x333c48(0x182)](a4_0x4fecd4[_0x333c48(0x1df)](_0x333c48(0x189))),0x0;if(_0x1da561===0x0&&_0xc6a427===0x0)return console[_0x333c48(0x182)](a4_0x4fecd4[_0x333c48(0x135)](_0x333c48(0x1cf))),saveSessionContext({'llm_project':_0x33b33e[_0x333c48(0x145)]},_0x2d4350['session']),console[_0x333c48(0x182)](a4_0x4fecd4[_0x333c48(0x135)](_0x333c48(0x1d4)+a4_0x4fecd4[_0x333c48(0x1c3)](_0x333c48(0x1be))+'\x20=\x20'+a4_0x4fecd4[_0x333c48(0x15b)](_0x33b33e[_0x333c48(0x145)]))),0x0;if(!_0x269c3a&&!_0x17e598){if(!isInteractive())return console[_0x333c48(0x1d9)](a4_0x4fecd4[_0x333c48(0x13f)](_0x333c48(0x1e3)),_0x333c48(0x1ad)),console['error'](a4_0x4fecd4[_0x333c48(0x1c3)](_0x333c48(0x15a))),0x1;const _0x47668e=await confirmKey('\x0aWrite\x20'+(_0x1da561+_0xc6a427)+_0x333c48(0x199));if(!_0x47668e)return console[_0x333c48(0x182)](a4_0x4fecd4['yellow'](_0x333c48(0x185)),_0x333c48(0x19d)),0x1;}const {data:_0x589906}=await withSpinner('Writing\x20files...',()=>_0x56623b[_0x333c48(0x1a6)][_0x333c48(0x178)](_0xadb0ba,_0x5e5593,{'force':_0x17e598}));return console[_0x333c48(0x182)](a4_0x4fecd4[_0x333c48(0x135)](_0x333c48(0x186)+(_0x1da561+_0xc6a427)+_0x333c48(0x153)+_0x589906[_0x333c48(0x191)])),saveSessionContext({'llm_project':_0x589906['projectName']},_0x2d4350[_0x333c48(0x170)]),console[_0x333c48(0x182)](a4_0x4fecd4[_0x333c48(0x135)]('✔\x20Context\x20set:\x20'+a4_0x4fecd4[_0x333c48(0x1c3)](_0x333c48(0x1be))+'\x20=\x20'+a4_0x4fecd4[_0x333c48(0x15b)](_0x589906[_0x333c48(0x145)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x3b9a29(0x1db)]=a4_0x3b9a29(0x137);['description']='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async['execute'](_0x4f21ff){const _0x7cee8a=a4_0x3b9a29,{options:_0x22c5f8,args:_0xccde92,tdx:_0x36a9dd}=_0x4f21ff,_0x404843=_0xccde92[0x0],_0x4ec940=_0x22c5f8[_0x7cee8a(0x1db)],_0x3cfe6c=_0x22c5f8[_0x7cee8a(0x147)],_0x181a21=_0x22c5f8[_0x7cee8a(0x17e)],_0x1418f4=_0x22c5f8[_0x7cee8a(0x14b)],_0x551ce4=_0x22c5f8[_0x7cee8a(0x17b)];let _0x3b9c68;const _0x438f35=findAgentConfigPath(process[_0x7cee8a(0x1c8)]());if(_0x404843){const _0x1ea93b=a4_0x2c330a['join'](_0x404843,_0x7cee8a(0x1b4));existsSync(_0x1ea93b)?(_0x3b9c68=_0x404843,console[_0x7cee8a(0x182)](a4_0x4fecd4[_0x7cee8a(0x1c3)](_0x7cee8a(0x15d)+_0x404843))):_0x3b9c68=_0x404843;}else{if(_0x438f35)_0x3b9c68=a4_0x2c330a[_0x7cee8a(0x13a)](_0x438f35),console[_0x7cee8a(0x182)](a4_0x4fecd4[_0x7cee8a(0x1c3)](_0x7cee8a(0x173)+_0x3b9c68));else{if(_0x551ce4){const _0x58bc06=sanitizeForFilesystem(_0x551ce4);let _0x1fe82a=_0x58bc06,_0x34fc49=a4_0x2c330a[_0x7cee8a(0x1dc)](process[_0x7cee8a(0x1c8)](),_0x7cee8a(0x158),_0x58bc06,_0x7cee8a(0x1b4));if(!existsSync(_0x34fc49)){const _0x154677=normalizeName(_0x551ce4),_0x488d88=a4_0x2c330a['join'](process[_0x7cee8a(0x1c8)](),'agents',_0x154677,_0x7cee8a(0x1b4));existsSync(_0x488d88)&&(_0x1fe82a=_0x154677,_0x34fc49=_0x488d88);}if(existsSync(_0x34fc49))_0x3b9c68=a4_0x2c330a['dirname'](_0x34fc49),console['log'](a4_0x4fecd4[_0x7cee8a(0x1c3)](_0x7cee8a(0x15d)+_0x3b9c68));else{const _0x45a3e9=_0x22c5f8[_0x7cee8a(0x131)];if(_0x45a3e9)throw new SDKError(ErrorCode[_0x7cee8a(0x17a)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x551ce4+_0x7cee8a(0x1af),undefined,{'helpText':_0x7cee8a(0x187)+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+(_0x7cee8a(0x179)+_0x551ce4+'\x0a')+(_0x7cee8a(0x1bf)+_0x1fe82a+'\x20--name\x20'+(_0x4ec940||_0x7cee8a(0x1a9))+_0x7cee8a(0x198)+_0x45a3e9)});_0x3b9c68=_0x551ce4,console[_0x7cee8a(0x182)](a4_0x4fecd4[_0x7cee8a(0x1c3)](_0x7cee8a(0x1e4)+_0x551ce4));}}}}if(!_0x3b9c68)return console[_0x7cee8a(0x182)](a4_0x4fecd4[_0x7cee8a(0x1df)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console['log'](_0x7cee8a(0x13d)),console[_0x7cee8a(0x182)]('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console[_0x7cee8a(0x182)]('\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)'),console['log'](_0x7cee8a(0x18a)),0x1;if(!_0x4ec940)throw new SDKError(ErrorCode[_0x7cee8a(0x156)],_0x7cee8a(0x13e),undefined,{'helpText':_0x7cee8a(0x18f)});if(!_0x181a21&&!_0x3cfe6c){if(!isInteractive())return console[_0x7cee8a(0x1d9)](a4_0x4fecd4[_0x7cee8a(0x13f)](_0x7cee8a(0x1e3)),_0x7cee8a(0x1ad)),console[_0x7cee8a(0x1d9)](a4_0x4fecd4[_0x7cee8a(0x1c3)](_0x7cee8a(0x15a))),0x1;const _0x402372=await confirmKey(_0x7cee8a(0x19c)+_0x3b9c68+_0x7cee8a(0x1cd)+_0x4ec940+'\x22?');if(!_0x402372)return console[_0x7cee8a(0x182)](a4_0x4fecd4[_0x7cee8a(0x1df)](_0x7cee8a(0x185))),0x1;}const {data:_0x206e2d}=await withSpinner('Cloning\x20\x22'+_0x3b9c68+_0x7cee8a(0x176)+_0x4ec940+_0x7cee8a(0x17f),()=>_0x36a9dd[_0x7cee8a(0x1a6)][_0x7cee8a(0x152)](_0x3b9c68,_0x4ec940,{'dryRun':_0x3cfe6c}));if(_0x3cfe6c){console['log'](a4_0x4fecd4[_0x7cee8a(0x1df)](_0x7cee8a(0x1d5))),console['log']('Source:\x20'+_0x206e2d[_0x7cee8a(0x150)]),console[_0x7cee8a(0x182)]('New\x20project:\x20'+_0x4ec940),console[_0x7cee8a(0x182)](_0x7cee8a(0x1e9)),console['log']('\x20\x20Agents:\x20'+_0x206e2d['counts'][_0x7cee8a(0x158)][_0x7cee8a(0x134)]),console[_0x7cee8a(0x182)](_0x7cee8a(0x1e7)+_0x206e2d[_0x7cee8a(0x1a3)][_0x7cee8a(0x1b0)][_0x7cee8a(0x134)]),console[_0x7cee8a(0x182)](_0x7cee8a(0x19b)+_0x206e2d['counts'][_0x7cee8a(0x16a)][_0x7cee8a(0x134)]),console[_0x7cee8a(0x182)](_0x7cee8a(0x1c1)+_0x206e2d['counts'][_0x7cee8a(0x138)][_0x7cee8a(0x134)]),console[_0x7cee8a(0x182)]('\x20\x20Chat\x20Interfaces:\x20'+_0x206e2d[_0x7cee8a(0x1a3)][_0x7cee8a(0x1e5)]['created']);const _0x13eb34=_0x206e2d[_0x7cee8a(0x1a3)][_0x7cee8a(0x1c6)][_0x7cee8a(0x134)]>0x0||_0x206e2d[_0x7cee8a(0x1a3)][_0x7cee8a(0x1c4)][_0x7cee8a(0x134)]>0x0;return _0x13eb34&&(console[_0x7cee8a(0x182)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+_0x206e2d['counts']['experimentalKnowledgeBases'][_0x7cee8a(0x134)]),console[_0x7cee8a(0x182)]('\x20\x20Experimental\x20Artifacts:\x20'+_0x206e2d[_0x7cee8a(0x1a3)][_0x7cee8a(0x1c4)][_0x7cee8a(0x134)])),0x0;}const _0x39d6cf=_0x206e2d['counts'][_0x7cee8a(0x158)][_0x7cee8a(0x12c)]>0x0||_0x206e2d[_0x7cee8a(0x1a3)][_0x7cee8a(0x1b0)][_0x7cee8a(0x12c)]>0x0||_0x206e2d[_0x7cee8a(0x1a3)]['prompts'][_0x7cee8a(0x12c)]>0x0||_0x206e2d['counts'][_0x7cee8a(0x138)]['errors']>0x0||_0x206e2d['counts'][_0x7cee8a(0x1e5)][_0x7cee8a(0x12c)]>0x0||_0x206e2d[_0x7cee8a(0x1a3)]['experimentalKnowledgeBases'][_0x7cee8a(0x12c)]>0x0||_0x206e2d[_0x7cee8a(0x1a3)]['experimentalArtifacts'][_0x7cee8a(0x12c)]>0x0;_0x39d6cf?console[_0x7cee8a(0x182)](a4_0x4fecd4['yellow'](_0x7cee8a(0x1a7))):console[_0x7cee8a(0x182)](a4_0x4fecd4[_0x7cee8a(0x135)](_0x7cee8a(0x1d3)));console[_0x7cee8a(0x182)](_0x7cee8a(0x144)+_0x206e2d[_0x7cee8a(0x150)]),console[_0x7cee8a(0x182)](_0x7cee8a(0x174)+_0x206e2d[_0x7cee8a(0x183)]),console[_0x7cee8a(0x182)](_0x7cee8a(0x18d)+_0x206e2d['newProjectId']),console[_0x7cee8a(0x182)](),console['log'](_0x7cee8a(0x160)),console[_0x7cee8a(0x182)](_0x7cee8a(0x14c)+formatCountSummary(_0x206e2d[_0x7cee8a(0x1a3)][_0x7cee8a(0x158)])),console[_0x7cee8a(0x182)](_0x7cee8a(0x1e7)+formatCountSummary(_0x206e2d[_0x7cee8a(0x1a3)][_0x7cee8a(0x1b0)])),console['log']('\x20\x20Prompts:\x20'+formatCountSummary(_0x206e2d[_0x7cee8a(0x1a3)][_0x7cee8a(0x16a)])),console[_0x7cee8a(0x182)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x206e2d[_0x7cee8a(0x1a3)]['integrations'])),console[_0x7cee8a(0x182)](_0x7cee8a(0x1c1)+formatCountSummary(_0x206e2d[_0x7cee8a(0x1a3)][_0x7cee8a(0x138)])),console['log']('\x20\x20Chat\x20Interfaces:\x20'+formatCountSummary(_0x206e2d['counts'][_0x7cee8a(0x1e5)]));const _0x2df3d1=_0x206e2d['counts'][_0x7cee8a(0x1c6)]['created']>0x0||_0x206e2d['counts'][_0x7cee8a(0x1c6)][_0x7cee8a(0x1b3)]>0x0||_0x206e2d[_0x7cee8a(0x1a3)][_0x7cee8a(0x1c6)][_0x7cee8a(0x1da)]>0x0||_0x206e2d[_0x7cee8a(0x1a3)][_0x7cee8a(0x1c4)][_0x7cee8a(0x134)]>0x0||_0x206e2d[_0x7cee8a(0x1a3)]['experimentalArtifacts']['updated']>0x0||_0x206e2d[_0x7cee8a(0x1a3)][_0x7cee8a(0x1c4)]['unchanged']>0x0;_0x2df3d1&&(console[_0x7cee8a(0x182)](_0x7cee8a(0x196)+formatCountSummary(_0x206e2d[_0x7cee8a(0x1a3)]['experimentalKnowledgeBases'])),console[_0x7cee8a(0x182)](_0x7cee8a(0x148)+formatCountSummary(_0x206e2d[_0x7cee8a(0x1a3)]['experimentalArtifacts'])));if(_0x39d6cf){console[_0x7cee8a(0x182)](),console[_0x7cee8a(0x182)](a4_0x4fecd4[_0x7cee8a(0x13f)](_0x7cee8a(0x168)));for(const _0x264545 of _0x206e2d['agents']){_0x264545[_0x7cee8a(0x16d)]===_0x7cee8a(0x1d9)&&console[_0x7cee8a(0x182)](a4_0x4fecd4[_0x7cee8a(0x13f)](_0x7cee8a(0x12d)+_0x264545[_0x7cee8a(0x1ba)]+_0x7cee8a(0x161)+_0x264545[_0x7cee8a(0x1d9)]));}for(const _0x3d4273 of _0x206e2d[_0x7cee8a(0x1b0)]){_0x3d4273[_0x7cee8a(0x16d)]==='error'&&console[_0x7cee8a(0x182)](a4_0x4fecd4[_0x7cee8a(0x13f)](_0x7cee8a(0x1ec)+_0x3d4273['name']+'\x22:\x20'+_0x3d4273[_0x7cee8a(0x1d9)]));}for(const _0x22fdf4 of _0x206e2d[_0x7cee8a(0x16a)]){_0x22fdf4['action']===_0x7cee8a(0x1d9)&&console[_0x7cee8a(0x182)](a4_0x4fecd4[_0x7cee8a(0x13f)](_0x7cee8a(0x142)+_0x22fdf4[_0x7cee8a(0x1db)]+_0x7cee8a(0x161)+_0x22fdf4['error']));}for(const _0x31072a of _0x206e2d[_0x7cee8a(0x15e)]){_0x31072a[_0x7cee8a(0x16d)]===_0x7cee8a(0x1d9)&&console[_0x7cee8a(0x182)](a4_0x4fecd4[_0x7cee8a(0x13f)]('\x20\x20Integration\x20\x22'+_0x31072a[_0x7cee8a(0x1db)]+_0x7cee8a(0x161)+_0x31072a['error']));}for(const _0x1fb5c4 of _0x206e2d[_0x7cee8a(0x138)]){_0x1fb5c4['action']==='error'&&console[_0x7cee8a(0x182)](a4_0x4fecd4[_0x7cee8a(0x13f)](_0x7cee8a(0x163)+_0x1fb5c4[_0x7cee8a(0x1db)]+_0x7cee8a(0x161)+_0x1fb5c4[_0x7cee8a(0x1d9)]));}for(const _0x5494d1 of _0x206e2d[_0x7cee8a(0x1e5)]){_0x5494d1[_0x7cee8a(0x16d)]===_0x7cee8a(0x1d9)&&console['log'](a4_0x4fecd4[_0x7cee8a(0x13f)](_0x7cee8a(0x1aa)+_0x5494d1[_0x7cee8a(0x1db)]+_0x7cee8a(0x161)+_0x5494d1[_0x7cee8a(0x1d9)]));}for(const _0x1e5b9c of _0x206e2d[_0x7cee8a(0x1c6)]){_0x1e5b9c['action']===_0x7cee8a(0x1d9)&&console[_0x7cee8a(0x182)](a4_0x4fecd4[_0x7cee8a(0x13f)](_0x7cee8a(0x1e1)+_0x1e5b9c['name']+_0x7cee8a(0x161)+_0x1e5b9c['error']));}for(const _0x49ed19 of _0x206e2d[_0x7cee8a(0x1c4)]){_0x49ed19['action']===_0x7cee8a(0x1d9)&&console[_0x7cee8a(0x182)](a4_0x4fecd4[_0x7cee8a(0x13f)](_0x7cee8a(0x166)+_0x49ed19[_0x7cee8a(0x1db)]+_0x7cee8a(0x161)+_0x49ed19['error']));}return 0x1;}console[_0x7cee8a(0x182)]();const _0x3c26d9=getLLMProjectUrl(_0x1418f4,_0x206e2d[_0x7cee8a(0x133)]);return console[_0x7cee8a(0x182)](_0x7cee8a(0x146)+a4_0x4fecd4['cyan'](_0x3c26d9)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x3b9a29(0x1db)]=a4_0x3b9a29(0x1d0);[a4_0x3b9a29(0x181)]=a4_0x3b9a29(0x1a1);async[a4_0x3b9a29(0x1d6)](_0x137fc6){const _0x40333a=a4_0x3b9a29,{options:_0xd129ac,args:_0x338355,tdx:_0x2fb9fa}=_0x137fc6;let _0x399017=_0x338355[0x0]||process[_0x40333a(0x1c8)]();const _0x3f2199=_0xd129ac[_0x40333a(0x147)],_0x1417a6=_0xd129ac[_0x40333a(0x1c0)],_0x5bd0ef=_0xd129ac[_0x40333a(0x17e)],_0x4c18e7=_0xd129ac['site'],_0x4bd29d=a4_0x2c330a[_0x40333a(0x1dc)](_0x399017,'agent.yml'),_0x10acbe=existsSync(_0x4bd29d);if(_0x10acbe){const {data:_0x307075}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x399017+_0x40333a(0x17f),()=>_0x2fb9fa[_0x40333a(0x1a6)]['pushAgent'](_0x399017,{'dryRun':_0x3f2199,'force':_0x1417a6}));if(_0x3f2199)return console['log'](a4_0x4fecd4['yellow'](_0x40333a(0x1d5))),console[_0x40333a(0x182)](_0x40333a(0x188)+_0x307075[_0x40333a(0x1ba)]),0x0;if(_0x307075[_0x40333a(0x16d)]===_0x40333a(0x1d9))return console[_0x40333a(0x182)](a4_0x4fecd4[_0x40333a(0x13f)]('Failed\x20to\x20push\x20agent:\x20'+_0x307075['error'])),0x1;console[_0x40333a(0x182)](a4_0x4fecd4['green'](_0x40333a(0x18c)+_0x307075[_0x40333a(0x16d)]+_0x40333a(0x1b8))),console[_0x40333a(0x182)](_0x40333a(0x141)+_0x307075['agentName']);if(_0x307075[_0x40333a(0x1cc)]&&_0x307075[_0x40333a(0x165)]){const _0x187865=getLLMAgentChatUrl(_0x4c18e7,_0x307075[_0x40333a(0x165)],_0x307075['agentId']);console[_0x40333a(0x182)](_0x40333a(0x1ea)+a4_0x4fecd4[_0x40333a(0x15b)](_0x187865));}return 0x0;}const _0x13edd0=_0xd129ac[_0x40333a(0x17b)],_0x2dbda8=resolveProjectFromContext(_0x399017,_0x13edd0);if(_0x2dbda8['found'])_0x399017=_0x2dbda8[_0x40333a(0x1b5)],_0x2dbda8[_0x40333a(0x1c5)]===_0x40333a(0x132)&&console[_0x40333a(0x182)](a4_0x4fecd4[_0x40333a(0x1c3)](_0x40333a(0x1d8)+_0x399017));else{let _0x2e935a='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x2dbda8[_0x40333a(0x140)]===_0x40333a(0x15f)&&(_0x2e935a=_0x2dbda8[_0x40333a(0x193)]+_0x40333a(0x1cb)+_0x2dbda8[_0x40333a(0x17b)]+_0x40333a(0x1d7));throw new SDKError(ErrorCode[_0x40333a(0x17a)],_0x2dbda8['reason']===_0x40333a(0x197)?_0x2dbda8[_0x40333a(0x193)]:_0x40333a(0x19f)+_0x399017,undefined,{'helpText':_0x2e935a});}const {data:_0x42f082}=await withSpinner(_0x40333a(0x1e6),()=>_0x2fb9fa['llm'][_0x40333a(0x1a4)](_0x399017,{'dryRun':!![]})),_0x560d29=_0x42f082[_0x40333a(0x1a3)][_0x40333a(0x158)][_0x40333a(0x12c)]>0x0;if(_0x560d29){console[_0x40333a(0x182)](a4_0x4fecd4['red'](_0x40333a(0x171)));for(const _0x284d70 of _0x42f082[_0x40333a(0x158)]){_0x284d70[_0x40333a(0x16d)]==='error'&&console[_0x40333a(0x182)](a4_0x4fecd4[_0x40333a(0x13f)]('\x20\x20Agent\x20\x22'+_0x284d70[_0x40333a(0x1ba)]+'\x22:\x20'+_0x284d70['error']));}return 0x1;}const _0x4f0541=_0x42f082[_0x40333a(0x1a3)][_0x40333a(0x158)][_0x40333a(0x134)]+_0x42f082[_0x40333a(0x1a3)]['knowledgeBases'][_0x40333a(0x134)]+_0x42f082['counts'][_0x40333a(0x1d1)][_0x40333a(0x134)]+_0x42f082[_0x40333a(0x1a3)][_0x40333a(0x16a)][_0x40333a(0x134)]+_0x42f082['counts'][_0x40333a(0x15e)][_0x40333a(0x134)]+_0x42f082[_0x40333a(0x1a3)][_0x40333a(0x1c6)][_0x40333a(0x134)]+_0x42f082[_0x40333a(0x1a3)][_0x40333a(0x1c4)][_0x40333a(0x134)]+_0x42f082[_0x40333a(0x1a3)][_0x40333a(0x138)][_0x40333a(0x134)]+_0x42f082[_0x40333a(0x1a3)][_0x40333a(0x1e5)][_0x40333a(0x134)],_0x134ad1=_0x42f082['counts'][_0x40333a(0x158)][_0x40333a(0x1b3)]+_0x42f082[_0x40333a(0x1a3)][_0x40333a(0x1b0)][_0x40333a(0x1b3)]+_0x42f082[_0x40333a(0x1a3)][_0x40333a(0x1d1)][_0x40333a(0x1b3)]+_0x42f082[_0x40333a(0x1a3)][_0x40333a(0x16a)][_0x40333a(0x1b3)]+_0x42f082['counts'][_0x40333a(0x15e)]['updated']+_0x42f082[_0x40333a(0x1a3)][_0x40333a(0x1c6)][_0x40333a(0x1b3)]+_0x42f082[_0x40333a(0x1a3)][_0x40333a(0x1c4)][_0x40333a(0x1b3)]+_0x42f082[_0x40333a(0x1a3)][_0x40333a(0x138)][_0x40333a(0x1b3)]+_0x42f082[_0x40333a(0x1a3)][_0x40333a(0x1e5)][_0x40333a(0x1b3)],_0x2eb056=_0x42f082[_0x40333a(0x1a3)][_0x40333a(0x158)][_0x40333a(0x1da)]+_0x42f082['counts']['knowledgeBases'][_0x40333a(0x1da)]+_0x42f082[_0x40333a(0x1a3)][_0x40333a(0x1d1)]['unchanged']+_0x42f082[_0x40333a(0x1a3)][_0x40333a(0x16a)][_0x40333a(0x1da)]+_0x42f082[_0x40333a(0x1a3)][_0x40333a(0x15e)]['unchanged']+_0x42f082[_0x40333a(0x1a3)]['experimentalKnowledgeBases'][_0x40333a(0x1da)]+_0x42f082[_0x40333a(0x1a3)][_0x40333a(0x1c4)][_0x40333a(0x1da)]+_0x42f082['counts']['formInterfaces'][_0x40333a(0x1da)]+_0x42f082[_0x40333a(0x1a3)][_0x40333a(0x1e5)][_0x40333a(0x1da)];console[_0x40333a(0x182)](_0x40333a(0x13c)+_0x42f082[_0x40333a(0x145)]+'\x27:'),console[_0x40333a(0x182)]('\x20\x20'+a4_0x4fecd4['green']('+\x20'+_0x4f0541+_0x40333a(0x162))+_0x40333a(0x19a)+a4_0x4fecd4[_0x40333a(0x1df)]('~\x20'+_0x134ad1+_0x40333a(0x136))+_0x40333a(0x19a)+a4_0x4fecd4[_0x40333a(0x1c3)]('=\x20'+_0x2eb056+_0x40333a(0x16b))),console[_0x40333a(0x182)]('\x20\x20Agents:\x20'+formatCountSummary(_0x42f082[_0x40333a(0x1a3)][_0x40333a(0x158)])),console[_0x40333a(0x182)](_0x40333a(0x1e7)+formatCountSummary(_0x42f082['counts'][_0x40333a(0x1b0)])),console[_0x40333a(0x182)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x42f082[_0x40333a(0x1a3)]['textKnowledgeBases'])),console[_0x40333a(0x182)](_0x40333a(0x19b)+formatCountSummary(_0x42f082['counts'][_0x40333a(0x16a)])),console['log'](_0x40333a(0x12e)+formatCountSummary(_0x42f082['counts']['integrations'])),console['log'](_0x40333a(0x1c1)+formatCountSummary(_0x42f082['counts']['formInterfaces'])),console[_0x40333a(0x182)](_0x40333a(0x1de)+formatCountSummary(_0x42f082['counts'][_0x40333a(0x1e5)]));const _0x46913a=_0x42f082['counts']['experimentalKnowledgeBases'][_0x40333a(0x134)]>0x0||_0x42f082[_0x40333a(0x1a3)]['experimentalKnowledgeBases'][_0x40333a(0x1b3)]>0x0||_0x42f082['counts'][_0x40333a(0x1c6)][_0x40333a(0x1da)]>0x0||_0x42f082['counts'][_0x40333a(0x1c4)][_0x40333a(0x134)]>0x0||_0x42f082[_0x40333a(0x1a3)]['experimentalArtifacts'][_0x40333a(0x1b3)]>0x0||_0x42f082['counts'][_0x40333a(0x1c4)][_0x40333a(0x1da)]>0x0;_0x46913a&&(console[_0x40333a(0x182)](_0x40333a(0x196)+formatCountSummary(_0x42f082['counts']['experimentalKnowledgeBases'])),console[_0x40333a(0x182)](_0x40333a(0x148)+formatCountSummary(_0x42f082[_0x40333a(0x1a3)][_0x40333a(0x1c4)])));console[_0x40333a(0x182)](_0x40333a(0x12f)+a4_0x4fecd4['cyan'](_0x399017)),displayDiffs(_0x42f082[_0x40333a(0x158)],_0x42f082[_0x40333a(0x1b0)],_0x42f082[_0x40333a(0x1d1)],_0x42f082[_0x40333a(0x16a)],_0x42f082[_0x40333a(0x15e)],_0x42f082[_0x40333a(0x1c6)],_0x42f082[_0x40333a(0x1c4)],_0x42f082[_0x40333a(0x138)],_0x42f082[_0x40333a(0x1e5)]);if(_0x3f2199)return console[_0x40333a(0x182)](a4_0x4fecd4[_0x40333a(0x1df)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x4f0541===0x0&&_0x134ad1===0x0){console[_0x40333a(0x182)](a4_0x4fecd4[_0x40333a(0x135)](_0x40333a(0x1e8)));const _0x372e7a=getLLMProjectUrl(_0x4c18e7,_0x42f082[_0x40333a(0x165)]);return console['log'](_0x40333a(0x146)+a4_0x4fecd4[_0x40333a(0x15b)](_0x372e7a)),0x0;}if(!_0x5bd0ef&&!_0x1417a6){if(!isInteractive())return console['error'](a4_0x4fecd4[_0x40333a(0x13f)](_0x40333a(0x1e3)),_0x40333a(0x1ad)),console[_0x40333a(0x1d9)](a4_0x4fecd4[_0x40333a(0x1c3)](_0x40333a(0x15a))),0x1;const _0x2a910a=await confirmKey(_0x40333a(0x154)+(_0x4f0541+_0x134ad1)+'\x20resources?');if(!_0x2a910a)return console[_0x40333a(0x182)](a4_0x4fecd4[_0x40333a(0x1df)](_0x40333a(0x185)),_0x40333a(0x1b7)),0x1;}const {data:_0x48fa21}=await withSpinner(_0x40333a(0x1bd),()=>_0x2fb9fa[_0x40333a(0x1a6)]['pushProject'](_0x399017,{'force':_0x1417a6})),_0x11a56e=_0x48fa21['counts'][_0x40333a(0x158)][_0x40333a(0x12c)]>0x0||_0x48fa21[_0x40333a(0x1a3)][_0x40333a(0x1b0)][_0x40333a(0x12c)]>0x0||_0x48fa21[_0x40333a(0x1a3)][_0x40333a(0x1d1)][_0x40333a(0x12c)]>0x0||_0x48fa21['counts'][_0x40333a(0x16a)]['errors']>0x0||_0x48fa21[_0x40333a(0x1a3)]['formInterfaces'][_0x40333a(0x12c)]>0x0||_0x48fa21[_0x40333a(0x1a3)][_0x40333a(0x1e5)][_0x40333a(0x12c)]>0x0;if(_0x11a56e){console[_0x40333a(0x182)](a4_0x4fecd4[_0x40333a(0x1df)](_0x40333a(0x1e2))),console['log'](),console[_0x40333a(0x182)](a4_0x4fecd4[_0x40333a(0x13f)](_0x40333a(0x168)));for(const _0x504566 of _0x48fa21[_0x40333a(0x158)]){_0x504566['action']===_0x40333a(0x1d9)&&console['log'](a4_0x4fecd4['red']('\x20\x20Agent\x20\x22'+_0x504566[_0x40333a(0x1ba)]+_0x40333a(0x161)+_0x504566[_0x40333a(0x1d9)]));}for(const _0x3e065e of _0x48fa21[_0x40333a(0x1b0)]){_0x3e065e[_0x40333a(0x16d)]===_0x40333a(0x1d9)&&console[_0x40333a(0x182)](a4_0x4fecd4[_0x40333a(0x13f)](_0x40333a(0x1ec)+_0x3e065e[_0x40333a(0x1db)]+_0x40333a(0x161)+_0x3e065e[_0x40333a(0x1d9)]));}for(const _0x59c19c of _0x48fa21['textKnowledgeBases']){_0x59c19c[_0x40333a(0x16d)]===_0x40333a(0x1d9)&&console[_0x40333a(0x182)](a4_0x4fecd4[_0x40333a(0x13f)](_0x40333a(0x172)+_0x59c19c['name']+_0x40333a(0x161)+_0x59c19c[_0x40333a(0x1d9)]));}for(const _0x2ce5ea of _0x48fa21[_0x40333a(0x16a)]){_0x2ce5ea[_0x40333a(0x16d)]===_0x40333a(0x1d9)&&console[_0x40333a(0x182)](a4_0x4fecd4[_0x40333a(0x13f)](_0x40333a(0x142)+_0x2ce5ea['name']+'\x22:\x20'+_0x2ce5ea['error']));}for(const _0x1aaa5e of _0x48fa21[_0x40333a(0x15e)]){_0x1aaa5e[_0x40333a(0x16d)]===_0x40333a(0x1d9)&&console['log'](a4_0x4fecd4[_0x40333a(0x13f)](_0x40333a(0x177)+_0x1aaa5e['name']+'\x22:\x20'+_0x1aaa5e[_0x40333a(0x1d9)]));}for(const _0x2abb06 of _0x48fa21[_0x40333a(0x138)]){_0x2abb06[_0x40333a(0x16d)]===_0x40333a(0x1d9)&&console[_0x40333a(0x182)](a4_0x4fecd4[_0x40333a(0x13f)](_0x40333a(0x163)+_0x2abb06[_0x40333a(0x1db)]+'\x22:\x20'+_0x2abb06[_0x40333a(0x1d9)]));}for(const _0x529106 of _0x48fa21[_0x40333a(0x1e5)]){_0x529106[_0x40333a(0x16d)]===_0x40333a(0x1d9)&&console['log'](a4_0x4fecd4[_0x40333a(0x13f)](_0x40333a(0x1aa)+_0x529106[_0x40333a(0x1db)]+_0x40333a(0x161)+_0x529106[_0x40333a(0x1d9)]));}return 0x1;}console['log'](a4_0x4fecd4[_0x40333a(0x135)](_0x40333a(0x1ed)+(_0x4f0541+_0x134ad1)+_0x40333a(0x14a)+_0x48fa21['projectName']+'\x27'));const _0x529d42=getLLMProjectUrl(_0x4c18e7,_0x48fa21[_0x40333a(0x165)]);return console[_0x40333a(0x182)]('Project:\x20'+a4_0x4fecd4[_0x40333a(0x15b)](_0x529d42)),0x0;}}
|
|
1
|
+
const a4_0x128688=a4_0xe8fa;(function(_0xc7e1a8,_0xff29bb){const _0x36b54d=a4_0xe8fa,_0x5c01b7=_0xc7e1a8();while(!![]){try{const _0xbaa4a2=-parseInt(_0x36b54d(0x232))/0x1*(-parseInt(_0x36b54d(0x22b))/0x2)+-parseInt(_0x36b54d(0x1b8))/0x3*(-parseInt(_0x36b54d(0x22c))/0x4)+-parseInt(_0x36b54d(0x1e1))/0x5+-parseInt(_0x36b54d(0x1f8))/0x6+parseInt(_0x36b54d(0x1e5))/0x7+-parseInt(_0x36b54d(0x1fa))/0x8*(parseInt(_0x36b54d(0x1b4))/0x9)+parseInt(_0x36b54d(0x1fd))/0xa;if(_0xbaa4a2===_0xff29bb)break;else _0x5c01b7['push'](_0x5c01b7['shift']());}catch(_0x1cb2ed){_0x5c01b7['push'](_0x5c01b7['shift']());}}}(a4_0x3fa1,0x1ff2b));import a4_0x3ab4a1 from'chalk';import a4_0x18183f 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';function a4_0x3fa1(){const _0x3f8017=['message','1208430QYdMiy','\x0aChanges\x20to\x20integration\x20\x27','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\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','1783019wOIPsS','site','Errors:','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\x20\x20Form\x20Interfaces:\x20','repeat','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x0a✔\x20Pulled\x20','\x0aChanges:','parse','profile','pullProject','source','\x20|\x20','agents','Summary:','\x20\x20Integrations:\x20','projectDir','Cloning\x20\x22','826584ZspBFo','errors','432616SDKPys','\x20\x20tdx\x20agent\x20pull\x20','projectName','1162580LQTwZZ','Agent\x20','\x20unchanged','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Failed\x20to\x20push\x20agent:\x20','\x0aProject\x20pushed\x20with\x20errors','cwd-config','outputPath','Using\x20project\x20from\x20','textKnowledgeBases','INVALID_ARGUMENT','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','Output:\x20','MISSING_ARGUMENT','newProjectId','red','\x0a✔\x20Pushed\x20','utf-8','llmProject','newProjectName','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)','join','action','gray','push','integrations','Output\x20path:\x20','\x0aChanges\x20to\x20prompt\x20\x27','\x20\x20Source:\x20','llm','Cancelled','Dry\x20run\x20-\x20no\x20files\x20written','updated','\x20\x20Knowledge\x20Bases:\x20','-\x20nothing\x20pushed','llm_project','Cannot\x20clone\x20from\x20context\x20project\x20\x22','session','\x0aError:','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x20created','unchanged','Pulling\x20agent\x20\x22','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','5470tPVftH','390744CDrmrO','\x0aChanges\x20to\x20chat\x20interface\x20\x27','tdx.json','total','agent','Project:\x20','35eLtcMv','Project\x20cloned\x20successfully','counts','\x20\x20Experimental\x20Artifacts:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','\x22:\x20','new','no_local_folder','diff','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x20total','output','Writing\x20files...','dim','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','description','arg-dir','\x20=\x20','agent:pull','\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','\x0aWrite\x20','force','knowledgeBases','Analyzing\x20changes\x20to\x20push...','Clone\x20\x22','\x20\x20Form\x20Interface\x20\x22','\x20\x20Integration\x20\x22','projectId','\x20new','Pushing\x20to\x20project...','\x20successfully','outputDir','pushProject','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','name','Agent\x20pulled\x20successfully','Dry\x20run\x20-\x20no\x20changes\x20made','experimentalKnowledgeBases','chatInterfaces','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x20--profile\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','New\x20project\x20name\x20is\x20required','Would\x20clone:','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','Would\x20pull\x20agent:\x20','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','dryRun','\x0aPush\x20','\x0aChanges\x20to\x20form\x20interface\x20\x27','error','Chat:\x20','prompts','created','yes','sourceProjectName','\x0aPush\x20summary\x20for\x20\x27','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','Using\x20local\x20project:\x20','agent:clone','Pushing\x20agent\x20from\x20\x22','\x20changed','\x20\x20Knowledge\x20Base\x20\x22','no_context','9gbDcks','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','log','cyan','3ZDdacO','dirname','isNew','green','\x20\x20Agent\x20\x22','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)','Analyzing\x20project\x20\x22','\x20\x20Text\x20Knowledge\x20Bases:\x20','pushAgent','\x20\x20Chat\x20Interfaces:\x20','Using\x20project:\x20','agentName','experimentalArtifacts','\x20\x20Chat\x20Interface\x20\x22','\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','\x20\x20Prompts:\x20','\x0aChanges\x20to\x20agent\x20\x27','\x22...','agent.yml','agentId','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','execute','cwd','\x20\x20tdx\x20agent\x20clone\x20agents/','Status:\x20','\x20\x20Prompt\x20\x22','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','<new-name>','formInterfaces','\x20files\x20to\x20','\x20\x20Agents:\x20','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','\x20resources?','✔\x20Context\x20set:\x20','New\x20project:\x20','yellow','cloneProject','Source:\x20','found','context'];a4_0x3fa1=function(){return _0x3f8017;};return a4_0x3fa1();}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(_0x46e5a7){const _0x89bd7d=a4_0xe8fa,_0x3145d9=[];if(_0x46e5a7[_0x89bd7d(0x22f)]!==undefined)_0x3145d9[_0x89bd7d(0x217)](_0x46e5a7[_0x89bd7d(0x22f)]+_0x89bd7d(0x17e));if(_0x46e5a7['new']!==undefined&&_0x46e5a7['new']>0x0)_0x3145d9['push'](a4_0x3ab4a1[_0x89bd7d(0x1bb)](_0x46e5a7[_0x89bd7d(0x17a)]+'\x20new'));if(_0x46e5a7['created']!==undefined&&_0x46e5a7['created']>0x0)_0x3145d9['push'](a4_0x3ab4a1[_0x89bd7d(0x1bb)](_0x46e5a7[_0x89bd7d(0x1a9)]+_0x89bd7d(0x227)));if(_0x46e5a7['updated']!==undefined&&_0x46e5a7[_0x89bd7d(0x21f)]>0x0)_0x3145d9['push'](a4_0x3ab4a1[_0x89bd7d(0x1db)](_0x46e5a7[_0x89bd7d(0x21f)]+'\x20updated'));if(_0x46e5a7[_0x89bd7d(0x228)]!==undefined&&_0x46e5a7['unchanged']>0x0)_0x3145d9['push'](a4_0x3ab4a1[_0x89bd7d(0x216)](_0x46e5a7[_0x89bd7d(0x228)]+_0x89bd7d(0x1ff)));if(_0x46e5a7[_0x89bd7d(0x1f9)]!==undefined&&_0x46e5a7[_0x89bd7d(0x1f9)]>0x0)_0x3145d9[_0x89bd7d(0x217)](a4_0x3ab4a1[_0x89bd7d(0x20c)](_0x46e5a7[_0x89bd7d(0x1f9)]+'\x20errors'));return _0x3145d9[_0x89bd7d(0x214)](',\x20');}function a4_0xe8fa(_0x209b83,_0x17e6e6){_0x209b83=_0x209b83-0x178;const _0x3fa168=a4_0x3fa1();let _0xe8faea=_0x3fa168[_0x209b83];return _0xe8faea;}function displayDiffs(_0x1fafbb,_0x4d5699,_0x1d5326,_0x45b7b2,_0x5c46ad,_0x49df83,_0x24db2a,_0x56ff81,_0x25056f){const _0x2928fa=a4_0xe8fa;for(const _0x4d1d5f of _0x1fafbb){if(_0x4d1d5f['diff']){const _0x15a2f4=_0x4d1d5f['agentName']||_0x4d1d5f[_0x2928fa(0x196)];console[_0x2928fa(0x1b6)](_0x2928fa(0x1c8)+_0x15a2f4+'\x27:'),console[_0x2928fa(0x1b6)]('─'[_0x2928fa(0x1ea)](0x3c)),console[_0x2928fa(0x1b6)](_0x4d1d5f[_0x2928fa(0x17c)]),console[_0x2928fa(0x1b6)]('─'[_0x2928fa(0x1ea)](0x3c));}}for(const _0x485c9d of _0x4d5699){_0x485c9d[_0x2928fa(0x17c)]&&(console['log'](_0x2928fa(0x226)+_0x485c9d[_0x2928fa(0x196)]+'\x27:'),console[_0x2928fa(0x1b6)]('─'[_0x2928fa(0x1ea)](0x3c)),console[_0x2928fa(0x1b6)](_0x485c9d[_0x2928fa(0x17c)]),console['log']('─'['repeat'](0x3c)));}for(const _0xea3c57 of _0x1d5326){_0xea3c57[_0x2928fa(0x17c)]&&(console[_0x2928fa(0x1b6)](_0x2928fa(0x17d)+_0xea3c57[_0x2928fa(0x196)]+'\x27:'),console[_0x2928fa(0x1b6)]('─'['repeat'](0x3c)),console['log'](_0xea3c57[_0x2928fa(0x17c)]),console[_0x2928fa(0x1b6)]('─'['repeat'](0x3c)));}for(const _0x5e8336 of _0x45b7b2){_0x5e8336[_0x2928fa(0x17c)]&&(console[_0x2928fa(0x1b6)](_0x2928fa(0x21a)+_0x5e8336[_0x2928fa(0x196)]+'\x27:'),console[_0x2928fa(0x1b6)]('─'['repeat'](0x3c)),console[_0x2928fa(0x1b6)](_0x5e8336['diff']),console[_0x2928fa(0x1b6)]('─'['repeat'](0x3c)));}for(const _0x38d3a4 of _0x5c46ad){_0x38d3a4[_0x2928fa(0x17c)]&&(console[_0x2928fa(0x1b6)](_0x2928fa(0x1e2)+_0x38d3a4[_0x2928fa(0x196)]+'\x27:'),console['log']('─'[_0x2928fa(0x1ea)](0x3c)),console['log'](_0x38d3a4[_0x2928fa(0x17c)]),console[_0x2928fa(0x1b6)]('─'[_0x2928fa(0x1ea)](0x3c)));}for(const _0x19262d of _0x49df83){_0x19262d[_0x2928fa(0x17c)]&&(console[_0x2928fa(0x1b6)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x19262d['name']+'\x27:'),console[_0x2928fa(0x1b6)]('─'[_0x2928fa(0x1ea)](0x3c)),console[_0x2928fa(0x1b6)](_0x19262d['diff']),console[_0x2928fa(0x1b6)]('─'[_0x2928fa(0x1ea)](0x3c)));}for(const _0x40c482 of _0x24db2a){_0x40c482['diff']&&(console[_0x2928fa(0x1b6)](_0x2928fa(0x208)+_0x40c482[_0x2928fa(0x196)]+'\x27:'),console[_0x2928fa(0x1b6)]('─'[_0x2928fa(0x1ea)](0x3c)),console[_0x2928fa(0x1b6)](_0x40c482['diff']),console['log']('─'[_0x2928fa(0x1ea)](0x3c)));}for(const _0x2ee77e of _0x56ff81){_0x2ee77e[_0x2928fa(0x17c)]&&(console[_0x2928fa(0x1b6)](_0x2928fa(0x1a5)+_0x2ee77e[_0x2928fa(0x196)]+'\x27:'),console[_0x2928fa(0x1b6)]('─'[_0x2928fa(0x1ea)](0x3c)),console[_0x2928fa(0x1b6)](_0x2ee77e[_0x2928fa(0x17c)]),console[_0x2928fa(0x1b6)]('─'[_0x2928fa(0x1ea)](0x3c)));}for(const _0x3a8b36 of _0x25056f){_0x3a8b36[_0x2928fa(0x17c)]&&(console['log'](_0x2928fa(0x22d)+_0x3a8b36[_0x2928fa(0x196)]+'\x27:'),console[_0x2928fa(0x1b6)]('─'[_0x2928fa(0x1ea)](0x3c)),console[_0x2928fa(0x1b6)](_0x3a8b36[_0x2928fa(0x17c)]),console[_0x2928fa(0x1b6)]('─'[_0x2928fa(0x1ea)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']=a4_0x128688(0x186);[a4_0x128688(0x183)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x128688(0x1cd)](_0x328e61){const _0x3a28ce=a4_0x128688,{options:_0x3e75df,args:_0x244f97,tdx:_0x4aa8f2}=_0x328e61,_0x3730ea=_0x244f97[0x0],_0x58c72d=_0x244f97[0x1],_0x207b56=_0x3e75df[_0x3a28ce(0x17f)],_0x2270a1=_0x3e75df[_0x3a28ce(0x1a3)],_0x546f42=_0x3e75df[_0x3a28ce(0x189)],_0x5e365a=_0x3e75df[_0x3a28ce(0x1aa)],_0x2738e9=_0x3e75df[_0x3a28ce(0x20f)],_0x24b761=_0x3e75df[_0x3a28ce(0x230)];let _0x2f1c1f;if(_0x3730ea){const _0x2189e=a4_0x18183f[_0x3a28ce(0x214)](_0x3730ea,_0x3a28ce(0x22e));if(existsSync(_0x2189e))try{const _0x4d1910=JSON['parse'](readFileSync(_0x2189e,_0x3a28ce(0x20e)));_0x4d1910['llm_project']&&(_0x2f1c1f={'llm_project':_0x4d1910[_0x3a28ce(0x222)]});}catch{}}const _0x11c127=findAgentConfigPath(process['cwd']());let _0x131402;if(_0x11c127)try{const _0x19fd80=JSON[_0x3a28ce(0x1ee)](readFileSync(_0x11c127,_0x3a28ce(0x20e)));_0x19fd80[_0x3a28ce(0x222)]&&(_0x131402={'llm_project':_0x19fd80[_0x3a28ce(0x222)]});}catch{}const _0x583354=resolveAgentPullArgs({'arg':_0x3730ea,'agentNameArg':_0x58c72d,'agentFlag':_0x24b761,'contextProject':_0x2738e9,'argDirConfig':_0x2f1c1f,'cwdConfigPath':_0x11c127||undefined,'cwdConfig':_0x131402}),{projectNameOrId:_0x3ac41f,targetAgentName:_0x477a33,existingOutputDir:_0x271ae9,source:_0x988758}=_0x583354;if(_0x988758===_0x3a28ce(0x184))console[_0x3a28ce(0x1b6)](a4_0x3ab4a1[_0x3a28ce(0x181)](_0x3a28ce(0x205)+a4_0x18183f['join'](_0x3730ea,'tdx.json')+':\x20'+_0x3ac41f));else{if(_0x988758===_0x3a28ce(0x203))console[_0x3a28ce(0x1b6)](a4_0x3ab4a1['dim'](_0x3a28ce(0x1c2)+_0x3ac41f));else _0x988758===_0x3a28ce(0x1df)&&console[_0x3a28ce(0x1b6)](a4_0x3ab4a1[_0x3a28ce(0x181)]('Using\x20project\x20from\x20context:\x20'+_0x3ac41f));}if(!_0x3ac41f)return _0x24b761?(console[_0x3a28ce(0x1b6)](a4_0x3ab4a1[_0x3a28ce(0x1db)](_0x3a28ce(0x1d7))),console['log'](_0x3a28ce(0x22a)),console['log'](_0x3a28ce(0x1d2))):(console[_0x3a28ce(0x1b6)](a4_0x3ab4a1[_0x3a28ce(0x1db)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console['log'](_0x3a28ce(0x1bd)),console[_0x3a28ce(0x1b6)](_0x3a28ce(0x178)),console[_0x3a28ce(0x1b6)](_0x3a28ce(0x1c6)),console[_0x3a28ce(0x1b6)](_0x3a28ce(0x1e4)),console[_0x3a28ce(0x1b6)](_0x3a28ce(0x187))),0x1;if(_0x477a33){const {data:_0x254cda}=await withSpinner(_0x3a28ce(0x229)+_0x477a33+'\x22\x20from\x20project\x20\x22'+_0x3ac41f+_0x3a28ce(0x1c9),()=>_0x4aa8f2[_0x3a28ce(0x21c)]['pullAgent'](_0x3ac41f,_0x477a33,_0x207b56,{'dryRun':_0x2270a1,'force':_0x546f42}));if(_0x2270a1)return console[_0x3a28ce(0x1b6)](a4_0x3ab4a1[_0x3a28ce(0x1db)](_0x3a28ce(0x21e))),console[_0x3a28ce(0x1b6)](_0x3a28ce(0x1a1)+_0x254cda['agentName']),console[_0x3a28ce(0x1b6)](_0x3a28ce(0x219)+_0x254cda[_0x3a28ce(0x204)]),_0x254cda[_0x3a28ce(0x17c)]&&(console['log'](_0x3a28ce(0x1ed)),console[_0x3a28ce(0x1b6)]('─'[_0x3a28ce(0x1ea)](0x3c)),console['log'](_0x254cda[_0x3a28ce(0x17c)]),console[_0x3a28ce(0x1b6)]('─'[_0x3a28ce(0x1ea)](0x3c))),0x0;return console[_0x3a28ce(0x1b6)](a4_0x3ab4a1[_0x3a28ce(0x1bb)](_0x3a28ce(0x197))),console['log']('Agent:\x20'+_0x254cda[_0x3a28ce(0x1c3)]),console[_0x3a28ce(0x1b6)](_0x3a28ce(0x209)+_0x254cda[_0x3a28ce(0x204)]),console[_0x3a28ce(0x1b6)](_0x3a28ce(0x1d0)+(_0x254cda[_0x3a28ce(0x1ba)]?a4_0x3ab4a1[_0x3a28ce(0x1bb)]('new'):_0x254cda['hasChanges']?a4_0x3ab4a1[_0x3a28ce(0x1db)]('updated'):a4_0x3ab4a1[_0x3a28ce(0x216)](_0x3a28ce(0x228)))),0x0;}const _0xc64bdf=_0x271ae9||_0x207b56,{data:_0x4b9239}=await withSpinner(_0x3a28ce(0x1be)+_0x3ac41f+_0x3a28ce(0x1c9),()=>_0x4aa8f2[_0x3a28ce(0x21c)][_0x3a28ce(0x1f0)](_0x3ac41f,_0xc64bdf,{'dryRun':!![]})),_0xdedb22=_0x4b9239['counts']['agents']['new']+_0x4b9239[_0x3a28ce(0x234)][_0x3a28ce(0x18a)][_0x3a28ce(0x17a)]+_0x4b9239[_0x3a28ce(0x234)][_0x3a28ce(0x206)][_0x3a28ce(0x17a)]+_0x4b9239[_0x3a28ce(0x234)][_0x3a28ce(0x1a8)][_0x3a28ce(0x17a)]+_0x4b9239['counts']['integrations']['new']+_0x4b9239[_0x3a28ce(0x234)][_0x3a28ce(0x199)]['new']+_0x4b9239[_0x3a28ce(0x234)][_0x3a28ce(0x1c4)]['new']+_0x4b9239[_0x3a28ce(0x234)]['formInterfaces'][_0x3a28ce(0x17a)]+_0x4b9239[_0x3a28ce(0x234)][_0x3a28ce(0x19a)][_0x3a28ce(0x17a)],_0x2866c1=_0x4b9239[_0x3a28ce(0x234)]['agents'][_0x3a28ce(0x21f)]+_0x4b9239[_0x3a28ce(0x234)][_0x3a28ce(0x18a)]['updated']+_0x4b9239['counts'][_0x3a28ce(0x206)][_0x3a28ce(0x21f)]+_0x4b9239[_0x3a28ce(0x234)][_0x3a28ce(0x1a8)][_0x3a28ce(0x21f)]+_0x4b9239[_0x3a28ce(0x234)][_0x3a28ce(0x218)][_0x3a28ce(0x21f)]+_0x4b9239[_0x3a28ce(0x234)][_0x3a28ce(0x199)]['updated']+_0x4b9239[_0x3a28ce(0x234)][_0x3a28ce(0x1c4)][_0x3a28ce(0x21f)]+_0x4b9239[_0x3a28ce(0x234)]['formInterfaces']['updated']+_0x4b9239[_0x3a28ce(0x234)][_0x3a28ce(0x19a)]['updated'],_0x41af55=_0x4b9239[_0x3a28ce(0x234)][_0x3a28ce(0x1f3)][_0x3a28ce(0x228)]+_0x4b9239[_0x3a28ce(0x234)]['knowledgeBases'][_0x3a28ce(0x228)]+_0x4b9239[_0x3a28ce(0x234)][_0x3a28ce(0x206)][_0x3a28ce(0x228)]+_0x4b9239['counts'][_0x3a28ce(0x1a8)][_0x3a28ce(0x228)]+_0x4b9239['counts'][_0x3a28ce(0x218)][_0x3a28ce(0x228)]+_0x4b9239['counts'][_0x3a28ce(0x199)][_0x3a28ce(0x228)]+_0x4b9239[_0x3a28ce(0x234)][_0x3a28ce(0x1c4)][_0x3a28ce(0x228)]+_0x4b9239[_0x3a28ce(0x234)][_0x3a28ce(0x1d4)][_0x3a28ce(0x228)]+_0x4b9239[_0x3a28ce(0x234)][_0x3a28ce(0x19a)][_0x3a28ce(0x228)];console[_0x3a28ce(0x1b6)]('\x0aPull\x20summary\x20for\x20\x27'+_0x4b9239[_0x3a28ce(0x1fc)]+'\x27:'),console[_0x3a28ce(0x1b6)]('\x20\x20'+a4_0x3ab4a1[_0x3a28ce(0x1bb)]('+\x20'+_0xdedb22+'\x20new')+_0x3a28ce(0x1f2)+a4_0x3ab4a1[_0x3a28ce(0x1db)]('~\x20'+_0x2866c1+_0x3a28ce(0x1b1))+_0x3a28ce(0x1f2)+a4_0x3ab4a1[_0x3a28ce(0x181)]('=\x20'+_0x41af55+'\x20unchanged')),console[_0x3a28ce(0x1b6)]('\x20\x20Agents:\x20'+formatCountSummary(_0x4b9239[_0x3a28ce(0x234)]['agents'])),console['log'](_0x3a28ce(0x220)+formatCountSummary(_0x4b9239[_0x3a28ce(0x234)][_0x3a28ce(0x18a)])),console[_0x3a28ce(0x1b6)](_0x3a28ce(0x1bf)+formatCountSummary(_0x4b9239['counts'][_0x3a28ce(0x206)])),console['log'](_0x3a28ce(0x1c7)+formatCountSummary(_0x4b9239[_0x3a28ce(0x234)]['prompts'])),console['log'](_0x3a28ce(0x1f5)+formatCountSummary(_0x4b9239['counts'][_0x3a28ce(0x218)])),console['log'](_0x3a28ce(0x1e9)+formatCountSummary(_0x4b9239[_0x3a28ce(0x234)][_0x3a28ce(0x1d4)])),console[_0x3a28ce(0x1b6)](_0x3a28ce(0x1c1)+formatCountSummary(_0x4b9239['counts'][_0x3a28ce(0x19a)]));const _0x51f31d=_0x4b9239[_0x3a28ce(0x234)]['experimentalKnowledgeBases'][_0x3a28ce(0x22f)]>0x0||_0x4b9239[_0x3a28ce(0x234)][_0x3a28ce(0x1c4)][_0x3a28ce(0x22f)]>0x0;_0x51f31d&&(console[_0x3a28ce(0x1b6)](_0x3a28ce(0x195)+formatCountSummary(_0x4b9239['counts'][_0x3a28ce(0x199)])),console[_0x3a28ce(0x1b6)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x4b9239[_0x3a28ce(0x234)][_0x3a28ce(0x1c4)])));console['log']('\x20\x20Target:\x20'+a4_0x3ab4a1[_0x3a28ce(0x1b7)](_0x4b9239[_0x3a28ce(0x193)])),displayDiffs(_0x4b9239[_0x3a28ce(0x1f3)],_0x4b9239[_0x3a28ce(0x18a)],_0x4b9239[_0x3a28ce(0x206)],_0x4b9239[_0x3a28ce(0x1a8)],_0x4b9239[_0x3a28ce(0x218)],_0x4b9239[_0x3a28ce(0x199)],_0x4b9239[_0x3a28ce(0x1c4)],_0x4b9239[_0x3a28ce(0x1d4)],_0x4b9239['chatInterfaces']);if(_0x2270a1)return console[_0x3a28ce(0x1b6)](a4_0x3ab4a1['yellow'](_0x3a28ce(0x19d))),0x0;if(_0xdedb22===0x0&&_0x2866c1===0x0)return console[_0x3a28ce(0x1b6)](a4_0x3ab4a1[_0x3a28ce(0x1bb)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x4b9239['projectName']},_0x3e75df['session']),console['log'](a4_0x3ab4a1[_0x3a28ce(0x1bb)](_0x3a28ce(0x1d9)+a4_0x3ab4a1[_0x3a28ce(0x181)]('llm_project')+_0x3a28ce(0x185)+a4_0x3ab4a1[_0x3a28ce(0x1b7)](_0x4b9239[_0x3a28ce(0x1fc)]))),0x0;if(!_0x5e365a&&!_0x546f42){if(!isInteractive())return console[_0x3a28ce(0x1a6)](a4_0x3ab4a1[_0x3a28ce(0x20c)](_0x3a28ce(0x225)),_0x3a28ce(0x200)),console[_0x3a28ce(0x1a6)](a4_0x3ab4a1[_0x3a28ce(0x181)](_0x3a28ce(0x1e3))),0x1;const _0x4d5736=await confirmKey(_0x3a28ce(0x188)+(_0xdedb22+_0x2866c1)+'\x20files?');if(!_0x4d5736)return console['log'](a4_0x3ab4a1[_0x3a28ce(0x1db)](_0x3a28ce(0x21d)),'-\x20no\x20files\x20written'),0x1;}const {data:_0x346207}=await withSpinner(_0x3a28ce(0x180),()=>_0x4aa8f2[_0x3a28ce(0x21c)][_0x3a28ce(0x1f0)](_0x3ac41f,_0xc64bdf,{'force':_0x546f42}));return console[_0x3a28ce(0x1b6)](a4_0x3ab4a1['green'](_0x3a28ce(0x1ec)+(_0xdedb22+_0x2866c1)+_0x3a28ce(0x1d5)+_0x346207[_0x3a28ce(0x193)])),saveSessionContext({'llm_project':_0x346207[_0x3a28ce(0x1fc)]},_0x3e75df[_0x3a28ce(0x224)]),console[_0x3a28ce(0x1b6)](a4_0x3ab4a1[_0x3a28ce(0x1bb)]('✔\x20Context\x20set:\x20'+a4_0x3ab4a1[_0x3a28ce(0x181)](_0x3a28ce(0x222))+'\x20=\x20'+a4_0x3ab4a1['cyan'](_0x346207[_0x3a28ce(0x1fc)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x128688(0x196)]=a4_0x128688(0x1af);[a4_0x128688(0x183)]=a4_0x128688(0x1eb);async[a4_0x128688(0x1cd)](_0x44158a){const _0x433d43=a4_0x128688,{options:_0x5efbaf,args:_0x1cc6c4,tdx:_0xdaeeb6}=_0x44158a,_0x1b4ef0=_0x1cc6c4[0x0],_0x55009f=_0x5efbaf[_0x433d43(0x196)],_0x2eddc3=_0x5efbaf[_0x433d43(0x1a3)],_0x27476f=_0x5efbaf[_0x433d43(0x1aa)],_0x23776f=_0x5efbaf[_0x433d43(0x1e6)],_0x24a779=_0x5efbaf[_0x433d43(0x20f)];let _0x5a62aa;const _0x38d6ef=findAgentConfigPath(process[_0x433d43(0x1ce)]());if(_0x1b4ef0){const _0x5ad7f9=a4_0x18183f[_0x433d43(0x214)](_0x1b4ef0,_0x433d43(0x22e));existsSync(_0x5ad7f9)?(_0x5a62aa=_0x1b4ef0,console[_0x433d43(0x1b6)](a4_0x3ab4a1[_0x433d43(0x181)](_0x433d43(0x1ae)+_0x1b4ef0))):_0x5a62aa=_0x1b4ef0;}else{if(_0x38d6ef)_0x5a62aa=a4_0x18183f[_0x433d43(0x1b9)](_0x38d6ef),console[_0x433d43(0x1b6)](a4_0x3ab4a1[_0x433d43(0x181)]('Using\x20current\x20project:\x20'+_0x5a62aa));else{if(_0x24a779){const _0x74a64=sanitizeForFilesystem(_0x24a779);let _0x5c7ad8=_0x74a64,_0x1dd5ad=a4_0x18183f[_0x433d43(0x214)](process[_0x433d43(0x1ce)](),_0x433d43(0x1f3),_0x74a64,'tdx.json');if(!existsSync(_0x1dd5ad)){const _0x16bb4b=normalizeName(_0x24a779),_0x5609dc=a4_0x18183f[_0x433d43(0x214)](process[_0x433d43(0x1ce)](),_0x433d43(0x1f3),_0x16bb4b,'tdx.json');existsSync(_0x5609dc)&&(_0x5c7ad8=_0x16bb4b,_0x1dd5ad=_0x5609dc);}if(existsSync(_0x1dd5ad))_0x5a62aa=a4_0x18183f[_0x433d43(0x1b9)](_0x1dd5ad),console['log'](a4_0x3ab4a1[_0x433d43(0x181)]('Using\x20local\x20project:\x20'+_0x5a62aa));else{const _0x557967=_0x5efbaf[_0x433d43(0x1ef)];if(_0x557967)throw new SDKError(ErrorCode[_0x433d43(0x207)],_0x433d43(0x223)+_0x24a779+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x433d43(0x1b5)+_0x433d43(0x1a0)+(_0x433d43(0x1fb)+_0x24a779+'\x0a')+(_0x433d43(0x1cf)+_0x5c7ad8+'\x20--name\x20'+(_0x55009f||_0x433d43(0x1d3))+_0x433d43(0x19c)+_0x557967)});_0x5a62aa=_0x24a779,console[_0x433d43(0x1b6)](a4_0x3ab4a1[_0x433d43(0x181)]('Using\x20context\x20project:\x20'+_0x24a779));}}}}if(!_0x5a62aa)return console[_0x433d43(0x1b6)](a4_0x3ab4a1[_0x433d43(0x1db)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x433d43(0x1b6)]('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console[_0x433d43(0x1b6)](_0x433d43(0x1a2)),console[_0x433d43(0x1b6)](_0x433d43(0x213)),console[_0x433d43(0x1b6)](_0x433d43(0x1cc)),0x1;if(!_0x55009f)throw new SDKError(ErrorCode[_0x433d43(0x20a)],_0x433d43(0x19e),undefined,{'helpText':_0x433d43(0x182)});if(!_0x27476f&&!_0x2eddc3){if(!isInteractive())return console[_0x433d43(0x1a6)](a4_0x3ab4a1['red']('\x0aError:'),_0x433d43(0x200)),console[_0x433d43(0x1a6)](a4_0x3ab4a1[_0x433d43(0x181)](_0x433d43(0x1e3))),0x1;const _0x2e0481=await confirmKey(_0x433d43(0x18c)+_0x5a62aa+'\x22\x20to\x20new\x20project\x20\x22'+_0x55009f+'\x22?');if(!_0x2e0481)return console[_0x433d43(0x1b6)](a4_0x3ab4a1[_0x433d43(0x1db)](_0x433d43(0x21d))),0x1;}const {data:_0x56a961}=await withSpinner(_0x433d43(0x1f7)+_0x5a62aa+'\x22\x20to\x20\x22'+_0x55009f+_0x433d43(0x1c9),()=>_0xdaeeb6[_0x433d43(0x21c)][_0x433d43(0x1dc)](_0x5a62aa,_0x55009f,{'dryRun':_0x2eddc3}));if(_0x2eddc3){console[_0x433d43(0x1b6)](a4_0x3ab4a1[_0x433d43(0x1db)](_0x433d43(0x198))),console[_0x433d43(0x1b6)](_0x433d43(0x1dd)+_0x56a961['sourceProjectName']),console[_0x433d43(0x1b6)]('New\x20project:\x20'+_0x55009f),console[_0x433d43(0x1b6)](_0x433d43(0x19f)),console[_0x433d43(0x1b6)](_0x433d43(0x1d6)+_0x56a961[_0x433d43(0x234)][_0x433d43(0x1f3)][_0x433d43(0x1a9)]),console['log']('\x20\x20Knowledge\x20Bases:\x20'+_0x56a961[_0x433d43(0x234)][_0x433d43(0x18a)]['created']),console[_0x433d43(0x1b6)](_0x433d43(0x1c7)+_0x56a961['counts']['prompts'][_0x433d43(0x1a9)]),console['log'](_0x433d43(0x1e9)+_0x56a961[_0x433d43(0x234)][_0x433d43(0x1d4)][_0x433d43(0x1a9)]),console[_0x433d43(0x1b6)]('\x20\x20Chat\x20Interfaces:\x20'+_0x56a961['counts'][_0x433d43(0x19a)][_0x433d43(0x1a9)]);const _0x16a9a7=_0x56a961[_0x433d43(0x234)]['experimentalKnowledgeBases'][_0x433d43(0x1a9)]>0x0||_0x56a961[_0x433d43(0x234)][_0x433d43(0x1c4)][_0x433d43(0x1a9)]>0x0;return _0x16a9a7&&(console[_0x433d43(0x1b6)](_0x433d43(0x195)+_0x56a961[_0x433d43(0x234)]['experimentalKnowledgeBases'][_0x433d43(0x1a9)]),console[_0x433d43(0x1b6)](_0x433d43(0x235)+_0x56a961[_0x433d43(0x234)]['experimentalArtifacts'][_0x433d43(0x1a9)])),0x0;}const _0x7a71fa=_0x56a961[_0x433d43(0x234)][_0x433d43(0x1f3)]['errors']>0x0||_0x56a961['counts'][_0x433d43(0x18a)][_0x433d43(0x1f9)]>0x0||_0x56a961[_0x433d43(0x234)][_0x433d43(0x1a8)]['errors']>0x0||_0x56a961[_0x433d43(0x234)][_0x433d43(0x1d4)]['errors']>0x0||_0x56a961[_0x433d43(0x234)][_0x433d43(0x19a)]['errors']>0x0||_0x56a961[_0x433d43(0x234)][_0x433d43(0x199)][_0x433d43(0x1f9)]>0x0||_0x56a961[_0x433d43(0x234)]['experimentalArtifacts'][_0x433d43(0x1f9)]>0x0;_0x7a71fa?console[_0x433d43(0x1b6)](a4_0x3ab4a1[_0x433d43(0x1db)]('Project\x20cloned\x20with\x20errors')):console[_0x433d43(0x1b6)](a4_0x3ab4a1['green'](_0x433d43(0x233)));console[_0x433d43(0x1b6)](_0x433d43(0x1dd)+_0x56a961[_0x433d43(0x1ab)]),console[_0x433d43(0x1b6)](_0x433d43(0x1da)+_0x56a961[_0x433d43(0x210)]),console[_0x433d43(0x1b6)]('New\x20project\x20ID:\x20'+_0x56a961[_0x433d43(0x20b)]),console[_0x433d43(0x1b6)](),console[_0x433d43(0x1b6)](_0x433d43(0x1f4)),console[_0x433d43(0x1b6)](_0x433d43(0x1d6)+formatCountSummary(_0x56a961[_0x433d43(0x234)][_0x433d43(0x1f3)])),console[_0x433d43(0x1b6)](_0x433d43(0x220)+formatCountSummary(_0x56a961['counts'][_0x433d43(0x18a)])),console[_0x433d43(0x1b6)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x56a961[_0x433d43(0x234)][_0x433d43(0x1a8)])),console['log']('\x20\x20Integrations:\x20'+formatCountSummary(_0x56a961['counts'][_0x433d43(0x218)])),console['log'](_0x433d43(0x1e9)+formatCountSummary(_0x56a961[_0x433d43(0x234)][_0x433d43(0x1d4)])),console[_0x433d43(0x1b6)](_0x433d43(0x1c1)+formatCountSummary(_0x56a961['counts'][_0x433d43(0x19a)]));const _0x1dd9fa=_0x56a961[_0x433d43(0x234)][_0x433d43(0x199)][_0x433d43(0x1a9)]>0x0||_0x56a961['counts']['experimentalKnowledgeBases'][_0x433d43(0x21f)]>0x0||_0x56a961[_0x433d43(0x234)][_0x433d43(0x199)][_0x433d43(0x228)]>0x0||_0x56a961[_0x433d43(0x234)][_0x433d43(0x1c4)]['created']>0x0||_0x56a961['counts']['experimentalArtifacts'][_0x433d43(0x21f)]>0x0||_0x56a961[_0x433d43(0x234)][_0x433d43(0x1c4)][_0x433d43(0x228)]>0x0;_0x1dd9fa&&(console[_0x433d43(0x1b6)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x56a961[_0x433d43(0x234)][_0x433d43(0x199)])),console[_0x433d43(0x1b6)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x56a961[_0x433d43(0x234)]['experimentalArtifacts'])));if(_0x7a71fa){console[_0x433d43(0x1b6)](),console[_0x433d43(0x1b6)](a4_0x3ab4a1[_0x433d43(0x20c)](_0x433d43(0x1e7)));for(const _0x13c439 of _0x56a961[_0x433d43(0x1f3)]){_0x13c439['action']===_0x433d43(0x1a6)&&console[_0x433d43(0x1b6)](a4_0x3ab4a1[_0x433d43(0x20c)]('\x20\x20Agent\x20\x22'+_0x13c439[_0x433d43(0x1c3)]+'\x22:\x20'+_0x13c439[_0x433d43(0x1a6)]));}for(const _0x552ddb of _0x56a961['knowledgeBases']){_0x552ddb[_0x433d43(0x215)]===_0x433d43(0x1a6)&&console[_0x433d43(0x1b6)](a4_0x3ab4a1[_0x433d43(0x20c)](_0x433d43(0x1b2)+_0x552ddb[_0x433d43(0x196)]+'\x22:\x20'+_0x552ddb[_0x433d43(0x1a6)]));}for(const _0x4215d9 of _0x56a961[_0x433d43(0x1a8)]){_0x4215d9[_0x433d43(0x215)]===_0x433d43(0x1a6)&&console[_0x433d43(0x1b6)](a4_0x3ab4a1[_0x433d43(0x20c)](_0x433d43(0x1d1)+_0x4215d9[_0x433d43(0x196)]+_0x433d43(0x179)+_0x4215d9['error']));}for(const _0x35669b of _0x56a961[_0x433d43(0x218)]){_0x35669b[_0x433d43(0x215)]===_0x433d43(0x1a6)&&console['log'](a4_0x3ab4a1['red'](_0x433d43(0x18e)+_0x35669b[_0x433d43(0x196)]+_0x433d43(0x179)+_0x35669b[_0x433d43(0x1a6)]));}for(const _0x264591 of _0x56a961[_0x433d43(0x1d4)]){_0x264591[_0x433d43(0x215)]===_0x433d43(0x1a6)&&console[_0x433d43(0x1b6)](a4_0x3ab4a1[_0x433d43(0x20c)]('\x20\x20Form\x20Interface\x20\x22'+_0x264591[_0x433d43(0x196)]+_0x433d43(0x179)+_0x264591[_0x433d43(0x1a6)]));}for(const _0x2fcf10 of _0x56a961['chatInterfaces']){_0x2fcf10[_0x433d43(0x215)]===_0x433d43(0x1a6)&&console[_0x433d43(0x1b6)](a4_0x3ab4a1[_0x433d43(0x20c)]('\x20\x20Chat\x20Interface\x20\x22'+_0x2fcf10[_0x433d43(0x196)]+'\x22:\x20'+_0x2fcf10[_0x433d43(0x1a6)]));}for(const _0x39d4d9 of _0x56a961['experimentalKnowledgeBases']){_0x39d4d9[_0x433d43(0x215)]===_0x433d43(0x1a6)&&console[_0x433d43(0x1b6)](a4_0x3ab4a1[_0x433d43(0x20c)]('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0x39d4d9[_0x433d43(0x196)]+_0x433d43(0x179)+_0x39d4d9[_0x433d43(0x1a6)]));}for(const _0x77ceda of _0x56a961[_0x433d43(0x1c4)]){_0x77ceda[_0x433d43(0x215)]==='error'&&console[_0x433d43(0x1b6)](a4_0x3ab4a1[_0x433d43(0x20c)]('\x20\x20Experimental\x20Artifact\x20\x22'+_0x77ceda[_0x433d43(0x196)]+_0x433d43(0x179)+_0x77ceda[_0x433d43(0x1a6)]));}return 0x1;}console[_0x433d43(0x1b6)]();const _0x2c2ccd=getLLMProjectUrl(_0x23776f,_0x56a961[_0x433d43(0x20b)]);return console['log'](_0x433d43(0x231)+a4_0x3ab4a1[_0x433d43(0x1b7)](_0x2c2ccd)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x128688(0x196)]='agent:push';[a4_0x128688(0x183)]=a4_0x128688(0x211);async[a4_0x128688(0x1cd)](_0x28902f){const _0x5dc679=a4_0x128688,{options:_0x1d4186,args:_0x355c5b,tdx:_0x2947d6}=_0x28902f;let _0x272aa8=_0x355c5b[0x0]||process['cwd']();const _0x2f2fa4=_0x1d4186[_0x5dc679(0x1a3)],_0x218b1a=_0x1d4186[_0x5dc679(0x189)],_0xbc38e5=_0x1d4186[_0x5dc679(0x1aa)],_0x460e26=_0x1d4186[_0x5dc679(0x1e6)],_0x875535=a4_0x18183f[_0x5dc679(0x214)](_0x272aa8,_0x5dc679(0x1ca)),_0x4bfc20=existsSync(_0x875535);if(_0x4bfc20){const {data:_0x2beeaf}=await withSpinner(_0x5dc679(0x1b0)+_0x272aa8+_0x5dc679(0x1c9),()=>_0x2947d6[_0x5dc679(0x21c)][_0x5dc679(0x1c0)](_0x272aa8,{'dryRun':_0x2f2fa4,'force':_0x218b1a}));if(_0x2f2fa4)return console['log'](a4_0x3ab4a1['yellow'](_0x5dc679(0x198))),console['log']('Would\x20push\x20agent:\x20'+_0x2beeaf[_0x5dc679(0x1c3)]),0x0;if(_0x2beeaf[_0x5dc679(0x215)]==='error')return console[_0x5dc679(0x1b6)](a4_0x3ab4a1[_0x5dc679(0x20c)](_0x5dc679(0x201)+_0x2beeaf[_0x5dc679(0x1a6)])),0x1;console[_0x5dc679(0x1b6)](a4_0x3ab4a1[_0x5dc679(0x1bb)](_0x5dc679(0x1fe)+_0x2beeaf[_0x5dc679(0x215)]+_0x5dc679(0x192))),console[_0x5dc679(0x1b6)]('Agent:\x20'+_0x2beeaf[_0x5dc679(0x1c3)]);if(_0x2beeaf[_0x5dc679(0x1cb)]&&_0x2beeaf['projectId']){const _0x25e00a=getLLMAgentChatUrl(_0x460e26,_0x2beeaf[_0x5dc679(0x18f)],_0x2beeaf['agentId']);console[_0x5dc679(0x1b6)](_0x5dc679(0x1a7)+a4_0x3ab4a1[_0x5dc679(0x1b7)](_0x25e00a));}return 0x0;}const _0xec269a=_0x1d4186[_0x5dc679(0x20f)],_0x5bbd67=resolveProjectFromContext(_0x272aa8,_0xec269a);if(_0x5bbd67[_0x5dc679(0x1de)])_0x272aa8=_0x5bbd67[_0x5dc679(0x1f6)],_0x5bbd67[_0x5dc679(0x1f1)]==='context'&&console[_0x5dc679(0x1b6)](a4_0x3ab4a1['dim']('Using\x20project:\x20'+_0x272aa8));else{let _0x5344ab=_0x5dc679(0x1e8);_0x5bbd67['reason']===_0x5dc679(0x17b)&&(_0x5344ab=_0x5bbd67[_0x5dc679(0x1e0)]+_0x5dc679(0x1ad)+_0x5bbd67[_0x5dc679(0x20f)]+_0x5dc679(0x19b));throw new SDKError(ErrorCode[_0x5dc679(0x207)],_0x5bbd67['reason']===_0x5dc679(0x1b3)?_0x5bbd67[_0x5dc679(0x1e0)]:'No\x20tdx.json\x20found\x20in\x20'+_0x272aa8,undefined,{'helpText':_0x5344ab});}const {data:_0x139cad}=await withSpinner(_0x5dc679(0x18b),()=>_0x2947d6[_0x5dc679(0x21c)][_0x5dc679(0x194)](_0x272aa8,{'dryRun':!![]})),_0x4d6631=_0x139cad[_0x5dc679(0x234)][_0x5dc679(0x1f3)]['errors']>0x0;if(_0x4d6631){console[_0x5dc679(0x1b6)](a4_0x3ab4a1[_0x5dc679(0x20c)]('\x0aErrors\x20found:'));for(const _0x5667e5 of _0x139cad[_0x5dc679(0x1f3)]){_0x5667e5[_0x5dc679(0x215)]===_0x5dc679(0x1a6)&&console[_0x5dc679(0x1b6)](a4_0x3ab4a1[_0x5dc679(0x20c)](_0x5dc679(0x1bc)+_0x5667e5[_0x5dc679(0x1c3)]+_0x5dc679(0x179)+_0x5667e5[_0x5dc679(0x1a6)]));}return 0x1;}const _0x588876=_0x139cad[_0x5dc679(0x234)][_0x5dc679(0x1f3)]['created']+_0x139cad[_0x5dc679(0x234)][_0x5dc679(0x18a)]['created']+_0x139cad[_0x5dc679(0x234)][_0x5dc679(0x206)]['created']+_0x139cad['counts'][_0x5dc679(0x1a8)]['created']+_0x139cad['counts'][_0x5dc679(0x218)][_0x5dc679(0x1a9)]+_0x139cad['counts'][_0x5dc679(0x199)][_0x5dc679(0x1a9)]+_0x139cad[_0x5dc679(0x234)][_0x5dc679(0x1c4)]['created']+_0x139cad[_0x5dc679(0x234)]['formInterfaces'][_0x5dc679(0x1a9)]+_0x139cad[_0x5dc679(0x234)]['chatInterfaces']['created'],_0xba6db3=_0x139cad[_0x5dc679(0x234)]['agents']['updated']+_0x139cad['counts'][_0x5dc679(0x18a)]['updated']+_0x139cad[_0x5dc679(0x234)]['textKnowledgeBases'][_0x5dc679(0x21f)]+_0x139cad[_0x5dc679(0x234)][_0x5dc679(0x1a8)][_0x5dc679(0x21f)]+_0x139cad[_0x5dc679(0x234)][_0x5dc679(0x218)][_0x5dc679(0x21f)]+_0x139cad[_0x5dc679(0x234)][_0x5dc679(0x199)][_0x5dc679(0x21f)]+_0x139cad[_0x5dc679(0x234)][_0x5dc679(0x1c4)]['updated']+_0x139cad[_0x5dc679(0x234)][_0x5dc679(0x1d4)][_0x5dc679(0x21f)]+_0x139cad['counts'][_0x5dc679(0x19a)][_0x5dc679(0x21f)],_0x8abe07=_0x139cad[_0x5dc679(0x234)][_0x5dc679(0x1f3)][_0x5dc679(0x228)]+_0x139cad[_0x5dc679(0x234)][_0x5dc679(0x18a)]['unchanged']+_0x139cad['counts']['textKnowledgeBases'][_0x5dc679(0x228)]+_0x139cad[_0x5dc679(0x234)]['prompts'][_0x5dc679(0x228)]+_0x139cad[_0x5dc679(0x234)][_0x5dc679(0x218)][_0x5dc679(0x228)]+_0x139cad[_0x5dc679(0x234)]['experimentalKnowledgeBases'][_0x5dc679(0x228)]+_0x139cad[_0x5dc679(0x234)][_0x5dc679(0x1c4)][_0x5dc679(0x228)]+_0x139cad[_0x5dc679(0x234)][_0x5dc679(0x1d4)]['unchanged']+_0x139cad['counts'][_0x5dc679(0x19a)][_0x5dc679(0x228)];console[_0x5dc679(0x1b6)](_0x5dc679(0x1ac)+_0x139cad[_0x5dc679(0x1fc)]+'\x27:'),console['log']('\x20\x20'+a4_0x3ab4a1[_0x5dc679(0x1bb)]('+\x20'+_0x588876+_0x5dc679(0x190))+'\x20|\x20'+a4_0x3ab4a1[_0x5dc679(0x1db)]('~\x20'+_0xba6db3+_0x5dc679(0x1b1))+_0x5dc679(0x1f2)+a4_0x3ab4a1[_0x5dc679(0x181)]('=\x20'+_0x8abe07+'\x20unchanged')),console['log'](_0x5dc679(0x1d6)+formatCountSummary(_0x139cad[_0x5dc679(0x234)][_0x5dc679(0x1f3)])),console['log'](_0x5dc679(0x220)+formatCountSummary(_0x139cad['counts']['knowledgeBases'])),console[_0x5dc679(0x1b6)](_0x5dc679(0x1bf)+formatCountSummary(_0x139cad[_0x5dc679(0x234)]['textKnowledgeBases'])),console[_0x5dc679(0x1b6)](_0x5dc679(0x1c7)+formatCountSummary(_0x139cad[_0x5dc679(0x234)]['prompts'])),console[_0x5dc679(0x1b6)](_0x5dc679(0x1f5)+formatCountSummary(_0x139cad[_0x5dc679(0x234)][_0x5dc679(0x218)])),console[_0x5dc679(0x1b6)](_0x5dc679(0x1e9)+formatCountSummary(_0x139cad[_0x5dc679(0x234)][_0x5dc679(0x1d4)])),console[_0x5dc679(0x1b6)](_0x5dc679(0x1c1)+formatCountSummary(_0x139cad[_0x5dc679(0x234)][_0x5dc679(0x19a)]));const _0x2f3363=_0x139cad[_0x5dc679(0x234)][_0x5dc679(0x199)][_0x5dc679(0x1a9)]>0x0||_0x139cad[_0x5dc679(0x234)][_0x5dc679(0x199)][_0x5dc679(0x21f)]>0x0||_0x139cad[_0x5dc679(0x234)]['experimentalKnowledgeBases'][_0x5dc679(0x228)]>0x0||_0x139cad['counts']['experimentalArtifacts'][_0x5dc679(0x1a9)]>0x0||_0x139cad[_0x5dc679(0x234)][_0x5dc679(0x1c4)][_0x5dc679(0x21f)]>0x0||_0x139cad[_0x5dc679(0x234)][_0x5dc679(0x1c4)][_0x5dc679(0x228)]>0x0;_0x2f3363&&(console['log'](_0x5dc679(0x195)+formatCountSummary(_0x139cad[_0x5dc679(0x234)][_0x5dc679(0x199)])),console[_0x5dc679(0x1b6)](_0x5dc679(0x235)+formatCountSummary(_0x139cad['counts']['experimentalArtifacts'])));console[_0x5dc679(0x1b6)](_0x5dc679(0x21b)+a4_0x3ab4a1[_0x5dc679(0x1b7)](_0x272aa8)),displayDiffs(_0x139cad['agents'],_0x139cad['knowledgeBases'],_0x139cad[_0x5dc679(0x206)],_0x139cad[_0x5dc679(0x1a8)],_0x139cad[_0x5dc679(0x218)],_0x139cad[_0x5dc679(0x199)],_0x139cad['experimentalArtifacts'],_0x139cad[_0x5dc679(0x1d4)],_0x139cad[_0x5dc679(0x19a)]);if(_0x2f2fa4)return console[_0x5dc679(0x1b6)](a4_0x3ab4a1[_0x5dc679(0x1db)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x588876===0x0&&_0xba6db3===0x0){console[_0x5dc679(0x1b6)](a4_0x3ab4a1['green'](_0x5dc679(0x212)));const _0x799dfd=getLLMProjectUrl(_0x460e26,_0x139cad[_0x5dc679(0x18f)]);return console[_0x5dc679(0x1b6)](_0x5dc679(0x231)+a4_0x3ab4a1['cyan'](_0x799dfd)),0x0;}if(!_0xbc38e5&&!_0x218b1a){if(!isInteractive())return console[_0x5dc679(0x1a6)](a4_0x3ab4a1['red'](_0x5dc679(0x225)),_0x5dc679(0x200)),console['error'](a4_0x3ab4a1['dim'](_0x5dc679(0x1e3))),0x1;const _0x1dd94f=await confirmKey(_0x5dc679(0x1a4)+(_0x588876+_0xba6db3)+_0x5dc679(0x1d8));if(!_0x1dd94f)return console['log'](a4_0x3ab4a1[_0x5dc679(0x1db)]('Cancelled'),_0x5dc679(0x221)),0x1;}const {data:_0x2b4479}=await withSpinner(_0x5dc679(0x191),()=>_0x2947d6[_0x5dc679(0x21c)][_0x5dc679(0x194)](_0x272aa8,{'force':_0x218b1a})),_0x20f4cd=_0x2b4479[_0x5dc679(0x234)][_0x5dc679(0x1f3)][_0x5dc679(0x1f9)]>0x0||_0x2b4479[_0x5dc679(0x234)]['knowledgeBases'][_0x5dc679(0x1f9)]>0x0||_0x2b4479['counts'][_0x5dc679(0x206)]['errors']>0x0||_0x2b4479[_0x5dc679(0x234)]['prompts'][_0x5dc679(0x1f9)]>0x0||_0x2b4479[_0x5dc679(0x234)][_0x5dc679(0x1d4)]['errors']>0x0||_0x2b4479[_0x5dc679(0x234)]['chatInterfaces'][_0x5dc679(0x1f9)]>0x0;if(_0x20f4cd){console[_0x5dc679(0x1b6)](a4_0x3ab4a1[_0x5dc679(0x1db)](_0x5dc679(0x202))),console[_0x5dc679(0x1b6)](),console[_0x5dc679(0x1b6)](a4_0x3ab4a1[_0x5dc679(0x20c)](_0x5dc679(0x1e7)));for(const _0x1a7924 of _0x2b4479[_0x5dc679(0x1f3)]){_0x1a7924[_0x5dc679(0x215)]===_0x5dc679(0x1a6)&&console[_0x5dc679(0x1b6)](a4_0x3ab4a1[_0x5dc679(0x20c)]('\x20\x20Agent\x20\x22'+_0x1a7924[_0x5dc679(0x1c3)]+_0x5dc679(0x179)+_0x1a7924[_0x5dc679(0x1a6)]));}for(const _0x285fe7 of _0x2b4479[_0x5dc679(0x18a)]){_0x285fe7['action']===_0x5dc679(0x1a6)&&console[_0x5dc679(0x1b6)](a4_0x3ab4a1['red'](_0x5dc679(0x1b2)+_0x285fe7[_0x5dc679(0x196)]+_0x5dc679(0x179)+_0x285fe7[_0x5dc679(0x1a6)]));}for(const _0x2d3f11 of _0x2b4479[_0x5dc679(0x206)]){_0x2d3f11['action']===_0x5dc679(0x1a6)&&console[_0x5dc679(0x1b6)](a4_0x3ab4a1[_0x5dc679(0x20c)]('\x20\x20Text\x20Knowledge\x20Base\x20\x22'+_0x2d3f11[_0x5dc679(0x196)]+'\x22:\x20'+_0x2d3f11[_0x5dc679(0x1a6)]));}for(const _0x1abe0d of _0x2b4479[_0x5dc679(0x1a8)]){_0x1abe0d[_0x5dc679(0x215)]===_0x5dc679(0x1a6)&&console[_0x5dc679(0x1b6)](a4_0x3ab4a1[_0x5dc679(0x20c)](_0x5dc679(0x1d1)+_0x1abe0d[_0x5dc679(0x196)]+_0x5dc679(0x179)+_0x1abe0d['error']));}for(const _0x3082a0 of _0x2b4479[_0x5dc679(0x218)]){_0x3082a0['action']==='error'&&console[_0x5dc679(0x1b6)](a4_0x3ab4a1[_0x5dc679(0x20c)](_0x5dc679(0x18e)+_0x3082a0[_0x5dc679(0x196)]+_0x5dc679(0x179)+_0x3082a0['error']));}for(const _0x159a2e of _0x2b4479[_0x5dc679(0x1d4)]){_0x159a2e[_0x5dc679(0x215)]==='error'&&console[_0x5dc679(0x1b6)](a4_0x3ab4a1[_0x5dc679(0x20c)](_0x5dc679(0x18d)+_0x159a2e[_0x5dc679(0x196)]+_0x5dc679(0x179)+_0x159a2e[_0x5dc679(0x1a6)]));}for(const _0x36e5a9 of _0x2b4479[_0x5dc679(0x19a)]){_0x36e5a9[_0x5dc679(0x215)]==='error'&&console[_0x5dc679(0x1b6)](a4_0x3ab4a1['red'](_0x5dc679(0x1c5)+_0x36e5a9['name']+_0x5dc679(0x179)+_0x36e5a9[_0x5dc679(0x1a6)]));}return 0x1;}console[_0x5dc679(0x1b6)](a4_0x3ab4a1[_0x5dc679(0x1bb)](_0x5dc679(0x20d)+(_0x588876+_0xba6db3)+'\x20resources\x20to\x20\x27'+_0x2b4479[_0x5dc679(0x1fc)]+'\x27'));const _0x5a70d2=getLLMProjectUrl(_0x460e26,_0x2b4479[_0x5dc679(0x18f)]);return console['log'](_0x5dc679(0x231)+a4_0x3ab4a1['cyan'](_0x5a70d2)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x4cb20c=a5_0x19b0;(function(_0x57674a,_0x3f021a){const _0xf6bcf6=a5_0x19b0,_0x54afbe=_0x57674a();while(!![]){try{const _0xefb99c=-parseInt(_0xf6bcf6(0x10c))/0x1+parseInt(_0xf6bcf6(0x113))/0x2*(-parseInt(_0xf6bcf6(0x1a0))/0x3)+-parseInt(_0xf6bcf6(0x178))/0x4*(parseInt(_0xf6bcf6(0x165))/0x5)+-parseInt(_0xf6bcf6(0x198))/0x6*(-parseInt(_0xf6bcf6(0x162))/0x7)+parseInt(_0xf6bcf6(0x169))/0x8*(-parseInt(_0xf6bcf6(0x10d))/0x9)+parseInt(_0xf6bcf6(0x179))/0xa+-parseInt(_0xf6bcf6(0x17b))/0xb*(-parseInt(_0xf6bcf6(0x16a))/0xc);if(_0xefb99c===_0x3f021a)break;else _0x54afbe['push'](_0x54afbe['shift']());}catch(_0x2f48bd){_0x54afbe['push'](_0x54afbe['shift']());}}}(a5_0xe598,0xc9c57));import*as a5_0x5e03f6 from'node:fs';import*as a5_0x305694 from'node:path';import a5_0x1baf33 from'chalk';function a5_0xe598(){const _0x401415=['ERROR','message','\x22,\x20but\x20current\x20site\x20is\x20\x22','Output\x20written\x20to:\x20','now','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','Round\x201/','9lSVZqe','toISOString','Passed:\x20\x20\x20','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','491315vtNgql','22590fyHUax',':\x20Sending\x20user\x20input...','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','✗\x20ERROR:\x20','agent:test','existsSync','79694aIzVwk','white','404','log','No\x20tests\x20have\x20tags\x20defined.','\x20-\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','Available\x20tags:\x20','verbose','some','Test\x20Summary','Evaluating\x20response...','llm','includes','resolveAgentId','found','Usage:','Executing\x20new\x20tests...','Error:\x20No\x20previous\x20test\x20run\x20found.','agent','source','map','projectDir','Error\x20writing\x20output\x20file:\x20','find','filter','trim','execute','No\x20tests\x20found\x20with\x20tags:\x20','reeval','...\x20','round','Running\x20agent\x20tests...','\x20\x20Project:\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','\x20(new)','\x20\x20Agent:\x20','conversation_url','⚠\x20SKIPPED:\x20','tags','Failed:\x20\x20\x20','Errors:\x20\x20\x20','timestamp','eval','stop','resolve','Failed\x20Tests:','Either\x20switch\x20to\x20the\x20\x22','writeFileSync','Project\x20path:\x20','Run\x20\x27tdx\x20agent\x20pull\x20','dim','toLowerCase','utf-8','push','tests','size','Conversation\x20URL:\x20','output','New\x20tests\x20to\x20execute:\x20','cyan','\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','Tests\x20found:\x20','reason','description','yellow','site','Round\x20','\x22:\x20','Total:\x20\x20\x20\x20','\x20\x20Round\x20','Run\x20tests\x20for\x20an\x20LLM\x20agent','green','agentName','Available\x20tests:\x20','forEach','Test\x20','executeReeval','\x20\x20-\x20','301XEEWUD','Cached\x20run\x20from:\x20','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','69860RdyBGm','Running\x20test:\x20','repeat','has','4832YFjKSi','4044glkcoA','join','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','Re-evaluating\x20','Agent:\x20','\x20\x20Site:\x20','tsv','\x27\x20to\x20create\x20the\x20folder\x20structure.','length','testName','rounds','\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)','name','conversations','316lzNGPg','14297420SlACMS','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','42823jazXMr','FAIL','PASS','dryRun','✓\x20PASS:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','\x20\x20Evaluating...\x20','multiple_agents','projectName','✗\x20FAIL:\x20','table','llmProject','status','add','\x20(cached)','red','Re-evaluating...','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','No\x20tests\x20found\x20matching:\x20','Re-evaluation\x20Summary','no_context','Test\x20Configuration:','split','Cached\x20run\x20is\x20from\x20site\x20\x22','agentDirs','testYmlPath','/<agent-name>','text','not\x20found','183552vVYeKJ'];a5_0xe598=function(){return _0x401415;};return a5_0xe598();}function a5_0x19b0(_0x267f6a,_0xd0c9c5){_0x267f6a=_0x267f6a-0x10c;const _0xe59869=a5_0xe598();let _0x19b045=_0xe59869[_0x267f6a];return _0x19b045;}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_0x4cb20c(0x176)]=a5_0x4cb20c(0x111);[a5_0x4cb20c(0x153)]=a5_0x4cb20c(0x15a);async[a5_0x4cb20c(0x12e)](_0xa42fdb){const _0x2fcf27=a5_0x4cb20c,{options:_0x441d54,args:_0x2cd274,tdx:_0x52f24c}=_0xa42fdb,_0x49d492=_0x2cd274[0x0]||'.',_0x5d2c9d=_0x441d54[_0x2fcf27(0x17e)],_0x50ad05=_0x441d54,_0x44c0f1=_0x50ad05[_0x2fcf27(0x13e)]===![],_0xc57c47=_0x50ad05[_0x2fcf27(0x130)],_0x1180f0=_0x50ad05[_0x2fcf27(0x176)],_0x2eeb28=_0x50ad05[_0x2fcf27(0x13a)],_0x3bd1de=_0x441d54[_0x2fcf27(0x155)],_0x1f24a6=_0x50ad05[_0x2fcf27(0x14d)];if(_0xc57c47&&_0x44c0f1)return console[_0x2fcf27(0x116)](a5_0x1baf33[_0x2fcf27(0x18a)]('Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval')),0x1;let _0xa42246=_0x2fcf27(0x185);if(_0x50ad05['json'])_0xa42246='json';else{if(_0x50ad05['jsonl'])_0xa42246='jsonl';else{if(_0x50ad05[_0x2fcf27(0x170)])_0xa42246=_0x2fcf27(0x170);else{if(_0x50ad05[_0x2fcf27(0x185)])_0xa42246=_0x2fcf27(0x185);}}}const _0x203570=_0x50ad05['llmProject'];let _0x4ecf09=_0x49d492;const _0x453176=a5_0x5e03f6[_0x2fcf27(0x112)](_0x49d492),_0x160232=_0x49d492==='.';if(!_0x453176||_0x160232){const _0x2649f6=resolveProjectFromContext(_0x49d492,_0x203570,{'requireFile':'test.yml'});if(_0x2649f6[_0x2fcf27(0x122)])_0x4ecf09=_0x2649f6[_0x2fcf27(0x129)],_0x2649f6[_0x2fcf27(0x127)]==='context'&&console[_0x2fcf27(0x116)](a5_0x1baf33[_0x2fcf27(0x146)]('Using\x20agent:\x20'+_0x4ecf09));else switch(_0x2649f6[_0x2fcf27(0x152)]){case _0x2fcf27(0x18f):console[_0x2fcf27(0x116)](a5_0x1baf33[_0x2fcf27(0x154)](_0x2649f6[_0x2fcf27(0x19a)])),console[_0x2fcf27(0x116)](),console['log'](_0x2fcf27(0x123)),console[_0x2fcf27(0x116)](_0x2fcf27(0x150)),console[_0x2fcf27(0x116)](_0x2fcf27(0x175)),console['log'](),console[_0x2fcf27(0x116)]('Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>');return 0x1;case'no_local_folder':console[_0x2fcf27(0x116)](a5_0x1baf33[_0x2fcf27(0x154)](_0x2649f6['message'])),console[_0x2fcf27(0x116)](),console[_0x2fcf27(0x116)](_0x2fcf27(0x145)+_0x2649f6[_0x2fcf27(0x186)]+_0x2fcf27(0x171));return 0x1;case _0x2fcf27(0x182):{const _0x510ed5=a5_0x305694['basename'](_0x2649f6[_0x2fcf27(0x129)]);console[_0x2fcf27(0x116)](a5_0x1baf33[_0x2fcf27(0x154)]('Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22'+_0x2649f6[_0x2fcf27(0x186)]+'\x22:'));for(const _0x1c28e5 of _0x2649f6[_0x2fcf27(0x193)]){console[_0x2fcf27(0x116)](_0x2fcf27(0x161)+_0x1c28e5);}return console[_0x2fcf27(0x116)](),console[_0x2fcf27(0x116)]('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x510ed5+_0x2fcf27(0x195)),0x1;}case'no_tests':console[_0x2fcf27(0x116)](a5_0x1baf33['yellow'](_0x2fcf27(0x1a3)+_0x2649f6[_0x2fcf27(0x186)]+'\x22.')),console[_0x2fcf27(0x116)](a5_0x1baf33['dim'](_0x2fcf27(0x144)+_0x2649f6[_0x2fcf27(0x129)])),console[_0x2fcf27(0x116)](),console[_0x2fcf27(0x116)](_0x2fcf27(0x10f));return 0x1;}}const {definition:_0x2b9886,agentInfo:_0x52c16d}=parseTestFile(_0x4ecf09);let _0x3c617f=_0x2b9886[_0x2fcf27(0x14a)];if(_0x1180f0){const _0x2059a6=_0x1180f0[_0x2fcf27(0x191)](',')['map'](_0x918f57=>_0x918f57[_0x2fcf27(0x12d)]());_0x3c617f=_0x2b9886[_0x2fcf27(0x14a)][_0x2fcf27(0x12c)](_0x4c248f=>_0x2059a6[_0x2fcf27(0x120)](_0x4c248f['name']));if(_0x3c617f[_0x2fcf27(0x172)]===0x0)return console[_0x2fcf27(0x116)](a5_0x1baf33['yellow'](_0x2fcf27(0x18d)+_0x1180f0)),console[_0x2fcf27(0x116)](a5_0x1baf33[_0x2fcf27(0x146)](_0x2fcf27(0x15d)+_0x2b9886[_0x2fcf27(0x14a)]['map'](_0x1922c7=>_0x1922c7[_0x2fcf27(0x176)])[_0x2fcf27(0x16b)](',\x20'))),0x1;}if(_0x2eeb28){const _0x3324c9=_0x2eeb28[_0x2fcf27(0x191)](',')[_0x2fcf27(0x128)](_0x2c9c93=>_0x2c9c93[_0x2fcf27(0x12d)]()[_0x2fcf27(0x147)]());_0x3c617f=_0x3c617f[_0x2fcf27(0x12c)](_0x1633e4=>_0x1633e4['tags']?.[_0x2fcf27(0x11c)](_0x307f5b=>_0x3324c9[_0x2fcf27(0x120)](_0x307f5b[_0x2fcf27(0x147)]())));if(_0x3c617f[_0x2fcf27(0x172)]===0x0){console['log'](a5_0x1baf33[_0x2fcf27(0x154)](_0x2fcf27(0x12f)+_0x2eeb28));const _0x52348b=new Set();return _0x2b9886[_0x2fcf27(0x14a)][_0x2fcf27(0x15e)](_0x1e5775=>_0x1e5775[_0x2fcf27(0x13a)]?.['forEach'](_0x22da14=>_0x52348b[_0x2fcf27(0x188)](_0x22da14))),_0x52348b[_0x2fcf27(0x14b)]>0x0?console[_0x2fcf27(0x116)](a5_0x1baf33[_0x2fcf27(0x146)](_0x2fcf27(0x11a)+[..._0x52348b][_0x2fcf27(0x16b)](',\x20'))):console[_0x2fcf27(0x116)](a5_0x1baf33[_0x2fcf27(0x146)](_0x2fcf27(0x117))),0x1;}}if(_0xc57c47)return this[_0x2fcf27(0x160)](_0xa42fdb,{'definition':{'tests':_0x3c617f},'agentInfo':_0x52c16d,'outputFormat':_0xa42246,'outputFile':_0x1f24a6,'testNames':_0x1180f0});if(_0x5d2c9d){console[_0x2fcf27(0x116)](a5_0x1baf33[_0x2fcf27(0x14f)](_0x2fcf27(0x190))),console[_0x2fcf27(0x116)](_0x2fcf27(0x16f)+a5_0x1baf33[_0x2fcf27(0x114)](_0x3bd1de)),console[_0x2fcf27(0x116)](_0x2fcf27(0x134)+a5_0x1baf33[_0x2fcf27(0x114)](_0x52c16d[_0x2fcf27(0x183)])),console['log'](_0x2fcf27(0x137)+a5_0x1baf33[_0x2fcf27(0x114)](_0x52c16d[_0x2fcf27(0x15c)])),console[_0x2fcf27(0x116)](),console['log'](_0x2fcf27(0x151)+a5_0x1baf33['white'](_0x3c617f['length']));for(let _0x57ae7d=0x0;_0x57ae7d<_0x3c617f[_0x2fcf27(0x172)];_0x57ae7d++){const _0x5f5430=_0x3c617f[_0x57ae7d],_0x5ad424=_0x5f5430[_0x2fcf27(0x174)]['length']===0x1?_0x2fcf27(0x132):_0x2fcf27(0x174),_0x59667f=_0x5f5430[_0x2fcf27(0x13a)]?.[_0x2fcf27(0x172)]?'\x20['+_0x5f5430[_0x2fcf27(0x13a)][_0x2fcf27(0x16b)](',\x20')+']':'';console[_0x2fcf27(0x116)]('\x20\x20'+(_0x57ae7d+0x1)+'.\x20'+a5_0x1baf33['white'](_0x5f5430[_0x2fcf27(0x176)])+'\x20('+_0x5f5430[_0x2fcf27(0x174)]['length']+'\x20'+_0x5ad424+')'+a5_0x1baf33[_0x2fcf27(0x146)](_0x59667f));}return 0x0;}let _0x1d46fb,_0x3ff717;try{_0x1d46fb=await _0x52f24c['llm']['resolveProjectId'](_0x52c16d['projectName']);}catch(_0x4db4c4){const _0x1a9f8f=_0x4db4c4 instanceof Error?_0x4db4c4['message']:String(_0x4db4c4);return _0x1a9f8f[_0x2fcf27(0x120)](_0x2fcf27(0x115))||_0x1a9f8f[_0x2fcf27(0x147)]()[_0x2fcf27(0x120)](_0x2fcf27(0x197))?console[_0x2fcf27(0x116)](a5_0x1baf33['red']('✗\x20ERROR:\x20Project\x20not\x20found:\x20'+_0x52c16d[_0x2fcf27(0x183)])):console['log'](a5_0x1baf33[_0x2fcf27(0x18a)](_0x2fcf27(0x180)+_0x52c16d['projectName']+_0x2fcf27(0x157)+_0x1a9f8f)),0x1;}try{_0x3ff717=await _0x52f24c[_0x2fcf27(0x11f)][_0x2fcf27(0x121)](_0x52c16d[_0x2fcf27(0x15c)],_0x1d46fb);}catch(_0x6f0c52){const _0x1328fa=_0x6f0c52 instanceof Error?_0x6f0c52[_0x2fcf27(0x19a)]:String(_0x6f0c52);return _0x1328fa['includes'](_0x2fcf27(0x115))||_0x1328fa[_0x2fcf27(0x147)]()[_0x2fcf27(0x120)]('not\x20found')?console[_0x2fcf27(0x116)](a5_0x1baf33['red']('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x52c16d[_0x2fcf27(0x15c)])):console['log'](a5_0x1baf33[_0x2fcf27(0x18a)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x52c16d[_0x2fcf27(0x15c)]+'\x22:\x20'+_0x1328fa)),0x1;}let _0x40e6e6;if(!_0x44c0f1)try{_0x40e6e6=await setupEvaluatorAgent(_0x52f24c[_0x2fcf27(0x11f)],_0x441d54[_0x2fcf27(0x11b)]);}catch(_0x51d29a){const _0x1970b4=_0x51d29a instanceof Error?_0x51d29a[_0x2fcf27(0x19a)]:String(_0x51d29a);return console[_0x2fcf27(0x116)](a5_0x1baf33[_0x2fcf27(0x18a)](_0x2fcf27(0x18c)+_0x1970b4)),0x1;}console[_0x2fcf27(0x116)](a5_0x1baf33[_0x2fcf27(0x14f)](_0x2fcf27(0x133))),console['log']('Site:\x20'+a5_0x1baf33[_0x2fcf27(0x114)](_0x3bd1de)),console['log'](_0x2fcf27(0x16e)+a5_0x1baf33[_0x2fcf27(0x114)](_0x52c16d[_0x2fcf27(0x183)]+'/'+_0x52c16d['agentName'])),console[_0x2fcf27(0x116)]();const _0x47e205=[],_0x17c549=[],_0x241b69=Date[_0x2fcf27(0x19d)]();for(let _0x5a3427=0x0;_0x5a3427<_0x3c617f[_0x2fcf27(0x172)];_0x5a3427++){const _0x29ad6f=_0x3c617f[_0x5a3427];_0x3c617f[_0x2fcf27(0x172)]>0x1?console['log'](_0x2fcf27(0x15f)+(_0x5a3427+0x1)+'/'+_0x3c617f[_0x2fcf27(0x172)]+':\x20'+a5_0x1baf33[_0x2fcf27(0x114)](_0x29ad6f[_0x2fcf27(0x176)])):console[_0x2fcf27(0x116)](_0x2fcf27(0x166)+a5_0x1baf33[_0x2fcf27(0x114)](_0x29ad6f[_0x2fcf27(0x176)]));const _0x271561=createCommandSpinner(_0x2fcf27(0x19f)+_0x29ad6f[_0x2fcf27(0x174)][_0x2fcf27(0x172)]+_0x2fcf27(0x10e));_0x271561['start']();try{const {result:_0x4e4f08,conversation:_0x1c46a9}=await runTest(_0x52f24c['llm'],_0x29ad6f,{'agentId':_0x3ff717,'projectId':_0x1d46fb,'site':_0x3bd1de,'noEval':_0x44c0f1,'evaluatorId':_0x40e6e6,'onRoundStart':(_0x513f2c,_0x5c8744)=>{const _0x130c49=_0x2fcf27;_0x271561[_0x130c49(0x196)]=_0x130c49(0x156)+(_0x513f2c+0x1)+'/'+_0x5c8744+_0x130c49(0x10e);},'onRoundComplete':(_0x196efa,_0x16b1a3,_0x523b94)=>{const _0x2e40f8=_0x2fcf27,_0x533f28=formatElapsed(_0x16b1a3);_0x523b94?console['log'](_0x2e40f8(0x159)+(_0x196efa+0x1)+'/'+_0x29ad6f[_0x2e40f8(0x174)]['length']+'...\x20'+a5_0x1baf33[_0x2e40f8(0x15b)]('✓')+'\x20('+_0x533f28+')'):console['log'](_0x2e40f8(0x159)+(_0x196efa+0x1)+'/'+_0x29ad6f[_0x2e40f8(0x174)][_0x2e40f8(0x172)]+_0x2e40f8(0x131)+a5_0x1baf33[_0x2e40f8(0x18a)]('✗'));},'onEvaluationStart':()=>{const _0x47e4fe=_0x2fcf27;_0x271561[_0x47e4fe(0x196)]=_0x47e4fe(0x11e);},'onEvaluationComplete':_0x347f3e=>{const _0x35094d=_0x2fcf27,_0x342770=formatElapsed(_0x347f3e);console[_0x35094d(0x116)](_0x35094d(0x181)+a5_0x1baf33['green']('✓')+'\x20('+_0x342770+')');}});_0x271561[_0x2fcf27(0x13f)](),_0x47e205[_0x2fcf27(0x149)](_0x4e4f08),_0x17c549[_0x2fcf27(0x149)](_0x1c46a9);if(_0x4e4f08['status']===_0x2fcf27(0x17d))console[_0x2fcf27(0x116)](a5_0x1baf33[_0x2fcf27(0x15b)](_0x2fcf27(0x17f)+_0x4e4f08['reason']));else _0x4e4f08['status']===_0x2fcf27(0x17c)?console[_0x2fcf27(0x116)](a5_0x1baf33[_0x2fcf27(0x18a)](_0x2fcf27(0x184)+_0x4e4f08[_0x2fcf27(0x152)])):console[_0x2fcf27(0x116)](a5_0x1baf33['red'](_0x2fcf27(0x110)+_0x4e4f08[_0x2fcf27(0x152)]));_0x4e4f08[_0x2fcf27(0x138)]&&console[_0x2fcf27(0x116)](a5_0x1baf33[_0x2fcf27(0x146)](_0x2fcf27(0x14c)+_0x4e4f08[_0x2fcf27(0x138)])),console[_0x2fcf27(0x116)]();}catch(_0x17b2d4){_0x271561[_0x2fcf27(0x13f)]();const _0x5845ea=_0x17b2d4 instanceof Error?_0x17b2d4[_0x2fcf27(0x19a)]:String(_0x17b2d4);console[_0x2fcf27(0x116)](a5_0x1baf33[_0x2fcf27(0x18a)](_0x2fcf27(0x110)+_0x5845ea)),console['log'](),_0x47e205[_0x2fcf27(0x149)]({'name':_0x29ad6f['name'],'status':_0x2fcf27(0x199),'reason':_0x5845ea,'timestamp':new Date()[_0x2fcf27(0x1a1)](),'duration_ms':0x0});}}const _0x426031=Date['now']()-_0x241b69,_0x4aa825=_0x47e205[_0x2fcf27(0x12c)](_0x4c77b0=>_0x4c77b0['status']===_0x2fcf27(0x17d))[_0x2fcf27(0x172)],_0x566d3c=_0x47e205['filter'](_0x44c253=>_0x44c253[_0x2fcf27(0x187)]===_0x2fcf27(0x17c))['length'],_0x932964=_0x47e205['filter'](_0x220f14=>_0x220f14[_0x2fcf27(0x187)]==='ERROR')[_0x2fcf27(0x172)];console[_0x2fcf27(0x116)]('━'[_0x2fcf27(0x167)](0x3c)),console[_0x2fcf27(0x116)](_0x2fcf27(0x11d)),console['log']('━'[_0x2fcf27(0x167)](0x3c)),console[_0x2fcf27(0x116)](_0x2fcf27(0x158)+_0x47e205[_0x2fcf27(0x172)]),console['log']('Passed:\x20\x20\x20'+a5_0x1baf33[_0x2fcf27(0x15b)](_0x4aa825)),console['log'](_0x2fcf27(0x13b)+a5_0x1baf33[_0x2fcf27(0x18a)](_0x566d3c));_0x932964>0x0&&console[_0x2fcf27(0x116)]('Errors:\x20\x20\x20'+a5_0x1baf33[_0x2fcf27(0x18a)](_0x932964));console[_0x2fcf27(0x116)]('Duration:\x20'+formatElapsed(_0x426031)),console[_0x2fcf27(0x116)]('━'[_0x2fcf27(0x167)](0x3c));const _0xee5ddb=_0x47e205[_0x2fcf27(0x12c)](_0x67e4c3=>_0x67e4c3[_0x2fcf27(0x187)]!==_0x2fcf27(0x17d));if(_0xee5ddb[_0x2fcf27(0x172)]>0x0){console[_0x2fcf27(0x116)](),console['log'](_0x2fcf27(0x141));for(const _0x3ea3c5 of _0xee5ddb){const _0x4016b9=a5_0x1baf33[_0x2fcf27(0x18a)]('✗'),_0x537c40=_0x3ea3c5[_0x2fcf27(0x152)][_0x2fcf27(0x172)]>0x32?_0x3ea3c5[_0x2fcf27(0x152)]['substring'](0x0,0x32)+'...':_0x3ea3c5[_0x2fcf27(0x152)];console[_0x2fcf27(0x116)]('\x20\x20'+_0x4016b9+'\x20'+_0x3ea3c5['name']+':\x20'+_0x537c40);}}const _0x56ef7a={'summary':{'total':_0x47e205[_0x2fcf27(0x172)],'passed':_0x4aa825,'failed':_0x566d3c,'errors':_0x932964>0x0?_0x932964:undefined,'duration_ms':_0x426031},'tests':_0x47e205,'agent':{'project':_0x52c16d['projectName'],'name':_0x52c16d['agentName'],'site':_0x3bd1de},'timestamp':new Date(_0x241b69)[_0x2fcf27(0x1a1)]()};try{const _0x2438e5=buildCachedTestRun(_0x17c549,{'site':_0x3bd1de,'projectId':_0x1d46fb,'projectName':_0x52c16d[_0x2fcf27(0x183)],'agentId':_0x3ff717,'agentName':_0x52c16d[_0x2fcf27(0x15c)],'testYmlPath':a5_0x305694[_0x2fcf27(0x140)](_0x52c16d[_0x2fcf27(0x194)])});saveLastTestRun(_0x2438e5);}catch{}if(_0xa42246!==_0x2fcf27(0x185)||_0x1f24a6){const _0x191bf5=formatResults(_0x56ef7a,_0xa42246);if(_0x1f24a6)try{a5_0x5e03f6['writeFileSync'](_0x1f24a6,_0x191bf5,_0x2fcf27(0x148)),console[_0x2fcf27(0x116)](),console['log'](a5_0x1baf33[_0x2fcf27(0x146)](_0x2fcf27(0x19c)+_0x1f24a6));}catch(_0x52e8ea){return console[_0x2fcf27(0x116)](),console[_0x2fcf27(0x116)](a5_0x1baf33[_0x2fcf27(0x18a)](_0x2fcf27(0x12a)+_0x52e8ea)),0x1;}else console[_0x2fcf27(0x116)](),console[_0x2fcf27(0x116)](_0x191bf5);}return _0xee5ddb['length']>0x0?0x1:0x0;}async[a5_0x4cb20c(0x160)](_0xa6c0c3,_0x445a00){const _0x577906=a5_0x4cb20c,{options:_0x3c67a7,tdx:_0x18d160}=_0xa6c0c3,{definition:_0x1364f2,agentInfo:_0x39958b,outputFormat:_0x37eced,outputFile:_0x32269f}=_0x445a00,_0x2bcd71=_0x3c67a7[_0x577906(0x155)],_0x40c81a=loadLastTestRun();if(!_0x40c81a)return console[_0x577906(0x116)](a5_0x1baf33['red'](_0x577906(0x125))),console[_0x577906(0x116)](a5_0x1baf33[_0x577906(0x146)](_0x577906(0x119))),0x1;if(_0x40c81a[_0x577906(0x126)][_0x577906(0x15c)]!==_0x39958b[_0x577906(0x15c)])return console[_0x577906(0x116)](a5_0x1baf33[_0x577906(0x18a)](_0x577906(0x19e)+_0x40c81a['agent'][_0x577906(0x15c)]+_0x577906(0x16c)+_0x39958b[_0x577906(0x15c)]+'\x22.')),console[_0x577906(0x116)](a5_0x1baf33[_0x577906(0x146)](_0x577906(0x164))),0x1;const _0x29f730=new Set(_0x40c81a[_0x577906(0x177)][_0x577906(0x128)](_0x14d9c5=>_0x14d9c5[_0x577906(0x173)])),_0x188e5f=_0x1364f2[_0x577906(0x14a)][_0x577906(0x12c)](_0x4ec4f6=>!_0x29f730[_0x577906(0x168)](_0x4ec4f6[_0x577906(0x176)]));if(_0x188e5f['length']>0x0&&_0x40c81a['site']!==_0x2bcd71)return console[_0x577906(0x116)](a5_0x1baf33['red'](_0x577906(0x17a))),console['log'](a5_0x1baf33[_0x577906(0x146)](_0x577906(0x192)+_0x40c81a[_0x577906(0x155)]+_0x577906(0x19b)+_0x2bcd71+'\x22.')),console[_0x577906(0x116)](a5_0x1baf33[_0x577906(0x146)](_0x577906(0x142)+_0x40c81a[_0x577906(0x155)]+_0x577906(0x135))),0x1;const _0x357fd2=_0x1364f2[_0x577906(0x14a)][_0x577906(0x12c)](_0x4172b5=>_0x29f730[_0x577906(0x168)](_0x4172b5[_0x577906(0x176)])),_0x49fa02=_0x188e5f;let _0x1b3083;try{_0x1b3083=await setupEvaluatorAgent(_0x18d160[_0x577906(0x11f)],_0x3c67a7['verbose']);}catch(_0xb64bd7){const _0x2132f5=_0xb64bd7 instanceof Error?_0xb64bd7[_0x577906(0x19a)]:String(_0xb64bd7);return console[_0x577906(0x116)](a5_0x1baf33['red']('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x2132f5)),0x1;}console[_0x577906(0x116)](a5_0x1baf33[_0x577906(0x14f)]('Re-evaluating\x20cached\x20test\x20run...')),console['log'](_0x577906(0x163)+a5_0x1baf33[_0x577906(0x114)](_0x40c81a[_0x577906(0x13d)])),console['log'](_0x577906(0x16e)+a5_0x1baf33[_0x577906(0x114)](_0x40c81a[_0x577906(0x126)][_0x577906(0x183)]+'/'+_0x40c81a[_0x577906(0x126)]['agentName']));_0x49fa02[_0x577906(0x172)]>0x0&&console[_0x577906(0x116)](_0x577906(0x14e)+a5_0x1baf33[_0x577906(0x154)](_0x49fa02['length']));console[_0x577906(0x116)]();const _0x439419=[],_0x4b2cf6=Date[_0x577906(0x19d)](),_0x4ec5a6=createCommandSpinner(_0x577906(0x18b));if(_0x357fd2[_0x577906(0x172)]>0x0)try{const _0x440084=await reevaluateFromCache(_0x18d160['llm'],_0x40c81a,{'tests':_0x357fd2},{'evaluatorId':_0x1b3083,'onTestStart':(_0x45f2ef,_0x288fa4,_0xa074bd)=>{const _0x4255e5=_0x577906;_0x4ec5a6[_0x4255e5(0x196)]=_0x4255e5(0x16d)+(_0x288fa4+0x1)+'/'+_0xa074bd+':\x20'+_0x45f2ef+'...';if(!_0x4ec5a6['isSpinning'])_0x4ec5a6['start']();},'onTestComplete':(_0x4ee168,_0x128f8f)=>{const _0x4a5e32=_0x577906;_0x4ec5a6['stop']();if(_0x128f8f[_0x4a5e32(0x187)]===_0x4a5e32(0x17d))console[_0x4a5e32(0x116)](a5_0x1baf33[_0x4a5e32(0x15b)](_0x4a5e32(0x17f)+_0x4ee168)+a5_0x1baf33[_0x4a5e32(0x146)](_0x4a5e32(0x189)));else _0x128f8f[_0x4a5e32(0x187)]===_0x4a5e32(0x17c)?console['log'](a5_0x1baf33[_0x4a5e32(0x18a)](_0x4a5e32(0x184)+_0x4ee168+_0x4a5e32(0x118)+_0x128f8f[_0x4a5e32(0x152)])+a5_0x1baf33['dim'](_0x4a5e32(0x189))):console[_0x4a5e32(0x116)](a5_0x1baf33[_0x4a5e32(0x18a)]('✗\x20ERROR:\x20'+_0x4ee168+_0x4a5e32(0x118)+_0x128f8f[_0x4a5e32(0x152)]));_0x128f8f[_0x4a5e32(0x138)]&&console[_0x4a5e32(0x116)](a5_0x1baf33[_0x4a5e32(0x146)]('\x20\x20Conversation:\x20'+_0x128f8f[_0x4a5e32(0x138)])),_0x439419['push'](_0x128f8f);},'onTestSkipped':(_0x1de4e8,_0x4d79b8)=>{const _0x5a3798=_0x577906;_0x4ec5a6[_0x5a3798(0x13f)](),console[_0x5a3798(0x116)](a5_0x1baf33[_0x5a3798(0x154)](_0x5a3798(0x139)+_0x1de4e8+_0x5a3798(0x118)+_0x4d79b8));}});for(const _0x1279fc of _0x440084){!_0x439419[_0x577906(0x12b)](_0x28e488=>_0x28e488['name']===_0x1279fc['name'])&&_0x439419[_0x577906(0x149)](_0x1279fc);}}catch(_0x4ec44a){_0x4ec5a6[_0x577906(0x13f)]();const _0xa1e73a=_0x4ec44a instanceof Error?_0x4ec44a[_0x577906(0x19a)]:String(_0x4ec44a);return console['log'](a5_0x1baf33[_0x577906(0x18a)]('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0xa1e73a)),0x1;}_0x4ec5a6[_0x577906(0x13f)]();if(_0x49fa02[_0x577906(0x172)]>0x0){console[_0x577906(0x116)](),console[_0x577906(0x116)](a5_0x1baf33[_0x577906(0x14f)](_0x577906(0x124)));const {projectId:_0x2b8356,agentId:_0x25bee6}=_0x40c81a[_0x577906(0x126)];for(const _0x352129 of _0x49fa02){console[_0x577906(0x116)]('Running:\x20'+a5_0x1baf33['white'](_0x352129[_0x577906(0x176)]));const _0x3367e1=createCommandSpinner(_0x577906(0x19f)+_0x352129[_0x577906(0x174)][_0x577906(0x172)]+_0x577906(0x10e));_0x3367e1['start']();try{const {result:_0x2391cf}=await runTest(_0x18d160[_0x577906(0x11f)],_0x352129,{'agentId':_0x25bee6,'projectId':_0x2b8356,'site':_0x40c81a[_0x577906(0x155)],'noEval':![],'evaluatorId':_0x1b3083,'onRoundStart':(_0x23bed3,_0x4c6766)=>{const _0x307e7a=_0x577906;_0x3367e1['text']='Round\x20'+(_0x23bed3+0x1)+'/'+_0x4c6766+_0x307e7a(0x10e);},'onRoundComplete':(_0x192f28,_0x246045,_0x54e5c8)=>{const _0x376aef=_0x577906,_0x47eec2=formatElapsed(_0x246045);_0x54e5c8?console[_0x376aef(0x116)](_0x376aef(0x159)+(_0x192f28+0x1)+'/'+_0x352129[_0x376aef(0x174)][_0x376aef(0x172)]+_0x376aef(0x131)+a5_0x1baf33['green']('✓')+'\x20('+_0x47eec2+')'):console['log']('\x20\x20Round\x20'+(_0x192f28+0x1)+'/'+_0x352129[_0x376aef(0x174)]['length']+'...\x20'+a5_0x1baf33['red']('✗'));},'onEvaluationStart':()=>{const _0x1eedbe=_0x577906;_0x3367e1[_0x1eedbe(0x196)]=_0x1eedbe(0x11e);},'onEvaluationComplete':_0x31a2dd=>{const _0x1d312d=_0x577906,_0x58fc59=formatElapsed(_0x31a2dd);console['log'](_0x1d312d(0x181)+a5_0x1baf33[_0x1d312d(0x15b)]('✓')+'\x20('+_0x58fc59+')');}});_0x3367e1[_0x577906(0x13f)](),_0x439419[_0x577906(0x149)](_0x2391cf);if(_0x2391cf[_0x577906(0x187)]===_0x577906(0x17d))console[_0x577906(0x116)](a5_0x1baf33[_0x577906(0x15b)]('✓\x20PASS:\x20'+_0x2391cf[_0x577906(0x152)])+a5_0x1baf33[_0x577906(0x146)]('\x20(new)'));else _0x2391cf[_0x577906(0x187)]==='FAIL'?console[_0x577906(0x116)](a5_0x1baf33[_0x577906(0x18a)](_0x577906(0x184)+_0x2391cf['reason'])+a5_0x1baf33[_0x577906(0x146)](_0x577906(0x136))):console[_0x577906(0x116)](a5_0x1baf33[_0x577906(0x18a)](_0x577906(0x110)+_0x2391cf[_0x577906(0x152)]));_0x2391cf['conversation_url']&&console[_0x577906(0x116)](a5_0x1baf33['dim']('\x20\x20Conversation:\x20'+_0x2391cf[_0x577906(0x138)]));}catch(_0x4206c4){_0x3367e1['stop']();const _0x247045=_0x4206c4 instanceof Error?_0x4206c4[_0x577906(0x19a)]:String(_0x4206c4);console[_0x577906(0x116)](a5_0x1baf33[_0x577906(0x18a)](_0x577906(0x110)+_0x247045)),_0x439419[_0x577906(0x149)]({'name':_0x352129['name'],'status':_0x577906(0x199),'reason':_0x247045,'timestamp':new Date()[_0x577906(0x1a1)](),'duration_ms':0x0});}}}console[_0x577906(0x116)]();const _0xf899cd=Date[_0x577906(0x19d)]()-_0x4b2cf6,_0x4572aa=_0x439419[_0x577906(0x12c)](_0x3451cd=>_0x3451cd[_0x577906(0x187)]===_0x577906(0x17d))['length'],_0xeb2708=_0x439419[_0x577906(0x12c)](_0x27599d=>_0x27599d[_0x577906(0x187)]==='FAIL')[_0x577906(0x172)],_0x4927e0=_0x439419[_0x577906(0x12c)](_0x567f43=>_0x567f43['status']===_0x577906(0x199))['length'];console[_0x577906(0x116)]('━'['repeat'](0x3c)),console[_0x577906(0x116)](_0x577906(0x18e)),console[_0x577906(0x116)]('━'[_0x577906(0x167)](0x3c)),console[_0x577906(0x116)]('Total:\x20\x20\x20\x20'+_0x439419[_0x577906(0x172)]),console[_0x577906(0x116)](_0x577906(0x1a2)+a5_0x1baf33[_0x577906(0x15b)](_0x4572aa)),console['log'](_0x577906(0x13b)+a5_0x1baf33[_0x577906(0x18a)](_0xeb2708));_0x4927e0>0x0&&console['log'](_0x577906(0x13c)+a5_0x1baf33[_0x577906(0x18a)](_0x4927e0));console[_0x577906(0x116)]('Duration:\x20'+formatElapsed(_0xf899cd)),console[_0x577906(0x116)]('━'['repeat'](0x3c));const _0x3bbe27={'summary':{'total':_0x439419[_0x577906(0x172)],'passed':_0x4572aa,'failed':_0xeb2708,'errors':_0x4927e0>0x0?_0x4927e0:undefined,'duration_ms':_0xf899cd},'tests':_0x439419,'agent':{'project':_0x39958b[_0x577906(0x183)],'name':_0x39958b[_0x577906(0x15c)],'site':_0x2bcd71},'timestamp':new Date(_0x4b2cf6)['toISOString']()};if(_0x37eced!==_0x577906(0x185)||_0x32269f){const _0x380af3=formatResults(_0x3bbe27,_0x37eced);if(_0x32269f)try{a5_0x5e03f6[_0x577906(0x143)](_0x32269f,_0x380af3,_0x577906(0x148)),console[_0x577906(0x116)](),console['log'](a5_0x1baf33['dim'](_0x577906(0x19c)+_0x32269f));}catch(_0x14cd40){return console[_0x577906(0x116)](),console[_0x577906(0x116)](a5_0x1baf33[_0x577906(0x18a)](_0x577906(0x12a)+_0x14cd40)),0x1;}else console[_0x577906(0x116)](),console[_0x577906(0x116)](_0x380af3);}const _0x53f279=_0x439419['filter'](_0x8d2780=>_0x8d2780[_0x577906(0x187)]!==_0x577906(0x17d));return _0x53f279[_0x577906(0x172)]>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0x8a54d7=a5_0x28bc;(function(_0xe88f86,_0x2116b2){const _0x4623ad=a5_0x28bc,_0x1fedad=_0xe88f86();while(!![]){try{const _0x3aad07=parseInt(_0x4623ad(0x1f1))/0x1+parseInt(_0x4623ad(0x1a2))/0x2*(parseInt(_0x4623ad(0x1c5))/0x3)+parseInt(_0x4623ad(0x1ce))/0x4*(-parseInt(_0x4623ad(0x1bf))/0x5)+parseInt(_0x4623ad(0x1c4))/0x6+-parseInt(_0x4623ad(0x19f))/0x7+parseInt(_0x4623ad(0x1b4))/0x8*(parseInt(_0x4623ad(0x1d7))/0x9)+parseInt(_0x4623ad(0x199))/0xa*(-parseInt(_0x4623ad(0x1d2))/0xb);if(_0x3aad07===_0x2116b2)break;else _0x1fedad['push'](_0x1fedad['shift']());}catch(_0x385ae8){_0x1fedad['push'](_0x1fedad['shift']());}}}(a5_0x50b5,0x6df74));function a5_0x28bc(_0x56c46d,_0x5c8d0e){_0x56c46d=_0x56c46d-0x171;const _0x50b5c3=a5_0x50b5();let _0x28bc16=_0x50b5c3[_0x56c46d];return _0x28bc16;}import*as a5_0x2da925 from'node:fs';import*as a5_0x3ddc4f from'node:path';function a5_0x50b5(){const _0x5ccd6c=['\x20\x20Project:\x20','✗\x20ERROR:\x20','resolveProjectId','tags','\x22,\x20but\x20current\x20site\x20is\x20\x22','forEach','Round\x201/','Using\x20agent:\x20','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','dim','dryRun','agentName','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','ERROR','No\x20tests\x20have\x20tags\x20defined.','status','testName','red','PASS','description','502495tUIraq','now','split','Test\x20Configuration:','site','/<agent-name>','Available\x20tags:\x20','tsv','No\x20tests\x20found\x20with\x20tags:\x20','has','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','Usage:','verbose','toISOString','\x20\x20Site:\x20','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Test\x20Summary','source','text','...','Failed:\x20\x20\x20','Executing\x20new\x20tests...','repeat','Run\x20tests\x20for\x20an\x20LLM\x20agent','stop','no_context','Output\x20written\x20to:\x20','Agent:\x20','map','llm','cyan','FAIL','\x20\x20Evaluating...\x20','yellow','Running\x20test:\x20','Total:\x20\x20\x20\x20','no_tests','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','resolve','\x20-\x20','Re-evaluating...','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','projectDir','utf-8','log','not\x20found','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Cached\x20run\x20from:\x20','Conversation\x20URL:\x20',':\x20Sending\x20user\x20input...','\x20\x20Conversation:\x20','⚠\x20SKIPPED:\x20','Error\x20writing\x20output\x20file:\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)','conversation_url','agent:test','rounds','✓\x20PASS:\x20','json','message','69540ymUzXh','Errors:\x20\x20\x20','Round\x20','toLowerCase','Running\x20agent\x20tests...','some','2392383wUxCCq','conversations','Failed\x20Tests:','25272OHCOPr','\x20\x20Round\x20','projectName','no_local_folder','\x20\x20Agent:\x20','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','filter','reason','New\x20tests\x20to\x20execute:\x20','start','push','includes','substring','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','Either\x20switch\x20to\x20the\x20\x22','Run\x20\x27tdx\x20agent\x20pull\x20','\x20\x20-\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','136zFVxjo','white','table','agentDirs','executeReeval','basename','Available\x20tests:\x20','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path','timestamp','Evaluating\x20response...','5OJioQg','...\x20','trim','\x20(new)','test.yml','2092248hGmdRh','33gzJWUQ','Tests\x20found:\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','length','Test\x20','testYmlPath','name','llmProject','green','844964hQLVXW','tests','add','Site:\x20','1067YeMtBv','Error:\x20No\x20previous\x20test\x20run\x20found.','\x20(cached)','\x22:\x20','Passed:\x20\x20\x20','364113HLEogR','✗\x20FAIL:\x20','eval','agent','writeFileSync','Duration:\x20'];a5_0x50b5=function(){return _0x5ccd6c;};return a5_0x50b5();}import a5_0x11c4db 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_0x8a54d7(0x1cb)]=a5_0x8a54d7(0x194);[a5_0x8a54d7(0x1f0)]=a5_0x8a54d7(0x174);async['execute'](_0x8cf3e9){const _0x4cabfe=a5_0x8a54d7,{options:_0x2998fc,args:_0x479d98,tdx:_0x132b09}=_0x8cf3e9,_0x4bc195=_0x479d98[0x0]||'.',_0x47737f=_0x2998fc[_0x4cabfe(0x1e7)],_0x318702=_0x2998fc,_0x2faaf9=_0x318702[_0x4cabfe(0x1d9)]===![],_0x4ec25e=_0x318702['reeval'],_0x205567=_0x318702['name'],_0x3b0d3c=_0x318702[_0x4cabfe(0x1e0)],_0x1d74e8=_0x2998fc[_0x4cabfe(0x1f5)],_0x47566f=_0x318702['output'];if(_0x4ec25e&&_0x2faaf9)return console[_0x4cabfe(0x189)](a5_0x11c4db[_0x4cabfe(0x1ee)](_0x4cabfe(0x1fb))),0x1;let _0xffdc17=_0x4cabfe(0x1b6);if(_0x318702[_0x4cabfe(0x197)])_0xffdc17=_0x4cabfe(0x197);else{if(_0x318702['jsonl'])_0xffdc17='jsonl';else{if(_0x318702['tsv'])_0xffdc17=_0x4cabfe(0x1f8);else{if(_0x318702[_0x4cabfe(0x1b6)])_0xffdc17=_0x4cabfe(0x1b6);}}}const _0x572aa4=_0x318702['llmProject'];let _0x3d97ab=_0x4bc195;const _0xc50f14=a5_0x2da925['existsSync'](_0x4bc195),_0x544d4a=_0x4bc195==='.';if(!_0xc50f14||_0x544d4a){const _0x41780a=resolveProjectFromContext(_0x4bc195,_0x572aa4,{'requireFile':_0x4cabfe(0x1c3)});if(_0x41780a['found'])_0x3d97ab=_0x41780a['projectDir'],_0x41780a[_0x4cabfe(0x202)]==='context'&&console[_0x4cabfe(0x189)](a5_0x11c4db[_0x4cabfe(0x1e6)](_0x4cabfe(0x1e4)+_0x3d97ab));else switch(_0x41780a[_0x4cabfe(0x1a9)]){case _0x4cabfe(0x176):console[_0x4cabfe(0x189)](a5_0x11c4db[_0x4cabfe(0x17e)](_0x41780a[_0x4cabfe(0x198)])),console[_0x4cabfe(0x189)](),console[_0x4cabfe(0x189)](_0x4cabfe(0x1fc)),console['log'](_0x4cabfe(0x1bc)),console[_0x4cabfe(0x189)](_0x4cabfe(0x192)),console[_0x4cabfe(0x189)](),console[_0x4cabfe(0x189)](_0x4cabfe(0x200));return 0x1;case _0x4cabfe(0x1a5):console[_0x4cabfe(0x189)](a5_0x11c4db[_0x4cabfe(0x17e)](_0x41780a['message'])),console['log'](),console[_0x4cabfe(0x189)](_0x4cabfe(0x1b1)+_0x41780a[_0x4cabfe(0x1cc)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');return 0x1;case'multiple_agents':{const _0x58f6e8=a5_0x3ddc4f[_0x4cabfe(0x1b9)](_0x41780a[_0x4cabfe(0x187)]);console[_0x4cabfe(0x189)](a5_0x11c4db[_0x4cabfe(0x17e)]('Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22'+_0x41780a[_0x4cabfe(0x1cc)]+'\x22:'));for(const _0x53b74b of _0x41780a[_0x4cabfe(0x1b7)]){console[_0x4cabfe(0x189)](_0x4cabfe(0x1b2)+_0x53b74b);}return console[_0x4cabfe(0x189)](),console['log'](_0x4cabfe(0x1a7)+_0x58f6e8+_0x4cabfe(0x1f6)),0x1;}case _0x4cabfe(0x181):console['log'](a5_0x11c4db[_0x4cabfe(0x17e)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x41780a[_0x4cabfe(0x1cc)]+'\x22.')),console[_0x4cabfe(0x189)](a5_0x11c4db[_0x4cabfe(0x1e6)]('Project\x20path:\x20'+_0x41780a[_0x4cabfe(0x187)])),console[_0x4cabfe(0x189)](),console[_0x4cabfe(0x189)]('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0x315420,agentInfo:_0x4f92ea}=parseTestFile(_0x3d97ab);let _0x96760b=_0x315420[_0x4cabfe(0x1cf)];if(_0x205567){const _0x4534c3=_0x205567[_0x4cabfe(0x1f3)](',')[_0x4cabfe(0x179)](_0x3d486d=>_0x3d486d[_0x4cabfe(0x1c1)]());_0x96760b=_0x315420[_0x4cabfe(0x1cf)][_0x4cabfe(0x1a8)](_0x562b40=>_0x4534c3[_0x4cabfe(0x1ad)](_0x562b40[_0x4cabfe(0x1cb)]));if(_0x96760b[_0x4cabfe(0x1c8)]===0x0)return console['log'](a5_0x11c4db['yellow']('No\x20tests\x20found\x20matching:\x20'+_0x205567)),console[_0x4cabfe(0x189)](a5_0x11c4db[_0x4cabfe(0x1e6)](_0x4cabfe(0x1ba)+_0x315420['tests']['map'](_0x40cae0=>_0x40cae0['name'])['join'](',\x20'))),0x1;}if(_0x3b0d3c){const _0x51d5a2=_0x3b0d3c[_0x4cabfe(0x1f3)](',')['map'](_0x396204=>_0x396204['trim']()[_0x4cabfe(0x19c)]());_0x96760b=_0x96760b[_0x4cabfe(0x1a8)](_0x1992df=>_0x1992df[_0x4cabfe(0x1e0)]?.[_0x4cabfe(0x19e)](_0x1632ff=>_0x51d5a2[_0x4cabfe(0x1ad)](_0x1632ff['toLowerCase']())));if(_0x96760b[_0x4cabfe(0x1c8)]===0x0){console[_0x4cabfe(0x189)](a5_0x11c4db[_0x4cabfe(0x17e)](_0x4cabfe(0x1f9)+_0x3b0d3c));const _0x3e26e5=new Set();return _0x315420[_0x4cabfe(0x1cf)]['forEach'](_0x39fa56=>_0x39fa56[_0x4cabfe(0x1e0)]?.[_0x4cabfe(0x1e2)](_0x428e56=>_0x3e26e5[_0x4cabfe(0x1d0)](_0x428e56))),_0x3e26e5['size']>0x0?console[_0x4cabfe(0x189)](a5_0x11c4db[_0x4cabfe(0x1e6)](_0x4cabfe(0x1f7)+[..._0x3e26e5]['join'](',\x20'))):console[_0x4cabfe(0x189)](a5_0x11c4db['dim'](_0x4cabfe(0x1eb))),0x1;}}if(_0x4ec25e)return this[_0x4cabfe(0x1b8)](_0x8cf3e9,{'definition':{'tests':_0x96760b},'agentInfo':_0x4f92ea,'outputFormat':_0xffdc17,'outputFile':_0x47566f,'testNames':_0x205567});if(_0x47737f){console[_0x4cabfe(0x189)](a5_0x11c4db[_0x4cabfe(0x17b)](_0x4cabfe(0x1f4))),console[_0x4cabfe(0x189)](_0x4cabfe(0x1ff)+a5_0x11c4db['white'](_0x1d74e8)),console[_0x4cabfe(0x189)](_0x4cabfe(0x1dd)+a5_0x11c4db[_0x4cabfe(0x1b5)](_0x4f92ea[_0x4cabfe(0x1a4)])),console[_0x4cabfe(0x189)](_0x4cabfe(0x1a6)+a5_0x11c4db['white'](_0x4f92ea[_0x4cabfe(0x1e8)])),console['log'](),console[_0x4cabfe(0x189)](_0x4cabfe(0x1c6)+a5_0x11c4db[_0x4cabfe(0x1b5)](_0x96760b[_0x4cabfe(0x1c8)]));for(let _0x3f2574=0x0;_0x3f2574<_0x96760b['length'];_0x3f2574++){const _0x4f7d46=_0x96760b[_0x3f2574],_0x5546f1=_0x4f7d46[_0x4cabfe(0x195)][_0x4cabfe(0x1c8)]===0x1?'round':_0x4cabfe(0x195),_0x46ef29=_0x4f7d46[_0x4cabfe(0x1e0)]?.[_0x4cabfe(0x1c8)]?'\x20['+_0x4f7d46[_0x4cabfe(0x1e0)]['join'](',\x20')+']':'';console[_0x4cabfe(0x189)]('\x20\x20'+(_0x3f2574+0x1)+'.\x20'+a5_0x11c4db['white'](_0x4f7d46['name'])+'\x20('+_0x4f7d46[_0x4cabfe(0x195)][_0x4cabfe(0x1c8)]+'\x20'+_0x5546f1+')'+a5_0x11c4db[_0x4cabfe(0x1e6)](_0x46ef29));}return 0x0;}let _0x42578a,_0x36eb65;try{_0x42578a=await _0x132b09[_0x4cabfe(0x17a)][_0x4cabfe(0x1df)](_0x4f92ea[_0x4cabfe(0x1a4)]);}catch(_0x540dde){const _0x4cca5c=_0x540dde instanceof Error?_0x540dde[_0x4cabfe(0x198)]:String(_0x540dde);return _0x4cca5c[_0x4cabfe(0x1ad)]('404')||_0x4cca5c[_0x4cabfe(0x19c)]()[_0x4cabfe(0x1ad)](_0x4cabfe(0x18a))?console[_0x4cabfe(0x189)](a5_0x11c4db[_0x4cabfe(0x1ee)](_0x4cabfe(0x1b3)+_0x4f92ea[_0x4cabfe(0x1a4)])):console[_0x4cabfe(0x189)](a5_0x11c4db[_0x4cabfe(0x1ee)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0x4f92ea[_0x4cabfe(0x1a4)]+_0x4cabfe(0x1d5)+_0x4cca5c)),0x1;}try{_0x36eb65=await _0x132b09[_0x4cabfe(0x17a)]['resolveAgentId'](_0x4f92ea[_0x4cabfe(0x1e8)],_0x42578a);}catch(_0x568780){const _0x2e97be=_0x568780 instanceof Error?_0x568780[_0x4cabfe(0x198)]:String(_0x568780);return _0x2e97be['includes']('404')||_0x2e97be[_0x4cabfe(0x19c)]()[_0x4cabfe(0x1ad)](_0x4cabfe(0x18a))?console[_0x4cabfe(0x189)](a5_0x11c4db['red'](_0x4cabfe(0x1e5)+_0x4f92ea[_0x4cabfe(0x1e8)])):console[_0x4cabfe(0x189)](a5_0x11c4db[_0x4cabfe(0x1ee)](_0x4cabfe(0x1af)+_0x4f92ea[_0x4cabfe(0x1e8)]+_0x4cabfe(0x1d5)+_0x2e97be)),0x1;}let _0x55f282;if(!_0x2faaf9)try{_0x55f282=await setupEvaluatorAgent(_0x132b09[_0x4cabfe(0x17a)],_0x2998fc['verbose']);}catch(_0x3c2016){const _0x70d3e1=_0x3c2016 instanceof Error?_0x3c2016['message']:String(_0x3c2016);return console['log'](a5_0x11c4db[_0x4cabfe(0x1ee)](_0x4cabfe(0x182)+_0x70d3e1)),0x1;}console[_0x4cabfe(0x189)](a5_0x11c4db[_0x4cabfe(0x17b)](_0x4cabfe(0x19d))),console[_0x4cabfe(0x189)](_0x4cabfe(0x1d1)+a5_0x11c4db[_0x4cabfe(0x1b5)](_0x1d74e8)),console[_0x4cabfe(0x189)]('Agent:\x20'+a5_0x11c4db[_0x4cabfe(0x1b5)](_0x4f92ea['projectName']+'/'+_0x4f92ea[_0x4cabfe(0x1e8)])),console[_0x4cabfe(0x189)]();const _0x39ac5e=[],_0x4a7644=[],_0x39eac6=Date['now']();for(let _0x5330eb=0x0;_0x5330eb<_0x96760b[_0x4cabfe(0x1c8)];_0x5330eb++){const _0x151a7f=_0x96760b[_0x5330eb];_0x96760b[_0x4cabfe(0x1c8)]>0x1?console[_0x4cabfe(0x189)](_0x4cabfe(0x1c9)+(_0x5330eb+0x1)+'/'+_0x96760b[_0x4cabfe(0x1c8)]+':\x20'+a5_0x11c4db['white'](_0x151a7f[_0x4cabfe(0x1cb)])):console[_0x4cabfe(0x189)](_0x4cabfe(0x17f)+a5_0x11c4db[_0x4cabfe(0x1b5)](_0x151a7f[_0x4cabfe(0x1cb)]));const _0x24c968=createCommandSpinner(_0x4cabfe(0x1e3)+_0x151a7f['rounds']['length']+_0x4cabfe(0x18e));_0x24c968[_0x4cabfe(0x1ab)]();try{const {result:_0x5777df,conversation:_0x57f2cf}=await runTest(_0x132b09[_0x4cabfe(0x17a)],_0x151a7f,{'agentId':_0x36eb65,'projectId':_0x42578a,'site':_0x1d74e8,'noEval':_0x2faaf9,'evaluatorId':_0x55f282,'onRoundStart':(_0x56530f,_0x46e7a7)=>{const _0x5ae2fc=_0x4cabfe;_0x24c968[_0x5ae2fc(0x203)]='Round\x20'+(_0x56530f+0x1)+'/'+_0x46e7a7+_0x5ae2fc(0x18e);},'onRoundComplete':(_0x18987a,_0x934ef9,_0x1ed86d)=>{const _0x22f22e=_0x4cabfe,_0x405936=formatElapsed(_0x934ef9);_0x1ed86d?console[_0x22f22e(0x189)]('\x20\x20Round\x20'+(_0x18987a+0x1)+'/'+_0x151a7f['rounds']['length']+'...\x20'+a5_0x11c4db[_0x22f22e(0x1cd)]('✓')+'\x20('+_0x405936+')'):console['log'](_0x22f22e(0x1a3)+(_0x18987a+0x1)+'/'+_0x151a7f[_0x22f22e(0x195)][_0x22f22e(0x1c8)]+_0x22f22e(0x1c0)+a5_0x11c4db[_0x22f22e(0x1ee)]('✗'));},'onEvaluationStart':()=>{_0x24c968['text']='Evaluating\x20response...';},'onEvaluationComplete':_0x4d503e=>{const _0xce1b38=_0x4cabfe,_0x371831=formatElapsed(_0x4d503e);console['log'](_0xce1b38(0x17d)+a5_0x11c4db[_0xce1b38(0x1cd)]('✓')+'\x20('+_0x371831+')');}});_0x24c968[_0x4cabfe(0x175)](),_0x39ac5e[_0x4cabfe(0x1ac)](_0x5777df),_0x4a7644[_0x4cabfe(0x1ac)](_0x57f2cf);if(_0x5777df['status']===_0x4cabfe(0x1ef))console[_0x4cabfe(0x189)](a5_0x11c4db['green'](_0x4cabfe(0x196)+_0x5777df['reason']));else _0x5777df[_0x4cabfe(0x1ec)]===_0x4cabfe(0x17c)?console[_0x4cabfe(0x189)](a5_0x11c4db[_0x4cabfe(0x1ee)]('✗\x20FAIL:\x20'+_0x5777df[_0x4cabfe(0x1a9)])):console[_0x4cabfe(0x189)](a5_0x11c4db['red'](_0x4cabfe(0x1de)+_0x5777df[_0x4cabfe(0x1a9)]));_0x5777df[_0x4cabfe(0x193)]&&console['log'](a5_0x11c4db[_0x4cabfe(0x1e6)](_0x4cabfe(0x18d)+_0x5777df[_0x4cabfe(0x193)])),console[_0x4cabfe(0x189)]();}catch(_0x72564d){_0x24c968[_0x4cabfe(0x175)]();const _0x1a7c1b=_0x72564d instanceof Error?_0x72564d[_0x4cabfe(0x198)]:String(_0x72564d);console[_0x4cabfe(0x189)](a5_0x11c4db[_0x4cabfe(0x1ee)]('✗\x20ERROR:\x20'+_0x1a7c1b)),console['log'](),_0x39ac5e['push']({'name':_0x151a7f[_0x4cabfe(0x1cb)],'status':_0x4cabfe(0x1ea),'reason':_0x1a7c1b,'timestamp':new Date()[_0x4cabfe(0x1fe)](),'duration_ms':0x0});}}const _0x2cc506=Date['now']()-_0x39eac6,_0x2922b0=_0x39ac5e[_0x4cabfe(0x1a8)](_0x5f4a7f=>_0x5f4a7f['status']===_0x4cabfe(0x1ef))[_0x4cabfe(0x1c8)],_0x58e46c=_0x39ac5e[_0x4cabfe(0x1a8)](_0x3f9998=>_0x3f9998[_0x4cabfe(0x1ec)]===_0x4cabfe(0x17c))['length'],_0x5d07f9=_0x39ac5e[_0x4cabfe(0x1a8)](_0x1f830a=>_0x1f830a['status']===_0x4cabfe(0x1ea))['length'];console[_0x4cabfe(0x189)]('━'[_0x4cabfe(0x173)](0x3c)),console[_0x4cabfe(0x189)](_0x4cabfe(0x201)),console[_0x4cabfe(0x189)]('━'[_0x4cabfe(0x173)](0x3c)),console[_0x4cabfe(0x189)]('Total:\x20\x20\x20\x20'+_0x39ac5e[_0x4cabfe(0x1c8)]),console[_0x4cabfe(0x189)]('Passed:\x20\x20\x20'+a5_0x11c4db[_0x4cabfe(0x1cd)](_0x2922b0)),console[_0x4cabfe(0x189)](_0x4cabfe(0x171)+a5_0x11c4db[_0x4cabfe(0x1ee)](_0x58e46c));_0x5d07f9>0x0&&console[_0x4cabfe(0x189)](_0x4cabfe(0x19a)+a5_0x11c4db[_0x4cabfe(0x1ee)](_0x5d07f9));console[_0x4cabfe(0x189)]('Duration:\x20'+formatElapsed(_0x2cc506)),console['log']('━'['repeat'](0x3c));const _0x509e6c=_0x39ac5e[_0x4cabfe(0x1a8)](_0x36047b=>_0x36047b[_0x4cabfe(0x1ec)]!==_0x4cabfe(0x1ef));if(_0x509e6c[_0x4cabfe(0x1c8)]>0x0){console[_0x4cabfe(0x189)](),console[_0x4cabfe(0x189)](_0x4cabfe(0x1a1));for(const _0xa71b80 of _0x509e6c){const _0x850c48=a5_0x11c4db[_0x4cabfe(0x1ee)]('✗'),_0x750624=_0xa71b80[_0x4cabfe(0x1a9)][_0x4cabfe(0x1c8)]>0x32?_0xa71b80[_0x4cabfe(0x1a9)][_0x4cabfe(0x1ae)](0x0,0x32)+_0x4cabfe(0x204):_0xa71b80[_0x4cabfe(0x1a9)];console[_0x4cabfe(0x189)]('\x20\x20'+_0x850c48+'\x20'+_0xa71b80[_0x4cabfe(0x1cb)]+':\x20'+_0x750624);}}const _0x246274={'summary':{'total':_0x39ac5e[_0x4cabfe(0x1c8)],'passed':_0x2922b0,'failed':_0x58e46c,'errors':_0x5d07f9>0x0?_0x5d07f9:undefined,'duration_ms':_0x2cc506},'tests':_0x39ac5e,'agent':{'project':_0x4f92ea[_0x4cabfe(0x1a4)],'name':_0x4f92ea[_0x4cabfe(0x1e8)],'site':_0x1d74e8},'timestamp':new Date(_0x39eac6)[_0x4cabfe(0x1fe)]()};try{const _0x1f7b57=buildCachedTestRun(_0x4a7644,{'site':_0x1d74e8,'projectId':_0x42578a,'projectName':_0x4f92ea[_0x4cabfe(0x1a4)],'agentId':_0x36eb65,'agentName':_0x4f92ea[_0x4cabfe(0x1e8)],'testYmlPath':a5_0x3ddc4f[_0x4cabfe(0x183)](_0x4f92ea[_0x4cabfe(0x1ca)])});saveLastTestRun(_0x1f7b57);}catch{}if(_0xffdc17!=='table'||_0x47566f){const _0x2ba017=formatResults(_0x246274,_0xffdc17);if(_0x47566f)try{a5_0x2da925[_0x4cabfe(0x1db)](_0x47566f,_0x2ba017,_0x4cabfe(0x188)),console[_0x4cabfe(0x189)](),console['log'](a5_0x11c4db[_0x4cabfe(0x1e6)]('Output\x20written\x20to:\x20'+_0x47566f));}catch(_0x16dc33){return console[_0x4cabfe(0x189)](),console['log'](a5_0x11c4db['red']('Error\x20writing\x20output\x20file:\x20'+_0x16dc33)),0x1;}else console[_0x4cabfe(0x189)](),console[_0x4cabfe(0x189)](_0x2ba017);}return _0x509e6c[_0x4cabfe(0x1c8)]>0x0?0x1:0x0;}async[a5_0x8a54d7(0x1b8)](_0x43f85a,_0xa7b10){const _0x3c575b=a5_0x8a54d7,{options:_0x1a4db1,tdx:_0x144906}=_0x43f85a,{definition:_0x199fdc,agentInfo:_0x249889,outputFormat:_0x25c286,outputFile:_0x395227}=_0xa7b10,_0x514770=_0x1a4db1[_0x3c575b(0x1f5)],_0x15121a=loadLastTestRun();if(!_0x15121a)return console['log'](a5_0x11c4db[_0x3c575b(0x1ee)](_0x3c575b(0x1d3))),console[_0x3c575b(0x189)](a5_0x11c4db['dim'](_0x3c575b(0x1c7))),0x1;if(_0x15121a['agent'][_0x3c575b(0x1e8)]!==_0x249889[_0x3c575b(0x1e8)])return console[_0x3c575b(0x189)](a5_0x11c4db['red'](_0x3c575b(0x1bb)+_0x15121a['agent'][_0x3c575b(0x1e8)]+_0x3c575b(0x1e9)+_0x249889[_0x3c575b(0x1e8)]+'\x22.')),console[_0x3c575b(0x189)](a5_0x11c4db[_0x3c575b(0x1e6)]('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x1accad=new Set(_0x15121a[_0x3c575b(0x1a0)][_0x3c575b(0x179)](_0x28318c=>_0x28318c[_0x3c575b(0x1ed)])),_0x2ba020=_0x199fdc['tests'][_0x3c575b(0x1a8)](_0x1dbd8b=>!_0x1accad['has'](_0x1dbd8b[_0x3c575b(0x1cb)]));if(_0x2ba020[_0x3c575b(0x1c8)]>0x0&&_0x15121a[_0x3c575b(0x1f5)]!==_0x514770)return console[_0x3c575b(0x189)](a5_0x11c4db['red'](_0x3c575b(0x186))),console[_0x3c575b(0x189)](a5_0x11c4db['dim']('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x15121a[_0x3c575b(0x1f5)]+_0x3c575b(0x1e1)+_0x514770+'\x22.')),console['log'](a5_0x11c4db[_0x3c575b(0x1e6)](_0x3c575b(0x1b0)+_0x15121a[_0x3c575b(0x1f5)]+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x3dc060=_0x199fdc[_0x3c575b(0x1cf)][_0x3c575b(0x1a8)](_0x5be6f6=>_0x1accad[_0x3c575b(0x1fa)](_0x5be6f6['name'])),_0x24208f=_0x2ba020;let _0x2c3fc9;try{_0x2c3fc9=await setupEvaluatorAgent(_0x144906[_0x3c575b(0x17a)],_0x1a4db1[_0x3c575b(0x1fd)]);}catch(_0x55d0ae){const _0x1849b2=_0x55d0ae instanceof Error?_0x55d0ae['message']:String(_0x55d0ae);return console[_0x3c575b(0x189)](a5_0x11c4db[_0x3c575b(0x1ee)](_0x3c575b(0x182)+_0x1849b2)),0x1;}console[_0x3c575b(0x189)](a5_0x11c4db['cyan']('Re-evaluating\x20cached\x20test\x20run...')),console['log'](_0x3c575b(0x18c)+a5_0x11c4db[_0x3c575b(0x1b5)](_0x15121a[_0x3c575b(0x1bd)])),console[_0x3c575b(0x189)](_0x3c575b(0x178)+a5_0x11c4db['white'](_0x15121a[_0x3c575b(0x1da)][_0x3c575b(0x1a4)]+'/'+_0x15121a[_0x3c575b(0x1da)][_0x3c575b(0x1e8)]));_0x24208f['length']>0x0&&console[_0x3c575b(0x189)](_0x3c575b(0x1aa)+a5_0x11c4db[_0x3c575b(0x17e)](_0x24208f[_0x3c575b(0x1c8)]));console[_0x3c575b(0x189)]();const _0x18e364=[],_0x3fcf5e=Date[_0x3c575b(0x1f2)](),_0x52e5c2=createCommandSpinner(_0x3c575b(0x185));if(_0x3dc060[_0x3c575b(0x1c8)]>0x0)try{const _0x97289e=await reevaluateFromCache(_0x144906[_0x3c575b(0x17a)],_0x15121a,{'tests':_0x3dc060},{'evaluatorId':_0x2c3fc9,'onTestStart':(_0xdd8bbf,_0x19e61b,_0x1fd24b)=>{const _0x56e8a7=_0x3c575b;_0x52e5c2[_0x56e8a7(0x203)]='Re-evaluating\x20'+(_0x19e61b+0x1)+'/'+_0x1fd24b+':\x20'+_0xdd8bbf+'...';if(!_0x52e5c2['isSpinning'])_0x52e5c2['start']();},'onTestComplete':(_0x3d2ba8,_0x8b8773)=>{const _0x31f89e=_0x3c575b;_0x52e5c2[_0x31f89e(0x175)]();if(_0x8b8773[_0x31f89e(0x1ec)]==='PASS')console[_0x31f89e(0x189)](a5_0x11c4db[_0x31f89e(0x1cd)]('✓\x20PASS:\x20'+_0x3d2ba8)+a5_0x11c4db['dim'](_0x31f89e(0x1d4)));else _0x8b8773[_0x31f89e(0x1ec)]===_0x31f89e(0x17c)?console[_0x31f89e(0x189)](a5_0x11c4db[_0x31f89e(0x1ee)](_0x31f89e(0x1d8)+_0x3d2ba8+'\x20-\x20'+_0x8b8773[_0x31f89e(0x1a9)])+a5_0x11c4db[_0x31f89e(0x1e6)](_0x31f89e(0x1d4))):console[_0x31f89e(0x189)](a5_0x11c4db[_0x31f89e(0x1ee)]('✗\x20ERROR:\x20'+_0x3d2ba8+_0x31f89e(0x184)+_0x8b8773[_0x31f89e(0x1a9)]));_0x8b8773[_0x31f89e(0x193)]&&console[_0x31f89e(0x189)](a5_0x11c4db[_0x31f89e(0x1e6)]('\x20\x20Conversation:\x20'+_0x8b8773[_0x31f89e(0x193)])),_0x18e364[_0x31f89e(0x1ac)](_0x8b8773);},'onTestSkipped':(_0x2beb29,_0x3d9c1d)=>{const _0x2bbfbe=_0x3c575b;_0x52e5c2[_0x2bbfbe(0x175)](),console[_0x2bbfbe(0x189)](a5_0x11c4db[_0x2bbfbe(0x17e)](_0x2bbfbe(0x190)+_0x2beb29+_0x2bbfbe(0x184)+_0x3d9c1d));}});for(const _0x550693 of _0x97289e){!_0x18e364['find'](_0x42ee9c=>_0x42ee9c['name']===_0x550693[_0x3c575b(0x1cb)])&&_0x18e364[_0x3c575b(0x1ac)](_0x550693);}}catch(_0x210261){_0x52e5c2['stop']();const _0x816461=_0x210261 instanceof Error?_0x210261[_0x3c575b(0x198)]:String(_0x210261);return console[_0x3c575b(0x189)](a5_0x11c4db[_0x3c575b(0x1ee)](_0x3c575b(0x18b)+_0x816461)),0x1;}_0x52e5c2[_0x3c575b(0x175)]();if(_0x24208f[_0x3c575b(0x1c8)]>0x0){console[_0x3c575b(0x189)](),console['log'](a5_0x11c4db[_0x3c575b(0x17b)](_0x3c575b(0x172)));const {projectId:_0x5cea99,agentId:_0x5ac83f}=_0x15121a[_0x3c575b(0x1da)];for(const _0x39baa3 of _0x24208f){console[_0x3c575b(0x189)]('Running:\x20'+a5_0x11c4db[_0x3c575b(0x1b5)](_0x39baa3[_0x3c575b(0x1cb)]));const _0x3d86b6=createCommandSpinner('Round\x201/'+_0x39baa3['rounds'][_0x3c575b(0x1c8)]+_0x3c575b(0x18e));_0x3d86b6[_0x3c575b(0x1ab)]();try{const {result:_0x24aa1c}=await runTest(_0x144906[_0x3c575b(0x17a)],_0x39baa3,{'agentId':_0x5ac83f,'projectId':_0x5cea99,'site':_0x15121a[_0x3c575b(0x1f5)],'noEval':![],'evaluatorId':_0x2c3fc9,'onRoundStart':(_0x1c4006,_0x3157e5)=>{const _0x151ca2=_0x3c575b;_0x3d86b6[_0x151ca2(0x203)]=_0x151ca2(0x19b)+(_0x1c4006+0x1)+'/'+_0x3157e5+_0x151ca2(0x18e);},'onRoundComplete':(_0x2b8df2,_0x2a7375,_0x1e04cf)=>{const _0x43a705=_0x3c575b,_0x27e1af=formatElapsed(_0x2a7375);_0x1e04cf?console[_0x43a705(0x189)](_0x43a705(0x1a3)+(_0x2b8df2+0x1)+'/'+_0x39baa3['rounds'][_0x43a705(0x1c8)]+'...\x20'+a5_0x11c4db[_0x43a705(0x1cd)]('✓')+'\x20('+_0x27e1af+')'):console['log']('\x20\x20Round\x20'+(_0x2b8df2+0x1)+'/'+_0x39baa3['rounds']['length']+_0x43a705(0x1c0)+a5_0x11c4db[_0x43a705(0x1ee)]('✗'));},'onEvaluationStart':()=>{const _0x35e92b=_0x3c575b;_0x3d86b6['text']=_0x35e92b(0x1be);},'onEvaluationComplete':_0x56b2e0=>{const _0x216357=_0x3c575b,_0x1668b1=formatElapsed(_0x56b2e0);console[_0x216357(0x189)](_0x216357(0x17d)+a5_0x11c4db[_0x216357(0x1cd)]('✓')+'\x20('+_0x1668b1+')');}});_0x3d86b6['stop'](),_0x18e364['push'](_0x24aa1c);if(_0x24aa1c[_0x3c575b(0x1ec)]===_0x3c575b(0x1ef))console['log'](a5_0x11c4db[_0x3c575b(0x1cd)](_0x3c575b(0x196)+_0x24aa1c['reason'])+a5_0x11c4db[_0x3c575b(0x1e6)]('\x20(new)'));else _0x24aa1c[_0x3c575b(0x1ec)]===_0x3c575b(0x17c)?console['log'](a5_0x11c4db[_0x3c575b(0x1ee)]('✗\x20FAIL:\x20'+_0x24aa1c[_0x3c575b(0x1a9)])+a5_0x11c4db['dim'](_0x3c575b(0x1c2))):console[_0x3c575b(0x189)](a5_0x11c4db[_0x3c575b(0x1ee)]('✗\x20ERROR:\x20'+_0x24aa1c['reason']));_0x24aa1c[_0x3c575b(0x193)]&&console[_0x3c575b(0x189)](a5_0x11c4db[_0x3c575b(0x1e6)](_0x3c575b(0x18f)+_0x24aa1c[_0x3c575b(0x193)]));}catch(_0x4e451a){_0x3d86b6[_0x3c575b(0x175)]();const _0x24f4ef=_0x4e451a instanceof Error?_0x4e451a['message']:String(_0x4e451a);console[_0x3c575b(0x189)](a5_0x11c4db[_0x3c575b(0x1ee)](_0x3c575b(0x1de)+_0x24f4ef)),_0x18e364[_0x3c575b(0x1ac)]({'name':_0x39baa3[_0x3c575b(0x1cb)],'status':_0x3c575b(0x1ea),'reason':_0x24f4ef,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console[_0x3c575b(0x189)]();const _0x373e44=Date[_0x3c575b(0x1f2)]()-_0x3fcf5e,_0x50e789=_0x18e364[_0x3c575b(0x1a8)](_0x380e6d=>_0x380e6d[_0x3c575b(0x1ec)]==='PASS')[_0x3c575b(0x1c8)],_0x11765f=_0x18e364['filter'](_0x55916f=>_0x55916f[_0x3c575b(0x1ec)]==='FAIL')[_0x3c575b(0x1c8)],_0xa8ce00=_0x18e364[_0x3c575b(0x1a8)](_0x1ade9d=>_0x1ade9d[_0x3c575b(0x1ec)]==='ERROR')[_0x3c575b(0x1c8)];console['log']('━'[_0x3c575b(0x173)](0x3c)),console[_0x3c575b(0x189)]('Re-evaluation\x20Summary'),console['log']('━'[_0x3c575b(0x173)](0x3c)),console[_0x3c575b(0x189)](_0x3c575b(0x180)+_0x18e364[_0x3c575b(0x1c8)]),console[_0x3c575b(0x189)](_0x3c575b(0x1d6)+a5_0x11c4db[_0x3c575b(0x1cd)](_0x50e789)),console[_0x3c575b(0x189)](_0x3c575b(0x171)+a5_0x11c4db[_0x3c575b(0x1ee)](_0x11765f));_0xa8ce00>0x0&&console['log'](_0x3c575b(0x19a)+a5_0x11c4db['red'](_0xa8ce00));console[_0x3c575b(0x189)](_0x3c575b(0x1dc)+formatElapsed(_0x373e44)),console[_0x3c575b(0x189)]('━'[_0x3c575b(0x173)](0x3c));const _0x17aa07={'summary':{'total':_0x18e364[_0x3c575b(0x1c8)],'passed':_0x50e789,'failed':_0x11765f,'errors':_0xa8ce00>0x0?_0xa8ce00:undefined,'duration_ms':_0x373e44},'tests':_0x18e364,'agent':{'project':_0x249889[_0x3c575b(0x1a4)],'name':_0x249889[_0x3c575b(0x1e8)],'site':_0x514770},'timestamp':new Date(_0x3fcf5e)['toISOString']()};if(_0x25c286!==_0x3c575b(0x1b6)||_0x395227){const _0xbde9d6=formatResults(_0x17aa07,_0x25c286);if(_0x395227)try{a5_0x2da925[_0x3c575b(0x1db)](_0x395227,_0xbde9d6,'utf-8'),console[_0x3c575b(0x189)](),console['log'](a5_0x11c4db[_0x3c575b(0x1e6)](_0x3c575b(0x177)+_0x395227));}catch(_0x3f3844){return console[_0x3c575b(0x189)](),console['log'](a5_0x11c4db['red'](_0x3c575b(0x191)+_0x3f3844)),0x1;}else console[_0x3c575b(0x189)](),console[_0x3c575b(0x189)](_0xbde9d6);}const _0xdc81b5=_0x18e364['filter'](_0x3fb314=>_0x3fb314[_0x3c575b(0x1ec)]!==_0x3c575b(0x1ef));return _0xdc81b5[_0x3c575b(0x1c8)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x2695c8=a6_0x9a10;(function(_0x1baeb1,_0x264cd9){const _0x56ca8b=a6_0x9a10,_0x35115f=_0x1baeb1();while(!![]){try{const _0x5d19f6=parseInt(_0x56ca8b(0x131))/0x1+-parseInt(_0x56ca8b(0x123))/0x2+parseInt(_0x56ca8b(0x129))/0x3+parseInt(_0x56ca8b(0x132))/0x4*(parseInt(_0x56ca8b(0x147))/0x5)+parseInt(_0x56ca8b(0x149))/0x6*(-parseInt(_0x56ca8b(0x136))/0x7)+parseInt(_0x56ca8b(0x144))/0x8*(parseInt(_0x56ca8b(0x107))/0x9)+-parseInt(_0x56ca8b(0x146))/0xa*(parseInt(_0x56ca8b(0x120))/0xb);if(_0x5d19f6===_0x264cd9)break;else _0x35115f['push'](_0x35115f['shift']());}catch(_0x58de30){_0x35115f['push'](_0x35115f['shift']());}}}(a6_0x4cc8,0xc673f));import{BaseCommand}from'./command.js';function a6_0x4cc8(){const _0x439471=['method','has','validate','Invalid\x20HTTP\x20method:\x20','POST','x-trino-user','startsWith','PATCH','includes','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','join','llm','workflow','Endpoint\x20must\x20start\x20with\x20/:\x20','api','proxy-authorization','toUpperCase','substring','cdp','11kUXEnb','Error:\x20','Results\x20saved\x20to\x20','2401118fIzDHl','type','<\x20HTTP/1.1\x20','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','trim','verbose','4734735Wqiyfn','\x22.\x20','stack','.\x20Valid\x20methods:\x20','color','.\x20Valid\x20types:\x20','indexOf','headers','1595914nGtwTW','4228WSGCUo','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','request','DELETE','3379145mkklaP','name','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','readBodyFromFile','log','site','x-xsrf-token','error','status','length','file','entries','output','authorization','1384vNEgQB','Invalid\x20header\x20format:\x20\x22','28346470pdLSKI','7610BkuyVw','isArray','6LoVhKp','x-auth-token','execute','trino','28503KCklSM','noColor','Invalid\x20API\x20type:\x20','GET','cas','body'];a6_0x4cc8=function(){return _0x439471;};return a6_0x4cc8();}import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';function a6_0x9a10(_0x2b676d,_0xa15001){_0x2b676d=_0x2b676d-0x104;const _0x4cc80f=a6_0x4cc8();let _0x9a1005=_0x4cc80f[_0x2b676d];return _0x9a1005;}import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x2695c8(0x143),a6_0x2695c8(0x11c),'cookie','set-cookie','set-cookie2',a6_0x2695c8(0x13c),a6_0x2695c8(0x104),a6_0x2695c8(0x112)]);function isSensitiveHeader(_0x187b0a){const _0x230e32=a6_0x2695c8;return SENSITIVE_HEADERS[_0x230e32(0x10e)](_0x187b0a['toLowerCase']());}function parseHeader(_0x175476){const _0x59e5fc=a6_0x2695c8,_0x1db91b=_0x175476[_0x59e5fc(0x12f)](':');if(_0x1db91b===-0x1)throw new Error(_0x59e5fc(0x145)+_0x175476+_0x59e5fc(0x12a)+_0x59e5fc(0x138));const _0x32bc59=_0x175476[_0x59e5fc(0x11e)](0x0,_0x1db91b)[_0x59e5fc(0x127)](),_0x343fb8=_0x175476['substring'](_0x1db91b+0x1)[_0x59e5fc(0x127)]();if(!_0x32bc59)throw new Error(_0x59e5fc(0x116)+_0x175476+'\x22');return[_0x32bc59,_0x343fb8];}export class ApiCommand extends BaseCommand{[a6_0x2695c8(0x137)]=a6_0x2695c8(0x11b);['description']=a6_0x2695c8(0x126);[a6_0x2695c8(0x10f)](_0x3d3c45){const _0x2a6b86=a6_0x2695c8,{args:_0x1253e7,options:_0x1aead9}=_0x3d3c45,_0x1480f6=_0x1aead9;if(_0x1253e7[_0x2a6b86(0x13f)]===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x2b47d0=_0x1253e7[0x0];if(!_0x2b47d0[_0x2a6b86(0x113)]('/'))return _0x2a6b86(0x11a)+_0x2b47d0;const _0x27883c=_0x1480f6['data'],_0x49d967=_0x1480f6[_0x2a6b86(0x140)];if(_0x27883c&&_0x49d967)return _0x2a6b86(0x133);const _0x1e6701=_0x1480f6[_0x2a6b86(0x10d)]||_0x2a6b86(0x10a),_0x1f88bb=[_0x2a6b86(0x10a),_0x2a6b86(0x111),'PUT',_0x2a6b86(0x135),_0x2a6b86(0x114)];if(!_0x1f88bb[_0x2a6b86(0x115)](_0x1e6701[_0x2a6b86(0x11d)]()))return _0x2a6b86(0x110)+_0x1e6701+_0x2a6b86(0x12c)+_0x1f88bb[_0x2a6b86(0x117)](',\x20');const _0x46e910=_0x1480f6[_0x2a6b86(0x124)]||'td',_0xf9e332=['td',_0x2a6b86(0x11f),_0x2a6b86(0x119),_0x2a6b86(0x106),_0x2a6b86(0x118),'llm-proxy',_0x2a6b86(0x10b)];if(!_0xf9e332['includes'](_0x46e910))return _0x2a6b86(0x109)+_0x46e910+_0x2a6b86(0x12e)+_0xf9e332[_0x2a6b86(0x117)](',\x20');return undefined;}async[a6_0x2695c8(0x105)](_0x2e80df){const _0x1589eb=a6_0x2695c8,{options:_0x9e71,args:_0x3352cd,tdx:_0x27b9c1}=_0x2e80df,_0x34d222=_0x9e71,_0x5bf31a=_0x3352cd[0x0],_0x2806bc=(_0x34d222[_0x1589eb(0x10d)]||'GET')[_0x1589eb(0x11d)](),_0xc07812=_0x34d222['data'],_0x4ab04a=_0x34d222[_0x1589eb(0x140)],_0xafebc4=_0x34d222['header'],_0x2da21f=_0x34d222[_0x1589eb(0x124)]||'td';try{const _0x553caa={};if(_0xafebc4){const _0x2d9db5=Array[_0x1589eb(0x148)](_0xafebc4)?_0xafebc4:[_0xafebc4];for(const _0x451079 of _0x2d9db5){const [_0x44b1c5,_0x42a9cd]=parseHeader(_0x451079);_0x553caa[_0x44b1c5]=_0x42a9cd;}}let _0x13048e;if(_0xc07812)_0x13048e=_0xc07812;else{if(_0x4ab04a)try{_0x13048e=RawAPI[_0x1589eb(0x139)](_0x4ab04a);}catch(_0x36b9d7){return console['error'](_0x1589eb(0x121)+(_0x36b9d7 instanceof Error?_0x36b9d7['message']:String(_0x36b9d7))),0x1;}}const _0xdf6182={'method':_0x2806bc,'apiType':_0x2da21f,'includeHeaders':_0x9e71[_0x1589eb(0x128)]};_0x13048e&&(_0xdf6182[_0x1589eb(0x10c)]=_0x13048e);Object['keys'](_0x553caa)[_0x1589eb(0x13f)]>0x0&&(_0xdf6182[_0x1589eb(0x130)]=_0x553caa);if(_0x9e71[_0x1589eb(0x128)]){const _0x559325=resolveSite(_0x9e71[_0x1589eb(0x13b)]),_0x52c4a9=getEndpoint(_0x559325,_0x2da21f),_0x3372cc=''+_0x52c4a9+_0x5bf31a;console['error']('>\x20'+_0x2806bc+'\x20'+_0x3372cc);const _0x24425c=getAuthHeaders(_0x559325),_0x439ec1={..._0x24425c,..._0x553caa};for(const [_0x32ea9e,_0x11d450]of Object[_0x1589eb(0x141)](_0x439ec1)){!isSensitiveHeader(_0x32ea9e)&&console[_0x1589eb(0x13d)]('>\x20'+_0x32ea9e+':\x20'+_0x11d450);}_0x13048e&&console[_0x1589eb(0x13d)]('>'),console[_0x1589eb(0x13d)]('');}const _0x252151=await _0x27b9c1['api'][_0x1589eb(0x134)](_0x5bf31a,_0xdf6182);if(_0x9e71['verbose']&&_0x252151[_0x1589eb(0x130)]){console['error'](_0x1589eb(0x125)+_0x252151[_0x1589eb(0x13e)]);for(const [_0x4669ae,_0x2609da]of Object[_0x1589eb(0x141)](_0x252151[_0x1589eb(0x130)])){!isSensitiveHeader(_0x4669ae)&&console[_0x1589eb(0x13d)]('<\x20'+_0x4669ae+':\x20'+_0x2609da);}console['error']('');}const _0x3b236c=Boolean(_0x9e71[_0x1589eb(0x142)]),_0x29997e={'color':_0x9e71[_0x1589eb(0x12d)],'noColor':_0x9e71[_0x1589eb(0x108)]||_0x3b236c&&!_0x9e71[_0x1589eb(0x12d)]},_0x96fc4f=colorizeJSON(_0x252151['data'],_0x29997e);return _0x9e71[_0x1589eb(0x142)]?(writeFileSync(_0x9e71['output'],_0x96fc4f),console[_0x1589eb(0x13d)](_0x1589eb(0x122)+_0x9e71[_0x1589eb(0x142)])):console[_0x1589eb(0x13a)](_0x96fc4f),0x0;}catch(_0xe8da42){return _0xe8da42 instanceof Error?(console['error'](_0x1589eb(0x121)+_0xe8da42['message']),_0x9e71[_0x1589eb(0x128)]&&_0xe8da42[_0x1589eb(0x12b)]&&console[_0x1589eb(0x13d)]('\x0aStack\x20trace:\x0a'+_0xe8da42[_0x1589eb(0x12b)])):console[_0x1589eb(0x13d)]('Error:\x20'+String(_0xe8da42)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a7_0x46155f=a7_0x36d3;(function(_0x2ab790,_0x137335){const _0x5df04b=a7_0x36d3,_0x936391=_0x2ab790();while(!![]){try{const _0x9d6e7a=-parseInt(_0x5df04b(0x123))/0x1*(-parseInt(_0x5df04b(0x110))/0x2)+-parseInt(_0x5df04b(0x11b))/0x3*(-parseInt(_0x5df04b(0x160))/0x4)+parseInt(_0x5df04b(0x145))/0x5+-parseInt(_0x5df04b(0x150))/0x6+-parseInt(_0x5df04b(0x146))/0x7+-parseInt(_0x5df04b(0x151))/0x8*(-parseInt(_0x5df04b(0x124))/0x9)+-parseInt(_0x5df04b(0x116))/0xa;if(_0x9d6e7a===_0x137335)break;else _0x936391['push'](_0x936391['shift']());}catch(_0x30fbf2){_0x936391['push'](_0x936391['shift']());}}}(a7_0x21e8,0x1e74d));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';import{clearCredentialCache}from'../core/credential-cache.js';import{startOAuthFlow}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x316510 from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';function a7_0x21e8(){const _0x2e6a3d=['32330cKqCRX','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','/users/initiate_sso\x20(account:\x20','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','account_id','dim','3154790jPySlz','status','create','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','Credential\x20type:\x20OAuth','30khnTho','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','execute','apiKey','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','Enter\x20your\x20TD\x20API\x20key:','tdx\x20profile:\x20','red','1tiZLqA','168516ftRARk','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','\x0aSetup\x20cancelled','\x20for\x20profile:\x20','email','ERROR','logLevel','first_name','all','N/A','jobs','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','Opening\x20browser\x20for\x20authentication...','\x20\x20user_id:','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','✓\x20Authentication\x20successful\x0a','✓\x20Profile\x20\x27','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','System\x20keychain\x20is\x20not\x20available','Setting\x20up\x20authentication\x20for\x20site:\x20','accountName','\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','yellow','Setup\x20API\x20key\x20authentication\x20interactively','getUserInfo','\x20\x20(','log','last_name','For\x20scripts\x20or\x20headless\x20servers','access_token','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','description','Read\x20credential\x20from\x20keychain','968775OTDHCr','474845qAOycd','/oauth/authorize','Read\x20credential\x20from\x20','site','text','password','✓\x20Default\x20site\x20set\x20to\x20','API\x20key','trim','API\x20key\x20cannot\x20be\x20empty','650298qgVUTB','72EAAgUt','method','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','filter','\x20(site:\x20','/app/mp/ak','cyan','User:\x20','auth','Setup\x20cancelled','green','profile','warn','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','error','95204kdfmki','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','Remove\x20API\x20key\x20from\x20system\x20keychain','us01','name','\x20(profile:\x20','✗\x20Validation\x20failed:\x20','\x20--profile\x20','Name:\x20','message','\x20removed\x20from\x20keychain','\x20\x20tdx','You\x20can\x20find\x20your\x20API\x20key\x20at:','join','Use\x20an\x20API\x20key','apikey'];a7_0x21e8=function(){return _0x2e6a3d;};return a7_0x21e8();}import{LogLevel}from'../utils/tdx-logger.js';import a7_0x4558ce from'chalk';function a7_0x36d3(_0x37996f,_0x173287){_0x37996f=_0x37996f-0x10a;const _0x21e8e0=a7_0x21e8();let _0x36d321=_0x21e8e0[_0x37996f];return _0x36d321;}export async function runOAuthLoginFlow(_0x382068,_0x22b2ec,_0xb2d76c,_0x188b59){const _0xc9adb7=a7_0x36d3,_0x10d1ac=await isKeychainAvailable();if(!_0x10d1ac)throw new Error(_0xc9adb7(0x12f)+_0xc9adb7(0x161));let _0x43cc56=_0x188b59?.[_0xc9adb7(0x138)];if(!_0x43cc56){const _0x174569=await a7_0x316510({'type':_0xc9adb7(0x14a),'name':'accountName','message':_0xc9adb7(0x11f)});if(_0x174569[_0xc9adb7(0x138)]===undefined)throw new Error('Setup\x20cancelled');_0x43cc56=_0x174569[_0xc9adb7(0x138)][_0xc9adb7(0x14e)]()||undefined;}const _0x46df96=getConsoleUrl(_0x382068);console[_0xc9adb7(0x13e)](_0xc9adb7(0x130));_0x43cc56?console['log']('\x20\x20'+_0x46df96+_0xc9adb7(0x112)+_0x43cc56+')'):console[_0xc9adb7(0x13e)]('\x20\x20'+_0x46df96+_0xc9adb7(0x147));console['log'](_0xc9adb7(0x132));const _0x366864=await startOAuthFlow(_0x382068,{'accountName':_0x43cc56});console[_0xc9adb7(0x13e)]('Validating\x20OAuth\x20tokens...');const _0x50af8c=TDX['create']({'site':_0x382068,'accessToken':_0x366864[_0xc9adb7(0x141)],'logLevel':_0xb2d76c??LogLevel[_0xc9adb7(0x129)]}),_0x39b725=await _0x50af8c[_0xc9adb7(0x12e)][_0xc9adb7(0x13c)]();console[_0xc9adb7(0x13e)](a7_0x4558ce[_0xc9adb7(0x15b)]('✓\x20Signed\x20in\x20successfully')),console[_0xc9adb7(0x13e)]('\x20\x20'+a7_0x4558ce[_0xc9adb7(0x157)](_0x382068+':'+_0x39b725[_0xc9adb7(0x114)])+_0xc9adb7(0x131)+_0x39b725['id']+_0xc9adb7(0x13d)+_0x39b725[_0xc9adb7(0x128)]+')');!_0x43cc56&&(console[_0xc9adb7(0x13e)](a7_0x4558ce[_0xc9adb7(0x115)](_0xc9adb7(0x139))),console[_0xc9adb7(0x13e)](a7_0x4558ce[_0xc9adb7(0x115)](_0xc9adb7(0x113))),console[_0xc9adb7(0x13e)](a7_0x4558ce['dim'](_0xc9adb7(0x119))));await saveOAuthTokens(_0x366864,_0x22b2ec),console[_0xc9adb7(0x13e)]('✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain'+(_0x22b2ec?_0xc9adb7(0x165)+_0x22b2ec+')':''));if(_0x22b2ec){const _0x5bf4bb={'site':_0x382068};saveProfileToUserConfig(_0x22b2ec,_0x5bf4bb),console[_0xc9adb7(0x13e)](_0xc9adb7(0x134)+_0x22b2ec+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x382068),console[_0xc9adb7(0x13e)](_0xc9adb7(0x14c)+_0x382068);const _0x1c4c30=_0x22b2ec?'\x20--profile\x20'+_0x22b2ec:'';console[_0xc9adb7(0x13e)](),console[_0xc9adb7(0x13e)](_0xc9adb7(0x15e)),console[_0xc9adb7(0x13e)](_0xc9adb7(0x10b)+_0x1c4c30+_0xc9adb7(0x111)),console['log'](_0xc9adb7(0x10b)+_0x1c4c30+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases');}export async function promptAuthMethod(){const _0x1caead=a7_0x36d3,_0x323215=await a7_0x316510({'type':'select','name':_0x1caead(0x152),'message':'Choose\x20how\x20to\x20sign\x20in:','choices':[{'title':'Sign\x20in\x20with\x20browser\x20(recommended)','description':'Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','value':'oauth'},{'title':_0x1caead(0x10e),'description':_0x1caead(0x140),'value':_0x1caead(0x10f)}]});return _0x323215[_0x1caead(0x152)]||null;}export class AuthSetupCommand extends BaseCommand{['name']='auth:setup';[a7_0x46155f(0x143)]=a7_0x46155f(0x13b);async[a7_0x46155f(0x11d)](_0xee244f){const _0x1650bd=a7_0x46155f,{options:_0x48a6d4}=_0xee244f,_0x107b8c=_0x48a6d4[_0x1650bd(0x15c)];console[_0x1650bd(0x13e)](a7_0x4558ce['bold']('tdx:\x20auth\x20setup'));const _0x46d4ee=_0x48a6d4['site']||_0x1650bd(0x163),_0x1df0b9=await promptSiteSelection(_0x46d4ee,_0x107b8c,_0x1650bd(0x15a));if(!_0x1df0b9)return 0x1;const _0x206c90=resolveSite(_0x1df0b9),_0x3f022b=await promptAuthMethod();if(!_0x3f022b)return console[_0x1650bd(0x13e)](_0x1650bd(0x126)),0x1;if(_0x3f022b==='oauth'){const {accountName:_0x51fc02}=_0x48a6d4;return await runOAuthLoginFlow(_0x206c90,_0x107b8c,_0x48a6d4['logLevel']??LogLevel[_0x1650bd(0x129)],{'accountName':_0x51fc02}),0x0;}console[_0x1650bd(0x13e)](_0x1650bd(0x137)+_0x206c90),console[_0x1650bd(0x13e)](_0x1650bd(0x10c)),console[_0x1650bd(0x13e)]('\x20\x20'+getConsoleUrl(_0x206c90,_0x1650bd(0x156)));const _0x186685=await a7_0x316510({'type':_0x1650bd(0x14b),'name':_0x1650bd(0x11e),'message':_0x1650bd(0x120),'validate':_0x321d25=>{const _0x89d8fb=_0x1650bd;if(!_0x321d25||!_0x321d25['trim']())return _0x89d8fb(0x14f);return!![];}});if(!_0x186685[_0x1650bd(0x11e)])return console[_0x1650bd(0x13e)](_0x1650bd(0x126)),0x1;const _0x2f27ac=_0x186685['apiKey'];console[_0x1650bd(0x13e)]('Validating\x20API\x20key...');try{const _0x1929a1=TDX[_0x1650bd(0x118)]({'site':_0x206c90,'apiKey':_0x2f27ac[_0x1650bd(0x14e)](),'logLevel':_0x48a6d4[_0x1650bd(0x12a)]??LogLevel[_0x1650bd(0x129)]}),_0x5493a5=await _0x1929a1['jobs']['getUserInfo']();console['log']('✓\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x5493a5[_0x1650bd(0x128)]+')');const _0x50f52e=await isKeychainAvailable();_0x50f52e?(await saveAPIKeyAsync(_0x2f27ac[_0x1650bd(0x14e)](),_0x206c90,_0x107b8c),console[_0x1650bd(0x13e)](_0x1650bd(0x135)+(_0x107b8c?_0x1650bd(0x165)+_0x107b8c+')':''))):(console[_0x1650bd(0x15d)](a7_0x4558ce[_0x1650bd(0x13a)](_0x1650bd(0x142))),console[_0x1650bd(0x15d)](a7_0x4558ce[_0x1650bd(0x13a)](_0x1650bd(0x125))));if(_0x107b8c){const _0x4b3f2a={'site':_0x206c90};saveProfileToUserConfig(_0x107b8c,_0x4b3f2a),console[_0x1650bd(0x13e)](_0x1650bd(0x134)+_0x107b8c+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x206c90),console[_0x1650bd(0x13e)](_0x1650bd(0x14c)+_0x206c90);const _0x8f2dba=_0x107b8c?_0x1650bd(0x167)+_0x107b8c:'';return console['log'](),console[_0x1650bd(0x13e)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x1650bd(0x13e)](_0x1650bd(0x10b)+_0x8f2dba+_0x1650bd(0x111)),console['log'](_0x1650bd(0x10b)+_0x8f2dba+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x2a02e8){if(_0x2a02e8 instanceof HTTPClientError&&_0x2a02e8[_0x1650bd(0x117)]===0x191)return printAuthError(_0x2a02e8),0x1;return console[_0x1650bd(0x15f)](a7_0x4558ce[_0x1650bd(0x122)]('✗\x20Validation\x20failed:\x20'+(_0x2a02e8 instanceof Error?_0x2a02e8[_0x1650bd(0x169)]:String(_0x2a02e8)))),console[_0x1650bd(0x15f)](_0x1650bd(0x153)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x46155f(0x164)]=a7_0x46155f(0x159);[a7_0x46155f(0x143)]=a7_0x46155f(0x11c);async[a7_0x46155f(0x11d)](_0x13dd6d){const _0x41d272=a7_0x46155f,{options:_0x5e78a7,tdx:_0x50b4d0}=_0x13dd6d,_0x4839f1=_0x5e78a7[_0x41d272(0x149)],_0x42c40f=_0x5e78a7[_0x41d272(0x15c)],_0x1a834b=_0x42c40f?_0x42c40f:_0x41d272(0x12d);console[_0x41d272(0x13e)](_0x41d272(0x121)+_0x1a834b+_0x41d272(0x155)+_0x4839f1+')');const _0x433be2=await getOAuthTokens(_0x42c40f);if(_0x433be2)console[_0x41d272(0x13e)](_0x41d272(0x11a)),console[_0x41d272(0x13e)](_0x41d272(0x144)+(_0x42c40f?_0x41d272(0x165)+_0x42c40f+')':''));else{const _0x1b9f42=await resolveAPIKeyAsync(_0x4839f1,_0x42c40f);if(_0x1b9f42){const {source:_0x301364,isDeprecated:_0x508cab}=_0x1b9f42,_0x55386b=_0x41d272(0x148)+_0x301364;console['log'](_0x508cab?a7_0x4558ce[_0x41d272(0x13a)](_0x55386b):_0x55386b);}else console[_0x41d272(0x13e)](a7_0x4558ce[_0x41d272(0x13a)]('No\x20credential\x20found'));}try{const _0x388d9c=await _0x50b4d0[_0x41d272(0x12e)][_0x41d272(0x13c)]();return console[_0x41d272(0x13e)](a7_0x4558ce[_0x41d272(0x15b)](_0x41d272(0x133))),console['log'](_0x41d272(0x158)+_0x388d9c[_0x41d272(0x128)]),(_0x388d9c[_0x41d272(0x12b)]||_0x388d9c[_0x41d272(0x13f)])&&console[_0x41d272(0x13e)](_0x41d272(0x168)+[_0x388d9c[_0x41d272(0x12b)],_0x388d9c[_0x41d272(0x13f)]][_0x41d272(0x154)](Boolean)[_0x41d272(0x10d)]('\x20')),0x0;}catch(_0x4acd2e){return _0x4acd2e instanceof HTTPClientError&&_0x4acd2e['status']===0x191?printAuthError(_0x4acd2e,!![],_0x42c40f):console['error'](a7_0x4558ce[_0x41d272(0x122)](_0x41d272(0x166)+(_0x4acd2e instanceof Error?_0x4acd2e[_0x41d272(0x169)]:String(_0x4acd2e)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x46155f(0x164)]='auth:clear';[a7_0x46155f(0x143)]=a7_0x46155f(0x162);async[a7_0x46155f(0x11d)](_0x2893ab){const _0x5d949a=a7_0x46155f,{options:_0x491e57}=_0x2893ab,_0x222309=_0x491e57['profile'];console[_0x5d949a(0x13e)](a7_0x4558ce['bold']('tdx:\x20auth\x20clear'));const _0x48b2d0=await isKeychainAvailable();if(!_0x48b2d0)return console[_0x5d949a(0x15f)](a7_0x4558ce['red'](_0x5d949a(0x136))),0x1;const [_0x4d7d9f,_0x297b3a]=await Promise[_0x5d949a(0x12c)]([deleteKeychainAPIKey(_0x222309),deleteOAuthTokens(_0x222309)]);if(_0x4d7d9f||_0x297b3a){clearCredentialCache();const _0x523a0e=[_0x4d7d9f&&_0x5d949a(0x14d),_0x297b3a&&'OAuth\x20tokens'][_0x5d949a(0x154)](Boolean)[_0x5d949a(0x10d)]('\x20and\x20');return console[_0x5d949a(0x13e)]('✓\x20'+_0x523a0e+_0x5d949a(0x10a)+(_0x222309?_0x5d949a(0x165)+_0x222309+')':'')),0x0;}else return console['log']('No\x20credentials\x20found\x20in\x20keychain'+(_0x222309?_0x5d949a(0x127)+_0x222309:'')),0x1;}}
|
|
1
|
+
function a7_0x8ded(){const _0x2062bf=['✓\x20API\x20key\x20is\x20valid\x20(User:\x20','\x20removed\x20from\x20keychain','5HKdObg','first_name','\x20--profile\x20','dim','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','/app/mp/ak','Credential\x20type:\x20OAuth','721896ZkzMGj','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','160741EzMYCb','Sign\x20in\x20with\x20browser\x20(recommended)','Remove\x20API\x20key\x20from\x20system\x20keychain','method','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','3sUphNS','Use\x20an\x20API\x20key','tdx:\x20auth\x20setup','\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','message','filter','No\x20credentials\x20found\x20in\x20keychain','access_token','\x20\x20tdx','Setup\x20API\x20key\x20authentication\x20interactively','join','16KrPbvi','status','Validating\x20OAuth\x20tokens...','logLevel','oauth','/users/initiate_sso\x20(account:\x20','email','✓\x20Profile\x20\x27','accountName','auth','366402YCZYoN','169042srTyXu','\x20\x20(','\x20(site:\x20','text','Setting\x20up\x20authentication\x20for\x20site:\x20','log','warn','OAuth\x20tokens','✓\x20Default\x20site\x20set\x20to\x20','User:\x20','\x20\x20user_id:','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','\x27\x20registered','Setup\x20cancelled','all','563046BBaugf','Opening\x20browser\x20for\x20authentication...','yellow','API\x20key\x20cannot\x20be\x20empty','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','apiKey','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','create','\x20for\x20profile:\x20','jobs','No\x20credential\x20found','last_name','For\x20scripts\x20or\x20headless\x20servers','site','cyan','Validating\x20API\x20key...','\x20(profile:\x20','account_id','ERROR','187DPkkyG','profile','Name:\x20','execute','\x0aSetup\x20cancelled','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','760396MLChSA','Choose\x20how\x20to\x20sign\x20in:','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','✗\x20Validation\x20failed:\x20','API\x20key','apikey','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','Enter\x20your\x20TD\x20API\x20key:','N/A','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','getUserInfo','trim','18uCgpsY','name','1191830ZyGxuE','error','description','password','/oauth/authorize'];a7_0x8ded=function(){return _0x2062bf;};return a7_0x8ded();}const a7_0x3273e7=a7_0x1490;(function(_0x3c27cc,_0x51e6dd){const _0x3cdbd9=a7_0x1490,_0xd7212e=_0x3c27cc();while(!![]){try{const _0x52bf24=-parseInt(_0x3cdbd9(0x102))/0x1+parseInt(_0x3cdbd9(0x103))/0x2*(-parseInt(_0x3cdbd9(0xed))/0x3)+-parseInt(_0x3cdbd9(0xc8))/0x4*(parseInt(_0x3cdbd9(0xdd))/0x5)+parseInt(_0x3cdbd9(0x112))/0x6+-parseInt(_0x3cdbd9(0xe7))/0x7*(parseInt(_0x3cdbd9(0xf8))/0x8)+-parseInt(_0x3cdbd9(0xd4))/0x9*(parseInt(_0x3cdbd9(0xd6))/0xa)+parseInt(_0x3cdbd9(0xc2))/0xb*(parseInt(_0x3cdbd9(0xe5))/0xc);if(_0x52bf24===_0x51e6dd)break;else _0xd7212e['push'](_0xd7212e['shift']());}catch(_0x5bcc3e){_0xd7212e['push'](_0xd7212e['shift']());}}}(a7_0x8ded,0x2eaed));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';import{clearCredentialCache}from'../core/credential-cache.js';import{startOAuthFlow}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x283533 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_0x486fe5 from'chalk';export async function runOAuthLoginFlow(_0x4144d3,_0x475fb8,_0x9ca134,_0x5c21fe){const _0x5270ed=a7_0x1490,_0x5b55eb=await isKeychainAvailable();if(!_0x5b55eb)throw new Error(_0x5270ed(0xd1)+_0x5270ed(0xb4));let _0x3ce17b=_0x5c21fe?.['accountName'];if(!_0x3ce17b){const _0x18de0a=await a7_0x283533({'type':_0x5270ed(0x106),'name':'accountName','message':_0x5270ed(0xec)});if(_0x18de0a[_0x5270ed(0x100)]===undefined)throw new Error(_0x5270ed(0x110));_0x3ce17b=_0x18de0a['accountName']['trim']()||undefined;}const _0x1ab1fe=getConsoleUrl(_0x4144d3);console[_0x5270ed(0x108)](_0x5270ed(0x113));_0x3ce17b?console[_0x5270ed(0x108)]('\x20\x20'+_0x1ab1fe+_0x5270ed(0xfd)+_0x3ce17b+')'):console[_0x5270ed(0x108)]('\x20\x20'+_0x1ab1fe+_0x5270ed(0xda));console[_0x5270ed(0x108)](_0x5270ed(0xeb));const _0x5672ed=await startOAuthFlow(_0x4144d3,{'accountName':_0x3ce17b});console[_0x5270ed(0x108)](_0x5270ed(0xfa));const _0xebc79a=TDX[_0x5270ed(0xb6)]({'site':_0x4144d3,'accessToken':_0x5672ed[_0x5270ed(0xf4)],'logLevel':_0x9ca134??LogLevel[_0x5270ed(0xc1)]}),_0x3aceff=await _0xebc79a['jobs'][_0x5270ed(0xd2)]();console[_0x5270ed(0x108)](a7_0x486fe5['green']('✓\x20Signed\x20in\x20successfully')),console[_0x5270ed(0x108)]('\x20\x20'+a7_0x486fe5[_0x5270ed(0xbd)](_0x4144d3+':'+_0x3aceff[_0x5270ed(0xc0)])+_0x5270ed(0x10d)+_0x3aceff['id']+_0x5270ed(0x104)+_0x3aceff[_0x5270ed(0xfe)]+')');!_0x3ce17b&&(console['log'](a7_0x486fe5[_0x5270ed(0xe0)](_0x5270ed(0xf0))),console[_0x5270ed(0x108)](a7_0x486fe5['dim']('\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>')),console[_0x5270ed(0x108)](a7_0x486fe5[_0x5270ed(0xe0)]('\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions')));await saveOAuthTokens(_0x5672ed,_0x475fb8),console['log'](_0x5270ed(0xb5)+(_0x475fb8?_0x5270ed(0xbf)+_0x475fb8+')':''));if(_0x475fb8){const _0x2f8b86={'site':_0x4144d3};saveProfileToUserConfig(_0x475fb8,_0x2f8b86),console[_0x5270ed(0x108)](_0x5270ed(0xff)+_0x475fb8+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x4144d3),console[_0x5270ed(0x108)](_0x5270ed(0x10b)+_0x4144d3);const _0x342d36=_0x475fb8?_0x5270ed(0xdf)+_0x475fb8:'';console[_0x5270ed(0x108)](),console[_0x5270ed(0x108)](_0x5270ed(0xca)),console[_0x5270ed(0x108)](_0x5270ed(0xf5)+_0x342d36+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console['log'](_0x5270ed(0xf5)+_0x342d36+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases');}function a7_0x1490(_0x19ab4f,_0x14f7d4){_0x19ab4f=_0x19ab4f-0xb4;const _0x8dedb6=a7_0x8ded();let _0x149069=_0x8dedb6[_0x19ab4f];return _0x149069;}export async function promptAuthMethod(){const _0x4bb59a=a7_0x1490,_0x7cd792=await a7_0x283533({'type':'select','name':'method','message':_0x4bb59a(0xc9),'choices':[{'title':_0x4bb59a(0xe8),'description':'Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','value':_0x4bb59a(0xfc)},{'title':_0x4bb59a(0xee),'description':_0x4bb59a(0xbb),'value':_0x4bb59a(0xcd)}]});return _0x7cd792[_0x4bb59a(0xea)]||null;}export class AuthSetupCommand extends BaseCommand{[a7_0x3273e7(0xd5)]='auth:setup';[a7_0x3273e7(0xd8)]=a7_0x3273e7(0xf6);async['execute'](_0x33de93){const _0x753a41=a7_0x3273e7,{options:_0x926058}=_0x33de93,_0x2b83c7=_0x926058[_0x753a41(0xc3)];console[_0x753a41(0x108)](a7_0x486fe5['bold'](_0x753a41(0xef)));const _0x4de7b3=_0x926058['site']||'us01',_0x43ee8b=await promptSiteSelection(_0x4de7b3,_0x2b83c7,_0x753a41(0x110));if(!_0x43ee8b)return 0x1;const _0x121260=resolveSite(_0x43ee8b),_0x331100=await promptAuthMethod();if(!_0x331100)return console[_0x753a41(0x108)](_0x753a41(0xc6)),0x1;if(_0x331100===_0x753a41(0xfc)){const {accountName:_0xc151c1}=_0x926058;return await runOAuthLoginFlow(_0x121260,_0x2b83c7,_0x926058['logLevel']??LogLevel[_0x753a41(0xc1)],{'accountName':_0xc151c1}),0x0;}console['log'](_0x753a41(0x107)+_0x121260),console[_0x753a41(0x108)]('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0x753a41(0x108)]('\x20\x20'+getConsoleUrl(_0x121260,_0x753a41(0xe3)));const _0x30e8d6=await a7_0x283533({'type':_0x753a41(0xd9),'name':_0x753a41(0x117),'message':_0x753a41(0xcf),'validate':_0x173f2b=>{const _0x4c9aa7=_0x753a41;if(!_0x173f2b||!_0x173f2b['trim']())return _0x4c9aa7(0x115);return!![];}});if(!_0x30e8d6['apiKey'])return console[_0x753a41(0x108)](_0x753a41(0xc6)),0x1;const _0xdc41d8=_0x30e8d6[_0x753a41(0x117)];console[_0x753a41(0x108)](_0x753a41(0xbe));try{const _0x330f09=TDX[_0x753a41(0xb6)]({'site':_0x121260,'apiKey':_0xdc41d8[_0x753a41(0xd3)](),'logLevel':_0x926058[_0x753a41(0xfb)]??LogLevel[_0x753a41(0xc1)]}),_0x5b8b67=await _0x330f09[_0x753a41(0xb8)][_0x753a41(0xd2)]();console[_0x753a41(0x108)](_0x753a41(0xdb)+_0x5b8b67[_0x753a41(0xfe)]+')');const _0x1c082a=await isKeychainAvailable();_0x1c082a?(await saveAPIKeyAsync(_0xdc41d8[_0x753a41(0xd3)](),_0x121260,_0x2b83c7),console[_0x753a41(0x108)](_0x753a41(0x116)+(_0x2b83c7?'\x20(profile:\x20'+_0x2b83c7+')':''))):(console[_0x753a41(0x109)](a7_0x486fe5[_0x753a41(0x114)](_0x753a41(0xe2))),console[_0x753a41(0x109)](a7_0x486fe5[_0x753a41(0x114)](_0x753a41(0xce))));if(_0x2b83c7){const _0x38417d={'site':_0x121260};saveProfileToUserConfig(_0x2b83c7,_0x38417d),console[_0x753a41(0x108)](_0x753a41(0xff)+_0x2b83c7+_0x753a41(0x10f));}else saveDefaultSiteToUserConfig(_0x121260),console[_0x753a41(0x108)]('✓\x20Default\x20site\x20set\x20to\x20'+_0x121260);const _0x159d63=_0x2b83c7?_0x753a41(0xdf)+_0x2b83c7:'';return console['log'](),console['log'](_0x753a41(0xca)),console[_0x753a41(0x108)]('\x20\x20tdx'+_0x159d63+_0x753a41(0xe1)),console[_0x753a41(0x108)](_0x753a41(0xf5)+_0x159d63+_0x753a41(0xc7)),0x0;}catch(_0x19ae93){if(_0x19ae93 instanceof HTTPClientError&&_0x19ae93[_0x753a41(0xf9)]===0x191)return printAuthError(_0x19ae93),0x1;return console[_0x753a41(0xd7)](a7_0x486fe5['red'](_0x753a41(0xcb)+(_0x19ae93 instanceof Error?_0x19ae93[_0x753a41(0xf1)]:String(_0x19ae93)))),console[_0x753a41(0xd7)](_0x753a41(0xe6)),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']=a7_0x3273e7(0x101);['description']=a7_0x3273e7(0x10e);async[a7_0x3273e7(0xc5)](_0x5405ed){const _0x101da9=a7_0x3273e7,{options:_0x21a54b,tdx:_0x2bd76e}=_0x5405ed,_0x3dd70a=_0x21a54b[_0x101da9(0xbc)],_0x2dd899=_0x21a54b[_0x101da9(0xc3)],_0x381f59=_0x2dd899?_0x2dd899:_0x101da9(0xd0);console[_0x101da9(0x108)]('tdx\x20profile:\x20'+_0x381f59+_0x101da9(0x105)+_0x3dd70a+')');const _0x552a47=await getOAuthTokens(_0x2dd899);if(_0x552a47)console[_0x101da9(0x108)](_0x101da9(0xe4)),console[_0x101da9(0x108)]('Read\x20credential\x20from\x20keychain'+(_0x2dd899?'\x20(profile:\x20'+_0x2dd899+')':''));else{const _0x12c100=await resolveAPIKeyAsync(_0x3dd70a,_0x2dd899);if(_0x12c100){const {source:_0x423f9d,isDeprecated:_0x183246}=_0x12c100,_0x1da8c2='Read\x20credential\x20from\x20'+_0x423f9d;console[_0x101da9(0x108)](_0x183246?a7_0x486fe5[_0x101da9(0x114)](_0x1da8c2):_0x1da8c2);}else console[_0x101da9(0x108)](a7_0x486fe5['yellow'](_0x101da9(0xb9)));}try{const _0x30eb0f=await _0x2bd76e[_0x101da9(0xb8)]['getUserInfo']();return console[_0x101da9(0x108)](a7_0x486fe5['green']('✓\x20Authentication\x20successful\x0a')),console[_0x101da9(0x108)](_0x101da9(0x10c)+_0x30eb0f[_0x101da9(0xfe)]),(_0x30eb0f[_0x101da9(0xde)]||_0x30eb0f[_0x101da9(0xba)])&&console[_0x101da9(0x108)](_0x101da9(0xc4)+[_0x30eb0f[_0x101da9(0xde)],_0x30eb0f[_0x101da9(0xba)]][_0x101da9(0xf2)](Boolean)[_0x101da9(0xf7)]('\x20')),0x0;}catch(_0x392775){return _0x392775 instanceof HTTPClientError&&_0x392775[_0x101da9(0xf9)]===0x191?printAuthError(_0x392775,!![],_0x2dd899):console[_0x101da9(0xd7)](a7_0x486fe5['red'](_0x101da9(0xcb)+(_0x392775 instanceof Error?_0x392775[_0x101da9(0xf1)]:String(_0x392775)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x3273e7(0xd5)]='auth:clear';[a7_0x3273e7(0xd8)]=a7_0x3273e7(0xe9);async[a7_0x3273e7(0xc5)](_0x31a192){const _0x3e4d1d=a7_0x3273e7,{options:_0x9120e6}=_0x31a192,_0x25f54a=_0x9120e6[_0x3e4d1d(0xc3)];console[_0x3e4d1d(0x108)](a7_0x486fe5['bold']('tdx:\x20auth\x20clear'));const _0x5c0006=await isKeychainAvailable();if(!_0x5c0006)return console[_0x3e4d1d(0xd7)](a7_0x486fe5['red']('System\x20keychain\x20is\x20not\x20available')),0x1;const [_0x142b0d,_0x374e59]=await Promise[_0x3e4d1d(0x111)]([deleteKeychainAPIKey(_0x25f54a),deleteOAuthTokens(_0x25f54a)]);if(_0x142b0d||_0x374e59){clearCredentialCache();const _0x18774e=[_0x142b0d&&_0x3e4d1d(0xcc),_0x374e59&&_0x3e4d1d(0x10a)][_0x3e4d1d(0xf2)](Boolean)['join']('\x20and\x20');return console[_0x3e4d1d(0x108)]('✓\x20'+_0x18774e+_0x3e4d1d(0xdc)+(_0x25f54a?_0x3e4d1d(0xbf)+_0x25f54a+')':'')),0x0;}else return console[_0x3e4d1d(0x108)](_0x3e4d1d(0xf3)+(_0x25f54a?_0x3e4d1d(0xb7)+_0x25f54a:'')),0x1;}}
|