@treasuredata/tdx 2026.3.22 → 2026.3.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-login-command.js +1 -1
- package/dist/commands/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/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/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/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/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a3_0x1a92(){const _0x49aa7f=['15LvCFYr','resolveSegmentId','Listing\x20activations\x20for\x20segment\x20\x27','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','1511583ZhbBIW','5447410agtRFk','✔\x20Found\x20','segment','error','\x20activation','Resolving\x20parent\x20segment\x20\x27','verbose','site','7329938xIAVbO','642151FAuXiS','resolveParentId','Parent\x20name:\x20','9lhOetT','558510awhLoZ','Child\x20name:\x20','Resolved\x20parent\x20ID:\x20','Resolved\x20child\x20ID:\x20','length','message','19047KuLDlg','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','execute','data','cause','Error:\x20Segment\x20name\x20is\x20required','description','listActivations','\x27...','2XZdhOu','Error:\x20','4572332MPXeoy','968oCyLuR','activations'];a3_0x1a92=function(){return _0x49aa7f;};return a3_0x1a92();}const a3_0xab93e0=a3_0x5546;function a3_0x5546(_0x2ba5a2,_0x23d0e3){_0x2ba5a2=_0x2ba5a2-0x8a;const _0x1a921c=a3_0x1a92();let _0x554651=_0x1a921c[_0x2ba5a2];return _0x554651;}(function(_0x2e342c,_0x35c23e){const _0xd2855e=a3_0x5546,_0x145dee=_0x2e342c();while(!![]){try{const _0x5511fa=-parseInt(_0xd2855e(0xa5))/0x1*(-parseInt(_0xd2855e(0x92))/0x2)+-parseInt(_0xd2855e(0x9b))/0x3+parseInt(_0xd2855e(0x94))/0x4+parseInt(_0xd2855e(0x97))/0x5*(parseInt(_0xd2855e(0xa9))/0x6)+-parseInt(_0xd2855e(0xaf))/0x7*(-parseInt(_0xd2855e(0x95))/0x8)+parseInt(_0xd2855e(0xa8))/0x9*(-parseInt(_0xd2855e(0x9c))/0xa)+-parseInt(_0xd2855e(0xa4))/0xb;if(_0x5511fa===_0x35c23e)break;else _0x145dee['push'](_0x145dee['shift']());}catch(_0x585c15){_0x145dee['push'](_0x145dee['shift']());}}}(a3_0x1a92,0xa5b72));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_0xab93e0(0x96);[a3_0xab93e0(0x8f)]='List\x20activations\x20for\x20a\x20segment';async[a3_0xab93e0(0x8b)](_0x490205){const _0x25ed1f=a3_0xab93e0,{options:_0x4e7198,args:_0x517845,tdx:_0x2ee247}=_0x490205;if(_0x517845[_0x25ed1f(0xad)]===0x0)return console[_0x25ed1f(0x9f)](_0x25ed1f(0x8e)),console['error']('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;try{const {parentId:_0x2ef5df,childId:_0x3de016}=parseSegmentRef(_0x517845[0x0]);if(!_0x3de016)return console[_0x25ed1f(0x9f)](_0x25ed1f(0x9a)),console['error'](_0x25ed1f(0x8a)),0x1;_0x4e7198[_0x25ed1f(0xa2)]&&(console[_0x25ed1f(0x9f)]('Site:\x20'+_0x4e7198[_0x25ed1f(0xa3)]),console[_0x25ed1f(0x9f)](_0x25ed1f(0xa7)+_0x2ef5df),console[_0x25ed1f(0x9f)](_0x25ed1f(0xaa)+_0x3de016));const _0x47090d=await withSpinner(_0x25ed1f(0xa1)+_0x2ef5df+_0x25ed1f(0x91),()=>_0x2ee247[_0x25ed1f(0x9e)][_0x25ed1f(0xa6)](_0x2ef5df),{'verbose':_0x4e7198[_0x25ed1f(0xa2)]}),_0x1a7fa0=_0x47090d[_0x25ed1f(0x8c)];_0x4e7198['verbose']&&console[_0x25ed1f(0x9f)](_0x25ed1f(0xab)+_0x1a7fa0);const _0x4ed841=await withSpinner('Resolving\x20child\x20segment\x20\x27'+_0x3de016+_0x25ed1f(0x91),()=>_0x2ee247[_0x25ed1f(0x9e)][_0x25ed1f(0x98)](_0x1a7fa0,_0x3de016),{'verbose':_0x4e7198['verbose']}),_0xc3273=_0x4ed841['data'];_0x4e7198['verbose']&&console[_0x25ed1f(0x9f)](_0x25ed1f(0xac)+_0xc3273);const _0x2a601a=await withSpinner(_0x25ed1f(0x99)+_0x3de016+_0x25ed1f(0x91),()=>_0x2ee247[_0x25ed1f(0x9e)][_0x25ed1f(0x90)](_0x1a7fa0,_0xc3273),{'verbose':_0x4e7198[_0x25ed1f(0xa2)]}),_0x5ea3b3=_0x2a601a[_0x25ed1f(0x8c)];return console['error'](_0x25ed1f(0x9d)+_0x5ea3b3[_0x25ed1f(0xad)]+_0x25ed1f(0xa0)+(_0x5ea3b3[_0x25ed1f(0xad)]!==0x1?'s':'')),await handleSDKOutput(_0x5ea3b3,_0x4e7198),0x0;}catch(_0x15a7df){if(_0x15a7df instanceof SDKError)return console['error'](_0x25ed1f(0x93)+_0x15a7df[_0x25ed1f(0xae)]),_0x15a7df[_0x25ed1f(0x8d)]&&console['error']('\x20\x20Cause:\x20'+_0x15a7df[_0x25ed1f(0x8d)]),0x1;throw _0x15a7df;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x2b2217=a4_0x7c7f;(function(_0xa070de,_0x564371){const _0x164261=a4_0x7c7f,_0xaa9cfa=_0xa070de();while(!![]){try{const _0x1edf7a=-parseInt(_0x164261(0x24b))/0x1+parseInt(_0x164261(0x1fd))/0x2+parseInt(_0x164261(0x1f5))/0x3+-parseInt(_0x164261(0x1e9))/0x4*(parseInt(_0x164261(0x22c))/0x5)+parseInt(_0x164261(0x204))/0x6*(-parseInt(_0x164261(0x1c6))/0x7)+-parseInt(_0x164261(0x1b1))/0x8*(parseInt(_0x164261(0x21b))/0x9)+parseInt(_0x164261(0x219))/0xa;if(_0x1edf7a===_0x564371)break;else _0xaa9cfa['push'](_0xaa9cfa['shift']());}catch(_0x4bae76){_0xaa9cfa['push'](_0xaa9cfa['shift']());}}}(a4_0xbec1,0xce36a));import a4_0x135328 from'chalk';import a4_0x572045 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';function a4_0x7c7f(_0x2281bf,_0x318cd5){_0x2281bf=_0x2281bf-0x1ab;const _0xbec1e1=a4_0xbec1();let _0x7c7f9f=_0xbec1e1[_0x2281bf];return _0x7c7f9f;}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(_0x3adf99){const _0x1eb67b=a4_0x7c7f,_0x5dbdba=[];if(_0x3adf99['total']!==undefined)_0x5dbdba['push'](_0x3adf99[_0x1eb67b(0x1d8)]+_0x1eb67b(0x1be));if(_0x3adf99['new']!==undefined&&_0x3adf99[_0x1eb67b(0x1c2)]>0x0)_0x5dbdba[_0x1eb67b(0x1d3)](a4_0x135328[_0x1eb67b(0x24d)](_0x3adf99['new']+_0x1eb67b(0x23b)));if(_0x3adf99['created']!==undefined&&_0x3adf99[_0x1eb67b(0x20e)]>0x0)_0x5dbdba[_0x1eb67b(0x1d3)](a4_0x135328['green'](_0x3adf99[_0x1eb67b(0x20e)]+_0x1eb67b(0x234)));if(_0x3adf99[_0x1eb67b(0x23e)]!==undefined&&_0x3adf99[_0x1eb67b(0x23e)]>0x0)_0x5dbdba[_0x1eb67b(0x1d3)](a4_0x135328['yellow'](_0x3adf99[_0x1eb67b(0x23e)]+'\x20updated'));if(_0x3adf99[_0x1eb67b(0x222)]!==undefined&&_0x3adf99[_0x1eb67b(0x222)]>0x0)_0x5dbdba['push'](a4_0x135328[_0x1eb67b(0x1f3)](_0x3adf99[_0x1eb67b(0x222)]+_0x1eb67b(0x207)));if(_0x3adf99[_0x1eb67b(0x1b5)]!==undefined&&_0x3adf99[_0x1eb67b(0x1b5)]>0x0)_0x5dbdba[_0x1eb67b(0x1d3)](a4_0x135328[_0x1eb67b(0x21f)](_0x3adf99[_0x1eb67b(0x1b5)]+'\x20errors'));return _0x5dbdba['join'](',\x20');}function displayDiffs(_0x22dc2e,_0x3cce45,_0x2e7d0b,_0x287d20,_0x19c650,_0x135e4e,_0x178d22){const _0x92d652=a4_0x7c7f;for(const _0x353b96 of _0x22dc2e){if(_0x353b96[_0x92d652(0x1ed)]){const _0x4a24a7=_0x353b96['agentName']||_0x353b96[_0x92d652(0x255)];console['log']('\x0aChanges\x20to\x20agent\x20\x27'+_0x4a24a7+'\x27:'),console[_0x92d652(0x1c3)]('─'[_0x92d652(0x233)](0x3c)),console[_0x92d652(0x1c3)](_0x353b96['diff']),console['log']('─'[_0x92d652(0x233)](0x3c));}}for(const _0x57015b of _0x3cce45){_0x57015b[_0x92d652(0x1ed)]&&(console[_0x92d652(0x1c3)](_0x92d652(0x1ac)+_0x57015b[_0x92d652(0x255)]+'\x27:'),console[_0x92d652(0x1c3)]('─'[_0x92d652(0x233)](0x3c)),console[_0x92d652(0x1c3)](_0x57015b['diff']),console[_0x92d652(0x1c3)]('─'[_0x92d652(0x233)](0x3c)));}for(const _0x39d01a of _0x2e7d0b){_0x39d01a['diff']&&(console['log']('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x39d01a['name']+'\x27:'),console[_0x92d652(0x1c3)]('─'[_0x92d652(0x233)](0x3c)),console[_0x92d652(0x1c3)](_0x39d01a[_0x92d652(0x1ed)]),console[_0x92d652(0x1c3)]('─'['repeat'](0x3c)));}for(const _0x5c958b of _0x287d20){_0x5c958b[_0x92d652(0x1ed)]&&(console[_0x92d652(0x1c3)](_0x92d652(0x237)+_0x5c958b[_0x92d652(0x255)]+'\x27:'),console[_0x92d652(0x1c3)]('─'[_0x92d652(0x233)](0x3c)),console[_0x92d652(0x1c3)](_0x5c958b['diff']),console[_0x92d652(0x1c3)]('─'['repeat'](0x3c)));}for(const _0x290015 of _0x19c650){_0x290015[_0x92d652(0x1ed)]&&(console[_0x92d652(0x1c3)](_0x92d652(0x253)+_0x290015['name']+'\x27:'),console[_0x92d652(0x1c3)]('─'[_0x92d652(0x233)](0x3c)),console[_0x92d652(0x1c3)](_0x290015[_0x92d652(0x1ed)]),console['log']('─'['repeat'](0x3c)));}for(const _0x89ec41 of _0x135e4e){_0x89ec41[_0x92d652(0x1ed)]&&(console[_0x92d652(0x1c3)](_0x92d652(0x231)+_0x89ec41[_0x92d652(0x255)]+'\x27:'),console['log']('─'[_0x92d652(0x233)](0x3c)),console[_0x92d652(0x1c3)](_0x89ec41[_0x92d652(0x1ed)]),console[_0x92d652(0x1c3)]('─'[_0x92d652(0x233)](0x3c)));}for(const _0x2c11b1 of _0x178d22){_0x2c11b1[_0x92d652(0x1ed)]&&(console[_0x92d652(0x1c3)](_0x92d652(0x1ae)+_0x2c11b1[_0x92d652(0x255)]+'\x27:'),console[_0x92d652(0x1c3)]('─'[_0x92d652(0x233)](0x3c)),console[_0x92d652(0x1c3)](_0x2c11b1[_0x92d652(0x1ed)]),console[_0x92d652(0x1c3)]('─'[_0x92d652(0x233)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x2b2217(0x255)]=a4_0x2b2217(0x1b2);['description']=a4_0x2b2217(0x256);async[a4_0x2b2217(0x257)](_0x21ec45){const _0xb13774=a4_0x2b2217,{options:_0x31f079,args:_0x444b5e,tdx:_0x3098e8}=_0x21ec45,_0x27ea2d=_0x444b5e[0x0],_0x33922a=_0x444b5e[0x1],_0x409b6a=_0x31f079[_0xb13774(0x247)],_0x1321e3=_0x31f079[_0xb13774(0x1ad)],_0x2ca707=_0x31f079[_0xb13774(0x223)],_0x23a784=_0x31f079['yes'],_0x3dc49f=_0x31f079[_0xb13774(0x24c)],_0x1b49bf=_0x31f079[_0xb13774(0x1f8)];let _0x1e9503;if(_0x27ea2d){const _0x1cd154=a4_0x572045[_0xb13774(0x1b8)](_0x27ea2d,_0xb13774(0x20f));if(existsSync(_0x1cd154))try{const _0x3f6edb=JSON[_0xb13774(0x1dd)](readFileSync(_0x1cd154,'utf-8'));_0x3f6edb[_0xb13774(0x200)]&&(_0x1e9503={'llm_project':_0x3f6edb[_0xb13774(0x200)]});}catch{}}const _0x561a39=findAgentConfigPath(process[_0xb13774(0x243)]());let _0x13c82d;if(_0x561a39)try{const _0x1ac357=JSON[_0xb13774(0x1dd)](readFileSync(_0x561a39,'utf-8'));_0x1ac357[_0xb13774(0x200)]&&(_0x13c82d={'llm_project':_0x1ac357['llm_project']});}catch{}const _0x260e5a=resolveAgentPullArgs({'arg':_0x27ea2d,'agentNameArg':_0x33922a,'agentFlag':_0x1b49bf,'contextProject':_0x3dc49f,'argDirConfig':_0x1e9503,'cwdConfigPath':_0x561a39||undefined,'cwdConfig':_0x13c82d}),{projectNameOrId:_0x2ec0a9,targetAgentName:_0x515f5f,existingOutputDir:_0x1adbee,source:_0x346f23}=_0x260e5a;if(_0x346f23===_0xb13774(0x1c7))console[_0xb13774(0x1c3)](a4_0x135328['dim'](_0xb13774(0x1f2)+a4_0x572045['join'](_0x27ea2d,_0xb13774(0x20f))+':\x20'+_0x2ec0a9));else{if(_0x346f23==='cwd-config')console[_0xb13774(0x1c3)](a4_0x135328[_0xb13774(0x212)](_0xb13774(0x250)+_0x2ec0a9));else _0x346f23===_0xb13774(0x22f)&&console[_0xb13774(0x1c3)](a4_0x135328[_0xb13774(0x212)](_0xb13774(0x220)+_0x2ec0a9));}if(!_0x2ec0a9)return _0x1b49bf?(console[_0xb13774(0x1c3)](a4_0x135328[_0xb13774(0x23a)](_0xb13774(0x209))),console[_0xb13774(0x1c3)](_0xb13774(0x1c1)),console[_0xb13774(0x1c3)]('Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>')):(console[_0xb13774(0x1c3)](a4_0x135328['yellow']('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console['log'](_0xb13774(0x1b0)),console['log'](_0xb13774(0x1e4)),console[_0xb13774(0x1c3)](_0xb13774(0x1c8)),console[_0xb13774(0x1c3)](_0xb13774(0x1e5)),console[_0xb13774(0x1c3)](_0xb13774(0x236))),0x1;if(_0x515f5f){const {data:_0x8f1944}=await withSpinner(_0xb13774(0x20c)+_0x515f5f+_0xb13774(0x252)+_0x2ec0a9+_0xb13774(0x230),()=>_0x3098e8[_0xb13774(0x1c5)][_0xb13774(0x1f1)](_0x2ec0a9,_0x515f5f,_0x409b6a,{'dryRun':_0x1321e3,'force':_0x2ca707}));if(_0x1321e3)return console[_0xb13774(0x1c3)](a4_0x135328[_0xb13774(0x23a)](_0xb13774(0x25c))),console['log'](_0xb13774(0x228)+_0x8f1944[_0xb13774(0x1e8)]),console[_0xb13774(0x1c3)]('Output\x20path:\x20'+_0x8f1944[_0xb13774(0x1e1)]),_0x8f1944[_0xb13774(0x1ed)]&&(console[_0xb13774(0x1c3)]('\x0aChanges:'),console[_0xb13774(0x1c3)]('─'[_0xb13774(0x233)](0x3c)),console[_0xb13774(0x1c3)](_0x8f1944[_0xb13774(0x1ed)]),console[_0xb13774(0x1c3)]('─'[_0xb13774(0x233)](0x3c))),0x0;return console['log'](a4_0x135328[_0xb13774(0x24d)](_0xb13774(0x1cb))),console[_0xb13774(0x1c3)](_0xb13774(0x1dc)+_0x8f1944['agentName']),console[_0xb13774(0x1c3)]('Output:\x20'+_0x8f1944[_0xb13774(0x1e1)]),console[_0xb13774(0x1c3)](_0xb13774(0x226)+(_0x8f1944[_0xb13774(0x22e)]?a4_0x135328[_0xb13774(0x24d)](_0xb13774(0x1c2)):_0x8f1944['hasChanges']?a4_0x135328[_0xb13774(0x23a)](_0xb13774(0x23e)):a4_0x135328[_0xb13774(0x1f3)](_0xb13774(0x222)))),0x0;}const _0x1b6d5d=_0x1adbee||_0x409b6a,{data:_0x3cda7c}=await withSpinner(_0xb13774(0x1e6)+_0x2ec0a9+'\x22...',()=>_0x3098e8[_0xb13774(0x1c5)][_0xb13774(0x1cd)](_0x2ec0a9,_0x1b6d5d,{'dryRun':!![]})),_0x22d72c=_0x3cda7c['counts'][_0xb13774(0x254)]['new']+_0x3cda7c[_0xb13774(0x248)]['knowledgeBases'][_0xb13774(0x1c2)]+_0x3cda7c[_0xb13774(0x248)][_0xb13774(0x24e)][_0xb13774(0x1c2)]+_0x3cda7c[_0xb13774(0x248)][_0xb13774(0x1b7)][_0xb13774(0x1c2)]+_0x3cda7c[_0xb13774(0x248)][_0xb13774(0x1ab)][_0xb13774(0x1c2)]+_0x3cda7c['counts'][_0xb13774(0x216)]['new']+_0x3cda7c['counts'][_0xb13774(0x1b4)]['new'],_0x37aed1=_0x3cda7c[_0xb13774(0x248)][_0xb13774(0x254)][_0xb13774(0x23e)]+_0x3cda7c[_0xb13774(0x248)]['knowledgeBases'][_0xb13774(0x23e)]+_0x3cda7c[_0xb13774(0x248)][_0xb13774(0x24e)]['updated']+_0x3cda7c[_0xb13774(0x248)][_0xb13774(0x1b7)][_0xb13774(0x23e)]+_0x3cda7c['counts'][_0xb13774(0x1ab)][_0xb13774(0x23e)]+_0x3cda7c[_0xb13774(0x248)]['experimentalKnowledgeBases'][_0xb13774(0x23e)]+_0x3cda7c[_0xb13774(0x248)][_0xb13774(0x1b4)]['updated'],_0x2ad53c=_0x3cda7c[_0xb13774(0x248)]['agents'][_0xb13774(0x222)]+_0x3cda7c[_0xb13774(0x248)]['knowledgeBases']['unchanged']+_0x3cda7c['counts'][_0xb13774(0x24e)]['unchanged']+_0x3cda7c['counts'][_0xb13774(0x1b7)]['unchanged']+_0x3cda7c[_0xb13774(0x248)][_0xb13774(0x1ab)][_0xb13774(0x222)]+_0x3cda7c['counts'][_0xb13774(0x216)][_0xb13774(0x222)]+_0x3cda7c[_0xb13774(0x248)][_0xb13774(0x1b4)][_0xb13774(0x222)];console[_0xb13774(0x1c3)]('\x0aPull\x20summary\x20for\x20\x27'+_0x3cda7c['projectName']+'\x27:'),console['log']('\x20\x20'+a4_0x135328[_0xb13774(0x24d)]('+\x20'+_0x22d72c+'\x20new')+_0xb13774(0x1d7)+a4_0x135328['yellow']('~\x20'+_0x37aed1+_0xb13774(0x1e0))+'\x20|\x20'+a4_0x135328[_0xb13774(0x212)]('=\x20'+_0x2ad53c+_0xb13774(0x207))),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x3cda7c['counts'][_0xb13774(0x254)])),console[_0xb13774(0x1c3)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x3cda7c['counts'][_0xb13774(0x251)])),console['log'](_0xb13774(0x1ce)+formatCountSummary(_0x3cda7c[_0xb13774(0x248)][_0xb13774(0x24e)])),console['log']('\x20\x20Prompts:\x20'+formatCountSummary(_0x3cda7c[_0xb13774(0x248)][_0xb13774(0x1b7)])),console[_0xb13774(0x1c3)](_0xb13774(0x214)+formatCountSummary(_0x3cda7c['counts']['integrations']));const _0x45195b=_0x3cda7c[_0xb13774(0x248)][_0xb13774(0x216)][_0xb13774(0x1d8)]>0x0||_0x3cda7c[_0xb13774(0x248)][_0xb13774(0x1b4)][_0xb13774(0x1d8)]>0x0;_0x45195b&&(console[_0xb13774(0x1c3)](_0xb13774(0x1f0)+formatCountSummary(_0x3cda7c[_0xb13774(0x248)][_0xb13774(0x216)])),console['log'](_0xb13774(0x1b3)+formatCountSummary(_0x3cda7c[_0xb13774(0x248)][_0xb13774(0x1b4)])));console[_0xb13774(0x1c3)](_0xb13774(0x208)+a4_0x135328[_0xb13774(0x1ec)](_0x3cda7c['outputDir'])),displayDiffs(_0x3cda7c[_0xb13774(0x254)],_0x3cda7c['knowledgeBases'],_0x3cda7c[_0xb13774(0x24e)],_0x3cda7c[_0xb13774(0x1b7)],_0x3cda7c[_0xb13774(0x1ab)],_0x3cda7c[_0xb13774(0x216)],_0x3cda7c[_0xb13774(0x1b4)]);if(_0x1321e3)return console[_0xb13774(0x1c3)](a4_0x135328[_0xb13774(0x23a)](_0xb13774(0x1eb))),0x0;if(_0x22d72c===0x0&&_0x37aed1===0x0)return console[_0xb13774(0x1c3)](a4_0x135328['green'](_0xb13774(0x239))),saveSessionContext({'llm_project':_0x3cda7c[_0xb13774(0x240)]},_0x31f079[_0xb13774(0x20d)]),console[_0xb13774(0x1c3)](a4_0x135328['green'](_0xb13774(0x21c)+a4_0x135328[_0xb13774(0x212)]('llm_project')+_0xb13774(0x24f)+a4_0x135328[_0xb13774(0x1ec)](_0x3cda7c[_0xb13774(0x240)]))),0x0;if(!_0x23a784&&!_0x2ca707){if(!isInteractive())return console[_0xb13774(0x1e7)](a4_0x135328['red'](_0xb13774(0x1df)),_0xb13774(0x1c0)),console[_0xb13774(0x1e7)](a4_0x135328[_0xb13774(0x212)](_0xb13774(0x221))),0x1;const _0x56a92f=await confirmKey(_0xb13774(0x1ca)+(_0x22d72c+_0x37aed1)+_0xb13774(0x215));if(!_0x56a92f)return console[_0xb13774(0x1c3)](a4_0x135328[_0xb13774(0x23a)](_0xb13774(0x232)),_0xb13774(0x1de)),0x1;}const {data:_0x1349af}=await withSpinner(_0xb13774(0x1bc),()=>_0x3098e8['llm']['pullProject'](_0x2ec0a9,_0x1b6d5d,{'force':_0x2ca707}));return console['log'](a4_0x135328[_0xb13774(0x24d)](_0xb13774(0x1ea)+(_0x22d72c+_0x37aed1)+'\x20files\x20to\x20'+_0x1349af[_0xb13774(0x201)])),saveSessionContext({'llm_project':_0x1349af[_0xb13774(0x240)]},_0x31f079[_0xb13774(0x20d)]),console[_0xb13774(0x1c3)](a4_0x135328[_0xb13774(0x24d)](_0xb13774(0x21c)+a4_0x135328['dim'](_0xb13774(0x200))+_0xb13774(0x24f)+a4_0x135328['cyan'](_0x1349af['projectName']))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x2b2217(0x255)]='agent:clone';[a4_0x2b2217(0x23f)]=a4_0x2b2217(0x1bd);async[a4_0x2b2217(0x257)](_0x39ea83){const _0x57810e=a4_0x2b2217,{options:_0x4f5a0f,args:_0x2a555a,tdx:_0x4e1131}=_0x39ea83,_0x454c54=_0x2a555a[0x0],_0x1eeb8f=_0x4f5a0f[_0x57810e(0x255)],_0x5802=_0x4f5a0f[_0x57810e(0x1ad)],_0x32029c=_0x4f5a0f[_0x57810e(0x205)],_0x2175d7=_0x4f5a0f[_0x57810e(0x1b9)],_0x1df721=_0x4f5a0f[_0x57810e(0x24c)];let _0x187852;const _0x3e6b44=findAgentConfigPath(process[_0x57810e(0x243)]());if(_0x454c54){const _0x4ac4d6=a4_0x572045[_0x57810e(0x1b8)](_0x454c54,_0x57810e(0x20f));existsSync(_0x4ac4d6)?(_0x187852=_0x454c54,console[_0x57810e(0x1c3)](a4_0x135328[_0x57810e(0x212)](_0x57810e(0x1d1)+_0x454c54))):_0x187852=_0x454c54;}else{if(_0x3e6b44)_0x187852=a4_0x572045[_0x57810e(0x1bf)](_0x3e6b44),console[_0x57810e(0x1c3)](a4_0x135328[_0x57810e(0x212)]('Using\x20current\x20project:\x20'+_0x187852));else{if(_0x1df721){const _0x5e545a=sanitizeForFilesystem(_0x1df721);let _0x775d3d=_0x5e545a,_0x4c5cec=a4_0x572045['join'](process[_0x57810e(0x243)](),_0x57810e(0x254),_0x5e545a,_0x57810e(0x20f));if(!existsSync(_0x4c5cec)){const _0x565774=normalizeName(_0x1df721),_0x2f993e=a4_0x572045[_0x57810e(0x1b8)](process[_0x57810e(0x243)](),'agents',_0x565774,'tdx.json');existsSync(_0x2f993e)&&(_0x775d3d=_0x565774,_0x4c5cec=_0x2f993e);}if(existsSync(_0x4c5cec))_0x187852=a4_0x572045['dirname'](_0x4c5cec),console[_0x57810e(0x1c3)](a4_0x135328['dim']('Using\x20local\x20project:\x20'+_0x187852));else{const _0x3849c8=_0x4f5a0f[_0x57810e(0x1bb)];if(_0x3849c8)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x57810e(0x227)+_0x1df721+_0x57810e(0x21d),undefined,{'helpText':'When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a'+_0x57810e(0x217)+(_0x57810e(0x1f9)+_0x1df721+'\x0a')+(_0x57810e(0x1f6)+_0x775d3d+'\x20--name\x20'+(_0x1eeb8f||'<new-name>')+_0x57810e(0x1d4)+_0x3849c8)});_0x187852=_0x1df721,console[_0x57810e(0x1c3)](a4_0x135328[_0x57810e(0x212)]('Using\x20context\x20project:\x20'+_0x1df721));}}}}if(!_0x187852)return console['log'](a4_0x135328[_0x57810e(0x23a)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x57810e(0x1c3)]('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console[_0x57810e(0x1c3)]('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console['log'](_0x57810e(0x245)),console[_0x57810e(0x1c3)](_0x57810e(0x246)),0x1;if(!_0x1eeb8f)throw new SDKError(ErrorCode[_0x57810e(0x225)],'New\x20project\x20name\x20is\x20required',undefined,{'helpText':_0x57810e(0x23c)});if(!_0x32029c&&!_0x5802){if(!isInteractive())return console['error'](a4_0x135328['red'](_0x57810e(0x1df)),_0x57810e(0x1c0)),console[_0x57810e(0x1e7)](a4_0x135328[_0x57810e(0x212)](_0x57810e(0x221))),0x1;const _0x368e29=await confirmKey('Clone\x20\x22'+_0x187852+_0x57810e(0x203)+_0x1eeb8f+'\x22?');if(!_0x368e29)return console['log'](a4_0x135328[_0x57810e(0x23a)](_0x57810e(0x232))),0x1;}const {data:_0x55b6a0}=await withSpinner('Cloning\x20\x22'+_0x187852+_0x57810e(0x1d6)+_0x1eeb8f+_0x57810e(0x230),()=>_0x4e1131['llm'][_0x57810e(0x241)](_0x187852,_0x1eeb8f,{'dryRun':_0x5802}));if(_0x5802){console[_0x57810e(0x1c3)](a4_0x135328['yellow'](_0x57810e(0x1c4))),console[_0x57810e(0x1c3)]('Source:\x20'+_0x55b6a0[_0x57810e(0x25a)]),console[_0x57810e(0x1c3)](_0x57810e(0x21a)+_0x1eeb8f),console[_0x57810e(0x1c3)](_0x57810e(0x206)),console[_0x57810e(0x1c3)](_0x57810e(0x22a)+_0x55b6a0[_0x57810e(0x248)][_0x57810e(0x254)][_0x57810e(0x20e)]),console[_0x57810e(0x1c3)](_0x57810e(0x1e2)+_0x55b6a0[_0x57810e(0x248)][_0x57810e(0x251)][_0x57810e(0x20e)]),console[_0x57810e(0x1c3)](_0x57810e(0x202)+_0x55b6a0[_0x57810e(0x248)]['prompts'][_0x57810e(0x20e)]);const _0x59fc63=_0x55b6a0[_0x57810e(0x248)][_0x57810e(0x216)][_0x57810e(0x20e)]>0x0||_0x55b6a0[_0x57810e(0x248)][_0x57810e(0x1b4)][_0x57810e(0x20e)]>0x0;return _0x59fc63&&(console[_0x57810e(0x1c3)](_0x57810e(0x1f0)+_0x55b6a0[_0x57810e(0x248)][_0x57810e(0x216)]['created']),console['log'](_0x57810e(0x1b3)+_0x55b6a0[_0x57810e(0x248)]['experimentalArtifacts'][_0x57810e(0x20e)])),0x0;}const _0x1808f4=_0x55b6a0[_0x57810e(0x248)][_0x57810e(0x254)][_0x57810e(0x1b5)]>0x0||_0x55b6a0[_0x57810e(0x248)][_0x57810e(0x251)][_0x57810e(0x1b5)]>0x0||_0x55b6a0[_0x57810e(0x248)][_0x57810e(0x1b7)][_0x57810e(0x1b5)]>0x0||_0x55b6a0['counts'][_0x57810e(0x216)][_0x57810e(0x1b5)]>0x0||_0x55b6a0[_0x57810e(0x248)][_0x57810e(0x1b4)][_0x57810e(0x1b5)]>0x0;_0x1808f4?console[_0x57810e(0x1c3)](a4_0x135328[_0x57810e(0x23a)](_0x57810e(0x1f7))):console['log'](a4_0x135328[_0x57810e(0x24d)](_0x57810e(0x1da)));console[_0x57810e(0x1c3)](_0x57810e(0x1cc)+_0x55b6a0[_0x57810e(0x25a)]),console['log'](_0x57810e(0x21a)+_0x55b6a0[_0x57810e(0x229)]),console[_0x57810e(0x1c3)](_0x57810e(0x1fa)+_0x55b6a0[_0x57810e(0x1f4)]),console[_0x57810e(0x1c3)](),console[_0x57810e(0x1c3)]('Summary:'),console[_0x57810e(0x1c3)]('\x20\x20Agents:\x20'+formatCountSummary(_0x55b6a0[_0x57810e(0x248)][_0x57810e(0x254)])),console['log']('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x55b6a0['counts'][_0x57810e(0x251)])),console[_0x57810e(0x1c3)](_0x57810e(0x202)+formatCountSummary(_0x55b6a0[_0x57810e(0x248)][_0x57810e(0x1b7)])),console[_0x57810e(0x1c3)](_0x57810e(0x214)+formatCountSummary(_0x55b6a0[_0x57810e(0x248)]['integrations']));const _0x3d63af=_0x55b6a0[_0x57810e(0x248)][_0x57810e(0x216)]['created']>0x0||_0x55b6a0[_0x57810e(0x248)][_0x57810e(0x216)][_0x57810e(0x23e)]>0x0||_0x55b6a0['counts'][_0x57810e(0x216)][_0x57810e(0x222)]>0x0||_0x55b6a0[_0x57810e(0x248)][_0x57810e(0x1b4)][_0x57810e(0x20e)]>0x0||_0x55b6a0[_0x57810e(0x248)]['experimentalArtifacts']['updated']>0x0||_0x55b6a0['counts'][_0x57810e(0x1b4)]['unchanged']>0x0;_0x3d63af&&(console['log'](_0x57810e(0x1f0)+formatCountSummary(_0x55b6a0[_0x57810e(0x248)]['experimentalKnowledgeBases'])),console[_0x57810e(0x1c3)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x55b6a0[_0x57810e(0x248)][_0x57810e(0x1b4)])));if(_0x1808f4){console['log'](),console[_0x57810e(0x1c3)](a4_0x135328[_0x57810e(0x21f)]('Errors:'));for(const _0x59525f of _0x55b6a0[_0x57810e(0x254)]){_0x59525f[_0x57810e(0x249)]===_0x57810e(0x1e7)&&console[_0x57810e(0x1c3)](a4_0x135328[_0x57810e(0x21f)](_0x57810e(0x1fc)+_0x59525f['agentName']+_0x57810e(0x24a)+_0x59525f[_0x57810e(0x1e7)]));}for(const _0x5663f0 of _0x55b6a0[_0x57810e(0x251)]){_0x5663f0[_0x57810e(0x249)]===_0x57810e(0x1e7)&&console[_0x57810e(0x1c3)](a4_0x135328[_0x57810e(0x21f)](_0x57810e(0x259)+_0x5663f0[_0x57810e(0x255)]+'\x22:\x20'+_0x5663f0['error']));}for(const _0x493907 of _0x55b6a0[_0x57810e(0x1b7)]){_0x493907[_0x57810e(0x249)]===_0x57810e(0x1e7)&&console['log'](a4_0x135328['red'](_0x57810e(0x1fe)+_0x493907['name']+'\x22:\x20'+_0x493907['error']));}for(const _0x440e32 of _0x55b6a0[_0x57810e(0x1ab)]){_0x440e32[_0x57810e(0x249)]==='error'&&console[_0x57810e(0x1c3)](a4_0x135328[_0x57810e(0x21f)](_0x57810e(0x242)+_0x440e32[_0x57810e(0x255)]+'\x22:\x20'+_0x440e32[_0x57810e(0x1e7)]));}for(const _0x1674d8 of _0x55b6a0[_0x57810e(0x216)]){_0x1674d8[_0x57810e(0x249)]==='error'&&console[_0x57810e(0x1c3)](a4_0x135328[_0x57810e(0x21f)](_0x57810e(0x22b)+_0x1674d8[_0x57810e(0x255)]+_0x57810e(0x24a)+_0x1674d8[_0x57810e(0x1e7)]));}for(const _0x2e220e of _0x55b6a0[_0x57810e(0x1b4)]){_0x2e220e[_0x57810e(0x249)]===_0x57810e(0x1e7)&&console['log'](a4_0x135328[_0x57810e(0x21f)](_0x57810e(0x224)+_0x2e220e['name']+_0x57810e(0x24a)+_0x2e220e[_0x57810e(0x1e7)]));}return 0x1;}console[_0x57810e(0x1c3)]();const _0x1e1156=getLLMProjectUrl(_0x2175d7,_0x55b6a0[_0x57810e(0x1f4)]);return console[_0x57810e(0x1c3)](_0x57810e(0x1cf)+a4_0x135328[_0x57810e(0x1ec)](_0x1e1156)),0x0;}}export class AgentPushCommand extends BaseCommand{['name']='agent:push';[a4_0x2b2217(0x23f)]='Push\x20local\x20agent\x20files\x20to\x20LLM\x20project';async[a4_0x2b2217(0x257)](_0x2b1dae){const _0x148115=a4_0x2b2217,{options:_0x4981de,args:_0x5c772d,tdx:_0x48402e}=_0x2b1dae;let _0x295122=_0x5c772d[0x0]||process[_0x148115(0x243)]();const _0x3509a5=_0x4981de[_0x148115(0x1ad)],_0x25157e=_0x4981de[_0x148115(0x223)],_0x352065=_0x4981de[_0x148115(0x205)],_0x5eeda4=_0x4981de[_0x148115(0x1b9)],_0x27be8b=a4_0x572045[_0x148115(0x1b8)](_0x295122,_0x148115(0x244)),_0x52749b=existsSync(_0x27be8b);if(_0x52749b){const {data:_0x4354ae}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x295122+_0x148115(0x230),()=>_0x48402e[_0x148115(0x1c5)][_0x148115(0x1d0)](_0x295122,{'dryRun':_0x3509a5,'force':_0x25157e}));if(_0x3509a5)return console[_0x148115(0x1c3)](a4_0x135328[_0x148115(0x23a)](_0x148115(0x1c4))),console['log'](_0x148115(0x1d2)+_0x4354ae[_0x148115(0x1e8)]),0x0;if(_0x4354ae['action']===_0x148115(0x1e7))return console[_0x148115(0x1c3)](a4_0x135328[_0x148115(0x21f)](_0x148115(0x1b6)+_0x4354ae[_0x148115(0x1e7)])),0x1;console[_0x148115(0x1c3)](a4_0x135328[_0x148115(0x24d)](_0x148115(0x258)+_0x4354ae[_0x148115(0x249)]+_0x148115(0x218))),console[_0x148115(0x1c3)](_0x148115(0x1dc)+_0x4354ae[_0x148115(0x1e8)]);if(_0x4354ae[_0x148115(0x1db)]&&_0x4354ae[_0x148115(0x25b)]){const _0x57ba4f=getLLMAgentChatUrl(_0x5eeda4,_0x4354ae['projectId'],_0x4354ae[_0x148115(0x1db)]);console[_0x148115(0x1c3)]('Chat:\x20'+a4_0x135328[_0x148115(0x1ec)](_0x57ba4f));}return 0x0;}const _0x1b8a89=_0x4981de[_0x148115(0x24c)],_0x5cc6df=resolveProjectFromContext(_0x295122,_0x1b8a89);if(_0x5cc6df['found'])_0x295122=_0x5cc6df[_0x148115(0x210)],_0x5cc6df[_0x148115(0x21e)]===_0x148115(0x22f)&&console[_0x148115(0x1c3)](a4_0x135328[_0x148115(0x212)](_0x148115(0x250)+_0x295122));else{let _0x525879=_0x148115(0x1d9);_0x5cc6df[_0x148115(0x213)]===_0x148115(0x235)&&(_0x525879=_0x5cc6df[_0x148115(0x20b)]+_0x148115(0x1ee)+_0x5cc6df[_0x148115(0x24c)]+_0x148115(0x1e3));throw new SDKError(ErrorCode[_0x148115(0x1fb)],_0x5cc6df['reason']===_0x148115(0x20a)?_0x5cc6df[_0x148115(0x20b)]:_0x148115(0x1ff)+_0x295122,undefined,{'helpText':_0x525879});}const {data:_0x2cd609}=await withSpinner(_0x148115(0x211),()=>_0x48402e[_0x148115(0x1c5)]['pushProject'](_0x295122,{'dryRun':!![]})),_0x7e409d=_0x2cd609[_0x148115(0x248)][_0x148115(0x254)][_0x148115(0x1b5)]>0x0;if(_0x7e409d){console[_0x148115(0x1c3)](a4_0x135328[_0x148115(0x21f)](_0x148115(0x1d5)));for(const _0x3f4be4 of _0x2cd609['agents']){_0x3f4be4['action']===_0x148115(0x1e7)&&console['log'](a4_0x135328[_0x148115(0x21f)](_0x148115(0x1fc)+_0x3f4be4[_0x148115(0x1e8)]+_0x148115(0x24a)+_0x3f4be4[_0x148115(0x1e7)]));}return 0x1;}const _0x2eaa66=_0x2cd609[_0x148115(0x248)][_0x148115(0x254)][_0x148115(0x20e)]+_0x2cd609[_0x148115(0x248)][_0x148115(0x251)][_0x148115(0x20e)]+_0x2cd609[_0x148115(0x248)][_0x148115(0x24e)][_0x148115(0x20e)]+_0x2cd609[_0x148115(0x248)]['prompts'][_0x148115(0x20e)]+_0x2cd609['counts']['integrations'][_0x148115(0x20e)]+_0x2cd609[_0x148115(0x248)][_0x148115(0x216)][_0x148115(0x20e)]+_0x2cd609[_0x148115(0x248)]['experimentalArtifacts'][_0x148115(0x20e)],_0x149074=_0x2cd609[_0x148115(0x248)][_0x148115(0x254)][_0x148115(0x23e)]+_0x2cd609[_0x148115(0x248)][_0x148115(0x251)][_0x148115(0x23e)]+_0x2cd609['counts'][_0x148115(0x24e)][_0x148115(0x23e)]+_0x2cd609[_0x148115(0x248)][_0x148115(0x1b7)][_0x148115(0x23e)]+_0x2cd609['counts'][_0x148115(0x1ab)]['updated']+_0x2cd609[_0x148115(0x248)]['experimentalKnowledgeBases'][_0x148115(0x23e)]+_0x2cd609[_0x148115(0x248)][_0x148115(0x1b4)][_0x148115(0x23e)],_0x42af4d=_0x2cd609[_0x148115(0x248)][_0x148115(0x254)]['unchanged']+_0x2cd609[_0x148115(0x248)][_0x148115(0x251)][_0x148115(0x222)]+_0x2cd609[_0x148115(0x248)][_0x148115(0x24e)]['unchanged']+_0x2cd609['counts'][_0x148115(0x1b7)][_0x148115(0x222)]+_0x2cd609[_0x148115(0x248)][_0x148115(0x1ab)][_0x148115(0x222)]+_0x2cd609[_0x148115(0x248)][_0x148115(0x216)][_0x148115(0x222)]+_0x2cd609['counts'][_0x148115(0x1b4)]['unchanged'];console['log']('\x0aPush\x20summary\x20for\x20\x27'+_0x2cd609[_0x148115(0x240)]+'\x27:'),console[_0x148115(0x1c3)]('\x20\x20'+a4_0x135328[_0x148115(0x24d)]('+\x20'+_0x2eaa66+_0x148115(0x23b))+_0x148115(0x1d7)+a4_0x135328[_0x148115(0x23a)]('~\x20'+_0x149074+_0x148115(0x1e0))+'\x20|\x20'+a4_0x135328[_0x148115(0x212)]('=\x20'+_0x42af4d+_0x148115(0x207))),console[_0x148115(0x1c3)](_0x148115(0x22a)+formatCountSummary(_0x2cd609[_0x148115(0x248)]['agents'])),console[_0x148115(0x1c3)](_0x148115(0x1e2)+formatCountSummary(_0x2cd609[_0x148115(0x248)][_0x148115(0x251)])),console[_0x148115(0x1c3)](_0x148115(0x1ce)+formatCountSummary(_0x2cd609[_0x148115(0x248)][_0x148115(0x24e)])),console[_0x148115(0x1c3)](_0x148115(0x202)+formatCountSummary(_0x2cd609['counts'][_0x148115(0x1b7)])),console[_0x148115(0x1c3)](_0x148115(0x214)+formatCountSummary(_0x2cd609[_0x148115(0x248)][_0x148115(0x1ab)]));const _0xf513a4=_0x2cd609[_0x148115(0x248)][_0x148115(0x216)][_0x148115(0x20e)]>0x0||_0x2cd609[_0x148115(0x248)][_0x148115(0x216)][_0x148115(0x23e)]>0x0||_0x2cd609[_0x148115(0x248)][_0x148115(0x216)][_0x148115(0x222)]>0x0||_0x2cd609[_0x148115(0x248)][_0x148115(0x1b4)][_0x148115(0x20e)]>0x0||_0x2cd609[_0x148115(0x248)][_0x148115(0x1b4)][_0x148115(0x23e)]>0x0||_0x2cd609['counts'][_0x148115(0x1b4)]['unchanged']>0x0;_0xf513a4&&(console[_0x148115(0x1c3)](_0x148115(0x1f0)+formatCountSummary(_0x2cd609['counts'][_0x148115(0x216)])),console[_0x148115(0x1c3)](_0x148115(0x1b3)+formatCountSummary(_0x2cd609[_0x148115(0x248)][_0x148115(0x1b4)])));console[_0x148115(0x1c3)](_0x148115(0x1ba)+a4_0x135328['cyan'](_0x295122)),displayDiffs(_0x2cd609[_0x148115(0x254)],_0x2cd609[_0x148115(0x251)],_0x2cd609[_0x148115(0x24e)],_0x2cd609[_0x148115(0x1b7)],_0x2cd609[_0x148115(0x1ab)],_0x2cd609[_0x148115(0x216)],_0x2cd609[_0x148115(0x1b4)]);if(_0x3509a5)return console[_0x148115(0x1c3)](a4_0x135328[_0x148115(0x23a)](_0x148115(0x23d))),0x0;if(_0x2eaa66===0x0&&_0x149074===0x0){console[_0x148115(0x1c3)](a4_0x135328[_0x148115(0x24d)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x1a154a=getLLMProjectUrl(_0x5eeda4,_0x2cd609[_0x148115(0x25b)]);return console[_0x148115(0x1c3)](_0x148115(0x1cf)+a4_0x135328[_0x148115(0x1ec)](_0x1a154a)),0x0;}if(!_0x352065&&!_0x25157e){if(!isInteractive())return console[_0x148115(0x1e7)](a4_0x135328['red']('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x148115(0x1e7)](a4_0x135328[_0x148115(0x212)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x1d9a10=await confirmKey(_0x148115(0x238)+(_0x2eaa66+_0x149074)+'\x20resources?');if(!_0x1d9a10)return console['log'](a4_0x135328[_0x148115(0x23a)](_0x148115(0x232)),'-\x20nothing\x20pushed'),0x1;}const {data:_0x5e0a4c}=await withSpinner('Pushing\x20to\x20project...',()=>_0x48402e[_0x148115(0x1c5)][_0x148115(0x1af)](_0x295122,{'force':_0x25157e})),_0x2cc7b4=_0x5e0a4c['counts'][_0x148115(0x254)][_0x148115(0x1b5)]>0x0||_0x5e0a4c['counts'][_0x148115(0x251)]['errors']>0x0||_0x5e0a4c[_0x148115(0x248)][_0x148115(0x24e)][_0x148115(0x1b5)]>0x0||_0x5e0a4c[_0x148115(0x248)][_0x148115(0x1b7)][_0x148115(0x1b5)]>0x0;if(_0x2cc7b4){console[_0x148115(0x1c3)](a4_0x135328['yellow'](_0x148115(0x1c9))),console[_0x148115(0x1c3)](),console[_0x148115(0x1c3)](a4_0x135328['red'](_0x148115(0x1ef)));for(const _0x120513 of _0x5e0a4c['agents']){_0x120513['action']===_0x148115(0x1e7)&&console['log'](a4_0x135328[_0x148115(0x21f)]('\x20\x20Agent\x20\x22'+_0x120513[_0x148115(0x1e8)]+_0x148115(0x24a)+_0x120513['error']));}for(const _0x1add04 of _0x5e0a4c[_0x148115(0x251)]){_0x1add04[_0x148115(0x249)]==='error'&&console[_0x148115(0x1c3)](a4_0x135328[_0x148115(0x21f)](_0x148115(0x259)+_0x1add04['name']+'\x22:\x20'+_0x1add04['error']));}for(const _0x41c9d0 of _0x5e0a4c[_0x148115(0x24e)]){_0x41c9d0['action']===_0x148115(0x1e7)&&console['log'](a4_0x135328[_0x148115(0x21f)]('\x20\x20Text\x20Knowledge\x20Base\x20\x22'+_0x41c9d0[_0x148115(0x255)]+_0x148115(0x24a)+_0x41c9d0[_0x148115(0x1e7)]));}for(const _0x348285 of _0x5e0a4c[_0x148115(0x1b7)]){_0x348285['action']===_0x148115(0x1e7)&&console[_0x148115(0x1c3)](a4_0x135328[_0x148115(0x21f)](_0x148115(0x1fe)+_0x348285[_0x148115(0x255)]+_0x148115(0x24a)+_0x348285['error']));}for(const _0x45ea5a of _0x5e0a4c[_0x148115(0x1ab)]){_0x45ea5a[_0x148115(0x249)]===_0x148115(0x1e7)&&console['log'](a4_0x135328['red'](_0x148115(0x242)+_0x45ea5a[_0x148115(0x255)]+_0x148115(0x24a)+_0x45ea5a[_0x148115(0x1e7)]));}return 0x1;}console[_0x148115(0x1c3)](a4_0x135328[_0x148115(0x24d)]('\x0a✔\x20Pushed\x20'+(_0x2eaa66+_0x149074)+_0x148115(0x22d)+_0x5e0a4c[_0x148115(0x240)]+'\x27'));const _0x21c880=getLLMProjectUrl(_0x5eeda4,_0x5e0a4c[_0x148115(0x25b)]);return console[_0x148115(0x1c3)](_0x148115(0x1cf)+a4_0x135328[_0x148115(0x1ec)](_0x21c880)),0x0;}}function a4_0xbec1(){const _0xa47598=['action','\x22:\x20','606188AwnrzP','llmProject','green','textKnowledgeBases','\x20=\x20','Using\x20project:\x20','knowledgeBases','\x22\x20from\x20project\x20\x22','\x0aChanges\x20to\x20integration\x20\x27','agents','name','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','execute','Agent\x20','\x20\x20Knowledge\x20Base\x20\x22','sourceProjectName','projectId','Dry\x20run\x20-\x20no\x20files\x20written','integrations','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','dryRun','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','pushProject','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)','109808rVWehw','agent:pull','\x20\x20Experimental\x20Artifacts:\x20','experimentalArtifacts','errors','Failed\x20to\x20push\x20agent:\x20','prompts','join','site','\x20\x20Source:\x20','profile','Writing\x20files...','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x20total','dirname','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','new','log','Dry\x20run\x20-\x20no\x20changes\x20made','llm','8112461rIcIeP','arg-dir','\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','\x0aProject\x20pushed\x20with\x20errors','\x0aWrite\x20','Agent\x20pulled\x20successfully','Source:\x20','pullProject','\x20\x20Text\x20Knowledge\x20Bases:\x20','Project:\x20','pushAgent','Using\x20local\x20project:\x20','Would\x20push\x20agent:\x20','push','\x20--profile\x20','\x0aErrors\x20found:','\x22\x20to\x20\x22','\x20|\x20','total','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','Project\x20cloned\x20successfully','agentId','Agent:\x20','parse','-\x20no\x20files\x20written','\x0aError:','\x20changed','outputPath','\x20\x20Knowledge\x20Bases:\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','\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','\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','Analyzing\x20project\x20\x22','error','agentName','4edzNpw','\x0a✔\x20Pulled\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','cyan','diff','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','Errors:','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','pullAgent','Using\x20project\x20from\x20','gray','newProjectId','179802CkNits','\x20\x20tdx\x20agent\x20clone\x20agents/','Project\x20cloned\x20with\x20errors','agent','\x20\x20tdx\x20agent\x20pull\x20','New\x20project\x20ID:\x20','INVALID_ARGUMENT','\x20\x20Agent\x20\x22','571650vhGPhH','\x20\x20Prompt\x20\x22','No\x20tdx.json\x20found\x20in\x20','llm_project','outputDir','\x20\x20Prompts:\x20','\x22\x20to\x20new\x20project\x20\x22','6NkaHGk','yes','Would\x20clone:','\x20unchanged','\x20\x20Target:\x20','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','no_context','message','Pulling\x20agent\x20\x22','session','created','tdx.json','projectDir','Analyzing\x20changes\x20to\x20push...','dim','reason','\x20\x20Integrations:\x20','\x20files?','experimentalKnowledgeBases','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x20successfully','45062700Cpofrp','New\x20project:\x20','621umAgSg','✔\x20Context\x20set:\x20','\x22\x20to\x20a\x20different\x20profile','source','red','Using\x20project\x20from\x20context:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','unchanged','force','\x20\x20Experimental\x20Artifact\x20\x22','MISSING_ARGUMENT','Status:\x20','Cannot\x20clone\x20from\x20context\x20project\x20\x22','Would\x20pull\x20agent:\x20','newProjectName','\x20\x20Agents:\x20','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','6475870jDzDxi','\x20resources\x20to\x20\x27','isNew','context','\x22...','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','Cancelled','repeat','\x20created','no_local_folder','\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','\x0aChanges\x20to\x20prompt\x20\x27','\x0aPush\x20','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','yellow','\x20new','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','updated','description','projectName','cloneProject','\x20\x20Integration\x20\x22','cwd','agent.yml','\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)','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','output','counts'];a4_0xbec1=function(){return _0xa47598;};return a4_0xbec1();}
|
|
1
|
+
const a4_0xbf99dc=a4_0x1b51;(function(_0x4ad687,_0x25bb16){const _0x1037bf=a4_0x1b51,_0x524355=_0x4ad687();while(!![]){try{const _0x2c43fc=-parseInt(_0x1037bf(0x225))/0x1*(parseInt(_0x1037bf(0x240))/0x2)+parseInt(_0x1037bf(0x1ba))/0x3*(parseInt(_0x1037bf(0x23f))/0x4)+-parseInt(_0x1037bf(0x207))/0x5+parseInt(_0x1037bf(0x203))/0x6*(-parseInt(_0x1037bf(0x22c))/0x7)+parseInt(_0x1037bf(0x24b))/0x8*(-parseInt(_0x1037bf(0x239))/0x9)+-parseInt(_0x1037bf(0x206))/0xa+-parseInt(_0x1037bf(0x228))/0xb*(-parseInt(_0x1037bf(0x1de))/0xc);if(_0x2c43fc===_0x25bb16)break;else _0x524355['push'](_0x524355['shift']());}catch(_0x4e1c60){_0x524355['push'](_0x524355['shift']());}}}(a4_0x1139,0x67bce));function a4_0x1139(){const _0x9cb418=['\x20total','1560152QVXYQT','1440MazVdU','no_local_folder','Output:\x20','agent:clone','\x20unchanged','source','counts','cyan','Failed\x20to\x20push\x20agent:\x20','Pulling\x20agent\x20\x22','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','6232ISSAvS','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','textKnowledgeBases','Status:\x20','error','no_context','dirname','projectDir','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x22...','outputDir','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','outputPath','\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','\x0aPush\x20','llm_project','Chat:\x20','No\x20tdx.json\x20found\x20in\x20','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','newProjectId','output','\x20\x20Experimental\x20Artifacts:\x20','Cancelled','agentId','parse','\x20\x20Knowledge\x20Base\x20\x22','Analyzing\x20changes\x20to\x20push...','new','Project\x20cloned\x20with\x20errors','updated','Project:\x20','Using\x20local\x20project:\x20','\x20\x20tdx\x20agent\x20clone\x20agents/','\x20successfully','\x20resources?','unchanged','isNew','\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','6pLBjJK','\x20created','yes','errors','projectId','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','Using\x20project:\x20','name','\x0aPull\x20summary\x20for\x20\x27','Agent:\x20','\x22\x20to\x20new\x20project\x20\x22','\x20\x20Agent\x20\x22','Writing\x20files...','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','total','Using\x20project\x20from\x20','MISSING_ARGUMENT','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','session','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x0aError:','Output\x20path:\x20','\x20\x20Knowledge\x20Bases:\x20','Would\x20push\x20agent:\x20','Source:\x20','projectName','experimentalArtifacts','execute','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','hasChanges','\x0aChanges\x20to\x20integration\x20\x27','agent:push','Agent\x20','found','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','dim','12TKmTdB','cwd','agentName','knowledgeBases','experimentalKnowledgeBases','context','dryRun','Using\x20context\x20project:\x20','\x20new','force','\x20\x20Source:\x20','Using\x20current\x20project:\x20','cwd-config','<new-name>','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\x22:\x20','\x22\x20to\x20a\x20different\x20profile','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','Errors:','\x20\x20Integrations:\x20','\x0a✔\x20Pushed\x20','yellow','\x20\x20Text\x20Knowledge\x20Bases:\x20','red','Project\x20cloned\x20successfully','\x0a✔\x20Pulled\x20','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','\x20changed','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','diff','INVALID_ARGUMENT','site','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','Agent\x20pulled\x20successfully','green','agent.yml','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','1426752qSJJYb','agent:pull','Cannot\x20clone\x20from\x20context\x20project\x20\x22','3864640NHZgXl','1126810LfIlVF','\x20errors','llmProject','prompts','Analyzing\x20project\x20\x22','\x0aPush\x20summary\x20for\x20\x27','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','Cloning\x20\x22','\x20\x20Prompts:\x20','New\x20project\x20ID:\x20','repeat','newProjectName','action','\x20--profile\x20','\x20files\x20to\x20','cloneProject','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','integrations','\x20\x20Agents:\x20','\x20|\x20','✔\x20Context\x20set:\x20','\x20\x20Text\x20Knowledge\x20Base\x20\x22','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','tdx.json','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)','Pushing\x20to\x20project...','llm','\x0aProject\x20pushed\x20with\x20errors','Summary:','10DUXSkQ','join','log','13815131SHYkMh','pullProject','\x22\x20from\x20project\x20\x22','sourceProjectName','14onCFBH','message','New\x20project:\x20','gray','push','agents','Pushing\x20agent\x20from\x20\x22','pushProject','\x27\x20to\x20create\x20the\x20folder\x20structure.','Would\x20pull\x20agent:\x20','utf-8','created','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','5967OSgvbO','-\x20nothing\x20pushed','\x20\x20Prompt\x20\x22','Clone\x20\x22','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27'];a4_0x1139=function(){return _0x9cb418;};return a4_0x1139();}import a4_0x25a774 from'chalk';import a4_0x5479b5 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(_0x33fca6){const _0x58e461=a4_0x1b51,_0x4651c9=[];if(_0x33fca6['total']!==undefined)_0x4651c9[_0x58e461(0x230)](_0x33fca6[_0x58e461(0x1c8)]+_0x58e461(0x23e));if(_0x33fca6['new']!==undefined&&_0x33fca6['new']>0x0)_0x4651c9[_0x58e461(0x230)](a4_0x25a774[_0x58e461(0x200)](_0x33fca6[_0x58e461(0x1af)]+'\x20new'));if(_0x33fca6[_0x58e461(0x237)]!==undefined&&_0x33fca6[_0x58e461(0x237)]>0x0)_0x4651c9[_0x58e461(0x230)](a4_0x25a774[_0x58e461(0x200)](_0x33fca6[_0x58e461(0x237)]+_0x58e461(0x1bb)));if(_0x33fca6['updated']!==undefined&&_0x33fca6[_0x58e461(0x1b1)]>0x0)_0x4651c9[_0x58e461(0x230)](a4_0x25a774[_0x58e461(0x1f3)](_0x33fca6['updated']+'\x20updated'));if(_0x33fca6['unchanged']!==undefined&&_0x33fca6[_0x58e461(0x1b7)]>0x0)_0x4651c9[_0x58e461(0x230)](a4_0x25a774[_0x58e461(0x22f)](_0x33fca6[_0x58e461(0x1b7)]+_0x58e461(0x244)));if(_0x33fca6[_0x58e461(0x1bd)]!==undefined&&_0x33fca6[_0x58e461(0x1bd)]>0x0)_0x4651c9[_0x58e461(0x230)](a4_0x25a774[_0x58e461(0x1f5)](_0x33fca6[_0x58e461(0x1bd)]+_0x58e461(0x208)));return _0x4651c9[_0x58e461(0x226)](',\x20');}function displayDiffs(_0x5030e1,_0x4b21c6,_0x1a4fd4,_0x4903d4,_0x2f7718,_0xb2e212,_0x2d5a12){const _0x1a9534=a4_0x1b51;for(const _0x10c108 of _0x5030e1){if(_0x10c108[_0x1a9534(0x1fb)]){const _0x29c673=_0x10c108[_0x1a9534(0x1e0)]||_0x10c108[_0x1a9534(0x1c1)];console[_0x1a9534(0x227)]('\x0aChanges\x20to\x20agent\x20\x27'+_0x29c673+'\x27:'),console[_0x1a9534(0x227)]('─'[_0x1a9534(0x211)](0x3c)),console[_0x1a9534(0x227)](_0x10c108[_0x1a9534(0x1fb)]),console[_0x1a9534(0x227)]('─'['repeat'](0x3c));}}for(const _0x5593ca of _0x4b21c6){_0x5593ca['diff']&&(console['log'](_0x1a9534(0x24a)+_0x5593ca[_0x1a9534(0x1c1)]+'\x27:'),console[_0x1a9534(0x227)]('─'[_0x1a9534(0x211)](0x3c)),console[_0x1a9534(0x227)](_0x5593ca['diff']),console[_0x1a9534(0x227)]('─'[_0x1a9534(0x211)](0x3c)));}for(const _0xd369f9 of _0x1a4fd4){_0xd369f9['diff']&&(console['log']('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0xd369f9['name']+'\x27:'),console['log']('─'['repeat'](0x3c)),console['log'](_0xd369f9[_0x1a9534(0x1fb)]),console[_0x1a9534(0x227)]('─'['repeat'](0x3c)));}for(const _0x515493 of _0x4903d4){_0x515493['diff']&&(console[_0x1a9534(0x227)]('\x0aChanges\x20to\x20prompt\x20\x27'+_0x515493[_0x1a9534(0x1c1)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x1a9534(0x227)](_0x515493[_0x1a9534(0x1fb)]),console[_0x1a9534(0x227)]('─'[_0x1a9534(0x211)](0x3c)));}for(const _0x2fd9ae of _0x2f7718){_0x2fd9ae['diff']&&(console[_0x1a9534(0x227)](_0x1a9534(0x1d8)+_0x2fd9ae['name']+'\x27:'),console['log']('─'[_0x1a9534(0x211)](0x3c)),console[_0x1a9534(0x227)](_0x2fd9ae['diff']),console[_0x1a9534(0x227)]('─'['repeat'](0x3c)));}for(const _0x950d05 of _0xb2e212){_0x950d05[_0x1a9534(0x1fb)]&&(console[_0x1a9534(0x227)](_0x1a9534(0x217)+_0x950d05[_0x1a9534(0x1c1)]+'\x27:'),console[_0x1a9534(0x227)]('─'[_0x1a9534(0x211)](0x3c)),console[_0x1a9534(0x227)](_0x950d05[_0x1a9534(0x1fb)]),console[_0x1a9534(0x227)]('─'[_0x1a9534(0x211)](0x3c)));}for(const _0x1b8232 of _0x2d5a12){_0x1b8232[_0x1a9534(0x1fb)]&&(console[_0x1a9534(0x227)](_0x1a9534(0x23d)+_0x1b8232[_0x1a9534(0x1c1)]+'\x27:'),console[_0x1a9534(0x227)]('─'[_0x1a9534(0x211)](0x3c)),console[_0x1a9534(0x227)](_0x1b8232['diff']),console['log']('─'[_0x1a9534(0x211)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']=a4_0xbf99dc(0x204);['description']=a4_0xbf99dc(0x253);async['execute'](_0x1c052d){const _0x5e6e26=a4_0xbf99dc,{options:_0x3e9624,args:_0x30cb45,tdx:_0x4cfde3}=_0x1c052d,_0x16def1=_0x30cb45[0x0],_0x339739=_0x30cb45[0x1],_0x32f9e4=_0x3e9624[_0x5e6e26(0x25f)],_0x3af933=_0x3e9624[_0x5e6e26(0x1e4)],_0x40c9e8=_0x3e9624[_0x5e6e26(0x1e7)],_0x1a11c0=_0x3e9624['yes'],_0x268541=_0x3e9624[_0x5e6e26(0x209)],_0xaa84cc=_0x3e9624['agent'];let _0x5deb76;if(_0x16def1){const _0x3f90bc=a4_0x5479b5[_0x5e6e26(0x226)](_0x16def1,_0x5e6e26(0x21f));if(existsSync(_0x3f90bc))try{const _0x36d2cc=JSON[_0x5e6e26(0x1ac)](readFileSync(_0x3f90bc,_0x5e6e26(0x236)));_0x36d2cc['llm_project']&&(_0x5deb76={'llm_project':_0x36d2cc[_0x5e6e26(0x25a)]});}catch{}}const _0x462767=findAgentConfigPath(process[_0x5e6e26(0x1df)]());let _0x2f21f7;if(_0x462767)try{const _0x582c2b=JSON[_0x5e6e26(0x1ac)](readFileSync(_0x462767,_0x5e6e26(0x236)));_0x582c2b['llm_project']&&(_0x2f21f7={'llm_project':_0x582c2b[_0x5e6e26(0x25a)]});}catch{}const _0x32a2fe=resolveAgentPullArgs({'arg':_0x16def1,'agentNameArg':_0x339739,'agentFlag':_0xaa84cc,'contextProject':_0x268541,'argDirConfig':_0x5deb76,'cwdConfigPath':_0x462767||undefined,'cwdConfig':_0x2f21f7}),{projectNameOrId:_0x1924b6,targetAgentName:_0x5e9f08,existingOutputDir:_0x3d8d53,source:_0x34b4d0}=_0x32a2fe;if(_0x34b4d0==='arg-dir')console[_0x5e6e26(0x227)](a4_0x25a774[_0x5e6e26(0x1dd)](_0x5e6e26(0x1c9)+a4_0x5479b5[_0x5e6e26(0x226)](_0x16def1,'tdx.json')+':\x20'+_0x1924b6));else{if(_0x34b4d0===_0x5e6e26(0x1ea))console[_0x5e6e26(0x227)](a4_0x25a774['dim'](_0x5e6e26(0x1c0)+_0x1924b6));else _0x34b4d0===_0x5e6e26(0x1e3)&&console[_0x5e6e26(0x227)](a4_0x25a774['dim']('Using\x20project\x20from\x20context:\x20'+_0x1924b6));}if(!_0x1924b6)return _0xaa84cc?(console[_0x5e6e26(0x227)](a4_0x25a774[_0x5e6e26(0x1f3)](_0x5e6e26(0x1ef))),console['log'](_0x5e6e26(0x202)),console[_0x5e6e26(0x227)](_0x5e6e26(0x1ec))):(console[_0x5e6e26(0x227)](a4_0x25a774['yellow'](_0x5e6e26(0x1cb))),console[_0x5e6e26(0x227)](_0x5e6e26(0x220)),console[_0x5e6e26(0x227)]('\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[_0x5e6e26(0x227)]('\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[_0x5e6e26(0x227)](_0x5e6e26(0x1b9)),console[_0x5e6e26(0x227)](_0x5e6e26(0x258))),0x1;if(_0x5e9f08){const {data:_0x3bf000}=await withSpinner(_0x5e6e26(0x249)+_0x5e9f08+_0x5e6e26(0x22a)+_0x1924b6+_0x5e6e26(0x254),()=>_0x4cfde3['llm']['pullAgent'](_0x1924b6,_0x5e9f08,_0x32f9e4,{'dryRun':_0x3af933,'force':_0x40c9e8}));if(_0x3af933)return console['log'](a4_0x25a774[_0x5e6e26(0x1f3)]('Dry\x20run\x20-\x20no\x20files\x20written')),console[_0x5e6e26(0x227)](_0x5e6e26(0x235)+_0x3bf000[_0x5e6e26(0x1e0)]),console[_0x5e6e26(0x227)](_0x5e6e26(0x1cf)+_0x3bf000['outputPath']),_0x3bf000[_0x5e6e26(0x1fb)]&&(console[_0x5e6e26(0x227)]('\x0aChanges:'),console[_0x5e6e26(0x227)]('─'[_0x5e6e26(0x211)](0x3c)),console[_0x5e6e26(0x227)](_0x3bf000[_0x5e6e26(0x1fb)]),console[_0x5e6e26(0x227)]('─'[_0x5e6e26(0x211)](0x3c))),0x0;return console[_0x5e6e26(0x227)](a4_0x25a774[_0x5e6e26(0x200)](_0x5e6e26(0x1ff))),console[_0x5e6e26(0x227)](_0x5e6e26(0x1c3)+_0x3bf000[_0x5e6e26(0x1e0)]),console[_0x5e6e26(0x227)](_0x5e6e26(0x242)+_0x3bf000[_0x5e6e26(0x257)]),console[_0x5e6e26(0x227)](_0x5e6e26(0x24e)+(_0x3bf000[_0x5e6e26(0x1b8)]?a4_0x25a774['green']('new'):_0x3bf000[_0x5e6e26(0x1d7)]?a4_0x25a774['yellow'](_0x5e6e26(0x1b1)):a4_0x25a774[_0x5e6e26(0x22f)](_0x5e6e26(0x1b7)))),0x0;}const _0x3c54dc=_0x3d8d53||_0x32f9e4,{data:_0x38469d}=await withSpinner(_0x5e6e26(0x20b)+_0x1924b6+_0x5e6e26(0x254),()=>_0x4cfde3[_0x5e6e26(0x222)][_0x5e6e26(0x229)](_0x1924b6,_0x3c54dc,{'dryRun':!![]})),_0xd51447=_0x38469d['counts'][_0x5e6e26(0x231)]['new']+_0x38469d[_0x5e6e26(0x246)][_0x5e6e26(0x1e1)]['new']+_0x38469d[_0x5e6e26(0x246)][_0x5e6e26(0x24d)][_0x5e6e26(0x1af)]+_0x38469d[_0x5e6e26(0x246)]['prompts']['new']+_0x38469d[_0x5e6e26(0x246)][_0x5e6e26(0x218)][_0x5e6e26(0x1af)]+_0x38469d['counts']['experimentalKnowledgeBases'][_0x5e6e26(0x1af)]+_0x38469d[_0x5e6e26(0x246)][_0x5e6e26(0x1d4)][_0x5e6e26(0x1af)],_0x4fd1e8=_0x38469d[_0x5e6e26(0x246)][_0x5e6e26(0x231)][_0x5e6e26(0x1b1)]+_0x38469d['counts']['knowledgeBases'][_0x5e6e26(0x1b1)]+_0x38469d[_0x5e6e26(0x246)][_0x5e6e26(0x24d)][_0x5e6e26(0x1b1)]+_0x38469d[_0x5e6e26(0x246)][_0x5e6e26(0x20a)][_0x5e6e26(0x1b1)]+_0x38469d[_0x5e6e26(0x246)][_0x5e6e26(0x218)][_0x5e6e26(0x1b1)]+_0x38469d['counts'][_0x5e6e26(0x1e2)][_0x5e6e26(0x1b1)]+_0x38469d[_0x5e6e26(0x246)][_0x5e6e26(0x1d4)][_0x5e6e26(0x1b1)],_0x576566=_0x38469d['counts'][_0x5e6e26(0x231)][_0x5e6e26(0x1b7)]+_0x38469d[_0x5e6e26(0x246)][_0x5e6e26(0x1e1)][_0x5e6e26(0x1b7)]+_0x38469d[_0x5e6e26(0x246)][_0x5e6e26(0x24d)][_0x5e6e26(0x1b7)]+_0x38469d[_0x5e6e26(0x246)]['prompts']['unchanged']+_0x38469d[_0x5e6e26(0x246)][_0x5e6e26(0x218)][_0x5e6e26(0x1b7)]+_0x38469d['counts'][_0x5e6e26(0x1e2)]['unchanged']+_0x38469d[_0x5e6e26(0x246)]['experimentalArtifacts'][_0x5e6e26(0x1b7)];console[_0x5e6e26(0x227)](_0x5e6e26(0x1c2)+_0x38469d[_0x5e6e26(0x1d3)]+'\x27:'),console['log']('\x20\x20'+a4_0x25a774[_0x5e6e26(0x200)]('+\x20'+_0xd51447+'\x20new')+_0x5e6e26(0x21a)+a4_0x25a774['yellow']('~\x20'+_0x4fd1e8+_0x5e6e26(0x1f9))+_0x5e6e26(0x21a)+a4_0x25a774[_0x5e6e26(0x1dd)]('=\x20'+_0x576566+_0x5e6e26(0x244))),console[_0x5e6e26(0x227)](_0x5e6e26(0x219)+formatCountSummary(_0x38469d[_0x5e6e26(0x246)]['agents'])),console[_0x5e6e26(0x227)](_0x5e6e26(0x1d0)+formatCountSummary(_0x38469d[_0x5e6e26(0x246)]['knowledgeBases'])),console[_0x5e6e26(0x227)](_0x5e6e26(0x1f4)+formatCountSummary(_0x38469d[_0x5e6e26(0x246)]['textKnowledgeBases'])),console['log']('\x20\x20Prompts:\x20'+formatCountSummary(_0x38469d[_0x5e6e26(0x246)][_0x5e6e26(0x20a)])),console[_0x5e6e26(0x227)](_0x5e6e26(0x1f1)+formatCountSummary(_0x38469d[_0x5e6e26(0x246)]['integrations']));const _0x2b29d6=_0x38469d['counts'][_0x5e6e26(0x1e2)][_0x5e6e26(0x1c8)]>0x0||_0x38469d[_0x5e6e26(0x246)]['experimentalArtifacts'][_0x5e6e26(0x1c8)]>0x0;_0x2b29d6&&(console['log'](_0x5e6e26(0x256)+formatCountSummary(_0x38469d['counts'][_0x5e6e26(0x1e2)])),console[_0x5e6e26(0x227)](_0x5e6e26(0x260)+formatCountSummary(_0x38469d[_0x5e6e26(0x246)][_0x5e6e26(0x1d4)])));console[_0x5e6e26(0x227)]('\x20\x20Target:\x20'+a4_0x25a774[_0x5e6e26(0x247)](_0x38469d[_0x5e6e26(0x255)])),displayDiffs(_0x38469d[_0x5e6e26(0x231)],_0x38469d[_0x5e6e26(0x1e1)],_0x38469d[_0x5e6e26(0x24d)],_0x38469d[_0x5e6e26(0x20a)],_0x38469d[_0x5e6e26(0x218)],_0x38469d[_0x5e6e26(0x1e2)],_0x38469d[_0x5e6e26(0x1d4)]);if(_0x3af933)return console[_0x5e6e26(0x227)](a4_0x25a774[_0x5e6e26(0x1f3)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0xd51447===0x0&&_0x4fd1e8===0x0)return console[_0x5e6e26(0x227)](a4_0x25a774[_0x5e6e26(0x200)](_0x5e6e26(0x21e))),saveSessionContext({'llm_project':_0x38469d[_0x5e6e26(0x1d3)]},_0x3e9624[_0x5e6e26(0x1cc)]),console[_0x5e6e26(0x227)](a4_0x25a774[_0x5e6e26(0x200)]('✔\x20Context\x20set:\x20'+a4_0x25a774[_0x5e6e26(0x1dd)](_0x5e6e26(0x25a))+'\x20=\x20'+a4_0x25a774[_0x5e6e26(0x247)](_0x38469d[_0x5e6e26(0x1d3)]))),0x0;if(!_0x1a11c0&&!_0x40c9e8){if(!isInteractive())return console[_0x5e6e26(0x24f)](a4_0x25a774[_0x5e6e26(0x1f5)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x5e6e26(0x24f)](a4_0x25a774['dim'](_0x5e6e26(0x1c7))),0x1;const _0x4a62e2=await confirmKey('\x0aWrite\x20'+(_0xd51447+_0x4fd1e8)+'\x20files?');if(!_0x4a62e2)return console['log'](a4_0x25a774['yellow'](_0x5e6e26(0x261)),'-\x20no\x20files\x20written'),0x1;}const {data:_0x15135c}=await withSpinner(_0x5e6e26(0x1c6),()=>_0x4cfde3['llm'][_0x5e6e26(0x229)](_0x1924b6,_0x3c54dc,{'force':_0x40c9e8}));return console[_0x5e6e26(0x227)](a4_0x25a774[_0x5e6e26(0x200)](_0x5e6e26(0x1f7)+(_0xd51447+_0x4fd1e8)+_0x5e6e26(0x215)+_0x15135c[_0x5e6e26(0x255)])),saveSessionContext({'llm_project':_0x15135c['projectName']},_0x3e9624[_0x5e6e26(0x1cc)]),console[_0x5e6e26(0x227)](a4_0x25a774[_0x5e6e26(0x200)](_0x5e6e26(0x21b)+a4_0x25a774[_0x5e6e26(0x1dd)](_0x5e6e26(0x25a))+'\x20=\x20'+a4_0x25a774['cyan'](_0x15135c['projectName']))),0x0;}}function a4_0x1b51(_0x4ccfe8,_0xe32432){_0x4ccfe8=_0x4ccfe8-0x1ac;const _0x113984=a4_0x1139();let _0x1b51d2=_0x113984[_0x4ccfe8];return _0x1b51d2;}export class AgentCloneCommand extends BaseCommand{[a4_0xbf99dc(0x1c1)]=a4_0xbf99dc(0x243);['description']=a4_0xbf99dc(0x24c);async['execute'](_0x35eedd){const _0x45da3c=a4_0xbf99dc,{options:_0x4dd020,args:_0x4825a3,tdx:_0x45449d}=_0x35eedd,_0x2d342d=_0x4825a3[0x0],_0x48e536=_0x4dd020[_0x45da3c(0x1c1)],_0x565e5c=_0x4dd020[_0x45da3c(0x1e4)],_0x230ebd=_0x4dd020[_0x45da3c(0x1bc)],_0x1ab8fd=_0x4dd020[_0x45da3c(0x1fd)],_0x449374=_0x4dd020[_0x45da3c(0x209)];let _0x386659;const _0x573834=findAgentConfigPath(process[_0x45da3c(0x1df)]());if(_0x2d342d){const _0xdf25c3=a4_0x5479b5[_0x45da3c(0x226)](_0x2d342d,_0x45da3c(0x21f));existsSync(_0xdf25c3)?(_0x386659=_0x2d342d,console['log'](a4_0x25a774[_0x45da3c(0x1dd)](_0x45da3c(0x1b3)+_0x2d342d))):_0x386659=_0x2d342d;}else{if(_0x573834)_0x386659=a4_0x5479b5['dirname'](_0x573834),console[_0x45da3c(0x227)](a4_0x25a774[_0x45da3c(0x1dd)](_0x45da3c(0x1e9)+_0x386659));else{if(_0x449374){const _0x4170c8=sanitizeForFilesystem(_0x449374);let _0x5b0bc8=_0x4170c8,_0x2fd08d=a4_0x5479b5['join'](process[_0x45da3c(0x1df)](),_0x45da3c(0x231),_0x4170c8,_0x45da3c(0x21f));if(!existsSync(_0x2fd08d)){const _0x444216=normalizeName(_0x449374),_0x2c3974=a4_0x5479b5['join'](process[_0x45da3c(0x1df)](),_0x45da3c(0x231),_0x444216,_0x45da3c(0x21f));existsSync(_0x2c3974)&&(_0x5b0bc8=_0x444216,_0x2fd08d=_0x2c3974);}if(existsSync(_0x2fd08d))_0x386659=a4_0x5479b5[_0x45da3c(0x251)](_0x2fd08d),console[_0x45da3c(0x227)](a4_0x25a774[_0x45da3c(0x1dd)](_0x45da3c(0x1b3)+_0x386659));else{const _0x51a24c=_0x4dd020['profile'];if(_0x51a24c)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x45da3c(0x205)+_0x449374+_0x45da3c(0x1ee),undefined,{'helpText':_0x45da3c(0x1bf)+_0x45da3c(0x1cd)+('\x20\x20tdx\x20agent\x20pull\x20'+_0x449374+'\x0a')+(_0x45da3c(0x1b4)+_0x5b0bc8+'\x20--name\x20'+(_0x48e536||_0x45da3c(0x1eb))+_0x45da3c(0x214)+_0x51a24c)});_0x386659=_0x449374,console[_0x45da3c(0x227)](a4_0x25a774[_0x45da3c(0x1dd)](_0x45da3c(0x1e5)+_0x449374));}}}}if(!_0x386659)return console[_0x45da3c(0x227)](a4_0x25a774[_0x45da3c(0x1f3)](_0x45da3c(0x1fe))),console['log'](_0x45da3c(0x1d6)),console[_0x45da3c(0x227)](_0x45da3c(0x20d)),console[_0x45da3c(0x227)]('\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[_0x45da3c(0x227)](_0x45da3c(0x1dc)),0x1;if(!_0x48e536)throw new SDKError(ErrorCode[_0x45da3c(0x1ca)],'New\x20project\x20name\x20is\x20required',undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0x230ebd&&!_0x565e5c){if(!isInteractive())return console['error'](a4_0x25a774[_0x45da3c(0x1f5)](_0x45da3c(0x1ce)),_0x45da3c(0x21d)),console[_0x45da3c(0x24f)](a4_0x25a774[_0x45da3c(0x1dd)](_0x45da3c(0x1c7))),0x1;const _0x22afa9=await confirmKey(_0x45da3c(0x23c)+_0x386659+_0x45da3c(0x1c4)+_0x48e536+'\x22?');if(!_0x22afa9)return console[_0x45da3c(0x227)](a4_0x25a774['yellow']('Cancelled')),0x1;}const {data:_0x1372d9}=await withSpinner(_0x45da3c(0x20e)+_0x386659+'\x22\x20to\x20\x22'+_0x48e536+'\x22...',()=>_0x45449d[_0x45da3c(0x222)][_0x45da3c(0x216)](_0x386659,_0x48e536,{'dryRun':_0x565e5c}));if(_0x565e5c){console[_0x45da3c(0x227)](a4_0x25a774[_0x45da3c(0x1f3)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console['log'](_0x45da3c(0x1d2)+_0x1372d9[_0x45da3c(0x22b)]),console['log'](_0x45da3c(0x22e)+_0x48e536),console[_0x45da3c(0x227)]('Would\x20clone:'),console['log']('\x20\x20Agents:\x20'+_0x1372d9[_0x45da3c(0x246)]['agents'][_0x45da3c(0x237)]),console[_0x45da3c(0x227)](_0x45da3c(0x1d0)+_0x1372d9[_0x45da3c(0x246)][_0x45da3c(0x1e1)][_0x45da3c(0x237)]),console[_0x45da3c(0x227)](_0x45da3c(0x20f)+_0x1372d9[_0x45da3c(0x246)][_0x45da3c(0x20a)]['created']);const _0x2f3a83=_0x1372d9[_0x45da3c(0x246)][_0x45da3c(0x1e2)]['created']>0x0||_0x1372d9['counts']['experimentalArtifacts'][_0x45da3c(0x237)]>0x0;return _0x2f3a83&&(console['log'](_0x45da3c(0x256)+_0x1372d9[_0x45da3c(0x246)][_0x45da3c(0x1e2)][_0x45da3c(0x237)]),console[_0x45da3c(0x227)]('\x20\x20Experimental\x20Artifacts:\x20'+_0x1372d9[_0x45da3c(0x246)]['experimentalArtifacts'][_0x45da3c(0x237)])),0x0;}const _0x5a39c3=_0x1372d9[_0x45da3c(0x246)][_0x45da3c(0x231)][_0x45da3c(0x1bd)]>0x0||_0x1372d9[_0x45da3c(0x246)][_0x45da3c(0x1e1)]['errors']>0x0||_0x1372d9[_0x45da3c(0x246)][_0x45da3c(0x20a)]['errors']>0x0||_0x1372d9['counts'][_0x45da3c(0x1e2)][_0x45da3c(0x1bd)]>0x0||_0x1372d9[_0x45da3c(0x246)][_0x45da3c(0x1d4)]['errors']>0x0;_0x5a39c3?console[_0x45da3c(0x227)](a4_0x25a774[_0x45da3c(0x1f3)](_0x45da3c(0x1b0))):console[_0x45da3c(0x227)](a4_0x25a774['green'](_0x45da3c(0x1f6)));console[_0x45da3c(0x227)](_0x45da3c(0x1d2)+_0x1372d9[_0x45da3c(0x22b)]),console[_0x45da3c(0x227)](_0x45da3c(0x22e)+_0x1372d9[_0x45da3c(0x212)]),console['log'](_0x45da3c(0x210)+_0x1372d9[_0x45da3c(0x25e)]),console['log'](),console[_0x45da3c(0x227)](_0x45da3c(0x224)),console[_0x45da3c(0x227)](_0x45da3c(0x219)+formatCountSummary(_0x1372d9['counts']['agents'])),console[_0x45da3c(0x227)](_0x45da3c(0x1d0)+formatCountSummary(_0x1372d9['counts'][_0x45da3c(0x1e1)])),console[_0x45da3c(0x227)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x1372d9[_0x45da3c(0x246)]['prompts'])),console[_0x45da3c(0x227)](_0x45da3c(0x1f1)+formatCountSummary(_0x1372d9[_0x45da3c(0x246)]['integrations']));const _0x2a576d=_0x1372d9[_0x45da3c(0x246)][_0x45da3c(0x1e2)][_0x45da3c(0x237)]>0x0||_0x1372d9[_0x45da3c(0x246)][_0x45da3c(0x1e2)]['updated']>0x0||_0x1372d9[_0x45da3c(0x246)]['experimentalKnowledgeBases'][_0x45da3c(0x1b7)]>0x0||_0x1372d9[_0x45da3c(0x246)][_0x45da3c(0x1d4)][_0x45da3c(0x237)]>0x0||_0x1372d9[_0x45da3c(0x246)][_0x45da3c(0x1d4)]['updated']>0x0||_0x1372d9[_0x45da3c(0x246)][_0x45da3c(0x1d4)][_0x45da3c(0x1b7)]>0x0;_0x2a576d&&(console[_0x45da3c(0x227)](_0x45da3c(0x256)+formatCountSummary(_0x1372d9[_0x45da3c(0x246)][_0x45da3c(0x1e2)])),console[_0x45da3c(0x227)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x1372d9[_0x45da3c(0x246)][_0x45da3c(0x1d4)])));if(_0x5a39c3){console[_0x45da3c(0x227)](),console[_0x45da3c(0x227)](a4_0x25a774[_0x45da3c(0x1f5)](_0x45da3c(0x1f0)));for(const _0x5666da of _0x1372d9['agents']){_0x5666da['action']===_0x45da3c(0x24f)&&console[_0x45da3c(0x227)](a4_0x25a774['red']('\x20\x20Agent\x20\x22'+_0x5666da[_0x45da3c(0x1e0)]+_0x45da3c(0x1ed)+_0x5666da[_0x45da3c(0x24f)]));}for(const _0x3b1054 of _0x1372d9['knowledgeBases']){_0x3b1054[_0x45da3c(0x213)]===_0x45da3c(0x24f)&&console[_0x45da3c(0x227)](a4_0x25a774[_0x45da3c(0x1f5)](_0x45da3c(0x1ad)+_0x3b1054[_0x45da3c(0x1c1)]+_0x45da3c(0x1ed)+_0x3b1054[_0x45da3c(0x24f)]));}for(const _0x492fa6 of _0x1372d9[_0x45da3c(0x20a)]){_0x492fa6[_0x45da3c(0x213)]===_0x45da3c(0x24f)&&console[_0x45da3c(0x227)](a4_0x25a774['red'](_0x45da3c(0x23b)+_0x492fa6[_0x45da3c(0x1c1)]+_0x45da3c(0x1ed)+_0x492fa6[_0x45da3c(0x24f)]));}for(const _0x4d7479 of _0x1372d9['integrations']){_0x4d7479[_0x45da3c(0x213)]===_0x45da3c(0x24f)&&console['log'](a4_0x25a774[_0x45da3c(0x1f5)]('\x20\x20Integration\x20\x22'+_0x4d7479['name']+'\x22:\x20'+_0x4d7479[_0x45da3c(0x24f)]));}for(const _0x11ab0d of _0x1372d9[_0x45da3c(0x1e2)]){_0x11ab0d[_0x45da3c(0x213)]===_0x45da3c(0x24f)&&console['log'](a4_0x25a774[_0x45da3c(0x1f5)](_0x45da3c(0x25d)+_0x11ab0d[_0x45da3c(0x1c1)]+_0x45da3c(0x1ed)+_0x11ab0d[_0x45da3c(0x24f)]));}for(const _0x3655a3 of _0x1372d9[_0x45da3c(0x1d4)]){_0x3655a3['action']===_0x45da3c(0x24f)&&console[_0x45da3c(0x227)](a4_0x25a774['red']('\x20\x20Experimental\x20Artifact\x20\x22'+_0x3655a3[_0x45da3c(0x1c1)]+_0x45da3c(0x1ed)+_0x3655a3[_0x45da3c(0x24f)]));}return 0x1;}console['log']();const _0x7a6ec9=getLLMProjectUrl(_0x1ab8fd,_0x1372d9[_0x45da3c(0x25e)]);return console[_0x45da3c(0x227)](_0x45da3c(0x1b2)+a4_0x25a774['cyan'](_0x7a6ec9)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0xbf99dc(0x1c1)]=a4_0xbf99dc(0x1d9);['description']='Push\x20local\x20agent\x20files\x20to\x20LLM\x20project';async[a4_0xbf99dc(0x1d5)](_0x4ed291){const _0x1f5c60=a4_0xbf99dc,{options:_0x2bb5da,args:_0x25953e,tdx:_0x2e5a7f}=_0x4ed291;let _0xaf816b=_0x25953e[0x0]||process[_0x1f5c60(0x1df)]();const _0x599029=_0x2bb5da[_0x1f5c60(0x1e4)],_0x3352c2=_0x2bb5da[_0x1f5c60(0x1e7)],_0x50860b=_0x2bb5da['yes'],_0x1030f3=_0x2bb5da[_0x1f5c60(0x1fd)],_0x244d85=a4_0x5479b5[_0x1f5c60(0x226)](_0xaf816b,_0x1f5c60(0x201)),_0x4a049e=existsSync(_0x244d85);if(_0x4a049e){const {data:_0x4ef049}=await withSpinner(_0x1f5c60(0x232)+_0xaf816b+_0x1f5c60(0x254),()=>_0x2e5a7f[_0x1f5c60(0x222)]['pushAgent'](_0xaf816b,{'dryRun':_0x599029,'force':_0x3352c2}));if(_0x599029)return console['log'](a4_0x25a774[_0x1f5c60(0x1f3)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x1f5c60(0x227)](_0x1f5c60(0x1d1)+_0x4ef049[_0x1f5c60(0x1e0)]),0x0;if(_0x4ef049[_0x1f5c60(0x213)]===_0x1f5c60(0x24f))return console[_0x1f5c60(0x227)](a4_0x25a774[_0x1f5c60(0x1f5)](_0x1f5c60(0x248)+_0x4ef049['error'])),0x1;console['log'](a4_0x25a774[_0x1f5c60(0x200)](_0x1f5c60(0x1da)+_0x4ef049[_0x1f5c60(0x213)]+_0x1f5c60(0x1b5))),console['log']('Agent:\x20'+_0x4ef049['agentName']);if(_0x4ef049[_0x1f5c60(0x262)]&&_0x4ef049['projectId']){const _0x897e41=getLLMAgentChatUrl(_0x1030f3,_0x4ef049[_0x1f5c60(0x1be)],_0x4ef049[_0x1f5c60(0x262)]);console['log'](_0x1f5c60(0x25b)+a4_0x25a774[_0x1f5c60(0x247)](_0x897e41));}return 0x0;}const _0x42a4cc=_0x2bb5da[_0x1f5c60(0x209)],_0x1d96f4=resolveProjectFromContext(_0xaf816b,_0x42a4cc);if(_0x1d96f4[_0x1f5c60(0x1db)])_0xaf816b=_0x1d96f4[_0x1f5c60(0x252)],_0x1d96f4[_0x1f5c60(0x245)]==='context'&&console[_0x1f5c60(0x227)](a4_0x25a774['dim'](_0x1f5c60(0x1c0)+_0xaf816b));else{let _0x3072ce=_0x1f5c60(0x1fa);_0x1d96f4['reason']===_0x1f5c60(0x241)&&(_0x3072ce=_0x1d96f4[_0x1f5c60(0x22d)]+_0x1f5c60(0x1f8)+_0x1d96f4[_0x1f5c60(0x209)]+_0x1f5c60(0x234));throw new SDKError(ErrorCode[_0x1f5c60(0x1fc)],_0x1d96f4['reason']===_0x1f5c60(0x250)?_0x1d96f4[_0x1f5c60(0x22d)]:_0x1f5c60(0x25c)+_0xaf816b,undefined,{'helpText':_0x3072ce});}const {data:_0x51b00e}=await withSpinner(_0x1f5c60(0x1ae),()=>_0x2e5a7f['llm']['pushProject'](_0xaf816b,{'dryRun':!![]})),_0x4c531d=_0x51b00e[_0x1f5c60(0x246)][_0x1f5c60(0x231)][_0x1f5c60(0x1bd)]>0x0;if(_0x4c531d){console[_0x1f5c60(0x227)](a4_0x25a774[_0x1f5c60(0x1f5)]('\x0aErrors\x20found:'));for(const _0x1626f8 of _0x51b00e[_0x1f5c60(0x231)]){_0x1626f8['action']==='error'&&console[_0x1f5c60(0x227)](a4_0x25a774[_0x1f5c60(0x1f5)]('\x20\x20Agent\x20\x22'+_0x1626f8[_0x1f5c60(0x1e0)]+_0x1f5c60(0x1ed)+_0x1626f8[_0x1f5c60(0x24f)]));}return 0x1;}const _0x2d37d4=_0x51b00e['counts'][_0x1f5c60(0x231)][_0x1f5c60(0x237)]+_0x51b00e[_0x1f5c60(0x246)]['knowledgeBases'][_0x1f5c60(0x237)]+_0x51b00e['counts'][_0x1f5c60(0x24d)][_0x1f5c60(0x237)]+_0x51b00e[_0x1f5c60(0x246)][_0x1f5c60(0x20a)]['created']+_0x51b00e[_0x1f5c60(0x246)][_0x1f5c60(0x218)][_0x1f5c60(0x237)]+_0x51b00e['counts']['experimentalKnowledgeBases'][_0x1f5c60(0x237)]+_0x51b00e[_0x1f5c60(0x246)]['experimentalArtifacts'][_0x1f5c60(0x237)],_0x172005=_0x51b00e[_0x1f5c60(0x246)]['agents']['updated']+_0x51b00e[_0x1f5c60(0x246)][_0x1f5c60(0x1e1)][_0x1f5c60(0x1b1)]+_0x51b00e[_0x1f5c60(0x246)][_0x1f5c60(0x24d)]['updated']+_0x51b00e[_0x1f5c60(0x246)]['prompts']['updated']+_0x51b00e['counts']['integrations']['updated']+_0x51b00e['counts'][_0x1f5c60(0x1e2)][_0x1f5c60(0x1b1)]+_0x51b00e[_0x1f5c60(0x246)][_0x1f5c60(0x1d4)]['updated'],_0x5ab0a6=_0x51b00e[_0x1f5c60(0x246)]['agents'][_0x1f5c60(0x1b7)]+_0x51b00e[_0x1f5c60(0x246)][_0x1f5c60(0x1e1)][_0x1f5c60(0x1b7)]+_0x51b00e['counts'][_0x1f5c60(0x24d)]['unchanged']+_0x51b00e['counts'][_0x1f5c60(0x20a)][_0x1f5c60(0x1b7)]+_0x51b00e[_0x1f5c60(0x246)][_0x1f5c60(0x218)][_0x1f5c60(0x1b7)]+_0x51b00e['counts']['experimentalKnowledgeBases'][_0x1f5c60(0x1b7)]+_0x51b00e[_0x1f5c60(0x246)][_0x1f5c60(0x1d4)][_0x1f5c60(0x1b7)];console[_0x1f5c60(0x227)](_0x1f5c60(0x20c)+_0x51b00e[_0x1f5c60(0x1d3)]+'\x27:'),console['log']('\x20\x20'+a4_0x25a774[_0x1f5c60(0x200)]('+\x20'+_0x2d37d4+_0x1f5c60(0x1e6))+_0x1f5c60(0x21a)+a4_0x25a774['yellow']('~\x20'+_0x172005+_0x1f5c60(0x1f9))+_0x1f5c60(0x21a)+a4_0x25a774[_0x1f5c60(0x1dd)]('=\x20'+_0x5ab0a6+_0x1f5c60(0x244))),console['log'](_0x1f5c60(0x219)+formatCountSummary(_0x51b00e[_0x1f5c60(0x246)][_0x1f5c60(0x231)])),console[_0x1f5c60(0x227)](_0x1f5c60(0x1d0)+formatCountSummary(_0x51b00e[_0x1f5c60(0x246)][_0x1f5c60(0x1e1)])),console[_0x1f5c60(0x227)](_0x1f5c60(0x1f4)+formatCountSummary(_0x51b00e[_0x1f5c60(0x246)][_0x1f5c60(0x24d)])),console[_0x1f5c60(0x227)](_0x1f5c60(0x20f)+formatCountSummary(_0x51b00e['counts'][_0x1f5c60(0x20a)])),console['log'](_0x1f5c60(0x1f1)+formatCountSummary(_0x51b00e[_0x1f5c60(0x246)]['integrations']));const _0x3dcda4=_0x51b00e['counts'][_0x1f5c60(0x1e2)][_0x1f5c60(0x237)]>0x0||_0x51b00e[_0x1f5c60(0x246)][_0x1f5c60(0x1e2)]['updated']>0x0||_0x51b00e[_0x1f5c60(0x246)][_0x1f5c60(0x1e2)]['unchanged']>0x0||_0x51b00e[_0x1f5c60(0x246)][_0x1f5c60(0x1d4)][_0x1f5c60(0x237)]>0x0||_0x51b00e[_0x1f5c60(0x246)]['experimentalArtifacts']['updated']>0x0||_0x51b00e[_0x1f5c60(0x246)]['experimentalArtifacts']['unchanged']>0x0;_0x3dcda4&&(console[_0x1f5c60(0x227)](_0x1f5c60(0x256)+formatCountSummary(_0x51b00e['counts'][_0x1f5c60(0x1e2)])),console[_0x1f5c60(0x227)](_0x1f5c60(0x260)+formatCountSummary(_0x51b00e['counts'][_0x1f5c60(0x1d4)])));console[_0x1f5c60(0x227)](_0x1f5c60(0x1e8)+a4_0x25a774[_0x1f5c60(0x247)](_0xaf816b)),displayDiffs(_0x51b00e[_0x1f5c60(0x231)],_0x51b00e[_0x1f5c60(0x1e1)],_0x51b00e[_0x1f5c60(0x24d)],_0x51b00e[_0x1f5c60(0x20a)],_0x51b00e[_0x1f5c60(0x218)],_0x51b00e['experimentalKnowledgeBases'],_0x51b00e[_0x1f5c60(0x1d4)]);if(_0x599029)return console[_0x1f5c60(0x227)](a4_0x25a774[_0x1f5c60(0x1f3)](_0x1f5c60(0x238))),0x0;if(_0x2d37d4===0x0&&_0x172005===0x0){console[_0x1f5c60(0x227)](a4_0x25a774['green']('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x431d49=getLLMProjectUrl(_0x1030f3,_0x51b00e['projectId']);return console['log'](_0x1f5c60(0x1b2)+a4_0x25a774[_0x1f5c60(0x247)](_0x431d49)),0x0;}if(!_0x50860b&&!_0x3352c2){if(!isInteractive())return console[_0x1f5c60(0x24f)](a4_0x25a774['red'](_0x1f5c60(0x1ce)),_0x1f5c60(0x21d)),console['error'](a4_0x25a774[_0x1f5c60(0x1dd)](_0x1f5c60(0x1c7))),0x1;const _0x5d62b4=await confirmKey(_0x1f5c60(0x259)+(_0x2d37d4+_0x172005)+_0x1f5c60(0x1b6));if(!_0x5d62b4)return console['log'](a4_0x25a774[_0x1f5c60(0x1f3)](_0x1f5c60(0x261)),_0x1f5c60(0x23a)),0x1;}const {data:_0x4f4ef5}=await withSpinner(_0x1f5c60(0x221),()=>_0x2e5a7f[_0x1f5c60(0x222)][_0x1f5c60(0x233)](_0xaf816b,{'force':_0x3352c2})),_0x5938d0=_0x4f4ef5[_0x1f5c60(0x246)][_0x1f5c60(0x231)][_0x1f5c60(0x1bd)]>0x0||_0x4f4ef5[_0x1f5c60(0x246)]['knowledgeBases']['errors']>0x0||_0x4f4ef5[_0x1f5c60(0x246)]['textKnowledgeBases']['errors']>0x0||_0x4f4ef5[_0x1f5c60(0x246)][_0x1f5c60(0x20a)][_0x1f5c60(0x1bd)]>0x0;if(_0x5938d0){console['log'](a4_0x25a774[_0x1f5c60(0x1f3)](_0x1f5c60(0x223))),console[_0x1f5c60(0x227)](),console[_0x1f5c60(0x227)](a4_0x25a774[_0x1f5c60(0x1f5)](_0x1f5c60(0x1f0)));for(const _0x3ebbab of _0x4f4ef5[_0x1f5c60(0x231)]){_0x3ebbab['action']==='error'&&console['log'](a4_0x25a774['red'](_0x1f5c60(0x1c5)+_0x3ebbab[_0x1f5c60(0x1e0)]+_0x1f5c60(0x1ed)+_0x3ebbab['error']));}for(const _0x1ccc04 of _0x4f4ef5[_0x1f5c60(0x1e1)]){_0x1ccc04[_0x1f5c60(0x213)]===_0x1f5c60(0x24f)&&console['log'](a4_0x25a774[_0x1f5c60(0x1f5)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x1ccc04[_0x1f5c60(0x1c1)]+'\x22:\x20'+_0x1ccc04[_0x1f5c60(0x24f)]));}for(const _0x58d490 of _0x4f4ef5['textKnowledgeBases']){_0x58d490[_0x1f5c60(0x213)]==='error'&&console[_0x1f5c60(0x227)](a4_0x25a774[_0x1f5c60(0x1f5)](_0x1f5c60(0x21c)+_0x58d490['name']+_0x1f5c60(0x1ed)+_0x58d490[_0x1f5c60(0x24f)]));}for(const _0xd69d72 of _0x4f4ef5[_0x1f5c60(0x20a)]){_0xd69d72[_0x1f5c60(0x213)]===_0x1f5c60(0x24f)&&console[_0x1f5c60(0x227)](a4_0x25a774['red'](_0x1f5c60(0x23b)+_0xd69d72[_0x1f5c60(0x1c1)]+_0x1f5c60(0x1ed)+_0xd69d72['error']));}for(const _0x752eeb of _0x4f4ef5[_0x1f5c60(0x218)]){_0x752eeb[_0x1f5c60(0x213)]===_0x1f5c60(0x24f)&&console[_0x1f5c60(0x227)](a4_0x25a774['red']('\x20\x20Integration\x20\x22'+_0x752eeb[_0x1f5c60(0x1c1)]+_0x1f5c60(0x1ed)+_0x752eeb[_0x1f5c60(0x24f)]));}return 0x1;}console[_0x1f5c60(0x227)](a4_0x25a774[_0x1f5c60(0x200)](_0x1f5c60(0x1f2)+(_0x2d37d4+_0x172005)+'\x20resources\x20to\x20\x27'+_0x4f4ef5[_0x1f5c60(0x1d3)]+'\x27'));const _0x8e66a7=getLLMProjectUrl(_0x1030f3,_0x4f4ef5[_0x1f5c60(0x1be)]);return console[_0x1f5c60(0x227)]('Project:\x20'+a4_0x25a774[_0x1f5c60(0x247)](_0x8e66a7)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x413b26=a5_0x26bb;(function(_0x576a35,_0x106afd){const _0x4b5813=a5_0x26bb,_0x425787=_0x576a35();while(!![]){try{const _0x5b4d4a=parseInt(_0x4b5813(0xcb))/0x1*(parseInt(_0x4b5813(0xd0))/0x2)+parseInt(_0x4b5813(0x116))/0x3*(parseInt(_0x4b5813(0x109))/0x4)+-parseInt(_0x4b5813(0x106))/0x5+parseInt(_0x4b5813(0x10e))/0x6+parseInt(_0x4b5813(0xf0))/0x7+-parseInt(_0x4b5813(0x142))/0x8+-parseInt(_0x4b5813(0x10d))/0x9*(parseInt(_0x4b5813(0x141))/0xa);if(_0x5b4d4a===_0x106afd)break;else _0x425787['push'](_0x425787['shift']());}catch(_0x244d8b){_0x425787['push'](_0x425787['shift']());}}}(a5_0x1a58,0x5d111));import*as a5_0x2f367c from'node:fs';import*as a5_0x2aad79 from'node:path';function a5_0x26bb(_0xee5235,_0x322d9a){_0xee5235=_0xee5235-0xb1;const _0x1a5822=a5_0x1a58();let _0x26bbf4=_0x1a5822[_0xee5235];return _0x26bbf4;}import a5_0x5108d1 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_0x1a58(){const _0x339843=['\x20\x20Round\x20','green','tags','cyan','size','red','Executing\x20new\x20tests...','Evaluating\x20response...','...\x20','FAIL','2355535sHGYUk','site','Failed:\x20\x20\x20','toISOString','Cached\x20run\x20is\x20from\x20site\x20\x22','conversation_url','forEach','✓\x20PASS:\x20','Re-evaluating\x20cached\x20test\x20run...','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','Either\x20switch\x20to\x20the\x20\x22','llmProject','No\x20tests\x20found\x20matching:\x20','agent','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','Round\x20','Total:\x20\x20\x20\x20','Tests\x20found:\x20','/<agent-name>','toLowerCase','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','start','2607225oVryRR','yellow','executeReeval','2536fOYvxv','isSpinning','multiple_agents','agent:test','18VUhwyy','3775260tEzmMV','Round\x201/','\x20(new)','now','\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)','stop','Test\x20','repeat','2064IzbKYs','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','utf-8','projectName','log','PASS','resolve','rounds','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','\x27\x20to\x20create\x20the\x20folder\x20structure.','includes','\x20(cached)','join','\x20-\x20','Test\x20Configuration:','add','found','projectDir','find','ERROR','Re-evaluating...','resolveAgentId','✗\x20ERROR:\x20Project\x20not\x20found:\x20','text','\x20\x20Agent:\x20','split','Re-evaluation\x20Summary','jsonl','Error:\x20No\x20previous\x20test\x20run\x20found.','Running\x20test:\x20','Test\x20Summary','\x22:\x20','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','tests','round','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','Project\x20path:\x20','has','dim','test.yml','existsSync','⚠\x20SKIPPED:\x20','reason','1565160VafFQS','3006264Ienila','basename','Available\x20tests:\x20','length','json','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','404','Error\x20writing\x20output\x20file:\x20',':\x20Sending\x20user\x20input...','agentName','push','message','tsv','\x20\x20-\x20','Failed\x20Tests:','New\x20tests\x20to\x20execute:\x20','Agent:\x20','llm','Conversation\x20URL:\x20','table','Duration:\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','✗\x20ERROR:\x20','Errors:\x20\x20\x20','white','not\x20found','trim','Site:\x20','✗\x20FAIL:\x20','substring','94777QrgRjP','Running:\x20','Using\x20agent:\x20','Re-evaluating\x20','status','4nKGXJt','some','name','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','reeval','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Passed:\x20\x20\x20','no_local_folder','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','\x20\x20Conversation:\x20','\x20\x20Site:\x20','\x20\x20Evaluating...\x20','Run\x20tests\x20for\x20an\x20LLM\x20agent','filter','map','Cached\x20run\x20from:\x20','\x20\x20Project:\x20','Output\x20written\x20to:\x20','testYmlPath','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','...'];a5_0x1a58=function(){return _0x339843;};return a5_0x1a58();}export class AgentTestCommand extends BaseCommand{[a5_0x413b26(0xd2)]=a5_0x413b26(0x10c);['description']=a5_0x413b26(0xdd);async['execute'](_0x90c4aa){const _0x55257f=a5_0x413b26,{options:_0x198494,args:_0x4035aa,tdx:_0x1b848a}=_0x90c4aa,_0x3185e8=_0x4035aa[0x0]||'.',_0x565795=_0x198494['dryRun'],_0x405d10=_0x198494,_0x552db3=_0x405d10['eval']===![],_0x455a7e=_0x405d10[_0x55257f(0xd5)],_0x494e2a=_0x405d10[_0x55257f(0xd2)],_0x2457fa=_0x405d10[_0x55257f(0xe8)],_0x598915=_0x198494[_0x55257f(0xf1)],_0x577182=_0x405d10['output'];if(_0x455a7e&&_0x552db3)return console[_0x55257f(0x11a)](a5_0x5108d1[_0x55257f(0xeb)](_0x55257f(0x136))),0x1;let _0x3f55b6=_0x55257f(0xc0);if(_0x405d10['json'])_0x3f55b6=_0x55257f(0x146);else{if(_0x405d10[_0x55257f(0x131)])_0x3f55b6=_0x55257f(0x131);else{if(_0x405d10[_0x55257f(0xb9)])_0x3f55b6=_0x55257f(0xb9);else{if(_0x405d10['table'])_0x3f55b6='table';}}}const _0x3b920b=_0x405d10[_0x55257f(0xfb)];let _0x5c08f6=_0x3185e8;const _0x5aea97=a5_0x2f367c[_0x55257f(0x13e)](_0x3185e8),_0x532a44=_0x3185e8==='.';if(!_0x5aea97||_0x532a44){const _0x363aa8=resolveProjectFromContext(_0x3185e8,_0x3b920b,{'requireFile':_0x55257f(0x13d)});if(_0x363aa8[_0x55257f(0x126)])_0x5c08f6=_0x363aa8['projectDir'],_0x363aa8['source']==='context'&&console['log'](a5_0x5108d1['dim'](_0x55257f(0xcd)+_0x5c08f6));else switch(_0x363aa8['reason']){case'no_context':console['log'](a5_0x5108d1[_0x55257f(0x107)](_0x363aa8[_0x55257f(0xb8)])),console[_0x55257f(0x11a)](),console['log']('Usage:'),console['log']('\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path'),console[_0x55257f(0x11a)](_0x55257f(0x112)),console[_0x55257f(0x11a)](),console[_0x55257f(0x11a)](_0x55257f(0x117));return 0x1;case _0x55257f(0xd8):console[_0x55257f(0x11a)](a5_0x5108d1[_0x55257f(0x107)](_0x363aa8['message'])),console['log'](),console[_0x55257f(0x11a)]('Run\x20\x27tdx\x20agent\x20pull\x20'+_0x363aa8[_0x55257f(0xfb)]+_0x55257f(0x11f));return 0x1;case _0x55257f(0x10b):{const _0x3949a5=a5_0x2aad79[_0x55257f(0x143)](_0x363aa8[_0x55257f(0x127)]);console[_0x55257f(0x11a)](a5_0x5108d1[_0x55257f(0x107)](_0x55257f(0xb1)+_0x363aa8[_0x55257f(0xfb)]+'\x22:'));for(const _0x4ef2a6 of _0x363aa8['agentDirs']){console[_0x55257f(0x11a)](_0x55257f(0xba)+_0x4ef2a6);}return console[_0x55257f(0x11a)](),console[_0x55257f(0x11a)]('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x3949a5+_0x55257f(0x102)),0x1;}case'no_tests':console[_0x55257f(0x11a)](a5_0x5108d1[_0x55257f(0x107)](_0x55257f(0xd3)+_0x363aa8['llmProject']+'\x22.')),console[_0x55257f(0x11a)](a5_0x5108d1[_0x55257f(0x13c)](_0x55257f(0x13a)+_0x363aa8['projectDir'])),console[_0x55257f(0x11a)](),console[_0x55257f(0x11a)](_0x55257f(0xd4));return 0x1;}}const {definition:_0x37dcfa,agentInfo:_0xdf923}=parseTestFile(_0x5c08f6);let _0x41a84b=_0x37dcfa[_0x55257f(0x137)];if(_0x494e2a){const _0x37884c=_0x494e2a['split'](',')[_0x55257f(0xdf)](_0xac17bb=>_0xac17bb[_0x55257f(0xc7)]());_0x41a84b=_0x37dcfa[_0x55257f(0x137)][_0x55257f(0xde)](_0x55523c=>_0x37884c['includes'](_0x55523c[_0x55257f(0xd2)]));if(_0x41a84b['length']===0x0)return console[_0x55257f(0x11a)](a5_0x5108d1[_0x55257f(0x107)](_0x55257f(0xfc)+_0x494e2a)),console['log'](a5_0x5108d1[_0x55257f(0x13c)](_0x55257f(0x144)+_0x37dcfa[_0x55257f(0x137)]['map'](_0x5b5ae2=>_0x5b5ae2['name'])[_0x55257f(0x122)](',\x20'))),0x1;}if(_0x2457fa){const _0x5f029f=_0x2457fa[_0x55257f(0x12f)](',')[_0x55257f(0xdf)](_0x45b5c2=>_0x45b5c2[_0x55257f(0xc7)]()[_0x55257f(0x103)]());_0x41a84b=_0x41a84b['filter'](_0x1d8310=>_0x1d8310[_0x55257f(0xe8)]?.[_0x55257f(0xd1)](_0x53ff3e=>_0x5f029f[_0x55257f(0x120)](_0x53ff3e['toLowerCase']())));if(_0x41a84b['length']===0x0){console['log'](a5_0x5108d1[_0x55257f(0x107)]('No\x20tests\x20found\x20with\x20tags:\x20'+_0x2457fa));const _0x75ca86=new Set();return _0x37dcfa['tests'][_0x55257f(0xf6)](_0x3453ea=>_0x3453ea[_0x55257f(0xe8)]?.[_0x55257f(0xf6)](_0x6d8066=>_0x75ca86[_0x55257f(0x125)](_0x6d8066))),_0x75ca86[_0x55257f(0xea)]>0x0?console['log'](a5_0x5108d1[_0x55257f(0x13c)]('Available\x20tags:\x20'+[..._0x75ca86][_0x55257f(0x122)](',\x20'))):console[_0x55257f(0x11a)](a5_0x5108d1['dim']('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0x455a7e)return this[_0x55257f(0x108)](_0x90c4aa,{'definition':{'tests':_0x41a84b},'agentInfo':_0xdf923,'outputFormat':_0x3f55b6,'outputFile':_0x577182,'testNames':_0x494e2a});if(_0x565795){console['log'](a5_0x5108d1[_0x55257f(0xe9)](_0x55257f(0x124))),console['log'](_0x55257f(0xdb)+a5_0x5108d1['white'](_0x598915)),console[_0x55257f(0x11a)](_0x55257f(0xe1)+a5_0x5108d1[_0x55257f(0xc5)](_0xdf923[_0x55257f(0x119)])),console[_0x55257f(0x11a)](_0x55257f(0x12e)+a5_0x5108d1['white'](_0xdf923[_0x55257f(0xb6)])),console['log'](),console[_0x55257f(0x11a)](_0x55257f(0x101)+a5_0x5108d1['white'](_0x41a84b['length']));for(let _0x19e40d=0x0;_0x19e40d<_0x41a84b['length'];_0x19e40d++){const _0x23f994=_0x41a84b[_0x19e40d],_0xbdcce3=_0x23f994[_0x55257f(0x11d)]['length']===0x1?_0x55257f(0x138):_0x55257f(0x11d),_0x247efd=_0x23f994[_0x55257f(0xe8)]?.[_0x55257f(0x145)]?'\x20['+_0x23f994['tags'][_0x55257f(0x122)](',\x20')+']':'';console['log']('\x20\x20'+(_0x19e40d+0x1)+'.\x20'+a5_0x5108d1['white'](_0x23f994[_0x55257f(0xd2)])+'\x20('+_0x23f994[_0x55257f(0x11d)][_0x55257f(0x145)]+'\x20'+_0xbdcce3+')'+a5_0x5108d1[_0x55257f(0x13c)](_0x247efd));}return 0x0;}let _0x433523,_0x5ca8a0;try{_0x433523=await _0x1b848a[_0x55257f(0xbe)]['resolveProjectId'](_0xdf923[_0x55257f(0x119)]);}catch(_0x1cc369){const _0x45efc7=_0x1cc369 instanceof Error?_0x1cc369['message']:String(_0x1cc369);return _0x45efc7[_0x55257f(0x120)](_0x55257f(0xb3))||_0x45efc7[_0x55257f(0x103)]()[_0x55257f(0x120)](_0x55257f(0xc6))?console[_0x55257f(0x11a)](a5_0x5108d1[_0x55257f(0xeb)](_0x55257f(0x12c)+_0xdf923[_0x55257f(0x119)])):console[_0x55257f(0x11a)](a5_0x5108d1[_0x55257f(0xeb)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0xdf923[_0x55257f(0x119)]+_0x55257f(0x135)+_0x45efc7)),0x1;}try{_0x5ca8a0=await _0x1b848a[_0x55257f(0xbe)][_0x55257f(0x12b)](_0xdf923['agentName'],_0x433523);}catch(_0x3c8c0f){const _0x5a780d=_0x3c8c0f instanceof Error?_0x3c8c0f[_0x55257f(0xb8)]:String(_0x3c8c0f);return _0x5a780d[_0x55257f(0x120)](_0x55257f(0xb3))||_0x5a780d[_0x55257f(0x103)]()[_0x55257f(0x120)](_0x55257f(0xc6))?console[_0x55257f(0x11a)](a5_0x5108d1[_0x55257f(0xeb)](_0x55257f(0xfe)+_0xdf923[_0x55257f(0xb6)])):console[_0x55257f(0x11a)](a5_0x5108d1[_0x55257f(0xeb)](_0x55257f(0x11e)+_0xdf923[_0x55257f(0xb6)]+_0x55257f(0x135)+_0x5a780d)),0x1;}let _0x75c312;if(!_0x552db3)try{_0x75c312=await setupEvaluatorAgent(_0x1b848a[_0x55257f(0xbe)],_0x198494['verbose']);}catch(_0x2a728f){const _0x5b9cbb=_0x2a728f instanceof Error?_0x2a728f[_0x55257f(0xb8)]:String(_0x2a728f);return console[_0x55257f(0x11a)](a5_0x5108d1[_0x55257f(0xeb)](_0x55257f(0x139)+_0x5b9cbb)),0x1;}console[_0x55257f(0x11a)](a5_0x5108d1[_0x55257f(0xe9)]('Running\x20agent\x20tests...')),console[_0x55257f(0x11a)](_0x55257f(0xc8)+a5_0x5108d1[_0x55257f(0xc5)](_0x598915)),console[_0x55257f(0x11a)](_0x55257f(0xbd)+a5_0x5108d1[_0x55257f(0xc5)](_0xdf923[_0x55257f(0x119)]+'/'+_0xdf923[_0x55257f(0xb6)])),console[_0x55257f(0x11a)]();const _0x50ecff=[],_0x46cdf9=[],_0x2afbb0=Date[_0x55257f(0x111)]();for(let _0x1ca47f=0x0;_0x1ca47f<_0x41a84b[_0x55257f(0x145)];_0x1ca47f++){const _0x31c5ab=_0x41a84b[_0x1ca47f];_0x41a84b[_0x55257f(0x145)]>0x1?console[_0x55257f(0x11a)](_0x55257f(0x114)+(_0x1ca47f+0x1)+'/'+_0x41a84b[_0x55257f(0x145)]+':\x20'+a5_0x5108d1[_0x55257f(0xc5)](_0x31c5ab['name'])):console[_0x55257f(0x11a)](_0x55257f(0x133)+a5_0x5108d1['white'](_0x31c5ab[_0x55257f(0xd2)]));const _0x116256=createCommandSpinner(_0x55257f(0x10f)+_0x31c5ab[_0x55257f(0x11d)][_0x55257f(0x145)]+_0x55257f(0xb5));_0x116256[_0x55257f(0x105)]();try{const {result:_0x424a3f,conversation:_0x4af4a6}=await runTest(_0x1b848a[_0x55257f(0xbe)],_0x31c5ab,{'agentId':_0x5ca8a0,'projectId':_0x433523,'site':_0x598915,'noEval':_0x552db3,'evaluatorId':_0x75c312,'onRoundStart':(_0x52bcbb,_0x4d52ce)=>{const _0x385124=_0x55257f;_0x116256[_0x385124(0x12d)]=_0x385124(0xff)+(_0x52bcbb+0x1)+'/'+_0x4d52ce+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x565d61,_0x37bccb,_0x1912dd)=>{const _0x372e71=_0x55257f,_0x2bee62=formatElapsed(_0x37bccb);_0x1912dd?console['log'](_0x372e71(0xe6)+(_0x565d61+0x1)+'/'+_0x31c5ab[_0x372e71(0x11d)][_0x372e71(0x145)]+_0x372e71(0xee)+a5_0x5108d1[_0x372e71(0xe7)]('✓')+'\x20('+_0x2bee62+')'):console[_0x372e71(0x11a)](_0x372e71(0xe6)+(_0x565d61+0x1)+'/'+_0x31c5ab[_0x372e71(0x11d)]['length']+_0x372e71(0xee)+a5_0x5108d1['red']('✗'));},'onEvaluationStart':()=>{const _0x114b2b=_0x55257f;_0x116256[_0x114b2b(0x12d)]='Evaluating\x20response...';},'onEvaluationComplete':_0x2fe0c8=>{const _0x395973=_0x55257f,_0x574047=formatElapsed(_0x2fe0c8);console[_0x395973(0x11a)]('\x20\x20Evaluating...\x20'+a5_0x5108d1['green']('✓')+'\x20('+_0x574047+')');}});_0x116256['stop'](),_0x50ecff[_0x55257f(0xb7)](_0x424a3f),_0x46cdf9[_0x55257f(0xb7)](_0x4af4a6);if(_0x424a3f['status']===_0x55257f(0x11b))console['log'](a5_0x5108d1['green'](_0x55257f(0xf7)+_0x424a3f[_0x55257f(0x140)]));else _0x424a3f['status']==='FAIL'?console[_0x55257f(0x11a)](a5_0x5108d1['red'](_0x55257f(0xc9)+_0x424a3f[_0x55257f(0x140)])):console[_0x55257f(0x11a)](a5_0x5108d1[_0x55257f(0xeb)](_0x55257f(0xc3)+_0x424a3f[_0x55257f(0x140)]));_0x424a3f[_0x55257f(0xf5)]&&console[_0x55257f(0x11a)](a5_0x5108d1['dim'](_0x55257f(0xbf)+_0x424a3f[_0x55257f(0xf5)])),console[_0x55257f(0x11a)]();}catch(_0x5116fe){_0x116256[_0x55257f(0x113)]();const _0x20d27b=_0x5116fe instanceof Error?_0x5116fe[_0x55257f(0xb8)]:String(_0x5116fe);console[_0x55257f(0x11a)](a5_0x5108d1[_0x55257f(0xeb)](_0x55257f(0xc3)+_0x20d27b)),console[_0x55257f(0x11a)](),_0x50ecff[_0x55257f(0xb7)]({'name':_0x31c5ab[_0x55257f(0xd2)],'status':_0x55257f(0x129),'reason':_0x20d27b,'timestamp':new Date()[_0x55257f(0xf3)](),'duration_ms':0x0});}}const _0x1e9800=Date['now']()-_0x2afbb0,_0x14bc59=_0x50ecff['filter'](_0x464d0e=>_0x464d0e[_0x55257f(0xcf)]===_0x55257f(0x11b))['length'],_0x375f8e=_0x50ecff['filter'](_0x54bd5a=>_0x54bd5a[_0x55257f(0xcf)]===_0x55257f(0xef))[_0x55257f(0x145)],_0x3fe2f1=_0x50ecff[_0x55257f(0xde)](_0x3b82bb=>_0x3b82bb['status']===_0x55257f(0x129))[_0x55257f(0x145)];console['log']('━'[_0x55257f(0x115)](0x3c)),console[_0x55257f(0x11a)](_0x55257f(0x134)),console[_0x55257f(0x11a)]('━'[_0x55257f(0x115)](0x3c)),console[_0x55257f(0x11a)](_0x55257f(0x100)+_0x50ecff[_0x55257f(0x145)]),console[_0x55257f(0x11a)](_0x55257f(0xd7)+a5_0x5108d1[_0x55257f(0xe7)](_0x14bc59)),console[_0x55257f(0x11a)]('Failed:\x20\x20\x20'+a5_0x5108d1[_0x55257f(0xeb)](_0x375f8e));_0x3fe2f1>0x0&&console[_0x55257f(0x11a)](_0x55257f(0xc4)+a5_0x5108d1[_0x55257f(0xeb)](_0x3fe2f1));console[_0x55257f(0x11a)](_0x55257f(0xc1)+formatElapsed(_0x1e9800)),console[_0x55257f(0x11a)]('━'[_0x55257f(0x115)](0x3c));const _0x464da5=_0x50ecff[_0x55257f(0xde)](_0x22695e=>_0x22695e[_0x55257f(0xcf)]!==_0x55257f(0x11b));if(_0x464da5[_0x55257f(0x145)]>0x0){console[_0x55257f(0x11a)](),console[_0x55257f(0x11a)](_0x55257f(0xbb));for(const _0x1aafa8 of _0x464da5){const _0x4b268f=a5_0x5108d1[_0x55257f(0xeb)]('✗'),_0x4de0a5=_0x1aafa8[_0x55257f(0x140)][_0x55257f(0x145)]>0x32?_0x1aafa8[_0x55257f(0x140)][_0x55257f(0xca)](0x0,0x32)+_0x55257f(0xe5):_0x1aafa8['reason'];console[_0x55257f(0x11a)]('\x20\x20'+_0x4b268f+'\x20'+_0x1aafa8[_0x55257f(0xd2)]+':\x20'+_0x4de0a5);}}const _0x251de3={'summary':{'total':_0x50ecff[_0x55257f(0x145)],'passed':_0x14bc59,'failed':_0x375f8e,'errors':_0x3fe2f1>0x0?_0x3fe2f1:undefined,'duration_ms':_0x1e9800},'tests':_0x50ecff,'agent':{'project':_0xdf923[_0x55257f(0x119)],'name':_0xdf923[_0x55257f(0xb6)],'site':_0x598915},'timestamp':new Date(_0x2afbb0)['toISOString']()};try{const _0x5150b=buildCachedTestRun(_0x46cdf9,{'site':_0x598915,'projectId':_0x433523,'projectName':_0xdf923[_0x55257f(0x119)],'agentId':_0x5ca8a0,'agentName':_0xdf923[_0x55257f(0xb6)],'testYmlPath':a5_0x2aad79[_0x55257f(0x11c)](_0xdf923[_0x55257f(0xe3)])});saveLastTestRun(_0x5150b);}catch{}if(_0x3f55b6!==_0x55257f(0xc0)||_0x577182){const _0x406695=formatResults(_0x251de3,_0x3f55b6);if(_0x577182)try{a5_0x2f367c['writeFileSync'](_0x577182,_0x406695,_0x55257f(0x118)),console[_0x55257f(0x11a)](),console[_0x55257f(0x11a)](a5_0x5108d1[_0x55257f(0x13c)](_0x55257f(0xe2)+_0x577182));}catch(_0x643f08){return console[_0x55257f(0x11a)](),console[_0x55257f(0x11a)](a5_0x5108d1[_0x55257f(0xeb)](_0x55257f(0xb4)+_0x643f08)),0x1;}else console[_0x55257f(0x11a)](),console['log'](_0x406695);}return _0x464da5[_0x55257f(0x145)]>0x0?0x1:0x0;}async[a5_0x413b26(0x108)](_0x256473,_0x2917bc){const _0x45b178=a5_0x413b26,{options:_0x53b759,tdx:_0x5d7128}=_0x256473,{definition:_0x596849,agentInfo:_0x587220,outputFormat:_0x165782,outputFile:_0x18c89a}=_0x2917bc,_0x3c9b2f=_0x53b759[_0x45b178(0xf1)],_0x1aca58=loadLastTestRun();if(!_0x1aca58)return console[_0x45b178(0x11a)](a5_0x5108d1[_0x45b178(0xeb)](_0x45b178(0x132))),console['log'](a5_0x5108d1[_0x45b178(0x13c)](_0x45b178(0xc2))),0x1;if(_0x1aca58[_0x45b178(0xfd)][_0x45b178(0xb6)]!==_0x587220['agentName'])return console[_0x45b178(0x11a)](a5_0x5108d1['red'](_0x45b178(0xf9)+_0x1aca58[_0x45b178(0xfd)][_0x45b178(0xb6)]+_0x45b178(0xb2)+_0x587220[_0x45b178(0xb6)]+'\x22.')),console['log'](a5_0x5108d1['dim'](_0x45b178(0xd9))),0x1;const _0x4c05c1=new Set(_0x1aca58['conversations'][_0x45b178(0xdf)](_0x293b56=>_0x293b56['testName'])),_0x157ae0=_0x596849['tests'][_0x45b178(0xde)](_0x1d8b48=>!_0x4c05c1[_0x45b178(0x13b)](_0x1d8b48[_0x45b178(0xd2)]));if(_0x157ae0[_0x45b178(0x145)]>0x0&&_0x1aca58['site']!==_0x3c9b2f)return console[_0x45b178(0x11a)](a5_0x5108d1[_0x45b178(0xeb)](_0x45b178(0xe4))),console[_0x45b178(0x11a)](a5_0x5108d1[_0x45b178(0x13c)](_0x45b178(0xf4)+_0x1aca58[_0x45b178(0xf1)]+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x3c9b2f+'\x22.')),console[_0x45b178(0x11a)](a5_0x5108d1[_0x45b178(0x13c)](_0x45b178(0xfa)+_0x1aca58[_0x45b178(0xf1)]+_0x45b178(0x104))),0x1;const _0x4ed328=_0x596849[_0x45b178(0x137)]['filter'](_0x919622=>_0x4c05c1[_0x45b178(0x13b)](_0x919622[_0x45b178(0xd2)])),_0x313f47=_0x157ae0;let _0x333432;try{_0x333432=await setupEvaluatorAgent(_0x5d7128[_0x45b178(0xbe)],_0x53b759['verbose']);}catch(_0x53671e){const _0x684445=_0x53671e instanceof Error?_0x53671e[_0x45b178(0xb8)]:String(_0x53671e);return console[_0x45b178(0x11a)](a5_0x5108d1[_0x45b178(0xeb)](_0x45b178(0x139)+_0x684445)),0x1;}console['log'](a5_0x5108d1[_0x45b178(0xe9)](_0x45b178(0xf8))),console[_0x45b178(0x11a)](_0x45b178(0xe0)+a5_0x5108d1[_0x45b178(0xc5)](_0x1aca58['timestamp'])),console[_0x45b178(0x11a)]('Agent:\x20'+a5_0x5108d1[_0x45b178(0xc5)](_0x1aca58[_0x45b178(0xfd)][_0x45b178(0x119)]+'/'+_0x1aca58[_0x45b178(0xfd)][_0x45b178(0xb6)]));_0x313f47[_0x45b178(0x145)]>0x0&&console[_0x45b178(0x11a)](_0x45b178(0xbc)+a5_0x5108d1[_0x45b178(0x107)](_0x313f47[_0x45b178(0x145)]));console[_0x45b178(0x11a)]();const _0x35054e=[],_0x5d4902=Date[_0x45b178(0x111)](),_0xe0bb7a=createCommandSpinner(_0x45b178(0x12a));if(_0x4ed328[_0x45b178(0x145)]>0x0)try{const _0x1db188=await reevaluateFromCache(_0x5d7128[_0x45b178(0xbe)],_0x1aca58,{'tests':_0x4ed328},{'evaluatorId':_0x333432,'onTestStart':(_0x263ae4,_0x34fe08,_0x1e5497)=>{const _0x255220=_0x45b178;_0xe0bb7a[_0x255220(0x12d)]=_0x255220(0xce)+(_0x34fe08+0x1)+'/'+_0x1e5497+':\x20'+_0x263ae4+_0x255220(0xe5);if(!_0xe0bb7a[_0x255220(0x10a)])_0xe0bb7a['start']();},'onTestComplete':(_0x37e8ab,_0x5ccffd)=>{const _0x8edb5f=_0x45b178;_0xe0bb7a[_0x8edb5f(0x113)]();if(_0x5ccffd[_0x8edb5f(0xcf)]===_0x8edb5f(0x11b))console[_0x8edb5f(0x11a)](a5_0x5108d1[_0x8edb5f(0xe7)]('✓\x20PASS:\x20'+_0x37e8ab)+a5_0x5108d1['dim'](_0x8edb5f(0x121)));else _0x5ccffd[_0x8edb5f(0xcf)]===_0x8edb5f(0xef)?console[_0x8edb5f(0x11a)](a5_0x5108d1[_0x8edb5f(0xeb)](_0x8edb5f(0xc9)+_0x37e8ab+_0x8edb5f(0x123)+_0x5ccffd[_0x8edb5f(0x140)])+a5_0x5108d1[_0x8edb5f(0x13c)](_0x8edb5f(0x121))):console['log'](a5_0x5108d1[_0x8edb5f(0xeb)](_0x8edb5f(0xc3)+_0x37e8ab+_0x8edb5f(0x123)+_0x5ccffd[_0x8edb5f(0x140)]));_0x5ccffd[_0x8edb5f(0xf5)]&&console[_0x8edb5f(0x11a)](a5_0x5108d1[_0x8edb5f(0x13c)]('\x20\x20Conversation:\x20'+_0x5ccffd[_0x8edb5f(0xf5)])),_0x35054e[_0x8edb5f(0xb7)](_0x5ccffd);},'onTestSkipped':(_0x35d096,_0x2db93c)=>{const _0x5da00e=_0x45b178;_0xe0bb7a[_0x5da00e(0x113)](),console[_0x5da00e(0x11a)](a5_0x5108d1['yellow'](_0x5da00e(0x13f)+_0x35d096+_0x5da00e(0x123)+_0x2db93c));}});for(const _0x4b6c3e of _0x1db188){!_0x35054e[_0x45b178(0x128)](_0x4d66cf=>_0x4d66cf['name']===_0x4b6c3e[_0x45b178(0xd2)])&&_0x35054e['push'](_0x4b6c3e);}}catch(_0x322317){_0xe0bb7a[_0x45b178(0x113)]();const _0x4e69ee=_0x322317 instanceof Error?_0x322317[_0x45b178(0xb8)]:String(_0x322317);return console[_0x45b178(0x11a)](a5_0x5108d1['red'](_0x45b178(0xd6)+_0x4e69ee)),0x1;}_0xe0bb7a['stop']();if(_0x313f47['length']>0x0){console[_0x45b178(0x11a)](),console[_0x45b178(0x11a)](a5_0x5108d1[_0x45b178(0xe9)](_0x45b178(0xec)));const {projectId:_0x4ad278,agentId:_0x3c6fc5}=_0x1aca58[_0x45b178(0xfd)];for(const _0x3a870b of _0x313f47){console[_0x45b178(0x11a)](_0x45b178(0xcc)+a5_0x5108d1[_0x45b178(0xc5)](_0x3a870b['name']));const _0x51d8b8=createCommandSpinner(_0x45b178(0x10f)+_0x3a870b[_0x45b178(0x11d)][_0x45b178(0x145)]+_0x45b178(0xb5));_0x51d8b8[_0x45b178(0x105)]();try{const {result:_0x502332}=await runTest(_0x5d7128[_0x45b178(0xbe)],_0x3a870b,{'agentId':_0x3c6fc5,'projectId':_0x4ad278,'site':_0x1aca58[_0x45b178(0xf1)],'noEval':![],'evaluatorId':_0x333432,'onRoundStart':(_0x53729f,_0x5adb5e)=>{const _0x264ea2=_0x45b178;_0x51d8b8['text']=_0x264ea2(0xff)+(_0x53729f+0x1)+'/'+_0x5adb5e+_0x264ea2(0xb5);},'onRoundComplete':(_0xb54d9f,_0x24d14c,_0x13b7cf)=>{const _0x11743a=_0x45b178,_0x4abaa7=formatElapsed(_0x24d14c);_0x13b7cf?console[_0x11743a(0x11a)](_0x11743a(0xe6)+(_0xb54d9f+0x1)+'/'+_0x3a870b['rounds'][_0x11743a(0x145)]+_0x11743a(0xee)+a5_0x5108d1[_0x11743a(0xe7)]('✓')+'\x20('+_0x4abaa7+')'):console[_0x11743a(0x11a)](_0x11743a(0xe6)+(_0xb54d9f+0x1)+'/'+_0x3a870b['rounds'][_0x11743a(0x145)]+_0x11743a(0xee)+a5_0x5108d1[_0x11743a(0xeb)]('✗'));},'onEvaluationStart':()=>{const _0x16cd04=_0x45b178;_0x51d8b8['text']=_0x16cd04(0xed);},'onEvaluationComplete':_0x76b002=>{const _0x4629cc=_0x45b178,_0x5b23df=formatElapsed(_0x76b002);console[_0x4629cc(0x11a)](_0x4629cc(0xdc)+a5_0x5108d1[_0x4629cc(0xe7)]('✓')+'\x20('+_0x5b23df+')');}});_0x51d8b8[_0x45b178(0x113)](),_0x35054e[_0x45b178(0xb7)](_0x502332);if(_0x502332[_0x45b178(0xcf)]===_0x45b178(0x11b))console[_0x45b178(0x11a)](a5_0x5108d1[_0x45b178(0xe7)](_0x45b178(0xf7)+_0x502332['reason'])+a5_0x5108d1['dim'](_0x45b178(0x110)));else _0x502332[_0x45b178(0xcf)]===_0x45b178(0xef)?console['log'](a5_0x5108d1[_0x45b178(0xeb)](_0x45b178(0xc9)+_0x502332['reason'])+a5_0x5108d1[_0x45b178(0x13c)]('\x20(new)')):console['log'](a5_0x5108d1[_0x45b178(0xeb)](_0x45b178(0xc3)+_0x502332[_0x45b178(0x140)]));_0x502332[_0x45b178(0xf5)]&&console['log'](a5_0x5108d1[_0x45b178(0x13c)](_0x45b178(0xda)+_0x502332[_0x45b178(0xf5)]));}catch(_0xfc300b){_0x51d8b8['stop']();const _0x746ba2=_0xfc300b instanceof Error?_0xfc300b[_0x45b178(0xb8)]:String(_0xfc300b);console['log'](a5_0x5108d1[_0x45b178(0xeb)](_0x45b178(0xc3)+_0x746ba2)),_0x35054e[_0x45b178(0xb7)]({'name':_0x3a870b[_0x45b178(0xd2)],'status':'ERROR','reason':_0x746ba2,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console[_0x45b178(0x11a)]();const _0x374a88=Date['now']()-_0x5d4902,_0x54be7b=_0x35054e['filter'](_0x2e9522=>_0x2e9522[_0x45b178(0xcf)]===_0x45b178(0x11b))['length'],_0x3221ea=_0x35054e['filter'](_0x3bcfa4=>_0x3bcfa4[_0x45b178(0xcf)]===_0x45b178(0xef))[_0x45b178(0x145)],_0x349b99=_0x35054e['filter'](_0x406b07=>_0x406b07[_0x45b178(0xcf)]===_0x45b178(0x129))[_0x45b178(0x145)];console[_0x45b178(0x11a)]('━'[_0x45b178(0x115)](0x3c)),console[_0x45b178(0x11a)](_0x45b178(0x130)),console[_0x45b178(0x11a)]('━'[_0x45b178(0x115)](0x3c)),console['log'](_0x45b178(0x100)+_0x35054e[_0x45b178(0x145)]),console['log'](_0x45b178(0xd7)+a5_0x5108d1[_0x45b178(0xe7)](_0x54be7b)),console['log'](_0x45b178(0xf2)+a5_0x5108d1[_0x45b178(0xeb)](_0x3221ea));_0x349b99>0x0&&console[_0x45b178(0x11a)](_0x45b178(0xc4)+a5_0x5108d1[_0x45b178(0xeb)](_0x349b99));console[_0x45b178(0x11a)]('Duration:\x20'+formatElapsed(_0x374a88)),console[_0x45b178(0x11a)]('━'[_0x45b178(0x115)](0x3c));const _0x11022c={'summary':{'total':_0x35054e[_0x45b178(0x145)],'passed':_0x54be7b,'failed':_0x3221ea,'errors':_0x349b99>0x0?_0x349b99:undefined,'duration_ms':_0x374a88},'tests':_0x35054e,'agent':{'project':_0x587220[_0x45b178(0x119)],'name':_0x587220[_0x45b178(0xb6)],'site':_0x3c9b2f},'timestamp':new Date(_0x5d4902)[_0x45b178(0xf3)]()};if(_0x165782!==_0x45b178(0xc0)||_0x18c89a){const _0x8b3c1=formatResults(_0x11022c,_0x165782);if(_0x18c89a)try{a5_0x2f367c['writeFileSync'](_0x18c89a,_0x8b3c1,_0x45b178(0x118)),console[_0x45b178(0x11a)](),console['log'](a5_0x5108d1[_0x45b178(0x13c)]('Output\x20written\x20to:\x20'+_0x18c89a));}catch(_0x465130){return console[_0x45b178(0x11a)](),console[_0x45b178(0x11a)](a5_0x5108d1[_0x45b178(0xeb)](_0x45b178(0xb4)+_0x465130)),0x1;}else console[_0x45b178(0x11a)](),console[_0x45b178(0x11a)](_0x8b3c1);}const _0xf7be01=_0x35054e['filter'](_0x35720e=>_0x35720e['status']!==_0x45b178(0x11b));return _0xf7be01[_0x45b178(0x145)]>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0x2b7648=a5_0x53bf;function a5_0x2f49(){const _0x437bce=['Error\x20writing\x20output\x20file:\x20','Re-evaluating\x20cached\x20test\x20run...','filter','no_tests','now','repeat','Run\x20\x27tdx\x20agent\x20pull\x20','⚠\x20SKIPPED:\x20','Re-evaluating\x20','round','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','...\x20','\x20\x20-\x20','length','llmProject','resolveProjectId','stop','trim','map','New\x20tests\x20to\x20execute:\x20','basename','Output\x20written\x20to:\x20','175rjTSwd','log','toLowerCase','No\x20tests\x20found\x20matching:\x20','404','Re-evaluating...','9902cGpyyn','message','tests','tags','execute','Errors:\x20\x20\x20','\x20\x20Project:\x20','find','\x20(new)','Re-evaluation\x20Summary','white','Round\x201/','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','verbose','Project\x20path:\x20','Available\x20tags:\x20','Usage:','dim','99ZGQQFk','...','red','Evaluating\x20response...','green','5181300AwIPgk','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','Running:\x20','Running\x20test:\x20','text','✗\x20FAIL:\x20','site','Agent:\x20','Cached\x20run\x20from:\x20','10DCiHkk','Total:\x20\x20\x20\x20','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','context','size','description','reason','dryRun','json','includes','✗\x20ERROR:\x20','128vqpSEF','source','\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\x20Conversation:\x20','Test\x20','\x20-\x20','\x20(cached)','tsv','start','Failed:\x20\x20\x20','yellow','3129304yOMdaO','toISOString','multiple_agents','285691AvzKlj','Using\x20agent:\x20','FAIL','agent','eval','2491836QCnolf','projectName','Site:\x20','ERROR','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','status','3gkeXgI','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','llm','\x22:\x20','PASS','rounds','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','conversation_url','\x20\x20Round\x20','reeval','cyan','Round\x20','\x20\x20Evaluating...\x20','Run\x20tests\x20for\x20an\x20LLM\x20agent','3232175TxiQPV','✓\x20PASS:\x20','forEach','testName','writeFileSync','\x22,\x20but\x20current\x20site\x20is\x20\x22','substring','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','existsSync','utf-8','name','found','jsonl','/<agent-name>','Running\x20agent\x20tests...','Duration:\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.',':\x20Sending\x20user\x20input...','agentName','timestamp','projectDir','table','resolveAgentId','executeReeval','resolve','4595418uGzugN','agentDirs','conversations','\x27\x20to\x20create\x20the\x20folder\x20structure.','not\x20found','some','Either\x20switch\x20to\x20the\x20\x22','join','has','no_local_folder','Failed\x20Tests:','push','split','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'];a5_0x2f49=function(){return _0x437bce;};return a5_0x2f49();}(function(_0x3e6af6,_0x1c46ee){const _0x30a7f1=a5_0x53bf,_0x3a81bb=_0x3e6af6();while(!![]){try{const _0x12484f=-parseInt(_0x30a7f1(0xe1))/0x1*(parseInt(_0x30a7f1(0xe7))/0x2)+parseInt(_0x30a7f1(0x12c))/0x3*(parseInt(_0x30a7f1(0x11e))/0x4)+-parseInt(_0x30a7f1(0x13a))/0x5+-parseInt(_0x30a7f1(0xbd))/0x6+-parseInt(_0x30a7f1(0x121))/0x7*(-parseInt(_0x30a7f1(0x113))/0x8)+parseInt(_0x30a7f1(0xfe))/0x9*(-parseInt(_0x30a7f1(0x108))/0xa)+parseInt(_0x30a7f1(0xf9))/0xb*(parseInt(_0x30a7f1(0x126))/0xc);if(_0x12484f===_0x1c46ee)break;else _0x3a81bb['push'](_0x3a81bb['shift']());}catch(_0x542991){_0x3a81bb['push'](_0x3a81bb['shift']());}}}(a5_0x2f49,0x6dcd4));import*as a5_0x30c0d7 from'node:fs';import*as a5_0x1c74d5 from'node:path';import a5_0xe4a0c2 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';function a5_0x53bf(_0x4891ca,_0x95337a){_0x4891ca=_0x4891ca-0xb3;const _0x2f499a=a5_0x2f49();let _0x53bf89=_0x2f499a[_0x4891ca];return _0x53bf89;}import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x2b7648(0x145)]='agent:test';[a5_0x2b7648(0x10d)]=a5_0x2b7648(0x139);async[a5_0x2b7648(0xeb)](_0x5a3b67){const _0x79e44a=a5_0x2b7648,{options:_0x136b28,args:_0x30d3c9,tdx:_0x276dbc}=_0x5a3b67,_0x3ecd02=_0x30d3c9[0x0]||'.',_0xc8d0b2=_0x136b28[_0x79e44a(0x10f)],_0x36a74c=_0x136b28,_0x127477=_0x36a74c[_0x79e44a(0x125)]===![],_0x58e858=_0x36a74c[_0x79e44a(0x135)],_0x42803e=_0x36a74c[_0x79e44a(0x145)],_0x106fa4=_0x36a74c['tags'],_0x594840=_0x136b28['site'],_0x5eb3f0=_0x36a74c['output'];if(_0x58e858&&_0x127477)return console[_0x79e44a(0xe2)](a5_0xe4a0c2['red'](_0x79e44a(0x100))),0x1;let _0x42dee5='table';if(_0x36a74c['json'])_0x42dee5=_0x79e44a(0x110);else{if(_0x36a74c[_0x79e44a(0x147)])_0x42dee5=_0x79e44a(0x147);else{if(_0x36a74c[_0x79e44a(0x11a)])_0x42dee5=_0x79e44a(0x11a);else{if(_0x36a74c[_0x79e44a(0xb9)])_0x42dee5='table';}}}const _0x47886f=_0x36a74c[_0x79e44a(0xd9)];let _0x595fff=_0x3ecd02;const _0x4984ef=a5_0x30c0d7[_0x79e44a(0x143)](_0x3ecd02),_0x4ac0c4=_0x3ecd02==='.';if(!_0x4984ef||_0x4ac0c4){const _0x390206=resolveProjectFromContext(_0x3ecd02,_0x47886f,{'requireFile':'test.yml'});if(_0x390206[_0x79e44a(0x146)])_0x595fff=_0x390206[_0x79e44a(0xb8)],_0x390206[_0x79e44a(0x114)]===_0x79e44a(0x10b)&&console[_0x79e44a(0xe2)](a5_0xe4a0c2[_0x79e44a(0xf8)](_0x79e44a(0x122)+_0x595fff));else switch(_0x390206[_0x79e44a(0x10e)]){case'no_context':console['log'](a5_0xe4a0c2['yellow'](_0x390206[_0x79e44a(0xe8)])),console[_0x79e44a(0xe2)](),console[_0x79e44a(0xe2)](_0x79e44a(0xf7)),console['log'](_0x79e44a(0x115)),console[_0x79e44a(0xe2)]('\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x79e44a(0xe2)](),console[_0x79e44a(0xe2)](_0x79e44a(0x142));return 0x1;case _0x79e44a(0xc6):console[_0x79e44a(0xe2)](a5_0xe4a0c2[_0x79e44a(0x11d)](_0x390206['message'])),console[_0x79e44a(0xe2)](),console[_0x79e44a(0xe2)](_0x79e44a(0xd1)+_0x390206['llmProject']+_0x79e44a(0xc0));return 0x1;case _0x79e44a(0x120):{const _0x5082f3=a5_0x1c74d5[_0x79e44a(0xdf)](_0x390206[_0x79e44a(0xb8)]);console[_0x79e44a(0xe2)](a5_0xe4a0c2[_0x79e44a(0x11d)](_0x79e44a(0x141)+_0x390206[_0x79e44a(0xd9)]+'\x22:'));for(const _0x421454 of _0x390206[_0x79e44a(0xbe)]){console[_0x79e44a(0xe2)](_0x79e44a(0xd7)+_0x421454);}return console[_0x79e44a(0xe2)](),console['log'](_0x79e44a(0x10a)+_0x5082f3+_0x79e44a(0x148)),0x1;}case _0x79e44a(0xce):console[_0x79e44a(0xe2)](a5_0xe4a0c2[_0x79e44a(0x11d)](_0x79e44a(0x12a)+_0x390206['llmProject']+'\x22.')),console[_0x79e44a(0xe2)](a5_0xe4a0c2['dim'](_0x79e44a(0xf5)+_0x390206[_0x79e44a(0xb8)])),console[_0x79e44a(0xe2)](),console['log'](_0x79e44a(0x12d));return 0x1;}}const {definition:_0x2a72ec,agentInfo:_0x470878}=parseTestFile(_0x595fff);let _0x11eed5=_0x2a72ec[_0x79e44a(0xe9)];if(_0x42803e){const _0x14531a=_0x42803e['split'](',')[_0x79e44a(0xdd)](_0x5a422e=>_0x5a422e[_0x79e44a(0xdc)]());_0x11eed5=_0x2a72ec['tests']['filter'](_0x5239bc=>_0x14531a[_0x79e44a(0x111)](_0x5239bc[_0x79e44a(0x145)]));if(_0x11eed5[_0x79e44a(0xd8)]===0x0)return console[_0x79e44a(0xe2)](a5_0xe4a0c2[_0x79e44a(0x11d)](_0x79e44a(0xe4)+_0x42803e)),console['log'](a5_0xe4a0c2[_0x79e44a(0xf8)]('Available\x20tests:\x20'+_0x2a72ec[_0x79e44a(0xe9)][_0x79e44a(0xdd)](_0x48edfe=>_0x48edfe['name'])['join'](',\x20'))),0x1;}if(_0x106fa4){const _0x1b1c15=_0x106fa4[_0x79e44a(0xc9)](',')[_0x79e44a(0xdd)](_0x103995=>_0x103995[_0x79e44a(0xdc)]()[_0x79e44a(0xe3)]());_0x11eed5=_0x11eed5['filter'](_0x400dfa=>_0x400dfa['tags']?.[_0x79e44a(0xc2)](_0xd84c0b=>_0x1b1c15[_0x79e44a(0x111)](_0xd84c0b['toLowerCase']())));if(_0x11eed5[_0x79e44a(0xd8)]===0x0){console[_0x79e44a(0xe2)](a5_0xe4a0c2['yellow']('No\x20tests\x20found\x20with\x20tags:\x20'+_0x106fa4));const _0x3c1a17=new Set();return _0x2a72ec['tests'][_0x79e44a(0x13c)](_0x26be6c=>_0x26be6c[_0x79e44a(0xea)]?.[_0x79e44a(0x13c)](_0x21384f=>_0x3c1a17['add'](_0x21384f))),_0x3c1a17[_0x79e44a(0x10c)]>0x0?console[_0x79e44a(0xe2)](a5_0xe4a0c2['dim'](_0x79e44a(0xf6)+[..._0x3c1a17][_0x79e44a(0xc4)](',\x20'))):console[_0x79e44a(0xe2)](a5_0xe4a0c2[_0x79e44a(0xf8)]('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0x58e858)return this[_0x79e44a(0xbb)](_0x5a3b67,{'definition':{'tests':_0x11eed5},'agentInfo':_0x470878,'outputFormat':_0x42dee5,'outputFile':_0x5eb3f0,'testNames':_0x42803e});if(_0xc8d0b2){console[_0x79e44a(0xe2)](a5_0xe4a0c2[_0x79e44a(0x136)]('Test\x20Configuration:')),console[_0x79e44a(0xe2)]('\x20\x20Site:\x20'+a5_0xe4a0c2[_0x79e44a(0xf1)](_0x594840)),console[_0x79e44a(0xe2)](_0x79e44a(0xed)+a5_0xe4a0c2[_0x79e44a(0xf1)](_0x470878[_0x79e44a(0x127)])),console['log']('\x20\x20Agent:\x20'+a5_0xe4a0c2['white'](_0x470878['agentName'])),console['log'](),console['log']('Tests\x20found:\x20'+a5_0xe4a0c2[_0x79e44a(0xf1)](_0x11eed5[_0x79e44a(0xd8)]));for(let _0x4587aa=0x0;_0x4587aa<_0x11eed5[_0x79e44a(0xd8)];_0x4587aa++){const _0x28bea3=_0x11eed5[_0x4587aa],_0x5320db=_0x28bea3[_0x79e44a(0x131)][_0x79e44a(0xd8)]===0x1?_0x79e44a(0xd4):_0x79e44a(0x131),_0x1389cc=_0x28bea3[_0x79e44a(0xea)]?.['length']?'\x20['+_0x28bea3[_0x79e44a(0xea)]['join'](',\x20')+']':'';console['log']('\x20\x20'+(_0x4587aa+0x1)+'.\x20'+a5_0xe4a0c2['white'](_0x28bea3[_0x79e44a(0x145)])+'\x20('+_0x28bea3['rounds']['length']+'\x20'+_0x5320db+')'+a5_0xe4a0c2[_0x79e44a(0xf8)](_0x1389cc));}return 0x0;}let _0x31587b,_0x238702;try{_0x31587b=await _0x276dbc[_0x79e44a(0x12e)][_0x79e44a(0xda)](_0x470878[_0x79e44a(0x127)]);}catch(_0x29ee49){const _0x3694a4=_0x29ee49 instanceof Error?_0x29ee49[_0x79e44a(0xe8)]:String(_0x29ee49);return _0x3694a4['includes'](_0x79e44a(0xe5))||_0x3694a4[_0x79e44a(0xe3)]()[_0x79e44a(0x111)](_0x79e44a(0xc1))?console[_0x79e44a(0xe2)](a5_0xe4a0c2[_0x79e44a(0xfb)]('✗\x20ERROR:\x20Project\x20not\x20found:\x20'+_0x470878[_0x79e44a(0x127)])):console[_0x79e44a(0xe2)](a5_0xe4a0c2[_0x79e44a(0xfb)](_0x79e44a(0xca)+_0x470878[_0x79e44a(0x127)]+'\x22:\x20'+_0x3694a4)),0x1;}try{_0x238702=await _0x276dbc['llm'][_0x79e44a(0xba)](_0x470878['agentName'],_0x31587b);}catch(_0x5ea9e1){const _0x459bb0=_0x5ea9e1 instanceof Error?_0x5ea9e1[_0x79e44a(0xe8)]:String(_0x5ea9e1);return _0x459bb0[_0x79e44a(0x111)](_0x79e44a(0xe5))||_0x459bb0[_0x79e44a(0xe3)]()[_0x79e44a(0x111)](_0x79e44a(0xc1))?console['log'](a5_0xe4a0c2['red']('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x470878['agentName'])):console[_0x79e44a(0xe2)](a5_0xe4a0c2['red']('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x470878[_0x79e44a(0xb6)]+_0x79e44a(0x12f)+_0x459bb0)),0x1;}let _0x5d09de;if(!_0x127477)try{_0x5d09de=await setupEvaluatorAgent(_0x276dbc[_0x79e44a(0x12e)],_0x136b28[_0x79e44a(0xf4)]);}catch(_0x30f327){const _0x3b14cf=_0x30f327 instanceof Error?_0x30f327[_0x79e44a(0xe8)]:String(_0x30f327);return console['log'](a5_0xe4a0c2[_0x79e44a(0xfb)](_0x79e44a(0xff)+_0x3b14cf)),0x1;}console[_0x79e44a(0xe2)](a5_0xe4a0c2[_0x79e44a(0x136)](_0x79e44a(0x149))),console[_0x79e44a(0xe2)](_0x79e44a(0x128)+a5_0xe4a0c2[_0x79e44a(0xf1)](_0x594840)),console[_0x79e44a(0xe2)](_0x79e44a(0x106)+a5_0xe4a0c2[_0x79e44a(0xf1)](_0x470878['projectName']+'/'+_0x470878[_0x79e44a(0xb6)])),console[_0x79e44a(0xe2)]();const _0x27bfef=[],_0xbf0be0=[],_0x5d65b0=Date['now']();for(let _0x33f09b=0x0;_0x33f09b<_0x11eed5[_0x79e44a(0xd8)];_0x33f09b++){const _0x761f86=_0x11eed5[_0x33f09b];_0x11eed5[_0x79e44a(0xd8)]>0x1?console[_0x79e44a(0xe2)](_0x79e44a(0x117)+(_0x33f09b+0x1)+'/'+_0x11eed5[_0x79e44a(0xd8)]+':\x20'+a5_0xe4a0c2[_0x79e44a(0xf1)](_0x761f86['name'])):console[_0x79e44a(0xe2)](_0x79e44a(0x102)+a5_0xe4a0c2[_0x79e44a(0xf1)](_0x761f86[_0x79e44a(0x145)]));const _0x33b1bf=createCommandSpinner(_0x79e44a(0xf2)+_0x761f86[_0x79e44a(0x131)]['length']+_0x79e44a(0xb5));_0x33b1bf[_0x79e44a(0x11b)]();try{const {result:_0x49d519,conversation:_0x24b0ab}=await runTest(_0x276dbc['llm'],_0x761f86,{'agentId':_0x238702,'projectId':_0x31587b,'site':_0x594840,'noEval':_0x127477,'evaluatorId':_0x5d09de,'onRoundStart':(_0x2ee3c8,_0x1a4f3a)=>{const _0x345899=_0x79e44a;_0x33b1bf[_0x345899(0x103)]=_0x345899(0x137)+(_0x2ee3c8+0x1)+'/'+_0x1a4f3a+_0x345899(0xb5);},'onRoundComplete':(_0x1c25a3,_0x5ea0e1,_0x47c813)=>{const _0x244344=_0x79e44a,_0x39a0f8=formatElapsed(_0x5ea0e1);_0x47c813?console[_0x244344(0xe2)]('\x20\x20Round\x20'+(_0x1c25a3+0x1)+'/'+_0x761f86['rounds'][_0x244344(0xd8)]+_0x244344(0xd6)+a5_0xe4a0c2[_0x244344(0xfd)]('✓')+'\x20('+_0x39a0f8+')'):console[_0x244344(0xe2)](_0x244344(0x134)+(_0x1c25a3+0x1)+'/'+_0x761f86[_0x244344(0x131)][_0x244344(0xd8)]+'...\x20'+a5_0xe4a0c2[_0x244344(0xfb)]('✗'));},'onEvaluationStart':()=>{const _0x30d970=_0x79e44a;_0x33b1bf[_0x30d970(0x103)]=_0x30d970(0xfc);},'onEvaluationComplete':_0x2dca40=>{const _0x511a96=_0x79e44a,_0x31cd7a=formatElapsed(_0x2dca40);console[_0x511a96(0xe2)]('\x20\x20Evaluating...\x20'+a5_0xe4a0c2['green']('✓')+'\x20('+_0x31cd7a+')');}});_0x33b1bf[_0x79e44a(0xdb)](),_0x27bfef[_0x79e44a(0xc8)](_0x49d519),_0xbf0be0[_0x79e44a(0xc8)](_0x24b0ab);if(_0x49d519[_0x79e44a(0x12b)]===_0x79e44a(0x130))console['log'](a5_0xe4a0c2[_0x79e44a(0xfd)](_0x79e44a(0x13b)+_0x49d519[_0x79e44a(0x10e)]));else _0x49d519[_0x79e44a(0x12b)]===_0x79e44a(0x123)?console[_0x79e44a(0xe2)](a5_0xe4a0c2['red'](_0x79e44a(0x104)+_0x49d519[_0x79e44a(0x10e)])):console[_0x79e44a(0xe2)](a5_0xe4a0c2[_0x79e44a(0xfb)](_0x79e44a(0x112)+_0x49d519['reason']));_0x49d519['conversation_url']&&console[_0x79e44a(0xe2)](a5_0xe4a0c2[_0x79e44a(0xf8)]('Conversation\x20URL:\x20'+_0x49d519[_0x79e44a(0x133)])),console['log']();}catch(_0x364f7f){_0x33b1bf[_0x79e44a(0xdb)]();const _0x12fe89=_0x364f7f instanceof Error?_0x364f7f[_0x79e44a(0xe8)]:String(_0x364f7f);console[_0x79e44a(0xe2)](a5_0xe4a0c2[_0x79e44a(0xfb)](_0x79e44a(0x112)+_0x12fe89)),console[_0x79e44a(0xe2)](),_0x27bfef[_0x79e44a(0xc8)]({'name':_0x761f86[_0x79e44a(0x145)],'status':_0x79e44a(0x129),'reason':_0x12fe89,'timestamp':new Date()[_0x79e44a(0x11f)](),'duration_ms':0x0});}}const _0x4f431b=Date[_0x79e44a(0xcf)]()-_0x5d65b0,_0xdee543=_0x27bfef[_0x79e44a(0xcd)](_0x5a8b1f=>_0x5a8b1f['status']===_0x79e44a(0x130))['length'],_0x5380d1=_0x27bfef['filter'](_0x53f5a4=>_0x53f5a4['status']===_0x79e44a(0x123))[_0x79e44a(0xd8)],_0xd30b81=_0x27bfef[_0x79e44a(0xcd)](_0x3746a9=>_0x3746a9[_0x79e44a(0x12b)]===_0x79e44a(0x129))[_0x79e44a(0xd8)];console[_0x79e44a(0xe2)]('━'['repeat'](0x3c)),console[_0x79e44a(0xe2)]('Test\x20Summary'),console[_0x79e44a(0xe2)]('━'[_0x79e44a(0xd0)](0x3c)),console[_0x79e44a(0xe2)](_0x79e44a(0x109)+_0x27bfef[_0x79e44a(0xd8)]),console[_0x79e44a(0xe2)]('Passed:\x20\x20\x20'+a5_0xe4a0c2[_0x79e44a(0xfd)](_0xdee543)),console[_0x79e44a(0xe2)]('Failed:\x20\x20\x20'+a5_0xe4a0c2[_0x79e44a(0xfb)](_0x5380d1));_0xd30b81>0x0&&console['log'](_0x79e44a(0xec)+a5_0xe4a0c2['red'](_0xd30b81));console['log'](_0x79e44a(0xb3)+formatElapsed(_0x4f431b)),console[_0x79e44a(0xe2)]('━'[_0x79e44a(0xd0)](0x3c));const _0x2be722=_0x27bfef[_0x79e44a(0xcd)](_0x1f018a=>_0x1f018a[_0x79e44a(0x12b)]!==_0x79e44a(0x130));if(_0x2be722['length']>0x0){console['log'](),console[_0x79e44a(0xe2)](_0x79e44a(0xc7));for(const _0x2f5b05 of _0x2be722){const _0x22c70c=a5_0xe4a0c2[_0x79e44a(0xfb)]('✗'),_0x17028c=_0x2f5b05['reason'][_0x79e44a(0xd8)]>0x32?_0x2f5b05[_0x79e44a(0x10e)][_0x79e44a(0x140)](0x0,0x32)+_0x79e44a(0xfa):_0x2f5b05[_0x79e44a(0x10e)];console[_0x79e44a(0xe2)]('\x20\x20'+_0x22c70c+'\x20'+_0x2f5b05[_0x79e44a(0x145)]+':\x20'+_0x17028c);}}const _0x4688ae={'summary':{'total':_0x27bfef[_0x79e44a(0xd8)],'passed':_0xdee543,'failed':_0x5380d1,'errors':_0xd30b81>0x0?_0xd30b81:undefined,'duration_ms':_0x4f431b},'tests':_0x27bfef,'agent':{'project':_0x470878[_0x79e44a(0x127)],'name':_0x470878[_0x79e44a(0xb6)],'site':_0x594840},'timestamp':new Date(_0x5d65b0)['toISOString']()};try{const _0x22d3cf=buildCachedTestRun(_0xbf0be0,{'site':_0x594840,'projectId':_0x31587b,'projectName':_0x470878['projectName'],'agentId':_0x238702,'agentName':_0x470878['agentName'],'testYmlPath':a5_0x1c74d5[_0x79e44a(0xbc)](_0x470878['testYmlPath'])});saveLastTestRun(_0x22d3cf);}catch{}if(_0x42dee5!==_0x79e44a(0xb9)||_0x5eb3f0){const _0xdd3db0=formatResults(_0x4688ae,_0x42dee5);if(_0x5eb3f0)try{a5_0x30c0d7[_0x79e44a(0x13e)](_0x5eb3f0,_0xdd3db0,_0x79e44a(0x144)),console[_0x79e44a(0xe2)](),console[_0x79e44a(0xe2)](a5_0xe4a0c2['dim'](_0x79e44a(0xe0)+_0x5eb3f0));}catch(_0x5b1888){return console['log'](),console[_0x79e44a(0xe2)](a5_0xe4a0c2[_0x79e44a(0xfb)](_0x79e44a(0xcb)+_0x5b1888)),0x1;}else console['log'](),console[_0x79e44a(0xe2)](_0xdd3db0);}return _0x2be722[_0x79e44a(0xd8)]>0x0?0x1:0x0;}async[a5_0x2b7648(0xbb)](_0x384d69,_0x5eeb3f){const _0x1620d4=a5_0x2b7648,{options:_0xb41ebf,tdx:_0x38a414}=_0x384d69,{definition:_0x3e1633,agentInfo:_0x14bddc,outputFormat:_0x2616be,outputFile:_0x60a1e1}=_0x5eeb3f,_0x52a6e0=_0xb41ebf['site'],_0x50e912=loadLastTestRun();if(!_0x50e912)return console[_0x1620d4(0xe2)](a5_0xe4a0c2[_0x1620d4(0xfb)]('Error:\x20No\x20previous\x20test\x20run\x20found.')),console[_0x1620d4(0xe2)](a5_0xe4a0c2[_0x1620d4(0xf8)]('Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.')),0x1;if(_0x50e912[_0x1620d4(0x124)][_0x1620d4(0xb6)]!==_0x14bddc[_0x1620d4(0xb6)])return console['log'](a5_0xe4a0c2['red']('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x50e912[_0x1620d4(0x124)][_0x1620d4(0xb6)]+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x14bddc['agentName']+'\x22.')),console[_0x1620d4(0xe2)](a5_0xe4a0c2[_0x1620d4(0xf8)](_0x1620d4(0x132))),0x1;const _0x49e66f=new Set(_0x50e912[_0x1620d4(0xbf)]['map'](_0x3c8624=>_0x3c8624[_0x1620d4(0x13d)])),_0x1c93bb=_0x3e1633[_0x1620d4(0xe9)]['filter'](_0x15bd70=>!_0x49e66f[_0x1620d4(0xc5)](_0x15bd70[_0x1620d4(0x145)]));if(_0x1c93bb['length']>0x0&&_0x50e912[_0x1620d4(0x105)]!==_0x52a6e0)return console[_0x1620d4(0xe2)](a5_0xe4a0c2[_0x1620d4(0xfb)](_0x1620d4(0xd5))),console[_0x1620d4(0xe2)](a5_0xe4a0c2[_0x1620d4(0xf8)]('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x50e912[_0x1620d4(0x105)]+_0x1620d4(0x13f)+_0x52a6e0+'\x22.')),console['log'](a5_0xe4a0c2[_0x1620d4(0xf8)](_0x1620d4(0xc3)+_0x50e912['site']+_0x1620d4(0xb4))),0x1;const _0x3516b=_0x3e1633[_0x1620d4(0xe9)][_0x1620d4(0xcd)](_0x2f3d36=>_0x49e66f[_0x1620d4(0xc5)](_0x2f3d36['name'])),_0x7c745=_0x1c93bb;let _0x3e066f;try{_0x3e066f=await setupEvaluatorAgent(_0x38a414['llm'],_0xb41ebf[_0x1620d4(0xf4)]);}catch(_0x541b77){const _0x53056a=_0x541b77 instanceof Error?_0x541b77[_0x1620d4(0xe8)]:String(_0x541b77);return console[_0x1620d4(0xe2)](a5_0xe4a0c2['red'](_0x1620d4(0xff)+_0x53056a)),0x1;}console['log'](a5_0xe4a0c2['cyan'](_0x1620d4(0xcc))),console[_0x1620d4(0xe2)](_0x1620d4(0x107)+a5_0xe4a0c2[_0x1620d4(0xf1)](_0x50e912[_0x1620d4(0xb7)])),console['log'](_0x1620d4(0x106)+a5_0xe4a0c2[_0x1620d4(0xf1)](_0x50e912[_0x1620d4(0x124)][_0x1620d4(0x127)]+'/'+_0x50e912['agent'][_0x1620d4(0xb6)]));_0x7c745[_0x1620d4(0xd8)]>0x0&&console['log'](_0x1620d4(0xde)+a5_0xe4a0c2[_0x1620d4(0x11d)](_0x7c745[_0x1620d4(0xd8)]));console[_0x1620d4(0xe2)]();const _0x4e657f=[],_0x53067c=Date[_0x1620d4(0xcf)](),_0x1b26bc=createCommandSpinner(_0x1620d4(0xe6));if(_0x3516b['length']>0x0)try{const _0x167e21=await reevaluateFromCache(_0x38a414[_0x1620d4(0x12e)],_0x50e912,{'tests':_0x3516b},{'evaluatorId':_0x3e066f,'onTestStart':(_0x3468bb,_0xa621b4,_0x3c22b0)=>{const _0x33802d=_0x1620d4;_0x1b26bc[_0x33802d(0x103)]=_0x33802d(0xd3)+(_0xa621b4+0x1)+'/'+_0x3c22b0+':\x20'+_0x3468bb+_0x33802d(0xfa);if(!_0x1b26bc['isSpinning'])_0x1b26bc[_0x33802d(0x11b)]();},'onTestComplete':(_0x2a6bcb,_0x5aa765)=>{const _0x5eb3e8=_0x1620d4;_0x1b26bc[_0x5eb3e8(0xdb)]();if(_0x5aa765[_0x5eb3e8(0x12b)]===_0x5eb3e8(0x130))console[_0x5eb3e8(0xe2)](a5_0xe4a0c2[_0x5eb3e8(0xfd)](_0x5eb3e8(0x13b)+_0x2a6bcb)+a5_0xe4a0c2[_0x5eb3e8(0xf8)](_0x5eb3e8(0x119)));else _0x5aa765[_0x5eb3e8(0x12b)]===_0x5eb3e8(0x123)?console[_0x5eb3e8(0xe2)](a5_0xe4a0c2['red'](_0x5eb3e8(0x104)+_0x2a6bcb+'\x20-\x20'+_0x5aa765[_0x5eb3e8(0x10e)])+a5_0xe4a0c2[_0x5eb3e8(0xf8)]('\x20(cached)')):console[_0x5eb3e8(0xe2)](a5_0xe4a0c2[_0x5eb3e8(0xfb)](_0x5eb3e8(0x112)+_0x2a6bcb+_0x5eb3e8(0x118)+_0x5aa765[_0x5eb3e8(0x10e)]));_0x5aa765[_0x5eb3e8(0x133)]&&console[_0x5eb3e8(0xe2)](a5_0xe4a0c2['dim'](_0x5eb3e8(0x116)+_0x5aa765['conversation_url'])),_0x4e657f[_0x5eb3e8(0xc8)](_0x5aa765);},'onTestSkipped':(_0x2643e7,_0x4abb4e)=>{const _0x4c71c1=_0x1620d4;_0x1b26bc[_0x4c71c1(0xdb)](),console[_0x4c71c1(0xe2)](a5_0xe4a0c2[_0x4c71c1(0x11d)](_0x4c71c1(0xd2)+_0x2643e7+_0x4c71c1(0x118)+_0x4abb4e));}});for(const _0x286755 of _0x167e21){!_0x4e657f[_0x1620d4(0xee)](_0x55844f=>_0x55844f['name']===_0x286755[_0x1620d4(0x145)])&&_0x4e657f[_0x1620d4(0xc8)](_0x286755);}}catch(_0x2e7e1f){_0x1b26bc['stop']();const _0x28bafc=_0x2e7e1f instanceof Error?_0x2e7e1f[_0x1620d4(0xe8)]:String(_0x2e7e1f);return console[_0x1620d4(0xe2)](a5_0xe4a0c2[_0x1620d4(0xfb)](_0x1620d4(0xf3)+_0x28bafc)),0x1;}_0x1b26bc[_0x1620d4(0xdb)]();if(_0x7c745[_0x1620d4(0xd8)]>0x0){console[_0x1620d4(0xe2)](),console['log'](a5_0xe4a0c2[_0x1620d4(0x136)]('Executing\x20new\x20tests...'));const {projectId:_0x454bfe,agentId:_0x562d12}=_0x50e912[_0x1620d4(0x124)];for(const _0x102830 of _0x7c745){console[_0x1620d4(0xe2)](_0x1620d4(0x101)+a5_0xe4a0c2[_0x1620d4(0xf1)](_0x102830[_0x1620d4(0x145)]));const _0x3ef223=createCommandSpinner(_0x1620d4(0xf2)+_0x102830['rounds'][_0x1620d4(0xd8)]+_0x1620d4(0xb5));_0x3ef223[_0x1620d4(0x11b)]();try{const {result:_0x2de774}=await runTest(_0x38a414['llm'],_0x102830,{'agentId':_0x562d12,'projectId':_0x454bfe,'site':_0x50e912[_0x1620d4(0x105)],'noEval':![],'evaluatorId':_0x3e066f,'onRoundStart':(_0x2dcfec,_0x38005a)=>{const _0x1f0fc0=_0x1620d4;_0x3ef223['text']=_0x1f0fc0(0x137)+(_0x2dcfec+0x1)+'/'+_0x38005a+_0x1f0fc0(0xb5);},'onRoundComplete':(_0x5cc92e,_0x45fcc4,_0x51a571)=>{const _0x232b77=_0x1620d4,_0x108cff=formatElapsed(_0x45fcc4);_0x51a571?console['log'](_0x232b77(0x134)+(_0x5cc92e+0x1)+'/'+_0x102830[_0x232b77(0x131)][_0x232b77(0xd8)]+_0x232b77(0xd6)+a5_0xe4a0c2['green']('✓')+'\x20('+_0x108cff+')'):console[_0x232b77(0xe2)](_0x232b77(0x134)+(_0x5cc92e+0x1)+'/'+_0x102830[_0x232b77(0x131)][_0x232b77(0xd8)]+_0x232b77(0xd6)+a5_0xe4a0c2[_0x232b77(0xfb)]('✗'));},'onEvaluationStart':()=>{const _0x45292f=_0x1620d4;_0x3ef223[_0x45292f(0x103)]=_0x45292f(0xfc);},'onEvaluationComplete':_0x5e3820=>{const _0x54c9a1=_0x1620d4,_0x1b40a5=formatElapsed(_0x5e3820);console['log'](_0x54c9a1(0x138)+a5_0xe4a0c2[_0x54c9a1(0xfd)]('✓')+'\x20('+_0x1b40a5+')');}});_0x3ef223[_0x1620d4(0xdb)](),_0x4e657f['push'](_0x2de774);if(_0x2de774[_0x1620d4(0x12b)]===_0x1620d4(0x130))console[_0x1620d4(0xe2)](a5_0xe4a0c2[_0x1620d4(0xfd)](_0x1620d4(0x13b)+_0x2de774[_0x1620d4(0x10e)])+a5_0xe4a0c2[_0x1620d4(0xf8)](_0x1620d4(0xef)));else _0x2de774[_0x1620d4(0x12b)]===_0x1620d4(0x123)?console[_0x1620d4(0xe2)](a5_0xe4a0c2['red'](_0x1620d4(0x104)+_0x2de774[_0x1620d4(0x10e)])+a5_0xe4a0c2[_0x1620d4(0xf8)](_0x1620d4(0xef))):console[_0x1620d4(0xe2)](a5_0xe4a0c2['red']('✗\x20ERROR:\x20'+_0x2de774[_0x1620d4(0x10e)]));_0x2de774[_0x1620d4(0x133)]&&console[_0x1620d4(0xe2)](a5_0xe4a0c2['dim'](_0x1620d4(0x116)+_0x2de774['conversation_url']));}catch(_0xfbe738){_0x3ef223['stop']();const _0x29b48f=_0xfbe738 instanceof Error?_0xfbe738['message']:String(_0xfbe738);console[_0x1620d4(0xe2)](a5_0xe4a0c2[_0x1620d4(0xfb)]('✗\x20ERROR:\x20'+_0x29b48f)),_0x4e657f['push']({'name':_0x102830['name'],'status':'ERROR','reason':_0x29b48f,'timestamp':new Date()[_0x1620d4(0x11f)](),'duration_ms':0x0});}}}console['log']();const _0x401c20=Date[_0x1620d4(0xcf)]()-_0x53067c,_0x3acf97=_0x4e657f[_0x1620d4(0xcd)](_0x2f7b39=>_0x2f7b39['status']===_0x1620d4(0x130))[_0x1620d4(0xd8)],_0x1b1ae3=_0x4e657f[_0x1620d4(0xcd)](_0x14175a=>_0x14175a[_0x1620d4(0x12b)]===_0x1620d4(0x123))[_0x1620d4(0xd8)],_0x3bd56b=_0x4e657f[_0x1620d4(0xcd)](_0x377593=>_0x377593[_0x1620d4(0x12b)]==='ERROR')[_0x1620d4(0xd8)];console[_0x1620d4(0xe2)]('━'[_0x1620d4(0xd0)](0x3c)),console[_0x1620d4(0xe2)](_0x1620d4(0xf0)),console[_0x1620d4(0xe2)]('━'['repeat'](0x3c)),console['log'](_0x1620d4(0x109)+_0x4e657f[_0x1620d4(0xd8)]),console[_0x1620d4(0xe2)]('Passed:\x20\x20\x20'+a5_0xe4a0c2[_0x1620d4(0xfd)](_0x3acf97)),console[_0x1620d4(0xe2)](_0x1620d4(0x11c)+a5_0xe4a0c2[_0x1620d4(0xfb)](_0x1b1ae3));_0x3bd56b>0x0&&console['log'](_0x1620d4(0xec)+a5_0xe4a0c2[_0x1620d4(0xfb)](_0x3bd56b));console[_0x1620d4(0xe2)]('Duration:\x20'+formatElapsed(_0x401c20)),console[_0x1620d4(0xe2)]('━'[_0x1620d4(0xd0)](0x3c));const _0x2eeff1={'summary':{'total':_0x4e657f['length'],'passed':_0x3acf97,'failed':_0x1b1ae3,'errors':_0x3bd56b>0x0?_0x3bd56b:undefined,'duration_ms':_0x401c20},'tests':_0x4e657f,'agent':{'project':_0x14bddc['projectName'],'name':_0x14bddc[_0x1620d4(0xb6)],'site':_0x52a6e0},'timestamp':new Date(_0x53067c)[_0x1620d4(0x11f)]()};if(_0x2616be!==_0x1620d4(0xb9)||_0x60a1e1){const _0x1a0a11=formatResults(_0x2eeff1,_0x2616be);if(_0x60a1e1)try{a5_0x30c0d7[_0x1620d4(0x13e)](_0x60a1e1,_0x1a0a11,'utf-8'),console['log'](),console['log'](a5_0xe4a0c2[_0x1620d4(0xf8)](_0x1620d4(0xe0)+_0x60a1e1));}catch(_0x14a4a5){return console[_0x1620d4(0xe2)](),console[_0x1620d4(0xe2)](a5_0xe4a0c2[_0x1620d4(0xfb)](_0x1620d4(0xcb)+_0x14a4a5)),0x1;}else console[_0x1620d4(0xe2)](),console['log'](_0x1a0a11);}const _0x3940e2=_0x4e657f[_0x1620d4(0xcd)](_0x5e1ce6=>_0x5e1ce6[_0x1620d4(0x12b)]!=='PASS');return _0x3940e2[_0x1620d4(0xd8)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x219fe7=a6_0xce1a;(function(_0x33195e,_0x491f6){const _0x5950d6=a6_0xce1a,_0x1ca2ab=_0x33195e();while(!![]){try{const _0x47a525=parseInt(_0x5950d6(0xe0))/0x1*(parseInt(_0x5950d6(0xe4))/0x2)+-parseInt(_0x5950d6(0xe5))/0x3+-parseInt(_0x5950d6(0xd9))/0x4+-parseInt(_0x5950d6(0xf3))/0x5*(-parseInt(_0x5950d6(0x109))/0x6)+-parseInt(_0x5950d6(0x11a))/0x7+parseInt(_0x5950d6(0x112))/0x8+parseInt(_0x5950d6(0x105))/0x9*(parseInt(_0x5950d6(0xe3))/0xa);if(_0x47a525===_0x491f6)break;else _0x1ca2ab['push'](_0x1ca2ab['shift']());}catch(_0x360dc6){_0x1ca2ab['push'](_0x1ca2ab['shift']());}}}(a6_0xe878,0x92c03));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';function a6_0xce1a(_0x4abbe2,_0x3ea705){_0x4abbe2=_0x4abbe2-0xd5;const _0xe878b=a6_0xe878();let _0xce1a07=_0xe878b[_0x4abbe2];return _0xce1a07;}import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x219fe7(0xf1),a6_0x219fe7(0x108),a6_0x219fe7(0x106),a6_0x219fe7(0x11b),a6_0x219fe7(0x11f),a6_0x219fe7(0x10e),a6_0x219fe7(0xdd),a6_0x219fe7(0xe6)]);function isSensitiveHeader(_0x1bb025){const _0x1b9ba4=a6_0x219fe7;return SENSITIVE_HEADERS[_0x1b9ba4(0xf6)](_0x1bb025['toLowerCase']());}function a6_0xe878(){const _0x4fb224=['PUT','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','log','.\x20Valid\x20types:\x20','request','execute','message','llm-proxy','toUpperCase','PATCH','data','48897OEucvb','cookie','.\x20Valid\x20methods:\x20','proxy-authorization','12hEKLoR','file','body','Invalid\x20header\x20format:\x20\x22','site','x-xsrf-token','GET','\x22.\x20','type','4475496cJEWVL','output','Invalid\x20HTTP\x20method:\x20','Invalid\x20API\x20type:\x20','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','verbose','isArray','POST','7668087NNVAsA','set-cookie','name','substring','llm','set-cookie2','api','length','noColor','startsWith','995168GHXpvU','method','entries','status','x-auth-token','trim','color','1aukbfB','<\x20HTTP/1.1\x20','includes','2390FHLQcJ','1415332LbMXYt','2626488wXYMYt','x-trino-user','Error:\x20','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','cdp','Endpoint\x20must\x20start\x20with\x20/:\x20','validate','DELETE','workflow','description','headers','stack','authorization','indexOf','638075xwKVmw','readBodyFromFile','error','has','\x0aStack\x20trace:\x0a','join','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22'];a6_0xe878=function(){return _0x4fb224;};return a6_0xe878();}function parseHeader(_0x58e0f3){const _0x1a0ef9=a6_0x219fe7,_0x882301=_0x58e0f3[_0x1a0ef9(0xf2)](':');if(_0x882301===-0x1)throw new Error(_0x1a0ef9(0x10c)+_0x58e0f3+_0x1a0ef9(0x110)+_0x1a0ef9(0xf9));const _0x38c090=_0x58e0f3[_0x1a0ef9(0x11d)](0x0,_0x882301)['trim'](),_0x253fd2=_0x58e0f3[_0x1a0ef9(0x11d)](_0x882301+0x1)[_0x1a0ef9(0xde)]();if(!_0x38c090)throw new Error(_0x1a0ef9(0xfb)+_0x58e0f3+'\x22');return[_0x38c090,_0x253fd2];}export class ApiCommand extends BaseCommand{[a6_0x219fe7(0x11c)]=a6_0x219fe7(0xd5);[a6_0x219fe7(0xee)]=a6_0x219fe7(0xe8);[a6_0x219fe7(0xeb)](_0x834afa){const _0x2410a5=a6_0x219fe7,{args:_0x98ad49,options:_0xfba90b}=_0x834afa,_0x1d63ad=_0xfba90b;if(_0x98ad49[_0x2410a5(0xd6)]===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x2b5c49=_0x98ad49[0x0];if(!_0x2b5c49[_0x2410a5(0xd8)]('/'))return _0x2410a5(0xea)+_0x2b5c49;const _0x478ae3=_0x1d63ad[_0x2410a5(0x104)],_0x38d6b3=_0x1d63ad['file'];if(_0x478ae3&&_0x38d6b3)return _0x2410a5(0x116);const _0x914bcc=_0x1d63ad[_0x2410a5(0xda)]||_0x2410a5(0x10f),_0x32635b=[_0x2410a5(0x10f),_0x2410a5(0x119),_0x2410a5(0xfa),_0x2410a5(0xec),_0x2410a5(0x103)];if(!_0x32635b[_0x2410a5(0xe2)](_0x914bcc[_0x2410a5(0x102)]()))return _0x2410a5(0x114)+_0x914bcc+_0x2410a5(0x107)+_0x32635b[_0x2410a5(0xf8)](',\x20');const _0x2a77a6=_0x1d63ad['type']||'td',_0x8f54a=['td',_0x2410a5(0xe9),_0x2410a5(0xed),'trino',_0x2410a5(0x11e),_0x2410a5(0x101)];if(!_0x8f54a['includes'](_0x2a77a6))return _0x2410a5(0x115)+_0x2a77a6+_0x2410a5(0xfd)+_0x8f54a['join'](',\x20');return undefined;}async[a6_0x219fe7(0xff)](_0x1f3e55){const _0x421e9f=a6_0x219fe7,{options:_0x59bc9b,args:_0x4bcd65,tdx:_0x29a34b}=_0x1f3e55,_0x435f88=_0x59bc9b,_0xf98fcd=_0x4bcd65[0x0],_0x44278b=(_0x435f88['method']||_0x421e9f(0x10f))['toUpperCase'](),_0x39836d=_0x435f88[_0x421e9f(0x104)],_0x3a8215=_0x435f88[_0x421e9f(0x10a)],_0x624e89=_0x435f88['header'],_0x186103=_0x435f88[_0x421e9f(0x111)]||'td';try{const _0x556efc={};if(_0x624e89){const _0x385ae9=Array[_0x421e9f(0x118)](_0x624e89)?_0x624e89:[_0x624e89];for(const _0x2923f6 of _0x385ae9){const [_0x25ecd8,_0x575b62]=parseHeader(_0x2923f6);_0x556efc[_0x25ecd8]=_0x575b62;}}let _0x18192b;if(_0x39836d)_0x18192b=_0x39836d;else{if(_0x3a8215)try{_0x18192b=RawAPI[_0x421e9f(0xf4)](_0x3a8215);}catch(_0x6e1e5e){return console[_0x421e9f(0xf5)](_0x421e9f(0xe7)+(_0x6e1e5e instanceof Error?_0x6e1e5e['message']:String(_0x6e1e5e))),0x1;}}const _0x6f390b={'method':_0x44278b,'apiType':_0x186103,'includeHeaders':_0x59bc9b['verbose']};_0x18192b&&(_0x6f390b[_0x421e9f(0x10b)]=_0x18192b);Object['keys'](_0x556efc)['length']>0x0&&(_0x6f390b[_0x421e9f(0xef)]=_0x556efc);if(_0x59bc9b[_0x421e9f(0x117)]){const _0x518971=resolveSite(_0x59bc9b[_0x421e9f(0x10d)]),_0x2de27a=getEndpoint(_0x518971,_0x186103),_0x25afd0=''+_0x2de27a+_0xf98fcd;console[_0x421e9f(0xf5)]('>\x20'+_0x44278b+'\x20'+_0x25afd0);const _0x5a159d=getAuthHeaders(_0x518971),_0x217c7e={..._0x5a159d,..._0x556efc};for(const [_0xeb3a4f,_0x54c6b8]of Object[_0x421e9f(0xdb)](_0x217c7e)){!isSensitiveHeader(_0xeb3a4f)&&console[_0x421e9f(0xf5)]('>\x20'+_0xeb3a4f+':\x20'+_0x54c6b8);}_0x18192b&&console['error']('>'),console[_0x421e9f(0xf5)]('');}const _0x1a0b62=await _0x29a34b[_0x421e9f(0xd5)][_0x421e9f(0xfe)](_0xf98fcd,_0x6f390b);if(_0x59bc9b[_0x421e9f(0x117)]&&_0x1a0b62[_0x421e9f(0xef)]){console[_0x421e9f(0xf5)](_0x421e9f(0xe1)+_0x1a0b62[_0x421e9f(0xdc)]);for(const [_0x377990,_0x23f4b9]of Object[_0x421e9f(0xdb)](_0x1a0b62['headers'])){!isSensitiveHeader(_0x377990)&&console[_0x421e9f(0xf5)]('<\x20'+_0x377990+':\x20'+_0x23f4b9);}console[_0x421e9f(0xf5)]('');}const _0x1a12c1=Boolean(_0x59bc9b['output']),_0xb10970={'color':_0x59bc9b[_0x421e9f(0xdf)],'noColor':_0x59bc9b[_0x421e9f(0xd7)]||_0x1a12c1&&!_0x59bc9b[_0x421e9f(0xdf)]},_0x12fe75=colorizeJSON(_0x1a0b62[_0x421e9f(0x104)],_0xb10970);return _0x59bc9b[_0x421e9f(0x113)]?(writeFileSync(_0x59bc9b[_0x421e9f(0x113)],_0x12fe75),console[_0x421e9f(0xf5)]('Results\x20saved\x20to\x20'+_0x59bc9b['output'])):console[_0x421e9f(0xfc)](_0x12fe75),0x0;}catch(_0x18bd1d){return _0x18bd1d instanceof Error?(console[_0x421e9f(0xf5)](_0x421e9f(0xe7)+_0x18bd1d[_0x421e9f(0x100)]),_0x59bc9b[_0x421e9f(0x117)]&&_0x18bd1d[_0x421e9f(0xf0)]&&console[_0x421e9f(0xf5)](_0x421e9f(0xf7)+_0x18bd1d[_0x421e9f(0xf0)])):console[_0x421e9f(0xf5)]('Error:\x20'+String(_0x18bd1d)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a7_0x509b89=a7_0x549f;(function(_0x52b013,_0x1fcad6){const _0x1a3e7d=a7_0x549f,_0x50b837=_0x52b013();while(!![]){try{const _0xef1518=parseInt(_0x1a3e7d(0x12b))/0x1+parseInt(_0x1a3e7d(0x15d))/0x2*(-parseInt(_0x1a3e7d(0x137))/0x3)+-parseInt(_0x1a3e7d(0x111))/0x4*(-parseInt(_0x1a3e7d(0x11f))/0x5)+-parseInt(_0x1a3e7d(0x145))/0x6*(-parseInt(_0x1a3e7d(0x135))/0x7)+parseInt(_0x1a3e7d(0x13d))/0x8*(-parseInt(_0x1a3e7d(0x12f))/0x9)+parseInt(_0x1a3e7d(0x150))/0xa+-parseInt(_0x1a3e7d(0x12c))/0xb*(-parseInt(_0x1a3e7d(0x13e))/0xc);if(_0xef1518===_0x1fcad6)break;else _0x50b837['push'](_0x50b837['shift']());}catch(_0x1d4779){_0x50b837['push'](_0x50b837['shift']());}}}(a7_0x43c4,0xbc090));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';function a7_0x549f(_0x1845b0,_0x5cf19c){_0x1845b0=_0x1845b0-0x10f;const _0x43c470=a7_0x43c4();let _0x549f47=_0x43c470[_0x1845b0];return _0x549f47;}import{deleteOAuthTokens}from'../core/oauth-keychain.js';function a7_0x43c4(){const _0x33083b=['\x27\x20registered','7gzHoMB','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','423guOPhx','name','tdx:\x20auth\x20clear','email','create','select','3976hstUty','60sADiVK','logLevel','Setup\x20API\x20key\x20authentication\x20interactively','Setup\x20cancelled','Read\x20credential\x20from\x20keychain','\x0aSetup\x20cancelled','Credential\x20type:\x20OAuth','2624586MJAznr','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','✗\x20Validation\x20failed:\x20','\x20and\x20','execute','log','API\x20Key','green','yellow','oauth','apiKey','8353960xumWAQ','\x20removed\x20from\x20keychain','OAuth\x20(browser\x20login)','error','auth:setup','description','User:\x20','Remove\x20API\x20key\x20from\x20system\x20keychain','Validating\x20API\x20key...','\x20--profile\x20','warn','You\x20can\x20find\x20your\x20API\x20key\x20at:','auth','16364maTaNk','status','profile','OAuth\x20tokens','API\x20key\x20cannot\x20be\x20empty','13028SkzTBY','/app/mp/ak','API\x20key','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','first_name','No\x20credentials\x20found\x20in\x20keychain','\x20(profile:\x20','Name:\x20','✓\x20Profile\x20\x27','Read\x20credential\x20from\x20','method','bold','site','ERROR','1455EgJemZ','\x20for\x20profile:\x20','red','join','Choose\x20authentication\x20method:','trim','tdx:\x20auth\x20setup','\x20(site:\x20','message','N/A','tdx\x20profile:\x20','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','316038RpNWJP','662607NDQGos','filter','apikey','16551jBvvdn','\x20\x20tdx','✓\x20Default\x20site\x20set\x20to\x20','last_name','auth:clear'];a7_0x43c4=function(){return _0x33083b;};return a7_0x43c4();}import{clearCredentialCache}from'../core/credential-cache.js';import{isOAuthSupported}from'../core/oauth.js';import{runOAuthLoginFlow}from'./auth-login-command.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x38b3b9 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_0x3ba4c3 from'chalk';export class AuthSetupCommand extends BaseCommand{[a7_0x509b89(0x138)]=a7_0x509b89(0x154);['description']=a7_0x509b89(0x140);async[a7_0x509b89(0x149)](_0x4238d5){const _0x3baee7=a7_0x509b89,{options:_0x4af7c9}=_0x4238d5,_0x5c6f4a=_0x4af7c9[_0x3baee7(0x15f)];console['log'](a7_0x3ba4c3[_0x3baee7(0x11c)](_0x3baee7(0x125)));const _0x2418d6=_0x4af7c9[_0x3baee7(0x11d)]||'us01',_0x3fe852=await promptSiteSelection(_0x2418d6,_0x5c6f4a,_0x3baee7(0x141));if(!_0x3fe852)return 0x1;const _0x2a2de6=resolveSite(_0x3fe852);if(isOAuthSupported(_0x2a2de6)){const _0x3f1a1e=await a7_0x38b3b9({'type':_0x3baee7(0x13c),'name':_0x3baee7(0x11b),'message':_0x3baee7(0x123),'choices':[{'title':_0x3baee7(0x152),'value':_0x3baee7(0x14e)},{'title':_0x3baee7(0x14b),'value':_0x3baee7(0x12e)}]});if(!_0x3f1a1e['method'])return console[_0x3baee7(0x14a)](_0x3baee7(0x143)),0x1;if(_0x3f1a1e[_0x3baee7(0x11b)]===_0x3baee7(0x14e))return await runOAuthLoginFlow(_0x2a2de6,_0x5c6f4a,_0x4af7c9[_0x3baee7(0x13f)]??LogLevel[_0x3baee7(0x11e)]),0x0;}console[_0x3baee7(0x14a)]('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x2a2de6),console[_0x3baee7(0x14a)](_0x3baee7(0x15b)),console[_0x3baee7(0x14a)]('\x20\x20'+getConsoleUrl(_0x2a2de6,_0x3baee7(0x112)));const _0x5d4132=await a7_0x38b3b9({'type':'password','name':_0x3baee7(0x14f),'message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x561d54=>{const _0x54ff58=_0x3baee7;if(!_0x561d54||!_0x561d54[_0x54ff58(0x124)]())return _0x54ff58(0x110);return!![];}});if(!_0x5d4132[_0x3baee7(0x14f)])return console[_0x3baee7(0x14a)](_0x3baee7(0x143)),0x1;const _0x244e99=_0x5d4132['apiKey'];console[_0x3baee7(0x14a)](_0x3baee7(0x158));try{const _0xa82899=TDX[_0x3baee7(0x13b)]({'site':_0x2a2de6,'apiKey':_0x244e99['trim'](),'logLevel':_0x4af7c9[_0x3baee7(0x13f)]??LogLevel[_0x3baee7(0x11e)]}),_0x2ac3da=await _0xa82899['jobs']['getUserInfo']();console[_0x3baee7(0x14a)]('✓\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x2ac3da[_0x3baee7(0x13a)]+')');const _0x584f05=await isKeychainAvailable();_0x584f05?(await saveAPIKeyAsync(_0x244e99['trim'](),_0x2a2de6,_0x5c6f4a),console[_0x3baee7(0x14a)]('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0x5c6f4a?_0x3baee7(0x117)+_0x5c6f4a+')':''))):(console[_0x3baee7(0x15a)](a7_0x3ba4c3[_0x3baee7(0x14d)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console['warn'](a7_0x3ba4c3['yellow'](_0x3baee7(0x136))));if(_0x5c6f4a){const _0x25d684={'site':_0x2a2de6};saveProfileToUserConfig(_0x5c6f4a,_0x25d684),console[_0x3baee7(0x14a)](_0x3baee7(0x119)+_0x5c6f4a+_0x3baee7(0x134));}else saveDefaultSiteToUserConfig(_0x2a2de6),console[_0x3baee7(0x14a)](_0x3baee7(0x131)+_0x2a2de6);const _0xa6d362=_0x5c6f4a?_0x3baee7(0x159)+_0x5c6f4a:'';return console[_0x3baee7(0x14a)](),console[_0x3baee7(0x14a)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console['log'](_0x3baee7(0x130)+_0xa6d362+_0x3baee7(0x146)),console[_0x3baee7(0x14a)](_0x3baee7(0x130)+_0xa6d362+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x1daacd){if(_0x1daacd instanceof HTTPClientError&&_0x1daacd[_0x3baee7(0x15e)]===0x191)return printAuthError(_0x1daacd),0x1;return console[_0x3baee7(0x153)](a7_0x3ba4c3['red']('✗\x20Validation\x20failed:\x20'+(_0x1daacd instanceof Error?_0x1daacd[_0x3baee7(0x127)]:String(_0x1daacd)))),console[_0x3baee7(0x153)](_0x3baee7(0x12a)),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']=a7_0x509b89(0x15c);[a7_0x509b89(0x155)]=a7_0x509b89(0x114);async['execute'](_0x5668bd){const _0x10489f=a7_0x509b89,{options:_0x4cc969,tdx:_0x2495b9}=_0x5668bd,_0x72ec69=_0x4cc969[_0x10489f(0x11d)],_0x3b3af4=_0x4cc969['profile'],_0x2d42c3=_0x3b3af4?_0x3b3af4:_0x10489f(0x128);console['log'](_0x10489f(0x129)+_0x2d42c3+_0x10489f(0x126)+_0x72ec69+')');const _0x41eb13=await getOAuthTokens(_0x3b3af4);if(_0x41eb13)console['log'](_0x10489f(0x144)),console[_0x10489f(0x14a)](_0x10489f(0x142)+(_0x3b3af4?_0x10489f(0x117)+_0x3b3af4+')':''));else{const _0x53ef4f=await resolveAPIKeyAsync(_0x72ec69,_0x3b3af4);if(_0x53ef4f){const {source:_0x40c16,isDeprecated:_0x3db27c}=_0x53ef4f,_0x5b8d5e=_0x10489f(0x11a)+_0x40c16;console['log'](_0x3db27c?a7_0x3ba4c3[_0x10489f(0x14d)](_0x5b8d5e):_0x5b8d5e);}else console[_0x10489f(0x14a)](a7_0x3ba4c3[_0x10489f(0x14d)]('No\x20credential\x20found'));}try{const _0xbf3403=await _0x2495b9['jobs']['getUserInfo']();return console['log'](a7_0x3ba4c3[_0x10489f(0x14c)]('✓\x20Authentication\x20successful\x0a')),console[_0x10489f(0x14a)](_0x10489f(0x156)+_0xbf3403[_0x10489f(0x13a)]),(_0xbf3403[_0x10489f(0x115)]||_0xbf3403[_0x10489f(0x132)])&&console[_0x10489f(0x14a)](_0x10489f(0x118)+[_0xbf3403['first_name'],_0xbf3403[_0x10489f(0x132)]][_0x10489f(0x12d)](Boolean)['join']('\x20')),0x0;}catch(_0x486a2c){return _0x486a2c instanceof HTTPClientError&&_0x486a2c['status']===0x191?printAuthError(_0x486a2c,!![],_0x3b3af4):console[_0x10489f(0x153)](a7_0x3ba4c3[_0x10489f(0x121)](_0x10489f(0x147)+(_0x486a2c instanceof Error?_0x486a2c[_0x10489f(0x127)]:String(_0x486a2c)))),0x1;}}}export class AuthClearCommand extends BaseCommand{['name']=a7_0x509b89(0x133);['description']=a7_0x509b89(0x157);async[a7_0x509b89(0x149)](_0x4c72b5){const _0x1d9e0e=a7_0x509b89,{options:_0x21573b}=_0x4c72b5,_0x11ac52=_0x21573b[_0x1d9e0e(0x15f)];console['log'](a7_0x3ba4c3['bold'](_0x1d9e0e(0x139)));const _0x5ac91b=await isKeychainAvailable();if(!_0x5ac91b)return console['error'](a7_0x3ba4c3[_0x1d9e0e(0x121)]('System\x20keychain\x20is\x20not\x20available')),0x1;const [_0x402a74,_0x13fa0e]=await Promise['all']([deleteKeychainAPIKey(_0x11ac52),deleteOAuthTokens(_0x11ac52)]);if(_0x402a74||_0x13fa0e){clearCredentialCache();const _0x343751=[_0x402a74&&_0x1d9e0e(0x113),_0x13fa0e&&_0x1d9e0e(0x10f)]['filter'](Boolean)[_0x1d9e0e(0x122)](_0x1d9e0e(0x148));return console[_0x1d9e0e(0x14a)]('✓\x20'+_0x343751+_0x1d9e0e(0x151)+(_0x11ac52?_0x1d9e0e(0x117)+_0x11ac52+')':'')),0x0;}else return console['log'](_0x1d9e0e(0x116)+(_0x11ac52?_0x1d9e0e(0x120)+_0x11ac52:'')),0x1;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a8_0x2a9c(_0xb822f3,_0x3639a7){_0xb822f3=_0xb822f3-0x136;const _0x394d89=a8_0x394d();let _0x2a9cec=_0x394d89[_0xb822f3];return _0x2a9cec;}const a8_0x48d9d7=a8_0x2a9c;(function(_0x4041e7,_0x583a52){const _0x4ede3c=a8_0x2a9c,_0x3db487=_0x4041e7();while(!![]){try{const _0x320444=-parseInt(_0x4ede3c(0x157))/0x1+-parseInt(_0x4ede3c(0x137))/0x2+-parseInt(_0x4ede3c(0x151))/0x3+parseInt(_0x4ede3c(0x14c))/0x4+-parseInt(_0x4ede3c(0x155))/0x5*(parseInt(_0x4ede3c(0x15c))/0x6)+-parseInt(_0x4ede3c(0x156))/0x7*(parseInt(_0x4ede3c(0x140))/0x8)+-parseInt(_0x4ede3c(0x139))/0x9*(-parseInt(_0x4ede3c(0x13e))/0xa);if(_0x320444===_0x583a52)break;else _0x3db487['push'](_0x3db487['shift']());}catch(_0x24d18d){_0x3db487['push'](_0x3db487['shift']());}}}(a8_0x394d,0x868f9));import{BaseCommand}from'./command.js';import{resolveSite}from'../core/config.js';function a8_0x394d(){const _0xb7af7d=['Authenticating\x20via\x20OAuth\x20for\x20site:\x20','✓\x20Profile\x20\x27','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','290tVJftb','7eAIKSt','299636scbGyx','log','execute','site','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','38262ajuSnx','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','\x20(profile:\x20','1466688QSXKzV','logLevel','390078glHcSC','\x20\x20tdx','access_token','Login\x20via\x20OAuth\x20(opens\x20browser)','us01','620hMCnjR','create','1718536dCnMYL','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','/oauth/authorize','name','\x27\x20registered','Opening\x20browser\x20for\x20authentication...','OAuth\x20login\x20is\x20not\x20yet\x20available\x20for\x20site:\x20','email','Login\x20cancelled','Validating\x20OAuth\x20tokens...','jobs','getUserInfo','763580eavGZX','\x20--profile\x20','description','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','ERROR','2127825dTwlgu'];a8_0x394d=function(){return _0xb7af7d;};return a8_0x394d();}import{saveProfileToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{isKeychainAvailable}from'../core/keychain.js';import{saveOAuthTokens}from'../core/oauth-keychain.js';import{startOAuthFlow,isOAuthSupported}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a8_0x41bced from'chalk';export async function runOAuthLoginFlow(_0x15271c,_0x1687eb,_0x5842ec){const _0x57d228=a8_0x2a9c;if(!isOAuthSupported(_0x15271c))throw new Error(_0x57d228(0x146)+_0x15271c+'.\x20'+'OAuth\x20is\x20currently\x20supported\x20on\x20dev-us01\x20and\x20dev-eu01\x20only.\x20'+'Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.');const _0x4bd64b=await isKeychainAvailable();if(!_0x4bd64b)throw new Error(_0x57d228(0x141)+_0x57d228(0x15b));const _0x26c68a=getConsoleUrl(_0x15271c);console[_0x57d228(0x158)](_0x57d228(0x145)),console[_0x57d228(0x158)]('\x20\x20'+_0x26c68a+_0x57d228(0x142)),console[_0x57d228(0x158)](_0x57d228(0x14f));const _0x410fc9=await startOAuthFlow(_0x15271c);console[_0x57d228(0x158)](_0x57d228(0x149));const _0x30b3e6=TDX[_0x57d228(0x13f)]({'site':_0x15271c,'accessToken':_0x410fc9[_0x57d228(0x13b)],'logLevel':_0x5842ec??LogLevel['ERROR']}),_0x23d9b0=await _0x30b3e6[_0x57d228(0x14a)][_0x57d228(0x14b)]();console[_0x57d228(0x158)](a8_0x41bced['green']('✓\x20Authentication\x20successful\x20(User:\x20'+_0x23d9b0[_0x57d228(0x147)]+')')),await saveOAuthTokens(_0x410fc9,_0x1687eb),console[_0x57d228(0x158)](_0x57d228(0x15d)+(_0x1687eb?_0x57d228(0x136)+_0x1687eb+')':''));if(_0x1687eb){const _0x2fc337={'site':_0x15271c};saveProfileToUserConfig(_0x1687eb,_0x2fc337),console[_0x57d228(0x158)](_0x57d228(0x153)+_0x1687eb+_0x57d228(0x144));}const _0x1c2baf=_0x1687eb?_0x57d228(0x14d)+_0x1687eb:'';console[_0x57d228(0x158)](),console[_0x57d228(0x158)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console['log']('\x20\x20tdx'+_0x1c2baf+_0x57d228(0x154)),console['log'](_0x57d228(0x13a)+_0x1c2baf+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases');}export class AuthLoginCommand extends BaseCommand{[a8_0x48d9d7(0x143)]='auth:login';[a8_0x48d9d7(0x14e)]=a8_0x48d9d7(0x13c);async[a8_0x48d9d7(0x159)](_0x10ffc3){const _0xb22dbb=a8_0x48d9d7,{options:_0x459845}=_0x10ffc3,_0x15eaa5=_0x459845['profile'];console['log'](a8_0x41bced['bold']('tdx:\x20auth\x20login'));const _0x14041b=_0x459845[_0xb22dbb(0x15a)]||_0xb22dbb(0x13d),_0x4fe5df=await promptSiteSelection(_0x14041b,_0x15eaa5,_0xb22dbb(0x148));if(!_0x4fe5df)return 0x1;const _0x5d83ed=resolveSite(_0x4fe5df);return console[_0xb22dbb(0x158)](_0xb22dbb(0x152)+_0x5d83ed),await runOAuthLoginFlow(_0x5d83ed,_0x15eaa5,_0x459845[_0xb22dbb(0x138)]??LogLevel[_0xb22dbb(0x150)]),0x0;}}
|