@treasuredata/tdx 2026.3.55 → 2026.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.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.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.d.ts.map +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/file-discovery.js.map +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.d.ts.map +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js.map +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.d.ts.map +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/index.js.map +1 -1
- package/dist/sdk/workspace/templates.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/process.js.map +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a3_0xa27e(){const _0x129c38=['977760fHaQlH','Child\x20name:\x20','resolveParentId','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','error','Resolved\x20child\x20ID:\x20','data','listActivations','Resolving\x20parent\x20segment\x20\x27','List\x20activations\x20for\x20a\x20segment','147tnseMD','Listing\x20activations\x20for\x20segment\x20\x27','18tXYJUX','cause','\x27...','execute','18SLYLtI','✔\x20Found\x20','186yEFEoZ','684024FshuWz','631624ElBWMv','4338850shERSo','Parent\x20name:\x20','20429ykUmww','site','length','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','description','segment','Error:\x20Segment\x20name\x20is\x20required','410249CtBHPo','Resolved\x20parent\x20ID:\x20','verbose','message'];a3_0xa27e=function(){return _0x129c38;};return a3_0xa27e();}const a3_0x4be0be=a3_0x1eb9;(function(_0x37d17d,_0x1c0764){const _0x11bb2a=a3_0x1eb9,_0x2f729e=_0x37d17d();while(!![]){try{const _0x3e211d=parseInt(_0x11bb2a(0xcc))/0x1+-parseInt(_0x11bb2a(0xc7))/0x2*(-parseInt(_0x11bb2a(0xbf))/0x3)+-parseInt(_0x11bb2a(0xc9))/0x4+-parseInt(_0x11bb2a(0xb5))/0x5+-parseInt(_0x11bb2a(0xc1))/0x6*(parseInt(_0x11bb2a(0xb1))/0x7)+-parseInt(_0x11bb2a(0xc8))/0x8*(-parseInt(_0x11bb2a(0xc5))/0x9)+parseInt(_0x11bb2a(0xca))/0xa;if(_0x3e211d===_0x1c0764)break;else _0x2f729e['push'](_0x2f729e['shift']());}catch(_0x289d19){_0x2f729e['push'](_0x2f729e['shift']());}}}(a3_0xa27e,0x188f6));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a3_0x1eb9(_0xf90bc6,_0x2fac3f){_0xf90bc6=_0xf90bc6-0xad;const _0xa27e4a=a3_0xa27e();let _0x1eb9f6=_0xa27e4a[_0xf90bc6];return _0x1eb9f6;}import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{['name']='activations';[a3_0x4be0be(0xae)]=a3_0x4be0be(0xbe);async[a3_0x4be0be(0xc4)](_0x546947){const _0x391f64=a3_0x4be0be,{options:_0x33b5d3,args:_0x4ea7f5,tdx:_0x44023b}=_0x546947;if(_0x4ea7f5[_0x391f64(0xce)]===0x0)return console[_0x391f64(0xb9)](_0x391f64(0xb0)),console['error'](_0x391f64(0xad)),0x1;try{const {parentId:_0x13c80e,childId:_0x2cb68d}=parseSegmentRef(_0x4ea7f5[0x0]);if(!_0x2cb68d)return console[_0x391f64(0xb9)](_0x391f64(0xb8)),console[_0x391f64(0xb9)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;_0x33b5d3[_0x391f64(0xb3)]&&(console[_0x391f64(0xb9)]('Site:\x20'+_0x33b5d3[_0x391f64(0xcd)]),console[_0x391f64(0xb9)](_0x391f64(0xcb)+_0x13c80e),console['error'](_0x391f64(0xb6)+_0x2cb68d));const _0x27c740=await withSpinner(_0x391f64(0xbd)+_0x13c80e+_0x391f64(0xc3),()=>_0x44023b[_0x391f64(0xaf)][_0x391f64(0xb7)](_0x13c80e),{'verbose':_0x33b5d3['verbose']}),_0x306eae=_0x27c740[_0x391f64(0xbb)];_0x33b5d3['verbose']&&console[_0x391f64(0xb9)](_0x391f64(0xb2)+_0x306eae);const _0x1dcb5f=await withSpinner('Resolving\x20child\x20segment\x20\x27'+_0x2cb68d+_0x391f64(0xc3),()=>_0x44023b[_0x391f64(0xaf)]['resolveSegmentId'](_0x306eae,_0x2cb68d),{'verbose':_0x33b5d3[_0x391f64(0xb3)]}),_0x4f7667=_0x1dcb5f[_0x391f64(0xbb)];_0x33b5d3[_0x391f64(0xb3)]&&console[_0x391f64(0xb9)](_0x391f64(0xba)+_0x4f7667);const _0x516b10=await withSpinner(_0x391f64(0xc0)+_0x2cb68d+'\x27...',()=>_0x44023b[_0x391f64(0xaf)][_0x391f64(0xbc)](_0x306eae,_0x4f7667),{'verbose':_0x33b5d3['verbose']}),_0x300ccc=_0x516b10[_0x391f64(0xbb)];return console[_0x391f64(0xb9)](_0x391f64(0xc6)+_0x300ccc[_0x391f64(0xce)]+'\x20activation'+(_0x300ccc['length']!==0x1?'s':'')),await handleSDKOutput(_0x300ccc,_0x33b5d3),0x0;}catch(_0x49ed63){if(_0x49ed63 instanceof SDKError)return console['error']('Error:\x20'+_0x49ed63[_0x391f64(0xb4)]),_0x49ed63[_0x391f64(0xc2)]&&console[_0x391f64(0xb9)]('\x20\x20Cause:\x20'+_0x49ed63[_0x391f64(0xc2)]),0x1;throw _0x49ed63;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x2eaf32=a4_0x9485;(function(_0x56f80a,_0x340e42){const _0x4bee86=a4_0x9485,_0x27864b=_0x56f80a();while(!![]){try{const _0x104a07=parseInt(_0x4bee86(0x1a8))/0x1+-parseInt(_0x4bee86(0x22b))/0x2*(-parseInt(_0x4bee86(0x198))/0x3)+-parseInt(_0x4bee86(0x1af))/0x4+parseInt(_0x4bee86(0x1b6))/0x5*(-parseInt(_0x4bee86(0x199))/0x6)+parseInt(_0x4bee86(0x193))/0x7*(-parseInt(_0x4bee86(0x22a))/0x8)+-parseInt(_0x4bee86(0x1d1))/0x9+-parseInt(_0x4bee86(0x1f8))/0xa*(-parseInt(_0x4bee86(0x1dd))/0xb);if(_0x104a07===_0x340e42)break;else _0x27864b['push'](_0x27864b['shift']());}catch(_0x2d1814){_0x27864b['push'](_0x27864b['shift']());}}}(a4_0x34d7,0xe5d66));import a4_0x40c111 from'chalk';import a4_0x38d37e from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';function a4_0x34d7(){const _0x2d26bb=['textKnowledgeBases','\x22\x20from\x20project\x20\x22','dryRun','site','\x20new','reason','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x0aPull\x20summary\x20for\x20\x27','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','No\x20tdx.json\x20found\x20in\x20','Cancelled','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','1467275xMYXcu','\x20=\x20','Cloning\x20\x22','session','\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','✔\x20Context\x20set:\x20','join','3223592BcMgZo','prompts','agentName','agent:pull','Status:\x20','\x20resources?','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','5UkPKBM','knowledgeBases','\x0aErrors\x20found:','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','Output:\x20','Pushing\x20agent\x20from\x20\x22','output','\x20\x20Prompts:\x20','Chat:\x20','\x20\x20Chat\x20Interfaces:\x20','errors','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x20\x20Text\x20Knowledge\x20Base\x20\x22','Project\x20cloned\x20successfully','\x20changed','context','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','cloneProject','description','arg-dir','counts','parse','chatInterfaces','cwd-config','\x20\x20Integration\x20\x22','\x0aChanges:','\x22...','8258607mcHXWp','\x0aWrite\x20','\x0aChanges\x20to\x20prompt\x20\x27','tdx.json','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','agentId','source','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','log','Would\x20pull\x20agent:\x20','\x20\x20Agents:\x20','INVALID_ARGUMENT','11OMGxaz','projectName','outputDir','llmProject','Errors:','\x20\x20Knowledge\x20Bases:\x20','\x20\x20Text\x20Knowledge\x20Bases:\x20','error','Cannot\x20clone\x20from\x20context\x20project\x20\x22','Pulling\x20agent\x20\x22','pullAgent','cwd','Dry\x20run\x20-\x20no\x20files\x20written','Failed\x20to\x20push\x20agent:\x20','\x0a✔\x20Pushed\x20','agent:clone','new','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','action','integrations','Writing\x20files...','Agent:\x20','\x0aProject\x20pushed\x20with\x20errors','push','-\x20no\x20files\x20written','Using\x20local\x20project:\x20','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','27011470eIIPCU','\x20\x20Integrations:\x20','profile','\x0aChanges\x20to\x20integration\x20\x27','\x0aPush\x20summary\x20for\x20\x27','New\x20project\x20name\x20is\x20required','\x20\x20Form\x20Interfaces:\x20','isNew','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','experimentalArtifacts','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','unchanged','cyan','Source:\x20','\x22:\x20','Would\x20push\x20agent:\x20','\x20errors','yes','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)','\x20files\x20to\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project','MISSING_ARGUMENT','\x20\x20tdx\x20agent\x20clone\x20agents/','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x20\x20Knowledge\x20Base\x20\x22','Summary:','\x20--profile\x20','<new-name>','dim','\x20--name\x20','\x20created','\x20unchanged','utf-8','found','Pushing\x20to\x20project...','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','\x20\x20Prompt\x20\x22','pushProject','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','Using\x20context\x20project:\x20','\x20\x20Form\x20Interface\x20\x22','\x20\x20Agent\x20\x22','name','\x0aPush\x20','pullProject','Would\x20clone:','\x20total','4432vwCnNW','4GseXcn','green','Analyzing\x20project\x20\x22','sourceProjectName','\x20|\x20','formInterfaces','\x20updated','\x27\x20to\x20create\x20the\x20folder\x20structure.','yellow','force','projectId','red','updated','created','\x22\x20to\x20a\x20different\x20profile','dirname','\x0aChanges\x20to\x20chat\x20interface\x20\x27','execute','newProjectId','gray','llm_project','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','New\x20project\x20ID:\x20','New\x20project:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','message','Using\x20project\x20from\x20context:\x20','\x0aChanges\x20to\x20agent\x20\x27','repeat','\x22\x20to\x20\x22','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x20files?','Using\x20project:\x20','no_local_folder','\x20\x20Experimental\x20Artifacts:\x20','Using\x20project\x20from\x20','diff','\x0a✔\x20Pulled\x20','\x20\x20Experimental\x20Artifact\x20\x22','Project:\x20','agents','llm','21308FGZLDL','experimentalKnowledgeBases','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','total','Dry\x20run\x20-\x20no\x20changes\x20made','1980624ADqcZT','6825162dUWCcs','\x0aError:'];a4_0x34d7=function(){return _0x2d26bb;};return a4_0x34d7();}import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0xeba59){const _0x25cebf=a4_0x9485,_0x1e1906=[];if(_0xeba59[_0x25cebf(0x196)]!==undefined)_0x1e1906['push'](_0xeba59['total']+_0x25cebf(0x229));if(_0xeba59[_0x25cebf(0x1ed)]!==undefined&&_0xeba59['new']>0x0)_0x1e1906[_0x25cebf(0x1f4)](a4_0x40c111[_0x25cebf(0x22c)](_0xeba59[_0x25cebf(0x1ed)]+'\x20new'));if(_0xeba59[_0x25cebf(0x176)]!==undefined&&_0xeba59['created']>0x0)_0x1e1906[_0x25cebf(0x1f4)](a4_0x40c111[_0x25cebf(0x22c)](_0xeba59['created']+_0x25cebf(0x217)));if(_0xeba59[_0x25cebf(0x175)]!==undefined&&_0xeba59[_0x25cebf(0x175)]>0x0)_0x1e1906[_0x25cebf(0x1f4)](a4_0x40c111[_0x25cebf(0x233)](_0xeba59[_0x25cebf(0x175)]+_0x25cebf(0x231)));if(_0xeba59[_0x25cebf(0x203)]!==undefined&&_0xeba59[_0x25cebf(0x203)]>0x0)_0x1e1906[_0x25cebf(0x1f4)](a4_0x40c111[_0x25cebf(0x17c)](_0xeba59[_0x25cebf(0x203)]+_0x25cebf(0x218)));if(_0xeba59[_0x25cebf(0x1c0)]!==undefined&&_0xeba59[_0x25cebf(0x1c0)]>0x0)_0x1e1906[_0x25cebf(0x1f4)](a4_0x40c111[_0x25cebf(0x174)](_0xeba59[_0x25cebf(0x1c0)]+_0x25cebf(0x208)));return _0x1e1906[_0x25cebf(0x1ae)](',\x20');}function a4_0x9485(_0x4fee81,_0x38d44d){_0x4fee81=_0x4fee81-0x172;const _0x34d757=a4_0x34d7();let _0x948592=_0x34d757[_0x4fee81];return _0x948592;}function displayDiffs(_0x2232dc,_0x56fb78,_0x4e8fe2,_0xb9fc0b,_0x3100af,_0x1ac96c,_0x261308,_0x1e528a,_0x2240a2){const _0x27ad50=a4_0x9485;for(const _0x49528d of _0x2232dc){if(_0x49528d[_0x27ad50(0x18d)]){const _0x119939=_0x49528d['agentName']||_0x49528d[_0x27ad50(0x225)];console[_0x27ad50(0x1d9)](_0x27ad50(0x184)+_0x119939+'\x27:'),console[_0x27ad50(0x1d9)]('─'['repeat'](0x3c)),console['log'](_0x49528d[_0x27ad50(0x18d)]),console['log']('─'['repeat'](0x3c));}}for(const _0x19945b of _0x56fb78){_0x19945b[_0x27ad50(0x18d)]&&(console[_0x27ad50(0x1d9)](_0x27ad50(0x1a2)+_0x19945b[_0x27ad50(0x225)]+'\x27:'),console[_0x27ad50(0x1d9)]('─'[_0x27ad50(0x185)](0x3c)),console['log'](_0x19945b['diff']),console[_0x27ad50(0x1d9)]('─'[_0x27ad50(0x185)](0x3c)));}for(const _0x3ef763 of _0x4e8fe2){_0x3ef763[_0x27ad50(0x18d)]&&(console['log'](_0x27ad50(0x1b9)+_0x3ef763[_0x27ad50(0x225)]+'\x27:'),console[_0x27ad50(0x1d9)]('─'[_0x27ad50(0x185)](0x3c)),console[_0x27ad50(0x1d9)](_0x3ef763[_0x27ad50(0x18d)]),console['log']('─'[_0x27ad50(0x185)](0x3c)));}for(const _0x316432 of _0xb9fc0b){_0x316432[_0x27ad50(0x18d)]&&(console[_0x27ad50(0x1d9)](_0x27ad50(0x1d3)+_0x316432['name']+'\x27:'),console[_0x27ad50(0x1d9)]('─'['repeat'](0x3c)),console[_0x27ad50(0x1d9)](_0x316432['diff']),console[_0x27ad50(0x1d9)]('─'[_0x27ad50(0x185)](0x3c)));}for(const _0x578c07 of _0x3100af){_0x578c07['diff']&&(console[_0x27ad50(0x1d9)](_0x27ad50(0x1fb)+_0x578c07[_0x27ad50(0x225)]+'\x27:'),console['log']('─'[_0x27ad50(0x185)](0x3c)),console[_0x27ad50(0x1d9)](_0x578c07[_0x27ad50(0x18d)]),console['log']('─'[_0x27ad50(0x185)](0x3c)));}for(const _0x5626df of _0x1ac96c){_0x5626df[_0x27ad50(0x18d)]&&(console[_0x27ad50(0x1d9)](_0x27ad50(0x221)+_0x5626df[_0x27ad50(0x225)]+'\x27:'),console['log']('─'[_0x27ad50(0x185)](0x3c)),console[_0x27ad50(0x1d9)](_0x5626df[_0x27ad50(0x18d)]),console[_0x27ad50(0x1d9)]('─'[_0x27ad50(0x185)](0x3c)));}for(const _0x4e8748 of _0x261308){_0x4e8748[_0x27ad50(0x18d)]&&(console['log'](_0x27ad50(0x1d5)+_0x4e8748[_0x27ad50(0x225)]+'\x27:'),console['log']('─'[_0x27ad50(0x185)](0x3c)),console[_0x27ad50(0x1d9)](_0x4e8748[_0x27ad50(0x18d)]),console[_0x27ad50(0x1d9)]('─'[_0x27ad50(0x185)](0x3c)));}for(const _0x3fec60 of _0x1e528a){_0x3fec60[_0x27ad50(0x18d)]&&(console['log']('\x0aChanges\x20to\x20form\x20interface\x20\x27'+_0x3fec60[_0x27ad50(0x225)]+'\x27:'),console[_0x27ad50(0x1d9)]('─'[_0x27ad50(0x185)](0x3c)),console['log'](_0x3fec60[_0x27ad50(0x18d)]),console[_0x27ad50(0x1d9)]('─'[_0x27ad50(0x185)](0x3c)));}for(const _0x4065a7 of _0x2240a2){_0x4065a7[_0x27ad50(0x18d)]&&(console[_0x27ad50(0x1d9)](_0x27ad50(0x179)+_0x4065a7[_0x27ad50(0x225)]+'\x27:'),console[_0x27ad50(0x1d9)]('─'[_0x27ad50(0x185)](0x3c)),console[_0x27ad50(0x1d9)](_0x4065a7[_0x27ad50(0x18d)]),console['log']('─'[_0x27ad50(0x185)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x2eaf32(0x225)]=a4_0x2eaf32(0x1b2);[a4_0x2eaf32(0x1c8)]=a4_0x2eaf32(0x210);async[a4_0x2eaf32(0x17a)](_0x3518d3){const _0x40a431=a4_0x2eaf32,{options:_0x46c963,args:_0x4c918e,tdx:_0x5a06be}=_0x3518d3,_0x28c632=_0x4c918e[0x0],_0x57a871=_0x4c918e[0x1],_0x3f5d1b=_0x46c963[_0x40a431(0x1bc)],_0x53363a=_0x46c963[_0x40a431(0x19d)],_0x10e733=_0x46c963[_0x40a431(0x172)],_0x1bd8e2=_0x46c963[_0x40a431(0x209)],_0x19fa03=_0x46c963['llmProject'],_0x563edf=_0x46c963['agent'];let _0x10edbe;if(_0x28c632){const _0x17e434=a4_0x38d37e[_0x40a431(0x1ae)](_0x28c632,_0x40a431(0x1d4));if(existsSync(_0x17e434))try{const _0x481485=JSON[_0x40a431(0x1cb)](readFileSync(_0x17e434,_0x40a431(0x219)));_0x481485[_0x40a431(0x17d)]&&(_0x10edbe={'llm_project':_0x481485[_0x40a431(0x17d)]});}catch{}}const _0x49b903=findAgentConfigPath(process['cwd']());let _0x3b55a3;if(_0x49b903)try{const _0x482540=JSON[_0x40a431(0x1cb)](readFileSync(_0x49b903,'utf-8'));_0x482540['llm_project']&&(_0x3b55a3={'llm_project':_0x482540['llm_project']});}catch{}const _0x19332b=resolveAgentPullArgs({'arg':_0x28c632,'agentNameArg':_0x57a871,'agentFlag':_0x563edf,'contextProject':_0x19fa03,'argDirConfig':_0x10edbe,'cwdConfigPath':_0x49b903||undefined,'cwdConfig':_0x3b55a3}),{projectNameOrId:_0x209032,targetAgentName:_0x52fabc,existingOutputDir:_0x155843,source:_0x5cddc2}=_0x19332b;if(_0x5cddc2===_0x40a431(0x1c9))console[_0x40a431(0x1d9)](a4_0x40c111[_0x40a431(0x215)](_0x40a431(0x18c)+a4_0x38d37e['join'](_0x28c632,_0x40a431(0x1d4))+':\x20'+_0x209032));else{if(_0x5cddc2===_0x40a431(0x1cd))console[_0x40a431(0x1d9)](a4_0x40c111['dim']('Using\x20project:\x20'+_0x209032));else _0x5cddc2===_0x40a431(0x1c5)&&console[_0x40a431(0x1d9)](a4_0x40c111[_0x40a431(0x215)](_0x40a431(0x183)+_0x209032));}if(!_0x209032)return _0x563edf?(console[_0x40a431(0x1d9)](a4_0x40c111['yellow']('The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a')),console[_0x40a431(0x1d9)](_0x40a431(0x220)),console[_0x40a431(0x1d9)](_0x40a431(0x17e))):(console[_0x40a431(0x1d9)](a4_0x40c111[_0x40a431(0x233)](_0x40a431(0x195))),console[_0x40a431(0x1d9)](_0x40a431(0x20a)),console[_0x40a431(0x1d9)](_0x40a431(0x1ac)),console[_0x40a431(0x1d9)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory'),console[_0x40a431(0x1d9)](_0x40a431(0x20c)),console[_0x40a431(0x1d9)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project')),0x1;if(_0x52fabc){const {data:_0x52fa53}=await withSpinner(_0x40a431(0x1e6)+_0x52fabc+_0x40a431(0x19c)+_0x209032+'\x22...',()=>_0x5a06be[_0x40a431(0x192)][_0x40a431(0x1e7)](_0x209032,_0x52fabc,_0x3f5d1b,{'dryRun':_0x53363a,'force':_0x10e733}));if(_0x53363a)return console[_0x40a431(0x1d9)](a4_0x40c111[_0x40a431(0x233)](_0x40a431(0x1e9))),console['log'](_0x40a431(0x1da)+_0x52fa53['agentName']),console[_0x40a431(0x1d9)]('Output\x20path:\x20'+_0x52fa53['outputPath']),_0x52fa53[_0x40a431(0x18d)]&&(console[_0x40a431(0x1d9)](_0x40a431(0x1cf)),console[_0x40a431(0x1d9)]('─'[_0x40a431(0x185)](0x3c)),console[_0x40a431(0x1d9)](_0x52fa53[_0x40a431(0x18d)]),console[_0x40a431(0x1d9)]('─'['repeat'](0x3c))),0x0;return console[_0x40a431(0x1d9)](a4_0x40c111['green']('Agent\x20pulled\x20successfully')),console[_0x40a431(0x1d9)](_0x40a431(0x1f2)+_0x52fa53[_0x40a431(0x1b1)]),console[_0x40a431(0x1d9)](_0x40a431(0x1ba)+_0x52fa53['outputPath']),console[_0x40a431(0x1d9)](_0x40a431(0x1b3)+(_0x52fa53[_0x40a431(0x1ff)]?a4_0x40c111[_0x40a431(0x22c)](_0x40a431(0x1ed)):_0x52fa53['hasChanges']?a4_0x40c111[_0x40a431(0x233)]('updated'):a4_0x40c111[_0x40a431(0x17c)](_0x40a431(0x203)))),0x0;}const _0x3ea396=_0x155843||_0x3f5d1b,{data:_0x34eb27}=await withSpinner(_0x40a431(0x22d)+_0x209032+_0x40a431(0x1d0),()=>_0x5a06be[_0x40a431(0x192)][_0x40a431(0x227)](_0x209032,_0x3ea396,{'dryRun':!![]})),_0x252c30=_0x34eb27[_0x40a431(0x1ca)]['agents'][_0x40a431(0x1ed)]+_0x34eb27[_0x40a431(0x1ca)][_0x40a431(0x1b7)][_0x40a431(0x1ed)]+_0x34eb27[_0x40a431(0x1ca)][_0x40a431(0x19b)][_0x40a431(0x1ed)]+_0x34eb27[_0x40a431(0x1ca)][_0x40a431(0x1b0)][_0x40a431(0x1ed)]+_0x34eb27[_0x40a431(0x1ca)][_0x40a431(0x1f0)][_0x40a431(0x1ed)]+_0x34eb27[_0x40a431(0x1ca)]['experimentalKnowledgeBases']['new']+_0x34eb27['counts'][_0x40a431(0x201)]['new']+_0x34eb27['counts'][_0x40a431(0x230)]['new']+_0x34eb27[_0x40a431(0x1ca)][_0x40a431(0x1cc)][_0x40a431(0x1ed)],_0x862289=_0x34eb27[_0x40a431(0x1ca)][_0x40a431(0x191)][_0x40a431(0x175)]+_0x34eb27[_0x40a431(0x1ca)]['knowledgeBases']['updated']+_0x34eb27[_0x40a431(0x1ca)][_0x40a431(0x19b)][_0x40a431(0x175)]+_0x34eb27[_0x40a431(0x1ca)][_0x40a431(0x1b0)][_0x40a431(0x175)]+_0x34eb27[_0x40a431(0x1ca)][_0x40a431(0x1f0)]['updated']+_0x34eb27[_0x40a431(0x1ca)][_0x40a431(0x194)]['updated']+_0x34eb27[_0x40a431(0x1ca)][_0x40a431(0x201)][_0x40a431(0x175)]+_0x34eb27[_0x40a431(0x1ca)][_0x40a431(0x230)]['updated']+_0x34eb27[_0x40a431(0x1ca)][_0x40a431(0x1cc)][_0x40a431(0x175)],_0x14c552=_0x34eb27[_0x40a431(0x1ca)][_0x40a431(0x191)][_0x40a431(0x203)]+_0x34eb27['counts'][_0x40a431(0x1b7)]['unchanged']+_0x34eb27['counts'][_0x40a431(0x19b)][_0x40a431(0x203)]+_0x34eb27[_0x40a431(0x1ca)]['prompts']['unchanged']+_0x34eb27[_0x40a431(0x1ca)][_0x40a431(0x1f0)][_0x40a431(0x203)]+_0x34eb27[_0x40a431(0x1ca)][_0x40a431(0x194)]['unchanged']+_0x34eb27[_0x40a431(0x1ca)][_0x40a431(0x201)][_0x40a431(0x203)]+_0x34eb27[_0x40a431(0x1ca)][_0x40a431(0x230)][_0x40a431(0x203)]+_0x34eb27['counts']['chatInterfaces']['unchanged'];console[_0x40a431(0x1d9)](_0x40a431(0x1a3)+_0x34eb27['projectName']+'\x27:'),console[_0x40a431(0x1d9)]('\x20\x20'+a4_0x40c111['green']('+\x20'+_0x252c30+_0x40a431(0x19f))+_0x40a431(0x22f)+a4_0x40c111['yellow']('~\x20'+_0x862289+_0x40a431(0x1c4))+_0x40a431(0x22f)+a4_0x40c111[_0x40a431(0x215)]('=\x20'+_0x14c552+_0x40a431(0x218))),console[_0x40a431(0x1d9)](_0x40a431(0x1db)+formatCountSummary(_0x34eb27[_0x40a431(0x1ca)][_0x40a431(0x191)])),console[_0x40a431(0x1d9)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x34eb27[_0x40a431(0x1ca)][_0x40a431(0x1b7)])),console[_0x40a431(0x1d9)](_0x40a431(0x1e3)+formatCountSummary(_0x34eb27[_0x40a431(0x1ca)][_0x40a431(0x19b)])),console['log'](_0x40a431(0x1bd)+formatCountSummary(_0x34eb27['counts']['prompts'])),console[_0x40a431(0x1d9)](_0x40a431(0x1f9)+formatCountSummary(_0x34eb27[_0x40a431(0x1ca)][_0x40a431(0x1f0)])),console[_0x40a431(0x1d9)](_0x40a431(0x1fe)+formatCountSummary(_0x34eb27['counts'][_0x40a431(0x230)])),console['log'](_0x40a431(0x1bf)+formatCountSummary(_0x34eb27['counts'][_0x40a431(0x1cc)]));const _0x4474a9=_0x34eb27['counts']['experimentalKnowledgeBases'][_0x40a431(0x196)]>0x0||_0x34eb27[_0x40a431(0x1ca)][_0x40a431(0x201)][_0x40a431(0x196)]>0x0;_0x4474a9&&(console[_0x40a431(0x1d9)](_0x40a431(0x1a4)+formatCountSummary(_0x34eb27[_0x40a431(0x1ca)]['experimentalKnowledgeBases'])),console[_0x40a431(0x1d9)](_0x40a431(0x18b)+formatCountSummary(_0x34eb27[_0x40a431(0x1ca)][_0x40a431(0x201)])));console[_0x40a431(0x1d9)]('\x20\x20Target:\x20'+a4_0x40c111[_0x40a431(0x204)](_0x34eb27[_0x40a431(0x1df)])),displayDiffs(_0x34eb27[_0x40a431(0x191)],_0x34eb27[_0x40a431(0x1b7)],_0x34eb27[_0x40a431(0x19b)],_0x34eb27['prompts'],_0x34eb27[_0x40a431(0x1f0)],_0x34eb27[_0x40a431(0x194)],_0x34eb27[_0x40a431(0x201)],_0x34eb27[_0x40a431(0x230)],_0x34eb27[_0x40a431(0x1cc)]);if(_0x53363a)return console[_0x40a431(0x1d9)](a4_0x40c111[_0x40a431(0x233)](_0x40a431(0x1b5))),0x0;if(_0x252c30===0x0&&_0x862289===0x0)return console[_0x40a431(0x1d9)](a4_0x40c111[_0x40a431(0x22c)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x34eb27['projectName']},_0x46c963[_0x40a431(0x1ab)]),console[_0x40a431(0x1d9)](a4_0x40c111[_0x40a431(0x22c)](_0x40a431(0x1ad)+a4_0x40c111[_0x40a431(0x215)]('llm_project')+_0x40a431(0x1a9)+a4_0x40c111[_0x40a431(0x204)](_0x34eb27[_0x40a431(0x1de)]))),0x0;if(!_0x1bd8e2&&!_0x10e733){if(!isInteractive())return console[_0x40a431(0x1e4)](a4_0x40c111[_0x40a431(0x174)](_0x40a431(0x19a)),_0x40a431(0x181)),console[_0x40a431(0x1e4)](a4_0x40c111['dim'](_0x40a431(0x1ee))),0x1;const _0x123a6c=await confirmKey(_0x40a431(0x1d2)+(_0x252c30+_0x862289)+_0x40a431(0x188));if(!_0x123a6c)return console['log'](a4_0x40c111[_0x40a431(0x233)](_0x40a431(0x1a6)),_0x40a431(0x1f5)),0x1;}const {data:_0x5d7ea7}=await withSpinner(_0x40a431(0x1f1),()=>_0x5a06be[_0x40a431(0x192)][_0x40a431(0x227)](_0x209032,_0x3ea396,{'force':_0x10e733}));return console[_0x40a431(0x1d9)](a4_0x40c111['green'](_0x40a431(0x18e)+(_0x252c30+_0x862289)+_0x40a431(0x20b)+_0x5d7ea7[_0x40a431(0x1df)])),saveSessionContext({'llm_project':_0x5d7ea7[_0x40a431(0x1de)]},_0x46c963[_0x40a431(0x1ab)]),console['log'](a4_0x40c111[_0x40a431(0x22c)]('✔\x20Context\x20set:\x20'+a4_0x40c111['dim'](_0x40a431(0x17d))+'\x20=\x20'+a4_0x40c111[_0x40a431(0x204)](_0x5d7ea7['projectName']))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x2eaf32(0x225)]=a4_0x2eaf32(0x1ec);[a4_0x2eaf32(0x1c8)]=a4_0x2eaf32(0x202);async[a4_0x2eaf32(0x17a)](_0x103854){const _0x96dec=a4_0x2eaf32,{options:_0x49850b,args:_0x3f4bfb,tdx:_0x4617a4}=_0x103854,_0x1e5366=_0x3f4bfb[0x0],_0x5a2293=_0x49850b[_0x96dec(0x225)],_0x444b15=_0x49850b[_0x96dec(0x19d)],_0x69a5bd=_0x49850b[_0x96dec(0x209)],_0x29c6e7=_0x49850b[_0x96dec(0x19e)],_0x8d5d96=_0x49850b[_0x96dec(0x1e0)];let _0x5259;const _0xcfe85e=findAgentConfigPath(process[_0x96dec(0x1e8)]());if(_0x1e5366){const _0x10631b=a4_0x38d37e[_0x96dec(0x1ae)](_0x1e5366,_0x96dec(0x1d4));existsSync(_0x10631b)?(_0x5259=_0x1e5366,console[_0x96dec(0x1d9)](a4_0x40c111[_0x96dec(0x215)](_0x96dec(0x1f6)+_0x1e5366))):_0x5259=_0x1e5366;}else{if(_0xcfe85e)_0x5259=a4_0x38d37e[_0x96dec(0x178)](_0xcfe85e),console['log'](a4_0x40c111[_0x96dec(0x215)]('Using\x20current\x20project:\x20'+_0x5259));else{if(_0x8d5d96){const _0x187adb=sanitizeForFilesystem(_0x8d5d96);let _0x8c2621=_0x187adb,_0x4f2058=a4_0x38d37e[_0x96dec(0x1ae)](process[_0x96dec(0x1e8)](),_0x96dec(0x191),_0x187adb,_0x96dec(0x1d4));if(!existsSync(_0x4f2058)){const _0x5842e3=normalizeName(_0x8d5d96),_0x3a8a17=a4_0x38d37e[_0x96dec(0x1ae)](process[_0x96dec(0x1e8)](),_0x96dec(0x191),_0x5842e3,_0x96dec(0x1d4));existsSync(_0x3a8a17)&&(_0x8c2621=_0x5842e3,_0x4f2058=_0x3a8a17);}if(existsSync(_0x4f2058))_0x5259=a4_0x38d37e[_0x96dec(0x178)](_0x4f2058),console[_0x96dec(0x1d9)](a4_0x40c111['dim']('Using\x20local\x20project:\x20'+_0x5259));else{const _0x2648a0=_0x49850b[_0x96dec(0x1fa)];if(_0x2648a0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x96dec(0x1e5)+_0x8d5d96+_0x96dec(0x177),undefined,{'helpText':_0x96dec(0x1c6)+_0x96dec(0x1a7)+('\x20\x20tdx\x20agent\x20pull\x20'+_0x8d5d96+'\x0a')+(_0x96dec(0x20e)+_0x8c2621+_0x96dec(0x216)+(_0x5a2293||_0x96dec(0x214))+_0x96dec(0x213)+_0x2648a0)});_0x5259=_0x8d5d96,console['log'](a4_0x40c111[_0x96dec(0x215)](_0x96dec(0x222)+_0x8d5d96));}}}}if(!_0x5259)return console[_0x96dec(0x1d9)](a4_0x40c111[_0x96dec(0x233)](_0x96dec(0x21d))),console[_0x96dec(0x1d9)](_0x96dec(0x187)),console['log'](_0x96dec(0x1c1)),console['log']('\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'](_0x96dec(0x200)),0x1;if(!_0x5a2293)throw new SDKError(ErrorCode[_0x96dec(0x20d)],_0x96dec(0x1fd),undefined,{'helpText':_0x96dec(0x1f7)});if(!_0x69a5bd&&!_0x444b15){if(!isInteractive())return console[_0x96dec(0x1e4)](a4_0x40c111['red']('\x0aError:'),_0x96dec(0x181)),console[_0x96dec(0x1e4)](a4_0x40c111[_0x96dec(0x215)](_0x96dec(0x1ee))),0x1;const _0x233a37=await confirmKey('Clone\x20\x22'+_0x5259+'\x22\x20to\x20new\x20project\x20\x22'+_0x5a2293+'\x22?');if(!_0x233a37)return console['log'](a4_0x40c111[_0x96dec(0x233)](_0x96dec(0x1a6))),0x1;}const {data:_0x11c7a6}=await withSpinner(_0x96dec(0x1aa)+_0x5259+_0x96dec(0x186)+_0x5a2293+_0x96dec(0x1d0),()=>_0x4617a4['llm'][_0x96dec(0x1c7)](_0x5259,_0x5a2293,{'dryRun':_0x444b15}));if(_0x444b15){console[_0x96dec(0x1d9)](a4_0x40c111[_0x96dec(0x233)](_0x96dec(0x197))),console[_0x96dec(0x1d9)](_0x96dec(0x205)+_0x11c7a6['sourceProjectName']),console[_0x96dec(0x1d9)](_0x96dec(0x180)+_0x5a2293),console[_0x96dec(0x1d9)](_0x96dec(0x228)),console[_0x96dec(0x1d9)](_0x96dec(0x1db)+_0x11c7a6[_0x96dec(0x1ca)][_0x96dec(0x191)][_0x96dec(0x176)]),console[_0x96dec(0x1d9)](_0x96dec(0x1e2)+_0x11c7a6[_0x96dec(0x1ca)][_0x96dec(0x1b7)][_0x96dec(0x176)]),console[_0x96dec(0x1d9)](_0x96dec(0x1bd)+_0x11c7a6[_0x96dec(0x1ca)]['prompts']['created']),console[_0x96dec(0x1d9)](_0x96dec(0x1fe)+_0x11c7a6['counts']['formInterfaces'][_0x96dec(0x176)]),console[_0x96dec(0x1d9)](_0x96dec(0x1bf)+_0x11c7a6[_0x96dec(0x1ca)][_0x96dec(0x1cc)][_0x96dec(0x176)]);const _0x4e38a6=_0x11c7a6['counts'][_0x96dec(0x194)][_0x96dec(0x176)]>0x0||_0x11c7a6[_0x96dec(0x1ca)][_0x96dec(0x201)]['created']>0x0;return _0x4e38a6&&(console[_0x96dec(0x1d9)](_0x96dec(0x1a4)+_0x11c7a6[_0x96dec(0x1ca)][_0x96dec(0x194)][_0x96dec(0x176)]),console[_0x96dec(0x1d9)](_0x96dec(0x18b)+_0x11c7a6[_0x96dec(0x1ca)]['experimentalArtifacts'][_0x96dec(0x176)])),0x0;}const _0x1f02bb=_0x11c7a6['counts'][_0x96dec(0x191)][_0x96dec(0x1c0)]>0x0||_0x11c7a6[_0x96dec(0x1ca)][_0x96dec(0x1b7)][_0x96dec(0x1c0)]>0x0||_0x11c7a6['counts'][_0x96dec(0x1b0)][_0x96dec(0x1c0)]>0x0||_0x11c7a6[_0x96dec(0x1ca)][_0x96dec(0x230)][_0x96dec(0x1c0)]>0x0||_0x11c7a6[_0x96dec(0x1ca)][_0x96dec(0x1cc)][_0x96dec(0x1c0)]>0x0||_0x11c7a6[_0x96dec(0x1ca)][_0x96dec(0x194)][_0x96dec(0x1c0)]>0x0||_0x11c7a6[_0x96dec(0x1ca)][_0x96dec(0x201)][_0x96dec(0x1c0)]>0x0;_0x1f02bb?console['log'](a4_0x40c111[_0x96dec(0x233)]('Project\x20cloned\x20with\x20errors')):console[_0x96dec(0x1d9)](a4_0x40c111['green'](_0x96dec(0x1c3)));console['log'](_0x96dec(0x205)+_0x11c7a6[_0x96dec(0x22e)]),console['log'](_0x96dec(0x180)+_0x11c7a6['newProjectName']),console[_0x96dec(0x1d9)](_0x96dec(0x17f)+_0x11c7a6[_0x96dec(0x17b)]),console[_0x96dec(0x1d9)](),console[_0x96dec(0x1d9)](_0x96dec(0x212)),console[_0x96dec(0x1d9)](_0x96dec(0x1db)+formatCountSummary(_0x11c7a6[_0x96dec(0x1ca)][_0x96dec(0x191)])),console[_0x96dec(0x1d9)](_0x96dec(0x1e2)+formatCountSummary(_0x11c7a6['counts'][_0x96dec(0x1b7)])),console[_0x96dec(0x1d9)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x11c7a6[_0x96dec(0x1ca)]['prompts'])),console[_0x96dec(0x1d9)](_0x96dec(0x1f9)+formatCountSummary(_0x11c7a6[_0x96dec(0x1ca)][_0x96dec(0x1f0)])),console[_0x96dec(0x1d9)](_0x96dec(0x1fe)+formatCountSummary(_0x11c7a6[_0x96dec(0x1ca)][_0x96dec(0x230)])),console[_0x96dec(0x1d9)](_0x96dec(0x1bf)+formatCountSummary(_0x11c7a6[_0x96dec(0x1ca)][_0x96dec(0x1cc)]));const _0x1cfa3e=_0x11c7a6[_0x96dec(0x1ca)][_0x96dec(0x194)][_0x96dec(0x176)]>0x0||_0x11c7a6['counts'][_0x96dec(0x194)][_0x96dec(0x175)]>0x0||_0x11c7a6[_0x96dec(0x1ca)]['experimentalKnowledgeBases'][_0x96dec(0x203)]>0x0||_0x11c7a6[_0x96dec(0x1ca)][_0x96dec(0x201)][_0x96dec(0x176)]>0x0||_0x11c7a6[_0x96dec(0x1ca)][_0x96dec(0x201)][_0x96dec(0x175)]>0x0||_0x11c7a6[_0x96dec(0x1ca)][_0x96dec(0x201)][_0x96dec(0x203)]>0x0;_0x1cfa3e&&(console[_0x96dec(0x1d9)](_0x96dec(0x1a4)+formatCountSummary(_0x11c7a6[_0x96dec(0x1ca)][_0x96dec(0x194)])),console[_0x96dec(0x1d9)](_0x96dec(0x18b)+formatCountSummary(_0x11c7a6[_0x96dec(0x1ca)]['experimentalArtifacts'])));if(_0x1f02bb){console[_0x96dec(0x1d9)](),console[_0x96dec(0x1d9)](a4_0x40c111[_0x96dec(0x174)](_0x96dec(0x1e1)));for(const _0x25dff1 of _0x11c7a6[_0x96dec(0x191)]){_0x25dff1['action']==='error'&&console[_0x96dec(0x1d9)](a4_0x40c111[_0x96dec(0x174)](_0x96dec(0x224)+_0x25dff1[_0x96dec(0x1b1)]+'\x22:\x20'+_0x25dff1[_0x96dec(0x1e4)]));}for(const _0x5210dc of _0x11c7a6[_0x96dec(0x1b7)]){_0x5210dc[_0x96dec(0x1ef)]===_0x96dec(0x1e4)&&console[_0x96dec(0x1d9)](a4_0x40c111[_0x96dec(0x174)](_0x96dec(0x211)+_0x5210dc[_0x96dec(0x225)]+_0x96dec(0x206)+_0x5210dc[_0x96dec(0x1e4)]));}for(const _0x20f192 of _0x11c7a6[_0x96dec(0x1b0)]){_0x20f192[_0x96dec(0x1ef)]===_0x96dec(0x1e4)&&console[_0x96dec(0x1d9)](a4_0x40c111[_0x96dec(0x174)](_0x96dec(0x21e)+_0x20f192['name']+'\x22:\x20'+_0x20f192[_0x96dec(0x1e4)]));}for(const _0x5e3b4c of _0x11c7a6['integrations']){_0x5e3b4c['action']==='error'&&console[_0x96dec(0x1d9)](a4_0x40c111[_0x96dec(0x174)](_0x96dec(0x1ce)+_0x5e3b4c[_0x96dec(0x225)]+_0x96dec(0x206)+_0x5e3b4c['error']));}for(const _0xe7bd5e of _0x11c7a6[_0x96dec(0x230)]){_0xe7bd5e[_0x96dec(0x1ef)]===_0x96dec(0x1e4)&&console['log'](a4_0x40c111[_0x96dec(0x174)](_0x96dec(0x223)+_0xe7bd5e['name']+_0x96dec(0x206)+_0xe7bd5e[_0x96dec(0x1e4)]));}for(const _0x337dd3 of _0x11c7a6[_0x96dec(0x1cc)]){_0x337dd3[_0x96dec(0x1ef)]===_0x96dec(0x1e4)&&console[_0x96dec(0x1d9)](a4_0x40c111[_0x96dec(0x174)]('\x20\x20Chat\x20Interface\x20\x22'+_0x337dd3[_0x96dec(0x225)]+'\x22:\x20'+_0x337dd3[_0x96dec(0x1e4)]));}for(const _0x58dd1b of _0x11c7a6[_0x96dec(0x194)]){_0x58dd1b[_0x96dec(0x1ef)]===_0x96dec(0x1e4)&&console[_0x96dec(0x1d9)](a4_0x40c111[_0x96dec(0x174)](_0x96dec(0x1d8)+_0x58dd1b[_0x96dec(0x225)]+_0x96dec(0x206)+_0x58dd1b[_0x96dec(0x1e4)]));}for(const _0x581e19 of _0x11c7a6['experimentalArtifacts']){_0x581e19[_0x96dec(0x1ef)]===_0x96dec(0x1e4)&&console['log'](a4_0x40c111['red'](_0x96dec(0x18f)+_0x581e19['name']+_0x96dec(0x206)+_0x581e19[_0x96dec(0x1e4)]));}return 0x1;}console[_0x96dec(0x1d9)]();const _0x141038=getLLMProjectUrl(_0x29c6e7,_0x11c7a6[_0x96dec(0x17b)]);return console[_0x96dec(0x1d9)](_0x96dec(0x190)+a4_0x40c111['cyan'](_0x141038)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x2eaf32(0x225)]='agent:push';[a4_0x2eaf32(0x1c8)]=a4_0x2eaf32(0x20f);async[a4_0x2eaf32(0x17a)](_0x15e4df){const _0x2b17cf=a4_0x2eaf32,{options:_0x5c581a,args:_0x28af52,tdx:_0x56b1cf}=_0x15e4df;let _0x27474b=_0x28af52[0x0]||process[_0x2b17cf(0x1e8)]();const _0x165b25=_0x5c581a[_0x2b17cf(0x19d)],_0x156b05=_0x5c581a[_0x2b17cf(0x172)],_0x7d7a25=_0x5c581a[_0x2b17cf(0x209)],_0x56485f=_0x5c581a[_0x2b17cf(0x19e)],_0x8a61ec=a4_0x38d37e['join'](_0x27474b,'agent.yml'),_0x3b27b9=existsSync(_0x8a61ec);if(_0x3b27b9){const {data:_0xc0fc73}=await withSpinner(_0x2b17cf(0x1bb)+_0x27474b+_0x2b17cf(0x1d0),()=>_0x56b1cf['llm']['pushAgent'](_0x27474b,{'dryRun':_0x165b25,'force':_0x156b05}));if(_0x165b25)return console[_0x2b17cf(0x1d9)](a4_0x40c111[_0x2b17cf(0x233)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x2b17cf(0x1d9)](_0x2b17cf(0x207)+_0xc0fc73[_0x2b17cf(0x1b1)]),0x0;if(_0xc0fc73[_0x2b17cf(0x1ef)]==='error')return console[_0x2b17cf(0x1d9)](a4_0x40c111[_0x2b17cf(0x174)](_0x2b17cf(0x1ea)+_0xc0fc73[_0x2b17cf(0x1e4)])),0x1;console[_0x2b17cf(0x1d9)](a4_0x40c111[_0x2b17cf(0x22c)]('Agent\x20'+_0xc0fc73[_0x2b17cf(0x1ef)]+'\x20successfully')),console['log'](_0x2b17cf(0x1f2)+_0xc0fc73[_0x2b17cf(0x1b1)]);if(_0xc0fc73[_0x2b17cf(0x1d6)]&&_0xc0fc73[_0x2b17cf(0x173)]){const _0x594408=getLLMAgentChatUrl(_0x56485f,_0xc0fc73[_0x2b17cf(0x173)],_0xc0fc73[_0x2b17cf(0x1d6)]);console[_0x2b17cf(0x1d9)](_0x2b17cf(0x1be)+a4_0x40c111[_0x2b17cf(0x204)](_0x594408));}return 0x0;}const _0x3c166d=_0x5c581a['llmProject'],_0x4a0014=resolveProjectFromContext(_0x27474b,_0x3c166d);if(_0x4a0014[_0x2b17cf(0x21a)])_0x27474b=_0x4a0014['projectDir'],_0x4a0014[_0x2b17cf(0x1d7)]===_0x2b17cf(0x1c5)&&console[_0x2b17cf(0x1d9)](a4_0x40c111[_0x2b17cf(0x215)](_0x2b17cf(0x189)+_0x27474b));else{let _0x36febd='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x4a0014['reason']===_0x2b17cf(0x18a)&&(_0x36febd=_0x4a0014[_0x2b17cf(0x182)]+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x4a0014[_0x2b17cf(0x1e0)]+_0x2b17cf(0x232));throw new SDKError(ErrorCode[_0x2b17cf(0x1dc)],_0x4a0014[_0x2b17cf(0x1a0)]==='no_context'?_0x4a0014['message']:_0x2b17cf(0x1a5)+_0x27474b,undefined,{'helpText':_0x36febd});}const {data:_0x3243f5}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x56b1cf['llm'][_0x2b17cf(0x21f)](_0x27474b,{'dryRun':!![]})),_0x9b4151=_0x3243f5[_0x2b17cf(0x1ca)][_0x2b17cf(0x191)][_0x2b17cf(0x1c0)]>0x0;if(_0x9b4151){console[_0x2b17cf(0x1d9)](a4_0x40c111[_0x2b17cf(0x174)](_0x2b17cf(0x1b8)));for(const _0x45b13b of _0x3243f5[_0x2b17cf(0x191)]){_0x45b13b[_0x2b17cf(0x1ef)]==='error'&&console[_0x2b17cf(0x1d9)](a4_0x40c111['red'](_0x2b17cf(0x224)+_0x45b13b['agentName']+_0x2b17cf(0x206)+_0x45b13b[_0x2b17cf(0x1e4)]));}return 0x1;}const _0x136059=_0x3243f5[_0x2b17cf(0x1ca)]['agents']['created']+_0x3243f5['counts']['knowledgeBases'][_0x2b17cf(0x176)]+_0x3243f5['counts'][_0x2b17cf(0x19b)]['created']+_0x3243f5[_0x2b17cf(0x1ca)][_0x2b17cf(0x1b0)]['created']+_0x3243f5['counts']['integrations']['created']+_0x3243f5[_0x2b17cf(0x1ca)]['experimentalKnowledgeBases'][_0x2b17cf(0x176)]+_0x3243f5[_0x2b17cf(0x1ca)]['experimentalArtifacts'][_0x2b17cf(0x176)]+_0x3243f5[_0x2b17cf(0x1ca)]['formInterfaces'][_0x2b17cf(0x176)]+_0x3243f5[_0x2b17cf(0x1ca)][_0x2b17cf(0x1cc)][_0x2b17cf(0x176)],_0x2fe121=_0x3243f5['counts'][_0x2b17cf(0x191)]['updated']+_0x3243f5[_0x2b17cf(0x1ca)][_0x2b17cf(0x1b7)][_0x2b17cf(0x175)]+_0x3243f5[_0x2b17cf(0x1ca)][_0x2b17cf(0x19b)][_0x2b17cf(0x175)]+_0x3243f5['counts'][_0x2b17cf(0x1b0)][_0x2b17cf(0x175)]+_0x3243f5[_0x2b17cf(0x1ca)][_0x2b17cf(0x1f0)][_0x2b17cf(0x175)]+_0x3243f5['counts'][_0x2b17cf(0x194)]['updated']+_0x3243f5[_0x2b17cf(0x1ca)][_0x2b17cf(0x201)]['updated']+_0x3243f5[_0x2b17cf(0x1ca)][_0x2b17cf(0x230)][_0x2b17cf(0x175)]+_0x3243f5[_0x2b17cf(0x1ca)][_0x2b17cf(0x1cc)][_0x2b17cf(0x175)],_0x5db2d8=_0x3243f5['counts']['agents'][_0x2b17cf(0x203)]+_0x3243f5['counts'][_0x2b17cf(0x1b7)]['unchanged']+_0x3243f5[_0x2b17cf(0x1ca)][_0x2b17cf(0x19b)][_0x2b17cf(0x203)]+_0x3243f5['counts'][_0x2b17cf(0x1b0)]['unchanged']+_0x3243f5[_0x2b17cf(0x1ca)][_0x2b17cf(0x1f0)][_0x2b17cf(0x203)]+_0x3243f5[_0x2b17cf(0x1ca)]['experimentalKnowledgeBases']['unchanged']+_0x3243f5['counts'][_0x2b17cf(0x201)][_0x2b17cf(0x203)]+_0x3243f5[_0x2b17cf(0x1ca)][_0x2b17cf(0x230)][_0x2b17cf(0x203)]+_0x3243f5['counts'][_0x2b17cf(0x1cc)][_0x2b17cf(0x203)];console[_0x2b17cf(0x1d9)](_0x2b17cf(0x1fc)+_0x3243f5[_0x2b17cf(0x1de)]+'\x27:'),console[_0x2b17cf(0x1d9)]('\x20\x20'+a4_0x40c111[_0x2b17cf(0x22c)]('+\x20'+_0x136059+_0x2b17cf(0x19f))+_0x2b17cf(0x22f)+a4_0x40c111[_0x2b17cf(0x233)]('~\x20'+_0x2fe121+_0x2b17cf(0x1c4))+'\x20|\x20'+a4_0x40c111[_0x2b17cf(0x215)]('=\x20'+_0x5db2d8+_0x2b17cf(0x218))),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x3243f5['counts'][_0x2b17cf(0x191)])),console[_0x2b17cf(0x1d9)](_0x2b17cf(0x1e2)+formatCountSummary(_0x3243f5[_0x2b17cf(0x1ca)][_0x2b17cf(0x1b7)])),console['log'](_0x2b17cf(0x1e3)+formatCountSummary(_0x3243f5[_0x2b17cf(0x1ca)][_0x2b17cf(0x19b)])),console[_0x2b17cf(0x1d9)](_0x2b17cf(0x1bd)+formatCountSummary(_0x3243f5[_0x2b17cf(0x1ca)][_0x2b17cf(0x1b0)])),console['log'](_0x2b17cf(0x1f9)+formatCountSummary(_0x3243f5[_0x2b17cf(0x1ca)][_0x2b17cf(0x1f0)])),console[_0x2b17cf(0x1d9)](_0x2b17cf(0x1fe)+formatCountSummary(_0x3243f5[_0x2b17cf(0x1ca)][_0x2b17cf(0x230)])),console['log']('\x20\x20Chat\x20Interfaces:\x20'+formatCountSummary(_0x3243f5[_0x2b17cf(0x1ca)]['chatInterfaces']));const _0x56bf4f=_0x3243f5[_0x2b17cf(0x1ca)][_0x2b17cf(0x194)][_0x2b17cf(0x176)]>0x0||_0x3243f5['counts'][_0x2b17cf(0x194)]['updated']>0x0||_0x3243f5[_0x2b17cf(0x1ca)]['experimentalKnowledgeBases'][_0x2b17cf(0x203)]>0x0||_0x3243f5[_0x2b17cf(0x1ca)][_0x2b17cf(0x201)][_0x2b17cf(0x176)]>0x0||_0x3243f5['counts'][_0x2b17cf(0x201)]['updated']>0x0||_0x3243f5[_0x2b17cf(0x1ca)]['experimentalArtifacts'][_0x2b17cf(0x203)]>0x0;_0x56bf4f&&(console[_0x2b17cf(0x1d9)](_0x2b17cf(0x1a4)+formatCountSummary(_0x3243f5[_0x2b17cf(0x1ca)][_0x2b17cf(0x194)])),console[_0x2b17cf(0x1d9)](_0x2b17cf(0x18b)+formatCountSummary(_0x3243f5['counts'][_0x2b17cf(0x201)])));console[_0x2b17cf(0x1d9)]('\x20\x20Source:\x20'+a4_0x40c111[_0x2b17cf(0x204)](_0x27474b)),displayDiffs(_0x3243f5[_0x2b17cf(0x191)],_0x3243f5['knowledgeBases'],_0x3243f5[_0x2b17cf(0x19b)],_0x3243f5[_0x2b17cf(0x1b0)],_0x3243f5['integrations'],_0x3243f5[_0x2b17cf(0x194)],_0x3243f5[_0x2b17cf(0x201)],_0x3243f5['formInterfaces'],_0x3243f5[_0x2b17cf(0x1cc)]);if(_0x165b25)return console['log'](a4_0x40c111[_0x2b17cf(0x233)](_0x2b17cf(0x1a1))),0x0;if(_0x136059===0x0&&_0x2fe121===0x0){console[_0x2b17cf(0x1d9)](a4_0x40c111[_0x2b17cf(0x22c)](_0x2b17cf(0x21c)));const _0x4c3959=getLLMProjectUrl(_0x56485f,_0x3243f5[_0x2b17cf(0x173)]);return console[_0x2b17cf(0x1d9)](_0x2b17cf(0x190)+a4_0x40c111[_0x2b17cf(0x204)](_0x4c3959)),0x0;}if(!_0x7d7a25&&!_0x156b05){if(!isInteractive())return console['error'](a4_0x40c111[_0x2b17cf(0x174)](_0x2b17cf(0x19a)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x2b17cf(0x1e4)](a4_0x40c111[_0x2b17cf(0x215)](_0x2b17cf(0x1ee))),0x1;const _0x1447f9=await confirmKey(_0x2b17cf(0x226)+(_0x136059+_0x2fe121)+_0x2b17cf(0x1b4));if(!_0x1447f9)return console['log'](a4_0x40c111[_0x2b17cf(0x233)](_0x2b17cf(0x1a6)),'-\x20nothing\x20pushed'),0x1;}const {data:_0x35fe48}=await withSpinner(_0x2b17cf(0x21b),()=>_0x56b1cf['llm'][_0x2b17cf(0x21f)](_0x27474b,{'force':_0x156b05})),_0x11f796=_0x35fe48[_0x2b17cf(0x1ca)][_0x2b17cf(0x191)][_0x2b17cf(0x1c0)]>0x0||_0x35fe48[_0x2b17cf(0x1ca)][_0x2b17cf(0x1b7)]['errors']>0x0||_0x35fe48[_0x2b17cf(0x1ca)][_0x2b17cf(0x19b)][_0x2b17cf(0x1c0)]>0x0||_0x35fe48['counts'][_0x2b17cf(0x1b0)][_0x2b17cf(0x1c0)]>0x0||_0x35fe48[_0x2b17cf(0x1ca)][_0x2b17cf(0x230)][_0x2b17cf(0x1c0)]>0x0||_0x35fe48[_0x2b17cf(0x1ca)]['chatInterfaces'][_0x2b17cf(0x1c0)]>0x0;if(_0x11f796){console['log'](a4_0x40c111[_0x2b17cf(0x233)](_0x2b17cf(0x1f3))),console['log'](),console[_0x2b17cf(0x1d9)](a4_0x40c111[_0x2b17cf(0x174)](_0x2b17cf(0x1e1)));for(const _0x17e92d of _0x35fe48[_0x2b17cf(0x191)]){_0x17e92d['action']==='error'&&console[_0x2b17cf(0x1d9)](a4_0x40c111['red'](_0x2b17cf(0x224)+_0x17e92d[_0x2b17cf(0x1b1)]+_0x2b17cf(0x206)+_0x17e92d['error']));}for(const _0x3f0bfb of _0x35fe48[_0x2b17cf(0x1b7)]){_0x3f0bfb[_0x2b17cf(0x1ef)]===_0x2b17cf(0x1e4)&&console['log'](a4_0x40c111['red'](_0x2b17cf(0x211)+_0x3f0bfb[_0x2b17cf(0x225)]+'\x22:\x20'+_0x3f0bfb[_0x2b17cf(0x1e4)]));}for(const _0x1ad6a1 of _0x35fe48[_0x2b17cf(0x19b)]){_0x1ad6a1[_0x2b17cf(0x1ef)]==='error'&&console[_0x2b17cf(0x1d9)](a4_0x40c111[_0x2b17cf(0x174)](_0x2b17cf(0x1c2)+_0x1ad6a1[_0x2b17cf(0x225)]+_0x2b17cf(0x206)+_0x1ad6a1[_0x2b17cf(0x1e4)]));}for(const _0x5e4a32 of _0x35fe48['prompts']){_0x5e4a32[_0x2b17cf(0x1ef)]==='error'&&console[_0x2b17cf(0x1d9)](a4_0x40c111[_0x2b17cf(0x174)](_0x2b17cf(0x21e)+_0x5e4a32[_0x2b17cf(0x225)]+'\x22:\x20'+_0x5e4a32['error']));}for(const _0xd068d3 of _0x35fe48[_0x2b17cf(0x1f0)]){_0xd068d3['action']==='error'&&console[_0x2b17cf(0x1d9)](a4_0x40c111[_0x2b17cf(0x174)]('\x20\x20Integration\x20\x22'+_0xd068d3[_0x2b17cf(0x225)]+'\x22:\x20'+_0xd068d3[_0x2b17cf(0x1e4)]));}for(const _0x29f9b7 of _0x35fe48[_0x2b17cf(0x230)]){_0x29f9b7[_0x2b17cf(0x1ef)]===_0x2b17cf(0x1e4)&&console[_0x2b17cf(0x1d9)](a4_0x40c111[_0x2b17cf(0x174)](_0x2b17cf(0x223)+_0x29f9b7[_0x2b17cf(0x225)]+_0x2b17cf(0x206)+_0x29f9b7[_0x2b17cf(0x1e4)]));}for(const _0x5a3159 of _0x35fe48[_0x2b17cf(0x1cc)]){_0x5a3159[_0x2b17cf(0x1ef)]===_0x2b17cf(0x1e4)&&console[_0x2b17cf(0x1d9)](a4_0x40c111[_0x2b17cf(0x174)]('\x20\x20Chat\x20Interface\x20\x22'+_0x5a3159[_0x2b17cf(0x225)]+'\x22:\x20'+_0x5a3159[_0x2b17cf(0x1e4)]));}return 0x1;}console['log'](a4_0x40c111['green'](_0x2b17cf(0x1eb)+(_0x136059+_0x2fe121)+'\x20resources\x20to\x20\x27'+_0x35fe48[_0x2b17cf(0x1de)]+'\x27'));const _0x4d0b39=getLLMProjectUrl(_0x56485f,_0x35fe48[_0x2b17cf(0x173)]);return console['log'](_0x2b17cf(0x190)+a4_0x40c111[_0x2b17cf(0x204)](_0x4d0b39)),0x0;}}
|
|
1
|
+
const a4_0x3353d8=a4_0x4c68;(function(_0x21c1e1,_0x1f267d){const _0x5e4e86=a4_0x4c68,_0x43c43a=_0x21c1e1();while(!![]){try{const _0x540bee=parseInt(_0x5e4e86(0x1d3))/0x1*(-parseInt(_0x5e4e86(0x234))/0x2)+parseInt(_0x5e4e86(0x235))/0x3*(parseInt(_0x5e4e86(0x259))/0x4)+-parseInt(_0x5e4e86(0x281))/0x5+-parseInt(_0x5e4e86(0x21a))/0x6+parseInt(_0x5e4e86(0x1ef))/0x7+-parseInt(_0x5e4e86(0x202))/0x8*(-parseInt(_0x5e4e86(0x27a))/0x9)+parseInt(_0x5e4e86(0x1d8))/0xa;if(_0x540bee===_0x1f267d)break;else _0x43c43a['push'](_0x43c43a['shift']());}catch(_0x679119){_0x43c43a['push'](_0x43c43a['shift']());}}}(a4_0x53dd,0x74034));import a4_0x3df42b from'chalk';import a4_0xde5246 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';function a4_0x4c68(_0x54e19e,_0x4c16fb){_0x54e19e=_0x54e19e-0x1c1;const _0x53dd33=a4_0x53dd();let _0x4c687d=_0x53dd33[_0x54e19e];return _0x4c687d;}import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0xcb094d){const _0x45369e=a4_0x4c68,_0x2be518=[];if(_0xcb094d[_0x45369e(0x218)]!==undefined)_0x2be518[_0x45369e(0x1ee)](_0xcb094d[_0x45369e(0x218)]+_0x45369e(0x1ec));if(_0xcb094d[_0x45369e(0x257)]!==undefined&&_0xcb094d[_0x45369e(0x257)]>0x0)_0x2be518[_0x45369e(0x1ee)](a4_0x3df42b[_0x45369e(0x25a)](_0xcb094d[_0x45369e(0x257)]+_0x45369e(0x22b)));if(_0xcb094d[_0x45369e(0x232)]!==undefined&&_0xcb094d[_0x45369e(0x232)]>0x0)_0x2be518['push'](a4_0x3df42b['green'](_0xcb094d[_0x45369e(0x232)]+_0x45369e(0x1fa)));if(_0xcb094d[_0x45369e(0x252)]!==undefined&&_0xcb094d[_0x45369e(0x252)]>0x0)_0x2be518[_0x45369e(0x1ee)](a4_0x3df42b[_0x45369e(0x27d)](_0xcb094d[_0x45369e(0x252)]+_0x45369e(0x1dd)));if(_0xcb094d[_0x45369e(0x263)]!==undefined&&_0xcb094d[_0x45369e(0x263)]>0x0)_0x2be518[_0x45369e(0x1ee)](a4_0x3df42b[_0x45369e(0x23b)](_0xcb094d[_0x45369e(0x263)]+_0x45369e(0x247)));if(_0xcb094d['errors']!==undefined&&_0xcb094d['errors']>0x0)_0x2be518['push'](a4_0x3df42b[_0x45369e(0x217)](_0xcb094d['errors']+_0x45369e(0x25d)));return _0x2be518['join'](',\x20');}function displayDiffs(_0x5e8f99,_0x241d69,_0x17c41c,_0xabe8e,_0x1528ce,_0xb1a5b,_0x45fe84,_0x3f92a0,_0x2fc064){const _0x100687=a4_0x4c68;for(const _0x538224 of _0x5e8f99){if(_0x538224[_0x100687(0x1c1)]){const _0xb3afca=_0x538224['agentName']||_0x538224['name'];console['log'](_0x100687(0x204)+_0xb3afca+'\x27:'),console[_0x100687(0x24d)]('─'['repeat'](0x3c)),console['log'](_0x538224[_0x100687(0x1c1)]),console['log']('─'['repeat'](0x3c));}}for(const _0x54a024 of _0x241d69){_0x54a024['diff']&&(console['log']('\x0aChanges\x20to\x20knowledge\x20base\x20\x27'+_0x54a024[_0x100687(0x26d)]+'\x27:'),console[_0x100687(0x24d)]('─'[_0x100687(0x205)](0x3c)),console['log'](_0x54a024[_0x100687(0x1c1)]),console['log']('─'[_0x100687(0x205)](0x3c)));}for(const _0x2c834d of _0x17c41c){_0x2c834d[_0x100687(0x1c1)]&&(console[_0x100687(0x24d)](_0x100687(0x1e0)+_0x2c834d[_0x100687(0x26d)]+'\x27:'),console['log']('─'[_0x100687(0x205)](0x3c)),console[_0x100687(0x24d)](_0x2c834d[_0x100687(0x1c1)]),console[_0x100687(0x24d)]('─'[_0x100687(0x205)](0x3c)));}for(const _0x1e2071 of _0xabe8e){_0x1e2071[_0x100687(0x1c1)]&&(console[_0x100687(0x24d)](_0x100687(0x23a)+_0x1e2071['name']+'\x27:'),console[_0x100687(0x24d)]('─'[_0x100687(0x205)](0x3c)),console[_0x100687(0x24d)](_0x1e2071['diff']),console[_0x100687(0x24d)]('─'[_0x100687(0x205)](0x3c)));}for(const _0xce0f02 of _0x1528ce){_0xce0f02['diff']&&(console[_0x100687(0x24d)](_0x100687(0x1c2)+_0xce0f02['name']+'\x27:'),console[_0x100687(0x24d)]('─'[_0x100687(0x205)](0x3c)),console[_0x100687(0x24d)](_0xce0f02['diff']),console[_0x100687(0x24d)]('─'[_0x100687(0x205)](0x3c)));}for(const _0xe5bd45 of _0xb1a5b){_0xe5bd45[_0x100687(0x1c1)]&&(console[_0x100687(0x24d)](_0x100687(0x271)+_0xe5bd45['name']+'\x27:'),console[_0x100687(0x24d)]('─'['repeat'](0x3c)),console[_0x100687(0x24d)](_0xe5bd45[_0x100687(0x1c1)]),console[_0x100687(0x24d)]('─'[_0x100687(0x205)](0x3c)));}for(const _0x497a12 of _0x45fe84){_0x497a12[_0x100687(0x1c1)]&&(console[_0x100687(0x24d)](_0x100687(0x245)+_0x497a12[_0x100687(0x26d)]+'\x27:'),console[_0x100687(0x24d)]('─'[_0x100687(0x205)](0x3c)),console[_0x100687(0x24d)](_0x497a12[_0x100687(0x1c1)]),console[_0x100687(0x24d)]('─'[_0x100687(0x205)](0x3c)));}for(const _0x44ac72 of _0x3f92a0){_0x44ac72['diff']&&(console[_0x100687(0x24d)](_0x100687(0x231)+_0x44ac72[_0x100687(0x26d)]+'\x27:'),console['log']('─'[_0x100687(0x205)](0x3c)),console[_0x100687(0x24d)](_0x44ac72['diff']),console[_0x100687(0x24d)]('─'[_0x100687(0x205)](0x3c)));}for(const _0x4eb62a of _0x2fc064){_0x4eb62a[_0x100687(0x1c1)]&&(console[_0x100687(0x24d)]('\x0aChanges\x20to\x20chat\x20interface\x20\x27'+_0x4eb62a[_0x100687(0x26d)]+'\x27:'),console[_0x100687(0x24d)]('─'['repeat'](0x3c)),console[_0x100687(0x24d)](_0x4eb62a[_0x100687(0x1c1)]),console[_0x100687(0x24d)]('─'[_0x100687(0x205)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x3353d8(0x26d)]=a4_0x3353d8(0x208);['description']='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async['execute'](_0x4af5ac){const _0x32e960=a4_0x3353d8,{options:_0x154b47,args:_0x6f4c31,tdx:_0x37d082}=_0x4af5ac,_0x177fa3=_0x6f4c31[0x0],_0x5e39bc=_0x6f4c31[0x1],_0x4814ce=_0x154b47['output'],_0x55bfd5=_0x154b47[_0x32e960(0x268)],_0x2e8f12=_0x154b47[_0x32e960(0x1c5)],_0x3ea217=_0x154b47[_0x32e960(0x1ce)],_0x5016c5=_0x154b47['llmProject'],_0x5594ea=_0x154b47[_0x32e960(0x26c)];let _0x5cc00c;if(_0x177fa3){const _0x3e19bf=a4_0xde5246[_0x32e960(0x1f9)](_0x177fa3,_0x32e960(0x23f));if(existsSync(_0x3e19bf))try{const _0x2576ad=JSON[_0x32e960(0x20a)](readFileSync(_0x3e19bf,_0x32e960(0x25b)));_0x2576ad[_0x32e960(0x265)]&&(_0x5cc00c={'llm_project':_0x2576ad[_0x32e960(0x265)]});}catch{}}const _0x5b0066=findAgentConfigPath(process[_0x32e960(0x1e1)]());let _0x4e1c82;if(_0x5b0066)try{const _0x456512=JSON[_0x32e960(0x20a)](readFileSync(_0x5b0066,_0x32e960(0x25b)));_0x456512[_0x32e960(0x265)]&&(_0x4e1c82={'llm_project':_0x456512['llm_project']});}catch{}const _0x500f78=resolveAgentPullArgs({'arg':_0x177fa3,'agentNameArg':_0x5e39bc,'agentFlag':_0x5594ea,'contextProject':_0x5016c5,'argDirConfig':_0x5cc00c,'cwdConfigPath':_0x5b0066||undefined,'cwdConfig':_0x4e1c82}),{projectNameOrId:_0xdd2347,targetAgentName:_0x5aad46,existingOutputDir:_0x3efc30,source:_0x7be548}=_0x500f78;if(_0x7be548==='arg-dir')console[_0x32e960(0x24d)](a4_0x3df42b['dim'](_0x32e960(0x21b)+a4_0xde5246['join'](_0x177fa3,_0x32e960(0x23f))+':\x20'+_0xdd2347));else{if(_0x7be548==='cwd-config')console['log'](a4_0x3df42b[_0x32e960(0x284)](_0x32e960(0x1da)+_0xdd2347));else _0x7be548===_0x32e960(0x1ed)&&console[_0x32e960(0x24d)](a4_0x3df42b['dim'](_0x32e960(0x24a)+_0xdd2347));}if(!_0xdd2347)return _0x5594ea?(console[_0x32e960(0x24d)](a4_0x3df42b['yellow'](_0x32e960(0x236))),console['log']('Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>'),console[_0x32e960(0x24d)](_0x32e960(0x200))):(console['log'](a4_0x3df42b[_0x32e960(0x27d)](_0x32e960(0x1c3))),console[_0x32e960(0x24d)](_0x32e960(0x1c6)),console[_0x32e960(0x24d)](_0x32e960(0x26b)),console[_0x32e960(0x24d)](_0x32e960(0x27f)),console[_0x32e960(0x24d)](_0x32e960(0x22d)),console[_0x32e960(0x24d)](_0x32e960(0x1d9))),0x1;if(_0x5aad46){const {data:_0x59cb5a}=await withSpinner(_0x32e960(0x1cd)+_0x5aad46+_0x32e960(0x1fe)+_0xdd2347+_0x32e960(0x27b),()=>_0x37d082['llm']['pullAgent'](_0xdd2347,_0x5aad46,_0x4814ce,{'dryRun':_0x55bfd5,'force':_0x2e8f12}));if(_0x55bfd5)return console['log'](a4_0x3df42b['yellow'](_0x32e960(0x27e))),console[_0x32e960(0x24d)](_0x32e960(0x243)+_0x59cb5a[_0x32e960(0x23d)]),console[_0x32e960(0x24d)](_0x32e960(0x214)+_0x59cb5a[_0x32e960(0x21c)]),_0x59cb5a['diff']&&(console[_0x32e960(0x24d)](_0x32e960(0x203)),console[_0x32e960(0x24d)]('─'[_0x32e960(0x205)](0x3c)),console[_0x32e960(0x24d)](_0x59cb5a[_0x32e960(0x1c1)]),console['log']('─'[_0x32e960(0x205)](0x3c))),0x0;return console[_0x32e960(0x24d)](a4_0x3df42b[_0x32e960(0x25a)]('Agent\x20pulled\x20successfully')),console[_0x32e960(0x24d)]('Agent:\x20'+_0x59cb5a[_0x32e960(0x23d)]),console['log'](_0x32e960(0x1ea)+_0x59cb5a[_0x32e960(0x21c)]),console[_0x32e960(0x24d)](_0x32e960(0x1cb)+(_0x59cb5a[_0x32e960(0x1d4)]?a4_0x3df42b[_0x32e960(0x25a)](_0x32e960(0x257)):_0x59cb5a[_0x32e960(0x20d)]?a4_0x3df42b[_0x32e960(0x27d)](_0x32e960(0x252)):a4_0x3df42b[_0x32e960(0x23b)](_0x32e960(0x263)))),0x0;}const _0x478eb1=_0x3efc30||_0x4814ce,{data:_0x56fd18}=await withSpinner(_0x32e960(0x20c)+_0xdd2347+_0x32e960(0x27b),()=>_0x37d082[_0x32e960(0x282)][_0x32e960(0x22f)](_0xdd2347,_0x478eb1,{'dryRun':!![]})),_0x1a3189=_0x56fd18[_0x32e960(0x1f6)][_0x32e960(0x1e9)][_0x32e960(0x257)]+_0x56fd18[_0x32e960(0x1f6)][_0x32e960(0x21f)][_0x32e960(0x257)]+_0x56fd18[_0x32e960(0x1f6)][_0x32e960(0x1c7)]['new']+_0x56fd18[_0x32e960(0x1f6)][_0x32e960(0x240)][_0x32e960(0x257)]+_0x56fd18[_0x32e960(0x1f6)][_0x32e960(0x256)][_0x32e960(0x257)]+_0x56fd18['counts'][_0x32e960(0x1e3)]['new']+_0x56fd18[_0x32e960(0x1f6)][_0x32e960(0x23e)]['new']+_0x56fd18[_0x32e960(0x1f6)][_0x32e960(0x1eb)]['new']+_0x56fd18['counts']['chatInterfaces'][_0x32e960(0x257)],_0x397229=_0x56fd18[_0x32e960(0x1f6)][_0x32e960(0x1e9)][_0x32e960(0x252)]+_0x56fd18['counts'][_0x32e960(0x21f)][_0x32e960(0x252)]+_0x56fd18[_0x32e960(0x1f6)][_0x32e960(0x1c7)][_0x32e960(0x252)]+_0x56fd18['counts'][_0x32e960(0x240)][_0x32e960(0x252)]+_0x56fd18[_0x32e960(0x1f6)][_0x32e960(0x256)][_0x32e960(0x252)]+_0x56fd18[_0x32e960(0x1f6)][_0x32e960(0x1e3)][_0x32e960(0x252)]+_0x56fd18['counts'][_0x32e960(0x23e)][_0x32e960(0x252)]+_0x56fd18['counts'][_0x32e960(0x1eb)][_0x32e960(0x252)]+_0x56fd18[_0x32e960(0x1f6)]['chatInterfaces'][_0x32e960(0x252)],_0x1063b0=_0x56fd18[_0x32e960(0x1f6)][_0x32e960(0x1e9)][_0x32e960(0x263)]+_0x56fd18[_0x32e960(0x1f6)][_0x32e960(0x21f)][_0x32e960(0x263)]+_0x56fd18[_0x32e960(0x1f6)][_0x32e960(0x1c7)][_0x32e960(0x263)]+_0x56fd18[_0x32e960(0x1f6)][_0x32e960(0x240)][_0x32e960(0x263)]+_0x56fd18[_0x32e960(0x1f6)][_0x32e960(0x256)][_0x32e960(0x263)]+_0x56fd18[_0x32e960(0x1f6)][_0x32e960(0x1e3)]['unchanged']+_0x56fd18[_0x32e960(0x1f6)][_0x32e960(0x23e)]['unchanged']+_0x56fd18['counts'][_0x32e960(0x1eb)][_0x32e960(0x263)]+_0x56fd18[_0x32e960(0x1f6)][_0x32e960(0x210)][_0x32e960(0x263)];console[_0x32e960(0x24d)](_0x32e960(0x220)+_0x56fd18[_0x32e960(0x216)]+'\x27:'),console[_0x32e960(0x24d)]('\x20\x20'+a4_0x3df42b['green']('+\x20'+_0x1a3189+'\x20new')+_0x32e960(0x25c)+a4_0x3df42b[_0x32e960(0x27d)]('~\x20'+_0x397229+_0x32e960(0x26a))+'\x20|\x20'+a4_0x3df42b[_0x32e960(0x284)]('=\x20'+_0x1063b0+_0x32e960(0x247))),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x56fd18['counts'][_0x32e960(0x1e9)])),console[_0x32e960(0x24d)](_0x32e960(0x270)+formatCountSummary(_0x56fd18[_0x32e960(0x1f6)][_0x32e960(0x21f)])),console[_0x32e960(0x24d)](_0x32e960(0x272)+formatCountSummary(_0x56fd18[_0x32e960(0x1f6)][_0x32e960(0x1c7)])),console['log'](_0x32e960(0x213)+formatCountSummary(_0x56fd18['counts'][_0x32e960(0x240)])),console[_0x32e960(0x24d)](_0x32e960(0x279)+formatCountSummary(_0x56fd18[_0x32e960(0x1f6)][_0x32e960(0x256)])),console[_0x32e960(0x24d)](_0x32e960(0x246)+formatCountSummary(_0x56fd18[_0x32e960(0x1f6)][_0x32e960(0x1eb)])),console[_0x32e960(0x24d)]('\x20\x20Chat\x20Interfaces:\x20'+formatCountSummary(_0x56fd18[_0x32e960(0x1f6)][_0x32e960(0x210)]));const _0x38236d=_0x56fd18[_0x32e960(0x1f6)][_0x32e960(0x1e3)][_0x32e960(0x218)]>0x0||_0x56fd18[_0x32e960(0x1f6)][_0x32e960(0x23e)][_0x32e960(0x218)]>0x0;_0x38236d&&(console[_0x32e960(0x24d)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x56fd18['counts'][_0x32e960(0x1e3)])),console['log'](_0x32e960(0x1fb)+formatCountSummary(_0x56fd18['counts'][_0x32e960(0x23e)])));console['log']('\x20\x20Target:\x20'+a4_0x3df42b[_0x32e960(0x219)](_0x56fd18[_0x32e960(0x1de)])),displayDiffs(_0x56fd18[_0x32e960(0x1e9)],_0x56fd18['knowledgeBases'],_0x56fd18[_0x32e960(0x1c7)],_0x56fd18[_0x32e960(0x240)],_0x56fd18[_0x32e960(0x256)],_0x56fd18['experimentalKnowledgeBases'],_0x56fd18[_0x32e960(0x23e)],_0x56fd18[_0x32e960(0x1eb)],_0x56fd18[_0x32e960(0x210)]);if(_0x55bfd5)return console[_0x32e960(0x24d)](a4_0x3df42b[_0x32e960(0x27d)](_0x32e960(0x1e4))),0x0;if(_0x1a3189===0x0&&_0x397229===0x0)return console[_0x32e960(0x24d)](a4_0x3df42b['green']('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x56fd18[_0x32e960(0x216)]},_0x154b47[_0x32e960(0x260)]),console['log'](a4_0x3df42b[_0x32e960(0x25a)](_0x32e960(0x283)+a4_0x3df42b['dim'](_0x32e960(0x265))+'\x20=\x20'+a4_0x3df42b[_0x32e960(0x219)](_0x56fd18[_0x32e960(0x216)]))),0x0;if(!_0x3ea217&&!_0x2e8f12){if(!isInteractive())return console['error'](a4_0x3df42b['red']('\x0aError:'),_0x32e960(0x254)),console[_0x32e960(0x1ca)](a4_0x3df42b[_0x32e960(0x284)](_0x32e960(0x1fc))),0x1;const _0x3b5574=await confirmKey(_0x32e960(0x26f)+(_0x1a3189+_0x397229)+_0x32e960(0x1c8));if(!_0x3b5574)return console[_0x32e960(0x24d)](a4_0x3df42b[_0x32e960(0x27d)](_0x32e960(0x1e5)),'-\x20no\x20files\x20written'),0x1;}const {data:_0x454231}=await withSpinner(_0x32e960(0x1e8),()=>_0x37d082[_0x32e960(0x282)][_0x32e960(0x22f)](_0xdd2347,_0x478eb1,{'force':_0x2e8f12}));return console[_0x32e960(0x24d)](a4_0x3df42b['green'](_0x32e960(0x24c)+(_0x1a3189+_0x397229)+_0x32e960(0x258)+_0x454231[_0x32e960(0x1de)])),saveSessionContext({'llm_project':_0x454231[_0x32e960(0x216)]},_0x154b47['session']),console[_0x32e960(0x24d)](a4_0x3df42b['green'](_0x32e960(0x283)+a4_0x3df42b[_0x32e960(0x284)](_0x32e960(0x265))+'\x20=\x20'+a4_0x3df42b['cyan'](_0x454231[_0x32e960(0x216)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x3353d8(0x26d)]=a4_0x3353d8(0x1f0);['description']=a4_0x3353d8(0x1dc);async[a4_0x3353d8(0x22a)](_0x4034e5){const _0x207167=a4_0x3353d8,{options:_0x1c4f65,args:_0x28ccc4,tdx:_0xf1f4aa}=_0x4034e5,_0x475c5e=_0x28ccc4[0x0],_0x51b5c6=_0x1c4f65['name'],_0x2f21a6=_0x1c4f65[_0x207167(0x268)],_0x571cf2=_0x1c4f65[_0x207167(0x1ce)],_0x54cde3=_0x1c4f65[_0x207167(0x1f2)],_0x31b801=_0x1c4f65[_0x207167(0x24f)];let _0xa26322;const _0x1b448c=findAgentConfigPath(process[_0x207167(0x1e1)]());if(_0x475c5e){const _0x25a2b0=a4_0xde5246[_0x207167(0x1f9)](_0x475c5e,_0x207167(0x23f));existsSync(_0x25a2b0)?(_0xa26322=_0x475c5e,console[_0x207167(0x24d)](a4_0x3df42b[_0x207167(0x284)](_0x207167(0x1d1)+_0x475c5e))):_0xa26322=_0x475c5e;}else{if(_0x1b448c)_0xa26322=a4_0xde5246['dirname'](_0x1b448c),console[_0x207167(0x24d)](a4_0x3df42b[_0x207167(0x284)](_0x207167(0x1f1)+_0xa26322));else{if(_0x31b801){const _0x1b4223=sanitizeForFilesystem(_0x31b801);let _0x72463d=_0x1b4223,_0x12963c=a4_0xde5246[_0x207167(0x1f9)](process[_0x207167(0x1e1)](),_0x207167(0x1e9),_0x1b4223,_0x207167(0x23f));if(!existsSync(_0x12963c)){const _0x4870e9=normalizeName(_0x31b801),_0x3fc79c=a4_0xde5246[_0x207167(0x1f9)](process[_0x207167(0x1e1)](),_0x207167(0x1e9),_0x4870e9,'tdx.json');existsSync(_0x3fc79c)&&(_0x72463d=_0x4870e9,_0x12963c=_0x3fc79c);}if(existsSync(_0x12963c))_0xa26322=a4_0xde5246['dirname'](_0x12963c),console[_0x207167(0x24d)](a4_0x3df42b[_0x207167(0x284)]('Using\x20local\x20project:\x20'+_0xa26322));else{const _0x2511d9=_0x1c4f65[_0x207167(0x274)];if(_0x2511d9)throw new SDKError(ErrorCode[_0x207167(0x1ff)],_0x207167(0x1e6)+_0x31b801+_0x207167(0x1df),undefined,{'helpText':_0x207167(0x21e)+_0x207167(0x277)+(_0x207167(0x233)+_0x31b801+'\x0a')+(_0x207167(0x223)+_0x72463d+'\x20--name\x20'+(_0x51b5c6||_0x207167(0x278))+_0x207167(0x267)+_0x2511d9)});_0xa26322=_0x31b801,console['log'](a4_0x3df42b[_0x207167(0x284)](_0x207167(0x229)+_0x31b801));}}}}if(!_0xa26322)return console[_0x207167(0x24d)](a4_0x3df42b[_0x207167(0x27d)](_0x207167(0x24b))),console[_0x207167(0x24d)](_0x207167(0x273)),console[_0x207167(0x24d)]('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console[_0x207167(0x24d)](_0x207167(0x230)),console[_0x207167(0x24d)](_0x207167(0x1f3)),0x1;if(!_0x51b5c6)throw new SDKError(ErrorCode[_0x207167(0x249)],_0x207167(0x1db),undefined,{'helpText':_0x207167(0x1e7)});if(!_0x571cf2&&!_0x2f21a6){if(!isInteractive())return console[_0x207167(0x1ca)](a4_0x3df42b[_0x207167(0x217)]('\x0aError:'),_0x207167(0x254)),console[_0x207167(0x1ca)](a4_0x3df42b['dim'](_0x207167(0x1fc))),0x1;const _0x711fa5=await confirmKey('Clone\x20\x22'+_0xa26322+_0x207167(0x27c)+_0x51b5c6+'\x22?');if(!_0x711fa5)return console[_0x207167(0x24d)](a4_0x3df42b[_0x207167(0x27d)](_0x207167(0x1e5))),0x1;}const {data:_0x396227}=await withSpinner(_0x207167(0x1f7)+_0xa26322+_0x207167(0x201)+_0x51b5c6+'\x22...',()=>_0xf1f4aa['llm'][_0x207167(0x1d5)](_0xa26322,_0x51b5c6,{'dryRun':_0x2f21a6}));if(_0x2f21a6){console[_0x207167(0x24d)](a4_0x3df42b[_0x207167(0x27d)](_0x207167(0x1cf))),console[_0x207167(0x24d)]('Source:\x20'+_0x396227['sourceProjectName']),console[_0x207167(0x24d)](_0x207167(0x269)+_0x51b5c6),console['log'](_0x207167(0x222)),console['log'](_0x207167(0x1f5)+_0x396227[_0x207167(0x1f6)][_0x207167(0x1e9)][_0x207167(0x232)]),console[_0x207167(0x24d)](_0x207167(0x270)+_0x396227[_0x207167(0x1f6)]['knowledgeBases'][_0x207167(0x232)]),console[_0x207167(0x24d)](_0x207167(0x213)+_0x396227[_0x207167(0x1f6)][_0x207167(0x240)]['created']),console['log'](_0x207167(0x246)+_0x396227[_0x207167(0x1f6)][_0x207167(0x1eb)][_0x207167(0x232)]),console[_0x207167(0x24d)](_0x207167(0x285)+_0x396227[_0x207167(0x1f6)][_0x207167(0x210)][_0x207167(0x232)]);const _0x51b9cb=_0x396227[_0x207167(0x1f6)][_0x207167(0x1e3)][_0x207167(0x232)]>0x0||_0x396227[_0x207167(0x1f6)][_0x207167(0x23e)][_0x207167(0x232)]>0x0;return _0x51b9cb&&(console[_0x207167(0x24d)](_0x207167(0x22e)+_0x396227['counts'][_0x207167(0x1e3)]['created']),console[_0x207167(0x24d)]('\x20\x20Experimental\x20Artifacts:\x20'+_0x396227['counts']['experimentalArtifacts'][_0x207167(0x232)])),0x0;}const _0x490f46=_0x396227[_0x207167(0x1f6)][_0x207167(0x1e9)][_0x207167(0x211)]>0x0||_0x396227[_0x207167(0x1f6)][_0x207167(0x21f)][_0x207167(0x211)]>0x0||_0x396227[_0x207167(0x1f6)][_0x207167(0x240)][_0x207167(0x211)]>0x0||_0x396227[_0x207167(0x1f6)][_0x207167(0x1eb)][_0x207167(0x211)]>0x0||_0x396227['counts'][_0x207167(0x210)][_0x207167(0x211)]>0x0||_0x396227[_0x207167(0x1f6)]['experimentalKnowledgeBases']['errors']>0x0||_0x396227[_0x207167(0x1f6)][_0x207167(0x23e)][_0x207167(0x211)]>0x0;_0x490f46?console['log'](a4_0x3df42b[_0x207167(0x27d)](_0x207167(0x20e))):console[_0x207167(0x24d)](a4_0x3df42b[_0x207167(0x25a)](_0x207167(0x21d)));console[_0x207167(0x24d)](_0x207167(0x20f)+_0x396227[_0x207167(0x253)]),console[_0x207167(0x24d)]('New\x20project:\x20'+_0x396227['newProjectName']),console[_0x207167(0x24d)](_0x207167(0x1d2)+_0x396227[_0x207167(0x1e2)]),console[_0x207167(0x24d)](),console['log'](_0x207167(0x221)),console[_0x207167(0x24d)](_0x207167(0x1f5)+formatCountSummary(_0x396227[_0x207167(0x1f6)]['agents'])),console['log'](_0x207167(0x270)+formatCountSummary(_0x396227[_0x207167(0x1f6)][_0x207167(0x21f)])),console[_0x207167(0x24d)](_0x207167(0x213)+formatCountSummary(_0x396227[_0x207167(0x1f6)]['prompts'])),console[_0x207167(0x24d)](_0x207167(0x279)+formatCountSummary(_0x396227['counts'][_0x207167(0x256)])),console[_0x207167(0x24d)](_0x207167(0x246)+formatCountSummary(_0x396227[_0x207167(0x1f6)][_0x207167(0x1eb)])),console[_0x207167(0x24d)]('\x20\x20Chat\x20Interfaces:\x20'+formatCountSummary(_0x396227[_0x207167(0x1f6)][_0x207167(0x210)]));const _0x31a9e1=_0x396227[_0x207167(0x1f6)][_0x207167(0x1e3)][_0x207167(0x232)]>0x0||_0x396227['counts']['experimentalKnowledgeBases'][_0x207167(0x252)]>0x0||_0x396227['counts'][_0x207167(0x1e3)][_0x207167(0x263)]>0x0||_0x396227[_0x207167(0x1f6)]['experimentalArtifacts'][_0x207167(0x232)]>0x0||_0x396227[_0x207167(0x1f6)][_0x207167(0x23e)][_0x207167(0x252)]>0x0||_0x396227[_0x207167(0x1f6)]['experimentalArtifacts'][_0x207167(0x263)]>0x0;_0x31a9e1&&(console[_0x207167(0x24d)](_0x207167(0x22e)+formatCountSummary(_0x396227[_0x207167(0x1f6)][_0x207167(0x1e3)])),console[_0x207167(0x24d)](_0x207167(0x1fb)+formatCountSummary(_0x396227[_0x207167(0x1f6)]['experimentalArtifacts'])));if(_0x490f46){console[_0x207167(0x24d)](),console[_0x207167(0x24d)](a4_0x3df42b[_0x207167(0x217)](_0x207167(0x250)));for(const _0x146150 of _0x396227['agents']){_0x146150[_0x207167(0x1d6)]==='error'&&console[_0x207167(0x24d)](a4_0x3df42b['red'](_0x207167(0x276)+_0x146150['agentName']+_0x207167(0x206)+_0x146150[_0x207167(0x1ca)]));}for(const _0x3ba1a2 of _0x396227['knowledgeBases']){_0x3ba1a2[_0x207167(0x1d6)]===_0x207167(0x1ca)&&console['log'](a4_0x3df42b['red']('\x20\x20Knowledge\x20Base\x20\x22'+_0x3ba1a2[_0x207167(0x26d)]+'\x22:\x20'+_0x3ba1a2[_0x207167(0x1ca)]));}for(const _0x6ec827 of _0x396227[_0x207167(0x240)]){_0x6ec827[_0x207167(0x1d6)]===_0x207167(0x1ca)&&console[_0x207167(0x24d)](a4_0x3df42b[_0x207167(0x217)](_0x207167(0x20b)+_0x6ec827[_0x207167(0x26d)]+_0x207167(0x206)+_0x6ec827[_0x207167(0x1ca)]));}for(const _0x53f4a6 of _0x396227[_0x207167(0x256)]){_0x53f4a6[_0x207167(0x1d6)]===_0x207167(0x1ca)&&console[_0x207167(0x24d)](a4_0x3df42b[_0x207167(0x217)](_0x207167(0x1cc)+_0x53f4a6['name']+_0x207167(0x206)+_0x53f4a6[_0x207167(0x1ca)]));}for(const _0x56c630 of _0x396227['formInterfaces']){_0x56c630['action']===_0x207167(0x1ca)&&console[_0x207167(0x24d)](a4_0x3df42b[_0x207167(0x217)](_0x207167(0x251)+_0x56c630['name']+_0x207167(0x206)+_0x56c630[_0x207167(0x1ca)]));}for(const _0x3c9292 of _0x396227[_0x207167(0x210)]){_0x3c9292['action']===_0x207167(0x1ca)&&console[_0x207167(0x24d)](a4_0x3df42b[_0x207167(0x217)]('\x20\x20Chat\x20Interface\x20\x22'+_0x3c9292[_0x207167(0x26d)]+_0x207167(0x206)+_0x3c9292[_0x207167(0x1ca)]));}for(const _0x3edf82 of _0x396227[_0x207167(0x1e3)]){_0x3edf82[_0x207167(0x1d6)]===_0x207167(0x1ca)&&console['log'](a4_0x3df42b['red'](_0x207167(0x212)+_0x3edf82['name']+_0x207167(0x206)+_0x3edf82[_0x207167(0x1ca)]));}for(const _0x45c471 of _0x396227[_0x207167(0x23e)]){_0x45c471['action']==='error'&&console['log'](a4_0x3df42b[_0x207167(0x217)](_0x207167(0x225)+_0x45c471[_0x207167(0x26d)]+_0x207167(0x206)+_0x45c471[_0x207167(0x1ca)]));}return 0x1;}console[_0x207167(0x24d)]();const _0x18270d=getLLMProjectUrl(_0x54cde3,_0x396227[_0x207167(0x1e2)]);return console[_0x207167(0x24d)](_0x207167(0x280)+a4_0x3df42b[_0x207167(0x219)](_0x18270d)),0x0;}}function a4_0x53dd(){const _0x46a502=['profile','agentId','\x20\x20Agent\x20\x22','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','<new-name>','\x20\x20Integrations:\x20','405846jsfmtV','\x22...','\x22\x20to\x20new\x20project\x20\x22','yellow','Dry\x20run\x20-\x20no\x20files\x20written','\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','Project:\x20','1563285aDJqZm','llm','✔\x20Context\x20set:\x20','dim','\x20\x20Chat\x20Interfaces:\x20','diff','\x0aChanges\x20to\x20integration\x20\x27','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','no_local_folder','force','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)','textKnowledgeBases','\x20files?','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','error','Status:\x20','\x20\x20Integration\x20\x22','Pulling\x20agent\x20\x22','yes','Dry\x20run\x20-\x20no\x20changes\x20made','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','Using\x20local\x20project:\x20','New\x20project\x20ID:\x20','1QHAKzZ','isNew','cloneProject','action','\x20resources?','2739510ARVQNZ','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project','Using\x20project:\x20','New\x20project\x20name\x20is\x20required','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x20updated','outputDir','\x22\x20to\x20a\x20different\x20profile','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','cwd','newProjectId','experimentalKnowledgeBases','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Cancelled','Cannot\x20clone\x20from\x20context\x20project\x20\x22','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','Writing\x20files...','agents','Output:\x20','formInterfaces','\x20total','context','push','5285035ygpDQG','agent:clone','Using\x20current\x20project:\x20','site','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x20\x20Agents:\x20','counts','Cloning\x20\x22','-\x20nothing\x20pushed','join','\x20created','\x20\x20Experimental\x20Artifacts:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','projectDir','\x22\x20from\x20project\x20\x22','INVALID_ARGUMENT','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\x22\x20to\x20\x22','80ztLEbF','\x0aChanges:','\x0aChanges\x20to\x20agent\x20\x27','repeat','\x22:\x20','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','agent:pull','\x0aErrors\x20found:','parse','\x20\x20Prompt\x20\x22','Analyzing\x20project\x20\x22','hasChanges','Project\x20cloned\x20with\x20errors','Source:\x20','chatInterfaces','errors','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x20\x20Prompts:\x20','Output\x20path:\x20','message','projectName','red','total','cyan','3526128VYzgtg','Using\x20project\x20from\x20','outputPath','Project\x20cloned\x20successfully','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','knowledgeBases','\x0aPull\x20summary\x20for\x20\x27','Summary:','Would\x20clone:','\x20\x20tdx\x20agent\x20clone\x20agents/','agent:push','\x20\x20Experimental\x20Artifact\x20\x22','\x20\x20Knowledge\x20Base\x20\x22','projectId','\x0aPush\x20','Using\x20context\x20project:\x20','execute','\x20new','\x0a✔\x20Pushed\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','pullProject','\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)','\x0aChanges\x20to\x20form\x20interface\x20\x27','created','\x20\x20tdx\x20agent\x20pull\x20','433756VQLDTn','8655GaYbHz','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','reason','pushProject','\x20successfully','\x0aChanges\x20to\x20prompt\x20\x27','gray','Would\x20push\x20agent:\x20','agentName','experimentalArtifacts','tdx.json','prompts','found','Pushing\x20agent\x20from\x20\x22','Would\x20pull\x20agent:\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x20\x20Form\x20Interfaces:\x20','\x20unchanged','no_context','MISSING_ARGUMENT','Using\x20project\x20from\x20context:\x20','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','\x0a✔\x20Pulled\x20','log','\x20\x20Chat\x20Interface\x20\x22','llmProject','Errors:','\x20\x20Form\x20Interface\x20\x22','updated','sourceProjectName','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x27\x20to\x20create\x20the\x20folder\x20structure.','integrations','new','\x20files\x20to\x20','156SumPyT','green','utf-8','\x20|\x20','\x20errors','\x0aProject\x20pushed\x20with\x20errors','Agent\x20','session','\x0aError:','source','unchanged','pushAgent','llm_project','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x20--profile\x20','dryRun','New\x20project:\x20','\x20changed','\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','agent','name','Failed\x20to\x20push\x20agent:\x20','\x0aWrite\x20','\x20\x20Knowledge\x20Bases:\x20','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'];a4_0x53dd=function(){return _0x46a502;};return a4_0x53dd();}export class AgentPushCommand extends BaseCommand{['name']=a4_0x3353d8(0x224);['description']=a4_0x3353d8(0x1f4);async[a4_0x3353d8(0x22a)](_0x1b74cb){const _0x2de262=a4_0x3353d8,{options:_0x4570f9,args:_0x199a13,tdx:_0x39a103}=_0x1b74cb;let _0x2c777c=_0x199a13[0x0]||process[_0x2de262(0x1e1)]();const _0x156485=_0x4570f9[_0x2de262(0x268)],_0x56cdcb=_0x4570f9[_0x2de262(0x1c5)],_0x38cc47=_0x4570f9[_0x2de262(0x1ce)],_0x54a2df=_0x4570f9[_0x2de262(0x1f2)],_0x81bce3=a4_0xde5246['join'](_0x2c777c,'agent.yml'),_0x1da055=existsSync(_0x81bce3);if(_0x1da055){const {data:_0x50458f}=await withSpinner(_0x2de262(0x242)+_0x2c777c+_0x2de262(0x27b),()=>_0x39a103[_0x2de262(0x282)][_0x2de262(0x264)](_0x2c777c,{'dryRun':_0x156485,'force':_0x56cdcb}));if(_0x156485)return console[_0x2de262(0x24d)](a4_0x3df42b['yellow'](_0x2de262(0x1cf))),console['log'](_0x2de262(0x23c)+_0x50458f['agentName']),0x0;if(_0x50458f['action']==='error')return console[_0x2de262(0x24d)](a4_0x3df42b['red'](_0x2de262(0x26e)+_0x50458f[_0x2de262(0x1ca)])),0x1;console['log'](a4_0x3df42b['green'](_0x2de262(0x25f)+_0x50458f[_0x2de262(0x1d6)]+_0x2de262(0x239))),console['log']('Agent:\x20'+_0x50458f[_0x2de262(0x23d)]);if(_0x50458f[_0x2de262(0x275)]&&_0x50458f[_0x2de262(0x227)]){const _0x4d7980=getLLMAgentChatUrl(_0x54a2df,_0x50458f[_0x2de262(0x227)],_0x50458f[_0x2de262(0x275)]);console[_0x2de262(0x24d)]('Chat:\x20'+a4_0x3df42b[_0x2de262(0x219)](_0x4d7980));}return 0x0;}const _0x4d7d1b=_0x4570f9['llmProject'],_0x5dc68f=resolveProjectFromContext(_0x2c777c,_0x4d7d1b);if(_0x5dc68f[_0x2de262(0x241)])_0x2c777c=_0x5dc68f[_0x2de262(0x1fd)],_0x5dc68f[_0x2de262(0x262)]===_0x2de262(0x1ed)&&console[_0x2de262(0x24d)](a4_0x3df42b['dim'](_0x2de262(0x1da)+_0x2c777c));else{let _0x58ab59=_0x2de262(0x207);_0x5dc68f[_0x2de262(0x237)]===_0x2de262(0x1c4)&&(_0x58ab59=_0x5dc68f[_0x2de262(0x215)]+_0x2de262(0x1c9)+_0x5dc68f[_0x2de262(0x24f)]+_0x2de262(0x255));throw new SDKError(ErrorCode[_0x2de262(0x1ff)],_0x5dc68f[_0x2de262(0x237)]===_0x2de262(0x248)?_0x5dc68f['message']:'No\x20tdx.json\x20found\x20in\x20'+_0x2c777c,undefined,{'helpText':_0x58ab59});}const {data:_0x148213}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x39a103[_0x2de262(0x282)]['pushProject'](_0x2c777c,{'dryRun':!![]})),_0xf469fe=_0x148213[_0x2de262(0x1f6)][_0x2de262(0x1e9)]['errors']>0x0;if(_0xf469fe){console[_0x2de262(0x24d)](a4_0x3df42b['red'](_0x2de262(0x209)));for(const _0x188fda of _0x148213[_0x2de262(0x1e9)]){_0x188fda[_0x2de262(0x1d6)]===_0x2de262(0x1ca)&&console[_0x2de262(0x24d)](a4_0x3df42b['red'](_0x2de262(0x276)+_0x188fda['agentName']+_0x2de262(0x206)+_0x188fda[_0x2de262(0x1ca)]));}return 0x1;}const _0x1bc11e=_0x148213[_0x2de262(0x1f6)]['agents']['created']+_0x148213[_0x2de262(0x1f6)][_0x2de262(0x21f)]['created']+_0x148213[_0x2de262(0x1f6)][_0x2de262(0x1c7)][_0x2de262(0x232)]+_0x148213[_0x2de262(0x1f6)][_0x2de262(0x240)][_0x2de262(0x232)]+_0x148213[_0x2de262(0x1f6)][_0x2de262(0x256)]['created']+_0x148213[_0x2de262(0x1f6)][_0x2de262(0x1e3)][_0x2de262(0x232)]+_0x148213['counts'][_0x2de262(0x23e)][_0x2de262(0x232)]+_0x148213[_0x2de262(0x1f6)][_0x2de262(0x1eb)][_0x2de262(0x232)]+_0x148213[_0x2de262(0x1f6)]['chatInterfaces'][_0x2de262(0x232)],_0x134963=_0x148213[_0x2de262(0x1f6)][_0x2de262(0x1e9)][_0x2de262(0x252)]+_0x148213[_0x2de262(0x1f6)]['knowledgeBases'][_0x2de262(0x252)]+_0x148213[_0x2de262(0x1f6)]['textKnowledgeBases'][_0x2de262(0x252)]+_0x148213['counts'][_0x2de262(0x240)][_0x2de262(0x252)]+_0x148213['counts'][_0x2de262(0x256)]['updated']+_0x148213[_0x2de262(0x1f6)][_0x2de262(0x1e3)][_0x2de262(0x252)]+_0x148213['counts'][_0x2de262(0x23e)][_0x2de262(0x252)]+_0x148213[_0x2de262(0x1f6)][_0x2de262(0x1eb)]['updated']+_0x148213['counts'][_0x2de262(0x210)][_0x2de262(0x252)],_0x28db6d=_0x148213[_0x2de262(0x1f6)]['agents']['unchanged']+_0x148213[_0x2de262(0x1f6)][_0x2de262(0x21f)]['unchanged']+_0x148213[_0x2de262(0x1f6)][_0x2de262(0x1c7)]['unchanged']+_0x148213['counts'][_0x2de262(0x240)][_0x2de262(0x263)]+_0x148213[_0x2de262(0x1f6)][_0x2de262(0x256)][_0x2de262(0x263)]+_0x148213[_0x2de262(0x1f6)]['experimentalKnowledgeBases'][_0x2de262(0x263)]+_0x148213['counts'][_0x2de262(0x23e)]['unchanged']+_0x148213[_0x2de262(0x1f6)][_0x2de262(0x1eb)]['unchanged']+_0x148213[_0x2de262(0x1f6)][_0x2de262(0x210)][_0x2de262(0x263)];console[_0x2de262(0x24d)]('\x0aPush\x20summary\x20for\x20\x27'+_0x148213[_0x2de262(0x216)]+'\x27:'),console[_0x2de262(0x24d)]('\x20\x20'+a4_0x3df42b[_0x2de262(0x25a)]('+\x20'+_0x1bc11e+_0x2de262(0x22b))+'\x20|\x20'+a4_0x3df42b[_0x2de262(0x27d)]('~\x20'+_0x134963+_0x2de262(0x26a))+_0x2de262(0x25c)+a4_0x3df42b[_0x2de262(0x284)]('=\x20'+_0x28db6d+_0x2de262(0x247))),console[_0x2de262(0x24d)](_0x2de262(0x1f5)+formatCountSummary(_0x148213[_0x2de262(0x1f6)]['agents'])),console['log'](_0x2de262(0x270)+formatCountSummary(_0x148213[_0x2de262(0x1f6)]['knowledgeBases'])),console[_0x2de262(0x24d)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x148213[_0x2de262(0x1f6)][_0x2de262(0x1c7)])),console['log'](_0x2de262(0x213)+formatCountSummary(_0x148213[_0x2de262(0x1f6)]['prompts'])),console[_0x2de262(0x24d)](_0x2de262(0x279)+formatCountSummary(_0x148213['counts'][_0x2de262(0x256)])),console[_0x2de262(0x24d)](_0x2de262(0x246)+formatCountSummary(_0x148213[_0x2de262(0x1f6)][_0x2de262(0x1eb)])),console[_0x2de262(0x24d)](_0x2de262(0x285)+formatCountSummary(_0x148213['counts'][_0x2de262(0x210)]));const _0x5a84a9=_0x148213[_0x2de262(0x1f6)]['experimentalKnowledgeBases'][_0x2de262(0x232)]>0x0||_0x148213[_0x2de262(0x1f6)][_0x2de262(0x1e3)]['updated']>0x0||_0x148213[_0x2de262(0x1f6)]['experimentalKnowledgeBases'][_0x2de262(0x263)]>0x0||_0x148213[_0x2de262(0x1f6)]['experimentalArtifacts'][_0x2de262(0x232)]>0x0||_0x148213['counts']['experimentalArtifacts'][_0x2de262(0x252)]>0x0||_0x148213[_0x2de262(0x1f6)][_0x2de262(0x23e)][_0x2de262(0x263)]>0x0;_0x5a84a9&&(console[_0x2de262(0x24d)](_0x2de262(0x22e)+formatCountSummary(_0x148213[_0x2de262(0x1f6)][_0x2de262(0x1e3)])),console['log'](_0x2de262(0x1fb)+formatCountSummary(_0x148213[_0x2de262(0x1f6)][_0x2de262(0x23e)])));console[_0x2de262(0x24d)]('\x20\x20Source:\x20'+a4_0x3df42b['cyan'](_0x2c777c)),displayDiffs(_0x148213['agents'],_0x148213['knowledgeBases'],_0x148213[_0x2de262(0x1c7)],_0x148213[_0x2de262(0x240)],_0x148213[_0x2de262(0x256)],_0x148213[_0x2de262(0x1e3)],_0x148213['experimentalArtifacts'],_0x148213[_0x2de262(0x1eb)],_0x148213[_0x2de262(0x210)]);if(_0x156485)return console[_0x2de262(0x24d)](a4_0x3df42b[_0x2de262(0x27d)](_0x2de262(0x244))),0x0;if(_0x1bc11e===0x0&&_0x134963===0x0){console[_0x2de262(0x24d)](a4_0x3df42b[_0x2de262(0x25a)](_0x2de262(0x1d0)));const _0x1644bf=getLLMProjectUrl(_0x54a2df,_0x148213[_0x2de262(0x227)]);return console[_0x2de262(0x24d)](_0x2de262(0x280)+a4_0x3df42b['cyan'](_0x1644bf)),0x0;}if(!_0x38cc47&&!_0x56cdcb){if(!isInteractive())return console[_0x2de262(0x1ca)](a4_0x3df42b[_0x2de262(0x217)](_0x2de262(0x261)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x2de262(0x1ca)](a4_0x3df42b[_0x2de262(0x284)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x5ef6e1=await confirmKey(_0x2de262(0x228)+(_0x1bc11e+_0x134963)+_0x2de262(0x1d7));if(!_0x5ef6e1)return console[_0x2de262(0x24d)](a4_0x3df42b[_0x2de262(0x27d)](_0x2de262(0x1e5)),_0x2de262(0x1f8)),0x1;}const {data:_0x5f3f68}=await withSpinner('Pushing\x20to\x20project...',()=>_0x39a103[_0x2de262(0x282)][_0x2de262(0x238)](_0x2c777c,{'force':_0x56cdcb})),_0x13c2bd=_0x5f3f68[_0x2de262(0x1f6)]['agents'][_0x2de262(0x211)]>0x0||_0x5f3f68[_0x2de262(0x1f6)][_0x2de262(0x21f)][_0x2de262(0x211)]>0x0||_0x5f3f68[_0x2de262(0x1f6)][_0x2de262(0x1c7)][_0x2de262(0x211)]>0x0||_0x5f3f68[_0x2de262(0x1f6)][_0x2de262(0x240)]['errors']>0x0||_0x5f3f68[_0x2de262(0x1f6)][_0x2de262(0x1eb)][_0x2de262(0x211)]>0x0||_0x5f3f68[_0x2de262(0x1f6)]['chatInterfaces'][_0x2de262(0x211)]>0x0;if(_0x13c2bd){console[_0x2de262(0x24d)](a4_0x3df42b[_0x2de262(0x27d)](_0x2de262(0x25e))),console[_0x2de262(0x24d)](),console[_0x2de262(0x24d)](a4_0x3df42b['red'](_0x2de262(0x250)));for(const _0x48e254 of _0x5f3f68['agents']){_0x48e254['action']===_0x2de262(0x1ca)&&console[_0x2de262(0x24d)](a4_0x3df42b[_0x2de262(0x217)](_0x2de262(0x276)+_0x48e254[_0x2de262(0x23d)]+'\x22:\x20'+_0x48e254[_0x2de262(0x1ca)]));}for(const _0x380e67 of _0x5f3f68['knowledgeBases']){_0x380e67['action']==='error'&&console['log'](a4_0x3df42b['red'](_0x2de262(0x226)+_0x380e67[_0x2de262(0x26d)]+_0x2de262(0x206)+_0x380e67['error']));}for(const _0x6085d9 of _0x5f3f68['textKnowledgeBases']){_0x6085d9[_0x2de262(0x1d6)]==='error'&&console[_0x2de262(0x24d)](a4_0x3df42b['red'](_0x2de262(0x266)+_0x6085d9[_0x2de262(0x26d)]+_0x2de262(0x206)+_0x6085d9[_0x2de262(0x1ca)]));}for(const _0x2a57cd of _0x5f3f68[_0x2de262(0x240)]){_0x2a57cd[_0x2de262(0x1d6)]===_0x2de262(0x1ca)&&console['log'](a4_0x3df42b[_0x2de262(0x217)](_0x2de262(0x20b)+_0x2a57cd[_0x2de262(0x26d)]+_0x2de262(0x206)+_0x2a57cd[_0x2de262(0x1ca)]));}for(const _0x2b5ece of _0x5f3f68[_0x2de262(0x256)]){_0x2b5ece[_0x2de262(0x1d6)]===_0x2de262(0x1ca)&&console[_0x2de262(0x24d)](a4_0x3df42b[_0x2de262(0x217)](_0x2de262(0x1cc)+_0x2b5ece[_0x2de262(0x26d)]+_0x2de262(0x206)+_0x2b5ece[_0x2de262(0x1ca)]));}for(const _0x29f59d of _0x5f3f68[_0x2de262(0x1eb)]){_0x29f59d[_0x2de262(0x1d6)]===_0x2de262(0x1ca)&&console[_0x2de262(0x24d)](a4_0x3df42b[_0x2de262(0x217)](_0x2de262(0x251)+_0x29f59d[_0x2de262(0x26d)]+_0x2de262(0x206)+_0x29f59d[_0x2de262(0x1ca)]));}for(const _0x5d58e3 of _0x5f3f68[_0x2de262(0x210)]){_0x5d58e3[_0x2de262(0x1d6)]===_0x2de262(0x1ca)&&console['log'](a4_0x3df42b[_0x2de262(0x217)](_0x2de262(0x24e)+_0x5d58e3[_0x2de262(0x26d)]+_0x2de262(0x206)+_0x5d58e3[_0x2de262(0x1ca)]));}return 0x1;}console[_0x2de262(0x24d)](a4_0x3df42b['green'](_0x2de262(0x22c)+(_0x1bc11e+_0x134963)+'\x20resources\x20to\x20\x27'+_0x5f3f68[_0x2de262(0x216)]+'\x27'));const _0x47ca51=getLLMProjectUrl(_0x54a2df,_0x5f3f68[_0x2de262(0x227)]);return console['log'](_0x2de262(0x280)+a4_0x3df42b['cyan'](_0x47ca51)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x43bd11=a5_0x9267;(function(_0x29399a,_0x256475){const _0x17e671=a5_0x9267,_0x1a0132=_0x29399a();while(!![]){try{const _0x53a038=parseInt(_0x17e671(0x1fc))/0x1+-parseInt(_0x17e671(0x1f1))/0x2+parseInt(_0x17e671(0x1e8))/0x3*(-parseInt(_0x17e671(0x1cf))/0x4)+parseInt(_0x17e671(0x21a))/0x5+parseInt(_0x17e671(0x231))/0x6*(-parseInt(_0x17e671(0x245))/0x7)+-parseInt(_0x17e671(0x246))/0x8+parseInt(_0x17e671(0x1c7))/0x9;if(_0x53a038===_0x256475)break;else _0x1a0132['push'](_0x1a0132['shift']());}catch(_0x500b06){_0x1a0132['push'](_0x1a0132['shift']());}}}(a5_0x3fa4,0xe62d2));import*as a5_0x5c53a9 from'node:fs';import*as a5_0x353be6 from'node:path';import a5_0x4e9eb1 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';function a5_0x3fa4(){const _0x5d8f5d=['✓\x20PASS:\x20','projectDir','isSpinning','has','push','Either\x20switch\x20to\x20the\x20\x22','conversation_url','description','dim','name','testYmlPath','No\x20tests\x20found\x20with\x20tags:\x20','⚠\x20SKIPPED:\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','Duration:\x20','reeval','utf-8','5671122sdegAY','...','toISOString','\x20-\x20',':\x20Sending\x20user\x20input...','Passed:\x20\x20\x20','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','Re-evaluating...','Total:\x20\x20\x20\x20','\x20\x20Round\x20','round','\x20\x20Conversation:\x20','Running\x20test:\x20','start','PASS','\x20\x20Evaluating...\x20','stop','\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','ERROR','7DZXqhk','1471896luHiUK','test.yml','agentDirs','New\x20tests\x20to\x20execute:\x20','\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','agent:test','yellow','tags','trim','Conversation\x20URL:\x20','No\x20tests\x20found\x20matching:\x20','Failed:\x20\x20\x20','timestamp','Usage:','add','join','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','includes','dryRun','repeat','llmProject','executeReeval','cyan','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','30584700CNgLiC','Running:\x20','Agent:\x20','Available\x20tests:\x20','testName','...\x20','Errors:\x20\x20\x20','agentName','92PZjlnM','execute','length','projectName','/<agent-name>','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','green','FAIL','Using\x20agent:\x20','split','resolveProjectId','404','\x20(new)','Available\x20tags:\x20','Re-evaluating\x20','site','Failed\x20Tests:','\x22:\x20','no_context','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','llm','rounds','table','\x20(cached)','227343MFzNfo','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Re-evaluation\x20Summary','forEach','Round\x20','now','reason','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','multiple_agents','3319676HuAKyL','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','basename','Cached\x20run\x20from:\x20','no_local_folder','source','filter','conversations','Test\x20Summary','existsSync','map','1075153LvNoRw','Evaluating\x20response...','substring','status','agent','\x27\x20to\x20create\x20the\x20folder\x20structure.','eval','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','json','log','resolveAgentId','some','tsv','red','text','\x20\x20Agent:\x20','jsonl','toLowerCase','Output\x20written\x20to:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','verbose','tests','✗\x20ERROR:\x20','not\x20found','Tests\x20found:\x20','\x20\x20Project:\x20','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','writeFileSync','✗\x20FAIL:\x20','white','5006620PxEbEG','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','resolve','message','Run\x20tests\x20for\x20an\x20LLM\x20agent','size'];a5_0x3fa4=function(){return _0x5d8f5d;};return a5_0x3fa4();}import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';function a5_0x9267(_0x349239,_0x55f4ee){_0x349239=_0x349239-0x1c4;const _0x3fa4ee=a5_0x3fa4();let _0x9267b8=_0x3fa4ee[_0x349239];return _0x9267b8;}export class AgentTestCommand extends BaseCommand{['name']=a5_0x43bd11(0x24c);[a5_0x43bd11(0x227)]=a5_0x43bd11(0x21e);async[a5_0x43bd11(0x1d0)](_0x31221a){const _0x59130d=a5_0x43bd11,{options:_0x34aa9c,args:_0x2754ef,tdx:_0x594a8a}=_0x31221a,_0x364816=_0x2754ef[0x0]||'.',_0x2139fb=_0x34aa9c[_0x59130d(0x259)],_0x10dd4d=_0x34aa9c,_0x22e1b8=_0x10dd4d[_0x59130d(0x202)]===![],_0x51060b=_0x10dd4d[_0x59130d(0x22f)],_0x15f0fe=_0x10dd4d['name'],_0x1d98b9=_0x10dd4d[_0x59130d(0x24e)],_0x1a9637=_0x34aa9c[_0x59130d(0x1de)],_0x43d658=_0x10dd4d['output'];if(_0x51060b&&_0x22e1b8)return console[_0x59130d(0x205)](a5_0x4e9eb1['red'](_0x59130d(0x1ef))),0x1;let _0x3a9eff=_0x59130d(0x1e6);if(_0x10dd4d[_0x59130d(0x204)])_0x3a9eff='json';else{if(_0x10dd4d[_0x59130d(0x20c)])_0x3a9eff=_0x59130d(0x20c);else{if(_0x10dd4d['tsv'])_0x3a9eff=_0x59130d(0x208);else{if(_0x10dd4d['table'])_0x3a9eff=_0x59130d(0x1e6);}}}const _0x3b0ac1=_0x10dd4d['llmProject'];let _0x2d199d=_0x364816;const _0x571e03=a5_0x5c53a9[_0x59130d(0x1fa)](_0x364816),_0xc8a6b1=_0x364816==='.';if(!_0x571e03||_0xc8a6b1){const _0x2a181e=resolveProjectFromContext(_0x364816,_0x3b0ac1,{'requireFile':_0x59130d(0x247)});if(_0x2a181e['found'])_0x2d199d=_0x2a181e[_0x59130d(0x221)],_0x2a181e[_0x59130d(0x1f6)]==='context'&&console[_0x59130d(0x205)](a5_0x4e9eb1[_0x59130d(0x228)](_0x59130d(0x1d7)+_0x2d199d));else switch(_0x2a181e['reason']){case _0x59130d(0x1e1):console[_0x59130d(0x205)](a5_0x4e9eb1['yellow'](_0x2a181e['message'])),console[_0x59130d(0x205)](),console[_0x59130d(0x205)](_0x59130d(0x254)),console[_0x59130d(0x205)](_0x59130d(0x243)),console[_0x59130d(0x205)](_0x59130d(0x24a)),console[_0x59130d(0x205)](),console[_0x59130d(0x205)](_0x59130d(0x1c6));return 0x1;case _0x59130d(0x1f5):console['log'](a5_0x4e9eb1[_0x59130d(0x24d)](_0x2a181e[_0x59130d(0x21d)])),console[_0x59130d(0x205)](),console[_0x59130d(0x205)]('Run\x20\x27tdx\x20agent\x20pull\x20'+_0x2a181e['llmProject']+_0x59130d(0x201));return 0x1;case _0x59130d(0x1f0):{const _0x3db723=a5_0x353be6[_0x59130d(0x1f3)](_0x2a181e[_0x59130d(0x221)]);console[_0x59130d(0x205)](a5_0x4e9eb1[_0x59130d(0x24d)](_0x59130d(0x1d4)+_0x2a181e[_0x59130d(0x25b)]+'\x22:'));for(const _0x43cc09 of _0x2a181e[_0x59130d(0x248)]){console[_0x59130d(0x205)]('\x20\x20-\x20'+_0x43cc09);}return console[_0x59130d(0x205)](),console[_0x59130d(0x205)](_0x59130d(0x24b)+_0x3db723+_0x59130d(0x1d3)),0x1;}case'no_tests':console[_0x59130d(0x205)](a5_0x4e9eb1['yellow'](_0x59130d(0x21b)+_0x2a181e[_0x59130d(0x25b)]+'\x22.')),console[_0x59130d(0x205)](a5_0x4e9eb1[_0x59130d(0x228)]('Project\x20path:\x20'+_0x2a181e[_0x59130d(0x221)])),console[_0x59130d(0x205)](),console[_0x59130d(0x205)](_0x59130d(0x237));return 0x1;}}const {definition:_0x25d65e,agentInfo:_0x1261ef}=parseTestFile(_0x2d199d);let _0x2dcda5=_0x25d65e['tests'];if(_0x15f0fe){const _0x34d595=_0x15f0fe[_0x59130d(0x1d8)](',')['map'](_0x380c00=>_0x380c00[_0x59130d(0x24f)]());_0x2dcda5=_0x25d65e[_0x59130d(0x211)][_0x59130d(0x1f7)](_0x4a7d4b=>_0x34d595[_0x59130d(0x258)](_0x4a7d4b[_0x59130d(0x229)]));if(_0x2dcda5[_0x59130d(0x1d1)]===0x0)return console[_0x59130d(0x205)](a5_0x4e9eb1[_0x59130d(0x24d)](_0x59130d(0x251)+_0x15f0fe)),console[_0x59130d(0x205)](a5_0x4e9eb1[_0x59130d(0x228)](_0x59130d(0x1ca)+_0x25d65e[_0x59130d(0x211)][_0x59130d(0x1fb)](_0x2878a5=>_0x2878a5[_0x59130d(0x229)])['join'](',\x20'))),0x1;}if(_0x1d98b9){const _0x53283a=_0x1d98b9['split'](',')['map'](_0x1db508=>_0x1db508[_0x59130d(0x24f)]()[_0x59130d(0x20d)]());_0x2dcda5=_0x2dcda5[_0x59130d(0x1f7)](_0x3add70=>_0x3add70[_0x59130d(0x24e)]?.[_0x59130d(0x207)](_0x1b421a=>_0x53283a['includes'](_0x1b421a[_0x59130d(0x20d)]())));if(_0x2dcda5[_0x59130d(0x1d1)]===0x0){console[_0x59130d(0x205)](a5_0x4e9eb1['yellow'](_0x59130d(0x22b)+_0x1d98b9));const _0x5a787d=new Set();return _0x25d65e[_0x59130d(0x211)][_0x59130d(0x1eb)](_0x2b039d=>_0x2b039d['tags']?.['forEach'](_0x18bd13=>_0x5a787d[_0x59130d(0x255)](_0x18bd13))),_0x5a787d[_0x59130d(0x21f)]>0x0?console[_0x59130d(0x205)](a5_0x4e9eb1[_0x59130d(0x228)](_0x59130d(0x1dc)+[..._0x5a787d][_0x59130d(0x256)](',\x20'))):console[_0x59130d(0x205)](a5_0x4e9eb1[_0x59130d(0x228)]('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0x51060b)return this[_0x59130d(0x1c4)](_0x31221a,{'definition':{'tests':_0x2dcda5},'agentInfo':_0x1261ef,'outputFormat':_0x3a9eff,'outputFile':_0x43d658,'testNames':_0x15f0fe});if(_0x2139fb){console[_0x59130d(0x205)](a5_0x4e9eb1[_0x59130d(0x1c5)]('Test\x20Configuration:')),console[_0x59130d(0x205)]('\x20\x20Site:\x20'+a5_0x4e9eb1['white'](_0x1a9637)),console['log'](_0x59130d(0x215)+a5_0x4e9eb1[_0x59130d(0x219)](_0x1261ef['projectName'])),console['log'](_0x59130d(0x20b)+a5_0x4e9eb1[_0x59130d(0x219)](_0x1261ef[_0x59130d(0x1ce)])),console['log'](),console[_0x59130d(0x205)](_0x59130d(0x214)+a5_0x4e9eb1[_0x59130d(0x219)](_0x2dcda5[_0x59130d(0x1d1)]));for(let _0x17aa8b=0x0;_0x17aa8b<_0x2dcda5[_0x59130d(0x1d1)];_0x17aa8b++){const _0x14b371=_0x2dcda5[_0x17aa8b],_0x4238a8=_0x14b371[_0x59130d(0x1e5)][_0x59130d(0x1d1)]===0x1?_0x59130d(0x23c):_0x59130d(0x1e5),_0x5f467e=_0x14b371[_0x59130d(0x24e)]?.['length']?'\x20['+_0x14b371[_0x59130d(0x24e)]['join'](',\x20')+']':'';console[_0x59130d(0x205)]('\x20\x20'+(_0x17aa8b+0x1)+'.\x20'+a5_0x4e9eb1[_0x59130d(0x219)](_0x14b371[_0x59130d(0x229)])+'\x20('+_0x14b371[_0x59130d(0x1e5)][_0x59130d(0x1d1)]+'\x20'+_0x4238a8+')'+a5_0x4e9eb1['dim'](_0x5f467e));}return 0x0;}let _0x4e4a58,_0x2db0bc;try{_0x4e4a58=await _0x594a8a[_0x59130d(0x1e4)][_0x59130d(0x1d9)](_0x1261ef[_0x59130d(0x1d2)]);}catch(_0x3f6a80){const _0x1336c9=_0x3f6a80 instanceof Error?_0x3f6a80['message']:String(_0x3f6a80);return _0x1336c9['includes'](_0x59130d(0x1da))||_0x1336c9[_0x59130d(0x20d)]()[_0x59130d(0x258)]('not\x20found')?console[_0x59130d(0x205)](a5_0x4e9eb1[_0x59130d(0x209)]('✗\x20ERROR:\x20Project\x20not\x20found:\x20'+_0x1261ef[_0x59130d(0x1d2)])):console['log'](a5_0x4e9eb1['red'](_0x59130d(0x1e2)+_0x1261ef[_0x59130d(0x1d2)]+_0x59130d(0x1e0)+_0x1336c9)),0x1;}try{_0x2db0bc=await _0x594a8a[_0x59130d(0x1e4)][_0x59130d(0x206)](_0x1261ef[_0x59130d(0x1ce)],_0x4e4a58);}catch(_0x4fdabd){const _0x3ca637=_0x4fdabd instanceof Error?_0x4fdabd['message']:String(_0x4fdabd);return _0x3ca637[_0x59130d(0x258)](_0x59130d(0x1da))||_0x3ca637[_0x59130d(0x20d)]()[_0x59130d(0x258)](_0x59130d(0x213))?console[_0x59130d(0x205)](a5_0x4e9eb1[_0x59130d(0x209)](_0x59130d(0x1e3)+_0x1261ef[_0x59130d(0x1ce)])):console[_0x59130d(0x205)](a5_0x4e9eb1[_0x59130d(0x209)](_0x59130d(0x20f)+_0x1261ef['agentName']+_0x59130d(0x1e0)+_0x3ca637)),0x1;}let _0x18ef78;if(!_0x22e1b8)try{_0x18ef78=await setupEvaluatorAgent(_0x594a8a[_0x59130d(0x1e4)],_0x34aa9c[_0x59130d(0x210)]);}catch(_0xd40ec1){const _0x539a38=_0xd40ec1 instanceof Error?_0xd40ec1[_0x59130d(0x21d)]:String(_0xd40ec1);return console[_0x59130d(0x205)](a5_0x4e9eb1[_0x59130d(0x209)](_0x59130d(0x257)+_0x539a38)),0x1;}console[_0x59130d(0x205)](a5_0x4e9eb1[_0x59130d(0x1c5)]('Running\x20agent\x20tests...')),console[_0x59130d(0x205)]('Site:\x20'+a5_0x4e9eb1[_0x59130d(0x219)](_0x1a9637)),console[_0x59130d(0x205)](_0x59130d(0x1c9)+a5_0x4e9eb1['white'](_0x1261ef[_0x59130d(0x1d2)]+'/'+_0x1261ef[_0x59130d(0x1ce)])),console['log']();const _0x575af4=[],_0x1d1e28=[],_0x5103d0=Date['now']();for(let _0xa3e45b=0x0;_0xa3e45b<_0x2dcda5[_0x59130d(0x1d1)];_0xa3e45b++){const _0x4af36e=_0x2dcda5[_0xa3e45b];_0x2dcda5['length']>0x1?console['log']('Test\x20'+(_0xa3e45b+0x1)+'/'+_0x2dcda5[_0x59130d(0x1d1)]+':\x20'+a5_0x4e9eb1[_0x59130d(0x219)](_0x4af36e[_0x59130d(0x229)])):console[_0x59130d(0x205)](_0x59130d(0x23e)+a5_0x4e9eb1[_0x59130d(0x219)](_0x4af36e[_0x59130d(0x229)]));const _0x8bdc55=createCommandSpinner('Round\x201/'+_0x4af36e[_0x59130d(0x1e5)]['length']+_0x59130d(0x235));_0x8bdc55[_0x59130d(0x23f)]();try{const {result:_0x2888f2,conversation:_0x10cf06}=await runTest(_0x594a8a['llm'],_0x4af36e,{'agentId':_0x2db0bc,'projectId':_0x4e4a58,'site':_0x1a9637,'noEval':_0x22e1b8,'evaluatorId':_0x18ef78,'onRoundStart':(_0xae098b,_0x444928)=>{const _0x13f987=_0x59130d;_0x8bdc55[_0x13f987(0x20a)]=_0x13f987(0x1ec)+(_0xae098b+0x1)+'/'+_0x444928+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x3f230d,_0x84c82b,_0x593d8e)=>{const _0x3ffc37=_0x59130d,_0x53bca7=formatElapsed(_0x84c82b);_0x593d8e?console[_0x3ffc37(0x205)](_0x3ffc37(0x23b)+(_0x3f230d+0x1)+'/'+_0x4af36e[_0x3ffc37(0x1e5)][_0x3ffc37(0x1d1)]+'...\x20'+a5_0x4e9eb1[_0x3ffc37(0x1d5)]('✓')+'\x20('+_0x53bca7+')'):console[_0x3ffc37(0x205)](_0x3ffc37(0x23b)+(_0x3f230d+0x1)+'/'+_0x4af36e[_0x3ffc37(0x1e5)][_0x3ffc37(0x1d1)]+_0x3ffc37(0x1cc)+a5_0x4e9eb1['red']('✗'));},'onEvaluationStart':()=>{const _0x421220=_0x59130d;_0x8bdc55[_0x421220(0x20a)]=_0x421220(0x1fd);},'onEvaluationComplete':_0x3c1a5d=>{const _0x320002=_0x59130d,_0x2d0f16=formatElapsed(_0x3c1a5d);console[_0x320002(0x205)](_0x320002(0x241)+a5_0x4e9eb1[_0x320002(0x1d5)]('✓')+'\x20('+_0x2d0f16+')');}});_0x8bdc55[_0x59130d(0x242)](),_0x575af4['push'](_0x2888f2),_0x1d1e28[_0x59130d(0x224)](_0x10cf06);if(_0x2888f2[_0x59130d(0x1ff)]===_0x59130d(0x240))console['log'](a5_0x4e9eb1['green'](_0x59130d(0x220)+_0x2888f2[_0x59130d(0x1ee)]));else _0x2888f2[_0x59130d(0x1ff)]===_0x59130d(0x1d6)?console[_0x59130d(0x205)](a5_0x4e9eb1[_0x59130d(0x209)]('✗\x20FAIL:\x20'+_0x2888f2[_0x59130d(0x1ee)])):console[_0x59130d(0x205)](a5_0x4e9eb1['red'](_0x59130d(0x212)+_0x2888f2['reason']));_0x2888f2[_0x59130d(0x226)]&&console[_0x59130d(0x205)](a5_0x4e9eb1[_0x59130d(0x228)](_0x59130d(0x250)+_0x2888f2['conversation_url'])),console[_0x59130d(0x205)]();}catch(_0x81ba06){_0x8bdc55[_0x59130d(0x242)]();const _0x1eb862=_0x81ba06 instanceof Error?_0x81ba06[_0x59130d(0x21d)]:String(_0x81ba06);console[_0x59130d(0x205)](a5_0x4e9eb1[_0x59130d(0x209)](_0x59130d(0x212)+_0x1eb862)),console[_0x59130d(0x205)](),_0x575af4['push']({'name':_0x4af36e[_0x59130d(0x229)],'status':_0x59130d(0x244),'reason':_0x1eb862,'timestamp':new Date()[_0x59130d(0x233)](),'duration_ms':0x0});}}const _0x28131b=Date[_0x59130d(0x1ed)]()-_0x5103d0,_0x4f1023=_0x575af4[_0x59130d(0x1f7)](_0x1f7f6b=>_0x1f7f6b[_0x59130d(0x1ff)]==='PASS')[_0x59130d(0x1d1)],_0x1bb6f5=_0x575af4[_0x59130d(0x1f7)](_0x57f2fc=>_0x57f2fc[_0x59130d(0x1ff)]===_0x59130d(0x1d6))[_0x59130d(0x1d1)],_0x468af7=_0x575af4[_0x59130d(0x1f7)](_0x566760=>_0x566760['status']==='ERROR')[_0x59130d(0x1d1)];console['log']('━'['repeat'](0x3c)),console[_0x59130d(0x205)](_0x59130d(0x1f9)),console[_0x59130d(0x205)]('━'[_0x59130d(0x25a)](0x3c)),console[_0x59130d(0x205)](_0x59130d(0x23a)+_0x575af4[_0x59130d(0x1d1)]),console[_0x59130d(0x205)]('Passed:\x20\x20\x20'+a5_0x4e9eb1[_0x59130d(0x1d5)](_0x4f1023)),console[_0x59130d(0x205)](_0x59130d(0x252)+a5_0x4e9eb1[_0x59130d(0x209)](_0x1bb6f5));_0x468af7>0x0&&console[_0x59130d(0x205)](_0x59130d(0x1cd)+a5_0x4e9eb1['red'](_0x468af7));console[_0x59130d(0x205)](_0x59130d(0x22e)+formatElapsed(_0x28131b)),console[_0x59130d(0x205)]('━'[_0x59130d(0x25a)](0x3c));const _0x3ad6ab=_0x575af4[_0x59130d(0x1f7)](_0xc99f0c=>_0xc99f0c[_0x59130d(0x1ff)]!=='PASS');if(_0x3ad6ab['length']>0x0){console[_0x59130d(0x205)](),console[_0x59130d(0x205)](_0x59130d(0x1df));for(const _0x15d90f of _0x3ad6ab){const _0x3a14f0=a5_0x4e9eb1[_0x59130d(0x209)]('✗'),_0x2f5314=_0x15d90f['reason'][_0x59130d(0x1d1)]>0x32?_0x15d90f[_0x59130d(0x1ee)][_0x59130d(0x1fe)](0x0,0x32)+_0x59130d(0x232):_0x15d90f['reason'];console['log']('\x20\x20'+_0x3a14f0+'\x20'+_0x15d90f['name']+':\x20'+_0x2f5314);}}const _0x484374={'summary':{'total':_0x575af4['length'],'passed':_0x4f1023,'failed':_0x1bb6f5,'errors':_0x468af7>0x0?_0x468af7:undefined,'duration_ms':_0x28131b},'tests':_0x575af4,'agent':{'project':_0x1261ef[_0x59130d(0x1d2)],'name':_0x1261ef['agentName'],'site':_0x1a9637},'timestamp':new Date(_0x5103d0)['toISOString']()};try{const _0x2ae2e6=buildCachedTestRun(_0x1d1e28,{'site':_0x1a9637,'projectId':_0x4e4a58,'projectName':_0x1261ef[_0x59130d(0x1d2)],'agentId':_0x2db0bc,'agentName':_0x1261ef[_0x59130d(0x1ce)],'testYmlPath':a5_0x353be6[_0x59130d(0x21c)](_0x1261ef[_0x59130d(0x22a)])});saveLastTestRun(_0x2ae2e6);}catch{}if(_0x3a9eff!==_0x59130d(0x1e6)||_0x43d658){const _0x216614=formatResults(_0x484374,_0x3a9eff);if(_0x43d658)try{a5_0x5c53a9[_0x59130d(0x217)](_0x43d658,_0x216614,_0x59130d(0x230)),console[_0x59130d(0x205)](),console[_0x59130d(0x205)](a5_0x4e9eb1[_0x59130d(0x228)]('Output\x20written\x20to:\x20'+_0x43d658));}catch(_0x1bc4ec){return console[_0x59130d(0x205)](),console[_0x59130d(0x205)](a5_0x4e9eb1[_0x59130d(0x209)]('Error\x20writing\x20output\x20file:\x20'+_0x1bc4ec)),0x1;}else console[_0x59130d(0x205)](),console[_0x59130d(0x205)](_0x216614);}return _0x3ad6ab[_0x59130d(0x1d1)]>0x0?0x1:0x0;}async[a5_0x43bd11(0x1c4)](_0x503d2b,_0x60048a){const _0x254f5d=a5_0x43bd11,{options:_0x30346e,tdx:_0x439f97}=_0x503d2b,{definition:_0x4b9769,agentInfo:_0x15831d,outputFormat:_0x10876a,outputFile:_0x6da493}=_0x60048a,_0x481e53=_0x30346e[_0x254f5d(0x1de)],_0x290371=loadLastTestRun();if(!_0x290371)return console[_0x254f5d(0x205)](a5_0x4e9eb1[_0x254f5d(0x209)]('Error:\x20No\x20previous\x20test\x20run\x20found.')),console[_0x254f5d(0x205)](a5_0x4e9eb1['dim'](_0x254f5d(0x22d))),0x1;if(_0x290371[_0x254f5d(0x200)]['agentName']!==_0x15831d[_0x254f5d(0x1ce)])return console[_0x254f5d(0x205)](a5_0x4e9eb1['red']('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x290371[_0x254f5d(0x200)]['agentName']+_0x254f5d(0x216)+_0x15831d['agentName']+'\x22.')),console[_0x254f5d(0x205)](a5_0x4e9eb1[_0x254f5d(0x228)](_0x254f5d(0x203))),0x1;const _0x4813ac=new Set(_0x290371[_0x254f5d(0x1f8)][_0x254f5d(0x1fb)](_0x51b08c=>_0x51b08c[_0x254f5d(0x1cb)])),_0x7ced9a=_0x4b9769[_0x254f5d(0x211)]['filter'](_0x2e5141=>!_0x4813ac[_0x254f5d(0x223)](_0x2e5141[_0x254f5d(0x229)]));if(_0x7ced9a[_0x254f5d(0x1d1)]>0x0&&_0x290371[_0x254f5d(0x1de)]!==_0x481e53)return console[_0x254f5d(0x205)](a5_0x4e9eb1[_0x254f5d(0x209)](_0x254f5d(0x238))),console[_0x254f5d(0x205)](a5_0x4e9eb1[_0x254f5d(0x228)]('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x290371[_0x254f5d(0x1de)]+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x481e53+'\x22.')),console[_0x254f5d(0x205)](a5_0x4e9eb1[_0x254f5d(0x228)](_0x254f5d(0x225)+_0x290371[_0x254f5d(0x1de)]+_0x254f5d(0x1f2))),0x1;const _0xd9440d=_0x4b9769[_0x254f5d(0x211)]['filter'](_0xa8f3c4=>_0x4813ac[_0x254f5d(0x223)](_0xa8f3c4[_0x254f5d(0x229)])),_0x2820f3=_0x7ced9a;let _0x532d71;try{_0x532d71=await setupEvaluatorAgent(_0x439f97[_0x254f5d(0x1e4)],_0x30346e[_0x254f5d(0x210)]);}catch(_0x33cff7){const _0x41e7d6=_0x33cff7 instanceof Error?_0x33cff7['message']:String(_0x33cff7);return console[_0x254f5d(0x205)](a5_0x4e9eb1['red']('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x41e7d6)),0x1;}console[_0x254f5d(0x205)](a5_0x4e9eb1[_0x254f5d(0x1c5)]('Re-evaluating\x20cached\x20test\x20run...')),console[_0x254f5d(0x205)](_0x254f5d(0x1f4)+a5_0x4e9eb1[_0x254f5d(0x219)](_0x290371[_0x254f5d(0x253)])),console['log'](_0x254f5d(0x1c9)+a5_0x4e9eb1[_0x254f5d(0x219)](_0x290371['agent'][_0x254f5d(0x1d2)]+'/'+_0x290371[_0x254f5d(0x200)][_0x254f5d(0x1ce)]));_0x2820f3[_0x254f5d(0x1d1)]>0x0&&console['log'](_0x254f5d(0x249)+a5_0x4e9eb1[_0x254f5d(0x24d)](_0x2820f3[_0x254f5d(0x1d1)]));console['log']();const _0xb4ea5d=[],_0x268c89=Date[_0x254f5d(0x1ed)](),_0x4f915e=createCommandSpinner(_0x254f5d(0x239));if(_0xd9440d[_0x254f5d(0x1d1)]>0x0)try{const _0x3ae89e=await reevaluateFromCache(_0x439f97['llm'],_0x290371,{'tests':_0xd9440d},{'evaluatorId':_0x532d71,'onTestStart':(_0x1d3e26,_0x48366e,_0x4b740f)=>{const _0x6cbcdc=_0x254f5d;_0x4f915e[_0x6cbcdc(0x20a)]=_0x6cbcdc(0x1dd)+(_0x48366e+0x1)+'/'+_0x4b740f+':\x20'+_0x1d3e26+_0x6cbcdc(0x232);if(!_0x4f915e[_0x6cbcdc(0x222)])_0x4f915e[_0x6cbcdc(0x23f)]();},'onTestComplete':(_0x3f8c57,_0x4776b5)=>{const _0x738df5=_0x254f5d;_0x4f915e[_0x738df5(0x242)]();if(_0x4776b5['status']===_0x738df5(0x240))console[_0x738df5(0x205)](a5_0x4e9eb1[_0x738df5(0x1d5)]('✓\x20PASS:\x20'+_0x3f8c57)+a5_0x4e9eb1['dim'](_0x738df5(0x1e7)));else _0x4776b5[_0x738df5(0x1ff)]===_0x738df5(0x1d6)?console[_0x738df5(0x205)](a5_0x4e9eb1['red'](_0x738df5(0x218)+_0x3f8c57+'\x20-\x20'+_0x4776b5[_0x738df5(0x1ee)])+a5_0x4e9eb1[_0x738df5(0x228)]('\x20(cached)')):console['log'](a5_0x4e9eb1['red'](_0x738df5(0x212)+_0x3f8c57+_0x738df5(0x234)+_0x4776b5[_0x738df5(0x1ee)]));_0x4776b5[_0x738df5(0x226)]&&console[_0x738df5(0x205)](a5_0x4e9eb1[_0x738df5(0x228)](_0x738df5(0x23d)+_0x4776b5[_0x738df5(0x226)])),_0xb4ea5d[_0x738df5(0x224)](_0x4776b5);},'onTestSkipped':(_0x39ac72,_0x395eec)=>{const _0x133c49=_0x254f5d;_0x4f915e[_0x133c49(0x242)](),console[_0x133c49(0x205)](a5_0x4e9eb1[_0x133c49(0x24d)](_0x133c49(0x22c)+_0x39ac72+'\x20-\x20'+_0x395eec));}});for(const _0x4de926 of _0x3ae89e){!_0xb4ea5d['find'](_0x206567=>_0x206567[_0x254f5d(0x229)]===_0x4de926[_0x254f5d(0x229)])&&_0xb4ea5d['push'](_0x4de926);}}catch(_0x5a6e73){_0x4f915e['stop']();const _0x1fc06d=_0x5a6e73 instanceof Error?_0x5a6e73['message']:String(_0x5a6e73);return console['log'](a5_0x4e9eb1[_0x254f5d(0x209)](_0x254f5d(0x1e9)+_0x1fc06d)),0x1;}_0x4f915e[_0x254f5d(0x242)]();if(_0x2820f3['length']>0x0){console[_0x254f5d(0x205)](),console[_0x254f5d(0x205)](a5_0x4e9eb1['cyan']('Executing\x20new\x20tests...'));const {projectId:_0x564198,agentId:_0x29a15f}=_0x290371[_0x254f5d(0x200)];for(const _0x4f6da0 of _0x2820f3){console[_0x254f5d(0x205)](_0x254f5d(0x1c8)+a5_0x4e9eb1['white'](_0x4f6da0[_0x254f5d(0x229)]));const _0x4ccea6=createCommandSpinner('Round\x201/'+_0x4f6da0[_0x254f5d(0x1e5)]['length']+_0x254f5d(0x235));_0x4ccea6[_0x254f5d(0x23f)]();try{const {result:_0x75ec4d}=await runTest(_0x439f97['llm'],_0x4f6da0,{'agentId':_0x29a15f,'projectId':_0x564198,'site':_0x290371[_0x254f5d(0x1de)],'noEval':![],'evaluatorId':_0x532d71,'onRoundStart':(_0x423eaa,_0x6d0e)=>{const _0x5a2e39=_0x254f5d;_0x4ccea6[_0x5a2e39(0x20a)]=_0x5a2e39(0x1ec)+(_0x423eaa+0x1)+'/'+_0x6d0e+_0x5a2e39(0x235);},'onRoundComplete':(_0x333e3f,_0x39d0fc,_0x41ed54)=>{const _0x5b9fca=_0x254f5d,_0x21cd2c=formatElapsed(_0x39d0fc);_0x41ed54?console[_0x5b9fca(0x205)]('\x20\x20Round\x20'+(_0x333e3f+0x1)+'/'+_0x4f6da0[_0x5b9fca(0x1e5)][_0x5b9fca(0x1d1)]+_0x5b9fca(0x1cc)+a5_0x4e9eb1[_0x5b9fca(0x1d5)]('✓')+'\x20('+_0x21cd2c+')'):console[_0x5b9fca(0x205)]('\x20\x20Round\x20'+(_0x333e3f+0x1)+'/'+_0x4f6da0[_0x5b9fca(0x1e5)][_0x5b9fca(0x1d1)]+_0x5b9fca(0x1cc)+a5_0x4e9eb1['red']('✗'));},'onEvaluationStart':()=>{const _0x315356=_0x254f5d;_0x4ccea6[_0x315356(0x20a)]='Evaluating\x20response...';},'onEvaluationComplete':_0x748d44=>{const _0x5add04=_0x254f5d,_0x11a206=formatElapsed(_0x748d44);console['log'](_0x5add04(0x241)+a5_0x4e9eb1[_0x5add04(0x1d5)]('✓')+'\x20('+_0x11a206+')');}});_0x4ccea6['stop'](),_0xb4ea5d['push'](_0x75ec4d);if(_0x75ec4d[_0x254f5d(0x1ff)]==='PASS')console[_0x254f5d(0x205)](a5_0x4e9eb1[_0x254f5d(0x1d5)](_0x254f5d(0x220)+_0x75ec4d[_0x254f5d(0x1ee)])+a5_0x4e9eb1[_0x254f5d(0x228)](_0x254f5d(0x1db)));else _0x75ec4d[_0x254f5d(0x1ff)]===_0x254f5d(0x1d6)?console[_0x254f5d(0x205)](a5_0x4e9eb1['red'](_0x254f5d(0x218)+_0x75ec4d[_0x254f5d(0x1ee)])+a5_0x4e9eb1[_0x254f5d(0x228)](_0x254f5d(0x1db))):console[_0x254f5d(0x205)](a5_0x4e9eb1[_0x254f5d(0x209)](_0x254f5d(0x212)+_0x75ec4d['reason']));_0x75ec4d[_0x254f5d(0x226)]&&console[_0x254f5d(0x205)](a5_0x4e9eb1['dim']('\x20\x20Conversation:\x20'+_0x75ec4d[_0x254f5d(0x226)]));}catch(_0x4c1f02){_0x4ccea6[_0x254f5d(0x242)]();const _0x2568dd=_0x4c1f02 instanceof Error?_0x4c1f02[_0x254f5d(0x21d)]:String(_0x4c1f02);console[_0x254f5d(0x205)](a5_0x4e9eb1[_0x254f5d(0x209)](_0x254f5d(0x212)+_0x2568dd)),_0xb4ea5d[_0x254f5d(0x224)]({'name':_0x4f6da0[_0x254f5d(0x229)],'status':'ERROR','reason':_0x2568dd,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console[_0x254f5d(0x205)]();const _0xef51bd=Date['now']()-_0x268c89,_0x2ea92e=_0xb4ea5d[_0x254f5d(0x1f7)](_0x135005=>_0x135005[_0x254f5d(0x1ff)]===_0x254f5d(0x240))[_0x254f5d(0x1d1)],_0x13f184=_0xb4ea5d[_0x254f5d(0x1f7)](_0x5e7d0b=>_0x5e7d0b[_0x254f5d(0x1ff)]==='FAIL')['length'],_0x4b95ae=_0xb4ea5d[_0x254f5d(0x1f7)](_0x2136ae=>_0x2136ae[_0x254f5d(0x1ff)]==='ERROR')[_0x254f5d(0x1d1)];console[_0x254f5d(0x205)]('━'['repeat'](0x3c)),console[_0x254f5d(0x205)](_0x254f5d(0x1ea)),console[_0x254f5d(0x205)]('━'['repeat'](0x3c)),console['log'](_0x254f5d(0x23a)+_0xb4ea5d[_0x254f5d(0x1d1)]),console[_0x254f5d(0x205)](_0x254f5d(0x236)+a5_0x4e9eb1[_0x254f5d(0x1d5)](_0x2ea92e)),console[_0x254f5d(0x205)](_0x254f5d(0x252)+a5_0x4e9eb1[_0x254f5d(0x209)](_0x13f184));_0x4b95ae>0x0&&console[_0x254f5d(0x205)]('Errors:\x20\x20\x20'+a5_0x4e9eb1['red'](_0x4b95ae));console[_0x254f5d(0x205)](_0x254f5d(0x22e)+formatElapsed(_0xef51bd)),console[_0x254f5d(0x205)]('━'['repeat'](0x3c));const _0x4f39a5={'summary':{'total':_0xb4ea5d['length'],'passed':_0x2ea92e,'failed':_0x13f184,'errors':_0x4b95ae>0x0?_0x4b95ae:undefined,'duration_ms':_0xef51bd},'tests':_0xb4ea5d,'agent':{'project':_0x15831d[_0x254f5d(0x1d2)],'name':_0x15831d['agentName'],'site':_0x481e53},'timestamp':new Date(_0x268c89)[_0x254f5d(0x233)]()};if(_0x10876a!==_0x254f5d(0x1e6)||_0x6da493){const _0x4b6b7a=formatResults(_0x4f39a5,_0x10876a);if(_0x6da493)try{a5_0x5c53a9[_0x254f5d(0x217)](_0x6da493,_0x4b6b7a,_0x254f5d(0x230)),console[_0x254f5d(0x205)](),console[_0x254f5d(0x205)](a5_0x4e9eb1[_0x254f5d(0x228)](_0x254f5d(0x20e)+_0x6da493));}catch(_0x448f2c){return console[_0x254f5d(0x205)](),console[_0x254f5d(0x205)](a5_0x4e9eb1['red']('Error\x20writing\x20output\x20file:\x20'+_0x448f2c)),0x1;}else console[_0x254f5d(0x205)](),console[_0x254f5d(0x205)](_0x4b6b7a);}const _0x33dde9=_0xb4ea5d[_0x254f5d(0x1f7)](_0x34e070=>_0x34e070['status']!==_0x254f5d(0x240));return _0x33dde9['length']>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0x47560e=a5_0x1321;function a5_0x1321(_0x36cdc2,_0x2cefb4){_0x36cdc2=_0x36cdc2-0xbf;const _0x12a0a3=a5_0x12a0();let _0x1321be=_0x12a0a3[_0x36cdc2];return _0x1321be;}(function(_0x537125,_0x460bea){const _0x58109b=a5_0x1321,_0x528063=_0x537125();while(!![]){try{const _0x1e393f=parseInt(_0x58109b(0x146))/0x1+parseInt(_0x58109b(0x111))/0x2+parseInt(_0x58109b(0x150))/0x3*(-parseInt(_0x58109b(0xc6))/0x4)+parseInt(_0x58109b(0xdb))/0x5*(parseInt(_0x58109b(0x141))/0x6)+parseInt(_0x58109b(0xcf))/0x7+-parseInt(_0x58109b(0xed))/0x8*(-parseInt(_0x58109b(0xfd))/0x9)+-parseInt(_0x58109b(0x134))/0xa*(parseInt(_0x58109b(0xfa))/0xb);if(_0x1e393f===_0x460bea)break;else _0x528063['push'](_0x528063['shift']());}catch(_0x57abdd){_0x528063['push'](_0x528063['shift']());}}}(a5_0x12a0,0x92417));import*as a5_0x4bc22d from'node:fs';import*as a5_0x4148d0 from'node:path';import a5_0x5754d7 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';function a5_0x12a0(){const _0xba2db9=['dryRun','name','2194808hkOJOe','\x20\x20Conversation:\x20','Using\x20agent:\x20','✗\x20ERROR:\x20','agent:test','now','forEach','projectName','Available\x20tags:\x20','tags','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','size','2112865QXQKCZ','Run\x20tests\x20for\x20an\x20LLM\x20agent','✗\x20FAIL:\x20','Test\x20Summary','repeat','test.yml','Re-evaluating\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','Failed\x20Tests:','resolveAgentId','utf-8','trim','\x22,\x20but\x20current\x20site\x20is\x20\x22','Test\x20','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','context','jsonl','Error\x20writing\x20output\x20file:\x20','8begpAN','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','Output\x20written\x20to:\x20','Either\x20switch\x20to\x20the\x20\x22','reason','no_local_folder','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','cyan','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','agentName','green','table','\x20\x20-\x20','231913brGWcf','llm','map','1472949plwOKm','PASS','\x20(new)','No\x20tests\x20have\x20tags\x20defined.','agent','Passed:\x20\x20\x20','tests','has','No\x20tests\x20found\x20with\x20tags:\x20','Re-evaluation\x20Summary','Error:\x20No\x20previous\x20test\x20run\x20found.','ERROR','404','testYmlPath','\x20\x20Project:\x20','substring',':\x20Sending\x20user\x20input...','description','Agent:\x20','resolve','792166lFYEmc','source','\x27\x20to\x20create\x20the\x20folder\x20structure.','New\x20tests\x20to\x20execute:\x20','json','toISOString','\x20-\x20','white','split','\x22:\x20','text','testName','not\x20found','basename','writeFileSync','conversation_url','stop','FAIL','filter','Project\x20path:\x20','/<agent-name>','Executing\x20new\x20tests...','multiple_agents','some','Running\x20agent\x20tests...','executeReeval','...\x20','add','Total:\x20\x20\x20\x20','includes','status','\x20\x20Evaluating...\x20','timestamp','yellow','eval','210uXqTCR','agentDirs','start','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','✓\x20PASS:\x20','Round\x201/','found','llmProject','Cached\x20run\x20is\x20from\x20site\x20\x22','push','dim','tsv','6hGFOda','\x20\x20Round\x20','...','execute','join','796881fQMfID','Duration:\x20','log','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','No\x20tests\x20found\x20matching:\x20','reeval','Site:\x20','Failed:\x20\x20\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','Round\x20','788202hZtoDI','find','Errors:\x20\x20\x20','message','no_tests','Running:\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','round','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','\x20\x20Site:\x20','Re-evaluating...','Tests\x20found:\x20','Cached\x20run\x20from:\x20','isSpinning','verbose','⚠\x20SKIPPED:\x20','site','Test\x20Configuration:','Running\x20test:\x20','rounds','16brauwd','length','red','toLowerCase','projectDir','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Evaluating\x20response...'];a5_0x12a0=function(){return _0xba2db9;};return a5_0x12a0();}import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{['name']=a5_0x47560e(0xd3);[a5_0x47560e(0x10e)]=a5_0x47560e(0xdc);async[a5_0x47560e(0x144)](_0x1a04d5){const _0x1f1317=a5_0x47560e,{options:_0x383cc7,args:_0x4bbea6,tdx:_0x52df81}=_0x1a04d5,_0x1fa347=_0x4bbea6[0x0]||'.',_0x453878=_0x383cc7[_0x1f1317(0xcd)],_0x5dbf4b=_0x383cc7,_0x159e9f=_0x5dbf4b[_0x1f1317(0x133)]===![],_0x476517=_0x5dbf4b[_0x1f1317(0x14b)],_0x4fb0e0=_0x5dbf4b['name'],_0x218761=_0x5dbf4b['tags'],_0x38922e=_0x383cc7['site'],_0x5b871d=_0x5dbf4b['output'];if(_0x476517&&_0x159e9f)return console[_0x1f1317(0x148)](a5_0x5754d7[_0x1f1317(0xc8)](_0x1f1317(0x158))),0x1;let _0x4e93ff=_0x1f1317(0xf8);if(_0x5dbf4b[_0x1f1317(0x115)])_0x4e93ff='json';else{if(_0x5dbf4b[_0x1f1317(0xeb)])_0x4e93ff='jsonl';else{if(_0x5dbf4b[_0x1f1317(0x140)])_0x4e93ff='tsv';else{if(_0x5dbf4b[_0x1f1317(0xf8)])_0x4e93ff='table';}}}const _0x3f15e2=_0x5dbf4b[_0x1f1317(0x13c)];let _0x2ae647=_0x1fa347;const _0x4f906d=a5_0x4bc22d['existsSync'](_0x1fa347),_0x15e269=_0x1fa347==='.';if(!_0x4f906d||_0x15e269){const _0x4527a2=resolveProjectFromContext(_0x1fa347,_0x3f15e2,{'requireFile':_0x1f1317(0xe0)});if(_0x4527a2[_0x1f1317(0x13b)])_0x2ae647=_0x4527a2[_0x1f1317(0xca)],_0x4527a2[_0x1f1317(0x112)]===_0x1f1317(0xea)&&console['log'](a5_0x5754d7[_0x1f1317(0x13f)](_0x1f1317(0xd1)+_0x2ae647));else switch(_0x4527a2[_0x1f1317(0xf1)]){case'no_context':console[_0x1f1317(0x148)](a5_0x5754d7[_0x1f1317(0x132)](_0x4527a2[_0x1f1317(0x153)])),console[_0x1f1317(0x148)](),console[_0x1f1317(0x148)]('Usage:'),console[_0x1f1317(0x148)]('\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path'),console['log']('\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x1f1317(0x148)](),console[_0x1f1317(0x148)](_0x1f1317(0xcb));return 0x1;case _0x1f1317(0xf2):console[_0x1f1317(0x148)](a5_0x5754d7[_0x1f1317(0x132)](_0x4527a2['message'])),console['log'](),console[_0x1f1317(0x148)]('Run\x20\x27tdx\x20agent\x20pull\x20'+_0x4527a2[_0x1f1317(0x13c)]+_0x1f1317(0x113));return 0x1;case _0x1f1317(0x127):{const _0xcab1d5=a5_0x4148d0[_0x1f1317(0x11e)](_0x4527a2[_0x1f1317(0xca)]);console[_0x1f1317(0x148)](a5_0x5754d7['yellow'](_0x1f1317(0x149)+_0x4527a2[_0x1f1317(0x13c)]+'\x22:'));for(const _0x398780 of _0x4527a2[_0x1f1317(0x135)]){console[_0x1f1317(0x148)](_0x1f1317(0xf9)+_0x398780);}return console['log'](),console[_0x1f1317(0x148)]('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0xcab1d5+_0x1f1317(0x125)),0x1;}case _0x1f1317(0x154):console[_0x1f1317(0x148)](a5_0x5754d7['yellow'](_0x1f1317(0xd9)+_0x4527a2['llmProject']+'\x22.')),console[_0x1f1317(0x148)](a5_0x5754d7[_0x1f1317(0x13f)](_0x1f1317(0x124)+_0x4527a2[_0x1f1317(0xca)])),console[_0x1f1317(0x148)](),console[_0x1f1317(0x148)](_0x1f1317(0xee));return 0x1;}}const {definition:_0x5b0926,agentInfo:_0x386fd6}=parseTestFile(_0x2ae647);let _0x1803d6=_0x5b0926[_0x1f1317(0x103)];if(_0x4fb0e0){const _0x2d9650=_0x4fb0e0[_0x1f1317(0x119)](',')[_0x1f1317(0xfc)](_0x49cbbb=>_0x49cbbb[_0x1f1317(0xe6)]());_0x1803d6=_0x5b0926[_0x1f1317(0x103)][_0x1f1317(0x123)](_0xea9265=>_0x2d9650[_0x1f1317(0x12e)](_0xea9265[_0x1f1317(0xce)]));if(_0x1803d6[_0x1f1317(0xc7)]===0x0)return console[_0x1f1317(0x148)](a5_0x5754d7[_0x1f1317(0x132)](_0x1f1317(0x14a)+_0x4fb0e0)),console[_0x1f1317(0x148)](a5_0x5754d7[_0x1f1317(0x13f)]('Available\x20tests:\x20'+_0x5b0926[_0x1f1317(0x103)][_0x1f1317(0xfc)](_0x44b93e=>_0x44b93e[_0x1f1317(0xce)])[_0x1f1317(0x145)](',\x20'))),0x1;}if(_0x218761){const _0x3b06f6=_0x218761[_0x1f1317(0x119)](',')[_0x1f1317(0xfc)](_0xf86216=>_0xf86216[_0x1f1317(0xe6)]()['toLowerCase']());_0x1803d6=_0x1803d6[_0x1f1317(0x123)](_0x5bb199=>_0x5bb199[_0x1f1317(0xd8)]?.[_0x1f1317(0x128)](_0x1047f0=>_0x3b06f6[_0x1f1317(0x12e)](_0x1047f0['toLowerCase']())));if(_0x1803d6[_0x1f1317(0xc7)]===0x0){console[_0x1f1317(0x148)](a5_0x5754d7[_0x1f1317(0x132)](_0x1f1317(0x105)+_0x218761));const _0x4b24bb=new Set();return _0x5b0926[_0x1f1317(0x103)]['forEach'](_0x4696fa=>_0x4696fa[_0x1f1317(0xd8)]?.[_0x1f1317(0xd5)](_0x1f64bf=>_0x4b24bb[_0x1f1317(0x12c)](_0x1f64bf))),_0x4b24bb[_0x1f1317(0xda)]>0x0?console['log'](a5_0x5754d7[_0x1f1317(0x13f)](_0x1f1317(0xd7)+[..._0x4b24bb][_0x1f1317(0x145)](',\x20'))):console['log'](a5_0x5754d7[_0x1f1317(0x13f)](_0x1f1317(0x100))),0x1;}}if(_0x476517)return this[_0x1f1317(0x12a)](_0x1a04d5,{'definition':{'tests':_0x1803d6},'agentInfo':_0x386fd6,'outputFormat':_0x4e93ff,'outputFile':_0x5b871d,'testNames':_0x4fb0e0});if(_0x453878){console[_0x1f1317(0x148)](a5_0x5754d7[_0x1f1317(0xf4)](_0x1f1317(0xc3))),console[_0x1f1317(0x148)](_0x1f1317(0x159)+a5_0x5754d7['white'](_0x38922e)),console['log'](_0x1f1317(0x10b)+a5_0x5754d7[_0x1f1317(0x118)](_0x386fd6['projectName'])),console[_0x1f1317(0x148)]('\x20\x20Agent:\x20'+a5_0x5754d7[_0x1f1317(0x118)](_0x386fd6[_0x1f1317(0xf6)])),console['log'](),console['log'](_0x1f1317(0x15b)+a5_0x5754d7['white'](_0x1803d6[_0x1f1317(0xc7)]));for(let _0x3b1211=0x0;_0x3b1211<_0x1803d6[_0x1f1317(0xc7)];_0x3b1211++){const _0x1133c9=_0x1803d6[_0x3b1211],_0x64347f=_0x1133c9['rounds']['length']===0x1?_0x1f1317(0x157):'rounds',_0x4d826e=_0x1133c9[_0x1f1317(0xd8)]?.[_0x1f1317(0xc7)]?'\x20['+_0x1133c9['tags']['join'](',\x20')+']':'';console[_0x1f1317(0x148)]('\x20\x20'+(_0x3b1211+0x1)+'.\x20'+a5_0x5754d7[_0x1f1317(0x118)](_0x1133c9[_0x1f1317(0xce)])+'\x20('+_0x1133c9[_0x1f1317(0xc5)]['length']+'\x20'+_0x64347f+')'+a5_0x5754d7[_0x1f1317(0x13f)](_0x4d826e));}return 0x0;}let _0x168eb8,_0x57ae76;try{_0x168eb8=await _0x52df81[_0x1f1317(0xfb)]['resolveProjectId'](_0x386fd6[_0x1f1317(0xd6)]);}catch(_0x338b7d){const _0x55e31d=_0x338b7d instanceof Error?_0x338b7d[_0x1f1317(0x153)]:String(_0x338b7d);return _0x55e31d['includes'](_0x1f1317(0x109))||_0x55e31d['toLowerCase']()[_0x1f1317(0x12e)]('not\x20found')?console[_0x1f1317(0x148)](a5_0x5754d7['red']('✗\x20ERROR:\x20Project\x20not\x20found:\x20'+_0x386fd6[_0x1f1317(0xd6)])):console['log'](a5_0x5754d7[_0x1f1317(0xc8)](_0x1f1317(0x137)+_0x386fd6[_0x1f1317(0xd6)]+_0x1f1317(0x11a)+_0x55e31d)),0x1;}try{_0x57ae76=await _0x52df81[_0x1f1317(0xfb)][_0x1f1317(0xe4)](_0x386fd6[_0x1f1317(0xf6)],_0x168eb8);}catch(_0x2fdcc3){const _0x4a72c4=_0x2fdcc3 instanceof Error?_0x2fdcc3[_0x1f1317(0x153)]:String(_0x2fdcc3);return _0x4a72c4[_0x1f1317(0x12e)]('404')||_0x4a72c4[_0x1f1317(0xc9)]()[_0x1f1317(0x12e)](_0x1f1317(0x11d))?console[_0x1f1317(0x148)](a5_0x5754d7['red'](_0x1f1317(0xf3)+_0x386fd6[_0x1f1317(0xf6)])):console[_0x1f1317(0x148)](a5_0x5754d7['red']('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x386fd6[_0x1f1317(0xf6)]+_0x1f1317(0x11a)+_0x4a72c4)),0x1;}let _0x33a846;if(!_0x159e9f)try{_0x33a846=await setupEvaluatorAgent(_0x52df81['llm'],_0x383cc7[_0x1f1317(0xc0)]);}catch(_0x1c0628){const _0x38a9ed=_0x1c0628 instanceof Error?_0x1c0628[_0x1f1317(0x153)]:String(_0x1c0628);return console[_0x1f1317(0x148)](a5_0x5754d7[_0x1f1317(0xc8)](_0x1f1317(0x14e)+_0x38a9ed)),0x1;}console[_0x1f1317(0x148)](a5_0x5754d7[_0x1f1317(0xf4)](_0x1f1317(0x129))),console[_0x1f1317(0x148)](_0x1f1317(0x14c)+a5_0x5754d7[_0x1f1317(0x118)](_0x38922e)),console[_0x1f1317(0x148)](_0x1f1317(0x10f)+a5_0x5754d7[_0x1f1317(0x118)](_0x386fd6[_0x1f1317(0xd6)]+'/'+_0x386fd6[_0x1f1317(0xf6)])),console['log']();const _0x25a90a=[],_0x2a6251=[],_0x2dd8ca=Date[_0x1f1317(0xd4)]();for(let _0x25d4f0=0x0;_0x25d4f0<_0x1803d6[_0x1f1317(0xc7)];_0x25d4f0++){const _0x497f4e=_0x1803d6[_0x25d4f0];_0x1803d6[_0x1f1317(0xc7)]>0x1?console[_0x1f1317(0x148)](_0x1f1317(0xe8)+(_0x25d4f0+0x1)+'/'+_0x1803d6[_0x1f1317(0xc7)]+':\x20'+a5_0x5754d7['white'](_0x497f4e[_0x1f1317(0xce)])):console['log'](_0x1f1317(0xc4)+a5_0x5754d7[_0x1f1317(0x118)](_0x497f4e[_0x1f1317(0xce)]));const _0xef1f13=createCommandSpinner('Round\x201/'+_0x497f4e[_0x1f1317(0xc5)][_0x1f1317(0xc7)]+':\x20Sending\x20user\x20input...');_0xef1f13['start']();try{const {result:_0x1eb489,conversation:_0x4e4bf4}=await runTest(_0x52df81['llm'],_0x497f4e,{'agentId':_0x57ae76,'projectId':_0x168eb8,'site':_0x38922e,'noEval':_0x159e9f,'evaluatorId':_0x33a846,'onRoundStart':(_0x320047,_0x1650eb)=>{const _0x3381d2=_0x1f1317;_0xef1f13[_0x3381d2(0x11b)]=_0x3381d2(0x14f)+(_0x320047+0x1)+'/'+_0x1650eb+_0x3381d2(0x10d);},'onRoundComplete':(_0x26668a,_0x3b8371,_0x2475e4)=>{const _0x1e0737=_0x1f1317,_0x2f0aa6=formatElapsed(_0x3b8371);_0x2475e4?console['log'](_0x1e0737(0x142)+(_0x26668a+0x1)+'/'+_0x497f4e[_0x1e0737(0xc5)][_0x1e0737(0xc7)]+_0x1e0737(0x12b)+a5_0x5754d7[_0x1e0737(0xf7)]('✓')+'\x20('+_0x2f0aa6+')'):console[_0x1e0737(0x148)]('\x20\x20Round\x20'+(_0x26668a+0x1)+'/'+_0x497f4e[_0x1e0737(0xc5)][_0x1e0737(0xc7)]+_0x1e0737(0x12b)+a5_0x5754d7[_0x1e0737(0xc8)]('✗'));},'onEvaluationStart':()=>{const _0x56f9a2=_0x1f1317;_0xef1f13[_0x56f9a2(0x11b)]=_0x56f9a2(0xcc);},'onEvaluationComplete':_0x1b07a8=>{const _0x5ea3b7=_0x1f1317,_0x431e0c=formatElapsed(_0x1b07a8);console['log']('\x20\x20Evaluating...\x20'+a5_0x5754d7[_0x5ea3b7(0xf7)]('✓')+'\x20('+_0x431e0c+')');}});_0xef1f13[_0x1f1317(0x121)](),_0x25a90a[_0x1f1317(0x13e)](_0x1eb489),_0x2a6251[_0x1f1317(0x13e)](_0x4e4bf4);if(_0x1eb489[_0x1f1317(0x12f)]===_0x1f1317(0xfe))console[_0x1f1317(0x148)](a5_0x5754d7[_0x1f1317(0xf7)](_0x1f1317(0x139)+_0x1eb489['reason']));else _0x1eb489[_0x1f1317(0x12f)]==='FAIL'?console[_0x1f1317(0x148)](a5_0x5754d7['red'](_0x1f1317(0xdd)+_0x1eb489[_0x1f1317(0xf1)])):console['log'](a5_0x5754d7[_0x1f1317(0xc8)](_0x1f1317(0xd2)+_0x1eb489[_0x1f1317(0xf1)]));_0x1eb489[_0x1f1317(0x120)]&&console['log'](a5_0x5754d7[_0x1f1317(0x13f)]('Conversation\x20URL:\x20'+_0x1eb489[_0x1f1317(0x120)])),console[_0x1f1317(0x148)]();}catch(_0x10ab17){_0xef1f13['stop']();const _0x1ba4d8=_0x10ab17 instanceof Error?_0x10ab17['message']:String(_0x10ab17);console[_0x1f1317(0x148)](a5_0x5754d7[_0x1f1317(0xc8)]('✗\x20ERROR:\x20'+_0x1ba4d8)),console[_0x1f1317(0x148)](),_0x25a90a[_0x1f1317(0x13e)]({'name':_0x497f4e['name'],'status':_0x1f1317(0x108),'reason':_0x1ba4d8,'timestamp':new Date()[_0x1f1317(0x116)](),'duration_ms':0x0});}}const _0x5b754e=Date[_0x1f1317(0xd4)]()-_0x2dd8ca,_0x57793f=_0x25a90a[_0x1f1317(0x123)](_0x20108c=>_0x20108c[_0x1f1317(0x12f)]===_0x1f1317(0xfe))[_0x1f1317(0xc7)],_0x275248=_0x25a90a[_0x1f1317(0x123)](_0x64fe9c=>_0x64fe9c['status']==='FAIL')[_0x1f1317(0xc7)],_0x183277=_0x25a90a['filter'](_0x5e001d=>_0x5e001d[_0x1f1317(0x12f)]===_0x1f1317(0x108))[_0x1f1317(0xc7)];console[_0x1f1317(0x148)]('━'['repeat'](0x3c)),console[_0x1f1317(0x148)](_0x1f1317(0xde)),console[_0x1f1317(0x148)]('━'['repeat'](0x3c)),console[_0x1f1317(0x148)](_0x1f1317(0x12d)+_0x25a90a[_0x1f1317(0xc7)]),console[_0x1f1317(0x148)](_0x1f1317(0x102)+a5_0x5754d7[_0x1f1317(0xf7)](_0x57793f)),console['log'](_0x1f1317(0x14d)+a5_0x5754d7[_0x1f1317(0xc8)](_0x275248));_0x183277>0x0&&console['log'](_0x1f1317(0x152)+a5_0x5754d7[_0x1f1317(0xc8)](_0x183277));console['log'](_0x1f1317(0x147)+formatElapsed(_0x5b754e)),console['log']('━'[_0x1f1317(0xdf)](0x3c));const _0x185034=_0x25a90a[_0x1f1317(0x123)](_0x39dc04=>_0x39dc04[_0x1f1317(0x12f)]!==_0x1f1317(0xfe));if(_0x185034['length']>0x0){console[_0x1f1317(0x148)](),console[_0x1f1317(0x148)](_0x1f1317(0xe3));for(const _0x313f54 of _0x185034){const _0x529763=a5_0x5754d7[_0x1f1317(0xc8)]('✗'),_0x541496=_0x313f54[_0x1f1317(0xf1)][_0x1f1317(0xc7)]>0x32?_0x313f54[_0x1f1317(0xf1)][_0x1f1317(0x10c)](0x0,0x32)+_0x1f1317(0x143):_0x313f54[_0x1f1317(0xf1)];console[_0x1f1317(0x148)]('\x20\x20'+_0x529763+'\x20'+_0x313f54[_0x1f1317(0xce)]+':\x20'+_0x541496);}}const _0x256091={'summary':{'total':_0x25a90a[_0x1f1317(0xc7)],'passed':_0x57793f,'failed':_0x275248,'errors':_0x183277>0x0?_0x183277:undefined,'duration_ms':_0x5b754e},'tests':_0x25a90a,'agent':{'project':_0x386fd6['projectName'],'name':_0x386fd6[_0x1f1317(0xf6)],'site':_0x38922e},'timestamp':new Date(_0x2dd8ca)[_0x1f1317(0x116)]()};try{const _0x2297fd=buildCachedTestRun(_0x2a6251,{'site':_0x38922e,'projectId':_0x168eb8,'projectName':_0x386fd6[_0x1f1317(0xd6)],'agentId':_0x57ae76,'agentName':_0x386fd6[_0x1f1317(0xf6)],'testYmlPath':a5_0x4148d0[_0x1f1317(0x110)](_0x386fd6[_0x1f1317(0x10a)])});saveLastTestRun(_0x2297fd);}catch{}if(_0x4e93ff!==_0x1f1317(0xf8)||_0x5b871d){const _0xc06974=formatResults(_0x256091,_0x4e93ff);if(_0x5b871d)try{a5_0x4bc22d[_0x1f1317(0x11f)](_0x5b871d,_0xc06974,'utf-8'),console['log'](),console[_0x1f1317(0x148)](a5_0x5754d7[_0x1f1317(0x13f)](_0x1f1317(0xef)+_0x5b871d));}catch(_0x414027){return console[_0x1f1317(0x148)](),console[_0x1f1317(0x148)](a5_0x5754d7[_0x1f1317(0xc8)](_0x1f1317(0xec)+_0x414027)),0x1;}else console[_0x1f1317(0x148)](),console['log'](_0xc06974);}return _0x185034[_0x1f1317(0xc7)]>0x0?0x1:0x0;}async[a5_0x47560e(0x12a)](_0x40978e,_0x55288f){const _0x3cf782=a5_0x47560e,{options:_0x556c7d,tdx:_0x394046}=_0x40978e,{definition:_0x18348a,agentInfo:_0x1a0c5e,outputFormat:_0x794e3b,outputFile:_0x1fd54f}=_0x55288f,_0x18ee26=_0x556c7d[_0x3cf782(0xc2)],_0x4204cd=loadLastTestRun();if(!_0x4204cd)return console[_0x3cf782(0x148)](a5_0x5754d7['red'](_0x3cf782(0x107))),console[_0x3cf782(0x148)](a5_0x5754d7[_0x3cf782(0x13f)](_0x3cf782(0xe2))),0x1;if(_0x4204cd[_0x3cf782(0x101)][_0x3cf782(0xf6)]!==_0x1a0c5e['agentName'])return console['log'](a5_0x5754d7['red']('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x4204cd[_0x3cf782(0x101)][_0x3cf782(0xf6)]+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x1a0c5e['agentName']+'\x22.')),console[_0x3cf782(0x148)](a5_0x5754d7[_0x3cf782(0x13f)](_0x3cf782(0xe9))),0x1;const _0x219a7=new Set(_0x4204cd['conversations'][_0x3cf782(0xfc)](_0x5dbecd=>_0x5dbecd[_0x3cf782(0x11c)])),_0x3391e0=_0x18348a[_0x3cf782(0x103)][_0x3cf782(0x123)](_0x545c27=>!_0x219a7[_0x3cf782(0x104)](_0x545c27['name']));if(_0x3391e0[_0x3cf782(0xc7)]>0x0&&_0x4204cd[_0x3cf782(0xc2)]!==_0x18ee26)return console[_0x3cf782(0x148)](a5_0x5754d7[_0x3cf782(0xc8)](_0x3cf782(0x156))),console[_0x3cf782(0x148)](a5_0x5754d7['dim'](_0x3cf782(0x13d)+_0x4204cd[_0x3cf782(0xc2)]+_0x3cf782(0xe7)+_0x18ee26+'\x22.')),console['log'](a5_0x5754d7[_0x3cf782(0x13f)](_0x3cf782(0xf0)+_0x4204cd[_0x3cf782(0xc2)]+_0x3cf782(0x138))),0x1;const _0x234f0b=_0x18348a[_0x3cf782(0x103)][_0x3cf782(0x123)](_0x43379d=>_0x219a7[_0x3cf782(0x104)](_0x43379d[_0x3cf782(0xce)])),_0x52ebdf=_0x3391e0;let _0x53e616;try{_0x53e616=await setupEvaluatorAgent(_0x394046[_0x3cf782(0xfb)],_0x556c7d[_0x3cf782(0xc0)]);}catch(_0x34bccd){const _0x57b8db=_0x34bccd instanceof Error?_0x34bccd['message']:String(_0x34bccd);return console['log'](a5_0x5754d7[_0x3cf782(0xc8)](_0x3cf782(0x14e)+_0x57b8db)),0x1;}console[_0x3cf782(0x148)](a5_0x5754d7[_0x3cf782(0xf4)]('Re-evaluating\x20cached\x20test\x20run...')),console[_0x3cf782(0x148)](_0x3cf782(0x15c)+a5_0x5754d7[_0x3cf782(0x118)](_0x4204cd[_0x3cf782(0x131)])),console[_0x3cf782(0x148)](_0x3cf782(0x10f)+a5_0x5754d7[_0x3cf782(0x118)](_0x4204cd[_0x3cf782(0x101)]['projectName']+'/'+_0x4204cd[_0x3cf782(0x101)][_0x3cf782(0xf6)]));_0x52ebdf[_0x3cf782(0xc7)]>0x0&&console[_0x3cf782(0x148)](_0x3cf782(0x114)+a5_0x5754d7[_0x3cf782(0x132)](_0x52ebdf[_0x3cf782(0xc7)]));console['log']();const _0x471be8=[],_0x4a676c=Date[_0x3cf782(0xd4)](),_0x432fb3=createCommandSpinner(_0x3cf782(0x15a));if(_0x234f0b[_0x3cf782(0xc7)]>0x0)try{const _0x2f75df=await reevaluateFromCache(_0x394046[_0x3cf782(0xfb)],_0x4204cd,{'tests':_0x234f0b},{'evaluatorId':_0x53e616,'onTestStart':(_0x5da8ab,_0x426169,_0x1d4d8e)=>{const _0x1d5c24=_0x3cf782;_0x432fb3[_0x1d5c24(0x11b)]=_0x1d5c24(0xe1)+(_0x426169+0x1)+'/'+_0x1d4d8e+':\x20'+_0x5da8ab+_0x1d5c24(0x143);if(!_0x432fb3[_0x1d5c24(0xbf)])_0x432fb3[_0x1d5c24(0x136)]();},'onTestComplete':(_0x9e4135,_0x4db9b0)=>{const _0x1999c6=_0x3cf782;_0x432fb3[_0x1999c6(0x121)]();if(_0x4db9b0[_0x1999c6(0x12f)]==='PASS')console['log'](a5_0x5754d7[_0x1999c6(0xf7)](_0x1999c6(0x139)+_0x9e4135)+a5_0x5754d7[_0x1999c6(0x13f)]('\x20(cached)'));else _0x4db9b0[_0x1999c6(0x12f)]===_0x1999c6(0x122)?console[_0x1999c6(0x148)](a5_0x5754d7[_0x1999c6(0xc8)](_0x1999c6(0xdd)+_0x9e4135+_0x1999c6(0x117)+_0x4db9b0['reason'])+a5_0x5754d7[_0x1999c6(0x13f)]('\x20(cached)')):console[_0x1999c6(0x148)](a5_0x5754d7['red'](_0x1999c6(0xd2)+_0x9e4135+_0x1999c6(0x117)+_0x4db9b0[_0x1999c6(0xf1)]));_0x4db9b0['conversation_url']&&console[_0x1999c6(0x148)](a5_0x5754d7[_0x1999c6(0x13f)]('\x20\x20Conversation:\x20'+_0x4db9b0[_0x1999c6(0x120)])),_0x471be8[_0x1999c6(0x13e)](_0x4db9b0);},'onTestSkipped':(_0x1adc2e,_0x2baf1e)=>{const _0x1891aa=_0x3cf782;_0x432fb3[_0x1891aa(0x121)](),console[_0x1891aa(0x148)](a5_0x5754d7[_0x1891aa(0x132)](_0x1891aa(0xc1)+_0x1adc2e+'\x20-\x20'+_0x2baf1e));}});for(const _0x10a181 of _0x2f75df){!_0x471be8[_0x3cf782(0x151)](_0x217ee3=>_0x217ee3['name']===_0x10a181[_0x3cf782(0xce)])&&_0x471be8[_0x3cf782(0x13e)](_0x10a181);}}catch(_0xedbe20){_0x432fb3['stop']();const _0x29bce6=_0xedbe20 instanceof Error?_0xedbe20[_0x3cf782(0x153)]:String(_0xedbe20);return console['log'](a5_0x5754d7[_0x3cf782(0xc8)](_0x3cf782(0xf5)+_0x29bce6)),0x1;}_0x432fb3[_0x3cf782(0x121)]();if(_0x52ebdf[_0x3cf782(0xc7)]>0x0){console['log'](),console['log'](a5_0x5754d7[_0x3cf782(0xf4)](_0x3cf782(0x126)));const {projectId:_0x5c3bb7,agentId:_0x14348e}=_0x4204cd[_0x3cf782(0x101)];for(const _0x5066a6 of _0x52ebdf){console[_0x3cf782(0x148)](_0x3cf782(0x155)+a5_0x5754d7[_0x3cf782(0x118)](_0x5066a6[_0x3cf782(0xce)]));const _0x21469e=createCommandSpinner(_0x3cf782(0x13a)+_0x5066a6[_0x3cf782(0xc5)][_0x3cf782(0xc7)]+_0x3cf782(0x10d));_0x21469e[_0x3cf782(0x136)]();try{const {result:_0x1977f4}=await runTest(_0x394046['llm'],_0x5066a6,{'agentId':_0x14348e,'projectId':_0x5c3bb7,'site':_0x4204cd[_0x3cf782(0xc2)],'noEval':![],'evaluatorId':_0x53e616,'onRoundStart':(_0x1e7ae4,_0x1f5244)=>{const _0x1dc2fa=_0x3cf782;_0x21469e[_0x1dc2fa(0x11b)]=_0x1dc2fa(0x14f)+(_0x1e7ae4+0x1)+'/'+_0x1f5244+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x236524,_0x5388cb,_0xdf9eef)=>{const _0x12283c=_0x3cf782,_0x5408f8=formatElapsed(_0x5388cb);_0xdf9eef?console[_0x12283c(0x148)]('\x20\x20Round\x20'+(_0x236524+0x1)+'/'+_0x5066a6[_0x12283c(0xc5)][_0x12283c(0xc7)]+_0x12283c(0x12b)+a5_0x5754d7['green']('✓')+'\x20('+_0x5408f8+')'):console[_0x12283c(0x148)]('\x20\x20Round\x20'+(_0x236524+0x1)+'/'+_0x5066a6['rounds'][_0x12283c(0xc7)]+_0x12283c(0x12b)+a5_0x5754d7['red']('✗'));},'onEvaluationStart':()=>{const _0x571967=_0x3cf782;_0x21469e[_0x571967(0x11b)]='Evaluating\x20response...';},'onEvaluationComplete':_0x5dd217=>{const _0x1142e6=_0x3cf782,_0x2cb14c=formatElapsed(_0x5dd217);console[_0x1142e6(0x148)](_0x1142e6(0x130)+a5_0x5754d7[_0x1142e6(0xf7)]('✓')+'\x20('+_0x2cb14c+')');}});_0x21469e[_0x3cf782(0x121)](),_0x471be8[_0x3cf782(0x13e)](_0x1977f4);if(_0x1977f4[_0x3cf782(0x12f)]==='PASS')console[_0x3cf782(0x148)](a5_0x5754d7[_0x3cf782(0xf7)](_0x3cf782(0x139)+_0x1977f4['reason'])+a5_0x5754d7[_0x3cf782(0x13f)]('\x20(new)'));else _0x1977f4[_0x3cf782(0x12f)]===_0x3cf782(0x122)?console[_0x3cf782(0x148)](a5_0x5754d7[_0x3cf782(0xc8)](_0x3cf782(0xdd)+_0x1977f4['reason'])+a5_0x5754d7[_0x3cf782(0x13f)](_0x3cf782(0xff))):console['log'](a5_0x5754d7[_0x3cf782(0xc8)]('✗\x20ERROR:\x20'+_0x1977f4['reason']));_0x1977f4[_0x3cf782(0x120)]&&console[_0x3cf782(0x148)](a5_0x5754d7[_0x3cf782(0x13f)](_0x3cf782(0xd0)+_0x1977f4[_0x3cf782(0x120)]));}catch(_0x28250d){_0x21469e['stop']();const _0x11c2e3=_0x28250d instanceof Error?_0x28250d[_0x3cf782(0x153)]:String(_0x28250d);console[_0x3cf782(0x148)](a5_0x5754d7['red'](_0x3cf782(0xd2)+_0x11c2e3)),_0x471be8[_0x3cf782(0x13e)]({'name':_0x5066a6[_0x3cf782(0xce)],'status':_0x3cf782(0x108),'reason':_0x11c2e3,'timestamp':new Date()[_0x3cf782(0x116)](),'duration_ms':0x0});}}}console[_0x3cf782(0x148)]();const _0x324965=Date[_0x3cf782(0xd4)]()-_0x4a676c,_0x374fe9=_0x471be8[_0x3cf782(0x123)](_0x54b419=>_0x54b419[_0x3cf782(0x12f)]===_0x3cf782(0xfe))['length'],_0x3a7b58=_0x471be8[_0x3cf782(0x123)](_0x4bbfb1=>_0x4bbfb1[_0x3cf782(0x12f)]===_0x3cf782(0x122))[_0x3cf782(0xc7)],_0x2ba620=_0x471be8[_0x3cf782(0x123)](_0x482ee3=>_0x482ee3[_0x3cf782(0x12f)]==='ERROR')['length'];console[_0x3cf782(0x148)]('━'[_0x3cf782(0xdf)](0x3c)),console['log'](_0x3cf782(0x106)),console[_0x3cf782(0x148)]('━'[_0x3cf782(0xdf)](0x3c)),console[_0x3cf782(0x148)]('Total:\x20\x20\x20\x20'+_0x471be8[_0x3cf782(0xc7)]),console[_0x3cf782(0x148)](_0x3cf782(0x102)+a5_0x5754d7['green'](_0x374fe9)),console[_0x3cf782(0x148)](_0x3cf782(0x14d)+a5_0x5754d7[_0x3cf782(0xc8)](_0x3a7b58));_0x2ba620>0x0&&console[_0x3cf782(0x148)](_0x3cf782(0x152)+a5_0x5754d7['red'](_0x2ba620));console[_0x3cf782(0x148)](_0x3cf782(0x147)+formatElapsed(_0x324965)),console['log']('━'[_0x3cf782(0xdf)](0x3c));const _0x47ee15={'summary':{'total':_0x471be8[_0x3cf782(0xc7)],'passed':_0x374fe9,'failed':_0x3a7b58,'errors':_0x2ba620>0x0?_0x2ba620:undefined,'duration_ms':_0x324965},'tests':_0x471be8,'agent':{'project':_0x1a0c5e[_0x3cf782(0xd6)],'name':_0x1a0c5e['agentName'],'site':_0x18ee26},'timestamp':new Date(_0x4a676c)[_0x3cf782(0x116)]()};if(_0x794e3b!=='table'||_0x1fd54f){const _0x5172cb=formatResults(_0x47ee15,_0x794e3b);if(_0x1fd54f)try{a5_0x4bc22d[_0x3cf782(0x11f)](_0x1fd54f,_0x5172cb,_0x3cf782(0xe5)),console['log'](),console[_0x3cf782(0x148)](a5_0x5754d7['dim']('Output\x20written\x20to:\x20'+_0x1fd54f));}catch(_0x179b8b){return console[_0x3cf782(0x148)](),console[_0x3cf782(0x148)](a5_0x5754d7[_0x3cf782(0xc8)](_0x3cf782(0xec)+_0x179b8b)),0x1;}else console[_0x3cf782(0x148)](),console['log'](_0x5172cb);}const _0x528b94=_0x471be8[_0x3cf782(0x123)](_0x141842=>_0x141842[_0x3cf782(0x12f)]!==_0x3cf782(0xfe));return _0x528b94[_0x3cf782(0xc7)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a6_0x1c543a=a6_0x23b2;function a6_0x23b2(_0x3e8a58,_0x3cebc6){_0x3e8a58=_0x3e8a58-0xf3;const _0x5ad353=a6_0x5ad3();let _0x23b2ed=_0x5ad353[_0x3e8a58];return _0x23b2ed;}(function(_0x20cdae,_0x16d354){const _0x2e9d47=a6_0x23b2,_0x1a0b36=_0x20cdae();while(!![]){try{const _0x3b3b85=parseInt(_0x2e9d47(0x11e))/0x1+-parseInt(_0x2e9d47(0x10b))/0x2*(parseInt(_0x2e9d47(0xff))/0x3)+-parseInt(_0x2e9d47(0x133))/0x4+parseInt(_0x2e9d47(0x106))/0x5+parseInt(_0x2e9d47(0x11d))/0x6*(-parseInt(_0x2e9d47(0x125))/0x7)+parseInt(_0x2e9d47(0x102))/0x8+parseInt(_0x2e9d47(0x103))/0x9;if(_0x3b3b85===_0x16d354)break;else _0x1a0b36['push'](_0x1a0b36['shift']());}catch(_0x458e78){_0x1a0b36['push'](_0x1a0b36['shift']());}}}(a6_0x5ad3,0xd94b3));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x1c543a(0xf5),'proxy-authorization','cookie',a6_0x1c543a(0x119),a6_0x1c543a(0x104),a6_0x1c543a(0xfd),a6_0x1c543a(0x126),a6_0x1c543a(0x12a)]);function isSensitiveHeader(_0x3f9df6){const _0x5e3c=a6_0x1c543a;return SENSITIVE_HEADERS[_0x5e3c(0x107)](_0x3f9df6[_0x5e3c(0x118)]());}function a6_0x5ad3(){const _0x2ffeea=['PATCH','workflow','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','includes','isArray','execute','data','2418956TvlhJg','.\x20Valid\x20types:\x20','DELETE','trim','error','authorization','color','llm','file','GET','stack','readBodyFromFile','\x0aStack\x20trace:\x0a','x-xsrf-token','\x22.\x20','32286FjGVSF','keys','status','3531960gIMYlB','9794727YUNOtj','set-cookie2','name','3417960mdsFSp','has','verbose','validate','log','182rBTqWV','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','Error:\x20','startsWith','noColor','llm-proxy','Endpoint\x20must\x20start\x20with\x20/:\x20','Invalid\x20API\x20type:\x20','header','cdp','type','api','Invalid\x20header\x20format:\x20\x22','toLowerCase','set-cookie','<\x20HTTP/1.1\x20','headers','Results\x20saved\x20to\x20','40098yLaSHv','1269859ZVmowA','indexOf','body','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','.\x20Valid\x20methods:\x20','output','cas','1057FKpzOf','x-auth-token','message','substring','request','x-trino-user','toUpperCase'];a6_0x5ad3=function(){return _0x2ffeea;};return a6_0x5ad3();}function parseHeader(_0xc94e8e){const _0x4950af=a6_0x1c543a,_0x377285=_0xc94e8e[_0x4950af(0x11f)](':');if(_0x377285===-0x1)throw new Error(_0x4950af(0x117)+_0xc94e8e+_0x4950af(0xfe)+_0x4950af(0x121));const _0x26ec5a=_0xc94e8e[_0x4950af(0x128)](0x0,_0x377285)[_0x4950af(0xf3)](),_0x41223d=_0xc94e8e[_0x4950af(0x128)](_0x377285+0x1)['trim']();if(!_0x26ec5a)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0xc94e8e+'\x22');return[_0x26ec5a,_0x41223d];}export class ApiCommand extends BaseCommand{[a6_0x1c543a(0x105)]=a6_0x1c543a(0x116);['description']=a6_0x1c543a(0x10c);[a6_0x1c543a(0x109)](_0x2e5882){const _0x3347ec=a6_0x1c543a,{args:_0x122c5c,options:_0x30c46c}=_0x2e5882,_0x41d8e4=_0x30c46c;if(_0x122c5c['length']===0x0)return _0x3347ec(0x12e);const _0x520856=_0x122c5c[0x0];if(!_0x520856[_0x3347ec(0x10e)]('/'))return _0x3347ec(0x111)+_0x520856;const _0x27c3fc=_0x41d8e4['data'],_0x7dcc40=_0x41d8e4[_0x3347ec(0xf8)];if(_0x27c3fc&&_0x7dcc40)return'Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.';const _0x4ddc4a=_0x41d8e4['method']||_0x3347ec(0xf9),_0x140deb=[_0x3347ec(0xf9),'POST','PUT',_0x3347ec(0x135),_0x3347ec(0x12c)];if(!_0x140deb[_0x3347ec(0x12f)](_0x4ddc4a[_0x3347ec(0x12b)]()))return'Invalid\x20HTTP\x20method:\x20'+_0x4ddc4a+_0x3347ec(0x122)+_0x140deb['join'](',\x20');const _0x32d54f=_0x41d8e4[_0x3347ec(0x115)]||'td',_0x2c76cf=['td',_0x3347ec(0x114),_0x3347ec(0x12d),'trino',_0x3347ec(0xf7),_0x3347ec(0x110),_0x3347ec(0x124)];if(!_0x2c76cf[_0x3347ec(0x12f)](_0x32d54f))return _0x3347ec(0x112)+_0x32d54f+_0x3347ec(0x134)+_0x2c76cf['join'](',\x20');return undefined;}async[a6_0x1c543a(0x131)](_0x45239b){const _0x4d78e5=a6_0x1c543a,{options:_0x4aafe5,args:_0x251c92,tdx:_0x51f366}=_0x45239b,_0x385b13=_0x4aafe5,_0x39fa9d=_0x251c92[0x0],_0x354047=(_0x385b13['method']||_0x4d78e5(0xf9))[_0x4d78e5(0x12b)](),_0x4a4a9c=_0x385b13[_0x4d78e5(0x132)],_0x18bb81=_0x385b13['file'],_0x1e4688=_0x385b13[_0x4d78e5(0x113)],_0x503003=_0x385b13['type']||'td';try{const _0x476d04={};if(_0x1e4688){const _0x32c328=Array[_0x4d78e5(0x130)](_0x1e4688)?_0x1e4688:[_0x1e4688];for(const _0x1cd070 of _0x32c328){const [_0x121913,_0x4cb0c9]=parseHeader(_0x1cd070);_0x476d04[_0x121913]=_0x4cb0c9;}}let _0x79b388;if(_0x4a4a9c)_0x79b388=_0x4a4a9c;else{if(_0x18bb81)try{_0x79b388=RawAPI[_0x4d78e5(0xfb)](_0x18bb81);}catch(_0x3f48ea){return console[_0x4d78e5(0xf4)](_0x4d78e5(0x10d)+(_0x3f48ea instanceof Error?_0x3f48ea[_0x4d78e5(0x127)]:String(_0x3f48ea))),0x1;}}const _0x7d505b={'method':_0x354047,'apiType':_0x503003,'includeHeaders':_0x4aafe5[_0x4d78e5(0x108)]};_0x79b388&&(_0x7d505b[_0x4d78e5(0x120)]=_0x79b388);Object[_0x4d78e5(0x100)](_0x476d04)['length']>0x0&&(_0x7d505b[_0x4d78e5(0x11b)]=_0x476d04);if(_0x4aafe5[_0x4d78e5(0x108)]){const _0x48947a=resolveSite(_0x4aafe5['site']),_0x1ce7dd=getEndpoint(_0x48947a,_0x503003),_0x503bc4=''+_0x1ce7dd+_0x39fa9d;console[_0x4d78e5(0xf4)]('>\x20'+_0x354047+'\x20'+_0x503bc4);const _0x402ae5=getAuthHeaders(_0x48947a),_0x1f093c={..._0x402ae5,..._0x476d04};for(const [_0x4c29a3,_0x2ad6ff]of Object['entries'](_0x1f093c)){!isSensitiveHeader(_0x4c29a3)&&console['error']('>\x20'+_0x4c29a3+':\x20'+_0x2ad6ff);}_0x79b388&&console[_0x4d78e5(0xf4)]('>'),console[_0x4d78e5(0xf4)]('');}const _0x2454d4=await _0x51f366[_0x4d78e5(0x116)][_0x4d78e5(0x129)](_0x39fa9d,_0x7d505b);if(_0x4aafe5['verbose']&&_0x2454d4[_0x4d78e5(0x11b)]){console[_0x4d78e5(0xf4)](_0x4d78e5(0x11a)+_0x2454d4[_0x4d78e5(0x101)]);for(const [_0x5d684a,_0x5bb37b]of Object['entries'](_0x2454d4[_0x4d78e5(0x11b)])){!isSensitiveHeader(_0x5d684a)&&console[_0x4d78e5(0xf4)]('<\x20'+_0x5d684a+':\x20'+_0x5bb37b);}console[_0x4d78e5(0xf4)]('');}const _0x57c71f=Boolean(_0x4aafe5[_0x4d78e5(0x123)]),_0x32e915={'color':_0x4aafe5[_0x4d78e5(0xf6)],'noColor':_0x4aafe5[_0x4d78e5(0x10f)]||_0x57c71f&&!_0x4aafe5[_0x4d78e5(0xf6)]},_0x47cced=colorizeJSON(_0x2454d4[_0x4d78e5(0x132)],_0x32e915);return _0x4aafe5['output']?(writeFileSync(_0x4aafe5[_0x4d78e5(0x123)],_0x47cced),console[_0x4d78e5(0xf4)](_0x4d78e5(0x11c)+_0x4aafe5[_0x4d78e5(0x123)])):console[_0x4d78e5(0x10a)](_0x47cced),0x0;}catch(_0x3bc449){return _0x3bc449 instanceof Error?(console[_0x4d78e5(0xf4)]('Error:\x20'+_0x3bc449[_0x4d78e5(0x127)]),_0x4aafe5[_0x4d78e5(0x108)]&&_0x3bc449[_0x4d78e5(0xfa)]&&console[_0x4d78e5(0xf4)](_0x4d78e5(0xfc)+_0x3bc449[_0x4d78e5(0xfa)])):console['error'](_0x4d78e5(0x10d)+String(_0x3bc449)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a7_0x120e5b=a7_0x1235;(function(_0x20c69d,_0x52b27e){const _0x579a56=a7_0x1235,_0x222167=_0x20c69d();while(!![]){try{const _0x1567a6=parseInt(_0x579a56(0x141))/0x1*(-parseInt(_0x579a56(0x147))/0x2)+-parseInt(_0x579a56(0x148))/0x3*(-parseInt(_0x579a56(0x18b))/0x4)+-parseInt(_0x579a56(0x171))/0x5+parseInt(_0x579a56(0x138))/0x6*(-parseInt(_0x579a56(0x170))/0x7)+-parseInt(_0x579a56(0x16e))/0x8+-parseInt(_0x579a56(0x172))/0x9*(parseInt(_0x579a56(0x15c))/0xa)+parseInt(_0x579a56(0x14b))/0xb;if(_0x1567a6===_0x52b27e)break;else _0x222167['push'](_0x222167['shift']());}catch(_0x5e8765){_0x222167['push'](_0x222167['shift']());}}}(a7_0x5abc,0x7efd4));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_0x283251 from'prompts';function a7_0x5abc(){const _0x2cb7c6=['password','\x20(site:\x20','1003xUACVI','API\x20key\x20cannot\x20be\x20empty','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','✓\x20Profile\x20\x27','email','apikey','34qFnOJB','3zKkZJn','tdx\x20profile:\x20','dim','28577142DomsBw','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','\x20and\x20','\x27\x20registered','Validating\x20API\x20key...','Sign\x20in\x20with\x20browser\x20(recommended)','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','execute','message','us01','red','profile','/app/mp/ak','\x20\x20user_id:','✓\x20Default\x20site\x20set\x20to\x20','Setup\x20cancelled','accountName','495410qkeZQe','trim','error','No\x20credential\x20found','description','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','oauth','Enter\x20your\x20TD\x20API\x20key:','Opening\x20browser\x20for\x20authentication...','getUserInfo','System\x20keychain\x20is\x20not\x20available','site','yellow','N/A','create','warn','Setting\x20up\x20authentication\x20for\x20site:\x20','name','1288256FJdVeQ','auth','3416PKJorl','4166765EpQQsh','171YORMlm','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','\x20\x20(','OAuth\x20tokens','text','No\x20credentials\x20found\x20in\x20keychain','✓\x20Signed\x20in\x20successfully','logLevel','filter','last_name','first_name','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','/oauth/authorize','auth:clear','✓\x20Authentication\x20successful\x0a','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','cyan','\x20removed\x20from\x20keychain','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','Use\x20an\x20API\x20key','bold','Remove\x20API\x20key\x20from\x20system\x20keychain','ERROR','Name:\x20','2751796PtopSj','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','jobs','✗\x20Validation\x20failed:\x20','apiKey','access_token','Credential\x20type:\x20OAuth','\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','For\x20scripts\x20or\x20headless\x20servers','You\x20can\x20find\x20your\x20API\x20key\x20at:','account_id','tdx:\x20auth\x20setup','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','\x0aSetup\x20cancelled','User:\x20','Choose\x20how\x20to\x20sign\x20in:','\x20\x20tdx','9996lILFTn','method','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','\x20(profile:\x20','status','join','log'];a7_0x5abc=function(){return _0x2cb7c6;};return a7_0x5abc();}function a7_0x1235(_0x15ebcc,_0xadbe4c){_0x15ebcc=_0x15ebcc-0x130;const _0x5abc3d=a7_0x5abc();let _0x1235fa=_0x5abc3d[_0x15ebcc];return _0x1235fa;}import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a7_0x59d1f5 from'chalk';export async function runOAuthLoginFlow(_0x1ba44e,_0x3c0b3f,_0x23ba31,_0xb9ffc6){const _0x7485f5=a7_0x1235,_0x8c8b00=await isKeychainAvailable();if(!_0x8c8b00)throw new Error('System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20'+_0x7485f5(0x193));let _0x961bc5=_0xb9ffc6?.['accountName'];if(!_0x961bc5){const _0x540fe4=await a7_0x283251({'type':_0x7485f5(0x177),'name':'accountName','message':_0x7485f5(0x185)});if(_0x540fe4[_0x7485f5(0x15b)]===undefined)throw new Error(_0x7485f5(0x15a));_0x961bc5=_0x540fe4[_0x7485f5(0x15b)][_0x7485f5(0x15d)]()||undefined;}const _0x1d54c2=getConsoleUrl(_0x1ba44e);console['log'](_0x7485f5(0x164));_0x961bc5?console['log']('\x20\x20'+_0x1d54c2+'/users/initiate_sso\x20(account:\x20'+_0x961bc5+')'):console[_0x7485f5(0x13e)]('\x20\x20'+_0x1d54c2+_0x7485f5(0x17f));console['log'](_0x7485f5(0x13a));const _0x3105f3=await startOAuthFlow(_0x1ba44e,{'accountName':_0x961bc5});console[_0x7485f5(0x13e)]('Validating\x20OAuth\x20tokens...');const _0x523b42=TDX['create']({'site':_0x1ba44e,'accessToken':_0x3105f3[_0x7485f5(0x190)],'logLevel':_0x23ba31??LogLevel[_0x7485f5(0x189)]}),_0x5ad5eb=await _0x523b42[_0x7485f5(0x18d)][_0x7485f5(0x165)]();console[_0x7485f5(0x13e)](a7_0x59d1f5['green'](_0x7485f5(0x179))),console['log']('\x20\x20'+a7_0x59d1f5[_0x7485f5(0x183)](_0x1ba44e+':'+_0x5ad5eb[_0x7485f5(0x130)])+_0x7485f5(0x158)+_0x5ad5eb['id']+_0x7485f5(0x175)+_0x5ad5eb[_0x7485f5(0x145)]+')');!_0x961bc5&&(console['log'](a7_0x59d1f5['dim'](_0x7485f5(0x192))),console[_0x7485f5(0x13e)](a7_0x59d1f5[_0x7485f5(0x14a)](_0x7485f5(0x151))),console['log'](a7_0x59d1f5['dim'](_0x7485f5(0x143))));await saveOAuthTokens(_0x3105f3,_0x3c0b3f),console['log'](_0x7485f5(0x18c)+(_0x3c0b3f?_0x7485f5(0x13b)+_0x3c0b3f+')':''));if(_0x3c0b3f){const _0x502a41={'site':_0x1ba44e};saveProfileToUserConfig(_0x3c0b3f,_0x502a41),console[_0x7485f5(0x13e)](_0x7485f5(0x144)+_0x3c0b3f+_0x7485f5(0x14e));}else saveDefaultSiteToUserConfig(_0x1ba44e),console[_0x7485f5(0x13e)]('✓\x20Default\x20site\x20set\x20to\x20'+_0x1ba44e);const _0x570d84=_0x3c0b3f?'\x20--profile\x20'+_0x3c0b3f:'';console[_0x7485f5(0x13e)](),console[_0x7485f5(0x13e)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x7485f5(0x13e)]('\x20\x20tdx'+_0x570d84+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x7485f5(0x13e)](_0x7485f5(0x137)+_0x570d84+_0x7485f5(0x173));}export async function promptAuthMethod(){const _0x2bb5f8=a7_0x1235,_0x1c59c9=await a7_0x283251({'type':'select','name':_0x2bb5f8(0x139),'message':_0x2bb5f8(0x136),'choices':[{'title':_0x2bb5f8(0x150),'description':_0x2bb5f8(0x182),'value':_0x2bb5f8(0x162)},{'title':_0x2bb5f8(0x186),'description':_0x2bb5f8(0x194),'value':_0x2bb5f8(0x146)}]});return _0x1c59c9['method']||null;}export class AuthSetupCommand extends BaseCommand{[a7_0x120e5b(0x16d)]='auth:setup';['description']='Setup\x20API\x20key\x20authentication\x20interactively';async[a7_0x120e5b(0x152)](_0x20f5ed){const _0x6aa22=a7_0x120e5b,{options:_0x31c4fd}=_0x20f5ed,_0x38ecd2=_0x31c4fd['profile'];console[_0x6aa22(0x13e)](a7_0x59d1f5[_0x6aa22(0x187)](_0x6aa22(0x131)));const _0x3b2743=_0x31c4fd[_0x6aa22(0x167)]||_0x6aa22(0x154),_0xfc0dd9=await promptSiteSelection(_0x3b2743,_0x38ecd2,_0x6aa22(0x15a));if(!_0xfc0dd9)return 0x1;const _0x320620=resolveSite(_0xfc0dd9),_0xda8830=await promptAuthMethod();if(!_0xda8830)return console[_0x6aa22(0x13e)](_0x6aa22(0x134)),0x1;if(_0xda8830===_0x6aa22(0x162)){const {accountName:_0x35c2b1}=_0x31c4fd;return await runOAuthLoginFlow(_0x320620,_0x38ecd2,_0x31c4fd['logLevel']??LogLevel[_0x6aa22(0x189)],{'accountName':_0x35c2b1}),0x0;}console[_0x6aa22(0x13e)](_0x6aa22(0x16c)+_0x320620),console[_0x6aa22(0x13e)](_0x6aa22(0x195)),console['log']('\x20\x20'+getConsoleUrl(_0x320620,_0x6aa22(0x157)));const _0xfbdec8=await a7_0x283251({'type':_0x6aa22(0x13f),'name':_0x6aa22(0x18f),'message':_0x6aa22(0x163),'validate':_0x1992d6=>{const _0x19ef4d=_0x6aa22;if(!_0x1992d6||!_0x1992d6['trim']())return _0x19ef4d(0x142);return!![];}});if(!_0xfbdec8[_0x6aa22(0x18f)])return console[_0x6aa22(0x13e)](_0x6aa22(0x134)),0x1;const _0x20b491=_0xfbdec8[_0x6aa22(0x18f)];console[_0x6aa22(0x13e)](_0x6aa22(0x14f));try{const _0x415fb4=TDX[_0x6aa22(0x16a)]({'site':_0x320620,'apiKey':_0x20b491[_0x6aa22(0x15d)](),'logLevel':_0x31c4fd[_0x6aa22(0x17a)]??LogLevel[_0x6aa22(0x189)]}),_0x477531=await _0x415fb4['jobs'][_0x6aa22(0x165)]();console[_0x6aa22(0x13e)]('✓\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x477531['email']+')');const _0x5ccebc=await isKeychainAvailable();_0x5ccebc?(await saveAPIKeyAsync(_0x20b491[_0x6aa22(0x15d)](),_0x320620,_0x38ecd2),console[_0x6aa22(0x13e)](_0x6aa22(0x133)+(_0x38ecd2?'\x20(profile:\x20'+_0x38ecd2+')':''))):(console[_0x6aa22(0x16b)](a7_0x59d1f5[_0x6aa22(0x168)](_0x6aa22(0x174))),console[_0x6aa22(0x16b)](a7_0x59d1f5[_0x6aa22(0x168)](_0x6aa22(0x17e))));if(_0x38ecd2){const _0x29fcba={'site':_0x320620};saveProfileToUserConfig(_0x38ecd2,_0x29fcba),console[_0x6aa22(0x13e)]('✓\x20Profile\x20\x27'+_0x38ecd2+_0x6aa22(0x14e));}else saveDefaultSiteToUserConfig(_0x320620),console[_0x6aa22(0x13e)](_0x6aa22(0x159)+_0x320620);const _0x33e0e5=_0x38ecd2?'\x20--profile\x20'+_0x38ecd2:'';return console[_0x6aa22(0x13e)](),console['log']('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x6aa22(0x13e)](_0x6aa22(0x137)+_0x33e0e5+_0x6aa22(0x161)),console['log'](_0x6aa22(0x137)+_0x33e0e5+_0x6aa22(0x173)),0x0;}catch(_0x249869){if(_0x249869 instanceof HTTPClientError&&_0x249869[_0x6aa22(0x13c)]===0x191)return printAuthError(_0x249869),0x1;return console[_0x6aa22(0x15e)](a7_0x59d1f5[_0x6aa22(0x155)](_0x6aa22(0x18e)+(_0x249869 instanceof Error?_0x249869[_0x6aa22(0x153)]:String(_0x249869)))),console[_0x6aa22(0x15e)](_0x6aa22(0x14c)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x120e5b(0x16d)]=a7_0x120e5b(0x16f);[a7_0x120e5b(0x160)]=a7_0x120e5b(0x132);async['execute'](_0x2b2d86){const _0x18a9d5=a7_0x120e5b,{options:_0x3a189a,tdx:_0x3ba6c1}=_0x2b2d86,_0x16551c=_0x3a189a[_0x18a9d5(0x167)],_0x19529c=_0x3a189a[_0x18a9d5(0x156)],_0x3ccee8=_0x19529c?_0x19529c:_0x18a9d5(0x169);console[_0x18a9d5(0x13e)](_0x18a9d5(0x149)+_0x3ccee8+_0x18a9d5(0x140)+_0x16551c+')');const _0x138d4d=await getOAuthTokens(_0x19529c);if(_0x138d4d)console[_0x18a9d5(0x13e)](_0x18a9d5(0x191)),console[_0x18a9d5(0x13e)]('Read\x20credential\x20from\x20keychain'+(_0x19529c?_0x18a9d5(0x13b)+_0x19529c+')':''));else{const _0x4c5851=await resolveAPIKeyAsync(_0x16551c,_0x19529c);if(_0x4c5851){const {source:_0x35139b,isDeprecated:_0x292ed9}=_0x4c5851,_0x46d064='Read\x20credential\x20from\x20'+_0x35139b;console[_0x18a9d5(0x13e)](_0x292ed9?a7_0x59d1f5[_0x18a9d5(0x168)](_0x46d064):_0x46d064);}else console['log'](a7_0x59d1f5[_0x18a9d5(0x168)](_0x18a9d5(0x15f)));}try{const _0x363107=await _0x3ba6c1[_0x18a9d5(0x18d)][_0x18a9d5(0x165)]();return console[_0x18a9d5(0x13e)](a7_0x59d1f5['green'](_0x18a9d5(0x181))),console[_0x18a9d5(0x13e)](_0x18a9d5(0x135)+_0x363107[_0x18a9d5(0x145)]),(_0x363107[_0x18a9d5(0x17d)]||_0x363107['last_name'])&&console[_0x18a9d5(0x13e)](_0x18a9d5(0x18a)+[_0x363107[_0x18a9d5(0x17d)],_0x363107[_0x18a9d5(0x17c)]][_0x18a9d5(0x17b)](Boolean)['join']('\x20')),0x0;}catch(_0x375477){return _0x375477 instanceof HTTPClientError&&_0x375477[_0x18a9d5(0x13c)]===0x191?printAuthError(_0x375477,!![],_0x19529c):console['error'](a7_0x59d1f5['red'](_0x18a9d5(0x18e)+(_0x375477 instanceof Error?_0x375477['message']:String(_0x375477)))),0x1;}}}export class AuthClearCommand extends BaseCommand{['name']=a7_0x120e5b(0x180);[a7_0x120e5b(0x160)]=a7_0x120e5b(0x188);async['execute'](_0x2affd0){const _0x4b0071=a7_0x120e5b,{options:_0x15048c}=_0x2affd0,_0x1c7d24=_0x15048c[_0x4b0071(0x156)];console['log'](a7_0x59d1f5[_0x4b0071(0x187)]('tdx:\x20auth\x20clear'));const _0x5d1326=await isKeychainAvailable();if(!_0x5d1326)return console[_0x4b0071(0x15e)](a7_0x59d1f5[_0x4b0071(0x155)](_0x4b0071(0x166))),0x1;const [_0xdb7d09,_0xa74b2d]=await Promise['all']([deleteKeychainAPIKey(_0x1c7d24),deleteOAuthTokens(_0x1c7d24)]);if(_0xdb7d09||_0xa74b2d){clearCredentialCache();const _0x10c334=[_0xdb7d09&&'API\x20key',_0xa74b2d&&_0x4b0071(0x176)][_0x4b0071(0x17b)](Boolean)[_0x4b0071(0x13d)](_0x4b0071(0x14d));return console['log']('✓\x20'+_0x10c334+_0x4b0071(0x184)+(_0x1c7d24?_0x4b0071(0x13b)+_0x1c7d24+')':'')),0x0;}else return console[_0x4b0071(0x13e)](_0x4b0071(0x178)+(_0x1c7d24?'\x20for\x20profile:\x20'+_0x1c7d24:'')),0x1;}}
|
|
1
|
+
const a7_0x2ee1c5=a7_0x3626;(function(_0x92eed2,_0x42089f){const _0x4ab1b9=a7_0x3626,_0x3c6f53=_0x92eed2();while(!![]){try{const _0x13ec13=parseInt(_0x4ab1b9(0x163))/0x1+-parseInt(_0x4ab1b9(0x142))/0x2+-parseInt(_0x4ab1b9(0x15b))/0x3*(parseInt(_0x4ab1b9(0x166))/0x4)+parseInt(_0x4ab1b9(0x153))/0x5+-parseInt(_0x4ab1b9(0x133))/0x6*(-parseInt(_0x4ab1b9(0x12f))/0x7)+-parseInt(_0x4ab1b9(0x13f))/0x8+parseInt(_0x4ab1b9(0x18b))/0x9*(parseInt(_0x4ab1b9(0x14d))/0xa);if(_0x13ec13===_0x42089f)break;else _0x3c6f53['push'](_0x3c6f53['shift']());}catch(_0x4e5711){_0x3c6f53['push'](_0x3c6f53['shift']());}}}(a7_0x5a34,0x33a32));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';function a7_0x3626(_0xd82b6e,_0x23fb94){_0xd82b6e=_0xd82b6e-0x12b;const _0x5a3434=a7_0x5a34();let _0x36263c=_0x5a3434[_0xd82b6e];return _0x36263c;}import{promptSiteSelection}from'../core/constants.js';import a7_0xdcac50 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_0xac9fd5 from'chalk';function a7_0x5a34(){const _0x1d1dcd=['\x20(profile:\x20','tdx\x20profile:\x20','auth:setup','\x20\x20tdx','cyan','1164248ABOPRv','tdx:\x20auth\x20setup','\x20\x20(','404906NxjqEs','jobs','ERROR','apikey','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','log','✓\x20Default\x20site\x20set\x20to\x20','filter','trim','\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','For\x20scripts\x20or\x20headless\x20servers','190DCDDzq','oauth','✗\x20Validation\x20failed:\x20','all','error','first_name','737350DYdFea','Read\x20credential\x20from\x20','\x0aSetup\x20cancelled','Enter\x20your\x20TD\x20API\x20key:','Name:\x20','join','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','771bPDOaX','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','\x20for\x20profile:\x20','green','email','✓\x20Authentication\x20successful\x0a','Choose\x20how\x20to\x20sign\x20in:','Sign\x20in\x20with\x20browser\x20(recommended)','353928HJSYGw','You\x20can\x20find\x20your\x20API\x20key\x20at:','last_name','3376uKCgbT','\x20removed\x20from\x20keychain','\x20\x20user_id:','Use\x20an\x20API\x20key','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','\x20--profile\x20','dim','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','getUserInfo','text','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','/app/mp/ak','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','execute','status','Validating\x20OAuth\x20tokens...','✓\x20Profile\x20\x27','System\x20keychain\x20is\x20not\x20available','select','name','/users/initiate_sso\x20(account:\x20','method','warn','description','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','\x20(site:\x20','us01','yellow','No\x20credentials\x20found\x20in\x20keychain','access_token','OAuth\x20tokens','Setup\x20cancelled','auth:clear','accountName','N/A','Setup\x20API\x20key\x20authentication\x20interactively','17973IROffb','User:\x20','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','Read\x20credential\x20from\x20keychain','Credential\x20type:\x20OAuth','No\x20credential\x20found','site','21tPclLv','account_id','profile','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','474114QujqBi','apiKey','create','✓\x20Signed\x20in\x20successfully','bold','\x27\x20registered','red'];a7_0x5a34=function(){return _0x1d1dcd;};return a7_0x5a34();}export async function runOAuthLoginFlow(_0x519dad,_0x240c06,_0x288972,_0x325518){const _0x398162=a7_0x3626,_0x5844cf=await isKeychainAvailable();if(!_0x5844cf)throw new Error(_0x398162(0x17f)+'Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.');let _0x33e457=_0x325518?.['accountName'];if(!_0x33e457){const _0x33540b=await a7_0xdcac50({'type':_0x398162(0x16f),'name':_0x398162(0x188),'message':_0x398162(0x16a)});if(_0x33540b[_0x398162(0x188)]===undefined)throw new Error('Setup\x20cancelled');_0x33e457=_0x33540b[_0x398162(0x188)][_0x398162(0x14a)]()||undefined;}const _0x1f1c36=getConsoleUrl(_0x519dad);console[_0x398162(0x147)]('Opening\x20browser\x20for\x20authentication...');_0x33e457?console['log']('\x20\x20'+_0x1f1c36+_0x398162(0x17a)+_0x33e457+')'):console['log']('\x20\x20'+_0x1f1c36+'/oauth/authorize');console['log'](_0x398162(0x132));const _0x14122b=await startOAuthFlow(_0x519dad,{'accountName':_0x33e457});console[_0x398162(0x147)](_0x398162(0x175));const _0x561594=TDX['create']({'site':_0x519dad,'accessToken':_0x14122b[_0x398162(0x184)],'logLevel':_0x288972??LogLevel[_0x398162(0x144)]}),_0x3a3d3a=await _0x561594['jobs'][_0x398162(0x16e)]();console[_0x398162(0x147)](a7_0xac9fd5[_0x398162(0x15e)](_0x398162(0x136))),console[_0x398162(0x147)]('\x20\x20'+a7_0xac9fd5[_0x398162(0x13e)](_0x519dad+':'+_0x3a3d3a[_0x398162(0x130)])+_0x398162(0x168)+_0x3a3d3a['id']+_0x398162(0x141)+_0x3a3d3a['email']+')');!_0x33e457&&(console[_0x398162(0x147)](a7_0xac9fd5[_0x398162(0x16c)](_0x398162(0x14b))),console[_0x398162(0x147)](a7_0xac9fd5[_0x398162(0x16c)]('\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>')),console[_0x398162(0x147)](a7_0xac9fd5['dim'](_0x398162(0x159))));await saveOAuthTokens(_0x14122b,_0x240c06),console['log']('✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain'+(_0x240c06?'\x20(profile:\x20'+_0x240c06+')':''));if(_0x240c06){const _0x5de8db={'site':_0x519dad};saveProfileToUserConfig(_0x240c06,_0x5de8db),console['log'](_0x398162(0x176)+_0x240c06+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x519dad),console['log'](_0x398162(0x148)+_0x519dad);const _0x4f847e=_0x240c06?_0x398162(0x16b)+_0x240c06:'';console[_0x398162(0x147)](),console[_0x398162(0x147)](_0x398162(0x17e)),console[_0x398162(0x147)]('\x20\x20tdx'+_0x4f847e+_0x398162(0x146)),console[_0x398162(0x147)](_0x398162(0x13d)+_0x4f847e+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases');}export async function promptAuthMethod(){const _0x4bbbda=a7_0x3626,_0x4f9296=await a7_0xdcac50({'type':_0x4bbbda(0x178),'name':'method','message':_0x4bbbda(0x161),'choices':[{'title':_0x4bbbda(0x162),'description':_0x4bbbda(0x172),'value':_0x4bbbda(0x14e)},{'title':_0x4bbbda(0x169),'description':_0x4bbbda(0x14c),'value':_0x4bbbda(0x145)}]});return _0x4f9296[_0x4bbbda(0x17b)]||null;}export class AuthSetupCommand extends BaseCommand{[a7_0x2ee1c5(0x179)]=a7_0x2ee1c5(0x13c);[a7_0x2ee1c5(0x17d)]=a7_0x2ee1c5(0x18a);async[a7_0x2ee1c5(0x173)](_0xe9cf2c){const _0x13cab7=a7_0x2ee1c5,{options:_0x20d98c}=_0xe9cf2c,_0x1b8f38=_0x20d98c[_0x13cab7(0x131)];console[_0x13cab7(0x147)](a7_0xac9fd5[_0x13cab7(0x137)](_0x13cab7(0x140)));const _0x43ace5=_0x20d98c[_0x13cab7(0x12e)]||_0x13cab7(0x181),_0x352be2=await promptSiteSelection(_0x43ace5,_0x1b8f38,_0x13cab7(0x186));if(!_0x352be2)return 0x1;const _0x5e57db=resolveSite(_0x352be2),_0x2d839b=await promptAuthMethod();if(!_0x2d839b)return console[_0x13cab7(0x147)](_0x13cab7(0x155)),0x1;if(_0x2d839b===_0x13cab7(0x14e)){const {accountName:_0x4932f1}=_0x20d98c;return await runOAuthLoginFlow(_0x5e57db,_0x1b8f38,_0x20d98c['logLevel']??LogLevel[_0x13cab7(0x144)],{'accountName':_0x4932f1}),0x0;}console['log']('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x5e57db),console['log'](_0x13cab7(0x164)),console[_0x13cab7(0x147)]('\x20\x20'+getConsoleUrl(_0x5e57db,_0x13cab7(0x171)));const _0x1549c9=await a7_0xdcac50({'type':'password','name':_0x13cab7(0x134),'message':_0x13cab7(0x156),'validate':_0x4b1212=>{if(!_0x4b1212||!_0x4b1212['trim']())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x1549c9['apiKey'])return console[_0x13cab7(0x147)](_0x13cab7(0x155)),0x1;const _0xba9b17=_0x1549c9[_0x13cab7(0x134)];console[_0x13cab7(0x147)]('Validating\x20API\x20key...');try{const _0x323b78=TDX[_0x13cab7(0x135)]({'site':_0x5e57db,'apiKey':_0xba9b17[_0x13cab7(0x14a)](),'logLevel':_0x20d98c['logLevel']??LogLevel['ERROR']}),_0xb05dc1=await _0x323b78[_0x13cab7(0x143)][_0x13cab7(0x16e)]();console[_0x13cab7(0x147)](_0x13cab7(0x18d)+_0xb05dc1[_0x13cab7(0x15f)]+')');const _0x29a190=await isKeychainAvailable();_0x29a190?(await saveAPIKeyAsync(_0xba9b17['trim'](),_0x5e57db,_0x1b8f38),console[_0x13cab7(0x147)](_0x13cab7(0x16d)+(_0x1b8f38?_0x13cab7(0x13a)+_0x1b8f38+')':''))):(console[_0x13cab7(0x17c)](a7_0xac9fd5[_0x13cab7(0x182)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console['warn'](a7_0xac9fd5[_0x13cab7(0x182)](_0x13cab7(0x170))));if(_0x1b8f38){const _0x2f924c={'site':_0x5e57db};saveProfileToUserConfig(_0x1b8f38,_0x2f924c),console[_0x13cab7(0x147)]('✓\x20Profile\x20\x27'+_0x1b8f38+_0x13cab7(0x138));}else saveDefaultSiteToUserConfig(_0x5e57db),console[_0x13cab7(0x147)]('✓\x20Default\x20site\x20set\x20to\x20'+_0x5e57db);const _0xd8401c=_0x1b8f38?_0x13cab7(0x16b)+_0x1b8f38:'';return console[_0x13cab7(0x147)](),console[_0x13cab7(0x147)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console['log'](_0x13cab7(0x13d)+_0xd8401c+_0x13cab7(0x146)),console[_0x13cab7(0x147)](_0x13cab7(0x13d)+_0xd8401c+_0x13cab7(0x15a)),0x0;}catch(_0x42f436){if(_0x42f436 instanceof HTTPClientError&&_0x42f436[_0x13cab7(0x174)]===0x191)return printAuthError(_0x42f436),0x1;return console[_0x13cab7(0x151)](a7_0xac9fd5[_0x13cab7(0x139)](_0x13cab7(0x14f)+(_0x42f436 instanceof Error?_0x42f436['message']:String(_0x42f436)))),console[_0x13cab7(0x151)](_0x13cab7(0x15c)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x2ee1c5(0x179)]='auth';[a7_0x2ee1c5(0x17d)]='Show\x20authentication\x20status\x20and\x20validate\x20API\x20key';async[a7_0x2ee1c5(0x173)](_0x3d261e){const _0x4dff8e=a7_0x2ee1c5,{options:_0x4c53de,tdx:_0x5ceabf}=_0x3d261e,_0x1ee36=_0x4c53de[_0x4dff8e(0x12e)],_0x5b4a35=_0x4c53de['profile'],_0x143a2f=_0x5b4a35?_0x5b4a35:_0x4dff8e(0x189);console[_0x4dff8e(0x147)](_0x4dff8e(0x13b)+_0x143a2f+_0x4dff8e(0x180)+_0x1ee36+')');const _0x1feaed=await getOAuthTokens(_0x5b4a35);if(_0x1feaed)console['log'](_0x4dff8e(0x12c)),console[_0x4dff8e(0x147)](_0x4dff8e(0x12b)+(_0x5b4a35?_0x4dff8e(0x13a)+_0x5b4a35+')':''));else{const _0x37ba70=await resolveAPIKeyAsync(_0x1ee36,_0x5b4a35);if(_0x37ba70){const {source:_0x4979ea,isDeprecated:_0x14aab6}=_0x37ba70,_0x9c5d7b=_0x4dff8e(0x154)+_0x4979ea;console[_0x4dff8e(0x147)](_0x14aab6?a7_0xac9fd5[_0x4dff8e(0x182)](_0x9c5d7b):_0x9c5d7b);}else console[_0x4dff8e(0x147)](a7_0xac9fd5[_0x4dff8e(0x182)](_0x4dff8e(0x12d)));}try{const _0x464dc0=await _0x5ceabf[_0x4dff8e(0x143)]['getUserInfo']();return console[_0x4dff8e(0x147)](a7_0xac9fd5[_0x4dff8e(0x15e)](_0x4dff8e(0x160))),console[_0x4dff8e(0x147)](_0x4dff8e(0x18c)+_0x464dc0[_0x4dff8e(0x15f)]),(_0x464dc0[_0x4dff8e(0x152)]||_0x464dc0['last_name'])&&console['log'](_0x4dff8e(0x157)+[_0x464dc0[_0x4dff8e(0x152)],_0x464dc0[_0x4dff8e(0x165)]]['filter'](Boolean)['join']('\x20')),0x0;}catch(_0x4ef1f5){return _0x4ef1f5 instanceof HTTPClientError&&_0x4ef1f5['status']===0x191?printAuthError(_0x4ef1f5,!![],_0x5b4a35):console[_0x4dff8e(0x151)](a7_0xac9fd5[_0x4dff8e(0x139)](_0x4dff8e(0x14f)+(_0x4ef1f5 instanceof Error?_0x4ef1f5['message']:String(_0x4ef1f5)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x2ee1c5(0x179)]=a7_0x2ee1c5(0x187);[a7_0x2ee1c5(0x17d)]='Remove\x20API\x20key\x20from\x20system\x20keychain';async[a7_0x2ee1c5(0x173)](_0x2be62f){const _0x4a00e3=a7_0x2ee1c5,{options:_0x63a7e1}=_0x2be62f,_0x294e23=_0x63a7e1[_0x4a00e3(0x131)];console['log'](a7_0xac9fd5[_0x4a00e3(0x137)]('tdx:\x20auth\x20clear'));const _0x16ddcb=await isKeychainAvailable();if(!_0x16ddcb)return console['error'](a7_0xac9fd5[_0x4a00e3(0x139)](_0x4a00e3(0x177))),0x1;const [_0x2e3ab2,_0x47fa5e]=await Promise[_0x4a00e3(0x150)]([deleteKeychainAPIKey(_0x294e23),deleteOAuthTokens(_0x294e23)]);if(_0x2e3ab2||_0x47fa5e){clearCredentialCache();const _0x3c49de=[_0x2e3ab2&&'API\x20key',_0x47fa5e&&_0x4a00e3(0x185)][_0x4a00e3(0x149)](Boolean)[_0x4a00e3(0x158)]('\x20and\x20');return console[_0x4a00e3(0x147)]('✓\x20'+_0x3c49de+_0x4a00e3(0x167)+(_0x294e23?'\x20(profile:\x20'+_0x294e23+')':'')),0x0;}else return console[_0x4a00e3(0x147)](_0x4a00e3(0x183)+(_0x294e23?_0x4a00e3(0x15d)+_0x294e23:'')),0x1;}}
|