@treasuredata/tdx 2026.4.16 → 2026.4.18
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.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +17 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a3_0x22f3(){const _0xc5b6b2=['9fNyBuA','6lrgEMh','Error:\x20Segment\x20name\x20is\x20required','Error:\x20','error','✔\x20Found\x20','\x20activation','listActivations','112090XNlPnY','verbose','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','Resolved\x20parent\x20ID:\x20','description','resolveSegmentId','execute','length','activations','2429285eRoHoD','351838wYhRtv','resolveParentId','Child\x20name:\x20','Parent\x20name:\x20','54EkDPOy','4413400XITNyD','data','Listing\x20activations\x20for\x20segment\x20\x27','\x20\x20Cause:\x20','210204wFMOqS','\x27...','Site:\x20','Resolved\x20child\x20ID:\x20','segment','Resolving\x20child\x20segment\x20\x27','4irTCYz','site','72310eZQaPP','Resolving\x20parent\x20segment\x20\x27','894920NuHdFL','11viXNOC','message','cause'];a3_0x22f3=function(){return _0xc5b6b2;};return a3_0x22f3();}const a3_0x3547fc=a3_0x57ab;function a3_0x57ab(_0x551815,_0x355cb2){_0x551815=_0x551815-0xf0;const _0x22f338=a3_0x22f3();let _0x57ab5b=_0x22f338[_0x551815];return _0x57ab5b;}(function(_0x4b618a,_0x34d216){const _0x491a88=a3_0x57ab,_0x3ce833=_0x4b618a();while(!![]){try{const _0x6a7b34=-parseInt(_0x491a88(0xf6))/0x1+parseInt(_0x491a88(0x100))/0x2*(-parseInt(_0x491a88(0x118))/0x3)+-parseInt(_0x491a88(0x10f))/0x4*(-parseInt(_0x491a88(0xff))/0x5)+-parseInt(_0x491a88(0x104))/0x6*(parseInt(_0x491a88(0x111))/0x7)+parseInt(_0x491a88(0x105))/0x8+-parseInt(_0x491a88(0x117))/0x9*(parseInt(_0x491a88(0x113))/0xa)+-parseInt(_0x491a88(0x114))/0xb*(parseInt(_0x491a88(0x109))/0xc);if(_0x6a7b34===_0x34d216)break;else _0x3ce833['push'](_0x3ce833['shift']());}catch(_0x34e0a9){_0x3ce833['push'](_0x3ce833['shift']());}}}(a3_0x22f3,0x5b379));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{['name']=a3_0x3547fc(0xfe);[a3_0x3547fc(0xfa)]='List\x20activations\x20for\x20a\x20segment';async[a3_0x3547fc(0xfc)](_0x1bd7e4){const _0x3daa55=a3_0x3547fc,{options:_0x3e267e,args:_0x21de48,tdx:_0x42e2b2}=_0x1bd7e4;if(_0x21de48[_0x3daa55(0xfd)]===0x0)return console[_0x3daa55(0xf2)](_0x3daa55(0xf0)),console[_0x3daa55(0xf2)](_0x3daa55(0xf8)),0x1;try{const {parentId:_0x1d3c5b,childId:_0x569cd9}=parseSegmentRef(_0x21de48[0x0]);if(!_0x569cd9)return console['error']('Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations'),console[_0x3daa55(0xf2)](_0x3daa55(0xf8)),0x1;_0x3e267e['verbose']&&(console[_0x3daa55(0xf2)](_0x3daa55(0x10b)+_0x3e267e[_0x3daa55(0x110)]),console[_0x3daa55(0xf2)](_0x3daa55(0x103)+_0x1d3c5b),console[_0x3daa55(0xf2)](_0x3daa55(0x102)+_0x569cd9));const _0x266727=await withSpinner(_0x3daa55(0x112)+_0x1d3c5b+'\x27...',()=>_0x42e2b2[_0x3daa55(0x10d)][_0x3daa55(0x101)](_0x1d3c5b),{'verbose':_0x3e267e[_0x3daa55(0xf7)]}),_0x193d15=_0x266727[_0x3daa55(0x106)];_0x3e267e[_0x3daa55(0xf7)]&&console[_0x3daa55(0xf2)](_0x3daa55(0xf9)+_0x193d15);const _0x59832a=await withSpinner(_0x3daa55(0x10e)+_0x569cd9+_0x3daa55(0x10a),()=>_0x42e2b2['segment'][_0x3daa55(0xfb)](_0x193d15,_0x569cd9),{'verbose':_0x3e267e[_0x3daa55(0xf7)]}),_0x54a5ed=_0x59832a['data'];_0x3e267e['verbose']&&console[_0x3daa55(0xf2)](_0x3daa55(0x10c)+_0x54a5ed);const _0x5ba595=await withSpinner(_0x3daa55(0x107)+_0x569cd9+_0x3daa55(0x10a),()=>_0x42e2b2[_0x3daa55(0x10d)][_0x3daa55(0xf5)](_0x193d15,_0x54a5ed),{'verbose':_0x3e267e[_0x3daa55(0xf7)]}),_0x1e135f=_0x5ba595[_0x3daa55(0x106)];return console[_0x3daa55(0xf2)](_0x3daa55(0xf3)+_0x1e135f[_0x3daa55(0xfd)]+_0x3daa55(0xf4)+(_0x1e135f[_0x3daa55(0xfd)]!==0x1?'s':'')),await handleSDKOutput(_0x1e135f,_0x3e267e),0x0;}catch(_0x1054df){if(_0x1054df instanceof SDKError)return console[_0x3daa55(0xf2)](_0x3daa55(0xf1)+_0x1054df[_0x3daa55(0x115)]),_0x1054df[_0x3daa55(0x116)]&&console[_0x3daa55(0xf2)](_0x3daa55(0x108)+_0x1054df[_0x3daa55(0x116)]),0x1;throw _0x1054df;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x55f474=a4_0xfe3d;(function(_0x3c5efb,_0x5e2166){const _0x28d61c=a4_0xfe3d,_0x1ce697=_0x3c5efb();while(!![]){try{const _0x1b5f8c=-parseInt(_0x28d61c(0x192))/0x1*(parseInt(_0x28d61c(0x11b))/0x2)+-parseInt(_0x28d61c(0x10c))/0x3*(-parseInt(_0x28d61c(0x136))/0x4)+parseInt(_0x28d61c(0x170))/0x5*(-parseInt(_0x28d61c(0x142))/0x6)+-parseInt(_0x28d61c(0x14a))/0x7+-parseInt(_0x28d61c(0x182))/0x8*(-parseInt(_0x28d61c(0x12a))/0x9)+parseInt(_0x28d61c(0x14e))/0xa*(parseInt(_0x28d61c(0x10e))/0xb)+parseInt(_0x28d61c(0x1a0))/0xc*(parseInt(_0x28d61c(0x1aa))/0xd);if(_0x1b5f8c===_0x5e2166)break;else _0x1ce697['push'](_0x1ce697['shift']());}catch(_0x220d75){_0x1ce697['push'](_0x1ce697['shift']());}}}(a4_0x141f,0x62e2a));import a4_0x52269a from'chalk';function a4_0xfe3d(_0x549e07,_0x1f89d5){_0x549e07=_0x549e07-0xf9;const _0x141f0c=a4_0x141f();let _0xfe3ddf=_0x141f0c[_0x549e07];return _0xfe3ddf;}import a4_0x644d9b from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x2873d8){const _0xeaa7f7=a4_0xfe3d,_0x25da73=[];if(_0x2873d8[_0xeaa7f7(0x1a1)]!==undefined)_0x25da73[_0xeaa7f7(0x1b3)](_0x2873d8[_0xeaa7f7(0x1a1)]+_0xeaa7f7(0x17d));if(_0x2873d8[_0xeaa7f7(0x1b6)]!==undefined&&_0x2873d8['new']>0x0)_0x25da73[_0xeaa7f7(0x1b3)](a4_0x52269a['green'](_0x2873d8[_0xeaa7f7(0x1b6)]+'\x20new'));if(_0x2873d8['created']!==undefined&&_0x2873d8[_0xeaa7f7(0x14d)]>0x0)_0x25da73['push'](a4_0x52269a[_0xeaa7f7(0x198)](_0x2873d8[_0xeaa7f7(0x14d)]+_0xeaa7f7(0x145)));if(_0x2873d8['updated']!==undefined&&_0x2873d8[_0xeaa7f7(0x1b0)]>0x0)_0x25da73[_0xeaa7f7(0x1b3)](a4_0x52269a[_0xeaa7f7(0x193)](_0x2873d8['updated']+_0xeaa7f7(0x109)));if(_0x2873d8['unchanged']!==undefined&&_0x2873d8[_0xeaa7f7(0x18b)]>0x0)_0x25da73[_0xeaa7f7(0x1b3)](a4_0x52269a[_0xeaa7f7(0x111)](_0x2873d8[_0xeaa7f7(0x18b)]+_0xeaa7f7(0x124)));if(_0x2873d8['errors']!==undefined&&_0x2873d8['errors']>0x0)_0x25da73[_0xeaa7f7(0x1b3)](a4_0x52269a[_0xeaa7f7(0x156)](_0x2873d8[_0xeaa7f7(0x16e)]+_0xeaa7f7(0x18d)));return _0x25da73[_0xeaa7f7(0x104)](',\x20');}function displayDiffs(_0x3a75b7,_0xd0fb22,_0x256c8f,_0x7c40b,_0x24e303,_0x153565,_0x31bc06,_0x3c79ba,_0x262f4c){const _0x273ea9=a4_0xfe3d;for(const _0x3af6e2 of _0x3a75b7){if(_0x3af6e2[_0x273ea9(0x13d)]){const _0xba918a=_0x3af6e2[_0x273ea9(0x127)]||_0x3af6e2[_0x273ea9(0x15c)];console[_0x273ea9(0x1c0)](_0x273ea9(0x1a8)+_0xba918a+'\x27:'),console[_0x273ea9(0x1c0)]('─'[_0x273ea9(0x1b4)](0x3c)),console[_0x273ea9(0x1c0)](_0x3af6e2[_0x273ea9(0x13d)]),console[_0x273ea9(0x1c0)]('─'[_0x273ea9(0x1b4)](0x3c));}}for(const _0x13e813 of _0xd0fb22){_0x13e813[_0x273ea9(0x13d)]&&(console[_0x273ea9(0x1c0)](_0x273ea9(0xfe)+_0x13e813[_0x273ea9(0x15c)]+'\x27:'),console[_0x273ea9(0x1c0)]('─'[_0x273ea9(0x1b4)](0x3c)),console['log'](_0x13e813[_0x273ea9(0x13d)]),console[_0x273ea9(0x1c0)]('─'[_0x273ea9(0x1b4)](0x3c)));}for(const _0x5f194b of _0x256c8f){_0x5f194b['diff']&&(console[_0x273ea9(0x1c0)](_0x273ea9(0x175)+_0x5f194b[_0x273ea9(0x15c)]+'\x27:'),console[_0x273ea9(0x1c0)]('─'[_0x273ea9(0x1b4)](0x3c)),console[_0x273ea9(0x1c0)](_0x5f194b[_0x273ea9(0x13d)]),console[_0x273ea9(0x1c0)]('─'[_0x273ea9(0x1b4)](0x3c)));}for(const _0x5ce972 of _0x7c40b){_0x5ce972[_0x273ea9(0x13d)]&&(console[_0x273ea9(0x1c0)](_0x273ea9(0x12e)+_0x5ce972[_0x273ea9(0x15c)]+'\x27:'),console[_0x273ea9(0x1c0)]('─'['repeat'](0x3c)),console['log'](_0x5ce972[_0x273ea9(0x13d)]),console[_0x273ea9(0x1c0)]('─'[_0x273ea9(0x1b4)](0x3c)));}for(const _0x2f2a97 of _0x24e303){_0x2f2a97[_0x273ea9(0x13d)]&&(console[_0x273ea9(0x1c0)](_0x273ea9(0x168)+_0x2f2a97[_0x273ea9(0x15c)]+'\x27:'),console[_0x273ea9(0x1c0)]('─'[_0x273ea9(0x1b4)](0x3c)),console[_0x273ea9(0x1c0)](_0x2f2a97[_0x273ea9(0x13d)]),console[_0x273ea9(0x1c0)]('─'[_0x273ea9(0x1b4)](0x3c)));}for(const _0x2df677 of _0x153565){_0x2df677[_0x273ea9(0x13d)]&&(console[_0x273ea9(0x1c0)](_0x273ea9(0x179)+_0x2df677[_0x273ea9(0x15c)]+'\x27:'),console[_0x273ea9(0x1c0)]('─'['repeat'](0x3c)),console[_0x273ea9(0x1c0)](_0x2df677[_0x273ea9(0x13d)]),console[_0x273ea9(0x1c0)]('─'['repeat'](0x3c)));}for(const _0x21d7c7 of _0x31bc06){_0x21d7c7[_0x273ea9(0x13d)]&&(console['log'](_0x273ea9(0x1c2)+_0x21d7c7[_0x273ea9(0x15c)]+'\x27:'),console['log']('─'[_0x273ea9(0x1b4)](0x3c)),console[_0x273ea9(0x1c0)](_0x21d7c7['diff']),console['log']('─'['repeat'](0x3c)));}for(const _0x58d545 of _0x3c79ba){_0x58d545[_0x273ea9(0x13d)]&&(console[_0x273ea9(0x1c0)](_0x273ea9(0x191)+_0x58d545[_0x273ea9(0x15c)]+'\x27:'),console[_0x273ea9(0x1c0)]('─'['repeat'](0x3c)),console[_0x273ea9(0x1c0)](_0x58d545['diff']),console[_0x273ea9(0x1c0)]('─'[_0x273ea9(0x1b4)](0x3c)));}for(const _0x47b767 of _0x262f4c){_0x47b767['diff']&&(console['log'](_0x273ea9(0x18a)+_0x47b767['name']+'\x27:'),console[_0x273ea9(0x1c0)]('─'[_0x273ea9(0x1b4)](0x3c)),console[_0x273ea9(0x1c0)](_0x47b767['diff']),console[_0x273ea9(0x1c0)]('─'['repeat'](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x55f474(0x15c)]=a4_0x55f474(0x113);[a4_0x55f474(0x13c)]=a4_0x55f474(0x172);async[a4_0x55f474(0x15f)](_0x3275b9){const _0x2ea26c=a4_0x55f474,{options:_0x5d698d,args:_0x4b23ef,tdx:_0x8ddaf3}=_0x3275b9,_0x374071=_0x4b23ef[0x0],_0x3018da=_0x4b23ef[0x1],_0x3e4b61=_0x5d698d['output'],_0xd23e73=_0x5d698d[_0x2ea26c(0x14c)],_0x169cbb=_0x5d698d[_0x2ea26c(0x13a)],_0x1d5f6c=_0x5d698d[_0x2ea26c(0x10f)],_0xbb4b45=_0x5d698d[_0x2ea26c(0x122)],_0x3511cd=_0x5d698d[_0x2ea26c(0x165)];let _0x35ca0b;if(_0x374071){const _0x3f6e83=a4_0x644d9b[_0x2ea26c(0x104)](_0x374071,_0x2ea26c(0x123));if(existsSync(_0x3f6e83))try{const _0x11a9c8=JSON[_0x2ea26c(0x141)](readFileSync(_0x3f6e83,'utf-8'));_0x11a9c8['llm_project']&&(_0x35ca0b={'llm_project':_0x11a9c8['llm_project']});}catch{}}const _0x30d465=findAgentConfigPath(process[_0x2ea26c(0x1b5)]());let _0x288f50;if(_0x30d465)try{const _0x21af9f=JSON[_0x2ea26c(0x141)](readFileSync(_0x30d465,_0x2ea26c(0x18c)));_0x21af9f[_0x2ea26c(0x14f)]&&(_0x288f50={'llm_project':_0x21af9f['llm_project']});}catch{}const _0x5b6b24=resolveAgentPullArgs({'arg':_0x374071,'agentNameArg':_0x3018da,'agentFlag':_0x3511cd,'contextProject':_0xbb4b45,'argDirConfig':_0x35ca0b,'cwdConfigPath':_0x30d465||undefined,'cwdConfig':_0x288f50}),{projectNameOrId:_0x3021fb,targetAgentName:_0x3d8e41,existingOutputDir:_0xa3374e,source:_0x3f973c}=_0x5b6b24;if(_0x3f973c===_0x2ea26c(0x1b9))console[_0x2ea26c(0x1c0)](a4_0x52269a['dim'](_0x2ea26c(0x154)+a4_0x644d9b[_0x2ea26c(0x104)](_0x374071,_0x2ea26c(0x123))+':\x20'+_0x3021fb));else{if(_0x3f973c==='cwd-config')console['log'](a4_0x52269a['dim'](_0x2ea26c(0x151)+_0x3021fb));else _0x3f973c==='context'&&console[_0x2ea26c(0x1c0)](a4_0x52269a['dim'](_0x2ea26c(0x19e)+_0x3021fb));}if(!_0x3021fb)return _0x3511cd?(console['log'](a4_0x52269a[_0x2ea26c(0x193)](_0x2ea26c(0x15b))),console[_0x2ea26c(0x1c0)](_0x2ea26c(0x183)),console['log'](_0x2ea26c(0x1b8))):(console[_0x2ea26c(0x1c0)](a4_0x52269a[_0x2ea26c(0x193)](_0x2ea26c(0xf9))),console[_0x2ea26c(0x1c0)](_0x2ea26c(0x19f)),console['log'](_0x2ea26c(0x12d)),console[_0x2ea26c(0x1c0)](_0x2ea26c(0x16b)),console['log'](_0x2ea26c(0x148)),console['log']('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project')),0x1;if(_0x3d8e41){const {data:_0x4e2016}=await withSpinner(_0x2ea26c(0x13e)+_0x3d8e41+_0x2ea26c(0x1b1)+_0x3021fb+_0x2ea26c(0xfb),()=>_0x8ddaf3[_0x2ea26c(0x1af)][_0x2ea26c(0x1b7)](_0x3021fb,_0x3d8e41,_0x3e4b61,{'dryRun':_0xd23e73,'force':_0x169cbb}));if(_0xd23e73)return console[_0x2ea26c(0x1c0)](a4_0x52269a[_0x2ea26c(0x193)](_0x2ea26c(0x139))),console[_0x2ea26c(0x1c0)](_0x2ea26c(0x1a7)+_0x4e2016[_0x2ea26c(0x127)]),console['log'](_0x2ea26c(0x108)+_0x4e2016[_0x2ea26c(0x184)]),_0x4e2016[_0x2ea26c(0x13d)]&&(console[_0x2ea26c(0x1c0)]('\x0aChanges:'),console[_0x2ea26c(0x1c0)]('─'[_0x2ea26c(0x1b4)](0x3c)),console[_0x2ea26c(0x1c0)](_0x4e2016[_0x2ea26c(0x13d)]),console[_0x2ea26c(0x1c0)]('─'['repeat'](0x3c))),0x0;return console['log'](a4_0x52269a[_0x2ea26c(0x198)](_0x2ea26c(0x15a))),console['log'](_0x2ea26c(0x144)+_0x4e2016['agentName']),console[_0x2ea26c(0x1c0)](_0x2ea26c(0x18e)+_0x4e2016['outputPath']),console[_0x2ea26c(0x1c0)]('Status:\x20'+(_0x4e2016['isNew']?a4_0x52269a[_0x2ea26c(0x198)](_0x2ea26c(0x1b6)):_0x4e2016[_0x2ea26c(0x199)]?a4_0x52269a[_0x2ea26c(0x193)](_0x2ea26c(0x1b0)):a4_0x52269a[_0x2ea26c(0x111)](_0x2ea26c(0x18b)))),0x0;}const _0x53d569=_0xa3374e||_0x3e4b61,{data:_0x455336}=await withSpinner('Analyzing\x20project\x20\x22'+_0x3021fb+'\x22...',()=>_0x8ddaf3[_0x2ea26c(0x1af)]['pullProject'](_0x3021fb,_0x53d569,{'dryRun':!![]})),_0x100730=_0x455336[_0x2ea26c(0x194)]['agents']['new']+_0x455336['counts'][_0x2ea26c(0x153)][_0x2ea26c(0x1b6)]+_0x455336[_0x2ea26c(0x194)][_0x2ea26c(0x1bd)][_0x2ea26c(0x1b6)]+_0x455336[_0x2ea26c(0x194)][_0x2ea26c(0x177)][_0x2ea26c(0x1b6)]+_0x455336[_0x2ea26c(0x194)][_0x2ea26c(0x171)][_0x2ea26c(0x1b6)]+_0x455336[_0x2ea26c(0x194)][_0x2ea26c(0x125)][_0x2ea26c(0x1b6)]+_0x455336[_0x2ea26c(0x194)]['experimentalArtifacts'][_0x2ea26c(0x1b6)]+_0x455336[_0x2ea26c(0x194)][_0x2ea26c(0x126)][_0x2ea26c(0x1b6)]+_0x455336[_0x2ea26c(0x194)][_0x2ea26c(0x135)][_0x2ea26c(0x1b6)],_0x6a1f33=_0x455336[_0x2ea26c(0x194)][_0x2ea26c(0x169)][_0x2ea26c(0x1b0)]+_0x455336['counts']['knowledgeBases'][_0x2ea26c(0x1b0)]+_0x455336[_0x2ea26c(0x194)][_0x2ea26c(0x1bd)][_0x2ea26c(0x1b0)]+_0x455336[_0x2ea26c(0x194)]['prompts'][_0x2ea26c(0x1b0)]+_0x455336[_0x2ea26c(0x194)][_0x2ea26c(0x171)][_0x2ea26c(0x1b0)]+_0x455336[_0x2ea26c(0x194)]['experimentalKnowledgeBases'][_0x2ea26c(0x1b0)]+_0x455336[_0x2ea26c(0x194)][_0x2ea26c(0x116)][_0x2ea26c(0x1b0)]+_0x455336[_0x2ea26c(0x194)][_0x2ea26c(0x126)][_0x2ea26c(0x1b0)]+_0x455336[_0x2ea26c(0x194)][_0x2ea26c(0x135)][_0x2ea26c(0x1b0)],_0x270e00=_0x455336['counts'][_0x2ea26c(0x169)][_0x2ea26c(0x18b)]+_0x455336['counts'][_0x2ea26c(0x153)][_0x2ea26c(0x18b)]+_0x455336[_0x2ea26c(0x194)][_0x2ea26c(0x1bd)][_0x2ea26c(0x18b)]+_0x455336[_0x2ea26c(0x194)][_0x2ea26c(0x177)][_0x2ea26c(0x18b)]+_0x455336[_0x2ea26c(0x194)][_0x2ea26c(0x171)]['unchanged']+_0x455336[_0x2ea26c(0x194)][_0x2ea26c(0x125)][_0x2ea26c(0x18b)]+_0x455336[_0x2ea26c(0x194)][_0x2ea26c(0x116)][_0x2ea26c(0x18b)]+_0x455336[_0x2ea26c(0x194)][_0x2ea26c(0x126)][_0x2ea26c(0x18b)]+_0x455336[_0x2ea26c(0x194)][_0x2ea26c(0x135)]['unchanged'];console[_0x2ea26c(0x1c0)](_0x2ea26c(0x19a)+_0x455336['projectName']+'\x27:'),console['log']('\x20\x20'+a4_0x52269a[_0x2ea26c(0x198)]('+\x20'+_0x100730+_0x2ea26c(0x159))+_0x2ea26c(0x11e)+a4_0x52269a['yellow']('~\x20'+_0x6a1f33+_0x2ea26c(0x1a4))+'\x20|\x20'+a4_0x52269a[_0x2ea26c(0x17e)]('=\x20'+_0x270e00+'\x20unchanged')),console[_0x2ea26c(0x1c0)](_0x2ea26c(0x1a6)+formatCountSummary(_0x455336[_0x2ea26c(0x194)][_0x2ea26c(0x169)])),console[_0x2ea26c(0x1c0)](_0x2ea26c(0x16c)+formatCountSummary(_0x455336['counts'][_0x2ea26c(0x153)])),console[_0x2ea26c(0x1c0)](_0x2ea26c(0x150)+formatCountSummary(_0x455336[_0x2ea26c(0x194)][_0x2ea26c(0x1bd)])),console[_0x2ea26c(0x1c0)](_0x2ea26c(0x149)+formatCountSummary(_0x455336['counts'][_0x2ea26c(0x177)])),console[_0x2ea26c(0x1c0)](_0x2ea26c(0x14b)+formatCountSummary(_0x455336[_0x2ea26c(0x194)]['integrations'])),console[_0x2ea26c(0x1c0)](_0x2ea26c(0x197)+formatCountSummary(_0x455336[_0x2ea26c(0x194)][_0x2ea26c(0x126)])),console['log'](_0x2ea26c(0x121)+formatCountSummary(_0x455336['counts'][_0x2ea26c(0x135)]));const _0x167e00=_0x455336[_0x2ea26c(0x194)][_0x2ea26c(0x125)][_0x2ea26c(0x1a1)]>0x0||_0x455336['counts'][_0x2ea26c(0x116)][_0x2ea26c(0x1a1)]>0x0;_0x167e00&&(console[_0x2ea26c(0x1c0)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x455336[_0x2ea26c(0x194)][_0x2ea26c(0x125)])),console[_0x2ea26c(0x1c0)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x455336[_0x2ea26c(0x194)][_0x2ea26c(0x116)])));console['log']('\x20\x20Target:\x20'+a4_0x52269a[_0x2ea26c(0x160)](_0x455336[_0x2ea26c(0x15d)])),displayDiffs(_0x455336[_0x2ea26c(0x169)],_0x455336[_0x2ea26c(0x153)],_0x455336[_0x2ea26c(0x1bd)],_0x455336['prompts'],_0x455336[_0x2ea26c(0x171)],_0x455336[_0x2ea26c(0x125)],_0x455336[_0x2ea26c(0x116)],_0x455336[_0x2ea26c(0x126)],_0x455336[_0x2ea26c(0x135)]);if(_0xd23e73)return console[_0x2ea26c(0x1c0)](a4_0x52269a[_0x2ea26c(0x193)](_0x2ea26c(0x1a9))),0x0;if(_0x100730===0x0&&_0x6a1f33===0x0)return console[_0x2ea26c(0x1c0)](a4_0x52269a['green'](_0x2ea26c(0x140))),saveSessionContext({'llm_project':_0x455336['projectName']},_0x5d698d[_0x2ea26c(0x1bc)]),console[_0x2ea26c(0x1c0)](a4_0x52269a[_0x2ea26c(0x198)]('✔\x20Context\x20set:\x20'+a4_0x52269a[_0x2ea26c(0x17e)](_0x2ea26c(0x14f))+_0x2ea26c(0x101)+a4_0x52269a['cyan'](_0x455336[_0x2ea26c(0xfa)]))),0x0;if(!_0x1d5f6c&&!_0x169cbb){if(!isInteractive())return console[_0x2ea26c(0x1ab)](a4_0x52269a['red'](_0x2ea26c(0x11d)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x2ea26c(0x1ab)](a4_0x52269a[_0x2ea26c(0x17e)](_0x2ea26c(0x119))),0x1;const _0x411daa=await confirmKey(_0x2ea26c(0x132)+(_0x100730+_0x6a1f33)+_0x2ea26c(0x1be));if(!_0x411daa)return console[_0x2ea26c(0x1c0)](a4_0x52269a[_0x2ea26c(0x193)](_0x2ea26c(0x1b2)),_0x2ea26c(0x1ba)),0x1;}const {data:_0x26153b}=await withSpinner(_0x2ea26c(0x19c),()=>_0x8ddaf3[_0x2ea26c(0x1af)][_0x2ea26c(0x128)](_0x3021fb,_0x53d569,{'force':_0x169cbb}));return console[_0x2ea26c(0x1c0)](a4_0x52269a[_0x2ea26c(0x198)]('\x0a✔\x20Pulled\x20'+(_0x100730+_0x6a1f33)+_0x2ea26c(0x12b)+_0x26153b[_0x2ea26c(0x15d)])),saveSessionContext({'llm_project':_0x26153b[_0x2ea26c(0xfa)]},_0x5d698d[_0x2ea26c(0x1bc)]),console[_0x2ea26c(0x1c0)](a4_0x52269a[_0x2ea26c(0x198)](_0x2ea26c(0x105)+a4_0x52269a[_0x2ea26c(0x17e)]('llm_project')+_0x2ea26c(0x101)+a4_0x52269a[_0x2ea26c(0x160)](_0x26153b[_0x2ea26c(0xfa)]))),0x0;}}function a4_0x141f(){const _0x3f50f7=['pushProject','Dry\x20run\x20-\x20no\x20changes\x20made','\x0aChanges\x20to\x20chat\x20interface\x20\x27','unchanged','utf-8','\x20errors','Output:\x20','\x22:\x20','\x0aProject\x20pushed\x20with\x20errors','\x0aChanges\x20to\x20form\x20interface\x20\x27','178tOGVhh','yellow','counts','\x20resources?','Would\x20push\x20agent:\x20','\x20\x20Form\x20Interfaces:\x20','green','hasChanges','\x0aPull\x20summary\x20for\x20\x27','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','Writing\x20files...','\x20\x20Prompt\x20\x22','Using\x20project\x20from\x20context:\x20','Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','18444JiiIzy','total','\x20\x20Text\x20Knowledge\x20Base\x20\x22','Chat:\x20','\x20changed','\x20\x20Source:\x20','\x20\x20Agents:\x20','Would\x20pull\x20agent:\x20','\x0aChanges\x20to\x20agent\x20\x27','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','8346RmOQzP','error','Cloning\x20\x22','Project:\x20','cloneProject','llm','updated','\x22\x20from\x20project\x20\x22','Cancelled','push','repeat','cwd','new','pullAgent','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','arg-dir','-\x20no\x20files\x20written','\x20successfully','session','textKnowledgeBases','\x20files?','projectDir','log','\x20--profile\x20','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','projectName','\x22...','Cannot\x20clone\x20from\x20context\x20project\x20\x22','\x20\x20Chat\x20Interface\x20\x22','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','New\x20project\x20name\x20is\x20required','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\x20=\x20','Clone\x20\x22','\x27\x20to\x20create\x20the\x20folder\x20structure.','join','✔\x20Context\x20set:\x20','\x22\x20to\x20new\x20project\x20\x22','Errors:','Output\x20path:\x20','\x20updated','Using\x20context\x20project:\x20','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','3wlJNvM','Analyzing\x20changes\x20to\x20push...','22mebYqC','yes','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','gray','\x20\x20tdx\x20agent\x20pull\x20','agent:pull','Failed\x20to\x20push\x20agent:\x20','Pushing\x20to\x20project...','experimentalArtifacts','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20resources\x20to\x20\x27','462VmQxhQ','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','\x0aError:','\x20|\x20','agent:push','site','\x20\x20Chat\x20Interfaces:\x20','llmProject','tdx.json','\x20unchanged','experimentalKnowledgeBases','formInterfaces','agentName','pullProject','agentId','6435dkntDW','\x20files\x20to\x20','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\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','\x0aChanges\x20to\x20prompt\x20\x27','dirname','New\x20project:\x20','\x20\x20Agent\x20\x22','\x0aWrite\x20','\x20\x20Form\x20Interface\x20\x22','INVALID_ARGUMENT','chatInterfaces','894048NeuGkp','\x20\x20Experimental\x20Artifact\x20\x22','Using\x20local\x20project:\x20','Dry\x20run\x20-\x20no\x20files\x20written','force','New\x20project\x20ID:\x20','description','diff','Pulling\x20agent\x20\x22','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','parse','197004ODySAU','projectId','Agent:\x20','\x20created','\x20\x20Experimental\x20Artifacts:\x20','sourceProjectName','\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\x20Prompts:\x20','5625725jHbvLq','\x20\x20Integrations:\x20','dryRun','created','124840pvAlpq','llm_project','\x20\x20Text\x20Knowledge\x20Bases:\x20','Using\x20project:\x20','Source:\x20','knowledgeBases','Using\x20project\x20from\x20','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','red','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','Pushing\x20agent\x20from\x20\x22','\x20new','Agent\x20pulled\x20successfully','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','name','outputDir','action','execute','cyan','message','Summary:','\x20\x20Integration\x20\x22','context','agent','reason','newProjectName','\x0aChanges\x20to\x20integration\x20\x27','agents','No\x20tdx.json\x20found\x20in\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','\x20\x20Knowledge\x20Bases:\x20','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','errors','\x0aErrors\x20found:','90vVUPYn','integrations','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','newProjectId','agent.yml','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x20--name\x20','prompts','Agent\x20','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x20\x20Knowledge\x20Base\x20\x22','\x0a✔\x20Pushed\x20','\x22\x20to\x20\x22','\x20total','dim','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x0aPush\x20summary\x20for\x20\x27','Would\x20clone:','6776sDlhnw','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','outputPath','no_context','Project\x20cloned\x20with\x20errors','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed'];a4_0x141f=function(){return _0x3f50f7;};return a4_0x141f();}export class AgentCloneCommand extends BaseCommand{[a4_0x55f474(0x15c)]='agent:clone';[a4_0x55f474(0x13c)]=a4_0x55f474(0x157);async['execute'](_0x543903){const _0x22380c=a4_0x55f474,{options:_0x483b0b,args:_0x26f37d,tdx:_0x106fc7}=_0x543903,_0x1b37ad=_0x26f37d[0x0],_0x5a93d9=_0x483b0b[_0x22380c(0x15c)],_0x17271a=_0x483b0b[_0x22380c(0x14c)],_0x41c2c3=_0x483b0b[_0x22380c(0x10f)],_0x3f68a4=_0x483b0b[_0x22380c(0x120)],_0x324311=_0x483b0b[_0x22380c(0x122)];let _0x52616d;const _0x17d5d0=findAgentConfigPath(process[_0x22380c(0x1b5)]());if(_0x1b37ad){const _0x196cef=a4_0x644d9b['join'](_0x1b37ad,'tdx.json');existsSync(_0x196cef)?(_0x52616d=_0x1b37ad,console[_0x22380c(0x1c0)](a4_0x52269a[_0x22380c(0x17e)](_0x22380c(0x138)+_0x1b37ad))):_0x52616d=_0x1b37ad;}else{if(_0x17d5d0)_0x52616d=a4_0x644d9b[_0x22380c(0x12f)](_0x17d5d0),console[_0x22380c(0x1c0)](a4_0x52269a[_0x22380c(0x17e)]('Using\x20current\x20project:\x20'+_0x52616d));else{if(_0x324311){const _0x44ca38=sanitizeForFilesystem(_0x324311);let _0x1b9ad3=_0x44ca38,_0x4bcd23=a4_0x644d9b[_0x22380c(0x104)](process[_0x22380c(0x1b5)](),_0x22380c(0x169),_0x44ca38,_0x22380c(0x123));if(!existsSync(_0x4bcd23)){const _0x14095d=normalizeName(_0x324311),_0x5c8d0e=a4_0x644d9b['join'](process[_0x22380c(0x1b5)](),'agents',_0x14095d,_0x22380c(0x123));existsSync(_0x5c8d0e)&&(_0x1b9ad3=_0x14095d,_0x4bcd23=_0x5c8d0e);}if(existsSync(_0x4bcd23))_0x52616d=a4_0x644d9b[_0x22380c(0x12f)](_0x4bcd23),console[_0x22380c(0x1c0)](a4_0x52269a[_0x22380c(0x17e)](_0x22380c(0x138)+_0x52616d));else{const _0x49b3df=_0x483b0b['profile'];if(_0x49b3df)throw new SDKError(ErrorCode[_0x22380c(0x134)],_0x22380c(0xfc)+_0x324311+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':'When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a'+_0x22380c(0x16d)+(_0x22380c(0x112)+_0x324311+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x1b9ad3+_0x22380c(0x176)+(_0x5a93d9||'<new-name>')+_0x22380c(0x1c1)+_0x49b3df)});_0x52616d=_0x324311,console[_0x22380c(0x1c0)](a4_0x52269a['dim'](_0x22380c(0x10a)+_0x324311));}}}}if(!_0x52616d)return console['log'](a4_0x52269a[_0x22380c(0x193)](_0x22380c(0x10b))),console['log'](_0x22380c(0x17f)),console[_0x22380c(0x1c0)](_0x22380c(0x19b)),console[_0x22380c(0x1c0)]('\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[_0x22380c(0x1c0)](_0x22380c(0x12c)),0x1;if(!_0x5a93d9)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x22380c(0xff),undefined,{'helpText':_0x22380c(0x118)});if(!_0x41c2c3&&!_0x17271a){if(!isInteractive())return console[_0x22380c(0x1ab)](a4_0x52269a[_0x22380c(0x156)](_0x22380c(0x11d)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x22380c(0x1ab)](a4_0x52269a[_0x22380c(0x17e)](_0x22380c(0x119))),0x1;const _0x43697b=await confirmKey(_0x22380c(0x102)+_0x52616d+_0x22380c(0x106)+_0x5a93d9+'\x22?');if(!_0x43697b)return console[_0x22380c(0x1c0)](a4_0x52269a[_0x22380c(0x193)]('Cancelled')),0x1;}const {data:_0x183988}=await withSpinner(_0x22380c(0x1ac)+_0x52616d+_0x22380c(0x17c)+_0x5a93d9+_0x22380c(0xfb),()=>_0x106fc7['llm'][_0x22380c(0x1ae)](_0x52616d,_0x5a93d9,{'dryRun':_0x17271a}));if(_0x17271a){console[_0x22380c(0x1c0)](a4_0x52269a[_0x22380c(0x193)](_0x22380c(0x189))),console[_0x22380c(0x1c0)](_0x22380c(0x152)+_0x183988[_0x22380c(0x147)]),console['log'](_0x22380c(0x130)+_0x5a93d9),console[_0x22380c(0x1c0)](_0x22380c(0x181)),console[_0x22380c(0x1c0)](_0x22380c(0x1a6)+_0x183988[_0x22380c(0x194)][_0x22380c(0x169)]['created']),console[_0x22380c(0x1c0)](_0x22380c(0x16c)+_0x183988['counts'][_0x22380c(0x153)][_0x22380c(0x14d)]),console[_0x22380c(0x1c0)](_0x22380c(0x149)+_0x183988['counts'][_0x22380c(0x177)]['created']),console['log'](_0x22380c(0x197)+_0x183988[_0x22380c(0x194)][_0x22380c(0x126)][_0x22380c(0x14d)]),console['log'](_0x22380c(0x121)+_0x183988[_0x22380c(0x194)][_0x22380c(0x135)][_0x22380c(0x14d)]);const _0x14cded=_0x183988[_0x22380c(0x194)][_0x22380c(0x125)][_0x22380c(0x14d)]>0x0||_0x183988[_0x22380c(0x194)][_0x22380c(0x116)][_0x22380c(0x14d)]>0x0;return _0x14cded&&(console[_0x22380c(0x1c0)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+_0x183988[_0x22380c(0x194)][_0x22380c(0x125)][_0x22380c(0x14d)]),console['log'](_0x22380c(0x146)+_0x183988[_0x22380c(0x194)][_0x22380c(0x116)]['created'])),0x0;}const _0x57751b=_0x183988['counts'][_0x22380c(0x169)][_0x22380c(0x16e)]>0x0||_0x183988[_0x22380c(0x194)][_0x22380c(0x153)]['errors']>0x0||_0x183988[_0x22380c(0x194)]['prompts'][_0x22380c(0x16e)]>0x0||_0x183988[_0x22380c(0x194)][_0x22380c(0x126)]['errors']>0x0||_0x183988[_0x22380c(0x194)][_0x22380c(0x135)][_0x22380c(0x16e)]>0x0||_0x183988[_0x22380c(0x194)][_0x22380c(0x125)][_0x22380c(0x16e)]>0x0||_0x183988[_0x22380c(0x194)][_0x22380c(0x116)]['errors']>0x0;_0x57751b?console[_0x22380c(0x1c0)](a4_0x52269a[_0x22380c(0x193)](_0x22380c(0x186))):console['log'](a4_0x52269a[_0x22380c(0x198)]('Project\x20cloned\x20successfully'));console[_0x22380c(0x1c0)](_0x22380c(0x152)+_0x183988[_0x22380c(0x147)]),console['log'](_0x22380c(0x130)+_0x183988[_0x22380c(0x167)]),console[_0x22380c(0x1c0)](_0x22380c(0x13b)+_0x183988['newProjectId']),console[_0x22380c(0x1c0)](),console[_0x22380c(0x1c0)](_0x22380c(0x162)),console[_0x22380c(0x1c0)](_0x22380c(0x1a6)+formatCountSummary(_0x183988['counts'][_0x22380c(0x169)])),console[_0x22380c(0x1c0)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x183988[_0x22380c(0x194)][_0x22380c(0x153)])),console[_0x22380c(0x1c0)](_0x22380c(0x149)+formatCountSummary(_0x183988[_0x22380c(0x194)][_0x22380c(0x177)])),console[_0x22380c(0x1c0)](_0x22380c(0x14b)+formatCountSummary(_0x183988[_0x22380c(0x194)][_0x22380c(0x171)])),console[_0x22380c(0x1c0)](_0x22380c(0x197)+formatCountSummary(_0x183988[_0x22380c(0x194)]['formInterfaces'])),console['log'](_0x22380c(0x121)+formatCountSummary(_0x183988[_0x22380c(0x194)][_0x22380c(0x135)]));const _0x24ff2c=_0x183988['counts'][_0x22380c(0x125)]['created']>0x0||_0x183988[_0x22380c(0x194)]['experimentalKnowledgeBases'][_0x22380c(0x1b0)]>0x0||_0x183988[_0x22380c(0x194)][_0x22380c(0x125)]['unchanged']>0x0||_0x183988[_0x22380c(0x194)]['experimentalArtifacts']['created']>0x0||_0x183988[_0x22380c(0x194)][_0x22380c(0x116)]['updated']>0x0||_0x183988[_0x22380c(0x194)][_0x22380c(0x116)][_0x22380c(0x18b)]>0x0;_0x24ff2c&&(console[_0x22380c(0x1c0)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x183988[_0x22380c(0x194)][_0x22380c(0x125)])),console['log'](_0x22380c(0x146)+formatCountSummary(_0x183988['counts'][_0x22380c(0x116)])));if(_0x57751b){console[_0x22380c(0x1c0)](),console['log'](a4_0x52269a[_0x22380c(0x156)](_0x22380c(0x107)));for(const _0x5c9008 of _0x183988['agents']){_0x5c9008[_0x22380c(0x15e)]==='error'&&console[_0x22380c(0x1c0)](a4_0x52269a[_0x22380c(0x156)](_0x22380c(0x131)+_0x5c9008[_0x22380c(0x127)]+'\x22:\x20'+_0x5c9008['error']));}for(const _0xe07623 of _0x183988[_0x22380c(0x153)]){_0xe07623[_0x22380c(0x15e)]===_0x22380c(0x1ab)&&console[_0x22380c(0x1c0)](a4_0x52269a[_0x22380c(0x156)](_0x22380c(0x17a)+_0xe07623[_0x22380c(0x15c)]+'\x22:\x20'+_0xe07623[_0x22380c(0x1ab)]));}for(const _0x138320 of _0x183988[_0x22380c(0x177)]){_0x138320[_0x22380c(0x15e)]===_0x22380c(0x1ab)&&console[_0x22380c(0x1c0)](a4_0x52269a[_0x22380c(0x156)](_0x22380c(0x19d)+_0x138320[_0x22380c(0x15c)]+_0x22380c(0x18f)+_0x138320[_0x22380c(0x1ab)]));}for(const _0x4eca98 of _0x183988[_0x22380c(0x171)]){_0x4eca98[_0x22380c(0x15e)]===_0x22380c(0x1ab)&&console[_0x22380c(0x1c0)](a4_0x52269a[_0x22380c(0x156)](_0x22380c(0x163)+_0x4eca98[_0x22380c(0x15c)]+_0x22380c(0x18f)+_0x4eca98[_0x22380c(0x1ab)]));}for(const _0x2709c7 of _0x183988[_0x22380c(0x126)]){_0x2709c7[_0x22380c(0x15e)]===_0x22380c(0x1ab)&&console['log'](a4_0x52269a[_0x22380c(0x156)](_0x22380c(0x133)+_0x2709c7[_0x22380c(0x15c)]+_0x22380c(0x18f)+_0x2709c7['error']));}for(const _0x3c5d32 of _0x183988[_0x22380c(0x135)]){_0x3c5d32[_0x22380c(0x15e)]===_0x22380c(0x1ab)&&console[_0x22380c(0x1c0)](a4_0x52269a['red'](_0x22380c(0xfd)+_0x3c5d32[_0x22380c(0x15c)]+_0x22380c(0x18f)+_0x3c5d32[_0x22380c(0x1ab)]));}for(const _0x3c20c9 of _0x183988[_0x22380c(0x125)]){_0x3c20c9['action']===_0x22380c(0x1ab)&&console['log'](a4_0x52269a[_0x22380c(0x156)](_0x22380c(0x110)+_0x3c20c9['name']+'\x22:\x20'+_0x3c20c9[_0x22380c(0x1ab)]));}for(const _0x394cdf of _0x183988['experimentalArtifacts']){_0x394cdf['action']==='error'&&console[_0x22380c(0x1c0)](a4_0x52269a['red'](_0x22380c(0x137)+_0x394cdf[_0x22380c(0x15c)]+_0x22380c(0x18f)+_0x394cdf['error']));}return 0x1;}console['log']();const _0x1083a8=getLLMProjectUrl(_0x3f68a4,_0x183988[_0x22380c(0x173)]);return console['log']('Project:\x20'+a4_0x52269a[_0x22380c(0x160)](_0x1083a8)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x55f474(0x15c)]=a4_0x55f474(0x11f);['description']=a4_0x55f474(0x13f);async[a4_0x55f474(0x15f)](_0x54f6a8){const _0x174987=a4_0x55f474,{options:_0x2f5e5a,args:_0x53c5a5,tdx:_0x276a13}=_0x54f6a8;let _0x1d3a1e=_0x53c5a5[0x0]||process[_0x174987(0x1b5)]();const _0x401fd4=_0x2f5e5a[_0x174987(0x14c)],_0x9e373=_0x2f5e5a[_0x174987(0x13a)],_0x50dcfc=_0x2f5e5a[_0x174987(0x10f)],_0x485f9b=_0x2f5e5a[_0x174987(0x120)],_0x410da5=a4_0x644d9b['join'](_0x1d3a1e,_0x174987(0x174)),_0x41d359=existsSync(_0x410da5);if(_0x41d359){const {data:_0x4f55a8}=await withSpinner(_0x174987(0x158)+_0x1d3a1e+_0x174987(0xfb),()=>_0x276a13['llm']['pushAgent'](_0x1d3a1e,{'dryRun':_0x401fd4,'force':_0x9e373}));if(_0x401fd4)return console[_0x174987(0x1c0)](a4_0x52269a[_0x174987(0x193)](_0x174987(0x189))),console[_0x174987(0x1c0)](_0x174987(0x196)+_0x4f55a8[_0x174987(0x127)]),0x0;if(_0x4f55a8[_0x174987(0x15e)]===_0x174987(0x1ab))return console['log'](a4_0x52269a[_0x174987(0x156)](_0x174987(0x114)+_0x4f55a8['error'])),0x1;console[_0x174987(0x1c0)](a4_0x52269a[_0x174987(0x198)](_0x174987(0x178)+_0x4f55a8[_0x174987(0x15e)]+_0x174987(0x1bb))),console[_0x174987(0x1c0)](_0x174987(0x144)+_0x4f55a8['agentName']);if(_0x4f55a8[_0x174987(0x129)]&&_0x4f55a8[_0x174987(0x143)]){const _0x29f998=getLLMAgentChatUrl(_0x485f9b,_0x4f55a8['projectId'],_0x4f55a8[_0x174987(0x129)]);console[_0x174987(0x1c0)](_0x174987(0x1a3)+a4_0x52269a[_0x174987(0x160)](_0x29f998));}return 0x0;}const _0x5c676c=_0x2f5e5a[_0x174987(0x122)],_0x2f9f75=resolveProjectFromContext(_0x1d3a1e,_0x5c676c);if(_0x2f9f75['found'])_0x1d3a1e=_0x2f9f75[_0x174987(0x1bf)],_0x2f9f75['source']===_0x174987(0x164)&&console['log'](a4_0x52269a[_0x174987(0x17e)]('Using\x20project:\x20'+_0x1d3a1e));else{let _0x330321=_0x174987(0x100);_0x2f9f75[_0x174987(0x166)]==='no_local_folder'&&(_0x330321=_0x2f9f75[_0x174987(0x161)]+_0x174987(0x11c)+_0x2f9f75[_0x174987(0x122)]+_0x174987(0x103));throw new SDKError(ErrorCode[_0x174987(0x134)],_0x2f9f75[_0x174987(0x166)]===_0x174987(0x185)?_0x2f9f75[_0x174987(0x161)]:_0x174987(0x16a)+_0x1d3a1e,undefined,{'helpText':_0x330321});}const {data:_0xa8850b}=await withSpinner(_0x174987(0x10d),()=>_0x276a13[_0x174987(0x1af)][_0x174987(0x188)](_0x1d3a1e,{'dryRun':!![]})),_0x30b378=_0xa8850b[_0x174987(0x194)][_0x174987(0x169)][_0x174987(0x16e)]>0x0;if(_0x30b378){console['log'](a4_0x52269a[_0x174987(0x156)](_0x174987(0x16f)));for(const _0x133e99 of _0xa8850b[_0x174987(0x169)]){_0x133e99[_0x174987(0x15e)]==='error'&&console['log'](a4_0x52269a[_0x174987(0x156)](_0x174987(0x131)+_0x133e99['agentName']+_0x174987(0x18f)+_0x133e99[_0x174987(0x1ab)]));}return 0x1;}const _0xc3c282=_0xa8850b[_0x174987(0x194)][_0x174987(0x169)][_0x174987(0x14d)]+_0xa8850b[_0x174987(0x194)][_0x174987(0x153)]['created']+_0xa8850b[_0x174987(0x194)][_0x174987(0x1bd)][_0x174987(0x14d)]+_0xa8850b['counts']['prompts']['created']+_0xa8850b['counts'][_0x174987(0x171)][_0x174987(0x14d)]+_0xa8850b[_0x174987(0x194)]['experimentalKnowledgeBases'][_0x174987(0x14d)]+_0xa8850b[_0x174987(0x194)][_0x174987(0x116)][_0x174987(0x14d)]+_0xa8850b['counts'][_0x174987(0x126)][_0x174987(0x14d)]+_0xa8850b['counts']['chatInterfaces'][_0x174987(0x14d)],_0x32034c=_0xa8850b['counts'][_0x174987(0x169)][_0x174987(0x1b0)]+_0xa8850b['counts'][_0x174987(0x153)][_0x174987(0x1b0)]+_0xa8850b[_0x174987(0x194)][_0x174987(0x1bd)][_0x174987(0x1b0)]+_0xa8850b[_0x174987(0x194)][_0x174987(0x177)]['updated']+_0xa8850b[_0x174987(0x194)]['integrations'][_0x174987(0x1b0)]+_0xa8850b[_0x174987(0x194)][_0x174987(0x125)]['updated']+_0xa8850b[_0x174987(0x194)][_0x174987(0x116)]['updated']+_0xa8850b[_0x174987(0x194)]['formInterfaces']['updated']+_0xa8850b[_0x174987(0x194)]['chatInterfaces'][_0x174987(0x1b0)],_0x353384=_0xa8850b['counts'][_0x174987(0x169)][_0x174987(0x18b)]+_0xa8850b[_0x174987(0x194)][_0x174987(0x153)][_0x174987(0x18b)]+_0xa8850b[_0x174987(0x194)][_0x174987(0x1bd)][_0x174987(0x18b)]+_0xa8850b['counts']['prompts'][_0x174987(0x18b)]+_0xa8850b[_0x174987(0x194)]['integrations'][_0x174987(0x18b)]+_0xa8850b[_0x174987(0x194)][_0x174987(0x125)][_0x174987(0x18b)]+_0xa8850b[_0x174987(0x194)][_0x174987(0x116)][_0x174987(0x18b)]+_0xa8850b[_0x174987(0x194)]['formInterfaces']['unchanged']+_0xa8850b['counts'][_0x174987(0x135)]['unchanged'];console[_0x174987(0x1c0)](_0x174987(0x180)+_0xa8850b[_0x174987(0xfa)]+'\x27:'),console[_0x174987(0x1c0)]('\x20\x20'+a4_0x52269a[_0x174987(0x198)]('+\x20'+_0xc3c282+_0x174987(0x159))+'\x20|\x20'+a4_0x52269a[_0x174987(0x193)]('~\x20'+_0x32034c+_0x174987(0x1a4))+_0x174987(0x11e)+a4_0x52269a[_0x174987(0x17e)]('=\x20'+_0x353384+_0x174987(0x124))),console[_0x174987(0x1c0)](_0x174987(0x1a6)+formatCountSummary(_0xa8850b[_0x174987(0x194)][_0x174987(0x169)])),console[_0x174987(0x1c0)](_0x174987(0x16c)+formatCountSummary(_0xa8850b[_0x174987(0x194)][_0x174987(0x153)])),console[_0x174987(0x1c0)](_0x174987(0x150)+formatCountSummary(_0xa8850b['counts'][_0x174987(0x1bd)])),console[_0x174987(0x1c0)](_0x174987(0x149)+formatCountSummary(_0xa8850b[_0x174987(0x194)][_0x174987(0x177)])),console[_0x174987(0x1c0)](_0x174987(0x14b)+formatCountSummary(_0xa8850b[_0x174987(0x194)][_0x174987(0x171)])),console[_0x174987(0x1c0)](_0x174987(0x197)+formatCountSummary(_0xa8850b[_0x174987(0x194)]['formInterfaces'])),console['log'](_0x174987(0x121)+formatCountSummary(_0xa8850b['counts'][_0x174987(0x135)]));const _0x1beb15=_0xa8850b[_0x174987(0x194)][_0x174987(0x125)][_0x174987(0x14d)]>0x0||_0xa8850b['counts'][_0x174987(0x125)]['updated']>0x0||_0xa8850b[_0x174987(0x194)]['experimentalKnowledgeBases']['unchanged']>0x0||_0xa8850b[_0x174987(0x194)]['experimentalArtifacts'][_0x174987(0x14d)]>0x0||_0xa8850b[_0x174987(0x194)][_0x174987(0x116)][_0x174987(0x1b0)]>0x0||_0xa8850b[_0x174987(0x194)][_0x174987(0x116)][_0x174987(0x18b)]>0x0;_0x1beb15&&(console[_0x174987(0x1c0)](_0x174987(0x155)+formatCountSummary(_0xa8850b[_0x174987(0x194)][_0x174987(0x125)])),console[_0x174987(0x1c0)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0xa8850b[_0x174987(0x194)][_0x174987(0x116)])));console[_0x174987(0x1c0)](_0x174987(0x1a5)+a4_0x52269a[_0x174987(0x160)](_0x1d3a1e)),displayDiffs(_0xa8850b['agents'],_0xa8850b['knowledgeBases'],_0xa8850b['textKnowledgeBases'],_0xa8850b['prompts'],_0xa8850b[_0x174987(0x171)],_0xa8850b[_0x174987(0x125)],_0xa8850b[_0x174987(0x116)],_0xa8850b[_0x174987(0x126)],_0xa8850b[_0x174987(0x135)]);if(_0x401fd4)return console[_0x174987(0x1c0)](a4_0x52269a[_0x174987(0x193)](_0x174987(0x187))),0x0;if(_0xc3c282===0x0&&_0x32034c===0x0){console[_0x174987(0x1c0)](a4_0x52269a[_0x174987(0x198)](_0x174987(0x117)));const _0xf42e64=getLLMProjectUrl(_0x485f9b,_0xa8850b[_0x174987(0x143)]);return console[_0x174987(0x1c0)](_0x174987(0x1ad)+a4_0x52269a['cyan'](_0xf42e64)),0x0;}if(!_0x50dcfc&&!_0x9e373){if(!isInteractive())return console[_0x174987(0x1ab)](a4_0x52269a['red']('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x174987(0x1ab)](a4_0x52269a[_0x174987(0x17e)](_0x174987(0x119))),0x1;const _0x2cdbb2=await confirmKey('\x0aPush\x20'+(_0xc3c282+_0x32034c)+_0x174987(0x195));if(!_0x2cdbb2)return console[_0x174987(0x1c0)](a4_0x52269a[_0x174987(0x193)](_0x174987(0x1b2)),'-\x20nothing\x20pushed'),0x1;}const {data:_0x5f1844}=await withSpinner(_0x174987(0x115),()=>_0x276a13[_0x174987(0x1af)][_0x174987(0x188)](_0x1d3a1e,{'force':_0x9e373})),_0x11ff10=_0x5f1844[_0x174987(0x194)][_0x174987(0x169)][_0x174987(0x16e)]>0x0||_0x5f1844['counts'][_0x174987(0x153)][_0x174987(0x16e)]>0x0||_0x5f1844['counts']['textKnowledgeBases'][_0x174987(0x16e)]>0x0||_0x5f1844[_0x174987(0x194)][_0x174987(0x177)][_0x174987(0x16e)]>0x0||_0x5f1844[_0x174987(0x194)][_0x174987(0x126)][_0x174987(0x16e)]>0x0||_0x5f1844['counts'][_0x174987(0x135)][_0x174987(0x16e)]>0x0;if(_0x11ff10){console[_0x174987(0x1c0)](a4_0x52269a[_0x174987(0x193)](_0x174987(0x190))),console[_0x174987(0x1c0)](),console[_0x174987(0x1c0)](a4_0x52269a[_0x174987(0x156)](_0x174987(0x107)));for(const _0x1fdba8 of _0x5f1844[_0x174987(0x169)]){_0x1fdba8['action']===_0x174987(0x1ab)&&console[_0x174987(0x1c0)](a4_0x52269a[_0x174987(0x156)](_0x174987(0x131)+_0x1fdba8[_0x174987(0x127)]+_0x174987(0x18f)+_0x1fdba8[_0x174987(0x1ab)]));}for(const _0x40e34b of _0x5f1844[_0x174987(0x153)]){_0x40e34b[_0x174987(0x15e)]===_0x174987(0x1ab)&&console[_0x174987(0x1c0)](a4_0x52269a[_0x174987(0x156)](_0x174987(0x17a)+_0x40e34b['name']+_0x174987(0x18f)+_0x40e34b[_0x174987(0x1ab)]));}for(const _0x4b4a22 of _0x5f1844[_0x174987(0x1bd)]){_0x4b4a22[_0x174987(0x15e)]===_0x174987(0x1ab)&&console['log'](a4_0x52269a[_0x174987(0x156)](_0x174987(0x1a2)+_0x4b4a22[_0x174987(0x15c)]+_0x174987(0x18f)+_0x4b4a22[_0x174987(0x1ab)]));}for(const _0x259fd1 of _0x5f1844[_0x174987(0x177)]){_0x259fd1[_0x174987(0x15e)]===_0x174987(0x1ab)&&console[_0x174987(0x1c0)](a4_0x52269a[_0x174987(0x156)](_0x174987(0x19d)+_0x259fd1[_0x174987(0x15c)]+'\x22:\x20'+_0x259fd1['error']));}for(const _0x20cf2e of _0x5f1844[_0x174987(0x171)]){_0x20cf2e['action']==='error'&&console['log'](a4_0x52269a[_0x174987(0x156)](_0x174987(0x163)+_0x20cf2e[_0x174987(0x15c)]+_0x174987(0x18f)+_0x20cf2e[_0x174987(0x1ab)]));}for(const _0x58f17a of _0x5f1844[_0x174987(0x126)]){_0x58f17a[_0x174987(0x15e)]===_0x174987(0x1ab)&&console[_0x174987(0x1c0)](a4_0x52269a[_0x174987(0x156)]('\x20\x20Form\x20Interface\x20\x22'+_0x58f17a['name']+'\x22:\x20'+_0x58f17a[_0x174987(0x1ab)]));}for(const _0x50cd57 of _0x5f1844[_0x174987(0x135)]){_0x50cd57[_0x174987(0x15e)]===_0x174987(0x1ab)&&console[_0x174987(0x1c0)](a4_0x52269a[_0x174987(0x156)]('\x20\x20Chat\x20Interface\x20\x22'+_0x50cd57[_0x174987(0x15c)]+_0x174987(0x18f)+_0x50cd57[_0x174987(0x1ab)]));}return 0x1;}console[_0x174987(0x1c0)](a4_0x52269a[_0x174987(0x198)](_0x174987(0x17b)+(_0xc3c282+_0x32034c)+_0x174987(0x11a)+_0x5f1844['projectName']+'\x27'));const _0x4002b3=getLLMProjectUrl(_0x485f9b,_0x5f1844[_0x174987(0x143)]);return console[_0x174987(0x1c0)]('Project:\x20'+a4_0x52269a[_0x174987(0x160)](_0x4002b3)),0x0;}}
|
|
1
|
+
const a4_0x5d14f6=a4_0x12a9;(function(_0x4ce12a,_0x51d189){const _0x277678=a4_0x12a9,_0x52cac8=_0x4ce12a();while(!![]){try{const _0x1a6fd6=-parseInt(_0x277678(0x194))/0x1*(parseInt(_0x277678(0x16e))/0x2)+-parseInt(_0x277678(0x1a2))/0x3+parseInt(_0x277678(0x15a))/0x4*(-parseInt(_0x277678(0x1ac))/0x5)+parseInt(_0x277678(0x18d))/0x6*(parseInt(_0x277678(0x185))/0x7)+parseInt(_0x277678(0x1af))/0x8*(-parseInt(_0x277678(0x14f))/0x9)+-parseInt(_0x277678(0x1ed))/0xa*(-parseInt(_0x277678(0x1eb))/0xb)+parseInt(_0x277678(0x1f1))/0xc*(parseInt(_0x277678(0x1c6))/0xd);if(_0x1a6fd6===_0x51d189)break;else _0x52cac8['push'](_0x52cac8['shift']());}catch(_0x5f25bc){_0x52cac8['push'](_0x52cac8['shift']());}}}(a4_0x584a,0xb2fc3));import a4_0x2ce4db from'chalk';import a4_0xdacdae from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x246700){const _0x4fcd84=a4_0x12a9,_0x55d467=[];if(_0x246700[_0x4fcd84(0x1df)]!==undefined)_0x55d467[_0x4fcd84(0x1f5)](_0x246700[_0x4fcd84(0x1df)]+'\x20total');if(_0x246700[_0x4fcd84(0x1fc)]!==undefined&&_0x246700[_0x4fcd84(0x1fc)]>0x0)_0x55d467[_0x4fcd84(0x1f5)](a4_0x2ce4db['green'](_0x246700[_0x4fcd84(0x1fc)]+'\x20new'));if(_0x246700[_0x4fcd84(0x20a)]!==undefined&&_0x246700['created']>0x0)_0x55d467[_0x4fcd84(0x1f5)](a4_0x2ce4db['green'](_0x246700[_0x4fcd84(0x20a)]+_0x4fcd84(0x15b)));if(_0x246700[_0x4fcd84(0x1ee)]!==undefined&&_0x246700[_0x4fcd84(0x1ee)]>0x0)_0x55d467[_0x4fcd84(0x1f5)](a4_0x2ce4db['yellow'](_0x246700[_0x4fcd84(0x1ee)]+_0x4fcd84(0x156)));if(_0x246700['unchanged']!==undefined&&_0x246700[_0x4fcd84(0x1f8)]>0x0)_0x55d467[_0x4fcd84(0x1f5)](a4_0x2ce4db[_0x4fcd84(0x1bb)](_0x246700[_0x4fcd84(0x1f8)]+_0x4fcd84(0x17b)));if(_0x246700['errors']!==undefined&&_0x246700[_0x4fcd84(0x1f4)]>0x0)_0x55d467[_0x4fcd84(0x1f5)](a4_0x2ce4db['red'](_0x246700[_0x4fcd84(0x1f4)]+_0x4fcd84(0x1ab)));return _0x55d467[_0x4fcd84(0x18b)](',\x20');}function a4_0x584a(){const _0x407b11=['integrations','<new-name>','pullAgent','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20\x20Agents:\x20','error','Would\x20clone:','chatInterfaces','red','New\x20project\x20ID:\x20','Dry\x20run\x20-\x20no\x20files\x20written','Project\x20cloned\x20successfully','4131327dyvjVo','\x20new','sourceProjectName','projectName','experimentalKnowledgeBases','\x0aChanges:','agentId','description','name','\x20errors','585325YuqtMu','\x20\x20tdx\x20agent\x20clone\x20agents/','Using\x20project:\x20','11276840UYxmHF','\x20\x20Form\x20Interfaces:\x20','agent','cwd','log','parse','Using\x20context\x20project:\x20','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','newProjectId','gray','\x0aErrors\x20found:','Analyzing\x20changes\x20to\x20push...','yes','agent:pull','No\x20tdx.json\x20found\x20in\x20','\x22\x20to\x20a\x20different\x20profile','green','\x20resources?','\x0aChanges\x20to\x20prompt\x20\x27','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','363987nrvcGa','formInterfaces','\x20\x20tdx\x20agent\x20pull\x20','Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','prompts','✔\x20Context\x20set:\x20','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','llm','\x22...','Cannot\x20clone\x20from\x20context\x20project\x20\x22','Using\x20project\x20from\x20context:\x20','New\x20project\x20name\x20is\x20required','\x22\x20from\x20project\x20\x22','llmProject','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Using\x20local\x20project:\x20','outputDir','INVALID_ARGUMENT','\x0a✔\x20Pulled\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project','Errors:','pullProject','llm_project','\x0aPush\x20summary\x20for\x20\x27','total','context','\x20=\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x0aPull\x20summary\x20for\x20\x27','dim','Cloning\x20\x22','execute','\x20\x20Prompt\x20\x22','experimentalArtifacts','\x20\x20Agent\x20\x22','13604921LYjoWU','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','10drLVmG','updated','Using\x20project\x20from\x20','profile','1416ulwKia','Writing\x20files...','Project\x20cloned\x20with\x20errors','errors','push','tdx.json','yellow','unchanged','\x0aPush\x20','agent.yml','agent:clone','new','arg-dir','Pushing\x20agent\x20from\x20\x22','dirname','\x22:\x20','\x20\x20Knowledge\x20Bases:\x20','\x20successfully','output','\x0aChanges\x20to\x20integration\x20\x27','\x20files?','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x20\x20Experimental\x20Artifacts:\x20','\x20|\x20','agentName','created','\x20--name\x20','\x20\x20Source:\x20','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','found','pushProject','\x20\x20Text\x20Knowledge\x20Bases:\x20','9tYiTPh','action','\x0aError:','\x0aChanges\x20to\x20chat\x20interface\x20\x27','\x20\x20Chat\x20Interfaces:\x20','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','Pulling\x20agent\x20\x22','\x20updated','projectId','agents','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','16fRatPi','\x20created','repeat','Agent\x20pulled\x20successfully','cloneProject','\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','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','-\x20nothing\x20pushed','Source:\x20','\x20\x20Prompts:\x20','cwd-config','MISSING_ARGUMENT','Output\x20path:\x20','outputPath','pushAgent','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','diff','\x20\x20Integrations:\x20','\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)','counts','5498UQHPIe','session','Would\x20pull\x20agent:\x20','\x0a✔\x20Pushed\x20','hasChanges','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x20--profile\x20','dryRun','force','no_context','cyan','New\x20project:\x20','Project:\x20','\x20unchanged','Agent\x20','textKnowledgeBases','Cancelled','projectDir','knowledgeBases','\x20\x20Knowledge\x20Base\x20\x22','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','\x20changed','\x20\x20Form\x20Interface\x20\x22','49NjVWOB','Failed\x20to\x20push\x20agent:\x20','\x0aChanges\x20to\x20form\x20interface\x20\x27','\x22\x20to\x20\x22','utf-8','agent:push','join','message','579606OmwoCn','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','site','source','\x20\x20Experimental\x20Artifact\x20\x22','reason','\x20\x20Integration\x20\x22','447nGVesh'];a4_0x584a=function(){return _0x407b11;};return a4_0x584a();}function displayDiffs(_0x5433e8,_0x400b2b,_0x31e36c,_0x13a319,_0x363204,_0x57e2f9,_0x2d4db0,_0x5941f0,_0x6586d3){const _0x339934=a4_0x12a9;for(const _0x6be9f3 of _0x5433e8){if(_0x6be9f3['diff']){const _0xb92d6a=_0x6be9f3[_0x339934(0x209)]||_0x6be9f3[_0x339934(0x1aa)];console[_0x339934(0x1b3)]('\x0aChanges\x20to\x20agent\x20\x27'+_0xb92d6a+'\x27:'),console[_0x339934(0x1b3)]('─'['repeat'](0x3c)),console[_0x339934(0x1b3)](_0x6be9f3['diff']),console[_0x339934(0x1b3)]('─'[_0x339934(0x15c)](0x3c));}}for(const _0x166b99 of _0x400b2b){_0x166b99['diff']&&(console[_0x339934(0x1b3)](_0x339934(0x1ec)+_0x166b99[_0x339934(0x1aa)]+'\x27:'),console[_0x339934(0x1b3)]('─'['repeat'](0x3c)),console[_0x339934(0x1b3)](_0x166b99['diff']),console[_0x339934(0x1b3)]('─'[_0x339934(0x15c)](0x3c)));}for(const _0x528291 of _0x31e36c){_0x528291[_0x339934(0x16a)]&&(console[_0x339934(0x1b3)]('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x528291[_0x339934(0x1aa)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x339934(0x1b3)](_0x528291[_0x339934(0x16a)]),console[_0x339934(0x1b3)]('─'[_0x339934(0x15c)](0x3c)));}for(const _0x3fd3f3 of _0x13a319){_0x3fd3f3[_0x339934(0x16a)]&&(console['log'](_0x339934(0x1c4)+_0x3fd3f3[_0x339934(0x1aa)]+'\x27:'),console[_0x339934(0x1b3)]('─'['repeat'](0x3c)),console[_0x339934(0x1b3)](_0x3fd3f3['diff']),console[_0x339934(0x1b3)]('─'[_0x339934(0x15c)](0x3c)));}for(const _0x2736f6 of _0x363204){_0x2736f6[_0x339934(0x16a)]&&(console['log'](_0x339934(0x204)+_0x2736f6[_0x339934(0x1aa)]+'\x27:'),console[_0x339934(0x1b3)]('─'['repeat'](0x3c)),console[_0x339934(0x1b3)](_0x2736f6[_0x339934(0x16a)]),console[_0x339934(0x1b3)]('─'[_0x339934(0x15c)](0x3c)));}for(const _0x586a05 of _0x57e2f9){_0x586a05[_0x339934(0x16a)]&&(console[_0x339934(0x1b3)](_0x339934(0x173)+_0x586a05[_0x339934(0x1aa)]+'\x27:'),console['log']('─'[_0x339934(0x15c)](0x3c)),console[_0x339934(0x1b3)](_0x586a05[_0x339934(0x16a)]),console[_0x339934(0x1b3)]('─'[_0x339934(0x15c)](0x3c)));}for(const _0x2bcf44 of _0x2d4db0){_0x2bcf44[_0x339934(0x16a)]&&(console[_0x339934(0x1b3)](_0x339934(0x1b9)+_0x2bcf44[_0x339934(0x1aa)]+'\x27:'),console['log']('─'[_0x339934(0x15c)](0x3c)),console[_0x339934(0x1b3)](_0x2bcf44[_0x339934(0x16a)]),console[_0x339934(0x1b3)]('─'[_0x339934(0x15c)](0x3c)));}for(const _0x31f2b of _0x5941f0){_0x31f2b[_0x339934(0x16a)]&&(console[_0x339934(0x1b3)](_0x339934(0x187)+_0x31f2b[_0x339934(0x1aa)]+'\x27:'),console[_0x339934(0x1b3)]('─'['repeat'](0x3c)),console[_0x339934(0x1b3)](_0x31f2b[_0x339934(0x16a)]),console[_0x339934(0x1b3)]('─'[_0x339934(0x15c)](0x3c)));}for(const _0x4fbf38 of _0x6586d3){_0x4fbf38[_0x339934(0x16a)]&&(console['log'](_0x339934(0x152)+_0x4fbf38[_0x339934(0x1aa)]+'\x27:'),console[_0x339934(0x1b3)]('─'['repeat'](0x3c)),console['log'](_0x4fbf38[_0x339934(0x16a)]),console[_0x339934(0x1b3)]('─'[_0x339934(0x15c)](0x3c)));}}function a4_0x12a9(_0x323e22,_0x269408){_0x323e22=_0x323e22-0x14a;const _0x584a=a4_0x584a();let _0x12a965=_0x584a[_0x323e22];return _0x12a965;}export class AgentPullCommand extends BaseCommand{[a4_0x5d14f6(0x1aa)]=a4_0x5d14f6(0x1bf);[a4_0x5d14f6(0x1a9)]='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x5d14f6(0x1e7)](_0x503d11){const _0x833f0a=a4_0x5d14f6,{options:_0x2b7e9e,args:_0x3f4f98,tdx:_0x1d79e7}=_0x503d11,_0x5a6f3b=_0x3f4f98[0x0],_0x46af0a=_0x3f4f98[0x1],_0x569b4e=_0x2b7e9e[_0x833f0a(0x203)],_0x119d42=_0x2b7e9e[_0x833f0a(0x175)],_0x5cc70b=_0x2b7e9e[_0x833f0a(0x176)],_0x3afae7=_0x2b7e9e['yes'],_0x31199b=_0x2b7e9e[_0x833f0a(0x1d4)],_0x287c31=_0x2b7e9e[_0x833f0a(0x1b1)];let _0x4694a5;if(_0x5a6f3b){const _0x50b2e3=a4_0xdacdae[_0x833f0a(0x18b)](_0x5a6f3b,_0x833f0a(0x1f6));if(existsSync(_0x50b2e3))try{const _0x489459=JSON[_0x833f0a(0x1b4)](readFileSync(_0x50b2e3,_0x833f0a(0x189)));_0x489459[_0x833f0a(0x1dd)]&&(_0x4694a5={'llm_project':_0x489459['llm_project']});}catch{}}const _0x518b77=findAgentConfigPath(process[_0x833f0a(0x1b2)]());let _0x25d276;if(_0x518b77)try{const _0x15b79a=JSON['parse'](readFileSync(_0x518b77,'utf-8'));_0x15b79a[_0x833f0a(0x1dd)]&&(_0x25d276={'llm_project':_0x15b79a[_0x833f0a(0x1dd)]});}catch{}const _0x326564=resolveAgentPullArgs({'arg':_0x5a6f3b,'agentNameArg':_0x46af0a,'agentFlag':_0x287c31,'contextProject':_0x31199b,'argDirConfig':_0x4694a5,'cwdConfigPath':_0x518b77||undefined,'cwdConfig':_0x25d276}),{projectNameOrId:_0x4924d5,targetAgentName:_0x1728ef,existingOutputDir:_0x1ac6b7,source:_0x39c388}=_0x326564;if(_0x39c388===_0x833f0a(0x1fd))console[_0x833f0a(0x1b3)](a4_0x2ce4db[_0x833f0a(0x1e5)](_0x833f0a(0x1ef)+a4_0xdacdae['join'](_0x5a6f3b,_0x833f0a(0x1f6))+':\x20'+_0x4924d5));else{if(_0x39c388===_0x833f0a(0x164))console[_0x833f0a(0x1b3)](a4_0x2ce4db[_0x833f0a(0x1e5)](_0x833f0a(0x1ae)+_0x4924d5));else _0x39c388===_0x833f0a(0x1e0)&&console['log'](a4_0x2ce4db[_0x833f0a(0x1e5)](_0x833f0a(0x1d1)+_0x4924d5));}if(!_0x4924d5)return _0x287c31?(console[_0x833f0a(0x1b3)](a4_0x2ce4db['yellow'](_0x833f0a(0x160))),console[_0x833f0a(0x1b3)](_0x833f0a(0x18e)),console[_0x833f0a(0x1b3)](_0x833f0a(0x1cd))):(console[_0x833f0a(0x1b3)](a4_0x2ce4db[_0x833f0a(0x1f7)](_0x833f0a(0x1c5))),console['log'](_0x833f0a(0x1c9)),console[_0x833f0a(0x1b3)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project'),console[_0x833f0a(0x1b3)]('\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[_0x833f0a(0x1b3)](_0x833f0a(0x15f)),console[_0x833f0a(0x1b3)](_0x833f0a(0x1da))),0x1;if(_0x1728ef){const {data:_0x2905cb}=await withSpinner(_0x833f0a(0x155)+_0x1728ef+_0x833f0a(0x1d3)+_0x4924d5+_0x833f0a(0x1cf),()=>_0x1d79e7['llm'][_0x833f0a(0x197)](_0x4924d5,_0x1728ef,_0x569b4e,{'dryRun':_0x119d42,'force':_0x5cc70b}));if(_0x119d42)return console[_0x833f0a(0x1b3)](a4_0x2ce4db[_0x833f0a(0x1f7)](_0x833f0a(0x1a0))),console[_0x833f0a(0x1b3)](_0x833f0a(0x170)+_0x2905cb[_0x833f0a(0x209)]),console['log'](_0x833f0a(0x166)+_0x2905cb['outputPath']),_0x2905cb['diff']&&(console[_0x833f0a(0x1b3)](_0x833f0a(0x1a7)),console[_0x833f0a(0x1b3)]('─'[_0x833f0a(0x15c)](0x3c)),console[_0x833f0a(0x1b3)](_0x2905cb[_0x833f0a(0x16a)]),console[_0x833f0a(0x1b3)]('─'['repeat'](0x3c))),0x0;return console[_0x833f0a(0x1b3)](a4_0x2ce4db['green'](_0x833f0a(0x15d))),console['log']('Agent:\x20'+_0x2905cb[_0x833f0a(0x209)]),console[_0x833f0a(0x1b3)]('Output:\x20'+_0x2905cb[_0x833f0a(0x167)]),console['log']('Status:\x20'+(_0x2905cb['isNew']?a4_0x2ce4db[_0x833f0a(0x1c2)](_0x833f0a(0x1fc)):_0x2905cb[_0x833f0a(0x172)]?a4_0x2ce4db['yellow']('updated'):a4_0x2ce4db['gray'](_0x833f0a(0x1f8)))),0x0;}const _0x29b713=_0x1ac6b7||_0x569b4e,{data:_0xd5ad53}=await withSpinner('Analyzing\x20project\x20\x22'+_0x4924d5+_0x833f0a(0x1cf),()=>_0x1d79e7['llm'][_0x833f0a(0x1dc)](_0x4924d5,_0x29b713,{'dryRun':!![]})),_0x50a720=_0xd5ad53[_0x833f0a(0x16d)][_0x833f0a(0x158)]['new']+_0xd5ad53[_0x833f0a(0x16d)][_0x833f0a(0x180)][_0x833f0a(0x1fc)]+_0xd5ad53[_0x833f0a(0x16d)][_0x833f0a(0x17d)][_0x833f0a(0x1fc)]+_0xd5ad53[_0x833f0a(0x16d)]['prompts']['new']+_0xd5ad53[_0x833f0a(0x16d)][_0x833f0a(0x195)]['new']+_0xd5ad53[_0x833f0a(0x16d)][_0x833f0a(0x1a6)]['new']+_0xd5ad53[_0x833f0a(0x16d)][_0x833f0a(0x1e9)][_0x833f0a(0x1fc)]+_0xd5ad53['counts']['formInterfaces'][_0x833f0a(0x1fc)]+_0xd5ad53[_0x833f0a(0x16d)][_0x833f0a(0x19d)][_0x833f0a(0x1fc)],_0x5273f4=_0xd5ad53['counts'][_0x833f0a(0x158)]['updated']+_0xd5ad53[_0x833f0a(0x16d)][_0x833f0a(0x180)][_0x833f0a(0x1ee)]+_0xd5ad53['counts'][_0x833f0a(0x17d)][_0x833f0a(0x1ee)]+_0xd5ad53['counts']['prompts'][_0x833f0a(0x1ee)]+_0xd5ad53[_0x833f0a(0x16d)]['integrations'][_0x833f0a(0x1ee)]+_0xd5ad53[_0x833f0a(0x16d)][_0x833f0a(0x1a6)]['updated']+_0xd5ad53['counts'][_0x833f0a(0x1e9)]['updated']+_0xd5ad53[_0x833f0a(0x16d)][_0x833f0a(0x1c7)][_0x833f0a(0x1ee)]+_0xd5ad53[_0x833f0a(0x16d)][_0x833f0a(0x19d)][_0x833f0a(0x1ee)],_0x212b15=_0xd5ad53[_0x833f0a(0x16d)][_0x833f0a(0x158)][_0x833f0a(0x1f8)]+_0xd5ad53[_0x833f0a(0x16d)][_0x833f0a(0x180)][_0x833f0a(0x1f8)]+_0xd5ad53[_0x833f0a(0x16d)][_0x833f0a(0x17d)][_0x833f0a(0x1f8)]+_0xd5ad53[_0x833f0a(0x16d)][_0x833f0a(0x1cb)][_0x833f0a(0x1f8)]+_0xd5ad53[_0x833f0a(0x16d)][_0x833f0a(0x195)][_0x833f0a(0x1f8)]+_0xd5ad53[_0x833f0a(0x16d)][_0x833f0a(0x1a6)][_0x833f0a(0x1f8)]+_0xd5ad53[_0x833f0a(0x16d)][_0x833f0a(0x1e9)][_0x833f0a(0x1f8)]+_0xd5ad53['counts'][_0x833f0a(0x1c7)][_0x833f0a(0x1f8)]+_0xd5ad53[_0x833f0a(0x16d)]['chatInterfaces']['unchanged'];console[_0x833f0a(0x1b3)](_0x833f0a(0x1e4)+_0xd5ad53[_0x833f0a(0x1a5)]+'\x27:'),console[_0x833f0a(0x1b3)]('\x20\x20'+a4_0x2ce4db[_0x833f0a(0x1c2)]('+\x20'+_0x50a720+_0x833f0a(0x1a3))+_0x833f0a(0x208)+a4_0x2ce4db[_0x833f0a(0x1f7)]('~\x20'+_0x5273f4+_0x833f0a(0x183))+_0x833f0a(0x208)+a4_0x2ce4db['dim']('=\x20'+_0x212b15+'\x20unchanged')),console[_0x833f0a(0x1b3)](_0x833f0a(0x19a)+formatCountSummary(_0xd5ad53[_0x833f0a(0x16d)][_0x833f0a(0x158)])),console['log'](_0x833f0a(0x201)+formatCountSummary(_0xd5ad53[_0x833f0a(0x16d)]['knowledgeBases'])),console['log'](_0x833f0a(0x14e)+formatCountSummary(_0xd5ad53[_0x833f0a(0x16d)]['textKnowledgeBases'])),console[_0x833f0a(0x1b3)](_0x833f0a(0x163)+formatCountSummary(_0xd5ad53[_0x833f0a(0x16d)][_0x833f0a(0x1cb)])),console[_0x833f0a(0x1b3)]('\x20\x20Integrations:\x20'+formatCountSummary(_0xd5ad53[_0x833f0a(0x16d)][_0x833f0a(0x195)])),console[_0x833f0a(0x1b3)](_0x833f0a(0x1b0)+formatCountSummary(_0xd5ad53['counts'][_0x833f0a(0x1c7)])),console[_0x833f0a(0x1b3)](_0x833f0a(0x153)+formatCountSummary(_0xd5ad53[_0x833f0a(0x16d)][_0x833f0a(0x19d)]));const _0x5c2261=_0xd5ad53[_0x833f0a(0x16d)][_0x833f0a(0x1a6)]['total']>0x0||_0xd5ad53['counts']['experimentalArtifacts'][_0x833f0a(0x1df)]>0x0;_0x5c2261&&(console[_0x833f0a(0x1b3)](_0x833f0a(0x198)+formatCountSummary(_0xd5ad53['counts']['experimentalKnowledgeBases'])),console[_0x833f0a(0x1b3)](_0x833f0a(0x207)+formatCountSummary(_0xd5ad53['counts'][_0x833f0a(0x1e9)])));console[_0x833f0a(0x1b3)]('\x20\x20Target:\x20'+a4_0x2ce4db[_0x833f0a(0x178)](_0xd5ad53['outputDir'])),displayDiffs(_0xd5ad53[_0x833f0a(0x158)],_0xd5ad53[_0x833f0a(0x180)],_0xd5ad53['textKnowledgeBases'],_0xd5ad53[_0x833f0a(0x1cb)],_0xd5ad53[_0x833f0a(0x195)],_0xd5ad53[_0x833f0a(0x1a6)],_0xd5ad53[_0x833f0a(0x1e9)],_0xd5ad53[_0x833f0a(0x1c7)],_0xd5ad53[_0x833f0a(0x19d)]);if(_0x119d42)return console['log'](a4_0x2ce4db['yellow'](_0x833f0a(0x1d5))),0x0;if(_0x50a720===0x0&&_0x5273f4===0x0)return console[_0x833f0a(0x1b3)](a4_0x2ce4db['green'](_0x833f0a(0x154))),saveSessionContext({'llm_project':_0xd5ad53[_0x833f0a(0x1a5)]},_0x2b7e9e[_0x833f0a(0x16f)]),console['log'](a4_0x2ce4db[_0x833f0a(0x1c2)]('✔\x20Context\x20set:\x20'+a4_0x2ce4db[_0x833f0a(0x1e5)]('llm_project')+_0x833f0a(0x1e1)+a4_0x2ce4db['cyan'](_0xd5ad53[_0x833f0a(0x1a5)]))),0x0;if(!_0x3afae7&&!_0x5cc70b){if(!isInteractive())return console[_0x833f0a(0x19b)](a4_0x2ce4db['red'](_0x833f0a(0x151)),_0x833f0a(0x1e2)),console['error'](a4_0x2ce4db[_0x833f0a(0x1e5)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x522cde=await confirmKey('\x0aWrite\x20'+(_0x50a720+_0x5273f4)+_0x833f0a(0x205));if(!_0x522cde)return console['log'](a4_0x2ce4db[_0x833f0a(0x1f7)](_0x833f0a(0x17e)),'-\x20no\x20files\x20written'),0x1;}const {data:_0xcf9dc9}=await withSpinner(_0x833f0a(0x1f2),()=>_0x1d79e7[_0x833f0a(0x1ce)]['pullProject'](_0x4924d5,_0x29b713,{'force':_0x5cc70b}));return console[_0x833f0a(0x1b3)](a4_0x2ce4db[_0x833f0a(0x1c2)](_0x833f0a(0x1d9)+(_0x50a720+_0x5273f4)+'\x20files\x20to\x20'+_0xcf9dc9[_0x833f0a(0x1d7)])),saveSessionContext({'llm_project':_0xcf9dc9[_0x833f0a(0x1a5)]},_0x2b7e9e[_0x833f0a(0x16f)]),console[_0x833f0a(0x1b3)](a4_0x2ce4db['green'](_0x833f0a(0x1cc)+a4_0x2ce4db[_0x833f0a(0x1e5)]('llm_project')+'\x20=\x20'+a4_0x2ce4db[_0x833f0a(0x178)](_0xcf9dc9[_0x833f0a(0x1a5)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x5d14f6(0x1aa)]=a4_0x5d14f6(0x1fb);[a4_0x5d14f6(0x1a9)]=a4_0x5d14f6(0x14b);async[a4_0x5d14f6(0x1e7)](_0x3db997){const _0x20c4bc=a4_0x5d14f6,{options:_0x551644,args:_0x37a780,tdx:_0x1f7cbc}=_0x3db997,_0x4ad408=_0x37a780[0x0],_0x20b452=_0x551644[_0x20c4bc(0x1aa)],_0x76ef7b=_0x551644[_0x20c4bc(0x175)],_0x4737f2=_0x551644[_0x20c4bc(0x1be)],_0x1b35ee=_0x551644['site'],_0x4e174c=_0x551644[_0x20c4bc(0x1d4)];let _0x89e502;const _0xe08bff=findAgentConfigPath(process[_0x20c4bc(0x1b2)]());if(_0x4ad408){const _0x301d0a=a4_0xdacdae['join'](_0x4ad408,_0x20c4bc(0x1f6));existsSync(_0x301d0a)?(_0x89e502=_0x4ad408,console[_0x20c4bc(0x1b3)](a4_0x2ce4db[_0x20c4bc(0x1e5)](_0x20c4bc(0x1d6)+_0x4ad408))):_0x89e502=_0x4ad408;}else{if(_0xe08bff)_0x89e502=a4_0xdacdae[_0x20c4bc(0x1ff)](_0xe08bff),console[_0x20c4bc(0x1b3)](a4_0x2ce4db[_0x20c4bc(0x1e5)]('Using\x20current\x20project:\x20'+_0x89e502));else{if(_0x4e174c){const _0x1fb5d3=sanitizeForFilesystem(_0x4e174c);let _0x130053=_0x1fb5d3,_0x47befb=a4_0xdacdae[_0x20c4bc(0x18b)](process[_0x20c4bc(0x1b2)](),_0x20c4bc(0x158),_0x1fb5d3,_0x20c4bc(0x1f6));if(!existsSync(_0x47befb)){const _0x1433b4=normalizeName(_0x4e174c),_0x45a5b2=a4_0xdacdae[_0x20c4bc(0x18b)](process[_0x20c4bc(0x1b2)](),_0x20c4bc(0x158),_0x1433b4,_0x20c4bc(0x1f6));existsSync(_0x45a5b2)&&(_0x130053=_0x1433b4,_0x47befb=_0x45a5b2);}if(existsSync(_0x47befb))_0x89e502=a4_0xdacdae[_0x20c4bc(0x1ff)](_0x47befb),console[_0x20c4bc(0x1b3)](a4_0x2ce4db['dim']('Using\x20local\x20project:\x20'+_0x89e502));else{const _0x276f56=_0x551644[_0x20c4bc(0x1f0)];if(_0x276f56)throw new SDKError(ErrorCode[_0x20c4bc(0x1d8)],_0x20c4bc(0x1d0)+_0x4e174c+_0x20c4bc(0x1c1),undefined,{'helpText':_0x20c4bc(0x1b6)+_0x20c4bc(0x206)+(_0x20c4bc(0x1c8)+_0x4e174c+'\x0a')+(_0x20c4bc(0x1ad)+_0x130053+_0x20c4bc(0x20b)+(_0x20b452||_0x20c4bc(0x196))+_0x20c4bc(0x174)+_0x276f56)});_0x89e502=_0x4e174c,console[_0x20c4bc(0x1b3)](a4_0x2ce4db[_0x20c4bc(0x1e5)](_0x20c4bc(0x1b5)+_0x4e174c));}}}}if(!_0x89e502)return console['log'](a4_0x2ce4db[_0x20c4bc(0x1f7)](_0x20c4bc(0x1b8))),console['log'](_0x20c4bc(0x159)),console['log'](_0x20c4bc(0x1ca)),console[_0x20c4bc(0x1b3)](_0x20c4bc(0x16c)),console[_0x20c4bc(0x1b3)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x20b452)throw new SDKError(ErrorCode[_0x20c4bc(0x165)],_0x20c4bc(0x1d2),undefined,{'helpText':_0x20c4bc(0x169)});if(!_0x4737f2&&!_0x76ef7b){if(!isInteractive())return console[_0x20c4bc(0x19b)](a4_0x2ce4db['red']('\x0aError:'),_0x20c4bc(0x1e2)),console[_0x20c4bc(0x19b)](a4_0x2ce4db[_0x20c4bc(0x1e5)](_0x20c4bc(0x199))),0x1;const _0x8f7b56=await confirmKey('Clone\x20\x22'+_0x89e502+'\x22\x20to\x20new\x20project\x20\x22'+_0x20b452+'\x22?');if(!_0x8f7b56)return console[_0x20c4bc(0x1b3)](a4_0x2ce4db[_0x20c4bc(0x1f7)](_0x20c4bc(0x17e))),0x1;}const {data:_0x4f5e5f}=await withSpinner(_0x20c4bc(0x1e6)+_0x89e502+_0x20c4bc(0x188)+_0x20b452+'\x22...',()=>_0x1f7cbc[_0x20c4bc(0x1ce)][_0x20c4bc(0x15e)](_0x89e502,_0x20b452,{'dryRun':_0x76ef7b}));if(_0x76ef7b){console[_0x20c4bc(0x1b3)](a4_0x2ce4db[_0x20c4bc(0x1f7)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x20c4bc(0x1b3)](_0x20c4bc(0x162)+_0x4f5e5f[_0x20c4bc(0x1a4)]),console[_0x20c4bc(0x1b3)](_0x20c4bc(0x179)+_0x20b452),console[_0x20c4bc(0x1b3)](_0x20c4bc(0x19c)),console[_0x20c4bc(0x1b3)]('\x20\x20Agents:\x20'+_0x4f5e5f['counts'][_0x20c4bc(0x158)][_0x20c4bc(0x20a)]),console[_0x20c4bc(0x1b3)]('\x20\x20Knowledge\x20Bases:\x20'+_0x4f5e5f[_0x20c4bc(0x16d)][_0x20c4bc(0x180)][_0x20c4bc(0x20a)]),console[_0x20c4bc(0x1b3)](_0x20c4bc(0x163)+_0x4f5e5f[_0x20c4bc(0x16d)]['prompts']['created']),console['log'](_0x20c4bc(0x1b0)+_0x4f5e5f[_0x20c4bc(0x16d)][_0x20c4bc(0x1c7)][_0x20c4bc(0x20a)]),console['log']('\x20\x20Chat\x20Interfaces:\x20'+_0x4f5e5f[_0x20c4bc(0x16d)][_0x20c4bc(0x19d)]['created']);const _0x2e3ac9=_0x4f5e5f[_0x20c4bc(0x16d)][_0x20c4bc(0x1a6)]['created']>0x0||_0x4f5e5f[_0x20c4bc(0x16d)][_0x20c4bc(0x1e9)][_0x20c4bc(0x20a)]>0x0;return _0x2e3ac9&&(console['log'](_0x20c4bc(0x198)+_0x4f5e5f[_0x20c4bc(0x16d)][_0x20c4bc(0x1a6)][_0x20c4bc(0x20a)]),console['log'](_0x20c4bc(0x207)+_0x4f5e5f[_0x20c4bc(0x16d)][_0x20c4bc(0x1e9)][_0x20c4bc(0x20a)])),0x0;}const _0xe2b77b=_0x4f5e5f[_0x20c4bc(0x16d)][_0x20c4bc(0x158)][_0x20c4bc(0x1f4)]>0x0||_0x4f5e5f[_0x20c4bc(0x16d)]['knowledgeBases'][_0x20c4bc(0x1f4)]>0x0||_0x4f5e5f[_0x20c4bc(0x16d)]['prompts']['errors']>0x0||_0x4f5e5f[_0x20c4bc(0x16d)][_0x20c4bc(0x1c7)][_0x20c4bc(0x1f4)]>0x0||_0x4f5e5f[_0x20c4bc(0x16d)][_0x20c4bc(0x19d)][_0x20c4bc(0x1f4)]>0x0||_0x4f5e5f[_0x20c4bc(0x16d)][_0x20c4bc(0x1a6)][_0x20c4bc(0x1f4)]>0x0||_0x4f5e5f[_0x20c4bc(0x16d)]['experimentalArtifacts'][_0x20c4bc(0x1f4)]>0x0;_0xe2b77b?console[_0x20c4bc(0x1b3)](a4_0x2ce4db[_0x20c4bc(0x1f7)](_0x20c4bc(0x1f3))):console[_0x20c4bc(0x1b3)](a4_0x2ce4db[_0x20c4bc(0x1c2)](_0x20c4bc(0x1a1)));console[_0x20c4bc(0x1b3)](_0x20c4bc(0x162)+_0x4f5e5f[_0x20c4bc(0x1a4)]),console['log'](_0x20c4bc(0x179)+_0x4f5e5f['newProjectName']),console['log'](_0x20c4bc(0x19f)+_0x4f5e5f[_0x20c4bc(0x1ba)]),console[_0x20c4bc(0x1b3)](),console[_0x20c4bc(0x1b3)]('Summary:'),console['log'](_0x20c4bc(0x19a)+formatCountSummary(_0x4f5e5f[_0x20c4bc(0x16d)][_0x20c4bc(0x158)])),console[_0x20c4bc(0x1b3)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x4f5e5f[_0x20c4bc(0x16d)][_0x20c4bc(0x180)])),console[_0x20c4bc(0x1b3)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x4f5e5f[_0x20c4bc(0x16d)][_0x20c4bc(0x1cb)])),console[_0x20c4bc(0x1b3)](_0x20c4bc(0x16b)+formatCountSummary(_0x4f5e5f['counts'][_0x20c4bc(0x195)])),console[_0x20c4bc(0x1b3)](_0x20c4bc(0x1b0)+formatCountSummary(_0x4f5e5f[_0x20c4bc(0x16d)]['formInterfaces'])),console[_0x20c4bc(0x1b3)](_0x20c4bc(0x153)+formatCountSummary(_0x4f5e5f['counts'][_0x20c4bc(0x19d)]));const _0x1b8891=_0x4f5e5f[_0x20c4bc(0x16d)]['experimentalKnowledgeBases']['created']>0x0||_0x4f5e5f[_0x20c4bc(0x16d)][_0x20c4bc(0x1a6)]['updated']>0x0||_0x4f5e5f[_0x20c4bc(0x16d)][_0x20c4bc(0x1a6)][_0x20c4bc(0x1f8)]>0x0||_0x4f5e5f[_0x20c4bc(0x16d)][_0x20c4bc(0x1e9)][_0x20c4bc(0x20a)]>0x0||_0x4f5e5f['counts'][_0x20c4bc(0x1e9)]['updated']>0x0||_0x4f5e5f[_0x20c4bc(0x16d)][_0x20c4bc(0x1e9)]['unchanged']>0x0;_0x1b8891&&(console['log'](_0x20c4bc(0x198)+formatCountSummary(_0x4f5e5f[_0x20c4bc(0x16d)][_0x20c4bc(0x1a6)])),console[_0x20c4bc(0x1b3)](_0x20c4bc(0x207)+formatCountSummary(_0x4f5e5f[_0x20c4bc(0x16d)][_0x20c4bc(0x1e9)])));if(_0xe2b77b){console[_0x20c4bc(0x1b3)](),console['log'](a4_0x2ce4db[_0x20c4bc(0x19e)](_0x20c4bc(0x1db)));for(const _0x41dbb2 of _0x4f5e5f[_0x20c4bc(0x158)]){_0x41dbb2[_0x20c4bc(0x150)]===_0x20c4bc(0x19b)&&console['log'](a4_0x2ce4db[_0x20c4bc(0x19e)](_0x20c4bc(0x1ea)+_0x41dbb2['agentName']+_0x20c4bc(0x200)+_0x41dbb2['error']));}for(const _0x3f705b of _0x4f5e5f[_0x20c4bc(0x180)]){_0x3f705b[_0x20c4bc(0x150)]===_0x20c4bc(0x19b)&&console[_0x20c4bc(0x1b3)](a4_0x2ce4db[_0x20c4bc(0x19e)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x3f705b['name']+'\x22:\x20'+_0x3f705b[_0x20c4bc(0x19b)]));}for(const _0x2a859f of _0x4f5e5f[_0x20c4bc(0x1cb)]){_0x2a859f[_0x20c4bc(0x150)]==='error'&&console[_0x20c4bc(0x1b3)](a4_0x2ce4db[_0x20c4bc(0x19e)](_0x20c4bc(0x1e8)+_0x2a859f['name']+_0x20c4bc(0x200)+_0x2a859f[_0x20c4bc(0x19b)]));}for(const _0x53a179 of _0x4f5e5f['integrations']){_0x53a179[_0x20c4bc(0x150)]===_0x20c4bc(0x19b)&&console['log'](a4_0x2ce4db['red'](_0x20c4bc(0x193)+_0x53a179[_0x20c4bc(0x1aa)]+_0x20c4bc(0x200)+_0x53a179[_0x20c4bc(0x19b)]));}for(const _0x390829 of _0x4f5e5f[_0x20c4bc(0x1c7)]){_0x390829['action']==='error'&&console['log'](a4_0x2ce4db[_0x20c4bc(0x19e)](_0x20c4bc(0x184)+_0x390829[_0x20c4bc(0x1aa)]+_0x20c4bc(0x200)+_0x390829[_0x20c4bc(0x19b)]));}for(const _0x5ea599 of _0x4f5e5f[_0x20c4bc(0x19d)]){_0x5ea599[_0x20c4bc(0x150)]===_0x20c4bc(0x19b)&&console['log'](a4_0x2ce4db[_0x20c4bc(0x19e)]('\x20\x20Chat\x20Interface\x20\x22'+_0x5ea599[_0x20c4bc(0x1aa)]+_0x20c4bc(0x200)+_0x5ea599[_0x20c4bc(0x19b)]));}for(const _0x402ce2 of _0x4f5e5f[_0x20c4bc(0x1a6)]){_0x402ce2[_0x20c4bc(0x150)]===_0x20c4bc(0x19b)&&console[_0x20c4bc(0x1b3)](a4_0x2ce4db[_0x20c4bc(0x19e)]('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0x402ce2[_0x20c4bc(0x1aa)]+_0x20c4bc(0x200)+_0x402ce2[_0x20c4bc(0x19b)]));}for(const _0x921534 of _0x4f5e5f[_0x20c4bc(0x1e9)]){_0x921534[_0x20c4bc(0x150)]===_0x20c4bc(0x19b)&&console[_0x20c4bc(0x1b3)](a4_0x2ce4db['red'](_0x20c4bc(0x191)+_0x921534[_0x20c4bc(0x1aa)]+'\x22:\x20'+_0x921534[_0x20c4bc(0x19b)]));}return 0x1;}console[_0x20c4bc(0x1b3)]();const _0x269293=getLLMProjectUrl(_0x1b35ee,_0x4f5e5f[_0x20c4bc(0x1ba)]);return console[_0x20c4bc(0x1b3)](_0x20c4bc(0x17a)+a4_0x2ce4db[_0x20c4bc(0x178)](_0x269293)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x5d14f6(0x1aa)]=a4_0x5d14f6(0x18a);[a4_0x5d14f6(0x1a9)]='Push\x20local\x20agent\x20files\x20to\x20LLM\x20project';async[a4_0x5d14f6(0x1e7)](_0x4f3b61){const _0x54c5de=a4_0x5d14f6,{options:_0x2a7c3b,args:_0x4d0a0f,tdx:_0x299622}=_0x4f3b61;let _0x58323b=_0x4d0a0f[0x0]||process[_0x54c5de(0x1b2)]();const _0x1350ff=_0x2a7c3b[_0x54c5de(0x175)],_0x44378a=_0x2a7c3b[_0x54c5de(0x176)],_0x475396=_0x2a7c3b[_0x54c5de(0x1be)],_0x257279=_0x2a7c3b[_0x54c5de(0x18f)],_0x27e52e=a4_0xdacdae['join'](_0x58323b,_0x54c5de(0x1fa)),_0x499627=existsSync(_0x27e52e);if(_0x499627){const {data:_0x15fe82}=await withSpinner(_0x54c5de(0x1fe)+_0x58323b+_0x54c5de(0x1cf),()=>_0x299622['llm'][_0x54c5de(0x168)](_0x58323b,{'dryRun':_0x1350ff,'force':_0x44378a}));if(_0x1350ff)return console[_0x54c5de(0x1b3)](a4_0x2ce4db[_0x54c5de(0x1f7)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x54c5de(0x1b3)]('Would\x20push\x20agent:\x20'+_0x15fe82[_0x54c5de(0x209)]),0x0;if(_0x15fe82[_0x54c5de(0x150)]===_0x54c5de(0x19b))return console[_0x54c5de(0x1b3)](a4_0x2ce4db[_0x54c5de(0x19e)](_0x54c5de(0x186)+_0x15fe82[_0x54c5de(0x19b)])),0x1;console[_0x54c5de(0x1b3)](a4_0x2ce4db['green'](_0x54c5de(0x17c)+_0x15fe82[_0x54c5de(0x150)]+_0x54c5de(0x202))),console[_0x54c5de(0x1b3)]('Agent:\x20'+_0x15fe82[_0x54c5de(0x209)]);if(_0x15fe82[_0x54c5de(0x1a8)]&&_0x15fe82[_0x54c5de(0x157)]){const _0x48e01e=getLLMAgentChatUrl(_0x257279,_0x15fe82[_0x54c5de(0x157)],_0x15fe82['agentId']);console[_0x54c5de(0x1b3)]('Chat:\x20'+a4_0x2ce4db[_0x54c5de(0x178)](_0x48e01e));}return 0x0;}const _0x5026cb=_0x2a7c3b[_0x54c5de(0x1d4)],_0x5c0980=resolveProjectFromContext(_0x58323b,_0x5026cb);if(_0x5c0980[_0x54c5de(0x14c)])_0x58323b=_0x5c0980[_0x54c5de(0x17f)],_0x5c0980[_0x54c5de(0x190)]===_0x54c5de(0x1e0)&&console[_0x54c5de(0x1b3)](a4_0x2ce4db['dim'](_0x54c5de(0x1ae)+_0x58323b));else{let _0xa03c8='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x5c0980[_0x54c5de(0x192)]==='no_local_folder'&&(_0xa03c8=_0x5c0980[_0x54c5de(0x18c)]+_0x54c5de(0x182)+_0x5c0980[_0x54c5de(0x1d4)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x5c0980[_0x54c5de(0x192)]===_0x54c5de(0x177)?_0x5c0980[_0x54c5de(0x18c)]:_0x54c5de(0x1c0)+_0x58323b,undefined,{'helpText':_0xa03c8});}const {data:_0x4b0138}=await withSpinner(_0x54c5de(0x1bd),()=>_0x299622[_0x54c5de(0x1ce)][_0x54c5de(0x14d)](_0x58323b,{'dryRun':!![]})),_0x1104de=_0x4b0138[_0x54c5de(0x16d)][_0x54c5de(0x158)][_0x54c5de(0x1f4)]>0x0;if(_0x1104de){console[_0x54c5de(0x1b3)](a4_0x2ce4db['red'](_0x54c5de(0x1bc)));for(const _0xd68698 of _0x4b0138[_0x54c5de(0x158)]){_0xd68698[_0x54c5de(0x150)]===_0x54c5de(0x19b)&&console[_0x54c5de(0x1b3)](a4_0x2ce4db[_0x54c5de(0x19e)](_0x54c5de(0x1ea)+_0xd68698[_0x54c5de(0x209)]+_0x54c5de(0x200)+_0xd68698[_0x54c5de(0x19b)]));}return 0x1;}const _0x25a4ee=_0x4b0138['counts'][_0x54c5de(0x158)][_0x54c5de(0x20a)]+_0x4b0138['counts'][_0x54c5de(0x180)][_0x54c5de(0x20a)]+_0x4b0138['counts'][_0x54c5de(0x17d)][_0x54c5de(0x20a)]+_0x4b0138[_0x54c5de(0x16d)][_0x54c5de(0x1cb)][_0x54c5de(0x20a)]+_0x4b0138[_0x54c5de(0x16d)]['integrations']['created']+_0x4b0138[_0x54c5de(0x16d)][_0x54c5de(0x1a6)][_0x54c5de(0x20a)]+_0x4b0138['counts']['experimentalArtifacts'][_0x54c5de(0x20a)]+_0x4b0138[_0x54c5de(0x16d)][_0x54c5de(0x1c7)][_0x54c5de(0x20a)]+_0x4b0138['counts']['chatInterfaces'][_0x54c5de(0x20a)],_0x128055=_0x4b0138[_0x54c5de(0x16d)][_0x54c5de(0x158)][_0x54c5de(0x1ee)]+_0x4b0138[_0x54c5de(0x16d)][_0x54c5de(0x180)][_0x54c5de(0x1ee)]+_0x4b0138[_0x54c5de(0x16d)][_0x54c5de(0x17d)]['updated']+_0x4b0138[_0x54c5de(0x16d)][_0x54c5de(0x1cb)][_0x54c5de(0x1ee)]+_0x4b0138[_0x54c5de(0x16d)][_0x54c5de(0x195)][_0x54c5de(0x1ee)]+_0x4b0138[_0x54c5de(0x16d)][_0x54c5de(0x1a6)][_0x54c5de(0x1ee)]+_0x4b0138[_0x54c5de(0x16d)]['experimentalArtifacts'][_0x54c5de(0x1ee)]+_0x4b0138[_0x54c5de(0x16d)]['formInterfaces'][_0x54c5de(0x1ee)]+_0x4b0138[_0x54c5de(0x16d)]['chatInterfaces'][_0x54c5de(0x1ee)],_0x384bc2=_0x4b0138[_0x54c5de(0x16d)][_0x54c5de(0x158)][_0x54c5de(0x1f8)]+_0x4b0138[_0x54c5de(0x16d)]['knowledgeBases']['unchanged']+_0x4b0138[_0x54c5de(0x16d)][_0x54c5de(0x17d)][_0x54c5de(0x1f8)]+_0x4b0138[_0x54c5de(0x16d)][_0x54c5de(0x1cb)]['unchanged']+_0x4b0138[_0x54c5de(0x16d)]['integrations'][_0x54c5de(0x1f8)]+_0x4b0138['counts']['experimentalKnowledgeBases'][_0x54c5de(0x1f8)]+_0x4b0138['counts'][_0x54c5de(0x1e9)][_0x54c5de(0x1f8)]+_0x4b0138[_0x54c5de(0x16d)][_0x54c5de(0x1c7)][_0x54c5de(0x1f8)]+_0x4b0138[_0x54c5de(0x16d)][_0x54c5de(0x19d)]['unchanged'];console[_0x54c5de(0x1b3)](_0x54c5de(0x1de)+_0x4b0138[_0x54c5de(0x1a5)]+'\x27:'),console[_0x54c5de(0x1b3)]('\x20\x20'+a4_0x2ce4db['green']('+\x20'+_0x25a4ee+_0x54c5de(0x1a3))+'\x20|\x20'+a4_0x2ce4db[_0x54c5de(0x1f7)]('~\x20'+_0x128055+_0x54c5de(0x183))+_0x54c5de(0x208)+a4_0x2ce4db[_0x54c5de(0x1e5)]('=\x20'+_0x384bc2+_0x54c5de(0x17b))),console[_0x54c5de(0x1b3)](_0x54c5de(0x19a)+formatCountSummary(_0x4b0138['counts']['agents'])),console[_0x54c5de(0x1b3)](_0x54c5de(0x201)+formatCountSummary(_0x4b0138['counts'][_0x54c5de(0x180)])),console['log'](_0x54c5de(0x14e)+formatCountSummary(_0x4b0138[_0x54c5de(0x16d)][_0x54c5de(0x17d)])),console[_0x54c5de(0x1b3)](_0x54c5de(0x163)+formatCountSummary(_0x4b0138['counts'][_0x54c5de(0x1cb)])),console[_0x54c5de(0x1b3)](_0x54c5de(0x16b)+formatCountSummary(_0x4b0138[_0x54c5de(0x16d)]['integrations'])),console[_0x54c5de(0x1b3)](_0x54c5de(0x1b0)+formatCountSummary(_0x4b0138[_0x54c5de(0x16d)][_0x54c5de(0x1c7)])),console['log'](_0x54c5de(0x153)+formatCountSummary(_0x4b0138['counts']['chatInterfaces']));const _0x5da496=_0x4b0138['counts']['experimentalKnowledgeBases'][_0x54c5de(0x20a)]>0x0||_0x4b0138[_0x54c5de(0x16d)][_0x54c5de(0x1a6)][_0x54c5de(0x1ee)]>0x0||_0x4b0138['counts'][_0x54c5de(0x1a6)]['unchanged']>0x0||_0x4b0138['counts'][_0x54c5de(0x1e9)][_0x54c5de(0x20a)]>0x0||_0x4b0138['counts'][_0x54c5de(0x1e9)]['updated']>0x0||_0x4b0138[_0x54c5de(0x16d)][_0x54c5de(0x1e9)]['unchanged']>0x0;_0x5da496&&(console[_0x54c5de(0x1b3)](_0x54c5de(0x198)+formatCountSummary(_0x4b0138[_0x54c5de(0x16d)][_0x54c5de(0x1a6)])),console[_0x54c5de(0x1b3)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x4b0138[_0x54c5de(0x16d)][_0x54c5de(0x1e9)])));console[_0x54c5de(0x1b3)](_0x54c5de(0x14a)+a4_0x2ce4db[_0x54c5de(0x178)](_0x58323b)),displayDiffs(_0x4b0138[_0x54c5de(0x158)],_0x4b0138['knowledgeBases'],_0x4b0138[_0x54c5de(0x17d)],_0x4b0138[_0x54c5de(0x1cb)],_0x4b0138[_0x54c5de(0x195)],_0x4b0138['experimentalKnowledgeBases'],_0x4b0138['experimentalArtifacts'],_0x4b0138['formInterfaces'],_0x4b0138[_0x54c5de(0x19d)]);if(_0x1350ff)return console['log'](a4_0x2ce4db[_0x54c5de(0x1f7)](_0x54c5de(0x1e3))),0x0;if(_0x25a4ee===0x0&&_0x128055===0x0){console[_0x54c5de(0x1b3)](a4_0x2ce4db[_0x54c5de(0x1c2)](_0x54c5de(0x1b7)));const _0x18fb5f=getLLMProjectUrl(_0x257279,_0x4b0138[_0x54c5de(0x157)]);return console[_0x54c5de(0x1b3)](_0x54c5de(0x17a)+a4_0x2ce4db[_0x54c5de(0x178)](_0x18fb5f)),0x0;}if(!_0x475396&&!_0x44378a){if(!isInteractive())return console[_0x54c5de(0x19b)](a4_0x2ce4db[_0x54c5de(0x19e)](_0x54c5de(0x151)),_0x54c5de(0x1e2)),console[_0x54c5de(0x19b)](a4_0x2ce4db[_0x54c5de(0x1e5)](_0x54c5de(0x199))),0x1;const _0x82ce8e=await confirmKey(_0x54c5de(0x1f9)+(_0x25a4ee+_0x128055)+_0x54c5de(0x1c3));if(!_0x82ce8e)return console['log'](a4_0x2ce4db['yellow'](_0x54c5de(0x17e)),_0x54c5de(0x161)),0x1;}const {data:_0x3a65a1}=await withSpinner('Pushing\x20to\x20project...',()=>_0x299622[_0x54c5de(0x1ce)][_0x54c5de(0x14d)](_0x58323b,{'force':_0x44378a})),_0x710347=_0x3a65a1[_0x54c5de(0x16d)][_0x54c5de(0x158)][_0x54c5de(0x1f4)]>0x0||_0x3a65a1[_0x54c5de(0x16d)][_0x54c5de(0x180)]['errors']>0x0||_0x3a65a1[_0x54c5de(0x16d)][_0x54c5de(0x17d)][_0x54c5de(0x1f4)]>0x0||_0x3a65a1['counts'][_0x54c5de(0x1cb)][_0x54c5de(0x1f4)]>0x0||_0x3a65a1['counts'][_0x54c5de(0x1c7)]['errors']>0x0||_0x3a65a1[_0x54c5de(0x16d)][_0x54c5de(0x19d)][_0x54c5de(0x1f4)]>0x0;if(_0x710347){console[_0x54c5de(0x1b3)](a4_0x2ce4db[_0x54c5de(0x1f7)]('\x0aProject\x20pushed\x20with\x20errors')),console[_0x54c5de(0x1b3)](),console[_0x54c5de(0x1b3)](a4_0x2ce4db[_0x54c5de(0x19e)](_0x54c5de(0x1db)));for(const _0x278bfe of _0x3a65a1[_0x54c5de(0x158)]){_0x278bfe[_0x54c5de(0x150)]===_0x54c5de(0x19b)&&console[_0x54c5de(0x1b3)](a4_0x2ce4db[_0x54c5de(0x19e)](_0x54c5de(0x1ea)+_0x278bfe[_0x54c5de(0x209)]+'\x22:\x20'+_0x278bfe['error']));}for(const _0x43c89a of _0x3a65a1[_0x54c5de(0x180)]){_0x43c89a['action']===_0x54c5de(0x19b)&&console[_0x54c5de(0x1b3)](a4_0x2ce4db[_0x54c5de(0x19e)](_0x54c5de(0x181)+_0x43c89a['name']+'\x22:\x20'+_0x43c89a[_0x54c5de(0x19b)]));}for(const _0x18de1a of _0x3a65a1[_0x54c5de(0x17d)]){_0x18de1a['action']===_0x54c5de(0x19b)&&console[_0x54c5de(0x1b3)](a4_0x2ce4db[_0x54c5de(0x19e)]('\x20\x20Text\x20Knowledge\x20Base\x20\x22'+_0x18de1a['name']+_0x54c5de(0x200)+_0x18de1a['error']));}for(const _0x2821dd of _0x3a65a1[_0x54c5de(0x1cb)]){_0x2821dd[_0x54c5de(0x150)]===_0x54c5de(0x19b)&&console[_0x54c5de(0x1b3)](a4_0x2ce4db[_0x54c5de(0x19e)](_0x54c5de(0x1e8)+_0x2821dd['name']+_0x54c5de(0x200)+_0x2821dd[_0x54c5de(0x19b)]));}for(const _0x605e7d of _0x3a65a1[_0x54c5de(0x195)]){_0x605e7d[_0x54c5de(0x150)]===_0x54c5de(0x19b)&&console[_0x54c5de(0x1b3)](a4_0x2ce4db['red'](_0x54c5de(0x193)+_0x605e7d[_0x54c5de(0x1aa)]+_0x54c5de(0x200)+_0x605e7d[_0x54c5de(0x19b)]));}for(const _0x44917d of _0x3a65a1[_0x54c5de(0x1c7)]){_0x44917d['action']===_0x54c5de(0x19b)&&console[_0x54c5de(0x1b3)](a4_0x2ce4db[_0x54c5de(0x19e)]('\x20\x20Form\x20Interface\x20\x22'+_0x44917d[_0x54c5de(0x1aa)]+_0x54c5de(0x200)+_0x44917d[_0x54c5de(0x19b)]));}for(const _0x4bc130 of _0x3a65a1[_0x54c5de(0x19d)]){_0x4bc130[_0x54c5de(0x150)]===_0x54c5de(0x19b)&&console[_0x54c5de(0x1b3)](a4_0x2ce4db[_0x54c5de(0x19e)]('\x20\x20Chat\x20Interface\x20\x22'+_0x4bc130[_0x54c5de(0x1aa)]+'\x22:\x20'+_0x4bc130['error']));}return 0x1;}console['log'](a4_0x2ce4db['green'](_0x54c5de(0x171)+(_0x25a4ee+_0x128055)+'\x20resources\x20to\x20\x27'+_0x3a65a1[_0x54c5de(0x1a5)]+'\x27'));const _0x3daa62=getLLMProjectUrl(_0x257279,_0x3a65a1[_0x54c5de(0x157)]);return console[_0x54c5de(0x1b3)](_0x54c5de(0x17a)+a4_0x2ce4db[_0x54c5de(0x178)](_0x3daa62)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x3db408=a5_0x5ca1;(function(_0x4ab298,_0x5d1d2b){const _0x5ea390=a5_0x5ca1,_0x1aa91f=_0x4ab298();while(!![]){try{const _0x5b5b70=-parseInt(_0x5ea390(0x110))/0x1*(parseInt(_0x5ea390(0x140))/0x2)+-parseInt(_0x5ea390(0x122))/0x3*(-parseInt(_0x5ea390(0x147))/0x4)+parseInt(_0x5ea390(0x11d))/0x5*(parseInt(_0x5ea390(0x18b))/0x6)+-parseInt(_0x5ea390(0x148))/0x7+parseInt(_0x5ea390(0x105))/0x8+parseInt(_0x5ea390(0x138))/0x9*(-parseInt(_0x5ea390(0x150))/0xa)+-parseInt(_0x5ea390(0x12c))/0xb*(-parseInt(_0x5ea390(0x142))/0xc);if(_0x5b5b70===_0x5d1d2b)break;else _0x1aa91f['push'](_0x1aa91f['shift']());}catch(_0x673a06){_0x1aa91f['push'](_0x1aa91f['shift']());}}}(a5_0x3319,0xef71e));import*as a5_0x1173a6 from'node:fs';function a5_0x3319(){const _0x3a0203=['message','Errors:\x20\x20\x20','size','Output\x20written\x20to:\x20','tests','join','Round\x20','Re-evaluation\x20Summary','now','213666ByxhXF','executeReeval','testName','Round\x201/','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','Cached\x20run\x20from:\x20',':\x20Sending\x20user\x20input...','\x20\x20Round\x20','description','\x20\x20Project:\x20','includes','Project\x20path:\x20','json','output','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','timestamp','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','404','Run\x20\x27tdx\x20agent\x20pull\x20','8722872MvfsIT','Available\x20tests:\x20','source','/<agent-name>','projectDir','stop','utf-8','Either\x20switch\x20to\x20the\x20\x22','...','site','llm','1aAxMnd','no_tests','red','\x20\x20-\x20','tsv','Duration:\x20','No\x20tests\x20found\x20matching:\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)','filter','Test\x20','Usage:','jsonl','some','80WFPprV','rounds','\x22,\x20but\x20current\x20site\x20is\x20\x22','conversations','Using\x20agent:\x20','147fqvRpc','dim','round','Failed:\x20\x20\x20','Total:\x20\x20\x20\x20','Run\x20tests\x20for\x20an\x20LLM\x20agent','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','existsSync','FAIL','toLowerCase','8661015IVBTTE','\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','...\x20','status','Available\x20tags:\x20','length','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','conversation_url','map','✗\x20ERROR:\x20Project\x20not\x20found:\x20','start','Failed\x20Tests:','10297341bLoJtk','basename','Conversation\x20URL:\x20','Re-evaluating\x20cached\x20test\x20run...','green','toISOString','Agent:\x20','No\x20tests\x20have\x20tags\x20defined.','574612PBVVWY','writeFileSync','12KbPzvX','Test\x20Summary','\x20-\x20','agent:test','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','113392RJSsiW','9970317BcfKLN','add','agent','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','\x20\x20Site:\x20','push','✗\x20ERROR:\x20','No\x20tests\x20found\x20with\x20tags:\x20','10oQdOHx','Executing\x20new\x20tests...','no_local_folder','execute','✗\x20FAIL:\x20','tags','✓\x20PASS:\x20','llmProject','\x22:\x20','testYmlPath','resolveAgentId','New\x20tests\x20to\x20execute:\x20','white','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','resolve','\x20(cached)','reason','verbose','log','name','agentName','substring','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','dryRun','Error\x20writing\x20output\x20file:\x20','forEach','\x20\x20Evaluating...\x20','repeat','\x20\x20Conversation:\x20','PASS','split','trim','yellow','has','Running\x20test:\x20','Passed:\x20\x20\x20','projectName','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','Running:\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','Error:\x20No\x20previous\x20test\x20run\x20found.','multiple_agents','cyan','Re-evaluating\x20','\x20(new)','table','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','ERROR','text','no_context'];a5_0x3319=function(){return _0x3a0203;};return a5_0x3319();}import*as a5_0x1f8473 from'node:path';import a5_0x53e721 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';function a5_0x5ca1(_0x594e78,_0x2d5b65){_0x594e78=_0x594e78-0xf3;const _0x331969=a5_0x3319();let _0x5ca1bc=_0x331969[_0x594e78];return _0x5ca1bc;}export class AgentTestCommand extends BaseCommand{[a5_0x3db408(0x163)]=a5_0x3db408(0x145);[a5_0x3db408(0xfa)]=a5_0x3db408(0x127);async[a5_0x3db408(0x153)](_0x18af7f){const _0x381120=a5_0x3db408,{options:_0x1291c5,args:_0x39d847,tdx:_0x1d084a}=_0x18af7f,_0x5d4e9c=_0x39d847[0x0]||'.',_0x494c2b=_0x1291c5[_0x381120(0x167)],_0x11bc47=_0x1291c5,_0x1bf8cd=_0x11bc47['eval']===![],_0x27a320=_0x11bc47['reeval'],_0x1f9b41=_0x11bc47[_0x381120(0x163)],_0x3a8e99=_0x11bc47[_0x381120(0x155)],_0x588b1f=_0x1291c5['site'],_0x3810f6=_0x11bc47[_0x381120(0xff)];if(_0x27a320&&_0x1bf8cd)return console['log'](a5_0x53e721[_0x381120(0x112)]('Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval')),0x1;let _0x5e5eb4=_0x381120(0x17d);if(_0x11bc47['json'])_0x5e5eb4=_0x381120(0xfe);else{if(_0x11bc47[_0x381120(0x11b)])_0x5e5eb4=_0x381120(0x11b);else{if(_0x11bc47[_0x381120(0x114)])_0x5e5eb4=_0x381120(0x114);else{if(_0x11bc47['table'])_0x5e5eb4=_0x381120(0x17d);}}}const _0x593cbe=_0x11bc47[_0x381120(0x157)];let _0x2453cc=_0x5d4e9c;const _0x41ac02=a5_0x1173a6[_0x381120(0x129)](_0x5d4e9c),_0x4833af=_0x5d4e9c==='.';if(!_0x41ac02||_0x4833af){const _0x51b29b=resolveProjectFromContext(_0x5d4e9c,_0x593cbe,{'requireFile':'test.yml'});if(_0x51b29b['found'])_0x2453cc=_0x51b29b[_0x381120(0x109)],_0x51b29b[_0x381120(0x107)]==='context'&&console['log'](a5_0x53e721[_0x381120(0x123)](_0x381120(0x121)+_0x2453cc));else switch(_0x51b29b['reason']){case _0x381120(0x181):console[_0x381120(0x162)](a5_0x53e721[_0x381120(0x170)](_0x51b29b[_0x381120(0x182)])),console[_0x381120(0x162)](),console[_0x381120(0x162)](_0x381120(0x11a)),console[_0x381120(0x162)](_0x381120(0x12d)),console[_0x381120(0x162)](_0x381120(0x117)),console['log'](),console[_0x381120(0x162)](_0x381120(0x128));return 0x1;case _0x381120(0x152):console[_0x381120(0x162)](a5_0x53e721[_0x381120(0x170)](_0x51b29b[_0x381120(0x182)])),console[_0x381120(0x162)](),console['log'](_0x381120(0x104)+_0x51b29b['llmProject']+'\x27\x20to\x20create\x20the\x20folder\x20structure.');return 0x1;case _0x381120(0x179):{const _0x4ae4a0=a5_0x1f8473[_0x381120(0x139)](_0x51b29b[_0x381120(0x109)]);console['log'](a5_0x53e721[_0x381120(0x170)](_0x381120(0x175)+_0x51b29b['llmProject']+'\x22:'));for(const _0x4e1d35 of _0x51b29b['agentDirs']){console[_0x381120(0x162)](_0x381120(0x113)+_0x4e1d35);}return console[_0x381120(0x162)](),console[_0x381120(0x162)]('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x4ae4a0+_0x381120(0x108)),0x1;}case _0x381120(0x111):console[_0x381120(0x162)](a5_0x53e721[_0x381120(0x170)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x51b29b[_0x381120(0x157)]+'\x22.')),console[_0x381120(0x162)](a5_0x53e721[_0x381120(0x123)](_0x381120(0xfd)+_0x51b29b['projectDir'])),console['log'](),console[_0x381120(0x162)](_0x381120(0x15d));return 0x1;}}const {definition:_0x3ea7a2,agentInfo:_0x30905e}=parseTestFile(_0x2453cc);let _0x4e879d=_0x3ea7a2[_0x381120(0x186)];if(_0x1f9b41){const _0x167b07=_0x1f9b41[_0x381120(0x16e)](',')[_0x381120(0x134)](_0x2963df=>_0x2963df[_0x381120(0x16f)]());_0x4e879d=_0x3ea7a2[_0x381120(0x186)][_0x381120(0x118)](_0x1c558a=>_0x167b07[_0x381120(0xfc)](_0x1c558a[_0x381120(0x163)]));if(_0x4e879d['length']===0x0)return console[_0x381120(0x162)](a5_0x53e721[_0x381120(0x170)](_0x381120(0x116)+_0x1f9b41)),console[_0x381120(0x162)](a5_0x53e721['dim'](_0x381120(0x106)+_0x3ea7a2[_0x381120(0x186)][_0x381120(0x134)](_0x53af5a=>_0x53af5a[_0x381120(0x163)])[_0x381120(0x187)](',\x20'))),0x1;}if(_0x3a8e99){const _0x43c6fa=_0x3a8e99['split'](',')[_0x381120(0x134)](_0x49f2df=>_0x49f2df[_0x381120(0x16f)]()[_0x381120(0x12b)]());_0x4e879d=_0x4e879d[_0x381120(0x118)](_0x134659=>_0x134659[_0x381120(0x155)]?.[_0x381120(0x11c)](_0x457ff5=>_0x43c6fa[_0x381120(0xfc)](_0x457ff5[_0x381120(0x12b)]())));if(_0x4e879d[_0x381120(0x131)]===0x0){console[_0x381120(0x162)](a5_0x53e721[_0x381120(0x170)](_0x381120(0x14f)+_0x3a8e99));const _0x578191=new Set();return _0x3ea7a2[_0x381120(0x186)][_0x381120(0x169)](_0x2deedb=>_0x2deedb[_0x381120(0x155)]?.['forEach'](_0x1bd9ae=>_0x578191[_0x381120(0x149)](_0x1bd9ae))),_0x578191[_0x381120(0x184)]>0x0?console[_0x381120(0x162)](a5_0x53e721[_0x381120(0x123)](_0x381120(0x130)+[..._0x578191][_0x381120(0x187)](',\x20'))):console[_0x381120(0x162)](a5_0x53e721[_0x381120(0x123)](_0x381120(0x13f))),0x1;}}if(_0x27a320)return this['executeReeval'](_0x18af7f,{'definition':{'tests':_0x4e879d},'agentInfo':_0x30905e,'outputFormat':_0x5e5eb4,'outputFile':_0x3810f6,'testNames':_0x1f9b41});if(_0x494c2b){console[_0x381120(0x162)](a5_0x53e721[_0x381120(0x17a)]('Test\x20Configuration:')),console[_0x381120(0x162)](_0x381120(0x14c)+a5_0x53e721[_0x381120(0x15c)](_0x588b1f)),console[_0x381120(0x162)](_0x381120(0xfb)+a5_0x53e721[_0x381120(0x15c)](_0x30905e[_0x381120(0x174)])),console[_0x381120(0x162)]('\x20\x20Agent:\x20'+a5_0x53e721[_0x381120(0x15c)](_0x30905e[_0x381120(0x164)])),console['log'](),console[_0x381120(0x162)]('Tests\x20found:\x20'+a5_0x53e721[_0x381120(0x15c)](_0x4e879d[_0x381120(0x131)]));for(let _0x421c71=0x0;_0x421c71<_0x4e879d['length'];_0x421c71++){const _0x3ebc46=_0x4e879d[_0x421c71],_0x54fc19=_0x3ebc46[_0x381120(0x11e)][_0x381120(0x131)]===0x1?_0x381120(0x124):'rounds',_0x4b2b1d=_0x3ebc46[_0x381120(0x155)]?.[_0x381120(0x131)]?'\x20['+_0x3ebc46[_0x381120(0x155)]['join'](',\x20')+']':'';console[_0x381120(0x162)]('\x20\x20'+(_0x421c71+0x1)+'.\x20'+a5_0x53e721[_0x381120(0x15c)](_0x3ebc46[_0x381120(0x163)])+'\x20('+_0x3ebc46[_0x381120(0x11e)][_0x381120(0x131)]+'\x20'+_0x54fc19+')'+a5_0x53e721[_0x381120(0x123)](_0x4b2b1d));}return 0x0;}let _0x88506d,_0x248fcb;try{_0x88506d=await _0x1d084a[_0x381120(0x10f)]['resolveProjectId'](_0x30905e['projectName']);}catch(_0x2c7d40){const _0x22cc50=_0x2c7d40 instanceof Error?_0x2c7d40[_0x381120(0x182)]:String(_0x2c7d40);return _0x22cc50[_0x381120(0xfc)]('404')||_0x22cc50['toLowerCase']()[_0x381120(0xfc)]('not\x20found')?console[_0x381120(0x162)](a5_0x53e721[_0x381120(0x112)](_0x381120(0x135)+_0x30905e[_0x381120(0x174)])):console['log'](a5_0x53e721[_0x381120(0x112)](_0x381120(0x146)+_0x30905e[_0x381120(0x174)]+_0x381120(0x158)+_0x22cc50)),0x1;}try{_0x248fcb=await _0x1d084a[_0x381120(0x10f)][_0x381120(0x15a)](_0x30905e['agentName'],_0x88506d);}catch(_0x5b2bea){const _0x2fbe21=_0x5b2bea instanceof Error?_0x5b2bea[_0x381120(0x182)]:String(_0x5b2bea);return _0x2fbe21[_0x381120(0xfc)](_0x381120(0x103))||_0x2fbe21[_0x381120(0x12b)]()[_0x381120(0xfc)]('not\x20found')?console['log'](a5_0x53e721[_0x381120(0x112)](_0x381120(0xf6)+_0x30905e['agentName'])):console['log'](a5_0x53e721[_0x381120(0x112)](_0x381120(0x100)+_0x30905e[_0x381120(0x164)]+_0x381120(0x158)+_0x2fbe21)),0x1;}let _0x2b1134;if(!_0x1bf8cd)try{_0x2b1134=await setupEvaluatorAgent(_0x1d084a[_0x381120(0x10f)],_0x1291c5['verbose']);}catch(_0x488865){const _0x12a206=_0x488865 instanceof Error?_0x488865[_0x381120(0x182)]:String(_0x488865);return console['log'](a5_0x53e721[_0x381120(0x112)](_0x381120(0x166)+_0x12a206)),0x1;}console[_0x381120(0x162)](a5_0x53e721[_0x381120(0x17a)]('Running\x20agent\x20tests...')),console[_0x381120(0x162)]('Site:\x20'+a5_0x53e721['white'](_0x588b1f)),console[_0x381120(0x162)]('Agent:\x20'+a5_0x53e721[_0x381120(0x15c)](_0x30905e['projectName']+'/'+_0x30905e[_0x381120(0x164)])),console[_0x381120(0x162)]();const _0x4aeac2=[],_0x5dd2a5=[],_0x4a2c67=Date[_0x381120(0x18a)]();for(let _0x5befbe=0x0;_0x5befbe<_0x4e879d[_0x381120(0x131)];_0x5befbe++){const _0x478510=_0x4e879d[_0x5befbe];_0x4e879d[_0x381120(0x131)]>0x1?console[_0x381120(0x162)](_0x381120(0x119)+(_0x5befbe+0x1)+'/'+_0x4e879d[_0x381120(0x131)]+':\x20'+a5_0x53e721[_0x381120(0x15c)](_0x478510['name'])):console[_0x381120(0x162)](_0x381120(0x172)+a5_0x53e721[_0x381120(0x15c)](_0x478510[_0x381120(0x163)]));const _0x444d00=createCommandSpinner(_0x381120(0xf5)+_0x478510[_0x381120(0x11e)]['length']+_0x381120(0xf8));_0x444d00[_0x381120(0x136)]();try{const {result:_0xebb7b5,conversation:_0x33496d}=await runTest(_0x1d084a['llm'],_0x478510,{'agentId':_0x248fcb,'projectId':_0x88506d,'site':_0x588b1f,'noEval':_0x1bf8cd,'evaluatorId':_0x2b1134,'onRoundStart':(_0x4826f6,_0x18c85c)=>{const _0x4a09eb=_0x381120;_0x444d00[_0x4a09eb(0x180)]=_0x4a09eb(0x188)+(_0x4826f6+0x1)+'/'+_0x18c85c+_0x4a09eb(0xf8);},'onRoundComplete':(_0x90dee8,_0x2dfb9,_0x1d3911)=>{const _0x36c8fc=_0x381120,_0x1c15f5=formatElapsed(_0x2dfb9);_0x1d3911?console[_0x36c8fc(0x162)](_0x36c8fc(0xf9)+(_0x90dee8+0x1)+'/'+_0x478510[_0x36c8fc(0x11e)][_0x36c8fc(0x131)]+_0x36c8fc(0x12e)+a5_0x53e721[_0x36c8fc(0x13c)]('✓')+'\x20('+_0x1c15f5+')'):console[_0x36c8fc(0x162)](_0x36c8fc(0xf9)+(_0x90dee8+0x1)+'/'+_0x478510[_0x36c8fc(0x11e)][_0x36c8fc(0x131)]+_0x36c8fc(0x12e)+a5_0x53e721[_0x36c8fc(0x112)]('✗'));},'onEvaluationStart':()=>{const _0x247a9f=_0x381120;_0x444d00[_0x247a9f(0x180)]='Evaluating\x20response...';},'onEvaluationComplete':_0x36958e=>{const _0x285847=_0x381120,_0x4bc48d=formatElapsed(_0x36958e);console[_0x285847(0x162)](_0x285847(0x16a)+a5_0x53e721[_0x285847(0x13c)]('✓')+'\x20('+_0x4bc48d+')');}});_0x444d00[_0x381120(0x10a)](),_0x4aeac2[_0x381120(0x14d)](_0xebb7b5),_0x5dd2a5[_0x381120(0x14d)](_0x33496d);if(_0xebb7b5[_0x381120(0x12f)]===_0x381120(0x16d))console[_0x381120(0x162)](a5_0x53e721['green'](_0x381120(0x156)+_0xebb7b5[_0x381120(0x160)]));else _0xebb7b5['status']==='FAIL'?console[_0x381120(0x162)](a5_0x53e721[_0x381120(0x112)]('✗\x20FAIL:\x20'+_0xebb7b5[_0x381120(0x160)])):console[_0x381120(0x162)](a5_0x53e721['red'](_0x381120(0x14e)+_0xebb7b5[_0x381120(0x160)]));_0xebb7b5[_0x381120(0x133)]&&console[_0x381120(0x162)](a5_0x53e721['dim'](_0x381120(0x13a)+_0xebb7b5[_0x381120(0x133)])),console[_0x381120(0x162)]();}catch(_0x1f40da){_0x444d00[_0x381120(0x10a)]();const _0x1f569a=_0x1f40da instanceof Error?_0x1f40da[_0x381120(0x182)]:String(_0x1f40da);console[_0x381120(0x162)](a5_0x53e721[_0x381120(0x112)](_0x381120(0x14e)+_0x1f569a)),console['log'](),_0x4aeac2[_0x381120(0x14d)]({'name':_0x478510[_0x381120(0x163)],'status':_0x381120(0x17f),'reason':_0x1f569a,'timestamp':new Date()[_0x381120(0x13d)](),'duration_ms':0x0});}}const _0x17833d=Date[_0x381120(0x18a)]()-_0x4a2c67,_0x519dfa=_0x4aeac2[_0x381120(0x118)](_0x168567=>_0x168567[_0x381120(0x12f)]===_0x381120(0x16d))[_0x381120(0x131)],_0x3b10d8=_0x4aeac2[_0x381120(0x118)](_0x5b8410=>_0x5b8410['status']===_0x381120(0x12a))[_0x381120(0x131)],_0x30b991=_0x4aeac2['filter'](_0xe94ce9=>_0xe94ce9[_0x381120(0x12f)]===_0x381120(0x17f))[_0x381120(0x131)];console[_0x381120(0x162)]('━'[_0x381120(0x16b)](0x3c)),console[_0x381120(0x162)](_0x381120(0x143)),console[_0x381120(0x162)]('━'[_0x381120(0x16b)](0x3c)),console['log']('Total:\x20\x20\x20\x20'+_0x4aeac2[_0x381120(0x131)]),console['log'](_0x381120(0x173)+a5_0x53e721[_0x381120(0x13c)](_0x519dfa)),console[_0x381120(0x162)](_0x381120(0x125)+a5_0x53e721['red'](_0x3b10d8));_0x30b991>0x0&&console[_0x381120(0x162)]('Errors:\x20\x20\x20'+a5_0x53e721[_0x381120(0x112)](_0x30b991));console[_0x381120(0x162)]('Duration:\x20'+formatElapsed(_0x17833d)),console[_0x381120(0x162)]('━'[_0x381120(0x16b)](0x3c));const _0x209e8a=_0x4aeac2[_0x381120(0x118)](_0x1ce228=>_0x1ce228[_0x381120(0x12f)]!=='PASS');if(_0x209e8a['length']>0x0){console[_0x381120(0x162)](),console['log'](_0x381120(0x137));for(const _0x1321cd of _0x209e8a){const _0x48ea88=a5_0x53e721[_0x381120(0x112)]('✗'),_0x5c40d8=_0x1321cd[_0x381120(0x160)][_0x381120(0x131)]>0x32?_0x1321cd[_0x381120(0x160)][_0x381120(0x165)](0x0,0x32)+_0x381120(0x10d):_0x1321cd['reason'];console[_0x381120(0x162)]('\x20\x20'+_0x48ea88+'\x20'+_0x1321cd[_0x381120(0x163)]+':\x20'+_0x5c40d8);}}const _0x3cf99c={'summary':{'total':_0x4aeac2[_0x381120(0x131)],'passed':_0x519dfa,'failed':_0x3b10d8,'errors':_0x30b991>0x0?_0x30b991:undefined,'duration_ms':_0x17833d},'tests':_0x4aeac2,'agent':{'project':_0x30905e[_0x381120(0x174)],'name':_0x30905e[_0x381120(0x164)],'site':_0x588b1f},'timestamp':new Date(_0x4a2c67)[_0x381120(0x13d)]()};try{const _0x1d282b=buildCachedTestRun(_0x5dd2a5,{'site':_0x588b1f,'projectId':_0x88506d,'projectName':_0x30905e[_0x381120(0x174)],'agentId':_0x248fcb,'agentName':_0x30905e['agentName'],'testYmlPath':a5_0x1f8473[_0x381120(0x15e)](_0x30905e[_0x381120(0x159)])});saveLastTestRun(_0x1d282b);}catch{}if(_0x5e5eb4!==_0x381120(0x17d)||_0x3810f6){const _0x31e0cf=formatResults(_0x3cf99c,_0x5e5eb4);if(_0x3810f6)try{a5_0x1173a6[_0x381120(0x141)](_0x3810f6,_0x31e0cf,_0x381120(0x10b)),console[_0x381120(0x162)](),console[_0x381120(0x162)](a5_0x53e721['dim'](_0x381120(0x185)+_0x3810f6));}catch(_0x296c17){return console[_0x381120(0x162)](),console[_0x381120(0x162)](a5_0x53e721['red'](_0x381120(0x168)+_0x296c17)),0x1;}else console[_0x381120(0x162)](),console[_0x381120(0x162)](_0x31e0cf);}return _0x209e8a[_0x381120(0x131)]>0x0?0x1:0x0;}async[a5_0x3db408(0xf3)](_0x1625ce,_0x103758){const _0x331d45=a5_0x3db408,{options:_0x2adc0c,tdx:_0x297398}=_0x1625ce,{definition:_0x4445f0,agentInfo:_0xeff7c0,outputFormat:_0x45a99b,outputFile:_0x3a6be6}=_0x103758,_0x5a2b39=_0x2adc0c[_0x331d45(0x10e)],_0x4828a0=loadLastTestRun();if(!_0x4828a0)return console[_0x331d45(0x162)](a5_0x53e721[_0x331d45(0x112)](_0x331d45(0x178))),console[_0x331d45(0x162)](a5_0x53e721['dim'](_0x331d45(0x14b))),0x1;if(_0x4828a0[_0x331d45(0x14a)][_0x331d45(0x164)]!==_0xeff7c0['agentName'])return console[_0x331d45(0x162)](a5_0x53e721[_0x331d45(0x112)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x4828a0['agent'][_0x331d45(0x164)]+_0x331d45(0x17e)+_0xeff7c0[_0x331d45(0x164)]+'\x22.')),console[_0x331d45(0x162)](a5_0x53e721['dim']('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x181a1c=new Set(_0x4828a0[_0x331d45(0x120)][_0x331d45(0x134)](_0x3bd8f6=>_0x3bd8f6[_0x331d45(0xf4)])),_0x49703b=_0x4445f0[_0x331d45(0x186)][_0x331d45(0x118)](_0x41f983=>!_0x181a1c[_0x331d45(0x171)](_0x41f983['name']));if(_0x49703b[_0x331d45(0x131)]>0x0&&_0x4828a0[_0x331d45(0x10e)]!==_0x5a2b39)return console[_0x331d45(0x162)](a5_0x53e721['red'](_0x331d45(0x102))),console['log'](a5_0x53e721['dim']('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x4828a0[_0x331d45(0x10e)]+_0x331d45(0x11f)+_0x5a2b39+'\x22.')),console['log'](a5_0x53e721[_0x331d45(0x123)](_0x331d45(0x10c)+_0x4828a0['site']+_0x331d45(0x177))),0x1;const _0x5e14cd=_0x4445f0[_0x331d45(0x186)][_0x331d45(0x118)](_0x2bbd8e=>_0x181a1c[_0x331d45(0x171)](_0x2bbd8e[_0x331d45(0x163)])),_0x58f4ea=_0x49703b;let _0x26a7c9;try{_0x26a7c9=await setupEvaluatorAgent(_0x297398[_0x331d45(0x10f)],_0x2adc0c[_0x331d45(0x161)]);}catch(_0x145901){const _0x49d0aa=_0x145901 instanceof Error?_0x145901[_0x331d45(0x182)]:String(_0x145901);return console['log'](a5_0x53e721[_0x331d45(0x112)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x49d0aa)),0x1;}console[_0x331d45(0x162)](a5_0x53e721[_0x331d45(0x17a)](_0x331d45(0x13b))),console[_0x331d45(0x162)](_0x331d45(0xf7)+a5_0x53e721[_0x331d45(0x15c)](_0x4828a0[_0x331d45(0x101)])),console[_0x331d45(0x162)](_0x331d45(0x13e)+a5_0x53e721[_0x331d45(0x15c)](_0x4828a0['agent'][_0x331d45(0x174)]+'/'+_0x4828a0['agent'][_0x331d45(0x164)]));_0x58f4ea[_0x331d45(0x131)]>0x0&&console['log'](_0x331d45(0x15b)+a5_0x53e721[_0x331d45(0x170)](_0x58f4ea['length']));console[_0x331d45(0x162)]();const _0x2549d7=[],_0x4efea6=Date['now'](),_0x39794a=createCommandSpinner('Re-evaluating...');if(_0x5e14cd['length']>0x0)try{const _0x419031=await reevaluateFromCache(_0x297398[_0x331d45(0x10f)],_0x4828a0,{'tests':_0x5e14cd},{'evaluatorId':_0x26a7c9,'onTestStart':(_0x26cfe9,_0x3e4721,_0x2dbf5a)=>{const _0x2b7e68=_0x331d45;_0x39794a['text']=_0x2b7e68(0x17b)+(_0x3e4721+0x1)+'/'+_0x2dbf5a+':\x20'+_0x26cfe9+_0x2b7e68(0x10d);if(!_0x39794a['isSpinning'])_0x39794a['start']();},'onTestComplete':(_0x441ef2,_0x54c9c5)=>{const _0x284391=_0x331d45;_0x39794a[_0x284391(0x10a)]();if(_0x54c9c5['status']===_0x284391(0x16d))console[_0x284391(0x162)](a5_0x53e721['green'](_0x284391(0x156)+_0x441ef2)+a5_0x53e721[_0x284391(0x123)](_0x284391(0x15f)));else _0x54c9c5[_0x284391(0x12f)]===_0x284391(0x12a)?console[_0x284391(0x162)](a5_0x53e721['red'](_0x284391(0x154)+_0x441ef2+_0x284391(0x144)+_0x54c9c5[_0x284391(0x160)])+a5_0x53e721[_0x284391(0x123)](_0x284391(0x15f))):console[_0x284391(0x162)](a5_0x53e721['red'](_0x284391(0x14e)+_0x441ef2+_0x284391(0x144)+_0x54c9c5[_0x284391(0x160)]));_0x54c9c5[_0x284391(0x133)]&&console[_0x284391(0x162)](a5_0x53e721[_0x284391(0x123)](_0x284391(0x16c)+_0x54c9c5[_0x284391(0x133)])),_0x2549d7[_0x284391(0x14d)](_0x54c9c5);},'onTestSkipped':(_0x151385,_0x509fd3)=>{const _0x67bc5d=_0x331d45;_0x39794a['stop'](),console[_0x67bc5d(0x162)](a5_0x53e721[_0x67bc5d(0x170)]('⚠\x20SKIPPED:\x20'+_0x151385+_0x67bc5d(0x144)+_0x509fd3));}});for(const _0x5c661d of _0x419031){!_0x2549d7['find'](_0x2d88f7=>_0x2d88f7[_0x331d45(0x163)]===_0x5c661d[_0x331d45(0x163)])&&_0x2549d7[_0x331d45(0x14d)](_0x5c661d);}}catch(_0x21624d){_0x39794a[_0x331d45(0x10a)]();const _0x17d1c6=_0x21624d instanceof Error?_0x21624d[_0x331d45(0x182)]:String(_0x21624d);return console[_0x331d45(0x162)](a5_0x53e721['red'](_0x331d45(0x132)+_0x17d1c6)),0x1;}_0x39794a['stop']();if(_0x58f4ea['length']>0x0){console[_0x331d45(0x162)](),console[_0x331d45(0x162)](a5_0x53e721[_0x331d45(0x17a)](_0x331d45(0x151)));const {projectId:_0x17a994,agentId:_0x544b8a}=_0x4828a0['agent'];for(const _0x32f4e0 of _0x58f4ea){console['log'](_0x331d45(0x176)+a5_0x53e721[_0x331d45(0x15c)](_0x32f4e0['name']));const _0x441f6c=createCommandSpinner(_0x331d45(0xf5)+_0x32f4e0['rounds']['length']+_0x331d45(0xf8));_0x441f6c[_0x331d45(0x136)]();try{const {result:_0x4c874f}=await runTest(_0x297398[_0x331d45(0x10f)],_0x32f4e0,{'agentId':_0x544b8a,'projectId':_0x17a994,'site':_0x4828a0[_0x331d45(0x10e)],'noEval':![],'evaluatorId':_0x26a7c9,'onRoundStart':(_0x1cd167,_0x52b172)=>{const _0x202450=_0x331d45;_0x441f6c[_0x202450(0x180)]='Round\x20'+(_0x1cd167+0x1)+'/'+_0x52b172+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x5b2a89,_0x34e4ef,_0x488e62)=>{const _0x3e5f95=_0x331d45,_0x30daad=formatElapsed(_0x34e4ef);_0x488e62?console[_0x3e5f95(0x162)](_0x3e5f95(0xf9)+(_0x5b2a89+0x1)+'/'+_0x32f4e0[_0x3e5f95(0x11e)][_0x3e5f95(0x131)]+_0x3e5f95(0x12e)+a5_0x53e721[_0x3e5f95(0x13c)]('✓')+'\x20('+_0x30daad+')'):console[_0x3e5f95(0x162)](_0x3e5f95(0xf9)+(_0x5b2a89+0x1)+'/'+_0x32f4e0[_0x3e5f95(0x11e)][_0x3e5f95(0x131)]+'...\x20'+a5_0x53e721[_0x3e5f95(0x112)]('✗'));},'onEvaluationStart':()=>{const _0x2d5ea8=_0x331d45;_0x441f6c[_0x2d5ea8(0x180)]='Evaluating\x20response...';},'onEvaluationComplete':_0x2f7b68=>{const _0x30e26a=_0x331d45,_0xaebb7e=formatElapsed(_0x2f7b68);console[_0x30e26a(0x162)]('\x20\x20Evaluating...\x20'+a5_0x53e721['green']('✓')+'\x20('+_0xaebb7e+')');}});_0x441f6c[_0x331d45(0x10a)](),_0x2549d7[_0x331d45(0x14d)](_0x4c874f);if(_0x4c874f['status']==='PASS')console[_0x331d45(0x162)](a5_0x53e721[_0x331d45(0x13c)]('✓\x20PASS:\x20'+_0x4c874f[_0x331d45(0x160)])+a5_0x53e721[_0x331d45(0x123)](_0x331d45(0x17c)));else _0x4c874f[_0x331d45(0x12f)]===_0x331d45(0x12a)?console[_0x331d45(0x162)](a5_0x53e721[_0x331d45(0x112)](_0x331d45(0x154)+_0x4c874f['reason'])+a5_0x53e721['dim'](_0x331d45(0x17c))):console['log'](a5_0x53e721[_0x331d45(0x112)](_0x331d45(0x14e)+_0x4c874f[_0x331d45(0x160)]));_0x4c874f[_0x331d45(0x133)]&&console[_0x331d45(0x162)](a5_0x53e721[_0x331d45(0x123)]('\x20\x20Conversation:\x20'+_0x4c874f['conversation_url']));}catch(_0x572cf2){_0x441f6c['stop']();const _0x1612f8=_0x572cf2 instanceof Error?_0x572cf2[_0x331d45(0x182)]:String(_0x572cf2);console[_0x331d45(0x162)](a5_0x53e721['red'](_0x331d45(0x14e)+_0x1612f8)),_0x2549d7[_0x331d45(0x14d)]({'name':_0x32f4e0['name'],'status':_0x331d45(0x17f),'reason':_0x1612f8,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console['log']();const _0x5d967c=Date[_0x331d45(0x18a)]()-_0x4efea6,_0x1ca673=_0x2549d7['filter'](_0x49a057=>_0x49a057[_0x331d45(0x12f)]===_0x331d45(0x16d))[_0x331d45(0x131)],_0x2d57f9=_0x2549d7[_0x331d45(0x118)](_0x3b132b=>_0x3b132b[_0x331d45(0x12f)]===_0x331d45(0x12a))['length'],_0x2c69fb=_0x2549d7[_0x331d45(0x118)](_0x5c0255=>_0x5c0255[_0x331d45(0x12f)]==='ERROR')[_0x331d45(0x131)];console[_0x331d45(0x162)]('━'[_0x331d45(0x16b)](0x3c)),console[_0x331d45(0x162)](_0x331d45(0x189)),console[_0x331d45(0x162)]('━'[_0x331d45(0x16b)](0x3c)),console[_0x331d45(0x162)](_0x331d45(0x126)+_0x2549d7['length']),console[_0x331d45(0x162)]('Passed:\x20\x20\x20'+a5_0x53e721[_0x331d45(0x13c)](_0x1ca673)),console[_0x331d45(0x162)](_0x331d45(0x125)+a5_0x53e721[_0x331d45(0x112)](_0x2d57f9));_0x2c69fb>0x0&&console[_0x331d45(0x162)](_0x331d45(0x183)+a5_0x53e721[_0x331d45(0x112)](_0x2c69fb));console[_0x331d45(0x162)](_0x331d45(0x115)+formatElapsed(_0x5d967c)),console[_0x331d45(0x162)]('━'[_0x331d45(0x16b)](0x3c));const _0x57e27d={'summary':{'total':_0x2549d7['length'],'passed':_0x1ca673,'failed':_0x2d57f9,'errors':_0x2c69fb>0x0?_0x2c69fb:undefined,'duration_ms':_0x5d967c},'tests':_0x2549d7,'agent':{'project':_0xeff7c0['projectName'],'name':_0xeff7c0[_0x331d45(0x164)],'site':_0x5a2b39},'timestamp':new Date(_0x4efea6)[_0x331d45(0x13d)]()};if(_0x45a99b!=='table'||_0x3a6be6){const _0xe58604=formatResults(_0x57e27d,_0x45a99b);if(_0x3a6be6)try{a5_0x1173a6[_0x331d45(0x141)](_0x3a6be6,_0xe58604,'utf-8'),console[_0x331d45(0x162)](),console[_0x331d45(0x162)](a5_0x53e721[_0x331d45(0x123)](_0x331d45(0x185)+_0x3a6be6));}catch(_0x207580){return console[_0x331d45(0x162)](),console['log'](a5_0x53e721['red'](_0x331d45(0x168)+_0x207580)),0x1;}else console[_0x331d45(0x162)](),console[_0x331d45(0x162)](_0xe58604);}const _0x205dd4=_0x2549d7['filter'](_0x2e8b7c=>_0x2e8b7c[_0x331d45(0x12f)]!=='PASS');return _0x205dd4[_0x331d45(0x131)]>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0x1d3651=a5_0x2cb3;(function(_0x5eb18d,_0x5beb8e){const _0x5c054c=a5_0x2cb3,_0x45a8f1=_0x5eb18d();while(!![]){try{const _0x319f16=parseInt(_0x5c054c(0x180))/0x1+-parseInt(_0x5c054c(0x167))/0x2+parseInt(_0x5c054c(0x118))/0x3+parseInt(_0x5c054c(0x17f))/0x4*(parseInt(_0x5c054c(0x17c))/0x5)+parseInt(_0x5c054c(0x16c))/0x6+parseInt(_0x5c054c(0x15b))/0x7*(parseInt(_0x5c054c(0x11e))/0x8)+-parseInt(_0x5c054c(0x137))/0x9;if(_0x319f16===_0x5beb8e)break;else _0x45a8f1['push'](_0x45a8f1['shift']());}catch(_0x44252b){_0x45a8f1['push'](_0x45a8f1['shift']());}}}(a5_0x4a2c,0xe88ae));import*as a5_0x3b0654 from'node:fs';import*as a5_0x2b7d77 from'node:path';function a5_0x2cb3(_0x28d867,_0x2b9a95){_0x28d867=_0x28d867-0x118;const _0x4a2cda=a5_0x4a2c();let _0x2cb309=_0x4a2cda[_0x28d867];return _0x2cb309;}import a5_0x53dbd8 from'chalk';import{BaseCommand}from'./command.js';function a5_0x4a2c(){const _0x14e4c9=['writeFileSync','description','Cached\x20run\x20is\x20from\x20site\x20\x22','llm','Test\x20Configuration:','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Running\x20agent\x20tests...','repeat','Executing\x20new\x20tests...','join','✓\x20PASS:\x20','agent','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','13317787ZUmjyI','split','start','length','\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path','timestamp','dryRun','text','reeval','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','toISOString','Errors:\x20\x20\x20','960820ZHJFJR','Round\x201/','cyan','conversation_url','includes','6047478JcaboT','multiple_agents','\x20\x20Agent:\x20','rounds','Re-evaluating\x20cached\x20test\x20run...','source','Re-evaluating\x20','Passed:\x20\x20\x20','not\x20found','...','Re-evaluation\x20Summary','Agent:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','No\x20tests\x20found\x20matching:\x20','reason','Failed\x20Tests:','847445sKPveX','Conversation\x20URL:\x20','output','36AIojXG','671953BjhxLl','status','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','\x20\x20Conversation:\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','find','name','trim','agent:test','log','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','404','\x20(new)','✗\x20FAIL:\x20','Available\x20tags:\x20','tags','\x20\x20-\x20','found','substring','now','push','agentDirs','message','no_context','Error\x20writing\x20output\x20file:\x20','FAIL','testName','basename','New\x20tests\x20to\x20execute:\x20','Run\x20tests\x20for\x20an\x20LLM\x20agent','Running\x20test:\x20','\x20(cached)','resolveAgentId','projectName','no_local_folder','llmProject','filter','Failed:\x20\x20\x20','json','PASS','3691950Hsjtzp','projectDir','tests','Either\x20switch\x20to\x20the\x20\x22','test.yml','Evaluating\x20response...','8kFErYx','forEach','\x20\x20Round\x20',':\x20Sending\x20user\x20input...','\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)','dim','No\x20tests\x20have\x20tags\x20defined.','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','existsSync','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','Total:\x20\x20\x20\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','green','✗\x20ERROR:\x20','Usage:','execute','context','table','white','Duration:\x20','site','Error:\x20No\x20previous\x20test\x20run\x20found.','\x20-\x20','44149986HFkMIi','ERROR','yellow','Available\x20tests:\x20','eval','map','agentName','executeReeval','red','stop','/<agent-name>','Round\x20','some','...\x20','Test\x20Summary','tsv','toLowerCase','Output\x20written\x20to:\x20','utf-8','\x22:\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','Re-evaluating...','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.'];a5_0x4a2c=function(){return _0x14e4c9;};return a5_0x4a2c();}import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{['name']=a5_0x1d3651(0x189);[a5_0x1d3651(0x14f)]=a5_0x1d3651(0x19e);async[a5_0x1d3651(0x12f)](_0x259182){const _0x4996ba=a5_0x1d3651,{options:_0x51aaf8,args:_0x407cda,tdx:_0x6bd42e}=_0x259182,_0x5ded75=_0x407cda[0x0]||'.',_0x5cc7a9=_0x51aaf8[_0x4996ba(0x161)],_0x363243=_0x51aaf8,_0x1cb0cb=_0x363243[_0x4996ba(0x13b)]===![],_0x335b04=_0x363243[_0x4996ba(0x163)],_0x487bef=_0x363243[_0x4996ba(0x187)],_0x120104=_0x363243[_0x4996ba(0x190)],_0x577f13=_0x51aaf8[_0x4996ba(0x134)],_0x115579=_0x363243[_0x4996ba(0x17e)];if(_0x335b04&&_0x1cb0cb)return console[_0x4996ba(0x18a)](a5_0x53dbd8['red'](_0x4996ba(0x164))),0x1;let _0x18c055=_0x4996ba(0x131);if(_0x363243[_0x4996ba(0x1a7)])_0x18c055='json';else{if(_0x363243['jsonl'])_0x18c055='jsonl';else{if(_0x363243[_0x4996ba(0x146)])_0x18c055=_0x4996ba(0x146);else{if(_0x363243[_0x4996ba(0x131)])_0x18c055=_0x4996ba(0x131);}}}const _0x108b29=_0x363243[_0x4996ba(0x1a4)];let _0xcb3514=_0x5ded75;const _0x206e88=a5_0x3b0654[_0x4996ba(0x127)](_0x5ded75),_0x4820f9=_0x5ded75==='.';if(!_0x206e88||_0x4820f9){const _0x2307f8=resolveProjectFromContext(_0x5ded75,_0x108b29,{'requireFile':_0x4996ba(0x11c)});if(_0x2307f8[_0x4996ba(0x192)])_0xcb3514=_0x2307f8['projectDir'],_0x2307f8[_0x4996ba(0x171)]===_0x4996ba(0x130)&&console[_0x4996ba(0x18a)](a5_0x53dbd8[_0x4996ba(0x123)]('Using\x20agent:\x20'+_0xcb3514));else switch(_0x2307f8[_0x4996ba(0x17a)]){case _0x4996ba(0x198):console[_0x4996ba(0x18a)](a5_0x53dbd8[_0x4996ba(0x139)](_0x2307f8[_0x4996ba(0x197)])),console[_0x4996ba(0x18a)](),console[_0x4996ba(0x18a)](_0x4996ba(0x12e)),console[_0x4996ba(0x18a)](_0x4996ba(0x15f)),console[_0x4996ba(0x18a)](_0x4996ba(0x122)),console[_0x4996ba(0x18a)](),console[_0x4996ba(0x18a)](_0x4996ba(0x153));return 0x1;case _0x4996ba(0x1a3):console[_0x4996ba(0x18a)](a5_0x53dbd8[_0x4996ba(0x139)](_0x2307f8[_0x4996ba(0x197)])),console[_0x4996ba(0x18a)](),console[_0x4996ba(0x18a)]('Run\x20\x27tdx\x20agent\x20pull\x20'+_0x2307f8['llmProject']+_0x4996ba(0x14b));return 0x1;case _0x4996ba(0x16d):{const _0x3803ad=a5_0x2b7d77[_0x4996ba(0x19c)](_0x2307f8[_0x4996ba(0x119)]);console[_0x4996ba(0x18a)](a5_0x53dbd8[_0x4996ba(0x139)]('Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22'+_0x2307f8['llmProject']+'\x22:'));for(const _0x197d61 of _0x2307f8[_0x4996ba(0x196)]){console[_0x4996ba(0x18a)](_0x4996ba(0x191)+_0x197d61);}return console[_0x4996ba(0x18a)](),console[_0x4996ba(0x18a)]('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x3803ad+_0x4996ba(0x141)),0x1;}case'no_tests':console[_0x4996ba(0x18a)](a5_0x53dbd8[_0x4996ba(0x139)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x2307f8[_0x4996ba(0x1a4)]+'\x22.')),console[_0x4996ba(0x18a)](a5_0x53dbd8['dim']('Project\x20path:\x20'+_0x2307f8['projectDir'])),console[_0x4996ba(0x18a)](),console[_0x4996ba(0x18a)]('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0x7c352c,agentInfo:_0x30660e}=parseTestFile(_0xcb3514);let _0x383ef6=_0x7c352c[_0x4996ba(0x11a)];if(_0x487bef){const _0x352ed1=_0x487bef[_0x4996ba(0x15c)](',')[_0x4996ba(0x13c)](_0x37e263=>_0x37e263[_0x4996ba(0x188)]());_0x383ef6=_0x7c352c[_0x4996ba(0x11a)][_0x4996ba(0x1a5)](_0x57e6bc=>_0x352ed1['includes'](_0x57e6bc[_0x4996ba(0x187)]));if(_0x383ef6[_0x4996ba(0x15e)]===0x0)return console[_0x4996ba(0x18a)](a5_0x53dbd8[_0x4996ba(0x139)](_0x4996ba(0x179)+_0x487bef)),console[_0x4996ba(0x18a)](a5_0x53dbd8[_0x4996ba(0x123)](_0x4996ba(0x13a)+_0x7c352c[_0x4996ba(0x11a)][_0x4996ba(0x13c)](_0xf0b585=>_0xf0b585[_0x4996ba(0x187)])[_0x4996ba(0x157)](',\x20'))),0x1;}if(_0x120104){const _0x153b39=_0x120104[_0x4996ba(0x15c)](',')[_0x4996ba(0x13c)](_0x475632=>_0x475632[_0x4996ba(0x188)]()[_0x4996ba(0x147)]());_0x383ef6=_0x383ef6[_0x4996ba(0x1a5)](_0x107563=>_0x107563['tags']?.[_0x4996ba(0x143)](_0xa542ee=>_0x153b39[_0x4996ba(0x16b)](_0xa542ee[_0x4996ba(0x147)]())));if(_0x383ef6['length']===0x0){console[_0x4996ba(0x18a)](a5_0x53dbd8[_0x4996ba(0x139)]('No\x20tests\x20found\x20with\x20tags:\x20'+_0x120104));const _0x10e4af=new Set();return _0x7c352c[_0x4996ba(0x11a)][_0x4996ba(0x11f)](_0x3909e1=>_0x3909e1[_0x4996ba(0x190)]?.['forEach'](_0x2df88b=>_0x10e4af['add'](_0x2df88b))),_0x10e4af['size']>0x0?console[_0x4996ba(0x18a)](a5_0x53dbd8[_0x4996ba(0x123)](_0x4996ba(0x18f)+[..._0x10e4af][_0x4996ba(0x157)](',\x20'))):console['log'](a5_0x53dbd8[_0x4996ba(0x123)](_0x4996ba(0x124))),0x1;}}if(_0x335b04)return this[_0x4996ba(0x13e)](_0x259182,{'definition':{'tests':_0x383ef6},'agentInfo':_0x30660e,'outputFormat':_0x18c055,'outputFile':_0x115579,'testNames':_0x487bef});if(_0x5cc7a9){console[_0x4996ba(0x18a)](a5_0x53dbd8[_0x4996ba(0x169)](_0x4996ba(0x152))),console[_0x4996ba(0x18a)]('\x20\x20Site:\x20'+a5_0x53dbd8[_0x4996ba(0x132)](_0x577f13)),console['log']('\x20\x20Project:\x20'+a5_0x53dbd8[_0x4996ba(0x132)](_0x30660e[_0x4996ba(0x1a2)])),console[_0x4996ba(0x18a)](_0x4996ba(0x16e)+a5_0x53dbd8[_0x4996ba(0x132)](_0x30660e[_0x4996ba(0x13d)])),console[_0x4996ba(0x18a)](),console[_0x4996ba(0x18a)]('Tests\x20found:\x20'+a5_0x53dbd8[_0x4996ba(0x132)](_0x383ef6[_0x4996ba(0x15e)]));for(let _0x197d4e=0x0;_0x197d4e<_0x383ef6[_0x4996ba(0x15e)];_0x197d4e++){const _0xb22768=_0x383ef6[_0x197d4e],_0x5e1325=_0xb22768[_0x4996ba(0x16f)][_0x4996ba(0x15e)]===0x1?'round':_0x4996ba(0x16f),_0x9eb843=_0xb22768[_0x4996ba(0x190)]?.[_0x4996ba(0x15e)]?'\x20['+_0xb22768[_0x4996ba(0x190)][_0x4996ba(0x157)](',\x20')+']':'';console[_0x4996ba(0x18a)]('\x20\x20'+(_0x197d4e+0x1)+'.\x20'+a5_0x53dbd8[_0x4996ba(0x132)](_0xb22768[_0x4996ba(0x187)])+'\x20('+_0xb22768['rounds'][_0x4996ba(0x15e)]+'\x20'+_0x5e1325+')'+a5_0x53dbd8[_0x4996ba(0x123)](_0x9eb843));}return 0x0;}let _0x277be9,_0x3486e;try{_0x277be9=await _0x6bd42e[_0x4996ba(0x151)]['resolveProjectId'](_0x30660e['projectName']);}catch(_0x460473){const _0x10ff47=_0x460473 instanceof Error?_0x460473[_0x4996ba(0x197)]:String(_0x460473);return _0x10ff47['includes'](_0x4996ba(0x18c))||_0x10ff47[_0x4996ba(0x147)]()['includes'](_0x4996ba(0x174))?console['log'](a5_0x53dbd8[_0x4996ba(0x13f)](_0x4996ba(0x185)+_0x30660e[_0x4996ba(0x1a2)])):console[_0x4996ba(0x18a)](a5_0x53dbd8[_0x4996ba(0x13f)](_0x4996ba(0x178)+_0x30660e[_0x4996ba(0x1a2)]+'\x22:\x20'+_0x10ff47)),0x1;}try{_0x3486e=await _0x6bd42e[_0x4996ba(0x151)][_0x4996ba(0x1a1)](_0x30660e[_0x4996ba(0x13d)],_0x277be9);}catch(_0x47b281){const _0x3b152b=_0x47b281 instanceof Error?_0x47b281['message']:String(_0x47b281);return _0x3b152b[_0x4996ba(0x16b)](_0x4996ba(0x18c))||_0x3b152b[_0x4996ba(0x147)]()[_0x4996ba(0x16b)](_0x4996ba(0x174))?console[_0x4996ba(0x18a)](a5_0x53dbd8[_0x4996ba(0x13f)](_0x4996ba(0x15a)+_0x30660e[_0x4996ba(0x13d)])):console[_0x4996ba(0x18a)](a5_0x53dbd8[_0x4996ba(0x13f)](_0x4996ba(0x12b)+_0x30660e['agentName']+_0x4996ba(0x14a)+_0x3b152b)),0x1;}let _0x1854d4;if(!_0x1cb0cb)try{_0x1854d4=await setupEvaluatorAgent(_0x6bd42e[_0x4996ba(0x151)],_0x51aaf8['verbose']);}catch(_0x5b02c8){const _0x136839=_0x5b02c8 instanceof Error?_0x5b02c8['message']:String(_0x5b02c8);return console[_0x4996ba(0x18a)](a5_0x53dbd8[_0x4996ba(0x13f)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x136839)),0x1;}console['log'](a5_0x53dbd8['cyan'](_0x4996ba(0x154))),console[_0x4996ba(0x18a)]('Site:\x20'+a5_0x53dbd8['white'](_0x577f13)),console[_0x4996ba(0x18a)](_0x4996ba(0x177)+a5_0x53dbd8[_0x4996ba(0x132)](_0x30660e[_0x4996ba(0x1a2)]+'/'+_0x30660e['agentName'])),console[_0x4996ba(0x18a)]();const _0xf8576c=[],_0x2da3c2=[],_0x5c5abe=Date[_0x4996ba(0x194)]();for(let _0xff1b1b=0x0;_0xff1b1b<_0x383ef6[_0x4996ba(0x15e)];_0xff1b1b++){const _0xf842fb=_0x383ef6[_0xff1b1b];_0x383ef6[_0x4996ba(0x15e)]>0x1?console[_0x4996ba(0x18a)]('Test\x20'+(_0xff1b1b+0x1)+'/'+_0x383ef6[_0x4996ba(0x15e)]+':\x20'+a5_0x53dbd8['white'](_0xf842fb['name'])):console[_0x4996ba(0x18a)](_0x4996ba(0x19f)+a5_0x53dbd8['white'](_0xf842fb[_0x4996ba(0x187)]));const _0x3efc05=createCommandSpinner(_0x4996ba(0x168)+_0xf842fb[_0x4996ba(0x16f)][_0x4996ba(0x15e)]+_0x4996ba(0x121));_0x3efc05['start']();try{const {result:_0x605ad0,conversation:_0x2c49d1}=await runTest(_0x6bd42e['llm'],_0xf842fb,{'agentId':_0x3486e,'projectId':_0x277be9,'site':_0x577f13,'noEval':_0x1cb0cb,'evaluatorId':_0x1854d4,'onRoundStart':(_0x4a8765,_0x40ed71)=>{const _0x203903=_0x4996ba;_0x3efc05[_0x203903(0x162)]=_0x203903(0x142)+(_0x4a8765+0x1)+'/'+_0x40ed71+_0x203903(0x121);},'onRoundComplete':(_0x3da7d9,_0x33873b,_0xe9d680)=>{const _0xd3fb4a=_0x4996ba,_0x127123=formatElapsed(_0x33873b);_0xe9d680?console[_0xd3fb4a(0x18a)](_0xd3fb4a(0x120)+(_0x3da7d9+0x1)+'/'+_0xf842fb[_0xd3fb4a(0x16f)][_0xd3fb4a(0x15e)]+_0xd3fb4a(0x144)+a5_0x53dbd8[_0xd3fb4a(0x12c)]('✓')+'\x20('+_0x127123+')'):console[_0xd3fb4a(0x18a)](_0xd3fb4a(0x120)+(_0x3da7d9+0x1)+'/'+_0xf842fb[_0xd3fb4a(0x16f)][_0xd3fb4a(0x15e)]+_0xd3fb4a(0x144)+a5_0x53dbd8[_0xd3fb4a(0x13f)]('✗'));},'onEvaluationStart':()=>{const _0x40e97f=_0x4996ba;_0x3efc05[_0x40e97f(0x162)]=_0x40e97f(0x11d);},'onEvaluationComplete':_0x190779=>{const _0x503a51=formatElapsed(_0x190779);console['log']('\x20\x20Evaluating...\x20'+a5_0x53dbd8['green']('✓')+'\x20('+_0x503a51+')');}});_0x3efc05[_0x4996ba(0x140)](),_0xf8576c['push'](_0x605ad0),_0x2da3c2[_0x4996ba(0x195)](_0x2c49d1);if(_0x605ad0[_0x4996ba(0x181)]===_0x4996ba(0x1a8))console[_0x4996ba(0x18a)](a5_0x53dbd8[_0x4996ba(0x12c)](_0x4996ba(0x158)+_0x605ad0[_0x4996ba(0x17a)]));else _0x605ad0[_0x4996ba(0x181)]===_0x4996ba(0x19a)?console['log'](a5_0x53dbd8[_0x4996ba(0x13f)](_0x4996ba(0x18e)+_0x605ad0[_0x4996ba(0x17a)])):console[_0x4996ba(0x18a)](a5_0x53dbd8['red'](_0x4996ba(0x12d)+_0x605ad0[_0x4996ba(0x17a)]));_0x605ad0[_0x4996ba(0x16a)]&&console[_0x4996ba(0x18a)](a5_0x53dbd8[_0x4996ba(0x123)](_0x4996ba(0x17d)+_0x605ad0['conversation_url'])),console[_0x4996ba(0x18a)]();}catch(_0x33366e){_0x3efc05[_0x4996ba(0x140)]();const _0x3ff3aa=_0x33366e instanceof Error?_0x33366e[_0x4996ba(0x197)]:String(_0x33366e);console[_0x4996ba(0x18a)](a5_0x53dbd8['red'](_0x4996ba(0x12d)+_0x3ff3aa)),console['log'](),_0xf8576c[_0x4996ba(0x195)]({'name':_0xf842fb[_0x4996ba(0x187)],'status':_0x4996ba(0x138),'reason':_0x3ff3aa,'timestamp':new Date()[_0x4996ba(0x165)](),'duration_ms':0x0});}}const _0x20e965=Date[_0x4996ba(0x194)]()-_0x5c5abe,_0x5272c0=_0xf8576c[_0x4996ba(0x1a5)](_0x2c5a9a=>_0x2c5a9a[_0x4996ba(0x181)]===_0x4996ba(0x1a8))[_0x4996ba(0x15e)],_0x1f331c=_0xf8576c[_0x4996ba(0x1a5)](_0x55e0de=>_0x55e0de[_0x4996ba(0x181)]==='FAIL')[_0x4996ba(0x15e)],_0x3ded24=_0xf8576c[_0x4996ba(0x1a5)](_0x25a26f=>_0x25a26f[_0x4996ba(0x181)]===_0x4996ba(0x138))[_0x4996ba(0x15e)];console[_0x4996ba(0x18a)]('━'[_0x4996ba(0x155)](0x3c)),console[_0x4996ba(0x18a)](_0x4996ba(0x145)),console[_0x4996ba(0x18a)]('━'[_0x4996ba(0x155)](0x3c)),console[_0x4996ba(0x18a)]('Total:\x20\x20\x20\x20'+_0xf8576c['length']),console[_0x4996ba(0x18a)](_0x4996ba(0x173)+a5_0x53dbd8[_0x4996ba(0x12c)](_0x5272c0)),console[_0x4996ba(0x18a)](_0x4996ba(0x1a6)+a5_0x53dbd8['red'](_0x1f331c));_0x3ded24>0x0&&console[_0x4996ba(0x18a)](_0x4996ba(0x166)+a5_0x53dbd8[_0x4996ba(0x13f)](_0x3ded24));console[_0x4996ba(0x18a)](_0x4996ba(0x133)+formatElapsed(_0x20e965)),console[_0x4996ba(0x18a)]('━'[_0x4996ba(0x155)](0x3c));const _0x20bb6b=_0xf8576c[_0x4996ba(0x1a5)](_0x5e0671=>_0x5e0671[_0x4996ba(0x181)]!=='PASS');if(_0x20bb6b[_0x4996ba(0x15e)]>0x0){console[_0x4996ba(0x18a)](),console['log'](_0x4996ba(0x17b));for(const _0x478d25 of _0x20bb6b){const _0x2910a0=a5_0x53dbd8[_0x4996ba(0x13f)]('✗'),_0x59bae9=_0x478d25[_0x4996ba(0x17a)]['length']>0x32?_0x478d25[_0x4996ba(0x17a)][_0x4996ba(0x193)](0x0,0x32)+_0x4996ba(0x175):_0x478d25['reason'];console['log']('\x20\x20'+_0x2910a0+'\x20'+_0x478d25[_0x4996ba(0x187)]+':\x20'+_0x59bae9);}}const _0x3b0a1e={'summary':{'total':_0xf8576c[_0x4996ba(0x15e)],'passed':_0x5272c0,'failed':_0x1f331c,'errors':_0x3ded24>0x0?_0x3ded24:undefined,'duration_ms':_0x20e965},'tests':_0xf8576c,'agent':{'project':_0x30660e[_0x4996ba(0x1a2)],'name':_0x30660e[_0x4996ba(0x13d)],'site':_0x577f13},'timestamp':new Date(_0x5c5abe)[_0x4996ba(0x165)]()};try{const _0x40733c=buildCachedTestRun(_0x2da3c2,{'site':_0x577f13,'projectId':_0x277be9,'projectName':_0x30660e['projectName'],'agentId':_0x3486e,'agentName':_0x30660e[_0x4996ba(0x13d)],'testYmlPath':a5_0x2b7d77['resolve'](_0x30660e['testYmlPath'])});saveLastTestRun(_0x40733c);}catch{}if(_0x18c055!==_0x4996ba(0x131)||_0x115579){const _0x4c48b7=formatResults(_0x3b0a1e,_0x18c055);if(_0x115579)try{a5_0x3b0654[_0x4996ba(0x14e)](_0x115579,_0x4c48b7,_0x4996ba(0x149)),console[_0x4996ba(0x18a)](),console[_0x4996ba(0x18a)](a5_0x53dbd8['dim']('Output\x20written\x20to:\x20'+_0x115579));}catch(_0x5c021f){return console[_0x4996ba(0x18a)](),console[_0x4996ba(0x18a)](a5_0x53dbd8[_0x4996ba(0x13f)](_0x4996ba(0x199)+_0x5c021f)),0x1;}else console[_0x4996ba(0x18a)](),console[_0x4996ba(0x18a)](_0x4c48b7);}return _0x20bb6b[_0x4996ba(0x15e)]>0x0?0x1:0x0;}async[a5_0x1d3651(0x13e)](_0x41fdfe,_0x165013){const _0xe7bd26=a5_0x1d3651,{options:_0xfcdeb4,tdx:_0x2757cb}=_0x41fdfe,{definition:_0xd727b7,agentInfo:_0x21db7c,outputFormat:_0x57004c,outputFile:_0x2f2d87}=_0x165013,_0x467d51=_0xfcdeb4[_0xe7bd26(0x134)],_0x33234c=loadLastTestRun();if(!_0x33234c)return console['log'](a5_0x53dbd8[_0xe7bd26(0x13f)](_0xe7bd26(0x135))),console[_0xe7bd26(0x18a)](a5_0x53dbd8[_0xe7bd26(0x123)](_0xe7bd26(0x128))),0x1;if(_0x33234c[_0xe7bd26(0x159)][_0xe7bd26(0x13d)]!==_0x21db7c['agentName'])return console[_0xe7bd26(0x18a)](a5_0x53dbd8[_0xe7bd26(0x13f)](_0xe7bd26(0x182)+_0x33234c[_0xe7bd26(0x159)]['agentName']+_0xe7bd26(0x125)+_0x21db7c[_0xe7bd26(0x13d)]+'\x22.')),console['log'](a5_0x53dbd8['dim'](_0xe7bd26(0x126))),0x1;const _0x188e12=new Set(_0x33234c['conversations'][_0xe7bd26(0x13c)](_0x5c63cb=>_0x5c63cb[_0xe7bd26(0x19b)])),_0x3e3537=_0xd727b7[_0xe7bd26(0x11a)][_0xe7bd26(0x1a5)](_0x33ef42=>!_0x188e12['has'](_0x33ef42[_0xe7bd26(0x187)]));if(_0x3e3537['length']>0x0&&_0x33234c[_0xe7bd26(0x134)]!==_0x467d51)return console['log'](a5_0x53dbd8[_0xe7bd26(0x13f)](_0xe7bd26(0x18b))),console['log'](a5_0x53dbd8['dim'](_0xe7bd26(0x150)+_0x33234c[_0xe7bd26(0x134)]+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x467d51+'\x22.')),console[_0xe7bd26(0x18a)](a5_0x53dbd8[_0xe7bd26(0x123)](_0xe7bd26(0x11b)+_0x33234c[_0xe7bd26(0x134)]+_0xe7bd26(0x14d))),0x1;const _0x446dd5=_0xd727b7['tests'][_0xe7bd26(0x1a5)](_0x26788c=>_0x188e12['has'](_0x26788c[_0xe7bd26(0x187)])),_0x1b1295=_0x3e3537;let _0x14cb81;try{_0x14cb81=await setupEvaluatorAgent(_0x2757cb[_0xe7bd26(0x151)],_0xfcdeb4['verbose']);}catch(_0x33f470){const _0x5bd378=_0x33f470 instanceof Error?_0x33f470[_0xe7bd26(0x197)]:String(_0x33f470);return console[_0xe7bd26(0x18a)](a5_0x53dbd8[_0xe7bd26(0x13f)](_0xe7bd26(0x12a)+_0x5bd378)),0x1;}console[_0xe7bd26(0x18a)](a5_0x53dbd8['cyan'](_0xe7bd26(0x170))),console[_0xe7bd26(0x18a)]('Cached\x20run\x20from:\x20'+a5_0x53dbd8['white'](_0x33234c[_0xe7bd26(0x160)])),console[_0xe7bd26(0x18a)](_0xe7bd26(0x177)+a5_0x53dbd8[_0xe7bd26(0x132)](_0x33234c[_0xe7bd26(0x159)][_0xe7bd26(0x1a2)]+'/'+_0x33234c['agent'][_0xe7bd26(0x13d)]));_0x1b1295[_0xe7bd26(0x15e)]>0x0&&console[_0xe7bd26(0x18a)](_0xe7bd26(0x19d)+a5_0x53dbd8[_0xe7bd26(0x139)](_0x1b1295[_0xe7bd26(0x15e)]));console[_0xe7bd26(0x18a)]();const _0x125cd5=[],_0x59156e=Date[_0xe7bd26(0x194)](),_0x5755f9=createCommandSpinner(_0xe7bd26(0x14c));if(_0x446dd5[_0xe7bd26(0x15e)]>0x0)try{const _0x520d4f=await reevaluateFromCache(_0x2757cb['llm'],_0x33234c,{'tests':_0x446dd5},{'evaluatorId':_0x14cb81,'onTestStart':(_0x34cbc4,_0x36e8c2,_0x38d124)=>{const _0x3ec083=_0xe7bd26;_0x5755f9[_0x3ec083(0x162)]=_0x3ec083(0x172)+(_0x36e8c2+0x1)+'/'+_0x38d124+':\x20'+_0x34cbc4+'...';if(!_0x5755f9['isSpinning'])_0x5755f9[_0x3ec083(0x15d)]();},'onTestComplete':(_0x45d59c,_0x8bc9f7)=>{const _0x4ebbd6=_0xe7bd26;_0x5755f9[_0x4ebbd6(0x140)]();if(_0x8bc9f7[_0x4ebbd6(0x181)]===_0x4ebbd6(0x1a8))console[_0x4ebbd6(0x18a)](a5_0x53dbd8['green'](_0x4ebbd6(0x158)+_0x45d59c)+a5_0x53dbd8[_0x4ebbd6(0x123)](_0x4ebbd6(0x1a0)));else _0x8bc9f7[_0x4ebbd6(0x181)]===_0x4ebbd6(0x19a)?console[_0x4ebbd6(0x18a)](a5_0x53dbd8[_0x4ebbd6(0x13f)](_0x4ebbd6(0x18e)+_0x45d59c+_0x4ebbd6(0x136)+_0x8bc9f7[_0x4ebbd6(0x17a)])+a5_0x53dbd8[_0x4ebbd6(0x123)]('\x20(cached)')):console['log'](a5_0x53dbd8[_0x4ebbd6(0x13f)](_0x4ebbd6(0x12d)+_0x45d59c+_0x4ebbd6(0x136)+_0x8bc9f7[_0x4ebbd6(0x17a)]));_0x8bc9f7['conversation_url']&&console[_0x4ebbd6(0x18a)](a5_0x53dbd8[_0x4ebbd6(0x123)]('\x20\x20Conversation:\x20'+_0x8bc9f7[_0x4ebbd6(0x16a)])),_0x125cd5[_0x4ebbd6(0x195)](_0x8bc9f7);},'onTestSkipped':(_0xaf23c,_0x28559e)=>{const _0xa9194=_0xe7bd26;_0x5755f9[_0xa9194(0x140)](),console['log'](a5_0x53dbd8['yellow']('⚠\x20SKIPPED:\x20'+_0xaf23c+_0xa9194(0x136)+_0x28559e));}});for(const _0xd23c08 of _0x520d4f){!_0x125cd5[_0xe7bd26(0x186)](_0x5133ad=>_0x5133ad[_0xe7bd26(0x187)]===_0xd23c08[_0xe7bd26(0x187)])&&_0x125cd5[_0xe7bd26(0x195)](_0xd23c08);}}catch(_0x460d4e){_0x5755f9[_0xe7bd26(0x140)]();const _0x5ea85a=_0x460d4e instanceof Error?_0x460d4e[_0xe7bd26(0x197)]:String(_0x460d4e);return console['log'](a5_0x53dbd8['red'](_0xe7bd26(0x183)+_0x5ea85a)),0x1;}_0x5755f9['stop']();if(_0x1b1295[_0xe7bd26(0x15e)]>0x0){console[_0xe7bd26(0x18a)](),console[_0xe7bd26(0x18a)](a5_0x53dbd8[_0xe7bd26(0x169)](_0xe7bd26(0x156)));const {projectId:_0x1d1291,agentId:_0x11c214}=_0x33234c[_0xe7bd26(0x159)];for(const _0x3e97d2 of _0x1b1295){console[_0xe7bd26(0x18a)]('Running:\x20'+a5_0x53dbd8[_0xe7bd26(0x132)](_0x3e97d2[_0xe7bd26(0x187)]));const _0x245048=createCommandSpinner(_0xe7bd26(0x168)+_0x3e97d2[_0xe7bd26(0x16f)]['length']+_0xe7bd26(0x121));_0x245048[_0xe7bd26(0x15d)]();try{const {result:_0x818253}=await runTest(_0x2757cb[_0xe7bd26(0x151)],_0x3e97d2,{'agentId':_0x11c214,'projectId':_0x1d1291,'site':_0x33234c['site'],'noEval':![],'evaluatorId':_0x14cb81,'onRoundStart':(_0x5299af,_0x1867ac)=>{const _0x26fcaa=_0xe7bd26;_0x245048[_0x26fcaa(0x162)]=_0x26fcaa(0x142)+(_0x5299af+0x1)+'/'+_0x1867ac+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x8a5f8d,_0x596378,_0x42336f)=>{const _0x413bbe=_0xe7bd26,_0x2db56b=formatElapsed(_0x596378);_0x42336f?console[_0x413bbe(0x18a)](_0x413bbe(0x120)+(_0x8a5f8d+0x1)+'/'+_0x3e97d2[_0x413bbe(0x16f)][_0x413bbe(0x15e)]+_0x413bbe(0x144)+a5_0x53dbd8[_0x413bbe(0x12c)]('✓')+'\x20('+_0x2db56b+')'):console[_0x413bbe(0x18a)](_0x413bbe(0x120)+(_0x8a5f8d+0x1)+'/'+_0x3e97d2[_0x413bbe(0x16f)][_0x413bbe(0x15e)]+_0x413bbe(0x144)+a5_0x53dbd8[_0x413bbe(0x13f)]('✗'));},'onEvaluationStart':()=>{const _0x5a3a6b=_0xe7bd26;_0x245048[_0x5a3a6b(0x162)]=_0x5a3a6b(0x11d);},'onEvaluationComplete':_0x2538db=>{const _0x5de7b1=_0xe7bd26,_0x7bb242=formatElapsed(_0x2538db);console['log']('\x20\x20Evaluating...\x20'+a5_0x53dbd8[_0x5de7b1(0x12c)]('✓')+'\x20('+_0x7bb242+')');}});_0x245048[_0xe7bd26(0x140)](),_0x125cd5[_0xe7bd26(0x195)](_0x818253);if(_0x818253['status']===_0xe7bd26(0x1a8))console[_0xe7bd26(0x18a)](a5_0x53dbd8['green'](_0xe7bd26(0x158)+_0x818253[_0xe7bd26(0x17a)])+a5_0x53dbd8[_0xe7bd26(0x123)]('\x20(new)'));else _0x818253[_0xe7bd26(0x181)]==='FAIL'?console[_0xe7bd26(0x18a)](a5_0x53dbd8[_0xe7bd26(0x13f)](_0xe7bd26(0x18e)+_0x818253[_0xe7bd26(0x17a)])+a5_0x53dbd8[_0xe7bd26(0x123)](_0xe7bd26(0x18d))):console['log'](a5_0x53dbd8[_0xe7bd26(0x13f)](_0xe7bd26(0x12d)+_0x818253['reason']));_0x818253[_0xe7bd26(0x16a)]&&console[_0xe7bd26(0x18a)](a5_0x53dbd8[_0xe7bd26(0x123)](_0xe7bd26(0x184)+_0x818253[_0xe7bd26(0x16a)]));}catch(_0x3666e3){_0x245048[_0xe7bd26(0x140)]();const _0x3a0da9=_0x3666e3 instanceof Error?_0x3666e3['message']:String(_0x3666e3);console[_0xe7bd26(0x18a)](a5_0x53dbd8[_0xe7bd26(0x13f)](_0xe7bd26(0x12d)+_0x3a0da9)),_0x125cd5[_0xe7bd26(0x195)]({'name':_0x3e97d2[_0xe7bd26(0x187)],'status':_0xe7bd26(0x138),'reason':_0x3a0da9,'timestamp':new Date()[_0xe7bd26(0x165)](),'duration_ms':0x0});}}}console[_0xe7bd26(0x18a)]();const _0x481c81=Date[_0xe7bd26(0x194)]()-_0x59156e,_0x5b09ce=_0x125cd5[_0xe7bd26(0x1a5)](_0x1ff22b=>_0x1ff22b[_0xe7bd26(0x181)]===_0xe7bd26(0x1a8))[_0xe7bd26(0x15e)],_0x246b56=_0x125cd5[_0xe7bd26(0x1a5)](_0x3cd4d1=>_0x3cd4d1[_0xe7bd26(0x181)]==='FAIL')[_0xe7bd26(0x15e)],_0x1e11fc=_0x125cd5['filter'](_0x187400=>_0x187400[_0xe7bd26(0x181)]===_0xe7bd26(0x138))[_0xe7bd26(0x15e)];console[_0xe7bd26(0x18a)]('━'[_0xe7bd26(0x155)](0x3c)),console[_0xe7bd26(0x18a)](_0xe7bd26(0x176)),console[_0xe7bd26(0x18a)]('━'['repeat'](0x3c)),console[_0xe7bd26(0x18a)](_0xe7bd26(0x129)+_0x125cd5[_0xe7bd26(0x15e)]),console[_0xe7bd26(0x18a)](_0xe7bd26(0x173)+a5_0x53dbd8['green'](_0x5b09ce)),console[_0xe7bd26(0x18a)]('Failed:\x20\x20\x20'+a5_0x53dbd8[_0xe7bd26(0x13f)](_0x246b56));_0x1e11fc>0x0&&console[_0xe7bd26(0x18a)](_0xe7bd26(0x166)+a5_0x53dbd8[_0xe7bd26(0x13f)](_0x1e11fc));console[_0xe7bd26(0x18a)]('Duration:\x20'+formatElapsed(_0x481c81)),console[_0xe7bd26(0x18a)]('━'[_0xe7bd26(0x155)](0x3c));const _0xe5836f={'summary':{'total':_0x125cd5['length'],'passed':_0x5b09ce,'failed':_0x246b56,'errors':_0x1e11fc>0x0?_0x1e11fc:undefined,'duration_ms':_0x481c81},'tests':_0x125cd5,'agent':{'project':_0x21db7c['projectName'],'name':_0x21db7c['agentName'],'site':_0x467d51},'timestamp':new Date(_0x59156e)[_0xe7bd26(0x165)]()};if(_0x57004c!==_0xe7bd26(0x131)||_0x2f2d87){const _0x54afa5=formatResults(_0xe5836f,_0x57004c);if(_0x2f2d87)try{a5_0x3b0654['writeFileSync'](_0x2f2d87,_0x54afa5,_0xe7bd26(0x149)),console[_0xe7bd26(0x18a)](),console['log'](a5_0x53dbd8['dim'](_0xe7bd26(0x148)+_0x2f2d87));}catch(_0x69345d){return console[_0xe7bd26(0x18a)](),console[_0xe7bd26(0x18a)](a5_0x53dbd8[_0xe7bd26(0x13f)]('Error\x20writing\x20output\x20file:\x20'+_0x69345d)),0x1;}else console[_0xe7bd26(0x18a)](),console[_0xe7bd26(0x18a)](_0x54afa5);}const _0x127632=_0x125cd5[_0xe7bd26(0x1a5)](_0x12c57c=>_0x12c57c[_0xe7bd26(0x181)]!==_0xe7bd26(0x1a8));return _0x127632[_0xe7bd26(0x15e)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x4f4a49=a6_0x11d7;function a6_0x11d7(_0x20efa7,_0x19d581){_0x20efa7=_0x20efa7-0x10f;const _0x1c9e2a=a6_0x1c9e();let _0x11d764=_0x1c9e2a[_0x20efa7];return _0x11d764;}(function(_0x4e150b,_0x482c2b){const _0xe91ff5=a6_0x11d7,_0x1c6e33=_0x4e150b();while(!![]){try{const _0x4f2929=-parseInt(_0xe91ff5(0x121))/0x1*(parseInt(_0xe91ff5(0x119))/0x2)+-parseInt(_0xe91ff5(0x14b))/0x3*(parseInt(_0xe91ff5(0x14a))/0x4)+-parseInt(_0xe91ff5(0x125))/0x5*(parseInt(_0xe91ff5(0x118))/0x6)+-parseInt(_0xe91ff5(0x149))/0x7*(-parseInt(_0xe91ff5(0x152))/0x8)+-parseInt(_0xe91ff5(0x12d))/0x9+-parseInt(_0xe91ff5(0x123))/0xa+parseInt(_0xe91ff5(0x10f))/0xb;if(_0x4f2929===_0x482c2b)break;else _0x1c6e33['push'](_0x1c6e33['shift']());}catch(_0xa3f968){_0x1c6e33['push'](_0x1c6e33['shift']());}}}(a6_0x1c9e,0x57a44));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';function a6_0x1c9e(){const _0x36b3d7=['stack','5qaThwn','<\x20HTTP/1.1\x20','Invalid\x20HTTP\x20method:\x20','Invalid\x20API\x20type:\x20','log','noColor','join','api','2260242bOPNvB','llm','output','startsWith','status','message','headers','verbose','workflow','Error:\x20','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','Invalid\x20header\x20format:\x20\x22','name','site','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','llm-proxy','set-cookie2','proxy-authorization','GET','cas','execute','color','error','toUpperCase','method','PATCH','\x0aStack\x20trace:\x0a','set-cookie','40516wpQGoe','20yIKOct','203805AsWjRd','trim','POST','Endpoint\x20must\x20start\x20with\x20/:\x20','PUT','cookie','type','296hRbIHT','22463529LyICgU','cdp','x-trino-user','readBodyFromFile','includes','x-xsrf-token','trino','entries','x-auth-token','2041818fuiUGg','4ivLfGR','Results\x20saved\x20to\x20','has','body','file','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','authorization','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','236521iHEgzl','data','4931570aUMNEX'];a6_0x1c9e=function(){return _0x36b3d7;};return a6_0x1c9e();}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_0x4f4a49(0x11f),a6_0x4f4a49(0x13e),a6_0x4f4a49(0x150),a6_0x4f4a49(0x148),a6_0x4f4a49(0x13d),a6_0x4f4a49(0x114),a6_0x4f4a49(0x117),a6_0x4f4a49(0x111)]);function isSensitiveHeader(_0x36d4fd){const _0x2f2e63=a6_0x4f4a49;return SENSITIVE_HEADERS[_0x2f2e63(0x11b)](_0x36d4fd['toLowerCase']());}function parseHeader(_0x43ecc9){const _0x54563d=a6_0x4f4a49,_0x552ecd=_0x43ecc9['indexOf'](':');if(_0x552ecd===-0x1)throw new Error(_0x54563d(0x138)+_0x43ecc9+'\x22.\x20'+_0x54563d(0x137));const _0x213117=_0x43ecc9['substring'](0x0,_0x552ecd)[_0x54563d(0x14c)](),_0x15ea28=_0x43ecc9['substring'](_0x552ecd+0x1)[_0x54563d(0x14c)]();if(!_0x213117)throw new Error(_0x54563d(0x11e)+_0x43ecc9+'\x22');return[_0x213117,_0x15ea28];}export class ApiCommand extends BaseCommand{[a6_0x4f4a49(0x139)]='api';['description']=a6_0x4f4a49(0x120);['validate'](_0x81ba54){const _0x4c014b=a6_0x4f4a49,{args:_0x74aad8,options:_0x89f3d}=_0x81ba54,_0x28f010=_0x89f3d;if(_0x74aad8['length']===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x15cbd2=_0x74aad8[0x0];if(!_0x15cbd2[_0x4c014b(0x130)]('/'))return _0x4c014b(0x14e)+_0x15cbd2;const _0x4322d5=_0x28f010[_0x4c014b(0x122)],_0x3d3205=_0x28f010[_0x4c014b(0x11d)];if(_0x4322d5&&_0x3d3205)return _0x4c014b(0x13b);const _0x3ec03b=_0x28f010['method']||_0x4c014b(0x13f),_0x2c0f72=[_0x4c014b(0x13f),_0x4c014b(0x14d),_0x4c014b(0x14f),'DELETE',_0x4c014b(0x146)];if(!_0x2c0f72[_0x4c014b(0x113)](_0x3ec03b['toUpperCase']()))return _0x4c014b(0x127)+_0x3ec03b+'.\x20Valid\x20methods:\x20'+_0x2c0f72['join'](',\x20');const _0x20ca3b=_0x28f010[_0x4c014b(0x151)]||'td',_0x294789=['td',_0x4c014b(0x110),_0x4c014b(0x135),_0x4c014b(0x115),_0x4c014b(0x12e),_0x4c014b(0x13c),_0x4c014b(0x140)];if(!_0x294789[_0x4c014b(0x113)](_0x20ca3b))return _0x4c014b(0x128)+_0x20ca3b+'.\x20Valid\x20types:\x20'+_0x294789[_0x4c014b(0x12b)](',\x20');return undefined;}async[a6_0x4f4a49(0x141)](_0x50f41d){const _0x40ede1=a6_0x4f4a49,{options:_0x351fdb,args:_0x4a3517,tdx:_0x49a878}=_0x50f41d,_0x150fb4=_0x351fdb,_0x30cc79=_0x4a3517[0x0],_0x24cfab=(_0x150fb4[_0x40ede1(0x145)]||_0x40ede1(0x13f))[_0x40ede1(0x144)](),_0x202105=_0x150fb4[_0x40ede1(0x122)],_0x17885d=_0x150fb4['file'],_0x19db2a=_0x150fb4['header'],_0x331aa4=_0x150fb4[_0x40ede1(0x151)]||'td';try{const _0x196dba={};if(_0x19db2a){const _0xdba771=Array['isArray'](_0x19db2a)?_0x19db2a:[_0x19db2a];for(const _0x2552c1 of _0xdba771){const [_0x3a6f3a,_0x48c35a]=parseHeader(_0x2552c1);_0x196dba[_0x3a6f3a]=_0x48c35a;}}let _0x46fc43;if(_0x202105)_0x46fc43=_0x202105;else{if(_0x17885d)try{_0x46fc43=RawAPI[_0x40ede1(0x112)](_0x17885d);}catch(_0x320689){return console[_0x40ede1(0x143)](_0x40ede1(0x136)+(_0x320689 instanceof Error?_0x320689[_0x40ede1(0x132)]:String(_0x320689))),0x1;}}const _0x364b14={'method':_0x24cfab,'apiType':_0x331aa4,'includeHeaders':_0x351fdb[_0x40ede1(0x134)]};_0x46fc43&&(_0x364b14[_0x40ede1(0x11c)]=_0x46fc43);Object['keys'](_0x196dba)['length']>0x0&&(_0x364b14[_0x40ede1(0x133)]=_0x196dba);if(_0x351fdb[_0x40ede1(0x134)]){const _0x2cf5e6=resolveSite(_0x351fdb[_0x40ede1(0x13a)]),_0x421eaa=getEndpoint(_0x2cf5e6,_0x331aa4),_0x49cdbc=''+_0x421eaa+_0x30cc79;console['error']('>\x20'+_0x24cfab+'\x20'+_0x49cdbc);const _0xb18fa4=getAuthHeaders(_0x2cf5e6),_0x117bdf={..._0xb18fa4,..._0x196dba};for(const [_0x37d334,_0x25af8d]of Object[_0x40ede1(0x116)](_0x117bdf)){!isSensitiveHeader(_0x37d334)&&console['error']('>\x20'+_0x37d334+':\x20'+_0x25af8d);}_0x46fc43&&console[_0x40ede1(0x143)]('>'),console[_0x40ede1(0x143)]('');}const _0x483cf8=await _0x49a878[_0x40ede1(0x12c)]['request'](_0x30cc79,_0x364b14);if(_0x351fdb['verbose']&&_0x483cf8['headers']){console[_0x40ede1(0x143)](_0x40ede1(0x126)+_0x483cf8[_0x40ede1(0x131)]);for(const [_0x551e00,_0x48af26]of Object[_0x40ede1(0x116)](_0x483cf8[_0x40ede1(0x133)])){!isSensitiveHeader(_0x551e00)&&console[_0x40ede1(0x143)]('<\x20'+_0x551e00+':\x20'+_0x48af26);}console[_0x40ede1(0x143)]('');}const _0x4c3b83=Boolean(_0x351fdb['output']),_0x3ad116={'color':_0x351fdb[_0x40ede1(0x142)],'noColor':_0x351fdb[_0x40ede1(0x12a)]||_0x4c3b83&&!_0x351fdb[_0x40ede1(0x142)]},_0xc1f92c=colorizeJSON(_0x483cf8['data'],_0x3ad116);return _0x351fdb['output']?(writeFileSync(_0x351fdb[_0x40ede1(0x12f)],_0xc1f92c),console[_0x40ede1(0x143)](_0x40ede1(0x11a)+_0x351fdb[_0x40ede1(0x12f)])):console[_0x40ede1(0x129)](_0xc1f92c),0x0;}catch(_0x16ceee){return _0x16ceee instanceof Error?(console[_0x40ede1(0x143)](_0x40ede1(0x136)+_0x16ceee[_0x40ede1(0x132)]),_0x351fdb['verbose']&&_0x16ceee[_0x40ede1(0x124)]&&console['error'](_0x40ede1(0x147)+_0x16ceee[_0x40ede1(0x124)])):console[_0x40ede1(0x143)](_0x40ede1(0x136)+String(_0x16ceee)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a7_0x1fe559=a7_0x5eaf;(function(_0x4d1990,_0x1c3bd0){const _0x4ac45a=a7_0x5eaf,_0x3bfd55=_0x4d1990();while(!![]){try{const _0xd2d3a3=parseInt(_0x4ac45a(0x223))/0x1*(parseInt(_0x4ac45a(0x21f))/0x2)+parseInt(_0x4ac45a(0x1e5))/0x3*(parseInt(_0x4ac45a(0x222))/0x4)+-parseInt(_0x4ac45a(0x20f))/0x5*(parseInt(_0x4ac45a(0x20b))/0x6)+parseInt(_0x4ac45a(0x1d6))/0x7*(-parseInt(_0x4ac45a(0x226))/0x8)+-parseInt(_0x4ac45a(0x221))/0x9*(parseInt(_0x4ac45a(0x1e0))/0xa)+parseInt(_0x4ac45a(0x217))/0xb*(parseInt(_0x4ac45a(0x219))/0xc)+parseInt(_0x4ac45a(0x1df))/0xd*(-parseInt(_0x4ac45a(0x1ee))/0xe);if(_0xd2d3a3===_0x1c3bd0)break;else _0x3bfd55['push'](_0x3bfd55['shift']());}catch(_0x25f72c){_0x3bfd55['push'](_0x3bfd55['shift']());}}}(a7_0x5a13,0xd5e88));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_0xe83ced from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';function a7_0x5eaf(_0x470d76,_0x3d8446){_0x470d76=_0x470d76-0x1d2;const _0x5a1396=a7_0x5a13();let _0x5eaf38=_0x5a1396[_0x470d76];return _0x5eaf38;}import{LogLevel}from'../utils/tdx-logger.js';import a7_0x45b8a8 from'chalk';export async function runOAuthLoginFlow(_0xd81468,_0x17e9dc,_0x364e50,_0x1a12c6){const _0x32977a=a7_0x5eaf,_0x36c8e9=await isKeychainAvailable();if(!_0x36c8e9)throw new Error('System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20'+_0x32977a(0x207));let _0x1e4455=_0x1a12c6?.[_0x32977a(0x206)];if(!_0x1e4455){const _0x163f7a=await a7_0xe83ced({'type':_0x32977a(0x232),'name':_0x32977a(0x206),'message':'Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):'});if(_0x163f7a[_0x32977a(0x206)]===undefined)throw new Error('Setup\x20cancelled');_0x1e4455=_0x163f7a[_0x32977a(0x206)][_0x32977a(0x1dd)]()||undefined;}const _0x193429=getConsoleUrl(_0xd81468);console[_0x32977a(0x235)](_0x32977a(0x228));_0x1e4455?console['log']('\x20\x20'+_0x193429+_0x32977a(0x1ea)+_0x1e4455+')'):console[_0x32977a(0x235)]('\x20\x20'+_0x193429+_0x32977a(0x21d));console[_0x32977a(0x235)](_0x32977a(0x1dc));const _0x4d1e1c=await startOAuthFlow(_0xd81468,{'accountName':_0x1e4455});console[_0x32977a(0x235)](_0x32977a(0x1e2));const _0x4e5016=TDX[_0x32977a(0x234)]({'site':_0xd81468,'accessToken':_0x4d1e1c['access_token'],'logLevel':_0x364e50??LogLevel[_0x32977a(0x1ef)]}),_0x46dec8=await _0x4e5016[_0x32977a(0x1d9)][_0x32977a(0x20d)]();console[_0x32977a(0x235)](a7_0x45b8a8['green']('✓\x20Signed\x20in\x20successfully')),console[_0x32977a(0x235)]('\x20\x20'+a7_0x45b8a8[_0x32977a(0x1db)](_0xd81468+':'+_0x46dec8['account_id'])+_0x32977a(0x225)+_0x46dec8['id']+'\x20\x20('+_0x46dec8[_0x32977a(0x1d7)]+')');!_0x1e4455&&(console[_0x32977a(0x235)](a7_0x45b8a8[_0x32977a(0x21c)](_0x32977a(0x1e9))),console[_0x32977a(0x235)](a7_0x45b8a8[_0x32977a(0x21c)](_0x32977a(0x22c))),console[_0x32977a(0x235)](a7_0x45b8a8['dim'](_0x32977a(0x215))));await saveOAuthTokens(_0x4d1e1c,_0x17e9dc),console[_0x32977a(0x235)](_0x32977a(0x213)+(_0x17e9dc?_0x32977a(0x1fe)+_0x17e9dc+')':''));if(_0x17e9dc){const _0x22be56={'site':_0xd81468};saveProfileToUserConfig(_0x17e9dc,_0x22be56),console['log'](_0x32977a(0x209)+_0x17e9dc+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0xd81468),console[_0x32977a(0x235)]('✓\x20Default\x20site\x20set\x20to\x20'+_0xd81468);const _0x5a7f75=_0x17e9dc?_0x32977a(0x1f3)+_0x17e9dc:'';console[_0x32977a(0x235)](),console[_0x32977a(0x235)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x32977a(0x235)]('\x20\x20tdx'+_0x5a7f75+_0x32977a(0x212)),console['log'](_0x32977a(0x1f2)+_0x5a7f75+_0x32977a(0x216));}export async function promptAuthMethod(){const _0x335823=a7_0x5eaf,_0x4bd36b=await a7_0xe83ced({'type':_0x335823(0x1e4),'name':'method','message':_0x335823(0x1eb),'choices':[{'title':'Sign\x20in\x20with\x20browser\x20(recommended)','description':_0x335823(0x1f4),'value':_0x335823(0x208)},{'title':_0x335823(0x1f8),'description':'For\x20scripts\x20or\x20headless\x20servers','value':'apikey'}]});return _0x4bd36b[_0x335823(0x224)]||null;}export class AuthSetupCommand extends BaseCommand{[a7_0x1fe559(0x1e3)]='auth:setup';[a7_0x1fe559(0x1e1)]=a7_0x1fe559(0x200);async[a7_0x1fe559(0x1f9)](_0x1cf9f1){const _0x265d29=a7_0x1fe559,{options:_0x547564}=_0x1cf9f1,_0x196bd1=_0x547564[_0x265d29(0x1fc)];console[_0x265d29(0x235)](a7_0x45b8a8['bold']('tdx:\x20auth\x20setup'));const _0x370007=_0x547564[_0x265d29(0x1d3)]||'us01',_0x1155c9=await promptSiteSelection(_0x370007,_0x196bd1,_0x265d29(0x1fa));if(!_0x1155c9)return 0x1;const _0x280010=resolveSite(_0x1155c9),_0x2f15f6=await promptAuthMethod();if(!_0x2f15f6)return console[_0x265d29(0x235)](_0x265d29(0x1f5)),0x1;if(_0x2f15f6===_0x265d29(0x208)){const {accountName:_0x587e1b}=_0x547564;return await runOAuthLoginFlow(_0x280010,_0x196bd1,_0x547564[_0x265d29(0x1fd)]??LogLevel[_0x265d29(0x1ef)],{'accountName':_0x587e1b}),0x0;}console[_0x265d29(0x235)]('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x280010),console[_0x265d29(0x235)](_0x265d29(0x231)),console[_0x265d29(0x235)]('\x20\x20'+getConsoleUrl(_0x280010,_0x265d29(0x1ff)));const _0x724339=await a7_0xe83ced({'type':'password','name':'apiKey','message':_0x265d29(0x21b),'validate':_0x4d747a=>{const _0x6dacf5=_0x265d29;if(!_0x4d747a||!_0x4d747a[_0x6dacf5(0x1dd)]())return _0x6dacf5(0x233);return!![];}});if(!_0x724339[_0x265d29(0x1da)])return console['log'](_0x265d29(0x1f5)),0x1;const _0x3aa54e=_0x724339[_0x265d29(0x1da)];console[_0x265d29(0x235)](_0x265d29(0x1f6));try{const _0x47984e=TDX[_0x265d29(0x234)]({'site':_0x280010,'apiKey':_0x3aa54e[_0x265d29(0x1dd)](),'logLevel':_0x547564[_0x265d29(0x1fd)]??LogLevel[_0x265d29(0x1ef)]}),_0x1f824e=await _0x47984e[_0x265d29(0x1d9)][_0x265d29(0x20d)]();console['log'](_0x265d29(0x1ed)+_0x1f824e[_0x265d29(0x1d7)]+')');const _0x5048c4=await isKeychainAvailable();_0x5048c4?(await saveAPIKeyAsync(_0x3aa54e[_0x265d29(0x1dd)](),_0x280010,_0x196bd1),console['log'](_0x265d29(0x1f7)+(_0x196bd1?_0x265d29(0x1fe)+_0x196bd1+')':''))):(console['warn'](a7_0x45b8a8['yellow'](_0x265d29(0x1ec))),console['warn'](a7_0x45b8a8[_0x265d29(0x202)](_0x265d29(0x1d4))));if(_0x196bd1){const _0x15776a={'site':_0x280010};saveProfileToUserConfig(_0x196bd1,_0x15776a),console['log'](_0x265d29(0x209)+_0x196bd1+_0x265d29(0x1f0));}else saveDefaultSiteToUserConfig(_0x280010),console[_0x265d29(0x235)](_0x265d29(0x1d5)+_0x280010);const _0x350f75=_0x196bd1?_0x265d29(0x1f3)+_0x196bd1:'';return console[_0x265d29(0x235)](),console[_0x265d29(0x235)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x265d29(0x235)](_0x265d29(0x1f2)+_0x350f75+_0x265d29(0x212)),console['log']('\x20\x20tdx'+_0x350f75+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x1ce938){if(_0x1ce938 instanceof HTTPClientError&&_0x1ce938['status']===0x191)return printAuthError(_0x1ce938),0x1;return console[_0x265d29(0x205)](a7_0x45b8a8[_0x265d29(0x21a)](_0x265d29(0x20a)+(_0x1ce938 instanceof Error?_0x1ce938[_0x265d29(0x227)]:String(_0x1ce938)))),console[_0x265d29(0x205)]('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']=a7_0x1fe559(0x1d8);[a7_0x1fe559(0x1e1)]=a7_0x1fe559(0x20e);async[a7_0x1fe559(0x1f9)](_0x2e4730){const _0x559ef6=a7_0x1fe559,{options:_0x159fb3,tdx:_0x3e9bfc}=_0x2e4730,_0x1d2990=_0x159fb3['site'],_0x21530f=_0x159fb3[_0x559ef6(0x1fc)],_0x2c0068=_0x21530f?_0x21530f:_0x559ef6(0x1d2);console['log'](_0x559ef6(0x1e8)+_0x2c0068+_0x559ef6(0x20c)+_0x1d2990+')');const _0x2f277b=await getOAuthTokens(_0x21530f);if(_0x2f277b)console['log']('Credential\x20type:\x20OAuth'),console[_0x559ef6(0x235)](_0x559ef6(0x229)+(_0x21530f?_0x559ef6(0x1fe)+_0x21530f+')':''));else{const _0x1710b9=await resolveAPIKeyAsync(_0x1d2990,_0x21530f);if(_0x1710b9){const {source:_0x4e6612,isDeprecated:_0x2fb757}=_0x1710b9,_0x222d95=_0x559ef6(0x1f1)+_0x4e6612;console['log'](_0x2fb757?a7_0x45b8a8[_0x559ef6(0x202)](_0x222d95):_0x222d95);}else console['log'](a7_0x45b8a8[_0x559ef6(0x202)](_0x559ef6(0x22a)));}try{const _0x3f7c35=await _0x3e9bfc[_0x559ef6(0x1d9)][_0x559ef6(0x20d)]();return console[_0x559ef6(0x235)](a7_0x45b8a8[_0x559ef6(0x22f)](_0x559ef6(0x22d))),console[_0x559ef6(0x235)](_0x559ef6(0x220)+_0x3f7c35['email']),(_0x3f7c35[_0x559ef6(0x22b)]||_0x3f7c35['last_name'])&&console[_0x559ef6(0x235)]('Name:\x20'+[_0x3f7c35['first_name'],_0x3f7c35[_0x559ef6(0x22e)]]['filter'](Boolean)[_0x559ef6(0x1e6)]('\x20')),0x0;}catch(_0x1cf8e5){return _0x1cf8e5 instanceof HTTPClientError&&_0x1cf8e5[_0x559ef6(0x1fb)]===0x191?printAuthError(_0x1cf8e5,!![],_0x21530f):console[_0x559ef6(0x205)](a7_0x45b8a8[_0x559ef6(0x21a)](_0x559ef6(0x20a)+(_0x1cf8e5 instanceof Error?_0x1cf8e5['message']:String(_0x1cf8e5)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x1fe559(0x1e3)]=a7_0x1fe559(0x1e7);[a7_0x1fe559(0x1e1)]=a7_0x1fe559(0x1de);async[a7_0x1fe559(0x1f9)](_0x50e55f){const _0xe9fac5=a7_0x1fe559,{options:_0x5da036}=_0x50e55f,_0x4f4136=_0x5da036[_0xe9fac5(0x1fc)];console[_0xe9fac5(0x235)](a7_0x45b8a8[_0xe9fac5(0x203)]('tdx:\x20auth\x20clear'));const _0x338fd5=await isKeychainAvailable();if(!_0x338fd5)return console['error'](a7_0x45b8a8[_0xe9fac5(0x21a)](_0xe9fac5(0x211))),0x1;const [_0x4fb2f8,_0x399d3e]=await Promise[_0xe9fac5(0x21e)]([deleteKeychainAPIKey(_0x4f4136),deleteOAuthTokens(_0x4f4136)]);if(_0x4fb2f8||_0x399d3e){clearCredentialCache();const _0x228391=[_0x4fb2f8&&_0xe9fac5(0x210),_0x399d3e&&_0xe9fac5(0x218)][_0xe9fac5(0x201)](Boolean)[_0xe9fac5(0x1e6)](_0xe9fac5(0x204));return console[_0xe9fac5(0x235)]('✓\x20'+_0x228391+_0xe9fac5(0x214)+(_0x4f4136?_0xe9fac5(0x1fe)+_0x4f4136+')':'')),0x0;}else return console[_0xe9fac5(0x235)]('No\x20credentials\x20found\x20in\x20keychain'+(_0x4f4136?_0xe9fac5(0x230)+_0x4f4136:'')),0x1;}}function a7_0x5a13(){const _0x4e7def=['auth:clear','tdx\x20profile:\x20','\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','/users/initiate_sso\x20(account:\x20','Choose\x20how\x20to\x20sign\x20in:','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','14CIoQYd','ERROR','\x27\x20registered','Read\x20credential\x20from\x20','\x20\x20tdx','\x20--profile\x20','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','\x0aSetup\x20cancelled','Validating\x20API\x20key...','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','Use\x20an\x20API\x20key','execute','Setup\x20cancelled','status','profile','logLevel','\x20(profile:\x20','/app/mp/ak','Setup\x20API\x20key\x20authentication\x20interactively','filter','yellow','bold','\x20and\x20','error','accountName','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','oauth','✓\x20Profile\x20\x27','✗\x20Validation\x20failed:\x20','108cTwCJR','\x20(site:\x20','getUserInfo','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','14395wsZrXw','API\x20key','System\x20keychain\x20is\x20not\x20available','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','\x20removed\x20from\x20keychain','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','143obfxFm','OAuth\x20tokens','380256abjdrf','red','Enter\x20your\x20TD\x20API\x20key:','dim','/oauth/authorize','all','2BEfrxA','User:\x20','2900943CpIEiY','358864hoSEmg','1170035lnABUw','method','\x20\x20user_id:','48QJSsTK','message','Opening\x20browser\x20for\x20authentication...','Read\x20credential\x20from\x20keychain','No\x20credential\x20found','first_name','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','✓\x20Authentication\x20successful\x0a','last_name','green','\x20for\x20profile:\x20','You\x20can\x20find\x20your\x20API\x20key\x20at:','text','API\x20key\x20cannot\x20be\x20empty','create','log','N/A','site','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','✓\x20Default\x20site\x20set\x20to\x20','435281dJbGKj','email','auth','jobs','apiKey','cyan','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','trim','Remove\x20API\x20key\x20from\x20system\x20keychain','6242834QKvByd','30wwDmyb','description','Validating\x20OAuth\x20tokens...','name','select','39gMhZfQ','join'];a7_0x5a13=function(){return _0x4e7def;};return a7_0x5a13();}
|
|
1
|
+
const a7_0x9f7a25=a7_0x41c9;(function(_0x10e4bb,_0xe65ba8){const _0x7b2a6a=a7_0x41c9,_0x542e33=_0x10e4bb();while(!![]){try{const _0x1ff92a=parseInt(_0x7b2a6a(0x108))/0x1+-parseInt(_0x7b2a6a(0x128))/0x2+-parseInt(_0x7b2a6a(0x146))/0x3+parseInt(_0x7b2a6a(0x131))/0x4*(parseInt(_0x7b2a6a(0x14e))/0x5)+parseInt(_0x7b2a6a(0x13a))/0x6*(-parseInt(_0x7b2a6a(0x124))/0x7)+parseInt(_0x7b2a6a(0x114))/0x8+-parseInt(_0x7b2a6a(0x127))/0x9*(parseInt(_0x7b2a6a(0x161))/0xa);if(_0x1ff92a===_0xe65ba8)break;else _0x542e33['push'](_0x542e33['shift']());}catch(_0x3c1c5a){_0x542e33['push'](_0x542e33['shift']());}}}(a7_0x2d8a,0xaab63));import{BaseCommand,printAuthError}from'./command.js';function a7_0x41c9(_0x1aa1c0,_0x42f492){_0x1aa1c0=_0x1aa1c0-0x107;const _0x2d8ac8=a7_0x2d8a();let _0x41c9fe=_0x2d8ac8[_0x1aa1c0];return _0x41c9fe;}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_0x273064 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_0x171774 from'chalk';export async function runOAuthLoginFlow(_0x506797,_0x3e44ae,_0x41c5c0,_0x273459){const _0x4b5e55=a7_0x41c9,_0x5e145f=await isKeychainAvailable();if(!_0x5e145f)throw new Error('System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20'+'Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.');let _0x99bf89=_0x273459?.[_0x4b5e55(0x11f)];if(!_0x99bf89){const _0x6efb25=await a7_0x273064({'type':_0x4b5e55(0x15e),'name':'accountName','message':_0x4b5e55(0x116)});if(_0x6efb25['accountName']===undefined)throw new Error('Setup\x20cancelled');_0x99bf89=_0x6efb25['accountName'][_0x4b5e55(0x10c)]()||undefined;}const _0x301545=getConsoleUrl(_0x506797);console[_0x4b5e55(0x142)]('Opening\x20browser\x20for\x20authentication...');_0x99bf89?console[_0x4b5e55(0x142)]('\x20\x20'+_0x301545+_0x4b5e55(0x110)+_0x99bf89+')'):console[_0x4b5e55(0x142)]('\x20\x20'+_0x301545+_0x4b5e55(0x112));console[_0x4b5e55(0x142)](_0x4b5e55(0x15b));const _0x2148a2=await startOAuthFlow(_0x506797,{'accountName':_0x99bf89});console[_0x4b5e55(0x142)](_0x4b5e55(0x12f));const _0x2b84ee=TDX[_0x4b5e55(0x136)]({'site':_0x506797,'accessToken':_0x2148a2[_0x4b5e55(0x15a)],'logLevel':_0x41c5c0??LogLevel['ERROR']}),_0x100e24=await _0x2b84ee[_0x4b5e55(0x138)]['getUserInfo']();console[_0x4b5e55(0x142)](a7_0x171774[_0x4b5e55(0x135)](_0x4b5e55(0x126))),console['log']('\x20\x20'+a7_0x171774[_0x4b5e55(0x130)](_0x506797+':'+_0x100e24[_0x4b5e55(0x13d)])+_0x4b5e55(0x13b)+_0x100e24['id']+_0x4b5e55(0x11b)+_0x100e24[_0x4b5e55(0x12c)]+')');!_0x99bf89&&(console[_0x4b5e55(0x142)](a7_0x171774['dim']('\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:')),console[_0x4b5e55(0x142)](a7_0x171774[_0x4b5e55(0x10f)](_0x4b5e55(0x134))),console[_0x4b5e55(0x142)](a7_0x171774['dim']('\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions')));await saveOAuthTokens(_0x2148a2,_0x3e44ae),console[_0x4b5e55(0x142)](_0x4b5e55(0x150)+(_0x3e44ae?'\x20(profile:\x20'+_0x3e44ae+')':''));if(_0x3e44ae){const _0x259323={'site':_0x506797};saveProfileToUserConfig(_0x3e44ae,_0x259323),console[_0x4b5e55(0x142)](_0x4b5e55(0x163)+_0x3e44ae+_0x4b5e55(0x129));}else saveDefaultSiteToUserConfig(_0x506797),console[_0x4b5e55(0x142)](_0x4b5e55(0x13f)+_0x506797);const _0x2df1a7=_0x3e44ae?_0x4b5e55(0x140)+_0x3e44ae:'';console[_0x4b5e55(0x142)](),console[_0x4b5e55(0x142)](_0x4b5e55(0x12d)),console[_0x4b5e55(0x142)](_0x4b5e55(0x15d)+_0x2df1a7+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x4b5e55(0x142)]('\x20\x20tdx'+_0x2df1a7+_0x4b5e55(0x133));}export async function promptAuthMethod(){const _0x1fcb7d=a7_0x41c9,_0x5737b0=await a7_0x273064({'type':_0x1fcb7d(0x10d),'name':'method','message':'Choose\x20how\x20to\x20sign\x20in:','choices':[{'title':'Sign\x20in\x20with\x20browser\x20(recommended)','description':'Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','value':_0x1fcb7d(0x144)},{'title':_0x1fcb7d(0x165),'description':_0x1fcb7d(0x111),'value':_0x1fcb7d(0x113)}]});return _0x5737b0['method']||null;}export class AuthSetupCommand extends BaseCommand{[a7_0x9f7a25(0x12b)]=a7_0x9f7a25(0x120);[a7_0x9f7a25(0x11c)]=a7_0x9f7a25(0x152);async[a7_0x9f7a25(0x148)](_0x6beb25){const _0x221616=a7_0x9f7a25,{options:_0x4413d8}=_0x6beb25,_0x28aafa=_0x4413d8[_0x221616(0x164)];console['log'](a7_0x171774['bold'](_0x221616(0x141)));const _0x32b2e8=_0x4413d8[_0x221616(0x154)]||'us01',_0x1eac95=await promptSiteSelection(_0x32b2e8,_0x28aafa,_0x221616(0x11a));if(!_0x1eac95)return 0x1;const _0x28c795=resolveSite(_0x1eac95),_0x482680=await promptAuthMethod();if(!_0x482680)return console['log']('\x0aSetup\x20cancelled'),0x1;if(_0x482680===_0x221616(0x144)){const {accountName:_0x28a2f4}=_0x4413d8;return await runOAuthLoginFlow(_0x28c795,_0x28aafa,_0x4413d8[_0x221616(0x159)]??LogLevel[_0x221616(0x151)],{'accountName':_0x28a2f4}),0x0;}console[_0x221616(0x142)](_0x221616(0x122)+_0x28c795),console[_0x221616(0x142)](_0x221616(0x14f)),console[_0x221616(0x142)]('\x20\x20'+getConsoleUrl(_0x28c795,_0x221616(0x10a)));const _0x5d57e1=await a7_0x273064({'type':_0x221616(0x10b),'name':'apiKey','message':_0x221616(0x14d),'validate':_0x2ce2ef=>{const _0x460d0d=_0x221616;if(!_0x2ce2ef||!_0x2ce2ef[_0x460d0d(0x10c)]())return _0x460d0d(0x14c);return!![];}});if(!_0x5d57e1[_0x221616(0x14a)])return console[_0x221616(0x142)]('\x0aSetup\x20cancelled'),0x1;const _0x5bb1d1=_0x5d57e1[_0x221616(0x14a)];console[_0x221616(0x142)]('Validating\x20API\x20key...');try{const _0x75a8da=TDX['create']({'site':_0x28c795,'apiKey':_0x5bb1d1[_0x221616(0x10c)](),'logLevel':_0x4413d8['logLevel']??LogLevel[_0x221616(0x151)]}),_0x35f865=await _0x75a8da[_0x221616(0x138)][_0x221616(0x13e)]();console[_0x221616(0x142)](_0x221616(0x125)+_0x35f865['email']+')');const _0x5d6b14=await isKeychainAvailable();_0x5d6b14?(await saveAPIKeyAsync(_0x5bb1d1[_0x221616(0x10c)](),_0x28c795,_0x28aafa),console['log'](_0x221616(0x147)+(_0x28aafa?_0x221616(0x149)+_0x28aafa+')':''))):(console[_0x221616(0x11e)](a7_0x171774[_0x221616(0x160)](_0x221616(0x107))),console[_0x221616(0x11e)](a7_0x171774['yellow'](_0x221616(0x156))));if(_0x28aafa){const _0x4a5c96={'site':_0x28c795};saveProfileToUserConfig(_0x28aafa,_0x4a5c96),console['log'](_0x221616(0x163)+_0x28aafa+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x28c795),console[_0x221616(0x142)](_0x221616(0x13f)+_0x28c795);const _0x2436e8=_0x28aafa?_0x221616(0x140)+_0x28aafa:'';return console[_0x221616(0x142)](),console[_0x221616(0x142)](_0x221616(0x12d)),console['log']('\x20\x20tdx'+_0x2436e8+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x221616(0x142)]('\x20\x20tdx'+_0x2436e8+_0x221616(0x133)),0x0;}catch(_0x217567){if(_0x217567 instanceof HTTPClientError&&_0x217567[_0x221616(0x143)]===0x191)return printAuthError(_0x217567),0x1;return console[_0x221616(0x115)](a7_0x171774['red'](_0x221616(0x12e)+(_0x217567 instanceof Error?_0x217567[_0x221616(0x132)]:String(_0x217567)))),console[_0x221616(0x115)](_0x221616(0x162)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x9f7a25(0x12b)]=a7_0x9f7a25(0x157);['description']=a7_0x9f7a25(0x11d);async[a7_0x9f7a25(0x148)](_0x4ff716){const _0x4ec1a2=a7_0x9f7a25,{options:_0x27d8a3,tdx:_0x2b67ac}=_0x4ff716,_0x1705d1=_0x27d8a3[_0x4ec1a2(0x154)],_0x2c50fc=_0x27d8a3['profile'],_0x4968f8=_0x2c50fc?_0x2c50fc:_0x4ec1a2(0x117);console[_0x4ec1a2(0x142)](_0x4ec1a2(0x14b)+_0x4968f8+_0x4ec1a2(0x145)+_0x1705d1+')');const _0x5bdeb9=await getOAuthTokens(_0x2c50fc);if(_0x5bdeb9)console[_0x4ec1a2(0x142)](_0x4ec1a2(0x13c)),console[_0x4ec1a2(0x142)](_0x4ec1a2(0x166)+(_0x2c50fc?_0x4ec1a2(0x149)+_0x2c50fc+')':''));else{const _0x20f225=await resolveAPIKeyAsync(_0x1705d1,_0x2c50fc);if(_0x20f225){const {source:_0xa326b,isDeprecated:_0x4a8d8e}=_0x20f225,_0x230563='Read\x20credential\x20from\x20'+_0xa326b;console['log'](_0x4a8d8e?a7_0x171774[_0x4ec1a2(0x160)](_0x230563):_0x230563);}else console[_0x4ec1a2(0x142)](a7_0x171774['yellow'](_0x4ec1a2(0x153)));}try{const _0x3aea89=await _0x2b67ac[_0x4ec1a2(0x138)][_0x4ec1a2(0x13e)]();return console[_0x4ec1a2(0x142)](a7_0x171774[_0x4ec1a2(0x135)]('✓\x20Authentication\x20successful\x0a')),console[_0x4ec1a2(0x142)]('User:\x20'+_0x3aea89[_0x4ec1a2(0x12c)]),(_0x3aea89[_0x4ec1a2(0x121)]||_0x3aea89[_0x4ec1a2(0x10e)])&&console[_0x4ec1a2(0x142)](_0x4ec1a2(0x155)+[_0x3aea89[_0x4ec1a2(0x121)],_0x3aea89[_0x4ec1a2(0x10e)]][_0x4ec1a2(0x118)](Boolean)['join']('\x20')),0x0;}catch(_0x53e1d5){return _0x53e1d5 instanceof HTTPClientError&&_0x53e1d5[_0x4ec1a2(0x143)]===0x191?printAuthError(_0x53e1d5,!![],_0x2c50fc):console[_0x4ec1a2(0x115)](a7_0x171774[_0x4ec1a2(0x123)]('✗\x20Validation\x20failed:\x20'+(_0x53e1d5 instanceof Error?_0x53e1d5[_0x4ec1a2(0x132)]:String(_0x53e1d5)))),0x1;}}}function a7_0x2d8a(){const _0x5dca74=['error','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','N/A','filter','\x20and\x20','Setup\x20cancelled','\x20\x20(','description','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','warn','accountName','auth:setup','first_name','Setting\x20up\x20authentication\x20for\x20site:\x20','red','7eovNoA','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','✓\x20Signed\x20in\x20successfully','14508siQbAU','77366yVKhjN','\x27\x20registered','tdx:\x20auth\x20clear','name','email','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','✗\x20Validation\x20failed:\x20','Validating\x20OAuth\x20tokens...','cyan','4WEwzfJ','message','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','green','create','System\x20keychain\x20is\x20not\x20available','jobs','No\x20credentials\x20found\x20in\x20keychain','5718858MQIXvl','\x20\x20user_id:','Credential\x20type:\x20OAuth','account_id','getUserInfo','✓\x20Default\x20site\x20set\x20to\x20','\x20--profile\x20','tdx:\x20auth\x20setup','log','status','oauth','\x20(site:\x20','511827hSZCic','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','execute','\x20(profile:\x20','apiKey','tdx\x20profile:\x20','API\x20key\x20cannot\x20be\x20empty','Enter\x20your\x20TD\x20API\x20key:','6085640ddxQgb','You\x20can\x20find\x20your\x20API\x20key\x20at:','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','ERROR','Setup\x20API\x20key\x20authentication\x20interactively','No\x20credential\x20found','site','Name:\x20','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','auth','\x20removed\x20from\x20keychain','logLevel','access_token','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','join','\x20\x20tdx','text','Remove\x20API\x20key\x20from\x20system\x20keychain','yellow','2050iPGJxq','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','✓\x20Profile\x20\x27','profile','Use\x20an\x20API\x20key','Read\x20credential\x20from\x20keychain','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','144416WoYzhg','\x20for\x20profile:\x20','/app/mp/ak','password','trim','select','last_name','dim','/users/initiate_sso\x20(account:\x20','For\x20scripts\x20or\x20headless\x20servers','/oauth/authorize','apikey','6644688VfiFQV'];a7_0x2d8a=function(){return _0x5dca74;};return a7_0x2d8a();}export class AuthClearCommand extends BaseCommand{[a7_0x9f7a25(0x12b)]='auth:clear';['description']=a7_0x9f7a25(0x15f);async[a7_0x9f7a25(0x148)](_0x2be3a4){const _0x241310=a7_0x9f7a25,{options:_0x3376dd}=_0x2be3a4,_0x39813c=_0x3376dd['profile'];console[_0x241310(0x142)](a7_0x171774['bold'](_0x241310(0x12a)));const _0x34ac54=await isKeychainAvailable();if(!_0x34ac54)return console[_0x241310(0x115)](a7_0x171774[_0x241310(0x123)](_0x241310(0x137))),0x1;const [_0x3e8782,_0x5ebcbd]=await Promise['all']([deleteKeychainAPIKey(_0x39813c),deleteOAuthTokens(_0x39813c)]);if(_0x3e8782||_0x5ebcbd){clearCredentialCache();const _0x3a2add=[_0x3e8782&&'API\x20key',_0x5ebcbd&&'OAuth\x20tokens']['filter'](Boolean)[_0x241310(0x15c)](_0x241310(0x119));return console['log']('✓\x20'+_0x3a2add+_0x241310(0x158)+(_0x39813c?_0x241310(0x149)+_0x39813c+')':'')),0x0;}else return console[_0x241310(0x142)](_0x241310(0x139)+(_0x39813c?_0x241310(0x109)+_0x39813c:'')),0x1;}}
|