@treasuredata/tdx 2026.4.17 → 2026.4.19
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.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.d.ts +38 -0
- package/dist/commands/engage-command.d.ts.map +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-command.js.map +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/tools/work-create-item.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.d.ts +26 -1
- package/dist/sdk/client/engage-api-client.d.ts.map +1 -1
- 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.d.ts +1 -1
- package/dist/sdk/client/http-client.d.ts.map +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/http-client.js.map +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-validator.js.map +1 -1
- package/dist/sdk/engage/campaign-yaml.d.ts +1 -1
- package/dist/sdk/engage/campaign-yaml.d.ts.map +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js.map +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.d.ts +2 -2
- package/dist/sdk/engage/types/campaign-def.d.ts.map +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js.map +1 -1
- package/dist/sdk/engage/types/campaign-schema.d.ts +256 -8
- package/dist/sdk/engage/types/campaign-schema.d.ts.map +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js.map +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.d.ts +28 -1
- package/dist/sdk/engage.d.ts.map +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/engage.js.map +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.d.ts +1 -1
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/engage.d.ts +125 -1
- package/dist/sdk/types/engage.d.ts.map +1 -1
- package/dist/sdk/types/index.d.ts +1 -1
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/index.js.map +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +17 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a3_0x74b05a=a3_0x2c1f;(function(_0x50e16a,_0x82cf4b){const _0x1211d5=a3_0x2c1f,_0x3eabdd=_0x50e16a();while(!![]){try{const _0x2c3896=parseInt(_0x1211d5(0x18a))/0x1*(-parseInt(_0x1211d5(0x1a5))/0x2)+parseInt(_0x1211d5(0x184))/0x3*(parseInt(_0x1211d5(0x192))/0x4)+-parseInt(_0x1211d5(0x1a1))/0x5+parseInt(_0x1211d5(0x19c))/0x6+parseInt(_0x1211d5(0x19d))/0x7+-parseInt(_0x1211d5(0x1a0))/0x8+parseInt(_0x1211d5(0x18f))/0x9;if(_0x2c3896===_0x82cf4b)break;else _0x3eabdd['push'](_0x3eabdd['shift']());}catch(_0x5ee127){_0x3eabdd['push'](_0x3eabdd['shift']());}}}(a3_0x53d1,0xc222d));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a3_0x53d1(){const _0x5808a3=['resolveSegmentId','Resolving\x20child\x20segment\x20\x27','1106223NCHynZ','site','listActivations','Resolving\x20parent\x20segment\x20\x27','description','31758453xJYuxL','verbose','segment','105544tMytps','data','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','Child\x20name:\x20','error','name','List\x20activations\x20for\x20a\x20segment','execute','\x27...','resolveParentId','1440666EuEpau','921725UDwHnQ','\x20\x20Cause:\x20','Parent\x20name:\x20','7034088JlHKmc','6786560sCNMCD','cause','length','Error:\x20','2KCfPGw','27SZNmoL','Resolved\x20child\x20ID:\x20','✔\x20Found\x20','Error:\x20Segment\x20name\x20is\x20required'];a3_0x53d1=function(){return _0x5808a3;};return a3_0x53d1();}function a3_0x2c1f(_0x577e67,_0x4dae01){_0x577e67=_0x577e67-0x184;const _0x53d1c6=a3_0x53d1();let _0x2c1f04=_0x53d1c6[_0x577e67];return _0x2c1f04;}import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x74b05a(0x197)]='activations';[a3_0x74b05a(0x18e)]=a3_0x74b05a(0x198);async[a3_0x74b05a(0x199)](_0x168125){const _0x11d4f1=a3_0x74b05a,{options:_0x250c74,args:_0x7b0122,tdx:_0x5a1c06}=_0x168125;if(_0x7b0122['length']===0x0)return console[_0x11d4f1(0x196)](_0x11d4f1(0x187)),console[_0x11d4f1(0x196)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;try{const {parentId:_0x415c4b,childId:_0x54eae4}=parseSegmentRef(_0x7b0122[0x0]);if(!_0x54eae4)return console[_0x11d4f1(0x196)](_0x11d4f1(0x194)),console['error']('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;_0x250c74[_0x11d4f1(0x190)]&&(console['error']('Site:\x20'+_0x250c74[_0x11d4f1(0x18b)]),console[_0x11d4f1(0x196)](_0x11d4f1(0x19f)+_0x415c4b),console[_0x11d4f1(0x196)](_0x11d4f1(0x195)+_0x54eae4));const _0x1d3b04=await withSpinner(_0x11d4f1(0x18d)+_0x415c4b+_0x11d4f1(0x19a),()=>_0x5a1c06[_0x11d4f1(0x191)][_0x11d4f1(0x19b)](_0x415c4b),{'verbose':_0x250c74[_0x11d4f1(0x190)]}),_0x17ff4a=_0x1d3b04[_0x11d4f1(0x193)];_0x250c74[_0x11d4f1(0x190)]&&console[_0x11d4f1(0x196)]('Resolved\x20parent\x20ID:\x20'+_0x17ff4a);const _0x4a7fdd=await withSpinner(_0x11d4f1(0x189)+_0x54eae4+_0x11d4f1(0x19a),()=>_0x5a1c06['segment'][_0x11d4f1(0x188)](_0x17ff4a,_0x54eae4),{'verbose':_0x250c74['verbose']}),_0x5d858b=_0x4a7fdd['data'];_0x250c74[_0x11d4f1(0x190)]&&console[_0x11d4f1(0x196)](_0x11d4f1(0x185)+_0x5d858b);const _0x4cb694=await withSpinner('Listing\x20activations\x20for\x20segment\x20\x27'+_0x54eae4+'\x27...',()=>_0x5a1c06[_0x11d4f1(0x191)][_0x11d4f1(0x18c)](_0x17ff4a,_0x5d858b),{'verbose':_0x250c74[_0x11d4f1(0x190)]}),_0xe77ad5=_0x4cb694[_0x11d4f1(0x193)];return console['error'](_0x11d4f1(0x186)+_0xe77ad5[_0x11d4f1(0x1a3)]+'\x20activation'+(_0xe77ad5['length']!==0x1?'s':'')),await handleSDKOutput(_0xe77ad5,_0x250c74),0x0;}catch(_0x1caafc){if(_0x1caafc instanceof SDKError)return console['error'](_0x11d4f1(0x1a4)+_0x1caafc['message']),_0x1caafc[_0x11d4f1(0x1a2)]&&console['error'](_0x11d4f1(0x19e)+_0x1caafc['cause']),0x1;throw _0x1caafc;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x2fdcfe=a4_0x267c;(function(_0x20096c,_0x38b5fe){const _0x5c096f=a4_0x267c,_0xeb9299=_0x20096c();while(!![]){try{const _0x4add96=parseInt(_0x5c096f(0x1dd))/0x1*(parseInt(_0x5c096f(0x1fc))/0x2)+-parseInt(_0x5c096f(0x18b))/0x3+parseInt(_0x5c096f(0x17c))/0x4+-parseInt(_0x5c096f(0x17a))/0x5+-parseInt(_0x5c096f(0x1f9))/0x6+parseInt(_0x5c096f(0x1e0))/0x7+-parseInt(_0x5c096f(0x205))/0x8*(-parseInt(_0x5c096f(0x190))/0x9);if(_0x4add96===_0x38b5fe)break;else _0xeb9299['push'](_0xeb9299['shift']());}catch(_0x482e6e){_0xeb9299['push'](_0xeb9299['shift']());}}}(a4_0x13d0,0x657c8));import a4_0x2cca95 from'chalk';import a4_0x5933e5 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a4_0x13d0(){const _0x223708=['Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x0aChanges\x20to\x20chat\x20interface\x20\x27','reason','context','unchanged','Using\x20project\x20from\x20','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','llmProject','projectId','Agent\x20pulled\x20successfully','counts','hasChanges','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','Output:\x20','Pushing\x20agent\x20from\x20\x22','join','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','green','action','\x20=\x20','agentName','agent:push','outputDir','agent.yml','Project\x20cloned\x20with\x20errors','131947MTWjHY','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','534597MiHTkf','Project:\x20','\x20\x20tdx\x20agent\x20clone\x20agents/','\x20\x20Form\x20Interface\x20\x22','knowledgeBases','profile','created','yellow','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','INVALID_ARGUMENT','\x0aWrite\x20','\x20updated','-\x20nothing\x20pushed','session','\x20\x20Form\x20Interfaces:\x20','textKnowledgeBases','\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','updated','pushProject','projectDir','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','experimentalKnowledgeBases','utf-8','\x20created','output','245706FkNjdN','Agent\x20','total','2RZSyFX','\x20\x20Agent\x20\x22','agentId','llm','execute','Cloning\x20\x22','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','source','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','15752CyYykP','\x22\x20from\x20project\x20\x22','Using\x20project\x20from\x20context:\x20','agents','\x20--profile\x20','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','chatInterfaces','\x20\x20Experimental\x20Artifact\x20\x22','tdx.json','Project\x20cloned\x20successfully','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x0aChanges:','\x20successfully','Status:\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','newProjectId','\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','dryRun','diff','name','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','arg-dir','found','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x20\x20Agents:\x20','\x20total','Using\x20context\x20project:\x20','cwd-config','New\x20project:\x20','\x20\x20Knowledge\x20Bases:\x20','newProjectName','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','Using\x20project:\x20','\x20\x20Chat\x20Interfaces:\x20','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','yes','Using\x20current\x20project:\x20','Clone\x20\x22','\x20\x20Text\x20Knowledge\x20Bases:\x20','Chat:\x20','message','agent:clone','integrations','\x0aError:','Using\x20local\x20project:\x20','error','\x20\x20Text\x20Knowledge\x20Base\x20\x22','prompts','sourceProjectName','\x22:\x20','pullProject','\x0aPull\x20summary\x20for\x20\x27','agent','\x20unchanged','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','\x20\x20tdx\x20agent\x20pull\x20','Source:\x20','Would\x20clone:','3611920ykhsrU','Cancelled','3085016zabEHx','\x0aChanges\x20to\x20form\x20interface\x20\x27','\x20changed','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','Pulling\x20agent\x20\x22','\x20\x20Source:\x20','Errors:','repeat','\x20\x20Knowledge\x20Base\x20\x22','Analyzing\x20project\x20\x22','New\x20project\x20ID:\x20','gray','\x0aChanges\x20to\x20integration\x20\x27','description','\x20\x20Experimental\x20Artifacts:\x20','2361054lcxtmI','\x22\x20to\x20\x22','\x20\x20Chat\x20Interface\x20\x22','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','No\x20tdx.json\x20found\x20in\x20','4509rFqzWA','\x20files?','\x22...','log','✔\x20Context\x20set:\x20','\x20resources?','push','Failed\x20to\x20push\x20agent:\x20','new','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x0aChanges\x20to\x20agent\x20\x27','cyan','\x20\x20Prompt\x20\x22','cwd','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Pushing\x20to\x20project...','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)','Agent:\x20','\x20\x20Prompts:\x20','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','errors','\x0aProject\x20pushed\x20with\x20errors','Summary:','\x20\x20Integration\x20\x22','parse','Dry\x20run\x20-\x20no\x20files\x20written','\x20new','dim','red','New\x20project\x20name\x20is\x20required','-\x20no\x20files\x20written','cloneProject','Cannot\x20clone\x20from\x20context\x20project\x20\x22','\x0aPush\x20','Dry\x20run\x20-\x20no\x20changes\x20made','dirname','\x20\x20Integrations:\x20','projectName','site','MISSING_ARGUMENT','force','llm_project','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x20--name\x20','experimentalArtifacts','Analyzing\x20changes\x20to\x20push...','\x0aChanges\x20to\x20prompt\x20\x27','\x20|\x20','\x0a✔\x20Pulled\x20','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','formInterfaces','pushAgent'];a4_0x13d0=function(){return _0x223708;};return a4_0x13d0();}import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';function a4_0x267c(_0x2b44d7,_0x2b5e8b){_0x2b44d7=_0x2b44d7-0x173;const _0x13d02b=a4_0x13d0();let _0x267c1c=_0x13d02b[_0x2b44d7];return _0x267c1c;}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(_0x357bda){const _0x166ebc=a4_0x267c,_0x4adde3=[];if(_0x357bda[_0x166ebc(0x1fb)]!==undefined)_0x4adde3[_0x166ebc(0x196)](_0x357bda[_0x166ebc(0x1fb)]+_0x166ebc(0x21e));if(_0x357bda['new']!==undefined&&_0x357bda[_0x166ebc(0x198)]>0x0)_0x4adde3[_0x166ebc(0x196)](a4_0x2cca95[_0x166ebc(0x1d5)](_0x357bda[_0x166ebc(0x198)]+_0x166ebc(0x1aa)));if(_0x357bda['created']!==undefined&&_0x357bda[_0x166ebc(0x1e6)]>0x0)_0x4adde3[_0x166ebc(0x196)](a4_0x2cca95[_0x166ebc(0x1d5)](_0x357bda['created']+_0x166ebc(0x1f7)));if(_0x357bda['updated']!==undefined&&_0x357bda[_0x166ebc(0x1f1)]>0x0)_0x4adde3['push'](a4_0x2cca95[_0x166ebc(0x1e7)](_0x357bda[_0x166ebc(0x1f1)]+_0x166ebc(0x1eb)));if(_0x357bda[_0x166ebc(0x1c8)]!==undefined&&_0x357bda['unchanged']>0x0)_0x4adde3[_0x166ebc(0x196)](a4_0x2cca95[_0x166ebc(0x187)](_0x357bda[_0x166ebc(0x1c8)]+_0x166ebc(0x175)));if(_0x357bda[_0x166ebc(0x1a4)]!==undefined&&_0x357bda['errors']>0x0)_0x4adde3[_0x166ebc(0x196)](a4_0x2cca95[_0x166ebc(0x1ac)](_0x357bda[_0x166ebc(0x1a4)]+'\x20errors'));return _0x4adde3[_0x166ebc(0x1d3)](',\x20');}function displayDiffs(_0x15a005,_0x104962,_0x5ee80e,_0x27f6fa,_0x4d148c,_0x520700,_0x3e00a8,_0x190b84,_0xc77917){const _0x14db1e=a4_0x267c;for(const _0xedbedf of _0x15a005){if(_0xedbedf[_0x14db1e(0x217)]){const _0x385ddd=_0xedbedf[_0x14db1e(0x1d8)]||_0xedbedf[_0x14db1e(0x218)];console[_0x14db1e(0x193)](_0x14db1e(0x19a)+_0x385ddd+'\x27:'),console[_0x14db1e(0x193)]('─'[_0x14db1e(0x183)](0x3c)),console[_0x14db1e(0x193)](_0xedbedf[_0x14db1e(0x217)]),console[_0x14db1e(0x193)]('─'[_0x14db1e(0x183)](0x3c));}}for(const _0x16a735 of _0x104962){_0x16a735[_0x14db1e(0x217)]&&(console[_0x14db1e(0x193)](_0x14db1e(0x21c)+_0x16a735[_0x14db1e(0x218)]+'\x27:'),console[_0x14db1e(0x193)]('─'['repeat'](0x3c)),console[_0x14db1e(0x193)](_0x16a735[_0x14db1e(0x217)]),console[_0x14db1e(0x193)]('─'[_0x14db1e(0x183)](0x3c)));}for(const _0x458b70 of _0x5ee80e){_0x458b70[_0x14db1e(0x217)]&&(console[_0x14db1e(0x193)](_0x14db1e(0x1f4)+_0x458b70[_0x14db1e(0x218)]+'\x27:'),console['log']('─'[_0x14db1e(0x183)](0x3c)),console['log'](_0x458b70[_0x14db1e(0x217)]),console[_0x14db1e(0x193)]('─'[_0x14db1e(0x183)](0x3c)));}for(const _0x3dd502 of _0x27f6fa){_0x3dd502[_0x14db1e(0x217)]&&(console[_0x14db1e(0x193)](_0x14db1e(0x1be)+_0x3dd502[_0x14db1e(0x218)]+'\x27:'),console[_0x14db1e(0x193)]('─'[_0x14db1e(0x183)](0x3c)),console[_0x14db1e(0x193)](_0x3dd502[_0x14db1e(0x217)]),console[_0x14db1e(0x193)]('─'[_0x14db1e(0x183)](0x3c)));}for(const _0x4dd8c1 of _0x4d148c){_0x4dd8c1[_0x14db1e(0x217)]&&(console[_0x14db1e(0x193)](_0x14db1e(0x188)+_0x4dd8c1[_0x14db1e(0x218)]+'\x27:'),console[_0x14db1e(0x193)]('─'[_0x14db1e(0x183)](0x3c)),console[_0x14db1e(0x193)](_0x4dd8c1[_0x14db1e(0x217)]),console[_0x14db1e(0x193)]('─'[_0x14db1e(0x183)](0x3c)));}for(const _0x4421e5 of _0x520700){_0x4421e5['diff']&&(console[_0x14db1e(0x193)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x4421e5['name']+'\x27:'),console['log']('─'[_0x14db1e(0x183)](0x3c)),console['log'](_0x4421e5[_0x14db1e(0x217)]),console[_0x14db1e(0x193)]('─'['repeat'](0x3c)));}for(const _0x352967 of _0x3e00a8){_0x352967['diff']&&(console[_0x14db1e(0x193)](_0x14db1e(0x1de)+_0x352967['name']+'\x27:'),console[_0x14db1e(0x193)]('─'[_0x14db1e(0x183)](0x3c)),console['log'](_0x352967[_0x14db1e(0x217)]),console[_0x14db1e(0x193)]('─'[_0x14db1e(0x183)](0x3c)));}for(const _0x2913b6 of _0x190b84){_0x2913b6[_0x14db1e(0x217)]&&(console[_0x14db1e(0x193)](_0x14db1e(0x17d)+_0x2913b6[_0x14db1e(0x218)]+'\x27:'),console[_0x14db1e(0x193)]('─'[_0x14db1e(0x183)](0x3c)),console[_0x14db1e(0x193)](_0x2913b6[_0x14db1e(0x217)]),console['log']('─'['repeat'](0x3c)));}for(const _0x57471c of _0xc77917){_0x57471c['diff']&&(console['log'](_0x14db1e(0x1c5)+_0x57471c['name']+'\x27:'),console[_0x14db1e(0x193)]('─'[_0x14db1e(0x183)](0x3c)),console[_0x14db1e(0x193)](_0x57471c[_0x14db1e(0x217)]),console['log']('─'[_0x14db1e(0x183)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']='agent:pull';[a4_0x2fdcfe(0x189)]=a4_0x2fdcfe(0x224);async['execute'](_0x59965e){const _0x3c9492=a4_0x2fdcfe,{options:_0x14be59,args:_0x5f17cf,tdx:_0x5efed4}=_0x59965e,_0x51df4a=_0x5f17cf[0x0],_0x1d473f=_0x5f17cf[0x1],_0x444fdd=_0x14be59[_0x3c9492(0x1f8)],_0x551879=_0x14be59['dryRun'],_0x500ae0=_0x14be59[_0x3c9492(0x1b8)],_0x61e6f2=_0x14be59[_0x3c9492(0x228)],_0x404436=_0x14be59[_0x3c9492(0x1cb)],_0x2ac59c=_0x14be59[_0x3c9492(0x174)];let _0x2ff6e9;if(_0x51df4a){const _0x5b1330=a4_0x5933e5['join'](_0x51df4a,_0x3c9492(0x20d));if(existsSync(_0x5b1330))try{const _0x39d66c=JSON[_0x3c9492(0x1a8)](readFileSync(_0x5b1330,'utf-8'));_0x39d66c['llm_project']&&(_0x2ff6e9={'llm_project':_0x39d66c[_0x3c9492(0x1b9)]});}catch{}}const _0x1a0cf0=findAgentConfigPath(process[_0x3c9492(0x19d)]());let _0x211967;if(_0x1a0cf0)try{const _0x2e2c7d=JSON[_0x3c9492(0x1a8)](readFileSync(_0x1a0cf0,_0x3c9492(0x1f6)));_0x2e2c7d[_0x3c9492(0x1b9)]&&(_0x211967={'llm_project':_0x2e2c7d[_0x3c9492(0x1b9)]});}catch{}const _0x4ed349=resolveAgentPullArgs({'arg':_0x51df4a,'agentNameArg':_0x1d473f,'agentFlag':_0x2ac59c,'contextProject':_0x404436,'argDirConfig':_0x2ff6e9,'cwdConfigPath':_0x1a0cf0||undefined,'cwdConfig':_0x211967}),{projectNameOrId:_0x5bfc5b,targetAgentName:_0x4d34c2,existingOutputDir:_0xe9fffb,source:_0x3afdfd}=_0x4ed349;if(_0x3afdfd===_0x3c9492(0x21a))console['log'](a4_0x2cca95[_0x3c9492(0x1ab)](_0x3c9492(0x1c9)+a4_0x5933e5[_0x3c9492(0x1d3)](_0x51df4a,'tdx.json')+':\x20'+_0x5bfc5b));else{if(_0x3afdfd===_0x3c9492(0x220))console[_0x3c9492(0x193)](a4_0x2cca95[_0x3c9492(0x1ab)](_0x3c9492(0x225)+_0x5bfc5b));else _0x3afdfd===_0x3c9492(0x1c7)&&console['log'](a4_0x2cca95['dim'](_0x3c9492(0x207)+_0x5bfc5b));}if(!_0x5bfc5b)return _0x2ac59c?(console[_0x3c9492(0x193)](a4_0x2cca95[_0x3c9492(0x1e7)](_0x3c9492(0x20a))),console[_0x3c9492(0x193)](_0x3c9492(0x219)),console[_0x3c9492(0x193)]('Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>')):(console['log'](a4_0x2cca95[_0x3c9492(0x1e7)](_0x3c9492(0x176))),console['log'](_0x3c9492(0x1a0)),console['log'](_0x3c9492(0x1f0)),console[_0x3c9492(0x193)](_0x3c9492(0x215)),console[_0x3c9492(0x193)]('\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[_0x3c9492(0x193)]('\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(_0x4d34c2){const {data:_0x456bac}=await withSpinner(_0x3c9492(0x180)+_0x4d34c2+_0x3c9492(0x206)+_0x5bfc5b+'\x22...',()=>_0x5efed4[_0x3c9492(0x1ff)]['pullAgent'](_0x5bfc5b,_0x4d34c2,_0x444fdd,{'dryRun':_0x551879,'force':_0x500ae0}));if(_0x551879)return console['log'](a4_0x2cca95[_0x3c9492(0x1e7)](_0x3c9492(0x1a9))),console[_0x3c9492(0x193)]('Would\x20pull\x20agent:\x20'+_0x456bac['agentName']),console[_0x3c9492(0x193)]('Output\x20path:\x20'+_0x456bac['outputPath']),_0x456bac[_0x3c9492(0x217)]&&(console[_0x3c9492(0x193)](_0x3c9492(0x210)),console['log']('─'[_0x3c9492(0x183)](0x3c)),console[_0x3c9492(0x193)](_0x456bac[_0x3c9492(0x217)]),console[_0x3c9492(0x193)]('─'['repeat'](0x3c))),0x0;return console['log'](a4_0x2cca95[_0x3c9492(0x1d5)](_0x3c9492(0x1cd))),console[_0x3c9492(0x193)](_0x3c9492(0x1a1)+_0x456bac[_0x3c9492(0x1d8)]),console[_0x3c9492(0x193)](_0x3c9492(0x1d1)+_0x456bac['outputPath']),console[_0x3c9492(0x193)](_0x3c9492(0x212)+(_0x456bac['isNew']?a4_0x2cca95[_0x3c9492(0x1d5)](_0x3c9492(0x198)):_0x456bac[_0x3c9492(0x1cf)]?a4_0x2cca95[_0x3c9492(0x1e7)](_0x3c9492(0x1f1)):a4_0x2cca95[_0x3c9492(0x187)]('unchanged'))),0x0;}const _0x4d8c20=_0xe9fffb||_0x444fdd,{data:_0x58ad87}=await withSpinner(_0x3c9492(0x185)+_0x5bfc5b+_0x3c9492(0x192),()=>_0x5efed4[_0x3c9492(0x1ff)]['pullProject'](_0x5bfc5b,_0x4d8c20,{'dryRun':!![]})),_0x2120b2=_0x58ad87[_0x3c9492(0x1ce)][_0x3c9492(0x208)]['new']+_0x58ad87['counts'][_0x3c9492(0x1e4)][_0x3c9492(0x198)]+_0x58ad87['counts']['textKnowledgeBases']['new']+_0x58ad87[_0x3c9492(0x1ce)][_0x3c9492(0x234)]['new']+_0x58ad87[_0x3c9492(0x1ce)]['integrations'][_0x3c9492(0x198)]+_0x58ad87['counts'][_0x3c9492(0x1f5)][_0x3c9492(0x198)]+_0x58ad87[_0x3c9492(0x1ce)]['experimentalArtifacts'][_0x3c9492(0x198)]+_0x58ad87[_0x3c9492(0x1ce)][_0x3c9492(0x1c2)]['new']+_0x58ad87[_0x3c9492(0x1ce)]['chatInterfaces'][_0x3c9492(0x198)],_0x50db2d=_0x58ad87[_0x3c9492(0x1ce)][_0x3c9492(0x208)]['updated']+_0x58ad87[_0x3c9492(0x1ce)][_0x3c9492(0x1e4)]['updated']+_0x58ad87[_0x3c9492(0x1ce)][_0x3c9492(0x1ef)][_0x3c9492(0x1f1)]+_0x58ad87[_0x3c9492(0x1ce)][_0x3c9492(0x234)]['updated']+_0x58ad87['counts'][_0x3c9492(0x22f)][_0x3c9492(0x1f1)]+_0x58ad87[_0x3c9492(0x1ce)][_0x3c9492(0x1f5)][_0x3c9492(0x1f1)]+_0x58ad87[_0x3c9492(0x1ce)][_0x3c9492(0x1bc)][_0x3c9492(0x1f1)]+_0x58ad87[_0x3c9492(0x1ce)]['formInterfaces'][_0x3c9492(0x1f1)]+_0x58ad87[_0x3c9492(0x1ce)][_0x3c9492(0x20b)][_0x3c9492(0x1f1)],_0x1f00aa=_0x58ad87['counts']['agents'][_0x3c9492(0x1c8)]+_0x58ad87[_0x3c9492(0x1ce)][_0x3c9492(0x1e4)][_0x3c9492(0x1c8)]+_0x58ad87['counts'][_0x3c9492(0x1ef)]['unchanged']+_0x58ad87[_0x3c9492(0x1ce)][_0x3c9492(0x234)][_0x3c9492(0x1c8)]+_0x58ad87['counts'][_0x3c9492(0x22f)][_0x3c9492(0x1c8)]+_0x58ad87[_0x3c9492(0x1ce)][_0x3c9492(0x1f5)]['unchanged']+_0x58ad87['counts'][_0x3c9492(0x1bc)][_0x3c9492(0x1c8)]+_0x58ad87[_0x3c9492(0x1ce)][_0x3c9492(0x1c2)]['unchanged']+_0x58ad87['counts']['chatInterfaces'][_0x3c9492(0x1c8)];console[_0x3c9492(0x193)](_0x3c9492(0x173)+_0x58ad87[_0x3c9492(0x1b5)]+'\x27:'),console[_0x3c9492(0x193)]('\x20\x20'+a4_0x2cca95['green']('+\x20'+_0x2120b2+'\x20new')+'\x20|\x20'+a4_0x2cca95[_0x3c9492(0x1e7)]('~\x20'+_0x50db2d+'\x20changed')+_0x3c9492(0x1bf)+a4_0x2cca95[_0x3c9492(0x1ab)]('=\x20'+_0x1f00aa+_0x3c9492(0x175))),console[_0x3c9492(0x193)](_0x3c9492(0x21d)+formatCountSummary(_0x58ad87[_0x3c9492(0x1ce)][_0x3c9492(0x208)])),console[_0x3c9492(0x193)](_0x3c9492(0x222)+formatCountSummary(_0x58ad87['counts'][_0x3c9492(0x1e4)])),console['log']('\x20\x20Text\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x58ad87[_0x3c9492(0x1ce)][_0x3c9492(0x1ef)])),console[_0x3c9492(0x193)](_0x3c9492(0x1a2)+formatCountSummary(_0x58ad87[_0x3c9492(0x1ce)]['prompts'])),console[_0x3c9492(0x193)](_0x3c9492(0x1b4)+formatCountSummary(_0x58ad87[_0x3c9492(0x1ce)][_0x3c9492(0x22f)])),console['log'](_0x3c9492(0x1ee)+formatCountSummary(_0x58ad87['counts'][_0x3c9492(0x1c2)])),console['log'](_0x3c9492(0x226)+formatCountSummary(_0x58ad87[_0x3c9492(0x1ce)][_0x3c9492(0x20b)]));const _0x6887b4=_0x58ad87[_0x3c9492(0x1ce)][_0x3c9492(0x1f5)][_0x3c9492(0x1fb)]>0x0||_0x58ad87[_0x3c9492(0x1ce)][_0x3c9492(0x1bc)][_0x3c9492(0x1fb)]>0x0;_0x6887b4&&(console['log'](_0x3c9492(0x1d4)+formatCountSummary(_0x58ad87[_0x3c9492(0x1ce)][_0x3c9492(0x1f5)])),console[_0x3c9492(0x193)](_0x3c9492(0x18a)+formatCountSummary(_0x58ad87[_0x3c9492(0x1ce)][_0x3c9492(0x1bc)])));console['log']('\x20\x20Target:\x20'+a4_0x2cca95[_0x3c9492(0x19b)](_0x58ad87[_0x3c9492(0x1da)])),displayDiffs(_0x58ad87[_0x3c9492(0x208)],_0x58ad87[_0x3c9492(0x1e4)],_0x58ad87['textKnowledgeBases'],_0x58ad87['prompts'],_0x58ad87[_0x3c9492(0x22f)],_0x58ad87[_0x3c9492(0x1f5)],_0x58ad87['experimentalArtifacts'],_0x58ad87['formInterfaces'],_0x58ad87['chatInterfaces']);if(_0x551879)return console[_0x3c9492(0x193)](a4_0x2cca95[_0x3c9492(0x1e7)](_0x3c9492(0x19e))),0x0;if(_0x2120b2===0x0&&_0x50db2d===0x0)return console[_0x3c9492(0x193)](a4_0x2cca95['green'](_0x3c9492(0x202))),saveSessionContext({'llm_project':_0x58ad87[_0x3c9492(0x1b5)]},_0x14be59[_0x3c9492(0x1ed)]),console[_0x3c9492(0x193)](a4_0x2cca95[_0x3c9492(0x1d5)](_0x3c9492(0x194)+a4_0x2cca95[_0x3c9492(0x1ab)](_0x3c9492(0x1b9))+'\x20=\x20'+a4_0x2cca95[_0x3c9492(0x19b)](_0x58ad87[_0x3c9492(0x1b5)]))),0x0;if(!_0x61e6f2&&!_0x500ae0){if(!isInteractive())return console[_0x3c9492(0x232)](a4_0x2cca95[_0x3c9492(0x1ac)](_0x3c9492(0x230)),_0x3c9492(0x1c4)),console[_0x3c9492(0x232)](a4_0x2cca95[_0x3c9492(0x1ab)](_0x3c9492(0x18e))),0x1;const _0x25feca=await confirmKey(_0x3c9492(0x1ea)+(_0x2120b2+_0x50db2d)+_0x3c9492(0x191));if(!_0x25feca)return console[_0x3c9492(0x193)](a4_0x2cca95[_0x3c9492(0x1e7)]('Cancelled'),_0x3c9492(0x1ae)),0x1;}const {data:_0x5508e6}=await withSpinner('Writing\x20files...',()=>_0x5efed4['llm'][_0x3c9492(0x237)](_0x5bfc5b,_0x4d8c20,{'force':_0x500ae0}));return console[_0x3c9492(0x193)](a4_0x2cca95['green'](_0x3c9492(0x1c0)+(_0x2120b2+_0x50db2d)+'\x20files\x20to\x20'+_0x5508e6[_0x3c9492(0x1da)])),saveSessionContext({'llm_project':_0x5508e6['projectName']},_0x14be59[_0x3c9492(0x1ed)]),console[_0x3c9492(0x193)](a4_0x2cca95[_0x3c9492(0x1d5)](_0x3c9492(0x194)+a4_0x2cca95[_0x3c9492(0x1ab)](_0x3c9492(0x1b9))+_0x3c9492(0x1d7)+a4_0x2cca95[_0x3c9492(0x19b)](_0x5508e6[_0x3c9492(0x1b5)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']=a4_0x2fdcfe(0x22e);['description']=a4_0x2fdcfe(0x17f);async[a4_0x2fdcfe(0x200)](_0x3c1ffe){const _0x1e7136=a4_0x2fdcfe,{options:_0x3b8b2e,args:_0x25538d,tdx:_0x462a9a}=_0x3c1ffe,_0x43b81e=_0x25538d[0x0],_0x3706d8=_0x3b8b2e['name'],_0x5eb3d1=_0x3b8b2e[_0x1e7136(0x216)],_0x5cf43e=_0x3b8b2e['yes'],_0x895ee8=_0x3b8b2e[_0x1e7136(0x1b6)],_0x24723e=_0x3b8b2e[_0x1e7136(0x1cb)];let _0x5c9902;const _0x59b01e=findAgentConfigPath(process[_0x1e7136(0x19d)]());if(_0x43b81e){const _0x5e13ab=a4_0x5933e5[_0x1e7136(0x1d3)](_0x43b81e,'tdx.json');existsSync(_0x5e13ab)?(_0x5c9902=_0x43b81e,console[_0x1e7136(0x193)](a4_0x2cca95[_0x1e7136(0x1ab)](_0x1e7136(0x231)+_0x43b81e))):_0x5c9902=_0x43b81e;}else{if(_0x59b01e)_0x5c9902=a4_0x5933e5[_0x1e7136(0x1b3)](_0x59b01e),console[_0x1e7136(0x193)](a4_0x2cca95[_0x1e7136(0x1ab)](_0x1e7136(0x229)+_0x5c9902));else{if(_0x24723e){const _0x502f30=sanitizeForFilesystem(_0x24723e);let _0x51d84f=_0x502f30,_0x3660c3=a4_0x5933e5[_0x1e7136(0x1d3)](process[_0x1e7136(0x19d)](),'agents',_0x502f30,_0x1e7136(0x20d));if(!existsSync(_0x3660c3)){const _0x35a677=normalizeName(_0x24723e),_0x4b6e27=a4_0x5933e5['join'](process[_0x1e7136(0x19d)](),'agents',_0x35a677,_0x1e7136(0x20d));existsSync(_0x4b6e27)&&(_0x51d84f=_0x35a677,_0x3660c3=_0x4b6e27);}if(existsSync(_0x3660c3))_0x5c9902=a4_0x5933e5[_0x1e7136(0x1b3)](_0x3660c3),console[_0x1e7136(0x193)](a4_0x2cca95['dim'](_0x1e7136(0x231)+_0x5c9902));else{const _0x5d3e0c=_0x3b8b2e[_0x1e7136(0x1e5)];if(_0x5d3e0c)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x1e7136(0x1b0)+_0x24723e+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x1e7136(0x1a3)+_0x1e7136(0x204)+(_0x1e7136(0x177)+_0x24723e+'\x0a')+(_0x1e7136(0x1e2)+_0x51d84f+_0x1e7136(0x1bb)+(_0x3706d8||'<new-name>')+_0x1e7136(0x209)+_0x5d3e0c)});_0x5c9902=_0x24723e,console['log'](a4_0x2cca95[_0x1e7136(0x1ab)](_0x1e7136(0x21f)+_0x24723e));}}}}if(!_0x5c9902)return console[_0x1e7136(0x193)](a4_0x2cca95[_0x1e7136(0x1e7)](_0x1e7136(0x1d0))),console['log'](_0x1e7136(0x199)),console[_0x1e7136(0x193)](_0x1e7136(0x1c1)),console[_0x1e7136(0x193)]('\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'](_0x1e7136(0x1df)),0x1;if(!_0x3706d8)throw new SDKError(ErrorCode[_0x1e7136(0x1b7)],_0x1e7136(0x1ad),undefined,{'helpText':_0x1e7136(0x20f)});if(!_0x5cf43e&&!_0x5eb3d1){if(!isInteractive())return console['error'](a4_0x2cca95['red'](_0x1e7136(0x230)),_0x1e7136(0x1c4)),console[_0x1e7136(0x232)](a4_0x2cca95[_0x1e7136(0x1ab)](_0x1e7136(0x18e))),0x1;const _0x30ca39=await confirmKey(_0x1e7136(0x22a)+_0x5c9902+'\x22\x20to\x20new\x20project\x20\x22'+_0x3706d8+'\x22?');if(!_0x30ca39)return console['log'](a4_0x2cca95['yellow'](_0x1e7136(0x17b))),0x1;}const {data:_0x38affd}=await withSpinner(_0x1e7136(0x201)+_0x5c9902+_0x1e7136(0x18c)+_0x3706d8+_0x1e7136(0x192),()=>_0x462a9a[_0x1e7136(0x1ff)][_0x1e7136(0x1af)](_0x5c9902,_0x3706d8,{'dryRun':_0x5eb3d1}));if(_0x5eb3d1){console[_0x1e7136(0x193)](a4_0x2cca95['yellow']('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x1e7136(0x193)](_0x1e7136(0x178)+_0x38affd[_0x1e7136(0x235)]),console[_0x1e7136(0x193)]('New\x20project:\x20'+_0x3706d8),console[_0x1e7136(0x193)](_0x1e7136(0x179)),console[_0x1e7136(0x193)]('\x20\x20Agents:\x20'+_0x38affd[_0x1e7136(0x1ce)][_0x1e7136(0x208)][_0x1e7136(0x1e6)]),console[_0x1e7136(0x193)]('\x20\x20Knowledge\x20Bases:\x20'+_0x38affd['counts'][_0x1e7136(0x1e4)][_0x1e7136(0x1e6)]),console[_0x1e7136(0x193)](_0x1e7136(0x1a2)+_0x38affd[_0x1e7136(0x1ce)][_0x1e7136(0x234)][_0x1e7136(0x1e6)]),console[_0x1e7136(0x193)]('\x20\x20Form\x20Interfaces:\x20'+_0x38affd['counts']['formInterfaces'][_0x1e7136(0x1e6)]),console['log']('\x20\x20Chat\x20Interfaces:\x20'+_0x38affd['counts'][_0x1e7136(0x20b)][_0x1e7136(0x1e6)]);const _0x3f88e9=_0x38affd['counts'][_0x1e7136(0x1f5)]['created']>0x0||_0x38affd[_0x1e7136(0x1ce)][_0x1e7136(0x1bc)][_0x1e7136(0x1e6)]>0x0;return _0x3f88e9&&(console['log']('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+_0x38affd[_0x1e7136(0x1ce)][_0x1e7136(0x1f5)][_0x1e7136(0x1e6)]),console[_0x1e7136(0x193)](_0x1e7136(0x18a)+_0x38affd[_0x1e7136(0x1ce)]['experimentalArtifacts'][_0x1e7136(0x1e6)])),0x0;}const _0x2803c6=_0x38affd[_0x1e7136(0x1ce)][_0x1e7136(0x208)][_0x1e7136(0x1a4)]>0x0||_0x38affd[_0x1e7136(0x1ce)]['knowledgeBases'][_0x1e7136(0x1a4)]>0x0||_0x38affd[_0x1e7136(0x1ce)]['prompts'][_0x1e7136(0x1a4)]>0x0||_0x38affd[_0x1e7136(0x1ce)][_0x1e7136(0x1c2)]['errors']>0x0||_0x38affd[_0x1e7136(0x1ce)]['chatInterfaces'][_0x1e7136(0x1a4)]>0x0||_0x38affd['counts'][_0x1e7136(0x1f5)][_0x1e7136(0x1a4)]>0x0||_0x38affd[_0x1e7136(0x1ce)]['experimentalArtifacts']['errors']>0x0;_0x2803c6?console[_0x1e7136(0x193)](a4_0x2cca95['yellow'](_0x1e7136(0x1dc))):console[_0x1e7136(0x193)](a4_0x2cca95[_0x1e7136(0x1d5)](_0x1e7136(0x20e)));console[_0x1e7136(0x193)](_0x1e7136(0x178)+_0x38affd[_0x1e7136(0x235)]),console['log'](_0x1e7136(0x221)+_0x38affd[_0x1e7136(0x223)]),console['log'](_0x1e7136(0x186)+_0x38affd[_0x1e7136(0x214)]),console[_0x1e7136(0x193)](),console[_0x1e7136(0x193)](_0x1e7136(0x1a6)),console[_0x1e7136(0x193)](_0x1e7136(0x21d)+formatCountSummary(_0x38affd['counts'][_0x1e7136(0x208)])),console[_0x1e7136(0x193)](_0x1e7136(0x222)+formatCountSummary(_0x38affd[_0x1e7136(0x1ce)]['knowledgeBases'])),console[_0x1e7136(0x193)](_0x1e7136(0x1a2)+formatCountSummary(_0x38affd[_0x1e7136(0x1ce)][_0x1e7136(0x234)])),console[_0x1e7136(0x193)](_0x1e7136(0x1b4)+formatCountSummary(_0x38affd[_0x1e7136(0x1ce)][_0x1e7136(0x22f)])),console[_0x1e7136(0x193)](_0x1e7136(0x1ee)+formatCountSummary(_0x38affd[_0x1e7136(0x1ce)]['formInterfaces'])),console[_0x1e7136(0x193)]('\x20\x20Chat\x20Interfaces:\x20'+formatCountSummary(_0x38affd[_0x1e7136(0x1ce)][_0x1e7136(0x20b)]));const _0x5230ce=_0x38affd[_0x1e7136(0x1ce)][_0x1e7136(0x1f5)][_0x1e7136(0x1e6)]>0x0||_0x38affd[_0x1e7136(0x1ce)][_0x1e7136(0x1f5)][_0x1e7136(0x1f1)]>0x0||_0x38affd['counts'][_0x1e7136(0x1f5)][_0x1e7136(0x1c8)]>0x0||_0x38affd['counts'][_0x1e7136(0x1bc)][_0x1e7136(0x1e6)]>0x0||_0x38affd['counts']['experimentalArtifacts'][_0x1e7136(0x1f1)]>0x0||_0x38affd[_0x1e7136(0x1ce)][_0x1e7136(0x1bc)]['unchanged']>0x0;_0x5230ce&&(console[_0x1e7136(0x193)](_0x1e7136(0x1d4)+formatCountSummary(_0x38affd['counts'][_0x1e7136(0x1f5)])),console[_0x1e7136(0x193)](_0x1e7136(0x18a)+formatCountSummary(_0x38affd[_0x1e7136(0x1ce)][_0x1e7136(0x1bc)])));if(_0x2803c6){console[_0x1e7136(0x193)](),console[_0x1e7136(0x193)](a4_0x2cca95[_0x1e7136(0x1ac)](_0x1e7136(0x182)));for(const _0x3438bc of _0x38affd[_0x1e7136(0x208)]){_0x3438bc[_0x1e7136(0x1d6)]===_0x1e7136(0x232)&&console[_0x1e7136(0x193)](a4_0x2cca95['red']('\x20\x20Agent\x20\x22'+_0x3438bc[_0x1e7136(0x1d8)]+'\x22:\x20'+_0x3438bc['error']));}for(const _0x6a4c13 of _0x38affd[_0x1e7136(0x1e4)]){_0x6a4c13[_0x1e7136(0x1d6)]==='error'&&console[_0x1e7136(0x193)](a4_0x2cca95[_0x1e7136(0x1ac)](_0x1e7136(0x184)+_0x6a4c13[_0x1e7136(0x218)]+_0x1e7136(0x236)+_0x6a4c13['error']));}for(const _0x1c1e99 of _0x38affd[_0x1e7136(0x234)]){_0x1c1e99[_0x1e7136(0x1d6)]==='error'&&console['log'](a4_0x2cca95[_0x1e7136(0x1ac)](_0x1e7136(0x19c)+_0x1c1e99[_0x1e7136(0x218)]+_0x1e7136(0x236)+_0x1c1e99[_0x1e7136(0x232)]));}for(const _0x150313 of _0x38affd[_0x1e7136(0x22f)]){_0x150313['action']===_0x1e7136(0x232)&&console[_0x1e7136(0x193)](a4_0x2cca95[_0x1e7136(0x1ac)](_0x1e7136(0x1a7)+_0x150313['name']+_0x1e7136(0x236)+_0x150313[_0x1e7136(0x232)]));}for(const _0x15cf99 of _0x38affd['formInterfaces']){_0x15cf99['action']===_0x1e7136(0x232)&&console[_0x1e7136(0x193)](a4_0x2cca95['red'](_0x1e7136(0x1e3)+_0x15cf99[_0x1e7136(0x218)]+'\x22:\x20'+_0x15cf99[_0x1e7136(0x232)]));}for(const _0x3ca02f of _0x38affd['chatInterfaces']){_0x3ca02f[_0x1e7136(0x1d6)]===_0x1e7136(0x232)&&console['log'](a4_0x2cca95[_0x1e7136(0x1ac)]('\x20\x20Chat\x20Interface\x20\x22'+_0x3ca02f[_0x1e7136(0x218)]+_0x1e7136(0x236)+_0x3ca02f[_0x1e7136(0x232)]));}for(const _0x25a95a of _0x38affd[_0x1e7136(0x1f5)]){_0x25a95a[_0x1e7136(0x1d6)]===_0x1e7136(0x232)&&console[_0x1e7136(0x193)](a4_0x2cca95[_0x1e7136(0x1ac)](_0x1e7136(0x1ca)+_0x25a95a[_0x1e7136(0x218)]+_0x1e7136(0x236)+_0x25a95a[_0x1e7136(0x232)]));}for(const _0x506625 of _0x38affd['experimentalArtifacts']){_0x506625[_0x1e7136(0x1d6)]===_0x1e7136(0x232)&&console[_0x1e7136(0x193)](a4_0x2cca95[_0x1e7136(0x1ac)](_0x1e7136(0x20c)+_0x506625[_0x1e7136(0x218)]+_0x1e7136(0x236)+_0x506625[_0x1e7136(0x232)]));}return 0x1;}console[_0x1e7136(0x193)]();const _0x26d2b7=getLLMProjectUrl(_0x895ee8,_0x38affd[_0x1e7136(0x214)]);return console['log'](_0x1e7136(0x1e1)+a4_0x2cca95['cyan'](_0x26d2b7)),0x0;}}export class AgentPushCommand extends BaseCommand{['name']=a4_0x2fdcfe(0x1d9);[a4_0x2fdcfe(0x189)]='Push\x20local\x20agent\x20files\x20to\x20LLM\x20project';async[a4_0x2fdcfe(0x200)](_0x8b2d1d){const _0x23e7b6=a4_0x2fdcfe,{options:_0x3e2db6,args:_0x495a73,tdx:_0x2281dc}=_0x8b2d1d;let _0x5ad11e=_0x495a73[0x0]||process[_0x23e7b6(0x19d)]();const _0x43b4df=_0x3e2db6[_0x23e7b6(0x216)],_0x43b9b1=_0x3e2db6['force'],_0x24cbb7=_0x3e2db6['yes'],_0x2555a9=_0x3e2db6[_0x23e7b6(0x1b6)],_0x259e7f=a4_0x5933e5['join'](_0x5ad11e,_0x23e7b6(0x1db)),_0x5a6ff7=existsSync(_0x259e7f);if(_0x5a6ff7){const {data:_0x535b15}=await withSpinner(_0x23e7b6(0x1d2)+_0x5ad11e+'\x22...',()=>_0x2281dc[_0x23e7b6(0x1ff)][_0x23e7b6(0x1c3)](_0x5ad11e,{'dryRun':_0x43b4df,'force':_0x43b9b1}));if(_0x43b4df)return console[_0x23e7b6(0x193)](a4_0x2cca95[_0x23e7b6(0x1e7)](_0x23e7b6(0x1b2))),console[_0x23e7b6(0x193)]('Would\x20push\x20agent:\x20'+_0x535b15[_0x23e7b6(0x1d8)]),0x0;if(_0x535b15[_0x23e7b6(0x1d6)]===_0x23e7b6(0x232))return console[_0x23e7b6(0x193)](a4_0x2cca95[_0x23e7b6(0x1ac)](_0x23e7b6(0x197)+_0x535b15[_0x23e7b6(0x232)])),0x1;console[_0x23e7b6(0x193)](a4_0x2cca95[_0x23e7b6(0x1d5)](_0x23e7b6(0x1fa)+_0x535b15[_0x23e7b6(0x1d6)]+_0x23e7b6(0x211))),console[_0x23e7b6(0x193)]('Agent:\x20'+_0x535b15[_0x23e7b6(0x1d8)]);if(_0x535b15['agentId']&&_0x535b15[_0x23e7b6(0x1cc)]){const _0x3b626f=getLLMAgentChatUrl(_0x2555a9,_0x535b15[_0x23e7b6(0x1cc)],_0x535b15[_0x23e7b6(0x1fe)]);console[_0x23e7b6(0x193)](_0x23e7b6(0x22c)+a4_0x2cca95['cyan'](_0x3b626f));}return 0x0;}const _0x19ece=_0x3e2db6[_0x23e7b6(0x1cb)],_0x542592=resolveProjectFromContext(_0x5ad11e,_0x19ece);if(_0x542592[_0x23e7b6(0x21b)])_0x5ad11e=_0x542592[_0x23e7b6(0x1f3)],_0x542592[_0x23e7b6(0x203)]===_0x23e7b6(0x1c7)&&console[_0x23e7b6(0x193)](a4_0x2cca95[_0x23e7b6(0x1ab)](_0x23e7b6(0x225)+_0x5ad11e));else{let _0x5b6c90=_0x23e7b6(0x1e8);_0x542592[_0x23e7b6(0x1c6)]==='no_local_folder'&&(_0x5b6c90=_0x542592[_0x23e7b6(0x22d)]+_0x23e7b6(0x227)+_0x542592[_0x23e7b6(0x1cb)]+_0x23e7b6(0x213));throw new SDKError(ErrorCode[_0x23e7b6(0x1e9)],_0x542592[_0x23e7b6(0x1c6)]==='no_context'?_0x542592[_0x23e7b6(0x22d)]:_0x23e7b6(0x18f)+_0x5ad11e,undefined,{'helpText':_0x5b6c90});}const {data:_0x20ee30}=await withSpinner(_0x23e7b6(0x1bd),()=>_0x2281dc[_0x23e7b6(0x1ff)][_0x23e7b6(0x1f2)](_0x5ad11e,{'dryRun':!![]})),_0x2d4edd=_0x20ee30[_0x23e7b6(0x1ce)]['agents'][_0x23e7b6(0x1a4)]>0x0;if(_0x2d4edd){console[_0x23e7b6(0x193)](a4_0x2cca95[_0x23e7b6(0x1ac)]('\x0aErrors\x20found:'));for(const _0x193bdf of _0x20ee30['agents']){_0x193bdf[_0x23e7b6(0x1d6)]===_0x23e7b6(0x232)&&console[_0x23e7b6(0x193)](a4_0x2cca95['red'](_0x23e7b6(0x1fd)+_0x193bdf[_0x23e7b6(0x1d8)]+_0x23e7b6(0x236)+_0x193bdf[_0x23e7b6(0x232)]));}return 0x1;}const _0x4292de=_0x20ee30[_0x23e7b6(0x1ce)][_0x23e7b6(0x208)]['created']+_0x20ee30[_0x23e7b6(0x1ce)][_0x23e7b6(0x1e4)]['created']+_0x20ee30['counts']['textKnowledgeBases'][_0x23e7b6(0x1e6)]+_0x20ee30[_0x23e7b6(0x1ce)][_0x23e7b6(0x234)][_0x23e7b6(0x1e6)]+_0x20ee30[_0x23e7b6(0x1ce)]['integrations'][_0x23e7b6(0x1e6)]+_0x20ee30['counts'][_0x23e7b6(0x1f5)][_0x23e7b6(0x1e6)]+_0x20ee30['counts'][_0x23e7b6(0x1bc)][_0x23e7b6(0x1e6)]+_0x20ee30['counts'][_0x23e7b6(0x1c2)]['created']+_0x20ee30[_0x23e7b6(0x1ce)]['chatInterfaces'][_0x23e7b6(0x1e6)],_0x3c3f73=_0x20ee30[_0x23e7b6(0x1ce)][_0x23e7b6(0x208)][_0x23e7b6(0x1f1)]+_0x20ee30[_0x23e7b6(0x1ce)][_0x23e7b6(0x1e4)][_0x23e7b6(0x1f1)]+_0x20ee30[_0x23e7b6(0x1ce)][_0x23e7b6(0x1ef)][_0x23e7b6(0x1f1)]+_0x20ee30['counts'][_0x23e7b6(0x234)][_0x23e7b6(0x1f1)]+_0x20ee30[_0x23e7b6(0x1ce)][_0x23e7b6(0x22f)]['updated']+_0x20ee30[_0x23e7b6(0x1ce)]['experimentalKnowledgeBases'][_0x23e7b6(0x1f1)]+_0x20ee30[_0x23e7b6(0x1ce)][_0x23e7b6(0x1bc)][_0x23e7b6(0x1f1)]+_0x20ee30[_0x23e7b6(0x1ce)]['formInterfaces']['updated']+_0x20ee30['counts'][_0x23e7b6(0x20b)][_0x23e7b6(0x1f1)],_0x5e6138=_0x20ee30[_0x23e7b6(0x1ce)][_0x23e7b6(0x208)][_0x23e7b6(0x1c8)]+_0x20ee30[_0x23e7b6(0x1ce)][_0x23e7b6(0x1e4)][_0x23e7b6(0x1c8)]+_0x20ee30[_0x23e7b6(0x1ce)]['textKnowledgeBases'][_0x23e7b6(0x1c8)]+_0x20ee30[_0x23e7b6(0x1ce)][_0x23e7b6(0x234)][_0x23e7b6(0x1c8)]+_0x20ee30[_0x23e7b6(0x1ce)][_0x23e7b6(0x22f)]['unchanged']+_0x20ee30[_0x23e7b6(0x1ce)][_0x23e7b6(0x1f5)][_0x23e7b6(0x1c8)]+_0x20ee30['counts']['experimentalArtifacts'][_0x23e7b6(0x1c8)]+_0x20ee30[_0x23e7b6(0x1ce)][_0x23e7b6(0x1c2)][_0x23e7b6(0x1c8)]+_0x20ee30[_0x23e7b6(0x1ce)][_0x23e7b6(0x20b)][_0x23e7b6(0x1c8)];console[_0x23e7b6(0x193)]('\x0aPush\x20summary\x20for\x20\x27'+_0x20ee30['projectName']+'\x27:'),console[_0x23e7b6(0x193)]('\x20\x20'+a4_0x2cca95[_0x23e7b6(0x1d5)]('+\x20'+_0x4292de+'\x20new')+_0x23e7b6(0x1bf)+a4_0x2cca95[_0x23e7b6(0x1e7)]('~\x20'+_0x3c3f73+_0x23e7b6(0x17e))+_0x23e7b6(0x1bf)+a4_0x2cca95[_0x23e7b6(0x1ab)]('=\x20'+_0x5e6138+_0x23e7b6(0x175))),console['log'](_0x23e7b6(0x21d)+formatCountSummary(_0x20ee30[_0x23e7b6(0x1ce)]['agents'])),console[_0x23e7b6(0x193)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x20ee30[_0x23e7b6(0x1ce)][_0x23e7b6(0x1e4)])),console[_0x23e7b6(0x193)](_0x23e7b6(0x22b)+formatCountSummary(_0x20ee30[_0x23e7b6(0x1ce)]['textKnowledgeBases'])),console['log']('\x20\x20Prompts:\x20'+formatCountSummary(_0x20ee30[_0x23e7b6(0x1ce)]['prompts'])),console[_0x23e7b6(0x193)](_0x23e7b6(0x1b4)+formatCountSummary(_0x20ee30['counts'][_0x23e7b6(0x22f)])),console['log'](_0x23e7b6(0x1ee)+formatCountSummary(_0x20ee30[_0x23e7b6(0x1ce)][_0x23e7b6(0x1c2)])),console[_0x23e7b6(0x193)](_0x23e7b6(0x226)+formatCountSummary(_0x20ee30[_0x23e7b6(0x1ce)][_0x23e7b6(0x20b)]));const _0x19ada5=_0x20ee30[_0x23e7b6(0x1ce)][_0x23e7b6(0x1f5)][_0x23e7b6(0x1e6)]>0x0||_0x20ee30[_0x23e7b6(0x1ce)][_0x23e7b6(0x1f5)][_0x23e7b6(0x1f1)]>0x0||_0x20ee30[_0x23e7b6(0x1ce)][_0x23e7b6(0x1f5)]['unchanged']>0x0||_0x20ee30[_0x23e7b6(0x1ce)][_0x23e7b6(0x1bc)][_0x23e7b6(0x1e6)]>0x0||_0x20ee30[_0x23e7b6(0x1ce)][_0x23e7b6(0x1bc)]['updated']>0x0||_0x20ee30[_0x23e7b6(0x1ce)][_0x23e7b6(0x1bc)][_0x23e7b6(0x1c8)]>0x0;_0x19ada5&&(console[_0x23e7b6(0x193)](_0x23e7b6(0x1d4)+formatCountSummary(_0x20ee30['counts'][_0x23e7b6(0x1f5)])),console['log'](_0x23e7b6(0x18a)+formatCountSummary(_0x20ee30[_0x23e7b6(0x1ce)][_0x23e7b6(0x1bc)])));console['log'](_0x23e7b6(0x181)+a4_0x2cca95[_0x23e7b6(0x19b)](_0x5ad11e)),displayDiffs(_0x20ee30[_0x23e7b6(0x208)],_0x20ee30['knowledgeBases'],_0x20ee30[_0x23e7b6(0x1ef)],_0x20ee30[_0x23e7b6(0x234)],_0x20ee30[_0x23e7b6(0x22f)],_0x20ee30[_0x23e7b6(0x1f5)],_0x20ee30[_0x23e7b6(0x1bc)],_0x20ee30[_0x23e7b6(0x1c2)],_0x20ee30[_0x23e7b6(0x20b)]);if(_0x43b4df)return console[_0x23e7b6(0x193)](a4_0x2cca95[_0x23e7b6(0x1e7)](_0x23e7b6(0x1ba))),0x0;if(_0x4292de===0x0&&_0x3c3f73===0x0){console[_0x23e7b6(0x193)](a4_0x2cca95[_0x23e7b6(0x1d5)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x13a760=getLLMProjectUrl(_0x2555a9,_0x20ee30[_0x23e7b6(0x1cc)]);return console[_0x23e7b6(0x193)](_0x23e7b6(0x1e1)+a4_0x2cca95[_0x23e7b6(0x19b)](_0x13a760)),0x0;}if(!_0x24cbb7&&!_0x43b9b1){if(!isInteractive())return console[_0x23e7b6(0x232)](a4_0x2cca95[_0x23e7b6(0x1ac)](_0x23e7b6(0x230)),_0x23e7b6(0x1c4)),console['error'](a4_0x2cca95[_0x23e7b6(0x1ab)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x43a159=await confirmKey(_0x23e7b6(0x1b1)+(_0x4292de+_0x3c3f73)+_0x23e7b6(0x195));if(!_0x43a159)return console[_0x23e7b6(0x193)](a4_0x2cca95[_0x23e7b6(0x1e7)](_0x23e7b6(0x17b)),_0x23e7b6(0x1ec)),0x1;}const {data:_0x5ef2ec}=await withSpinner(_0x23e7b6(0x19f),()=>_0x2281dc[_0x23e7b6(0x1ff)]['pushProject'](_0x5ad11e,{'force':_0x43b9b1})),_0x1b90d8=_0x5ef2ec[_0x23e7b6(0x1ce)][_0x23e7b6(0x208)][_0x23e7b6(0x1a4)]>0x0||_0x5ef2ec[_0x23e7b6(0x1ce)][_0x23e7b6(0x1e4)][_0x23e7b6(0x1a4)]>0x0||_0x5ef2ec['counts'][_0x23e7b6(0x1ef)][_0x23e7b6(0x1a4)]>0x0||_0x5ef2ec['counts'][_0x23e7b6(0x234)][_0x23e7b6(0x1a4)]>0x0||_0x5ef2ec[_0x23e7b6(0x1ce)][_0x23e7b6(0x1c2)][_0x23e7b6(0x1a4)]>0x0||_0x5ef2ec[_0x23e7b6(0x1ce)][_0x23e7b6(0x20b)][_0x23e7b6(0x1a4)]>0x0;if(_0x1b90d8){console[_0x23e7b6(0x193)](a4_0x2cca95[_0x23e7b6(0x1e7)](_0x23e7b6(0x1a5))),console['log'](),console['log'](a4_0x2cca95[_0x23e7b6(0x1ac)]('Errors:'));for(const _0x12ccfa of _0x5ef2ec[_0x23e7b6(0x208)]){_0x12ccfa['action']===_0x23e7b6(0x232)&&console[_0x23e7b6(0x193)](a4_0x2cca95[_0x23e7b6(0x1ac)](_0x23e7b6(0x1fd)+_0x12ccfa[_0x23e7b6(0x1d8)]+_0x23e7b6(0x236)+_0x12ccfa[_0x23e7b6(0x232)]));}for(const _0x1dd94f of _0x5ef2ec[_0x23e7b6(0x1e4)]){_0x1dd94f[_0x23e7b6(0x1d6)]===_0x23e7b6(0x232)&&console[_0x23e7b6(0x193)](a4_0x2cca95['red']('\x20\x20Knowledge\x20Base\x20\x22'+_0x1dd94f['name']+'\x22:\x20'+_0x1dd94f[_0x23e7b6(0x232)]));}for(const _0x2648ba of _0x5ef2ec['textKnowledgeBases']){_0x2648ba[_0x23e7b6(0x1d6)]==='error'&&console[_0x23e7b6(0x193)](a4_0x2cca95[_0x23e7b6(0x1ac)](_0x23e7b6(0x233)+_0x2648ba[_0x23e7b6(0x218)]+_0x23e7b6(0x236)+_0x2648ba[_0x23e7b6(0x232)]));}for(const _0x30323e of _0x5ef2ec[_0x23e7b6(0x234)]){_0x30323e[_0x23e7b6(0x1d6)]===_0x23e7b6(0x232)&&console[_0x23e7b6(0x193)](a4_0x2cca95[_0x23e7b6(0x1ac)](_0x23e7b6(0x19c)+_0x30323e[_0x23e7b6(0x218)]+_0x23e7b6(0x236)+_0x30323e[_0x23e7b6(0x232)]));}for(const _0x410e46 of _0x5ef2ec[_0x23e7b6(0x22f)]){_0x410e46['action']===_0x23e7b6(0x232)&&console[_0x23e7b6(0x193)](a4_0x2cca95['red'](_0x23e7b6(0x1a7)+_0x410e46[_0x23e7b6(0x218)]+_0x23e7b6(0x236)+_0x410e46[_0x23e7b6(0x232)]));}for(const _0x3ff7ac of _0x5ef2ec[_0x23e7b6(0x1c2)]){_0x3ff7ac['action']==='error'&&console[_0x23e7b6(0x193)](a4_0x2cca95[_0x23e7b6(0x1ac)]('\x20\x20Form\x20Interface\x20\x22'+_0x3ff7ac[_0x23e7b6(0x218)]+'\x22:\x20'+_0x3ff7ac['error']));}for(const _0x549194 of _0x5ef2ec[_0x23e7b6(0x20b)]){_0x549194[_0x23e7b6(0x1d6)]===_0x23e7b6(0x232)&&console[_0x23e7b6(0x193)](a4_0x2cca95['red'](_0x23e7b6(0x18d)+_0x549194[_0x23e7b6(0x218)]+_0x23e7b6(0x236)+_0x549194['error']));}return 0x1;}console['log'](a4_0x2cca95['green']('\x0a✔\x20Pushed\x20'+(_0x4292de+_0x3c3f73)+'\x20resources\x20to\x20\x27'+_0x5ef2ec[_0x23e7b6(0x1b5)]+'\x27'));const _0x33bee2=getLLMProjectUrl(_0x2555a9,_0x5ef2ec['projectId']);return console[_0x23e7b6(0x193)](_0x23e7b6(0x1e1)+a4_0x2cca95[_0x23e7b6(0x19b)](_0x33bee2)),0x0;}}
|
|
1
|
+
const a4_0x9ae543=a4_0x182e;function a4_0x182e(_0x119025,_0x47a113){_0x119025=_0x119025-0x1b1;const _0x47c742=a4_0x47c7();let _0x182e8a=_0x47c742[_0x119025];return _0x182e8a;}(function(_0x49ee10,_0x5aee05){const _0x193543=a4_0x182e,_0x30d6a9=_0x49ee10();while(!![]){try{const _0x5660ce=parseInt(_0x193543(0x1c9))/0x1*(-parseInt(_0x193543(0x1ec))/0x2)+parseInt(_0x193543(0x21e))/0x3*(parseInt(_0x193543(0x1bd))/0x4)+parseInt(_0x193543(0x224))/0x5+parseInt(_0x193543(0x20b))/0x6+-parseInt(_0x193543(0x23e))/0x7+-parseInt(_0x193543(0x211))/0x8*(-parseInt(_0x193543(0x249))/0x9)+parseInt(_0x193543(0x1df))/0xa;if(_0x5660ce===_0x5aee05)break;else _0x30d6a9['push'](_0x30d6a9['shift']());}catch(_0x53a39a){_0x30d6a9['push'](_0x30d6a9['shift']());}}}(a4_0x47c7,0x5de9d));import a4_0x40b849 from'chalk';import a4_0x188f49 from'path';function a4_0x47c7(){const _0x58cc40=['\x20total','agentName','red','log','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','✔\x20Context\x20set:\x20','\x0aChanges\x20to\x20chat\x20interface\x20\x27','New\x20project\x20ID:\x20','\x20files?','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','-\x20no\x20files\x20written','dryRun','Using\x20current\x20project:\x20','textKnowledgeBases','chatInterfaces','\x22\x20to\x20a\x20different\x20profile','source','cloneProject','Analyzing\x20changes\x20to\x20push...','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x20--profile\x20','\x20\x20Agent\x20\x22','Would\x20pull\x20agent:\x20','dim','\x20unchanged','\x20\x20Prompts:\x20','\x0aChanges\x20to\x20form\x20interface\x20\x27','\x20successfully','1700iptBHZ','agent:pull','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x0aError:','Analyzing\x20project\x20\x22','\x20|\x20','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','force','Writing\x20files...','\x20\x20tdx\x20agent\x20clone\x20agents/','reason','Cloning\x20\x22','2HaNbAy','yellow','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\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)','\x22\x20from\x20project\x20\x22','Chat:\x20','execute','Project:\x20','\x0aPush\x20','new','no_context','projectId','utf-8','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x20\x20tdx\x20agent\x20pull\x20','description','llm','MISSING_ARGUMENT','Would\x20push\x20agent:\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','agent','701730XDRnbj','Clone\x20\x22','pushAgent','Summary:','Source:\x20','\x20new','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','\x20\x20Text\x20Knowledge\x20Bases:\x20','action','pullProject','\x20\x20Form\x20Interface\x20\x22','\x20resources?','New\x20project\x20name\x20is\x20required','536474yQMrrR','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\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','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','newProjectId','arg-dir','\x20\x20Prompt\x20\x22','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','Pulling\x20agent\x20\x22','\x0aChanges\x20to\x20prompt\x20\x27','agents','\x20errors','repeat','\x22...','\x0aPull\x20summary\x20for\x20\x27','counts','Failed\x20to\x20push\x20agent:\x20','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','\x20\x20Experimental\x20Artifacts:\x20','knowledgeBases','prompts','Using\x20project\x20from\x20context:\x20','projectName','green','\x20\x20Integration\x20\x22','-\x20nothing\x20pushed','Output\x20path:\x20','\x20\x20Chat\x20Interface\x20\x22','cwd-config','\x20created','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','9966EGcYJm','push','\x20\x20Form\x20Interfaces:\x20','\x0aProject\x20pushed\x20with\x20errors','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','Using\x20project\x20from\x20','23376pOfFlU','outputDir','<new-name>','found','parse','\x20\x20Knowledge\x20Bases:\x20','\x20\x20Knowledge\x20Base\x20\x22','\x22:\x20','Errors:','llmProject','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)','profile','\x20updated','4449vUmmCf','error','outputPath','message','integrations','Project\x20cloned\x20successfully','3086285hjxlNY','no_local_folder','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','join','session','\x0aErrors\x20found:','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','llm_project','Cancelled','\x0a✔\x20Pushed\x20','\x0aWrite\x20','\x20\x20Target:\x20','\x20\x20Chat\x20Interfaces:\x20','dirname','\x0aChanges\x20to\x20integration\x20\x27','experimentalArtifacts','Agent:\x20','agent:push','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','No\x20tdx.json\x20found\x20in\x20','pushProject','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','\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','Output:\x20','Using\x20project:\x20','4464789OUrUvq','diff','Using\x20local\x20project:\x20','updated','context','cwd','Dry\x20run\x20-\x20no\x20changes\x20made','unchanged','Dry\x20run\x20-\x20no\x20files\x20written','sourceProjectName','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','738ezMiNJ','Pushing\x20agent\x20from\x20\x22','New\x20project:\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','total','\x20resources\x20to\x20\x27','\x20\x20Source:\x20','INVALID_ARGUMENT','experimentalKnowledgeBases','formInterfaces','created','Would\x20clone:','\x20=\x20','agentId','tdx.json','\x20changed','agent:clone','Status:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','errors','\x20\x20Agents:\x20','pullAgent','name','cyan','agent.yml','site'];a4_0x47c7=function(){return _0x58cc40;};return a4_0x47c7();}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(_0x4d5896){const _0x2520df=a4_0x182e,_0xa18c9e=[];if(_0x4d5896[_0x2520df(0x24d)]!==undefined)_0xa18c9e[_0x2520df(0x20c)](_0x4d5896['total']+_0x2520df(0x263));if(_0x4d5896['new']!==undefined&&_0x4d5896['new']>0x0)_0xa18c9e[_0x2520df(0x20c)](a4_0x40b849[_0x2520df(0x203)](_0x4d5896[_0x2520df(0x1d3)]+'\x20new'));if(_0x4d5896[_0x2520df(0x253)]!==undefined&&_0x4d5896[_0x2520df(0x253)]>0x0)_0xa18c9e[_0x2520df(0x20c)](a4_0x40b849[_0x2520df(0x203)](_0x4d5896['created']+_0x2520df(0x209)));if(_0x4d5896['updated']!==undefined&&_0x4d5896['updated']>0x0)_0xa18c9e[_0x2520df(0x20c)](a4_0x40b849['yellow'](_0x4d5896['updated']+_0x2520df(0x21d)));if(_0x4d5896[_0x2520df(0x245)]!==undefined&&_0x4d5896[_0x2520df(0x245)]>0x0)_0xa18c9e[_0x2520df(0x20c)](a4_0x40b849['gray'](_0x4d5896['unchanged']+_0x2520df(0x1b9)));if(_0x4d5896[_0x2520df(0x25c)]!==undefined&&_0x4d5896[_0x2520df(0x25c)]>0x0)_0xa18c9e[_0x2520df(0x20c)](a4_0x40b849['red'](_0x4d5896[_0x2520df(0x25c)]+_0x2520df(0x1f7)));return _0xa18c9e[_0x2520df(0x227)](',\x20');}function displayDiffs(_0x128284,_0x53e1f6,_0x15bc71,_0xe9cd33,_0x4d72c8,_0x538d75,_0x57cbdc,_0x51b2d2,_0x15bd8b){const _0x44f173=a4_0x182e;for(const _0x223b2e of _0x128284){if(_0x223b2e[_0x44f173(0x23f)]){const _0x468f8c=_0x223b2e['agentName']||_0x223b2e[_0x44f173(0x25f)];console[_0x44f173(0x266)]('\x0aChanges\x20to\x20agent\x20\x27'+_0x468f8c+'\x27:'),console[_0x44f173(0x266)]('─'[_0x44f173(0x1f8)](0x3c)),console[_0x44f173(0x266)](_0x223b2e[_0x44f173(0x23f)]),console[_0x44f173(0x266)]('─'[_0x44f173(0x1f8)](0x3c));}}for(const _0x3d8ceb of _0x53e1f6){_0x3d8ceb[_0x44f173(0x23f)]&&(console[_0x44f173(0x266)](_0x44f173(0x1bf)+_0x3d8ceb[_0x44f173(0x25f)]+'\x27:'),console[_0x44f173(0x266)]('─'[_0x44f173(0x1f8)](0x3c)),console[_0x44f173(0x266)](_0x3d8ceb[_0x44f173(0x23f)]),console[_0x44f173(0x266)]('─'[_0x44f173(0x1f8)](0x3c)));}for(const _0x3eb801 of _0x15bc71){_0x3eb801[_0x44f173(0x23f)]&&(console['log'](_0x44f173(0x22a)+_0x3eb801[_0x44f173(0x25f)]+'\x27:'),console[_0x44f173(0x266)]('─'[_0x44f173(0x1f8)](0x3c)),console['log'](_0x3eb801[_0x44f173(0x23f)]),console['log']('─'[_0x44f173(0x1f8)](0x3c)));}for(const _0x46bb98 of _0xe9cd33){_0x46bb98[_0x44f173(0x23f)]&&(console[_0x44f173(0x266)](_0x44f173(0x1f5)+_0x46bb98['name']+'\x27:'),console[_0x44f173(0x266)]('─'[_0x44f173(0x1f8)](0x3c)),console[_0x44f173(0x266)](_0x46bb98[_0x44f173(0x23f)]),console[_0x44f173(0x266)]('─'['repeat'](0x3c)));}for(const _0x580c51 of _0x4d72c8){_0x580c51[_0x44f173(0x23f)]&&(console[_0x44f173(0x266)](_0x44f173(0x232)+_0x580c51[_0x44f173(0x25f)]+'\x27:'),console[_0x44f173(0x266)]('─'[_0x44f173(0x1f8)](0x3c)),console[_0x44f173(0x266)](_0x580c51[_0x44f173(0x23f)]),console['log']('─'['repeat'](0x3c)));}for(const _0x21c833 of _0x538d75){_0x21c833[_0x44f173(0x23f)]&&(console['log'](_0x44f173(0x1cc)+_0x21c833[_0x44f173(0x25f)]+'\x27:'),console[_0x44f173(0x266)]('─'[_0x44f173(0x1f8)](0x3c)),console['log'](_0x21c833[_0x44f173(0x23f)]),console['log']('─'[_0x44f173(0x1f8)](0x3c)));}for(const _0x4ffef0 of _0x57cbdc){_0x4ffef0[_0x44f173(0x23f)]&&(console[_0x44f173(0x266)](_0x44f173(0x1f3)+_0x4ffef0[_0x44f173(0x25f)]+'\x27:'),console[_0x44f173(0x266)]('─'[_0x44f173(0x1f8)](0x3c)),console[_0x44f173(0x266)](_0x4ffef0[_0x44f173(0x23f)]),console['log']('─'[_0x44f173(0x1f8)](0x3c)));}for(const _0x164c3c of _0x51b2d2){_0x164c3c[_0x44f173(0x23f)]&&(console[_0x44f173(0x266)](_0x44f173(0x1bb)+_0x164c3c[_0x44f173(0x25f)]+'\x27:'),console[_0x44f173(0x266)]('─'[_0x44f173(0x1f8)](0x3c)),console[_0x44f173(0x266)](_0x164c3c[_0x44f173(0x23f)]),console[_0x44f173(0x266)]('─'['repeat'](0x3c)));}for(const _0x134031 of _0x15bd8b){_0x134031[_0x44f173(0x23f)]&&(console[_0x44f173(0x266)](_0x44f173(0x269)+_0x134031['name']+'\x27:'),console['log']('─'[_0x44f173(0x1f8)](0x3c)),console[_0x44f173(0x266)](_0x134031['diff']),console[_0x44f173(0x266)]('─'[_0x44f173(0x1f8)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x9ae543(0x25f)]=a4_0x9ae543(0x1be);[a4_0x9ae543(0x1d9)]=a4_0x9ae543(0x239);async[a4_0x9ae543(0x1d0)](_0xd45bac){const _0x1e7b28=a4_0x9ae543,{options:_0x33d688,args:_0x2ec464,tdx:_0x393b2a}=_0xd45bac,_0x68cae1=_0x2ec464[0x0],_0x41c75d=_0x2ec464[0x1],_0x43129d=_0x33d688['output'],_0x560dec=_0x33d688['dryRun'],_0x5d41c1=_0x33d688[_0x1e7b28(0x1c4)],_0x1572b5=_0x33d688['yes'],_0x18b3c0=_0x33d688[_0x1e7b28(0x21a)],_0x13e558=_0x33d688[_0x1e7b28(0x1de)];let _0x58a234;if(_0x68cae1){const _0x3548e1=a4_0x188f49['join'](_0x68cae1,'tdx.json');if(existsSync(_0x3548e1))try{const _0x58b016=JSON[_0x1e7b28(0x215)](readFileSync(_0x3548e1,'utf-8'));_0x58b016[_0x1e7b28(0x22b)]&&(_0x58a234={'llm_project':_0x58b016['llm_project']});}catch{}}const _0x41dc91=findAgentConfigPath(process[_0x1e7b28(0x243)]());let _0xca9d6;if(_0x41dc91)try{const _0x5b767d=JSON[_0x1e7b28(0x215)](readFileSync(_0x41dc91,_0x1e7b28(0x1d6)));_0x5b767d['llm_project']&&(_0xca9d6={'llm_project':_0x5b767d['llm_project']});}catch{}const _0x5c15cf=resolveAgentPullArgs({'arg':_0x68cae1,'agentNameArg':_0x41c75d,'agentFlag':_0x13e558,'contextProject':_0x18b3c0,'argDirConfig':_0x58a234,'cwdConfigPath':_0x41dc91||undefined,'cwdConfig':_0xca9d6}),{projectNameOrId:_0x5aec7d,targetAgentName:_0x2b17f7,existingOutputDir:_0x10d464,source:_0x4299ef}=_0x5c15cf;if(_0x4299ef===_0x1e7b28(0x1f1))console[_0x1e7b28(0x266)](a4_0x40b849[_0x1e7b28(0x1b8)](_0x1e7b28(0x210)+a4_0x188f49[_0x1e7b28(0x227)](_0x68cae1,_0x1e7b28(0x257))+':\x20'+_0x5aec7d));else{if(_0x4299ef===_0x1e7b28(0x208))console[_0x1e7b28(0x266)](a4_0x40b849['dim'](_0x1e7b28(0x23d)+_0x5aec7d));else _0x4299ef==='context'&&console['log'](a4_0x40b849[_0x1e7b28(0x1b8)](_0x1e7b28(0x201)+_0x5aec7d));}if(!_0x5aec7d)return _0x13e558?(console[_0x1e7b28(0x266)](a4_0x40b849['yellow']('The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a')),console[_0x1e7b28(0x266)](_0x1e7b28(0x20a)),console[_0x1e7b28(0x266)]('Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>')):(console['log'](a4_0x40b849[_0x1e7b28(0x1ca)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console['log'](_0x1e7b28(0x21b)),console[_0x1e7b28(0x266)](_0x1e7b28(0x1ee)),console['log'](_0x1e7b28(0x26c)),console['log'](_0x1e7b28(0x23b)),console[_0x1e7b28(0x266)]('\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(_0x2b17f7){const {data:_0x3895e1}=await withSpinner(_0x1e7b28(0x1f4)+_0x2b17f7+_0x1e7b28(0x1ce)+_0x5aec7d+'\x22...',()=>_0x393b2a[_0x1e7b28(0x1da)][_0x1e7b28(0x25e)](_0x5aec7d,_0x2b17f7,_0x43129d,{'dryRun':_0x560dec,'force':_0x5d41c1}));if(_0x560dec)return console[_0x1e7b28(0x266)](a4_0x40b849[_0x1e7b28(0x1ca)](_0x1e7b28(0x246))),console['log'](_0x1e7b28(0x1b7)+_0x3895e1[_0x1e7b28(0x264)]),console['log'](_0x1e7b28(0x206)+_0x3895e1[_0x1e7b28(0x220)]),_0x3895e1[_0x1e7b28(0x23f)]&&(console[_0x1e7b28(0x266)]('\x0aChanges:'),console[_0x1e7b28(0x266)]('─'[_0x1e7b28(0x1f8)](0x3c)),console[_0x1e7b28(0x266)](_0x3895e1[_0x1e7b28(0x23f)]),console[_0x1e7b28(0x266)]('─'[_0x1e7b28(0x1f8)](0x3c))),0x0;return console[_0x1e7b28(0x266)](a4_0x40b849[_0x1e7b28(0x203)]('Agent\x20pulled\x20successfully')),console[_0x1e7b28(0x266)](_0x1e7b28(0x234)+_0x3895e1['agentName']),console[_0x1e7b28(0x266)](_0x1e7b28(0x23c)+_0x3895e1[_0x1e7b28(0x220)]),console[_0x1e7b28(0x266)](_0x1e7b28(0x25a)+(_0x3895e1['isNew']?a4_0x40b849[_0x1e7b28(0x203)](_0x1e7b28(0x1d3)):_0x3895e1['hasChanges']?a4_0x40b849[_0x1e7b28(0x1ca)](_0x1e7b28(0x241)):a4_0x40b849['gray'](_0x1e7b28(0x245)))),0x0;}const _0xba80bc=_0x10d464||_0x43129d,{data:_0x3fac2c}=await withSpinner(_0x1e7b28(0x1c1)+_0x5aec7d+_0x1e7b28(0x1f9),()=>_0x393b2a[_0x1e7b28(0x1da)][_0x1e7b28(0x1e8)](_0x5aec7d,_0xba80bc,{'dryRun':!![]})),_0x475740=_0x3fac2c[_0x1e7b28(0x1fb)][_0x1e7b28(0x1f6)][_0x1e7b28(0x1d3)]+_0x3fac2c[_0x1e7b28(0x1fb)][_0x1e7b28(0x1ff)][_0x1e7b28(0x1d3)]+_0x3fac2c['counts'][_0x1e7b28(0x271)][_0x1e7b28(0x1d3)]+_0x3fac2c[_0x1e7b28(0x1fb)][_0x1e7b28(0x200)]['new']+_0x3fac2c[_0x1e7b28(0x1fb)][_0x1e7b28(0x222)][_0x1e7b28(0x1d3)]+_0x3fac2c[_0x1e7b28(0x1fb)][_0x1e7b28(0x251)][_0x1e7b28(0x1d3)]+_0x3fac2c['counts'][_0x1e7b28(0x233)]['new']+_0x3fac2c[_0x1e7b28(0x1fb)][_0x1e7b28(0x252)][_0x1e7b28(0x1d3)]+_0x3fac2c[_0x1e7b28(0x1fb)]['chatInterfaces'][_0x1e7b28(0x1d3)],_0x5c59c7=_0x3fac2c[_0x1e7b28(0x1fb)]['agents'][_0x1e7b28(0x241)]+_0x3fac2c['counts'][_0x1e7b28(0x1ff)][_0x1e7b28(0x241)]+_0x3fac2c['counts'][_0x1e7b28(0x271)][_0x1e7b28(0x241)]+_0x3fac2c['counts'][_0x1e7b28(0x200)][_0x1e7b28(0x241)]+_0x3fac2c['counts']['integrations'][_0x1e7b28(0x241)]+_0x3fac2c['counts'][_0x1e7b28(0x251)]['updated']+_0x3fac2c['counts']['experimentalArtifacts']['updated']+_0x3fac2c[_0x1e7b28(0x1fb)]['formInterfaces'][_0x1e7b28(0x241)]+_0x3fac2c[_0x1e7b28(0x1fb)][_0x1e7b28(0x272)]['updated'],_0xd894dc=_0x3fac2c[_0x1e7b28(0x1fb)][_0x1e7b28(0x1f6)][_0x1e7b28(0x245)]+_0x3fac2c[_0x1e7b28(0x1fb)][_0x1e7b28(0x1ff)][_0x1e7b28(0x245)]+_0x3fac2c[_0x1e7b28(0x1fb)][_0x1e7b28(0x271)][_0x1e7b28(0x245)]+_0x3fac2c[_0x1e7b28(0x1fb)][_0x1e7b28(0x200)][_0x1e7b28(0x245)]+_0x3fac2c[_0x1e7b28(0x1fb)][_0x1e7b28(0x222)]['unchanged']+_0x3fac2c[_0x1e7b28(0x1fb)]['experimentalKnowledgeBases']['unchanged']+_0x3fac2c[_0x1e7b28(0x1fb)][_0x1e7b28(0x233)][_0x1e7b28(0x245)]+_0x3fac2c['counts']['formInterfaces'][_0x1e7b28(0x245)]+_0x3fac2c['counts'][_0x1e7b28(0x272)][_0x1e7b28(0x245)];console[_0x1e7b28(0x266)](_0x1e7b28(0x1fa)+_0x3fac2c['projectName']+'\x27:'),console[_0x1e7b28(0x266)]('\x20\x20'+a4_0x40b849[_0x1e7b28(0x203)]('+\x20'+_0x475740+_0x1e7b28(0x1e4))+_0x1e7b28(0x1c2)+a4_0x40b849[_0x1e7b28(0x1ca)]('~\x20'+_0x5c59c7+_0x1e7b28(0x258))+_0x1e7b28(0x1c2)+a4_0x40b849['dim']('=\x20'+_0xd894dc+_0x1e7b28(0x1b9))),console[_0x1e7b28(0x266)](_0x1e7b28(0x25d)+formatCountSummary(_0x3fac2c[_0x1e7b28(0x1fb)][_0x1e7b28(0x1f6)])),console[_0x1e7b28(0x266)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x3fac2c[_0x1e7b28(0x1fb)][_0x1e7b28(0x1ff)])),console[_0x1e7b28(0x266)](_0x1e7b28(0x1e6)+formatCountSummary(_0x3fac2c['counts'][_0x1e7b28(0x271)])),console['log'](_0x1e7b28(0x1ba)+formatCountSummary(_0x3fac2c[_0x1e7b28(0x1fb)][_0x1e7b28(0x200)])),console['log']('\x20\x20Integrations:\x20'+formatCountSummary(_0x3fac2c[_0x1e7b28(0x1fb)][_0x1e7b28(0x222)])),console[_0x1e7b28(0x266)]('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0x3fac2c['counts'][_0x1e7b28(0x252)])),console[_0x1e7b28(0x266)](_0x1e7b28(0x230)+formatCountSummary(_0x3fac2c['counts']['chatInterfaces']));const _0x2de8a7=_0x3fac2c[_0x1e7b28(0x1fb)][_0x1e7b28(0x251)][_0x1e7b28(0x24d)]>0x0||_0x3fac2c['counts']['experimentalArtifacts']['total']>0x0;_0x2de8a7&&(console['log'](_0x1e7b28(0x226)+formatCountSummary(_0x3fac2c[_0x1e7b28(0x1fb)][_0x1e7b28(0x251)])),console[_0x1e7b28(0x266)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x3fac2c[_0x1e7b28(0x1fb)][_0x1e7b28(0x233)])));console[_0x1e7b28(0x266)](_0x1e7b28(0x22f)+a4_0x40b849[_0x1e7b28(0x260)](_0x3fac2c['outputDir'])),displayDiffs(_0x3fac2c[_0x1e7b28(0x1f6)],_0x3fac2c['knowledgeBases'],_0x3fac2c[_0x1e7b28(0x271)],_0x3fac2c[_0x1e7b28(0x200)],_0x3fac2c['integrations'],_0x3fac2c[_0x1e7b28(0x251)],_0x3fac2c[_0x1e7b28(0x233)],_0x3fac2c['formInterfaces'],_0x3fac2c['chatInterfaces']);if(_0x560dec)return console['log'](a4_0x40b849[_0x1e7b28(0x1ca)](_0x1e7b28(0x1ed))),0x0;if(_0x475740===0x0&&_0x5c59c7===0x0)return console['log'](a4_0x40b849[_0x1e7b28(0x203)](_0x1e7b28(0x236))),saveSessionContext({'llm_project':_0x3fac2c['projectName']},_0x33d688['session']),console[_0x1e7b28(0x266)](a4_0x40b849[_0x1e7b28(0x203)](_0x1e7b28(0x268)+a4_0x40b849[_0x1e7b28(0x1b8)]('llm_project')+'\x20=\x20'+a4_0x40b849[_0x1e7b28(0x260)](_0x3fac2c[_0x1e7b28(0x202)]))),0x0;if(!_0x1572b5&&!_0x5d41c1){if(!isInteractive())return console[_0x1e7b28(0x21f)](a4_0x40b849[_0x1e7b28(0x265)](_0x1e7b28(0x1c0)),_0x1e7b28(0x24c)),console[_0x1e7b28(0x21f)](a4_0x40b849['dim'](_0x1e7b28(0x25b))),0x1;const _0x1f173d=await confirmKey(_0x1e7b28(0x22e)+(_0x475740+_0x5c59c7)+_0x1e7b28(0x26b));if(!_0x1f173d)return console[_0x1e7b28(0x266)](a4_0x40b849['yellow'](_0x1e7b28(0x22c)),_0x1e7b28(0x26e)),0x1;}const {data:_0x3a162e}=await withSpinner(_0x1e7b28(0x1c5),()=>_0x393b2a[_0x1e7b28(0x1da)]['pullProject'](_0x5aec7d,_0xba80bc,{'force':_0x5d41c1}));return console[_0x1e7b28(0x266)](a4_0x40b849[_0x1e7b28(0x203)]('\x0a✔\x20Pulled\x20'+(_0x475740+_0x5c59c7)+'\x20files\x20to\x20'+_0x3a162e[_0x1e7b28(0x212)])),saveSessionContext({'llm_project':_0x3a162e[_0x1e7b28(0x202)]},_0x33d688[_0x1e7b28(0x228)]),console[_0x1e7b28(0x266)](a4_0x40b849[_0x1e7b28(0x203)](_0x1e7b28(0x268)+a4_0x40b849[_0x1e7b28(0x1b8)](_0x1e7b28(0x22b))+_0x1e7b28(0x255)+a4_0x40b849['cyan'](_0x3a162e['projectName']))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']=a4_0x9ae543(0x259);[a4_0x9ae543(0x1d9)]=a4_0x9ae543(0x20f);async[a4_0x9ae543(0x1d0)](_0x1b9d7a){const _0x33e48c=a4_0x9ae543,{options:_0x59f03f,args:_0x23d0da,tdx:_0x5f0afa}=_0x1b9d7a,_0x408250=_0x23d0da[0x0],_0x5482ea=_0x59f03f[_0x33e48c(0x25f)],_0xfb86af=_0x59f03f[_0x33e48c(0x26f)],_0x55b003=_0x59f03f['yes'],_0xa6cd01=_0x59f03f[_0x33e48c(0x262)],_0x1cb7d1=_0x59f03f[_0x33e48c(0x21a)];let _0x2d533f;const _0x48236d=findAgentConfigPath(process[_0x33e48c(0x243)]());if(_0x408250){const _0x332ca8=a4_0x188f49[_0x33e48c(0x227)](_0x408250,_0x33e48c(0x257));existsSync(_0x332ca8)?(_0x2d533f=_0x408250,console[_0x33e48c(0x266)](a4_0x40b849[_0x33e48c(0x1b8)](_0x33e48c(0x240)+_0x408250))):_0x2d533f=_0x408250;}else{if(_0x48236d)_0x2d533f=a4_0x188f49[_0x33e48c(0x231)](_0x48236d),console[_0x33e48c(0x266)](a4_0x40b849['dim'](_0x33e48c(0x270)+_0x2d533f));else{if(_0x1cb7d1){const _0x154644=sanitizeForFilesystem(_0x1cb7d1);let _0x5180fc=_0x154644,_0x239f1f=a4_0x188f49['join'](process[_0x33e48c(0x243)](),_0x33e48c(0x1f6),_0x154644,_0x33e48c(0x257));if(!existsSync(_0x239f1f)){const _0x2f5850=normalizeName(_0x1cb7d1),_0x2cb774=a4_0x188f49[_0x33e48c(0x227)](process[_0x33e48c(0x243)](),_0x33e48c(0x1f6),_0x2f5850,'tdx.json');existsSync(_0x2cb774)&&(_0x5180fc=_0x2f5850,_0x239f1f=_0x2cb774);}if(existsSync(_0x239f1f))_0x2d533f=a4_0x188f49[_0x33e48c(0x231)](_0x239f1f),console[_0x33e48c(0x266)](a4_0x40b849[_0x33e48c(0x1b8)](_0x33e48c(0x240)+_0x2d533f));else{const _0x166cad=_0x59f03f[_0x33e48c(0x21c)];if(_0x166cad)throw new SDKError(ErrorCode[_0x33e48c(0x250)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x1cb7d1+_0x33e48c(0x273),undefined,{'helpText':_0x33e48c(0x1e5)+_0x33e48c(0x267)+(_0x33e48c(0x1d8)+_0x1cb7d1+'\x0a')+(_0x33e48c(0x1c6)+_0x5180fc+'\x20--name\x20'+(_0x5482ea||_0x33e48c(0x213))+_0x33e48c(0x1b5)+_0x166cad)});_0x2d533f=_0x1cb7d1,console[_0x33e48c(0x266)](a4_0x40b849[_0x33e48c(0x1b8)]('Using\x20context\x20project:\x20'+_0x1cb7d1));}}}}if(!_0x2d533f)return console['log'](a4_0x40b849['yellow'](_0x33e48c(0x23a))),console[_0x33e48c(0x266)](_0x33e48c(0x1fd)),console[_0x33e48c(0x266)](_0x33e48c(0x26d)),console['log'](_0x33e48c(0x1cd)),console['log'](_0x33e48c(0x1ef)),0x1;if(!_0x5482ea)throw new SDKError(ErrorCode[_0x33e48c(0x1db)],_0x33e48c(0x1eb),undefined,{'helpText':_0x33e48c(0x1b4)});if(!_0x55b003&&!_0xfb86af){if(!isInteractive())return console['error'](a4_0x40b849[_0x33e48c(0x265)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a4_0x40b849[_0x33e48c(0x1b8)](_0x33e48c(0x25b))),0x1;const _0x14be33=await confirmKey(_0x33e48c(0x1e0)+_0x2d533f+'\x22\x20to\x20new\x20project\x20\x22'+_0x5482ea+'\x22?');if(!_0x14be33)return console['log'](a4_0x40b849[_0x33e48c(0x1ca)](_0x33e48c(0x22c))),0x1;}const {data:_0x58d5a8}=await withSpinner(_0x33e48c(0x1c8)+_0x2d533f+'\x22\x20to\x20\x22'+_0x5482ea+_0x33e48c(0x1f9),()=>_0x5f0afa['llm'][_0x33e48c(0x1b2)](_0x2d533f,_0x5482ea,{'dryRun':_0xfb86af}));if(_0xfb86af){console[_0x33e48c(0x266)](a4_0x40b849[_0x33e48c(0x1ca)](_0x33e48c(0x244))),console['log'](_0x33e48c(0x1e3)+_0x58d5a8['sourceProjectName']),console[_0x33e48c(0x266)](_0x33e48c(0x24b)+_0x5482ea),console[_0x33e48c(0x266)](_0x33e48c(0x254)),console[_0x33e48c(0x266)](_0x33e48c(0x25d)+_0x58d5a8[_0x33e48c(0x1fb)][_0x33e48c(0x1f6)][_0x33e48c(0x253)]),console[_0x33e48c(0x266)](_0x33e48c(0x216)+_0x58d5a8[_0x33e48c(0x1fb)][_0x33e48c(0x1ff)][_0x33e48c(0x253)]),console[_0x33e48c(0x266)]('\x20\x20Prompts:\x20'+_0x58d5a8[_0x33e48c(0x1fb)][_0x33e48c(0x200)]['created']),console[_0x33e48c(0x266)]('\x20\x20Form\x20Interfaces:\x20'+_0x58d5a8[_0x33e48c(0x1fb)][_0x33e48c(0x252)][_0x33e48c(0x253)]),console['log']('\x20\x20Chat\x20Interfaces:\x20'+_0x58d5a8['counts'][_0x33e48c(0x272)][_0x33e48c(0x253)]);const _0x52bcc7=_0x58d5a8[_0x33e48c(0x1fb)][_0x33e48c(0x251)][_0x33e48c(0x253)]>0x0||_0x58d5a8[_0x33e48c(0x1fb)]['experimentalArtifacts'][_0x33e48c(0x253)]>0x0;return _0x52bcc7&&(console['log'](_0x33e48c(0x226)+_0x58d5a8[_0x33e48c(0x1fb)]['experimentalKnowledgeBases']['created']),console['log'](_0x33e48c(0x1fe)+_0x58d5a8['counts'][_0x33e48c(0x233)][_0x33e48c(0x253)])),0x0;}const _0x39e35b=_0x58d5a8[_0x33e48c(0x1fb)][_0x33e48c(0x1f6)][_0x33e48c(0x25c)]>0x0||_0x58d5a8[_0x33e48c(0x1fb)][_0x33e48c(0x1ff)]['errors']>0x0||_0x58d5a8['counts']['prompts'][_0x33e48c(0x25c)]>0x0||_0x58d5a8[_0x33e48c(0x1fb)][_0x33e48c(0x252)][_0x33e48c(0x25c)]>0x0||_0x58d5a8[_0x33e48c(0x1fb)][_0x33e48c(0x272)][_0x33e48c(0x25c)]>0x0||_0x58d5a8[_0x33e48c(0x1fb)][_0x33e48c(0x251)][_0x33e48c(0x25c)]>0x0||_0x58d5a8['counts']['experimentalArtifacts'][_0x33e48c(0x25c)]>0x0;_0x39e35b?console[_0x33e48c(0x266)](a4_0x40b849[_0x33e48c(0x1ca)]('Project\x20cloned\x20with\x20errors')):console[_0x33e48c(0x266)](a4_0x40b849[_0x33e48c(0x203)](_0x33e48c(0x223)));console['log'](_0x33e48c(0x1e3)+_0x58d5a8[_0x33e48c(0x247)]),console[_0x33e48c(0x266)](_0x33e48c(0x24b)+_0x58d5a8['newProjectName']),console['log'](_0x33e48c(0x26a)+_0x58d5a8[_0x33e48c(0x1f0)]),console[_0x33e48c(0x266)](),console[_0x33e48c(0x266)](_0x33e48c(0x1e2)),console['log'](_0x33e48c(0x25d)+formatCountSummary(_0x58d5a8[_0x33e48c(0x1fb)]['agents'])),console[_0x33e48c(0x266)](_0x33e48c(0x216)+formatCountSummary(_0x58d5a8[_0x33e48c(0x1fb)][_0x33e48c(0x1ff)])),console[_0x33e48c(0x266)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x58d5a8[_0x33e48c(0x1fb)][_0x33e48c(0x200)])),console[_0x33e48c(0x266)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x58d5a8['counts']['integrations'])),console[_0x33e48c(0x266)](_0x33e48c(0x20d)+formatCountSummary(_0x58d5a8[_0x33e48c(0x1fb)]['formInterfaces'])),console[_0x33e48c(0x266)]('\x20\x20Chat\x20Interfaces:\x20'+formatCountSummary(_0x58d5a8['counts'][_0x33e48c(0x272)]));const _0x412c85=_0x58d5a8[_0x33e48c(0x1fb)]['experimentalKnowledgeBases'][_0x33e48c(0x253)]>0x0||_0x58d5a8[_0x33e48c(0x1fb)]['experimentalKnowledgeBases']['updated']>0x0||_0x58d5a8[_0x33e48c(0x1fb)]['experimentalKnowledgeBases'][_0x33e48c(0x245)]>0x0||_0x58d5a8['counts'][_0x33e48c(0x233)]['created']>0x0||_0x58d5a8[_0x33e48c(0x1fb)][_0x33e48c(0x233)][_0x33e48c(0x241)]>0x0||_0x58d5a8[_0x33e48c(0x1fb)][_0x33e48c(0x233)][_0x33e48c(0x245)]>0x0;_0x412c85&&(console['log'](_0x33e48c(0x226)+formatCountSummary(_0x58d5a8[_0x33e48c(0x1fb)]['experimentalKnowledgeBases'])),console[_0x33e48c(0x266)](_0x33e48c(0x1fe)+formatCountSummary(_0x58d5a8[_0x33e48c(0x1fb)][_0x33e48c(0x233)])));if(_0x39e35b){console[_0x33e48c(0x266)](),console[_0x33e48c(0x266)](a4_0x40b849[_0x33e48c(0x265)](_0x33e48c(0x219)));for(const _0x30a399 of _0x58d5a8[_0x33e48c(0x1f6)]){_0x30a399[_0x33e48c(0x1e7)]==='error'&&console[_0x33e48c(0x266)](a4_0x40b849[_0x33e48c(0x265)](_0x33e48c(0x1b6)+_0x30a399[_0x33e48c(0x264)]+'\x22:\x20'+_0x30a399[_0x33e48c(0x21f)]));}for(const _0x264b96 of _0x58d5a8[_0x33e48c(0x1ff)]){_0x264b96[_0x33e48c(0x1e7)]===_0x33e48c(0x21f)&&console['log'](a4_0x40b849['red'](_0x33e48c(0x217)+_0x264b96[_0x33e48c(0x25f)]+_0x33e48c(0x218)+_0x264b96[_0x33e48c(0x21f)]));}for(const _0x2aaf78 of _0x58d5a8['prompts']){_0x2aaf78[_0x33e48c(0x1e7)]===_0x33e48c(0x21f)&&console[_0x33e48c(0x266)](a4_0x40b849[_0x33e48c(0x265)]('\x20\x20Prompt\x20\x22'+_0x2aaf78['name']+_0x33e48c(0x218)+_0x2aaf78['error']));}for(const _0x3b140f of _0x58d5a8[_0x33e48c(0x222)]){_0x3b140f[_0x33e48c(0x1e7)]==='error'&&console['log'](a4_0x40b849[_0x33e48c(0x265)]('\x20\x20Integration\x20\x22'+_0x3b140f[_0x33e48c(0x25f)]+_0x33e48c(0x218)+_0x3b140f[_0x33e48c(0x21f)]));}for(const _0x481181 of _0x58d5a8[_0x33e48c(0x252)]){_0x481181[_0x33e48c(0x1e7)]===_0x33e48c(0x21f)&&console[_0x33e48c(0x266)](a4_0x40b849[_0x33e48c(0x265)](_0x33e48c(0x1e9)+_0x481181['name']+_0x33e48c(0x218)+_0x481181[_0x33e48c(0x21f)]));}for(const _0x4cf9f1 of _0x58d5a8[_0x33e48c(0x272)]){_0x4cf9f1[_0x33e48c(0x1e7)]===_0x33e48c(0x21f)&&console['log'](a4_0x40b849[_0x33e48c(0x265)]('\x20\x20Chat\x20Interface\x20\x22'+_0x4cf9f1[_0x33e48c(0x25f)]+_0x33e48c(0x218)+_0x4cf9f1[_0x33e48c(0x21f)]));}for(const _0x4f2993 of _0x58d5a8[_0x33e48c(0x251)]){_0x4f2993[_0x33e48c(0x1e7)]==='error'&&console[_0x33e48c(0x266)](a4_0x40b849['red'](_0x33e48c(0x1c3)+_0x4f2993['name']+_0x33e48c(0x218)+_0x4f2993[_0x33e48c(0x21f)]));}for(const _0x1b9b83 of _0x58d5a8['experimentalArtifacts']){_0x1b9b83['action']===_0x33e48c(0x21f)&&console[_0x33e48c(0x266)](a4_0x40b849[_0x33e48c(0x265)]('\x20\x20Experimental\x20Artifact\x20\x22'+_0x1b9b83[_0x33e48c(0x25f)]+_0x33e48c(0x218)+_0x1b9b83['error']));}return 0x1;}console[_0x33e48c(0x266)]();const _0x1033ce=getLLMProjectUrl(_0xa6cd01,_0x58d5a8[_0x33e48c(0x1f0)]);return console[_0x33e48c(0x266)](_0x33e48c(0x1d1)+a4_0x40b849[_0x33e48c(0x260)](_0x1033ce)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x9ae543(0x25f)]=a4_0x9ae543(0x235);[a4_0x9ae543(0x1d9)]='Push\x20local\x20agent\x20files\x20to\x20LLM\x20project';async[a4_0x9ae543(0x1d0)](_0x8b25f0){const _0x3238ca=a4_0x9ae543,{options:_0x5830e3,args:_0xb2f866,tdx:_0x5a99ff}=_0x8b25f0;let _0x168d67=_0xb2f866[0x0]||process['cwd']();const _0x4332a3=_0x5830e3[_0x3238ca(0x26f)],_0x36bbdb=_0x5830e3['force'],_0x597f22=_0x5830e3['yes'],_0x22b127=_0x5830e3[_0x3238ca(0x262)],_0x47d0f7=a4_0x188f49[_0x3238ca(0x227)](_0x168d67,_0x3238ca(0x261)),_0x166710=existsSync(_0x47d0f7);if(_0x166710){const {data:_0x1002d5}=await withSpinner(_0x3238ca(0x24a)+_0x168d67+_0x3238ca(0x1f9),()=>_0x5a99ff[_0x3238ca(0x1da)][_0x3238ca(0x1e1)](_0x168d67,{'dryRun':_0x4332a3,'force':_0x36bbdb}));if(_0x4332a3)return console[_0x3238ca(0x266)](a4_0x40b849[_0x3238ca(0x1ca)](_0x3238ca(0x244))),console['log'](_0x3238ca(0x1dc)+_0x1002d5[_0x3238ca(0x264)]),0x0;if(_0x1002d5[_0x3238ca(0x1e7)]==='error')return console[_0x3238ca(0x266)](a4_0x40b849[_0x3238ca(0x265)](_0x3238ca(0x1fc)+_0x1002d5[_0x3238ca(0x21f)])),0x1;console[_0x3238ca(0x266)](a4_0x40b849[_0x3238ca(0x203)]('Agent\x20'+_0x1002d5[_0x3238ca(0x1e7)]+_0x3238ca(0x1bc))),console[_0x3238ca(0x266)](_0x3238ca(0x234)+_0x1002d5[_0x3238ca(0x264)]);if(_0x1002d5[_0x3238ca(0x256)]&&_0x1002d5[_0x3238ca(0x1d5)]){const _0x316089=getLLMAgentChatUrl(_0x22b127,_0x1002d5['projectId'],_0x1002d5[_0x3238ca(0x256)]);console[_0x3238ca(0x266)](_0x3238ca(0x1cf)+a4_0x40b849[_0x3238ca(0x260)](_0x316089));}return 0x0;}const _0x2b9452=_0x5830e3[_0x3238ca(0x21a)],_0x41dd96=resolveProjectFromContext(_0x168d67,_0x2b9452);if(_0x41dd96[_0x3238ca(0x214)])_0x168d67=_0x41dd96['projectDir'],_0x41dd96[_0x3238ca(0x1b1)]===_0x3238ca(0x242)&&console[_0x3238ca(0x266)](a4_0x40b849[_0x3238ca(0x1b8)](_0x3238ca(0x23d)+_0x168d67));else{let _0x3ede46=_0x3238ca(0x248);_0x41dd96[_0x3238ca(0x1c7)]===_0x3238ca(0x225)&&(_0x3ede46=_0x41dd96[_0x3238ca(0x221)]+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0x41dd96['llmProject']+_0x3238ca(0x1dd));throw new SDKError(ErrorCode[_0x3238ca(0x250)],_0x41dd96[_0x3238ca(0x1c7)]===_0x3238ca(0x1d4)?_0x41dd96[_0x3238ca(0x221)]:_0x3238ca(0x237)+_0x168d67,undefined,{'helpText':_0x3ede46});}const {data:_0x3432e9}=await withSpinner(_0x3238ca(0x1b3),()=>_0x5a99ff['llm'][_0x3238ca(0x238)](_0x168d67,{'dryRun':!![]})),_0x307381=_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x1f6)][_0x3238ca(0x25c)]>0x0;if(_0x307381){console[_0x3238ca(0x266)](a4_0x40b849[_0x3238ca(0x265)](_0x3238ca(0x229)));for(const _0x349cfc of _0x3432e9[_0x3238ca(0x1f6)]){_0x349cfc[_0x3238ca(0x1e7)]===_0x3238ca(0x21f)&&console[_0x3238ca(0x266)](a4_0x40b849[_0x3238ca(0x265)](_0x3238ca(0x1b6)+_0x349cfc[_0x3238ca(0x264)]+'\x22:\x20'+_0x349cfc[_0x3238ca(0x21f)]));}return 0x1;}const _0x2595ea=_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x1f6)][_0x3238ca(0x253)]+_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x1ff)][_0x3238ca(0x253)]+_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x271)][_0x3238ca(0x253)]+_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x200)]['created']+_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x222)][_0x3238ca(0x253)]+_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x251)][_0x3238ca(0x253)]+_0x3432e9['counts']['experimentalArtifacts'][_0x3238ca(0x253)]+_0x3432e9[_0x3238ca(0x1fb)]['formInterfaces']['created']+_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x272)]['created'],_0x18c141=_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x1f6)][_0x3238ca(0x241)]+_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x1ff)][_0x3238ca(0x241)]+_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x271)][_0x3238ca(0x241)]+_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x200)][_0x3238ca(0x241)]+_0x3432e9[_0x3238ca(0x1fb)]['integrations'][_0x3238ca(0x241)]+_0x3432e9['counts'][_0x3238ca(0x251)][_0x3238ca(0x241)]+_0x3432e9[_0x3238ca(0x1fb)]['experimentalArtifacts'][_0x3238ca(0x241)]+_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x252)][_0x3238ca(0x241)]+_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x272)][_0x3238ca(0x241)],_0x24fc57=_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x1f6)]['unchanged']+_0x3432e9[_0x3238ca(0x1fb)]['knowledgeBases']['unchanged']+_0x3432e9['counts'][_0x3238ca(0x271)][_0x3238ca(0x245)]+_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x200)]['unchanged']+_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x222)]['unchanged']+_0x3432e9['counts']['experimentalKnowledgeBases']['unchanged']+_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x233)][_0x3238ca(0x245)]+_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x252)][_0x3238ca(0x245)]+_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x272)]['unchanged'];console[_0x3238ca(0x266)]('\x0aPush\x20summary\x20for\x20\x27'+_0x3432e9['projectName']+'\x27:'),console[_0x3238ca(0x266)]('\x20\x20'+a4_0x40b849['green']('+\x20'+_0x2595ea+'\x20new')+'\x20|\x20'+a4_0x40b849['yellow']('~\x20'+_0x18c141+_0x3238ca(0x258))+_0x3238ca(0x1c2)+a4_0x40b849[_0x3238ca(0x1b8)]('=\x20'+_0x24fc57+_0x3238ca(0x1b9))),console[_0x3238ca(0x266)](_0x3238ca(0x25d)+formatCountSummary(_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x1f6)])),console['log'](_0x3238ca(0x216)+formatCountSummary(_0x3432e9['counts'][_0x3238ca(0x1ff)])),console[_0x3238ca(0x266)](_0x3238ca(0x1e6)+formatCountSummary(_0x3432e9['counts'][_0x3238ca(0x271)])),console[_0x3238ca(0x266)](_0x3238ca(0x1ba)+formatCountSummary(_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x200)])),console[_0x3238ca(0x266)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x3432e9['counts'][_0x3238ca(0x222)])),console[_0x3238ca(0x266)]('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0x3432e9['counts'][_0x3238ca(0x252)])),console[_0x3238ca(0x266)](_0x3238ca(0x230)+formatCountSummary(_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x272)]));const _0x384423=_0x3432e9[_0x3238ca(0x1fb)]['experimentalKnowledgeBases'][_0x3238ca(0x253)]>0x0||_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x251)][_0x3238ca(0x241)]>0x0||_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x251)]['unchanged']>0x0||_0x3432e9[_0x3238ca(0x1fb)]['experimentalArtifacts'][_0x3238ca(0x253)]>0x0||_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x233)]['updated']>0x0||_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x233)][_0x3238ca(0x245)]>0x0;_0x384423&&(console[_0x3238ca(0x266)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x251)])),console[_0x3238ca(0x266)](_0x3238ca(0x1fe)+formatCountSummary(_0x3432e9[_0x3238ca(0x1fb)][_0x3238ca(0x233)])));console[_0x3238ca(0x266)](_0x3238ca(0x24f)+a4_0x40b849[_0x3238ca(0x260)](_0x168d67)),displayDiffs(_0x3432e9['agents'],_0x3432e9[_0x3238ca(0x1ff)],_0x3432e9['textKnowledgeBases'],_0x3432e9[_0x3238ca(0x200)],_0x3432e9[_0x3238ca(0x222)],_0x3432e9[_0x3238ca(0x251)],_0x3432e9[_0x3238ca(0x233)],_0x3432e9[_0x3238ca(0x252)],_0x3432e9['chatInterfaces']);if(_0x4332a3)return console[_0x3238ca(0x266)](a4_0x40b849[_0x3238ca(0x1ca)](_0x3238ca(0x1d7))),0x0;if(_0x2595ea===0x0&&_0x18c141===0x0){console[_0x3238ca(0x266)](a4_0x40b849['green'](_0x3238ca(0x1cb)));const _0x80b3aa=getLLMProjectUrl(_0x22b127,_0x3432e9[_0x3238ca(0x1d5)]);return console[_0x3238ca(0x266)](_0x3238ca(0x1d1)+a4_0x40b849[_0x3238ca(0x260)](_0x80b3aa)),0x0;}if(!_0x597f22&&!_0x36bbdb){if(!isInteractive())return console[_0x3238ca(0x21f)](a4_0x40b849[_0x3238ca(0x265)](_0x3238ca(0x1c0)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x3238ca(0x21f)](a4_0x40b849['dim'](_0x3238ca(0x25b))),0x1;const _0x378112=await confirmKey(_0x3238ca(0x1d2)+(_0x2595ea+_0x18c141)+_0x3238ca(0x1ea));if(!_0x378112)return console[_0x3238ca(0x266)](a4_0x40b849[_0x3238ca(0x1ca)](_0x3238ca(0x22c)),_0x3238ca(0x205)),0x1;}const {data:_0x5030a8}=await withSpinner('Pushing\x20to\x20project...',()=>_0x5a99ff['llm'][_0x3238ca(0x238)](_0x168d67,{'force':_0x36bbdb})),_0x250b1f=_0x5030a8['counts'][_0x3238ca(0x1f6)][_0x3238ca(0x25c)]>0x0||_0x5030a8['counts'][_0x3238ca(0x1ff)][_0x3238ca(0x25c)]>0x0||_0x5030a8[_0x3238ca(0x1fb)][_0x3238ca(0x271)][_0x3238ca(0x25c)]>0x0||_0x5030a8[_0x3238ca(0x1fb)][_0x3238ca(0x200)][_0x3238ca(0x25c)]>0x0||_0x5030a8[_0x3238ca(0x1fb)][_0x3238ca(0x252)]['errors']>0x0||_0x5030a8[_0x3238ca(0x1fb)][_0x3238ca(0x272)][_0x3238ca(0x25c)]>0x0;if(_0x250b1f){console[_0x3238ca(0x266)](a4_0x40b849[_0x3238ca(0x1ca)](_0x3238ca(0x20e))),console[_0x3238ca(0x266)](),console[_0x3238ca(0x266)](a4_0x40b849['red']('Errors:'));for(const _0x14961e of _0x5030a8['agents']){_0x14961e[_0x3238ca(0x1e7)]===_0x3238ca(0x21f)&&console[_0x3238ca(0x266)](a4_0x40b849[_0x3238ca(0x265)](_0x3238ca(0x1b6)+_0x14961e[_0x3238ca(0x264)]+_0x3238ca(0x218)+_0x14961e[_0x3238ca(0x21f)]));}for(const _0x345729 of _0x5030a8[_0x3238ca(0x1ff)]){_0x345729[_0x3238ca(0x1e7)]===_0x3238ca(0x21f)&&console[_0x3238ca(0x266)](a4_0x40b849[_0x3238ca(0x265)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x345729[_0x3238ca(0x25f)]+_0x3238ca(0x218)+_0x345729[_0x3238ca(0x21f)]));}for(const _0x4f9513 of _0x5030a8[_0x3238ca(0x271)]){_0x4f9513[_0x3238ca(0x1e7)]===_0x3238ca(0x21f)&&console[_0x3238ca(0x266)](a4_0x40b849[_0x3238ca(0x265)]('\x20\x20Text\x20Knowledge\x20Base\x20\x22'+_0x4f9513[_0x3238ca(0x25f)]+_0x3238ca(0x218)+_0x4f9513[_0x3238ca(0x21f)]));}for(const _0x269a11 of _0x5030a8['prompts']){_0x269a11[_0x3238ca(0x1e7)]==='error'&&console['log'](a4_0x40b849['red'](_0x3238ca(0x1f2)+_0x269a11[_0x3238ca(0x25f)]+_0x3238ca(0x218)+_0x269a11[_0x3238ca(0x21f)]));}for(const _0x423a24 of _0x5030a8[_0x3238ca(0x222)]){_0x423a24[_0x3238ca(0x1e7)]==='error'&&console[_0x3238ca(0x266)](a4_0x40b849['red'](_0x3238ca(0x204)+_0x423a24[_0x3238ca(0x25f)]+_0x3238ca(0x218)+_0x423a24['error']));}for(const _0x5b5cd6 of _0x5030a8['formInterfaces']){_0x5b5cd6[_0x3238ca(0x1e7)]===_0x3238ca(0x21f)&&console['log'](a4_0x40b849[_0x3238ca(0x265)](_0x3238ca(0x1e9)+_0x5b5cd6[_0x3238ca(0x25f)]+_0x3238ca(0x218)+_0x5b5cd6[_0x3238ca(0x21f)]));}for(const _0x392c35 of _0x5030a8[_0x3238ca(0x272)]){_0x392c35[_0x3238ca(0x1e7)]==='error'&&console['log'](a4_0x40b849[_0x3238ca(0x265)](_0x3238ca(0x207)+_0x392c35['name']+_0x3238ca(0x218)+_0x392c35['error']));}return 0x1;}console[_0x3238ca(0x266)](a4_0x40b849['green'](_0x3238ca(0x22d)+(_0x2595ea+_0x18c141)+_0x3238ca(0x24e)+_0x5030a8[_0x3238ca(0x202)]+'\x27'));const _0x4f155c=getLLMProjectUrl(_0x22b127,_0x5030a8[_0x3238ca(0x1d5)]);return console[_0x3238ca(0x266)](_0x3238ca(0x1d1)+a4_0x40b849['cyan'](_0x4f155c)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a5_0x1a5b(_0x1d694c,_0x125670){_0x1d694c=_0x1d694c-0x1a5;const _0x366b7d=a5_0x366b();let _0x1a5bee=_0x366b7d[_0x1d694c];return _0x1a5bee;}const a5_0x2badb6=a5_0x1a5b;(function(_0x2bacca,_0x3f58b1){const _0x160870=a5_0x1a5b,_0x51c85d=_0x2bacca();while(!![]){try{const _0xd20df7=parseInt(_0x160870(0x1ed))/0x1+parseInt(_0x160870(0x202))/0x2+-parseInt(_0x160870(0x1b2))/0x3+parseInt(_0x160870(0x1ef))/0x4+-parseInt(_0x160870(0x1b5))/0x5+-parseInt(_0x160870(0x203))/0x6+parseInt(_0x160870(0x1e7))/0x7*(parseInt(_0x160870(0x22f))/0x8);if(_0xd20df7===_0x3f58b1)break;else _0x51c85d['push'](_0x51c85d['shift']());}catch(_0x5603ea){_0x51c85d['push'](_0x51c85d['shift']());}}}(a5_0x366b,0x976bd));function a5_0x366b(){const _0x493cbe=['multiple_agents','conversations','Available\x20tags:\x20','Re-evaluating\x20cached\x20test\x20run...','push','Round\x20','existsSync','red','no_local_folder','repeat','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','8144mDENjH','execute','\x20\x20-\x20','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','tags','toISOString','join','now','rounds','conversation_url','llm','filter','name','\x20-\x20','status','\x20\x20Project:\x20','not\x20found','Total:\x20\x20\x20\x20','Usage:','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','yellow','Passed:\x20\x20\x20','Test\x20Configuration:','1818060CndMxc','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','\x27\x20to\x20create\x20the\x20folder\x20structure.','2750975UprHki','resolveAgentId','context','reason','source','writeFileSync','\x20(new)','...\x20','log','eval','jsonl','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','\x22,\x20but\x20current\x20site\x20is\x20\x22','substring','Test\x20','no_context','Project\x20path:\x20','agentDirs','tests','\x20\x20Evaluating...\x20','projectDir','llmProject','Evaluating\x20response...','description','✗\x20ERROR:\x20','Tests\x20found:\x20','trim','Run\x20\x27tdx\x20agent\x20pull\x20','site','resolveProjectId','Agent:\x20','Running:\x20','Round\x201/','text','basename','toLowerCase','Output\x20written\x20to:\x20','start','ERROR','No\x20tests\x20found\x20with\x20tags:\x20','no_tests','\x20\x20Site:\x20','has','some','\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','No\x20tests\x20found\x20matching:\x20','✓\x20PASS:\x20','✗\x20FAIL:\x20','isSpinning','\x20\x20Agent:\x20','3178FvwpiR','No\x20tests\x20have\x20tags\x20defined.','split','Test\x20Summary',':\x20Sending\x20user\x20input...','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','852610xKQTer','json','733080qymzWa','dryRun','Duration:\x20','includes','stop','FAIL','Cached\x20run\x20from:\x20','agentName','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','Error\x20writing\x20output\x20file:\x20','Available\x20tests:\x20','cyan','Re-evaluating\x20','executeReeval','Cached\x20run\x20is\x20from\x20site\x20\x22','...','\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)','2427312EBEeom','5611632eFyJKr','PASS','message','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','agent','agent:test','404','Running\x20agent\x20tests...','add','length','green','utf-8','tsv','dim','\x20\x20Round\x20','find','resolve','size','map','✗\x20ERROR:\x20Project\x20not\x20found:\x20','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','projectName','Errors:\x20\x20\x20','Failed:\x20\x20\x20','testYmlPath','table','Failed\x20Tests:','round','found','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','\x20(cached)','verbose','white'];a5_0x366b=function(){return _0x493cbe;};return a5_0x366b();}import*as a5_0x306e8a from'node:fs';import*as a5_0x4b04ce from'node:path';import a5_0x76862c from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x2badb6(0x1a7)]=a5_0x2badb6(0x208);[a5_0x2badb6(0x1cc)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x2badb6(0x230)](_0x4b6a19){const _0x34d658=a5_0x2badb6,{options:_0x5a33a5,args:_0x396989,tdx:_0xd91308}=_0x4b6a19,_0x2ac85b=_0x396989[0x0]||'.',_0x30b81b=_0x5a33a5[_0x34d658(0x1f0)],_0x2d4bad=_0x5a33a5,_0x40f532=_0x2d4bad[_0x34d658(0x1be)]===![],_0x1b559c=_0x2d4bad['reeval'],_0x2b764b=_0x2d4bad['name'],_0x333477=_0x2d4bad[_0x34d658(0x233)],_0x21869a=_0x5a33a5[_0x34d658(0x1d1)],_0x4876a4=_0x2d4bad['output'];if(_0x1b559c&&_0x40f532)return console['log'](a5_0x76862c[_0x34d658(0x22b)](_0x34d658(0x1f9))),0x1;let _0x360bb8=_0x34d658(0x21c);if(_0x2d4bad['json'])_0x360bb8=_0x34d658(0x1ee);else{if(_0x2d4bad[_0x34d658(0x1bf)])_0x360bb8='jsonl';else{if(_0x2d4bad[_0x34d658(0x20f)])_0x360bb8=_0x34d658(0x20f);else{if(_0x2d4bad['table'])_0x360bb8=_0x34d658(0x21c);}}}const _0xc3296f=_0x2d4bad[_0x34d658(0x1ca)];let _0x542c9b=_0x2ac85b;const _0x6b3539=a5_0x306e8a[_0x34d658(0x22a)](_0x2ac85b),_0x3cc615=_0x2ac85b==='.';if(!_0x6b3539||_0x3cc615){const _0x4c8d08=resolveProjectFromContext(_0x2ac85b,_0xc3296f,{'requireFile':'test.yml'});if(_0x4c8d08[_0x34d658(0x21f)])_0x542c9b=_0x4c8d08[_0x34d658(0x1c9)],_0x4c8d08[_0x34d658(0x1b9)]===_0x34d658(0x1b7)&&console[_0x34d658(0x1bd)](a5_0x76862c['dim']('Using\x20agent:\x20'+_0x542c9b));else switch(_0x4c8d08[_0x34d658(0x1b8)]){case _0x34d658(0x1c4):console['log'](a5_0x76862c[_0x34d658(0x1af)](_0x4c8d08[_0x34d658(0x205)])),console['log'](),console[_0x34d658(0x1bd)](_0x34d658(0x1ad)),console['log'](_0x34d658(0x1e1)),console[_0x34d658(0x1bd)](_0x34d658(0x201)),console['log'](),console[_0x34d658(0x1bd)](_0x34d658(0x232));return 0x1;case _0x34d658(0x22c):console['log'](a5_0x76862c[_0x34d658(0x1af)](_0x4c8d08[_0x34d658(0x205)])),console[_0x34d658(0x1bd)](),console[_0x34d658(0x1bd)](_0x34d658(0x1d0)+_0x4c8d08[_0x34d658(0x1ca)]+_0x34d658(0x1b4));return 0x1;case _0x34d658(0x224):{const _0x2cebf5=a5_0x4b04ce[_0x34d658(0x1d7)](_0x4c8d08[_0x34d658(0x1c9)]);console[_0x34d658(0x1bd)](a5_0x76862c['yellow'](_0x34d658(0x217)+_0x4c8d08[_0x34d658(0x1ca)]+'\x22:'));for(const _0x514ecb of _0x4c8d08[_0x34d658(0x1c6)]){console[_0x34d658(0x1bd)](_0x34d658(0x231)+_0x514ecb);}return console['log'](),console[_0x34d658(0x1bd)](_0x34d658(0x206)+_0x2cebf5+'/<agent-name>'),0x1;}case _0x34d658(0x1dd):console[_0x34d658(0x1bd)](a5_0x76862c['yellow']('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x4c8d08[_0x34d658(0x1ca)]+'\x22.')),console['log'](a5_0x76862c[_0x34d658(0x210)](_0x34d658(0x1c5)+_0x4c8d08['projectDir'])),console[_0x34d658(0x1bd)](),console['log'](_0x34d658(0x1b3));return 0x1;}}const {definition:_0x44eb60,agentInfo:_0x17efc5}=parseTestFile(_0x542c9b);let _0x186964=_0x44eb60['tests'];if(_0x2b764b){const _0x517626=_0x2b764b[_0x34d658(0x1e9)](',')[_0x34d658(0x215)](_0x41d36a=>_0x41d36a[_0x34d658(0x1cf)]());_0x186964=_0x44eb60['tests']['filter'](_0x5a50f1=>_0x517626[_0x34d658(0x1f2)](_0x5a50f1[_0x34d658(0x1a7)]));if(_0x186964[_0x34d658(0x20c)]===0x0)return console[_0x34d658(0x1bd)](a5_0x76862c[_0x34d658(0x1af)](_0x34d658(0x1e2)+_0x2b764b)),console[_0x34d658(0x1bd)](a5_0x76862c[_0x34d658(0x210)](_0x34d658(0x1fb)+_0x44eb60['tests'][_0x34d658(0x215)](_0x284edd=>_0x284edd[_0x34d658(0x1a7)])[_0x34d658(0x235)](',\x20'))),0x1;}if(_0x333477){const _0xcdd902=_0x333477[_0x34d658(0x1e9)](',')[_0x34d658(0x215)](_0x4c6204=>_0x4c6204[_0x34d658(0x1cf)]()['toLowerCase']());_0x186964=_0x186964[_0x34d658(0x1a6)](_0x27db74=>_0x27db74['tags']?.[_0x34d658(0x1e0)](_0x3bdaec=>_0xcdd902[_0x34d658(0x1f2)](_0x3bdaec[_0x34d658(0x1d8)]())));if(_0x186964[_0x34d658(0x20c)]===0x0){console['log'](a5_0x76862c['yellow'](_0x34d658(0x1dc)+_0x333477));const _0x16e38c=new Set();return _0x44eb60[_0x34d658(0x1c7)]['forEach'](_0x557184=>_0x557184[_0x34d658(0x233)]?.['forEach'](_0x1f128e=>_0x16e38c[_0x34d658(0x20b)](_0x1f128e))),_0x16e38c[_0x34d658(0x214)]>0x0?console[_0x34d658(0x1bd)](a5_0x76862c['dim'](_0x34d658(0x226)+[..._0x16e38c][_0x34d658(0x235)](',\x20'))):console[_0x34d658(0x1bd)](a5_0x76862c[_0x34d658(0x210)](_0x34d658(0x1e8))),0x1;}}if(_0x1b559c)return this[_0x34d658(0x1fe)](_0x4b6a19,{'definition':{'tests':_0x186964},'agentInfo':_0x17efc5,'outputFormat':_0x360bb8,'outputFile':_0x4876a4,'testNames':_0x2b764b});if(_0x30b81b){console['log'](a5_0x76862c[_0x34d658(0x1fc)](_0x34d658(0x1b1))),console[_0x34d658(0x1bd)](_0x34d658(0x1de)+a5_0x76862c[_0x34d658(0x223)](_0x21869a)),console[_0x34d658(0x1bd)](_0x34d658(0x1aa)+a5_0x76862c['white'](_0x17efc5[_0x34d658(0x218)])),console[_0x34d658(0x1bd)](_0x34d658(0x1e6)+a5_0x76862c[_0x34d658(0x223)](_0x17efc5[_0x34d658(0x1f6)])),console[_0x34d658(0x1bd)](),console[_0x34d658(0x1bd)](_0x34d658(0x1ce)+a5_0x76862c[_0x34d658(0x223)](_0x186964['length']));for(let _0x3dab24=0x0;_0x3dab24<_0x186964[_0x34d658(0x20c)];_0x3dab24++){const _0x99d11c=_0x186964[_0x3dab24],_0x3e6b10=_0x99d11c[_0x34d658(0x237)][_0x34d658(0x20c)]===0x1?_0x34d658(0x21e):_0x34d658(0x237),_0xf003c3=_0x99d11c[_0x34d658(0x233)]?.[_0x34d658(0x20c)]?'\x20['+_0x99d11c[_0x34d658(0x233)][_0x34d658(0x235)](',\x20')+']':'';console[_0x34d658(0x1bd)]('\x20\x20'+(_0x3dab24+0x1)+'.\x20'+a5_0x76862c[_0x34d658(0x223)](_0x99d11c[_0x34d658(0x1a7)])+'\x20('+_0x99d11c[_0x34d658(0x237)]['length']+'\x20'+_0x3e6b10+')'+a5_0x76862c[_0x34d658(0x210)](_0xf003c3));}return 0x0;}let _0x2f407d,_0x489244;try{_0x2f407d=await _0xd91308[_0x34d658(0x1a5)][_0x34d658(0x1d2)](_0x17efc5['projectName']);}catch(_0x7d146f){const _0x438a4e=_0x7d146f instanceof Error?_0x7d146f['message']:String(_0x7d146f);return _0x438a4e[_0x34d658(0x1f2)](_0x34d658(0x209))||_0x438a4e[_0x34d658(0x1d8)]()[_0x34d658(0x1f2)](_0x34d658(0x1ab))?console[_0x34d658(0x1bd)](a5_0x76862c[_0x34d658(0x22b)](_0x34d658(0x216)+_0x17efc5['projectName'])):console['log'](a5_0x76862c[_0x34d658(0x22b)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0x17efc5[_0x34d658(0x218)]+'\x22:\x20'+_0x438a4e)),0x1;}try{_0x489244=await _0xd91308[_0x34d658(0x1a5)][_0x34d658(0x1b6)](_0x17efc5['agentName'],_0x2f407d);}catch(_0x1f57eb){const _0x23fdcb=_0x1f57eb instanceof Error?_0x1f57eb[_0x34d658(0x205)]:String(_0x1f57eb);return _0x23fdcb[_0x34d658(0x1f2)](_0x34d658(0x209))||_0x23fdcb[_0x34d658(0x1d8)]()['includes'](_0x34d658(0x1ab))?console[_0x34d658(0x1bd)](a5_0x76862c['red'](_0x34d658(0x1f8)+_0x17efc5[_0x34d658(0x1f6)])):console[_0x34d658(0x1bd)](a5_0x76862c[_0x34d658(0x22b)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x17efc5[_0x34d658(0x1f6)]+'\x22:\x20'+_0x23fdcb)),0x1;}let _0x32e5a8;if(!_0x40f532)try{_0x32e5a8=await setupEvaluatorAgent(_0xd91308['llm'],_0x5a33a5['verbose']);}catch(_0x3208f3){const _0x293a51=_0x3208f3 instanceof Error?_0x3208f3[_0x34d658(0x205)]:String(_0x3208f3);return console['log'](a5_0x76862c[_0x34d658(0x22b)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x293a51)),0x1;}console[_0x34d658(0x1bd)](a5_0x76862c[_0x34d658(0x1fc)](_0x34d658(0x20a))),console[_0x34d658(0x1bd)]('Site:\x20'+a5_0x76862c[_0x34d658(0x223)](_0x21869a)),console['log']('Agent:\x20'+a5_0x76862c['white'](_0x17efc5[_0x34d658(0x218)]+'/'+_0x17efc5[_0x34d658(0x1f6)])),console[_0x34d658(0x1bd)]();const _0x2e0240=[],_0x7cb4d4=[],_0x851228=Date[_0x34d658(0x236)]();for(let _0x18b6c5=0x0;_0x18b6c5<_0x186964[_0x34d658(0x20c)];_0x18b6c5++){const _0x14a2b0=_0x186964[_0x18b6c5];_0x186964[_0x34d658(0x20c)]>0x1?console[_0x34d658(0x1bd)](_0x34d658(0x1c3)+(_0x18b6c5+0x1)+'/'+_0x186964[_0x34d658(0x20c)]+':\x20'+a5_0x76862c[_0x34d658(0x223)](_0x14a2b0[_0x34d658(0x1a7)])):console['log']('Running\x20test:\x20'+a5_0x76862c[_0x34d658(0x223)](_0x14a2b0['name']));const _0x5a01b1=createCommandSpinner(_0x34d658(0x1d5)+_0x14a2b0['rounds']['length']+_0x34d658(0x1eb));_0x5a01b1[_0x34d658(0x1da)]();try{const {result:_0x5ee29b,conversation:_0x229c9d}=await runTest(_0xd91308['llm'],_0x14a2b0,{'agentId':_0x489244,'projectId':_0x2f407d,'site':_0x21869a,'noEval':_0x40f532,'evaluatorId':_0x32e5a8,'onRoundStart':(_0x223907,_0x5c1e46)=>{const _0x3d6eb8=_0x34d658;_0x5a01b1[_0x3d6eb8(0x1d6)]=_0x3d6eb8(0x229)+(_0x223907+0x1)+'/'+_0x5c1e46+_0x3d6eb8(0x1eb);},'onRoundComplete':(_0x9810c1,_0x95b99c,_0x36185d)=>{const _0x22c1de=_0x34d658,_0x1a909e=formatElapsed(_0x95b99c);_0x36185d?console[_0x22c1de(0x1bd)](_0x22c1de(0x211)+(_0x9810c1+0x1)+'/'+_0x14a2b0[_0x22c1de(0x237)][_0x22c1de(0x20c)]+_0x22c1de(0x1bc)+a5_0x76862c[_0x22c1de(0x20d)]('✓')+'\x20('+_0x1a909e+')'):console['log'](_0x22c1de(0x211)+(_0x9810c1+0x1)+'/'+_0x14a2b0[_0x22c1de(0x237)][_0x22c1de(0x20c)]+_0x22c1de(0x1bc)+a5_0x76862c['red']('✗'));},'onEvaluationStart':()=>{const _0x1713e6=_0x34d658;_0x5a01b1[_0x1713e6(0x1d6)]=_0x1713e6(0x1cb);},'onEvaluationComplete':_0x42c12b=>{const _0x7b1757=_0x34d658,_0x1fe86c=formatElapsed(_0x42c12b);console[_0x7b1757(0x1bd)](_0x7b1757(0x1c8)+a5_0x76862c[_0x7b1757(0x20d)]('✓')+'\x20('+_0x1fe86c+')');}});_0x5a01b1[_0x34d658(0x1f3)](),_0x2e0240['push'](_0x5ee29b),_0x7cb4d4['push'](_0x229c9d);if(_0x5ee29b[_0x34d658(0x1a9)]===_0x34d658(0x204))console[_0x34d658(0x1bd)](a5_0x76862c['green'](_0x34d658(0x1e3)+_0x5ee29b[_0x34d658(0x1b8)]));else _0x5ee29b[_0x34d658(0x1a9)]===_0x34d658(0x1f4)?console[_0x34d658(0x1bd)](a5_0x76862c[_0x34d658(0x22b)]('✗\x20FAIL:\x20'+_0x5ee29b['reason'])):console[_0x34d658(0x1bd)](a5_0x76862c['red'](_0x34d658(0x1cd)+_0x5ee29b[_0x34d658(0x1b8)]));_0x5ee29b[_0x34d658(0x238)]&&console[_0x34d658(0x1bd)](a5_0x76862c[_0x34d658(0x210)]('Conversation\x20URL:\x20'+_0x5ee29b[_0x34d658(0x238)])),console[_0x34d658(0x1bd)]();}catch(_0x1d111c){_0x5a01b1['stop']();const _0x472093=_0x1d111c instanceof Error?_0x1d111c[_0x34d658(0x205)]:String(_0x1d111c);console['log'](a5_0x76862c[_0x34d658(0x22b)](_0x34d658(0x1cd)+_0x472093)),console[_0x34d658(0x1bd)](),_0x2e0240['push']({'name':_0x14a2b0[_0x34d658(0x1a7)],'status':_0x34d658(0x1db),'reason':_0x472093,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x25301a=Date[_0x34d658(0x236)]()-_0x851228,_0x5308fe=_0x2e0240[_0x34d658(0x1a6)](_0x39b7d6=>_0x39b7d6[_0x34d658(0x1a9)]===_0x34d658(0x204))[_0x34d658(0x20c)],_0x1740ba=_0x2e0240['filter'](_0x293355=>_0x293355[_0x34d658(0x1a9)]==='FAIL')['length'],_0x4e7774=_0x2e0240['filter'](_0xe0e8ff=>_0xe0e8ff[_0x34d658(0x1a9)]===_0x34d658(0x1db))[_0x34d658(0x20c)];console[_0x34d658(0x1bd)]('━'[_0x34d658(0x22d)](0x3c)),console['log'](_0x34d658(0x1ea)),console[_0x34d658(0x1bd)]('━'[_0x34d658(0x22d)](0x3c)),console[_0x34d658(0x1bd)](_0x34d658(0x1ac)+_0x2e0240[_0x34d658(0x20c)]),console['log']('Passed:\x20\x20\x20'+a5_0x76862c[_0x34d658(0x20d)](_0x5308fe)),console[_0x34d658(0x1bd)](_0x34d658(0x21a)+a5_0x76862c[_0x34d658(0x22b)](_0x1740ba));_0x4e7774>0x0&&console[_0x34d658(0x1bd)](_0x34d658(0x219)+a5_0x76862c[_0x34d658(0x22b)](_0x4e7774));console['log']('Duration:\x20'+formatElapsed(_0x25301a)),console[_0x34d658(0x1bd)]('━'[_0x34d658(0x22d)](0x3c));const _0x2b92c8=_0x2e0240[_0x34d658(0x1a6)](_0x387255=>_0x387255[_0x34d658(0x1a9)]!==_0x34d658(0x204));if(_0x2b92c8[_0x34d658(0x20c)]>0x0){console[_0x34d658(0x1bd)](),console[_0x34d658(0x1bd)](_0x34d658(0x21d));for(const _0x50193e of _0x2b92c8){const _0x33a965=a5_0x76862c['red']('✗'),_0x4ceabc=_0x50193e['reason']['length']>0x32?_0x50193e[_0x34d658(0x1b8)][_0x34d658(0x1c2)](0x0,0x32)+_0x34d658(0x200):_0x50193e['reason'];console['log']('\x20\x20'+_0x33a965+'\x20'+_0x50193e[_0x34d658(0x1a7)]+':\x20'+_0x4ceabc);}}const _0x4692a4={'summary':{'total':_0x2e0240[_0x34d658(0x20c)],'passed':_0x5308fe,'failed':_0x1740ba,'errors':_0x4e7774>0x0?_0x4e7774:undefined,'duration_ms':_0x25301a},'tests':_0x2e0240,'agent':{'project':_0x17efc5['projectName'],'name':_0x17efc5[_0x34d658(0x1f6)],'site':_0x21869a},'timestamp':new Date(_0x851228)[_0x34d658(0x234)]()};try{const _0x1d9609=buildCachedTestRun(_0x7cb4d4,{'site':_0x21869a,'projectId':_0x2f407d,'projectName':_0x17efc5['projectName'],'agentId':_0x489244,'agentName':_0x17efc5[_0x34d658(0x1f6)],'testYmlPath':a5_0x4b04ce[_0x34d658(0x213)](_0x17efc5[_0x34d658(0x21b)])});saveLastTestRun(_0x1d9609);}catch{}if(_0x360bb8!==_0x34d658(0x21c)||_0x4876a4){const _0x5b2ff9=formatResults(_0x4692a4,_0x360bb8);if(_0x4876a4)try{a5_0x306e8a['writeFileSync'](_0x4876a4,_0x5b2ff9,_0x34d658(0x20e)),console[_0x34d658(0x1bd)](),console[_0x34d658(0x1bd)](a5_0x76862c[_0x34d658(0x210)]('Output\x20written\x20to:\x20'+_0x4876a4));}catch(_0x367c37){return console[_0x34d658(0x1bd)](),console[_0x34d658(0x1bd)](a5_0x76862c[_0x34d658(0x22b)](_0x34d658(0x1fa)+_0x367c37)),0x1;}else console['log'](),console[_0x34d658(0x1bd)](_0x5b2ff9);}return _0x2b92c8[_0x34d658(0x20c)]>0x0?0x1:0x0;}async['executeReeval'](_0x6e2650,_0x1cb467){const _0x4a8ffb=a5_0x2badb6,{options:_0x2121ed,tdx:_0x12d9f7}=_0x6e2650,{definition:_0x7dd32,agentInfo:_0x13b82e,outputFormat:_0x177021,outputFile:_0x217937}=_0x1cb467,_0x54af9c=_0x2121ed[_0x4a8ffb(0x1d1)],_0x33f93d=loadLastTestRun();if(!_0x33f93d)return console[_0x4a8ffb(0x1bd)](a5_0x76862c[_0x4a8ffb(0x22b)]('Error:\x20No\x20previous\x20test\x20run\x20found.')),console[_0x4a8ffb(0x1bd)](a5_0x76862c[_0x4a8ffb(0x210)]('Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.')),0x1;if(_0x33f93d[_0x4a8ffb(0x207)]['agentName']!==_0x13b82e[_0x4a8ffb(0x1f6)])return console[_0x4a8ffb(0x1bd)](a5_0x76862c[_0x4a8ffb(0x22b)](_0x4a8ffb(0x1f7)+_0x33f93d[_0x4a8ffb(0x207)][_0x4a8ffb(0x1f6)]+_0x4a8ffb(0x220)+_0x13b82e[_0x4a8ffb(0x1f6)]+'\x22.')),console[_0x4a8ffb(0x1bd)](a5_0x76862c['dim'](_0x4a8ffb(0x1ae))),0x1;const _0x3ad159=new Set(_0x33f93d[_0x4a8ffb(0x225)][_0x4a8ffb(0x215)](_0x1b7fc4=>_0x1b7fc4['testName'])),_0x50abfd=_0x7dd32[_0x4a8ffb(0x1c7)][_0x4a8ffb(0x1a6)](_0x349af0=>!_0x3ad159['has'](_0x349af0['name']));if(_0x50abfd[_0x4a8ffb(0x20c)]>0x0&&_0x33f93d[_0x4a8ffb(0x1d1)]!==_0x54af9c)return console[_0x4a8ffb(0x1bd)](a5_0x76862c[_0x4a8ffb(0x22b)](_0x4a8ffb(0x1ec))),console[_0x4a8ffb(0x1bd)](a5_0x76862c['dim'](_0x4a8ffb(0x1ff)+_0x33f93d[_0x4a8ffb(0x1d1)]+_0x4a8ffb(0x1c1)+_0x54af9c+'\x22.')),console[_0x4a8ffb(0x1bd)](a5_0x76862c[_0x4a8ffb(0x210)]('Either\x20switch\x20to\x20the\x20\x22'+_0x33f93d['site']+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0xceba3a=_0x7dd32[_0x4a8ffb(0x1c7)][_0x4a8ffb(0x1a6)](_0x5dc943=>_0x3ad159[_0x4a8ffb(0x1df)](_0x5dc943[_0x4a8ffb(0x1a7)])),_0x58e445=_0x50abfd;let _0x1c5cd0;try{_0x1c5cd0=await setupEvaluatorAgent(_0x12d9f7[_0x4a8ffb(0x1a5)],_0x2121ed[_0x4a8ffb(0x222)]);}catch(_0x2e97e9){const _0x587d19=_0x2e97e9 instanceof Error?_0x2e97e9[_0x4a8ffb(0x205)]:String(_0x2e97e9);return console[_0x4a8ffb(0x1bd)](a5_0x76862c['red'](_0x4a8ffb(0x22e)+_0x587d19)),0x1;}console['log'](a5_0x76862c[_0x4a8ffb(0x1fc)](_0x4a8ffb(0x227))),console['log'](_0x4a8ffb(0x1f5)+a5_0x76862c[_0x4a8ffb(0x223)](_0x33f93d['timestamp'])),console[_0x4a8ffb(0x1bd)](_0x4a8ffb(0x1d3)+a5_0x76862c['white'](_0x33f93d[_0x4a8ffb(0x207)][_0x4a8ffb(0x218)]+'/'+_0x33f93d[_0x4a8ffb(0x207)][_0x4a8ffb(0x1f6)]));_0x58e445[_0x4a8ffb(0x20c)]>0x0&&console[_0x4a8ffb(0x1bd)]('New\x20tests\x20to\x20execute:\x20'+a5_0x76862c['yellow'](_0x58e445[_0x4a8ffb(0x20c)]));console[_0x4a8ffb(0x1bd)]();const _0x231132=[],_0x3010f9=Date[_0x4a8ffb(0x236)](),_0x57bd6c=createCommandSpinner('Re-evaluating...');if(_0xceba3a[_0x4a8ffb(0x20c)]>0x0)try{const _0x56e035=await reevaluateFromCache(_0x12d9f7[_0x4a8ffb(0x1a5)],_0x33f93d,{'tests':_0xceba3a},{'evaluatorId':_0x1c5cd0,'onTestStart':(_0x2e49ed,_0xc0e43f,_0x1e4572)=>{const _0xc1bfcf=_0x4a8ffb;_0x57bd6c[_0xc1bfcf(0x1d6)]=_0xc1bfcf(0x1fd)+(_0xc0e43f+0x1)+'/'+_0x1e4572+':\x20'+_0x2e49ed+_0xc1bfcf(0x200);if(!_0x57bd6c[_0xc1bfcf(0x1e5)])_0x57bd6c[_0xc1bfcf(0x1da)]();},'onTestComplete':(_0x36e43d,_0x5d8bdf)=>{const _0x17e402=_0x4a8ffb;_0x57bd6c[_0x17e402(0x1f3)]();if(_0x5d8bdf[_0x17e402(0x1a9)]===_0x17e402(0x204))console[_0x17e402(0x1bd)](a5_0x76862c[_0x17e402(0x20d)](_0x17e402(0x1e3)+_0x36e43d)+a5_0x76862c[_0x17e402(0x210)](_0x17e402(0x221)));else _0x5d8bdf[_0x17e402(0x1a9)]==='FAIL'?console[_0x17e402(0x1bd)](a5_0x76862c[_0x17e402(0x22b)](_0x17e402(0x1e4)+_0x36e43d+_0x17e402(0x1a8)+_0x5d8bdf[_0x17e402(0x1b8)])+a5_0x76862c[_0x17e402(0x210)](_0x17e402(0x221))):console[_0x17e402(0x1bd)](a5_0x76862c['red'](_0x17e402(0x1cd)+_0x36e43d+_0x17e402(0x1a8)+_0x5d8bdf[_0x17e402(0x1b8)]));_0x5d8bdf[_0x17e402(0x238)]&&console[_0x17e402(0x1bd)](a5_0x76862c['dim']('\x20\x20Conversation:\x20'+_0x5d8bdf[_0x17e402(0x238)])),_0x231132[_0x17e402(0x228)](_0x5d8bdf);},'onTestSkipped':(_0x14f0b6,_0x8262d7)=>{const _0x3b1a9c=_0x4a8ffb;_0x57bd6c[_0x3b1a9c(0x1f3)](),console[_0x3b1a9c(0x1bd)](a5_0x76862c[_0x3b1a9c(0x1af)]('⚠\x20SKIPPED:\x20'+_0x14f0b6+_0x3b1a9c(0x1a8)+_0x8262d7));}});for(const _0x2ad9bc of _0x56e035){!_0x231132[_0x4a8ffb(0x212)](_0x55962a=>_0x55962a[_0x4a8ffb(0x1a7)]===_0x2ad9bc['name'])&&_0x231132[_0x4a8ffb(0x228)](_0x2ad9bc);}}catch(_0x23043a){_0x57bd6c[_0x4a8ffb(0x1f3)]();const _0x40ba66=_0x23043a instanceof Error?_0x23043a[_0x4a8ffb(0x205)]:String(_0x23043a);return console[_0x4a8ffb(0x1bd)](a5_0x76862c[_0x4a8ffb(0x22b)](_0x4a8ffb(0x1c0)+_0x40ba66)),0x1;}_0x57bd6c[_0x4a8ffb(0x1f3)]();if(_0x58e445[_0x4a8ffb(0x20c)]>0x0){console['log'](),console[_0x4a8ffb(0x1bd)](a5_0x76862c['cyan']('Executing\x20new\x20tests...'));const {projectId:_0x2fb763,agentId:_0x590b41}=_0x33f93d['agent'];for(const _0x509f65 of _0x58e445){console['log'](_0x4a8ffb(0x1d4)+a5_0x76862c[_0x4a8ffb(0x223)](_0x509f65[_0x4a8ffb(0x1a7)]));const _0x182936=createCommandSpinner(_0x4a8ffb(0x1d5)+_0x509f65[_0x4a8ffb(0x237)][_0x4a8ffb(0x20c)]+':\x20Sending\x20user\x20input...');_0x182936[_0x4a8ffb(0x1da)]();try{const {result:_0xbf9c36}=await runTest(_0x12d9f7['llm'],_0x509f65,{'agentId':_0x590b41,'projectId':_0x2fb763,'site':_0x33f93d[_0x4a8ffb(0x1d1)],'noEval':![],'evaluatorId':_0x1c5cd0,'onRoundStart':(_0x51af34,_0x441ee4)=>{const _0x152606=_0x4a8ffb;_0x182936['text']=_0x152606(0x229)+(_0x51af34+0x1)+'/'+_0x441ee4+_0x152606(0x1eb);},'onRoundComplete':(_0x12bdd2,_0x566fd2,_0x18cce6)=>{const _0x2d1d35=_0x4a8ffb,_0xa980ef=formatElapsed(_0x566fd2);_0x18cce6?console[_0x2d1d35(0x1bd)]('\x20\x20Round\x20'+(_0x12bdd2+0x1)+'/'+_0x509f65['rounds'][_0x2d1d35(0x20c)]+_0x2d1d35(0x1bc)+a5_0x76862c[_0x2d1d35(0x20d)]('✓')+'\x20('+_0xa980ef+')'):console[_0x2d1d35(0x1bd)](_0x2d1d35(0x211)+(_0x12bdd2+0x1)+'/'+_0x509f65[_0x2d1d35(0x237)][_0x2d1d35(0x20c)]+_0x2d1d35(0x1bc)+a5_0x76862c[_0x2d1d35(0x22b)]('✗'));},'onEvaluationStart':()=>{const _0x44a307=_0x4a8ffb;_0x182936[_0x44a307(0x1d6)]=_0x44a307(0x1cb);},'onEvaluationComplete':_0xb1a49c=>{const _0x30121b=_0x4a8ffb,_0x565cd9=formatElapsed(_0xb1a49c);console[_0x30121b(0x1bd)](_0x30121b(0x1c8)+a5_0x76862c[_0x30121b(0x20d)]('✓')+'\x20('+_0x565cd9+')');}});_0x182936[_0x4a8ffb(0x1f3)](),_0x231132[_0x4a8ffb(0x228)](_0xbf9c36);if(_0xbf9c36[_0x4a8ffb(0x1a9)]===_0x4a8ffb(0x204))console['log'](a5_0x76862c['green']('✓\x20PASS:\x20'+_0xbf9c36[_0x4a8ffb(0x1b8)])+a5_0x76862c[_0x4a8ffb(0x210)](_0x4a8ffb(0x1bb)));else _0xbf9c36[_0x4a8ffb(0x1a9)]==='FAIL'?console[_0x4a8ffb(0x1bd)](a5_0x76862c[_0x4a8ffb(0x22b)](_0x4a8ffb(0x1e4)+_0xbf9c36[_0x4a8ffb(0x1b8)])+a5_0x76862c[_0x4a8ffb(0x210)]('\x20(new)')):console[_0x4a8ffb(0x1bd)](a5_0x76862c['red'](_0x4a8ffb(0x1cd)+_0xbf9c36['reason']));_0xbf9c36['conversation_url']&&console[_0x4a8ffb(0x1bd)](a5_0x76862c[_0x4a8ffb(0x210)]('\x20\x20Conversation:\x20'+_0xbf9c36[_0x4a8ffb(0x238)]));}catch(_0x332467){_0x182936['stop']();const _0x5c9b4c=_0x332467 instanceof Error?_0x332467[_0x4a8ffb(0x205)]:String(_0x332467);console[_0x4a8ffb(0x1bd)](a5_0x76862c['red'](_0x4a8ffb(0x1cd)+_0x5c9b4c)),_0x231132[_0x4a8ffb(0x228)]({'name':_0x509f65[_0x4a8ffb(0x1a7)],'status':'ERROR','reason':_0x5c9b4c,'timestamp':new Date()[_0x4a8ffb(0x234)](),'duration_ms':0x0});}}}console[_0x4a8ffb(0x1bd)]();const _0x57b4fd=Date[_0x4a8ffb(0x236)]()-_0x3010f9,_0x27ac52=_0x231132[_0x4a8ffb(0x1a6)](_0x550f24=>_0x550f24[_0x4a8ffb(0x1a9)]==='PASS')[_0x4a8ffb(0x20c)],_0xf227a6=_0x231132[_0x4a8ffb(0x1a6)](_0xbffde8=>_0xbffde8[_0x4a8ffb(0x1a9)]===_0x4a8ffb(0x1f4))[_0x4a8ffb(0x20c)],_0x4cc7f2=_0x231132[_0x4a8ffb(0x1a6)](_0x29063b=>_0x29063b['status']===_0x4a8ffb(0x1db))[_0x4a8ffb(0x20c)];console[_0x4a8ffb(0x1bd)]('━'[_0x4a8ffb(0x22d)](0x3c)),console[_0x4a8ffb(0x1bd)]('Re-evaluation\x20Summary'),console[_0x4a8ffb(0x1bd)]('━'[_0x4a8ffb(0x22d)](0x3c)),console['log'](_0x4a8ffb(0x1ac)+_0x231132[_0x4a8ffb(0x20c)]),console[_0x4a8ffb(0x1bd)](_0x4a8ffb(0x1b0)+a5_0x76862c[_0x4a8ffb(0x20d)](_0x27ac52)),console[_0x4a8ffb(0x1bd)]('Failed:\x20\x20\x20'+a5_0x76862c[_0x4a8ffb(0x22b)](_0xf227a6));_0x4cc7f2>0x0&&console[_0x4a8ffb(0x1bd)]('Errors:\x20\x20\x20'+a5_0x76862c[_0x4a8ffb(0x22b)](_0x4cc7f2));console[_0x4a8ffb(0x1bd)](_0x4a8ffb(0x1f1)+formatElapsed(_0x57b4fd)),console[_0x4a8ffb(0x1bd)]('━'[_0x4a8ffb(0x22d)](0x3c));const _0xaad830={'summary':{'total':_0x231132[_0x4a8ffb(0x20c)],'passed':_0x27ac52,'failed':_0xf227a6,'errors':_0x4cc7f2>0x0?_0x4cc7f2:undefined,'duration_ms':_0x57b4fd},'tests':_0x231132,'agent':{'project':_0x13b82e['projectName'],'name':_0x13b82e[_0x4a8ffb(0x1f6)],'site':_0x54af9c},'timestamp':new Date(_0x3010f9)[_0x4a8ffb(0x234)]()};if(_0x177021!==_0x4a8ffb(0x21c)||_0x217937){const _0x33748d=formatResults(_0xaad830,_0x177021);if(_0x217937)try{a5_0x306e8a[_0x4a8ffb(0x1ba)](_0x217937,_0x33748d,'utf-8'),console[_0x4a8ffb(0x1bd)](),console[_0x4a8ffb(0x1bd)](a5_0x76862c[_0x4a8ffb(0x210)](_0x4a8ffb(0x1d9)+_0x217937));}catch(_0x5ad6ca){return console['log'](),console[_0x4a8ffb(0x1bd)](a5_0x76862c['red']('Error\x20writing\x20output\x20file:\x20'+_0x5ad6ca)),0x1;}else console[_0x4a8ffb(0x1bd)](),console[_0x4a8ffb(0x1bd)](_0x33748d);}const _0x52b42c=_0x231132[_0x4a8ffb(0x1a6)](_0x65e8d9=>_0x65e8d9[_0x4a8ffb(0x1a9)]!=='PASS');return _0x52b42c[_0x4a8ffb(0x20c)]>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0x5f4907=a5_0x5029;(function(_0x5ca72b,_0x159e84){const _0x50048f=a5_0x5029,_0x2835b0=_0x5ca72b();while(!![]){try{const _0x2a4789=-parseInt(_0x50048f(0x24a))/0x1+parseInt(_0x50048f(0x22e))/0x2+parseInt(_0x50048f(0x1d3))/0x3+-parseInt(_0x50048f(0x1d9))/0x4+-parseInt(_0x50048f(0x229))/0x5+-parseInt(_0x50048f(0x254))/0x6+parseInt(_0x50048f(0x1ea))/0x7*(parseInt(_0x50048f(0x1bd))/0x8);if(_0x2a4789===_0x159e84)break;else _0x2835b0['push'](_0x2835b0['shift']());}catch(_0x1720b4){_0x2835b0['push'](_0x2835b0['shift']());}}}(a5_0x50ad,0xe6778));import*as a5_0x445aa7 from'node:fs';function a5_0x5029(_0x5219a9,_0x494e4a){_0x5219a9=_0x5219a9-0x1bd;const _0x50ad1b=a5_0x50ad();let _0x502909=_0x50ad1b[_0x5219a9];return _0x502909;}import*as a5_0x2bbde6 from'node:path';import a5_0x31c1c7 from'chalk';import{BaseCommand}from'./command.js';function a5_0x50ad(){const _0x1b41aa=['test.yml','New\x20tests\x20to\x20execute:\x20','start','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','\x20\x20Conversation:\x20','name','\x22,\x20but\x20current\x20site\x20is\x20\x22','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x20(new)','tests','table','Round\x201/','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','Output\x20written\x20to:\x20','✗\x20ERROR:\x20','green','no_local_folder','no_tests','basename','⚠\x20SKIPPED:\x20','map','\x20\x20Project:\x20','yellow','utf-8','tags','\x20\x20Evaluating...\x20','263849pAIEhG','jsonl','substring','repeat','\x20\x20-\x20','has','cyan','No\x20tests\x20found\x20matching:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','2547324fXVkTZ','\x20(cached)','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','source','llmProject','22664WIzoeq','agent:test','Run\x20\x27tdx\x20agent\x20pull\x20','FAIL','status','existsSync','log','reason','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','round','conversation_url','Re-evaluating\x20','json','Executing\x20new\x20tests...','timestamp','length','push','Test\x20Summary','message','now','no_context','✓\x20PASS:\x20','3088299zbvaCy','multiple_agents','\x20\x20Agent:\x20','\x22:\x20','Duration:\x20','Available\x20tests:\x20','3860380ewYZuP','dim','Either\x20switch\x20to\x20the\x20\x22','execute','✗\x20ERROR:\x20Project\x20not\x20found:\x20','Failed:\x20\x20\x20','resolveAgentId','Using\x20agent:\x20','resolveProjectId','...','Re-evaluating...','toISOString','Agent:\x20','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','\x27\x20to\x20create\x20the\x20folder\x20structure.','agentName','/<agent-name>','3206rKuLkp','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','trim','\x20-\x20','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Errors:\x20\x20\x20','...\x20','llm','✗\x20FAIL:\x20','executeReeval','toLowerCase','Usage:','Project\x20path:\x20','Evaluating\x20response...','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','split','text','includes','site','isSpinning','Passed:\x20\x20\x20','Conversation\x20URL:\x20','stop','projectDir','writeFileSync','404','projectName','reeval','agentDirs','Re-evaluating\x20cached\x20test\x20run...','description','Round\x20','No\x20tests\x20found\x20with\x20tags:\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','red','Test\x20','some','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','white','Error:\x20No\x20previous\x20test\x20run\x20found.','PASS','testYmlPath','Error\x20writing\x20output\x20file:\x20','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','\x20\x20Round\x20','resolve','Tests\x20found:\x20','\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)','ERROR','No\x20tests\x20have\x20tags\x20defined.','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','filter','dryRun','Total:\x20\x20\x20\x20','join','Run\x20tests\x20for\x20an\x20LLM\x20agent','find','Failed\x20Tests:','Cached\x20run\x20is\x20from\x20site\x20\x22',':\x20Sending\x20user\x20input...','rounds','agent','conversations','4388075uIzZXe','context','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','Running\x20test:\x20','verbose','2296316SOINWq','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'];a5_0x50ad=function(){return _0x1b41aa;};return a5_0x50ad();}import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x5f4907(0x235)]=a5_0x5f4907(0x1be);[a5_0x5f4907(0x208)]=a5_0x5f4907(0x221);async[a5_0x5f4907(0x1dc)](_0x464b2a){const _0x5b7e07=a5_0x5f4907,{options:_0x29cb1a,args:_0x3cc2bb,tdx:_0x41c063}=_0x464b2a,_0x386fb0=_0x3cc2bb[0x0]||'.',_0x56b48a=_0x29cb1a[_0x5b7e07(0x21e)],_0x1e0990=_0x29cb1a,_0x25203a=_0x1e0990['eval']===![],_0xec66ae=_0x1e0990[_0x5b7e07(0x205)],_0x25406b=_0x1e0990[_0x5b7e07(0x235)],_0x6f992c=_0x1e0990['tags'],_0x2fb334=_0x29cb1a[_0x5b7e07(0x1fc)],_0x3c1527=_0x1e0990['output'];if(_0xec66ae&&_0x25203a)return console[_0x5b7e07(0x1c3)](a5_0x31c1c7[_0x5b7e07(0x20c)](_0x5b7e07(0x1f8))),0x1;let _0x2407b2=_0x5b7e07(0x23a);if(_0x1e0990[_0x5b7e07(0x1c9)])_0x2407b2='json';else{if(_0x1e0990['jsonl'])_0x2407b2=_0x5b7e07(0x24b);else{if(_0x1e0990['tsv'])_0x2407b2='tsv';else{if(_0x1e0990['table'])_0x2407b2=_0x5b7e07(0x23a);}}}const _0x1a953f=_0x1e0990[_0x5b7e07(0x258)];let _0xc30319=_0x386fb0;const _0x558beb=a5_0x445aa7[_0x5b7e07(0x1c2)](_0x386fb0),_0x5ab435=_0x386fb0==='.';if(!_0x558beb||_0x5ab435){const _0x4e0e74=resolveProjectFromContext(_0x386fb0,_0x1a953f,{'requireFile':_0x5b7e07(0x230)});if(_0x4e0e74['found'])_0xc30319=_0x4e0e74[_0x5b7e07(0x201)],_0x4e0e74[_0x5b7e07(0x257)]===_0x5b7e07(0x22a)&&console[_0x5b7e07(0x1c3)](a5_0x31c1c7[_0x5b7e07(0x1da)](_0x5b7e07(0x1e0)+_0xc30319));else switch(_0x4e0e74['reason']){case _0x5b7e07(0x1d1):console[_0x5b7e07(0x1c3)](a5_0x31c1c7[_0x5b7e07(0x246)](_0x4e0e74['message'])),console[_0x5b7e07(0x1c3)](),console[_0x5b7e07(0x1c3)](_0x5b7e07(0x1f5)),console['log'](_0x5b7e07(0x20b)),console[_0x5b7e07(0x1c3)](_0x5b7e07(0x219)),console[_0x5b7e07(0x1c3)](),console[_0x5b7e07(0x1c3)](_0x5b7e07(0x237));return 0x1;case _0x5b7e07(0x240):console[_0x5b7e07(0x1c3)](a5_0x31c1c7[_0x5b7e07(0x246)](_0x4e0e74[_0x5b7e07(0x1cf)])),console[_0x5b7e07(0x1c3)](),console['log'](_0x5b7e07(0x1bf)+_0x4e0e74['llmProject']+_0x5b7e07(0x1e7));return 0x1;case _0x5b7e07(0x1d4):{const _0x265fb5=a5_0x2bbde6[_0x5b7e07(0x242)](_0x4e0e74[_0x5b7e07(0x201)]);console[_0x5b7e07(0x1c3)](a5_0x31c1c7[_0x5b7e07(0x246)](_0x5b7e07(0x256)+_0x4e0e74[_0x5b7e07(0x258)]+'\x22:'));for(const _0x48c9c5 of _0x4e0e74[_0x5b7e07(0x206)]){console[_0x5b7e07(0x1c3)](_0x5b7e07(0x24e)+_0x48c9c5);}return console['log'](),console[_0x5b7e07(0x1c3)](_0x5b7e07(0x233)+_0x265fb5+_0x5b7e07(0x1e9)),0x1;}case _0x5b7e07(0x241):console[_0x5b7e07(0x1c3)](a5_0x31c1c7[_0x5b7e07(0x246)](_0x5b7e07(0x1eb)+_0x4e0e74[_0x5b7e07(0x258)]+'\x22.')),console['log'](a5_0x31c1c7['dim'](_0x5b7e07(0x1f6)+_0x4e0e74[_0x5b7e07(0x201)])),console[_0x5b7e07(0x1c3)](),console['log'](_0x5b7e07(0x1c5));return 0x1;}}const {definition:_0x5ef8f8,agentInfo:_0x5ca859}=parseTestFile(_0xc30319);let _0xfada1e=_0x5ef8f8[_0x5b7e07(0x239)];if(_0x25406b){const _0xba2b84=_0x25406b['split'](',')[_0x5b7e07(0x244)](_0x5bbfed=>_0x5bbfed[_0x5b7e07(0x1ec)]());_0xfada1e=_0x5ef8f8[_0x5b7e07(0x239)][_0x5b7e07(0x21d)](_0xf2b4e9=>_0xba2b84['includes'](_0xf2b4e9[_0x5b7e07(0x235)]));if(_0xfada1e[_0x5b7e07(0x1cc)]===0x0)return console['log'](a5_0x31c1c7[_0x5b7e07(0x246)](_0x5b7e07(0x251)+_0x25406b)),console['log'](a5_0x31c1c7[_0x5b7e07(0x1da)](_0x5b7e07(0x1d8)+_0x5ef8f8[_0x5b7e07(0x239)][_0x5b7e07(0x244)](_0x175faf=>_0x175faf['name'])[_0x5b7e07(0x220)](',\x20'))),0x1;}if(_0x6f992c){const _0x4dcae7=_0x6f992c[_0x5b7e07(0x1f9)](',')['map'](_0x4927ff=>_0x4927ff['trim']()[_0x5b7e07(0x1f4)]());_0xfada1e=_0xfada1e[_0x5b7e07(0x21d)](_0x127ca9=>_0x127ca9[_0x5b7e07(0x248)]?.[_0x5b7e07(0x20e)](_0x39e299=>_0x4dcae7[_0x5b7e07(0x1fb)](_0x39e299[_0x5b7e07(0x1f4)]())));if(_0xfada1e[_0x5b7e07(0x1cc)]===0x0){console[_0x5b7e07(0x1c3)](a5_0x31c1c7['yellow'](_0x5b7e07(0x20a)+_0x6f992c));const _0x4402e1=new Set();return _0x5ef8f8[_0x5b7e07(0x239)]['forEach'](_0x43da07=>_0x43da07[_0x5b7e07(0x248)]?.['forEach'](_0x24d222=>_0x4402e1['add'](_0x24d222))),_0x4402e1['size']>0x0?console[_0x5b7e07(0x1c3)](a5_0x31c1c7[_0x5b7e07(0x1da)]('Available\x20tags:\x20'+[..._0x4402e1][_0x5b7e07(0x220)](',\x20'))):console[_0x5b7e07(0x1c3)](a5_0x31c1c7[_0x5b7e07(0x1da)](_0x5b7e07(0x21b))),0x1;}}if(_0xec66ae)return this['executeReeval'](_0x464b2a,{'definition':{'tests':_0xfada1e},'agentInfo':_0x5ca859,'outputFormat':_0x2407b2,'outputFile':_0x3c1527,'testNames':_0x25406b});if(_0x56b48a){console[_0x5b7e07(0x1c3)](a5_0x31c1c7[_0x5b7e07(0x250)]('Test\x20Configuration:')),console['log']('\x20\x20Site:\x20'+a5_0x31c1c7['white'](_0x2fb334)),console[_0x5b7e07(0x1c3)](_0x5b7e07(0x245)+a5_0x31c1c7[_0x5b7e07(0x210)](_0x5ca859[_0x5b7e07(0x204)])),console[_0x5b7e07(0x1c3)](_0x5b7e07(0x1d5)+a5_0x31c1c7['white'](_0x5ca859[_0x5b7e07(0x1e8)])),console['log'](),console['log'](_0x5b7e07(0x218)+a5_0x31c1c7[_0x5b7e07(0x210)](_0xfada1e[_0x5b7e07(0x1cc)]));for(let _0x389949=0x0;_0x389949<_0xfada1e['length'];_0x389949++){const _0x4c3916=_0xfada1e[_0x389949],_0x41b944=_0x4c3916[_0x5b7e07(0x226)]['length']===0x1?_0x5b7e07(0x1c6):_0x5b7e07(0x226),_0x26b38c=_0x4c3916['tags']?.['length']?'\x20['+_0x4c3916[_0x5b7e07(0x248)]['join'](',\x20')+']':'';console[_0x5b7e07(0x1c3)]('\x20\x20'+(_0x389949+0x1)+'.\x20'+a5_0x31c1c7[_0x5b7e07(0x210)](_0x4c3916[_0x5b7e07(0x235)])+'\x20('+_0x4c3916[_0x5b7e07(0x226)][_0x5b7e07(0x1cc)]+'\x20'+_0x41b944+')'+a5_0x31c1c7['dim'](_0x26b38c));}return 0x0;}let _0x26144d,_0x2d48ab;try{_0x26144d=await _0x41c063[_0x5b7e07(0x1f1)][_0x5b7e07(0x1e1)](_0x5ca859['projectName']);}catch(_0xffc007){const _0x21a2ab=_0xffc007 instanceof Error?_0xffc007[_0x5b7e07(0x1cf)]:String(_0xffc007);return _0x21a2ab[_0x5b7e07(0x1fb)](_0x5b7e07(0x203))||_0x21a2ab[_0x5b7e07(0x1f4)]()[_0x5b7e07(0x1fb)]('not\x20found')?console[_0x5b7e07(0x1c3)](a5_0x31c1c7[_0x5b7e07(0x20c)](_0x5b7e07(0x1dd)+_0x5ca859['projectName'])):console[_0x5b7e07(0x1c3)](a5_0x31c1c7[_0x5b7e07(0x20c)](_0x5b7e07(0x23c)+_0x5ca859['projectName']+_0x5b7e07(0x1d6)+_0x21a2ab)),0x1;}try{_0x2d48ab=await _0x41c063[_0x5b7e07(0x1f1)][_0x5b7e07(0x1df)](_0x5ca859[_0x5b7e07(0x1e8)],_0x26144d);}catch(_0x11c903){const _0x3cec41=_0x11c903 instanceof Error?_0x11c903[_0x5b7e07(0x1cf)]:String(_0x11c903);return _0x3cec41[_0x5b7e07(0x1fb)]('404')||_0x3cec41['toLowerCase']()['includes']('not\x20found')?console[_0x5b7e07(0x1c3)](a5_0x31c1c7[_0x5b7e07(0x20c)](_0x5b7e07(0x20f)+_0x5ca859['agentName'])):console[_0x5b7e07(0x1c3)](a5_0x31c1c7[_0x5b7e07(0x20c)](_0x5b7e07(0x252)+_0x5ca859[_0x5b7e07(0x1e8)]+'\x22:\x20'+_0x3cec41)),0x1;}let _0x3ba560;if(!_0x25203a)try{_0x3ba560=await setupEvaluatorAgent(_0x41c063[_0x5b7e07(0x1f1)],_0x29cb1a[_0x5b7e07(0x22d)]);}catch(_0xc94dc3){const _0x2f5531=_0xc94dc3 instanceof Error?_0xc94dc3[_0x5b7e07(0x1cf)]:String(_0xc94dc3);return console[_0x5b7e07(0x1c3)](a5_0x31c1c7[_0x5b7e07(0x20c)](_0x5b7e07(0x22f)+_0x2f5531)),0x1;}console['log'](a5_0x31c1c7[_0x5b7e07(0x250)]('Running\x20agent\x20tests...')),console[_0x5b7e07(0x1c3)]('Site:\x20'+a5_0x31c1c7[_0x5b7e07(0x210)](_0x2fb334)),console[_0x5b7e07(0x1c3)](_0x5b7e07(0x1e5)+a5_0x31c1c7[_0x5b7e07(0x210)](_0x5ca859[_0x5b7e07(0x204)]+'/'+_0x5ca859[_0x5b7e07(0x1e8)])),console[_0x5b7e07(0x1c3)]();const _0x354473=[],_0x2b6efe=[],_0x4737a9=Date[_0x5b7e07(0x1d0)]();for(let _0x2d99f4=0x0;_0x2d99f4<_0xfada1e['length'];_0x2d99f4++){const _0x3246ef=_0xfada1e[_0x2d99f4];_0xfada1e[_0x5b7e07(0x1cc)]>0x1?console[_0x5b7e07(0x1c3)](_0x5b7e07(0x20d)+(_0x2d99f4+0x1)+'/'+_0xfada1e['length']+':\x20'+a5_0x31c1c7[_0x5b7e07(0x210)](_0x3246ef[_0x5b7e07(0x235)])):console[_0x5b7e07(0x1c3)](_0x5b7e07(0x22c)+a5_0x31c1c7[_0x5b7e07(0x210)](_0x3246ef['name']));const _0x440a84=createCommandSpinner(_0x5b7e07(0x23b)+_0x3246ef[_0x5b7e07(0x226)][_0x5b7e07(0x1cc)]+':\x20Sending\x20user\x20input...');_0x440a84[_0x5b7e07(0x232)]();try{const {result:_0x299f3b,conversation:_0x37192a}=await runTest(_0x41c063[_0x5b7e07(0x1f1)],_0x3246ef,{'agentId':_0x2d48ab,'projectId':_0x26144d,'site':_0x2fb334,'noEval':_0x25203a,'evaluatorId':_0x3ba560,'onRoundStart':(_0x56f0f3,_0xcf687f)=>{const _0x224bde=_0x5b7e07;_0x440a84[_0x224bde(0x1fa)]=_0x224bde(0x209)+(_0x56f0f3+0x1)+'/'+_0xcf687f+_0x224bde(0x225);},'onRoundComplete':(_0xe1435d,_0xedd327,_0x59fdb0)=>{const _0x1340b4=_0x5b7e07,_0x1397dc=formatElapsed(_0xedd327);_0x59fdb0?console['log'](_0x1340b4(0x216)+(_0xe1435d+0x1)+'/'+_0x3246ef['rounds'][_0x1340b4(0x1cc)]+_0x1340b4(0x1f0)+a5_0x31c1c7[_0x1340b4(0x23f)]('✓')+'\x20('+_0x1397dc+')'):console[_0x1340b4(0x1c3)](_0x1340b4(0x216)+(_0xe1435d+0x1)+'/'+_0x3246ef[_0x1340b4(0x226)][_0x1340b4(0x1cc)]+_0x1340b4(0x1f0)+a5_0x31c1c7[_0x1340b4(0x20c)]('✗'));},'onEvaluationStart':()=>{const _0x45133c=_0x5b7e07;_0x440a84['text']=_0x45133c(0x1f7);},'onEvaluationComplete':_0x57c1f8=>{const _0x3d94b5=_0x5b7e07,_0x4f6a2a=formatElapsed(_0x57c1f8);console[_0x3d94b5(0x1c3)](_0x3d94b5(0x249)+a5_0x31c1c7[_0x3d94b5(0x23f)]('✓')+'\x20('+_0x4f6a2a+')');}});_0x440a84['stop'](),_0x354473[_0x5b7e07(0x1cd)](_0x299f3b),_0x2b6efe[_0x5b7e07(0x1cd)](_0x37192a);if(_0x299f3b[_0x5b7e07(0x1c1)]===_0x5b7e07(0x212))console['log'](a5_0x31c1c7['green'](_0x5b7e07(0x1d2)+_0x299f3b[_0x5b7e07(0x1c4)]));else _0x299f3b[_0x5b7e07(0x1c1)]===_0x5b7e07(0x1c0)?console[_0x5b7e07(0x1c3)](a5_0x31c1c7['red'](_0x5b7e07(0x1f2)+_0x299f3b[_0x5b7e07(0x1c4)])):console['log'](a5_0x31c1c7[_0x5b7e07(0x20c)]('✗\x20ERROR:\x20'+_0x299f3b[_0x5b7e07(0x1c4)]));_0x299f3b[_0x5b7e07(0x1c7)]&&console[_0x5b7e07(0x1c3)](a5_0x31c1c7[_0x5b7e07(0x1da)](_0x5b7e07(0x1ff)+_0x299f3b['conversation_url'])),console[_0x5b7e07(0x1c3)]();}catch(_0x5a6c3c){_0x440a84['stop']();const _0x42846f=_0x5a6c3c instanceof Error?_0x5a6c3c[_0x5b7e07(0x1cf)]:String(_0x5a6c3c);console[_0x5b7e07(0x1c3)](a5_0x31c1c7[_0x5b7e07(0x20c)](_0x5b7e07(0x23e)+_0x42846f)),console['log'](),_0x354473[_0x5b7e07(0x1cd)]({'name':_0x3246ef['name'],'status':_0x5b7e07(0x21a),'reason':_0x42846f,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0xbc9cda=Date[_0x5b7e07(0x1d0)]()-_0x4737a9,_0x470919=_0x354473[_0x5b7e07(0x21d)](_0x23335f=>_0x23335f['status']==='PASS')[_0x5b7e07(0x1cc)],_0x185493=_0x354473[_0x5b7e07(0x21d)](_0x1b7a0e=>_0x1b7a0e[_0x5b7e07(0x1c1)]===_0x5b7e07(0x1c0))[_0x5b7e07(0x1cc)],_0x2b89c1=_0x354473['filter'](_0xa5014c=>_0xa5014c[_0x5b7e07(0x1c1)]===_0x5b7e07(0x21a))[_0x5b7e07(0x1cc)];console[_0x5b7e07(0x1c3)]('━'[_0x5b7e07(0x24d)](0x3c)),console[_0x5b7e07(0x1c3)](_0x5b7e07(0x1ce)),console[_0x5b7e07(0x1c3)]('━'[_0x5b7e07(0x24d)](0x3c)),console['log'](_0x5b7e07(0x21f)+_0x354473[_0x5b7e07(0x1cc)]),console[_0x5b7e07(0x1c3)](_0x5b7e07(0x1fe)+a5_0x31c1c7[_0x5b7e07(0x23f)](_0x470919)),console[_0x5b7e07(0x1c3)](_0x5b7e07(0x1de)+a5_0x31c1c7[_0x5b7e07(0x20c)](_0x185493));_0x2b89c1>0x0&&console[_0x5b7e07(0x1c3)](_0x5b7e07(0x1ef)+a5_0x31c1c7[_0x5b7e07(0x20c)](_0x2b89c1));console[_0x5b7e07(0x1c3)](_0x5b7e07(0x1d7)+formatElapsed(_0xbc9cda)),console[_0x5b7e07(0x1c3)]('━'[_0x5b7e07(0x24d)](0x3c));const _0x23f2a0=_0x354473['filter'](_0x5611d0=>_0x5611d0[_0x5b7e07(0x1c1)]!==_0x5b7e07(0x212));if(_0x23f2a0[_0x5b7e07(0x1cc)]>0x0){console['log'](),console[_0x5b7e07(0x1c3)](_0x5b7e07(0x223));for(const _0x33262a of _0x23f2a0){const _0x57787b=a5_0x31c1c7[_0x5b7e07(0x20c)]('✗'),_0x5a8928=_0x33262a[_0x5b7e07(0x1c4)][_0x5b7e07(0x1cc)]>0x32?_0x33262a['reason'][_0x5b7e07(0x24c)](0x0,0x32)+'...':_0x33262a[_0x5b7e07(0x1c4)];console[_0x5b7e07(0x1c3)]('\x20\x20'+_0x57787b+'\x20'+_0x33262a[_0x5b7e07(0x235)]+':\x20'+_0x5a8928);}}const _0x549be0={'summary':{'total':_0x354473[_0x5b7e07(0x1cc)],'passed':_0x470919,'failed':_0x185493,'errors':_0x2b89c1>0x0?_0x2b89c1:undefined,'duration_ms':_0xbc9cda},'tests':_0x354473,'agent':{'project':_0x5ca859[_0x5b7e07(0x204)],'name':_0x5ca859[_0x5b7e07(0x1e8)],'site':_0x2fb334},'timestamp':new Date(_0x4737a9)['toISOString']()};try{const _0x40d211=buildCachedTestRun(_0x2b6efe,{'site':_0x2fb334,'projectId':_0x26144d,'projectName':_0x5ca859[_0x5b7e07(0x204)],'agentId':_0x2d48ab,'agentName':_0x5ca859['agentName'],'testYmlPath':a5_0x2bbde6[_0x5b7e07(0x217)](_0x5ca859[_0x5b7e07(0x213)])});saveLastTestRun(_0x40d211);}catch{}if(_0x2407b2!==_0x5b7e07(0x23a)||_0x3c1527){const _0x20d30e=formatResults(_0x549be0,_0x2407b2);if(_0x3c1527)try{a5_0x445aa7[_0x5b7e07(0x202)](_0x3c1527,_0x20d30e,_0x5b7e07(0x247)),console['log'](),console[_0x5b7e07(0x1c3)](a5_0x31c1c7['dim'](_0x5b7e07(0x23d)+_0x3c1527));}catch(_0xa307e7){return console[_0x5b7e07(0x1c3)](),console[_0x5b7e07(0x1c3)](a5_0x31c1c7[_0x5b7e07(0x20c)](_0x5b7e07(0x214)+_0xa307e7)),0x1;}else console[_0x5b7e07(0x1c3)](),console[_0x5b7e07(0x1c3)](_0x20d30e);}return _0x23f2a0[_0x5b7e07(0x1cc)]>0x0?0x1:0x0;}async[a5_0x5f4907(0x1f3)](_0x1599f0,_0x8250a){const _0x3e9f74=a5_0x5f4907,{options:_0xb3c613,tdx:_0xf7b838}=_0x1599f0,{definition:_0x23419f,agentInfo:_0x443905,outputFormat:_0x12516f,outputFile:_0x5ed043}=_0x8250a,_0x2d5cc6=_0xb3c613['site'],_0x29a450=loadLastTestRun();if(!_0x29a450)return console[_0x3e9f74(0x1c3)](a5_0x31c1c7[_0x3e9f74(0x20c)](_0x3e9f74(0x211))),console['log'](a5_0x31c1c7['dim'](_0x3e9f74(0x253))),0x1;if(_0x29a450[_0x3e9f74(0x227)][_0x3e9f74(0x1e8)]!==_0x443905[_0x3e9f74(0x1e8)])return console[_0x3e9f74(0x1c3)](a5_0x31c1c7[_0x3e9f74(0x20c)](_0x3e9f74(0x215)+_0x29a450['agent']['agentName']+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x443905[_0x3e9f74(0x1e8)]+'\x22.')),console[_0x3e9f74(0x1c3)](a5_0x31c1c7[_0x3e9f74(0x1da)](_0x3e9f74(0x21c))),0x1;const _0x562f9b=new Set(_0x29a450[_0x3e9f74(0x228)]['map'](_0x1f5a04=>_0x1f5a04['testName'])),_0x40ca8d=_0x23419f[_0x3e9f74(0x239)]['filter'](_0x25fcd1=>!_0x562f9b[_0x3e9f74(0x24f)](_0x25fcd1[_0x3e9f74(0x235)]));if(_0x40ca8d['length']>0x0&&_0x29a450['site']!==_0x2d5cc6)return console['log'](a5_0x31c1c7[_0x3e9f74(0x20c)](_0x3e9f74(0x22b))),console['log'](a5_0x31c1c7[_0x3e9f74(0x1da)](_0x3e9f74(0x224)+_0x29a450['site']+_0x3e9f74(0x236)+_0x2d5cc6+'\x22.')),console['log'](a5_0x31c1c7[_0x3e9f74(0x1da)](_0x3e9f74(0x1db)+_0x29a450[_0x3e9f74(0x1fc)]+_0x3e9f74(0x1e6))),0x1;const _0x33e3c1=_0x23419f[_0x3e9f74(0x239)][_0x3e9f74(0x21d)](_0x429119=>_0x562f9b[_0x3e9f74(0x24f)](_0x429119[_0x3e9f74(0x235)])),_0x4350b8=_0x40ca8d;let _0x5670e3;try{_0x5670e3=await setupEvaluatorAgent(_0xf7b838[_0x3e9f74(0x1f1)],_0xb3c613['verbose']);}catch(_0x11f756){const _0x2b1d99=_0x11f756 instanceof Error?_0x11f756['message']:String(_0x11f756);return console[_0x3e9f74(0x1c3)](a5_0x31c1c7[_0x3e9f74(0x20c)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x2b1d99)),0x1;}console[_0x3e9f74(0x1c3)](a5_0x31c1c7[_0x3e9f74(0x250)](_0x3e9f74(0x207))),console[_0x3e9f74(0x1c3)]('Cached\x20run\x20from:\x20'+a5_0x31c1c7[_0x3e9f74(0x210)](_0x29a450[_0x3e9f74(0x1cb)])),console[_0x3e9f74(0x1c3)](_0x3e9f74(0x1e5)+a5_0x31c1c7['white'](_0x29a450['agent'][_0x3e9f74(0x204)]+'/'+_0x29a450[_0x3e9f74(0x227)][_0x3e9f74(0x1e8)]));_0x4350b8[_0x3e9f74(0x1cc)]>0x0&&console[_0x3e9f74(0x1c3)](_0x3e9f74(0x231)+a5_0x31c1c7[_0x3e9f74(0x246)](_0x4350b8[_0x3e9f74(0x1cc)]));console[_0x3e9f74(0x1c3)]();const _0x255e0a=[],_0x574873=Date[_0x3e9f74(0x1d0)](),_0x196617=createCommandSpinner(_0x3e9f74(0x1e3));if(_0x33e3c1[_0x3e9f74(0x1cc)]>0x0)try{const _0x2a1e69=await reevaluateFromCache(_0xf7b838['llm'],_0x29a450,{'tests':_0x33e3c1},{'evaluatorId':_0x5670e3,'onTestStart':(_0x554892,_0x285eb5,_0x52c20c)=>{const _0xd649b8=_0x3e9f74;_0x196617['text']=_0xd649b8(0x1c8)+(_0x285eb5+0x1)+'/'+_0x52c20c+':\x20'+_0x554892+_0xd649b8(0x1e2);if(!_0x196617[_0xd649b8(0x1fd)])_0x196617['start']();},'onTestComplete':(_0x53641d,_0x332057)=>{const _0x85b8ed=_0x3e9f74;_0x196617['stop']();if(_0x332057[_0x85b8ed(0x1c1)]===_0x85b8ed(0x212))console['log'](a5_0x31c1c7[_0x85b8ed(0x23f)](_0x85b8ed(0x1d2)+_0x53641d)+a5_0x31c1c7[_0x85b8ed(0x1da)](_0x85b8ed(0x255)));else _0x332057['status']===_0x85b8ed(0x1c0)?console['log'](a5_0x31c1c7['red'](_0x85b8ed(0x1f2)+_0x53641d+_0x85b8ed(0x1ed)+_0x332057[_0x85b8ed(0x1c4)])+a5_0x31c1c7[_0x85b8ed(0x1da)](_0x85b8ed(0x255))):console[_0x85b8ed(0x1c3)](a5_0x31c1c7[_0x85b8ed(0x20c)](_0x85b8ed(0x23e)+_0x53641d+_0x85b8ed(0x1ed)+_0x332057[_0x85b8ed(0x1c4)]));_0x332057['conversation_url']&&console[_0x85b8ed(0x1c3)](a5_0x31c1c7[_0x85b8ed(0x1da)](_0x85b8ed(0x234)+_0x332057[_0x85b8ed(0x1c7)])),_0x255e0a['push'](_0x332057);},'onTestSkipped':(_0x3aaf5f,_0x55f054)=>{const _0x271e80=_0x3e9f74;_0x196617['stop'](),console[_0x271e80(0x1c3)](a5_0x31c1c7[_0x271e80(0x246)](_0x271e80(0x243)+_0x3aaf5f+_0x271e80(0x1ed)+_0x55f054));}});for(const _0x54b32e of _0x2a1e69){!_0x255e0a[_0x3e9f74(0x222)](_0x40a507=>_0x40a507[_0x3e9f74(0x235)]===_0x54b32e[_0x3e9f74(0x235)])&&_0x255e0a[_0x3e9f74(0x1cd)](_0x54b32e);}}catch(_0x4a7475){_0x196617[_0x3e9f74(0x200)]();const _0x2b7b18=_0x4a7475 instanceof Error?_0x4a7475[_0x3e9f74(0x1cf)]:String(_0x4a7475);return console[_0x3e9f74(0x1c3)](a5_0x31c1c7[_0x3e9f74(0x20c)](_0x3e9f74(0x1ee)+_0x2b7b18)),0x1;}_0x196617[_0x3e9f74(0x200)]();if(_0x4350b8[_0x3e9f74(0x1cc)]>0x0){console[_0x3e9f74(0x1c3)](),console[_0x3e9f74(0x1c3)](a5_0x31c1c7[_0x3e9f74(0x250)](_0x3e9f74(0x1ca)));const {projectId:_0x2d02ac,agentId:_0x33a7ef}=_0x29a450[_0x3e9f74(0x227)];for(const _0x4b98fc of _0x4350b8){console[_0x3e9f74(0x1c3)]('Running:\x20'+a5_0x31c1c7['white'](_0x4b98fc[_0x3e9f74(0x235)]));const _0x4d9228=createCommandSpinner(_0x3e9f74(0x23b)+_0x4b98fc[_0x3e9f74(0x226)][_0x3e9f74(0x1cc)]+_0x3e9f74(0x225));_0x4d9228[_0x3e9f74(0x232)]();try{const {result:_0x4344e0}=await runTest(_0xf7b838[_0x3e9f74(0x1f1)],_0x4b98fc,{'agentId':_0x33a7ef,'projectId':_0x2d02ac,'site':_0x29a450[_0x3e9f74(0x1fc)],'noEval':![],'evaluatorId':_0x5670e3,'onRoundStart':(_0x3344e8,_0x3a0a05)=>{const _0x9475a8=_0x3e9f74;_0x4d9228[_0x9475a8(0x1fa)]=_0x9475a8(0x209)+(_0x3344e8+0x1)+'/'+_0x3a0a05+_0x9475a8(0x225);},'onRoundComplete':(_0x6f959e,_0x4a954a,_0x4bc99b)=>{const _0xb01664=_0x3e9f74,_0x19090e=formatElapsed(_0x4a954a);_0x4bc99b?console['log'](_0xb01664(0x216)+(_0x6f959e+0x1)+'/'+_0x4b98fc[_0xb01664(0x226)][_0xb01664(0x1cc)]+_0xb01664(0x1f0)+a5_0x31c1c7[_0xb01664(0x23f)]('✓')+'\x20('+_0x19090e+')'):console[_0xb01664(0x1c3)](_0xb01664(0x216)+(_0x6f959e+0x1)+'/'+_0x4b98fc['rounds']['length']+'...\x20'+a5_0x31c1c7[_0xb01664(0x20c)]('✗'));},'onEvaluationStart':()=>{const _0x657138=_0x3e9f74;_0x4d9228[_0x657138(0x1fa)]=_0x657138(0x1f7);},'onEvaluationComplete':_0xf96fe5=>{const _0x18ae4e=_0x3e9f74,_0x3bbc78=formatElapsed(_0xf96fe5);console['log']('\x20\x20Evaluating...\x20'+a5_0x31c1c7[_0x18ae4e(0x23f)]('✓')+'\x20('+_0x3bbc78+')');}});_0x4d9228['stop'](),_0x255e0a[_0x3e9f74(0x1cd)](_0x4344e0);if(_0x4344e0[_0x3e9f74(0x1c1)]===_0x3e9f74(0x212))console['log'](a5_0x31c1c7[_0x3e9f74(0x23f)]('✓\x20PASS:\x20'+_0x4344e0[_0x3e9f74(0x1c4)])+a5_0x31c1c7[_0x3e9f74(0x1da)](_0x3e9f74(0x238)));else _0x4344e0[_0x3e9f74(0x1c1)]===_0x3e9f74(0x1c0)?console[_0x3e9f74(0x1c3)](a5_0x31c1c7[_0x3e9f74(0x20c)](_0x3e9f74(0x1f2)+_0x4344e0['reason'])+a5_0x31c1c7[_0x3e9f74(0x1da)](_0x3e9f74(0x238))):console[_0x3e9f74(0x1c3)](a5_0x31c1c7[_0x3e9f74(0x20c)](_0x3e9f74(0x23e)+_0x4344e0['reason']));_0x4344e0[_0x3e9f74(0x1c7)]&&console['log'](a5_0x31c1c7['dim'](_0x3e9f74(0x234)+_0x4344e0[_0x3e9f74(0x1c7)]));}catch(_0x3d8e7e){_0x4d9228[_0x3e9f74(0x200)]();const _0x49e887=_0x3d8e7e instanceof Error?_0x3d8e7e[_0x3e9f74(0x1cf)]:String(_0x3d8e7e);console[_0x3e9f74(0x1c3)](a5_0x31c1c7[_0x3e9f74(0x20c)]('✗\x20ERROR:\x20'+_0x49e887)),_0x255e0a['push']({'name':_0x4b98fc[_0x3e9f74(0x235)],'status':_0x3e9f74(0x21a),'reason':_0x49e887,'timestamp':new Date()[_0x3e9f74(0x1e4)](),'duration_ms':0x0});}}}console['log']();const _0x22dd81=Date[_0x3e9f74(0x1d0)]()-_0x574873,_0x487d32=_0x255e0a[_0x3e9f74(0x21d)](_0x145b31=>_0x145b31['status']==='PASS')[_0x3e9f74(0x1cc)],_0x4dd5ea=_0x255e0a['filter'](_0x2b5a9a=>_0x2b5a9a[_0x3e9f74(0x1c1)]===_0x3e9f74(0x1c0))[_0x3e9f74(0x1cc)],_0x7cfc47=_0x255e0a[_0x3e9f74(0x21d)](_0x341059=>_0x341059[_0x3e9f74(0x1c1)]===_0x3e9f74(0x21a))['length'];console[_0x3e9f74(0x1c3)]('━'[_0x3e9f74(0x24d)](0x3c)),console[_0x3e9f74(0x1c3)]('Re-evaluation\x20Summary'),console[_0x3e9f74(0x1c3)]('━'[_0x3e9f74(0x24d)](0x3c)),console[_0x3e9f74(0x1c3)]('Total:\x20\x20\x20\x20'+_0x255e0a[_0x3e9f74(0x1cc)]),console['log']('Passed:\x20\x20\x20'+a5_0x31c1c7[_0x3e9f74(0x23f)](_0x487d32)),console[_0x3e9f74(0x1c3)](_0x3e9f74(0x1de)+a5_0x31c1c7[_0x3e9f74(0x20c)](_0x4dd5ea));_0x7cfc47>0x0&&console[_0x3e9f74(0x1c3)](_0x3e9f74(0x1ef)+a5_0x31c1c7['red'](_0x7cfc47));console[_0x3e9f74(0x1c3)]('Duration:\x20'+formatElapsed(_0x22dd81)),console['log']('━'[_0x3e9f74(0x24d)](0x3c));const _0x3e466a={'summary':{'total':_0x255e0a[_0x3e9f74(0x1cc)],'passed':_0x487d32,'failed':_0x4dd5ea,'errors':_0x7cfc47>0x0?_0x7cfc47:undefined,'duration_ms':_0x22dd81},'tests':_0x255e0a,'agent':{'project':_0x443905[_0x3e9f74(0x204)],'name':_0x443905[_0x3e9f74(0x1e8)],'site':_0x2d5cc6},'timestamp':new Date(_0x574873)['toISOString']()};if(_0x12516f!==_0x3e9f74(0x23a)||_0x5ed043){const _0x5bae3f=formatResults(_0x3e466a,_0x12516f);if(_0x5ed043)try{a5_0x445aa7[_0x3e9f74(0x202)](_0x5ed043,_0x5bae3f,_0x3e9f74(0x247)),console['log'](),console['log'](a5_0x31c1c7[_0x3e9f74(0x1da)]('Output\x20written\x20to:\x20'+_0x5ed043));}catch(_0xea654b){return console[_0x3e9f74(0x1c3)](),console[_0x3e9f74(0x1c3)](a5_0x31c1c7[_0x3e9f74(0x20c)](_0x3e9f74(0x214)+_0xea654b)),0x1;}else console[_0x3e9f74(0x1c3)](),console[_0x3e9f74(0x1c3)](_0x5bae3f);}const _0x11c285=_0x255e0a[_0x3e9f74(0x21d)](_0x2da800=>_0x2da800[_0x3e9f74(0x1c1)]!=='PASS');return _0x11c285[_0x3e9f74(0x1cc)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a6_0x475b(){const _0x25e95b=['<\x20HTTP/1.1\x20','keys','x-trino-user','GET','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','trino','Invalid\x20API\x20type:\x20','7NYmAqi','.\x20Valid\x20methods:\x20','startsWith','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','message','4qOpbwd','api','join','542154sfTmHa','Invalid\x20HTTP\x20method:\x20','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','headers','cookie','file','llm','DELETE','toUpperCase','Endpoint\x20must\x20start\x20with\x20/:\x20','workflow','name','log','1ZmQrkV','Error:\x20','stack','Invalid\x20header\x20format:\x20\x22','data','9pUEtJR','length','authorization','1062335LxoFcE','x-auth-token','.\x20Valid\x20types:\x20','730144DVrUPy','error','POST','validate','color','\x0aStack\x20trace:\x0a','substring','includes','noColor','proxy-authorization','method','header','set-cookie','type','toLowerCase','517740JuCzrJ','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','indexOf','x-xsrf-token','llm-proxy','Results\x20saved\x20to\x20','entries','859260jTQdJm','verbose','4411AJzaiG','cas','PUT','output','trim','\x22.\x20','169665FrRURG','readBodyFromFile','5100sjtQSY','set-cookie2','body'];a6_0x475b=function(){return _0x25e95b;};return a6_0x475b();}const a6_0x1d5fec=a6_0x55e2;(function(_0x2b9ffc,_0x45e484){const _0x26e6f5=a6_0x55e2,_0xb86c3f=_0x2b9ffc();while(!![]){try{const _0x147f7d=parseInt(_0x26e6f5(0x1a6))/0x1*(-parseInt(_0x26e6f5(0x199))/0x2)+-parseInt(_0x26e6f5(0x1cf))/0x3*(parseInt(_0x26e6f5(0x196))/0x4)+parseInt(_0x26e6f5(0x1ae))/0x5+parseInt(_0x26e6f5(0x1c0))/0x6*(-parseInt(_0x26e6f5(0x1db))/0x7)+-parseInt(_0x26e6f5(0x1b1))/0x8*(-parseInt(_0x26e6f5(0x1ab))/0x9)+parseInt(_0x26e6f5(0x1c7))/0xa+parseInt(_0x26e6f5(0x1c9))/0xb*(parseInt(_0x26e6f5(0x1d1))/0xc);if(_0x147f7d===_0x45e484)break;else _0xb86c3f['push'](_0xb86c3f['shift']());}catch(_0x52258d){_0xb86c3f['push'](_0xb86c3f['shift']());}}}(a6_0x475b,0x23af4));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';function a6_0x55e2(_0x2dae24,_0x3ef178){_0x2dae24=_0x2dae24-0x193;const _0x475bca=a6_0x475b();let _0x55e229=_0x475bca[_0x2dae24];return _0x55e229;}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_0x1d5fec(0x1ad),a6_0x1d5fec(0x1ba),a6_0x1d5fec(0x19d),a6_0x1d5fec(0x1bd),a6_0x1d5fec(0x1d2),a6_0x1d5fec(0x1c3),a6_0x1d5fec(0x1af),a6_0x1d5fec(0x1d6)]);function isSensitiveHeader(_0x284856){const _0x5eaeb6=a6_0x1d5fec;return SENSITIVE_HEADERS['has'](_0x284856[_0x5eaeb6(0x1bf)]());}function parseHeader(_0x4dd4a5){const _0x52f19e=a6_0x1d5fec,_0x3cd4ed=_0x4dd4a5[_0x52f19e(0x1c2)](':');if(_0x3cd4ed===-0x1)throw new Error(_0x52f19e(0x1a9)+_0x4dd4a5+_0x52f19e(0x1ce)+_0x52f19e(0x194));const _0x3d7529=_0x4dd4a5[_0x52f19e(0x1b7)](0x0,_0x3cd4ed)[_0x52f19e(0x1cd)](),_0xe3ab92=_0x4dd4a5[_0x52f19e(0x1b7)](_0x3cd4ed+0x1)[_0x52f19e(0x1cd)]();if(!_0x3d7529)throw new Error(_0x52f19e(0x1c1)+_0x4dd4a5+'\x22');return[_0x3d7529,_0xe3ab92];}export class ApiCommand extends BaseCommand{[a6_0x1d5fec(0x1a4)]=a6_0x1d5fec(0x197);['description']=a6_0x1d5fec(0x1d8);[a6_0x1d5fec(0x1b4)](_0x2853f6){const _0x349cce=a6_0x1d5fec,{args:_0x51ea02,options:_0x297b8f}=_0x2853f6,_0x5c9e58=_0x297b8f;if(_0x51ea02['length']===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x54f63d=_0x51ea02[0x0];if(!_0x54f63d[_0x349cce(0x193)]('/'))return _0x349cce(0x1a2)+_0x54f63d;const _0x48fe85=_0x5c9e58['data'],_0x525d06=_0x5c9e58[_0x349cce(0x19e)];if(_0x48fe85&&_0x525d06)return _0x349cce(0x19b);const _0x19de7b=_0x5c9e58[_0x349cce(0x1bb)]||'GET',_0x293bcd=['GET',_0x349cce(0x1b3),_0x349cce(0x1cb),_0x349cce(0x1a0),'PATCH'];if(!_0x293bcd[_0x349cce(0x1b8)](_0x19de7b[_0x349cce(0x1a1)]()))return _0x349cce(0x19a)+_0x19de7b+_0x349cce(0x1dc)+_0x293bcd[_0x349cce(0x198)](',\x20');const _0x37c24a=_0x5c9e58[_0x349cce(0x1be)]||'td',_0x5d4ebc=['td','cdp',_0x349cce(0x1a3),_0x349cce(0x1d9),_0x349cce(0x19f),_0x349cce(0x1c4),_0x349cce(0x1ca)];if(!_0x5d4ebc[_0x349cce(0x1b8)](_0x37c24a))return _0x349cce(0x1da)+_0x37c24a+_0x349cce(0x1b0)+_0x5d4ebc[_0x349cce(0x198)](',\x20');return undefined;}async['execute'](_0x4703f3){const _0x364452=a6_0x1d5fec,{options:_0x476684,args:_0x4c672d,tdx:_0x4843ad}=_0x4703f3,_0x473777=_0x476684,_0x862e27=_0x4c672d[0x0],_0x5dd6f1=(_0x473777[_0x364452(0x1bb)]||_0x364452(0x1d7))[_0x364452(0x1a1)](),_0x4295c4=_0x473777['data'],_0x20d314=_0x473777[_0x364452(0x19e)],_0x14cf72=_0x473777[_0x364452(0x1bc)],_0x21afc6=_0x473777[_0x364452(0x1be)]||'td';try{const _0x3c92ec={};if(_0x14cf72){const _0xf6c3b3=Array['isArray'](_0x14cf72)?_0x14cf72:[_0x14cf72];for(const _0x4be750 of _0xf6c3b3){const [_0x418688,_0x36ba8e]=parseHeader(_0x4be750);_0x3c92ec[_0x418688]=_0x36ba8e;}}let _0x1972f4;if(_0x4295c4)_0x1972f4=_0x4295c4;else{if(_0x20d314)try{_0x1972f4=RawAPI[_0x364452(0x1d0)](_0x20d314);}catch(_0x378c1c){return console[_0x364452(0x1b2)](_0x364452(0x1a7)+(_0x378c1c instanceof Error?_0x378c1c['message']:String(_0x378c1c))),0x1;}}const _0x9f36c9={'method':_0x5dd6f1,'apiType':_0x21afc6,'includeHeaders':_0x476684[_0x364452(0x1c8)]};_0x1972f4&&(_0x9f36c9[_0x364452(0x1d3)]=_0x1972f4);Object[_0x364452(0x1d5)](_0x3c92ec)[_0x364452(0x1ac)]>0x0&&(_0x9f36c9['headers']=_0x3c92ec);if(_0x476684[_0x364452(0x1c8)]){const _0x5e3836=resolveSite(_0x476684['site']),_0xfef4c3=getEndpoint(_0x5e3836,_0x21afc6),_0x385de4=''+_0xfef4c3+_0x862e27;console['error']('>\x20'+_0x5dd6f1+'\x20'+_0x385de4);const _0x5ed02b=getAuthHeaders(_0x5e3836),_0x2208d5={..._0x5ed02b,..._0x3c92ec};for(const [_0x1aabde,_0x5e186d]of Object[_0x364452(0x1c6)](_0x2208d5)){!isSensitiveHeader(_0x1aabde)&&console['error']('>\x20'+_0x1aabde+':\x20'+_0x5e186d);}_0x1972f4&&console['error']('>'),console['error']('');}const _0x5d1ce7=await _0x4843ad[_0x364452(0x197)]['request'](_0x862e27,_0x9f36c9);if(_0x476684[_0x364452(0x1c8)]&&_0x5d1ce7[_0x364452(0x19c)]){console[_0x364452(0x1b2)](_0x364452(0x1d4)+_0x5d1ce7['status']);for(const [_0xb513fc,_0x453f5e]of Object[_0x364452(0x1c6)](_0x5d1ce7['headers'])){!isSensitiveHeader(_0xb513fc)&&console[_0x364452(0x1b2)]('<\x20'+_0xb513fc+':\x20'+_0x453f5e);}console[_0x364452(0x1b2)]('');}const _0x4d724c=Boolean(_0x476684['output']),_0x1415a8={'color':_0x476684['color'],'noColor':_0x476684[_0x364452(0x1b9)]||_0x4d724c&&!_0x476684[_0x364452(0x1b5)]},_0x24d1ec=colorizeJSON(_0x5d1ce7[_0x364452(0x1aa)],_0x1415a8);return _0x476684[_0x364452(0x1cc)]?(writeFileSync(_0x476684[_0x364452(0x1cc)],_0x24d1ec),console[_0x364452(0x1b2)](_0x364452(0x1c5)+_0x476684[_0x364452(0x1cc)])):console[_0x364452(0x1a5)](_0x24d1ec),0x0;}catch(_0x113160){return _0x113160 instanceof Error?(console[_0x364452(0x1b2)](_0x364452(0x1a7)+_0x113160[_0x364452(0x195)]),_0x476684[_0x364452(0x1c8)]&&_0x113160[_0x364452(0x1a8)]&&console['error'](_0x364452(0x1b6)+_0x113160[_0x364452(0x1a8)])):console[_0x364452(0x1b2)](_0x364452(0x1a7)+String(_0x113160)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a7_0x9826d2=a7_0xaf05;(function(_0x406538,_0x35e11d){const _0x4dc29e=a7_0xaf05,_0x5b8b75=_0x406538();while(!![]){try{const _0x2c5d1a=parseInt(_0x4dc29e(0x135))/0x1*(-parseInt(_0x4dc29e(0x128))/0x2)+-parseInt(_0x4dc29e(0x140))/0x3+-parseInt(_0x4dc29e(0x132))/0x4*(parseInt(_0x4dc29e(0x142))/0x5)+parseInt(_0x4dc29e(0x13a))/0x6*(-parseInt(_0x4dc29e(0x12f))/0x7)+-parseInt(_0x4dc29e(0x100))/0x8*(-parseInt(_0x4dc29e(0x136))/0x9)+-parseInt(_0x4dc29e(0x14d))/0xa*(-parseInt(_0x4dc29e(0x13b))/0xb)+parseInt(_0x4dc29e(0x111))/0xc;if(_0x2c5d1a===_0x35e11d)break;else _0x5b8b75['push'](_0x5b8b75['shift']());}catch(_0x4de3f0){_0x5b8b75['push'](_0x5b8b75['shift']());}}}(a7_0x1b16,0xec010));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens,saveOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';function a7_0xaf05(_0x396bbb,_0x16ff19){_0x396bbb=_0x396bbb-0xee;const _0x1b16d7=a7_0x1b16();let _0xaf05d4=_0x1b16d7[_0x396bbb];return _0xaf05d4;}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_0x27dfa6 from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';function a7_0x1b16(){const _0x5749d2=['/app/mp/ak','4150806qlhSyW','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','8093710tfjDOg','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','Setup\x20API\x20key\x20authentication\x20interactively','OAuth\x20tokens','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','apiKey','apikey','User:\x20','name','\x20--profile\x20','status','850NtRFGf','site','\x20(site:\x20','access_token','yellow','join','filter','No\x20credentials\x20found\x20in\x20keychain','\x27\x20registered','all','API\x20key','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','API\x20key\x20cannot\x20be\x20empty','description','Read\x20credential\x20from\x20keychain','text','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','logLevel','System\x20keychain\x20is\x20not\x20available','\x20\x20user_id:','\x20and\x20','✗\x20Validation\x20failed:\x20','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','getUserInfo','Validating\x20OAuth\x20tokens...','error','ERROR','trim','Name:\x20','N/A','34912BecJPs','\x0aSetup\x20cancelled','execute','\x20\x20tdx','\x20(profile:\x20','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','jobs','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','Setup\x20cancelled','\x20\x20(','create','tdx\x20profile:\x20','message','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','oauth','warn','last_name','58258752JQPPeR','Use\x20an\x20API\x20key','✓\x20Profile\x20\x27','accountName','email','/users/initiate_sso\x20(account:\x20','\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','/oauth/authorize','No\x20credential\x20found','✓\x20Default\x20site\x20set\x20to\x20','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','bold','us01','Read\x20credential\x20from\x20','method','Choose\x20how\x20to\x20sign\x20in:','auth:clear','profile','\x20removed\x20from\x20keychain','log','Remove\x20API\x20key\x20from\x20system\x20keychain','password','2uYFcDX','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','✓\x20Authentication\x20successful\x0a','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','dim','✓\x20Signed\x20in\x20successfully','tdx:\x20auth\x20clear','29659nNozZk','red','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','4ZCuPQQ','cyan','green','1074572kyBjBa','2007bZTPHS','For\x20scripts\x20or\x20headless\x20servers','\x20for\x20profile:\x20','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','1170yQVdgg','5401bgLMEf','You\x20can\x20find\x20your\x20API\x20key\x20at:','Credential\x20type:\x20OAuth','tdx:\x20auth\x20setup'];a7_0x1b16=function(){return _0x5749d2;};return a7_0x1b16();}import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a7_0x1e2464 from'chalk';export async function runOAuthLoginFlow(_0x531c12,_0x1852a0,_0x1e061e,_0x344bb2){const _0x3bd0b5=a7_0xaf05,_0x1d9ed0=await isKeychainAvailable();if(!_0x1d9ed0)throw new Error(_0x3bd0b5(0xf1)+_0x3bd0b5(0xf8));let _0x282fc5=_0x344bb2?.[_0x3bd0b5(0x114)];if(!_0x282fc5){const _0x4d9a39=await a7_0x27dfa6({'type':_0x3bd0b5(0xf0),'name':'accountName','message':_0x3bd0b5(0x158)});if(_0x4d9a39[_0x3bd0b5(0x114)]===undefined)throw new Error(_0x3bd0b5(0x108));_0x282fc5=_0x4d9a39[_0x3bd0b5(0x114)][_0x3bd0b5(0xfd)]()||undefined;}const _0x147c16=getConsoleUrl(_0x531c12);console[_0x3bd0b5(0x125)]('Opening\x20browser\x20for\x20authentication...');_0x282fc5?console['log']('\x20\x20'+_0x147c16+_0x3bd0b5(0x116)+_0x282fc5+')'):console[_0x3bd0b5(0x125)]('\x20\x20'+_0x147c16+_0x3bd0b5(0x119));console['log'](_0x3bd0b5(0x118));const _0x381ff6=await startOAuthFlow(_0x531c12,{'accountName':_0x282fc5});console['log'](_0x3bd0b5(0xfa));const _0x35056f=TDX[_0x3bd0b5(0x10a)]({'site':_0x531c12,'accessToken':_0x381ff6[_0x3bd0b5(0x150)],'logLevel':_0x1e061e??LogLevel[_0x3bd0b5(0xfc)]}),_0x5bf4e0=await _0x35056f['jobs']['getUserInfo']();console[_0x3bd0b5(0x125)](a7_0x1e2464[_0x3bd0b5(0x134)](_0x3bd0b5(0x12d))),console[_0x3bd0b5(0x125)]('\x20\x20'+a7_0x1e2464[_0x3bd0b5(0x133)](_0x531c12+':'+_0x5bf4e0['account_id'])+_0x3bd0b5(0xf5)+_0x5bf4e0['id']+_0x3bd0b5(0x109)+_0x5bf4e0['email']+')');!_0x282fc5&&(console['log'](a7_0x1e2464[_0x3bd0b5(0x12c)](_0x3bd0b5(0x117))),console[_0x3bd0b5(0x125)](a7_0x1e2464['dim'](_0x3bd0b5(0x107))),console[_0x3bd0b5(0x125)](a7_0x1e2464[_0x3bd0b5(0x12c)](_0x3bd0b5(0x11c))));await saveOAuthTokens(_0x381ff6,_0x1852a0),console[_0x3bd0b5(0x125)](_0x3bd0b5(0x12b)+(_0x1852a0?'\x20(profile:\x20'+_0x1852a0+')':''));if(_0x1852a0){const _0x4de11d={'site':_0x531c12};saveProfileToUserConfig(_0x1852a0,_0x4de11d),console['log']('✓\x20Profile\x20\x27'+_0x1852a0+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x531c12),console[_0x3bd0b5(0x125)](_0x3bd0b5(0x11b)+_0x531c12);const _0x5b1665=_0x1852a0?_0x3bd0b5(0x14b)+_0x1852a0:'';console[_0x3bd0b5(0x125)](),console[_0x3bd0b5(0x125)](_0x3bd0b5(0x131)),console[_0x3bd0b5(0x125)](_0x3bd0b5(0x103)+_0x5b1665+_0x3bd0b5(0x10d)),console[_0x3bd0b5(0x125)](_0x3bd0b5(0x103)+_0x5b1665+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases');}export async function promptAuthMethod(){const _0x102066=a7_0xaf05,_0x53f816=await a7_0x27dfa6({'type':'select','name':_0x102066(0x120),'message':_0x102066(0x121),'choices':[{'title':'Sign\x20in\x20with\x20browser\x20(recommended)','description':_0x102066(0x139),'value':_0x102066(0x10e)},{'title':_0x102066(0x112),'description':_0x102066(0x137),'value':_0x102066(0x148)}]});return _0x53f816[_0x102066(0x120)]||null;}export class AuthSetupCommand extends BaseCommand{[a7_0x9826d2(0x14a)]='auth:setup';[a7_0x9826d2(0xee)]=a7_0x9826d2(0x144);async[a7_0x9826d2(0x102)](_0x13c449){const _0x5d553b=a7_0x9826d2,{options:_0x2f4c3d}=_0x13c449,_0x32c8aa=_0x2f4c3d[_0x5d553b(0x123)];console[_0x5d553b(0x125)](a7_0x1e2464[_0x5d553b(0x11d)](_0x5d553b(0x13e)));const _0x50d066=_0x2f4c3d[_0x5d553b(0x14e)]||_0x5d553b(0x11e),_0x14c689=await promptSiteSelection(_0x50d066,_0x32c8aa,'Setup\x20cancelled');if(!_0x14c689)return 0x1;const _0x4f66f5=resolveSite(_0x14c689),_0x1c30e9=await promptAuthMethod();if(!_0x1c30e9)return console['log'](_0x5d553b(0x101)),0x1;if(_0x1c30e9===_0x5d553b(0x10e)){const {accountName:_0x58cb7c}=_0x2f4c3d;return await runOAuthLoginFlow(_0x4f66f5,_0x32c8aa,_0x2f4c3d[_0x5d553b(0xf3)]??LogLevel[_0x5d553b(0xfc)],{'accountName':_0x58cb7c}),0x0;}console[_0x5d553b(0x125)]('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x4f66f5),console['log'](_0x5d553b(0x13c)),console[_0x5d553b(0x125)]('\x20\x20'+getConsoleUrl(_0x4f66f5,_0x5d553b(0x13f)));const _0xa466b8=await a7_0x27dfa6({'type':_0x5d553b(0x127),'name':_0x5d553b(0x147),'message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x508e7c=>{const _0x431e4b=_0x5d553b;if(!_0x508e7c||!_0x508e7c[_0x431e4b(0xfd)]())return _0x431e4b(0x159);return!![];}});if(!_0xa466b8['apiKey'])return console[_0x5d553b(0x125)](_0x5d553b(0x101)),0x1;const _0xc06b73=_0xa466b8[_0x5d553b(0x147)];console['log']('Validating\x20API\x20key...');try{const _0xd412c1=TDX['create']({'site':_0x4f66f5,'apiKey':_0xc06b73[_0x5d553b(0xfd)](),'logLevel':_0x2f4c3d[_0x5d553b(0xf3)]??LogLevel[_0x5d553b(0xfc)]}),_0x222726=await _0xd412c1[_0x5d553b(0x106)][_0x5d553b(0xf9)]();console[_0x5d553b(0x125)](_0x5d553b(0x146)+_0x222726['email']+')');const _0x230863=await isKeychainAvailable();_0x230863?(await saveAPIKeyAsync(_0xc06b73[_0x5d553b(0xfd)](),_0x4f66f5,_0x32c8aa),console[_0x5d553b(0x125)](_0x5d553b(0x129)+(_0x32c8aa?_0x5d553b(0x104)+_0x32c8aa+')':''))):(console['warn'](a7_0x1e2464[_0x5d553b(0x151)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0x5d553b(0x10f)](a7_0x1e2464['yellow'](_0x5d553b(0x105))));if(_0x32c8aa){const _0x1db964={'site':_0x4f66f5};saveProfileToUserConfig(_0x32c8aa,_0x1db964),console[_0x5d553b(0x125)](_0x5d553b(0x113)+_0x32c8aa+_0x5d553b(0x155));}else saveDefaultSiteToUserConfig(_0x4f66f5),console[_0x5d553b(0x125)]('✓\x20Default\x20site\x20set\x20to\x20'+_0x4f66f5);const _0x4d0257=_0x32c8aa?_0x5d553b(0x14b)+_0x32c8aa:'';return console[_0x5d553b(0x125)](),console[_0x5d553b(0x125)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console['log'](_0x5d553b(0x103)+_0x4d0257+_0x5d553b(0x10d)),console['log'](_0x5d553b(0x103)+_0x4d0257+_0x5d553b(0x141)),0x0;}catch(_0x2ce8e6){if(_0x2ce8e6 instanceof HTTPClientError&&_0x2ce8e6[_0x5d553b(0x14c)]===0x191)return printAuthError(_0x2ce8e6),0x1;return console[_0x5d553b(0xfb)](a7_0x1e2464[_0x5d553b(0x130)](_0x5d553b(0xf7)+(_0x2ce8e6 instanceof Error?_0x2ce8e6[_0x5d553b(0x10c)]:String(_0x2ce8e6)))),console[_0x5d553b(0xfb)](_0x5d553b(0x143)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x9826d2(0x14a)]='auth';[a7_0x9826d2(0xee)]=a7_0x9826d2(0xf2);async['execute'](_0x4385ed){const _0x3c731b=a7_0x9826d2,{options:_0x4c8cfc,tdx:_0x564f59}=_0x4385ed,_0x1ff131=_0x4c8cfc[_0x3c731b(0x14e)],_0x43a545=_0x4c8cfc[_0x3c731b(0x123)],_0x45b011=_0x43a545?_0x43a545:_0x3c731b(0xff);console[_0x3c731b(0x125)](_0x3c731b(0x10b)+_0x45b011+_0x3c731b(0x14f)+_0x1ff131+')');const _0x703eb0=await getOAuthTokens(_0x43a545);if(_0x703eb0)console[_0x3c731b(0x125)](_0x3c731b(0x13d)),console[_0x3c731b(0x125)](_0x3c731b(0xef)+(_0x43a545?'\x20(profile:\x20'+_0x43a545+')':''));else{const _0x2493f7=await resolveAPIKeyAsync(_0x1ff131,_0x43a545);if(_0x2493f7){const {source:_0x28ab6e,isDeprecated:_0x3425b3}=_0x2493f7,_0x59659d=_0x3c731b(0x11f)+_0x28ab6e;console[_0x3c731b(0x125)](_0x3425b3?a7_0x1e2464[_0x3c731b(0x151)](_0x59659d):_0x59659d);}else console[_0x3c731b(0x125)](a7_0x1e2464['yellow'](_0x3c731b(0x11a)));}try{const _0x389873=await _0x564f59[_0x3c731b(0x106)][_0x3c731b(0xf9)]();return console[_0x3c731b(0x125)](a7_0x1e2464[_0x3c731b(0x134)](_0x3c731b(0x12a))),console[_0x3c731b(0x125)](_0x3c731b(0x149)+_0x389873[_0x3c731b(0x115)]),(_0x389873['first_name']||_0x389873[_0x3c731b(0x110)])&&console['log'](_0x3c731b(0xfe)+[_0x389873['first_name'],_0x389873[_0x3c731b(0x110)]][_0x3c731b(0x153)](Boolean)['join']('\x20')),0x0;}catch(_0x5b834b){return _0x5b834b instanceof HTTPClientError&&_0x5b834b[_0x3c731b(0x14c)]===0x191?printAuthError(_0x5b834b,!![],_0x43a545):console[_0x3c731b(0xfb)](a7_0x1e2464[_0x3c731b(0x130)](_0x3c731b(0xf7)+(_0x5b834b instanceof Error?_0x5b834b['message']:String(_0x5b834b)))),0x1;}}}export class AuthClearCommand extends BaseCommand{['name']=a7_0x9826d2(0x122);[a7_0x9826d2(0xee)]=a7_0x9826d2(0x126);async[a7_0x9826d2(0x102)](_0xaa94e8){const _0x110afa=a7_0x9826d2,{options:_0x515380}=_0xaa94e8,_0x19865b=_0x515380['profile'];console[_0x110afa(0x125)](a7_0x1e2464[_0x110afa(0x11d)](_0x110afa(0x12e)));const _0x56b2d7=await isKeychainAvailable();if(!_0x56b2d7)return console[_0x110afa(0xfb)](a7_0x1e2464[_0x110afa(0x130)](_0x110afa(0xf4))),0x1;const [_0x2983ef,_0x48c116]=await Promise[_0x110afa(0x156)]([deleteKeychainAPIKey(_0x19865b),deleteOAuthTokens(_0x19865b)]);if(_0x2983ef||_0x48c116){clearCredentialCache();const _0x33a50e=[_0x2983ef&&_0x110afa(0x157),_0x48c116&&_0x110afa(0x145)][_0x110afa(0x153)](Boolean)[_0x110afa(0x152)](_0x110afa(0xf6));return console['log']('✓\x20'+_0x33a50e+_0x110afa(0x124)+(_0x19865b?'\x20(profile:\x20'+_0x19865b+')':'')),0x0;}else return console['log'](_0x110afa(0x154)+(_0x19865b?_0x110afa(0x138)+_0x19865b:'')),0x1;}}
|
|
1
|
+
const a7_0x576f07=a7_0x2a8c;(function(_0x187dd8,_0xe04fd){const _0x318cd8=a7_0x2a8c,_0x22c0e3=_0x187dd8();while(!![]){try{const _0x8464c7=parseInt(_0x318cd8(0x1f1))/0x1*(-parseInt(_0x318cd8(0x1e4))/0x2)+parseInt(_0x318cd8(0x202))/0x3+-parseInt(_0x318cd8(0x229))/0x4*(-parseInt(_0x318cd8(0x233))/0x5)+-parseInt(_0x318cd8(0x1eb))/0x6*(-parseInt(_0x318cd8(0x22b))/0x7)+-parseInt(_0x318cd8(0x243))/0x8*(parseInt(_0x318cd8(0x224))/0x9)+parseInt(_0x318cd8(0x1e6))/0xa*(parseInt(_0x318cd8(0x21d))/0xb)+parseInt(_0x318cd8(0x244))/0xc*(parseInt(_0x318cd8(0x1f0))/0xd);if(_0x8464c7===_0xe04fd)break;else _0x22c0e3['push'](_0x22c0e3['shift']());}catch(_0x16c76e){_0x22c0e3['push'](_0x22c0e3['shift']());}}}(a7_0x4fba,0x2d0d4));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens,saveOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';function a7_0x4fba(){const _0xab8be1=['Read\x20credential\x20from\x20','accountName','email','red','Read\x20credential\x20from\x20keychain','Enter\x20your\x20TD\x20API\x20key:','\x27\x20registered','/users/initiate_sso\x20(account:\x20','join','name','tdx\x20profile:\x20','bold','16hRaCgm','12rtxdti','524pobRfQ','getUserInfo','1111050rWIgYs','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','access_token','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','apikey','194766uQJJcE','dim','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','ERROR','tdx:\x20auth\x20clear','180479filZtR','347LoofEi','✓\x20Default\x20site\x20set\x20to\x20','execute','Validating\x20API\x20key...','site','first_name','\x20for\x20profile:\x20','method','auth:setup','✗\x20Validation\x20failed:\x20','apiKey','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','profile','\x20(profile:\x20','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','message','/oauth/authorize','606966Pakxwc','Opening\x20browser\x20for\x20authentication...','For\x20scripts\x20or\x20headless\x20servers','\x20and\x20','N/A','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','Setup\x20cancelled','\x20removed\x20from\x20keychain','Choose\x20how\x20to\x20sign\x20in:','warn','\x0aSetup\x20cancelled','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','yellow','Name:\x20','green','trim','error','account_id','✓\x20Authentication\x20successful\x0a','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','Setting\x20up\x20authentication\x20for\x20site:\x20','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','✓\x20Profile\x20\x27','last_name','No\x20credentials\x20found\x20in\x20keychain','/app/mp/ak','11wbnrxc','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','description','API\x20key','\x20--profile\x20','filter','\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','590427usFZFJ','jobs','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','password','\x20\x20user_id:','12cAVNBX','\x20\x20tdx','7blzAel','create','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','No\x20credential\x20found','Validating\x20OAuth\x20tokens...','System\x20keychain\x20is\x20not\x20available','status','78135MKOveV','oauth','log','cyan'];a7_0x4fba=function(){return _0xab8be1;};return a7_0x4fba();}import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';function a7_0x2a8c(_0x235c19,_0x3b8438){_0x235c19=_0x235c19-0x1e4;const _0x4fba34=a7_0x4fba();let _0x2a8c9b=_0x4fba34[_0x235c19];return _0x2a8c9b;}import{clearCredentialCache}from'../core/credential-cache.js';import{startOAuthFlow}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x576514 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_0x2b6acc from'chalk';export async function runOAuthLoginFlow(_0x18e0f8,_0x3626eb,_0x1898e9,_0x317364){const _0x2a49c2=a7_0x2a8c,_0x15d4ab=await isKeychainAvailable();if(!_0x15d4ab)throw new Error(_0x2a49c2(0x1e7)+_0x2a49c2(0x21e));let _0x2e7c08=_0x317364?.['accountName'];if(!_0x2e7c08){const _0x467860=await a7_0x576514({'type':'text','name':_0x2a49c2(0x238),'message':_0x2a49c2(0x1e9)});if(_0x467860[_0x2a49c2(0x238)]===undefined)throw new Error(_0x2a49c2(0x208));_0x2e7c08=_0x467860[_0x2a49c2(0x238)]['trim']()||undefined;}const _0x3a510a=getConsoleUrl(_0x18e0f8);console['log'](_0x2a49c2(0x203));_0x2e7c08?console[_0x2a49c2(0x235)]('\x20\x20'+_0x3a510a+_0x2a49c2(0x23e)+_0x2e7c08+')'):console[_0x2a49c2(0x235)]('\x20\x20'+_0x3a510a+_0x2a49c2(0x201));console['log'](_0x2a49c2(0x215));const _0xc85e14=await startOAuthFlow(_0x18e0f8,{'accountName':_0x2e7c08});console['log'](_0x2a49c2(0x230));const _0x19a1de=TDX[_0x2a49c2(0x22c)]({'site':_0x18e0f8,'accessToken':_0xc85e14[_0x2a49c2(0x1e8)],'logLevel':_0x1898e9??LogLevel[_0x2a49c2(0x1ee)]}),_0x510fc4=await _0x19a1de[_0x2a49c2(0x225)][_0x2a49c2(0x1e5)]();console[_0x2a49c2(0x235)](a7_0x2b6acc[_0x2a49c2(0x210)]('✓\x20Signed\x20in\x20successfully')),console[_0x2a49c2(0x235)]('\x20\x20'+a7_0x2b6acc[_0x2a49c2(0x236)](_0x18e0f8+':'+_0x510fc4[_0x2a49c2(0x213)])+_0x2a49c2(0x228)+_0x510fc4['id']+'\x20\x20('+_0x510fc4[_0x2a49c2(0x239)]+')');!_0x2e7c08&&(console[_0x2a49c2(0x235)](a7_0x2b6acc[_0x2a49c2(0x1ec)](_0x2a49c2(0x223))),console[_0x2a49c2(0x235)](a7_0x2b6acc[_0x2a49c2(0x1ec)](_0x2a49c2(0x216))),console[_0x2a49c2(0x235)](a7_0x2b6acc['dim']('\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions')));await saveOAuthTokens(_0xc85e14,_0x3626eb),console[_0x2a49c2(0x235)]('✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain'+(_0x3626eb?'\x20(profile:\x20'+_0x3626eb+')':''));if(_0x3626eb){const _0x512d79={'site':_0x18e0f8};saveProfileToUserConfig(_0x3626eb,_0x512d79),console[_0x2a49c2(0x235)](_0x2a49c2(0x219)+_0x3626eb+_0x2a49c2(0x23d));}else saveDefaultSiteToUserConfig(_0x18e0f8),console['log']('✓\x20Default\x20site\x20set\x20to\x20'+_0x18e0f8);const _0x15faf8=_0x3626eb?_0x2a49c2(0x221)+_0x3626eb:'';console[_0x2a49c2(0x235)](),console[_0x2a49c2(0x235)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x2a49c2(0x235)]('\x20\x20tdx'+_0x15faf8+_0x2a49c2(0x20d)),console[_0x2a49c2(0x235)](_0x2a49c2(0x22a)+_0x15faf8+_0x2a49c2(0x1fc));}export async function promptAuthMethod(){const _0x465460=a7_0x2a8c,_0x373399=await a7_0x576514({'type':'select','name':_0x465460(0x1f8),'message':_0x465460(0x20a),'choices':[{'title':'Sign\x20in\x20with\x20browser\x20(recommended)','description':_0x465460(0x218),'value':_0x465460(0x234)},{'title':'Use\x20an\x20API\x20key','description':_0x465460(0x204),'value':_0x465460(0x1ea)}]});return _0x373399[_0x465460(0x1f8)]||null;}export class AuthSetupCommand extends BaseCommand{['name']=a7_0x576f07(0x1f9);[a7_0x576f07(0x21f)]='Setup\x20API\x20key\x20authentication\x20interactively';async['execute'](_0x5304cf){const _0x3dce50=a7_0x576f07,{options:_0x1b66ee}=_0x5304cf,_0x4204d7=_0x1b66ee[_0x3dce50(0x1fd)];console[_0x3dce50(0x235)](a7_0x2b6acc[_0x3dce50(0x242)]('tdx:\x20auth\x20setup'));const _0x3c195d=_0x1b66ee[_0x3dce50(0x1f5)]||'us01',_0x57ae33=await promptSiteSelection(_0x3c195d,_0x4204d7,'Setup\x20cancelled');if(!_0x57ae33)return 0x1;const _0x2b129d=resolveSite(_0x57ae33),_0xb8619b=await promptAuthMethod();if(!_0xb8619b)return console[_0x3dce50(0x235)](_0x3dce50(0x20c)),0x1;if(_0xb8619b===_0x3dce50(0x234)){const {accountName:_0x3f62c0}=_0x1b66ee;return await runOAuthLoginFlow(_0x2b129d,_0x4204d7,_0x1b66ee['logLevel']??LogLevel[_0x3dce50(0x1ee)],{'accountName':_0x3f62c0}),0x0;}console['log'](_0x3dce50(0x217)+_0x2b129d),console[_0x3dce50(0x235)]('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0x3dce50(0x235)]('\x20\x20'+getConsoleUrl(_0x2b129d,_0x3dce50(0x21c)));const _0x2b2746=await a7_0x576514({'type':_0x3dce50(0x227),'name':_0x3dce50(0x1fb),'message':_0x3dce50(0x23c),'validate':_0x3a16b7=>{if(!_0x3a16b7||!_0x3a16b7['trim']())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x2b2746['apiKey'])return console['log'](_0x3dce50(0x20c)),0x1;const _0x448493=_0x2b2746[_0x3dce50(0x1fb)];console[_0x3dce50(0x235)](_0x3dce50(0x1f4));try{const _0x5ab891=TDX[_0x3dce50(0x22c)]({'site':_0x2b129d,'apiKey':_0x448493['trim'](),'logLevel':_0x1b66ee['logLevel']??LogLevel[_0x3dce50(0x1ee)]}),_0x47f7e6=await _0x5ab891[_0x3dce50(0x225)]['getUserInfo']();console[_0x3dce50(0x235)](_0x3dce50(0x226)+_0x47f7e6[_0x3dce50(0x239)]+')');const _0x250e25=await isKeychainAvailable();_0x250e25?(await saveAPIKeyAsync(_0x448493[_0x3dce50(0x211)](),_0x2b129d,_0x4204d7),console[_0x3dce50(0x235)](_0x3dce50(0x207)+(_0x4204d7?_0x3dce50(0x1fe)+_0x4204d7+')':''))):(console['warn'](a7_0x2b6acc['yellow'](_0x3dce50(0x1ff))),console[_0x3dce50(0x20b)](a7_0x2b6acc[_0x3dce50(0x20e)](_0x3dce50(0x22e))));if(_0x4204d7){const _0x2f4358={'site':_0x2b129d};saveProfileToUserConfig(_0x4204d7,_0x2f4358),console[_0x3dce50(0x235)]('✓\x20Profile\x20\x27'+_0x4204d7+_0x3dce50(0x23d));}else saveDefaultSiteToUserConfig(_0x2b129d),console[_0x3dce50(0x235)](_0x3dce50(0x1f2)+_0x2b129d);const _0x358c7c=_0x4204d7?'\x20--profile\x20'+_0x4204d7:'';return console[_0x3dce50(0x235)](),console['log']('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console['log'](_0x3dce50(0x22a)+_0x358c7c+_0x3dce50(0x20d)),console[_0x3dce50(0x235)]('\x20\x20tdx'+_0x358c7c+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x9a1fff){if(_0x9a1fff instanceof HTTPClientError&&_0x9a1fff[_0x3dce50(0x232)]===0x191)return printAuthError(_0x9a1fff),0x1;return console[_0x3dce50(0x212)](a7_0x2b6acc['red'](_0x3dce50(0x1fa)+(_0x9a1fff instanceof Error?_0x9a1fff[_0x3dce50(0x200)]:String(_0x9a1fff)))),console[_0x3dce50(0x212)](_0x3dce50(0x22d)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x576f07(0x240)]='auth';[a7_0x576f07(0x21f)]=a7_0x576f07(0x1ed);async[a7_0x576f07(0x1f3)](_0x2de416){const _0x4e0b0f=a7_0x576f07,{options:_0x136e69,tdx:_0x22e818}=_0x2de416,_0x17367f=_0x136e69[_0x4e0b0f(0x1f5)],_0x58fe4a=_0x136e69['profile'],_0x260dcb=_0x58fe4a?_0x58fe4a:_0x4e0b0f(0x206);console['log'](_0x4e0b0f(0x241)+_0x260dcb+'\x20(site:\x20'+_0x17367f+')');const _0x5418ef=await getOAuthTokens(_0x58fe4a);if(_0x5418ef)console[_0x4e0b0f(0x235)]('Credential\x20type:\x20OAuth'),console[_0x4e0b0f(0x235)](_0x4e0b0f(0x23b)+(_0x58fe4a?_0x4e0b0f(0x1fe)+_0x58fe4a+')':''));else{const _0x1bb386=await resolveAPIKeyAsync(_0x17367f,_0x58fe4a);if(_0x1bb386){const {source:_0xe0a362,isDeprecated:_0x3e67c6}=_0x1bb386,_0x4ef57d=_0x4e0b0f(0x237)+_0xe0a362;console[_0x4e0b0f(0x235)](_0x3e67c6?a7_0x2b6acc['yellow'](_0x4ef57d):_0x4ef57d);}else console[_0x4e0b0f(0x235)](a7_0x2b6acc[_0x4e0b0f(0x20e)](_0x4e0b0f(0x22f)));}try{const _0x5ea9ab=await _0x22e818[_0x4e0b0f(0x225)]['getUserInfo']();return console['log'](a7_0x2b6acc[_0x4e0b0f(0x210)](_0x4e0b0f(0x214))),console[_0x4e0b0f(0x235)]('User:\x20'+_0x5ea9ab[_0x4e0b0f(0x239)]),(_0x5ea9ab['first_name']||_0x5ea9ab[_0x4e0b0f(0x21a)])&&console['log'](_0x4e0b0f(0x20f)+[_0x5ea9ab[_0x4e0b0f(0x1f6)],_0x5ea9ab[_0x4e0b0f(0x21a)]][_0x4e0b0f(0x222)](Boolean)[_0x4e0b0f(0x23f)]('\x20')),0x0;}catch(_0x4ed344){return _0x4ed344 instanceof HTTPClientError&&_0x4ed344['status']===0x191?printAuthError(_0x4ed344,!![],_0x58fe4a):console[_0x4e0b0f(0x212)](a7_0x2b6acc[_0x4e0b0f(0x23a)](_0x4e0b0f(0x1fa)+(_0x4ed344 instanceof Error?_0x4ed344[_0x4e0b0f(0x200)]:String(_0x4ed344)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x576f07(0x240)]='auth:clear';[a7_0x576f07(0x21f)]='Remove\x20API\x20key\x20from\x20system\x20keychain';async[a7_0x576f07(0x1f3)](_0x1c5a63){const _0x5dc34f=a7_0x576f07,{options:_0x29724b}=_0x1c5a63,_0x355c16=_0x29724b['profile'];console[_0x5dc34f(0x235)](a7_0x2b6acc[_0x5dc34f(0x242)](_0x5dc34f(0x1ef)));const _0x4adf49=await isKeychainAvailable();if(!_0x4adf49)return console[_0x5dc34f(0x212)](a7_0x2b6acc['red'](_0x5dc34f(0x231))),0x1;const [_0x2b15cd,_0x591ddb]=await Promise['all']([deleteKeychainAPIKey(_0x355c16),deleteOAuthTokens(_0x355c16)]);if(_0x2b15cd||_0x591ddb){clearCredentialCache();const _0x36d57c=[_0x2b15cd&&_0x5dc34f(0x220),_0x591ddb&&'OAuth\x20tokens'][_0x5dc34f(0x222)](Boolean)['join'](_0x5dc34f(0x205));return console[_0x5dc34f(0x235)]('✓\x20'+_0x36d57c+_0x5dc34f(0x209)+(_0x355c16?_0x5dc34f(0x1fe)+_0x355c16+')':'')),0x0;}else return console['log'](_0x5dc34f(0x21b)+(_0x355c16?_0x5dc34f(0x1f7)+_0x355c16:'')),0x1;}}
|