@treasuredata/tdx 2026.7.4 → 2026.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.d.ts.map +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-command.js.map +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-move-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/table-deleted.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/tools/work-create-item.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-schema.d.ts +15 -3
- package/dist/sdk/cas/cas-audience-schema.d.ts.map +1 -1
- package/dist/sdk/cas/cas-audience-schema.js +1 -1
- package/dist/sdk/cas/cas-audience-schema.js.map +1 -1
- package/dist/sdk/cas/cas-audience-validator.js +1 -1
- package/dist/sdk/cas/cas-audience-validator.js.map +1 -1
- package/dist/sdk/cas/cas-audience-yaml.d.ts +8 -0
- package/dist/sdk/cas/cas-audience-yaml.d.ts.map +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js.map +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.d.ts +47 -1
- package/dist/sdk/cas/push-workflow.d.ts.map +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js.map +1 -1
- package/dist/sdk/cas/validate-files.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.d.ts +6 -6
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/engage-api-client.js.map +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/llm/user-settings.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/deleted-table-validation.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/cas.d.ts +5 -0
- package/dist/sdk/types/cas.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/util/tree-search.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/task-graph.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/claude-code-state.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/proxy-fetch.js +1 -1
- package/dist/utils/proxy-fetch.js.map +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a3_0x379236=a3_0x5c95;(function(_0x5c986f,_0x291550){const _0x59da71=a3_0x5c95,_0x2f28e7=_0x5c986f();while(!![]){try{const _0x1a5e26=parseInt(_0x59da71(0x1f3))/0x1+parseInt(_0x59da71(0x1eb))/0x2*(parseInt(_0x59da71(0x1fc))/0x3)+-parseInt(_0x59da71(0x1f8))/0x4*(parseInt(_0x59da71(0x1f5))/0x5)+parseInt(_0x59da71(0x1f9))/0x6+-parseInt(_0x59da71(0x1ee))/0x7+parseInt(_0x59da71(0x1fa))/0x8+-parseInt(_0x59da71(0x1f1))/0x9*(-parseInt(_0x59da71(0x1e9))/0xa);if(_0x1a5e26===_0x291550)break;else _0x2f28e7['push'](_0x2f28e7['shift']());}catch(_0x1ec82d){_0x2f28e7['push'](_0x2f28e7['shift']());}}}(a3_0x6055,0x435ab));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a3_0x5c95(_0x466356,_0x142365){_0x466356=_0x466356-0x1e5;const _0x60557b=a3_0x6055();let _0x5c9591=_0x60557b[_0x466356];return _0x5c9591;}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';function a3_0x6055(){const _0x3bb532=['Resolved\x20parent\x20ID:\x20','cause','description','\x27...','Resolving\x20parent\x20segment\x20\x27','message','listActivations','Parent\x20name:\x20','20WrgLHJ','Listing\x20activations\x20for\x20segment\x20\x27','620rKGmDw','execute','verbose','3610005sYeomv','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','Child\x20name:\x20','587079cysZlq','Resolving\x20child\x20segment\x20\x27','217220vRaFCW','name','15sbEose','length','resolveSegmentId','334132shKwqX','930942sNtWui','2439984zsFywM','Error:\x20','2268kIksEb','data','segment','resolveParentId','error','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','\x20\x20Cause:\x20','Resolved\x20child\x20ID:\x20','List\x20activations\x20for\x20a\x20segment'];a3_0x6055=function(){return _0x3bb532;};return a3_0x6055();}export class ActivationsCommand extends BaseCommand{[a3_0x379236(0x1f4)]='activations';[a3_0x379236(0x207)]=a3_0x379236(0x204);async[a3_0x379236(0x1ec)](_0x2cb99c){const _0x1500b2=a3_0x379236,{options:_0x20047e,args:_0x2ec8cb,tdx:_0x37276b}=_0x2cb99c;if(_0x2ec8cb[_0x1500b2(0x1f6)]===0x0)return console['error']('Error:\x20Segment\x20name\x20is\x20required'),console[_0x1500b2(0x200)](_0x1500b2(0x201)),0x1;try{const {parentId:_0x21ea84,childId:_0x81859}=parseSegmentRef(_0x2ec8cb[0x0]);if(!_0x81859)return console[_0x1500b2(0x200)](_0x1500b2(0x1ef)),console['error'](_0x1500b2(0x201)),0x1;_0x20047e[_0x1500b2(0x1ed)]&&(console[_0x1500b2(0x200)]('Site:\x20'+_0x20047e['site']),console[_0x1500b2(0x200)](_0x1500b2(0x1e8)+_0x21ea84),console['error'](_0x1500b2(0x1f0)+_0x81859));const _0x4a1a0c=await withSpinner(_0x1500b2(0x1e5)+_0x21ea84+_0x1500b2(0x208),()=>_0x37276b[_0x1500b2(0x1fe)][_0x1500b2(0x1ff)](_0x21ea84),{'verbose':_0x20047e[_0x1500b2(0x1ed)]}),_0x596e4=_0x4a1a0c[_0x1500b2(0x1fd)];_0x20047e['verbose']&&console[_0x1500b2(0x200)](_0x1500b2(0x205)+_0x596e4);const _0x300399=await withSpinner(_0x1500b2(0x1f2)+_0x81859+_0x1500b2(0x208),()=>_0x37276b[_0x1500b2(0x1fe)][_0x1500b2(0x1f7)](_0x596e4,_0x81859),{'verbose':_0x20047e[_0x1500b2(0x1ed)]}),_0x17e08d=_0x300399[_0x1500b2(0x1fd)];_0x20047e[_0x1500b2(0x1ed)]&&console[_0x1500b2(0x200)](_0x1500b2(0x203)+_0x17e08d);const _0x22c4cf=await withSpinner(_0x1500b2(0x1ea)+_0x81859+'\x27...',()=>_0x37276b[_0x1500b2(0x1fe)][_0x1500b2(0x1e7)](_0x596e4,_0x17e08d),{'verbose':_0x20047e['verbose']}),_0x5948ba=_0x22c4cf[_0x1500b2(0x1fd)];return console[_0x1500b2(0x200)]('✔\x20Found\x20'+_0x5948ba[_0x1500b2(0x1f6)]+'\x20activation'+(_0x5948ba[_0x1500b2(0x1f6)]!==0x1?'s':'')),await handleSDKOutput(_0x5948ba,_0x20047e),0x0;}catch(_0x2944ed){if(_0x2944ed instanceof SDKError)return console[_0x1500b2(0x200)](_0x1500b2(0x1fb)+_0x2944ed[_0x1500b2(0x1e6)]),_0x2944ed[_0x1500b2(0x206)]&&console[_0x1500b2(0x200)](_0x1500b2(0x202)+_0x2944ed[_0x1500b2(0x206)]),0x1;throw _0x2944ed;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x3cfd04=a4_0x3657;(function(_0x34df8e,_0x5859e6){const _0x4fc64c=a4_0x3657,_0x163f1e=_0x34df8e();while(!![]){try{const _0x8f4670=parseInt(_0x4fc64c(0xd8))/0x1+-parseInt(_0x4fc64c(0x12d))/0x2*(-parseInt(_0x4fc64c(0x16e))/0x3)+-parseInt(_0x4fc64c(0x148))/0x4+parseInt(_0x4fc64c(0x113))/0x5+-parseInt(_0x4fc64c(0x13f))/0x6+parseInt(_0x4fc64c(0x182))/0x7*(parseInt(_0x4fc64c(0x11e))/0x8)+-parseInt(_0x4fc64c(0x164))/0x9*(parseInt(_0x4fc64c(0xe9))/0xa);if(_0x8f4670===_0x5859e6)break;else _0x163f1e['push'](_0x163f1e['shift']());}catch(_0x5e8868){_0x163f1e['push'](_0x163f1e['shift']());}}}(a4_0x80b4,0x3a116));import a4_0x399678 from'chalk';import a4_0x230193 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';function a4_0x3657(_0x381888,_0x1afd7b){_0x381888=_0x381888-0xd0;const _0x80b48=a4_0x80b4();let _0x365781=_0x80b48[_0x381888];return _0x365781;}import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x116ea7){const _0x33970b=a4_0x3657,_0x49604b=[];if(_0x116ea7[_0x33970b(0x157)]!==undefined)_0x49604b['push'](_0x116ea7[_0x33970b(0x157)]+_0x33970b(0x13c));if(_0x116ea7[_0x33970b(0x18b)]!==undefined&&_0x116ea7[_0x33970b(0x18b)]>0x0)_0x49604b['push'](a4_0x399678[_0x33970b(0x17c)](_0x116ea7[_0x33970b(0x18b)]+_0x33970b(0x138)));if(_0x116ea7['created']!==undefined&&_0x116ea7[_0x33970b(0x165)]>0x0)_0x49604b[_0x33970b(0xfa)](a4_0x399678['green'](_0x116ea7[_0x33970b(0x165)]+'\x20created'));if(_0x116ea7['updated']!==undefined&&_0x116ea7['updated']>0x0)_0x49604b[_0x33970b(0xfa)](a4_0x399678[_0x33970b(0x14a)](_0x116ea7[_0x33970b(0x161)]+_0x33970b(0xfb)));if(_0x116ea7[_0x33970b(0x17d)]!==undefined&&_0x116ea7[_0x33970b(0x17d)]>0x0)_0x49604b[_0x33970b(0xfa)](a4_0x399678['gray'](_0x116ea7[_0x33970b(0x17d)]+'\x20unchanged'));if(_0x116ea7['errors']!==undefined&&_0x116ea7[_0x33970b(0x180)]>0x0)_0x49604b[_0x33970b(0xfa)](a4_0x399678[_0x33970b(0xe7)](_0x116ea7['errors']+'\x20errors'));return _0x49604b[_0x33970b(0x171)](',\x20');}function displayDiffs(_0x52f769,_0x56c045,_0x25ddbc,_0x49457c,_0x123111,_0x52e1aa,_0x53a010,_0x298dfe,_0xb5d7b3){const _0xe87be8=a4_0x3657;for(const _0xddad5a of _0x52f769){if(_0xddad5a[_0xe87be8(0x184)]){const _0x53a058=_0xddad5a[_0xe87be8(0x10c)]||_0xddad5a[_0xe87be8(0x175)];console['log']('\x0aChanges\x20to\x20agent\x20\x27'+_0x53a058+'\x27:'),console[_0xe87be8(0x10b)]('─'[_0xe87be8(0x173)](0x3c)),console['log'](_0xddad5a[_0xe87be8(0x184)]),console[_0xe87be8(0x10b)]('─'[_0xe87be8(0x173)](0x3c));}}for(const _0x3efd4c of _0x56c045){_0x3efd4c['diff']&&(console['log'](_0xe87be8(0xdc)+_0x3efd4c[_0xe87be8(0x175)]+'\x27:'),console[_0xe87be8(0x10b)]('─'['repeat'](0x3c)),console[_0xe87be8(0x10b)](_0x3efd4c[_0xe87be8(0x184)]),console[_0xe87be8(0x10b)]('─'[_0xe87be8(0x173)](0x3c)));}for(const _0x309fe8 of _0x25ddbc){_0x309fe8[_0xe87be8(0x184)]&&(console[_0xe87be8(0x10b)](_0xe87be8(0xe5)+_0x309fe8[_0xe87be8(0x175)]+'\x27:'),console[_0xe87be8(0x10b)]('─'[_0xe87be8(0x173)](0x3c)),console[_0xe87be8(0x10b)](_0x309fe8['diff']),console[_0xe87be8(0x10b)]('─'['repeat'](0x3c)));}for(const _0x5ba5c2 of _0x49457c){_0x5ba5c2[_0xe87be8(0x184)]&&(console[_0xe87be8(0x10b)](_0xe87be8(0x176)+_0x5ba5c2['name']+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0xe87be8(0x10b)](_0x5ba5c2[_0xe87be8(0x184)]),console[_0xe87be8(0x10b)]('─'['repeat'](0x3c)));}for(const _0x53d68d of _0x123111){_0x53d68d[_0xe87be8(0x184)]&&(console[_0xe87be8(0x10b)](_0xe87be8(0xf6)+_0x53d68d['name']+'\x27:'),console['log']('─'[_0xe87be8(0x173)](0x3c)),console['log'](_0x53d68d[_0xe87be8(0x184)]),console[_0xe87be8(0x10b)]('─'[_0xe87be8(0x173)](0x3c)));}for(const _0xca6c2f of _0x52e1aa){_0xca6c2f[_0xe87be8(0x184)]&&(console['log'](_0xe87be8(0x10e)+_0xca6c2f[_0xe87be8(0x175)]+'\x27:'),console[_0xe87be8(0x10b)]('─'[_0xe87be8(0x173)](0x3c)),console[_0xe87be8(0x10b)](_0xca6c2f[_0xe87be8(0x184)]),console[_0xe87be8(0x10b)]('─'['repeat'](0x3c)));}for(const _0x44f436 of _0x53a010){_0x44f436[_0xe87be8(0x184)]&&(console['log'](_0xe87be8(0x162)+_0x44f436['name']+'\x27:'),console['log']('─'[_0xe87be8(0x173)](0x3c)),console[_0xe87be8(0x10b)](_0x44f436[_0xe87be8(0x184)]),console[_0xe87be8(0x10b)]('─'['repeat'](0x3c)));}for(const _0x20063f of _0x298dfe){_0x20063f['diff']&&(console[_0xe87be8(0x10b)](_0xe87be8(0x139)+_0x20063f[_0xe87be8(0x175)]+'\x27:'),console[_0xe87be8(0x10b)]('─'[_0xe87be8(0x173)](0x3c)),console[_0xe87be8(0x10b)](_0x20063f[_0xe87be8(0x184)]),console[_0xe87be8(0x10b)]('─'[_0xe87be8(0x173)](0x3c)));}for(const _0xf8f82b of _0xb5d7b3){_0xf8f82b[_0xe87be8(0x184)]&&(console[_0xe87be8(0x10b)]('\x0aChanges\x20to\x20chat\x20interface\x20\x27'+_0xf8f82b[_0xe87be8(0x175)]+'\x27:'),console[_0xe87be8(0x10b)]('─'['repeat'](0x3c)),console[_0xe87be8(0x10b)](_0xf8f82b[_0xe87be8(0x184)]),console[_0xe87be8(0x10b)]('─'['repeat'](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x3cfd04(0x175)]=a4_0x3cfd04(0x109);['description']='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x3cfd04(0x16f)](_0x4cc588){const _0xfd2304=a4_0x3cfd04,{options:_0x4681b0,args:_0x49d6a8,tdx:_0x1e667f}=_0x4cc588,_0x31dde1=_0x49d6a8[0x0],_0x43f8db=_0x49d6a8[0x1],_0x4648d7=_0x4681b0[_0xfd2304(0x104)],_0x1c9d55=_0x4681b0[_0xfd2304(0x17b)],_0x546ed6=_0x4681b0[_0xfd2304(0x15c)],_0x5d7cdb=_0x4681b0[_0xfd2304(0x17e)],_0x15fd5b=_0x4681b0[_0xfd2304(0x101)],_0x5d1429=_0x4681b0[_0xfd2304(0x140)];let _0x1449c4;if(_0x31dde1){const _0x4ccd1a=a4_0x230193[_0xfd2304(0x171)](_0x31dde1,_0xfd2304(0xf9));if(existsSync(_0x4ccd1a))try{const _0x22299a=JSON[_0xfd2304(0x111)](readFileSync(_0x4ccd1a,_0xfd2304(0x14d)));_0x22299a[_0xfd2304(0x158)]&&(_0x1449c4={'llm_project':_0x22299a[_0xfd2304(0x158)]});}catch{}}const _0x1d728a=findAgentConfigPath(process[_0xfd2304(0x150)]());let _0x2b4128;if(_0x1d728a)try{const _0x2920a0=JSON[_0xfd2304(0x111)](readFileSync(_0x1d728a,'utf-8'));_0x2920a0[_0xfd2304(0x158)]&&(_0x2b4128={'llm_project':_0x2920a0[_0xfd2304(0x158)]});}catch{}const _0x34b383=resolveAgentPullArgs({'arg':_0x31dde1,'agentNameArg':_0x43f8db,'agentFlag':_0x5d1429,'contextProject':_0x15fd5b,'argDirConfig':_0x1449c4,'cwdConfigPath':_0x1d728a||undefined,'cwdConfig':_0x2b4128}),{projectNameOrId:_0x3256d8,targetAgentName:_0x34cb9b,existingOutputDir:_0x485c1b,source:_0x1f19f5}=_0x34b383;if(_0x1f19f5===_0xfd2304(0x144))console['log'](a4_0x399678['dim'](_0xfd2304(0x114)+a4_0x230193[_0xfd2304(0x171)](_0x31dde1,_0xfd2304(0xf9))+':\x20'+_0x3256d8));else{if(_0x1f19f5===_0xfd2304(0x16a))console[_0xfd2304(0x10b)](a4_0x399678[_0xfd2304(0x156)](_0xfd2304(0x13e)+_0x3256d8));else _0x1f19f5==='context'&&console[_0xfd2304(0x10b)](a4_0x399678[_0xfd2304(0x156)](_0xfd2304(0x149)+_0x3256d8));}if(!_0x3256d8)return _0x5d1429?(console[_0xfd2304(0x10b)](a4_0x399678[_0xfd2304(0x14a)](_0xfd2304(0xd0))),console[_0xfd2304(0x10b)](_0xfd2304(0xdf)),console[_0xfd2304(0x10b)](_0xfd2304(0xee))):(console[_0xfd2304(0x10b)](a4_0x399678[_0xfd2304(0x14a)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0xfd2304(0x10b)](_0xfd2304(0x125)),console[_0xfd2304(0x10b)]('\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[_0xfd2304(0x10b)]('\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['log'](_0xfd2304(0x160)),console[_0xfd2304(0x10b)]('\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(_0x34cb9b){const {data:_0x2dccb2}=await withSpinner('Pulling\x20agent\x20\x22'+_0x34cb9b+_0xfd2304(0x103)+_0x3256d8+_0xfd2304(0xdb),()=>_0x1e667f[_0xfd2304(0xe6)][_0xfd2304(0xfd)](_0x3256d8,_0x34cb9b,_0x4648d7,{'dryRun':_0x1c9d55,'force':_0x546ed6}));if(_0x1c9d55)return console['log'](a4_0x399678[_0xfd2304(0x14a)](_0xfd2304(0x11d))),console[_0xfd2304(0x10b)](_0xfd2304(0x129)+_0x2dccb2['agentName']),console['log']('Output\x20path:\x20'+_0x2dccb2[_0xfd2304(0x14c)]),_0x2dccb2['diff']&&(console[_0xfd2304(0x10b)](_0xfd2304(0x177)),console['log']('─'[_0xfd2304(0x173)](0x3c)),console['log'](_0x2dccb2[_0xfd2304(0x184)]),console['log']('─'[_0xfd2304(0x173)](0x3c))),0x0;return console[_0xfd2304(0x10b)](a4_0x399678[_0xfd2304(0x17c)]('Agent\x20pulled\x20successfully')),console['log'](_0xfd2304(0x133)+_0x2dccb2['agentName']),console['log'](_0xfd2304(0x154)+_0x2dccb2[_0xfd2304(0x14c)]),console[_0xfd2304(0x10b)]('Status:\x20'+(_0x2dccb2[_0xfd2304(0xe2)]?a4_0x399678[_0xfd2304(0x17c)](_0xfd2304(0x18b)):_0x2dccb2[_0xfd2304(0x141)]?a4_0x399678[_0xfd2304(0x14a)]('updated'):a4_0x399678[_0xfd2304(0x167)](_0xfd2304(0x17d)))),0x0;}const _0x41d53f=_0x485c1b||_0x4648d7,{data:_0x3d6454}=await withSpinner('Analyzing\x20project\x20\x22'+_0x3256d8+'\x22...',()=>_0x1e667f[_0xfd2304(0xe6)]['pullProject'](_0x3256d8,_0x41d53f,{'dryRun':!![]})),_0x24902c=_0x3d6454[_0xfd2304(0x108)]['agents']['new']+_0x3d6454[_0xfd2304(0x108)][_0xfd2304(0xe1)]['new']+_0x3d6454['counts']['textKnowledgeBases'][_0xfd2304(0x18b)]+_0x3d6454[_0xfd2304(0x108)][_0xfd2304(0xe0)][_0xfd2304(0x18b)]+_0x3d6454[_0xfd2304(0x108)][_0xfd2304(0xf5)][_0xfd2304(0x18b)]+_0x3d6454[_0xfd2304(0x108)][_0xfd2304(0x142)][_0xfd2304(0x18b)]+_0x3d6454[_0xfd2304(0x108)][_0xfd2304(0x159)][_0xfd2304(0x18b)]+_0x3d6454[_0xfd2304(0x108)][_0xfd2304(0x151)][_0xfd2304(0x18b)]+_0x3d6454[_0xfd2304(0x108)][_0xfd2304(0x152)][_0xfd2304(0x18b)],_0x37517c=_0x3d6454[_0xfd2304(0x108)][_0xfd2304(0x130)][_0xfd2304(0x161)]+_0x3d6454[_0xfd2304(0x108)][_0xfd2304(0xe1)][_0xfd2304(0x161)]+_0x3d6454[_0xfd2304(0x108)][_0xfd2304(0xf7)][_0xfd2304(0x161)]+_0x3d6454[_0xfd2304(0x108)]['prompts'][_0xfd2304(0x161)]+_0x3d6454[_0xfd2304(0x108)][_0xfd2304(0xf5)][_0xfd2304(0x161)]+_0x3d6454[_0xfd2304(0x108)]['experimentalKnowledgeBases'][_0xfd2304(0x161)]+_0x3d6454[_0xfd2304(0x108)][_0xfd2304(0x159)][_0xfd2304(0x161)]+_0x3d6454[_0xfd2304(0x108)][_0xfd2304(0x151)][_0xfd2304(0x161)]+_0x3d6454[_0xfd2304(0x108)][_0xfd2304(0x152)][_0xfd2304(0x161)],_0x4672e8=_0x3d6454[_0xfd2304(0x108)]['agents'][_0xfd2304(0x17d)]+_0x3d6454[_0xfd2304(0x108)]['knowledgeBases'][_0xfd2304(0x17d)]+_0x3d6454[_0xfd2304(0x108)]['textKnowledgeBases'][_0xfd2304(0x17d)]+_0x3d6454[_0xfd2304(0x108)][_0xfd2304(0xe0)][_0xfd2304(0x17d)]+_0x3d6454[_0xfd2304(0x108)]['integrations']['unchanged']+_0x3d6454[_0xfd2304(0x108)][_0xfd2304(0x142)][_0xfd2304(0x17d)]+_0x3d6454[_0xfd2304(0x108)][_0xfd2304(0x159)][_0xfd2304(0x17d)]+_0x3d6454[_0xfd2304(0x108)]['formInterfaces']['unchanged']+_0x3d6454['counts'][_0xfd2304(0x152)][_0xfd2304(0x17d)];console['log']('\x0aPull\x20summary\x20for\x20\x27'+_0x3d6454[_0xfd2304(0x100)]+'\x27:'),console['log']('\x20\x20'+a4_0x399678['green']('+\x20'+_0x24902c+_0xfd2304(0x138))+_0xfd2304(0x11f)+a4_0x399678['yellow']('~\x20'+_0x37517c+'\x20changed')+'\x20|\x20'+a4_0x399678['dim']('=\x20'+_0x4672e8+_0xfd2304(0xda))),console['log'](_0xfd2304(0x17a)+formatCountSummary(_0x3d6454[_0xfd2304(0x108)][_0xfd2304(0x130)])),console[_0xfd2304(0x10b)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x3d6454[_0xfd2304(0x108)][_0xfd2304(0xe1)])),console['log'](_0xfd2304(0x143)+formatCountSummary(_0x3d6454[_0xfd2304(0x108)]['textKnowledgeBases'])),console[_0xfd2304(0x10b)](_0xfd2304(0x186)+formatCountSummary(_0x3d6454[_0xfd2304(0x108)][_0xfd2304(0xe0)])),console[_0xfd2304(0x10b)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x3d6454[_0xfd2304(0x108)][_0xfd2304(0xf5)])),console['log'](_0xfd2304(0xf2)+formatCountSummary(_0x3d6454[_0xfd2304(0x108)][_0xfd2304(0x151)])),console['log'](_0xfd2304(0xeb)+formatCountSummary(_0x3d6454['counts'][_0xfd2304(0x152)]));const _0x136099=_0x3d6454['counts'][_0xfd2304(0x142)][_0xfd2304(0x157)]>0x0||_0x3d6454[_0xfd2304(0x108)][_0xfd2304(0x159)][_0xfd2304(0x157)]>0x0;_0x136099&&(console[_0xfd2304(0x10b)](_0xfd2304(0xf0)+formatCountSummary(_0x3d6454['counts']['experimentalKnowledgeBases'])),console[_0xfd2304(0x10b)](_0xfd2304(0x119)+formatCountSummary(_0x3d6454[_0xfd2304(0x108)]['experimentalArtifacts'])));console[_0xfd2304(0x10b)]('\x20\x20Target:\x20'+a4_0x399678[_0xfd2304(0x118)](_0x3d6454[_0xfd2304(0xf8)])),displayDiffs(_0x3d6454[_0xfd2304(0x130)],_0x3d6454[_0xfd2304(0xe1)],_0x3d6454[_0xfd2304(0xf7)],_0x3d6454[_0xfd2304(0xe0)],_0x3d6454[_0xfd2304(0xf5)],_0x3d6454[_0xfd2304(0x142)],_0x3d6454[_0xfd2304(0x159)],_0x3d6454[_0xfd2304(0x151)],_0x3d6454[_0xfd2304(0x152)]);if(_0x1c9d55)return console[_0xfd2304(0x10b)](a4_0x399678[_0xfd2304(0x14a)](_0xfd2304(0xd4))),0x0;if(_0x24902c===0x0&&_0x37517c===0x0)return console[_0xfd2304(0x10b)](a4_0x399678['green'](_0xfd2304(0x185))),saveSessionContext({'llm_project':_0x3d6454[_0xfd2304(0x100)]},_0x4681b0['session']),console['log'](a4_0x399678[_0xfd2304(0x17c)](_0xfd2304(0x16d)+a4_0x399678['dim'](_0xfd2304(0x158))+_0xfd2304(0x179)+a4_0x399678[_0xfd2304(0x118)](_0x3d6454[_0xfd2304(0x100)]))),0x0;if(!_0x5d7cdb&&!_0x546ed6){if(!isInteractive())return console[_0xfd2304(0x183)](a4_0x399678[_0xfd2304(0xe7)]('\x0aError:'),_0xfd2304(0xe4)),console[_0xfd2304(0x183)](a4_0x399678[_0xfd2304(0x156)](_0xfd2304(0x12f))),0x1;const _0x221e5=await confirmKey('\x0aWrite\x20'+(_0x24902c+_0x37517c)+'\x20files?');if(!_0x221e5)return console[_0xfd2304(0x10b)](a4_0x399678['yellow'](_0xfd2304(0xdd)),'-\x20no\x20files\x20written'),0x1;}const {data:_0x2bac69}=await withSpinner(_0xfd2304(0xef),()=>_0x1e667f['llm']['pullProject'](_0x3256d8,_0x41d53f,{'force':_0x546ed6}));return console[_0xfd2304(0x10b)](a4_0x399678[_0xfd2304(0x17c)](_0xfd2304(0xd3)+(_0x24902c+_0x37517c)+_0xfd2304(0xea)+_0x2bac69[_0xfd2304(0xf8)])),saveSessionContext({'llm_project':_0x2bac69['projectName']},_0x4681b0[_0xfd2304(0x10a)]),console['log'](a4_0x399678['green'](_0xfd2304(0x16d)+a4_0x399678['dim']('llm_project')+'\x20=\x20'+a4_0x399678[_0xfd2304(0x118)](_0x2bac69[_0xfd2304(0x100)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x3cfd04(0x175)]='agent:clone';[a4_0x3cfd04(0x18c)]=a4_0x3cfd04(0x181);async[a4_0x3cfd04(0x16f)](_0x4fb4e2){const _0x2fc20d=a4_0x3cfd04,{options:_0x3f8137,args:_0x538a2f,tdx:_0x5086d6}=_0x4fb4e2,_0x43d0a8=_0x538a2f[0x0],_0x30d3a2=_0x3f8137[_0x2fc20d(0x175)],_0x31fc15=_0x3f8137[_0x2fc20d(0x17b)],_0x480349=_0x3f8137[_0x2fc20d(0x17e)],_0x41bbba=_0x3f8137[_0x2fc20d(0x123)],_0x5b2691=_0x3f8137[_0x2fc20d(0x101)];let _0xc60680;const _0x1e2a01=findAgentConfigPath(process['cwd']());if(_0x43d0a8){const _0xd7226e=a4_0x230193[_0x2fc20d(0x171)](_0x43d0a8,'tdx.json');existsSync(_0xd7226e)?(_0xc60680=_0x43d0a8,console[_0x2fc20d(0x10b)](a4_0x399678[_0x2fc20d(0x156)](_0x2fc20d(0x16c)+_0x43d0a8))):_0xc60680=_0x43d0a8;}else{if(_0x1e2a01)_0xc60680=a4_0x230193[_0x2fc20d(0x189)](_0x1e2a01),console[_0x2fc20d(0x10b)](a4_0x399678[_0x2fc20d(0x156)](_0x2fc20d(0x102)+_0xc60680));else{if(_0x5b2691){const _0x40e196=sanitizeForFilesystem(_0x5b2691);let _0x4488fb=_0x40e196,_0x2988e3=a4_0x230193[_0x2fc20d(0x171)](process['cwd'](),_0x2fc20d(0x130),_0x40e196,_0x2fc20d(0xf9));if(!existsSync(_0x2988e3)){const _0x4647a2=normalizeName(_0x5b2691),_0x4b6c6c=a4_0x230193[_0x2fc20d(0x171)](process[_0x2fc20d(0x150)](),_0x2fc20d(0x130),_0x4647a2,_0x2fc20d(0xf9));existsSync(_0x4b6c6c)&&(_0x4488fb=_0x4647a2,_0x2988e3=_0x4b6c6c);}if(existsSync(_0x2988e3))_0xc60680=a4_0x230193[_0x2fc20d(0x189)](_0x2988e3),console[_0x2fc20d(0x10b)](a4_0x399678['dim'](_0x2fc20d(0x16c)+_0xc60680));else{const _0x4b29d2=_0x3f8137['profile'];if(_0x4b29d2)throw new SDKError(ErrorCode[_0x2fc20d(0x169)],_0x2fc20d(0xe8)+_0x5b2691+_0x2fc20d(0x124),undefined,{'helpText':_0x2fc20d(0x135)+_0x2fc20d(0x131)+(_0x2fc20d(0xe3)+_0x5b2691+'\x0a')+(_0x2fc20d(0x172)+_0x4488fb+_0x2fc20d(0x166)+(_0x30d3a2||_0x2fc20d(0xed))+_0x2fc20d(0x146)+_0x4b29d2)});_0xc60680=_0x5b2691,console[_0x2fc20d(0x10b)](a4_0x399678[_0x2fc20d(0x156)](_0x2fc20d(0xd5)+_0x5b2691));}}}}if(!_0xc60680)return console['log'](a4_0x399678[_0x2fc20d(0x14a)](_0x2fc20d(0x10d))),console[_0x2fc20d(0x10b)]('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console[_0x2fc20d(0x10b)](_0x2fc20d(0xfe)),console[_0x2fc20d(0x10b)]('\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)'),console['log'](_0x2fc20d(0x16b)),0x1;if(!_0x30d3a2)throw new SDKError(ErrorCode[_0x2fc20d(0x188)],'New\x20project\x20name\x20is\x20required',undefined,{'helpText':_0x2fc20d(0x147)});if(!_0x480349&&!_0x31fc15){if(!isInteractive())return console[_0x2fc20d(0x183)](a4_0x399678[_0x2fc20d(0xe7)](_0x2fc20d(0x10f)),_0x2fc20d(0xe4)),console['error'](a4_0x399678[_0x2fc20d(0x156)](_0x2fc20d(0x12f))),0x1;const _0x3ccbbc=await confirmKey(_0x2fc20d(0xd7)+_0xc60680+_0x2fc20d(0xd1)+_0x30d3a2+'\x22?');if(!_0x3ccbbc)return console[_0x2fc20d(0x10b)](a4_0x399678['yellow'](_0x2fc20d(0xdd))),0x1;}const {data:_0xb5a3d0}=await withSpinner('Cloning\x20\x22'+_0xc60680+_0x2fc20d(0x15b)+_0x30d3a2+'\x22...',()=>_0x5086d6['llm'][_0x2fc20d(0x115)](_0xc60680,_0x30d3a2,{'dryRun':_0x31fc15}));if(_0x31fc15){console[_0x2fc20d(0x10b)](a4_0x399678[_0x2fc20d(0x14a)](_0x2fc20d(0x122))),console[_0x2fc20d(0x10b)](_0x2fc20d(0x17f)+_0xb5a3d0[_0x2fc20d(0x12b)]),console[_0x2fc20d(0x10b)](_0x2fc20d(0xfc)+_0x30d3a2),console[_0x2fc20d(0x10b)](_0x2fc20d(0xde)),console[_0x2fc20d(0x10b)](_0x2fc20d(0x17a)+_0xb5a3d0[_0x2fc20d(0x108)][_0x2fc20d(0x130)][_0x2fc20d(0x165)]),console[_0x2fc20d(0x10b)](_0x2fc20d(0x105)+_0xb5a3d0[_0x2fc20d(0x108)][_0x2fc20d(0xe1)][_0x2fc20d(0x165)]),console[_0x2fc20d(0x10b)](_0x2fc20d(0x186)+_0xb5a3d0['counts']['prompts'][_0x2fc20d(0x165)]),console[_0x2fc20d(0x10b)]('\x20\x20Form\x20Interfaces:\x20'+_0xb5a3d0[_0x2fc20d(0x108)][_0x2fc20d(0x151)][_0x2fc20d(0x165)]),console[_0x2fc20d(0x10b)](_0x2fc20d(0xeb)+_0xb5a3d0[_0x2fc20d(0x108)][_0x2fc20d(0x152)]['created']);const _0x13bfd4=_0xb5a3d0[_0x2fc20d(0x108)][_0x2fc20d(0x142)][_0x2fc20d(0x165)]>0x0||_0xb5a3d0[_0x2fc20d(0x108)]['experimentalArtifacts'][_0x2fc20d(0x165)]>0x0;return _0x13bfd4&&(console[_0x2fc20d(0x10b)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+_0xb5a3d0[_0x2fc20d(0x108)][_0x2fc20d(0x142)][_0x2fc20d(0x165)]),console[_0x2fc20d(0x10b)](_0x2fc20d(0x119)+_0xb5a3d0[_0x2fc20d(0x108)]['experimentalArtifacts']['created'])),0x0;}const _0x5af332=_0xb5a3d0[_0x2fc20d(0x108)][_0x2fc20d(0x130)][_0x2fc20d(0x180)]>0x0||_0xb5a3d0[_0x2fc20d(0x108)][_0x2fc20d(0xe1)]['errors']>0x0||_0xb5a3d0[_0x2fc20d(0x108)][_0x2fc20d(0xe0)][_0x2fc20d(0x180)]>0x0||_0xb5a3d0[_0x2fc20d(0x108)][_0x2fc20d(0x151)][_0x2fc20d(0x180)]>0x0||_0xb5a3d0[_0x2fc20d(0x108)][_0x2fc20d(0x152)][_0x2fc20d(0x180)]>0x0||_0xb5a3d0[_0x2fc20d(0x108)][_0x2fc20d(0x142)]['errors']>0x0||_0xb5a3d0[_0x2fc20d(0x108)]['experimentalArtifacts']['errors']>0x0;_0x5af332?console['log'](a4_0x399678['yellow']('Project\x20cloned\x20with\x20errors')):console['log'](a4_0x399678[_0x2fc20d(0x17c)](_0x2fc20d(0x15e)));console[_0x2fc20d(0x10b)](_0x2fc20d(0x17f)+_0xb5a3d0[_0x2fc20d(0x12b)]),console['log'](_0x2fc20d(0xfc)+_0xb5a3d0['newProjectName']),console[_0x2fc20d(0x10b)](_0x2fc20d(0x15a)+_0xb5a3d0['newProjectId']),console[_0x2fc20d(0x10b)](),console[_0x2fc20d(0x10b)](_0x2fc20d(0x12c)),console['log'](_0x2fc20d(0x17a)+formatCountSummary(_0xb5a3d0[_0x2fc20d(0x108)][_0x2fc20d(0x130)])),console['log'](_0x2fc20d(0x105)+formatCountSummary(_0xb5a3d0[_0x2fc20d(0x108)]['knowledgeBases'])),console[_0x2fc20d(0x10b)]('\x20\x20Prompts:\x20'+formatCountSummary(_0xb5a3d0[_0x2fc20d(0x108)]['prompts'])),console[_0x2fc20d(0x10b)](_0x2fc20d(0x145)+formatCountSummary(_0xb5a3d0[_0x2fc20d(0x108)][_0x2fc20d(0xf5)])),console[_0x2fc20d(0x10b)](_0x2fc20d(0xf2)+formatCountSummary(_0xb5a3d0['counts']['formInterfaces'])),console['log']('\x20\x20Chat\x20Interfaces:\x20'+formatCountSummary(_0xb5a3d0['counts'][_0x2fc20d(0x152)]));const _0x8f591a=_0xb5a3d0[_0x2fc20d(0x108)]['experimentalKnowledgeBases']['created']>0x0||_0xb5a3d0[_0x2fc20d(0x108)][_0x2fc20d(0x142)][_0x2fc20d(0x161)]>0x0||_0xb5a3d0[_0x2fc20d(0x108)][_0x2fc20d(0x142)]['unchanged']>0x0||_0xb5a3d0[_0x2fc20d(0x108)][_0x2fc20d(0x159)][_0x2fc20d(0x165)]>0x0||_0xb5a3d0[_0x2fc20d(0x108)]['experimentalArtifacts'][_0x2fc20d(0x161)]>0x0||_0xb5a3d0[_0x2fc20d(0x108)][_0x2fc20d(0x159)][_0x2fc20d(0x17d)]>0x0;_0x8f591a&&(console[_0x2fc20d(0x10b)](_0x2fc20d(0xf0)+formatCountSummary(_0xb5a3d0[_0x2fc20d(0x108)][_0x2fc20d(0x142)])),console[_0x2fc20d(0x10b)](_0x2fc20d(0x119)+formatCountSummary(_0xb5a3d0['counts']['experimentalArtifacts'])));if(_0x5af332){console['log'](),console[_0x2fc20d(0x10b)](a4_0x399678['red'](_0x2fc20d(0x178)));for(const _0x2a23db of _0xb5a3d0[_0x2fc20d(0x130)]){_0x2a23db['action']===_0x2fc20d(0x183)&&console[_0x2fc20d(0x10b)](a4_0x399678['red'](_0x2fc20d(0x174)+_0x2a23db[_0x2fc20d(0x10c)]+_0x2fc20d(0xd9)+_0x2a23db['error']));}for(const _0x3eb8d7 of _0xb5a3d0[_0x2fc20d(0xe1)]){_0x3eb8d7[_0x2fc20d(0x168)]==='error'&&console[_0x2fc20d(0x10b)](a4_0x399678[_0x2fc20d(0xe7)](_0x2fc20d(0x187)+_0x3eb8d7[_0x2fc20d(0x175)]+_0x2fc20d(0xd9)+_0x3eb8d7[_0x2fc20d(0x183)]));}for(const _0x32cce9 of _0xb5a3d0['prompts']){_0x32cce9[_0x2fc20d(0x168)]===_0x2fc20d(0x183)&&console[_0x2fc20d(0x10b)](a4_0x399678[_0x2fc20d(0xe7)](_0x2fc20d(0x18a)+_0x32cce9[_0x2fc20d(0x175)]+'\x22:\x20'+_0x32cce9['error']));}for(const _0x1b29e3 of _0xb5a3d0['integrations']){_0x1b29e3[_0x2fc20d(0x168)]===_0x2fc20d(0x183)&&console[_0x2fc20d(0x10b)](a4_0x399678[_0x2fc20d(0xe7)]('\x20\x20Integration\x20\x22'+_0x1b29e3[_0x2fc20d(0x175)]+_0x2fc20d(0xd9)+_0x1b29e3[_0x2fc20d(0x183)]));}for(const _0x5dca34 of _0xb5a3d0[_0x2fc20d(0x151)]){_0x5dca34[_0x2fc20d(0x168)]===_0x2fc20d(0x183)&&console['log'](a4_0x399678[_0x2fc20d(0xe7)](_0x2fc20d(0x15f)+_0x5dca34[_0x2fc20d(0x175)]+_0x2fc20d(0xd9)+_0x5dca34[_0x2fc20d(0x183)]));}for(const _0x5d9407 of _0xb5a3d0['chatInterfaces']){_0x5d9407['action']===_0x2fc20d(0x183)&&console[_0x2fc20d(0x10b)](a4_0x399678['red'](_0x2fc20d(0x11b)+_0x5d9407[_0x2fc20d(0x175)]+_0x2fc20d(0xd9)+_0x5d9407[_0x2fc20d(0x183)]));}for(const _0x3bff77 of _0xb5a3d0[_0x2fc20d(0x142)]){_0x3bff77[_0x2fc20d(0x168)]===_0x2fc20d(0x183)&&console[_0x2fc20d(0x10b)](a4_0x399678[_0x2fc20d(0xe7)]('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0x3bff77[_0x2fc20d(0x175)]+'\x22:\x20'+_0x3bff77[_0x2fc20d(0x183)]));}for(const _0x44f98f of _0xb5a3d0['experimentalArtifacts']){_0x44f98f['action']==='error'&&console[_0x2fc20d(0x10b)](a4_0x399678[_0x2fc20d(0xe7)](_0x2fc20d(0x14b)+_0x44f98f[_0x2fc20d(0x175)]+'\x22:\x20'+_0x44f98f[_0x2fc20d(0x183)]));}return 0x1;}console[_0x2fc20d(0x10b)]();const _0x22794c=getLLMProjectUrl(_0x41bbba,_0xb5a3d0[_0x2fc20d(0x14e)]);return console[_0x2fc20d(0x10b)](_0x2fc20d(0x137)+a4_0x399678[_0x2fc20d(0x118)](_0x22794c)),0x0;}}function a4_0x80b4(){const _0x3c4910=['Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','prompts','knowledgeBases','isNew','\x20\x20tdx\x20agent\x20pull\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','llm','red','Cannot\x20clone\x20from\x20context\x20project\x20\x22','110jnMZsK','\x20files\x20to\x20','\x20\x20Chat\x20Interfaces:\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','<new-name>','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','Writing\x20files...','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','\x20changed','\x20\x20Form\x20Interfaces:\x20','projectId','Analyzing\x20changes\x20to\x20push...','integrations','\x0aChanges\x20to\x20integration\x20\x27','textKnowledgeBases','outputDir','tdx.json','push','\x20updated','New\x20project:\x20','pullAgent','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x20resources\x20to\x20\x27','projectName','llmProject','Using\x20current\x20project:\x20','\x22\x20from\x20project\x20\x22','output','\x20\x20Knowledge\x20Bases:\x20','Failed\x20to\x20push\x20agent:\x20','\x0aProject\x20pushed\x20with\x20errors','counts','agent:pull','session','log','agentName','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x0aError:','agentId','parse','\x0aPush\x20','270830YHdWcX','Using\x20project\x20from\x20','cloneProject','\x20successfully','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','cyan','\x20\x20Experimental\x20Artifacts:\x20','agent:push','\x20\x20Chat\x20Interface\x20\x22','\x20\x20Source:\x20','Dry\x20run\x20-\x20no\x20files\x20written','736744bdCKht','\x20|\x20','reason','pushProject','Dry\x20run\x20-\x20no\x20changes\x20made','site','\x22\x20to\x20a\x20different\x20profile','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)','context','\x0aPush\x20summary\x20for\x20\x27','source','Would\x20pull\x20agent:\x20','no_context','sourceProjectName','Summary:','2ArUaGL','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','agents','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','message','Agent:\x20','Chat:\x20','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','projectDir','Project:\x20','\x20new','\x0aChanges\x20to\x20form\x20interface\x20\x27','pushAgent','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x20total','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','Using\x20project:\x20','659442BpbsIi','agent','hasChanges','experimentalKnowledgeBases','\x20\x20Text\x20Knowledge\x20Bases:\x20','arg-dir','\x20\x20Integrations:\x20','\x20--profile\x20','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','912760LEcQqr','Using\x20project\x20from\x20context:\x20','yellow','\x20\x20Experimental\x20Artifact\x20\x22','outputPath','utf-8','newProjectId','found','cwd','formInterfaces','chatInterfaces','Agent\x20','Output:\x20','Pushing\x20agent\x20from\x20\x22','dim','total','llm_project','experimentalArtifacts','New\x20project\x20ID:\x20','\x22\x20to\x20\x22','force','Pushing\x20to\x20project...','Project\x20cloned\x20successfully','\x20\x20Form\x20Interface\x20\x22','\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','updated','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','386298SBRHEq','created','\x20--name\x20','gray','action','INVALID_ARGUMENT','cwd-config','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Using\x20local\x20project:\x20','✔\x20Context\x20set:\x20','1422294oCtwnH','execute','-\x20nothing\x20pushed','join','\x20\x20tdx\x20agent\x20clone\x20agents/','repeat','\x20\x20Agent\x20\x22','name','\x0aChanges\x20to\x20prompt\x20\x27','\x0aChanges:','Errors:','\x20=\x20','\x20\x20Agents:\x20','dryRun','green','unchanged','yes','Source:\x20','errors','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','14nuzvEW','error','diff','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','\x20\x20Prompts:\x20','\x20\x20Knowledge\x20Base\x20\x22','MISSING_ARGUMENT','dirname','\x20\x20Prompt\x20\x22','new','description','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','\x22\x20to\x20new\x20project\x20\x22','\x20resources?','\x0a✔\x20Pulled\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Using\x20context\x20project:\x20','Would\x20push\x20agent:\x20','Clone\x20\x22','335635YgFzsy','\x22:\x20','\x20unchanged','\x22...','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','Cancelled','Would\x20clone:'];a4_0x80b4=function(){return _0x3c4910;};return a4_0x80b4();}export class AgentPushCommand extends BaseCommand{[a4_0x3cfd04(0x175)]=a4_0x3cfd04(0x11a);[a4_0x3cfd04(0x18c)]=a4_0x3cfd04(0x163);async['execute'](_0x59a2f4){const _0x22dbb9=a4_0x3cfd04,{options:_0x48f752,args:_0xcb0e69,tdx:_0xc0567}=_0x59a2f4;let _0x126655=_0xcb0e69[0x0]||process[_0x22dbb9(0x150)]();const _0x9486cb=_0x48f752[_0x22dbb9(0x17b)],_0xaf372e=_0x48f752[_0x22dbb9(0x15c)],_0x61ea1e=_0x48f752[_0x22dbb9(0x17e)],_0x4a7d13=_0x48f752[_0x22dbb9(0x123)],_0x3c296d=a4_0x230193[_0x22dbb9(0x171)](_0x126655,'agent.yml'),_0x51de13=existsSync(_0x3c296d);if(_0x51de13){const {data:_0x3c5670}=await withSpinner(_0x22dbb9(0x155)+_0x126655+_0x22dbb9(0xdb),()=>_0xc0567[_0x22dbb9(0xe6)][_0x22dbb9(0x13a)](_0x126655,{'dryRun':_0x9486cb,'force':_0xaf372e}));if(_0x9486cb)return console[_0x22dbb9(0x10b)](a4_0x399678[_0x22dbb9(0x14a)](_0x22dbb9(0x122))),console[_0x22dbb9(0x10b)](_0x22dbb9(0xd6)+_0x3c5670['agentName']),0x0;if(_0x3c5670[_0x22dbb9(0x168)]===_0x22dbb9(0x183))return console[_0x22dbb9(0x10b)](a4_0x399678[_0x22dbb9(0xe7)](_0x22dbb9(0x106)+_0x3c5670[_0x22dbb9(0x183)])),0x1;console['log'](a4_0x399678[_0x22dbb9(0x17c)](_0x22dbb9(0x153)+_0x3c5670[_0x22dbb9(0x168)]+_0x22dbb9(0x116))),console[_0x22dbb9(0x10b)]('Agent:\x20'+_0x3c5670['agentName']);if(_0x3c5670[_0x22dbb9(0x110)]&&_0x3c5670['projectId']){const _0x1044e1=getLLMAgentChatUrl(_0x4a7d13,_0x3c5670[_0x22dbb9(0xf3)],_0x3c5670[_0x22dbb9(0x110)]);console[_0x22dbb9(0x10b)](_0x22dbb9(0x134)+a4_0x399678[_0x22dbb9(0x118)](_0x1044e1));}return 0x0;}const _0x54c9c0=_0x48f752['llmProject'],_0x24e44f=resolveProjectFromContext(_0x126655,_0x54c9c0);if(_0x24e44f[_0x22dbb9(0x14f)])_0x126655=_0x24e44f[_0x22dbb9(0x136)],_0x24e44f[_0x22dbb9(0x128)]===_0x22dbb9(0x126)&&console[_0x22dbb9(0x10b)](a4_0x399678[_0x22dbb9(0x156)](_0x22dbb9(0x13e)+_0x126655));else{let _0x4aea24=_0x22dbb9(0x12e);_0x24e44f[_0x22dbb9(0x120)]==='no_local_folder'&&(_0x4aea24=_0x24e44f[_0x22dbb9(0x132)]+_0x22dbb9(0x117)+_0x24e44f['llmProject']+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode[_0x22dbb9(0x169)],_0x24e44f[_0x22dbb9(0x120)]===_0x22dbb9(0x12a)?_0x24e44f['message']:'No\x20tdx.json\x20found\x20in\x20'+_0x126655,undefined,{'helpText':_0x4aea24});}const {data:_0x1d0283}=await withSpinner(_0x22dbb9(0xf4),()=>_0xc0567[_0x22dbb9(0xe6)][_0x22dbb9(0x121)](_0x126655,{'dryRun':!![]})),_0xd9bd69=_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0x130)][_0x22dbb9(0x180)]>0x0;if(_0xd9bd69){console['log'](a4_0x399678[_0x22dbb9(0xe7)]('\x0aErrors\x20found:'));for(const _0x4ade0b of _0x1d0283['agents']){_0x4ade0b[_0x22dbb9(0x168)]==='error'&&console[_0x22dbb9(0x10b)](a4_0x399678[_0x22dbb9(0xe7)](_0x22dbb9(0x174)+_0x4ade0b[_0x22dbb9(0x10c)]+_0x22dbb9(0xd9)+_0x4ade0b[_0x22dbb9(0x183)]));}return 0x1;}const _0x4c1c9a=_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0x130)][_0x22dbb9(0x165)]+_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0xe1)][_0x22dbb9(0x165)]+_0x1d0283['counts'][_0x22dbb9(0xf7)][_0x22dbb9(0x165)]+_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0xe0)]['created']+_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0xf5)][_0x22dbb9(0x165)]+_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0x142)][_0x22dbb9(0x165)]+_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0x159)][_0x22dbb9(0x165)]+_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0x151)][_0x22dbb9(0x165)]+_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0x152)][_0x22dbb9(0x165)],_0x207d43=_0x1d0283['counts'][_0x22dbb9(0x130)][_0x22dbb9(0x161)]+_0x1d0283[_0x22dbb9(0x108)]['knowledgeBases'][_0x22dbb9(0x161)]+_0x1d0283['counts'][_0x22dbb9(0xf7)][_0x22dbb9(0x161)]+_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0xe0)][_0x22dbb9(0x161)]+_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0xf5)][_0x22dbb9(0x161)]+_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0x142)][_0x22dbb9(0x161)]+_0x1d0283['counts'][_0x22dbb9(0x159)][_0x22dbb9(0x161)]+_0x1d0283['counts'][_0x22dbb9(0x151)][_0x22dbb9(0x161)]+_0x1d0283['counts'][_0x22dbb9(0x152)]['updated'],_0x305bf0=_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0x130)][_0x22dbb9(0x17d)]+_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0xe1)][_0x22dbb9(0x17d)]+_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0xf7)]['unchanged']+_0x1d0283['counts'][_0x22dbb9(0xe0)]['unchanged']+_0x1d0283['counts'][_0x22dbb9(0xf5)]['unchanged']+_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0x142)]['unchanged']+_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0x159)]['unchanged']+_0x1d0283[_0x22dbb9(0x108)]['formInterfaces'][_0x22dbb9(0x17d)]+_0x1d0283['counts'][_0x22dbb9(0x152)]['unchanged'];console[_0x22dbb9(0x10b)](_0x22dbb9(0x127)+_0x1d0283['projectName']+'\x27:'),console[_0x22dbb9(0x10b)]('\x20\x20'+a4_0x399678[_0x22dbb9(0x17c)]('+\x20'+_0x4c1c9a+_0x22dbb9(0x138))+_0x22dbb9(0x11f)+a4_0x399678[_0x22dbb9(0x14a)]('~\x20'+_0x207d43+_0x22dbb9(0xf1))+_0x22dbb9(0x11f)+a4_0x399678[_0x22dbb9(0x156)]('=\x20'+_0x305bf0+_0x22dbb9(0xda))),console[_0x22dbb9(0x10b)](_0x22dbb9(0x17a)+formatCountSummary(_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0x130)])),console[_0x22dbb9(0x10b)](_0x22dbb9(0x105)+formatCountSummary(_0x1d0283[_0x22dbb9(0x108)]['knowledgeBases'])),console[_0x22dbb9(0x10b)](_0x22dbb9(0x143)+formatCountSummary(_0x1d0283[_0x22dbb9(0x108)]['textKnowledgeBases'])),console[_0x22dbb9(0x10b)](_0x22dbb9(0x186)+formatCountSummary(_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0xe0)])),console['log'](_0x22dbb9(0x145)+formatCountSummary(_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0xf5)])),console['log'](_0x22dbb9(0xf2)+formatCountSummary(_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0x151)])),console[_0x22dbb9(0x10b)]('\x20\x20Chat\x20Interfaces:\x20'+formatCountSummary(_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0x152)]));const _0x32119d=_0x1d0283['counts'][_0x22dbb9(0x142)]['created']>0x0||_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0x142)][_0x22dbb9(0x161)]>0x0||_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0x142)][_0x22dbb9(0x17d)]>0x0||_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0x159)][_0x22dbb9(0x165)]>0x0||_0x1d0283[_0x22dbb9(0x108)]['experimentalArtifacts'][_0x22dbb9(0x161)]>0x0||_0x1d0283[_0x22dbb9(0x108)]['experimentalArtifacts'][_0x22dbb9(0x17d)]>0x0;_0x32119d&&(console[_0x22dbb9(0x10b)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x1d0283['counts'][_0x22dbb9(0x142)])),console[_0x22dbb9(0x10b)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0x159)])));console[_0x22dbb9(0x10b)](_0x22dbb9(0x11c)+a4_0x399678[_0x22dbb9(0x118)](_0x126655)),displayDiffs(_0x1d0283['agents'],_0x1d0283[_0x22dbb9(0xe1)],_0x1d0283[_0x22dbb9(0xf7)],_0x1d0283[_0x22dbb9(0xe0)],_0x1d0283[_0x22dbb9(0xf5)],_0x1d0283[_0x22dbb9(0x142)],_0x1d0283['experimentalArtifacts'],_0x1d0283[_0x22dbb9(0x151)],_0x1d0283[_0x22dbb9(0x152)]);if(_0x9486cb)return console[_0x22dbb9(0x10b)](a4_0x399678[_0x22dbb9(0x14a)](_0x22dbb9(0xec))),0x0;if(_0x4c1c9a===0x0&&_0x207d43===0x0){console[_0x22dbb9(0x10b)](a4_0x399678[_0x22dbb9(0x17c)](_0x22dbb9(0x13d)));const _0x4b5e75=getLLMProjectUrl(_0x4a7d13,_0x1d0283[_0x22dbb9(0xf3)]);return console['log'](_0x22dbb9(0x137)+a4_0x399678[_0x22dbb9(0x118)](_0x4b5e75)),0x0;}if(!_0x61ea1e&&!_0xaf372e){if(!isInteractive())return console[_0x22dbb9(0x183)](a4_0x399678[_0x22dbb9(0xe7)](_0x22dbb9(0x10f)),_0x22dbb9(0xe4)),console[_0x22dbb9(0x183)](a4_0x399678[_0x22dbb9(0x156)](_0x22dbb9(0x12f))),0x1;const _0x5dde6c=await confirmKey(_0x22dbb9(0x112)+(_0x4c1c9a+_0x207d43)+_0x22dbb9(0xd2));if(!_0x5dde6c)return console[_0x22dbb9(0x10b)](a4_0x399678['yellow'](_0x22dbb9(0xdd)),_0x22dbb9(0x170)),0x1;}const {data:_0xf1cd69}=await withSpinner(_0x22dbb9(0x15d),()=>_0xc0567[_0x22dbb9(0xe6)][_0x22dbb9(0x121)](_0x126655,{'force':_0xaf372e})),_0x563e62=_0xf1cd69[_0x22dbb9(0x108)]['agents'][_0x22dbb9(0x180)]>0x0||_0xf1cd69[_0x22dbb9(0x108)][_0x22dbb9(0xe1)][_0x22dbb9(0x180)]>0x0||_0xf1cd69[_0x22dbb9(0x108)][_0x22dbb9(0xf7)][_0x22dbb9(0x180)]>0x0||_0xf1cd69['counts']['prompts'][_0x22dbb9(0x180)]>0x0||_0xf1cd69[_0x22dbb9(0x108)][_0x22dbb9(0x151)][_0x22dbb9(0x180)]>0x0||_0xf1cd69[_0x22dbb9(0x108)][_0x22dbb9(0x152)]['errors']>0x0;if(_0x563e62){console['log'](a4_0x399678[_0x22dbb9(0x14a)](_0x22dbb9(0x107))),console[_0x22dbb9(0x10b)](),console[_0x22dbb9(0x10b)](a4_0x399678[_0x22dbb9(0xe7)](_0x22dbb9(0x178)));for(const _0x720087 of _0xf1cd69[_0x22dbb9(0x130)]){_0x720087['action']===_0x22dbb9(0x183)&&console[_0x22dbb9(0x10b)](a4_0x399678[_0x22dbb9(0xe7)](_0x22dbb9(0x174)+_0x720087['agentName']+_0x22dbb9(0xd9)+_0x720087[_0x22dbb9(0x183)]));}for(const _0x4d5a33 of _0xf1cd69['knowledgeBases']){_0x4d5a33['action']==='error'&&console['log'](a4_0x399678['red']('\x20\x20Knowledge\x20Base\x20\x22'+_0x4d5a33[_0x22dbb9(0x175)]+'\x22:\x20'+_0x4d5a33[_0x22dbb9(0x183)]));}for(const _0x5eecc8 of _0xf1cd69[_0x22dbb9(0xf7)]){_0x5eecc8[_0x22dbb9(0x168)]===_0x22dbb9(0x183)&&console['log'](a4_0x399678['red'](_0x22dbb9(0x13b)+_0x5eecc8[_0x22dbb9(0x175)]+'\x22:\x20'+_0x5eecc8['error']));}for(const _0x3cc3e3 of _0xf1cd69[_0x22dbb9(0xe0)]){_0x3cc3e3[_0x22dbb9(0x168)]==='error'&&console[_0x22dbb9(0x10b)](a4_0x399678[_0x22dbb9(0xe7)](_0x22dbb9(0x18a)+_0x3cc3e3[_0x22dbb9(0x175)]+_0x22dbb9(0xd9)+_0x3cc3e3[_0x22dbb9(0x183)]));}for(const _0x4918b7 of _0xf1cd69[_0x22dbb9(0xf5)]){_0x4918b7[_0x22dbb9(0x168)]===_0x22dbb9(0x183)&&console[_0x22dbb9(0x10b)](a4_0x399678['red']('\x20\x20Integration\x20\x22'+_0x4918b7[_0x22dbb9(0x175)]+_0x22dbb9(0xd9)+_0x4918b7[_0x22dbb9(0x183)]));}for(const _0x769fb9 of _0xf1cd69[_0x22dbb9(0x151)]){_0x769fb9[_0x22dbb9(0x168)]===_0x22dbb9(0x183)&&console[_0x22dbb9(0x10b)](a4_0x399678[_0x22dbb9(0xe7)]('\x20\x20Form\x20Interface\x20\x22'+_0x769fb9['name']+'\x22:\x20'+_0x769fb9[_0x22dbb9(0x183)]));}for(const _0x41c74c of _0xf1cd69[_0x22dbb9(0x152)]){_0x41c74c['action']===_0x22dbb9(0x183)&&console['log'](a4_0x399678[_0x22dbb9(0xe7)](_0x22dbb9(0x11b)+_0x41c74c[_0x22dbb9(0x175)]+'\x22:\x20'+_0x41c74c[_0x22dbb9(0x183)]));}return 0x1;}console[_0x22dbb9(0x10b)](a4_0x399678[_0x22dbb9(0x17c)]('\x0a✔\x20Pushed\x20'+(_0x4c1c9a+_0x207d43)+_0x22dbb9(0xff)+_0xf1cd69[_0x22dbb9(0x100)]+'\x27'));const _0xd30ef2=getLLMProjectUrl(_0x4a7d13,_0xf1cd69['projectId']);return console['log'](_0x22dbb9(0x137)+a4_0x399678[_0x22dbb9(0x118)](_0xd30ef2)),0x0;}}
|
|
1
|
+
const a4_0x2af299=a4_0x1cf3;(function(_0x529435,_0x2bc563){const _0x1b4ad4=a4_0x1cf3,_0x34e6dd=_0x529435();while(!![]){try{const _0x39f632=parseInt(_0x1b4ad4(0x116))/0x1+parseInt(_0x1b4ad4(0xdd))/0x2+parseInt(_0x1b4ad4(0xef))/0x3*(-parseInt(_0x1b4ad4(0x113))/0x4)+parseInt(_0x1b4ad4(0xfb))/0x5*(parseInt(_0x1b4ad4(0x11a))/0x6)+parseInt(_0x1b4ad4(0xbf))/0x7*(parseInt(_0x1b4ad4(0x127))/0x8)+-parseInt(_0x1b4ad4(0x9e))/0x9*(parseInt(_0x1b4ad4(0xd3))/0xa)+parseInt(_0x1b4ad4(0xe1))/0xb*(parseInt(_0x1b4ad4(0x12b))/0xc);if(_0x39f632===_0x2bc563)break;else _0x34e6dd['push'](_0x34e6dd['shift']());}catch(_0xc7974b){_0x34e6dd['push'](_0x34e6dd['shift']());}}}(a4_0x234c,0x9841f));import a4_0x30f3fc from'chalk';import a4_0x1e8bb5 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0xfdaf16){const _0x191c82=a4_0x1cf3,_0xa1b5c=[];if(_0xfdaf16['total']!==undefined)_0xa1b5c[_0x191c82(0x12e)](_0xfdaf16['total']+'\x20total');if(_0xfdaf16[_0x191c82(0x81)]!==undefined&&_0xfdaf16[_0x191c82(0x81)]>0x0)_0xa1b5c[_0x191c82(0x12e)](a4_0x30f3fc[_0x191c82(0xea)](_0xfdaf16['new']+'\x20new'));if(_0xfdaf16[_0x191c82(0xc7)]!==undefined&&_0xfdaf16[_0x191c82(0xc7)]>0x0)_0xa1b5c['push'](a4_0x30f3fc[_0x191c82(0xea)](_0xfdaf16[_0x191c82(0xc7)]+_0x191c82(0xa2)));if(_0xfdaf16['updated']!==undefined&&_0xfdaf16[_0x191c82(0x8f)]>0x0)_0xa1b5c['push'](a4_0x30f3fc['yellow'](_0xfdaf16[_0x191c82(0x8f)]+_0x191c82(0xc1)));if(_0xfdaf16[_0x191c82(0x100)]!==undefined&&_0xfdaf16[_0x191c82(0x100)]>0x0)_0xa1b5c[_0x191c82(0x12e)](a4_0x30f3fc['gray'](_0xfdaf16['unchanged']+_0x191c82(0xc5)));if(_0xfdaf16[_0x191c82(0xe5)]!==undefined&&_0xfdaf16[_0x191c82(0xe5)]>0x0)_0xa1b5c[_0x191c82(0x12e)](a4_0x30f3fc[_0x191c82(0xf9)](_0xfdaf16[_0x191c82(0xe5)]+_0x191c82(0xfe)));return _0xa1b5c[_0x191c82(0xb7)](',\x20');}function a4_0x1cf3(_0x21189c,_0x1dfbea){_0x21189c=_0x21189c-0x7b;const _0x234c19=a4_0x234c();let _0x1cf3fd=_0x234c19[_0x21189c];return _0x1cf3fd;}function displayDiffs(_0x16c78a,_0x29d813,_0x3f97e2,_0x57c017,_0x15e4a3,_0x34bd2b,_0x32b99a,_0x24528b,_0x9c74c0){const _0x1b0e55=a4_0x1cf3;for(const _0x5510c4 of _0x16c78a){if(_0x5510c4[_0x1b0e55(0x9d)]){const _0x1c731b=_0x5510c4[_0x1b0e55(0xaa)]||_0x5510c4[_0x1b0e55(0xdc)];console[_0x1b0e55(0x118)](_0x1b0e55(0xc2)+_0x1c731b+'\x27:'),console['log']('─'[_0x1b0e55(0x11e)](0x3c)),console['log'](_0x5510c4[_0x1b0e55(0x9d)]),console[_0x1b0e55(0x118)]('─'[_0x1b0e55(0x11e)](0x3c));}}for(const _0x2275a6 of _0x29d813){_0x2275a6['diff']&&(console[_0x1b0e55(0x118)](_0x1b0e55(0xc0)+_0x2275a6[_0x1b0e55(0xdc)]+'\x27:'),console['log']('─'[_0x1b0e55(0x11e)](0x3c)),console[_0x1b0e55(0x118)](_0x2275a6[_0x1b0e55(0x9d)]),console[_0x1b0e55(0x118)]('─'['repeat'](0x3c)));}for(const _0xca72ff of _0x3f97e2){_0xca72ff[_0x1b0e55(0x9d)]&&(console[_0x1b0e55(0x118)](_0x1b0e55(0x10c)+_0xca72ff[_0x1b0e55(0xdc)]+'\x27:'),console[_0x1b0e55(0x118)]('─'['repeat'](0x3c)),console['log'](_0xca72ff[_0x1b0e55(0x9d)]),console['log']('─'[_0x1b0e55(0x11e)](0x3c)));}for(const _0x1b3447 of _0x57c017){_0x1b3447['diff']&&(console[_0x1b0e55(0x118)]('\x0aChanges\x20to\x20prompt\x20\x27'+_0x1b3447[_0x1b0e55(0xdc)]+'\x27:'),console[_0x1b0e55(0x118)]('─'[_0x1b0e55(0x11e)](0x3c)),console['log'](_0x1b3447[_0x1b0e55(0x9d)]),console[_0x1b0e55(0x118)]('─'[_0x1b0e55(0x11e)](0x3c)));}for(const _0x487bfc of _0x15e4a3){_0x487bfc[_0x1b0e55(0x9d)]&&(console['log']('\x0aChanges\x20to\x20integration\x20\x27'+_0x487bfc[_0x1b0e55(0xdc)]+'\x27:'),console[_0x1b0e55(0x118)]('─'[_0x1b0e55(0x11e)](0x3c)),console[_0x1b0e55(0x118)](_0x487bfc[_0x1b0e55(0x9d)]),console['log']('─'[_0x1b0e55(0x11e)](0x3c)));}for(const _0x445ba9 of _0x34bd2b){_0x445ba9['diff']&&(console[_0x1b0e55(0x118)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x445ba9[_0x1b0e55(0xdc)]+'\x27:'),console[_0x1b0e55(0x118)]('─'['repeat'](0x3c)),console[_0x1b0e55(0x118)](_0x445ba9[_0x1b0e55(0x9d)]),console[_0x1b0e55(0x118)]('─'[_0x1b0e55(0x11e)](0x3c)));}for(const _0x13f62d of _0x32b99a){_0x13f62d['diff']&&(console['log'](_0x1b0e55(0x115)+_0x13f62d['name']+'\x27:'),console[_0x1b0e55(0x118)]('─'[_0x1b0e55(0x11e)](0x3c)),console[_0x1b0e55(0x118)](_0x13f62d[_0x1b0e55(0x9d)]),console[_0x1b0e55(0x118)]('─'[_0x1b0e55(0x11e)](0x3c)));}for(const _0x5a9c39 of _0x24528b){_0x5a9c39[_0x1b0e55(0x9d)]&&(console['log'](_0x1b0e55(0x134)+_0x5a9c39[_0x1b0e55(0xdc)]+'\x27:'),console[_0x1b0e55(0x118)]('─'[_0x1b0e55(0x11e)](0x3c)),console[_0x1b0e55(0x118)](_0x5a9c39['diff']),console[_0x1b0e55(0x118)]('─'['repeat'](0x3c)));}for(const _0x37bb2d of _0x9c74c0){_0x37bb2d[_0x1b0e55(0x9d)]&&(console[_0x1b0e55(0x118)](_0x1b0e55(0x119)+_0x37bb2d[_0x1b0e55(0xdc)]+'\x27:'),console['log']('─'[_0x1b0e55(0x11e)](0x3c)),console[_0x1b0e55(0x118)](_0x37bb2d[_0x1b0e55(0x9d)]),console[_0x1b0e55(0x118)]('─'[_0x1b0e55(0x11e)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']='agent:pull';['description']=a4_0x2af299(0x7e);async[a4_0x2af299(0xfd)](_0x52ade0){const _0x6c1221=a4_0x2af299,{options:_0x33ccf4,args:_0x32795a,tdx:_0x19bd71}=_0x52ade0,_0x53f23d=_0x32795a[0x0],_0x1df724=_0x32795a[0x1],_0x38a963=_0x33ccf4['output'],_0x47b70f=_0x33ccf4[_0x6c1221(0xa7)],_0x45d7b8=_0x33ccf4['force'],_0x5b14b4=_0x33ccf4[_0x6c1221(0xec)],_0x1a212f=_0x33ccf4[_0x6c1221(0x12a)],_0x564102=_0x33ccf4[_0x6c1221(0x10d)];let _0x2d5fa8;if(_0x53f23d){const _0x4e20f7=a4_0x1e8bb5[_0x6c1221(0xb7)](_0x53f23d,'tdx.json');if(existsSync(_0x4e20f7))try{const _0x3edd22=JSON[_0x6c1221(0xb9)](readFileSync(_0x4e20f7,'utf-8'));_0x3edd22[_0x6c1221(0x92)]&&(_0x2d5fa8={'llm_project':_0x3edd22[_0x6c1221(0x92)]});}catch{}}const _0x487dab=findAgentConfigPath(process['cwd']());let _0xacf9ff;if(_0x487dab)try{const _0x1f2702=JSON['parse'](readFileSync(_0x487dab,_0x6c1221(0xc8)));_0x1f2702[_0x6c1221(0x92)]&&(_0xacf9ff={'llm_project':_0x1f2702[_0x6c1221(0x92)]});}catch{}const _0x88f71e=resolveAgentPullArgs({'arg':_0x53f23d,'agentNameArg':_0x1df724,'agentFlag':_0x564102,'contextProject':_0x1a212f,'argDirConfig':_0x2d5fa8,'cwdConfigPath':_0x487dab||undefined,'cwdConfig':_0xacf9ff}),{projectNameOrId:_0x1fb462,targetAgentName:_0x2da227,existingOutputDir:_0xb6bed2,source:_0x24d072}=_0x88f71e;if(_0x24d072==='arg-dir')console['log'](a4_0x30f3fc['dim'](_0x6c1221(0xf4)+a4_0x1e8bb5[_0x6c1221(0xb7)](_0x53f23d,_0x6c1221(0xb5))+':\x20'+_0x1fb462));else{if(_0x24d072===_0x6c1221(0x125))console['log'](a4_0x30f3fc[_0x6c1221(0x88)](_0x6c1221(0xcf)+_0x1fb462));else _0x24d072===_0x6c1221(0x85)&&console[_0x6c1221(0x118)](a4_0x30f3fc[_0x6c1221(0x88)](_0x6c1221(0x89)+_0x1fb462));}if(!_0x1fb462)return _0x564102?(console[_0x6c1221(0x118)](a4_0x30f3fc['yellow'](_0x6c1221(0xb2))),console[_0x6c1221(0x118)]('Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>'),console['log'](_0x6c1221(0x137))):(console[_0x6c1221(0x118)](a4_0x30f3fc[_0x6c1221(0xe4)](_0x6c1221(0x135))),console[_0x6c1221(0x118)](_0x6c1221(0xb0)),console[_0x6c1221(0x118)](_0x6c1221(0x123)),console[_0x6c1221(0x118)](_0x6c1221(0x103)),console[_0x6c1221(0x118)]('\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'),console[_0x6c1221(0x118)](_0x6c1221(0x9f))),0x1;if(_0x2da227){const {data:_0x21332c}=await withSpinner(_0x6c1221(0xf0)+_0x2da227+_0x6c1221(0x10e)+_0x1fb462+'\x22...',()=>_0x19bd71[_0x6c1221(0x129)]['pullAgent'](_0x1fb462,_0x2da227,_0x38a963,{'dryRun':_0x47b70f,'force':_0x45d7b8}));if(_0x47b70f)return console['log'](a4_0x30f3fc['yellow'](_0x6c1221(0x12d))),console[_0x6c1221(0x118)](_0x6c1221(0x86)+_0x21332c[_0x6c1221(0xaa)]),console[_0x6c1221(0x118)]('Output\x20path:\x20'+_0x21332c[_0x6c1221(0x11f)]),_0x21332c[_0x6c1221(0x9d)]&&(console[_0x6c1221(0x118)](_0x6c1221(0xe3)),console[_0x6c1221(0x118)]('─'[_0x6c1221(0x11e)](0x3c)),console[_0x6c1221(0x118)](_0x21332c[_0x6c1221(0x9d)]),console[_0x6c1221(0x118)]('─'[_0x6c1221(0x11e)](0x3c))),0x0;return console[_0x6c1221(0x118)](a4_0x30f3fc[_0x6c1221(0xea)]('Agent\x20pulled\x20successfully')),console[_0x6c1221(0x118)]('Agent:\x20'+_0x21332c[_0x6c1221(0xaa)]),console['log'](_0x6c1221(0x98)+_0x21332c[_0x6c1221(0x11f)]),console['log'](_0x6c1221(0x8c)+(_0x21332c[_0x6c1221(0xca)]?a4_0x30f3fc[_0x6c1221(0xea)](_0x6c1221(0x81)):_0x21332c[_0x6c1221(0x122)]?a4_0x30f3fc[_0x6c1221(0xe4)]('updated'):a4_0x30f3fc['gray']('unchanged'))),0x0;}const _0x107b35=_0xb6bed2||_0x38a963,{data:_0x2da2bf}=await withSpinner(_0x6c1221(0xce)+_0x1fb462+_0x6c1221(0xb8),()=>_0x19bd71[_0x6c1221(0x129)][_0x6c1221(0x7b)](_0x1fb462,_0x107b35,{'dryRun':!![]})),_0x49cef5=_0x2da2bf[_0x6c1221(0x108)][_0x6c1221(0x82)][_0x6c1221(0x81)]+_0x2da2bf[_0x6c1221(0x108)][_0x6c1221(0x112)]['new']+_0x2da2bf['counts'][_0x6c1221(0xf2)][_0x6c1221(0x81)]+_0x2da2bf['counts'][_0x6c1221(0xe0)][_0x6c1221(0x81)]+_0x2da2bf[_0x6c1221(0x108)][_0x6c1221(0x8b)][_0x6c1221(0x81)]+_0x2da2bf[_0x6c1221(0x108)]['experimentalKnowledgeBases'][_0x6c1221(0x81)]+_0x2da2bf[_0x6c1221(0x108)][_0x6c1221(0x10a)]['new']+_0x2da2bf[_0x6c1221(0x108)]['formInterfaces'][_0x6c1221(0x81)]+_0x2da2bf['counts'][_0x6c1221(0x8d)][_0x6c1221(0x81)],_0x8b3201=_0x2da2bf['counts'][_0x6c1221(0x82)]['updated']+_0x2da2bf['counts']['knowledgeBases'][_0x6c1221(0x8f)]+_0x2da2bf['counts']['textKnowledgeBases'][_0x6c1221(0x8f)]+_0x2da2bf[_0x6c1221(0x108)]['prompts']['updated']+_0x2da2bf['counts']['integrations'][_0x6c1221(0x8f)]+_0x2da2bf['counts'][_0x6c1221(0x11b)][_0x6c1221(0x8f)]+_0x2da2bf[_0x6c1221(0x108)][_0x6c1221(0x10a)][_0x6c1221(0x8f)]+_0x2da2bf[_0x6c1221(0x108)][_0x6c1221(0x83)][_0x6c1221(0x8f)]+_0x2da2bf['counts'][_0x6c1221(0x8d)][_0x6c1221(0x8f)],_0x16dea0=_0x2da2bf[_0x6c1221(0x108)][_0x6c1221(0x82)]['unchanged']+_0x2da2bf[_0x6c1221(0x108)]['knowledgeBases']['unchanged']+_0x2da2bf[_0x6c1221(0x108)][_0x6c1221(0xf2)][_0x6c1221(0x100)]+_0x2da2bf[_0x6c1221(0x108)][_0x6c1221(0xe0)][_0x6c1221(0x100)]+_0x2da2bf[_0x6c1221(0x108)]['integrations']['unchanged']+_0x2da2bf[_0x6c1221(0x108)]['experimentalKnowledgeBases'][_0x6c1221(0x100)]+_0x2da2bf[_0x6c1221(0x108)]['experimentalArtifacts'][_0x6c1221(0x100)]+_0x2da2bf[_0x6c1221(0x108)][_0x6c1221(0x83)][_0x6c1221(0x100)]+_0x2da2bf['counts']['chatInterfaces'][_0x6c1221(0x100)];console[_0x6c1221(0x118)](_0x6c1221(0x130)+_0x2da2bf[_0x6c1221(0x91)]+'\x27:'),console[_0x6c1221(0x118)]('\x20\x20'+a4_0x30f3fc['green']('+\x20'+_0x49cef5+_0x6c1221(0xd8))+_0x6c1221(0xf7)+a4_0x30f3fc[_0x6c1221(0xe4)]('~\x20'+_0x8b3201+'\x20changed')+_0x6c1221(0xf7)+a4_0x30f3fc[_0x6c1221(0x88)]('=\x20'+_0x16dea0+_0x6c1221(0xc5))),console[_0x6c1221(0x118)](_0x6c1221(0xe6)+formatCountSummary(_0x2da2bf['counts'][_0x6c1221(0x82)])),console[_0x6c1221(0x118)](_0x6c1221(0xa1)+formatCountSummary(_0x2da2bf['counts'][_0x6c1221(0x112)])),console[_0x6c1221(0x118)](_0x6c1221(0xa9)+formatCountSummary(_0x2da2bf['counts'][_0x6c1221(0xf2)])),console[_0x6c1221(0x118)](_0x6c1221(0x7f)+formatCountSummary(_0x2da2bf[_0x6c1221(0x108)][_0x6c1221(0xe0)])),console[_0x6c1221(0x118)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x2da2bf[_0x6c1221(0x108)][_0x6c1221(0x8b)])),console[_0x6c1221(0x118)](_0x6c1221(0xc9)+formatCountSummary(_0x2da2bf[_0x6c1221(0x108)][_0x6c1221(0x83)])),console['log'](_0x6c1221(0x7c)+formatCountSummary(_0x2da2bf[_0x6c1221(0x108)][_0x6c1221(0x8d)]));const _0x3b003b=_0x2da2bf[_0x6c1221(0x108)]['experimentalKnowledgeBases'][_0x6c1221(0xf8)]>0x0||_0x2da2bf[_0x6c1221(0x108)][_0x6c1221(0x10a)]['total']>0x0;_0x3b003b&&(console[_0x6c1221(0x118)](_0x6c1221(0x99)+formatCountSummary(_0x2da2bf[_0x6c1221(0x108)][_0x6c1221(0x11b)])),console[_0x6c1221(0x118)](_0x6c1221(0x102)+formatCountSummary(_0x2da2bf[_0x6c1221(0x108)]['experimentalArtifacts'])));console[_0x6c1221(0x118)](_0x6c1221(0xb6)+a4_0x30f3fc[_0x6c1221(0x120)](_0x2da2bf['outputDir'])),displayDiffs(_0x2da2bf[_0x6c1221(0x82)],_0x2da2bf[_0x6c1221(0x112)],_0x2da2bf[_0x6c1221(0xf2)],_0x2da2bf[_0x6c1221(0xe0)],_0x2da2bf[_0x6c1221(0x8b)],_0x2da2bf[_0x6c1221(0x11b)],_0x2da2bf[_0x6c1221(0x10a)],_0x2da2bf[_0x6c1221(0x83)],_0x2da2bf[_0x6c1221(0x8d)]);if(_0x47b70f)return console[_0x6c1221(0x118)](a4_0x30f3fc[_0x6c1221(0xe4)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x49cef5===0x0&&_0x8b3201===0x0)return console['log'](a4_0x30f3fc[_0x6c1221(0xea)](_0x6c1221(0x126))),saveSessionContext({'llm_project':_0x2da2bf[_0x6c1221(0x91)]},_0x33ccf4[_0x6c1221(0xd5)]),console[_0x6c1221(0x118)](a4_0x30f3fc[_0x6c1221(0xea)](_0x6c1221(0xde)+a4_0x30f3fc[_0x6c1221(0x88)](_0x6c1221(0x92))+_0x6c1221(0xd7)+a4_0x30f3fc[_0x6c1221(0x120)](_0x2da2bf[_0x6c1221(0x91)]))),0x0;if(!_0x5b14b4&&!_0x45d7b8){if(!isInteractive())return console[_0x6c1221(0x94)](a4_0x30f3fc[_0x6c1221(0xf9)](_0x6c1221(0xb4)),_0x6c1221(0xdb)),console[_0x6c1221(0x94)](a4_0x30f3fc[_0x6c1221(0x88)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x3f82a7=await confirmKey(_0x6c1221(0x101)+(_0x49cef5+_0x8b3201)+'\x20files?');if(!_0x3f82a7)return console[_0x6c1221(0x118)](a4_0x30f3fc['yellow'](_0x6c1221(0x87)),_0x6c1221(0xed)),0x1;}const {data:_0x3c185e}=await withSpinner(_0x6c1221(0x104),()=>_0x19bd71[_0x6c1221(0x129)][_0x6c1221(0x7b)](_0x1fb462,_0x107b35,{'force':_0x45d7b8}));return console['log'](a4_0x30f3fc['green'](_0x6c1221(0x111)+(_0x49cef5+_0x8b3201)+_0x6c1221(0xf6)+_0x3c185e[_0x6c1221(0xa6)])),saveSessionContext({'llm_project':_0x3c185e[_0x6c1221(0x91)]},_0x33ccf4[_0x6c1221(0xd5)]),console[_0x6c1221(0x118)](a4_0x30f3fc[_0x6c1221(0xea)]('✔\x20Context\x20set:\x20'+a4_0x30f3fc[_0x6c1221(0x88)]('llm_project')+_0x6c1221(0xd7)+a4_0x30f3fc['cyan'](_0x3c185e[_0x6c1221(0x91)]))),0x0;}}function a4_0x234c(){const _0x31fd51=['MISSING_ARGUMENT','\x20\x20Knowledge\x20Bases:\x20','\x20created','INVALID_ARGUMENT','New\x20project\x20name\x20is\x20required','cwd','outputDir','dryRun','\x20\x20Agent\x20\x22','\x20\x20Text\x20Knowledge\x20Bases:\x20','agentName','\x0a✔\x20Pushed\x20','Analyzing\x20changes\x20to\x20push...','agent:push','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x20resources\x20to\x20\x27','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)','\x0aPush\x20summary\x20for\x20\x27','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','newProjectName','\x0aError:','tdx.json','\x20\x20Target:\x20','join','\x22...','parse','\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)','site','no_local_folder','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x0aErrors\x20found:','7kaKJFj','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x20updated','\x0aChanges\x20to\x20agent\x20\x27','Failed\x20to\x20push\x20agent:\x20','\x22\x20to\x20a\x20different\x20profile','\x20unchanged','\x20\x20tdx\x20agent\x20clone\x20agents/','created','utf-8','\x20\x20Form\x20Interfaces:\x20','isNew','Summary:','Agent\x20','\x22:\x20','Analyzing\x20project\x20\x22','Using\x20project:\x20','sourceProjectName','\x22\x20to\x20\x22','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','541490PXujok','Using\x20local\x20project:\x20','session','Errors:','\x20=\x20','\x20new','Pushing\x20to\x20project...','profile','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','name','1863190fXxVus','✔\x20Context\x20set:\x20','\x20changed','prompts','1911657QlrcQG','description','\x0aChanges:','yellow','errors','\x20\x20Agents:\x20','Cloning\x20\x22','\x20\x20Chat\x20Interface\x20\x22','force','green','Project\x20cloned\x20with\x20errors','yes','-\x20no\x20files\x20written','Project\x20cloned\x20successfully','1470981IMilHf','Pulling\x20agent\x20\x22','\x20\x20Text\x20Knowledge\x20Base\x20\x22','textKnowledgeBases','\x20\x20Integrations:\x20','Using\x20project\x20from\x20','Cannot\x20clone\x20from\x20context\x20project\x20\x22','\x20files\x20to\x20','\x20|\x20','total','red','pushProject','5XcwVHr','\x22\x20to\x20new\x20project\x20\x22','execute','\x20errors','projectDir','unchanged','\x0aWrite\x20','\x20\x20Experimental\x20Artifacts:\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','Writing\x20files...','Using\x20context\x20project:\x20','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','counts','agentId','experimentalArtifacts','reason','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','agent','\x22\x20from\x20project\x20\x22','Source:\x20','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x0a✔\x20Pulled\x20','knowledgeBases','4ugAnxH','found','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','57598qBJWjl','source','log','\x0aChanges\x20to\x20chat\x20interface\x20\x27','1660380IQHpUf','experimentalKnowledgeBases','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','Using\x20current\x20project:\x20','repeat','outputPath','cyan','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','hasChanges','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','\x20\x20Prompt\x20\x22','cwd-config','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','2159224ySPVOA','pushAgent','llm','llmProject','12NHIXSI','dirname','Dry\x20run\x20-\x20no\x20files\x20written','push','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x0aPull\x20summary\x20for\x20\x27','newProjectId','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','New\x20project\x20ID:\x20','\x0aChanges\x20to\x20form\x20interface\x20\x27','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','Dry\x20run\x20-\x20no\x20changes\x20made','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','pullProject','\x20\x20Chat\x20Interfaces:\x20','projectId','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x20\x20Prompts:\x20','\x0aPush\x20','new','agents','formInterfaces','\x0aProject\x20pushed\x20with\x20errors','context','Would\x20pull\x20agent:\x20','Cancelled','dim','Using\x20project\x20from\x20context:\x20','Project:\x20','integrations','Status:\x20','chatInterfaces','\x20\x20Form\x20Interface\x20\x22','updated','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','projectName','llm_project','Would\x20push\x20agent:\x20','error','\x20\x20Knowledge\x20Base\x20\x22','action','\x20--profile\x20','Output:\x20','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','agent.yml','No\x20tdx.json\x20found\x20in\x20','message','diff','99QpMBlq','\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'];a4_0x234c=function(){return _0x31fd51;};return a4_0x234c();}export class AgentCloneCommand extends BaseCommand{['name']='agent:clone';[a4_0x2af299(0xe2)]=a4_0x2af299(0xd2);async[a4_0x2af299(0xfd)](_0x276078){const _0x139afb=a4_0x2af299,{options:_0x5d9229,args:_0x24231b,tdx:_0x5a15a4}=_0x276078,_0x3bf156=_0x24231b[0x0],_0x17109e=_0x5d9229['name'],_0x3a4cbf=_0x5d9229['dryRun'],_0x554405=_0x5d9229[_0x139afb(0xec)],_0x163098=_0x5d9229[_0x139afb(0xbb)],_0x25eeca=_0x5d9229['llmProject'];let _0x2f352b;const _0x532b02=findAgentConfigPath(process[_0x139afb(0xa5)]());if(_0x3bf156){const _0x540b4a=a4_0x1e8bb5[_0x139afb(0xb7)](_0x3bf156,_0x139afb(0xb5));existsSync(_0x540b4a)?(_0x2f352b=_0x3bf156,console[_0x139afb(0x118)](a4_0x30f3fc[_0x139afb(0x88)](_0x139afb(0xd4)+_0x3bf156))):_0x2f352b=_0x3bf156;}else{if(_0x532b02)_0x2f352b=a4_0x1e8bb5[_0x139afb(0x12c)](_0x532b02),console[_0x139afb(0x118)](a4_0x30f3fc[_0x139afb(0x88)](_0x139afb(0x11d)+_0x2f352b));else{if(_0x25eeca){const _0x223ceb=sanitizeForFilesystem(_0x25eeca);let _0x29367e=_0x223ceb,_0x3528a1=a4_0x1e8bb5[_0x139afb(0xb7)](process['cwd'](),_0x139afb(0x82),_0x223ceb,_0x139afb(0xb5));if(!existsSync(_0x3528a1)){const _0x391ea5=normalizeName(_0x25eeca),_0x5a4095=a4_0x1e8bb5[_0x139afb(0xb7)](process[_0x139afb(0xa5)](),_0x139afb(0x82),_0x391ea5,_0x139afb(0xb5));existsSync(_0x5a4095)&&(_0x29367e=_0x391ea5,_0x3528a1=_0x5a4095);}if(existsSync(_0x3528a1))_0x2f352b=a4_0x1e8bb5['dirname'](_0x3528a1),console[_0x139afb(0x118)](a4_0x30f3fc['dim'](_0x139afb(0xd4)+_0x2f352b));else{const _0x3fce93=_0x5d9229[_0x139afb(0xda)];if(_0x3fce93)throw new SDKError(ErrorCode[_0x139afb(0xa3)],_0x139afb(0xf5)+_0x25eeca+_0x139afb(0xc4),undefined,{'helpText':'When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a'+_0x139afb(0x110)+('\x20\x20tdx\x20agent\x20pull\x20'+_0x25eeca+'\x0a')+(_0x139afb(0xc6)+_0x29367e+'\x20--name\x20'+(_0x17109e||'<new-name>')+_0x139afb(0x97)+_0x3fce93)});_0x2f352b=_0x25eeca,console['log'](a4_0x30f3fc[_0x139afb(0x88)](_0x139afb(0x105)+_0x25eeca));}}}}if(!_0x2f352b)return console[_0x139afb(0x118)](a4_0x30f3fc[_0x139afb(0xe4)]('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x139afb(0x118)](_0x139afb(0x90)),console[_0x139afb(0x118)](_0x139afb(0x132)),console[_0x139afb(0x118)](_0x139afb(0xba)),console[_0x139afb(0x118)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x17109e)throw new SDKError(ErrorCode[_0x139afb(0xa0)],_0x139afb(0xa4),undefined,{'helpText':_0x139afb(0xae)});if(!_0x554405&&!_0x3a4cbf){if(!isInteractive())return console['error'](a4_0x30f3fc[_0x139afb(0xf9)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x139afb(0x94)](a4_0x30f3fc[_0x139afb(0x88)](_0x139afb(0x121))),0x1;const _0x93efd3=await confirmKey('Clone\x20\x22'+_0x2f352b+_0x139afb(0xfc)+_0x17109e+'\x22?');if(!_0x93efd3)return console[_0x139afb(0x118)](a4_0x30f3fc['yellow'](_0x139afb(0x87))),0x1;}const {data:_0x59a3a9}=await withSpinner(_0x139afb(0xe7)+_0x2f352b+_0x139afb(0xd1)+_0x17109e+'\x22...',()=>_0x5a15a4[_0x139afb(0x129)]['cloneProject'](_0x2f352b,_0x17109e,{'dryRun':_0x3a4cbf}));if(_0x3a4cbf){console['log'](a4_0x30f3fc['yellow'](_0x139afb(0x136))),console[_0x139afb(0x118)](_0x139afb(0x10f)+_0x59a3a9['sourceProjectName']),console[_0x139afb(0x118)]('New\x20project:\x20'+_0x17109e),console[_0x139afb(0x118)]('Would\x20clone:'),console['log'](_0x139afb(0xe6)+_0x59a3a9[_0x139afb(0x108)]['agents']['created']),console[_0x139afb(0x118)](_0x139afb(0xa1)+_0x59a3a9[_0x139afb(0x108)][_0x139afb(0x112)][_0x139afb(0xc7)]),console[_0x139afb(0x118)](_0x139afb(0x7f)+_0x59a3a9[_0x139afb(0x108)][_0x139afb(0xe0)][_0x139afb(0xc7)]),console[_0x139afb(0x118)]('\x20\x20Form\x20Interfaces:\x20'+_0x59a3a9['counts'][_0x139afb(0x83)][_0x139afb(0xc7)]),console[_0x139afb(0x118)](_0x139afb(0x7c)+_0x59a3a9[_0x139afb(0x108)][_0x139afb(0x8d)][_0x139afb(0xc7)]);const _0x597b5c=_0x59a3a9[_0x139afb(0x108)][_0x139afb(0x11b)]['created']>0x0||_0x59a3a9[_0x139afb(0x108)][_0x139afb(0x10a)]['created']>0x0;return _0x597b5c&&(console[_0x139afb(0x118)](_0x139afb(0x99)+_0x59a3a9['counts']['experimentalKnowledgeBases']['created']),console[_0x139afb(0x118)](_0x139afb(0x102)+_0x59a3a9['counts'][_0x139afb(0x10a)][_0x139afb(0xc7)])),0x0;}const _0x23d456=_0x59a3a9[_0x139afb(0x108)][_0x139afb(0x82)][_0x139afb(0xe5)]>0x0||_0x59a3a9['counts'][_0x139afb(0x112)][_0x139afb(0xe5)]>0x0||_0x59a3a9['counts'][_0x139afb(0xe0)][_0x139afb(0xe5)]>0x0||_0x59a3a9[_0x139afb(0x108)][_0x139afb(0x83)]['errors']>0x0||_0x59a3a9[_0x139afb(0x108)][_0x139afb(0x8d)][_0x139afb(0xe5)]>0x0||_0x59a3a9[_0x139afb(0x108)][_0x139afb(0x11b)][_0x139afb(0xe5)]>0x0||_0x59a3a9['counts']['experimentalArtifacts'][_0x139afb(0xe5)]>0x0;_0x23d456?console[_0x139afb(0x118)](a4_0x30f3fc[_0x139afb(0xe4)](_0x139afb(0xeb))):console[_0x139afb(0x118)](a4_0x30f3fc[_0x139afb(0xea)](_0x139afb(0xee)));console[_0x139afb(0x118)](_0x139afb(0x10f)+_0x59a3a9[_0x139afb(0xd0)]),console[_0x139afb(0x118)]('New\x20project:\x20'+_0x59a3a9[_0x139afb(0xb3)]),console['log'](_0x139afb(0x133)+_0x59a3a9[_0x139afb(0x131)]),console[_0x139afb(0x118)](),console[_0x139afb(0x118)](_0x139afb(0xcb)),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x59a3a9[_0x139afb(0x108)][_0x139afb(0x82)])),console[_0x139afb(0x118)](_0x139afb(0xa1)+formatCountSummary(_0x59a3a9['counts'][_0x139afb(0x112)])),console[_0x139afb(0x118)](_0x139afb(0x7f)+formatCountSummary(_0x59a3a9[_0x139afb(0x108)][_0x139afb(0xe0)])),console[_0x139afb(0x118)](_0x139afb(0xf3)+formatCountSummary(_0x59a3a9[_0x139afb(0x108)][_0x139afb(0x8b)])),console[_0x139afb(0x118)](_0x139afb(0xc9)+formatCountSummary(_0x59a3a9[_0x139afb(0x108)][_0x139afb(0x83)])),console[_0x139afb(0x118)](_0x139afb(0x7c)+formatCountSummary(_0x59a3a9['counts'][_0x139afb(0x8d)]));const _0x2195fd=_0x59a3a9[_0x139afb(0x108)]['experimentalKnowledgeBases']['created']>0x0||_0x59a3a9[_0x139afb(0x108)][_0x139afb(0x11b)][_0x139afb(0x8f)]>0x0||_0x59a3a9[_0x139afb(0x108)]['experimentalKnowledgeBases'][_0x139afb(0x100)]>0x0||_0x59a3a9[_0x139afb(0x108)][_0x139afb(0x10a)][_0x139afb(0xc7)]>0x0||_0x59a3a9[_0x139afb(0x108)][_0x139afb(0x10a)]['updated']>0x0||_0x59a3a9['counts']['experimentalArtifacts'][_0x139afb(0x100)]>0x0;_0x2195fd&&(console[_0x139afb(0x118)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x59a3a9[_0x139afb(0x108)]['experimentalKnowledgeBases'])),console['log'](_0x139afb(0x102)+formatCountSummary(_0x59a3a9[_0x139afb(0x108)][_0x139afb(0x10a)])));if(_0x23d456){console[_0x139afb(0x118)](),console[_0x139afb(0x118)](a4_0x30f3fc[_0x139afb(0xf9)](_0x139afb(0xd6)));for(const _0xc70b82 of _0x59a3a9['agents']){_0xc70b82['action']===_0x139afb(0x94)&&console[_0x139afb(0x118)](a4_0x30f3fc['red'](_0x139afb(0xa8)+_0xc70b82['agentName']+_0x139afb(0xcd)+_0xc70b82[_0x139afb(0x94)]));}for(const _0x566e1c of _0x59a3a9[_0x139afb(0x112)]){_0x566e1c[_0x139afb(0x96)]===_0x139afb(0x94)&&console[_0x139afb(0x118)](a4_0x30f3fc[_0x139afb(0xf9)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x566e1c[_0x139afb(0xdc)]+_0x139afb(0xcd)+_0x566e1c[_0x139afb(0x94)]));}for(const _0x10005b of _0x59a3a9['prompts']){_0x10005b[_0x139afb(0x96)]===_0x139afb(0x94)&&console[_0x139afb(0x118)](a4_0x30f3fc['red'](_0x139afb(0x124)+_0x10005b['name']+_0x139afb(0xcd)+_0x10005b['error']));}for(const _0x3063c1 of _0x59a3a9[_0x139afb(0x8b)]){_0x3063c1[_0x139afb(0x96)]===_0x139afb(0x94)&&console['log'](a4_0x30f3fc[_0x139afb(0xf9)]('\x20\x20Integration\x20\x22'+_0x3063c1[_0x139afb(0xdc)]+_0x139afb(0xcd)+_0x3063c1[_0x139afb(0x94)]));}for(const _0x302560 of _0x59a3a9[_0x139afb(0x83)]){_0x302560[_0x139afb(0x96)]===_0x139afb(0x94)&&console['log'](a4_0x30f3fc[_0x139afb(0xf9)](_0x139afb(0x8e)+_0x302560[_0x139afb(0xdc)]+_0x139afb(0xcd)+_0x302560['error']));}for(const _0x3582db of _0x59a3a9['chatInterfaces']){_0x3582db[_0x139afb(0x96)]===_0x139afb(0x94)&&console['log'](a4_0x30f3fc[_0x139afb(0xf9)](_0x139afb(0xe8)+_0x3582db[_0x139afb(0xdc)]+'\x22:\x20'+_0x3582db['error']));}for(const _0x171e84 of _0x59a3a9[_0x139afb(0x11b)]){_0x171e84[_0x139afb(0x96)]===_0x139afb(0x94)&&console['log'](a4_0x30f3fc[_0x139afb(0xf9)](_0x139afb(0x12f)+_0x171e84[_0x139afb(0xdc)]+_0x139afb(0xcd)+_0x171e84[_0x139afb(0x94)]));}for(const _0x4a4f65 of _0x59a3a9[_0x139afb(0x10a)]){_0x4a4f65[_0x139afb(0x96)]===_0x139afb(0x94)&&console[_0x139afb(0x118)](a4_0x30f3fc[_0x139afb(0xf9)]('\x20\x20Experimental\x20Artifact\x20\x22'+_0x4a4f65[_0x139afb(0xdc)]+'\x22:\x20'+_0x4a4f65['error']));}return 0x1;}console[_0x139afb(0x118)]();const _0x2f1583=getLLMProjectUrl(_0x163098,_0x59a3a9[_0x139afb(0x131)]);return console[_0x139afb(0x118)](_0x139afb(0x8a)+a4_0x30f3fc[_0x139afb(0x120)](_0x2f1583)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x2af299(0xdc)]=a4_0x2af299(0xad);[a4_0x2af299(0xe2)]=a4_0x2af299(0x107);async[a4_0x2af299(0xfd)](_0x4aa342){const _0x1f9f93=a4_0x2af299,{options:_0x399294,args:_0x15e89f,tdx:_0x422fa3}=_0x4aa342;let _0x2fbd19=_0x15e89f[0x0]||process['cwd']();const _0x4fcec0=_0x399294[_0x1f9f93(0xa7)],_0x5ad3d6=_0x399294[_0x1f9f93(0xe9)],_0x289760=_0x399294['yes'],_0x37e301=_0x399294['site'],_0x1406fe=a4_0x1e8bb5[_0x1f9f93(0xb7)](_0x2fbd19,_0x1f9f93(0x9a)),_0x3f6317=existsSync(_0x1406fe);if(_0x3f6317){const {data:_0x16edac}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x2fbd19+'\x22...',()=>_0x422fa3[_0x1f9f93(0x129)][_0x1f9f93(0x128)](_0x2fbd19,{'dryRun':_0x4fcec0,'force':_0x5ad3d6}));if(_0x4fcec0)return console[_0x1f9f93(0x118)](a4_0x30f3fc[_0x1f9f93(0xe4)](_0x1f9f93(0x136))),console[_0x1f9f93(0x118)](_0x1f9f93(0x93)+_0x16edac['agentName']),0x0;if(_0x16edac[_0x1f9f93(0x96)]===_0x1f9f93(0x94))return console[_0x1f9f93(0x118)](a4_0x30f3fc[_0x1f9f93(0xf9)](_0x1f9f93(0xc3)+_0x16edac['error'])),0x1;console[_0x1f9f93(0x118)](a4_0x30f3fc['green'](_0x1f9f93(0xcc)+_0x16edac[_0x1f9f93(0x96)]+'\x20successfully')),console[_0x1f9f93(0x118)]('Agent:\x20'+_0x16edac[_0x1f9f93(0xaa)]);if(_0x16edac[_0x1f9f93(0x109)]&&_0x16edac[_0x1f9f93(0x7d)]){const _0x136d14=getLLMAgentChatUrl(_0x37e301,_0x16edac[_0x1f9f93(0x7d)],_0x16edac['agentId']);console[_0x1f9f93(0x118)]('Chat:\x20'+a4_0x30f3fc[_0x1f9f93(0x120)](_0x136d14));}return 0x0;}const _0x3daf1f=_0x399294[_0x1f9f93(0x12a)],_0x5a1839=resolveProjectFromContext(_0x2fbd19,_0x3daf1f);if(_0x5a1839[_0x1f9f93(0x114)])_0x2fbd19=_0x5a1839[_0x1f9f93(0xff)],_0x5a1839[_0x1f9f93(0x117)]===_0x1f9f93(0x85)&&console[_0x1f9f93(0x118)](a4_0x30f3fc[_0x1f9f93(0x88)](_0x1f9f93(0xcf)+_0x2fbd19));else{let _0x4b07d6='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x5a1839[_0x1f9f93(0x10b)]===_0x1f9f93(0xbc)&&(_0x4b07d6=_0x5a1839[_0x1f9f93(0x9c)]+_0x1f9f93(0x106)+_0x5a1839[_0x1f9f93(0x12a)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode[_0x1f9f93(0xa3)],_0x5a1839[_0x1f9f93(0x10b)]==='no_context'?_0x5a1839[_0x1f9f93(0x9c)]:_0x1f9f93(0x9b)+_0x2fbd19,undefined,{'helpText':_0x4b07d6});}const {data:_0x1ecf82}=await withSpinner(_0x1f9f93(0xac),()=>_0x422fa3[_0x1f9f93(0x129)][_0x1f9f93(0xfa)](_0x2fbd19,{'dryRun':!![]})),_0x265bf6=_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x82)]['errors']>0x0;if(_0x265bf6){console[_0x1f9f93(0x118)](a4_0x30f3fc[_0x1f9f93(0xf9)](_0x1f9f93(0xbe)));for(const _0x39e21a of _0x1ecf82[_0x1f9f93(0x82)]){_0x39e21a[_0x1f9f93(0x96)]===_0x1f9f93(0x94)&&console[_0x1f9f93(0x118)](a4_0x30f3fc[_0x1f9f93(0xf9)](_0x1f9f93(0xa8)+_0x39e21a['agentName']+'\x22:\x20'+_0x39e21a[_0x1f9f93(0x94)]));}return 0x1;}const _0x586465=_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x82)]['created']+_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x112)][_0x1f9f93(0xc7)]+_0x1ecf82[_0x1f9f93(0x108)]['textKnowledgeBases'][_0x1f9f93(0xc7)]+_0x1ecf82[_0x1f9f93(0x108)]['prompts']['created']+_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x8b)]['created']+_0x1ecf82['counts'][_0x1f9f93(0x11b)][_0x1f9f93(0xc7)]+_0x1ecf82['counts'][_0x1f9f93(0x10a)]['created']+_0x1ecf82['counts'][_0x1f9f93(0x83)][_0x1f9f93(0xc7)]+_0x1ecf82['counts'][_0x1f9f93(0x8d)]['created'],_0x53372f=_0x1ecf82['counts'][_0x1f9f93(0x82)]['updated']+_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x112)]['updated']+_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0xf2)][_0x1f9f93(0x8f)]+_0x1ecf82['counts'][_0x1f9f93(0xe0)][_0x1f9f93(0x8f)]+_0x1ecf82['counts'][_0x1f9f93(0x8b)][_0x1f9f93(0x8f)]+_0x1ecf82['counts'][_0x1f9f93(0x11b)][_0x1f9f93(0x8f)]+_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x10a)]['updated']+_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x83)]['updated']+_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x8d)][_0x1f9f93(0x8f)],_0x47650c=_0x1ecf82['counts'][_0x1f9f93(0x82)]['unchanged']+_0x1ecf82['counts'][_0x1f9f93(0x112)][_0x1f9f93(0x100)]+_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0xf2)][_0x1f9f93(0x100)]+_0x1ecf82['counts']['prompts'][_0x1f9f93(0x100)]+_0x1ecf82['counts'][_0x1f9f93(0x8b)]['unchanged']+_0x1ecf82[_0x1f9f93(0x108)]['experimentalKnowledgeBases'][_0x1f9f93(0x100)]+_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x10a)][_0x1f9f93(0x100)]+_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x83)]['unchanged']+_0x1ecf82[_0x1f9f93(0x108)]['chatInterfaces'][_0x1f9f93(0x100)];console[_0x1f9f93(0x118)](_0x1f9f93(0xb1)+_0x1ecf82[_0x1f9f93(0x91)]+'\x27:'),console[_0x1f9f93(0x118)]('\x20\x20'+a4_0x30f3fc[_0x1f9f93(0xea)]('+\x20'+_0x586465+'\x20new')+'\x20|\x20'+a4_0x30f3fc[_0x1f9f93(0xe4)]('~\x20'+_0x53372f+_0x1f9f93(0xdf))+'\x20|\x20'+a4_0x30f3fc[_0x1f9f93(0x88)]('=\x20'+_0x47650c+'\x20unchanged')),console[_0x1f9f93(0x118)](_0x1f9f93(0xe6)+formatCountSummary(_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x82)])),console['log'](_0x1f9f93(0xa1)+formatCountSummary(_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x112)])),console[_0x1f9f93(0x118)](_0x1f9f93(0xa9)+formatCountSummary(_0x1ecf82['counts'][_0x1f9f93(0xf2)])),console[_0x1f9f93(0x118)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x1ecf82['counts'][_0x1f9f93(0xe0)])),console[_0x1f9f93(0x118)](_0x1f9f93(0xf3)+formatCountSummary(_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x8b)])),console[_0x1f9f93(0x118)](_0x1f9f93(0xc9)+formatCountSummary(_0x1ecf82['counts']['formInterfaces'])),console[_0x1f9f93(0x118)](_0x1f9f93(0x7c)+formatCountSummary(_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x8d)]));const _0x1c4b20=_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x11b)][_0x1f9f93(0xc7)]>0x0||_0x1ecf82[_0x1f9f93(0x108)]['experimentalKnowledgeBases']['updated']>0x0||_0x1ecf82[_0x1f9f93(0x108)]['experimentalKnowledgeBases'][_0x1f9f93(0x100)]>0x0||_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x10a)][_0x1f9f93(0xc7)]>0x0||_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x10a)][_0x1f9f93(0x8f)]>0x0||_0x1ecf82['counts'][_0x1f9f93(0x10a)][_0x1f9f93(0x100)]>0x0;_0x1c4b20&&(console[_0x1f9f93(0x118)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x1ecf82[_0x1f9f93(0x108)]['experimentalKnowledgeBases'])),console[_0x1f9f93(0x118)](_0x1f9f93(0x102)+formatCountSummary(_0x1ecf82[_0x1f9f93(0x108)][_0x1f9f93(0x10a)])));console[_0x1f9f93(0x118)]('\x20\x20Source:\x20'+a4_0x30f3fc[_0x1f9f93(0x120)](_0x2fbd19)),displayDiffs(_0x1ecf82[_0x1f9f93(0x82)],_0x1ecf82['knowledgeBases'],_0x1ecf82[_0x1f9f93(0xf2)],_0x1ecf82[_0x1f9f93(0xe0)],_0x1ecf82[_0x1f9f93(0x8b)],_0x1ecf82[_0x1f9f93(0x11b)],_0x1ecf82[_0x1f9f93(0x10a)],_0x1ecf82[_0x1f9f93(0x83)],_0x1ecf82['chatInterfaces']);if(_0x4fcec0)return console['log'](a4_0x30f3fc[_0x1f9f93(0xe4)](_0x1f9f93(0xbd))),0x0;if(_0x586465===0x0&&_0x53372f===0x0){console[_0x1f9f93(0x118)](a4_0x30f3fc[_0x1f9f93(0xea)](_0x1f9f93(0x11c)));const _0x5559c6=getLLMProjectUrl(_0x37e301,_0x1ecf82['projectId']);return console[_0x1f9f93(0x118)](_0x1f9f93(0x8a)+a4_0x30f3fc[_0x1f9f93(0x120)](_0x5559c6)),0x0;}if(!_0x289760&&!_0x5ad3d6){if(!isInteractive())return console[_0x1f9f93(0x94)](a4_0x30f3fc['red']('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x1f9f93(0x94)](a4_0x30f3fc[_0x1f9f93(0x88)](_0x1f9f93(0x121))),0x1;const _0x8a14d9=await confirmKey(_0x1f9f93(0x80)+(_0x586465+_0x53372f)+'\x20resources?');if(!_0x8a14d9)return console['log'](a4_0x30f3fc[_0x1f9f93(0xe4)](_0x1f9f93(0x87)),'-\x20nothing\x20pushed'),0x1;}const {data:_0x3618fb}=await withSpinner(_0x1f9f93(0xd9),()=>_0x422fa3['llm']['pushProject'](_0x2fbd19,{'force':_0x5ad3d6})),_0x304928=_0x3618fb[_0x1f9f93(0x108)][_0x1f9f93(0x82)][_0x1f9f93(0xe5)]>0x0||_0x3618fb[_0x1f9f93(0x108)]['knowledgeBases']['errors']>0x0||_0x3618fb['counts']['textKnowledgeBases'][_0x1f9f93(0xe5)]>0x0||_0x3618fb[_0x1f9f93(0x108)][_0x1f9f93(0xe0)][_0x1f9f93(0xe5)]>0x0||_0x3618fb[_0x1f9f93(0x108)][_0x1f9f93(0x83)][_0x1f9f93(0xe5)]>0x0||_0x3618fb['counts'][_0x1f9f93(0x8d)]['errors']>0x0;if(_0x304928){console[_0x1f9f93(0x118)](a4_0x30f3fc['yellow'](_0x1f9f93(0x84))),console[_0x1f9f93(0x118)](),console[_0x1f9f93(0x118)](a4_0x30f3fc[_0x1f9f93(0xf9)](_0x1f9f93(0xd6)));for(const _0x3cba6d of _0x3618fb[_0x1f9f93(0x82)]){_0x3cba6d['action']==='error'&&console[_0x1f9f93(0x118)](a4_0x30f3fc[_0x1f9f93(0xf9)](_0x1f9f93(0xa8)+_0x3cba6d[_0x1f9f93(0xaa)]+_0x1f9f93(0xcd)+_0x3cba6d['error']));}for(const _0x3dd7b2 of _0x3618fb[_0x1f9f93(0x112)]){_0x3dd7b2[_0x1f9f93(0x96)]===_0x1f9f93(0x94)&&console['log'](a4_0x30f3fc[_0x1f9f93(0xf9)](_0x1f9f93(0x95)+_0x3dd7b2[_0x1f9f93(0xdc)]+'\x22:\x20'+_0x3dd7b2['error']));}for(const _0x4de6d9 of _0x3618fb[_0x1f9f93(0xf2)]){_0x4de6d9[_0x1f9f93(0x96)]===_0x1f9f93(0x94)&&console['log'](a4_0x30f3fc[_0x1f9f93(0xf9)](_0x1f9f93(0xf1)+_0x4de6d9[_0x1f9f93(0xdc)]+_0x1f9f93(0xcd)+_0x4de6d9[_0x1f9f93(0x94)]));}for(const _0x4548b7 of _0x3618fb[_0x1f9f93(0xe0)]){_0x4548b7[_0x1f9f93(0x96)]==='error'&&console[_0x1f9f93(0x118)](a4_0x30f3fc[_0x1f9f93(0xf9)](_0x1f9f93(0x124)+_0x4548b7[_0x1f9f93(0xdc)]+_0x1f9f93(0xcd)+_0x4548b7[_0x1f9f93(0x94)]));}for(const _0x41762e of _0x3618fb['integrations']){_0x41762e[_0x1f9f93(0x96)]==='error'&&console[_0x1f9f93(0x118)](a4_0x30f3fc[_0x1f9f93(0xf9)]('\x20\x20Integration\x20\x22'+_0x41762e[_0x1f9f93(0xdc)]+_0x1f9f93(0xcd)+_0x41762e[_0x1f9f93(0x94)]));}for(const _0x17ffcb of _0x3618fb[_0x1f9f93(0x83)]){_0x17ffcb[_0x1f9f93(0x96)]===_0x1f9f93(0x94)&&console[_0x1f9f93(0x118)](a4_0x30f3fc[_0x1f9f93(0xf9)](_0x1f9f93(0x8e)+_0x17ffcb[_0x1f9f93(0xdc)]+_0x1f9f93(0xcd)+_0x17ffcb[_0x1f9f93(0x94)]));}for(const _0x5ac351 of _0x3618fb[_0x1f9f93(0x8d)]){_0x5ac351[_0x1f9f93(0x96)]===_0x1f9f93(0x94)&&console[_0x1f9f93(0x118)](a4_0x30f3fc[_0x1f9f93(0xf9)](_0x1f9f93(0xe8)+_0x5ac351['name']+_0x1f9f93(0xcd)+_0x5ac351[_0x1f9f93(0x94)]));}return 0x1;}console[_0x1f9f93(0x118)](a4_0x30f3fc[_0x1f9f93(0xea)](_0x1f9f93(0xab)+(_0x586465+_0x53372f)+_0x1f9f93(0xaf)+_0x3618fb[_0x1f9f93(0x91)]+'\x27'));const _0x560038=getLLMProjectUrl(_0x37e301,_0x3618fb[_0x1f9f93(0x7d)]);return console['log'](_0x1f9f93(0x8a)+a4_0x30f3fc[_0x1f9f93(0x120)](_0x560038)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x5b6d8f=a5_0x1ded;(function(_0x28107c,_0x1f961c){const _0x425a76=a5_0x1ded,_0x45c155=_0x28107c();while(!![]){try{const _0x5507e0=-parseInt(_0x425a76(0xc9))/0x1*(-parseInt(_0x425a76(0xba))/0x2)+parseInt(_0x425a76(0xc8))/0x3*(parseInt(_0x425a76(0x115))/0x4)+parseInt(_0x425a76(0x8b))/0x5*(-parseInt(_0x425a76(0xa4))/0x6)+parseInt(_0x425a76(0x117))/0x7+parseInt(_0x425a76(0x96))/0x8*(parseInt(_0x425a76(0x11a))/0x9)+parseInt(_0x425a76(0x120))/0xa*(parseInt(_0x425a76(0x10a))/0xb)+parseInt(_0x425a76(0x98))/0xc*(-parseInt(_0x425a76(0x8a))/0xd);if(_0x5507e0===_0x1f961c)break;else _0x45c155['push'](_0x45c155['shift']());}catch(_0x3dbb51){_0x45c155['push'](_0x45c155['shift']());}}}(a5_0x2ac0,0xaba09));import*as a5_0x5bcefb from'node:fs';import*as a5_0x2ccfb9 from'node:path';import a5_0x4009f2 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';function a5_0x1ded(_0x3b9a43,_0x1f64ba){_0x3b9a43=_0x3b9a43-0x89;const _0x2ac049=a5_0x2ac0();let _0x1ded97=_0x2ac049[_0x3b9a43];return _0x1ded97;}function a5_0x2ac0(){const _0x42e94d=['/<agent-name>','\x20\x20Site:\x20','Errors:\x20\x20\x20','agent','find','\x22:\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','reason','execute','Tests\x20found:\x20','toLowerCase','timestamp','Failed\x20Tests:','Using\x20agent:\x20','json','status','\x20\x20Round\x20','\x20\x20Agent:\x20','Test\x20Configuration:','\x20\x20Conversation:\x20','name','✗\x20FAIL:\x20','resolve','tags','tests','text','no_context','isSpinning','filter','Passed:\x20\x20\x20','Output\x20written\x20to:\x20','testYmlPath','Conversation\x20URL:\x20','now','FAIL','projectName','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','Executing\x20new\x20tests...','...','length','llm','multiple_agents','yellow','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','table','white','PASS','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','\x20(new)','\x22,\x20but\x20current\x20site\x20is\x20\x22','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','add','repeat','✓\x20PASS:\x20','site','No\x20tests\x20have\x20tags\x20defined.','context','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','Test\x20','11XIqjGT','forEach','llmProject','Failed:\x20\x20\x20','jsonl','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','push','some','\x20\x20Evaluating...\x20','✗\x20ERROR:\x20','includes','3751212QNBpAc','\x20(cached)','9166129sVGFeH','Usage:','conversations','515133HvsWnF','resolveAgentId','executeReeval','Error:\x20No\x20previous\x20test\x20run\x20found.','Duration:\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','10714780hOmSme','cyan','5493449miujTF','26930tgVkJn','dim','rounds','Running\x20test:\x20','testName','\x20-\x20','map','message','trim','Running:\x20','not\x20found','8OzPenm','No\x20tests\x20found\x20with\x20tags:\x20','60Yagema','verbose','utf-8','writeFileSync','red','toISOString','start','agentName','Agent:\x20','Error\x20writing\x20output\x20file:\x20','agentDirs','Run\x20\x27tdx\x20agent\x20pull\x20','804PwKIcu','Evaluating\x20response...','agent:test','projectDir','found','Test\x20Summary','No\x20tests\x20found\x20matching:\x20','no_tests','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','404','Either\x20switch\x20to\x20the\x20\x22','tsv','split','dryRun','Cached\x20run\x20from:\x20','existsSync','Total:\x20\x20\x20\x20',':\x20Sending\x20user\x20input...','stop','Available\x20tags:\x20','ERROR','test.yml','46174WYekLL','no_local_folder','⚠\x20SKIPPED:\x20','join','\x27\x20to\x20create\x20the\x20folder\x20structure.','conversation_url','New\x20tests\x20to\x20execute:\x20','resolveProjectId','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','round','size','green','...\x20','\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','3aConSz','7rkMdfu','eval','log','Round\x20','source'];a5_0x2ac0=function(){return _0x42e94d;};return a5_0x2ac0();}export class AgentTestCommand extends BaseCommand{[a5_0x5b6d8f(0xe2)]=a5_0x5b6d8f(0xa6);['description']='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x5b6d8f(0xd6)](_0x474e01){const _0x3ce479=a5_0x5b6d8f,{options:_0x4ad89d,args:_0x4e81e3,tdx:_0xdb0621}=_0x474e01,_0x363703=_0x4e81e3[0x0]||'.',_0x2fe113=_0x4ad89d[_0x3ce479(0xb1)],_0xa1f0ea=_0x4ad89d,_0x13acc8=_0xa1f0ea[_0x3ce479(0xca)]===![],_0x7a5d43=_0xa1f0ea['reeval'],_0x41a81d=_0xa1f0ea['name'],_0x27a48c=_0xa1f0ea[_0x3ce479(0xe5)],_0x20035b=_0x4ad89d['site'],_0x30cf12=_0xa1f0ea['output'];if(_0x7a5d43&&_0x13acc8)return console[_0x3ce479(0xcb)](a5_0x4009f2[_0x3ce479(0x9c)](_0x3ce479(0x10f))),0x1;let _0x357389='table';if(_0xa1f0ea[_0x3ce479(0xdc)])_0x357389='json';else{if(_0xa1f0ea[_0x3ce479(0x10e)])_0x357389='jsonl';else{if(_0xa1f0ea[_0x3ce479(0xaf)])_0x357389=_0x3ce479(0xaf);else{if(_0xa1f0ea[_0x3ce479(0xfb)])_0x357389=_0x3ce479(0xfb);}}}const _0x14db5d=_0xa1f0ea['llmProject'];let _0x4fc4c6=_0x363703;const _0x36af5a=a5_0x5bcefb[_0x3ce479(0xb3)](_0x363703),_0x3e16a0=_0x363703==='.';if(!_0x36af5a||_0x3e16a0){const _0x20e6c5=resolveProjectFromContext(_0x363703,_0x14db5d,{'requireFile':_0x3ce479(0xb9)});if(_0x20e6c5[_0x3ce479(0xa8)])_0x4fc4c6=_0x20e6c5[_0x3ce479(0xa7)],_0x20e6c5[_0x3ce479(0xcd)]===_0x3ce479(0x107)&&console['log'](a5_0x4009f2[_0x3ce479(0x8c)](_0x3ce479(0xdb)+_0x4fc4c6));else switch(_0x20e6c5[_0x3ce479(0xd5)]){case _0x3ce479(0xe8):console[_0x3ce479(0xcb)](a5_0x4009f2[_0x3ce479(0xf8)](_0x20e6c5[_0x3ce479(0x92)])),console[_0x3ce479(0xcb)](),console[_0x3ce479(0xcb)](_0x3ce479(0x118)),console[_0x3ce479(0xcb)](_0x3ce479(0xc7)),console['log']('\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x3ce479(0xcb)](),console[_0x3ce479(0xcb)]('Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>');return 0x1;case _0x3ce479(0xbb):console['log'](a5_0x4009f2['yellow'](_0x20e6c5[_0x3ce479(0x92)])),console[_0x3ce479(0xcb)](),console['log'](_0x3ce479(0xa3)+_0x20e6c5[_0x3ce479(0x10c)]+_0x3ce479(0xbe));return 0x1;case _0x3ce479(0xf7):{const _0xa13e3d=a5_0x2ccfb9['basename'](_0x20e6c5['projectDir']);console[_0x3ce479(0xcb)](a5_0x4009f2['yellow']('Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22'+_0x20e6c5[_0x3ce479(0x10c)]+'\x22:'));for(const _0x147933 of _0x20e6c5[_0x3ce479(0xa2)]){console[_0x3ce479(0xcb)]('\x20\x20-\x20'+_0x147933);}return console[_0x3ce479(0xcb)](),console[_0x3ce479(0xcb)](_0x3ce479(0xf2)+_0xa13e3d+_0x3ce479(0xce)),0x1;}case _0x3ce479(0xab):console[_0x3ce479(0xcb)](a5_0x4009f2[_0x3ce479(0xf8)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x20e6c5[_0x3ce479(0x10c)]+'\x22.')),console[_0x3ce479(0xcb)](a5_0x4009f2['dim']('Project\x20path:\x20'+_0x20e6c5[_0x3ce479(0xa7)])),console[_0x3ce479(0xcb)](),console[_0x3ce479(0xcb)](_0x3ce479(0xac));return 0x1;}}const {definition:_0x37c4c2,agentInfo:_0x2d851c}=parseTestFile(_0x4fc4c6);let _0x2e1657=_0x37c4c2[_0x3ce479(0xe6)];if(_0x41a81d){const _0x2a946d=_0x41a81d[_0x3ce479(0xb0)](',')[_0x3ce479(0x91)](_0x1ba675=>_0x1ba675[_0x3ce479(0x93)]());_0x2e1657=_0x37c4c2['tests'][_0x3ce479(0xea)](_0x32c572=>_0x2a946d[_0x3ce479(0x114)](_0x32c572[_0x3ce479(0xe2)]));if(_0x2e1657[_0x3ce479(0xf5)]===0x0)return console[_0x3ce479(0xcb)](a5_0x4009f2[_0x3ce479(0xf8)](_0x3ce479(0xaa)+_0x41a81d)),console[_0x3ce479(0xcb)](a5_0x4009f2[_0x3ce479(0x8c)]('Available\x20tests:\x20'+_0x37c4c2[_0x3ce479(0xe6)]['map'](_0x261d87=>_0x261d87[_0x3ce479(0xe2)])['join'](',\x20'))),0x1;}if(_0x27a48c){const _0x28f3bd=_0x27a48c[_0x3ce479(0xb0)](',')[_0x3ce479(0x91)](_0x3de06d=>_0x3de06d[_0x3ce479(0x93)]()[_0x3ce479(0xd8)]());_0x2e1657=_0x2e1657[_0x3ce479(0xea)](_0x194ffe=>_0x194ffe[_0x3ce479(0xe5)]?.[_0x3ce479(0x111)](_0x52624a=>_0x28f3bd['includes'](_0x52624a['toLowerCase']())));if(_0x2e1657['length']===0x0){console['log'](a5_0x4009f2[_0x3ce479(0xf8)](_0x3ce479(0x97)+_0x27a48c));const _0x433313=new Set();return _0x37c4c2[_0x3ce479(0xe6)][_0x3ce479(0x10b)](_0x1b72d5=>_0x1b72d5['tags']?.[_0x3ce479(0x10b)](_0x3e1f1d=>_0x433313[_0x3ce479(0x102)](_0x3e1f1d))),_0x433313[_0x3ce479(0xc4)]>0x0?console['log'](a5_0x4009f2[_0x3ce479(0x8c)](_0x3ce479(0xb7)+[..._0x433313][_0x3ce479(0xbd)](',\x20'))):console[_0x3ce479(0xcb)](a5_0x4009f2['dim'](_0x3ce479(0x106))),0x1;}}if(_0x7a5d43)return this[_0x3ce479(0x11c)](_0x474e01,{'definition':{'tests':_0x2e1657},'agentInfo':_0x2d851c,'outputFormat':_0x357389,'outputFile':_0x30cf12,'testNames':_0x41a81d});if(_0x2fe113){console[_0x3ce479(0xcb)](a5_0x4009f2['cyan'](_0x3ce479(0xe0))),console[_0x3ce479(0xcb)](_0x3ce479(0xcf)+a5_0x4009f2[_0x3ce479(0xfc)](_0x20035b)),console[_0x3ce479(0xcb)]('\x20\x20Project:\x20'+a5_0x4009f2[_0x3ce479(0xfc)](_0x2d851c[_0x3ce479(0xf1)])),console[_0x3ce479(0xcb)](_0x3ce479(0xdf)+a5_0x4009f2[_0x3ce479(0xfc)](_0x2d851c[_0x3ce479(0x9f)])),console[_0x3ce479(0xcb)](),console[_0x3ce479(0xcb)](_0x3ce479(0xd7)+a5_0x4009f2['white'](_0x2e1657[_0x3ce479(0xf5)]));for(let _0xd512c5=0x0;_0xd512c5<_0x2e1657[_0x3ce479(0xf5)];_0xd512c5++){const _0x2a1213=_0x2e1657[_0xd512c5],_0x655a1e=_0x2a1213[_0x3ce479(0x8d)][_0x3ce479(0xf5)]===0x1?_0x3ce479(0xc3):_0x3ce479(0x8d),_0x4f30a2=_0x2a1213[_0x3ce479(0xe5)]?.[_0x3ce479(0xf5)]?'\x20['+_0x2a1213[_0x3ce479(0xe5)][_0x3ce479(0xbd)](',\x20')+']':'';console['log']('\x20\x20'+(_0xd512c5+0x1)+'.\x20'+a5_0x4009f2['white'](_0x2a1213[_0x3ce479(0xe2)])+'\x20('+_0x2a1213[_0x3ce479(0x8d)][_0x3ce479(0xf5)]+'\x20'+_0x655a1e+')'+a5_0x4009f2[_0x3ce479(0x8c)](_0x4f30a2));}return 0x0;}let _0x295d45,_0x535d10;try{_0x295d45=await _0xdb0621['llm'][_0x3ce479(0xc1)](_0x2d851c['projectName']);}catch(_0x132f95){const _0x17a522=_0x132f95 instanceof Error?_0x132f95[_0x3ce479(0x92)]:String(_0x132f95);return _0x17a522['includes']('404')||_0x17a522[_0x3ce479(0xd8)]()['includes'](_0x3ce479(0x95))?console['log'](a5_0x4009f2['red'](_0x3ce479(0x11f)+_0x2d851c[_0x3ce479(0xf1)])):console[_0x3ce479(0xcb)](a5_0x4009f2[_0x3ce479(0x9c)](_0x3ce479(0xfe)+_0x2d851c['projectName']+'\x22:\x20'+_0x17a522)),0x1;}try{_0x535d10=await _0xdb0621[_0x3ce479(0xf6)][_0x3ce479(0x11b)](_0x2d851c[_0x3ce479(0x9f)],_0x295d45);}catch(_0x8ee2c6){const _0x287c16=_0x8ee2c6 instanceof Error?_0x8ee2c6[_0x3ce479(0x92)]:String(_0x8ee2c6);return _0x287c16['includes'](_0x3ce479(0xad))||_0x287c16[_0x3ce479(0xd8)]()[_0x3ce479(0x114)](_0x3ce479(0x95))?console[_0x3ce479(0xcb)](a5_0x4009f2[_0x3ce479(0x9c)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x2d851c['agentName'])):console[_0x3ce479(0xcb)](a5_0x4009f2['red']('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x2d851c[_0x3ce479(0x9f)]+_0x3ce479(0xd3)+_0x287c16)),0x1;}let _0x52e5fd;if(!_0x13acc8)try{_0x52e5fd=await setupEvaluatorAgent(_0xdb0621[_0x3ce479(0xf6)],_0x4ad89d[_0x3ce479(0x99)]);}catch(_0x21b568){const _0x3601ef=_0x21b568 instanceof Error?_0x21b568['message']:String(_0x21b568);return console[_0x3ce479(0xcb)](a5_0x4009f2['red'](_0x3ce479(0xd4)+_0x3601ef)),0x1;}console[_0x3ce479(0xcb)](a5_0x4009f2[_0x3ce479(0x89)]('Running\x20agent\x20tests...')),console['log']('Site:\x20'+a5_0x4009f2[_0x3ce479(0xfc)](_0x20035b)),console[_0x3ce479(0xcb)]('Agent:\x20'+a5_0x4009f2[_0x3ce479(0xfc)](_0x2d851c['projectName']+'/'+_0x2d851c[_0x3ce479(0x9f)])),console[_0x3ce479(0xcb)]();const _0x3454c2=[],_0x21d52c=[],_0x4e4d7b=Date['now']();for(let _0x1baf5b=0x0;_0x1baf5b<_0x2e1657[_0x3ce479(0xf5)];_0x1baf5b++){const _0x13fa2e=_0x2e1657[_0x1baf5b];_0x2e1657[_0x3ce479(0xf5)]>0x1?console[_0x3ce479(0xcb)](_0x3ce479(0x109)+(_0x1baf5b+0x1)+'/'+_0x2e1657['length']+':\x20'+a5_0x4009f2[_0x3ce479(0xfc)](_0x13fa2e['name'])):console[_0x3ce479(0xcb)](_0x3ce479(0x8e)+a5_0x4009f2[_0x3ce479(0xfc)](_0x13fa2e['name']));const _0x409bf2=createCommandSpinner('Round\x201/'+_0x13fa2e[_0x3ce479(0x8d)][_0x3ce479(0xf5)]+_0x3ce479(0xb5));_0x409bf2['start']();try{const {result:_0x4ba862,conversation:_0x5802fe}=await runTest(_0xdb0621[_0x3ce479(0xf6)],_0x13fa2e,{'agentId':_0x535d10,'projectId':_0x295d45,'site':_0x20035b,'noEval':_0x13acc8,'evaluatorId':_0x52e5fd,'onRoundStart':(_0x5b3b51,_0x15e6f5)=>{const _0x5cf059=_0x3ce479;_0x409bf2[_0x5cf059(0xe7)]=_0x5cf059(0xcc)+(_0x5b3b51+0x1)+'/'+_0x15e6f5+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x24fe83,_0x2aab43,_0x402980)=>{const _0x4d7a56=_0x3ce479,_0x1b8f3f=formatElapsed(_0x2aab43);_0x402980?console['log']('\x20\x20Round\x20'+(_0x24fe83+0x1)+'/'+_0x13fa2e[_0x4d7a56(0x8d)]['length']+'...\x20'+a5_0x4009f2[_0x4d7a56(0xc5)]('✓')+'\x20('+_0x1b8f3f+')'):console[_0x4d7a56(0xcb)](_0x4d7a56(0xde)+(_0x24fe83+0x1)+'/'+_0x13fa2e['rounds'][_0x4d7a56(0xf5)]+'...\x20'+a5_0x4009f2['red']('✗'));},'onEvaluationStart':()=>{const _0x4a4e9f=_0x3ce479;_0x409bf2['text']=_0x4a4e9f(0xa5);},'onEvaluationComplete':_0x2e80e2=>{const _0x3b2bc3=_0x3ce479,_0x15b387=formatElapsed(_0x2e80e2);console[_0x3b2bc3(0xcb)]('\x20\x20Evaluating...\x20'+a5_0x4009f2['green']('✓')+'\x20('+_0x15b387+')');}});_0x409bf2['stop'](),_0x3454c2[_0x3ce479(0x110)](_0x4ba862),_0x21d52c['push'](_0x5802fe);if(_0x4ba862[_0x3ce479(0xdd)]==='PASS')console[_0x3ce479(0xcb)](a5_0x4009f2[_0x3ce479(0xc5)]('✓\x20PASS:\x20'+_0x4ba862[_0x3ce479(0xd5)]));else _0x4ba862['status']===_0x3ce479(0xf0)?console[_0x3ce479(0xcb)](a5_0x4009f2[_0x3ce479(0x9c)](_0x3ce479(0xe3)+_0x4ba862['reason'])):console[_0x3ce479(0xcb)](a5_0x4009f2[_0x3ce479(0x9c)](_0x3ce479(0x113)+_0x4ba862['reason']));_0x4ba862[_0x3ce479(0xbf)]&&console['log'](a5_0x4009f2[_0x3ce479(0x8c)](_0x3ce479(0xee)+_0x4ba862[_0x3ce479(0xbf)])),console['log']();}catch(_0x5a47f6){_0x409bf2[_0x3ce479(0xb6)]();const _0x42f519=_0x5a47f6 instanceof Error?_0x5a47f6[_0x3ce479(0x92)]:String(_0x5a47f6);console[_0x3ce479(0xcb)](a5_0x4009f2[_0x3ce479(0x9c)](_0x3ce479(0x113)+_0x42f519)),console['log'](),_0x3454c2[_0x3ce479(0x110)]({'name':_0x13fa2e[_0x3ce479(0xe2)],'status':'ERROR','reason':_0x42f519,'timestamp':new Date()[_0x3ce479(0x9d)](),'duration_ms':0x0});}}const _0x2e01e4=Date['now']()-_0x4e4d7b,_0x512f38=_0x3454c2[_0x3ce479(0xea)](_0xfce0ab=>_0xfce0ab[_0x3ce479(0xdd)]==='PASS')[_0x3ce479(0xf5)],_0x3f9fd1=_0x3454c2['filter'](_0x3042b3=>_0x3042b3[_0x3ce479(0xdd)]==='FAIL')[_0x3ce479(0xf5)],_0x592198=_0x3454c2[_0x3ce479(0xea)](_0x16e8f4=>_0x16e8f4[_0x3ce479(0xdd)]==='ERROR')[_0x3ce479(0xf5)];console[_0x3ce479(0xcb)]('━'[_0x3ce479(0x103)](0x3c)),console[_0x3ce479(0xcb)](_0x3ce479(0xa9)),console['log']('━'[_0x3ce479(0x103)](0x3c)),console[_0x3ce479(0xcb)](_0x3ce479(0xb4)+_0x3454c2[_0x3ce479(0xf5)]),console[_0x3ce479(0xcb)]('Passed:\x20\x20\x20'+a5_0x4009f2[_0x3ce479(0xc5)](_0x512f38)),console[_0x3ce479(0xcb)](_0x3ce479(0x10d)+a5_0x4009f2[_0x3ce479(0x9c)](_0x3f9fd1));_0x592198>0x0&&console[_0x3ce479(0xcb)](_0x3ce479(0xd0)+a5_0x4009f2[_0x3ce479(0x9c)](_0x592198));console[_0x3ce479(0xcb)](_0x3ce479(0x11e)+formatElapsed(_0x2e01e4)),console[_0x3ce479(0xcb)]('━'[_0x3ce479(0x103)](0x3c));const _0xc3b1bc=_0x3454c2[_0x3ce479(0xea)](_0x49a73f=>_0x49a73f[_0x3ce479(0xdd)]!==_0x3ce479(0xfd));if(_0xc3b1bc[_0x3ce479(0xf5)]>0x0){console[_0x3ce479(0xcb)](),console[_0x3ce479(0xcb)](_0x3ce479(0xda));for(const _0x35c10d of _0xc3b1bc){const _0x166447=a5_0x4009f2[_0x3ce479(0x9c)]('✗'),_0x540ed8=_0x35c10d['reason'][_0x3ce479(0xf5)]>0x32?_0x35c10d[_0x3ce479(0xd5)]['substring'](0x0,0x32)+_0x3ce479(0xf4):_0x35c10d[_0x3ce479(0xd5)];console['log']('\x20\x20'+_0x166447+'\x20'+_0x35c10d[_0x3ce479(0xe2)]+':\x20'+_0x540ed8);}}const _0x6c47f6={'summary':{'total':_0x3454c2[_0x3ce479(0xf5)],'passed':_0x512f38,'failed':_0x3f9fd1,'errors':_0x592198>0x0?_0x592198:undefined,'duration_ms':_0x2e01e4},'tests':_0x3454c2,'agent':{'project':_0x2d851c[_0x3ce479(0xf1)],'name':_0x2d851c['agentName'],'site':_0x20035b},'timestamp':new Date(_0x4e4d7b)[_0x3ce479(0x9d)]()};try{const _0x3712b8=buildCachedTestRun(_0x21d52c,{'site':_0x20035b,'projectId':_0x295d45,'projectName':_0x2d851c[_0x3ce479(0xf1)],'agentId':_0x535d10,'agentName':_0x2d851c['agentName'],'testYmlPath':a5_0x2ccfb9[_0x3ce479(0xe4)](_0x2d851c[_0x3ce479(0xed)])});saveLastTestRun(_0x3712b8);}catch{}if(_0x357389!=='table'||_0x30cf12){const _0x49dde3=formatResults(_0x6c47f6,_0x357389);if(_0x30cf12)try{a5_0x5bcefb[_0x3ce479(0x9b)](_0x30cf12,_0x49dde3,_0x3ce479(0x9a)),console['log'](),console['log'](a5_0x4009f2[_0x3ce479(0x8c)]('Output\x20written\x20to:\x20'+_0x30cf12));}catch(_0x322049){return console['log'](),console[_0x3ce479(0xcb)](a5_0x4009f2[_0x3ce479(0x9c)](_0x3ce479(0xa1)+_0x322049)),0x1;}else console[_0x3ce479(0xcb)](),console[_0x3ce479(0xcb)](_0x49dde3);}return _0xc3b1bc[_0x3ce479(0xf5)]>0x0?0x1:0x0;}async[a5_0x5b6d8f(0x11c)](_0xd335ef,_0x5ef9a2){const _0x1a04c5=a5_0x5b6d8f,{options:_0x4eb49d,tdx:_0x3a7e90}=_0xd335ef,{definition:_0x41ab4a,agentInfo:_0x892651,outputFormat:_0x20458b,outputFile:_0x4663de}=_0x5ef9a2,_0x3aece2=_0x4eb49d[_0x1a04c5(0x105)],_0x41e00c=loadLastTestRun();if(!_0x41e00c)return console[_0x1a04c5(0xcb)](a5_0x4009f2[_0x1a04c5(0x9c)](_0x1a04c5(0x11d))),console[_0x1a04c5(0xcb)](a5_0x4009f2[_0x1a04c5(0x8c)](_0x1a04c5(0xf9))),0x1;if(_0x41e00c[_0x1a04c5(0xd1)][_0x1a04c5(0x9f)]!==_0x892651['agentName'])return console['log'](a5_0x4009f2[_0x1a04c5(0x9c)](_0x1a04c5(0xfa)+_0x41e00c[_0x1a04c5(0xd1)][_0x1a04c5(0x9f)]+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x892651[_0x1a04c5(0x9f)]+'\x22.')),console['log'](a5_0x4009f2['dim'](_0x1a04c5(0xc2))),0x1;const _0x4de11d=new Set(_0x41e00c[_0x1a04c5(0x119)][_0x1a04c5(0x91)](_0x5d3a71=>_0x5d3a71[_0x1a04c5(0x8f)])),_0x1b1cdf=_0x41ab4a['tests'][_0x1a04c5(0xea)](_0x579f28=>!_0x4de11d['has'](_0x579f28['name']));if(_0x1b1cdf['length']>0x0&&_0x41e00c['site']!==_0x3aece2)return console['log'](a5_0x4009f2[_0x1a04c5(0x9c)](_0x1a04c5(0x108))),console[_0x1a04c5(0xcb)](a5_0x4009f2[_0x1a04c5(0x8c)]('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x41e00c[_0x1a04c5(0x105)]+_0x1a04c5(0x100)+_0x3aece2+'\x22.')),console[_0x1a04c5(0xcb)](a5_0x4009f2['dim'](_0x1a04c5(0xae)+_0x41e00c['site']+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x23b1d8=_0x41ab4a[_0x1a04c5(0xe6)][_0x1a04c5(0xea)](_0x214607=>_0x4de11d['has'](_0x214607[_0x1a04c5(0xe2)])),_0x368851=_0x1b1cdf;let _0x3deb79;try{_0x3deb79=await setupEvaluatorAgent(_0x3a7e90[_0x1a04c5(0xf6)],_0x4eb49d[_0x1a04c5(0x99)]);}catch(_0x163c22){const _0x34d4bb=_0x163c22 instanceof Error?_0x163c22['message']:String(_0x163c22);return console['log'](a5_0x4009f2[_0x1a04c5(0x9c)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x34d4bb)),0x1;}console[_0x1a04c5(0xcb)](a5_0x4009f2[_0x1a04c5(0x89)]('Re-evaluating\x20cached\x20test\x20run...')),console[_0x1a04c5(0xcb)](_0x1a04c5(0xb2)+a5_0x4009f2[_0x1a04c5(0xfc)](_0x41e00c[_0x1a04c5(0xd9)])),console['log'](_0x1a04c5(0xa0)+a5_0x4009f2[_0x1a04c5(0xfc)](_0x41e00c[_0x1a04c5(0xd1)][_0x1a04c5(0xf1)]+'/'+_0x41e00c[_0x1a04c5(0xd1)][_0x1a04c5(0x9f)]));_0x368851[_0x1a04c5(0xf5)]>0x0&&console[_0x1a04c5(0xcb)](_0x1a04c5(0xc0)+a5_0x4009f2[_0x1a04c5(0xf8)](_0x368851['length']));console[_0x1a04c5(0xcb)]();const _0x33b118=[],_0xeee7ab=Date[_0x1a04c5(0xef)](),_0x1d07a3=createCommandSpinner('Re-evaluating...');if(_0x23b1d8['length']>0x0)try{const _0xe91c75=await reevaluateFromCache(_0x3a7e90[_0x1a04c5(0xf6)],_0x41e00c,{'tests':_0x23b1d8},{'evaluatorId':_0x3deb79,'onTestStart':(_0x503f0a,_0xdefafc,_0x120850)=>{const _0x120ac9=_0x1a04c5;_0x1d07a3[_0x120ac9(0xe7)]='Re-evaluating\x20'+(_0xdefafc+0x1)+'/'+_0x120850+':\x20'+_0x503f0a+_0x120ac9(0xf4);if(!_0x1d07a3[_0x120ac9(0xe9)])_0x1d07a3[_0x120ac9(0x9e)]();},'onTestComplete':(_0xff8312,_0x42b86c)=>{const _0x3c4d9c=_0x1a04c5;_0x1d07a3[_0x3c4d9c(0xb6)]();if(_0x42b86c[_0x3c4d9c(0xdd)]===_0x3c4d9c(0xfd))console[_0x3c4d9c(0xcb)](a5_0x4009f2[_0x3c4d9c(0xc5)](_0x3c4d9c(0x104)+_0xff8312)+a5_0x4009f2[_0x3c4d9c(0x8c)](_0x3c4d9c(0x116)));else _0x42b86c['status']==='FAIL'?console[_0x3c4d9c(0xcb)](a5_0x4009f2[_0x3c4d9c(0x9c)](_0x3c4d9c(0xe3)+_0xff8312+_0x3c4d9c(0x90)+_0x42b86c[_0x3c4d9c(0xd5)])+a5_0x4009f2[_0x3c4d9c(0x8c)](_0x3c4d9c(0x116))):console[_0x3c4d9c(0xcb)](a5_0x4009f2[_0x3c4d9c(0x9c)](_0x3c4d9c(0x113)+_0xff8312+_0x3c4d9c(0x90)+_0x42b86c[_0x3c4d9c(0xd5)]));_0x42b86c[_0x3c4d9c(0xbf)]&&console['log'](a5_0x4009f2['dim'](_0x3c4d9c(0xe1)+_0x42b86c[_0x3c4d9c(0xbf)])),_0x33b118['push'](_0x42b86c);},'onTestSkipped':(_0x3ee387,_0x480c8f)=>{const _0x376d1b=_0x1a04c5;_0x1d07a3['stop'](),console[_0x376d1b(0xcb)](a5_0x4009f2[_0x376d1b(0xf8)](_0x376d1b(0xbc)+_0x3ee387+_0x376d1b(0x90)+_0x480c8f));}});for(const _0x1b042d of _0xe91c75){!_0x33b118[_0x1a04c5(0xd2)](_0x52d045=>_0x52d045[_0x1a04c5(0xe2)]===_0x1b042d['name'])&&_0x33b118[_0x1a04c5(0x110)](_0x1b042d);}}catch(_0x5d2d84){_0x1d07a3[_0x1a04c5(0xb6)]();const _0x4a0a07=_0x5d2d84 instanceof Error?_0x5d2d84['message']:String(_0x5d2d84);return console[_0x1a04c5(0xcb)](a5_0x4009f2['red'](_0x1a04c5(0x101)+_0x4a0a07)),0x1;}_0x1d07a3[_0x1a04c5(0xb6)]();if(_0x368851['length']>0x0){console[_0x1a04c5(0xcb)](),console[_0x1a04c5(0xcb)](a5_0x4009f2[_0x1a04c5(0x89)](_0x1a04c5(0xf3)));const {projectId:_0x4152a2,agentId:_0x333cc5}=_0x41e00c[_0x1a04c5(0xd1)];for(const _0x17dc11 of _0x368851){console[_0x1a04c5(0xcb)](_0x1a04c5(0x94)+a5_0x4009f2[_0x1a04c5(0xfc)](_0x17dc11[_0x1a04c5(0xe2)]));const _0x15302d=createCommandSpinner('Round\x201/'+_0x17dc11[_0x1a04c5(0x8d)][_0x1a04c5(0xf5)]+_0x1a04c5(0xb5));_0x15302d[_0x1a04c5(0x9e)]();try{const {result:_0x2a52f2}=await runTest(_0x3a7e90['llm'],_0x17dc11,{'agentId':_0x333cc5,'projectId':_0x4152a2,'site':_0x41e00c['site'],'noEval':![],'evaluatorId':_0x3deb79,'onRoundStart':(_0x12ac62,_0x447aa4)=>{const _0x3d3bb5=_0x1a04c5;_0x15302d[_0x3d3bb5(0xe7)]='Round\x20'+(_0x12ac62+0x1)+'/'+_0x447aa4+_0x3d3bb5(0xb5);},'onRoundComplete':(_0x40f451,_0x3cc485,_0x1913f1)=>{const _0x59ffea=_0x1a04c5,_0x2a1372=formatElapsed(_0x3cc485);_0x1913f1?console['log'](_0x59ffea(0xde)+(_0x40f451+0x1)+'/'+_0x17dc11[_0x59ffea(0x8d)]['length']+_0x59ffea(0xc6)+a5_0x4009f2[_0x59ffea(0xc5)]('✓')+'\x20('+_0x2a1372+')'):console[_0x59ffea(0xcb)]('\x20\x20Round\x20'+(_0x40f451+0x1)+'/'+_0x17dc11[_0x59ffea(0x8d)]['length']+'...\x20'+a5_0x4009f2[_0x59ffea(0x9c)]('✗'));},'onEvaluationStart':()=>{const _0x223ae0=_0x1a04c5;_0x15302d[_0x223ae0(0xe7)]=_0x223ae0(0xa5);},'onEvaluationComplete':_0x498ccc=>{const _0x3509bb=_0x1a04c5,_0x546ea6=formatElapsed(_0x498ccc);console['log'](_0x3509bb(0x112)+a5_0x4009f2[_0x3509bb(0xc5)]('✓')+'\x20('+_0x546ea6+')');}});_0x15302d[_0x1a04c5(0xb6)](),_0x33b118[_0x1a04c5(0x110)](_0x2a52f2);if(_0x2a52f2[_0x1a04c5(0xdd)]==='PASS')console[_0x1a04c5(0xcb)](a5_0x4009f2['green'](_0x1a04c5(0x104)+_0x2a52f2[_0x1a04c5(0xd5)])+a5_0x4009f2[_0x1a04c5(0x8c)](_0x1a04c5(0xff)));else _0x2a52f2[_0x1a04c5(0xdd)]==='FAIL'?console[_0x1a04c5(0xcb)](a5_0x4009f2[_0x1a04c5(0x9c)](_0x1a04c5(0xe3)+_0x2a52f2[_0x1a04c5(0xd5)])+a5_0x4009f2['dim'](_0x1a04c5(0xff))):console[_0x1a04c5(0xcb)](a5_0x4009f2[_0x1a04c5(0x9c)](_0x1a04c5(0x113)+_0x2a52f2[_0x1a04c5(0xd5)]));_0x2a52f2['conversation_url']&&console[_0x1a04c5(0xcb)](a5_0x4009f2['dim']('\x20\x20Conversation:\x20'+_0x2a52f2[_0x1a04c5(0xbf)]));}catch(_0x4bb754){_0x15302d[_0x1a04c5(0xb6)]();const _0x1952f0=_0x4bb754 instanceof Error?_0x4bb754[_0x1a04c5(0x92)]:String(_0x4bb754);console['log'](a5_0x4009f2['red']('✗\x20ERROR:\x20'+_0x1952f0)),_0x33b118['push']({'name':_0x17dc11[_0x1a04c5(0xe2)],'status':'ERROR','reason':_0x1952f0,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console['log']();const _0x33d752=Date[_0x1a04c5(0xef)]()-_0xeee7ab,_0x547a51=_0x33b118[_0x1a04c5(0xea)](_0x3c8551=>_0x3c8551[_0x1a04c5(0xdd)]===_0x1a04c5(0xfd))[_0x1a04c5(0xf5)],_0x3af590=_0x33b118[_0x1a04c5(0xea)](_0x4bdb8f=>_0x4bdb8f[_0x1a04c5(0xdd)]===_0x1a04c5(0xf0))['length'],_0x1d5d27=_0x33b118['filter'](_0x42f752=>_0x42f752[_0x1a04c5(0xdd)]===_0x1a04c5(0xb8))[_0x1a04c5(0xf5)];console[_0x1a04c5(0xcb)]('━'['repeat'](0x3c)),console[_0x1a04c5(0xcb)]('Re-evaluation\x20Summary'),console[_0x1a04c5(0xcb)]('━'[_0x1a04c5(0x103)](0x3c)),console[_0x1a04c5(0xcb)](_0x1a04c5(0xb4)+_0x33b118[_0x1a04c5(0xf5)]),console[_0x1a04c5(0xcb)](_0x1a04c5(0xeb)+a5_0x4009f2['green'](_0x547a51)),console[_0x1a04c5(0xcb)](_0x1a04c5(0x10d)+a5_0x4009f2[_0x1a04c5(0x9c)](_0x3af590));_0x1d5d27>0x0&&console['log'](_0x1a04c5(0xd0)+a5_0x4009f2[_0x1a04c5(0x9c)](_0x1d5d27));console[_0x1a04c5(0xcb)](_0x1a04c5(0x11e)+formatElapsed(_0x33d752)),console[_0x1a04c5(0xcb)]('━'[_0x1a04c5(0x103)](0x3c));const _0x234244={'summary':{'total':_0x33b118[_0x1a04c5(0xf5)],'passed':_0x547a51,'failed':_0x3af590,'errors':_0x1d5d27>0x0?_0x1d5d27:undefined,'duration_ms':_0x33d752},'tests':_0x33b118,'agent':{'project':_0x892651[_0x1a04c5(0xf1)],'name':_0x892651['agentName'],'site':_0x3aece2},'timestamp':new Date(_0xeee7ab)[_0x1a04c5(0x9d)]()};if(_0x20458b!==_0x1a04c5(0xfb)||_0x4663de){const _0x31fae9=formatResults(_0x234244,_0x20458b);if(_0x4663de)try{a5_0x5bcefb['writeFileSync'](_0x4663de,_0x31fae9,_0x1a04c5(0x9a)),console[_0x1a04c5(0xcb)](),console[_0x1a04c5(0xcb)](a5_0x4009f2[_0x1a04c5(0x8c)](_0x1a04c5(0xec)+_0x4663de));}catch(_0x498b51){return console[_0x1a04c5(0xcb)](),console[_0x1a04c5(0xcb)](a5_0x4009f2[_0x1a04c5(0x9c)]('Error\x20writing\x20output\x20file:\x20'+_0x498b51)),0x1;}else console[_0x1a04c5(0xcb)](),console['log'](_0x31fae9);}const _0x39d3a3=_0x33b118[_0x1a04c5(0xea)](_0x2c8c62=>_0x2c8c62[_0x1a04c5(0xdd)]!==_0x1a04c5(0xfd));return _0x39d3a3['length']>0x0?0x1:0x0;}}
|
|
1
|
+
function a5_0x130f(){const _0x31e687=['...\x20','Available\x20tests:\x20','✓\x20PASS:\x20','Running:\x20','Project\x20path:\x20','tsv','text','404','testName','\x20\x20Site:\x20','now','\x22:\x20','projectName','\x20\x20Round\x20','some','stop','includes','Cached\x20run\x20is\x20from\x20site\x20\x22','Evaluating\x20response...','\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)','cyan','Available\x20tags:\x20','add','test.yml','start','\x20\x20Conversation:\x20','No\x20tests\x20found\x20with\x20tags:\x20','Output\x20written\x20to:\x20','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','Failed:\x20\x20\x20','Duration:\x20','Re-evaluating\x20','36738GCDGYK','json','no_context','Test\x20','Executing\x20new\x20tests...','\x20(cached)','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','verbose','ERROR','Run\x20tests\x20for\x20an\x20LLM\x20agent','multiple_agents','Run\x20\x27tdx\x20agent\x20pull\x20','Either\x20switch\x20to\x20the\x20\x22','378HZpAhW','Conversation\x20URL:\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','Re-evaluating...','FAIL','dim','\x20\x20-\x20','Passed:\x20\x20\x20','description','reason','\x22,\x20but\x20current\x20site\x20is\x20\x22','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','agentName','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Tests\x20found:\x20','green','agent:test','Round\x201/','repeat','utf-8','Running\x20agent\x20tests...','\x20-\x20','basename','3FrvBiT','792508hfDFTe','white','PASS','Error:\x20No\x20previous\x20test\x20run\x20found.','No\x20tests\x20found\x20matching:\x20','testYmlPath','tests','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','conversations','Errors:\x20\x20\x20','join','conversation_url','llmProject','Error\x20writing\x20output\x20file:\x20','Round\x20','substring','✗\x20ERROR:\x20','table','yellow','push','find','status','23768nYXgZB','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','rounds','Total:\x20\x20\x20\x20','✗\x20FAIL:\x20','length','has','projectDir','size','Using\x20agent:\x20','2007985QTUnmi','\x27\x20to\x20create\x20the\x20folder\x20structure.','176326FIoPpY','tags','toLowerCase','agent','message','round','site','isSpinning',':\x20Sending\x20user\x20input...','no_tests','dryRun','resolve','/<agent-name>','\x20\x20Evaluating...\x20','resolveProjectId','executeReeval','\x20\x20Project:\x20','log','Failed\x20Tests:','Site:\x20','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','toISOString','New\x20tests\x20to\x20execute:\x20','\x20(new)','Usage:','jsonl','311170NTdUpM','output','filter','split','map','writeFileSync','reeval','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','existsSync','resolveAgentId','...','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','execute','Running\x20test:\x20','name','red','trim','llm','75320iUGGyN','Cached\x20run\x20from:\x20','Agent:\x20'];a5_0x130f=function(){return _0x31e687;};return a5_0x130f();}function a5_0x404f(_0x74378c,_0x690966){_0x74378c=_0x74378c-0x146;const _0x130f6a=a5_0x130f();let _0x404f3f=_0x130f6a[_0x74378c];return _0x404f3f;}const a5_0x4054c3=a5_0x404f;(function(_0x282fa6,_0x18686c){const _0x2a6031=a5_0x404f,_0x506991=_0x282fa6();while(!![]){try{const _0x53f547=parseInt(_0x2a6031(0x167))/0x1+-parseInt(_0x2a6031(0x1d2))/0x2+-parseInt(_0x2a6031(0x1ae))/0x3*(parseInt(_0x2a6031(0x1af))/0x4)+-parseInt(_0x2a6031(0x155))/0x5+parseInt(_0x2a6031(0x18a))/0x6+parseInt(_0x2a6031(0x1d0))/0x7+parseInt(_0x2a6031(0x1c6))/0x8*(parseInt(_0x2a6031(0x197))/0x9);if(_0x53f547===_0x18686c)break;else _0x506991['push'](_0x506991['shift']());}catch(_0x303558){_0x506991['push'](_0x506991['shift']());}}}(a5_0x130f,0x234ac));import*as a5_0x454be6 from'node:fs';import*as a5_0x209112 from'node:path';import a5_0x30cc29 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{['name']=a5_0x4054c3(0x1a7);[a5_0x4054c3(0x19f)]=a5_0x4054c3(0x193);async[a5_0x4054c3(0x161)](_0x27efe8){const _0x4d4e0=a5_0x4054c3,{options:_0x5ae384,args:_0x501306,tdx:_0x480780}=_0x27efe8,_0x3415cd=_0x501306[0x0]||'.',_0x3b49df=_0x5ae384[_0x4d4e0(0x1dc)],_0x4e4942=_0x5ae384,_0x5aca8a=_0x4e4942['eval']===![],_0xaeddd4=_0x4e4942[_0x4d4e0(0x15b)],_0x20bf50=_0x4e4942[_0x4d4e0(0x163)],_0x5e7997=_0x4e4942[_0x4d4e0(0x1d3)],_0x2337eb=_0x5ae384['site'],_0x53eb0e=_0x4e4942[_0x4d4e0(0x156)];if(_0xaeddd4&&_0x5aca8a)return console['log'](a5_0x30cc29[_0x4d4e0(0x164)](_0x4d4e0(0x15c))),0x1;let _0x50923f=_0x4d4e0(0x1c1);if(_0x4e4942[_0x4d4e0(0x18b)])_0x50923f=_0x4d4e0(0x18b);else{if(_0x4e4942['jsonl'])_0x50923f=_0x4d4e0(0x154);else{if(_0x4e4942[_0x4d4e0(0x16f)])_0x50923f=_0x4d4e0(0x16f);else{if(_0x4e4942[_0x4d4e0(0x1c1)])_0x50923f='table';}}}const _0x3a4d97=_0x4e4942[_0x4d4e0(0x1bc)];let _0x40c9f2=_0x3415cd;const _0x1eeed4=a5_0x454be6[_0x4d4e0(0x15d)](_0x3415cd),_0x5cb21e=_0x3415cd==='.';if(!_0x1eeed4||_0x5cb21e){const _0x1eba19=resolveProjectFromContext(_0x3415cd,_0x3a4d97,{'requireFile':_0x4d4e0(0x181)});if(_0x1eba19['found'])_0x40c9f2=_0x1eba19[_0x4d4e0(0x1cd)],_0x1eba19['source']==='context'&&console[_0x4d4e0(0x14b)](a5_0x30cc29['dim'](_0x4d4e0(0x1cf)+_0x40c9f2));else switch(_0x1eba19[_0x4d4e0(0x1a0)]){case _0x4d4e0(0x18c):console[_0x4d4e0(0x14b)](a5_0x30cc29[_0x4d4e0(0x1c2)](_0x1eba19[_0x4d4e0(0x1d6)])),console[_0x4d4e0(0x14b)](),console['log'](_0x4d4e0(0x153)),console[_0x4d4e0(0x14b)]('\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path'),console['log'](_0x4d4e0(0x17d)),console['log'](),console[_0x4d4e0(0x14b)](_0x4d4e0(0x14e));return 0x1;case'no_local_folder':console['log'](a5_0x30cc29[_0x4d4e0(0x1c2)](_0x1eba19['message'])),console[_0x4d4e0(0x14b)](),console['log'](_0x4d4e0(0x195)+_0x1eba19['llmProject']+_0x4d4e0(0x1d1));return 0x1;case _0x4d4e0(0x194):{const _0x50404b=a5_0x209112[_0x4d4e0(0x1ad)](_0x1eba19[_0x4d4e0(0x1cd)]);console[_0x4d4e0(0x14b)](a5_0x30cc29[_0x4d4e0(0x1c2)](_0x4d4e0(0x1b6)+_0x1eba19[_0x4d4e0(0x1bc)]+'\x22:'));for(const _0x2f579c of _0x1eba19['agentDirs']){console['log'](_0x4d4e0(0x19d)+_0x2f579c);}return console['log'](),console[_0x4d4e0(0x14b)]('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x50404b+_0x4d4e0(0x146)),0x1;}case _0x4d4e0(0x1db):console['log'](a5_0x30cc29['yellow']('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x1eba19[_0x4d4e0(0x1bc)]+'\x22.')),console[_0x4d4e0(0x14b)](a5_0x30cc29[_0x4d4e0(0x19c)](_0x4d4e0(0x16e)+_0x1eba19['projectDir'])),console[_0x4d4e0(0x14b)](),console[_0x4d4e0(0x14b)](_0x4d4e0(0x14f));return 0x1;}}const {definition:_0x2f7839,agentInfo:_0x1b3616}=parseTestFile(_0x40c9f2);let _0x4ca613=_0x2f7839[_0x4d4e0(0x1b5)];if(_0x20bf50){const _0x20af1d=_0x20bf50[_0x4d4e0(0x158)](',')[_0x4d4e0(0x159)](_0x204f21=>_0x204f21['trim']());_0x4ca613=_0x2f7839['tests']['filter'](_0x5c6e0c=>_0x20af1d[_0x4d4e0(0x17a)](_0x5c6e0c['name']));if(_0x4ca613[_0x4d4e0(0x1cb)]===0x0)return console[_0x4d4e0(0x14b)](a5_0x30cc29[_0x4d4e0(0x1c2)](_0x4d4e0(0x1b3)+_0x20bf50)),console[_0x4d4e0(0x14b)](a5_0x30cc29['dim'](_0x4d4e0(0x16b)+_0x2f7839[_0x4d4e0(0x1b5)]['map'](_0x29ef4d=>_0x29ef4d[_0x4d4e0(0x163)])[_0x4d4e0(0x1ba)](',\x20'))),0x1;}if(_0x5e7997){const _0x445095=_0x5e7997[_0x4d4e0(0x158)](',')[_0x4d4e0(0x159)](_0x50fb57=>_0x50fb57[_0x4d4e0(0x165)]()[_0x4d4e0(0x1d4)]());_0x4ca613=_0x4ca613['filter'](_0x400438=>_0x400438[_0x4d4e0(0x1d3)]?.[_0x4d4e0(0x178)](_0x24444c=>_0x445095['includes'](_0x24444c[_0x4d4e0(0x1d4)]())));if(_0x4ca613['length']===0x0){console[_0x4d4e0(0x14b)](a5_0x30cc29[_0x4d4e0(0x1c2)](_0x4d4e0(0x184)+_0x5e7997));const _0x1aefa9=new Set();return _0x2f7839[_0x4d4e0(0x1b5)]['forEach'](_0x564927=>_0x564927['tags']?.['forEach'](_0x779181=>_0x1aefa9[_0x4d4e0(0x180)](_0x779181))),_0x1aefa9[_0x4d4e0(0x1ce)]>0x0?console[_0x4d4e0(0x14b)](a5_0x30cc29[_0x4d4e0(0x19c)](_0x4d4e0(0x17f)+[..._0x1aefa9]['join'](',\x20'))):console[_0x4d4e0(0x14b)](a5_0x30cc29['dim']('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0xaeddd4)return this['executeReeval'](_0x27efe8,{'definition':{'tests':_0x4ca613},'agentInfo':_0x1b3616,'outputFormat':_0x50923f,'outputFile':_0x53eb0e,'testNames':_0x20bf50});if(_0x3b49df){console[_0x4d4e0(0x14b)](a5_0x30cc29[_0x4d4e0(0x17e)]('Test\x20Configuration:')),console[_0x4d4e0(0x14b)](_0x4d4e0(0x173)+a5_0x30cc29[_0x4d4e0(0x1b0)](_0x2337eb)),console[_0x4d4e0(0x14b)](_0x4d4e0(0x14a)+a5_0x30cc29[_0x4d4e0(0x1b0)](_0x1b3616[_0x4d4e0(0x176)])),console[_0x4d4e0(0x14b)]('\x20\x20Agent:\x20'+a5_0x30cc29['white'](_0x1b3616['agentName'])),console['log'](),console[_0x4d4e0(0x14b)](_0x4d4e0(0x1a5)+a5_0x30cc29[_0x4d4e0(0x1b0)](_0x4ca613[_0x4d4e0(0x1cb)]));for(let _0x4e986d=0x0;_0x4e986d<_0x4ca613[_0x4d4e0(0x1cb)];_0x4e986d++){const _0x534006=_0x4ca613[_0x4e986d],_0x301af5=_0x534006[_0x4d4e0(0x1c8)]['length']===0x1?_0x4d4e0(0x1d7):_0x4d4e0(0x1c8),_0x4556fa=_0x534006[_0x4d4e0(0x1d3)]?.['length']?'\x20['+_0x534006[_0x4d4e0(0x1d3)][_0x4d4e0(0x1ba)](',\x20')+']':'';console['log']('\x20\x20'+(_0x4e986d+0x1)+'.\x20'+a5_0x30cc29[_0x4d4e0(0x1b0)](_0x534006[_0x4d4e0(0x163)])+'\x20('+_0x534006[_0x4d4e0(0x1c8)][_0x4d4e0(0x1cb)]+'\x20'+_0x301af5+')'+a5_0x30cc29[_0x4d4e0(0x19c)](_0x4556fa));}return 0x0;}let _0x58e9e2,_0x25cf50;try{_0x58e9e2=await _0x480780[_0x4d4e0(0x166)][_0x4d4e0(0x148)](_0x1b3616[_0x4d4e0(0x176)]);}catch(_0x57dc3d){const _0x2bb2e6=_0x57dc3d instanceof Error?_0x57dc3d['message']:String(_0x57dc3d);return _0x2bb2e6[_0x4d4e0(0x17a)](_0x4d4e0(0x171))||_0x2bb2e6[_0x4d4e0(0x1d4)]()[_0x4d4e0(0x17a)]('not\x20found')?console['log'](a5_0x30cc29['red']('✗\x20ERROR:\x20Project\x20not\x20found:\x20'+_0x1b3616[_0x4d4e0(0x176)])):console['log'](a5_0x30cc29[_0x4d4e0(0x164)](_0x4d4e0(0x160)+_0x1b3616[_0x4d4e0(0x176)]+_0x4d4e0(0x175)+_0x2bb2e6)),0x1;}try{_0x25cf50=await _0x480780[_0x4d4e0(0x166)][_0x4d4e0(0x15e)](_0x1b3616[_0x4d4e0(0x1a3)],_0x58e9e2);}catch(_0x2cb56e){const _0x4c138c=_0x2cb56e instanceof Error?_0x2cb56e[_0x4d4e0(0x1d6)]:String(_0x2cb56e);return _0x4c138c[_0x4d4e0(0x17a)]('404')||_0x4c138c[_0x4d4e0(0x1d4)]()[_0x4d4e0(0x17a)]('not\x20found')?console['log'](a5_0x30cc29['red']('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x1b3616[_0x4d4e0(0x1a3)])):console[_0x4d4e0(0x14b)](a5_0x30cc29[_0x4d4e0(0x164)](_0x4d4e0(0x1b7)+_0x1b3616[_0x4d4e0(0x1a3)]+_0x4d4e0(0x175)+_0x4c138c)),0x1;}let _0x48301d;if(!_0x5aca8a)try{_0x48301d=await setupEvaluatorAgent(_0x480780['llm'],_0x5ae384['verbose']);}catch(_0xc83081){const _0x212c7b=_0xc83081 instanceof Error?_0xc83081[_0x4d4e0(0x1d6)]:String(_0xc83081);return console[_0x4d4e0(0x14b)](a5_0x30cc29['red'](_0x4d4e0(0x199)+_0x212c7b)),0x1;}console[_0x4d4e0(0x14b)](a5_0x30cc29[_0x4d4e0(0x17e)](_0x4d4e0(0x1ab))),console[_0x4d4e0(0x14b)](_0x4d4e0(0x14d)+a5_0x30cc29['white'](_0x2337eb)),console[_0x4d4e0(0x14b)](_0x4d4e0(0x169)+a5_0x30cc29[_0x4d4e0(0x1b0)](_0x1b3616[_0x4d4e0(0x176)]+'/'+_0x1b3616[_0x4d4e0(0x1a3)])),console['log']();const _0x5218e6=[],_0x77074b=[],_0x20cc30=Date[_0x4d4e0(0x174)]();for(let _0x205c69=0x0;_0x205c69<_0x4ca613[_0x4d4e0(0x1cb)];_0x205c69++){const _0x4281c3=_0x4ca613[_0x205c69];_0x4ca613[_0x4d4e0(0x1cb)]>0x1?console[_0x4d4e0(0x14b)](_0x4d4e0(0x18d)+(_0x205c69+0x1)+'/'+_0x4ca613[_0x4d4e0(0x1cb)]+':\x20'+a5_0x30cc29[_0x4d4e0(0x1b0)](_0x4281c3[_0x4d4e0(0x163)])):console['log'](_0x4d4e0(0x162)+a5_0x30cc29['white'](_0x4281c3[_0x4d4e0(0x163)]));const _0x210b45=createCommandSpinner(_0x4d4e0(0x1a8)+_0x4281c3[_0x4d4e0(0x1c8)][_0x4d4e0(0x1cb)]+_0x4d4e0(0x1da));_0x210b45[_0x4d4e0(0x182)]();try{const {result:_0x1a733c,conversation:_0x5bcc8d}=await runTest(_0x480780[_0x4d4e0(0x166)],_0x4281c3,{'agentId':_0x25cf50,'projectId':_0x58e9e2,'site':_0x2337eb,'noEval':_0x5aca8a,'evaluatorId':_0x48301d,'onRoundStart':(_0x5ec4e0,_0x4dd9c4)=>{const _0x3259c4=_0x4d4e0;_0x210b45[_0x3259c4(0x170)]=_0x3259c4(0x1be)+(_0x5ec4e0+0x1)+'/'+_0x4dd9c4+_0x3259c4(0x1da);},'onRoundComplete':(_0x4d2d83,_0x47701c,_0x57922a)=>{const _0x51c6ae=_0x4d4e0,_0x3786bd=formatElapsed(_0x47701c);_0x57922a?console[_0x51c6ae(0x14b)](_0x51c6ae(0x177)+(_0x4d2d83+0x1)+'/'+_0x4281c3['rounds']['length']+_0x51c6ae(0x16a)+a5_0x30cc29['green']('✓')+'\x20('+_0x3786bd+')'):console[_0x51c6ae(0x14b)](_0x51c6ae(0x177)+(_0x4d2d83+0x1)+'/'+_0x4281c3['rounds']['length']+_0x51c6ae(0x16a)+a5_0x30cc29[_0x51c6ae(0x164)]('✗'));},'onEvaluationStart':()=>{const _0x4789b6=_0x4d4e0;_0x210b45['text']=_0x4789b6(0x17c);},'onEvaluationComplete':_0x41d38c=>{const _0xae8b35=_0x4d4e0,_0x4fe23c=formatElapsed(_0x41d38c);console[_0xae8b35(0x14b)](_0xae8b35(0x147)+a5_0x30cc29[_0xae8b35(0x1a6)]('✓')+'\x20('+_0x4fe23c+')');}});_0x210b45[_0x4d4e0(0x179)](),_0x5218e6[_0x4d4e0(0x1c3)](_0x1a733c),_0x77074b[_0x4d4e0(0x1c3)](_0x5bcc8d);if(_0x1a733c[_0x4d4e0(0x1c5)]===_0x4d4e0(0x1b1))console[_0x4d4e0(0x14b)](a5_0x30cc29[_0x4d4e0(0x1a6)]('✓\x20PASS:\x20'+_0x1a733c[_0x4d4e0(0x1a0)]));else _0x1a733c['status']===_0x4d4e0(0x19b)?console[_0x4d4e0(0x14b)](a5_0x30cc29[_0x4d4e0(0x164)](_0x4d4e0(0x1ca)+_0x1a733c[_0x4d4e0(0x1a0)])):console[_0x4d4e0(0x14b)](a5_0x30cc29[_0x4d4e0(0x164)](_0x4d4e0(0x1c0)+_0x1a733c[_0x4d4e0(0x1a0)]));_0x1a733c[_0x4d4e0(0x1bb)]&&console[_0x4d4e0(0x14b)](a5_0x30cc29['dim'](_0x4d4e0(0x198)+_0x1a733c[_0x4d4e0(0x1bb)])),console[_0x4d4e0(0x14b)]();}catch(_0x264315){_0x210b45['stop']();const _0x4615b0=_0x264315 instanceof Error?_0x264315['message']:String(_0x264315);console[_0x4d4e0(0x14b)](a5_0x30cc29[_0x4d4e0(0x164)](_0x4d4e0(0x1c0)+_0x4615b0)),console['log'](),_0x5218e6[_0x4d4e0(0x1c3)]({'name':_0x4281c3[_0x4d4e0(0x163)],'status':_0x4d4e0(0x192),'reason':_0x4615b0,'timestamp':new Date()[_0x4d4e0(0x150)](),'duration_ms':0x0});}}const _0xe7743a=Date[_0x4d4e0(0x174)]()-_0x20cc30,_0x1af56d=_0x5218e6[_0x4d4e0(0x157)](_0x5724cb=>_0x5724cb['status']===_0x4d4e0(0x1b1))['length'],_0x9e76c7=_0x5218e6['filter'](_0x202a63=>_0x202a63[_0x4d4e0(0x1c5)]==='FAIL')['length'],_0x1da90c=_0x5218e6['filter'](_0x531a8d=>_0x531a8d[_0x4d4e0(0x1c5)]===_0x4d4e0(0x192))[_0x4d4e0(0x1cb)];console[_0x4d4e0(0x14b)]('━'[_0x4d4e0(0x1a9)](0x3c)),console['log']('Test\x20Summary'),console['log']('━'[_0x4d4e0(0x1a9)](0x3c)),console[_0x4d4e0(0x14b)]('Total:\x20\x20\x20\x20'+_0x5218e6[_0x4d4e0(0x1cb)]),console['log'](_0x4d4e0(0x19e)+a5_0x30cc29['green'](_0x1af56d)),console[_0x4d4e0(0x14b)](_0x4d4e0(0x187)+a5_0x30cc29['red'](_0x9e76c7));_0x1da90c>0x0&&console[_0x4d4e0(0x14b)]('Errors:\x20\x20\x20'+a5_0x30cc29[_0x4d4e0(0x164)](_0x1da90c));console[_0x4d4e0(0x14b)]('Duration:\x20'+formatElapsed(_0xe7743a)),console['log']('━'[_0x4d4e0(0x1a9)](0x3c));const _0x71912=_0x5218e6[_0x4d4e0(0x157)](_0x285a21=>_0x285a21['status']!==_0x4d4e0(0x1b1));if(_0x71912[_0x4d4e0(0x1cb)]>0x0){console[_0x4d4e0(0x14b)](),console['log'](_0x4d4e0(0x14c));for(const _0xf37b16 of _0x71912){const _0x426f3c=a5_0x30cc29[_0x4d4e0(0x164)]('✗'),_0x5db1e8=_0xf37b16[_0x4d4e0(0x1a0)][_0x4d4e0(0x1cb)]>0x32?_0xf37b16[_0x4d4e0(0x1a0)][_0x4d4e0(0x1bf)](0x0,0x32)+_0x4d4e0(0x15f):_0xf37b16[_0x4d4e0(0x1a0)];console[_0x4d4e0(0x14b)]('\x20\x20'+_0x426f3c+'\x20'+_0xf37b16[_0x4d4e0(0x163)]+':\x20'+_0x5db1e8);}}const _0x30f261={'summary':{'total':_0x5218e6[_0x4d4e0(0x1cb)],'passed':_0x1af56d,'failed':_0x9e76c7,'errors':_0x1da90c>0x0?_0x1da90c:undefined,'duration_ms':_0xe7743a},'tests':_0x5218e6,'agent':{'project':_0x1b3616['projectName'],'name':_0x1b3616[_0x4d4e0(0x1a3)],'site':_0x2337eb},'timestamp':new Date(_0x20cc30)[_0x4d4e0(0x150)]()};try{const _0x2affc4=buildCachedTestRun(_0x77074b,{'site':_0x2337eb,'projectId':_0x58e9e2,'projectName':_0x1b3616[_0x4d4e0(0x176)],'agentId':_0x25cf50,'agentName':_0x1b3616[_0x4d4e0(0x1a3)],'testYmlPath':a5_0x209112[_0x4d4e0(0x1dd)](_0x1b3616[_0x4d4e0(0x1b4)])});saveLastTestRun(_0x2affc4);}catch{}if(_0x50923f!=='table'||_0x53eb0e){const _0x37889b=formatResults(_0x30f261,_0x50923f);if(_0x53eb0e)try{a5_0x454be6[_0x4d4e0(0x15a)](_0x53eb0e,_0x37889b,_0x4d4e0(0x1aa)),console[_0x4d4e0(0x14b)](),console[_0x4d4e0(0x14b)](a5_0x30cc29[_0x4d4e0(0x19c)]('Output\x20written\x20to:\x20'+_0x53eb0e));}catch(_0x8fbf36){return console[_0x4d4e0(0x14b)](),console[_0x4d4e0(0x14b)](a5_0x30cc29[_0x4d4e0(0x164)](_0x4d4e0(0x1bd)+_0x8fbf36)),0x1;}else console['log'](),console['log'](_0x37889b);}return _0x71912['length']>0x0?0x1:0x0;}async[a5_0x4054c3(0x149)](_0x1838fc,_0x3b886a){const _0x1db64a=a5_0x4054c3,{options:_0x407ef2,tdx:_0x16fdb4}=_0x1838fc,{definition:_0x2362e0,agentInfo:_0x5b9c48,outputFormat:_0xc56503,outputFile:_0x5521b6}=_0x3b886a,_0x461555=_0x407ef2[_0x1db64a(0x1d8)],_0x489b7e=loadLastTestRun();if(!_0x489b7e)return console[_0x1db64a(0x14b)](a5_0x30cc29[_0x1db64a(0x164)](_0x1db64a(0x1b2))),console[_0x1db64a(0x14b)](a5_0x30cc29[_0x1db64a(0x19c)](_0x1db64a(0x1c7))),0x1;if(_0x489b7e['agent'][_0x1db64a(0x1a3)]!==_0x5b9c48['agentName'])return console[_0x1db64a(0x14b)](a5_0x30cc29['red'](_0x1db64a(0x190)+_0x489b7e[_0x1db64a(0x1d5)][_0x1db64a(0x1a3)]+_0x1db64a(0x186)+_0x5b9c48[_0x1db64a(0x1a3)]+'\x22.')),console['log'](a5_0x30cc29[_0x1db64a(0x19c)]('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x51ef13=new Set(_0x489b7e[_0x1db64a(0x1b8)][_0x1db64a(0x159)](_0x504f29=>_0x504f29[_0x1db64a(0x172)])),_0x3ef9d2=_0x2362e0[_0x1db64a(0x1b5)][_0x1db64a(0x157)](_0x3495d4=>!_0x51ef13[_0x1db64a(0x1cc)](_0x3495d4[_0x1db64a(0x163)]));if(_0x3ef9d2[_0x1db64a(0x1cb)]>0x0&&_0x489b7e[_0x1db64a(0x1d8)]!==_0x461555)return console[_0x1db64a(0x14b)](a5_0x30cc29['red'](_0x1db64a(0x1a2))),console[_0x1db64a(0x14b)](a5_0x30cc29['dim'](_0x1db64a(0x17b)+_0x489b7e['site']+_0x1db64a(0x1a1)+_0x461555+'\x22.')),console[_0x1db64a(0x14b)](a5_0x30cc29[_0x1db64a(0x19c)](_0x1db64a(0x196)+_0x489b7e[_0x1db64a(0x1d8)]+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0xc5615e=_0x2362e0[_0x1db64a(0x1b5)][_0x1db64a(0x157)](_0x36c7b1=>_0x51ef13[_0x1db64a(0x1cc)](_0x36c7b1[_0x1db64a(0x163)])),_0x562266=_0x3ef9d2;let _0x5a9db6;try{_0x5a9db6=await setupEvaluatorAgent(_0x16fdb4[_0x1db64a(0x166)],_0x407ef2[_0x1db64a(0x191)]);}catch(_0x187447){const _0x3405d9=_0x187447 instanceof Error?_0x187447['message']:String(_0x187447);return console[_0x1db64a(0x14b)](a5_0x30cc29['red'](_0x1db64a(0x199)+_0x3405d9)),0x1;}console[_0x1db64a(0x14b)](a5_0x30cc29[_0x1db64a(0x17e)]('Re-evaluating\x20cached\x20test\x20run...')),console[_0x1db64a(0x14b)](_0x1db64a(0x168)+a5_0x30cc29[_0x1db64a(0x1b0)](_0x489b7e['timestamp'])),console[_0x1db64a(0x14b)](_0x1db64a(0x169)+a5_0x30cc29[_0x1db64a(0x1b0)](_0x489b7e['agent']['projectName']+'/'+_0x489b7e[_0x1db64a(0x1d5)]['agentName']));_0x562266[_0x1db64a(0x1cb)]>0x0&&console[_0x1db64a(0x14b)](_0x1db64a(0x151)+a5_0x30cc29[_0x1db64a(0x1c2)](_0x562266[_0x1db64a(0x1cb)]));console[_0x1db64a(0x14b)]();const _0x14d05e=[],_0x58fe52=Date['now'](),_0x4d9cda=createCommandSpinner(_0x1db64a(0x19a));if(_0xc5615e[_0x1db64a(0x1cb)]>0x0)try{const _0x424d8f=await reevaluateFromCache(_0x16fdb4['llm'],_0x489b7e,{'tests':_0xc5615e},{'evaluatorId':_0x5a9db6,'onTestStart':(_0x55badd,_0x293d4a,_0x53227e)=>{const _0x16d8d3=_0x1db64a;_0x4d9cda['text']=_0x16d8d3(0x189)+(_0x293d4a+0x1)+'/'+_0x53227e+':\x20'+_0x55badd+_0x16d8d3(0x15f);if(!_0x4d9cda[_0x16d8d3(0x1d9)])_0x4d9cda['start']();},'onTestComplete':(_0x1aba78,_0x5cb5ec)=>{const _0x74cce1=_0x1db64a;_0x4d9cda[_0x74cce1(0x179)]();if(_0x5cb5ec[_0x74cce1(0x1c5)]===_0x74cce1(0x1b1))console[_0x74cce1(0x14b)](a5_0x30cc29[_0x74cce1(0x1a6)](_0x74cce1(0x16c)+_0x1aba78)+a5_0x30cc29[_0x74cce1(0x19c)](_0x74cce1(0x18f)));else _0x5cb5ec[_0x74cce1(0x1c5)]==='FAIL'?console[_0x74cce1(0x14b)](a5_0x30cc29['red'](_0x74cce1(0x1ca)+_0x1aba78+'\x20-\x20'+_0x5cb5ec[_0x74cce1(0x1a0)])+a5_0x30cc29[_0x74cce1(0x19c)](_0x74cce1(0x18f))):console[_0x74cce1(0x14b)](a5_0x30cc29['red'](_0x74cce1(0x1c0)+_0x1aba78+_0x74cce1(0x1ac)+_0x5cb5ec[_0x74cce1(0x1a0)]));_0x5cb5ec[_0x74cce1(0x1bb)]&&console[_0x74cce1(0x14b)](a5_0x30cc29['dim'](_0x74cce1(0x183)+_0x5cb5ec['conversation_url'])),_0x14d05e[_0x74cce1(0x1c3)](_0x5cb5ec);},'onTestSkipped':(_0x21b680,_0x54d799)=>{const _0x26697f=_0x1db64a;_0x4d9cda['stop'](),console['log'](a5_0x30cc29[_0x26697f(0x1c2)]('⚠\x20SKIPPED:\x20'+_0x21b680+'\x20-\x20'+_0x54d799));}});for(const _0x44a5ec of _0x424d8f){!_0x14d05e[_0x1db64a(0x1c4)](_0x4a393b=>_0x4a393b[_0x1db64a(0x163)]===_0x44a5ec[_0x1db64a(0x163)])&&_0x14d05e[_0x1db64a(0x1c3)](_0x44a5ec);}}catch(_0x131e5b){_0x4d9cda[_0x1db64a(0x179)]();const _0x21729f=_0x131e5b instanceof Error?_0x131e5b[_0x1db64a(0x1d6)]:String(_0x131e5b);return console[_0x1db64a(0x14b)](a5_0x30cc29[_0x1db64a(0x164)](_0x1db64a(0x1a4)+_0x21729f)),0x1;}_0x4d9cda['stop']();if(_0x562266[_0x1db64a(0x1cb)]>0x0){console[_0x1db64a(0x14b)](),console[_0x1db64a(0x14b)](a5_0x30cc29[_0x1db64a(0x17e)](_0x1db64a(0x18e)));const {projectId:_0x36e555,agentId:_0x18ff33}=_0x489b7e[_0x1db64a(0x1d5)];for(const _0x58b879 of _0x562266){console[_0x1db64a(0x14b)](_0x1db64a(0x16d)+a5_0x30cc29['white'](_0x58b879[_0x1db64a(0x163)]));const _0x59c796=createCommandSpinner('Round\x201/'+_0x58b879[_0x1db64a(0x1c8)][_0x1db64a(0x1cb)]+_0x1db64a(0x1da));_0x59c796['start']();try{const {result:_0x522886}=await runTest(_0x16fdb4[_0x1db64a(0x166)],_0x58b879,{'agentId':_0x18ff33,'projectId':_0x36e555,'site':_0x489b7e['site'],'noEval':![],'evaluatorId':_0x5a9db6,'onRoundStart':(_0xeb7ca2,_0x487cdf)=>{const _0x20b876=_0x1db64a;_0x59c796[_0x20b876(0x170)]=_0x20b876(0x1be)+(_0xeb7ca2+0x1)+'/'+_0x487cdf+_0x20b876(0x1da);},'onRoundComplete':(_0x2ac300,_0x308e39,_0x14effe)=>{const _0x54622f=_0x1db64a,_0x4fd4a3=formatElapsed(_0x308e39);_0x14effe?console[_0x54622f(0x14b)](_0x54622f(0x177)+(_0x2ac300+0x1)+'/'+_0x58b879[_0x54622f(0x1c8)][_0x54622f(0x1cb)]+'...\x20'+a5_0x30cc29[_0x54622f(0x1a6)]('✓')+'\x20('+_0x4fd4a3+')'):console['log'](_0x54622f(0x177)+(_0x2ac300+0x1)+'/'+_0x58b879[_0x54622f(0x1c8)][_0x54622f(0x1cb)]+'...\x20'+a5_0x30cc29['red']('✗'));},'onEvaluationStart':()=>{const _0x26a18c=_0x1db64a;_0x59c796[_0x26a18c(0x170)]=_0x26a18c(0x17c);},'onEvaluationComplete':_0x117bc4=>{const _0x3a4aee=_0x1db64a,_0x15807f=formatElapsed(_0x117bc4);console[_0x3a4aee(0x14b)]('\x20\x20Evaluating...\x20'+a5_0x30cc29[_0x3a4aee(0x1a6)]('✓')+'\x20('+_0x15807f+')');}});_0x59c796['stop'](),_0x14d05e['push'](_0x522886);if(_0x522886[_0x1db64a(0x1c5)]==='PASS')console['log'](a5_0x30cc29[_0x1db64a(0x1a6)](_0x1db64a(0x16c)+_0x522886[_0x1db64a(0x1a0)])+a5_0x30cc29['dim'](_0x1db64a(0x152)));else _0x522886[_0x1db64a(0x1c5)]===_0x1db64a(0x19b)?console[_0x1db64a(0x14b)](a5_0x30cc29[_0x1db64a(0x164)]('✗\x20FAIL:\x20'+_0x522886[_0x1db64a(0x1a0)])+a5_0x30cc29[_0x1db64a(0x19c)](_0x1db64a(0x152))):console[_0x1db64a(0x14b)](a5_0x30cc29[_0x1db64a(0x164)]('✗\x20ERROR:\x20'+_0x522886[_0x1db64a(0x1a0)]));_0x522886[_0x1db64a(0x1bb)]&&console[_0x1db64a(0x14b)](a5_0x30cc29[_0x1db64a(0x19c)]('\x20\x20Conversation:\x20'+_0x522886[_0x1db64a(0x1bb)]));}catch(_0x1314f5){_0x59c796[_0x1db64a(0x179)]();const _0x3f1d22=_0x1314f5 instanceof Error?_0x1314f5[_0x1db64a(0x1d6)]:String(_0x1314f5);console[_0x1db64a(0x14b)](a5_0x30cc29[_0x1db64a(0x164)](_0x1db64a(0x1c0)+_0x3f1d22)),_0x14d05e[_0x1db64a(0x1c3)]({'name':_0x58b879[_0x1db64a(0x163)],'status':_0x1db64a(0x192),'reason':_0x3f1d22,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console['log']();const _0x4bf85b=Date[_0x1db64a(0x174)]()-_0x58fe52,_0x25611d=_0x14d05e['filter'](_0x1d1204=>_0x1d1204['status']===_0x1db64a(0x1b1))['length'],_0x266f72=_0x14d05e[_0x1db64a(0x157)](_0x4217c7=>_0x4217c7[_0x1db64a(0x1c5)]==='FAIL')[_0x1db64a(0x1cb)],_0x1493ec=_0x14d05e[_0x1db64a(0x157)](_0x49a1c6=>_0x49a1c6[_0x1db64a(0x1c5)]===_0x1db64a(0x192))[_0x1db64a(0x1cb)];console[_0x1db64a(0x14b)]('━'[_0x1db64a(0x1a9)](0x3c)),console[_0x1db64a(0x14b)]('Re-evaluation\x20Summary'),console[_0x1db64a(0x14b)]('━'[_0x1db64a(0x1a9)](0x3c)),console[_0x1db64a(0x14b)](_0x1db64a(0x1c9)+_0x14d05e[_0x1db64a(0x1cb)]),console[_0x1db64a(0x14b)](_0x1db64a(0x19e)+a5_0x30cc29['green'](_0x25611d)),console[_0x1db64a(0x14b)](_0x1db64a(0x187)+a5_0x30cc29[_0x1db64a(0x164)](_0x266f72));_0x1493ec>0x0&&console[_0x1db64a(0x14b)](_0x1db64a(0x1b9)+a5_0x30cc29[_0x1db64a(0x164)](_0x1493ec));console[_0x1db64a(0x14b)](_0x1db64a(0x188)+formatElapsed(_0x4bf85b)),console[_0x1db64a(0x14b)]('━'['repeat'](0x3c));const _0x27eb86={'summary':{'total':_0x14d05e[_0x1db64a(0x1cb)],'passed':_0x25611d,'failed':_0x266f72,'errors':_0x1493ec>0x0?_0x1493ec:undefined,'duration_ms':_0x4bf85b},'tests':_0x14d05e,'agent':{'project':_0x5b9c48['projectName'],'name':_0x5b9c48[_0x1db64a(0x1a3)],'site':_0x461555},'timestamp':new Date(_0x58fe52)['toISOString']()};if(_0xc56503!==_0x1db64a(0x1c1)||_0x5521b6){const _0x23add4=formatResults(_0x27eb86,_0xc56503);if(_0x5521b6)try{a5_0x454be6[_0x1db64a(0x15a)](_0x5521b6,_0x23add4,'utf-8'),console[_0x1db64a(0x14b)](),console[_0x1db64a(0x14b)](a5_0x30cc29[_0x1db64a(0x19c)](_0x1db64a(0x185)+_0x5521b6));}catch(_0x211888){return console[_0x1db64a(0x14b)](),console['log'](a5_0x30cc29[_0x1db64a(0x164)](_0x1db64a(0x1bd)+_0x211888)),0x1;}else console[_0x1db64a(0x14b)](),console['log'](_0x23add4);}const _0xb74677=_0x14d05e[_0x1db64a(0x157)](_0x19ac6a=>_0x19ac6a[_0x1db64a(0x1c5)]!=='PASS');return _0xb74677[_0x1db64a(0x1cb)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x3ab92d=a6_0x4436;function a6_0x4436(_0x1887bd,_0x108869){_0x1887bd=_0x1887bd-0x14a;const _0x22ab8a=a6_0x22ab();let _0x4436b6=_0x22ab8a[_0x1887bd];return _0x4436b6;}(function(_0x35efab,_0x240d87){const _0x396c17=a6_0x4436,_0x279a41=_0x35efab();while(!![]){try{const _0x199e0a=parseInt(_0x396c17(0x181))/0x1*(parseInt(_0x396c17(0x16a))/0x2)+-parseInt(_0x396c17(0x186))/0x3+-parseInt(_0x396c17(0x168))/0x4+-parseInt(_0x396c17(0x173))/0x5*(-parseInt(_0x396c17(0x182))/0x6)+parseInt(_0x396c17(0x169))/0x7+-parseInt(_0x396c17(0x165))/0x8*(-parseInt(_0x396c17(0x177))/0x9)+parseInt(_0x396c17(0x174))/0xa*(-parseInt(_0x396c17(0x172))/0xb);if(_0x199e0a===_0x240d87)break;else _0x279a41['push'](_0x279a41['shift']());}catch(_0x3a1b0c){_0x279a41['push'](_0x279a41['shift']());}}}(a6_0x22ab,0xf158b));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';function a6_0x22ab(){const _0x109450=['file','stack','proxy-authorization','toUpperCase','authorization','headers','GET','Invalid\x20header\x20format:\x20\x22','output','trim','data','request','set-cookie2','body','workflow','has','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','\x22.\x20','cookie','noColor','56EVRsOH','entries','status','7559328eMDTEc','11336661qylqiQ','2jLspnh','startsWith','llm','color','llm-proxy','length','validate','isArray','1109383vNARNp','779365SqXPXx','40gPDeKW','readBodyFromFile','header','7101GgFKhD','DELETE','execute','keys','Results\x20saved\x20to\x20','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','x-auth-token','type','cas','method','525109kZNuAe','60nesdnI','error','substring','cdp','1281258vcArem','POST','api','message','includes','\x0aStack\x20trace:\x0a','Endpoint\x20must\x20start\x20with\x20/:\x20','verbose','log','x-trino-user','.\x20Valid\x20types:\x20','set-cookie','Error:\x20'];a6_0x22ab=function(){return _0x109450;};return a6_0x22ab();}import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x3ab92d(0x155),a6_0x3ab92d(0x153),a6_0x3ab92d(0x163),a6_0x3ab92d(0x14f),a6_0x3ab92d(0x15d),'x-xsrf-token',a6_0x3ab92d(0x17d),a6_0x3ab92d(0x14d)]);function isSensitiveHeader(_0xc0bff7){const _0x4e8897=a6_0x3ab92d;return SENSITIVE_HEADERS[_0x4e8897(0x160)](_0xc0bff7['toLowerCase']());}function parseHeader(_0x2fc97e){const _0x3e7dc1=a6_0x3ab92d,_0x1b42e5=_0x2fc97e['indexOf'](':');if(_0x1b42e5===-0x1)throw new Error(_0x3e7dc1(0x158)+_0x2fc97e+_0x3e7dc1(0x162)+_0x3e7dc1(0x17c));const _0x5cfae0=_0x2fc97e[_0x3e7dc1(0x184)](0x0,_0x1b42e5)['trim'](),_0x11c220=_0x2fc97e[_0x3e7dc1(0x184)](_0x1b42e5+0x1)[_0x3e7dc1(0x15a)]();if(!_0x5cfae0)throw new Error(_0x3e7dc1(0x161)+_0x2fc97e+'\x22');return[_0x5cfae0,_0x11c220];}export class ApiCommand extends BaseCommand{['name']=a6_0x3ab92d(0x188);['description']='Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs';[a6_0x3ab92d(0x170)](_0x2548df){const _0x91bb86=a6_0x3ab92d,{args:_0x315753,options:_0x51953b}=_0x2548df,_0x5c699b=_0x51953b;if(_0x315753[_0x91bb86(0x16f)]===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x2df350=_0x315753[0x0];if(!_0x2df350[_0x91bb86(0x16b)]('/'))return _0x91bb86(0x14a)+_0x2df350;const _0x3f04ca=_0x5c699b[_0x91bb86(0x15b)],_0x1b76c0=_0x5c699b[_0x91bb86(0x151)];if(_0x3f04ca&&_0x1b76c0)return'Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.';const _0x960fa5=_0x5c699b[_0x91bb86(0x180)]||_0x91bb86(0x157),_0x4e7783=[_0x91bb86(0x157),_0x91bb86(0x187),'PUT',_0x91bb86(0x178),'PATCH'];if(!_0x4e7783[_0x91bb86(0x18a)](_0x960fa5[_0x91bb86(0x154)]()))return'Invalid\x20HTTP\x20method:\x20'+_0x960fa5+'.\x20Valid\x20methods:\x20'+_0x4e7783['join'](',\x20');const _0x3af774=_0x5c699b[_0x91bb86(0x17e)]||'td',_0x4a7e04=['td',_0x91bb86(0x185),_0x91bb86(0x15f),'trino',_0x91bb86(0x16c),_0x91bb86(0x16e),_0x91bb86(0x17f)];if(!_0x4a7e04['includes'](_0x3af774))return'Invalid\x20API\x20type:\x20'+_0x3af774+_0x91bb86(0x14e)+_0x4a7e04['join'](',\x20');return undefined;}async[a6_0x3ab92d(0x179)](_0x2113f5){const _0x1360b8=a6_0x3ab92d,{options:_0x517680,args:_0x3cd8dc,tdx:_0x1469ab}=_0x2113f5,_0x55aa25=_0x517680,_0x1c6f9d=_0x3cd8dc[0x0],_0x518ff6=(_0x55aa25[_0x1360b8(0x180)]||_0x1360b8(0x157))[_0x1360b8(0x154)](),_0x16c3b9=_0x55aa25[_0x1360b8(0x15b)],_0x1310e7=_0x55aa25[_0x1360b8(0x151)],_0x26e02b=_0x55aa25[_0x1360b8(0x176)],_0x10d4bc=_0x55aa25[_0x1360b8(0x17e)]||'td';try{const _0x44791e={};if(_0x26e02b){const _0x11cc49=Array[_0x1360b8(0x171)](_0x26e02b)?_0x26e02b:[_0x26e02b];for(const _0x2996a4 of _0x11cc49){const [_0x3e088b,_0x5eff6b]=parseHeader(_0x2996a4);_0x44791e[_0x3e088b]=_0x5eff6b;}}let _0x57bae4;if(_0x16c3b9)_0x57bae4=_0x16c3b9;else{if(_0x1310e7)try{_0x57bae4=RawAPI[_0x1360b8(0x175)](_0x1310e7);}catch(_0x477341){return console[_0x1360b8(0x183)](_0x1360b8(0x150)+(_0x477341 instanceof Error?_0x477341[_0x1360b8(0x189)]:String(_0x477341))),0x1;}}const _0x2b24d5={'method':_0x518ff6,'apiType':_0x10d4bc,'includeHeaders':_0x517680[_0x1360b8(0x14b)]};_0x57bae4&&(_0x2b24d5[_0x1360b8(0x15e)]=_0x57bae4);Object[_0x1360b8(0x17a)](_0x44791e)[_0x1360b8(0x16f)]>0x0&&(_0x2b24d5[_0x1360b8(0x156)]=_0x44791e);if(_0x517680['verbose']){const _0x128a89=resolveSite(_0x517680['site']),_0x5a5885=getEndpoint(_0x128a89,_0x10d4bc),_0x2b9418=''+_0x5a5885+_0x1c6f9d;console[_0x1360b8(0x183)]('>\x20'+_0x518ff6+'\x20'+_0x2b9418);const _0xc5b1ea=getAuthHeaders(_0x128a89),_0x3d4e76={..._0xc5b1ea,..._0x44791e};for(const [_0x3718ad,_0xa50dfc]of Object[_0x1360b8(0x166)](_0x3d4e76)){!isSensitiveHeader(_0x3718ad)&&console[_0x1360b8(0x183)]('>\x20'+_0x3718ad+':\x20'+_0xa50dfc);}_0x57bae4&&console[_0x1360b8(0x183)]('>'),console[_0x1360b8(0x183)]('');}const _0x3e7854=await _0x1469ab[_0x1360b8(0x188)][_0x1360b8(0x15c)](_0x1c6f9d,_0x2b24d5);if(_0x517680[_0x1360b8(0x14b)]&&_0x3e7854[_0x1360b8(0x156)]){console[_0x1360b8(0x183)]('<\x20HTTP/1.1\x20'+_0x3e7854[_0x1360b8(0x167)]);for(const [_0x4e212a,_0x14c11a]of Object['entries'](_0x3e7854[_0x1360b8(0x156)])){!isSensitiveHeader(_0x4e212a)&&console[_0x1360b8(0x183)]('<\x20'+_0x4e212a+':\x20'+_0x14c11a);}console[_0x1360b8(0x183)]('');}const _0x1820e9=Boolean(_0x517680[_0x1360b8(0x159)]),_0x3d683d={'color':_0x517680['color'],'noColor':_0x517680[_0x1360b8(0x164)]||_0x1820e9&&!_0x517680[_0x1360b8(0x16d)]},_0x405549=colorizeJSON(_0x3e7854['data'],_0x3d683d);return _0x517680['output']?(writeFileSync(_0x517680[_0x1360b8(0x159)],_0x405549),console[_0x1360b8(0x183)](_0x1360b8(0x17b)+_0x517680[_0x1360b8(0x159)])):console[_0x1360b8(0x14c)](_0x405549),0x0;}catch(_0x402ee6){return _0x402ee6 instanceof Error?(console[_0x1360b8(0x183)](_0x1360b8(0x150)+_0x402ee6[_0x1360b8(0x189)]),_0x517680[_0x1360b8(0x14b)]&&_0x402ee6[_0x1360b8(0x152)]&&console[_0x1360b8(0x183)](_0x1360b8(0x18b)+_0x402ee6[_0x1360b8(0x152)])):console['error'](_0x1360b8(0x150)+String(_0x402ee6)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a7_0x488b54=a7_0xce7e;function a7_0xce7e(_0x54439d,_0x1b9316){_0x54439d=_0x54439d-0xf7;const _0x47bf78=a7_0x47bf();let _0xce7e9=_0x47bf78[_0x54439d];return _0xce7e9;}(function(_0x4fbd04,_0x1e8201){const _0x56fa94=a7_0xce7e,_0x4e167b=_0x4fbd04();while(!![]){try{const _0x38fd71=-parseInt(_0x56fa94(0x157))/0x1*(-parseInt(_0x56fa94(0x15b))/0x2)+-parseInt(_0x56fa94(0x124))/0x3*(parseInt(_0x56fa94(0x152))/0x4)+-parseInt(_0x56fa94(0x14b))/0x5*(-parseInt(_0x56fa94(0x13c))/0x6)+-parseInt(_0x56fa94(0x118))/0x7+-parseInt(_0x56fa94(0x103))/0x8+parseInt(_0x56fa94(0x14c))/0x9+parseInt(_0x56fa94(0xfb))/0xa*(parseInt(_0x56fa94(0x119))/0xb);if(_0x38fd71===_0x1e8201)break;else _0x4e167b['push'](_0x4e167b['shift']());}catch(_0x16aa75){_0x4e167b['push'](_0x4e167b['shift']());}}}(a7_0x47bf,0x61312));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync,loadGlobalProxy}from'../core/config.js';import{getOAuthTokens,saveOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';function a7_0x47bf(){const _0x495265=['✗\x20Validation\x20failed:\x20','email','Sign\x20in\x20with\x20browser\x20(recommended)','98265AEAloy','\x20(site:\x20','method','Validating\x20OAuth\x20tokens...','2nbFbhC','trim','getUserInfo','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','10UVxqyD','tdx:\x20auth\x20setup','site','✓\x20Default\x20site\x20set\x20to\x20','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','For\x20scripts\x20or\x20headless\x20servers','execute','select','3778800JnZRMB','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','text','all','join','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','warn','cyan','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','description','red','auth:clear','System\x20keychain\x20is\x20not\x20available','\x27\x20registered','us01','Read\x20credential\x20from\x20','Read\x20credential\x20from\x20keychain','OAuth\x20tokens','Opening\x20browser\x20for\x20authentication...','\x20(profile:\x20','\x20and\x20','2548217bcFEuB','13713458ZRTjZB','\x20for\x20profile:\x20','create','ERROR','jobs','bold','API\x20key\x20cannot\x20be\x20empty','message','first_name','filter','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','15987JSwfYE','tdx\x20profile:\x20','Setup\x20cancelled','accountName','\x20removed\x20from\x20keychain','dim','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','oauth','You\x20can\x20find\x20your\x20API\x20key\x20at:','Setup\x20API\x20key\x20authentication\x20interactively','Choose\x20how\x20to\x20sign\x20in:','yellow','Credential\x20type:\x20OAuth','Enter\x20your\x20TD\x20API\x20key:','log','Name:\x20','\x20\x20tdx','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','last_name','✓\x20Profile\x20\x27','Use\x20an\x20API\x20key','auth:setup','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','2202OHsrWP','\x20--profile\x20','password','No\x20credentials\x20found\x20in\x20keychain','error','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','✓\x20Authentication\x20successful\x0a','tdx:\x20auth\x20clear','profile','/users/initiate_sso\x20(account:\x20','apiKey','Setting\x20up\x20authentication\x20for\x20site:\x20','apikey','auth','logLevel','2880BeWXmM','1179981bmWICW','/oauth/authorize','/app/mp/ak','\x20\x20user_id:','access_token','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','340lcMAoL','name'];a7_0x47bf=function(){return _0x495265;};return a7_0x47bf();}import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{startOAuthFlow}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x27a895 from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a7_0x4a8097 from'chalk';export async function runOAuthLoginFlow(_0xe7f617,_0x25593f,_0x27e1ab,_0x37ff47){const _0x51a81f=a7_0xce7e,_0x530ad0=await isKeychainAvailable();if(!_0x530ad0)throw new Error(_0x51a81f(0x10b)+_0x51a81f(0x136));let _0x33d86d=_0x37ff47?.[_0x51a81f(0x127)];if(!_0x33d86d){const _0x1f923f=await a7_0x27a895({'type':_0x51a81f(0x105),'name':_0x51a81f(0x127),'message':_0x51a81f(0x104)});if(_0x1f923f[_0x51a81f(0x127)]===undefined)throw new Error('Setup\x20cancelled');_0x33d86d=_0x1f923f[_0x51a81f(0x127)][_0x51a81f(0xf7)]()||undefined;}const _0x760d2b=getConsoleUrl(_0xe7f617);console['log'](_0x51a81f(0x115));_0x33d86d?console[_0x51a81f(0x132)]('\x20\x20'+_0x760d2b+_0x51a81f(0x145)+_0x33d86d+')'):console[_0x51a81f(0x132)]('\x20\x20'+_0x760d2b+_0x51a81f(0x14d));console[_0x51a81f(0x132)](_0x51a81f(0xf9));const _0x531927=loadGlobalProxy()||process.env.HTTPS_PROXY||process.env.HTTP_PROXY,_0x3aba48=await startOAuthFlow(_0xe7f617,{'accountName':_0x33d86d,'proxy':_0x531927});console[_0x51a81f(0x132)](_0x51a81f(0x15a));const _0x1b45b9=TDX[_0x51a81f(0x11b)]({'site':_0xe7f617,'accessToken':_0x3aba48[_0x51a81f(0x150)],'logLevel':_0x27e1ab??LogLevel[_0x51a81f(0x11c)]}),_0x21c44f=await _0x1b45b9[_0x51a81f(0x11d)][_0x51a81f(0xf8)]();console[_0x51a81f(0x132)](a7_0x4a8097['green']('✓\x20Signed\x20in\x20successfully')),console[_0x51a81f(0x132)]('\x20\x20'+a7_0x4a8097[_0x51a81f(0x10a)](_0xe7f617+':'+_0x21c44f['account_id'])+_0x51a81f(0x14f)+_0x21c44f['id']+'\x20\x20('+_0x21c44f['email']+')');!_0x33d86d&&(console[_0x51a81f(0x132)](a7_0x4a8097[_0x51a81f(0x129)]('\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:')),console[_0x51a81f(0x132)](a7_0x4a8097[_0x51a81f(0x129)](_0x51a81f(0xfa))),console[_0x51a81f(0x132)](a7_0x4a8097[_0x51a81f(0x129)](_0x51a81f(0x135))));await saveOAuthTokens(_0x3aba48,_0x25593f),console[_0x51a81f(0x132)]('✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain'+(_0x25593f?_0x51a81f(0x116)+_0x25593f+')':''));if(_0x25593f){const _0x45ab14={'site':_0xe7f617};saveProfileToUserConfig(_0x25593f,_0x45ab14),console['log'](_0x51a81f(0x138)+_0x25593f+_0x51a81f(0x110));}else saveDefaultSiteToUserConfig(_0xe7f617),console[_0x51a81f(0x132)](_0x51a81f(0xfe)+_0xe7f617);const _0x56d972=_0x25593f?_0x51a81f(0x13d)+_0x25593f:'';console[_0x51a81f(0x132)](),console[_0x51a81f(0x132)](_0x51a81f(0xff)),console[_0x51a81f(0x132)](_0x51a81f(0x134)+_0x56d972+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console['log'](_0x51a81f(0x134)+_0x56d972+_0x51a81f(0x151));}export async function promptAuthMethod(){const _0xd0361a=a7_0xce7e,_0x3309c4=await a7_0x27a895({'type':_0xd0361a(0x102),'name':_0xd0361a(0x159),'message':_0xd0361a(0x12e),'choices':[{'title':_0xd0361a(0x156),'description':'Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','value':'oauth'},{'title':_0xd0361a(0x139),'description':_0xd0361a(0x100),'value':_0xd0361a(0x148)}]});return _0x3309c4[_0xd0361a(0x159)]||null;}export class AuthSetupCommand extends BaseCommand{[a7_0x488b54(0x153)]=a7_0x488b54(0x13a);['description']=a7_0x488b54(0x12d);async[a7_0x488b54(0x101)](_0xfa1b4b){const _0x3aa772=a7_0x488b54,{options:_0x258c9e}=_0xfa1b4b,_0x4f4273=_0x258c9e[_0x3aa772(0x144)];console[_0x3aa772(0x132)](a7_0x4a8097[_0x3aa772(0x11e)](_0x3aa772(0xfc)));const _0x4f12de=_0x258c9e[_0x3aa772(0xfd)]||_0x3aa772(0x111),_0x4c95b6=await promptSiteSelection(_0x4f12de,_0x4f4273,_0x3aa772(0x126));if(!_0x4c95b6)return 0x1;const _0x15daf9=resolveSite(_0x4c95b6),_0x666d6=await promptAuthMethod();if(!_0x666d6)return console[_0x3aa772(0x132)]('\x0aSetup\x20cancelled'),0x1;if(_0x666d6===_0x3aa772(0x12b)){const {accountName:_0x1d539c}=_0x258c9e;return await runOAuthLoginFlow(_0x15daf9,_0x4f4273,_0x258c9e[_0x3aa772(0x14a)]??LogLevel[_0x3aa772(0x11c)],{'accountName':_0x1d539c}),0x0;}console[_0x3aa772(0x132)](_0x3aa772(0x147)+_0x15daf9),console[_0x3aa772(0x132)](_0x3aa772(0x12c)),console[_0x3aa772(0x132)]('\x20\x20'+getConsoleUrl(_0x15daf9,_0x3aa772(0x14e)));const _0x51652b=await a7_0x27a895({'type':_0x3aa772(0x13e),'name':'apiKey','message':_0x3aa772(0x131),'validate':_0x5bcb82=>{const _0x54bafb=_0x3aa772;if(!_0x5bcb82||!_0x5bcb82[_0x54bafb(0xf7)]())return _0x54bafb(0x11f);return!![];}});if(!_0x51652b[_0x3aa772(0x146)])return console['log']('\x0aSetup\x20cancelled'),0x1;const _0x19b07f=_0x51652b[_0x3aa772(0x146)];console['log']('Validating\x20API\x20key...');try{const _0x3c8edb=TDX[_0x3aa772(0x11b)]({'site':_0x15daf9,'apiKey':_0x19b07f['trim'](),'logLevel':_0x258c9e[_0x3aa772(0x14a)]??LogLevel[_0x3aa772(0x11c)]}),_0x1ee532=await _0x3c8edb[_0x3aa772(0x11d)][_0x3aa772(0xf8)]();console['log'](_0x3aa772(0x141)+_0x1ee532['email']+')');const _0x12fca1=await isKeychainAvailable();_0x12fca1?(await saveAPIKeyAsync(_0x19b07f[_0x3aa772(0xf7)](),_0x15daf9,_0x4f4273),console['log'](_0x3aa772(0x123)+(_0x4f4273?_0x3aa772(0x116)+_0x4f4273+')':''))):(console[_0x3aa772(0x109)](a7_0x4a8097[_0x3aa772(0x12f)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0x3aa772(0x109)](a7_0x4a8097[_0x3aa772(0x12f)](_0x3aa772(0x108))));if(_0x4f4273){const _0x3ac421={'site':_0x15daf9};saveProfileToUserConfig(_0x4f4273,_0x3ac421),console[_0x3aa772(0x132)]('✓\x20Profile\x20\x27'+_0x4f4273+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x15daf9),console[_0x3aa772(0x132)](_0x3aa772(0xfe)+_0x15daf9);const _0x4bbf67=_0x4f4273?'\x20--profile\x20'+_0x4f4273:'';return console['log'](),console[_0x3aa772(0x132)](_0x3aa772(0xff)),console[_0x3aa772(0x132)](_0x3aa772(0x134)+_0x4bbf67+_0x3aa772(0x12a)),console[_0x3aa772(0x132)](_0x3aa772(0x134)+_0x4bbf67+_0x3aa772(0x151)),0x0;}catch(_0x33a53e){if(_0x33a53e instanceof HTTPClientError&&_0x33a53e['status']===0x191)return printAuthError(_0x33a53e),0x1;return console['error'](a7_0x4a8097['red'](_0x3aa772(0x154)+(_0x33a53e instanceof Error?_0x33a53e['message']:String(_0x33a53e)))),console['error']('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x488b54(0x153)]=a7_0x488b54(0x149);['description']=a7_0x488b54(0x13b);async['execute'](_0x394b2b){const _0x20731d=a7_0x488b54,{options:_0x3e300d,tdx:_0x1bc869}=_0x394b2b,_0x403cb4=_0x3e300d[_0x20731d(0xfd)],_0x2cbceb=_0x3e300d[_0x20731d(0x144)],_0x34b140=_0x2cbceb?_0x2cbceb:'N/A';console[_0x20731d(0x132)](_0x20731d(0x125)+_0x34b140+_0x20731d(0x158)+_0x403cb4+')');const _0x3a01a5=await getOAuthTokens(_0x2cbceb);if(_0x3a01a5)console['log'](_0x20731d(0x130)),console[_0x20731d(0x132)](_0x20731d(0x113)+(_0x2cbceb?_0x20731d(0x116)+_0x2cbceb+')':''));else{const _0x5a29f2=await resolveAPIKeyAsync(_0x403cb4,_0x2cbceb);if(_0x5a29f2){const {source:_0x5cd09d,isDeprecated:_0x315516}=_0x5a29f2,_0x4778d1=_0x20731d(0x112)+_0x5cd09d;console[_0x20731d(0x132)](_0x315516?a7_0x4a8097[_0x20731d(0x12f)](_0x4778d1):_0x4778d1);}else console[_0x20731d(0x132)](a7_0x4a8097[_0x20731d(0x12f)]('No\x20credential\x20found'));}try{const _0x3566ba=await _0x1bc869[_0x20731d(0x11d)]['getUserInfo']();return console['log'](a7_0x4a8097['green'](_0x20731d(0x142))),console[_0x20731d(0x132)]('User:\x20'+_0x3566ba[_0x20731d(0x155)]),(_0x3566ba[_0x20731d(0x121)]||_0x3566ba[_0x20731d(0x137)])&&console['log'](_0x20731d(0x133)+[_0x3566ba[_0x20731d(0x121)],_0x3566ba[_0x20731d(0x137)]]['filter'](Boolean)[_0x20731d(0x107)]('\x20')),0x0;}catch(_0x59c03b){return _0x59c03b instanceof HTTPClientError&&_0x59c03b['status']===0x191?printAuthError(_0x59c03b,!![],_0x2cbceb):console[_0x20731d(0x140)](a7_0x4a8097[_0x20731d(0x10d)](_0x20731d(0x154)+(_0x59c03b instanceof Error?_0x59c03b[_0x20731d(0x120)]:String(_0x59c03b)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x488b54(0x153)]=a7_0x488b54(0x10e);[a7_0x488b54(0x10c)]='Remove\x20API\x20key\x20from\x20system\x20keychain';async[a7_0x488b54(0x101)](_0x4df59a){const _0x4c7841=a7_0x488b54,{options:_0x22db47}=_0x4df59a,_0x38762f=_0x22db47[_0x4c7841(0x144)];console[_0x4c7841(0x132)](a7_0x4a8097[_0x4c7841(0x11e)](_0x4c7841(0x143)));const _0x25f19d=await isKeychainAvailable();if(!_0x25f19d)return console[_0x4c7841(0x140)](a7_0x4a8097[_0x4c7841(0x10d)](_0x4c7841(0x10f))),0x1;const [_0x40bffb,_0x5f116e]=await Promise[_0x4c7841(0x106)]([deleteKeychainAPIKey(_0x38762f),deleteOAuthTokens(_0x38762f)]);if(_0x40bffb||_0x5f116e){clearCredentialCache();const _0x4478d5=[_0x40bffb&&'API\x20key',_0x5f116e&&_0x4c7841(0x114)][_0x4c7841(0x122)](Boolean)[_0x4c7841(0x107)](_0x4c7841(0x117));return console[_0x4c7841(0x132)]('✓\x20'+_0x4478d5+_0x4c7841(0x128)+(_0x38762f?_0x4c7841(0x116)+_0x38762f+')':'')),0x0;}else return console[_0x4c7841(0x132)](_0x4c7841(0x13f)+(_0x38762f?_0x4c7841(0x11a)+_0x38762f:'')),0x1;}}
|
|
1
|
+
const a7_0x3aba64=a7_0x2581;(function(_0x5721b5,_0x1aa985){const _0x19877b=a7_0x2581,_0x423cd5=_0x5721b5();while(!![]){try{const _0x5f4e85=-parseInt(_0x19877b(0x1d2))/0x1+-parseInt(_0x19877b(0x18f))/0x2+-parseInt(_0x19877b(0x1e4))/0x3+parseInt(_0x19877b(0x1eb))/0x4*(parseInt(_0x19877b(0x1d4))/0x5)+-parseInt(_0x19877b(0x1cd))/0x6*(-parseInt(_0x19877b(0x1a4))/0x7)+parseInt(_0x19877b(0x1d6))/0x8*(parseInt(_0x19877b(0x1c9))/0x9)+-parseInt(_0x19877b(0x1e0))/0xa*(parseInt(_0x19877b(0x1d3))/0xb);if(_0x5f4e85===_0x1aa985)break;else _0x423cd5['push'](_0x423cd5['shift']());}catch(_0x44bace){_0x423cd5['push'](_0x423cd5['shift']());}}}(a7_0x5d5a,0x67c91));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync,loadGlobalProxy}from'../core/config.js';function a7_0x5d5a(){const _0x3754e5=['jobs','\x20removed\x20from\x20keychain','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','10DbDHqZ','execute','auth:clear','User:\x20','1071651HShJqt','error','warn','site','getUserInfo','✗\x20Validation\x20failed:\x20','Read\x20credential\x20from\x20keychain','8mroDIz','cyan','method','Enter\x20your\x20TD\x20API\x20key:','N/A','ERROR','create','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','\x20--profile\x20','Validating\x20API\x20key...','accountName','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','778568hBhDNS','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','No\x20credential\x20found','log','tdx:\x20auth\x20clear','You\x20can\x20find\x20your\x20API\x20key\x20at:','first_name','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','\x27\x20registered','select','Sign\x20in\x20with\x20browser\x20(recommended)','\x20(profile:\x20','Read\x20credential\x20from\x20','oauth','Setup\x20cancelled','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','No\x20credentials\x20found\x20in\x20keychain','Setup\x20API\x20key\x20authentication\x20interactively','access_token','status','\x20(site:\x20','7lUMnHO','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','Remove\x20API\x20key\x20from\x20system\x20keychain','filter','yellow','Opening\x20browser\x20for\x20authentication...','Choose\x20how\x20to\x20sign\x20in:','✓\x20Authentication\x20successful\x0a','✓\x20Profile\x20\x27','logLevel','/users/initiate_sso\x20(account:\x20','\x20\x20tdx','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','API\x20key','auth','name','✓\x20Default\x20site\x20set\x20to\x20','password','tdx\x20profile:\x20','profile','\x20\x20(','apiKey','join','red','\x0aSetup\x20cancelled','/app/mp/ak','/oauth/authorize','\x20for\x20profile:\x20','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','✓\x20Signed\x20in\x20successfully','us01','\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','auth:setup','\x20and\x20','trim','18ihEijL','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','description','dim','4830198kzMWmG','bold','API\x20key\x20cannot\x20be\x20empty','all','email','307658oeTNIS','2449843BEwLYY','1879295LDNjtP','Use\x20an\x20API\x20key','580904EOawbb','For\x20scripts\x20or\x20headless\x20servers','Setting\x20up\x20authentication\x20for\x20site:\x20','account_id','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>'];a7_0x5d5a=function(){return _0x3754e5;};return a7_0x5d5a();}import{getOAuthTokens,saveOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{startOAuthFlow}from'../core/oauth.js';function a7_0x2581(_0x3203b3,_0x275f52){_0x3203b3=_0x3203b3-0x186;const _0x5d5a19=a7_0x5d5a();let _0x2581b3=_0x5d5a19[_0x3203b3];return _0x2581b3;}import{promptSiteSelection}from'../core/constants.js';import a7_0x358af6 from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a7_0x178e47 from'chalk';export async function runOAuthLoginFlow(_0x254ab8,_0x1df469,_0x522f7c,_0x24e50c){const _0x2f220b=a7_0x2581,_0x2ba5a7=await isKeychainAvailable();if(!_0x2ba5a7)throw new Error(_0x2f220b(0x1c1)+_0x2f220b(0x1b1));let _0x1a530c=_0x24e50c?.[_0x2f220b(0x18d)];if(!_0x1a530c){const _0x463826=await a7_0x358af6({'type':'text','name':_0x2f220b(0x18d),'message':_0x2f220b(0x1c2)});if(_0x463826[_0x2f220b(0x18d)]===undefined)throw new Error(_0x2f220b(0x19d));_0x1a530c=_0x463826[_0x2f220b(0x18d)][_0x2f220b(0x1c8)]()||undefined;}const _0x17ac24=getConsoleUrl(_0x254ab8);console[_0x2f220b(0x192)](_0x2f220b(0x1aa));_0x1a530c?console['log']('\x20\x20'+_0x17ac24+_0x2f220b(0x1af)+_0x1a530c+')'):console[_0x2f220b(0x192)]('\x20\x20'+_0x17ac24+_0x2f220b(0x1bf));console[_0x2f220b(0x192)]('Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...');const _0xa7763d=loadGlobalProxy()||process.env.HTTPS_PROXY||process.env.HTTP_PROXY,_0x45814a=await startOAuthFlow(_0x254ab8,{'accountName':_0x1a530c,'proxy':_0xa7763d});console[_0x2f220b(0x192)]('Validating\x20OAuth\x20tokens...');const _0x596bba=TDX[_0x2f220b(0x188)]({'site':_0x254ab8,'accessToken':_0x45814a[_0x2f220b(0x1a1)],'logLevel':_0x522f7c??LogLevel[_0x2f220b(0x187)]}),_0x333ac7=await _0x596bba[_0x2f220b(0x1db)][_0x2f220b(0x1e8)]();console[_0x2f220b(0x192)](a7_0x178e47['green'](_0x2f220b(0x1c3))),console[_0x2f220b(0x192)]('\x20\x20'+a7_0x178e47[_0x2f220b(0x1ec)](_0x254ab8+':'+_0x333ac7[_0x2f220b(0x1d9)])+'\x20\x20user_id:'+_0x333ac7['id']+_0x2f220b(0x1b9)+_0x333ac7[_0x2f220b(0x1d1)]+')');!_0x1a530c&&(console['log'](a7_0x178e47[_0x2f220b(0x1cc)](_0x2f220b(0x1c5))),console[_0x2f220b(0x192)](a7_0x178e47['dim'](_0x2f220b(0x1da))),console[_0x2f220b(0x192)](a7_0x178e47[_0x2f220b(0x1cc)](_0x2f220b(0x190))));await saveOAuthTokens(_0x45814a,_0x1df469),console[_0x2f220b(0x192)](_0x2f220b(0x1a5)+(_0x1df469?_0x2f220b(0x19a)+_0x1df469+')':''));if(_0x1df469){const _0x37cbc4={'site':_0x254ab8};saveProfileToUserConfig(_0x1df469,_0x37cbc4),console[_0x2f220b(0x192)](_0x2f220b(0x1ad)+_0x1df469+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x254ab8),console['log']('✓\x20Default\x20site\x20set\x20to\x20'+_0x254ab8);const _0x270ad1=_0x1df469?_0x2f220b(0x18b)+_0x1df469:'';console[_0x2f220b(0x192)](),console[_0x2f220b(0x192)](_0x2f220b(0x1de)),console['log']('\x20\x20tdx'+_0x270ad1+_0x2f220b(0x18a)),console[_0x2f220b(0x192)](_0x2f220b(0x1b0)+_0x270ad1+_0x2f220b(0x1a6));}export async function promptAuthMethod(){const _0x4bdca0=a7_0x2581,_0x15f12e=await a7_0x358af6({'type':_0x4bdca0(0x198),'name':_0x4bdca0(0x1ed),'message':_0x4bdca0(0x1ab),'choices':[{'title':_0x4bdca0(0x199),'description':_0x4bdca0(0x196),'value':'oauth'},{'title':_0x4bdca0(0x1d5),'description':_0x4bdca0(0x1d7),'value':'apikey'}]});return _0x15f12e['method']||null;}export class AuthSetupCommand extends BaseCommand{['name']=a7_0x3aba64(0x1c6);[a7_0x3aba64(0x1cb)]=a7_0x3aba64(0x1a0);async[a7_0x3aba64(0x1e1)](_0x2c4f70){const _0x1de965=a7_0x3aba64,{options:_0x383b06}=_0x2c4f70,_0x95f1de=_0x383b06[_0x1de965(0x1b8)];console[_0x1de965(0x192)](a7_0x178e47[_0x1de965(0x1ce)]('tdx:\x20auth\x20setup'));const _0x3bd5aa=_0x383b06[_0x1de965(0x1e7)]||_0x1de965(0x1c4),_0xb0d331=await promptSiteSelection(_0x3bd5aa,_0x95f1de,_0x1de965(0x19d));if(!_0xb0d331)return 0x1;const _0x3ffa86=resolveSite(_0xb0d331),_0x59f526=await promptAuthMethod();if(!_0x59f526)return console[_0x1de965(0x192)](_0x1de965(0x1bd)),0x1;if(_0x59f526===_0x1de965(0x19c)){const {accountName:_0x4b6775}=_0x383b06;return await runOAuthLoginFlow(_0x3ffa86,_0x95f1de,_0x383b06[_0x1de965(0x1ae)]??LogLevel[_0x1de965(0x187)],{'accountName':_0x4b6775}),0x0;}console[_0x1de965(0x192)](_0x1de965(0x1d8)+_0x3ffa86),console[_0x1de965(0x192)](_0x1de965(0x194)),console[_0x1de965(0x192)]('\x20\x20'+getConsoleUrl(_0x3ffa86,_0x1de965(0x1be)));const _0x8083b2=await a7_0x358af6({'type':_0x1de965(0x1b6),'name':_0x1de965(0x1ba),'message':_0x1de965(0x1ee),'validate':_0x56a100=>{const _0x4333a3=_0x1de965;if(!_0x56a100||!_0x56a100['trim']())return _0x4333a3(0x1cf);return!![];}});if(!_0x8083b2[_0x1de965(0x1ba)])return console['log']('\x0aSetup\x20cancelled'),0x1;const _0x3096bc=_0x8083b2['apiKey'];console['log'](_0x1de965(0x18c));try{const _0xc4aaa7=TDX[_0x1de965(0x188)]({'site':_0x3ffa86,'apiKey':_0x3096bc[_0x1de965(0x1c8)](),'logLevel':_0x383b06[_0x1de965(0x1ae)]??LogLevel['ERROR']}),_0x5e3014=await _0xc4aaa7[_0x1de965(0x1db)][_0x1de965(0x1e8)]();console['log'](_0x1de965(0x1df)+_0x5e3014[_0x1de965(0x1d1)]+')');const _0x7d8c63=await isKeychainAvailable();_0x7d8c63?(await saveAPIKeyAsync(_0x3096bc['trim'](),_0x3ffa86,_0x95f1de),console[_0x1de965(0x192)](_0x1de965(0x1dd)+(_0x95f1de?_0x1de965(0x19a)+_0x95f1de+')':''))):(console[_0x1de965(0x1e6)](a7_0x178e47[_0x1de965(0x1a9)](_0x1de965(0x18e))),console[_0x1de965(0x1e6)](a7_0x178e47[_0x1de965(0x1a9)](_0x1de965(0x189))));if(_0x95f1de){const _0x38c9a3={'site':_0x3ffa86};saveProfileToUserConfig(_0x95f1de,_0x38c9a3),console['log'](_0x1de965(0x1ad)+_0x95f1de+_0x1de965(0x197));}else saveDefaultSiteToUserConfig(_0x3ffa86),console[_0x1de965(0x192)](_0x1de965(0x1b5)+_0x3ffa86);const _0x110c9f=_0x95f1de?_0x1de965(0x18b)+_0x95f1de:'';return console[_0x1de965(0x192)](),console[_0x1de965(0x192)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console['log'](_0x1de965(0x1b0)+_0x110c9f+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x1de965(0x192)]('\x20\x20tdx'+_0x110c9f+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x2a202c){if(_0x2a202c instanceof HTTPClientError&&_0x2a202c[_0x1de965(0x1a2)]===0x191)return printAuthError(_0x2a202c),0x1;return console['error'](a7_0x178e47[_0x1de965(0x1bc)](_0x1de965(0x1e9)+(_0x2a202c instanceof Error?_0x2a202c['message']:String(_0x2a202c)))),console[_0x1de965(0x1e5)](_0x1de965(0x19e)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x3aba64(0x1b4)]=a7_0x3aba64(0x1b3);[a7_0x3aba64(0x1cb)]=a7_0x3aba64(0x1ca);async[a7_0x3aba64(0x1e1)](_0x4f9625){const _0x236fae=a7_0x3aba64,{options:_0x323623,tdx:_0x432a3f}=_0x4f9625,_0x2f4c87=_0x323623['site'],_0x4092e5=_0x323623[_0x236fae(0x1b8)],_0x137833=_0x4092e5?_0x4092e5:_0x236fae(0x186);console[_0x236fae(0x192)](_0x236fae(0x1b7)+_0x137833+_0x236fae(0x1a3)+_0x2f4c87+')');const _0x1f9ed6=await getOAuthTokens(_0x4092e5);if(_0x1f9ed6)console[_0x236fae(0x192)]('Credential\x20type:\x20OAuth'),console[_0x236fae(0x192)](_0x236fae(0x1ea)+(_0x4092e5?_0x236fae(0x19a)+_0x4092e5+')':''));else{const _0x2c5731=await resolveAPIKeyAsync(_0x2f4c87,_0x4092e5);if(_0x2c5731){const {source:_0x21c98f,isDeprecated:_0x389589}=_0x2c5731,_0x2d3110=_0x236fae(0x19b)+_0x21c98f;console['log'](_0x389589?a7_0x178e47[_0x236fae(0x1a9)](_0x2d3110):_0x2d3110);}else console['log'](a7_0x178e47[_0x236fae(0x1a9)](_0x236fae(0x191)));}try{const _0x3bf799=await _0x432a3f['jobs']['getUserInfo']();return console[_0x236fae(0x192)](a7_0x178e47['green'](_0x236fae(0x1ac))),console['log'](_0x236fae(0x1e3)+_0x3bf799[_0x236fae(0x1d1)]),(_0x3bf799[_0x236fae(0x195)]||_0x3bf799['last_name'])&&console[_0x236fae(0x192)]('Name:\x20'+[_0x3bf799[_0x236fae(0x195)],_0x3bf799['last_name']][_0x236fae(0x1a8)](Boolean)['join']('\x20')),0x0;}catch(_0x544de8){return _0x544de8 instanceof HTTPClientError&&_0x544de8[_0x236fae(0x1a2)]===0x191?printAuthError(_0x544de8,!![],_0x4092e5):console[_0x236fae(0x1e5)](a7_0x178e47[_0x236fae(0x1bc)]('✗\x20Validation\x20failed:\x20'+(_0x544de8 instanceof Error?_0x544de8['message']:String(_0x544de8)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x3aba64(0x1b4)]=a7_0x3aba64(0x1e2);[a7_0x3aba64(0x1cb)]=a7_0x3aba64(0x1a7);async[a7_0x3aba64(0x1e1)](_0x4a08bc){const _0x4994b1=a7_0x3aba64,{options:_0x5dc371}=_0x4a08bc,_0x39dc21=_0x5dc371[_0x4994b1(0x1b8)];console['log'](a7_0x178e47[_0x4994b1(0x1ce)](_0x4994b1(0x193)));const _0x31efb8=await isKeychainAvailable();if(!_0x31efb8)return console['error'](a7_0x178e47[_0x4994b1(0x1bc)]('System\x20keychain\x20is\x20not\x20available')),0x1;const [_0x1ce3fb,_0x6f8cea]=await Promise[_0x4994b1(0x1d0)]([deleteKeychainAPIKey(_0x39dc21),deleteOAuthTokens(_0x39dc21)]);if(_0x1ce3fb||_0x6f8cea){clearCredentialCache();const _0x31e396=[_0x1ce3fb&&_0x4994b1(0x1b2),_0x6f8cea&&'OAuth\x20tokens']['filter'](Boolean)[_0x4994b1(0x1bb)](_0x4994b1(0x1c7));return console[_0x4994b1(0x192)]('✓\x20'+_0x31e396+_0x4994b1(0x1dc)+(_0x39dc21?_0x4994b1(0x19a)+_0x39dc21+')':'')),0x0;}else return console[_0x4994b1(0x192)](_0x4994b1(0x19f)+(_0x39dc21?_0x4994b1(0x1c0)+_0x39dc21:'')),0x1;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cas-command.d.ts","sourceRoot":"","sources":["../../src/commands/cas-command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAqBhE;;GAEG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAC7C,QAAQ,CAAC,IAAI,cAAc;IAC3B,QAAQ,CAAC,WAAW,+BAA+B;IAE7C,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAmCxD;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAC7C,QAAQ,CAAC,IAAI,cAAc;IAC3B,QAAQ,CAAC,WAAW,oCAAoC;IAElD,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAuDxD;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAC7C,QAAQ,CAAC,IAAI,cAAc;IAC3B,QAAQ,CAAC,WAAW,4CAA4C;IAE1D,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAuFxD;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAC7C,QAAQ,CAAC,IAAI,cAAc;IAC3B,QAAQ,CAAC,WAAW,gCAAgC;IAE9C,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"cas-command.d.ts","sourceRoot":"","sources":["../../src/commands/cas-command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAqBhE;;GAEG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAC7C,QAAQ,CAAC,IAAI,cAAc;IAC3B,QAAQ,CAAC,WAAW,+BAA+B;IAE7C,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAmCxD;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAC7C,QAAQ,CAAC,IAAI,cAAc;IAC3B,QAAQ,CAAC,WAAW,oCAAoC;IAElD,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAuDxD;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAC7C,QAAQ,CAAC,IAAI,cAAc;IAC3B,QAAQ,CAAC,WAAW,4CAA4C;IAE1D,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAuFxD;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAC7C,QAAQ,CAAC,IAAI,cAAc;IAC3B,QAAQ,CAAC,WAAW,gCAAgC;IAE9C,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAgPxD;AAED;;;;;;;;;;;;;GAaG;AACH,qBAAa,kBAAmB,SAAQ,WAAW;IACjD,QAAQ,CAAC,IAAI,kBAAkB;IAC/B,QAAQ,CAAC,WAAW,qDAAqD;IAEnE,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CA2FxD;AAED;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,WAAW;IAChD,QAAQ,CAAC,IAAI,iBAAiB;IAC9B,QAAQ,CAAC,WAAW,6CAA6C;IAE3D,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CA0DxD"}
|