@treasuredata/tdx 2026.3.22 → 2026.3.23
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
|
+
const a3_0x131873=a3_0x14e4;(function(_0x5f459c,_0xa7afd3){const _0x1c4cc8=a3_0x14e4,_0x332c20=_0x5f459c();while(!![]){try{const _0x3929c8=parseInt(_0x1c4cc8(0xfa))/0x1*(-parseInt(_0x1c4cc8(0xfb))/0x2)+parseInt(_0x1c4cc8(0x101))/0x3*(-parseInt(_0x1c4cc8(0xf2))/0x4)+parseInt(_0x1c4cc8(0xe4))/0x5+parseInt(_0x1c4cc8(0xe6))/0x6*(-parseInt(_0x1c4cc8(0xf3))/0x7)+-parseInt(_0x1c4cc8(0xf6))/0x8+-parseInt(_0x1c4cc8(0xee))/0x9+parseInt(_0x1c4cc8(0x102))/0xa;if(_0x3929c8===_0xa7afd3)break;else _0x332c20['push'](_0x332c20['shift']());}catch(_0x640baa){_0x332c20['push'](_0x332c20['shift']());}}}(a3_0x5e3c,0x656a0));function a3_0x5e3c(){const _0x43714d=['Resolving\x20parent\x20segment\x20\x27','\x20\x20Cause:\x20','List\x20activations\x20for\x20a\x20segment','execute','\x27...','6wDdsDi','20101630JOxWNT','Resolving\x20child\x20segment\x20\x27','Error:\x20Segment\x20name\x20is\x20required','length','cause','1456965LqBgNT','verbose','24VvLQLw','Site:\x20','Resolved\x20parent\x20ID:\x20','activations','error','listActivations','resolveSegmentId','resolveParentId','692622XhyvSc','segment','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','site','1320432GBNXWA','1158675KkkqxO','\x20activation','Error:\x20','1833616wrOayN','message','data','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','54HnCCxL','9544VzukAc'];a3_0x5e3c=function(){return _0x43714d;};return a3_0x5e3c();}import{BaseCommand}from'./command.js';function a3_0x14e4(_0x29710f,_0x42cc6d){_0x29710f=_0x29710f-0xe1;const _0x5e3cec=a3_0x5e3c();let _0x14e495=_0x5e3cec[_0x29710f];return _0x14e495;}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_0x131873(0xe9);['description']=a3_0x131873(0xfe);async[a3_0x131873(0xff)](_0x377c6e){const _0x3a3495=a3_0x131873,{options:_0x12ba48,args:_0x5a57cc,tdx:_0x58bc48}=_0x377c6e;if(_0x5a57cc[_0x3a3495(0xe2)]===0x0)return console[_0x3a3495(0xea)](_0x3a3495(0xe1)),console['error'](_0x3a3495(0xf9)),0x1;try{const {parentId:_0x3bbfd0,childId:_0x42d92f}=parseSegmentRef(_0x5a57cc[0x0]);if(!_0x42d92f)return console['error'](_0x3a3495(0xf0)),console[_0x3a3495(0xea)](_0x3a3495(0xf9)),0x1;_0x12ba48[_0x3a3495(0xe5)]&&(console['error'](_0x3a3495(0xe7)+_0x12ba48[_0x3a3495(0xf1)]),console[_0x3a3495(0xea)]('Parent\x20name:\x20'+_0x3bbfd0),console[_0x3a3495(0xea)]('Child\x20name:\x20'+_0x42d92f));const _0x5a8ab1=await withSpinner(_0x3a3495(0xfc)+_0x3bbfd0+_0x3a3495(0x100),()=>_0x58bc48[_0x3a3495(0xef)][_0x3a3495(0xed)](_0x3bbfd0),{'verbose':_0x12ba48[_0x3a3495(0xe5)]}),_0x5ddc7f=_0x5a8ab1[_0x3a3495(0xf8)];_0x12ba48[_0x3a3495(0xe5)]&&console[_0x3a3495(0xea)](_0x3a3495(0xe8)+_0x5ddc7f);const _0x264b66=await withSpinner(_0x3a3495(0x103)+_0x42d92f+'\x27...',()=>_0x58bc48[_0x3a3495(0xef)][_0x3a3495(0xec)](_0x5ddc7f,_0x42d92f),{'verbose':_0x12ba48[_0x3a3495(0xe5)]}),_0x2a2161=_0x264b66['data'];_0x12ba48[_0x3a3495(0xe5)]&&console[_0x3a3495(0xea)]('Resolved\x20child\x20ID:\x20'+_0x2a2161);const _0x1785b3=await withSpinner('Listing\x20activations\x20for\x20segment\x20\x27'+_0x42d92f+'\x27...',()=>_0x58bc48[_0x3a3495(0xef)][_0x3a3495(0xeb)](_0x5ddc7f,_0x2a2161),{'verbose':_0x12ba48['verbose']}),_0x4e4b7d=_0x1785b3[_0x3a3495(0xf8)];return console[_0x3a3495(0xea)]('✔\x20Found\x20'+_0x4e4b7d[_0x3a3495(0xe2)]+_0x3a3495(0xf4)+(_0x4e4b7d[_0x3a3495(0xe2)]!==0x1?'s':'')),await handleSDKOutput(_0x4e4b7d,_0x12ba48),0x0;}catch(_0x5efb27){if(_0x5efb27 instanceof SDKError)return console[_0x3a3495(0xea)](_0x3a3495(0xf5)+_0x5efb27[_0x3a3495(0xf7)]),_0x5efb27['cause']&&console[_0x3a3495(0xea)](_0x3a3495(0xfd)+_0x5efb27[_0x3a3495(0xe3)]),0x1;throw _0x5efb27;}}}
|
|
@@ -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_0x36616f=a4_0x1c77;(function(_0x1d9765,_0x45ba79){const _0x3796f0=a4_0x1c77,_0x3574c7=_0x1d9765();while(!![]){try{const _0xc76eb8=parseInt(_0x3796f0(0x1a1))/0x1+-parseInt(_0x3796f0(0x19a))/0x2+parseInt(_0x3796f0(0x1b1))/0x3*(parseInt(_0x3796f0(0x249))/0x4)+parseInt(_0x3796f0(0x22a))/0x5+parseInt(_0x3796f0(0x244))/0x6*(parseInt(_0x3796f0(0x1fc))/0x7)+parseInt(_0x3796f0(0x1a5))/0x8*(-parseInt(_0x3796f0(0x1d2))/0x9)+-parseInt(_0x3796f0(0x220))/0xa*(parseInt(_0x3796f0(0x1a6))/0xb);if(_0xc76eb8===_0x45ba79)break;else _0x3574c7['push'](_0x3574c7['shift']());}catch(_0x233f22){_0x3574c7['push'](_0x3574c7['shift']());}}}(a4_0x4bb9,0x8be4c));import a4_0x1f4b9a from'chalk';import a4_0x4e9b75 from'path';function a4_0x1c77(_0x127676,_0x2e3b85){_0x127676=_0x127676-0x192;const _0x4bb983=a4_0x4bb9();let _0x1c772c=_0x4bb983[_0x127676];return _0x1c772c;}import{existsSync,readFileSync}from'fs';function a4_0x4bb9(){const _0x28a309=['action','\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','integrations','unchanged','\x22:\x20','projectId','1314189FwtcIG','pushProject','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x0aError:','\x20\x20Source:\x20','No\x20tdx.json\x20found\x20in\x20','\x0aErrors\x20found:','✔\x20Context\x20set:\x20','\x20new','\x0aPull\x20summary\x20for\x20\x27','-\x20nothing\x20pushed','\x20successfully','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','outputPath','green','Cancelled','Writing\x20files...','Pushing\x20to\x20project...','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','-\x20no\x20files\x20written','hasChanges','join','description','Source:\x20','total','Would\x20clone:','profile','knowledgeBases','INVALID_ARGUMENT','log','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x20\x20Integrations:\x20','New\x20project:\x20','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','session','arg-dir','\x0aChanges\x20to\x20prompt\x20\x27','dirname','updated','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','errors','Using\x20project\x20from\x20context:\x20','77dNqINa','\x20resources\x20to\x20\x27','\x20\x20Text\x20Knowledge\x20Bases:\x20','error','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x20\x20Agents:\x20','Status:\x20','\x0aPush\x20summary\x20for\x20\x27','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','output','newProjectId','\x20\x20tdx\x20agent\x20clone\x20agents/','tdx.json','llm_project','counts','\x20files\x20to\x20','Dry\x20run\x20-\x20no\x20changes\x20made','agents','Pulling\x20agent\x20\x22','Would\x20push\x20agent:\x20','Would\x20pull\x20agent:\x20','diff','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','yellow','\x22\x20to\x20a\x20different\x20profile','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\x20\x20Knowledge\x20Bases:\x20','textKnowledgeBases','dim','\x20\x20Integration\x20\x22','no_context','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','reason','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x20errors','15410hakpKx','projectName','site','\x0aPush\x20','\x20\x20Prompt\x20\x22','\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)','message','agent:clone','\x20\x20tdx\x20agent\x20pull\x20','\x20created','3963120ZBZGWS','New\x20project\x20name\x20is\x20required','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','pushAgent','\x0aChanges\x20to\x20integration\x20\x27','Using\x20project\x20from\x20','experimentalKnowledgeBases','pullAgent','\x22...','force','Dry\x20run\x20-\x20no\x20files\x20written','agentName','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)','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','name','execute','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','red','cyan','found','\x20\x20Prompts:\x20','\x20\x20Knowledge\x20Base\x20\x22','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','\x20changed','424860eQLvBi','yes','\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','\x20updated','no_local_folder','1188dhCBKa','New\x20project\x20ID:\x20','\x20unchanged','\x20\x20Target:\x20','Analyzing\x20project\x20\x22','dryRun','repeat','sourceProjectName','cwd','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','agent','\x20--name\x20','798400GJpQRn','agent.yml','Chat:\x20','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','MISSING_ARGUMENT','utf-8','llm','649945JIGtBo','Project\x20cloned\x20with\x20errors','Errors:','push','16BKKDWY','9218URDzrM','Project\x20cloned\x20successfully','prompts','Output\x20path:\x20','<new-name>','Agent\x20','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','llmProject','Using\x20local\x20project:\x20','new','Project:\x20','3375qLyegR','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','agentId','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','created','Summary:','Agent\x20pulled\x20successfully','Cloning\x20\x22','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x20\x20Experimental\x20Artifacts:\x20','\x0a✔\x20Pulled\x20','Agent:\x20','context','\x22\x20from\x20project\x20\x22','outputDir','Using\x20project:\x20','gray','\x20=\x20','source','\x22\x20to\x20\x22','agent:pull','\x20|\x20','Using\x20context\x20project:\x20','experimentalArtifacts'];a4_0x4bb9=function(){return _0x28a309;};return a4_0x4bb9();}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(_0x3e4555){const _0x422c00=a4_0x1c77,_0xe22fa7=[];if(_0x3e4555['total']!==undefined)_0xe22fa7[_0x422c00(0x1a4)](_0x3e4555['total']+'\x20total');if(_0x3e4555[_0x422c00(0x1af)]!==undefined&&_0x3e4555[_0x422c00(0x1af)]>0x0)_0xe22fa7[_0x422c00(0x1a4)](a4_0x1f4b9a[_0x422c00(0x1e0)](_0x3e4555['new']+_0x422c00(0x1da)));if(_0x3e4555[_0x422c00(0x1b8)]!==undefined&&_0x3e4555['created']>0x0)_0xe22fa7['push'](a4_0x1f4b9a['green'](_0x3e4555[_0x422c00(0x1b8)]+_0x422c00(0x229)));if(_0x3e4555[_0x422c00(0x1f8)]!==undefined&&_0x3e4555[_0x422c00(0x1f8)]>0x0)_0xe22fa7[_0x422c00(0x1a4)](a4_0x1f4b9a[_0x422c00(0x213)](_0x3e4555['updated']+_0x422c00(0x247)));if(_0x3e4555[_0x422c00(0x1cf)]!==undefined&&_0x3e4555['unchanged']>0x0)_0xe22fa7[_0x422c00(0x1a4)](a4_0x1f4b9a[_0x422c00(0x1c4)](_0x3e4555[_0x422c00(0x1cf)]+_0x422c00(0x24b)));if(_0x3e4555[_0x422c00(0x1fa)]!==undefined&&_0x3e4555[_0x422c00(0x1fa)]>0x0)_0xe22fa7[_0x422c00(0x1a4)](a4_0x1f4b9a[_0x422c00(0x23d)](_0x3e4555[_0x422c00(0x1fa)]+_0x422c00(0x21f)));return _0xe22fa7['join'](',\x20');}function displayDiffs(_0x16f5ab,_0x3879ff,_0x3088e0,_0x2de9db,_0xddeec,_0x44c352,_0x106f78){const _0x3202bb=a4_0x1c77;for(const _0x28911d of _0x16f5ab){if(_0x28911d[_0x3202bb(0x211)]){const _0x2acd49=_0x28911d['agentName']||_0x28911d[_0x3202bb(0x239)];console[_0x3202bb(0x1ef)]('\x0aChanges\x20to\x20agent\x20\x27'+_0x2acd49+'\x27:'),console['log']('─'[_0x3202bb(0x194)](0x3c)),console['log'](_0x28911d['diff']),console[_0x3202bb(0x1ef)]('─'[_0x3202bb(0x194)](0x3c));}}for(const _0x29242e of _0x3879ff){_0x29242e[_0x3202bb(0x211)]&&(console[_0x3202bb(0x1ef)](_0x3202bb(0x22c)+_0x29242e[_0x3202bb(0x239)]+'\x27:'),console[_0x3202bb(0x1ef)]('─'[_0x3202bb(0x194)](0x3c)),console[_0x3202bb(0x1ef)](_0x29242e[_0x3202bb(0x211)]),console[_0x3202bb(0x1ef)]('─'[_0x3202bb(0x194)](0x3c)));}for(const _0x107acf of _0x3088e0){_0x107acf['diff']&&(console[_0x3202bb(0x1ef)](_0x3202bb(0x19d)+_0x107acf['name']+'\x27:'),console[_0x3202bb(0x1ef)]('─'[_0x3202bb(0x194)](0x3c)),console[_0x3202bb(0x1ef)](_0x107acf[_0x3202bb(0x211)]),console[_0x3202bb(0x1ef)]('─'[_0x3202bb(0x194)](0x3c)));}for(const _0x1a218a of _0x2de9db){_0x1a218a[_0x3202bb(0x211)]&&(console[_0x3202bb(0x1ef)](_0x3202bb(0x1f6)+_0x1a218a[_0x3202bb(0x239)]+'\x27:'),console[_0x3202bb(0x1ef)]('─'['repeat'](0x3c)),console[_0x3202bb(0x1ef)](_0x1a218a['diff']),console[_0x3202bb(0x1ef)]('─'[_0x3202bb(0x194)](0x3c)));}for(const _0x57731d of _0xddeec){_0x57731d[_0x3202bb(0x211)]&&(console[_0x3202bb(0x1ef)](_0x3202bb(0x22e)+_0x57731d[_0x3202bb(0x239)]+'\x27:'),console[_0x3202bb(0x1ef)]('─'[_0x3202bb(0x194)](0x3c)),console['log'](_0x57731d[_0x3202bb(0x211)]),console['log']('─'[_0x3202bb(0x194)](0x3c)));}for(const _0x523235 of _0x44c352){_0x523235[_0x3202bb(0x211)]&&(console[_0x3202bb(0x1ef)](_0x3202bb(0x1f3)+_0x523235['name']+'\x27:'),console[_0x3202bb(0x1ef)]('─'[_0x3202bb(0x194)](0x3c)),console['log'](_0x523235[_0x3202bb(0x211)]),console[_0x3202bb(0x1ef)]('─'[_0x3202bb(0x194)](0x3c)));}for(const _0x31f486 of _0x106f78){_0x31f486['diff']&&(console[_0x3202bb(0x1ef)](_0x3202bb(0x21e)+_0x31f486[_0x3202bb(0x239)]+'\x27:'),console[_0x3202bb(0x1ef)]('─'[_0x3202bb(0x194)](0x3c)),console['log'](_0x31f486[_0x3202bb(0x211)]),console[_0x3202bb(0x1ef)]('─'[_0x3202bb(0x194)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x36616f(0x239)]=a4_0x36616f(0x1c8);['description']='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x36616f(0x23a)](_0xcaad55){const _0x1ad9b7=a4_0x36616f,{options:_0x457e12,args:_0x579e72,tdx:_0x2df277}=_0xcaad55,_0x53bdcf=_0x579e72[0x0],_0x2ce4ca=_0x579e72[0x1],_0x474fac=_0x457e12[_0x1ad9b7(0x205)],_0x170537=_0x457e12[_0x1ad9b7(0x193)],_0x32cc9d=_0x457e12[_0x1ad9b7(0x233)],_0x1b6348=_0x457e12[_0x1ad9b7(0x245)],_0x591e5d=_0x457e12[_0x1ad9b7(0x1ad)],_0x2d1337=_0x457e12[_0x1ad9b7(0x198)];let _0x511121;if(_0x53bdcf){const _0x588254=a4_0x4e9b75[_0x1ad9b7(0x1e7)](_0x53bdcf,'tdx.json');if(existsSync(_0x588254))try{const _0x3aed0c=JSON['parse'](readFileSync(_0x588254,_0x1ad9b7(0x19f)));_0x3aed0c[_0x1ad9b7(0x209)]&&(_0x511121={'llm_project':_0x3aed0c['llm_project']});}catch{}}const _0x22b6ed=findAgentConfigPath(process[_0x1ad9b7(0x196)]());let _0x948c81;if(_0x22b6ed)try{const _0x40bdfa=JSON['parse'](readFileSync(_0x22b6ed,_0x1ad9b7(0x19f)));_0x40bdfa[_0x1ad9b7(0x209)]&&(_0x948c81={'llm_project':_0x40bdfa[_0x1ad9b7(0x209)]});}catch{}const _0x263e2a=resolveAgentPullArgs({'arg':_0x53bdcf,'agentNameArg':_0x2ce4ca,'agentFlag':_0x2d1337,'contextProject':_0x591e5d,'argDirConfig':_0x511121,'cwdConfigPath':_0x22b6ed||undefined,'cwdConfig':_0x948c81}),{projectNameOrId:_0x3c0d02,targetAgentName:_0x2ac72f,existingOutputDir:_0x43c647,source:_0xe9bb5a}=_0x263e2a;if(_0xe9bb5a===_0x1ad9b7(0x1f5))console[_0x1ad9b7(0x1ef)](a4_0x1f4b9a[_0x1ad9b7(0x218)](_0x1ad9b7(0x22f)+a4_0x4e9b75[_0x1ad9b7(0x1e7)](_0x53bdcf,_0x1ad9b7(0x208))+':\x20'+_0x3c0d02));else{if(_0xe9bb5a==='cwd-config')console[_0x1ad9b7(0x1ef)](a4_0x1f4b9a[_0x1ad9b7(0x218)](_0x1ad9b7(0x1c3)+_0x3c0d02));else _0xe9bb5a===_0x1ad9b7(0x1c0)&&console[_0x1ad9b7(0x1ef)](a4_0x1f4b9a[_0x1ad9b7(0x218)](_0x1ad9b7(0x1fb)+_0x3c0d02));}if(!_0x3c0d02)return _0x2d1337?(console[_0x1ad9b7(0x1ef)](a4_0x1f4b9a[_0x1ad9b7(0x213)](_0x1ad9b7(0x1ac))),console[_0x1ad9b7(0x1ef)](_0x1ad9b7(0x242)),console[_0x1ad9b7(0x1ef)](_0x1ad9b7(0x215))):(console[_0x1ad9b7(0x1ef)](a4_0x1f4b9a[_0x1ad9b7(0x213)](_0x1ad9b7(0x204))),console['log'](_0x1ad9b7(0x236)),console[_0x1ad9b7(0x1ef)](_0x1ad9b7(0x197)),console[_0x1ad9b7(0x1ef)](_0x1ad9b7(0x1cd)),console[_0x1ad9b7(0x1ef)](_0x1ad9b7(0x21c)),console['log'](_0x1ad9b7(0x246))),0x1;if(_0x2ac72f){const {data:_0x26bf0f}=await withSpinner(_0x1ad9b7(0x20e)+_0x2ac72f+_0x1ad9b7(0x1c1)+_0x3c0d02+_0x1ad9b7(0x232),()=>_0x2df277[_0x1ad9b7(0x1a0)][_0x1ad9b7(0x231)](_0x3c0d02,_0x2ac72f,_0x474fac,{'dryRun':_0x170537,'force':_0x32cc9d}));if(_0x170537)return console[_0x1ad9b7(0x1ef)](a4_0x1f4b9a[_0x1ad9b7(0x213)](_0x1ad9b7(0x234))),console[_0x1ad9b7(0x1ef)](_0x1ad9b7(0x210)+_0x26bf0f[_0x1ad9b7(0x235)]),console[_0x1ad9b7(0x1ef)](_0x1ad9b7(0x1a9)+_0x26bf0f[_0x1ad9b7(0x1df)]),_0x26bf0f[_0x1ad9b7(0x211)]&&(console[_0x1ad9b7(0x1ef)]('\x0aChanges:'),console[_0x1ad9b7(0x1ef)]('─'['repeat'](0x3c)),console['log'](_0x26bf0f['diff']),console[_0x1ad9b7(0x1ef)]('─'[_0x1ad9b7(0x194)](0x3c))),0x0;return console['log'](a4_0x1f4b9a[_0x1ad9b7(0x1e0)](_0x1ad9b7(0x1ba))),console[_0x1ad9b7(0x1ef)](_0x1ad9b7(0x1bf)+_0x26bf0f[_0x1ad9b7(0x235)]),console[_0x1ad9b7(0x1ef)]('Output:\x20'+_0x26bf0f['outputPath']),console[_0x1ad9b7(0x1ef)](_0x1ad9b7(0x202)+(_0x26bf0f[_0x1ad9b7(0x21b)]?a4_0x1f4b9a[_0x1ad9b7(0x1e0)]('new'):_0x26bf0f[_0x1ad9b7(0x1e6)]?a4_0x1f4b9a[_0x1ad9b7(0x213)]('updated'):a4_0x1f4b9a['gray'](_0x1ad9b7(0x1cf)))),0x0;}const _0x92f812=_0x43c647||_0x474fac,{data:_0x25221e}=await withSpinner(_0x1ad9b7(0x192)+_0x3c0d02+_0x1ad9b7(0x232),()=>_0x2df277[_0x1ad9b7(0x1a0)]['pullProject'](_0x3c0d02,_0x92f812,{'dryRun':!![]})),_0x202076=_0x25221e[_0x1ad9b7(0x20a)][_0x1ad9b7(0x20d)][_0x1ad9b7(0x1af)]+_0x25221e[_0x1ad9b7(0x20a)][_0x1ad9b7(0x1ed)][_0x1ad9b7(0x1af)]+_0x25221e['counts'][_0x1ad9b7(0x217)][_0x1ad9b7(0x1af)]+_0x25221e['counts'][_0x1ad9b7(0x1a8)][_0x1ad9b7(0x1af)]+_0x25221e[_0x1ad9b7(0x20a)][_0x1ad9b7(0x1ce)][_0x1ad9b7(0x1af)]+_0x25221e[_0x1ad9b7(0x20a)][_0x1ad9b7(0x230)][_0x1ad9b7(0x1af)]+_0x25221e[_0x1ad9b7(0x20a)][_0x1ad9b7(0x1cb)]['new'],_0x5e2d96=_0x25221e[_0x1ad9b7(0x20a)][_0x1ad9b7(0x20d)][_0x1ad9b7(0x1f8)]+_0x25221e[_0x1ad9b7(0x20a)][_0x1ad9b7(0x1ed)]['updated']+_0x25221e['counts']['textKnowledgeBases']['updated']+_0x25221e[_0x1ad9b7(0x20a)]['prompts'][_0x1ad9b7(0x1f8)]+_0x25221e[_0x1ad9b7(0x20a)][_0x1ad9b7(0x1ce)]['updated']+_0x25221e[_0x1ad9b7(0x20a)][_0x1ad9b7(0x230)][_0x1ad9b7(0x1f8)]+_0x25221e[_0x1ad9b7(0x20a)][_0x1ad9b7(0x1cb)][_0x1ad9b7(0x1f8)],_0x1e047b=_0x25221e['counts'][_0x1ad9b7(0x20d)]['unchanged']+_0x25221e[_0x1ad9b7(0x20a)]['knowledgeBases'][_0x1ad9b7(0x1cf)]+_0x25221e['counts'][_0x1ad9b7(0x217)][_0x1ad9b7(0x1cf)]+_0x25221e[_0x1ad9b7(0x20a)][_0x1ad9b7(0x1a8)]['unchanged']+_0x25221e['counts'][_0x1ad9b7(0x1ce)][_0x1ad9b7(0x1cf)]+_0x25221e[_0x1ad9b7(0x20a)][_0x1ad9b7(0x230)][_0x1ad9b7(0x1cf)]+_0x25221e[_0x1ad9b7(0x20a)][_0x1ad9b7(0x1cb)]['unchanged'];console['log'](_0x1ad9b7(0x1db)+_0x25221e['projectName']+'\x27:'),console[_0x1ad9b7(0x1ef)]('\x20\x20'+a4_0x1f4b9a['green']('+\x20'+_0x202076+_0x1ad9b7(0x1da))+_0x1ad9b7(0x1c9)+a4_0x1f4b9a[_0x1ad9b7(0x213)]('~\x20'+_0x5e2d96+'\x20changed')+_0x1ad9b7(0x1c9)+a4_0x1f4b9a[_0x1ad9b7(0x218)]('=\x20'+_0x1e047b+_0x1ad9b7(0x24b))),console[_0x1ad9b7(0x1ef)]('\x20\x20Agents:\x20'+formatCountSummary(_0x25221e[_0x1ad9b7(0x20a)][_0x1ad9b7(0x20d)])),console['log'](_0x1ad9b7(0x216)+formatCountSummary(_0x25221e['counts'][_0x1ad9b7(0x1ed)])),console[_0x1ad9b7(0x1ef)](_0x1ad9b7(0x1fe)+formatCountSummary(_0x25221e['counts']['textKnowledgeBases'])),console[_0x1ad9b7(0x1ef)](_0x1ad9b7(0x240)+formatCountSummary(_0x25221e['counts'][_0x1ad9b7(0x1a8)])),console[_0x1ad9b7(0x1ef)](_0x1ad9b7(0x1f1)+formatCountSummary(_0x25221e['counts'][_0x1ad9b7(0x1ce)]));const _0x39c85a=_0x25221e['counts'][_0x1ad9b7(0x230)]['total']>0x0||_0x25221e['counts']['experimentalArtifacts'][_0x1ad9b7(0x1ea)]>0x0;_0x39c85a&&(console['log'](_0x1ad9b7(0x23b)+formatCountSummary(_0x25221e[_0x1ad9b7(0x20a)][_0x1ad9b7(0x230)])),console[_0x1ad9b7(0x1ef)](_0x1ad9b7(0x1bd)+formatCountSummary(_0x25221e['counts'][_0x1ad9b7(0x1cb)])));console[_0x1ad9b7(0x1ef)](_0x1ad9b7(0x24c)+a4_0x1f4b9a[_0x1ad9b7(0x23e)](_0x25221e[_0x1ad9b7(0x1c2)])),displayDiffs(_0x25221e[_0x1ad9b7(0x20d)],_0x25221e[_0x1ad9b7(0x1ed)],_0x25221e['textKnowledgeBases'],_0x25221e[_0x1ad9b7(0x1a8)],_0x25221e[_0x1ad9b7(0x1ce)],_0x25221e['experimentalKnowledgeBases'],_0x25221e[_0x1ad9b7(0x1cb)]);if(_0x170537)return console[_0x1ad9b7(0x1ef)](a4_0x1f4b9a['yellow'](_0x1ad9b7(0x1b3))),0x0;if(_0x202076===0x0&&_0x5e2d96===0x0)return console[_0x1ad9b7(0x1ef)](a4_0x1f4b9a[_0x1ad9b7(0x1e0)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x25221e['projectName']},_0x457e12[_0x1ad9b7(0x1f4)]),console[_0x1ad9b7(0x1ef)](a4_0x1f4b9a[_0x1ad9b7(0x1e0)]('✔\x20Context\x20set:\x20'+a4_0x1f4b9a[_0x1ad9b7(0x218)]('llm_project')+_0x1ad9b7(0x1c5)+a4_0x1f4b9a[_0x1ad9b7(0x23e)](_0x25221e['projectName']))),0x0;if(!_0x1b6348&&!_0x32cc9d){if(!isInteractive())return console[_0x1ad9b7(0x1ff)](a4_0x1f4b9a[_0x1ad9b7(0x23d)](_0x1ad9b7(0x1d5)),_0x1ad9b7(0x23c)),console[_0x1ad9b7(0x1ff)](a4_0x1f4b9a[_0x1ad9b7(0x218)](_0x1ad9b7(0x238))),0x1;const _0x3615e0=await confirmKey('\x0aWrite\x20'+(_0x202076+_0x5e2d96)+'\x20files?');if(!_0x3615e0)return console['log'](a4_0x1f4b9a[_0x1ad9b7(0x213)](_0x1ad9b7(0x1e1)),_0x1ad9b7(0x1e5)),0x1;}const {data:_0x16251b}=await withSpinner(_0x1ad9b7(0x1e2),()=>_0x2df277['llm']['pullProject'](_0x3c0d02,_0x92f812,{'force':_0x32cc9d}));return console[_0x1ad9b7(0x1ef)](a4_0x1f4b9a['green'](_0x1ad9b7(0x1be)+(_0x202076+_0x5e2d96)+_0x1ad9b7(0x20b)+_0x16251b[_0x1ad9b7(0x1c2)])),saveSessionContext({'llm_project':_0x16251b[_0x1ad9b7(0x221)]},_0x457e12[_0x1ad9b7(0x1f4)]),console['log'](a4_0x1f4b9a['green'](_0x1ad9b7(0x1d9)+a4_0x1f4b9a[_0x1ad9b7(0x218)](_0x1ad9b7(0x209))+_0x1ad9b7(0x1c5)+a4_0x1f4b9a[_0x1ad9b7(0x23e)](_0x16251b['projectName']))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']=a4_0x36616f(0x227);['description']=a4_0x36616f(0x1b7);async[a4_0x36616f(0x23a)](_0xd9f55d){const _0x488cbd=a4_0x36616f,{options:_0x23760b,args:_0x3ed4d5,tdx:_0x7d5ec2}=_0xd9f55d,_0x53d883=_0x3ed4d5[0x0],_0x515338=_0x23760b[_0x488cbd(0x239)],_0x487d25=_0x23760b['dryRun'],_0x16cf15=_0x23760b[_0x488cbd(0x245)],_0xaaf592=_0x23760b['site'],_0x5f11d7=_0x23760b[_0x488cbd(0x1ad)];let _0x4c6a08;const _0x4c8a66=findAgentConfigPath(process[_0x488cbd(0x196)]());if(_0x53d883){const _0x42945d=a4_0x4e9b75[_0x488cbd(0x1e7)](_0x53d883,_0x488cbd(0x208));existsSync(_0x42945d)?(_0x4c6a08=_0x53d883,console[_0x488cbd(0x1ef)](a4_0x1f4b9a[_0x488cbd(0x218)]('Using\x20local\x20project:\x20'+_0x53d883))):_0x4c6a08=_0x53d883;}else{if(_0x4c8a66)_0x4c6a08=a4_0x4e9b75[_0x488cbd(0x1f7)](_0x4c8a66),console[_0x488cbd(0x1ef)](a4_0x1f4b9a[_0x488cbd(0x218)]('Using\x20current\x20project:\x20'+_0x4c6a08));else{if(_0x5f11d7){const _0xdf81e9=sanitizeForFilesystem(_0x5f11d7);let _0x5ca3c7=_0xdf81e9,_0xdc1808=a4_0x4e9b75[_0x488cbd(0x1e7)](process[_0x488cbd(0x196)](),_0x488cbd(0x20d),_0xdf81e9,_0x488cbd(0x208));if(!existsSync(_0xdc1808)){const _0x1c3deb=normalizeName(_0x5f11d7),_0x4ae1fc=a4_0x4e9b75[_0x488cbd(0x1e7)](process[_0x488cbd(0x196)](),_0x488cbd(0x20d),_0x1c3deb,_0x488cbd(0x208));existsSync(_0x4ae1fc)&&(_0x5ca3c7=_0x1c3deb,_0xdc1808=_0x4ae1fc);}if(existsSync(_0xdc1808))_0x4c6a08=a4_0x4e9b75[_0x488cbd(0x1f7)](_0xdc1808),console[_0x488cbd(0x1ef)](a4_0x1f4b9a['dim'](_0x488cbd(0x1ae)+_0x4c6a08));else{const _0x57c308=_0x23760b[_0x488cbd(0x1ec)];if(_0x57c308)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x5f11d7+_0x488cbd(0x214),undefined,{'helpText':_0x488cbd(0x237)+_0x488cbd(0x1f9)+(_0x488cbd(0x228)+_0x5f11d7+'\x0a')+(_0x488cbd(0x207)+_0x5ca3c7+_0x488cbd(0x199)+(_0x515338||_0x488cbd(0x1aa))+'\x20--profile\x20'+_0x57c308)});_0x4c6a08=_0x5f11d7,console[_0x488cbd(0x1ef)](a4_0x1f4b9a['dim'](_0x488cbd(0x1ca)+_0x5f11d7));}}}}if(!_0x4c6a08)return console[_0x488cbd(0x1ef)](a4_0x1f4b9a[_0x488cbd(0x213)](_0x488cbd(0x1b2))),console['log'](_0x488cbd(0x1b6)),console[_0x488cbd(0x1ef)](_0x488cbd(0x1d4)),console[_0x488cbd(0x1ef)](_0x488cbd(0x225)),console[_0x488cbd(0x1ef)](_0x488cbd(0x1de)),0x1;if(!_0x515338)throw new SDKError(ErrorCode[_0x488cbd(0x19e)],_0x488cbd(0x22b),undefined,{'helpText':_0x488cbd(0x1bc)});if(!_0x16cf15&&!_0x487d25){if(!isInteractive())return console['error'](a4_0x1f4b9a[_0x488cbd(0x23d)](_0x488cbd(0x1d5)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x488cbd(0x1ff)](a4_0x1f4b9a[_0x488cbd(0x218)](_0x488cbd(0x238))),0x1;const _0x436700=await confirmKey('Clone\x20\x22'+_0x4c6a08+'\x22\x20to\x20new\x20project\x20\x22'+_0x515338+'\x22?');if(!_0x436700)return console[_0x488cbd(0x1ef)](a4_0x1f4b9a[_0x488cbd(0x213)](_0x488cbd(0x1e1))),0x1;}const {data:_0x2d6a12}=await withSpinner(_0x488cbd(0x1bb)+_0x4c6a08+_0x488cbd(0x1c7)+_0x515338+_0x488cbd(0x232),()=>_0x7d5ec2[_0x488cbd(0x1a0)]['cloneProject'](_0x4c6a08,_0x515338,{'dryRun':_0x487d25}));if(_0x487d25){console[_0x488cbd(0x1ef)](a4_0x1f4b9a[_0x488cbd(0x213)](_0x488cbd(0x20c))),console[_0x488cbd(0x1ef)](_0x488cbd(0x1e9)+_0x2d6a12[_0x488cbd(0x195)]),console[_0x488cbd(0x1ef)](_0x488cbd(0x1f2)+_0x515338),console[_0x488cbd(0x1ef)](_0x488cbd(0x1eb)),console['log'](_0x488cbd(0x201)+_0x2d6a12[_0x488cbd(0x20a)][_0x488cbd(0x20d)][_0x488cbd(0x1b8)]),console[_0x488cbd(0x1ef)](_0x488cbd(0x216)+_0x2d6a12[_0x488cbd(0x20a)][_0x488cbd(0x1ed)][_0x488cbd(0x1b8)]),console[_0x488cbd(0x1ef)](_0x488cbd(0x240)+_0x2d6a12[_0x488cbd(0x20a)][_0x488cbd(0x1a8)][_0x488cbd(0x1b8)]);const _0x3f1b59=_0x2d6a12[_0x488cbd(0x20a)][_0x488cbd(0x230)][_0x488cbd(0x1b8)]>0x0||_0x2d6a12['counts']['experimentalArtifacts'][_0x488cbd(0x1b8)]>0x0;return _0x3f1b59&&(console[_0x488cbd(0x1ef)](_0x488cbd(0x23b)+_0x2d6a12[_0x488cbd(0x20a)][_0x488cbd(0x230)]['created']),console[_0x488cbd(0x1ef)](_0x488cbd(0x1bd)+_0x2d6a12['counts'][_0x488cbd(0x1cb)][_0x488cbd(0x1b8)])),0x0;}const _0x4f1f07=_0x2d6a12[_0x488cbd(0x20a)][_0x488cbd(0x20d)][_0x488cbd(0x1fa)]>0x0||_0x2d6a12[_0x488cbd(0x20a)][_0x488cbd(0x1ed)][_0x488cbd(0x1fa)]>0x0||_0x2d6a12['counts'][_0x488cbd(0x1a8)][_0x488cbd(0x1fa)]>0x0||_0x2d6a12[_0x488cbd(0x20a)][_0x488cbd(0x230)][_0x488cbd(0x1fa)]>0x0||_0x2d6a12[_0x488cbd(0x20a)]['experimentalArtifacts'][_0x488cbd(0x1fa)]>0x0;_0x4f1f07?console[_0x488cbd(0x1ef)](a4_0x1f4b9a['yellow'](_0x488cbd(0x1a2))):console[_0x488cbd(0x1ef)](a4_0x1f4b9a['green'](_0x488cbd(0x1a7)));console[_0x488cbd(0x1ef)]('Source:\x20'+_0x2d6a12[_0x488cbd(0x195)]),console[_0x488cbd(0x1ef)](_0x488cbd(0x1f2)+_0x2d6a12['newProjectName']),console[_0x488cbd(0x1ef)](_0x488cbd(0x24a)+_0x2d6a12[_0x488cbd(0x206)]),console[_0x488cbd(0x1ef)](),console['log'](_0x488cbd(0x1b9)),console[_0x488cbd(0x1ef)](_0x488cbd(0x201)+formatCountSummary(_0x2d6a12['counts'][_0x488cbd(0x20d)])),console[_0x488cbd(0x1ef)](_0x488cbd(0x216)+formatCountSummary(_0x2d6a12[_0x488cbd(0x20a)][_0x488cbd(0x1ed)])),console[_0x488cbd(0x1ef)](_0x488cbd(0x240)+formatCountSummary(_0x2d6a12['counts'][_0x488cbd(0x1a8)])),console[_0x488cbd(0x1ef)](_0x488cbd(0x1f1)+formatCountSummary(_0x2d6a12[_0x488cbd(0x20a)][_0x488cbd(0x1ce)]));const _0x355ea6=_0x2d6a12[_0x488cbd(0x20a)][_0x488cbd(0x230)][_0x488cbd(0x1b8)]>0x0||_0x2d6a12[_0x488cbd(0x20a)][_0x488cbd(0x230)][_0x488cbd(0x1f8)]>0x0||_0x2d6a12[_0x488cbd(0x20a)][_0x488cbd(0x230)][_0x488cbd(0x1cf)]>0x0||_0x2d6a12[_0x488cbd(0x20a)][_0x488cbd(0x1cb)][_0x488cbd(0x1b8)]>0x0||_0x2d6a12[_0x488cbd(0x20a)]['experimentalArtifacts'][_0x488cbd(0x1f8)]>0x0||_0x2d6a12[_0x488cbd(0x20a)][_0x488cbd(0x1cb)]['unchanged']>0x0;_0x355ea6&&(console[_0x488cbd(0x1ef)](_0x488cbd(0x23b)+formatCountSummary(_0x2d6a12[_0x488cbd(0x20a)][_0x488cbd(0x230)])),console['log'](_0x488cbd(0x1bd)+formatCountSummary(_0x2d6a12[_0x488cbd(0x20a)]['experimentalArtifacts'])));if(_0x4f1f07){console[_0x488cbd(0x1ef)](),console[_0x488cbd(0x1ef)](a4_0x1f4b9a[_0x488cbd(0x23d)](_0x488cbd(0x1a3)));for(const _0xb15bae of _0x2d6a12[_0x488cbd(0x20d)]){_0xb15bae[_0x488cbd(0x1cc)]===_0x488cbd(0x1ff)&&console[_0x488cbd(0x1ef)](a4_0x1f4b9a[_0x488cbd(0x23d)]('\x20\x20Agent\x20\x22'+_0xb15bae[_0x488cbd(0x235)]+_0x488cbd(0x1d0)+_0xb15bae[_0x488cbd(0x1ff)]));}for(const _0x29a989 of _0x2d6a12[_0x488cbd(0x1ed)]){_0x29a989[_0x488cbd(0x1cc)]===_0x488cbd(0x1ff)&&console['log'](a4_0x1f4b9a[_0x488cbd(0x23d)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x29a989[_0x488cbd(0x239)]+_0x488cbd(0x1d0)+_0x29a989['error']));}for(const _0x15b908 of _0x2d6a12['prompts']){_0x15b908[_0x488cbd(0x1cc)]==='error'&&console[_0x488cbd(0x1ef)](a4_0x1f4b9a[_0x488cbd(0x23d)](_0x488cbd(0x224)+_0x15b908[_0x488cbd(0x239)]+'\x22:\x20'+_0x15b908[_0x488cbd(0x1ff)]));}for(const _0x356246 of _0x2d6a12[_0x488cbd(0x1ce)]){_0x356246['action']==='error'&&console[_0x488cbd(0x1ef)](a4_0x1f4b9a[_0x488cbd(0x23d)](_0x488cbd(0x219)+_0x356246[_0x488cbd(0x239)]+_0x488cbd(0x1d0)+_0x356246[_0x488cbd(0x1ff)]));}for(const _0x4fdf8d of _0x2d6a12[_0x488cbd(0x230)]){_0x4fdf8d[_0x488cbd(0x1cc)]===_0x488cbd(0x1ff)&&console['log'](a4_0x1f4b9a[_0x488cbd(0x23d)]('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0x4fdf8d['name']+_0x488cbd(0x1d0)+_0x4fdf8d[_0x488cbd(0x1ff)]));}for(const _0x28c8eb of _0x2d6a12[_0x488cbd(0x1cb)]){_0x28c8eb[_0x488cbd(0x1cc)]===_0x488cbd(0x1ff)&&console[_0x488cbd(0x1ef)](a4_0x1f4b9a['red']('\x20\x20Experimental\x20Artifact\x20\x22'+_0x28c8eb[_0x488cbd(0x239)]+'\x22:\x20'+_0x28c8eb[_0x488cbd(0x1ff)]));}return 0x1;}console[_0x488cbd(0x1ef)]();const _0xe74705=getLLMProjectUrl(_0xaaf592,_0x2d6a12[_0x488cbd(0x206)]);return console[_0x488cbd(0x1ef)](_0x488cbd(0x1b0)+a4_0x1f4b9a[_0x488cbd(0x23e)](_0xe74705)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x36616f(0x239)]='agent:push';[a4_0x36616f(0x1e8)]=a4_0x36616f(0x212);async['execute'](_0x556035){const _0x49be48=a4_0x36616f,{options:_0x24ac5e,args:_0x51fee3,tdx:_0x2dd979}=_0x556035;let _0x2cb93b=_0x51fee3[0x0]||process['cwd']();const _0x3239bb=_0x24ac5e[_0x49be48(0x193)],_0x4cbee9=_0x24ac5e[_0x49be48(0x233)],_0x3f26ef=_0x24ac5e[_0x49be48(0x245)],_0x314213=_0x24ac5e[_0x49be48(0x222)],_0x1478cc=a4_0x4e9b75[_0x49be48(0x1e7)](_0x2cb93b,_0x49be48(0x19b)),_0x19adfc=existsSync(_0x1478cc);if(_0x19adfc){const {data:_0x436fa9}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x2cb93b+_0x49be48(0x232),()=>_0x2dd979[_0x49be48(0x1a0)][_0x49be48(0x22d)](_0x2cb93b,{'dryRun':_0x3239bb,'force':_0x4cbee9}));if(_0x3239bb)return console[_0x49be48(0x1ef)](a4_0x1f4b9a[_0x49be48(0x213)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x49be48(0x1ef)](_0x49be48(0x20f)+_0x436fa9[_0x49be48(0x235)]),0x0;if(_0x436fa9['action']===_0x49be48(0x1ff))return console['log'](a4_0x1f4b9a[_0x49be48(0x23d)]('Failed\x20to\x20push\x20agent:\x20'+_0x436fa9['error'])),0x1;console[_0x49be48(0x1ef)](a4_0x1f4b9a[_0x49be48(0x1e0)](_0x49be48(0x1ab)+_0x436fa9[_0x49be48(0x1cc)]+_0x49be48(0x1dd))),console[_0x49be48(0x1ef)](_0x49be48(0x1bf)+_0x436fa9[_0x49be48(0x235)]);if(_0x436fa9[_0x49be48(0x1b4)]&&_0x436fa9[_0x49be48(0x1d1)]){const _0x2bf396=getLLMAgentChatUrl(_0x314213,_0x436fa9[_0x49be48(0x1d1)],_0x436fa9[_0x49be48(0x1b4)]);console[_0x49be48(0x1ef)](_0x49be48(0x19c)+a4_0x1f4b9a[_0x49be48(0x23e)](_0x2bf396));}return 0x0;}const _0x17ab3a=_0x24ac5e['llmProject'],_0xfc2e8d=resolveProjectFromContext(_0x2cb93b,_0x17ab3a);if(_0xfc2e8d[_0x49be48(0x23f)])_0x2cb93b=_0xfc2e8d['projectDir'],_0xfc2e8d[_0x49be48(0x1c6)]===_0x49be48(0x1c0)&&console[_0x49be48(0x1ef)](a4_0x1f4b9a[_0x49be48(0x218)](_0x49be48(0x1c3)+_0x2cb93b));else{let _0x8cbfa8='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0xfc2e8d[_0x49be48(0x21d)]===_0x49be48(0x248)&&(_0x8cbfa8=_0xfc2e8d['message']+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0xfc2e8d[_0x49be48(0x1ad)]+_0x49be48(0x1f0));throw new SDKError(ErrorCode[_0x49be48(0x1ee)],_0xfc2e8d['reason']===_0x49be48(0x21a)?_0xfc2e8d[_0x49be48(0x226)]:_0x49be48(0x1d7)+_0x2cb93b,undefined,{'helpText':_0x8cbfa8});}const {data:_0x5d256e}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x2dd979['llm'][_0x49be48(0x1d3)](_0x2cb93b,{'dryRun':!![]})),_0x20568e=_0x5d256e[_0x49be48(0x20a)]['agents']['errors']>0x0;if(_0x20568e){console[_0x49be48(0x1ef)](a4_0x1f4b9a[_0x49be48(0x23d)](_0x49be48(0x1d8)));for(const _0x1bc8ab of _0x5d256e['agents']){_0x1bc8ab[_0x49be48(0x1cc)]==='error'&&console[_0x49be48(0x1ef)](a4_0x1f4b9a[_0x49be48(0x23d)]('\x20\x20Agent\x20\x22'+_0x1bc8ab[_0x49be48(0x235)]+_0x49be48(0x1d0)+_0x1bc8ab['error']));}return 0x1;}const _0xb733c0=_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x20d)]['created']+_0x5d256e[_0x49be48(0x20a)]['knowledgeBases'][_0x49be48(0x1b8)]+_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x217)][_0x49be48(0x1b8)]+_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x1a8)][_0x49be48(0x1b8)]+_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x1ce)][_0x49be48(0x1b8)]+_0x5d256e[_0x49be48(0x20a)]['experimentalKnowledgeBases'][_0x49be48(0x1b8)]+_0x5d256e[_0x49be48(0x20a)]['experimentalArtifacts']['created'],_0x3de0cc=_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x20d)][_0x49be48(0x1f8)]+_0x5d256e['counts']['knowledgeBases'][_0x49be48(0x1f8)]+_0x5d256e[_0x49be48(0x20a)]['textKnowledgeBases'][_0x49be48(0x1f8)]+_0x5d256e['counts']['prompts']['updated']+_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x1ce)]['updated']+_0x5d256e[_0x49be48(0x20a)]['experimentalKnowledgeBases'][_0x49be48(0x1f8)]+_0x5d256e[_0x49be48(0x20a)]['experimentalArtifacts']['updated'],_0x13dc63=_0x5d256e[_0x49be48(0x20a)]['agents'][_0x49be48(0x1cf)]+_0x5d256e['counts'][_0x49be48(0x1ed)][_0x49be48(0x1cf)]+_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x217)][_0x49be48(0x1cf)]+_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x1a8)][_0x49be48(0x1cf)]+_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x1ce)]['unchanged']+_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x230)]['unchanged']+_0x5d256e['counts'][_0x49be48(0x1cb)]['unchanged'];console[_0x49be48(0x1ef)](_0x49be48(0x203)+_0x5d256e['projectName']+'\x27:'),console['log']('\x20\x20'+a4_0x1f4b9a[_0x49be48(0x1e0)]('+\x20'+_0xb733c0+_0x49be48(0x1da))+_0x49be48(0x1c9)+a4_0x1f4b9a['yellow']('~\x20'+_0x3de0cc+_0x49be48(0x243))+_0x49be48(0x1c9)+a4_0x1f4b9a[_0x49be48(0x218)]('=\x20'+_0x13dc63+_0x49be48(0x24b))),console[_0x49be48(0x1ef)]('\x20\x20Agents:\x20'+formatCountSummary(_0x5d256e['counts'][_0x49be48(0x20d)])),console['log'](_0x49be48(0x216)+formatCountSummary(_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x1ed)])),console['log']('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x217)])),console[_0x49be48(0x1ef)](_0x49be48(0x240)+formatCountSummary(_0x5d256e[_0x49be48(0x20a)]['prompts'])),console[_0x49be48(0x1ef)](_0x49be48(0x1f1)+formatCountSummary(_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x1ce)]));const _0x13371d=_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x230)][_0x49be48(0x1b8)]>0x0||_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x230)][_0x49be48(0x1f8)]>0x0||_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x230)][_0x49be48(0x1cf)]>0x0||_0x5d256e['counts'][_0x49be48(0x1cb)][_0x49be48(0x1b8)]>0x0||_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x1cb)]['updated']>0x0||_0x5d256e[_0x49be48(0x20a)][_0x49be48(0x1cb)][_0x49be48(0x1cf)]>0x0;_0x13371d&&(console['log'](_0x49be48(0x23b)+formatCountSummary(_0x5d256e[_0x49be48(0x20a)]['experimentalKnowledgeBases'])),console['log'](_0x49be48(0x1bd)+formatCountSummary(_0x5d256e['counts']['experimentalArtifacts'])));console[_0x49be48(0x1ef)](_0x49be48(0x1d6)+a4_0x1f4b9a[_0x49be48(0x23e)](_0x2cb93b)),displayDiffs(_0x5d256e['agents'],_0x5d256e['knowledgeBases'],_0x5d256e[_0x49be48(0x217)],_0x5d256e[_0x49be48(0x1a8)],_0x5d256e[_0x49be48(0x1ce)],_0x5d256e[_0x49be48(0x230)],_0x5d256e[_0x49be48(0x1cb)]);if(_0x3239bb)return console[_0x49be48(0x1ef)](a4_0x1f4b9a[_0x49be48(0x213)](_0x49be48(0x1e4))),0x0;if(_0xb733c0===0x0&&_0x3de0cc===0x0){console['log'](a4_0x1f4b9a[_0x49be48(0x1e0)](_0x49be48(0x200)));const _0x85813b=getLLMProjectUrl(_0x314213,_0x5d256e[_0x49be48(0x1d1)]);return console[_0x49be48(0x1ef)](_0x49be48(0x1b0)+a4_0x1f4b9a[_0x49be48(0x23e)](_0x85813b)),0x0;}if(!_0x3f26ef&&!_0x4cbee9){if(!isInteractive())return console[_0x49be48(0x1ff)](a4_0x1f4b9a[_0x49be48(0x23d)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x49be48(0x1ff)](a4_0x1f4b9a[_0x49be48(0x218)](_0x49be48(0x238))),0x1;const _0x4b3b6a=await confirmKey(_0x49be48(0x223)+(_0xb733c0+_0x3de0cc)+'\x20resources?');if(!_0x4b3b6a)return console[_0x49be48(0x1ef)](a4_0x1f4b9a['yellow'](_0x49be48(0x1e1)),_0x49be48(0x1dc)),0x1;}const {data:_0x239723}=await withSpinner(_0x49be48(0x1e3),()=>_0x2dd979[_0x49be48(0x1a0)][_0x49be48(0x1d3)](_0x2cb93b,{'force':_0x4cbee9})),_0x103307=_0x239723[_0x49be48(0x20a)][_0x49be48(0x20d)][_0x49be48(0x1fa)]>0x0||_0x239723['counts']['knowledgeBases'][_0x49be48(0x1fa)]>0x0||_0x239723[_0x49be48(0x20a)][_0x49be48(0x217)][_0x49be48(0x1fa)]>0x0||_0x239723['counts'][_0x49be48(0x1a8)][_0x49be48(0x1fa)]>0x0;if(_0x103307){console[_0x49be48(0x1ef)](a4_0x1f4b9a[_0x49be48(0x213)]('\x0aProject\x20pushed\x20with\x20errors')),console[_0x49be48(0x1ef)](),console[_0x49be48(0x1ef)](a4_0x1f4b9a[_0x49be48(0x23d)](_0x49be48(0x1a3)));for(const _0x1bf646 of _0x239723['agents']){_0x1bf646[_0x49be48(0x1cc)]==='error'&&console[_0x49be48(0x1ef)](a4_0x1f4b9a[_0x49be48(0x23d)]('\x20\x20Agent\x20\x22'+_0x1bf646[_0x49be48(0x235)]+_0x49be48(0x1d0)+_0x1bf646[_0x49be48(0x1ff)]));}for(const _0x3e04bb of _0x239723[_0x49be48(0x1ed)]){_0x3e04bb['action']===_0x49be48(0x1ff)&&console['log'](a4_0x1f4b9a[_0x49be48(0x23d)](_0x49be48(0x241)+_0x3e04bb[_0x49be48(0x239)]+_0x49be48(0x1d0)+_0x3e04bb['error']));}for(const _0x3be7cf of _0x239723[_0x49be48(0x217)]){_0x3be7cf[_0x49be48(0x1cc)]===_0x49be48(0x1ff)&&console['log'](a4_0x1f4b9a['red'](_0x49be48(0x1b5)+_0x3be7cf[_0x49be48(0x239)]+'\x22:\x20'+_0x3be7cf[_0x49be48(0x1ff)]));}for(const _0x566369 of _0x239723[_0x49be48(0x1a8)]){_0x566369[_0x49be48(0x1cc)]===_0x49be48(0x1ff)&&console[_0x49be48(0x1ef)](a4_0x1f4b9a['red'](_0x49be48(0x224)+_0x566369[_0x49be48(0x239)]+'\x22:\x20'+_0x566369[_0x49be48(0x1ff)]));}for(const _0x39216f of _0x239723[_0x49be48(0x1ce)]){_0x39216f[_0x49be48(0x1cc)]===_0x49be48(0x1ff)&&console[_0x49be48(0x1ef)](a4_0x1f4b9a['red']('\x20\x20Integration\x20\x22'+_0x39216f[_0x49be48(0x239)]+_0x49be48(0x1d0)+_0x39216f[_0x49be48(0x1ff)]));}return 0x1;}console[_0x49be48(0x1ef)](a4_0x1f4b9a[_0x49be48(0x1e0)]('\x0a✔\x20Pushed\x20'+(_0xb733c0+_0x3de0cc)+_0x49be48(0x1fd)+_0x239723['projectName']+'\x27'));const _0x59a191=getLLMProjectUrl(_0x314213,_0x239723[_0x49be48(0x1d1)]);return console[_0x49be48(0x1ef)](_0x49be48(0x1b0)+a4_0x1f4b9a[_0x49be48(0x23e)](_0x59a191)),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
|
+
function a5_0x9b25(_0x44fe9b,_0x41c0b3){_0x44fe9b=_0x44fe9b-0xb4;const _0x916d4b=a5_0x916d();let _0x9b258f=_0x916d4b[_0x44fe9b];return _0x9b258f;}const a5_0x136a22=a5_0x9b25;(function(_0x53f7a3,_0x186737){const _0x39d408=a5_0x9b25,_0x2eaf11=_0x53f7a3();while(!![]){try{const _0x1e53df=parseInt(_0x39d408(0xcf))/0x1*(-parseInt(_0x39d408(0x135))/0x2)+-parseInt(_0x39d408(0x10d))/0x3*(parseInt(_0x39d408(0x117))/0x4)+-parseInt(_0x39d408(0x138))/0x5*(parseInt(_0x39d408(0x13b))/0x6)+parseInt(_0x39d408(0x10b))/0x7+-parseInt(_0x39d408(0x13f))/0x8*(parseInt(_0x39d408(0x101))/0x9)+parseInt(_0x39d408(0x127))/0xa+parseInt(_0x39d408(0xde))/0xb;if(_0x1e53df===_0x186737)break;else _0x2eaf11['push'](_0x2eaf11['shift']());}catch(_0x586e32){_0x2eaf11['push'](_0x2eaf11['shift']());}}}(a5_0x916d,0xc969c));import*as a5_0x184740 from'node:fs';function a5_0x916d(){const _0x20071c=['Re-evaluating...','repeat','✓\x20PASS:\x20','Either\x20switch\x20to\x20the\x20\x22','json','projectDir','log','some','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','Test\x20','size','testYmlPath','/<agent-name>','27201240cNCTwq','\x20(new)','context','source','Re-evaluation\x20Summary','New\x20tests\x20to\x20execute:\x20','Usage:','agentName','length','execute','\x22:\x20','Total:\x20\x20\x20\x20','testName','tests','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','resolveProjectId','✗\x20FAIL:\x20','writeFileSync','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','tags','conversation_url','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','table','trim','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','\x20\x20Site:\x20','Available\x20tests:\x20','reason','\x22,\x20but\x20current\x20site\x20is\x20\x22','\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path','not\x20found','Evaluating\x20response...','rounds','\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)','Cached\x20run\x20from:\x20','143073cWxFja','No\x20tests\x20found\x20with\x20tags:\x20','\x20\x20Agent:\x20','isSpinning','push','Cached\x20run\x20is\x20from\x20site\x20\x22','utf-8','no_context','reeval','agentDirs','1547553uRZSYL','name','2258103IOzmTq','basename','Error\x20writing\x20output\x20file:\x20','text','projectName','llm','message','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','\x20\x20Project:\x20','4gqbxSY','dim','site','red','status','...','stop','has','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Failed:\x20\x20\x20','FAIL','\x20\x20-\x20','start','now','timestamp','resolveAgentId','8870660IEPOPM','no_tests','agent:test','Executing\x20new\x20tests...','Test\x20Configuration:','no_local_folder',':\x20Sending\x20user\x20input...','\x20\x20Round\x20','filter','conversations','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','\x20\x20Evaluating...\x20','includes','cyan','2HyTnBF','resolve','map','5KoMXTD','404','multiple_agents','9528186oFSHtT','\x20-\x20','Output\x20written\x20to:\x20','Conversation\x20URL:\x20','192bRmLMY','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','agent','tsv','Running\x20test:\x20','ERROR','llmProject','green','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','jsonl','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','\x20\x20Conversation:\x20','found','yellow','...\x20','Run\x20\x27tdx\x20agent\x20pull\x20','split','Round\x201/','toISOString','✗\x20ERROR:\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','toLowerCase','Running:\x20','Re-evaluating\x20','Passed:\x20\x20\x20','PASS','output','Re-evaluating\x20cached\x20test\x20run...','verbose','Running\x20agent\x20tests...','Round\x20','Failed\x20Tests:','⚠\x20SKIPPED:\x20','join','existsSync','Project\x20path:\x20','find','\x20(cached)','Site:\x20','Test\x20Summary','Errors:\x20\x20\x20','Error:\x20No\x20previous\x20test\x20run\x20found.','forEach','Run\x20tests\x20for\x20an\x20LLM\x20agent','Tests\x20found:\x20','executeReeval','white','round','33737YxQDuE','substring'];a5_0x916d=function(){return _0x20071c;};return a5_0x916d();}import*as a5_0x36abb9 from'node:path';import a5_0x4942b0 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x136a22(0x10c)]=a5_0x136a22(0x129);['description']=a5_0x136a22(0xca);async[a5_0x136a22(0xe7)](_0xbf8871){const _0x4c08f7=a5_0x136a22,{options:_0x2d1174,args:_0x519464,tdx:_0x845b02}=_0xbf8871,_0x540736=_0x519464[0x0]||'.',_0x311d3a=_0x2d1174['dryRun'],_0x2a63ee=_0x2d1174,_0x4b1afe=_0x2a63ee['eval']===![],_0x291528=_0x2a63ee[_0x4c08f7(0x109)],_0x12efab=_0x2a63ee[_0x4c08f7(0x10c)],_0x4a1674=_0x2a63ee[_0x4c08f7(0xf1)],_0x40004f=_0x2d1174[_0x4c08f7(0x119)],_0x2d113b=_0x2a63ee[_0x4c08f7(0xb9)];if(_0x291528&&_0x4b1afe)return console[_0x4c08f7(0xd7)](a5_0x4942b0['red'](_0x4c08f7(0xd9))),0x1;let _0x33f8e2='table';if(_0x2a63ee['json'])_0x33f8e2=_0x4c08f7(0xd5);else{if(_0x2a63ee['jsonl'])_0x33f8e2=_0x4c08f7(0x148);else{if(_0x2a63ee[_0x4c08f7(0x142)])_0x33f8e2='tsv';else{if(_0x2a63ee[_0x4c08f7(0xf4)])_0x33f8e2=_0x4c08f7(0xf4);}}}const _0x106129=_0x2a63ee[_0x4c08f7(0x145)];let _0x42dc54=_0x540736;const _0x44200d=a5_0x184740[_0x4c08f7(0xc1)](_0x540736),_0x8fcc30=_0x540736==='.';if(!_0x44200d||_0x8fcc30){const _0x1677af=resolveProjectFromContext(_0x540736,_0x106129,{'requireFile':'test.yml'});if(_0x1677af[_0x4c08f7(0x14b)])_0x42dc54=_0x1677af[_0x4c08f7(0xd6)],_0x1677af[_0x4c08f7(0xe1)]===_0x4c08f7(0xe0)&&console[_0x4c08f7(0xd7)](a5_0x4942b0[_0x4c08f7(0x118)]('Using\x20agent:\x20'+_0x42dc54));else switch(_0x1677af[_0x4c08f7(0xf9)]){case _0x4c08f7(0x108):console[_0x4c08f7(0xd7)](a5_0x4942b0['yellow'](_0x1677af['message'])),console[_0x4c08f7(0xd7)](),console[_0x4c08f7(0xd7)](_0x4c08f7(0xe4)),console['log'](_0x4c08f7(0xfb)),console[_0x4c08f7(0xd7)](_0x4c08f7(0xff)),console[_0x4c08f7(0xd7)](),console[_0x4c08f7(0xd7)](_0x4c08f7(0x114));return 0x1;case _0x4c08f7(0x12c):console[_0x4c08f7(0xd7)](a5_0x4942b0[_0x4c08f7(0x14c)](_0x1677af[_0x4c08f7(0x113)])),console[_0x4c08f7(0xd7)](),console[_0x4c08f7(0xd7)](_0x4c08f7(0x14e)+_0x1677af['llmProject']+'\x27\x20to\x20create\x20the\x20folder\x20structure.');return 0x1;case _0x4c08f7(0x13a):{const _0x2a52df=a5_0x36abb9[_0x4c08f7(0x10e)](_0x1677af[_0x4c08f7(0xd6)]);console[_0x4c08f7(0xd7)](a5_0x4942b0[_0x4c08f7(0x14c)](_0x4c08f7(0xf6)+_0x1677af[_0x4c08f7(0x145)]+'\x22:'));for(const _0x59b1b2 of _0x1677af[_0x4c08f7(0x10a)]){console[_0x4c08f7(0xd7)](_0x4c08f7(0x122)+_0x59b1b2);}return console[_0x4c08f7(0xd7)](),console[_0x4c08f7(0xd7)](_0x4c08f7(0xec)+_0x2a52df+_0x4c08f7(0xdd)),0x1;}case _0x4c08f7(0x128):console[_0x4c08f7(0xd7)](a5_0x4942b0['yellow'](_0x4c08f7(0x147)+_0x1677af[_0x4c08f7(0x145)]+'\x22.')),console[_0x4c08f7(0xd7)](a5_0x4942b0[_0x4c08f7(0x118)](_0x4c08f7(0xc2)+_0x1677af[_0x4c08f7(0xd6)])),console[_0x4c08f7(0xd7)](),console[_0x4c08f7(0xd7)]('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0x619ba0,agentInfo:_0xe86f3a}=parseTestFile(_0x42dc54);let _0x56f1d8=_0x619ba0[_0x4c08f7(0xeb)];if(_0x12efab){const _0x1fc436=_0x12efab[_0x4c08f7(0x14f)](',')[_0x4c08f7(0x137)](_0x4af2f8=>_0x4af2f8[_0x4c08f7(0xf5)]());_0x56f1d8=_0x619ba0['tests'][_0x4c08f7(0x12f)](_0x1f5798=>_0x1fc436[_0x4c08f7(0x133)](_0x1f5798[_0x4c08f7(0x10c)]));if(_0x56f1d8['length']===0x0)return console[_0x4c08f7(0xd7)](a5_0x4942b0[_0x4c08f7(0x14c)]('No\x20tests\x20found\x20matching:\x20'+_0x12efab)),console[_0x4c08f7(0xd7)](a5_0x4942b0[_0x4c08f7(0x118)](_0x4c08f7(0xf8)+_0x619ba0[_0x4c08f7(0xeb)][_0x4c08f7(0x137)](_0x2dba1b=>_0x2dba1b[_0x4c08f7(0x10c)])[_0x4c08f7(0xc0)](',\x20'))),0x1;}if(_0x4a1674){const _0x3a7e06=_0x4a1674[_0x4c08f7(0x14f)](',')[_0x4c08f7(0x137)](_0x181715=>_0x181715[_0x4c08f7(0xf5)]()[_0x4c08f7(0xb4)]());_0x56f1d8=_0x56f1d8['filter'](_0x24f786=>_0x24f786['tags']?.[_0x4c08f7(0xd8)](_0xa6ce0c=>_0x3a7e06[_0x4c08f7(0x133)](_0xa6ce0c[_0x4c08f7(0xb4)]())));if(_0x56f1d8['length']===0x0){console['log'](a5_0x4942b0[_0x4c08f7(0x14c)](_0x4c08f7(0x102)+_0x4a1674));const _0x5b61bb=new Set();return _0x619ba0[_0x4c08f7(0xeb)]['forEach'](_0x185c9f=>_0x185c9f[_0x4c08f7(0xf1)]?.[_0x4c08f7(0xc9)](_0xc04c6f=>_0x5b61bb['add'](_0xc04c6f))),_0x5b61bb[_0x4c08f7(0xdb)]>0x0?console[_0x4c08f7(0xd7)](a5_0x4942b0['dim']('Available\x20tags:\x20'+[..._0x5b61bb]['join'](',\x20'))):console[_0x4c08f7(0xd7)](a5_0x4942b0['dim']('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0x291528)return this[_0x4c08f7(0xcc)](_0xbf8871,{'definition':{'tests':_0x56f1d8},'agentInfo':_0xe86f3a,'outputFormat':_0x33f8e2,'outputFile':_0x2d113b,'testNames':_0x12efab});if(_0x311d3a){console['log'](a5_0x4942b0[_0x4c08f7(0x134)](_0x4c08f7(0x12b))),console[_0x4c08f7(0xd7)](_0x4c08f7(0xf7)+a5_0x4942b0[_0x4c08f7(0xcd)](_0x40004f)),console['log'](_0x4c08f7(0x116)+a5_0x4942b0[_0x4c08f7(0xcd)](_0xe86f3a[_0x4c08f7(0x111)])),console['log'](_0x4c08f7(0x103)+a5_0x4942b0[_0x4c08f7(0xcd)](_0xe86f3a[_0x4c08f7(0xe5)])),console[_0x4c08f7(0xd7)](),console[_0x4c08f7(0xd7)](_0x4c08f7(0xcb)+a5_0x4942b0['white'](_0x56f1d8['length']));for(let _0x3931df=0x0;_0x3931df<_0x56f1d8[_0x4c08f7(0xe6)];_0x3931df++){const _0x22e2c9=_0x56f1d8[_0x3931df],_0x5df6b3=_0x22e2c9[_0x4c08f7(0xfe)][_0x4c08f7(0xe6)]===0x1?_0x4c08f7(0xce):'rounds',_0x3871a7=_0x22e2c9[_0x4c08f7(0xf1)]?.[_0x4c08f7(0xe6)]?'\x20['+_0x22e2c9['tags'][_0x4c08f7(0xc0)](',\x20')+']':'';console[_0x4c08f7(0xd7)]('\x20\x20'+(_0x3931df+0x1)+'.\x20'+a5_0x4942b0[_0x4c08f7(0xcd)](_0x22e2c9[_0x4c08f7(0x10c)])+'\x20('+_0x22e2c9['rounds'][_0x4c08f7(0xe6)]+'\x20'+_0x5df6b3+')'+a5_0x4942b0['dim'](_0x3871a7));}return 0x0;}let _0xde2d0e,_0x364e4b;try{_0xde2d0e=await _0x845b02[_0x4c08f7(0x112)][_0x4c08f7(0xed)](_0xe86f3a[_0x4c08f7(0x111)]);}catch(_0x8659fc){const _0x3b3d9f=_0x8659fc instanceof Error?_0x8659fc[_0x4c08f7(0x113)]:String(_0x8659fc);return _0x3b3d9f['includes'](_0x4c08f7(0x139))||_0x3b3d9f[_0x4c08f7(0xb4)]()['includes'](_0x4c08f7(0xfc))?console[_0x4c08f7(0xd7)](a5_0x4942b0[_0x4c08f7(0x11a)]('✗\x20ERROR:\x20Project\x20not\x20found:\x20'+_0xe86f3a[_0x4c08f7(0x111)])):console[_0x4c08f7(0xd7)](a5_0x4942b0[_0x4c08f7(0x11a)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0xe86f3a[_0x4c08f7(0x111)]+_0x4c08f7(0xe8)+_0x3b3d9f)),0x1;}try{_0x364e4b=await _0x845b02[_0x4c08f7(0x112)][_0x4c08f7(0x126)](_0xe86f3a[_0x4c08f7(0xe5)],_0xde2d0e);}catch(_0x55ba94){const _0x4482fc=_0x55ba94 instanceof Error?_0x55ba94[_0x4c08f7(0x113)]:String(_0x55ba94);return _0x4482fc['includes']('404')||_0x4482fc[_0x4c08f7(0xb4)]()[_0x4c08f7(0x133)](_0x4c08f7(0xfc))?console[_0x4c08f7(0xd7)](a5_0x4942b0[_0x4c08f7(0x11a)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0xe86f3a['agentName'])):console[_0x4c08f7(0xd7)](a5_0x4942b0['red'](_0x4c08f7(0x149)+_0xe86f3a[_0x4c08f7(0xe5)]+_0x4c08f7(0xe8)+_0x4482fc)),0x1;}let _0x574d93;if(!_0x4b1afe)try{_0x574d93=await setupEvaluatorAgent(_0x845b02['llm'],_0x2d1174[_0x4c08f7(0xbb)]);}catch(_0x34a47c){const _0x5b5527=_0x34a47c instanceof Error?_0x34a47c[_0x4c08f7(0x113)]:String(_0x34a47c);return console[_0x4c08f7(0xd7)](a5_0x4942b0[_0x4c08f7(0x11a)](_0x4c08f7(0x153)+_0x5b5527)),0x1;}console[_0x4c08f7(0xd7)](a5_0x4942b0[_0x4c08f7(0x134)](_0x4c08f7(0xbc))),console['log'](_0x4c08f7(0xc5)+a5_0x4942b0[_0x4c08f7(0xcd)](_0x40004f)),console['log']('Agent:\x20'+a5_0x4942b0['white'](_0xe86f3a[_0x4c08f7(0x111)]+'/'+_0xe86f3a['agentName'])),console[_0x4c08f7(0xd7)]();const _0x1f0f59=[],_0x36fbd0=[],_0x385e32=Date['now']();for(let _0x4327c5=0x0;_0x4327c5<_0x56f1d8[_0x4c08f7(0xe6)];_0x4327c5++){const _0x23eaca=_0x56f1d8[_0x4327c5];_0x56f1d8[_0x4c08f7(0xe6)]>0x1?console[_0x4c08f7(0xd7)](_0x4c08f7(0xda)+(_0x4327c5+0x1)+'/'+_0x56f1d8[_0x4c08f7(0xe6)]+':\x20'+a5_0x4942b0[_0x4c08f7(0xcd)](_0x23eaca[_0x4c08f7(0x10c)])):console[_0x4c08f7(0xd7)](_0x4c08f7(0x143)+a5_0x4942b0[_0x4c08f7(0xcd)](_0x23eaca[_0x4c08f7(0x10c)]));const _0x482118=createCommandSpinner(_0x4c08f7(0x150)+_0x23eaca[_0x4c08f7(0xfe)][_0x4c08f7(0xe6)]+_0x4c08f7(0x12d));_0x482118[_0x4c08f7(0x123)]();try{const {result:_0x4afb3a,conversation:_0xa13b16}=await runTest(_0x845b02[_0x4c08f7(0x112)],_0x23eaca,{'agentId':_0x364e4b,'projectId':_0xde2d0e,'site':_0x40004f,'noEval':_0x4b1afe,'evaluatorId':_0x574d93,'onRoundStart':(_0x1c2a6f,_0x4b3744)=>{const _0x3e5916=_0x4c08f7;_0x482118[_0x3e5916(0x110)]=_0x3e5916(0xbd)+(_0x1c2a6f+0x1)+'/'+_0x4b3744+_0x3e5916(0x12d);},'onRoundComplete':(_0x5100c2,_0x59059d,_0x1e2a7d)=>{const _0x4a0bda=_0x4c08f7,_0x2b8fe4=formatElapsed(_0x59059d);_0x1e2a7d?console[_0x4a0bda(0xd7)](_0x4a0bda(0x12e)+(_0x5100c2+0x1)+'/'+_0x23eaca[_0x4a0bda(0xfe)]['length']+_0x4a0bda(0x14d)+a5_0x4942b0[_0x4a0bda(0x146)]('✓')+'\x20('+_0x2b8fe4+')'):console['log'](_0x4a0bda(0x12e)+(_0x5100c2+0x1)+'/'+_0x23eaca[_0x4a0bda(0xfe)]['length']+_0x4a0bda(0x14d)+a5_0x4942b0['red']('✗'));},'onEvaluationStart':()=>{const _0x10e1ee=_0x4c08f7;_0x482118[_0x10e1ee(0x110)]=_0x10e1ee(0xfd);},'onEvaluationComplete':_0x432859=>{const _0x283d6c=_0x4c08f7,_0x1c7ba4=formatElapsed(_0x432859);console[_0x283d6c(0xd7)](_0x283d6c(0x132)+a5_0x4942b0[_0x283d6c(0x146)]('✓')+'\x20('+_0x1c7ba4+')');}});_0x482118[_0x4c08f7(0x11d)](),_0x1f0f59['push'](_0x4afb3a),_0x36fbd0['push'](_0xa13b16);if(_0x4afb3a[_0x4c08f7(0x11b)]==='PASS')console[_0x4c08f7(0xd7)](a5_0x4942b0['green']('✓\x20PASS:\x20'+_0x4afb3a['reason']));else _0x4afb3a[_0x4c08f7(0x11b)]==='FAIL'?console[_0x4c08f7(0xd7)](a5_0x4942b0[_0x4c08f7(0x11a)](_0x4c08f7(0xee)+_0x4afb3a[_0x4c08f7(0xf9)])):console['log'](a5_0x4942b0[_0x4c08f7(0x11a)](_0x4c08f7(0x152)+_0x4afb3a['reason']));_0x4afb3a[_0x4c08f7(0xf2)]&&console[_0x4c08f7(0xd7)](a5_0x4942b0[_0x4c08f7(0x118)](_0x4c08f7(0x13e)+_0x4afb3a[_0x4c08f7(0xf2)])),console[_0x4c08f7(0xd7)]();}catch(_0x4c7e70){_0x482118[_0x4c08f7(0x11d)]();const _0x1b4bd3=_0x4c7e70 instanceof Error?_0x4c7e70[_0x4c08f7(0x113)]:String(_0x4c7e70);console[_0x4c08f7(0xd7)](a5_0x4942b0[_0x4c08f7(0x11a)]('✗\x20ERROR:\x20'+_0x1b4bd3)),console[_0x4c08f7(0xd7)](),_0x1f0f59[_0x4c08f7(0x105)]({'name':_0x23eaca['name'],'status':_0x4c08f7(0x144),'reason':_0x1b4bd3,'timestamp':new Date()[_0x4c08f7(0x151)](),'duration_ms':0x0});}}const _0x702a3b=Date[_0x4c08f7(0x124)]()-_0x385e32,_0x54f01f=_0x1f0f59[_0x4c08f7(0x12f)](_0xb15b7a=>_0xb15b7a[_0x4c08f7(0x11b)]===_0x4c08f7(0xb8))[_0x4c08f7(0xe6)],_0x568bcb=_0x1f0f59[_0x4c08f7(0x12f)](_0x44d369=>_0x44d369[_0x4c08f7(0x11b)]===_0x4c08f7(0x121))[_0x4c08f7(0xe6)],_0x55b704=_0x1f0f59[_0x4c08f7(0x12f)](_0x57be84=>_0x57be84[_0x4c08f7(0x11b)]==='ERROR')[_0x4c08f7(0xe6)];console[_0x4c08f7(0xd7)]('━'[_0x4c08f7(0xd2)](0x3c)),console[_0x4c08f7(0xd7)](_0x4c08f7(0xc6)),console[_0x4c08f7(0xd7)]('━'[_0x4c08f7(0xd2)](0x3c)),console['log']('Total:\x20\x20\x20\x20'+_0x1f0f59[_0x4c08f7(0xe6)]),console[_0x4c08f7(0xd7)](_0x4c08f7(0xb7)+a5_0x4942b0['green'](_0x54f01f)),console[_0x4c08f7(0xd7)](_0x4c08f7(0x120)+a5_0x4942b0[_0x4c08f7(0x11a)](_0x568bcb));_0x55b704>0x0&&console['log'](_0x4c08f7(0xc7)+a5_0x4942b0[_0x4c08f7(0x11a)](_0x55b704));console[_0x4c08f7(0xd7)]('Duration:\x20'+formatElapsed(_0x702a3b)),console['log']('━'[_0x4c08f7(0xd2)](0x3c));const _0x227171=_0x1f0f59[_0x4c08f7(0x12f)](_0x2d2a01=>_0x2d2a01['status']!==_0x4c08f7(0xb8));if(_0x227171[_0x4c08f7(0xe6)]>0x0){console[_0x4c08f7(0xd7)](),console[_0x4c08f7(0xd7)](_0x4c08f7(0xbe));for(const _0x29541d of _0x227171){const _0x1fcb90=a5_0x4942b0[_0x4c08f7(0x11a)]('✗'),_0x2e900e=_0x29541d[_0x4c08f7(0xf9)][_0x4c08f7(0xe6)]>0x32?_0x29541d[_0x4c08f7(0xf9)][_0x4c08f7(0xd0)](0x0,0x32)+_0x4c08f7(0x11c):_0x29541d[_0x4c08f7(0xf9)];console[_0x4c08f7(0xd7)]('\x20\x20'+_0x1fcb90+'\x20'+_0x29541d['name']+':\x20'+_0x2e900e);}}const _0x1747c5={'summary':{'total':_0x1f0f59[_0x4c08f7(0xe6)],'passed':_0x54f01f,'failed':_0x568bcb,'errors':_0x55b704>0x0?_0x55b704:undefined,'duration_ms':_0x702a3b},'tests':_0x1f0f59,'agent':{'project':_0xe86f3a[_0x4c08f7(0x111)],'name':_0xe86f3a[_0x4c08f7(0xe5)],'site':_0x40004f},'timestamp':new Date(_0x385e32)[_0x4c08f7(0x151)]()};try{const _0x37a408=buildCachedTestRun(_0x36fbd0,{'site':_0x40004f,'projectId':_0xde2d0e,'projectName':_0xe86f3a[_0x4c08f7(0x111)],'agentId':_0x364e4b,'agentName':_0xe86f3a[_0x4c08f7(0xe5)],'testYmlPath':a5_0x36abb9[_0x4c08f7(0x136)](_0xe86f3a[_0x4c08f7(0xdc)])});saveLastTestRun(_0x37a408);}catch{}if(_0x33f8e2!==_0x4c08f7(0xf4)||_0x2d113b){const _0x25614c=formatResults(_0x1747c5,_0x33f8e2);if(_0x2d113b)try{a5_0x184740['writeFileSync'](_0x2d113b,_0x25614c,'utf-8'),console['log'](),console[_0x4c08f7(0xd7)](a5_0x4942b0['dim'](_0x4c08f7(0x13d)+_0x2d113b));}catch(_0x4d24b7){return console[_0x4c08f7(0xd7)](),console[_0x4c08f7(0xd7)](a5_0x4942b0['red'](_0x4c08f7(0x10f)+_0x4d24b7)),0x1;}else console[_0x4c08f7(0xd7)](),console[_0x4c08f7(0xd7)](_0x25614c);}return _0x227171[_0x4c08f7(0xe6)]>0x0?0x1:0x0;}async['executeReeval'](_0x472f98,_0x326b61){const _0x78975b=a5_0x136a22,{options:_0x170f7f,tdx:_0x8fc036}=_0x472f98,{definition:_0x535ca5,agentInfo:_0x283964,outputFormat:_0x6dc066,outputFile:_0x252595}=_0x326b61,_0x2d65ab=_0x170f7f[_0x78975b(0x119)],_0x24d1f2=loadLastTestRun();if(!_0x24d1f2)return console[_0x78975b(0xd7)](a5_0x4942b0[_0x78975b(0x11a)](_0x78975b(0xc8))),console[_0x78975b(0xd7)](a5_0x4942b0[_0x78975b(0x118)](_0x78975b(0xf0))),0x1;if(_0x24d1f2[_0x78975b(0x141)]['agentName']!==_0x283964[_0x78975b(0xe5)])return console[_0x78975b(0xd7)](a5_0x4942b0[_0x78975b(0x11a)](_0x78975b(0xf3)+_0x24d1f2[_0x78975b(0x141)][_0x78975b(0xe5)]+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x283964['agentName']+'\x22.')),console[_0x78975b(0xd7)](a5_0x4942b0[_0x78975b(0x118)](_0x78975b(0x140))),0x1;const _0x21b6d0=new Set(_0x24d1f2[_0x78975b(0x130)][_0x78975b(0x137)](_0x36469e=>_0x36469e[_0x78975b(0xea)])),_0x54e1cf=_0x535ca5[_0x78975b(0xeb)][_0x78975b(0x12f)](_0x106f06=>!_0x21b6d0[_0x78975b(0x11e)](_0x106f06[_0x78975b(0x10c)]));if(_0x54e1cf[_0x78975b(0xe6)]>0x0&&_0x24d1f2[_0x78975b(0x119)]!==_0x2d65ab)return console[_0x78975b(0xd7)](a5_0x4942b0['red'](_0x78975b(0x131))),console[_0x78975b(0xd7)](a5_0x4942b0[_0x78975b(0x118)](_0x78975b(0x106)+_0x24d1f2['site']+_0x78975b(0xfa)+_0x2d65ab+'\x22.')),console[_0x78975b(0xd7)](a5_0x4942b0[_0x78975b(0x118)](_0x78975b(0xd4)+_0x24d1f2[_0x78975b(0x119)]+_0x78975b(0x115))),0x1;const _0x5bf7eb=_0x535ca5[_0x78975b(0xeb)][_0x78975b(0x12f)](_0x359f12=>_0x21b6d0[_0x78975b(0x11e)](_0x359f12[_0x78975b(0x10c)])),_0x69ef1c=_0x54e1cf;let _0x3e2518;try{_0x3e2518=await setupEvaluatorAgent(_0x8fc036[_0x78975b(0x112)],_0x170f7f[_0x78975b(0xbb)]);}catch(_0xc678c7){const _0x23378a=_0xc678c7 instanceof Error?_0xc678c7['message']:String(_0xc678c7);return console['log'](a5_0x4942b0[_0x78975b(0x11a)](_0x78975b(0x153)+_0x23378a)),0x1;}console[_0x78975b(0xd7)](a5_0x4942b0[_0x78975b(0x134)](_0x78975b(0xba))),console[_0x78975b(0xd7)](_0x78975b(0x100)+a5_0x4942b0[_0x78975b(0xcd)](_0x24d1f2[_0x78975b(0x125)])),console[_0x78975b(0xd7)]('Agent:\x20'+a5_0x4942b0[_0x78975b(0xcd)](_0x24d1f2['agent'][_0x78975b(0x111)]+'/'+_0x24d1f2[_0x78975b(0x141)][_0x78975b(0xe5)]));_0x69ef1c[_0x78975b(0xe6)]>0x0&&console[_0x78975b(0xd7)](_0x78975b(0xe3)+a5_0x4942b0[_0x78975b(0x14c)](_0x69ef1c[_0x78975b(0xe6)]));console['log']();const _0x253599=[],_0x582f64=Date[_0x78975b(0x124)](),_0xedb7fd=createCommandSpinner(_0x78975b(0xd1));if(_0x5bf7eb[_0x78975b(0xe6)]>0x0)try{const _0x410c80=await reevaluateFromCache(_0x8fc036[_0x78975b(0x112)],_0x24d1f2,{'tests':_0x5bf7eb},{'evaluatorId':_0x3e2518,'onTestStart':(_0xa24e86,_0x30e55d,_0x56d39a)=>{const _0x495fdc=_0x78975b;_0xedb7fd[_0x495fdc(0x110)]=_0x495fdc(0xb6)+(_0x30e55d+0x1)+'/'+_0x56d39a+':\x20'+_0xa24e86+_0x495fdc(0x11c);if(!_0xedb7fd[_0x495fdc(0x104)])_0xedb7fd[_0x495fdc(0x123)]();},'onTestComplete':(_0x5d62c8,_0xa6d762)=>{const _0x4cdd70=_0x78975b;_0xedb7fd[_0x4cdd70(0x11d)]();if(_0xa6d762[_0x4cdd70(0x11b)]==='PASS')console[_0x4cdd70(0xd7)](a5_0x4942b0[_0x4cdd70(0x146)](_0x4cdd70(0xd3)+_0x5d62c8)+a5_0x4942b0[_0x4cdd70(0x118)](_0x4cdd70(0xc4)));else _0xa6d762['status']==='FAIL'?console[_0x4cdd70(0xd7)](a5_0x4942b0[_0x4cdd70(0x11a)]('✗\x20FAIL:\x20'+_0x5d62c8+_0x4cdd70(0x13c)+_0xa6d762[_0x4cdd70(0xf9)])+a5_0x4942b0['dim'](_0x4cdd70(0xc4))):console[_0x4cdd70(0xd7)](a5_0x4942b0[_0x4cdd70(0x11a)](_0x4cdd70(0x152)+_0x5d62c8+_0x4cdd70(0x13c)+_0xa6d762[_0x4cdd70(0xf9)]));_0xa6d762[_0x4cdd70(0xf2)]&&console[_0x4cdd70(0xd7)](a5_0x4942b0[_0x4cdd70(0x118)](_0x4cdd70(0x14a)+_0xa6d762[_0x4cdd70(0xf2)])),_0x253599[_0x4cdd70(0x105)](_0xa6d762);},'onTestSkipped':(_0x22aabb,_0x39ad03)=>{const _0x171cba=_0x78975b;_0xedb7fd[_0x171cba(0x11d)](),console[_0x171cba(0xd7)](a5_0x4942b0[_0x171cba(0x14c)](_0x171cba(0xbf)+_0x22aabb+_0x171cba(0x13c)+_0x39ad03));}});for(const _0x247e3d of _0x410c80){!_0x253599[_0x78975b(0xc3)](_0x53834c=>_0x53834c['name']===_0x247e3d[_0x78975b(0x10c)])&&_0x253599['push'](_0x247e3d);}}catch(_0x47de77){_0xedb7fd[_0x78975b(0x11d)]();const _0x31c541=_0x47de77 instanceof Error?_0x47de77[_0x78975b(0x113)]:String(_0x47de77);return console[_0x78975b(0xd7)](a5_0x4942b0[_0x78975b(0x11a)](_0x78975b(0x11f)+_0x31c541)),0x1;}_0xedb7fd[_0x78975b(0x11d)]();if(_0x69ef1c[_0x78975b(0xe6)]>0x0){console[_0x78975b(0xd7)](),console[_0x78975b(0xd7)](a5_0x4942b0[_0x78975b(0x134)](_0x78975b(0x12a)));const {projectId:_0x576f5c,agentId:_0x4138c1}=_0x24d1f2['agent'];for(const _0x1a82ae of _0x69ef1c){console[_0x78975b(0xd7)](_0x78975b(0xb5)+a5_0x4942b0['white'](_0x1a82ae[_0x78975b(0x10c)]));const _0x43f407=createCommandSpinner(_0x78975b(0x150)+_0x1a82ae['rounds'][_0x78975b(0xe6)]+':\x20Sending\x20user\x20input...');_0x43f407['start']();try{const {result:_0x492ae8}=await runTest(_0x8fc036['llm'],_0x1a82ae,{'agentId':_0x4138c1,'projectId':_0x576f5c,'site':_0x24d1f2[_0x78975b(0x119)],'noEval':![],'evaluatorId':_0x3e2518,'onRoundStart':(_0x1f2c30,_0x1a7c84)=>{const _0x302723=_0x78975b;_0x43f407[_0x302723(0x110)]=_0x302723(0xbd)+(_0x1f2c30+0x1)+'/'+_0x1a7c84+_0x302723(0x12d);},'onRoundComplete':(_0x242629,_0x4b2d36,_0x108a5c)=>{const _0x51d856=_0x78975b,_0xd56dcb=formatElapsed(_0x4b2d36);_0x108a5c?console['log'](_0x51d856(0x12e)+(_0x242629+0x1)+'/'+_0x1a82ae[_0x51d856(0xfe)][_0x51d856(0xe6)]+_0x51d856(0x14d)+a5_0x4942b0[_0x51d856(0x146)]('✓')+'\x20('+_0xd56dcb+')'):console[_0x51d856(0xd7)](_0x51d856(0x12e)+(_0x242629+0x1)+'/'+_0x1a82ae[_0x51d856(0xfe)][_0x51d856(0xe6)]+'...\x20'+a5_0x4942b0[_0x51d856(0x11a)]('✗'));},'onEvaluationStart':()=>{const _0x5402d3=_0x78975b;_0x43f407[_0x5402d3(0x110)]=_0x5402d3(0xfd);},'onEvaluationComplete':_0x2850e2=>{const _0x3789e7=_0x78975b,_0xdf5783=formatElapsed(_0x2850e2);console[_0x3789e7(0xd7)](_0x3789e7(0x132)+a5_0x4942b0['green']('✓')+'\x20('+_0xdf5783+')');}});_0x43f407['stop'](),_0x253599[_0x78975b(0x105)](_0x492ae8);if(_0x492ae8[_0x78975b(0x11b)]==='PASS')console[_0x78975b(0xd7)](a5_0x4942b0[_0x78975b(0x146)](_0x78975b(0xd3)+_0x492ae8['reason'])+a5_0x4942b0[_0x78975b(0x118)](_0x78975b(0xdf)));else _0x492ae8['status']===_0x78975b(0x121)?console['log'](a5_0x4942b0['red'](_0x78975b(0xee)+_0x492ae8[_0x78975b(0xf9)])+a5_0x4942b0[_0x78975b(0x118)]('\x20(new)')):console[_0x78975b(0xd7)](a5_0x4942b0['red']('✗\x20ERROR:\x20'+_0x492ae8[_0x78975b(0xf9)]));_0x492ae8[_0x78975b(0xf2)]&&console[_0x78975b(0xd7)](a5_0x4942b0[_0x78975b(0x118)](_0x78975b(0x14a)+_0x492ae8[_0x78975b(0xf2)]));}catch(_0x1c1bde){_0x43f407[_0x78975b(0x11d)]();const _0x15f9c3=_0x1c1bde instanceof Error?_0x1c1bde[_0x78975b(0x113)]:String(_0x1c1bde);console[_0x78975b(0xd7)](a5_0x4942b0[_0x78975b(0x11a)](_0x78975b(0x152)+_0x15f9c3)),_0x253599[_0x78975b(0x105)]({'name':_0x1a82ae[_0x78975b(0x10c)],'status':_0x78975b(0x144),'reason':_0x15f9c3,'timestamp':new Date()[_0x78975b(0x151)](),'duration_ms':0x0});}}}console[_0x78975b(0xd7)]();const _0x1ab1b7=Date[_0x78975b(0x124)]()-_0x582f64,_0x4d73a4=_0x253599[_0x78975b(0x12f)](_0x1efff8=>_0x1efff8['status']===_0x78975b(0xb8))[_0x78975b(0xe6)],_0x3f3529=_0x253599[_0x78975b(0x12f)](_0x4df0f4=>_0x4df0f4[_0x78975b(0x11b)]==='FAIL')[_0x78975b(0xe6)],_0x10c4c2=_0x253599[_0x78975b(0x12f)](_0x576d81=>_0x576d81[_0x78975b(0x11b)]===_0x78975b(0x144))['length'];console[_0x78975b(0xd7)]('━'[_0x78975b(0xd2)](0x3c)),console[_0x78975b(0xd7)](_0x78975b(0xe2)),console['log']('━'['repeat'](0x3c)),console[_0x78975b(0xd7)](_0x78975b(0xe9)+_0x253599[_0x78975b(0xe6)]),console[_0x78975b(0xd7)](_0x78975b(0xb7)+a5_0x4942b0[_0x78975b(0x146)](_0x4d73a4)),console[_0x78975b(0xd7)]('Failed:\x20\x20\x20'+a5_0x4942b0[_0x78975b(0x11a)](_0x3f3529));_0x10c4c2>0x0&&console[_0x78975b(0xd7)](_0x78975b(0xc7)+a5_0x4942b0[_0x78975b(0x11a)](_0x10c4c2));console[_0x78975b(0xd7)]('Duration:\x20'+formatElapsed(_0x1ab1b7)),console[_0x78975b(0xd7)]('━'[_0x78975b(0xd2)](0x3c));const _0x13ab37={'summary':{'total':_0x253599[_0x78975b(0xe6)],'passed':_0x4d73a4,'failed':_0x3f3529,'errors':_0x10c4c2>0x0?_0x10c4c2:undefined,'duration_ms':_0x1ab1b7},'tests':_0x253599,'agent':{'project':_0x283964[_0x78975b(0x111)],'name':_0x283964[_0x78975b(0xe5)],'site':_0x2d65ab},'timestamp':new Date(_0x582f64)[_0x78975b(0x151)]()};if(_0x6dc066!==_0x78975b(0xf4)||_0x252595){const _0x3bf07c=formatResults(_0x13ab37,_0x6dc066);if(_0x252595)try{a5_0x184740[_0x78975b(0xef)](_0x252595,_0x3bf07c,_0x78975b(0x107)),console[_0x78975b(0xd7)](),console[_0x78975b(0xd7)](a5_0x4942b0[_0x78975b(0x118)](_0x78975b(0x13d)+_0x252595));}catch(_0x32db1c){return console[_0x78975b(0xd7)](),console[_0x78975b(0xd7)](a5_0x4942b0['red'](_0x78975b(0x10f)+_0x32db1c)),0x1;}else console[_0x78975b(0xd7)](),console[_0x78975b(0xd7)](_0x3bf07c);}const _0x23c94b=_0x253599[_0x78975b(0x12f)](_0x32440a=>_0x32440a[_0x78975b(0x11b)]!==_0x78975b(0xb8));return _0x23c94b['length']>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x329082=a6_0x4cb2;(function(_0x4b6b52,_0x2e96fe){const _0x48f300=a6_0x4cb2,_0x20c028=_0x4b6b52();while(!![]){try{const _0x24644f=-parseInt(_0x48f300(0xe7))/0x1*(-parseInt(_0x48f300(0xb8))/0x2)+-parseInt(_0x48f300(0xc4))/0x3*(parseInt(_0x48f300(0xb3))/0x4)+parseInt(_0x48f300(0xcb))/0x5*(parseInt(_0x48f300(0xe5))/0x6)+parseInt(_0x48f300(0xad))/0x7+-parseInt(_0x48f300(0xea))/0x8*(parseInt(_0x48f300(0xbb))/0x9)+parseInt(_0x48f300(0xd4))/0xa*(-parseInt(_0x48f300(0xa6))/0xb)+parseInt(_0x48f300(0xde))/0xc;if(_0x24644f===_0x2e96fe)break;else _0x20c028['push'](_0x20c028['shift']());}catch(_0x30d433){_0x20c028['push'](_0x20c028['shift']());}}}(a6_0x4bed,0xef2aa));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';function a6_0x4bed(){const _0xecd54=['method','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','347634nGJZaP','isArray','921499JIusxg','description','has','11505224rXddMi','workflow','cookie','15499JywPUY','DELETE','PUT','entries','x-xsrf-token','status','verbose','9436658tEHKvW','PATCH','Invalid\x20HTTP\x20method:\x20','output','toLowerCase','header','2687376crHIxi','trim','log','Error:\x20','GET','4jtabjW','headers','length','9EOIYpD','Invalid\x20API\x20type:\x20','proxy-authorization','substring','message','indexOf','color','keys','data','3ghpiEu','set-cookie','join','stack','site','validate','cdp','115fBEOKo','\x0aStack\x20trace:\x0a','.\x20Valid\x20types:\x20','api','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','Endpoint\x20must\x20start\x20with\x20/:\x20','.\x20Valid\x20methods:\x20','execute','\x22.\x20','10790zenEir','file','authorization','x-auth-token','<\x20HTTP/1.1\x20','includes','name','error','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','type','1034940keOZXV','POST','request','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','Results\x20saved\x20to\x20'];a6_0x4bed=function(){return _0xecd54;};return a6_0x4bed();}const SENSITIVE_HEADERS=new Set([a6_0x329082(0xd6),a6_0x329082(0xbd),a6_0x329082(0xec),a6_0x329082(0xc5),'set-cookie2',a6_0x329082(0xaa),a6_0x329082(0xd7),'x-trino-user']);function isSensitiveHeader(_0x429966){const _0x254309=a6_0x329082;return SENSITIVE_HEADERS[_0x254309(0xe9)](_0x429966[_0x254309(0xb1)]());}function a6_0x4cb2(_0x2cc566,_0x3ced10){_0x2cc566=_0x2cc566-0xa6;const _0x4bed0b=a6_0x4bed();let _0x4cb2ec=_0x4bed0b[_0x2cc566];return _0x4cb2ec;}function parseHeader(_0x250483){const _0x284a2b=a6_0x329082,_0x516e74=_0x250483[_0x284a2b(0xc0)](':');if(_0x516e74===-0x1)throw new Error('Invalid\x20header\x20format:\x20\x22'+_0x250483+_0x284a2b(0xd3)+_0x284a2b(0xcf));const _0x37ecb3=_0x250483[_0x284a2b(0xbe)](0x0,_0x516e74)[_0x284a2b(0xb4)](),_0x567643=_0x250483[_0x284a2b(0xbe)](_0x516e74+0x1)[_0x284a2b(0xb4)]();if(!_0x37ecb3)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0x250483+'\x22');return[_0x37ecb3,_0x567643];}export class ApiCommand extends BaseCommand{[a6_0x329082(0xda)]='api';[a6_0x329082(0xe8)]=a6_0x329082(0xe1);[a6_0x329082(0xc9)](_0x4bd368){const _0x40171e=a6_0x329082,{args:_0x5d4d8a,options:_0x34209f}=_0x4bd368,_0x4885d7=_0x34209f;if(_0x5d4d8a[_0x40171e(0xba)]===0x0)return _0x40171e(0xdc);const _0x50244f=_0x5d4d8a[0x0];if(!_0x50244f['startsWith']('/'))return _0x40171e(0xd0)+_0x50244f;const _0x413a28=_0x4885d7[_0x40171e(0xc3)],_0x5e3e3b=_0x4885d7[_0x40171e(0xd5)];if(_0x413a28&&_0x5e3e3b)return _0x40171e(0xe4);const _0x54b96c=_0x4885d7[_0x40171e(0xe3)]||'GET',_0x212d16=[_0x40171e(0xb7),_0x40171e(0xdf),_0x40171e(0xa8),_0x40171e(0xa7),_0x40171e(0xae)];if(!_0x212d16[_0x40171e(0xd9)](_0x54b96c['toUpperCase']()))return _0x40171e(0xaf)+_0x54b96c+_0x40171e(0xd1)+_0x212d16[_0x40171e(0xc6)](',\x20');const _0x285f21=_0x4885d7[_0x40171e(0xdd)]||'td',_0x287c44=['td',_0x40171e(0xca),_0x40171e(0xeb),'trino','llm','llm-proxy'];if(!_0x287c44['includes'](_0x285f21))return _0x40171e(0xbc)+_0x285f21+_0x40171e(0xcd)+_0x287c44['join'](',\x20');return undefined;}async[a6_0x329082(0xd2)](_0x249f71){const _0x2523d6=a6_0x329082,{options:_0x497ee7,args:_0x29c42d,tdx:_0x964ae5}=_0x249f71,_0xdbcd4a=_0x497ee7,_0x592f27=_0x29c42d[0x0],_0x105524=(_0xdbcd4a[_0x2523d6(0xe3)]||_0x2523d6(0xb7))['toUpperCase'](),_0x274c83=_0xdbcd4a[_0x2523d6(0xc3)],_0x48f499=_0xdbcd4a['file'],_0x14ed41=_0xdbcd4a[_0x2523d6(0xb2)],_0x36a56d=_0xdbcd4a['type']||'td';try{const _0x3445a5={};if(_0x14ed41){const _0x33a49c=Array[_0x2523d6(0xe6)](_0x14ed41)?_0x14ed41:[_0x14ed41];for(const _0x22a2c6 of _0x33a49c){const [_0x54cad1,_0x4d54b3]=parseHeader(_0x22a2c6);_0x3445a5[_0x54cad1]=_0x4d54b3;}}let _0x2f31b0;if(_0x274c83)_0x2f31b0=_0x274c83;else{if(_0x48f499)try{_0x2f31b0=RawAPI['readBodyFromFile'](_0x48f499);}catch(_0x1522b7){return console[_0x2523d6(0xdb)]('Error:\x20'+(_0x1522b7 instanceof Error?_0x1522b7[_0x2523d6(0xbf)]:String(_0x1522b7))),0x1;}}const _0x598fbd={'method':_0x105524,'apiType':_0x36a56d,'includeHeaders':_0x497ee7[_0x2523d6(0xac)]};_0x2f31b0&&(_0x598fbd['body']=_0x2f31b0);Object[_0x2523d6(0xc2)](_0x3445a5)['length']>0x0&&(_0x598fbd[_0x2523d6(0xb9)]=_0x3445a5);if(_0x497ee7[_0x2523d6(0xac)]){const _0x2ef7d6=resolveSite(_0x497ee7[_0x2523d6(0xc8)]),_0x300498=getEndpoint(_0x2ef7d6,_0x36a56d),_0xeaf43=''+_0x300498+_0x592f27;console[_0x2523d6(0xdb)]('>\x20'+_0x105524+'\x20'+_0xeaf43);const _0x15f9c9=getAuthHeaders(_0x2ef7d6),_0x3329f3={..._0x15f9c9,..._0x3445a5};for(const [_0x558f27,_0x501cab]of Object[_0x2523d6(0xa9)](_0x3329f3)){!isSensitiveHeader(_0x558f27)&&console[_0x2523d6(0xdb)]('>\x20'+_0x558f27+':\x20'+_0x501cab);}_0x2f31b0&&console['error']('>'),console[_0x2523d6(0xdb)]('');}const _0x549a59=await _0x964ae5[_0x2523d6(0xce)][_0x2523d6(0xe0)](_0x592f27,_0x598fbd);if(_0x497ee7[_0x2523d6(0xac)]&&_0x549a59[_0x2523d6(0xb9)]){console[_0x2523d6(0xdb)](_0x2523d6(0xd8)+_0x549a59[_0x2523d6(0xab)]);for(const [_0x2f01cc,_0x5b4da4]of Object[_0x2523d6(0xa9)](_0x549a59['headers'])){!isSensitiveHeader(_0x2f01cc)&&console['error']('<\x20'+_0x2f01cc+':\x20'+_0x5b4da4);}console[_0x2523d6(0xdb)]('');}const _0x2d258e=Boolean(_0x497ee7[_0x2523d6(0xb0)]),_0x10f17f={'color':_0x497ee7[_0x2523d6(0xc1)],'noColor':_0x497ee7['noColor']||_0x2d258e&&!_0x497ee7[_0x2523d6(0xc1)]},_0x24830f=colorizeJSON(_0x549a59['data'],_0x10f17f);return _0x497ee7['output']?(writeFileSync(_0x497ee7[_0x2523d6(0xb0)],_0x24830f),console['error'](_0x2523d6(0xe2)+_0x497ee7[_0x2523d6(0xb0)])):console[_0x2523d6(0xb5)](_0x24830f),0x0;}catch(_0x4a2bc4){return _0x4a2bc4 instanceof Error?(console['error']('Error:\x20'+_0x4a2bc4['message']),_0x497ee7[_0x2523d6(0xac)]&&_0x4a2bc4[_0x2523d6(0xc7)]&&console[_0x2523d6(0xdb)](_0x2523d6(0xcc)+_0x4a2bc4[_0x2523d6(0xc7)])):console[_0x2523d6(0xdb)](_0x2523d6(0xb6)+String(_0x4a2bc4)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a7_0x5ca324=a7_0x1cf9;(function(_0x1bcdbf,_0x21efd9){const _0x330179=a7_0x1cf9,_0x3e4728=_0x1bcdbf();while(!![]){try{const _0x11c64b=parseInt(_0x330179(0x109))/0x1*(-parseInt(_0x330179(0x114))/0x2)+parseInt(_0x330179(0xed))/0x3+parseInt(_0x330179(0xde))/0x4+-parseInt(_0x330179(0xec))/0x5*(parseInt(_0x330179(0xdb))/0x6)+-parseInt(_0x330179(0xe2))/0x7*(parseInt(_0x330179(0xf2))/0x8)+-parseInt(_0x330179(0x113))/0x9+parseInt(_0x330179(0xfc))/0xa*(parseInt(_0x330179(0xf5))/0xb);if(_0x11c64b===_0x21efd9)break;else _0x3e4728['push'](_0x3e4728['shift']());}catch(_0x13da5c){_0x3e4728['push'](_0x3e4728['shift']());}}}(a7_0x4f01,0x87d50));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';function a7_0x4f01(){const _0x1771a1=['method','select','\x20(site:\x20','apiKey','Remove\x20API\x20key\x20from\x20system\x20keychain','Read\x20credential\x20from\x20','775555LuIfMq','1656696SoYtfl','message','N/A','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','log','92168VyYneM','Enter\x20your\x20TD\x20API\x20key:','\x20removed\x20from\x20keychain','15310889wveQda','Name:\x20','Read\x20credential\x20from\x20keychain','\x20and\x20','Setting\x20up\x20authentication\x20for\x20site:\x20','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','\x20(profile:\x20','10MuISsO','description','site','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','email','warn','profile','join','oauth','filter','Choose\x20authentication\x20method:','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','Setup\x20API\x20key\x20authentication\x20interactively','505SCMGQz','tdx\x20profile:\x20','/app/mp/ak','logLevel','red','No\x20credential\x20found','OAuth\x20(browser\x20login)','\x20--profile\x20','\x27\x20registered','\x0aSetup\x20cancelled','9868311lsGGmu','638anZMSx','OAuth\x20tokens','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','trim','last_name','API\x20key\x20cannot\x20be\x20empty','getUserInfo','API\x20Key','apikey','✓\x20Default\x20site\x20set\x20to\x20','✓\x20Authentication\x20successful\x0a','API\x20key','yellow','execute','status','auth','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','error','User:\x20','You\x20can\x20find\x20your\x20API\x20key\x20at:','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','\x20\x20tdx','bold','6EjWDSr','No\x20credentials\x20found\x20in\x20keychain','Credential\x20type:\x20OAuth','2680392yNzQft','first_name','Setup\x20cancelled','jobs','392KXbhHR','name','green','Validating\x20API\x20key...'];a7_0x4f01=function(){return _0x1771a1;};return a7_0x4f01();}function a7_0x1cf9(_0x26d596,_0x5c12d0){_0x26d596=_0x26d596-0xc8;const _0x4f0111=a7_0x4f01();let _0x1cf95c=_0x4f0111[_0x26d596];return _0x1cf95c;}import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{isOAuthSupported}from'../core/oauth.js';import{runOAuthLoginFlow}from'./auth-login-command.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x4acc4a 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_0xe9efc8 from'chalk';export class AuthSetupCommand extends BaseCommand{['name']='auth:setup';[a7_0x5ca324(0xfd)]=a7_0x5ca324(0x108);async[a7_0x5ca324(0xd1)](_0x446952){const _0x5b5126=a7_0x5ca324,{options:_0x126a21}=_0x446952,_0x4261a4=_0x126a21['profile'];console['log'](a7_0xe9efc8[_0x5b5126(0xda)]('tdx:\x20auth\x20setup'));const _0x436e55=_0x126a21['site']||'us01',_0x4afb42=await promptSiteSelection(_0x436e55,_0x4261a4,_0x5b5126(0xe0));if(!_0x4afb42)return 0x1;const _0x3a40f7=resolveSite(_0x4afb42);if(isOAuthSupported(_0x3a40f7)){const _0x2af1e3=await a7_0x4acc4a({'type':_0x5b5126(0xe7),'name':_0x5b5126(0xe6),'message':_0x5b5126(0x106),'choices':[{'title':_0x5b5126(0x10f),'value':_0x5b5126(0x104)},{'title':_0x5b5126(0xcb),'value':_0x5b5126(0xcc)}]});if(!_0x2af1e3['method'])return console['log'](_0x5b5126(0x112)),0x1;if(_0x2af1e3[_0x5b5126(0xe6)]==='oauth')return await runOAuthLoginFlow(_0x3a40f7,_0x4261a4,_0x126a21[_0x5b5126(0x10c)]??LogLevel['ERROR']),0x0;}console['log'](_0x5b5126(0xf9)+_0x3a40f7),console[_0x5b5126(0xf1)](_0x5b5126(0xd7)),console[_0x5b5126(0xf1)]('\x20\x20'+getConsoleUrl(_0x3a40f7,_0x5b5126(0x10b)));const _0x2efe7c=await a7_0x4acc4a({'type':'password','name':_0x5b5126(0xe9),'message':_0x5b5126(0xf3),'validate':_0x4e1526=>{const _0x5b830f=_0x5b5126;if(!_0x4e1526||!_0x4e1526[_0x5b830f(0x117)]())return _0x5b830f(0xc9);return!![];}});if(!_0x2efe7c[_0x5b5126(0xe9)])return console[_0x5b5126(0xf1)](_0x5b5126(0x112)),0x1;const _0x5681e6=_0x2efe7c[_0x5b5126(0xe9)];console[_0x5b5126(0xf1)](_0x5b5126(0xe5));try{const _0x97ef91=TDX['create']({'site':_0x3a40f7,'apiKey':_0x5681e6[_0x5b5126(0x117)](),'logLevel':_0x126a21[_0x5b5126(0x10c)]??LogLevel['ERROR']}),_0x242070=await _0x97ef91[_0x5b5126(0xe1)][_0x5b5126(0xca)]();console['log'](_0x5b5126(0xd4)+_0x242070[_0x5b5126(0x100)]+')');const _0x4357a9=await isKeychainAvailable();_0x4357a9?(await saveAPIKeyAsync(_0x5681e6[_0x5b5126(0x117)](),_0x3a40f7,_0x4261a4),console['log']('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0x4261a4?_0x5b5126(0xfb)+_0x4261a4+')':''))):(console[_0x5b5126(0x101)](a7_0xe9efc8['yellow']('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0x5b5126(0x101)](a7_0xe9efc8[_0x5b5126(0xd0)](_0x5b5126(0x107))));if(_0x4261a4){const _0x4802bd={'site':_0x3a40f7};saveProfileToUserConfig(_0x4261a4,_0x4802bd),console[_0x5b5126(0xf1)]('✓\x20Profile\x20\x27'+_0x4261a4+_0x5b5126(0x111));}else saveDefaultSiteToUserConfig(_0x3a40f7),console['log'](_0x5b5126(0xcd)+_0x3a40f7);const _0x28f79a=_0x4261a4?_0x5b5126(0x110)+_0x4261a4:'';return console[_0x5b5126(0xf1)](),console['log'](_0x5b5126(0xff)),console[_0x5b5126(0xf1)]('\x20\x20tdx'+_0x28f79a+_0x5b5126(0xf0)),console[_0x5b5126(0xf1)](_0x5b5126(0xd9)+_0x28f79a+_0x5b5126(0xfa)),0x0;}catch(_0x35cdd9){if(_0x35cdd9 instanceof HTTPClientError&&_0x35cdd9[_0x5b5126(0xd2)]===0x191)return printAuthError(_0x35cdd9),0x1;return console[_0x5b5126(0xd5)](a7_0xe9efc8[_0x5b5126(0x10d)]('✗\x20Validation\x20failed:\x20'+(_0x35cdd9 instanceof Error?_0x35cdd9['message']:String(_0x35cdd9)))),console[_0x5b5126(0xd5)](_0x5b5126(0x116)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x5ca324(0xe3)]=a7_0x5ca324(0xd3);['description']=a7_0x5ca324(0xd8);async['execute'](_0x4ea85a){const _0x8319d=a7_0x5ca324,{options:_0x5b21d6,tdx:_0x4dd0d5}=_0x4ea85a,_0x4815fc=_0x5b21d6[_0x8319d(0xfe)],_0x2f7fa2=_0x5b21d6[_0x8319d(0x102)],_0x529d6a=_0x2f7fa2?_0x2f7fa2:_0x8319d(0xef);console[_0x8319d(0xf1)](_0x8319d(0x10a)+_0x529d6a+_0x8319d(0xe8)+_0x4815fc+')');const _0x1347f5=await getOAuthTokens(_0x2f7fa2);if(_0x1347f5)console['log'](_0x8319d(0xdd)),console['log'](_0x8319d(0xf7)+(_0x2f7fa2?_0x8319d(0xfb)+_0x2f7fa2+')':''));else{const _0x274056=await resolveAPIKeyAsync(_0x4815fc,_0x2f7fa2);if(_0x274056){const {source:_0x291a29,isDeprecated:_0x2b5074}=_0x274056,_0xb05103=_0x8319d(0xeb)+_0x291a29;console[_0x8319d(0xf1)](_0x2b5074?a7_0xe9efc8[_0x8319d(0xd0)](_0xb05103):_0xb05103);}else console[_0x8319d(0xf1)](a7_0xe9efc8[_0x8319d(0xd0)](_0x8319d(0x10e)));}try{const _0x3c1181=await _0x4dd0d5[_0x8319d(0xe1)][_0x8319d(0xca)]();return console[_0x8319d(0xf1)](a7_0xe9efc8[_0x8319d(0xe4)](_0x8319d(0xce))),console['log'](_0x8319d(0xd6)+_0x3c1181[_0x8319d(0x100)]),(_0x3c1181[_0x8319d(0xdf)]||_0x3c1181[_0x8319d(0xc8)])&&console[_0x8319d(0xf1)](_0x8319d(0xf6)+[_0x3c1181[_0x8319d(0xdf)],_0x3c1181[_0x8319d(0xc8)]][_0x8319d(0x105)](Boolean)[_0x8319d(0x103)]('\x20')),0x0;}catch(_0x11ffde){return _0x11ffde instanceof HTTPClientError&&_0x11ffde['status']===0x191?printAuthError(_0x11ffde,!![],_0x2f7fa2):console[_0x8319d(0xd5)](a7_0xe9efc8[_0x8319d(0x10d)]('✗\x20Validation\x20failed:\x20'+(_0x11ffde instanceof Error?_0x11ffde[_0x8319d(0xee)]:String(_0x11ffde)))),0x1;}}}export class AuthClearCommand extends BaseCommand{['name']='auth:clear';[a7_0x5ca324(0xfd)]=a7_0x5ca324(0xea);async['execute'](_0x23c213){const _0x32b60f=a7_0x5ca324,{options:_0x5345c9}=_0x23c213,_0x2ebe49=_0x5345c9[_0x32b60f(0x102)];console[_0x32b60f(0xf1)](a7_0xe9efc8['bold']('tdx:\x20auth\x20clear'));const _0x4d18ec=await isKeychainAvailable();if(!_0x4d18ec)return console['error'](a7_0xe9efc8[_0x32b60f(0x10d)]('System\x20keychain\x20is\x20not\x20available')),0x1;const [_0x34cf02,_0x2516e1]=await Promise['all']([deleteKeychainAPIKey(_0x2ebe49),deleteOAuthTokens(_0x2ebe49)]);if(_0x34cf02||_0x2516e1){clearCredentialCache();const _0x11a7ba=[_0x34cf02&&_0x32b60f(0xcf),_0x2516e1&&_0x32b60f(0x115)]['filter'](Boolean)[_0x32b60f(0x103)](_0x32b60f(0xf8));return console[_0x32b60f(0xf1)]('✓\x20'+_0x11a7ba+_0x32b60f(0xf4)+(_0x2ebe49?_0x32b60f(0xfb)+_0x2ebe49+')':'')),0x0;}else return console[_0x32b60f(0xf1)](_0x32b60f(0xdc)+(_0x2ebe49?'\x20for\x20profile:\x20'+_0x2ebe49:'')),0x1;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a8_0x1ed0fa=a8_0x5cc7;(function(_0x2c2f94,_0x1e1b28){const _0x156905=a8_0x5cc7,_0x382646=_0x2c2f94();while(!![]){try{const _0x1ddbb9=parseInt(_0x156905(0x81))/0x1*(-parseInt(_0x156905(0x89))/0x2)+parseInt(_0x156905(0x97))/0x3*(parseInt(_0x156905(0x88))/0x4)+-parseInt(_0x156905(0x8c))/0x5*(-parseInt(_0x156905(0x83))/0x6)+-parseInt(_0x156905(0xa5))/0x7+parseInt(_0x156905(0xa1))/0x8+parseInt(_0x156905(0xa0))/0x9*(-parseInt(_0x156905(0xa6))/0xa)+-parseInt(_0x156905(0x85))/0xb*(parseInt(_0x156905(0xaa))/0xc);if(_0x1ddbb9===_0x1e1b28)break;else _0x382646['push'](_0x382646['shift']());}catch(_0x1a12a8){_0x382646['push'](_0x382646['shift']());}}}(a8_0x4997,0xa9ea7));import{BaseCommand}from'./command.js';import{resolveSite}from'../core/config.js';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';function a8_0x4997(){const _0x180932=['OAuth\x20login\x20is\x20not\x20yet\x20available\x20for\x20site:\x20','2081871UTtQqD','site','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','✓\x20Authentication\x20successful\x20(User:\x20','tdx:\x20auth\x20login','Opening\x20browser\x20for\x20authentication...','us01','logLevel','✓\x20Profile\x20\x27','5175WJhiVd','8414432OGFiGi','green','\x20\x20tdx','Validating\x20OAuth\x20tokens...','3393880XPsWQJ','18790UtFZbi','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','jobs','getUserInfo','4792836pLTWkU','1hbWtfs','Authenticating\x20via\x20OAuth\x20for\x20site:\x20','3967686ZmLRag','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','11Kuhxhk','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','auth:login','8XBgtTx','2203274ztAUNi','\x20--profile\x20','\x27\x20registered','10dTnBUc','name','description','log','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','create','OAuth\x20is\x20currently\x20supported\x20on\x20dev-us01\x20and\x20dev-eu01\x20only.\x20','email','/oauth/authorize','Login\x20cancelled'];a8_0x4997=function(){return _0x180932;};return a8_0x4997();}import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a8_0x2ad7fc from'chalk';function a8_0x5cc7(_0x5749c8,_0x3fc02a){_0x5749c8=_0x5749c8-0x81;const _0x49970a=a8_0x4997();let _0x5cc731=_0x49970a[_0x5749c8];return _0x5cc731;}export async function runOAuthLoginFlow(_0x54e7bb,_0x345a36,_0x515a21){const _0x4d0c38=a8_0x5cc7;if(!isOAuthSupported(_0x54e7bb))throw new Error(_0x4d0c38(0x96)+_0x54e7bb+'.\x20'+_0x4d0c38(0x92)+_0x4d0c38(0x90));const _0x78276a=await isKeychainAvailable();if(!_0x78276a)throw new Error(_0x4d0c38(0xa7)+_0x4d0c38(0x90));const _0x1998e6=getConsoleUrl(_0x54e7bb);console[_0x4d0c38(0x8f)](_0x4d0c38(0x9c)),console[_0x4d0c38(0x8f)]('\x20\x20'+_0x1998e6+_0x4d0c38(0x94)),console[_0x4d0c38(0x8f)]('Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...');const _0xae4cbe=await startOAuthFlow(_0x54e7bb);console['log'](_0x4d0c38(0xa4));const _0x2892e4=TDX[_0x4d0c38(0x91)]({'site':_0x54e7bb,'accessToken':_0xae4cbe['access_token'],'logLevel':_0x515a21??LogLevel['ERROR']}),_0x1d1a00=await _0x2892e4[_0x4d0c38(0xa8)][_0x4d0c38(0xa9)]();console[_0x4d0c38(0x8f)](a8_0x2ad7fc[_0x4d0c38(0xa2)](_0x4d0c38(0x9a)+_0x1d1a00[_0x4d0c38(0x93)]+')')),await saveOAuthTokens(_0xae4cbe,_0x345a36),console[_0x4d0c38(0x8f)]('✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain'+(_0x345a36?'\x20(profile:\x20'+_0x345a36+')':''));if(_0x345a36){const _0x2f53fc={'site':_0x54e7bb};saveProfileToUserConfig(_0x345a36,_0x2f53fc),console['log'](_0x4d0c38(0x9f)+_0x345a36+_0x4d0c38(0x8b));}const _0x3fed34=_0x345a36?_0x4d0c38(0x8a)+_0x345a36:'';console[_0x4d0c38(0x8f)](),console[_0x4d0c38(0x8f)](_0x4d0c38(0x99)),console[_0x4d0c38(0x8f)](_0x4d0c38(0xa3)+_0x3fed34+_0x4d0c38(0x86)),console['log'](_0x4d0c38(0xa3)+_0x3fed34+_0x4d0c38(0x84));}export class AuthLoginCommand extends BaseCommand{[a8_0x1ed0fa(0x8d)]=a8_0x1ed0fa(0x87);[a8_0x1ed0fa(0x8e)]='Login\x20via\x20OAuth\x20(opens\x20browser)';async['execute'](_0x592069){const _0x16c376=a8_0x1ed0fa,{options:_0x9881f9}=_0x592069,_0x40f44d=_0x9881f9['profile'];console[_0x16c376(0x8f)](a8_0x2ad7fc['bold'](_0x16c376(0x9b)));const _0x276540=_0x9881f9[_0x16c376(0x98)]||_0x16c376(0x9d),_0x4961cc=await promptSiteSelection(_0x276540,_0x40f44d,_0x16c376(0x95));if(!_0x4961cc)return 0x1;const _0x10ebca=resolveSite(_0x4961cc);return console[_0x16c376(0x8f)](_0x16c376(0x82)+_0x10ebca),await runOAuthLoginFlow(_0x10ebca,_0x40f44d,_0x9881f9[_0x16c376(0x9e)]??LogLevel['ERROR']),0x0;}}
|