@treasuredata/tdx 2026.3.13 → 2026.3.14
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/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/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a3_0x2f92(){const _0x399940=['List\x20activations\x20for\x20a\x20segment','\x20\x20Cause:\x20','✔\x20Found\x20','5325939UdcaSF','execute','Listing\x20activations\x20for\x20segment\x20\x27','6534FDVool','2SKtKDN','message','3718568QsVcJs','1149872EGKaQc','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','697760QzZNSt','Resolved\x20child\x20ID:\x20','data','2513CQDUaa','10GNkwER','cause','listActivations','segment','error','Resolving\x20child\x20segment\x20\x27','\x20activation','activations','Error:\x20Segment\x20name\x20is\x20required','verbose','Resolved\x20parent\x20ID:\x20','description','site','resolveSegmentId','name','518781Gourkr','length','\x27...','Parent\x20name:\x20','Child\x20name:\x20','Resolving\x20parent\x20segment\x20\x27','95481khbiDV'];a3_0x2f92=function(){return _0x399940;};return a3_0x2f92();}const a3_0x4d28e6=a3_0x1b10;(function(_0x549c65,_0x2a594b){const _0x24f714=a3_0x1b10,_0x1b3a66=_0x549c65();while(!![]){try{const _0x707b23=-parseInt(_0x24f714(0x129))/0x1*(parseInt(_0x24f714(0x131))/0x2)+-parseInt(_0x24f714(0x123))/0x3+-parseInt(_0x24f714(0x134))/0x4+parseInt(_0x24f714(0x136))/0x5+parseInt(_0x24f714(0x130))/0x6*(-parseInt(_0x24f714(0x139))/0x7)+parseInt(_0x24f714(0x133))/0x8+-parseInt(_0x24f714(0x12d))/0x9*(-parseInt(_0x24f714(0x13a))/0xa);if(_0x707b23===_0x2a594b)break;else _0x1b3a66['push'](_0x1b3a66['shift']());}catch(_0x365728){_0x1b3a66['push'](_0x1b3a66['shift']());}}}(a3_0x2f92,0x3cde5));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a3_0x1b10(_0x13948a,_0x32fa78){_0x13948a=_0x13948a-0x123;const _0x2f9281=a3_0x2f92();let _0x1b104a=_0x2f9281[_0x13948a];return _0x1b104a;}import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x4d28e6(0x148)]=a3_0x4d28e6(0x141);[a3_0x4d28e6(0x145)]=a3_0x4d28e6(0x12a);async[a3_0x4d28e6(0x12e)](_0x393192){const _0x5901ec=a3_0x4d28e6,{options:_0xd567cb,args:_0x3cc7dd,tdx:_0x2ca83c}=_0x393192;if(_0x3cc7dd['length']===0x0)return console[_0x5901ec(0x13e)](_0x5901ec(0x142)),console[_0x5901ec(0x13e)](_0x5901ec(0x135)),0x1;try{const {parentId:_0x18d33f,childId:_0x38c459}=parseSegmentRef(_0x3cc7dd[0x0]);if(!_0x38c459)return console['error']('Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations'),console['error']('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;_0xd567cb[_0x5901ec(0x143)]&&(console['error']('Site:\x20'+_0xd567cb[_0x5901ec(0x146)]),console['error'](_0x5901ec(0x126)+_0x18d33f),console[_0x5901ec(0x13e)](_0x5901ec(0x127)+_0x38c459));const _0x1f3e0f=await withSpinner(_0x5901ec(0x128)+_0x18d33f+_0x5901ec(0x125),()=>_0x2ca83c['segment']['resolveParentId'](_0x18d33f),{'verbose':_0xd567cb[_0x5901ec(0x143)]}),_0x1e63fb=_0x1f3e0f[_0x5901ec(0x138)];_0xd567cb[_0x5901ec(0x143)]&&console[_0x5901ec(0x13e)](_0x5901ec(0x144)+_0x1e63fb);const _0x922807=await withSpinner(_0x5901ec(0x13f)+_0x38c459+'\x27...',()=>_0x2ca83c[_0x5901ec(0x13d)][_0x5901ec(0x147)](_0x1e63fb,_0x38c459),{'verbose':_0xd567cb[_0x5901ec(0x143)]}),_0x3bc7a5=_0x922807[_0x5901ec(0x138)];_0xd567cb[_0x5901ec(0x143)]&&console[_0x5901ec(0x13e)](_0x5901ec(0x137)+_0x3bc7a5);const _0x2bf9f2=await withSpinner(_0x5901ec(0x12f)+_0x38c459+'\x27...',()=>_0x2ca83c[_0x5901ec(0x13d)][_0x5901ec(0x13c)](_0x1e63fb,_0x3bc7a5),{'verbose':_0xd567cb['verbose']}),_0x40f270=_0x2bf9f2['data'];return console[_0x5901ec(0x13e)](_0x5901ec(0x12c)+_0x40f270[_0x5901ec(0x124)]+_0x5901ec(0x140)+(_0x40f270[_0x5901ec(0x124)]!==0x1?'s':'')),await handleSDKOutput(_0x40f270,_0xd567cb),0x0;}catch(_0x3a4588){if(_0x3a4588 instanceof SDKError)return console[_0x5901ec(0x13e)]('Error:\x20'+_0x3a4588[_0x5901ec(0x132)]),_0x3a4588[_0x5901ec(0x13b)]&&console[_0x5901ec(0x13e)](_0x5901ec(0x12b)+_0x3a4588['cause']),0x1;throw _0x3a4588;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x32ab7b=a4_0x2ecc;(function(_0x1cad84,_0x58f866){const _0x2bbf5c=a4_0x2ecc,_0x364a4e=_0x1cad84();while(!![]){try{const _0x1c0ea0=-parseInt(_0x2bbf5c(0x20d))/0x1*(parseInt(_0x2bbf5c(0x1fc))/0x2)+-parseInt(_0x2bbf5c(0x175))/0x3*(parseInt(_0x2bbf5c(0x1ba))/0x4)+-parseInt(_0x2bbf5c(0x1ee))/0x5*(-parseInt(_0x2bbf5c(0x1f6))/0x6)+-parseInt(_0x2bbf5c(0x1e1))/0x7+-parseInt(_0x2bbf5c(0x1a8))/0x8*(parseInt(_0x2bbf5c(0x222))/0x9)+-parseInt(_0x2bbf5c(0x1b7))/0xa*(parseInt(_0x2bbf5c(0x226))/0xb)+parseInt(_0x2bbf5c(0x20e))/0xc;if(_0x1c0ea0===_0x58f866)break;else _0x364a4e['push'](_0x364a4e['shift']());}catch(_0x1373b3){_0x364a4e['push'](_0x364a4e['shift']());}}}(a4_0xca79,0xdf8e5));import a4_0x2a6b51 from'chalk';import a4_0xa48faf from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';function a4_0x2ecc(_0x256d0f,_0x587073){_0x256d0f=_0x256d0f-0x172;const _0xca7962=a4_0xca79();let _0x2ecc74=_0xca7962[_0x256d0f];return _0x2ecc74;}function a4_0xca79(){const _0x7b8da2=['Errors:','Agent:\x20','<new-name>','hasChanges','outputPath','knowledgeBases','6EpOMZd','message','\x22\x20to\x20new\x20project\x20\x22','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project','Pulling\x20agent\x20\x22','2qhadIO','join','execute','dryRun','\x0aWrite\x20','cyan','\x0aPull\x20summary\x20for\x20\x27','✔\x20Context\x20set:\x20','integrations','\x20updated','site','action','\x20\x20Knowledge\x20Base\x20\x22','pushAgent','Output\x20path:\x20','dim','newProjectName','1727014KMWKRe','67777152kAJJSc','new','\x20\x20Knowledge\x20Bases:\x20','\x22\x20from\x20project\x20\x22','experimentalKnowledgeBases','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','newProjectId','Chat:\x20','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','created','agent:clone','-\x20nothing\x20pushed','\x0aChanges\x20to\x20agent\x20\x27','projectId','total','Status:\x20','New\x20project:\x20','Project:\x20','cloneProject','1053153tQIPrr','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','cwd-config','\x20changed','4941299HlVzff','\x0aProject\x20pushed\x20with\x20errors','\x20resources?','\x22\x20to\x20a\x20different\x20profile','1169340qrATsO','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','errors','\x0aChanges\x20to\x20integration\x20\x27','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','textKnowledgeBases','\x20created','Would\x20pull\x20agent:\x20','yellow','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','gray','cwd','Agent\x20','name','Writing\x20files...','\x20\x20Target:\x20','llm_project','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','No\x20tdx.json\x20found\x20in\x20','projectName','\x0aError:','no_context','\x20new','description','Using\x20current\x20project:\x20','\x0aPush\x20','INVALID_ARGUMENT','\x20\x20Integrations:\x20','green','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','Analyzing\x20project\x20\x22','repeat','New\x20project\x20name\x20is\x20required','\x20successfully','Summary:','\x20files?','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','Would\x20push\x20agent:\x20','\x0aChanges\x20to\x20prompt\x20\x27','\x20|\x20','Cancelled','context','diff','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','\x20\x20Agents:\x20','Using\x20context\x20project:\x20','\x20=\x20','\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)','log','\x20--name\x20','error','32AxrXpd','\x20unchanged','Source:\x20','\x20\x20Prompts:\x20','Pushing\x20to\x20project...','agentName','prompts','push','Dry\x20run\x20-\x20no\x20files\x20written','Project\x20cloned\x20with\x20errors','counts','\x20--profile\x20','agentId','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20errors','10cFaVok','yes','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','8ygROHr','utf-8','pullProject','agent.yml','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','arg-dir','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','outputDir','Using\x20project\x20from\x20','agent:push','\x20\x20Experimental\x20Artifact\x20\x22','\x22\x20to\x20\x22','Using\x20project:\x20','red','session','pushProject','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x20\x20Integration\x20\x22','parse','llm','sourceProjectName','experimentalArtifacts','Cannot\x20clone\x20from\x20context\x20project\x20\x22','\x0a✔\x20Pushed\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project','Using\x20local\x20project:\x20','agent:pull','\x20total','unchanged','Dry\x20run\x20-\x20no\x20changes\x20made','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','tdx.json','reason','\x20\x20tdx\x20agent\x20clone\x20agents/','\x20\x20Experimental\x20Artifacts:\x20','MISSING_ARGUMENT','-\x20no\x20files\x20written','\x22:\x20','11613091wsIreW','\x22...','\x20\x20Prompt\x20\x22','dirname','llmProject','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','updated','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','agents','\x0aPush\x20summary\x20for\x20\x27','Pushing\x20agent\x20from\x20\x22','force','projectDir','1752265glUVpO','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project'];a4_0xca79=function(){return _0x7b8da2;};return a4_0xca79();}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(_0x2ecc74){const _0x1045d7=a4_0x2ecc,_0x548536=[];if(_0x2ecc74[_0x1045d7(0x21d)]!==undefined)_0x548536[_0x1045d7(0x1af)](_0x2ecc74[_0x1045d7(0x21d)]+_0x1045d7(0x1d5));if(_0x2ecc74[_0x1045d7(0x20f)]!==undefined&&_0x2ecc74[_0x1045d7(0x20f)]>0x0)_0x548536[_0x1045d7(0x1af)](a4_0x2a6b51['green'](_0x2ecc74[_0x1045d7(0x20f)]+'\x20new'));if(_0x2ecc74[_0x1045d7(0x218)]!==undefined&&_0x2ecc74['created']>0x0)_0x548536['push'](a4_0x2a6b51[_0x1045d7(0x191)](_0x2ecc74[_0x1045d7(0x218)]+_0x1045d7(0x17b)));if(_0x2ecc74[_0x1045d7(0x1e7)]!==undefined&&_0x2ecc74[_0x1045d7(0x1e7)]>0x0)_0x548536[_0x1045d7(0x1af)](a4_0x2a6b51['yellow'](_0x2ecc74['updated']+_0x1045d7(0x205)));if(_0x2ecc74[_0x1045d7(0x1d6)]!==undefined&&_0x2ecc74[_0x1045d7(0x1d6)]>0x0)_0x548536[_0x1045d7(0x1af)](a4_0x2a6b51[_0x1045d7(0x17f)](_0x2ecc74[_0x1045d7(0x1d6)]+'\x20unchanged'));if(_0x2ecc74[_0x1045d7(0x177)]!==undefined&&_0x2ecc74[_0x1045d7(0x177)]>0x0)_0x548536['push'](a4_0x2a6b51[_0x1045d7(0x1c7)](_0x2ecc74[_0x1045d7(0x177)]+_0x1045d7(0x1b6)));return _0x548536[_0x1045d7(0x1fd)](',\x20');}function displayDiffs(_0x5a72b1,_0x507505,_0x1e596d,_0x19f890,_0x2f4706,_0x44794f,_0x415693){const _0x4cbb1b=a4_0x2ecc;for(const _0x1578d3 of _0x5a72b1){if(_0x1578d3['diff']){const _0x126402=_0x1578d3[_0x4cbb1b(0x1ad)]||_0x1578d3['name'];console[_0x4cbb1b(0x1a5)](_0x4cbb1b(0x21b)+_0x126402+'\x27:'),console['log']('─'[_0x4cbb1b(0x194)](0x3c)),console[_0x4cbb1b(0x1a5)](_0x1578d3[_0x4cbb1b(0x19f)]),console[_0x4cbb1b(0x1a5)]('─'['repeat'](0x3c));}}for(const _0x2cfa24 of _0x507505){_0x2cfa24[_0x4cbb1b(0x19f)]&&(console[_0x4cbb1b(0x1a5)]('\x0aChanges\x20to\x20knowledge\x20base\x20\x27'+_0x2cfa24['name']+'\x27:'),console[_0x4cbb1b(0x1a5)]('─'[_0x4cbb1b(0x194)](0x3c)),console[_0x4cbb1b(0x1a5)](_0x2cfa24['diff']),console[_0x4cbb1b(0x1a5)]('─'[_0x4cbb1b(0x194)](0x3c)));}for(const _0x3c7d73 of _0x1e596d){_0x3c7d73['diff']&&(console[_0x4cbb1b(0x1a5)](_0x4cbb1b(0x17e)+_0x3c7d73[_0x4cbb1b(0x182)]+'\x27:'),console[_0x4cbb1b(0x1a5)]('─'[_0x4cbb1b(0x194)](0x3c)),console[_0x4cbb1b(0x1a5)](_0x3c7d73[_0x4cbb1b(0x19f)]),console[_0x4cbb1b(0x1a5)]('─'['repeat'](0x3c)));}for(const _0x30025a of _0x19f890){_0x30025a[_0x4cbb1b(0x19f)]&&(console[_0x4cbb1b(0x1a5)](_0x4cbb1b(0x19b)+_0x30025a[_0x4cbb1b(0x182)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x4cbb1b(0x1a5)](_0x30025a[_0x4cbb1b(0x19f)]),console[_0x4cbb1b(0x1a5)]('─'[_0x4cbb1b(0x194)](0x3c)));}for(const _0xb3f26c of _0x2f4706){_0xb3f26c[_0x4cbb1b(0x19f)]&&(console['log'](_0x4cbb1b(0x178)+_0xb3f26c['name']+'\x27:'),console['log']('─'[_0x4cbb1b(0x194)](0x3c)),console[_0x4cbb1b(0x1a5)](_0xb3f26c[_0x4cbb1b(0x19f)]),console[_0x4cbb1b(0x1a5)]('─'['repeat'](0x3c)));}for(const _0x134c33 of _0x44794f){_0x134c33[_0x4cbb1b(0x19f)]&&(console['log'](_0x4cbb1b(0x216)+_0x134c33[_0x4cbb1b(0x182)]+'\x27:'),console[_0x4cbb1b(0x1a5)]('─'[_0x4cbb1b(0x194)](0x3c)),console[_0x4cbb1b(0x1a5)](_0x134c33[_0x4cbb1b(0x19f)]),console[_0x4cbb1b(0x1a5)]('─'['repeat'](0x3c)));}for(const _0x5f22fe of _0x415693){_0x5f22fe[_0x4cbb1b(0x19f)]&&(console[_0x4cbb1b(0x1a5)]('\x0aChanges\x20to\x20experimental\x20artifact\x20\x27'+_0x5f22fe[_0x4cbb1b(0x182)]+'\x27:'),console[_0x4cbb1b(0x1a5)]('─'[_0x4cbb1b(0x194)](0x3c)),console['log'](_0x5f22fe[_0x4cbb1b(0x19f)]),console[_0x4cbb1b(0x1a5)]('─'[_0x4cbb1b(0x194)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x32ab7b(0x182)]=a4_0x32ab7b(0x1d4);[a4_0x32ab7b(0x18c)]=a4_0x32ab7b(0x223);async[a4_0x32ab7b(0x1fe)](_0x141f2d){const _0x14a7fe=a4_0x32ab7b,{options:_0x1b9dff,args:_0x4f7a69,tdx:_0x26551f}=_0x141f2d,_0x141bef=_0x4f7a69[0x0],_0x5a2010=_0x4f7a69[0x1],_0x52950f=_0x1b9dff['output'],_0x4bf253=_0x1b9dff[_0x14a7fe(0x1ff)],_0x4c4a00=_0x1b9dff[_0x14a7fe(0x1ec)],_0x52fd54=_0x1b9dff['yes'],_0x28d81b=_0x1b9dff[_0x14a7fe(0x1e5)],_0x4e56f3=_0x1b9dff['agent'];let _0x10f45d;if(_0x141bef){const _0x295c4e=a4_0xa48faf[_0x14a7fe(0x1fd)](_0x141bef,_0x14a7fe(0x1da));if(existsSync(_0x295c4e))try{const _0x40de10=JSON[_0x14a7fe(0x1cc)](readFileSync(_0x295c4e,_0x14a7fe(0x1bb)));_0x40de10[_0x14a7fe(0x185)]&&(_0x10f45d={'llm_project':_0x40de10[_0x14a7fe(0x185)]});}catch{}}const _0x2b87ce=findAgentConfigPath(process[_0x14a7fe(0x180)]());let _0x575c01;if(_0x2b87ce)try{const _0x554168=JSON[_0x14a7fe(0x1cc)](readFileSync(_0x2b87ce,_0x14a7fe(0x1bb)));_0x554168['llm_project']&&(_0x575c01={'llm_project':_0x554168['llm_project']});}catch{}const _0x337e04=resolveAgentPullArgs({'arg':_0x141bef,'agentNameArg':_0x5a2010,'agentFlag':_0x4e56f3,'contextProject':_0x28d81b,'argDirConfig':_0x10f45d,'cwdConfigPath':_0x2b87ce||undefined,'cwdConfig':_0x575c01}),{projectNameOrId:_0x46b24d,targetAgentName:_0x57e29e,existingOutputDir:_0x3e33fe,source:_0x1cc744}=_0x337e04;if(_0x1cc744===_0x14a7fe(0x1bf))console[_0x14a7fe(0x1a5)](a4_0x2a6b51[_0x14a7fe(0x20b)](_0x14a7fe(0x1c2)+a4_0xa48faf[_0x14a7fe(0x1fd)](_0x141bef,_0x14a7fe(0x1da))+':\x20'+_0x46b24d));else{if(_0x1cc744===_0x14a7fe(0x224))console['log'](a4_0x2a6b51[_0x14a7fe(0x20b)](_0x14a7fe(0x1c6)+_0x46b24d));else _0x1cc744==='context'&&console['log'](a4_0x2a6b51['dim']('Using\x20project\x20from\x20context:\x20'+_0x46b24d));}if(!_0x46b24d)return _0x4e56f3?(console[_0x14a7fe(0x1a5)](a4_0x2a6b51[_0x14a7fe(0x17d)]('The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a')),console['log']('Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>'),console[_0x14a7fe(0x1a5)]('Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>')):(console[_0x14a7fe(0x1a5)](a4_0x2a6b51[_0x14a7fe(0x17d)](_0x14a7fe(0x199))),console[_0x14a7fe(0x1a5)]('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)'),console['log']('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project'),console[_0x14a7fe(0x1a5)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory'),console[_0x14a7fe(0x1a5)](_0x14a7fe(0x1fa)),console[_0x14a7fe(0x1a5)](_0x14a7fe(0x1d2))),0x1;if(_0x57e29e){const {data:_0x36e89d}=await withSpinner(_0x14a7fe(0x1fb)+_0x57e29e+_0x14a7fe(0x211)+_0x46b24d+_0x14a7fe(0x1e2),()=>_0x26551f[_0x14a7fe(0x1cd)]['pullAgent'](_0x46b24d,_0x57e29e,_0x52950f,{'dryRun':_0x4bf253,'force':_0x4c4a00}));if(_0x4bf253)return console[_0x14a7fe(0x1a5)](a4_0x2a6b51[_0x14a7fe(0x17d)](_0x14a7fe(0x1b0))),console[_0x14a7fe(0x1a5)](_0x14a7fe(0x17c)+_0x36e89d[_0x14a7fe(0x1ad)]),console[_0x14a7fe(0x1a5)](_0x14a7fe(0x20a)+_0x36e89d[_0x14a7fe(0x1f4)]),_0x36e89d[_0x14a7fe(0x19f)]&&(console[_0x14a7fe(0x1a5)]('\x0aChanges:'),console[_0x14a7fe(0x1a5)]('─'[_0x14a7fe(0x194)](0x3c)),console['log'](_0x36e89d[_0x14a7fe(0x19f)]),console[_0x14a7fe(0x1a5)]('─'[_0x14a7fe(0x194)](0x3c))),0x0;return console[_0x14a7fe(0x1a5)](a4_0x2a6b51['green']('Agent\x20pulled\x20successfully')),console['log'](_0x14a7fe(0x1f1)+_0x36e89d[_0x14a7fe(0x1ad)]),console[_0x14a7fe(0x1a5)]('Output:\x20'+_0x36e89d[_0x14a7fe(0x1f4)]),console['log'](_0x14a7fe(0x21e)+(_0x36e89d['isNew']?a4_0x2a6b51['green'](_0x14a7fe(0x20f)):_0x36e89d[_0x14a7fe(0x1f3)]?a4_0x2a6b51[_0x14a7fe(0x17d)](_0x14a7fe(0x1e7)):a4_0x2a6b51[_0x14a7fe(0x17f)]('unchanged'))),0x0;}const _0x58065f=_0x3e33fe||_0x52950f,{data:_0x3236dc}=await withSpinner(_0x14a7fe(0x193)+_0x46b24d+_0x14a7fe(0x1e2),()=>_0x26551f[_0x14a7fe(0x1cd)][_0x14a7fe(0x1bc)](_0x46b24d,_0x58065f,{'dryRun':!![]})),_0x59ed0d=_0x3236dc[_0x14a7fe(0x1b2)][_0x14a7fe(0x1e9)][_0x14a7fe(0x20f)]+_0x3236dc[_0x14a7fe(0x1b2)][_0x14a7fe(0x1f5)][_0x14a7fe(0x20f)]+_0x3236dc['counts'][_0x14a7fe(0x17a)][_0x14a7fe(0x20f)]+_0x3236dc[_0x14a7fe(0x1b2)][_0x14a7fe(0x1ae)][_0x14a7fe(0x20f)]+_0x3236dc['counts'][_0x14a7fe(0x204)][_0x14a7fe(0x20f)]+_0x3236dc[_0x14a7fe(0x1b2)][_0x14a7fe(0x212)][_0x14a7fe(0x20f)]+_0x3236dc[_0x14a7fe(0x1b2)]['experimentalArtifacts']['new'],_0x24491d=_0x3236dc[_0x14a7fe(0x1b2)]['agents'][_0x14a7fe(0x1e7)]+_0x3236dc[_0x14a7fe(0x1b2)][_0x14a7fe(0x1f5)][_0x14a7fe(0x1e7)]+_0x3236dc['counts']['textKnowledgeBases'][_0x14a7fe(0x1e7)]+_0x3236dc[_0x14a7fe(0x1b2)][_0x14a7fe(0x1ae)][_0x14a7fe(0x1e7)]+_0x3236dc['counts'][_0x14a7fe(0x204)][_0x14a7fe(0x1e7)]+_0x3236dc[_0x14a7fe(0x1b2)][_0x14a7fe(0x212)][_0x14a7fe(0x1e7)]+_0x3236dc[_0x14a7fe(0x1b2)][_0x14a7fe(0x1cf)][_0x14a7fe(0x1e7)],_0x4db0f9=_0x3236dc[_0x14a7fe(0x1b2)][_0x14a7fe(0x1e9)]['unchanged']+_0x3236dc[_0x14a7fe(0x1b2)]['knowledgeBases'][_0x14a7fe(0x1d6)]+_0x3236dc['counts']['textKnowledgeBases'][_0x14a7fe(0x1d6)]+_0x3236dc[_0x14a7fe(0x1b2)][_0x14a7fe(0x1ae)][_0x14a7fe(0x1d6)]+_0x3236dc[_0x14a7fe(0x1b2)][_0x14a7fe(0x204)][_0x14a7fe(0x1d6)]+_0x3236dc['counts']['experimentalKnowledgeBases'][_0x14a7fe(0x1d6)]+_0x3236dc[_0x14a7fe(0x1b2)]['experimentalArtifacts'][_0x14a7fe(0x1d6)];console[_0x14a7fe(0x1a5)](_0x14a7fe(0x202)+_0x3236dc[_0x14a7fe(0x188)]+'\x27:'),console[_0x14a7fe(0x1a5)]('\x20\x20'+a4_0x2a6b51[_0x14a7fe(0x191)]('+\x20'+_0x59ed0d+'\x20new')+_0x14a7fe(0x19c)+a4_0x2a6b51[_0x14a7fe(0x17d)]('~\x20'+_0x24491d+_0x14a7fe(0x225))+_0x14a7fe(0x19c)+a4_0x2a6b51[_0x14a7fe(0x20b)]('=\x20'+_0x4db0f9+_0x14a7fe(0x1a9))),console[_0x14a7fe(0x1a5)]('\x20\x20Agents:\x20'+formatCountSummary(_0x3236dc[_0x14a7fe(0x1b2)][_0x14a7fe(0x1e9)])),console[_0x14a7fe(0x1a5)](_0x14a7fe(0x210)+formatCountSummary(_0x3236dc[_0x14a7fe(0x1b2)][_0x14a7fe(0x1f5)])),console[_0x14a7fe(0x1a5)](_0x14a7fe(0x1f9)+formatCountSummary(_0x3236dc[_0x14a7fe(0x1b2)][_0x14a7fe(0x17a)])),console[_0x14a7fe(0x1a5)](_0x14a7fe(0x1ab)+formatCountSummary(_0x3236dc['counts'][_0x14a7fe(0x1ae)])),console[_0x14a7fe(0x1a5)](_0x14a7fe(0x190)+formatCountSummary(_0x3236dc['counts']['integrations']));const _0x10c1a7=_0x3236dc[_0x14a7fe(0x1b2)][_0x14a7fe(0x212)]['total']>0x0||_0x3236dc[_0x14a7fe(0x1b2)][_0x14a7fe(0x1cf)]['total']>0x0;_0x10c1a7&&(console[_0x14a7fe(0x1a5)](_0x14a7fe(0x1c0)+formatCountSummary(_0x3236dc['counts'][_0x14a7fe(0x212)])),console[_0x14a7fe(0x1a5)](_0x14a7fe(0x1dd)+formatCountSummary(_0x3236dc[_0x14a7fe(0x1b2)][_0x14a7fe(0x1cf)])));console[_0x14a7fe(0x1a5)](_0x14a7fe(0x184)+a4_0x2a6b51[_0x14a7fe(0x201)](_0x3236dc[_0x14a7fe(0x1c1)])),displayDiffs(_0x3236dc['agents'],_0x3236dc['knowledgeBases'],_0x3236dc[_0x14a7fe(0x17a)],_0x3236dc['prompts'],_0x3236dc[_0x14a7fe(0x204)],_0x3236dc[_0x14a7fe(0x212)],_0x3236dc[_0x14a7fe(0x1cf)]);if(_0x4bf253)return console[_0x14a7fe(0x1a5)](a4_0x2a6b51['yellow']('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x59ed0d===0x0&&_0x24491d===0x0)return console[_0x14a7fe(0x1a5)](a4_0x2a6b51[_0x14a7fe(0x191)](_0x14a7fe(0x213))),saveSessionContext({'llm_project':_0x3236dc['projectName']},_0x1b9dff['session']),console[_0x14a7fe(0x1a5)](a4_0x2a6b51[_0x14a7fe(0x191)]('✔\x20Context\x20set:\x20'+a4_0x2a6b51['dim'](_0x14a7fe(0x185))+_0x14a7fe(0x1a3)+a4_0x2a6b51[_0x14a7fe(0x201)](_0x3236dc[_0x14a7fe(0x188)]))),0x0;if(!_0x52fd54&&!_0x4c4a00){if(!isInteractive())return console[_0x14a7fe(0x1a7)](a4_0x2a6b51[_0x14a7fe(0x1c7)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x14a7fe(0x1a7)](a4_0x2a6b51[_0x14a7fe(0x20b)](_0x14a7fe(0x1b5))),0x1;const _0x3b48e5=await confirmKey(_0x14a7fe(0x200)+(_0x59ed0d+_0x24491d)+_0x14a7fe(0x198));if(!_0x3b48e5)return console[_0x14a7fe(0x1a5)](a4_0x2a6b51[_0x14a7fe(0x17d)]('Cancelled'),_0x14a7fe(0x1df)),0x1;}const {data:_0x2240c4}=await withSpinner(_0x14a7fe(0x183),()=>_0x26551f[_0x14a7fe(0x1cd)]['pullProject'](_0x46b24d,_0x58065f,{'force':_0x4c4a00}));return console[_0x14a7fe(0x1a5)](a4_0x2a6b51[_0x14a7fe(0x191)]('\x0a✔\x20Pulled\x20'+(_0x59ed0d+_0x24491d)+'\x20files\x20to\x20'+_0x2240c4[_0x14a7fe(0x1c1)])),saveSessionContext({'llm_project':_0x2240c4[_0x14a7fe(0x188)]},_0x1b9dff[_0x14a7fe(0x1c8)]),console[_0x14a7fe(0x1a5)](a4_0x2a6b51['green'](_0x14a7fe(0x203)+a4_0x2a6b51[_0x14a7fe(0x20b)](_0x14a7fe(0x185))+'\x20=\x20'+a4_0x2a6b51[_0x14a7fe(0x201)](_0x2240c4[_0x14a7fe(0x188)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']=a4_0x32ab7b(0x219);['description']=a4_0x32ab7b(0x1e6);async[a4_0x32ab7b(0x1fe)](_0xadd488){const _0x2390c1=a4_0x32ab7b,{options:_0x1764f3,args:_0x154608,tdx:_0x3f6256}=_0xadd488,_0x1618b3=_0x154608[0x0],_0x4f23eb=_0x1764f3[_0x2390c1(0x182)],_0x42df3f=_0x1764f3[_0x2390c1(0x1ff)],_0xe460e4=_0x1764f3[_0x2390c1(0x1b8)],_0x1377fd=_0x1764f3[_0x2390c1(0x206)],_0xf11b80=_0x1764f3[_0x2390c1(0x1e5)];let _0x2b0626;const _0x3c8ddc=findAgentConfigPath(process[_0x2390c1(0x180)]());if(_0x1618b3){const _0x318c93=a4_0xa48faf['join'](_0x1618b3,'tdx.json');existsSync(_0x318c93)?(_0x2b0626=_0x1618b3,console['log'](a4_0x2a6b51[_0x2390c1(0x20b)](_0x2390c1(0x1d3)+_0x1618b3))):_0x2b0626=_0x1618b3;}else{if(_0x3c8ddc)_0x2b0626=a4_0xa48faf[_0x2390c1(0x1e4)](_0x3c8ddc),console[_0x2390c1(0x1a5)](a4_0x2a6b51[_0x2390c1(0x20b)](_0x2390c1(0x18d)+_0x2b0626));else{if(_0xf11b80){const _0x3ddd5b=sanitizeForFilesystem(_0xf11b80);let _0x65f2dd=_0x3ddd5b,_0x3fd542=a4_0xa48faf['join'](process[_0x2390c1(0x180)](),_0x2390c1(0x1e9),_0x3ddd5b,_0x2390c1(0x1da));if(!existsSync(_0x3fd542)){const _0x4996a9=normalizeName(_0xf11b80),_0xaddd2=a4_0xa48faf['join'](process[_0x2390c1(0x180)](),_0x2390c1(0x1e9),_0x4996a9,_0x2390c1(0x1da));existsSync(_0xaddd2)&&(_0x65f2dd=_0x4996a9,_0x3fd542=_0xaddd2);}if(existsSync(_0x3fd542))_0x2b0626=a4_0xa48faf[_0x2390c1(0x1e4)](_0x3fd542),console[_0x2390c1(0x1a5)](a4_0x2a6b51['dim'](_0x2390c1(0x1d3)+_0x2b0626));else{const _0x2579dc=_0x1764f3['profile'];if(_0x2579dc)throw new SDKError(ErrorCode[_0x2390c1(0x18f)],_0x2390c1(0x1d0)+_0xf11b80+_0x2390c1(0x174),undefined,{'helpText':'When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a'+_0x2390c1(0x1ca)+('\x20\x20tdx\x20agent\x20pull\x20'+_0xf11b80+'\x0a')+(_0x2390c1(0x1dc)+_0x65f2dd+_0x2390c1(0x1a6)+(_0x4f23eb||_0x2390c1(0x1f2))+_0x2390c1(0x1b3)+_0x2579dc)});_0x2b0626=_0xf11b80,console[_0x2390c1(0x1a5)](a4_0x2a6b51['dim'](_0x2390c1(0x1a2)+_0xf11b80));}}}}if(!_0x2b0626)return console['log'](a4_0x2a6b51['yellow'](_0x2390c1(0x1a0))),console[_0x2390c1(0x1a5)](_0x2390c1(0x1e8)),console[_0x2390c1(0x1a5)](_0x2390c1(0x192)),console[_0x2390c1(0x1a5)](_0x2390c1(0x1a4)),console[_0x2390c1(0x1a5)](_0x2390c1(0x1b9)),0x1;if(!_0x4f23eb)throw new SDKError(ErrorCode[_0x2390c1(0x1de)],_0x2390c1(0x195),undefined,{'helpText':_0x2390c1(0x176)});if(!_0xe460e4&&!_0x42df3f){if(!isInteractive())return console[_0x2390c1(0x1a7)](a4_0x2a6b51['red'](_0x2390c1(0x189)),_0x2390c1(0x186)),console[_0x2390c1(0x1a7)](a4_0x2a6b51['dim'](_0x2390c1(0x1b5))),0x1;const _0xa8618e=await confirmKey('Clone\x20\x22'+_0x2b0626+_0x2390c1(0x1f8)+_0x4f23eb+'\x22?');if(!_0xa8618e)return console[_0x2390c1(0x1a5)](a4_0x2a6b51[_0x2390c1(0x17d)](_0x2390c1(0x19d))),0x1;}const {data:_0x579aaf}=await withSpinner('Cloning\x20\x22'+_0x2b0626+_0x2390c1(0x1c5)+_0x4f23eb+_0x2390c1(0x1e2),()=>_0x3f6256[_0x2390c1(0x1cd)][_0x2390c1(0x221)](_0x2b0626,_0x4f23eb,{'dryRun':_0x42df3f}));if(_0x42df3f){console['log'](a4_0x2a6b51['yellow']('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x2390c1(0x1a5)](_0x2390c1(0x1aa)+_0x579aaf[_0x2390c1(0x1ce)]),console['log'](_0x2390c1(0x21f)+_0x4f23eb),console[_0x2390c1(0x1a5)]('Would\x20clone:'),console['log']('\x20\x20Agents:\x20'+_0x579aaf[_0x2390c1(0x1b2)]['agents'][_0x2390c1(0x218)]),console['log']('\x20\x20Knowledge\x20Bases:\x20'+_0x579aaf[_0x2390c1(0x1b2)][_0x2390c1(0x1f5)][_0x2390c1(0x218)]),console[_0x2390c1(0x1a5)](_0x2390c1(0x1ab)+_0x579aaf[_0x2390c1(0x1b2)][_0x2390c1(0x1ae)][_0x2390c1(0x218)]);const _0x2d3bf0=_0x579aaf[_0x2390c1(0x1b2)][_0x2390c1(0x212)]['created']>0x0||_0x579aaf['counts'][_0x2390c1(0x1cf)]['created']>0x0;return _0x2d3bf0&&(console['log'](_0x2390c1(0x1c0)+_0x579aaf[_0x2390c1(0x1b2)][_0x2390c1(0x212)]['created']),console[_0x2390c1(0x1a5)]('\x20\x20Experimental\x20Artifacts:\x20'+_0x579aaf[_0x2390c1(0x1b2)][_0x2390c1(0x1cf)][_0x2390c1(0x218)])),0x0;}const _0x1dc0f6=_0x579aaf[_0x2390c1(0x1b2)][_0x2390c1(0x1e9)][_0x2390c1(0x177)]>0x0||_0x579aaf[_0x2390c1(0x1b2)][_0x2390c1(0x1f5)][_0x2390c1(0x177)]>0x0||_0x579aaf[_0x2390c1(0x1b2)][_0x2390c1(0x1ae)][_0x2390c1(0x177)]>0x0||_0x579aaf[_0x2390c1(0x1b2)][_0x2390c1(0x212)][_0x2390c1(0x177)]>0x0||_0x579aaf['counts'][_0x2390c1(0x1cf)][_0x2390c1(0x177)]>0x0;_0x1dc0f6?console[_0x2390c1(0x1a5)](a4_0x2a6b51['yellow'](_0x2390c1(0x1b1))):console[_0x2390c1(0x1a5)](a4_0x2a6b51['green']('Project\x20cloned\x20successfully'));console['log']('Source:\x20'+_0x579aaf['sourceProjectName']),console[_0x2390c1(0x1a5)](_0x2390c1(0x21f)+_0x579aaf[_0x2390c1(0x20c)]),console[_0x2390c1(0x1a5)]('New\x20project\x20ID:\x20'+_0x579aaf[_0x2390c1(0x214)]),console[_0x2390c1(0x1a5)](),console[_0x2390c1(0x1a5)](_0x2390c1(0x197)),console[_0x2390c1(0x1a5)](_0x2390c1(0x1a1)+formatCountSummary(_0x579aaf[_0x2390c1(0x1b2)][_0x2390c1(0x1e9)])),console[_0x2390c1(0x1a5)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x579aaf[_0x2390c1(0x1b2)]['knowledgeBases'])),console['log'](_0x2390c1(0x1ab)+formatCountSummary(_0x579aaf[_0x2390c1(0x1b2)][_0x2390c1(0x1ae)])),console[_0x2390c1(0x1a5)](_0x2390c1(0x190)+formatCountSummary(_0x579aaf[_0x2390c1(0x1b2)][_0x2390c1(0x204)]));const _0x2cf564=_0x579aaf[_0x2390c1(0x1b2)]['experimentalKnowledgeBases']['created']>0x0||_0x579aaf[_0x2390c1(0x1b2)][_0x2390c1(0x212)][_0x2390c1(0x1e7)]>0x0||_0x579aaf[_0x2390c1(0x1b2)][_0x2390c1(0x212)][_0x2390c1(0x1d6)]>0x0||_0x579aaf[_0x2390c1(0x1b2)][_0x2390c1(0x1cf)][_0x2390c1(0x218)]>0x0||_0x579aaf[_0x2390c1(0x1b2)][_0x2390c1(0x1cf)][_0x2390c1(0x1e7)]>0x0||_0x579aaf[_0x2390c1(0x1b2)]['experimentalArtifacts']['unchanged']>0x0;_0x2cf564&&(console['log'](_0x2390c1(0x1c0)+formatCountSummary(_0x579aaf[_0x2390c1(0x1b2)][_0x2390c1(0x212)])),console['log'](_0x2390c1(0x1dd)+formatCountSummary(_0x579aaf[_0x2390c1(0x1b2)]['experimentalArtifacts'])));if(_0x1dc0f6){console['log'](),console['log'](a4_0x2a6b51[_0x2390c1(0x1c7)](_0x2390c1(0x1f0)));for(const _0x594f6f of _0x579aaf[_0x2390c1(0x1e9)]){_0x594f6f[_0x2390c1(0x207)]===_0x2390c1(0x1a7)&&console[_0x2390c1(0x1a5)](a4_0x2a6b51[_0x2390c1(0x1c7)]('\x20\x20Agent\x20\x22'+_0x594f6f[_0x2390c1(0x1ad)]+_0x2390c1(0x1e0)+_0x594f6f[_0x2390c1(0x1a7)]));}for(const _0x73711a of _0x579aaf['knowledgeBases']){_0x73711a[_0x2390c1(0x207)]==='error'&&console['log'](a4_0x2a6b51['red'](_0x2390c1(0x208)+_0x73711a['name']+_0x2390c1(0x1e0)+_0x73711a['error']));}for(const _0x120189 of _0x579aaf['prompts']){_0x120189[_0x2390c1(0x207)]===_0x2390c1(0x1a7)&&console[_0x2390c1(0x1a5)](a4_0x2a6b51[_0x2390c1(0x1c7)](_0x2390c1(0x1e3)+_0x120189[_0x2390c1(0x182)]+_0x2390c1(0x1e0)+_0x120189[_0x2390c1(0x1a7)]));}for(const _0x2356a5 of _0x579aaf['integrations']){_0x2356a5[_0x2390c1(0x207)]===_0x2390c1(0x1a7)&&console[_0x2390c1(0x1a5)](a4_0x2a6b51[_0x2390c1(0x1c7)](_0x2390c1(0x1cb)+_0x2356a5[_0x2390c1(0x182)]+_0x2390c1(0x1e0)+_0x2356a5[_0x2390c1(0x1a7)]));}for(const _0x3155b6 of _0x579aaf[_0x2390c1(0x212)]){_0x3155b6[_0x2390c1(0x207)]===_0x2390c1(0x1a7)&&console[_0x2390c1(0x1a5)](a4_0x2a6b51[_0x2390c1(0x1c7)](_0x2390c1(0x1be)+_0x3155b6[_0x2390c1(0x182)]+_0x2390c1(0x1e0)+_0x3155b6[_0x2390c1(0x1a7)]));}for(const _0x2952c9 of _0x579aaf[_0x2390c1(0x1cf)]){_0x2952c9[_0x2390c1(0x207)]===_0x2390c1(0x1a7)&&console[_0x2390c1(0x1a5)](a4_0x2a6b51[_0x2390c1(0x1c7)](_0x2390c1(0x1c4)+_0x2952c9[_0x2390c1(0x182)]+_0x2390c1(0x1e0)+_0x2952c9[_0x2390c1(0x1a7)]));}return 0x1;}console['log']();const _0x5ea99a=getLLMProjectUrl(_0x1377fd,_0x579aaf[_0x2390c1(0x214)]);return console[_0x2390c1(0x1a5)](_0x2390c1(0x220)+a4_0x2a6b51[_0x2390c1(0x201)](_0x5ea99a)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x32ab7b(0x182)]=a4_0x32ab7b(0x1c3);[a4_0x32ab7b(0x18c)]=a4_0x32ab7b(0x1ef);async[a4_0x32ab7b(0x1fe)](_0x40a637){const _0x33b039=a4_0x32ab7b,{options:_0x3a8730,args:_0x14b324,tdx:_0x293a1c}=_0x40a637;let _0x1657dc=_0x14b324[0x0]||process['cwd']();const _0x58bda8=_0x3a8730['dryRun'],_0x11c350=_0x3a8730[_0x33b039(0x1ec)],_0x29999f=_0x3a8730['yes'],_0x4dc9f3=_0x3a8730[_0x33b039(0x206)],_0x284465=a4_0xa48faf['join'](_0x1657dc,_0x33b039(0x1bd)),_0x27fbeb=existsSync(_0x284465);if(_0x27fbeb){const {data:_0x1033f4}=await withSpinner(_0x33b039(0x1eb)+_0x1657dc+'\x22...',()=>_0x293a1c['llm'][_0x33b039(0x209)](_0x1657dc,{'dryRun':_0x58bda8,'force':_0x11c350}));if(_0x58bda8)return console[_0x33b039(0x1a5)](a4_0x2a6b51['yellow'](_0x33b039(0x1d7))),console[_0x33b039(0x1a5)](_0x33b039(0x19a)+_0x1033f4[_0x33b039(0x1ad)]),0x0;if(_0x1033f4[_0x33b039(0x207)]===_0x33b039(0x1a7))return console[_0x33b039(0x1a5)](a4_0x2a6b51['red']('Failed\x20to\x20push\x20agent:\x20'+_0x1033f4[_0x33b039(0x1a7)])),0x1;console[_0x33b039(0x1a5)](a4_0x2a6b51[_0x33b039(0x191)](_0x33b039(0x181)+_0x1033f4[_0x33b039(0x207)]+_0x33b039(0x196))),console[_0x33b039(0x1a5)](_0x33b039(0x1f1)+_0x1033f4[_0x33b039(0x1ad)]);if(_0x1033f4[_0x33b039(0x1b4)]&&_0x1033f4['projectId']){const _0x21a912=getLLMAgentChatUrl(_0x4dc9f3,_0x1033f4[_0x33b039(0x21c)],_0x1033f4[_0x33b039(0x1b4)]);console['log'](_0x33b039(0x215)+a4_0x2a6b51[_0x33b039(0x201)](_0x21a912));}return 0x0;}const _0x2560e9=_0x3a8730[_0x33b039(0x1e5)],_0xec0b7b=resolveProjectFromContext(_0x1657dc,_0x2560e9);if(_0xec0b7b['found'])_0x1657dc=_0xec0b7b[_0x33b039(0x1ed)],_0xec0b7b['source']===_0x33b039(0x19e)&&console['log'](a4_0x2a6b51[_0x33b039(0x20b)](_0x33b039(0x1c6)+_0x1657dc));else{let _0x24b676=_0x33b039(0x179);_0xec0b7b['reason']==='no_local_folder'&&(_0x24b676=_0xec0b7b[_0x33b039(0x1f7)]+_0x33b039(0x1d8)+_0xec0b7b['llmProject']+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode[_0x33b039(0x18f)],_0xec0b7b[_0x33b039(0x1db)]===_0x33b039(0x18a)?_0xec0b7b[_0x33b039(0x1f7)]:_0x33b039(0x187)+_0x1657dc,undefined,{'helpText':_0x24b676});}const {data:_0x5eea2e}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x293a1c[_0x33b039(0x1cd)]['pushProject'](_0x1657dc,{'dryRun':!![]})),_0x5ec701=_0x5eea2e[_0x33b039(0x1b2)][_0x33b039(0x1e9)][_0x33b039(0x177)]>0x0;if(_0x5ec701){console[_0x33b039(0x1a5)](a4_0x2a6b51[_0x33b039(0x1c7)]('\x0aErrors\x20found:'));for(const _0x17fc17 of _0x5eea2e[_0x33b039(0x1e9)]){_0x17fc17[_0x33b039(0x207)]===_0x33b039(0x1a7)&&console['log'](a4_0x2a6b51['red']('\x20\x20Agent\x20\x22'+_0x17fc17[_0x33b039(0x1ad)]+'\x22:\x20'+_0x17fc17[_0x33b039(0x1a7)]));}return 0x1;}const _0x4ab97c=_0x5eea2e[_0x33b039(0x1b2)]['agents']['created']+_0x5eea2e['counts'][_0x33b039(0x1f5)][_0x33b039(0x218)]+_0x5eea2e[_0x33b039(0x1b2)][_0x33b039(0x17a)]['created']+_0x5eea2e['counts'][_0x33b039(0x1ae)][_0x33b039(0x218)]+_0x5eea2e[_0x33b039(0x1b2)][_0x33b039(0x204)][_0x33b039(0x218)]+_0x5eea2e[_0x33b039(0x1b2)][_0x33b039(0x212)][_0x33b039(0x218)]+_0x5eea2e[_0x33b039(0x1b2)][_0x33b039(0x1cf)]['created'],_0x16dda3=_0x5eea2e['counts'][_0x33b039(0x1e9)]['updated']+_0x5eea2e['counts'][_0x33b039(0x1f5)][_0x33b039(0x1e7)]+_0x5eea2e['counts'][_0x33b039(0x17a)][_0x33b039(0x1e7)]+_0x5eea2e[_0x33b039(0x1b2)][_0x33b039(0x1ae)][_0x33b039(0x1e7)]+_0x5eea2e[_0x33b039(0x1b2)]['integrations'][_0x33b039(0x1e7)]+_0x5eea2e[_0x33b039(0x1b2)][_0x33b039(0x212)][_0x33b039(0x1e7)]+_0x5eea2e['counts'][_0x33b039(0x1cf)][_0x33b039(0x1e7)],_0xf1d143=_0x5eea2e['counts'][_0x33b039(0x1e9)]['unchanged']+_0x5eea2e[_0x33b039(0x1b2)][_0x33b039(0x1f5)][_0x33b039(0x1d6)]+_0x5eea2e['counts'][_0x33b039(0x17a)][_0x33b039(0x1d6)]+_0x5eea2e[_0x33b039(0x1b2)][_0x33b039(0x1ae)][_0x33b039(0x1d6)]+_0x5eea2e[_0x33b039(0x1b2)]['integrations']['unchanged']+_0x5eea2e[_0x33b039(0x1b2)][_0x33b039(0x212)][_0x33b039(0x1d6)]+_0x5eea2e[_0x33b039(0x1b2)][_0x33b039(0x1cf)]['unchanged'];console['log'](_0x33b039(0x1ea)+_0x5eea2e[_0x33b039(0x188)]+'\x27:'),console[_0x33b039(0x1a5)]('\x20\x20'+a4_0x2a6b51[_0x33b039(0x191)]('+\x20'+_0x4ab97c+_0x33b039(0x18b))+_0x33b039(0x19c)+a4_0x2a6b51[_0x33b039(0x17d)]('~\x20'+_0x16dda3+'\x20changed')+_0x33b039(0x19c)+a4_0x2a6b51['dim']('=\x20'+_0xf1d143+_0x33b039(0x1a9))),console[_0x33b039(0x1a5)]('\x20\x20Agents:\x20'+formatCountSummary(_0x5eea2e['counts'][_0x33b039(0x1e9)])),console[_0x33b039(0x1a5)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x5eea2e['counts'][_0x33b039(0x1f5)])),console[_0x33b039(0x1a5)](_0x33b039(0x1f9)+formatCountSummary(_0x5eea2e[_0x33b039(0x1b2)]['textKnowledgeBases'])),console[_0x33b039(0x1a5)](_0x33b039(0x1ab)+formatCountSummary(_0x5eea2e[_0x33b039(0x1b2)][_0x33b039(0x1ae)])),console[_0x33b039(0x1a5)](_0x33b039(0x190)+formatCountSummary(_0x5eea2e['counts'][_0x33b039(0x204)]));const _0x920b77=_0x5eea2e[_0x33b039(0x1b2)][_0x33b039(0x212)][_0x33b039(0x218)]>0x0||_0x5eea2e['counts'][_0x33b039(0x212)][_0x33b039(0x1e7)]>0x0||_0x5eea2e[_0x33b039(0x1b2)][_0x33b039(0x212)][_0x33b039(0x1d6)]>0x0||_0x5eea2e[_0x33b039(0x1b2)][_0x33b039(0x1cf)][_0x33b039(0x218)]>0x0||_0x5eea2e[_0x33b039(0x1b2)]['experimentalArtifacts'][_0x33b039(0x1e7)]>0x0||_0x5eea2e[_0x33b039(0x1b2)][_0x33b039(0x1cf)][_0x33b039(0x1d6)]>0x0;_0x920b77&&(console[_0x33b039(0x1a5)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x5eea2e[_0x33b039(0x1b2)][_0x33b039(0x212)])),console[_0x33b039(0x1a5)](_0x33b039(0x1dd)+formatCountSummary(_0x5eea2e[_0x33b039(0x1b2)][_0x33b039(0x1cf)])));console['log']('\x20\x20Source:\x20'+a4_0x2a6b51[_0x33b039(0x201)](_0x1657dc)),displayDiffs(_0x5eea2e[_0x33b039(0x1e9)],_0x5eea2e[_0x33b039(0x1f5)],_0x5eea2e['textKnowledgeBases'],_0x5eea2e[_0x33b039(0x1ae)],_0x5eea2e[_0x33b039(0x204)],_0x5eea2e[_0x33b039(0x212)],_0x5eea2e[_0x33b039(0x1cf)]);if(_0x58bda8)return console[_0x33b039(0x1a5)](a4_0x2a6b51[_0x33b039(0x17d)](_0x33b039(0x1d9))),0x0;if(_0x4ab97c===0x0&&_0x16dda3===0x0){console[_0x33b039(0x1a5)](a4_0x2a6b51['green'](_0x33b039(0x217)));const _0x394988=getLLMProjectUrl(_0x4dc9f3,_0x5eea2e[_0x33b039(0x21c)]);return console[_0x33b039(0x1a5)](_0x33b039(0x220)+a4_0x2a6b51['cyan'](_0x394988)),0x0;}if(!_0x29999f&&!_0x11c350){if(!isInteractive())return console[_0x33b039(0x1a7)](a4_0x2a6b51[_0x33b039(0x1c7)](_0x33b039(0x189)),_0x33b039(0x186)),console['error'](a4_0x2a6b51[_0x33b039(0x20b)](_0x33b039(0x1b5))),0x1;const _0x55f147=await confirmKey(_0x33b039(0x18e)+(_0x4ab97c+_0x16dda3)+_0x33b039(0x173));if(!_0x55f147)return console[_0x33b039(0x1a5)](a4_0x2a6b51[_0x33b039(0x17d)](_0x33b039(0x19d)),_0x33b039(0x21a)),0x1;}const {data:_0x29940b}=await withSpinner(_0x33b039(0x1ac),()=>_0x293a1c[_0x33b039(0x1cd)][_0x33b039(0x1c9)](_0x1657dc,{'force':_0x11c350})),_0x5ac7db=_0x29940b[_0x33b039(0x1b2)]['agents'][_0x33b039(0x177)]>0x0||_0x29940b['counts'][_0x33b039(0x1f5)][_0x33b039(0x177)]>0x0||_0x29940b[_0x33b039(0x1b2)]['textKnowledgeBases']['errors']>0x0||_0x29940b[_0x33b039(0x1b2)][_0x33b039(0x1ae)][_0x33b039(0x177)]>0x0;if(_0x5ac7db){console[_0x33b039(0x1a5)](a4_0x2a6b51[_0x33b039(0x17d)](_0x33b039(0x172))),console[_0x33b039(0x1a5)](),console[_0x33b039(0x1a5)](a4_0x2a6b51['red'](_0x33b039(0x1f0)));for(const _0xe35d57 of _0x29940b[_0x33b039(0x1e9)]){_0xe35d57[_0x33b039(0x207)]==='error'&&console[_0x33b039(0x1a5)](a4_0x2a6b51['red']('\x20\x20Agent\x20\x22'+_0xe35d57['agentName']+_0x33b039(0x1e0)+_0xe35d57[_0x33b039(0x1a7)]));}for(const _0x27ea12 of _0x29940b[_0x33b039(0x1f5)]){_0x27ea12['action']===_0x33b039(0x1a7)&&console[_0x33b039(0x1a5)](a4_0x2a6b51[_0x33b039(0x1c7)](_0x33b039(0x208)+_0x27ea12[_0x33b039(0x182)]+_0x33b039(0x1e0)+_0x27ea12[_0x33b039(0x1a7)]));}for(const _0x4e6a57 of _0x29940b[_0x33b039(0x17a)]){_0x4e6a57[_0x33b039(0x207)]===_0x33b039(0x1a7)&&console[_0x33b039(0x1a5)](a4_0x2a6b51[_0x33b039(0x1c7)]('\x20\x20Text\x20Knowledge\x20Base\x20\x22'+_0x4e6a57['name']+'\x22:\x20'+_0x4e6a57[_0x33b039(0x1a7)]));}for(const _0x31dacc of _0x29940b[_0x33b039(0x1ae)]){_0x31dacc[_0x33b039(0x207)]===_0x33b039(0x1a7)&&console[_0x33b039(0x1a5)](a4_0x2a6b51[_0x33b039(0x1c7)]('\x20\x20Prompt\x20\x22'+_0x31dacc['name']+_0x33b039(0x1e0)+_0x31dacc['error']));}for(const _0xae1120 of _0x29940b[_0x33b039(0x204)]){_0xae1120[_0x33b039(0x207)]===_0x33b039(0x1a7)&&console[_0x33b039(0x1a5)](a4_0x2a6b51[_0x33b039(0x1c7)](_0x33b039(0x1cb)+_0xae1120[_0x33b039(0x182)]+_0x33b039(0x1e0)+_0xae1120[_0x33b039(0x1a7)]));}return 0x1;}console[_0x33b039(0x1a5)](a4_0x2a6b51[_0x33b039(0x191)](_0x33b039(0x1d1)+(_0x4ab97c+_0x16dda3)+'\x20resources\x20to\x20\x27'+_0x29940b[_0x33b039(0x188)]+'\x27'));const _0x4d69f0=getLLMProjectUrl(_0x4dc9f3,_0x29940b[_0x33b039(0x21c)]);return console[_0x33b039(0x1a5)](_0x33b039(0x220)+a4_0x2a6b51[_0x33b039(0x201)](_0x4d69f0)),0x0;}}
|
|
1
|
+
const a4_0x2ab4e6=a4_0x41fe;(function(_0x35b745,_0x5d7af1){const _0x3926c5=a4_0x41fe,_0xa112a7=_0x35b745();while(!![]){try{const _0x5cfc3f=-parseInt(_0x3926c5(0x19f))/0x1*(-parseInt(_0x3926c5(0x22b))/0x2)+-parseInt(_0x3926c5(0x242))/0x3*(-parseInt(_0x3926c5(0x1e7))/0x4)+parseInt(_0x3926c5(0x1ea))/0x5*(-parseInt(_0x3926c5(0x22d))/0x6)+parseInt(_0x3926c5(0x1af))/0x7+parseInt(_0x3926c5(0x230))/0x8*(-parseInt(_0x3926c5(0x22e))/0x9)+parseInt(_0x3926c5(0x1b7))/0xa*(parseInt(_0x3926c5(0x1bd))/0xb)+-parseInt(_0x3926c5(0x23a))/0xc;if(_0x5cfc3f===_0x5d7af1)break;else _0xa112a7['push'](_0xa112a7['shift']());}catch(_0xf702a8){_0xa112a7['push'](_0xa112a7['shift']());}}}(a4_0x346b,0x9603d));import a4_0x56c742 from'chalk';import a4_0x1af98c from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a4_0x346b(){const _0xeda3c5=['created','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x0aErrors\x20found:','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x20created','outputDir','\x20updated','push','\x22...','Using\x20local\x20project:\x20','errors','yes','Dry\x20run\x20-\x20no\x20files\x20written','\x20\x20Agent\x20\x22','agentName','\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)','prompts','\x0aChanges\x20to\x20agent\x20\x27','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','reason','Cancelled','\x20\x20Agents:\x20','\x20\x20tdx\x20agent\x20clone\x20agents/','Pulling\x20agent\x20\x22','Would\x20pull\x20agent:\x20','newProjectName','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','projectName','total','Clone\x20\x22','pushProject','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','counts','New\x20project:\x20','MISSING_ARGUMENT','\x20\x20Knowledge\x20Base\x20\x22','experimentalArtifacts','repeat','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','projectDir','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','\x20\x20Prompts:\x20','agentId','Dry\x20run\x20-\x20no\x20changes\x20made','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','Project:\x20','Project\x20cloned\x20with\x20errors','parse','\x20\x20Knowledge\x20Bases:\x20','-\x20no\x20files\x20written','\x0aWrite\x20','dim','experimentalKnowledgeBases','580WGpukR','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','308634hrPxtr','24237rrTaqc','✔\x20Context\x20set:\x20','488FNQRSh','yellow','\x20\x20Target:\x20','action','error','hasChanges','no_context','tdx.json','Using\x20project:\x20','\x20\x20Experimental\x20Artifacts:\x20','14027460GBXHlw','llm_project','\x20total','agent:clone','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','red','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','3ksalXG','integrations','execute','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','Using\x20current\x20project:\x20','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','agent','source','Project\x20cloned\x20successfully','site','\x20\x20Source:\x20','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','pushAgent','green','Source:\x20','llmProject','message','projectId','\x0aChanges:','utf-8','457eAudnv','\x20unchanged','Would\x20push\x20agent:\x20','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','Agent:\x20','gray','llm','\x22\x20from\x20project\x20\x22','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Cannot\x20clone\x20from\x20context\x20project\x20\x22','\x20successfully','\x22\x20to\x20\x22','\x0aPull\x20summary\x20for\x20\x27','description','Pushing\x20agent\x20from\x20\x22','6572475hwsRUW','agents','\x20resources\x20to\x20\x27','New\x20project\x20name\x20is\x20required','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','log','context','\x20changed','70wZAMSO','\x0aPush\x20','\x0a✔\x20Pushed\x20','INVALID_ARGUMENT','\x22:\x20','\x20=\x20','1415898BSkgnk','\x0aChanges\x20to\x20prompt\x20\x27','unchanged','cyan','\x20new','pullAgent','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','\x0aPush\x20summary\x20for\x20\x27','Using\x20context\x20project:\x20','-\x20nothing\x20pushed','\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','agent:pull','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','Analyzing\x20project\x20\x22','new','textKnowledgeBases','newProjectId','session','\x20\x20Experimental\x20Artifact\x20\x22','\x20|\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','profile','\x20\x20Prompt\x20\x22','Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','diff','\x20\x20Integration\x20\x22','Agent\x20pulled\x20successfully','sourceProjectName','dirname','dryRun','\x0aChanges\x20to\x20integration\x20\x27','force','name','Output\x20path:\x20','Would\x20clone:','updated','join','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','No\x20tdx.json\x20found\x20in\x20','<new-name>','Agent\x20','1341124KuiIMT','\x20\x20Integrations:\x20','\x20errors','35OnFkju','Status:\x20','Cloning\x20\x22','cwd','knowledgeBases','pullProject','\x20resources?','\x27\x20to\x20create\x20the\x20folder\x20structure.','Output:\x20','cwd-config','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Errors:'];a4_0x346b=function(){return _0xeda3c5;};return a4_0x346b();}import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';function a4_0x41fe(_0x4b037b,_0xaeace8){_0x4b037b=_0x4b037b-0x194;const _0x346bff=a4_0x346b();let _0x41fea4=_0x346bff[_0x4b037b];return _0x41fea4;}import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x1cfe98){const _0x238a43=a4_0x41fe,_0x2676c2=[];if(_0x1cfe98[_0x238a43(0x212)]!==undefined)_0x2676c2[_0x238a43(0x1fd)](_0x1cfe98[_0x238a43(0x212)]+_0x238a43(0x23c));if(_0x1cfe98[_0x238a43(0x1cc)]!==undefined&&_0x1cfe98[_0x238a43(0x1cc)]>0x0)_0x2676c2[_0x238a43(0x1fd)](a4_0x56c742[_0x238a43(0x198)](_0x1cfe98[_0x238a43(0x1cc)]+_0x238a43(0x1c1)));if(_0x1cfe98[_0x238a43(0x1f6)]!==undefined&&_0x1cfe98[_0x238a43(0x1f6)]>0x0)_0x2676c2[_0x238a43(0x1fd)](a4_0x56c742[_0x238a43(0x198)](_0x1cfe98[_0x238a43(0x1f6)]+_0x238a43(0x1fa)));if(_0x1cfe98['updated']!==undefined&&_0x1cfe98['updated']>0x0)_0x2676c2[_0x238a43(0x1fd)](a4_0x56c742[_0x238a43(0x231)](_0x1cfe98[_0x238a43(0x1e1)]+_0x238a43(0x1fc)));if(_0x1cfe98[_0x238a43(0x1bf)]!==undefined&&_0x1cfe98[_0x238a43(0x1bf)]>0x0)_0x2676c2[_0x238a43(0x1fd)](a4_0x56c742[_0x238a43(0x1a4)](_0x1cfe98[_0x238a43(0x1bf)]+_0x238a43(0x1a0)));if(_0x1cfe98[_0x238a43(0x200)]!==undefined&&_0x1cfe98[_0x238a43(0x200)]>0x0)_0x2676c2[_0x238a43(0x1fd)](a4_0x56c742[_0x238a43(0x23f)](_0x1cfe98['errors']+_0x238a43(0x1e9)));return _0x2676c2['join'](',\x20');}function displayDiffs(_0x596569,_0x59ed71,_0x36acbc,_0x2ebb3a,_0x5f2926,_0x3f6bf2,_0x3c31bc){const _0x249fc8=a4_0x41fe;for(const _0x491c17 of _0x596569){if(_0x491c17[_0x249fc8(0x1d6)]){const _0x4cdece=_0x491c17[_0x249fc8(0x204)]||_0x491c17['name'];console[_0x249fc8(0x1b4)](_0x249fc8(0x207)+_0x4cdece+'\x27:'),console[_0x249fc8(0x1b4)]('─'[_0x249fc8(0x21b)](0x3c)),console['log'](_0x491c17[_0x249fc8(0x1d6)]),console[_0x249fc8(0x1b4)]('─'['repeat'](0x3c));}}for(const _0x43d518 of _0x59ed71){_0x43d518['diff']&&(console['log']('\x0aChanges\x20to\x20knowledge\x20base\x20\x27'+_0x43d518[_0x249fc8(0x1de)]+'\x27:'),console[_0x249fc8(0x1b4)]('─'['repeat'](0x3c)),console[_0x249fc8(0x1b4)](_0x43d518[_0x249fc8(0x1d6)]),console[_0x249fc8(0x1b4)]('─'['repeat'](0x3c)));}for(const _0x55b04b of _0x36acbc){_0x55b04b['diff']&&(console[_0x249fc8(0x1b4)](_0x249fc8(0x240)+_0x55b04b['name']+'\x27:'),console['log']('─'[_0x249fc8(0x21b)](0x3c)),console[_0x249fc8(0x1b4)](_0x55b04b[_0x249fc8(0x1d6)]),console[_0x249fc8(0x1b4)]('─'['repeat'](0x3c)));}for(const _0x2b9917 of _0x2ebb3a){_0x2b9917[_0x249fc8(0x1d6)]&&(console[_0x249fc8(0x1b4)](_0x249fc8(0x1be)+_0x2b9917['name']+'\x27:'),console[_0x249fc8(0x1b4)]('─'[_0x249fc8(0x21b)](0x3c)),console[_0x249fc8(0x1b4)](_0x2b9917[_0x249fc8(0x1d6)]),console[_0x249fc8(0x1b4)]('─'['repeat'](0x3c)));}for(const _0x35760a of _0x5f2926){_0x35760a[_0x249fc8(0x1d6)]&&(console[_0x249fc8(0x1b4)](_0x249fc8(0x1dc)+_0x35760a[_0x249fc8(0x1de)]+'\x27:'),console[_0x249fc8(0x1b4)]('─'[_0x249fc8(0x21b)](0x3c)),console[_0x249fc8(0x1b4)](_0x35760a[_0x249fc8(0x1d6)]),console['log']('─'[_0x249fc8(0x21b)](0x3c)));}for(const _0x155302 of _0x3f6bf2){_0x155302[_0x249fc8(0x1d6)]&&(console['log']('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x155302[_0x249fc8(0x1de)]+'\x27:'),console[_0x249fc8(0x1b4)]('─'[_0x249fc8(0x21b)](0x3c)),console[_0x249fc8(0x1b4)](_0x155302['diff']),console[_0x249fc8(0x1b4)]('─'['repeat'](0x3c)));}for(const _0x10ff04 of _0x3c31bc){_0x10ff04[_0x249fc8(0x1d6)]&&(console[_0x249fc8(0x1b4)](_0x249fc8(0x1a2)+_0x10ff04[_0x249fc8(0x1de)]+'\x27:'),console[_0x249fc8(0x1b4)]('─'['repeat'](0x3c)),console[_0x249fc8(0x1b4)](_0x10ff04[_0x249fc8(0x1d6)]),console[_0x249fc8(0x1b4)]('─'[_0x249fc8(0x21b)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x2ab4e6(0x1de)]=a4_0x2ab4e6(0x1c9);['description']='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async['execute'](_0x15879a){const _0x337f06=a4_0x2ab4e6,{options:_0x3c54d5,args:_0x34d96b,tdx:_0x4bcb37}=_0x15879a,_0x557b52=_0x34d96b[0x0],_0x3cb794=_0x34d96b[0x1],_0x3fe671=_0x3c54d5['output'],_0x17cf90=_0x3c54d5[_0x337f06(0x1db)],_0x30b045=_0x3c54d5['force'],_0x3f7761=_0x3c54d5[_0x337f06(0x201)],_0x23d9aa=_0x3c54d5[_0x337f06(0x19a)],_0x500ba2=_0x3c54d5[_0x337f06(0x248)];let _0x31cef4;if(_0x557b52){const _0x21637f=a4_0x1af98c[_0x337f06(0x1e2)](_0x557b52,_0x337f06(0x237));if(existsSync(_0x21637f))try{const _0x527eb6=JSON[_0x337f06(0x225)](readFileSync(_0x21637f,_0x337f06(0x19e)));_0x527eb6[_0x337f06(0x23b)]&&(_0x31cef4={'llm_project':_0x527eb6[_0x337f06(0x23b)]});}catch{}}const _0x10cc5e=findAgentConfigPath(process[_0x337f06(0x1ed)]());let _0x5d6fb;if(_0x10cc5e)try{const _0x112fbf=JSON[_0x337f06(0x225)](readFileSync(_0x10cc5e,_0x337f06(0x19e)));_0x112fbf[_0x337f06(0x23b)]&&(_0x5d6fb={'llm_project':_0x112fbf[_0x337f06(0x23b)]});}catch{}const _0x3b1ba0=resolveAgentPullArgs({'arg':_0x557b52,'agentNameArg':_0x3cb794,'agentFlag':_0x500ba2,'contextProject':_0x23d9aa,'argDirConfig':_0x31cef4,'cwdConfigPath':_0x10cc5e||undefined,'cwdConfig':_0x5d6fb}),{projectNameOrId:_0x3c80ef,targetAgentName:_0xb2b658,existingOutputDir:_0x48f5a1,source:_0x4bd8e9}=_0x3b1ba0;if(_0x4bd8e9==='arg-dir')console[_0x337f06(0x1b4)](a4_0x56c742[_0x337f06(0x229)]('Using\x20project\x20from\x20'+a4_0x1af98c[_0x337f06(0x1e2)](_0x557b52,_0x337f06(0x237))+':\x20'+_0x3c80ef));else{if(_0x4bd8e9===_0x337f06(0x1f3))console[_0x337f06(0x1b4)](a4_0x56c742[_0x337f06(0x229)](_0x337f06(0x238)+_0x3c80ef));else _0x4bd8e9===_0x337f06(0x1b5)&&console[_0x337f06(0x1b4)](a4_0x56c742[_0x337f06(0x229)]('Using\x20project\x20from\x20context:\x20'+_0x3c80ef));}if(!_0x3c80ef)return _0x500ba2?(console[_0x337f06(0x1b4)](a4_0x56c742[_0x337f06(0x231)](_0x337f06(0x1c3))),console[_0x337f06(0x1b4)](_0x337f06(0x21e)),console[_0x337f06(0x1b4)](_0x337f06(0x1c4))):(console[_0x337f06(0x1b4)](a4_0x56c742['yellow'](_0x337f06(0x1b3))),console[_0x337f06(0x1b4)](_0x337f06(0x1d5)),console[_0x337f06(0x1b4)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project'),console[_0x337f06(0x1b4)](_0x337f06(0x1d2)),console[_0x337f06(0x1b4)](_0x337f06(0x1c8)),console['log']('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project')),0x1;if(_0xb2b658){const {data:_0x29bd4e}=await withSpinner(_0x337f06(0x20d)+_0xb2b658+_0x337f06(0x1a6)+_0x3c80ef+_0x337f06(0x1fe),()=>_0x4bcb37[_0x337f06(0x1a5)][_0x337f06(0x1c2)](_0x3c80ef,_0xb2b658,_0x3fe671,{'dryRun':_0x17cf90,'force':_0x30b045}));if(_0x17cf90)return console[_0x337f06(0x1b4)](a4_0x56c742['yellow'](_0x337f06(0x202))),console['log'](_0x337f06(0x20e)+_0x29bd4e[_0x337f06(0x204)]),console['log'](_0x337f06(0x1df)+_0x29bd4e['outputPath']),_0x29bd4e[_0x337f06(0x1d6)]&&(console[_0x337f06(0x1b4)](_0x337f06(0x19d)),console['log']('─'[_0x337f06(0x21b)](0x3c)),console['log'](_0x29bd4e['diff']),console['log']('─'[_0x337f06(0x21b)](0x3c))),0x0;return console['log'](a4_0x56c742[_0x337f06(0x198)](_0x337f06(0x1d8))),console[_0x337f06(0x1b4)]('Agent:\x20'+_0x29bd4e[_0x337f06(0x204)]),console[_0x337f06(0x1b4)](_0x337f06(0x1f2)+_0x29bd4e['outputPath']),console['log'](_0x337f06(0x1eb)+(_0x29bd4e['isNew']?a4_0x56c742['green'](_0x337f06(0x1cc)):_0x29bd4e[_0x337f06(0x235)]?a4_0x56c742[_0x337f06(0x231)](_0x337f06(0x1e1)):a4_0x56c742['gray'](_0x337f06(0x1bf)))),0x0;}const _0x32ff6f=_0x48f5a1||_0x3fe671,{data:_0x92d3a0}=await withSpinner(_0x337f06(0x1cb)+_0x3c80ef+'\x22...',()=>_0x4bcb37['llm'][_0x337f06(0x1ef)](_0x3c80ef,_0x32ff6f,{'dryRun':!![]})),_0x532742=_0x92d3a0[_0x337f06(0x216)][_0x337f06(0x1b0)][_0x337f06(0x1cc)]+_0x92d3a0[_0x337f06(0x216)][_0x337f06(0x1ee)][_0x337f06(0x1cc)]+_0x92d3a0[_0x337f06(0x216)]['textKnowledgeBases'][_0x337f06(0x1cc)]+_0x92d3a0[_0x337f06(0x216)][_0x337f06(0x206)][_0x337f06(0x1cc)]+_0x92d3a0['counts'][_0x337f06(0x243)][_0x337f06(0x1cc)]+_0x92d3a0[_0x337f06(0x216)][_0x337f06(0x22a)][_0x337f06(0x1cc)]+_0x92d3a0[_0x337f06(0x216)][_0x337f06(0x21a)][_0x337f06(0x1cc)],_0x1de07c=_0x92d3a0[_0x337f06(0x216)][_0x337f06(0x1b0)][_0x337f06(0x1e1)]+_0x92d3a0['counts']['knowledgeBases']['updated']+_0x92d3a0[_0x337f06(0x216)][_0x337f06(0x1cd)][_0x337f06(0x1e1)]+_0x92d3a0[_0x337f06(0x216)]['prompts'][_0x337f06(0x1e1)]+_0x92d3a0[_0x337f06(0x216)]['integrations'][_0x337f06(0x1e1)]+_0x92d3a0['counts'][_0x337f06(0x22a)]['updated']+_0x92d3a0[_0x337f06(0x216)]['experimentalArtifacts'][_0x337f06(0x1e1)],_0x111c27=_0x92d3a0[_0x337f06(0x216)]['agents'][_0x337f06(0x1bf)]+_0x92d3a0[_0x337f06(0x216)]['knowledgeBases'][_0x337f06(0x1bf)]+_0x92d3a0[_0x337f06(0x216)][_0x337f06(0x1cd)][_0x337f06(0x1bf)]+_0x92d3a0[_0x337f06(0x216)][_0x337f06(0x206)]['unchanged']+_0x92d3a0[_0x337f06(0x216)][_0x337f06(0x243)][_0x337f06(0x1bf)]+_0x92d3a0['counts'][_0x337f06(0x22a)][_0x337f06(0x1bf)]+_0x92d3a0[_0x337f06(0x216)][_0x337f06(0x21a)]['unchanged'];console[_0x337f06(0x1b4)](_0x337f06(0x1ac)+_0x92d3a0['projectName']+'\x27:'),console[_0x337f06(0x1b4)]('\x20\x20'+a4_0x56c742['green']('+\x20'+_0x532742+_0x337f06(0x1c1))+_0x337f06(0x1d1)+a4_0x56c742['yellow']('~\x20'+_0x1de07c+_0x337f06(0x1b6))+'\x20|\x20'+a4_0x56c742[_0x337f06(0x229)]('=\x20'+_0x111c27+_0x337f06(0x1a0))),console['log'](_0x337f06(0x20b)+formatCountSummary(_0x92d3a0['counts'][_0x337f06(0x1b0)])),console['log'](_0x337f06(0x226)+formatCountSummary(_0x92d3a0['counts'][_0x337f06(0x1ee)])),console[_0x337f06(0x1b4)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x92d3a0[_0x337f06(0x216)][_0x337f06(0x1cd)])),console[_0x337f06(0x1b4)](_0x337f06(0x21f)+formatCountSummary(_0x92d3a0[_0x337f06(0x216)]['prompts'])),console['log'](_0x337f06(0x1e8)+formatCountSummary(_0x92d3a0[_0x337f06(0x216)]['integrations']));const _0x412bfa=_0x92d3a0[_0x337f06(0x216)]['experimentalKnowledgeBases'][_0x337f06(0x212)]>0x0||_0x92d3a0[_0x337f06(0x216)][_0x337f06(0x21a)]['total']>0x0;_0x412bfa&&(console[_0x337f06(0x1b4)](_0x337f06(0x241)+formatCountSummary(_0x92d3a0[_0x337f06(0x216)][_0x337f06(0x22a)])),console['log']('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x92d3a0[_0x337f06(0x216)]['experimentalArtifacts'])));console[_0x337f06(0x1b4)](_0x337f06(0x232)+a4_0x56c742[_0x337f06(0x1c0)](_0x92d3a0[_0x337f06(0x1fb)])),displayDiffs(_0x92d3a0[_0x337f06(0x1b0)],_0x92d3a0[_0x337f06(0x1ee)],_0x92d3a0[_0x337f06(0x1cd)],_0x92d3a0['prompts'],_0x92d3a0['integrations'],_0x92d3a0[_0x337f06(0x22a)],_0x92d3a0['experimentalArtifacts']);if(_0x17cf90)return console['log'](a4_0x56c742[_0x337f06(0x231)](_0x337f06(0x1a8))),0x0;if(_0x532742===0x0&&_0x1de07c===0x0)return console[_0x337f06(0x1b4)](a4_0x56c742[_0x337f06(0x198)](_0x337f06(0x210))),saveSessionContext({'llm_project':_0x92d3a0['projectName']},_0x3c54d5[_0x337f06(0x1cf)]),console['log'](a4_0x56c742[_0x337f06(0x198)](_0x337f06(0x22f)+a4_0x56c742[_0x337f06(0x229)]('llm_project')+_0x337f06(0x1bc)+a4_0x56c742[_0x337f06(0x1c0)](_0x92d3a0['projectName']))),0x0;if(!_0x3f7761&&!_0x30b045){if(!isInteractive())return console['error'](a4_0x56c742['red']('\x0aError:'),_0x337f06(0x1f4)),console[_0x337f06(0x234)](a4_0x56c742['dim'](_0x337f06(0x215))),0x1;const _0x3c4b41=await confirmKey(_0x337f06(0x228)+(_0x532742+_0x1de07c)+'\x20files?');if(!_0x3c4b41)return console['log'](a4_0x56c742[_0x337f06(0x231)](_0x337f06(0x20a)),_0x337f06(0x227)),0x1;}const {data:_0x5d973a}=await withSpinner('Writing\x20files...',()=>_0x4bcb37[_0x337f06(0x1a5)][_0x337f06(0x1ef)](_0x3c80ef,_0x32ff6f,{'force':_0x30b045}));return console[_0x337f06(0x1b4)](a4_0x56c742['green']('\x0a✔\x20Pulled\x20'+(_0x532742+_0x1de07c)+'\x20files\x20to\x20'+_0x5d973a[_0x337f06(0x1fb)])),saveSessionContext({'llm_project':_0x5d973a[_0x337f06(0x211)]},_0x3c54d5[_0x337f06(0x1cf)]),console['log'](a4_0x56c742['green']('✔\x20Context\x20set:\x20'+a4_0x56c742[_0x337f06(0x229)](_0x337f06(0x23b))+'\x20=\x20'+a4_0x56c742[_0x337f06(0x1c0)](_0x5d973a[_0x337f06(0x211)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']=a4_0x2ab4e6(0x23d);['description']='Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project';async[a4_0x2ab4e6(0x244)](_0x281670){const _0x17b04a=a4_0x2ab4e6,{options:_0x1d16d3,args:_0x5330a3,tdx:_0x4f94cd}=_0x281670,_0x41e8dd=_0x5330a3[0x0],_0x4966aa=_0x1d16d3[_0x17b04a(0x1de)],_0xab7299=_0x1d16d3[_0x17b04a(0x1db)],_0x5540c6=_0x1d16d3[_0x17b04a(0x201)],_0x14c2a3=_0x1d16d3[_0x17b04a(0x194)],_0x2b4a07=_0x1d16d3[_0x17b04a(0x19a)];let _0x1cfe2c;const _0x5b996f=findAgentConfigPath(process[_0x17b04a(0x1ed)]());if(_0x41e8dd){const _0x173d52=a4_0x1af98c[_0x17b04a(0x1e2)](_0x41e8dd,'tdx.json');existsSync(_0x173d52)?(_0x1cfe2c=_0x41e8dd,console[_0x17b04a(0x1b4)](a4_0x56c742['dim'](_0x17b04a(0x1ff)+_0x41e8dd))):_0x1cfe2c=_0x41e8dd;}else{if(_0x5b996f)_0x1cfe2c=a4_0x1af98c['dirname'](_0x5b996f),console[_0x17b04a(0x1b4)](a4_0x56c742[_0x17b04a(0x229)](_0x17b04a(0x246)+_0x1cfe2c));else{if(_0x2b4a07){const _0x1db3cd=sanitizeForFilesystem(_0x2b4a07);let _0x5b1a0c=_0x1db3cd,_0x56adb5=a4_0x1af98c['join'](process['cwd'](),_0x17b04a(0x1b0),_0x1db3cd,_0x17b04a(0x237));if(!existsSync(_0x56adb5)){const _0x4bdaa3=normalizeName(_0x2b4a07),_0x43bb09=a4_0x1af98c[_0x17b04a(0x1e2)](process[_0x17b04a(0x1ed)](),_0x17b04a(0x1b0),_0x4bdaa3,_0x17b04a(0x237));existsSync(_0x43bb09)&&(_0x5b1a0c=_0x4bdaa3,_0x56adb5=_0x43bb09);}if(existsSync(_0x56adb5))_0x1cfe2c=a4_0x1af98c[_0x17b04a(0x1da)](_0x56adb5),console[_0x17b04a(0x1b4)](a4_0x56c742[_0x17b04a(0x229)](_0x17b04a(0x1ff)+_0x1cfe2c));else{const _0x3f5066=_0x1d16d3[_0x17b04a(0x1d3)];if(_0x3f5066)throw new SDKError(ErrorCode[_0x17b04a(0x1ba)],_0x17b04a(0x1a9)+_0x2b4a07+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x17b04a(0x208)+_0x17b04a(0x245)+('\x20\x20tdx\x20agent\x20pull\x20'+_0x2b4a07+'\x0a')+(_0x17b04a(0x20c)+_0x5b1a0c+'\x20--name\x20'+(_0x4966aa||_0x17b04a(0x1e5))+'\x20--profile\x20'+_0x3f5066)});_0x1cfe2c=_0x2b4a07,console[_0x17b04a(0x1b4)](a4_0x56c742[_0x17b04a(0x229)](_0x17b04a(0x1c6)+_0x2b4a07));}}}}if(!_0x1cfe2c)return console[_0x17b04a(0x1b4)](a4_0x56c742[_0x17b04a(0x231)](_0x17b04a(0x1ca))),console[_0x17b04a(0x1b4)](_0x17b04a(0x1a7)),console[_0x17b04a(0x1b4)](_0x17b04a(0x21c)),console[_0x17b04a(0x1b4)](_0x17b04a(0x205)),console[_0x17b04a(0x1b4)](_0x17b04a(0x196)),0x1;if(!_0x4966aa)throw new SDKError(ErrorCode[_0x17b04a(0x218)],_0x17b04a(0x1b2),undefined,{'helpText':_0x17b04a(0x1e3)});if(!_0x5540c6&&!_0xab7299){if(!isInteractive())return console[_0x17b04a(0x234)](a4_0x56c742[_0x17b04a(0x23f)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x17b04a(0x234)](a4_0x56c742[_0x17b04a(0x229)](_0x17b04a(0x215))),0x1;const _0x3f3b7f=await confirmKey(_0x17b04a(0x213)+_0x1cfe2c+'\x22\x20to\x20new\x20project\x20\x22'+_0x4966aa+'\x22?');if(!_0x3f3b7f)return console[_0x17b04a(0x1b4)](a4_0x56c742[_0x17b04a(0x231)](_0x17b04a(0x20a))),0x1;}const {data:_0x4fcafc}=await withSpinner(_0x17b04a(0x1ec)+_0x1cfe2c+_0x17b04a(0x1ab)+_0x4966aa+_0x17b04a(0x1fe),()=>_0x4f94cd['llm']['cloneProject'](_0x1cfe2c,_0x4966aa,{'dryRun':_0xab7299}));if(_0xab7299){console[_0x17b04a(0x1b4)](a4_0x56c742[_0x17b04a(0x231)](_0x17b04a(0x221))),console[_0x17b04a(0x1b4)](_0x17b04a(0x199)+_0x4fcafc[_0x17b04a(0x1d9)]),console[_0x17b04a(0x1b4)](_0x17b04a(0x217)+_0x4966aa),console[_0x17b04a(0x1b4)](_0x17b04a(0x1e0)),console[_0x17b04a(0x1b4)]('\x20\x20Agents:\x20'+_0x4fcafc[_0x17b04a(0x216)][_0x17b04a(0x1b0)][_0x17b04a(0x1f6)]),console[_0x17b04a(0x1b4)]('\x20\x20Knowledge\x20Bases:\x20'+_0x4fcafc['counts'][_0x17b04a(0x1ee)]['created']),console[_0x17b04a(0x1b4)](_0x17b04a(0x21f)+_0x4fcafc[_0x17b04a(0x216)]['prompts'][_0x17b04a(0x1f6)]);const _0xb3fdbe=_0x4fcafc[_0x17b04a(0x216)][_0x17b04a(0x22a)]['created']>0x0||_0x4fcafc[_0x17b04a(0x216)]['experimentalArtifacts'][_0x17b04a(0x1f6)]>0x0;return _0xb3fdbe&&(console[_0x17b04a(0x1b4)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+_0x4fcafc[_0x17b04a(0x216)][_0x17b04a(0x22a)][_0x17b04a(0x1f6)]),console['log'](_0x17b04a(0x239)+_0x4fcafc['counts']['experimentalArtifacts'][_0x17b04a(0x1f6)])),0x0;}const _0x3353e6=_0x4fcafc['counts'][_0x17b04a(0x1b0)][_0x17b04a(0x200)]>0x0||_0x4fcafc[_0x17b04a(0x216)][_0x17b04a(0x1ee)][_0x17b04a(0x200)]>0x0||_0x4fcafc[_0x17b04a(0x216)]['prompts']['errors']>0x0||_0x4fcafc[_0x17b04a(0x216)][_0x17b04a(0x22a)]['errors']>0x0||_0x4fcafc[_0x17b04a(0x216)][_0x17b04a(0x21a)][_0x17b04a(0x200)]>0x0;_0x3353e6?console[_0x17b04a(0x1b4)](a4_0x56c742[_0x17b04a(0x231)](_0x17b04a(0x224))):console['log'](a4_0x56c742[_0x17b04a(0x198)](_0x17b04a(0x24a)));console[_0x17b04a(0x1b4)](_0x17b04a(0x199)+_0x4fcafc[_0x17b04a(0x1d9)]),console['log'](_0x17b04a(0x217)+_0x4fcafc[_0x17b04a(0x20f)]),console[_0x17b04a(0x1b4)]('New\x20project\x20ID:\x20'+_0x4fcafc['newProjectId']),console[_0x17b04a(0x1b4)](),console[_0x17b04a(0x1b4)]('Summary:'),console[_0x17b04a(0x1b4)]('\x20\x20Agents:\x20'+formatCountSummary(_0x4fcafc[_0x17b04a(0x216)][_0x17b04a(0x1b0)])),console[_0x17b04a(0x1b4)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x4fcafc[_0x17b04a(0x216)]['knowledgeBases'])),console[_0x17b04a(0x1b4)](_0x17b04a(0x21f)+formatCountSummary(_0x4fcafc[_0x17b04a(0x216)][_0x17b04a(0x206)])),console[_0x17b04a(0x1b4)](_0x17b04a(0x1e8)+formatCountSummary(_0x4fcafc[_0x17b04a(0x216)][_0x17b04a(0x243)]));const _0x1822db=_0x4fcafc[_0x17b04a(0x216)][_0x17b04a(0x22a)][_0x17b04a(0x1f6)]>0x0||_0x4fcafc[_0x17b04a(0x216)][_0x17b04a(0x22a)][_0x17b04a(0x1e1)]>0x0||_0x4fcafc[_0x17b04a(0x216)][_0x17b04a(0x22a)][_0x17b04a(0x1bf)]>0x0||_0x4fcafc['counts'][_0x17b04a(0x21a)][_0x17b04a(0x1f6)]>0x0||_0x4fcafc[_0x17b04a(0x216)]['experimentalArtifacts']['updated']>0x0||_0x4fcafc['counts'][_0x17b04a(0x21a)][_0x17b04a(0x1bf)]>0x0;_0x1822db&&(console[_0x17b04a(0x1b4)](_0x17b04a(0x241)+formatCountSummary(_0x4fcafc[_0x17b04a(0x216)]['experimentalKnowledgeBases'])),console[_0x17b04a(0x1b4)](_0x17b04a(0x239)+formatCountSummary(_0x4fcafc[_0x17b04a(0x216)][_0x17b04a(0x21a)])));if(_0x3353e6){console[_0x17b04a(0x1b4)](),console[_0x17b04a(0x1b4)](a4_0x56c742[_0x17b04a(0x23f)]('Errors:'));for(const _0x218923 of _0x4fcafc[_0x17b04a(0x1b0)]){_0x218923[_0x17b04a(0x233)]===_0x17b04a(0x234)&&console[_0x17b04a(0x1b4)](a4_0x56c742[_0x17b04a(0x23f)]('\x20\x20Agent\x20\x22'+_0x218923['agentName']+'\x22:\x20'+_0x218923[_0x17b04a(0x234)]));}for(const _0x619ff9 of _0x4fcafc[_0x17b04a(0x1ee)]){_0x619ff9[_0x17b04a(0x233)]==='error'&&console['log'](a4_0x56c742[_0x17b04a(0x23f)](_0x17b04a(0x219)+_0x619ff9['name']+_0x17b04a(0x1bb)+_0x619ff9[_0x17b04a(0x234)]));}for(const _0x511673 of _0x4fcafc[_0x17b04a(0x206)]){_0x511673[_0x17b04a(0x233)]===_0x17b04a(0x234)&&console[_0x17b04a(0x1b4)](a4_0x56c742['red'](_0x17b04a(0x1d4)+_0x511673['name']+_0x17b04a(0x1bb)+_0x511673['error']));}for(const _0x48a8af of _0x4fcafc[_0x17b04a(0x243)]){_0x48a8af[_0x17b04a(0x233)]===_0x17b04a(0x234)&&console[_0x17b04a(0x1b4)](a4_0x56c742[_0x17b04a(0x23f)](_0x17b04a(0x1d7)+_0x48a8af['name']+_0x17b04a(0x1bb)+_0x48a8af[_0x17b04a(0x234)]));}for(const _0x14d459 of _0x4fcafc[_0x17b04a(0x22a)]){_0x14d459[_0x17b04a(0x233)]==='error'&&console[_0x17b04a(0x1b4)](a4_0x56c742['red']('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0x14d459[_0x17b04a(0x1de)]+_0x17b04a(0x1bb)+_0x14d459['error']));}for(const _0x2f2bad of _0x4fcafc[_0x17b04a(0x21a)]){_0x2f2bad[_0x17b04a(0x233)]==='error'&&console[_0x17b04a(0x1b4)](a4_0x56c742[_0x17b04a(0x23f)](_0x17b04a(0x1d0)+_0x2f2bad[_0x17b04a(0x1de)]+_0x17b04a(0x1bb)+_0x2f2bad[_0x17b04a(0x234)]));}return 0x1;}console[_0x17b04a(0x1b4)]();const _0x34178d=getLLMProjectUrl(_0x14c2a3,_0x4fcafc[_0x17b04a(0x1ce)]);return console[_0x17b04a(0x1b4)](_0x17b04a(0x223)+a4_0x56c742[_0x17b04a(0x1c0)](_0x34178d)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x2ab4e6(0x1de)]='agent:push';[a4_0x2ab4e6(0x1ad)]=a4_0x2ab4e6(0x22c);async['execute'](_0x57ca53){const _0x20908f=a4_0x2ab4e6,{options:_0x18ca9a,args:_0x536db2,tdx:_0xc277e9}=_0x57ca53;let _0x7f95f3=_0x536db2[0x0]||process['cwd']();const _0x4d9c07=_0x18ca9a['dryRun'],_0x1037e7=_0x18ca9a[_0x20908f(0x1dd)],_0x4487d9=_0x18ca9a[_0x20908f(0x201)],_0x550731=_0x18ca9a[_0x20908f(0x194)],_0x1eb8ed=a4_0x1af98c[_0x20908f(0x1e2)](_0x7f95f3,'agent.yml'),_0x1dea10=existsSync(_0x1eb8ed);if(_0x1dea10){const {data:_0x5168ff}=await withSpinner(_0x20908f(0x1ae)+_0x7f95f3+_0x20908f(0x1fe),()=>_0xc277e9[_0x20908f(0x1a5)][_0x20908f(0x197)](_0x7f95f3,{'dryRun':_0x4d9c07,'force':_0x1037e7}));if(_0x4d9c07)return console['log'](a4_0x56c742[_0x20908f(0x231)](_0x20908f(0x221))),console[_0x20908f(0x1b4)](_0x20908f(0x1a1)+_0x5168ff['agentName']),0x0;if(_0x5168ff[_0x20908f(0x233)]===_0x20908f(0x234))return console['log'](a4_0x56c742[_0x20908f(0x23f)]('Failed\x20to\x20push\x20agent:\x20'+_0x5168ff['error'])),0x1;console[_0x20908f(0x1b4)](a4_0x56c742[_0x20908f(0x198)](_0x20908f(0x1e6)+_0x5168ff[_0x20908f(0x233)]+_0x20908f(0x1aa))),console[_0x20908f(0x1b4)](_0x20908f(0x1a3)+_0x5168ff[_0x20908f(0x204)]);if(_0x5168ff[_0x20908f(0x220)]&&_0x5168ff[_0x20908f(0x19c)]){const _0xe9a0cc=getLLMAgentChatUrl(_0x550731,_0x5168ff['projectId'],_0x5168ff[_0x20908f(0x220)]);console[_0x20908f(0x1b4)]('Chat:\x20'+a4_0x56c742['cyan'](_0xe9a0cc));}return 0x0;}const _0x5a084f=_0x18ca9a[_0x20908f(0x19a)],_0x11a657=resolveProjectFromContext(_0x7f95f3,_0x5a084f);if(_0x11a657['found'])_0x7f95f3=_0x11a657[_0x20908f(0x21d)],_0x11a657[_0x20908f(0x249)]==='context'&&console[_0x20908f(0x1b4)](a4_0x56c742['dim']('Using\x20project:\x20'+_0x7f95f3));else{let _0x2588f3=_0x20908f(0x23e);_0x11a657[_0x20908f(0x209)]==='no_local_folder'&&(_0x2588f3=_0x11a657[_0x20908f(0x19b)]+_0x20908f(0x247)+_0x11a657[_0x20908f(0x19a)]+_0x20908f(0x1f1));throw new SDKError(ErrorCode[_0x20908f(0x1ba)],_0x11a657['reason']===_0x20908f(0x236)?_0x11a657[_0x20908f(0x19b)]:_0x20908f(0x1e4)+_0x7f95f3,undefined,{'helpText':_0x2588f3});}const {data:_0x4eb584}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0xc277e9[_0x20908f(0x1a5)][_0x20908f(0x214)](_0x7f95f3,{'dryRun':!![]})),_0x1226c0=_0x4eb584[_0x20908f(0x216)][_0x20908f(0x1b0)][_0x20908f(0x200)]>0x0;if(_0x1226c0){console[_0x20908f(0x1b4)](a4_0x56c742[_0x20908f(0x23f)](_0x20908f(0x1f8)));for(const _0xfd04f5 of _0x4eb584['agents']){_0xfd04f5[_0x20908f(0x233)]===_0x20908f(0x234)&&console['log'](a4_0x56c742[_0x20908f(0x23f)](_0x20908f(0x203)+_0xfd04f5['agentName']+_0x20908f(0x1bb)+_0xfd04f5[_0x20908f(0x234)]));}return 0x1;}const _0x18eae7=_0x4eb584[_0x20908f(0x216)]['agents'][_0x20908f(0x1f6)]+_0x4eb584[_0x20908f(0x216)][_0x20908f(0x1ee)][_0x20908f(0x1f6)]+_0x4eb584['counts'][_0x20908f(0x1cd)][_0x20908f(0x1f6)]+_0x4eb584['counts']['prompts'][_0x20908f(0x1f6)]+_0x4eb584[_0x20908f(0x216)]['integrations']['created']+_0x4eb584['counts'][_0x20908f(0x22a)]['created']+_0x4eb584[_0x20908f(0x216)][_0x20908f(0x21a)][_0x20908f(0x1f6)],_0x2e6e9d=_0x4eb584[_0x20908f(0x216)][_0x20908f(0x1b0)][_0x20908f(0x1e1)]+_0x4eb584[_0x20908f(0x216)][_0x20908f(0x1ee)][_0x20908f(0x1e1)]+_0x4eb584[_0x20908f(0x216)][_0x20908f(0x1cd)][_0x20908f(0x1e1)]+_0x4eb584[_0x20908f(0x216)][_0x20908f(0x206)]['updated']+_0x4eb584['counts'][_0x20908f(0x243)]['updated']+_0x4eb584['counts'][_0x20908f(0x22a)][_0x20908f(0x1e1)]+_0x4eb584[_0x20908f(0x216)][_0x20908f(0x21a)]['updated'],_0x27be13=_0x4eb584['counts']['agents'][_0x20908f(0x1bf)]+_0x4eb584[_0x20908f(0x216)]['knowledgeBases'][_0x20908f(0x1bf)]+_0x4eb584[_0x20908f(0x216)][_0x20908f(0x1cd)][_0x20908f(0x1bf)]+_0x4eb584[_0x20908f(0x216)]['prompts'][_0x20908f(0x1bf)]+_0x4eb584[_0x20908f(0x216)][_0x20908f(0x243)][_0x20908f(0x1bf)]+_0x4eb584['counts'][_0x20908f(0x22a)][_0x20908f(0x1bf)]+_0x4eb584[_0x20908f(0x216)][_0x20908f(0x21a)]['unchanged'];console['log'](_0x20908f(0x1c5)+_0x4eb584[_0x20908f(0x211)]+'\x27:'),console[_0x20908f(0x1b4)]('\x20\x20'+a4_0x56c742['green']('+\x20'+_0x18eae7+_0x20908f(0x1c1))+_0x20908f(0x1d1)+a4_0x56c742[_0x20908f(0x231)]('~\x20'+_0x2e6e9d+_0x20908f(0x1b6))+_0x20908f(0x1d1)+a4_0x56c742[_0x20908f(0x229)]('=\x20'+_0x27be13+_0x20908f(0x1a0))),console[_0x20908f(0x1b4)](_0x20908f(0x20b)+formatCountSummary(_0x4eb584[_0x20908f(0x216)][_0x20908f(0x1b0)])),console[_0x20908f(0x1b4)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x4eb584[_0x20908f(0x216)][_0x20908f(0x1ee)])),console[_0x20908f(0x1b4)]('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x4eb584[_0x20908f(0x216)][_0x20908f(0x1cd)])),console[_0x20908f(0x1b4)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x4eb584['counts']['prompts'])),console['log']('\x20\x20Integrations:\x20'+formatCountSummary(_0x4eb584['counts'][_0x20908f(0x243)]));const _0x291f4f=_0x4eb584[_0x20908f(0x216)][_0x20908f(0x22a)]['created']>0x0||_0x4eb584[_0x20908f(0x216)][_0x20908f(0x22a)]['updated']>0x0||_0x4eb584['counts']['experimentalKnowledgeBases'][_0x20908f(0x1bf)]>0x0||_0x4eb584[_0x20908f(0x216)][_0x20908f(0x21a)][_0x20908f(0x1f6)]>0x0||_0x4eb584[_0x20908f(0x216)]['experimentalArtifacts'][_0x20908f(0x1e1)]>0x0||_0x4eb584['counts']['experimentalArtifacts'][_0x20908f(0x1bf)]>0x0;_0x291f4f&&(console[_0x20908f(0x1b4)](_0x20908f(0x241)+formatCountSummary(_0x4eb584[_0x20908f(0x216)][_0x20908f(0x22a)])),console[_0x20908f(0x1b4)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x4eb584['counts'][_0x20908f(0x21a)])));console['log'](_0x20908f(0x195)+a4_0x56c742[_0x20908f(0x1c0)](_0x7f95f3)),displayDiffs(_0x4eb584[_0x20908f(0x1b0)],_0x4eb584['knowledgeBases'],_0x4eb584[_0x20908f(0x1cd)],_0x4eb584[_0x20908f(0x206)],_0x4eb584[_0x20908f(0x243)],_0x4eb584['experimentalKnowledgeBases'],_0x4eb584[_0x20908f(0x21a)]);if(_0x4d9c07)return console[_0x20908f(0x1b4)](a4_0x56c742[_0x20908f(0x231)](_0x20908f(0x222))),0x0;if(_0x18eae7===0x0&&_0x2e6e9d===0x0){console[_0x20908f(0x1b4)](a4_0x56c742[_0x20908f(0x198)](_0x20908f(0x1f9)));const _0x53237d=getLLMProjectUrl(_0x550731,_0x4eb584[_0x20908f(0x19c)]);return console[_0x20908f(0x1b4)](_0x20908f(0x223)+a4_0x56c742[_0x20908f(0x1c0)](_0x53237d)),0x0;}if(!_0x4487d9&&!_0x1037e7){if(!isInteractive())return console[_0x20908f(0x234)](a4_0x56c742[_0x20908f(0x23f)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x20908f(0x234)](a4_0x56c742[_0x20908f(0x229)](_0x20908f(0x215))),0x1;const _0x5b2d4c=await confirmKey(_0x20908f(0x1b8)+(_0x18eae7+_0x2e6e9d)+_0x20908f(0x1f0));if(!_0x5b2d4c)return console[_0x20908f(0x1b4)](a4_0x56c742[_0x20908f(0x231)](_0x20908f(0x20a)),_0x20908f(0x1c7)),0x1;}const {data:_0x24f270}=await withSpinner('Pushing\x20to\x20project...',()=>_0xc277e9['llm'][_0x20908f(0x214)](_0x7f95f3,{'force':_0x1037e7})),_0x12f951=_0x24f270['counts'][_0x20908f(0x1b0)][_0x20908f(0x200)]>0x0||_0x24f270[_0x20908f(0x216)]['knowledgeBases'][_0x20908f(0x200)]>0x0||_0x24f270[_0x20908f(0x216)][_0x20908f(0x1cd)]['errors']>0x0||_0x24f270[_0x20908f(0x216)][_0x20908f(0x206)][_0x20908f(0x200)]>0x0;if(_0x12f951){console[_0x20908f(0x1b4)](a4_0x56c742[_0x20908f(0x231)]('\x0aProject\x20pushed\x20with\x20errors')),console[_0x20908f(0x1b4)](),console['log'](a4_0x56c742[_0x20908f(0x23f)](_0x20908f(0x1f5)));for(const _0x2c0362 of _0x24f270[_0x20908f(0x1b0)]){_0x2c0362['action']===_0x20908f(0x234)&&console[_0x20908f(0x1b4)](a4_0x56c742['red'](_0x20908f(0x203)+_0x2c0362[_0x20908f(0x204)]+_0x20908f(0x1bb)+_0x2c0362['error']));}for(const _0x4b7e75 of _0x24f270[_0x20908f(0x1ee)]){_0x4b7e75['action']===_0x20908f(0x234)&&console[_0x20908f(0x1b4)](a4_0x56c742['red']('\x20\x20Knowledge\x20Base\x20\x22'+_0x4b7e75[_0x20908f(0x1de)]+'\x22:\x20'+_0x4b7e75[_0x20908f(0x234)]));}for(const _0x2e902d of _0x24f270['textKnowledgeBases']){_0x2e902d[_0x20908f(0x233)]===_0x20908f(0x234)&&console[_0x20908f(0x1b4)](a4_0x56c742[_0x20908f(0x23f)](_0x20908f(0x1f7)+_0x2e902d['name']+'\x22:\x20'+_0x2e902d[_0x20908f(0x234)]));}for(const _0xabc859 of _0x24f270['prompts']){_0xabc859['action']===_0x20908f(0x234)&&console[_0x20908f(0x1b4)](a4_0x56c742[_0x20908f(0x23f)](_0x20908f(0x1d4)+_0xabc859[_0x20908f(0x1de)]+_0x20908f(0x1bb)+_0xabc859[_0x20908f(0x234)]));}for(const _0x502f0f of _0x24f270[_0x20908f(0x243)]){_0x502f0f[_0x20908f(0x233)]===_0x20908f(0x234)&&console[_0x20908f(0x1b4)](a4_0x56c742[_0x20908f(0x23f)](_0x20908f(0x1d7)+_0x502f0f[_0x20908f(0x1de)]+_0x20908f(0x1bb)+_0x502f0f['error']));}return 0x1;}console[_0x20908f(0x1b4)](a4_0x56c742[_0x20908f(0x198)](_0x20908f(0x1b9)+(_0x18eae7+_0x2e6e9d)+_0x20908f(0x1b1)+_0x24f270['projectName']+'\x27'));const _0x465cba=getLLMProjectUrl(_0x550731,_0x24f270[_0x20908f(0x19c)]);return console[_0x20908f(0x1b4)](_0x20908f(0x223)+a4_0x56c742[_0x20908f(0x1c0)](_0x465cba)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x45a8d5=a5_0x1dd7;(function(_0x4b5f11,_0x107208){const _0x4ead6b=a5_0x1dd7,_0x376af4=_0x4b5f11();while(!![]){try{const _0x4d227d=-parseInt(_0x4ead6b(0xa5))/0x1*(-parseInt(_0x4ead6b(0xdc))/0x2)+parseInt(_0x4ead6b(0x111))/0x3+parseInt(_0x4ead6b(0xca))/0x4*(-parseInt(_0x4ead6b(0x107))/0x5)+-parseInt(_0x4ead6b(0xdb))/0x6*(-parseInt(_0x4ead6b(0xc6))/0x7)+parseInt(_0x4ead6b(0xa6))/0x8+-parseInt(_0x4ead6b(0xaf))/0x9*(parseInt(_0x4ead6b(0xad))/0xa)+-parseInt(_0x4ead6b(0xd4))/0xb*(parseInt(_0x4ead6b(0xd3))/0xc);if(_0x4d227d===_0x107208)break;else _0x376af4['push'](_0x376af4['shift']());}catch(_0x251904){_0x376af4['push'](_0x376af4['shift']());}}}(a5_0x175a,0x50572));import*as a5_0x5ca225 from'node:fs';import*as a5_0x2b3251 from'node:path';function a5_0x1dd7(_0x39ab5d,_0x331b45){_0x39ab5d=_0x39ab5d-0x9c;const _0x175a33=a5_0x175a();let _0x1dd70d=_0x175a33[_0x39ab5d];return _0x1dd70d;}function a5_0x175a(){const _0x4eb93b=['add','Run\x20tests\x20for\x20an\x20LLM\x20agent','\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','40qZQhGz',':\x20Sending\x20user\x20input...','406863OhjJje','executeReeval','trim','Test\x20','red','Passed:\x20\x20\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','push','Error\x20writing\x20output\x20file:\x20','isSpinning','table','\x20(cached)','yellow','test.yml','\x20\x20-\x20','\x22:\x20','verbose','eval','Failed\x20Tests:','no_context','context','...\x20','Site:\x20','4589137HFZCOu','\x20\x20Agent:\x20','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','✗\x20ERROR:\x20Project\x20not\x20found:\x20','216xWxEiH','json','dryRun','llmProject','Duration:\x20','Round\x201/','toISOString','Total:\x20\x20\x20\x20','jsonl','2478936SoxyWx','55Wclwce','Cached\x20run\x20from:\x20','writeFileSync','Agent:\x20','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','join','filter','6SbWpph','9014XpoEvq','Test\x20Summary','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','site','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','repeat','PASS','Re-evaluating...','has','agent','Output\x20written\x20to:\x20','map','Evaluating\x20response...','basename','testYmlPath','dim','Re-evaluating\x20','rounds','Executing\x20new\x20tests...','utf-8','not\x20found','...','projectDir','message','Re-evaluation\x20Summary','Failed:\x20\x20\x20','now','Errors:\x20\x20\x20','✓\x20PASS:\x20','execute','round','green','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','includes','Running\x20agent\x20tests...','conversation_url','Conversation\x20URL:\x20','log','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','size','No\x20tests\x20found\x20with\x20tags:\x20','existsSync','14285LwJoSr','testName','Round\x20','No\x20tests\x20found\x20matching:\x20','some','Running\x20test:\x20','\x20\x20Project:\x20','substring','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','white','527550PfCtwT','toLowerCase','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','ERROR','start','Project\x20path:\x20','text','FAIL','llm','\x20\x20Site:\x20','status','split','Tests\x20found:\x20','Running:\x20','\x20\x20Round\x20','\x20\x20Conversation:\x20','Test\x20Configuration:','⚠\x20SKIPPED:\x20','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','description','timestamp','✗\x20ERROR:\x20','\x20-\x20','resolve','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','Either\x20switch\x20to\x20the\x20\x22','Available\x20tests:\x20','\x22,\x20but\x20current\x20site\x20is\x20\x22','reason','/<agent-name>','404','found','Available\x20tags:\x20','\x20(new)','cyan','projectName','agentName','✗\x20FAIL:\x20','stop','tsv','tests','source','no_tests','name','find','length','67asJvVV','4509280pkzkZm','tags','\x20\x20Evaluating...\x20','New\x20tests\x20to\x20execute:\x20'];a5_0x175a=function(){return _0x4eb93b;};return a5_0x175a();}import a5_0x3a3fc5 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_0x45a8d5(0xa2)]='agent:test';[a5_0x45a8d5(0x124)]=a5_0x45a8d5(0xab);async[a5_0x45a8d5(0xfa)](_0x5c6eaa){const _0x33c30c=a5_0x45a8d5,{options:_0x32d331,args:_0x35449c,tdx:_0x51d36f}=_0x5c6eaa,_0x6d926c=_0x35449c[0x0]||'.',_0x3a5344=_0x32d331[_0x33c30c(0xcc)],_0x482611=_0x32d331,_0x423c43=_0x482611[_0x33c30c(0xc0)]===![],_0x3db73b=_0x482611['reeval'],_0x2d23c2=_0x482611['name'],_0x260392=_0x482611[_0x33c30c(0xa7)],_0x365c35=_0x32d331[_0x33c30c(0xe0)],_0xf8f27d=_0x482611['output'];if(_0x3db73b&&_0x423c43)return console[_0x33c30c(0x102)](a5_0x3a3fc5[_0x33c30c(0xb3)](_0x33c30c(0xd8))),0x1;let _0x339e89='table';if(_0x482611['json'])_0x339e89=_0x33c30c(0xcb);else{if(_0x482611[_0x33c30c(0xd2)])_0x339e89='jsonl';else{if(_0x482611['tsv'])_0x339e89=_0x33c30c(0x9e);else{if(_0x482611[_0x33c30c(0xb9)])_0x339e89=_0x33c30c(0xb9);}}}const _0x15fda8=_0x482611[_0x33c30c(0xcd)];let _0x58536d=_0x6d926c;const _0x2a2a47=a5_0x5ca225[_0x33c30c(0x106)](_0x6d926c),_0x451c0c=_0x6d926c==='.';if(!_0x2a2a47||_0x451c0c){const _0x35b8d9=resolveProjectFromContext(_0x6d926c,_0x15fda8,{'requireFile':_0x33c30c(0xbc)});if(_0x35b8d9[_0x33c30c(0x130)])_0x58536d=_0x35b8d9['projectDir'],_0x35b8d9[_0x33c30c(0xa0)]===_0x33c30c(0xc3)&&console[_0x33c30c(0x102)](a5_0x3a3fc5[_0x33c30c(0xec)]('Using\x20agent:\x20'+_0x58536d));else switch(_0x35b8d9[_0x33c30c(0x12d)]){case _0x33c30c(0xc2):console[_0x33c30c(0x102)](a5_0x3a3fc5[_0x33c30c(0xbb)](_0x35b8d9[_0x33c30c(0xf4)])),console[_0x33c30c(0x102)](),console[_0x33c30c(0x102)]('Usage:'),console[_0x33c30c(0x102)](_0x33c30c(0xac)),console[_0x33c30c(0x102)]('\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x33c30c(0x102)](),console[_0x33c30c(0x102)](_0x33c30c(0xc8));return 0x1;case'no_local_folder':console[_0x33c30c(0x102)](a5_0x3a3fc5[_0x33c30c(0xbb)](_0x35b8d9[_0x33c30c(0xf4)])),console[_0x33c30c(0x102)](),console[_0x33c30c(0x102)]('Run\x20\x27tdx\x20agent\x20pull\x20'+_0x35b8d9[_0x33c30c(0xcd)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');return 0x1;case'multiple_agents':{const _0x5bf2cb=a5_0x2b3251[_0x33c30c(0xea)](_0x35b8d9['projectDir']);console[_0x33c30c(0x102)](a5_0x3a3fc5[_0x33c30c(0xbb)](_0x33c30c(0x123)+_0x35b8d9[_0x33c30c(0xcd)]+'\x22:'));for(const _0x245544 of _0x35b8d9['agentDirs']){console[_0x33c30c(0x102)](_0x33c30c(0xbd)+_0x245544);}return console[_0x33c30c(0x102)](),console[_0x33c30c(0x102)](_0x33c30c(0xde)+_0x5bf2cb+_0x33c30c(0x12e)),0x1;}case _0x33c30c(0xa1):console['log'](a5_0x3a3fc5[_0x33c30c(0xbb)](_0x33c30c(0x129)+_0x35b8d9[_0x33c30c(0xcd)]+'\x22.')),console['log'](a5_0x3a3fc5[_0x33c30c(0xec)](_0x33c30c(0x116)+_0x35b8d9[_0x33c30c(0xf3)])),console[_0x33c30c(0x102)](),console['log']('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0x1e71b5,agentInfo:_0xf8e561}=parseTestFile(_0x58536d);let _0x38ee92=_0x1e71b5[_0x33c30c(0x9f)];if(_0x2d23c2){const _0x320428=_0x2d23c2[_0x33c30c(0x11c)](',')['map'](_0x19b9be=>_0x19b9be[_0x33c30c(0xb1)]());_0x38ee92=_0x1e71b5[_0x33c30c(0x9f)]['filter'](_0xa106b4=>_0x320428[_0x33c30c(0xfe)](_0xa106b4[_0x33c30c(0xa2)]));if(_0x38ee92[_0x33c30c(0xa4)]===0x0)return console['log'](a5_0x3a3fc5[_0x33c30c(0xbb)](_0x33c30c(0x10a)+_0x2d23c2)),console[_0x33c30c(0x102)](a5_0x3a3fc5[_0x33c30c(0xec)](_0x33c30c(0x12b)+_0x1e71b5[_0x33c30c(0x9f)][_0x33c30c(0xe8)](_0x4e7763=>_0x4e7763[_0x33c30c(0xa2)])['join'](',\x20'))),0x1;}if(_0x260392){const _0x6c6f6a=_0x260392[_0x33c30c(0x11c)](',')[_0x33c30c(0xe8)](_0x45fd1c=>_0x45fd1c[_0x33c30c(0xb1)]()['toLowerCase']());_0x38ee92=_0x38ee92[_0x33c30c(0xda)](_0x331f42=>_0x331f42[_0x33c30c(0xa7)]?.[_0x33c30c(0x10b)](_0x4ccba3=>_0x6c6f6a[_0x33c30c(0xfe)](_0x4ccba3[_0x33c30c(0x112)]())));if(_0x38ee92[_0x33c30c(0xa4)]===0x0){console[_0x33c30c(0x102)](a5_0x3a3fc5[_0x33c30c(0xbb)](_0x33c30c(0x105)+_0x260392));const _0x4390ca=new Set();return _0x1e71b5[_0x33c30c(0x9f)]['forEach'](_0x38d504=>_0x38d504[_0x33c30c(0xa7)]?.['forEach'](_0x1c37bf=>_0x4390ca[_0x33c30c(0xaa)](_0x1c37bf))),_0x4390ca[_0x33c30c(0x104)]>0x0?console[_0x33c30c(0x102)](a5_0x3a3fc5[_0x33c30c(0xec)](_0x33c30c(0x131)+[..._0x4390ca][_0x33c30c(0xd9)](',\x20'))):console[_0x33c30c(0x102)](a5_0x3a3fc5[_0x33c30c(0xec)]('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0x3db73b)return this['executeReeval'](_0x5c6eaa,{'definition':{'tests':_0x38ee92},'agentInfo':_0xf8e561,'outputFormat':_0x339e89,'outputFile':_0xf8f27d,'testNames':_0x2d23c2});if(_0x3a5344){console[_0x33c30c(0x102)](a5_0x3a3fc5[_0x33c30c(0x133)](_0x33c30c(0x121))),console['log'](_0x33c30c(0x11a)+a5_0x3a3fc5[_0x33c30c(0x110)](_0x365c35)),console[_0x33c30c(0x102)](_0x33c30c(0x10d)+a5_0x3a3fc5[_0x33c30c(0x110)](_0xf8e561[_0x33c30c(0x134)])),console[_0x33c30c(0x102)](_0x33c30c(0xc7)+a5_0x3a3fc5[_0x33c30c(0x110)](_0xf8e561[_0x33c30c(0x135)])),console[_0x33c30c(0x102)](),console[_0x33c30c(0x102)](_0x33c30c(0x11d)+a5_0x3a3fc5[_0x33c30c(0x110)](_0x38ee92[_0x33c30c(0xa4)]));for(let _0x442a09=0x0;_0x442a09<_0x38ee92[_0x33c30c(0xa4)];_0x442a09++){const _0x2f5001=_0x38ee92[_0x442a09],_0x5f5d80=_0x2f5001[_0x33c30c(0xee)][_0x33c30c(0xa4)]===0x1?_0x33c30c(0xfb):_0x33c30c(0xee),_0x4a8beb=_0x2f5001[_0x33c30c(0xa7)]?.['length']?'\x20['+_0x2f5001['tags'][_0x33c30c(0xd9)](',\x20')+']':'';console['log']('\x20\x20'+(_0x442a09+0x1)+'.\x20'+a5_0x3a3fc5['white'](_0x2f5001[_0x33c30c(0xa2)])+'\x20('+_0x2f5001['rounds']['length']+'\x20'+_0x5f5d80+')'+a5_0x3a3fc5[_0x33c30c(0xec)](_0x4a8beb));}return 0x0;}let _0x5ef393,_0x4c559c;try{_0x5ef393=await _0x51d36f[_0x33c30c(0x119)]['resolveProjectId'](_0xf8e561[_0x33c30c(0x134)]);}catch(_0x22aa2c){const _0x4dc193=_0x22aa2c instanceof Error?_0x22aa2c[_0x33c30c(0xf4)]:String(_0x22aa2c);return _0x4dc193[_0x33c30c(0xfe)](_0x33c30c(0x12f))||_0x4dc193[_0x33c30c(0x112)]()[_0x33c30c(0xfe)](_0x33c30c(0xf1))?console[_0x33c30c(0x102)](a5_0x3a3fc5[_0x33c30c(0xb3)](_0x33c30c(0xc9)+_0xf8e561['projectName'])):console[_0x33c30c(0x102)](a5_0x3a3fc5[_0x33c30c(0xb3)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0xf8e561['projectName']+_0x33c30c(0xbe)+_0x4dc193)),0x1;}try{_0x4c559c=await _0x51d36f['llm']['resolveAgentId'](_0xf8e561[_0x33c30c(0x135)],_0x5ef393);}catch(_0x4a8541){const _0x3ac1fb=_0x4a8541 instanceof Error?_0x4a8541[_0x33c30c(0xf4)]:String(_0x4a8541);return _0x3ac1fb[_0x33c30c(0xfe)](_0x33c30c(0x12f))||_0x3ac1fb[_0x33c30c(0x112)]()[_0x33c30c(0xfe)](_0x33c30c(0xf1))?console[_0x33c30c(0x102)](a5_0x3a3fc5[_0x33c30c(0xb3)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0xf8e561[_0x33c30c(0x135)])):console['log'](a5_0x3a3fc5[_0x33c30c(0xb3)](_0x33c30c(0x103)+_0xf8e561['agentName']+_0x33c30c(0xbe)+_0x3ac1fb)),0x1;}let _0x584747;if(!_0x423c43)try{_0x584747=await setupEvaluatorAgent(_0x51d36f[_0x33c30c(0x119)],_0x32d331['verbose']);}catch(_0x4aef6b){const _0x45def7=_0x4aef6b instanceof Error?_0x4aef6b['message']:String(_0x4aef6b);return console[_0x33c30c(0x102)](a5_0x3a3fc5[_0x33c30c(0xb3)](_0x33c30c(0x10f)+_0x45def7)),0x1;}console[_0x33c30c(0x102)](a5_0x3a3fc5[_0x33c30c(0x133)](_0x33c30c(0xff))),console['log'](_0x33c30c(0xc5)+a5_0x3a3fc5[_0x33c30c(0x110)](_0x365c35)),console[_0x33c30c(0x102)](_0x33c30c(0xd7)+a5_0x3a3fc5[_0x33c30c(0x110)](_0xf8e561[_0x33c30c(0x134)]+'/'+_0xf8e561[_0x33c30c(0x135)])),console[_0x33c30c(0x102)]();const _0x561a1a=[],_0x4898f5=[],_0x4e6207=Date[_0x33c30c(0xf7)]();for(let _0x2e2610=0x0;_0x2e2610<_0x38ee92[_0x33c30c(0xa4)];_0x2e2610++){const _0x1f69f0=_0x38ee92[_0x2e2610];_0x38ee92[_0x33c30c(0xa4)]>0x1?console['log'](_0x33c30c(0xb2)+(_0x2e2610+0x1)+'/'+_0x38ee92['length']+':\x20'+a5_0x3a3fc5[_0x33c30c(0x110)](_0x1f69f0[_0x33c30c(0xa2)])):console[_0x33c30c(0x102)](_0x33c30c(0x10c)+a5_0x3a3fc5['white'](_0x1f69f0['name']));const _0x462a08=createCommandSpinner(_0x33c30c(0xcf)+_0x1f69f0[_0x33c30c(0xee)][_0x33c30c(0xa4)]+_0x33c30c(0xae));_0x462a08[_0x33c30c(0x115)]();try{const {result:_0x4f8c07,conversation:_0x596c4e}=await runTest(_0x51d36f[_0x33c30c(0x119)],_0x1f69f0,{'agentId':_0x4c559c,'projectId':_0x5ef393,'site':_0x365c35,'noEval':_0x423c43,'evaluatorId':_0x584747,'onRoundStart':(_0x3327ad,_0x3ea42a)=>{const _0x1fda4b=_0x33c30c;_0x462a08['text']=_0x1fda4b(0x109)+(_0x3327ad+0x1)+'/'+_0x3ea42a+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x330cac,_0x1e11ac,_0x2905ab)=>{const _0x49d52a=_0x33c30c,_0x545bd8=formatElapsed(_0x1e11ac);_0x2905ab?console[_0x49d52a(0x102)](_0x49d52a(0x11f)+(_0x330cac+0x1)+'/'+_0x1f69f0['rounds'][_0x49d52a(0xa4)]+'...\x20'+a5_0x3a3fc5[_0x49d52a(0xfc)]('✓')+'\x20('+_0x545bd8+')'):console['log'](_0x49d52a(0x11f)+(_0x330cac+0x1)+'/'+_0x1f69f0[_0x49d52a(0xee)]['length']+_0x49d52a(0xc4)+a5_0x3a3fc5[_0x49d52a(0xb3)]('✗'));},'onEvaluationStart':()=>{const _0x437668=_0x33c30c;_0x462a08['text']=_0x437668(0xe9);},'onEvaluationComplete':_0x84d558=>{const _0x126f43=_0x33c30c,_0x5e7d14=formatElapsed(_0x84d558);console['log']('\x20\x20Evaluating...\x20'+a5_0x3a3fc5[_0x126f43(0xfc)]('✓')+'\x20('+_0x5e7d14+')');}});_0x462a08[_0x33c30c(0x9d)](),_0x561a1a[_0x33c30c(0xb6)](_0x4f8c07),_0x4898f5['push'](_0x596c4e);if(_0x4f8c07['status']===_0x33c30c(0xe3))console['log'](a5_0x3a3fc5['green'](_0x33c30c(0xf9)+_0x4f8c07['reason']));else _0x4f8c07[_0x33c30c(0x11b)]===_0x33c30c(0x118)?console[_0x33c30c(0x102)](a5_0x3a3fc5[_0x33c30c(0xb3)](_0x33c30c(0x9c)+_0x4f8c07['reason'])):console[_0x33c30c(0x102)](a5_0x3a3fc5[_0x33c30c(0xb3)]('✗\x20ERROR:\x20'+_0x4f8c07[_0x33c30c(0x12d)]));_0x4f8c07[_0x33c30c(0x100)]&&console[_0x33c30c(0x102)](a5_0x3a3fc5[_0x33c30c(0xec)](_0x33c30c(0x101)+_0x4f8c07[_0x33c30c(0x100)])),console[_0x33c30c(0x102)]();}catch(_0x5dc35b){_0x462a08[_0x33c30c(0x9d)]();const _0x5c3937=_0x5dc35b instanceof Error?_0x5dc35b[_0x33c30c(0xf4)]:String(_0x5dc35b);console[_0x33c30c(0x102)](a5_0x3a3fc5['red']('✗\x20ERROR:\x20'+_0x5c3937)),console[_0x33c30c(0x102)](),_0x561a1a['push']({'name':_0x1f69f0[_0x33c30c(0xa2)],'status':'ERROR','reason':_0x5c3937,'timestamp':new Date()[_0x33c30c(0xd0)](),'duration_ms':0x0});}}const _0x456aa1=Date[_0x33c30c(0xf7)]()-_0x4e6207,_0x18dd1a=_0x561a1a[_0x33c30c(0xda)](_0x507176=>_0x507176[_0x33c30c(0x11b)]===_0x33c30c(0xe3))['length'],_0x322f39=_0x561a1a[_0x33c30c(0xda)](_0x25a73a=>_0x25a73a[_0x33c30c(0x11b)]===_0x33c30c(0x118))['length'],_0x2fbe98=_0x561a1a[_0x33c30c(0xda)](_0x36a749=>_0x36a749[_0x33c30c(0x11b)]===_0x33c30c(0x114))['length'];console[_0x33c30c(0x102)]('━'[_0x33c30c(0xe2)](0x3c)),console[_0x33c30c(0x102)](_0x33c30c(0xdd)),console[_0x33c30c(0x102)]('━'[_0x33c30c(0xe2)](0x3c)),console['log'](_0x33c30c(0xd1)+_0x561a1a[_0x33c30c(0xa4)]),console[_0x33c30c(0x102)]('Passed:\x20\x20\x20'+a5_0x3a3fc5[_0x33c30c(0xfc)](_0x18dd1a)),console[_0x33c30c(0x102)](_0x33c30c(0xf6)+a5_0x3a3fc5[_0x33c30c(0xb3)](_0x322f39));_0x2fbe98>0x0&&console['log'](_0x33c30c(0xf8)+a5_0x3a3fc5[_0x33c30c(0xb3)](_0x2fbe98));console['log'](_0x33c30c(0xce)+formatElapsed(_0x456aa1)),console['log']('━'[_0x33c30c(0xe2)](0x3c));const _0x3187d3=_0x561a1a[_0x33c30c(0xda)](_0x5e230d=>_0x5e230d[_0x33c30c(0x11b)]!==_0x33c30c(0xe3));if(_0x3187d3[_0x33c30c(0xa4)]>0x0){console['log'](),console['log'](_0x33c30c(0xc1));for(const _0x527063 of _0x3187d3){const _0xe2a838=a5_0x3a3fc5[_0x33c30c(0xb3)]('✗'),_0x57ae14=_0x527063[_0x33c30c(0x12d)][_0x33c30c(0xa4)]>0x32?_0x527063[_0x33c30c(0x12d)][_0x33c30c(0x10e)](0x0,0x32)+'...':_0x527063[_0x33c30c(0x12d)];console[_0x33c30c(0x102)]('\x20\x20'+_0xe2a838+'\x20'+_0x527063['name']+':\x20'+_0x57ae14);}}const _0x26bf6c={'summary':{'total':_0x561a1a[_0x33c30c(0xa4)],'passed':_0x18dd1a,'failed':_0x322f39,'errors':_0x2fbe98>0x0?_0x2fbe98:undefined,'duration_ms':_0x456aa1},'tests':_0x561a1a,'agent':{'project':_0xf8e561[_0x33c30c(0x134)],'name':_0xf8e561[_0x33c30c(0x135)],'site':_0x365c35},'timestamp':new Date(_0x4e6207)[_0x33c30c(0xd0)]()};try{const _0x213cb7=buildCachedTestRun(_0x4898f5,{'site':_0x365c35,'projectId':_0x5ef393,'projectName':_0xf8e561[_0x33c30c(0x134)],'agentId':_0x4c559c,'agentName':_0xf8e561[_0x33c30c(0x135)],'testYmlPath':a5_0x2b3251[_0x33c30c(0x128)](_0xf8e561[_0x33c30c(0xeb)])});saveLastTestRun(_0x213cb7);}catch{}if(_0x339e89!==_0x33c30c(0xb9)||_0xf8f27d){const _0x3b7e47=formatResults(_0x26bf6c,_0x339e89);if(_0xf8f27d)try{a5_0x5ca225[_0x33c30c(0xd6)](_0xf8f27d,_0x3b7e47,'utf-8'),console['log'](),console[_0x33c30c(0x102)](a5_0x3a3fc5[_0x33c30c(0xec)]('Output\x20written\x20to:\x20'+_0xf8f27d));}catch(_0x120b61){return console[_0x33c30c(0x102)](),console[_0x33c30c(0x102)](a5_0x3a3fc5[_0x33c30c(0xb3)](_0x33c30c(0xb7)+_0x120b61)),0x1;}else console[_0x33c30c(0x102)](),console[_0x33c30c(0x102)](_0x3b7e47);}return _0x3187d3[_0x33c30c(0xa4)]>0x0?0x1:0x0;}async[a5_0x45a8d5(0xb0)](_0x3cb9c7,_0x1dfbe7){const _0x340f6d=a5_0x45a8d5,{options:_0x188d53,tdx:_0x59285e}=_0x3cb9c7,{definition:_0x4a55a8,agentInfo:_0x54533b,outputFormat:_0x3528da,outputFile:_0xb9ca9d}=_0x1dfbe7,_0x5af4f3=_0x188d53['site'],_0x4ef744=loadLastTestRun();if(!_0x4ef744)return console[_0x340f6d(0x102)](a5_0x3a3fc5['red']('Error:\x20No\x20previous\x20test\x20run\x20found.')),console[_0x340f6d(0x102)](a5_0x3a3fc5[_0x340f6d(0xec)](_0x340f6d(0x113))),0x1;if(_0x4ef744['agent'][_0x340f6d(0x135)]!==_0x54533b[_0x340f6d(0x135)])return console[_0x340f6d(0x102)](a5_0x3a3fc5['red']('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x4ef744[_0x340f6d(0xe6)]['agentName']+_0x340f6d(0xfd)+_0x54533b[_0x340f6d(0x135)]+'\x22.')),console[_0x340f6d(0x102)](a5_0x3a3fc5['dim'](_0x340f6d(0xdf))),0x1;const _0x2c1397=new Set(_0x4ef744['conversations'][_0x340f6d(0xe8)](_0x2cbda4=>_0x2cbda4[_0x340f6d(0x108)])),_0x2672f8=_0x4a55a8[_0x340f6d(0x9f)][_0x340f6d(0xda)](_0x17cf40=>!_0x2c1397[_0x340f6d(0xe5)](_0x17cf40[_0x340f6d(0xa2)]));if(_0x2672f8['length']>0x0&&_0x4ef744[_0x340f6d(0xe0)]!==_0x5af4f3)return console[_0x340f6d(0x102)](a5_0x3a3fc5[_0x340f6d(0xb3)](_0x340f6d(0xb5))),console['log'](a5_0x3a3fc5[_0x340f6d(0xec)]('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x4ef744[_0x340f6d(0xe0)]+_0x340f6d(0x12c)+_0x5af4f3+'\x22.')),console[_0x340f6d(0x102)](a5_0x3a3fc5[_0x340f6d(0xec)](_0x340f6d(0x12a)+_0x4ef744[_0x340f6d(0xe0)]+_0x340f6d(0xe1))),0x1;const _0x270fda=_0x4a55a8[_0x340f6d(0x9f)]['filter'](_0x30ee25=>_0x2c1397[_0x340f6d(0xe5)](_0x30ee25[_0x340f6d(0xa2)])),_0x3cb80e=_0x2672f8;let _0x488082;try{_0x488082=await setupEvaluatorAgent(_0x59285e[_0x340f6d(0x119)],_0x188d53[_0x340f6d(0xbf)]);}catch(_0x41d6f8){const _0x4e6901=_0x41d6f8 instanceof Error?_0x41d6f8[_0x340f6d(0xf4)]:String(_0x41d6f8);return console[_0x340f6d(0x102)](a5_0x3a3fc5[_0x340f6d(0xb3)](_0x340f6d(0x10f)+_0x4e6901)),0x1;}console[_0x340f6d(0x102)](a5_0x3a3fc5['cyan']('Re-evaluating\x20cached\x20test\x20run...')),console['log'](_0x340f6d(0xd5)+a5_0x3a3fc5['white'](_0x4ef744[_0x340f6d(0x125)])),console[_0x340f6d(0x102)](_0x340f6d(0xd7)+a5_0x3a3fc5['white'](_0x4ef744[_0x340f6d(0xe6)][_0x340f6d(0x134)]+'/'+_0x4ef744[_0x340f6d(0xe6)][_0x340f6d(0x135)]));_0x3cb80e[_0x340f6d(0xa4)]>0x0&&console[_0x340f6d(0x102)](_0x340f6d(0xa9)+a5_0x3a3fc5[_0x340f6d(0xbb)](_0x3cb80e['length']));console[_0x340f6d(0x102)]();const _0x2b34f3=[],_0x4d9d84=Date['now'](),_0x330624=createCommandSpinner(_0x340f6d(0xe4));if(_0x270fda[_0x340f6d(0xa4)]>0x0)try{const _0x5cea73=await reevaluateFromCache(_0x59285e['llm'],_0x4ef744,{'tests':_0x270fda},{'evaluatorId':_0x488082,'onTestStart':(_0x5d5e2a,_0x425e87,_0x1341ef)=>{const _0x58458b=_0x340f6d;_0x330624[_0x58458b(0x117)]=_0x58458b(0xed)+(_0x425e87+0x1)+'/'+_0x1341ef+':\x20'+_0x5d5e2a+_0x58458b(0xf2);if(!_0x330624[_0x58458b(0xb8)])_0x330624[_0x58458b(0x115)]();},'onTestComplete':(_0x533ae7,_0x43e920)=>{const _0x55ce6f=_0x340f6d;_0x330624[_0x55ce6f(0x9d)]();if(_0x43e920[_0x55ce6f(0x11b)]===_0x55ce6f(0xe3))console[_0x55ce6f(0x102)](a5_0x3a3fc5[_0x55ce6f(0xfc)]('✓\x20PASS:\x20'+_0x533ae7)+a5_0x3a3fc5[_0x55ce6f(0xec)](_0x55ce6f(0xba)));else _0x43e920[_0x55ce6f(0x11b)]==='FAIL'?console[_0x55ce6f(0x102)](a5_0x3a3fc5['red']('✗\x20FAIL:\x20'+_0x533ae7+_0x55ce6f(0x127)+_0x43e920[_0x55ce6f(0x12d)])+a5_0x3a3fc5[_0x55ce6f(0xec)]('\x20(cached)')):console[_0x55ce6f(0x102)](a5_0x3a3fc5[_0x55ce6f(0xb3)]('✗\x20ERROR:\x20'+_0x533ae7+_0x55ce6f(0x127)+_0x43e920[_0x55ce6f(0x12d)]));_0x43e920['conversation_url']&&console['log'](a5_0x3a3fc5[_0x55ce6f(0xec)](_0x55ce6f(0x120)+_0x43e920[_0x55ce6f(0x100)])),_0x2b34f3[_0x55ce6f(0xb6)](_0x43e920);},'onTestSkipped':(_0x421317,_0x23cce0)=>{const _0x4cc5e1=_0x340f6d;_0x330624[_0x4cc5e1(0x9d)](),console['log'](a5_0x3a3fc5['yellow'](_0x4cc5e1(0x122)+_0x421317+_0x4cc5e1(0x127)+_0x23cce0));}});for(const _0x554777 of _0x5cea73){!_0x2b34f3[_0x340f6d(0xa3)](_0x27d042=>_0x27d042[_0x340f6d(0xa2)]===_0x554777[_0x340f6d(0xa2)])&&_0x2b34f3[_0x340f6d(0xb6)](_0x554777);}}catch(_0x1daf17){_0x330624[_0x340f6d(0x9d)]();const _0x2e5cf8=_0x1daf17 instanceof Error?_0x1daf17[_0x340f6d(0xf4)]:String(_0x1daf17);return console['log'](a5_0x3a3fc5[_0x340f6d(0xb3)]('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0x2e5cf8)),0x1;}_0x330624[_0x340f6d(0x9d)]();if(_0x3cb80e[_0x340f6d(0xa4)]>0x0){console[_0x340f6d(0x102)](),console[_0x340f6d(0x102)](a5_0x3a3fc5['cyan'](_0x340f6d(0xef)));const {projectId:_0xddda61,agentId:_0x35b030}=_0x4ef744[_0x340f6d(0xe6)];for(const _0x109b9b of _0x3cb80e){console[_0x340f6d(0x102)](_0x340f6d(0x11e)+a5_0x3a3fc5[_0x340f6d(0x110)](_0x109b9b['name']));const _0xb7f4f9=createCommandSpinner(_0x340f6d(0xcf)+_0x109b9b[_0x340f6d(0xee)][_0x340f6d(0xa4)]+_0x340f6d(0xae));_0xb7f4f9[_0x340f6d(0x115)]();try{const {result:_0x1edd92}=await runTest(_0x59285e['llm'],_0x109b9b,{'agentId':_0x35b030,'projectId':_0xddda61,'site':_0x4ef744[_0x340f6d(0xe0)],'noEval':![],'evaluatorId':_0x488082,'onRoundStart':(_0x2904d3,_0x13241f)=>{const _0x454f5d=_0x340f6d;_0xb7f4f9[_0x454f5d(0x117)]='Round\x20'+(_0x2904d3+0x1)+'/'+_0x13241f+_0x454f5d(0xae);},'onRoundComplete':(_0x6ee397,_0x3c4cba,_0x2084a5)=>{const _0x28c4a3=_0x340f6d,_0x163c42=formatElapsed(_0x3c4cba);_0x2084a5?console['log']('\x20\x20Round\x20'+(_0x6ee397+0x1)+'/'+_0x109b9b[_0x28c4a3(0xee)][_0x28c4a3(0xa4)]+_0x28c4a3(0xc4)+a5_0x3a3fc5[_0x28c4a3(0xfc)]('✓')+'\x20('+_0x163c42+')'):console['log'](_0x28c4a3(0x11f)+(_0x6ee397+0x1)+'/'+_0x109b9b['rounds'][_0x28c4a3(0xa4)]+_0x28c4a3(0xc4)+a5_0x3a3fc5[_0x28c4a3(0xb3)]('✗'));},'onEvaluationStart':()=>{const _0x357f08=_0x340f6d;_0xb7f4f9['text']=_0x357f08(0xe9);},'onEvaluationComplete':_0x563cef=>{const _0x56516b=_0x340f6d,_0x569af6=formatElapsed(_0x563cef);console[_0x56516b(0x102)](_0x56516b(0xa8)+a5_0x3a3fc5['green']('✓')+'\x20('+_0x569af6+')');}});_0xb7f4f9[_0x340f6d(0x9d)](),_0x2b34f3[_0x340f6d(0xb6)](_0x1edd92);if(_0x1edd92[_0x340f6d(0x11b)]==='PASS')console[_0x340f6d(0x102)](a5_0x3a3fc5[_0x340f6d(0xfc)](_0x340f6d(0xf9)+_0x1edd92[_0x340f6d(0x12d)])+a5_0x3a3fc5[_0x340f6d(0xec)](_0x340f6d(0x132)));else _0x1edd92['status']==='FAIL'?console[_0x340f6d(0x102)](a5_0x3a3fc5[_0x340f6d(0xb3)](_0x340f6d(0x9c)+_0x1edd92[_0x340f6d(0x12d)])+a5_0x3a3fc5[_0x340f6d(0xec)](_0x340f6d(0x132))):console[_0x340f6d(0x102)](a5_0x3a3fc5[_0x340f6d(0xb3)](_0x340f6d(0x126)+_0x1edd92[_0x340f6d(0x12d)]));_0x1edd92[_0x340f6d(0x100)]&&console[_0x340f6d(0x102)](a5_0x3a3fc5[_0x340f6d(0xec)](_0x340f6d(0x120)+_0x1edd92[_0x340f6d(0x100)]));}catch(_0x3c881b){_0xb7f4f9[_0x340f6d(0x9d)]();const _0x5c2113=_0x3c881b instanceof Error?_0x3c881b[_0x340f6d(0xf4)]:String(_0x3c881b);console[_0x340f6d(0x102)](a5_0x3a3fc5[_0x340f6d(0xb3)](_0x340f6d(0x126)+_0x5c2113)),_0x2b34f3[_0x340f6d(0xb6)]({'name':_0x109b9b[_0x340f6d(0xa2)],'status':_0x340f6d(0x114),'reason':_0x5c2113,'timestamp':new Date()[_0x340f6d(0xd0)](),'duration_ms':0x0});}}}console[_0x340f6d(0x102)]();const _0x2a6208=Date['now']()-_0x4d9d84,_0x28c2c1=_0x2b34f3['filter'](_0x9fc06b=>_0x9fc06b['status']===_0x340f6d(0xe3))[_0x340f6d(0xa4)],_0x58fa95=_0x2b34f3['filter'](_0xbd820d=>_0xbd820d[_0x340f6d(0x11b)]===_0x340f6d(0x118))[_0x340f6d(0xa4)],_0x526896=_0x2b34f3[_0x340f6d(0xda)](_0xde0bfd=>_0xde0bfd[_0x340f6d(0x11b)]===_0x340f6d(0x114))[_0x340f6d(0xa4)];console[_0x340f6d(0x102)]('━'[_0x340f6d(0xe2)](0x3c)),console[_0x340f6d(0x102)](_0x340f6d(0xf5)),console[_0x340f6d(0x102)]('━'[_0x340f6d(0xe2)](0x3c)),console[_0x340f6d(0x102)](_0x340f6d(0xd1)+_0x2b34f3[_0x340f6d(0xa4)]),console[_0x340f6d(0x102)](_0x340f6d(0xb4)+a5_0x3a3fc5[_0x340f6d(0xfc)](_0x28c2c1)),console[_0x340f6d(0x102)](_0x340f6d(0xf6)+a5_0x3a3fc5[_0x340f6d(0xb3)](_0x58fa95));_0x526896>0x0&&console['log'](_0x340f6d(0xf8)+a5_0x3a3fc5[_0x340f6d(0xb3)](_0x526896));console['log'](_0x340f6d(0xce)+formatElapsed(_0x2a6208)),console[_0x340f6d(0x102)]('━'[_0x340f6d(0xe2)](0x3c));const _0x1b1e39={'summary':{'total':_0x2b34f3[_0x340f6d(0xa4)],'passed':_0x28c2c1,'failed':_0x58fa95,'errors':_0x526896>0x0?_0x526896:undefined,'duration_ms':_0x2a6208},'tests':_0x2b34f3,'agent':{'project':_0x54533b[_0x340f6d(0x134)],'name':_0x54533b[_0x340f6d(0x135)],'site':_0x5af4f3},'timestamp':new Date(_0x4d9d84)[_0x340f6d(0xd0)]()};if(_0x3528da!==_0x340f6d(0xb9)||_0xb9ca9d){const _0x315236=formatResults(_0x1b1e39,_0x3528da);if(_0xb9ca9d)try{a5_0x5ca225[_0x340f6d(0xd6)](_0xb9ca9d,_0x315236,_0x340f6d(0xf0)),console[_0x340f6d(0x102)](),console[_0x340f6d(0x102)](a5_0x3a3fc5[_0x340f6d(0xec)](_0x340f6d(0xe7)+_0xb9ca9d));}catch(_0x48a398){return console[_0x340f6d(0x102)](),console[_0x340f6d(0x102)](a5_0x3a3fc5[_0x340f6d(0xb3)](_0x340f6d(0xb7)+_0x48a398)),0x1;}else console[_0x340f6d(0x102)](),console[_0x340f6d(0x102)](_0x315236);}const _0x2a70a8=_0x2b34f3[_0x340f6d(0xda)](_0x597220=>_0x597220[_0x340f6d(0x11b)]!==_0x340f6d(0xe3));return _0x2a70a8['length']>0x0?0x1:0x0;}}
|
|
1
|
+
function a5_0x1f62(_0x356485,_0x308b74){_0x356485=_0x356485-0xce;const _0x2850f7=a5_0x2850();let _0x1f6228=_0x2850f7[_0x356485];return _0x1f6228;}const a5_0x4c3f92=a5_0x1f62;(function(_0x210390,_0x42e423){const _0x224f4d=a5_0x1f62,_0x2f8bf5=_0x210390();while(!![]){try{const _0xf0e0ba=-parseInt(_0x224f4d(0xef))/0x1*(-parseInt(_0x224f4d(0xfd))/0x2)+parseInt(_0x224f4d(0x10b))/0x3*(-parseInt(_0x224f4d(0x11d))/0x4)+parseInt(_0x224f4d(0x11b))/0x5+-parseInt(_0x224f4d(0x11e))/0x6*(-parseInt(_0x224f4d(0x151))/0x7)+parseInt(_0x224f4d(0x140))/0x8+-parseInt(_0x224f4d(0x11f))/0x9+-parseInt(_0x224f4d(0x13f))/0xa;if(_0xf0e0ba===_0x42e423)break;else _0x2f8bf5['push'](_0x2f8bf5['shift']());}catch(_0x144c8d){_0x2f8bf5['push'](_0x2f8bf5['shift']());}}}(a5_0x2850,0x43622));import*as a5_0x2409c8 from'node:fs';function a5_0x2850(){const _0x3ea0ab=['\x27\x20to\x20create\x20the\x20folder\x20structure.','timestamp','Executing\x20new\x20tests...','Output\x20written\x20to:\x20','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','Failed:\x20\x20\x20','not\x20found','Re-evaluating\x20cached\x20test\x20run...','/<agent-name>','404','resolveAgentId','48tKdBZQ','No\x20tests\x20found\x20with\x20tags:\x20','has','site','\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)','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','Available\x20tags:\x20','Cached\x20run\x20from:\x20','Passed:\x20\x20\x20','multiple_agents','⚠\x20SKIPPED:\x20','repeat','green','Conversation\x20URL:\x20','toISOString','Test\x20Summary','1862980WCvxgz','llmProject','100536ixNzgb','66dWMJAH','2585052YmuJrb','dim','Re-evaluation\x20Summary','Available\x20tests:\x20','Running\x20test:\x20','executeReeval','ERROR','\x22,\x20but\x20current\x20site\x20is\x20\x22','tests','...\x20','yellow','Using\x20agent:\x20','Agent:\x20','Total:\x20\x20\x20\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','found','filter','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','projectName','utf-8','size','llm','Round\x20','✗\x20FAIL:\x20','Tests\x20found:\x20','Running:\x20','✗\x20ERROR:\x20','projectDir','Evaluating\x20response...','isSpinning','test.yml','basename','5037780cOjWcq','3184624HHssfQ','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Cached\x20run\x20is\x20from\x20site\x20\x22','now','message','agent:test','\x20\x20Evaluating...\x20','red','Test\x20','includes','\x20-\x20','\x20\x20Round\x20','join','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','...','Round\x201/','✓\x20PASS:\x20','308987ZHwzrE','Duration:\x20','testYmlPath','trim','push','no_context','PASS','agent','stop','reason','cyan','forEach','tags','\x20\x20Agent:\x20','FAIL','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','resolveProjectId','length','agentName','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','\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','Test\x20Configuration:','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','Error\x20writing\x20output\x20file:\x20','No\x20tests\x20have\x20tags\x20defined.','Error:\x20No\x20previous\x20test\x20run\x20found.','resolve','some','Failed\x20Tests:','no_local_folder','name','existsSync','toLowerCase','white','json','rounds','Usage:','status','\x20\x20Conversation:\x20','no_tests','round','Re-evaluating...','execute','writeFileSync','conversation_url','verbose','conversations','split','map',':\x20Sending\x20user\x20input...','143BmClzR','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','text','table','dryRun','log','✗\x20ERROR:\x20Project\x20not\x20found:\x20','\x20\x20Site:\x20','find','\x20(cached)','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','\x22:\x20','Errors:\x20\x20\x20','tsv','2978SawqZh','Run\x20tests\x20for\x20an\x20LLM\x20agent','add'];a5_0x2850=function(){return _0x3ea0ab;};return a5_0x2850();}import*as a5_0x33fba1 from'node:path';import a5_0x32dbc7 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_0x4c3f92(0xdb)]=a5_0x4c3f92(0x145);['description']=a5_0x4c3f92(0xfe);async[a5_0x4c3f92(0xe7)](_0x20d885){const _0x4d3273=a5_0x4c3f92,{options:_0x17fcf1,args:_0x5180e8,tdx:_0x1c2fb2}=_0x20d885,_0x353759=_0x5180e8[0x0]||'.',_0x5c7238=_0x17fcf1[_0x4d3273(0xf3)],_0x24cd39=_0x17fcf1,_0x51af2d=_0x24cd39['eval']===![],_0x254e80=_0x24cd39['reeval'],_0x27e16d=_0x24cd39['name'],_0x135227=_0x24cd39[_0x4d3273(0x15d)],_0x33e7a6=_0x17fcf1[_0x4d3273(0x10e)],_0x5bf1e0=_0x24cd39['output'];if(_0x254e80&&_0x51af2d)return console[_0x4d3273(0xf4)](a5_0x32dbc7[_0x4d3273(0x147)](_0x4d3273(0xd2))),0x1;let _0x2d1b4c=_0x4d3273(0xf2);if(_0x24cd39[_0x4d3273(0xdf)])_0x2d1b4c=_0x4d3273(0xdf);else{if(_0x24cd39['jsonl'])_0x2d1b4c='jsonl';else{if(_0x24cd39[_0x4d3273(0xfc)])_0x2d1b4c='tsv';else{if(_0x24cd39[_0x4d3273(0xf2)])_0x2d1b4c=_0x4d3273(0xf2);}}}const _0x42fecf=_0x24cd39[_0x4d3273(0x11c)];let _0x583050=_0x353759;const _0x219635=a5_0x2409c8[_0x4d3273(0xdc)](_0x353759),_0x53357e=_0x353759==='.';if(!_0x219635||_0x53357e){const _0x439862=resolveProjectFromContext(_0x353759,_0x42fecf,{'requireFile':_0x4d3273(0x13d)});if(_0x439862[_0x4d3273(0x12e)])_0x583050=_0x439862['projectDir'],_0x439862['source']==='context'&&console[_0x4d3273(0xf4)](a5_0x32dbc7['dim'](_0x4d3273(0x12a)+_0x583050));else switch(_0x439862[_0x4d3273(0x15a)]){case _0x4d3273(0x156):console[_0x4d3273(0xf4)](a5_0x32dbc7[_0x4d3273(0x129)](_0x439862[_0x4d3273(0x144)])),console[_0x4d3273(0xf4)](),console[_0x4d3273(0xf4)](_0x4d3273(0xe1)),console[_0x4d3273(0xf4)](_0x4d3273(0xd0)),console['log'](_0x4d3273(0x10f)),console[_0x4d3273(0xf4)](),console[_0x4d3273(0xf4)](_0x4d3273(0x14d));return 0x1;case _0x4d3273(0xda):console[_0x4d3273(0xf4)](a5_0x32dbc7[_0x4d3273(0x129)](_0x439862['message'])),console[_0x4d3273(0xf4)](),console[_0x4d3273(0xf4)]('Run\x20\x27tdx\x20agent\x20pull\x20'+_0x439862[_0x4d3273(0x11c)]+_0x4d3273(0x100));return 0x1;case _0x4d3273(0x114):{const _0x400440=a5_0x33fba1[_0x4d3273(0x13e)](_0x439862[_0x4d3273(0x13a)]);console[_0x4d3273(0xf4)](a5_0x32dbc7['yellow'](_0x4d3273(0xf0)+_0x439862[_0x4d3273(0x11c)]+'\x22:'));for(const _0x39250d of _0x439862['agentDirs']){console[_0x4d3273(0xf4)]('\x20\x20-\x20'+_0x39250d);}return console[_0x4d3273(0xf4)](),console['log']('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x400440+_0x4d3273(0x108)),0x1;}case _0x4d3273(0xe4):console[_0x4d3273(0xf4)](a5_0x32dbc7[_0x4d3273(0x129)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x439862['llmProject']+'\x22.')),console['log'](a5_0x32dbc7['dim']('Project\x20path:\x20'+_0x439862['projectDir'])),console['log'](),console[_0x4d3273(0xf4)](_0x4d3273(0x104));return 0x1;}}const {definition:_0x2a0952,agentInfo:_0x5c646e}=parseTestFile(_0x583050);let _0x39b4a3=_0x2a0952[_0x4d3273(0x127)];if(_0x27e16d){const _0x43c098=_0x27e16d['split'](',')[_0x4d3273(0xed)](_0x1e4456=>_0x1e4456[_0x4d3273(0x154)]());_0x39b4a3=_0x2a0952[_0x4d3273(0x127)][_0x4d3273(0x12f)](_0x563404=>_0x43c098[_0x4d3273(0x149)](_0x563404[_0x4d3273(0xdb)]));if(_0x39b4a3[_0x4d3273(0x163)]===0x0)return console[_0x4d3273(0xf4)](a5_0x32dbc7[_0x4d3273(0x129)]('No\x20tests\x20found\x20matching:\x20'+_0x27e16d)),console[_0x4d3273(0xf4)](a5_0x32dbc7[_0x4d3273(0x120)](_0x4d3273(0x122)+_0x2a0952[_0x4d3273(0x127)][_0x4d3273(0xed)](_0x275c13=>_0x275c13[_0x4d3273(0xdb)])[_0x4d3273(0x14c)](',\x20'))),0x1;}if(_0x135227){const _0x656d1b=_0x135227[_0x4d3273(0xec)](',')[_0x4d3273(0xed)](_0x38c2da=>_0x38c2da[_0x4d3273(0x154)]()[_0x4d3273(0xdd)]());_0x39b4a3=_0x39b4a3['filter'](_0x1f220d=>_0x1f220d[_0x4d3273(0x15d)]?.[_0x4d3273(0xd8)](_0x1308f4=>_0x656d1b[_0x4d3273(0x149)](_0x1308f4[_0x4d3273(0xdd)]())));if(_0x39b4a3[_0x4d3273(0x163)]===0x0){console['log'](a5_0x32dbc7['yellow'](_0x4d3273(0x10c)+_0x135227));const _0x15e6ee=new Set();return _0x2a0952[_0x4d3273(0x127)][_0x4d3273(0x15c)](_0x5867f6=>_0x5867f6['tags']?.[_0x4d3273(0x15c)](_0x224818=>_0x15e6ee[_0x4d3273(0xff)](_0x224818))),_0x15e6ee[_0x4d3273(0x133)]>0x0?console['log'](a5_0x32dbc7[_0x4d3273(0x120)](_0x4d3273(0x111)+[..._0x15e6ee][_0x4d3273(0x14c)](',\x20'))):console[_0x4d3273(0xf4)](a5_0x32dbc7['dim'](_0x4d3273(0xd5))),0x1;}}if(_0x254e80)return this['executeReeval'](_0x20d885,{'definition':{'tests':_0x39b4a3},'agentInfo':_0x5c646e,'outputFormat':_0x2d1b4c,'outputFile':_0x5bf1e0,'testNames':_0x27e16d});if(_0x5c7238){console[_0x4d3273(0xf4)](a5_0x32dbc7[_0x4d3273(0x15b)](_0x4d3273(0xd1))),console[_0x4d3273(0xf4)](_0x4d3273(0xf6)+a5_0x32dbc7[_0x4d3273(0xde)](_0x33e7a6)),console[_0x4d3273(0xf4)]('\x20\x20Project:\x20'+a5_0x32dbc7[_0x4d3273(0xde)](_0x5c646e[_0x4d3273(0x131)])),console[_0x4d3273(0xf4)](_0x4d3273(0x15e)+a5_0x32dbc7['white'](_0x5c646e[_0x4d3273(0xce)])),console['log'](),console[_0x4d3273(0xf4)](_0x4d3273(0x137)+a5_0x32dbc7[_0x4d3273(0xde)](_0x39b4a3[_0x4d3273(0x163)]));for(let _0x2e6d83=0x0;_0x2e6d83<_0x39b4a3['length'];_0x2e6d83++){const _0xd60e3a=_0x39b4a3[_0x2e6d83],_0x52f9a6=_0xd60e3a[_0x4d3273(0xe0)]['length']===0x1?_0x4d3273(0xe5):_0x4d3273(0xe0),_0x44cc8f=_0xd60e3a[_0x4d3273(0x15d)]?.['length']?'\x20['+_0xd60e3a[_0x4d3273(0x15d)][_0x4d3273(0x14c)](',\x20')+']':'';console[_0x4d3273(0xf4)]('\x20\x20'+(_0x2e6d83+0x1)+'.\x20'+a5_0x32dbc7['white'](_0xd60e3a[_0x4d3273(0xdb)])+'\x20('+_0xd60e3a[_0x4d3273(0xe0)][_0x4d3273(0x163)]+'\x20'+_0x52f9a6+')'+a5_0x32dbc7['dim'](_0x44cc8f));}return 0x0;}let _0x4de48e,_0x1ad11c;try{_0x4de48e=await _0x1c2fb2[_0x4d3273(0x134)][_0x4d3273(0x162)](_0x5c646e[_0x4d3273(0x131)]);}catch(_0x1a3099){const _0x13d9d8=_0x1a3099 instanceof Error?_0x1a3099[_0x4d3273(0x144)]:String(_0x1a3099);return _0x13d9d8[_0x4d3273(0x149)](_0x4d3273(0x109))||_0x13d9d8[_0x4d3273(0xdd)]()['includes'](_0x4d3273(0x106))?console['log'](a5_0x32dbc7[_0x4d3273(0x147)](_0x4d3273(0xf5)+_0x5c646e[_0x4d3273(0x131)])):console['log'](a5_0x32dbc7[_0x4d3273(0x147)](_0x4d3273(0x110)+_0x5c646e[_0x4d3273(0x131)]+'\x22:\x20'+_0x13d9d8)),0x1;}try{_0x1ad11c=await _0x1c2fb2[_0x4d3273(0x134)][_0x4d3273(0x10a)](_0x5c646e[_0x4d3273(0xce)],_0x4de48e);}catch(_0x214ab4){const _0x1e0df0=_0x214ab4 instanceof Error?_0x214ab4[_0x4d3273(0x144)]:String(_0x214ab4);return _0x1e0df0[_0x4d3273(0x149)](_0x4d3273(0x109))||_0x1e0df0[_0x4d3273(0xdd)]()[_0x4d3273(0x149)](_0x4d3273(0x106))?console['log'](a5_0x32dbc7['red'](_0x4d3273(0xf9)+_0x5c646e['agentName'])):console['log'](a5_0x32dbc7[_0x4d3273(0x147)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x5c646e[_0x4d3273(0xce)]+_0x4d3273(0xfa)+_0x1e0df0)),0x1;}let _0x48615b;if(!_0x51af2d)try{_0x48615b=await setupEvaluatorAgent(_0x1c2fb2[_0x4d3273(0x134)],_0x17fcf1['verbose']);}catch(_0x1fe0d8){const _0x1e1c1d=_0x1fe0d8 instanceof Error?_0x1fe0d8['message']:String(_0x1fe0d8);return console['log'](a5_0x32dbc7[_0x4d3273(0x147)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x1e1c1d)),0x1;}console[_0x4d3273(0xf4)](a5_0x32dbc7['cyan']('Running\x20agent\x20tests...')),console[_0x4d3273(0xf4)]('Site:\x20'+a5_0x32dbc7['white'](_0x33e7a6)),console['log'](_0x4d3273(0x12b)+a5_0x32dbc7[_0x4d3273(0xde)](_0x5c646e[_0x4d3273(0x131)]+'/'+_0x5c646e['agentName'])),console[_0x4d3273(0xf4)]();const _0x24c6ca=[],_0x32c501=[],_0xfae68d=Date[_0x4d3273(0x143)]();for(let _0x338f5a=0x0;_0x338f5a<_0x39b4a3[_0x4d3273(0x163)];_0x338f5a++){const _0x1f959c=_0x39b4a3[_0x338f5a];_0x39b4a3[_0x4d3273(0x163)]>0x1?console['log'](_0x4d3273(0x148)+(_0x338f5a+0x1)+'/'+_0x39b4a3[_0x4d3273(0x163)]+':\x20'+a5_0x32dbc7[_0x4d3273(0xde)](_0x1f959c['name'])):console[_0x4d3273(0xf4)](_0x4d3273(0x123)+a5_0x32dbc7[_0x4d3273(0xde)](_0x1f959c[_0x4d3273(0xdb)]));const _0x14d97a=createCommandSpinner('Round\x201/'+_0x1f959c['rounds']['length']+':\x20Sending\x20user\x20input...');_0x14d97a['start']();try{const {result:_0x4e1455,conversation:_0x7a945a}=await runTest(_0x1c2fb2['llm'],_0x1f959c,{'agentId':_0x1ad11c,'projectId':_0x4de48e,'site':_0x33e7a6,'noEval':_0x51af2d,'evaluatorId':_0x48615b,'onRoundStart':(_0x9e1aca,_0x176fab)=>{const _0x53e833=_0x4d3273;_0x14d97a['text']=_0x53e833(0x135)+(_0x9e1aca+0x1)+'/'+_0x176fab+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x3f4922,_0x5623db,_0x17740c)=>{const _0xc00c2d=_0x4d3273,_0x2da8be=formatElapsed(_0x5623db);_0x17740c?console[_0xc00c2d(0xf4)](_0xc00c2d(0x14b)+(_0x3f4922+0x1)+'/'+_0x1f959c[_0xc00c2d(0xe0)]['length']+'...\x20'+a5_0x32dbc7[_0xc00c2d(0x117)]('✓')+'\x20('+_0x2da8be+')'):console[_0xc00c2d(0xf4)](_0xc00c2d(0x14b)+(_0x3f4922+0x1)+'/'+_0x1f959c['rounds'][_0xc00c2d(0x163)]+'...\x20'+a5_0x32dbc7[_0xc00c2d(0x147)]('✗'));},'onEvaluationStart':()=>{const _0x5dadbc=_0x4d3273;_0x14d97a[_0x5dadbc(0xf1)]=_0x5dadbc(0x13b);},'onEvaluationComplete':_0x1a4a06=>{const _0x3da8b4=_0x4d3273,_0x557afc=formatElapsed(_0x1a4a06);console[_0x3da8b4(0xf4)]('\x20\x20Evaluating...\x20'+a5_0x32dbc7['green']('✓')+'\x20('+_0x557afc+')');}});_0x14d97a['stop'](),_0x24c6ca[_0x4d3273(0x155)](_0x4e1455),_0x32c501['push'](_0x7a945a);if(_0x4e1455[_0x4d3273(0xe2)]==='PASS')console[_0x4d3273(0xf4)](a5_0x32dbc7[_0x4d3273(0x117)]('✓\x20PASS:\x20'+_0x4e1455[_0x4d3273(0x15a)]));else _0x4e1455[_0x4d3273(0xe2)]===_0x4d3273(0x15f)?console[_0x4d3273(0xf4)](a5_0x32dbc7[_0x4d3273(0x147)](_0x4d3273(0x136)+_0x4e1455['reason'])):console[_0x4d3273(0xf4)](a5_0x32dbc7[_0x4d3273(0x147)]('✗\x20ERROR:\x20'+_0x4e1455[_0x4d3273(0x15a)]));_0x4e1455[_0x4d3273(0xe9)]&&console['log'](a5_0x32dbc7[_0x4d3273(0x120)](_0x4d3273(0x118)+_0x4e1455[_0x4d3273(0xe9)])),console[_0x4d3273(0xf4)]();}catch(_0x54d8c9){_0x14d97a['stop']();const _0x17a6e4=_0x54d8c9 instanceof Error?_0x54d8c9[_0x4d3273(0x144)]:String(_0x54d8c9);console['log'](a5_0x32dbc7['red'](_0x4d3273(0x139)+_0x17a6e4)),console['log'](),_0x24c6ca[_0x4d3273(0x155)]({'name':_0x1f959c[_0x4d3273(0xdb)],'status':_0x4d3273(0x125),'reason':_0x17a6e4,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x2cc9eb=Date[_0x4d3273(0x143)]()-_0xfae68d,_0x528457=_0x24c6ca[_0x4d3273(0x12f)](_0x340fba=>_0x340fba[_0x4d3273(0xe2)]==='PASS')[_0x4d3273(0x163)],_0x27c9ee=_0x24c6ca['filter'](_0x3af547=>_0x3af547[_0x4d3273(0xe2)]===_0x4d3273(0x15f))[_0x4d3273(0x163)],_0x2e7fd2=_0x24c6ca[_0x4d3273(0x12f)](_0x1a353e=>_0x1a353e['status']===_0x4d3273(0x125))[_0x4d3273(0x163)];console[_0x4d3273(0xf4)]('━'[_0x4d3273(0x116)](0x3c)),console['log'](_0x4d3273(0x11a)),console[_0x4d3273(0xf4)]('━'[_0x4d3273(0x116)](0x3c)),console[_0x4d3273(0xf4)](_0x4d3273(0x12c)+_0x24c6ca[_0x4d3273(0x163)]),console[_0x4d3273(0xf4)](_0x4d3273(0x113)+a5_0x32dbc7[_0x4d3273(0x117)](_0x528457)),console[_0x4d3273(0xf4)]('Failed:\x20\x20\x20'+a5_0x32dbc7[_0x4d3273(0x147)](_0x27c9ee));_0x2e7fd2>0x0&&console['log'](_0x4d3273(0xfb)+a5_0x32dbc7[_0x4d3273(0x147)](_0x2e7fd2));console[_0x4d3273(0xf4)]('Duration:\x20'+formatElapsed(_0x2cc9eb)),console[_0x4d3273(0xf4)]('━'[_0x4d3273(0x116)](0x3c));const _0x350ed2=_0x24c6ca[_0x4d3273(0x12f)](_0x11b988=>_0x11b988[_0x4d3273(0xe2)]!=='PASS');if(_0x350ed2[_0x4d3273(0x163)]>0x0){console['log'](),console['log'](_0x4d3273(0xd9));for(const _0x3e337f of _0x350ed2){const _0x504c0c=a5_0x32dbc7['red']('✗'),_0x5831fa=_0x3e337f[_0x4d3273(0x15a)][_0x4d3273(0x163)]>0x32?_0x3e337f[_0x4d3273(0x15a)]['substring'](0x0,0x32)+_0x4d3273(0x14e):_0x3e337f[_0x4d3273(0x15a)];console['log']('\x20\x20'+_0x504c0c+'\x20'+_0x3e337f[_0x4d3273(0xdb)]+':\x20'+_0x5831fa);}}const _0x53d6f2={'summary':{'total':_0x24c6ca[_0x4d3273(0x163)],'passed':_0x528457,'failed':_0x27c9ee,'errors':_0x2e7fd2>0x0?_0x2e7fd2:undefined,'duration_ms':_0x2cc9eb},'tests':_0x24c6ca,'agent':{'project':_0x5c646e[_0x4d3273(0x131)],'name':_0x5c646e[_0x4d3273(0xce)],'site':_0x33e7a6},'timestamp':new Date(_0xfae68d)[_0x4d3273(0x119)]()};try{const _0x1ee2d3=buildCachedTestRun(_0x32c501,{'site':_0x33e7a6,'projectId':_0x4de48e,'projectName':_0x5c646e[_0x4d3273(0x131)],'agentId':_0x1ad11c,'agentName':_0x5c646e[_0x4d3273(0xce)],'testYmlPath':a5_0x33fba1[_0x4d3273(0xd7)](_0x5c646e[_0x4d3273(0x153)])});saveLastTestRun(_0x1ee2d3);}catch{}if(_0x2d1b4c!==_0x4d3273(0xf2)||_0x5bf1e0){const _0x59b50d=formatResults(_0x53d6f2,_0x2d1b4c);if(_0x5bf1e0)try{a5_0x2409c8[_0x4d3273(0xe8)](_0x5bf1e0,_0x59b50d,_0x4d3273(0x132)),console[_0x4d3273(0xf4)](),console[_0x4d3273(0xf4)](a5_0x32dbc7[_0x4d3273(0x120)](_0x4d3273(0x103)+_0x5bf1e0));}catch(_0x30fac9){return console[_0x4d3273(0xf4)](),console[_0x4d3273(0xf4)](a5_0x32dbc7['red'](_0x4d3273(0xd4)+_0x30fac9)),0x1;}else console[_0x4d3273(0xf4)](),console['log'](_0x59b50d);}return _0x350ed2[_0x4d3273(0x163)]>0x0?0x1:0x0;}async[a5_0x4c3f92(0x124)](_0x5d54e9,_0x5bebf1){const _0x122f0b=a5_0x4c3f92,{options:_0x47a628,tdx:_0x463749}=_0x5d54e9,{definition:_0x4c8a57,agentInfo:_0x2f8f49,outputFormat:_0xd3002b,outputFile:_0x4d9f9a}=_0x5bebf1,_0x168af8=_0x47a628[_0x122f0b(0x10e)],_0x155f9b=loadLastTestRun();if(!_0x155f9b)return console[_0x122f0b(0xf4)](a5_0x32dbc7[_0x122f0b(0x147)](_0x122f0b(0xd6))),console['log'](a5_0x32dbc7['dim'](_0x122f0b(0x12d))),0x1;if(_0x155f9b[_0x122f0b(0x158)][_0x122f0b(0xce)]!==_0x2f8f49[_0x122f0b(0xce)])return console[_0x122f0b(0xf4)](a5_0x32dbc7[_0x122f0b(0x147)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x155f9b['agent']['agentName']+_0x122f0b(0x161)+_0x2f8f49[_0x122f0b(0xce)]+'\x22.')),console[_0x122f0b(0xf4)](a5_0x32dbc7['dim'](_0x122f0b(0x130))),0x1;const _0x2e4738=new Set(_0x155f9b[_0x122f0b(0xeb)][_0x122f0b(0xed)](_0x4124bc=>_0x4124bc['testName'])),_0x4f0feb=_0x4c8a57[_0x122f0b(0x127)][_0x122f0b(0x12f)](_0x4c5f27=>!_0x2e4738[_0x122f0b(0x10d)](_0x4c5f27[_0x122f0b(0xdb)]));if(_0x4f0feb[_0x122f0b(0x163)]>0x0&&_0x155f9b['site']!==_0x168af8)return console[_0x122f0b(0xf4)](a5_0x32dbc7[_0x122f0b(0x147)](_0x122f0b(0xcf))),console[_0x122f0b(0xf4)](a5_0x32dbc7[_0x122f0b(0x120)](_0x122f0b(0x142)+_0x155f9b['site']+_0x122f0b(0x126)+_0x168af8+'\x22.')),console['log'](a5_0x32dbc7[_0x122f0b(0x120)]('Either\x20switch\x20to\x20the\x20\x22'+_0x155f9b['site']+_0x122f0b(0xd3))),0x1;const _0x1f37b3=_0x4c8a57['tests'][_0x122f0b(0x12f)](_0x674928=>_0x2e4738['has'](_0x674928[_0x122f0b(0xdb)])),_0x1201fc=_0x4f0feb;let _0x18af52;try{_0x18af52=await setupEvaluatorAgent(_0x463749['llm'],_0x47a628[_0x122f0b(0xea)]);}catch(_0x1ea328){const _0x4e86de=_0x1ea328 instanceof Error?_0x1ea328['message']:String(_0x1ea328);return console[_0x122f0b(0xf4)](a5_0x32dbc7[_0x122f0b(0x147)](_0x122f0b(0x160)+_0x4e86de)),0x1;}console[_0x122f0b(0xf4)](a5_0x32dbc7[_0x122f0b(0x15b)](_0x122f0b(0x107))),console[_0x122f0b(0xf4)](_0x122f0b(0x112)+a5_0x32dbc7[_0x122f0b(0xde)](_0x155f9b[_0x122f0b(0x101)])),console['log'](_0x122f0b(0x12b)+a5_0x32dbc7['white'](_0x155f9b[_0x122f0b(0x158)][_0x122f0b(0x131)]+'/'+_0x155f9b[_0x122f0b(0x158)][_0x122f0b(0xce)]));_0x1201fc['length']>0x0&&console[_0x122f0b(0xf4)]('New\x20tests\x20to\x20execute:\x20'+a5_0x32dbc7[_0x122f0b(0x129)](_0x1201fc[_0x122f0b(0x163)]));console['log']();const _0x17b289=[],_0x20af69=Date['now'](),_0x4af60b=createCommandSpinner(_0x122f0b(0xe6));if(_0x1f37b3[_0x122f0b(0x163)]>0x0)try{const _0x19f898=await reevaluateFromCache(_0x463749[_0x122f0b(0x134)],_0x155f9b,{'tests':_0x1f37b3},{'evaluatorId':_0x18af52,'onTestStart':(_0x498a2a,_0x525095,_0x339545)=>{const _0x57d0b7=_0x122f0b;_0x4af60b[_0x57d0b7(0xf1)]='Re-evaluating\x20'+(_0x525095+0x1)+'/'+_0x339545+':\x20'+_0x498a2a+_0x57d0b7(0x14e);if(!_0x4af60b[_0x57d0b7(0x13c)])_0x4af60b['start']();},'onTestComplete':(_0x262958,_0x117b9d)=>{const _0x59ba9d=_0x122f0b;_0x4af60b['stop']();if(_0x117b9d['status']===_0x59ba9d(0x157))console[_0x59ba9d(0xf4)](a5_0x32dbc7[_0x59ba9d(0x117)]('✓\x20PASS:\x20'+_0x262958)+a5_0x32dbc7['dim'](_0x59ba9d(0xf8)));else _0x117b9d['status']===_0x59ba9d(0x15f)?console[_0x59ba9d(0xf4)](a5_0x32dbc7['red'](_0x59ba9d(0x136)+_0x262958+_0x59ba9d(0x14a)+_0x117b9d[_0x59ba9d(0x15a)])+a5_0x32dbc7['dim'](_0x59ba9d(0xf8))):console[_0x59ba9d(0xf4)](a5_0x32dbc7['red']('✗\x20ERROR:\x20'+_0x262958+'\x20-\x20'+_0x117b9d[_0x59ba9d(0x15a)]));_0x117b9d['conversation_url']&&console[_0x59ba9d(0xf4)](a5_0x32dbc7['dim'](_0x59ba9d(0xe3)+_0x117b9d[_0x59ba9d(0xe9)])),_0x17b289[_0x59ba9d(0x155)](_0x117b9d);},'onTestSkipped':(_0x13491d,_0x4a06c5)=>{const _0x138db7=_0x122f0b;_0x4af60b['stop'](),console['log'](a5_0x32dbc7['yellow'](_0x138db7(0x115)+_0x13491d+_0x138db7(0x14a)+_0x4a06c5));}});for(const _0x1eaf9a of _0x19f898){!_0x17b289[_0x122f0b(0xf7)](_0x21c94f=>_0x21c94f['name']===_0x1eaf9a[_0x122f0b(0xdb)])&&_0x17b289[_0x122f0b(0x155)](_0x1eaf9a);}}catch(_0x5b5af0){_0x4af60b['stop']();const _0x4c4149=_0x5b5af0 instanceof Error?_0x5b5af0[_0x122f0b(0x144)]:String(_0x5b5af0);return console[_0x122f0b(0xf4)](a5_0x32dbc7[_0x122f0b(0x147)](_0x122f0b(0x141)+_0x4c4149)),0x1;}_0x4af60b[_0x122f0b(0x159)]();if(_0x1201fc['length']>0x0){console['log'](),console[_0x122f0b(0xf4)](a5_0x32dbc7[_0x122f0b(0x15b)](_0x122f0b(0x102)));const {projectId:_0x387f37,agentId:_0x3f26af}=_0x155f9b['agent'];for(const _0x410137 of _0x1201fc){console[_0x122f0b(0xf4)](_0x122f0b(0x138)+a5_0x32dbc7[_0x122f0b(0xde)](_0x410137['name']));const _0x5a2b56=createCommandSpinner(_0x122f0b(0x14f)+_0x410137[_0x122f0b(0xe0)]['length']+':\x20Sending\x20user\x20input...');_0x5a2b56['start']();try{const {result:_0x5e7aab}=await runTest(_0x463749['llm'],_0x410137,{'agentId':_0x3f26af,'projectId':_0x387f37,'site':_0x155f9b[_0x122f0b(0x10e)],'noEval':![],'evaluatorId':_0x18af52,'onRoundStart':(_0xaaef2f,_0x1dfc24)=>{const _0x4ae78a=_0x122f0b;_0x5a2b56['text']=_0x4ae78a(0x135)+(_0xaaef2f+0x1)+'/'+_0x1dfc24+_0x4ae78a(0xee);},'onRoundComplete':(_0x2047c8,_0xa05eb4,_0x3af40b)=>{const _0x5b341a=_0x122f0b,_0x2d669b=formatElapsed(_0xa05eb4);_0x3af40b?console[_0x5b341a(0xf4)]('\x20\x20Round\x20'+(_0x2047c8+0x1)+'/'+_0x410137[_0x5b341a(0xe0)]['length']+'...\x20'+a5_0x32dbc7[_0x5b341a(0x117)]('✓')+'\x20('+_0x2d669b+')'):console[_0x5b341a(0xf4)](_0x5b341a(0x14b)+(_0x2047c8+0x1)+'/'+_0x410137[_0x5b341a(0xe0)][_0x5b341a(0x163)]+_0x5b341a(0x128)+a5_0x32dbc7[_0x5b341a(0x147)]('✗'));},'onEvaluationStart':()=>{const _0x44257c=_0x122f0b;_0x5a2b56[_0x44257c(0xf1)]='Evaluating\x20response...';},'onEvaluationComplete':_0x4083a7=>{const _0x1bffb1=_0x122f0b,_0x464cff=formatElapsed(_0x4083a7);console[_0x1bffb1(0xf4)](_0x1bffb1(0x146)+a5_0x32dbc7[_0x1bffb1(0x117)]('✓')+'\x20('+_0x464cff+')');}});_0x5a2b56[_0x122f0b(0x159)](),_0x17b289[_0x122f0b(0x155)](_0x5e7aab);if(_0x5e7aab['status']===_0x122f0b(0x157))console['log'](a5_0x32dbc7[_0x122f0b(0x117)](_0x122f0b(0x150)+_0x5e7aab[_0x122f0b(0x15a)])+a5_0x32dbc7[_0x122f0b(0x120)]('\x20(new)'));else _0x5e7aab[_0x122f0b(0xe2)]===_0x122f0b(0x15f)?console[_0x122f0b(0xf4)](a5_0x32dbc7['red'](_0x122f0b(0x136)+_0x5e7aab['reason'])+a5_0x32dbc7[_0x122f0b(0x120)]('\x20(new)')):console[_0x122f0b(0xf4)](a5_0x32dbc7['red']('✗\x20ERROR:\x20'+_0x5e7aab[_0x122f0b(0x15a)]));_0x5e7aab[_0x122f0b(0xe9)]&&console['log'](a5_0x32dbc7[_0x122f0b(0x120)](_0x122f0b(0xe3)+_0x5e7aab[_0x122f0b(0xe9)]));}catch(_0x289a45){_0x5a2b56['stop']();const _0x27b772=_0x289a45 instanceof Error?_0x289a45[_0x122f0b(0x144)]:String(_0x289a45);console['log'](a5_0x32dbc7[_0x122f0b(0x147)]('✗\x20ERROR:\x20'+_0x27b772)),_0x17b289[_0x122f0b(0x155)]({'name':_0x410137[_0x122f0b(0xdb)],'status':'ERROR','reason':_0x27b772,'timestamp':new Date()[_0x122f0b(0x119)](),'duration_ms':0x0});}}}console[_0x122f0b(0xf4)]();const _0x864804=Date['now']()-_0x20af69,_0x4c6f52=_0x17b289[_0x122f0b(0x12f)](_0x5d5ab4=>_0x5d5ab4['status']==='PASS')[_0x122f0b(0x163)],_0x5035ec=_0x17b289['filter'](_0x122442=>_0x122442['status']==='FAIL')['length'],_0xfa3165=_0x17b289['filter'](_0x43c14b=>_0x43c14b[_0x122f0b(0xe2)]==='ERROR')['length'];console[_0x122f0b(0xf4)]('━'[_0x122f0b(0x116)](0x3c)),console[_0x122f0b(0xf4)](_0x122f0b(0x121)),console[_0x122f0b(0xf4)]('━'['repeat'](0x3c)),console['log'](_0x122f0b(0x12c)+_0x17b289[_0x122f0b(0x163)]),console[_0x122f0b(0xf4)]('Passed:\x20\x20\x20'+a5_0x32dbc7['green'](_0x4c6f52)),console[_0x122f0b(0xf4)](_0x122f0b(0x105)+a5_0x32dbc7[_0x122f0b(0x147)](_0x5035ec));_0xfa3165>0x0&&console[_0x122f0b(0xf4)](_0x122f0b(0xfb)+a5_0x32dbc7[_0x122f0b(0x147)](_0xfa3165));console[_0x122f0b(0xf4)](_0x122f0b(0x152)+formatElapsed(_0x864804)),console[_0x122f0b(0xf4)]('━'[_0x122f0b(0x116)](0x3c));const _0x16fbe5={'summary':{'total':_0x17b289[_0x122f0b(0x163)],'passed':_0x4c6f52,'failed':_0x5035ec,'errors':_0xfa3165>0x0?_0xfa3165:undefined,'duration_ms':_0x864804},'tests':_0x17b289,'agent':{'project':_0x2f8f49[_0x122f0b(0x131)],'name':_0x2f8f49[_0x122f0b(0xce)],'site':_0x168af8},'timestamp':new Date(_0x20af69)[_0x122f0b(0x119)]()};if(_0xd3002b!==_0x122f0b(0xf2)||_0x4d9f9a){const _0x126fc6=formatResults(_0x16fbe5,_0xd3002b);if(_0x4d9f9a)try{a5_0x2409c8[_0x122f0b(0xe8)](_0x4d9f9a,_0x126fc6,_0x122f0b(0x132)),console[_0x122f0b(0xf4)](),console[_0x122f0b(0xf4)](a5_0x32dbc7[_0x122f0b(0x120)](_0x122f0b(0x103)+_0x4d9f9a));}catch(_0x67c098){return console[_0x122f0b(0xf4)](),console[_0x122f0b(0xf4)](a5_0x32dbc7[_0x122f0b(0x147)](_0x122f0b(0xd4)+_0x67c098)),0x1;}else console[_0x122f0b(0xf4)](),console[_0x122f0b(0xf4)](_0x126fc6);}const _0x32a6d7=_0x17b289[_0x122f0b(0x12f)](_0x3a30c7=>_0x3a30c7['status']!==_0x122f0b(0x157));return _0x32a6d7['length']>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x39c2c6=a6_0x3335;(function(_0x37d326,_0x14ddab){const _0xc232e6=a6_0x3335,_0x1b5c18=_0x37d326();while(!![]){try{const _0x5f309d=-parseInt(_0xc232e6(0x19c))/0x1+parseInt(_0xc232e6(0x168))/0x2+-parseInt(_0xc232e6(0x177))/0x3*(-parseInt(_0xc232e6(0x167))/0x4)+-parseInt(_0xc232e6(0x17b))/0x5+parseInt(_0xc232e6(0x176))/0x6*(-parseInt(_0xc232e6(0x17d))/0x7)+-parseInt(_0xc232e6(0x173))/0x8*(parseInt(_0xc232e6(0x193))/0x9)+parseInt(_0xc232e6(0x165))/0xa;if(_0x5f309d===_0x14ddab)break;else _0x1b5c18['push'](_0x1b5c18['shift']());}catch(_0x406dca){_0x1b5c18['push'](_0x1b5c18['shift']());}}}(a6_0x2807,0x7c1e4));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';function a6_0x2807(){const _0x4ce357=['startsWith','includes','api','Results\x20saved\x20to\x20','site','request','Invalid\x20API\x20type:\x20','Endpoint\x20must\x20start\x20with\x20/:\x20','workflow','keys','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','error','type','verbose','set-cookie','set-cookie2','readBodyFromFile','827829NzvRZP','proxy-authorization','x-auth-token','llm-proxy','file','noColor','headers','log','execute','267253juAEjk','Invalid\x20header\x20format:\x20\x22','authorization','Invalid\x20HTTP\x20method:\x20','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','toUpperCase','trim','color','llm','message','body','toLowerCase','1467130bfEpDB','stack','44fXaMLi','1223502gnoYtp','GET','validate','<\x20HTTP/1.1\x20','\x22.\x20','method','Error:\x20','PATCH','isArray','output','\x0aStack\x20trace:\x0a','8jDYWeS','description','status','79812gDiiXX','169833nqtUpb','has','length','data','173455bjavxW','substring','252vzDiUU','join','entries','x-trino-user','POST'];a6_0x2807=function(){return _0x4ce357;};return a6_0x2807();}import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x39c2c6(0x19e),a6_0x39c2c6(0x194),'cookie',a6_0x39c2c6(0x190),a6_0x39c2c6(0x191),'x-xsrf-token',a6_0x39c2c6(0x195),a6_0x39c2c6(0x180)]);function a6_0x3335(_0x232f47,_0x2f3521){_0x232f47=_0x232f47-0x163;const _0x280749=a6_0x2807();let _0x333529=_0x280749[_0x232f47];return _0x333529;}function isSensitiveHeader(_0x324dc4){const _0x29810b=a6_0x39c2c6;return SENSITIVE_HEADERS[_0x29810b(0x178)](_0x324dc4[_0x29810b(0x164)]());}function parseHeader(_0x23bd78){const _0x43e384=a6_0x39c2c6,_0x23b418=_0x23bd78['indexOf'](':');if(_0x23b418===-0x1)throw new Error(_0x43e384(0x19d)+_0x23bd78+_0x43e384(0x16c)+_0x43e384(0x1a0));const _0x230ce4=_0x23bd78['substring'](0x0,_0x23b418)[_0x43e384(0x1a2)](),_0x590f69=_0x23bd78[_0x43e384(0x17c)](_0x23b418+0x1)['trim']();if(!_0x230ce4)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0x23bd78+'\x22');return[_0x230ce4,_0x590f69];}export class ApiCommand extends BaseCommand{['name']=a6_0x39c2c6(0x184);[a6_0x39c2c6(0x174)]='Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs';[a6_0x39c2c6(0x16a)](_0xbeead1){const _0x2cf113=a6_0x39c2c6,{args:_0xca9fd8,options:_0xefd88c}=_0xbeead1,_0xb85296=_0xefd88c;if(_0xca9fd8[_0x2cf113(0x179)]===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x3cbb51=_0xca9fd8[0x0];if(!_0x3cbb51[_0x2cf113(0x182)]('/'))return _0x2cf113(0x189)+_0x3cbb51;const _0x13eafe=_0xb85296[_0x2cf113(0x17a)],_0x11589b=_0xb85296[_0x2cf113(0x197)];if(_0x13eafe&&_0x11589b)return _0x2cf113(0x18c);const _0x2cc984=_0xb85296[_0x2cf113(0x16d)]||_0x2cf113(0x169),_0x2d062e=[_0x2cf113(0x169),_0x2cf113(0x181),'PUT','DELETE',_0x2cf113(0x16f)];if(!_0x2d062e[_0x2cf113(0x183)](_0x2cc984['toUpperCase']()))return _0x2cf113(0x19f)+_0x2cc984+'.\x20Valid\x20methods:\x20'+_0x2d062e[_0x2cf113(0x17e)](',\x20');const _0x17e9f5=_0xb85296[_0x2cf113(0x18e)]||'td',_0x315a25=['td','cdp',_0x2cf113(0x18a),'trino',_0x2cf113(0x1a4),_0x2cf113(0x196)];if(!_0x315a25[_0x2cf113(0x183)](_0x17e9f5))return _0x2cf113(0x188)+_0x17e9f5+'.\x20Valid\x20types:\x20'+_0x315a25[_0x2cf113(0x17e)](',\x20');return undefined;}async[a6_0x39c2c6(0x19b)](_0x36b29b){const _0x1e7456=a6_0x39c2c6,{options:_0xc0a1c3,args:_0x1f002d,tdx:_0xd47c93}=_0x36b29b,_0xad0dd6=_0xc0a1c3,_0x262440=_0x1f002d[0x0],_0x38b2df=(_0xad0dd6[_0x1e7456(0x16d)]||'GET')[_0x1e7456(0x1a1)](),_0xa5e5a1=_0xad0dd6[_0x1e7456(0x17a)],_0x135f98=_0xad0dd6['file'],_0x13e1d8=_0xad0dd6['header'],_0x33da4a=_0xad0dd6[_0x1e7456(0x18e)]||'td';try{const _0x62f8a8={};if(_0x13e1d8){const _0x4c2a6e=Array[_0x1e7456(0x170)](_0x13e1d8)?_0x13e1d8:[_0x13e1d8];for(const _0x404bc1 of _0x4c2a6e){const [_0x5530ce,_0x4cd2f6]=parseHeader(_0x404bc1);_0x62f8a8[_0x5530ce]=_0x4cd2f6;}}let _0x55a2b2;if(_0xa5e5a1)_0x55a2b2=_0xa5e5a1;else{if(_0x135f98)try{_0x55a2b2=RawAPI[_0x1e7456(0x192)](_0x135f98);}catch(_0x130ad8){return console[_0x1e7456(0x18d)](_0x1e7456(0x16e)+(_0x130ad8 instanceof Error?_0x130ad8[_0x1e7456(0x1a5)]:String(_0x130ad8))),0x1;}}const _0x178e9b={'method':_0x38b2df,'apiType':_0x33da4a,'includeHeaders':_0xc0a1c3[_0x1e7456(0x18f)]};_0x55a2b2&&(_0x178e9b[_0x1e7456(0x163)]=_0x55a2b2);Object[_0x1e7456(0x18b)](_0x62f8a8)['length']>0x0&&(_0x178e9b[_0x1e7456(0x199)]=_0x62f8a8);if(_0xc0a1c3['verbose']){const _0x4d83d9=resolveSite(_0xc0a1c3[_0x1e7456(0x186)]),_0x378bea=getEndpoint(_0x4d83d9,_0x33da4a),_0x501629=''+_0x378bea+_0x262440;console['error']('>\x20'+_0x38b2df+'\x20'+_0x501629);const _0x3fa77b=getAuthHeaders(_0x4d83d9),_0x280ac5={..._0x3fa77b,..._0x62f8a8};for(const [_0x42d4b3,_0x48a6c1]of Object[_0x1e7456(0x17f)](_0x280ac5)){!isSensitiveHeader(_0x42d4b3)&&console['error']('>\x20'+_0x42d4b3+':\x20'+_0x48a6c1);}_0x55a2b2&&console[_0x1e7456(0x18d)]('>'),console['error']('');}const _0x196a12=await _0xd47c93[_0x1e7456(0x184)][_0x1e7456(0x187)](_0x262440,_0x178e9b);if(_0xc0a1c3['verbose']&&_0x196a12[_0x1e7456(0x199)]){console['error'](_0x1e7456(0x16b)+_0x196a12[_0x1e7456(0x175)]);for(const [_0x4f37fb,_0x381526]of Object[_0x1e7456(0x17f)](_0x196a12[_0x1e7456(0x199)])){!isSensitiveHeader(_0x4f37fb)&&console[_0x1e7456(0x18d)]('<\x20'+_0x4f37fb+':\x20'+_0x381526);}console[_0x1e7456(0x18d)]('');}const _0x2a168a=Boolean(_0xc0a1c3[_0x1e7456(0x171)]),_0x83c9f2={'color':_0xc0a1c3[_0x1e7456(0x1a3)],'noColor':_0xc0a1c3[_0x1e7456(0x198)]||_0x2a168a&&!_0xc0a1c3[_0x1e7456(0x1a3)]},_0x3a0f53=colorizeJSON(_0x196a12['data'],_0x83c9f2);return _0xc0a1c3['output']?(writeFileSync(_0xc0a1c3['output'],_0x3a0f53),console['error'](_0x1e7456(0x185)+_0xc0a1c3[_0x1e7456(0x171)])):console[_0x1e7456(0x19a)](_0x3a0f53),0x0;}catch(_0x18bfb4){return _0x18bfb4 instanceof Error?(console['error']('Error:\x20'+_0x18bfb4['message']),_0xc0a1c3[_0x1e7456(0x18f)]&&_0x18bfb4[_0x1e7456(0x166)]&&console[_0x1e7456(0x18d)](_0x1e7456(0x172)+_0x18bfb4[_0x1e7456(0x166)])):console[_0x1e7456(0x18d)]('Error:\x20'+String(_0x18bfb4)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a7_0x12de54=a7_0x2f70;(function(_0x257fe7,_0x2c3bf1){const _0x72531d=a7_0x2f70,_0x20e7a2=_0x257fe7();while(!![]){try{const _0x3d1d5f=-parseInt(_0x72531d(0x154))/0x1+parseInt(_0x72531d(0x157))/0x2+parseInt(_0x72531d(0x14d))/0x3*(parseInt(_0x72531d(0x15a))/0x4)+parseInt(_0x72531d(0x120))/0x5*(parseInt(_0x72531d(0x134))/0x6)+parseInt(_0x72531d(0x11d))/0x7+parseInt(_0x72531d(0x11b))/0x8*(parseInt(_0x72531d(0x12b))/0x9)+-parseInt(_0x72531d(0x130))/0xa*(parseInt(_0x72531d(0x15c))/0xb);if(_0x3d1d5f===_0x2c3bf1)break;else _0x20e7a2['push'](_0x20e7a2['shift']());}catch(_0x199724){_0x20e7a2['push'](_0x20e7a2['shift']());}}}(a7_0x5d04,0x44aa7));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';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_0x3af851 from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';function a7_0x5d04(){const _0x45cf19=['profile','10EPTwsc','✓\x20Authentication\x20successful\x0a','us01','all','1068Foqlaa','No\x20credential\x20found','\x20\x20tdx','✗\x20Validation\x20failed:\x20','User:\x20','Name:\x20','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','\x20for\x20profile:\x20','log','Remove\x20API\x20key\x20from\x20system\x20keychain','API\x20Key','logLevel','API\x20key\x20cannot\x20be\x20empty','oauth','API\x20key','Setting\x20up\x20authentication\x20for\x20site:\x20','warn','join','tdx:\x20auth\x20setup','N/A','\x20and\x20','error','method','password','auth','479949XiraAb','email','✓\x20Profile\x20\x27','filter','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','✓\x20Default\x20site\x20set\x20to\x20','356764RjFTbt','tdx:\x20auth\x20clear','Read\x20credential\x20from\x20','345148yJtXcB','\x20removed\x20from\x20keychain','auth:clear','12UfMdCy','execute','5608119vAGmoy','status','yellow','green','Choose\x20authentication\x20method:','\x20(site:\x20','first_name','System\x20keychain\x20is\x20not\x20available','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','OAuth\x20tokens','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','\x0aSetup\x20cancelled','last_name','site','trim','568ouYYdf','/app/mp/ak','391958pDOGQL','description','\x27\x20registered','11545ZVgicZ','Validating\x20API\x20key...','\x20(profile:\x20','message','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','Setup\x20cancelled','bold','apiKey','ERROR','tdx\x20profile:\x20','red','3591HEZdHi','Credential\x20type:\x20OAuth','create','name'];a7_0x5d04=function(){return _0x45cf19;};return a7_0x5d04();}import{LogLevel}from'../utils/tdx-logger.js';import a7_0x3eb7f from'chalk';export class AuthSetupCommand extends BaseCommand{['name']='auth:setup';[a7_0x12de54(0x11e)]='Setup\x20API\x20key\x20authentication\x20interactively';async[a7_0x12de54(0x15b)](_0x15ef31){const _0x241bce=a7_0x12de54,{options:_0x45ab42}=_0x15ef31,_0x65142b=_0x45ab42[_0x241bce(0x12f)];console['log'](a7_0x3eb7f['bold'](_0x241bce(0x146)));const _0x4ed1c9=_0x45ab42[_0x241bce(0x119)]||_0x241bce(0x132),_0x4761d7=await promptSiteSelection(_0x4ed1c9,_0x65142b,_0x241bce(0x125));if(!_0x4761d7)return 0x1;const _0x493b83=resolveSite(_0x4761d7);if(isOAuthSupported(_0x493b83)){const _0x3670ba=await a7_0x3af851({'type':'select','name':_0x241bce(0x14a),'message':_0x241bce(0x160),'choices':[{'title':'OAuth\x20(browser\x20login)','value':_0x241bce(0x141)},{'title':_0x241bce(0x13e),'value':'apikey'}]});if(!_0x3670ba['method'])return console[_0x241bce(0x13c)]('\x0aSetup\x20cancelled'),0x1;if(_0x3670ba[_0x241bce(0x14a)]===_0x241bce(0x141))return await runOAuthLoginFlow(_0x493b83,_0x65142b,_0x45ab42['logLevel']??LogLevel[_0x241bce(0x128)]),0x0;}console[_0x241bce(0x13c)](_0x241bce(0x143)+_0x493b83),console[_0x241bce(0x13c)]('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0x241bce(0x13c)]('\x20\x20'+getConsoleUrl(_0x493b83,_0x241bce(0x11c)));const _0xf353de=await a7_0x3af851({'type':_0x241bce(0x14b),'name':'apiKey','message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x64708e=>{const _0x280bbf=_0x241bce;if(!_0x64708e||!_0x64708e[_0x280bbf(0x11a)]())return _0x280bbf(0x140);return!![];}});if(!_0xf353de[_0x241bce(0x127)])return console['log'](_0x241bce(0x117)),0x1;const _0x39d77b=_0xf353de[_0x241bce(0x127)];console[_0x241bce(0x13c)](_0x241bce(0x121));try{const _0x346e6d=TDX[_0x241bce(0x12d)]({'site':_0x493b83,'apiKey':_0x39d77b[_0x241bce(0x11a)](),'logLevel':_0x45ab42[_0x241bce(0x13f)]??LogLevel[_0x241bce(0x128)]}),_0x3a5e9d=await _0x346e6d['jobs']['getUserInfo']();console[_0x241bce(0x13c)](_0x241bce(0x124)+_0x3a5e9d[_0x241bce(0x14e)]+')');const _0x19592b=await isKeychainAvailable();_0x19592b?(await saveAPIKeyAsync(_0x39d77b[_0x241bce(0x11a)](),_0x493b83,_0x65142b),console[_0x241bce(0x13c)]('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0x65142b?_0x241bce(0x122)+_0x65142b+')':''))):(console[_0x241bce(0x144)](a7_0x3eb7f[_0x241bce(0x15e)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0x241bce(0x144)](a7_0x3eb7f[_0x241bce(0x15e)](_0x241bce(0x164))));if(_0x65142b){const _0xb67919={'site':_0x493b83};saveProfileToUserConfig(_0x65142b,_0xb67919),console[_0x241bce(0x13c)](_0x241bce(0x14f)+_0x65142b+_0x241bce(0x11f));}else saveDefaultSiteToUserConfig(_0x493b83),console[_0x241bce(0x13c)](_0x241bce(0x153)+_0x493b83);const _0x376f84=_0x65142b?'\x20--profile\x20'+_0x65142b:'';return console[_0x241bce(0x13c)](),console[_0x241bce(0x13c)](_0x241bce(0x166)),console[_0x241bce(0x13c)](_0x241bce(0x136)+_0x376f84+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x241bce(0x13c)](_0x241bce(0x136)+_0x376f84+_0x241bce(0x13a)),0x0;}catch(_0x6bdb30){if(_0x6bdb30 instanceof HTTPClientError&&_0x6bdb30[_0x241bce(0x15d)]===0x191)return printAuthError(_0x6bdb30),0x1;return console['error'](a7_0x3eb7f[_0x241bce(0x12a)](_0x241bce(0x137)+(_0x6bdb30 instanceof Error?_0x6bdb30[_0x241bce(0x123)]:String(_0x6bdb30)))),console[_0x241bce(0x149)](_0x241bce(0x151)),0x1;}}}function a7_0x2f70(_0x4fd399,_0x5be565){_0x4fd399=_0x4fd399-0x117;const _0x5d049a=a7_0x5d04();let _0x2f70fc=_0x5d049a[_0x4fd399];return _0x2f70fc;}export class AuthStatusCommand extends BaseCommand{[a7_0x12de54(0x12e)]=a7_0x12de54(0x14c);['description']=a7_0x12de54(0x152);async[a7_0x12de54(0x15b)](_0x2a3206){const _0xa0a947=a7_0x12de54,{options:_0x32e27e,tdx:_0xa65b1d}=_0x2a3206,_0x1927d7=_0x32e27e[_0xa0a947(0x119)],_0x55d830=_0x32e27e['profile'],_0x1e260c=_0x55d830?_0x55d830:_0xa0a947(0x147);console[_0xa0a947(0x13c)](_0xa0a947(0x129)+_0x1e260c+_0xa0a947(0x161)+_0x1927d7+')');const _0x2fd8a0=await getOAuthTokens(_0x55d830);if(_0x2fd8a0)console['log'](_0xa0a947(0x12c)),console[_0xa0a947(0x13c)]('Read\x20credential\x20from\x20keychain'+(_0x55d830?_0xa0a947(0x122)+_0x55d830+')':''));else{const _0x58028b=await resolveAPIKeyAsync(_0x1927d7,_0x55d830);if(_0x58028b){const {source:_0x50fbaa,isDeprecated:_0x41bedb}=_0x58028b,_0x1fb036=_0xa0a947(0x156)+_0x50fbaa;console['log'](_0x41bedb?a7_0x3eb7f['yellow'](_0x1fb036):_0x1fb036);}else console['log'](a7_0x3eb7f[_0xa0a947(0x15e)](_0xa0a947(0x135)));}try{const _0x23605d=await _0xa65b1d['jobs']['getUserInfo']();return console[_0xa0a947(0x13c)](a7_0x3eb7f[_0xa0a947(0x15f)](_0xa0a947(0x131))),console[_0xa0a947(0x13c)](_0xa0a947(0x138)+_0x23605d[_0xa0a947(0x14e)]),(_0x23605d['first_name']||_0x23605d[_0xa0a947(0x118)])&&console[_0xa0a947(0x13c)](_0xa0a947(0x139)+[_0x23605d[_0xa0a947(0x162)],_0x23605d['last_name']][_0xa0a947(0x150)](Boolean)['join']('\x20')),0x0;}catch(_0x29760b){return _0x29760b instanceof HTTPClientError&&_0x29760b[_0xa0a947(0x15d)]===0x191?printAuthError(_0x29760b,!![],_0x55d830):console[_0xa0a947(0x149)](a7_0x3eb7f[_0xa0a947(0x12a)](_0xa0a947(0x137)+(_0x29760b instanceof Error?_0x29760b['message']:String(_0x29760b)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x12de54(0x12e)]=a7_0x12de54(0x159);[a7_0x12de54(0x11e)]=a7_0x12de54(0x13d);async[a7_0x12de54(0x15b)](_0x4bf57f){const _0x358358=a7_0x12de54,{options:_0xf9cb3c}=_0x4bf57f,_0x39a944=_0xf9cb3c['profile'];console[_0x358358(0x13c)](a7_0x3eb7f[_0x358358(0x126)](_0x358358(0x155)));const _0x2974f0=await isKeychainAvailable();if(!_0x2974f0)return console['error'](a7_0x3eb7f[_0x358358(0x12a)](_0x358358(0x163))),0x1;const [_0x456594,_0x4192f0]=await Promise[_0x358358(0x133)]([deleteKeychainAPIKey(_0x39a944),deleteOAuthTokens(_0x39a944)]);if(_0x456594||_0x4192f0){clearCredentialCache();const _0x2acb63=[_0x456594&&_0x358358(0x142),_0x4192f0&&_0x358358(0x165)][_0x358358(0x150)](Boolean)[_0x358358(0x145)](_0x358358(0x148));return console[_0x358358(0x13c)]('✓\x20'+_0x2acb63+_0x358358(0x158)+(_0x39a944?_0x358358(0x122)+_0x39a944+')':'')),0x0;}else return console[_0x358358(0x13c)]('No\x20credentials\x20found\x20in\x20keychain'+(_0x39a944?_0x358358(0x13b)+_0x39a944:'')),0x1;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a8_0x59135d=a8_0x1ae2;(function(_0x455c6e,_0x39fc46){const _0x790d9c=a8_0x1ae2,_0x19e10d=_0x455c6e();while(!![]){try{const _0x446627=parseInt(_0x790d9c(0x1be))/0x1*(-parseInt(_0x790d9c(0x1cc))/0x2)+-parseInt(_0x790d9c(0x1b3))/0x3*(-parseInt(_0x790d9c(0x1b6))/0x4)+-parseInt(_0x790d9c(0x1c6))/0x5+parseInt(_0x790d9c(0x1c8))/0x6*(-parseInt(_0x790d9c(0x1d4))/0x7)+-parseInt(_0x790d9c(0x1ce))/0x8+parseInt(_0x790d9c(0x1ab))/0x9+-parseInt(_0x790d9c(0x1aa))/0xa*(-parseInt(_0x790d9c(0x1b2))/0xb);if(_0x446627===_0x39fc46)break;else _0x19e10d['push'](_0x19e10d['shift']());}catch(_0x4d84ec){_0x19e10d['push'](_0x19e10d['shift']());}}}(a8_0x52af,0x201db));function a8_0x52af(){const _0x5ef67d=['✓\x20Authentication\x20successful\x20(User:\x20','784454wwllLb','6qPMEUI','auth:login','Opening\x20browser\x20for\x20authentication...','179292sdwUtL','Authenticating\x20via\x20OAuth\x20for\x20site:\x20','tdx:\x20auth\x20login','execute','jobs','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','us01','\x20--profile\x20','205vDQClv','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','Login\x20via\x20OAuth\x20(opens\x20browser)','OAuth\x20is\x20currently\x20supported\x20on\x20dev-us01\x20and\x20dev-eu01\x20only.\x20','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','getUserInfo','\x27\x20registered','900660RjcQqr','/oauth/authorize','12WloNYz','site','\x20\x20tdx','description','1238oDhCDG','bold','2058592yDFGNI','create','OAuth\x20login\x20is\x20not\x20yet\x20available\x20for\x20site:\x20','\x20(profile:\x20','✓\x20Profile\x20\x27','green','563416DZljVn','80SvvrNY','1770444GwLGpE','access_token','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','log','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','profile'];a8_0x52af=function(){return _0x5ef67d;};return a8_0x52af();}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';function a8_0x1ae2(_0x15de5f,_0x461ca7){_0x15de5f=_0x15de5f-0x1aa;const _0x52afd5=a8_0x52af();let _0x1ae226=_0x52afd5[_0x15de5f];return _0x1ae226;}import{promptSiteSelection}from'../core/constants.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a8_0x5593d0 from'chalk';export async function runOAuthLoginFlow(_0x3cb723,_0x175349,_0x98fadb){const _0x1147d2=a8_0x1ae2;if(!isOAuthSupported(_0x3cb723))throw new Error(_0x1147d2(0x1d0)+_0x3cb723+'.\x20'+_0x1147d2(0x1c2)+_0x1147d2(0x1bb));const _0x3532b1=await isKeychainAvailable();if(!_0x3532b1)throw new Error(_0x1147d2(0x1c0)+_0x1147d2(0x1bb));const _0x40f3a=getConsoleUrl(_0x3cb723);console[_0x1147d2(0x1ae)](_0x1147d2(0x1b5)),console['log']('\x20\x20'+_0x40f3a+_0x1147d2(0x1c7)),console[_0x1147d2(0x1ae)]('Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...');const _0x9e2179=await startOAuthFlow(_0x3cb723);console[_0x1147d2(0x1ae)]('Validating\x20OAuth\x20tokens...');const _0x225318=TDX[_0x1147d2(0x1cf)]({'site':_0x3cb723,'accessToken':_0x9e2179[_0x1147d2(0x1ac)],'logLevel':_0x98fadb??LogLevel['ERROR']}),_0x1ec277=await _0x225318[_0x1147d2(0x1ba)][_0x1147d2(0x1c4)]();console[_0x1147d2(0x1ae)](a8_0x5593d0[_0x1147d2(0x1d3)](_0x1147d2(0x1b1)+_0x1ec277['email']+')')),await saveOAuthTokens(_0x9e2179,_0x175349),console[_0x1147d2(0x1ae)](_0x1147d2(0x1bf)+(_0x175349?_0x1147d2(0x1d1)+_0x175349+')':''));if(_0x175349){const _0x3cec83={'site':_0x3cb723};saveProfileToUserConfig(_0x175349,_0x3cec83),console[_0x1147d2(0x1ae)](_0x1147d2(0x1d2)+_0x175349+_0x1147d2(0x1c5));}const _0x5bf280=_0x175349?_0x1147d2(0x1bd)+_0x175349:'';console[_0x1147d2(0x1ae)](),console[_0x1147d2(0x1ae)](_0x1147d2(0x1c3)),console[_0x1147d2(0x1ae)]('\x20\x20tdx'+_0x5bf280+_0x1147d2(0x1ad)),console[_0x1147d2(0x1ae)](_0x1147d2(0x1ca)+_0x5bf280+_0x1147d2(0x1af));}export class AuthLoginCommand extends BaseCommand{['name']=a8_0x59135d(0x1b4);[a8_0x59135d(0x1cb)]=a8_0x59135d(0x1c1);async[a8_0x59135d(0x1b9)](_0x292327){const _0x266996=a8_0x59135d,{options:_0x165a70}=_0x292327,_0x45ad97=_0x165a70[_0x266996(0x1b0)];console[_0x266996(0x1ae)](a8_0x5593d0[_0x266996(0x1cd)](_0x266996(0x1b8)));const _0x572016=_0x165a70[_0x266996(0x1c9)]||_0x266996(0x1bc),_0x1eba29=await promptSiteSelection(_0x572016,_0x45ad97,'Login\x20cancelled');if(!_0x1eba29)return 0x1;const _0x588818=resolveSite(_0x1eba29);return console[_0x266996(0x1ae)](_0x266996(0x1b7)+_0x588818),await runOAuthLoginFlow(_0x588818,_0x45ad97,_0x165a70['logLevel']??LogLevel['ERROR']),0x0;}}
|