@treasuredata/tdx 2026.7.4 → 2026.7.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.d.ts.map +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-command.js.map +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-move-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/table-deleted.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/tools/work-create-item.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-schema.d.ts +15 -3
- package/dist/sdk/cas/cas-audience-schema.d.ts.map +1 -1
- package/dist/sdk/cas/cas-audience-schema.js +1 -1
- package/dist/sdk/cas/cas-audience-schema.js.map +1 -1
- package/dist/sdk/cas/cas-audience-validator.js +1 -1
- package/dist/sdk/cas/cas-audience-validator.js.map +1 -1
- package/dist/sdk/cas/cas-audience-yaml.d.ts +8 -0
- package/dist/sdk/cas/cas-audience-yaml.d.ts.map +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js.map +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.d.ts +47 -1
- package/dist/sdk/cas/push-workflow.d.ts.map +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js.map +1 -1
- package/dist/sdk/cas/validate-files.js +1 -1
- package/dist/sdk/client/cdp-api-client.d.ts +6 -6
- package/dist/sdk/client/cdp-api-client.d.ts.map +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/cdp-api-client.js.map +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.d.ts +6 -6
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/engage-api-client.js.map +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/llm/user-settings.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/deleted-table-validation.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.d.ts +0 -8
- package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js.map +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.d.ts.map +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js.map +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.d.ts +66 -7
- package/dist/sdk/segment/types/activation-schema.d.ts.map +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js.map +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.d.ts +1 -1
- package/dist/sdk/segment/types/segment-def.d.ts.map +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-def.js.map +1 -1
- package/dist/sdk/segment/types/segment-schema.d.ts +110 -1
- package/dist/sdk/segment/types/segment-schema.d.ts.map +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js.map +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/cas.d.ts +5 -0
- package/dist/sdk/types/cas.d.ts.map +1 -1
- package/dist/sdk/types/cdp.d.ts +7 -3
- package/dist/sdk/types/cdp.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/util/tree-search.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/task-graph.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/claude-code-state.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/proxy-fetch.js +1 -1
- package/dist/utils/proxy-fetch.js.map +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a3_0x2aeff6=a3_0xa349;function a3_0xa349(_0x11c4ed,_0x57875b){_0x11c4ed=_0x11c4ed-0xad;const _0x2957a5=a3_0x2957();let _0xa3495e=_0x2957a5[_0x11c4ed];return _0xa3495e;}(function(_0x39a935,_0x1c2f89){const _0x40e937=a3_0xa349,_0x24867a=_0x39a935();while(!![]){try{const _0x4b6cc6=-parseInt(_0x40e937(0xc5))/0x1+-parseInt(_0x40e937(0xcd))/0x2+parseInt(_0x40e937(0xcf))/0x3*(parseInt(_0x40e937(0xbb))/0x4)+parseInt(_0x40e937(0xc9))/0x5+parseInt(_0x40e937(0xbf))/0x6*(-parseInt(_0x40e937(0xbe))/0x7)+parseInt(_0x40e937(0xbd))/0x8+parseInt(_0x40e937(0xba))/0x9;if(_0x4b6cc6===_0x1c2f89)break;else _0x24867a['push'](_0x24867a['shift']());}catch(_0x5c7f68){_0x24867a['push'](_0x24867a['shift']());}}}(a3_0x2957,0x9baa9));import{BaseCommand}from'./command.js';function a3_0x2957(){const _0x48e6ef=['Resolving\x20child\x20segment\x20\x27','site','Resolved\x20parent\x20ID:\x20','data','3326292vnVXKA','44ArjqTp','activations','6167360eoJPMW','6937QSaeyT','4662bxjNIW','Resolved\x20child\x20ID:\x20','Site:\x20','execute','segment','Error:\x20','34707lgtpQB','length','Resolving\x20parent\x20segment\x20\x27','cause','1217620uLDKbd','Error:\x20Segment\x20name\x20is\x20required','description','\x20\x20Cause:\x20','1015252pzzslL','error','154341WDdXRo','✔\x20Found\x20','Child\x20name:\x20','resolveParentId','name','List\x20activations\x20for\x20a\x20segment','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','resolveSegmentId','verbose','\x27...'];a3_0x2957=function(){return _0x48e6ef;};return a3_0x2957();}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';export class ActivationsCommand extends BaseCommand{[a3_0x2aeff6(0xb0)]=a3_0x2aeff6(0xbc);[a3_0x2aeff6(0xcb)]=a3_0x2aeff6(0xb1);async[a3_0x2aeff6(0xc2)](_0xce6cb9){const _0x1f36b9=a3_0x2aeff6,{options:_0x4969fa,args:_0x27a85e,tdx:_0x44945d}=_0xce6cb9;if(_0x27a85e[_0x1f36b9(0xc6)]===0x0)return console[_0x1f36b9(0xce)](_0x1f36b9(0xca)),console[_0x1f36b9(0xce)](_0x1f36b9(0xb2)),0x1;try{const {parentId:_0x37a2bb,childId:_0x4c4e7c}=parseSegmentRef(_0x27a85e[0x0]);if(!_0x4c4e7c)return console['error']('Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations'),console[_0x1f36b9(0xce)](_0x1f36b9(0xb2)),0x1;_0x4969fa[_0x1f36b9(0xb4)]&&(console[_0x1f36b9(0xce)](_0x1f36b9(0xc1)+_0x4969fa[_0x1f36b9(0xb7)]),console['error']('Parent\x20name:\x20'+_0x37a2bb),console[_0x1f36b9(0xce)](_0x1f36b9(0xae)+_0x4c4e7c));const _0x5d97c5=await withSpinner(_0x1f36b9(0xc7)+_0x37a2bb+_0x1f36b9(0xb5),()=>_0x44945d['segment'][_0x1f36b9(0xaf)](_0x37a2bb),{'verbose':_0x4969fa[_0x1f36b9(0xb4)]}),_0x59144a=_0x5d97c5['data'];_0x4969fa['verbose']&&console[_0x1f36b9(0xce)](_0x1f36b9(0xb8)+_0x59144a);const _0x45ba92=await withSpinner(_0x1f36b9(0xb6)+_0x4c4e7c+_0x1f36b9(0xb5),()=>_0x44945d[_0x1f36b9(0xc3)][_0x1f36b9(0xb3)](_0x59144a,_0x4c4e7c),{'verbose':_0x4969fa[_0x1f36b9(0xb4)]}),_0x53942c=_0x45ba92[_0x1f36b9(0xb9)];_0x4969fa[_0x1f36b9(0xb4)]&&console[_0x1f36b9(0xce)](_0x1f36b9(0xc0)+_0x53942c);const _0x39ab2b=await withSpinner('Listing\x20activations\x20for\x20segment\x20\x27'+_0x4c4e7c+_0x1f36b9(0xb5),()=>_0x44945d[_0x1f36b9(0xc3)]['listActivations'](_0x59144a,_0x53942c),{'verbose':_0x4969fa['verbose']}),_0x1a573c=_0x39ab2b[_0x1f36b9(0xb9)];return console[_0x1f36b9(0xce)](_0x1f36b9(0xad)+_0x1a573c[_0x1f36b9(0xc6)]+'\x20activation'+(_0x1a573c[_0x1f36b9(0xc6)]!==0x1?'s':'')),await handleSDKOutput(_0x1a573c,_0x4969fa),0x0;}catch(_0x260873){if(_0x260873 instanceof SDKError)return console['error'](_0x1f36b9(0xc4)+_0x260873['message']),_0x260873[_0x1f36b9(0xc8)]&&console['error'](_0x1f36b9(0xcc)+_0x260873[_0x1f36b9(0xc8)]),0x1;throw _0x260873;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x3cfd04=a4_0x3657;(function(_0x34df8e,_0x5859e6){const _0x4fc64c=a4_0x3657,_0x163f1e=_0x34df8e();while(!![]){try{const _0x8f4670=parseInt(_0x4fc64c(0xd8))/0x1+-parseInt(_0x4fc64c(0x12d))/0x2*(-parseInt(_0x4fc64c(0x16e))/0x3)+-parseInt(_0x4fc64c(0x148))/0x4+parseInt(_0x4fc64c(0x113))/0x5+-parseInt(_0x4fc64c(0x13f))/0x6+parseInt(_0x4fc64c(0x182))/0x7*(parseInt(_0x4fc64c(0x11e))/0x8)+-parseInt(_0x4fc64c(0x164))/0x9*(parseInt(_0x4fc64c(0xe9))/0xa);if(_0x8f4670===_0x5859e6)break;else _0x163f1e['push'](_0x163f1e['shift']());}catch(_0x5e8868){_0x163f1e['push'](_0x163f1e['shift']());}}}(a4_0x80b4,0x3a116));import a4_0x399678 from'chalk';import a4_0x230193 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';function a4_0x3657(_0x381888,_0x1afd7b){_0x381888=_0x381888-0xd0;const _0x80b48=a4_0x80b4();let _0x365781=_0x80b48[_0x381888];return _0x365781;}import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x116ea7){const _0x33970b=a4_0x3657,_0x49604b=[];if(_0x116ea7[_0x33970b(0x157)]!==undefined)_0x49604b['push'](_0x116ea7[_0x33970b(0x157)]+_0x33970b(0x13c));if(_0x116ea7[_0x33970b(0x18b)]!==undefined&&_0x116ea7[_0x33970b(0x18b)]>0x0)_0x49604b['push'](a4_0x399678[_0x33970b(0x17c)](_0x116ea7[_0x33970b(0x18b)]+_0x33970b(0x138)));if(_0x116ea7['created']!==undefined&&_0x116ea7[_0x33970b(0x165)]>0x0)_0x49604b[_0x33970b(0xfa)](a4_0x399678['green'](_0x116ea7[_0x33970b(0x165)]+'\x20created'));if(_0x116ea7['updated']!==undefined&&_0x116ea7['updated']>0x0)_0x49604b[_0x33970b(0xfa)](a4_0x399678[_0x33970b(0x14a)](_0x116ea7[_0x33970b(0x161)]+_0x33970b(0xfb)));if(_0x116ea7[_0x33970b(0x17d)]!==undefined&&_0x116ea7[_0x33970b(0x17d)]>0x0)_0x49604b[_0x33970b(0xfa)](a4_0x399678['gray'](_0x116ea7[_0x33970b(0x17d)]+'\x20unchanged'));if(_0x116ea7['errors']!==undefined&&_0x116ea7[_0x33970b(0x180)]>0x0)_0x49604b[_0x33970b(0xfa)](a4_0x399678[_0x33970b(0xe7)](_0x116ea7['errors']+'\x20errors'));return _0x49604b[_0x33970b(0x171)](',\x20');}function displayDiffs(_0x52f769,_0x56c045,_0x25ddbc,_0x49457c,_0x123111,_0x52e1aa,_0x53a010,_0x298dfe,_0xb5d7b3){const _0xe87be8=a4_0x3657;for(const _0xddad5a of _0x52f769){if(_0xddad5a[_0xe87be8(0x184)]){const _0x53a058=_0xddad5a[_0xe87be8(0x10c)]||_0xddad5a[_0xe87be8(0x175)];console['log']('\x0aChanges\x20to\x20agent\x20\x27'+_0x53a058+'\x27:'),console[_0xe87be8(0x10b)]('─'[_0xe87be8(0x173)](0x3c)),console['log'](_0xddad5a[_0xe87be8(0x184)]),console[_0xe87be8(0x10b)]('─'[_0xe87be8(0x173)](0x3c));}}for(const _0x3efd4c of _0x56c045){_0x3efd4c['diff']&&(console['log'](_0xe87be8(0xdc)+_0x3efd4c[_0xe87be8(0x175)]+'\x27:'),console[_0xe87be8(0x10b)]('─'['repeat'](0x3c)),console[_0xe87be8(0x10b)](_0x3efd4c[_0xe87be8(0x184)]),console[_0xe87be8(0x10b)]('─'[_0xe87be8(0x173)](0x3c)));}for(const _0x309fe8 of _0x25ddbc){_0x309fe8[_0xe87be8(0x184)]&&(console[_0xe87be8(0x10b)](_0xe87be8(0xe5)+_0x309fe8[_0xe87be8(0x175)]+'\x27:'),console[_0xe87be8(0x10b)]('─'[_0xe87be8(0x173)](0x3c)),console[_0xe87be8(0x10b)](_0x309fe8['diff']),console[_0xe87be8(0x10b)]('─'['repeat'](0x3c)));}for(const _0x5ba5c2 of _0x49457c){_0x5ba5c2[_0xe87be8(0x184)]&&(console[_0xe87be8(0x10b)](_0xe87be8(0x176)+_0x5ba5c2['name']+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0xe87be8(0x10b)](_0x5ba5c2[_0xe87be8(0x184)]),console[_0xe87be8(0x10b)]('─'['repeat'](0x3c)));}for(const _0x53d68d of _0x123111){_0x53d68d[_0xe87be8(0x184)]&&(console[_0xe87be8(0x10b)](_0xe87be8(0xf6)+_0x53d68d['name']+'\x27:'),console['log']('─'[_0xe87be8(0x173)](0x3c)),console['log'](_0x53d68d[_0xe87be8(0x184)]),console[_0xe87be8(0x10b)]('─'[_0xe87be8(0x173)](0x3c)));}for(const _0xca6c2f of _0x52e1aa){_0xca6c2f[_0xe87be8(0x184)]&&(console['log'](_0xe87be8(0x10e)+_0xca6c2f[_0xe87be8(0x175)]+'\x27:'),console[_0xe87be8(0x10b)]('─'[_0xe87be8(0x173)](0x3c)),console[_0xe87be8(0x10b)](_0xca6c2f[_0xe87be8(0x184)]),console[_0xe87be8(0x10b)]('─'['repeat'](0x3c)));}for(const _0x44f436 of _0x53a010){_0x44f436[_0xe87be8(0x184)]&&(console['log'](_0xe87be8(0x162)+_0x44f436['name']+'\x27:'),console['log']('─'[_0xe87be8(0x173)](0x3c)),console[_0xe87be8(0x10b)](_0x44f436[_0xe87be8(0x184)]),console[_0xe87be8(0x10b)]('─'['repeat'](0x3c)));}for(const _0x20063f of _0x298dfe){_0x20063f['diff']&&(console[_0xe87be8(0x10b)](_0xe87be8(0x139)+_0x20063f[_0xe87be8(0x175)]+'\x27:'),console[_0xe87be8(0x10b)]('─'[_0xe87be8(0x173)](0x3c)),console[_0xe87be8(0x10b)](_0x20063f[_0xe87be8(0x184)]),console[_0xe87be8(0x10b)]('─'[_0xe87be8(0x173)](0x3c)));}for(const _0xf8f82b of _0xb5d7b3){_0xf8f82b[_0xe87be8(0x184)]&&(console[_0xe87be8(0x10b)]('\x0aChanges\x20to\x20chat\x20interface\x20\x27'+_0xf8f82b[_0xe87be8(0x175)]+'\x27:'),console[_0xe87be8(0x10b)]('─'['repeat'](0x3c)),console[_0xe87be8(0x10b)](_0xf8f82b[_0xe87be8(0x184)]),console[_0xe87be8(0x10b)]('─'['repeat'](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x3cfd04(0x175)]=a4_0x3cfd04(0x109);['description']='Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files';async[a4_0x3cfd04(0x16f)](_0x4cc588){const _0xfd2304=a4_0x3cfd04,{options:_0x4681b0,args:_0x49d6a8,tdx:_0x1e667f}=_0x4cc588,_0x31dde1=_0x49d6a8[0x0],_0x43f8db=_0x49d6a8[0x1],_0x4648d7=_0x4681b0[_0xfd2304(0x104)],_0x1c9d55=_0x4681b0[_0xfd2304(0x17b)],_0x546ed6=_0x4681b0[_0xfd2304(0x15c)],_0x5d7cdb=_0x4681b0[_0xfd2304(0x17e)],_0x15fd5b=_0x4681b0[_0xfd2304(0x101)],_0x5d1429=_0x4681b0[_0xfd2304(0x140)];let _0x1449c4;if(_0x31dde1){const _0x4ccd1a=a4_0x230193[_0xfd2304(0x171)](_0x31dde1,_0xfd2304(0xf9));if(existsSync(_0x4ccd1a))try{const _0x22299a=JSON[_0xfd2304(0x111)](readFileSync(_0x4ccd1a,_0xfd2304(0x14d)));_0x22299a[_0xfd2304(0x158)]&&(_0x1449c4={'llm_project':_0x22299a[_0xfd2304(0x158)]});}catch{}}const _0x1d728a=findAgentConfigPath(process[_0xfd2304(0x150)]());let _0x2b4128;if(_0x1d728a)try{const _0x2920a0=JSON[_0xfd2304(0x111)](readFileSync(_0x1d728a,'utf-8'));_0x2920a0[_0xfd2304(0x158)]&&(_0x2b4128={'llm_project':_0x2920a0[_0xfd2304(0x158)]});}catch{}const _0x34b383=resolveAgentPullArgs({'arg':_0x31dde1,'agentNameArg':_0x43f8db,'agentFlag':_0x5d1429,'contextProject':_0x15fd5b,'argDirConfig':_0x1449c4,'cwdConfigPath':_0x1d728a||undefined,'cwdConfig':_0x2b4128}),{projectNameOrId:_0x3256d8,targetAgentName:_0x34cb9b,existingOutputDir:_0x485c1b,source:_0x1f19f5}=_0x34b383;if(_0x1f19f5===_0xfd2304(0x144))console['log'](a4_0x399678['dim'](_0xfd2304(0x114)+a4_0x230193[_0xfd2304(0x171)](_0x31dde1,_0xfd2304(0xf9))+':\x20'+_0x3256d8));else{if(_0x1f19f5===_0xfd2304(0x16a))console[_0xfd2304(0x10b)](a4_0x399678[_0xfd2304(0x156)](_0xfd2304(0x13e)+_0x3256d8));else _0x1f19f5==='context'&&console[_0xfd2304(0x10b)](a4_0x399678[_0xfd2304(0x156)](_0xfd2304(0x149)+_0x3256d8));}if(!_0x3256d8)return _0x5d1429?(console[_0xfd2304(0x10b)](a4_0x399678[_0xfd2304(0x14a)](_0xfd2304(0xd0))),console[_0xfd2304(0x10b)](_0xfd2304(0xdf)),console[_0xfd2304(0x10b)](_0xfd2304(0xee))):(console[_0xfd2304(0x10b)](a4_0x399678[_0xfd2304(0x14a)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0xfd2304(0x10b)](_0xfd2304(0x125)),console[_0xfd2304(0x10b)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project'),console[_0xfd2304(0x10b)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory'),console['log'](_0xfd2304(0x160)),console[_0xfd2304(0x10b)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project')),0x1;if(_0x34cb9b){const {data:_0x2dccb2}=await withSpinner('Pulling\x20agent\x20\x22'+_0x34cb9b+_0xfd2304(0x103)+_0x3256d8+_0xfd2304(0xdb),()=>_0x1e667f[_0xfd2304(0xe6)][_0xfd2304(0xfd)](_0x3256d8,_0x34cb9b,_0x4648d7,{'dryRun':_0x1c9d55,'force':_0x546ed6}));if(_0x1c9d55)return console['log'](a4_0x399678[_0xfd2304(0x14a)](_0xfd2304(0x11d))),console[_0xfd2304(0x10b)](_0xfd2304(0x129)+_0x2dccb2['agentName']),console['log']('Output\x20path:\x20'+_0x2dccb2[_0xfd2304(0x14c)]),_0x2dccb2['diff']&&(console[_0xfd2304(0x10b)](_0xfd2304(0x177)),console['log']('─'[_0xfd2304(0x173)](0x3c)),console['log'](_0x2dccb2[_0xfd2304(0x184)]),console['log']('─'[_0xfd2304(0x173)](0x3c))),0x0;return console[_0xfd2304(0x10b)](a4_0x399678[_0xfd2304(0x17c)]('Agent\x20pulled\x20successfully')),console['log'](_0xfd2304(0x133)+_0x2dccb2['agentName']),console['log'](_0xfd2304(0x154)+_0x2dccb2[_0xfd2304(0x14c)]),console[_0xfd2304(0x10b)]('Status:\x20'+(_0x2dccb2[_0xfd2304(0xe2)]?a4_0x399678[_0xfd2304(0x17c)](_0xfd2304(0x18b)):_0x2dccb2[_0xfd2304(0x141)]?a4_0x399678[_0xfd2304(0x14a)]('updated'):a4_0x399678[_0xfd2304(0x167)](_0xfd2304(0x17d)))),0x0;}const _0x41d53f=_0x485c1b||_0x4648d7,{data:_0x3d6454}=await withSpinner('Analyzing\x20project\x20\x22'+_0x3256d8+'\x22...',()=>_0x1e667f[_0xfd2304(0xe6)]['pullProject'](_0x3256d8,_0x41d53f,{'dryRun':!![]})),_0x24902c=_0x3d6454[_0xfd2304(0x108)]['agents']['new']+_0x3d6454[_0xfd2304(0x108)][_0xfd2304(0xe1)]['new']+_0x3d6454['counts']['textKnowledgeBases'][_0xfd2304(0x18b)]+_0x3d6454[_0xfd2304(0x108)][_0xfd2304(0xe0)][_0xfd2304(0x18b)]+_0x3d6454[_0xfd2304(0x108)][_0xfd2304(0xf5)][_0xfd2304(0x18b)]+_0x3d6454[_0xfd2304(0x108)][_0xfd2304(0x142)][_0xfd2304(0x18b)]+_0x3d6454[_0xfd2304(0x108)][_0xfd2304(0x159)][_0xfd2304(0x18b)]+_0x3d6454[_0xfd2304(0x108)][_0xfd2304(0x151)][_0xfd2304(0x18b)]+_0x3d6454[_0xfd2304(0x108)][_0xfd2304(0x152)][_0xfd2304(0x18b)],_0x37517c=_0x3d6454[_0xfd2304(0x108)][_0xfd2304(0x130)][_0xfd2304(0x161)]+_0x3d6454[_0xfd2304(0x108)][_0xfd2304(0xe1)][_0xfd2304(0x161)]+_0x3d6454[_0xfd2304(0x108)][_0xfd2304(0xf7)][_0xfd2304(0x161)]+_0x3d6454[_0xfd2304(0x108)]['prompts'][_0xfd2304(0x161)]+_0x3d6454[_0xfd2304(0x108)][_0xfd2304(0xf5)][_0xfd2304(0x161)]+_0x3d6454[_0xfd2304(0x108)]['experimentalKnowledgeBases'][_0xfd2304(0x161)]+_0x3d6454[_0xfd2304(0x108)][_0xfd2304(0x159)][_0xfd2304(0x161)]+_0x3d6454[_0xfd2304(0x108)][_0xfd2304(0x151)][_0xfd2304(0x161)]+_0x3d6454[_0xfd2304(0x108)][_0xfd2304(0x152)][_0xfd2304(0x161)],_0x4672e8=_0x3d6454[_0xfd2304(0x108)]['agents'][_0xfd2304(0x17d)]+_0x3d6454[_0xfd2304(0x108)]['knowledgeBases'][_0xfd2304(0x17d)]+_0x3d6454[_0xfd2304(0x108)]['textKnowledgeBases'][_0xfd2304(0x17d)]+_0x3d6454[_0xfd2304(0x108)][_0xfd2304(0xe0)][_0xfd2304(0x17d)]+_0x3d6454[_0xfd2304(0x108)]['integrations']['unchanged']+_0x3d6454[_0xfd2304(0x108)][_0xfd2304(0x142)][_0xfd2304(0x17d)]+_0x3d6454[_0xfd2304(0x108)][_0xfd2304(0x159)][_0xfd2304(0x17d)]+_0x3d6454[_0xfd2304(0x108)]['formInterfaces']['unchanged']+_0x3d6454['counts'][_0xfd2304(0x152)][_0xfd2304(0x17d)];console['log']('\x0aPull\x20summary\x20for\x20\x27'+_0x3d6454[_0xfd2304(0x100)]+'\x27:'),console['log']('\x20\x20'+a4_0x399678['green']('+\x20'+_0x24902c+_0xfd2304(0x138))+_0xfd2304(0x11f)+a4_0x399678['yellow']('~\x20'+_0x37517c+'\x20changed')+'\x20|\x20'+a4_0x399678['dim']('=\x20'+_0x4672e8+_0xfd2304(0xda))),console['log'](_0xfd2304(0x17a)+formatCountSummary(_0x3d6454[_0xfd2304(0x108)][_0xfd2304(0x130)])),console[_0xfd2304(0x10b)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x3d6454[_0xfd2304(0x108)][_0xfd2304(0xe1)])),console['log'](_0xfd2304(0x143)+formatCountSummary(_0x3d6454[_0xfd2304(0x108)]['textKnowledgeBases'])),console[_0xfd2304(0x10b)](_0xfd2304(0x186)+formatCountSummary(_0x3d6454[_0xfd2304(0x108)][_0xfd2304(0xe0)])),console[_0xfd2304(0x10b)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x3d6454[_0xfd2304(0x108)][_0xfd2304(0xf5)])),console['log'](_0xfd2304(0xf2)+formatCountSummary(_0x3d6454[_0xfd2304(0x108)][_0xfd2304(0x151)])),console['log'](_0xfd2304(0xeb)+formatCountSummary(_0x3d6454['counts'][_0xfd2304(0x152)]));const _0x136099=_0x3d6454['counts'][_0xfd2304(0x142)][_0xfd2304(0x157)]>0x0||_0x3d6454[_0xfd2304(0x108)][_0xfd2304(0x159)][_0xfd2304(0x157)]>0x0;_0x136099&&(console[_0xfd2304(0x10b)](_0xfd2304(0xf0)+formatCountSummary(_0x3d6454['counts']['experimentalKnowledgeBases'])),console[_0xfd2304(0x10b)](_0xfd2304(0x119)+formatCountSummary(_0x3d6454[_0xfd2304(0x108)]['experimentalArtifacts'])));console[_0xfd2304(0x10b)]('\x20\x20Target:\x20'+a4_0x399678[_0xfd2304(0x118)](_0x3d6454[_0xfd2304(0xf8)])),displayDiffs(_0x3d6454[_0xfd2304(0x130)],_0x3d6454[_0xfd2304(0xe1)],_0x3d6454[_0xfd2304(0xf7)],_0x3d6454[_0xfd2304(0xe0)],_0x3d6454[_0xfd2304(0xf5)],_0x3d6454[_0xfd2304(0x142)],_0x3d6454[_0xfd2304(0x159)],_0x3d6454[_0xfd2304(0x151)],_0x3d6454[_0xfd2304(0x152)]);if(_0x1c9d55)return console[_0xfd2304(0x10b)](a4_0x399678[_0xfd2304(0x14a)](_0xfd2304(0xd4))),0x0;if(_0x24902c===0x0&&_0x37517c===0x0)return console[_0xfd2304(0x10b)](a4_0x399678['green'](_0xfd2304(0x185))),saveSessionContext({'llm_project':_0x3d6454[_0xfd2304(0x100)]},_0x4681b0['session']),console['log'](a4_0x399678[_0xfd2304(0x17c)](_0xfd2304(0x16d)+a4_0x399678['dim'](_0xfd2304(0x158))+_0xfd2304(0x179)+a4_0x399678[_0xfd2304(0x118)](_0x3d6454[_0xfd2304(0x100)]))),0x0;if(!_0x5d7cdb&&!_0x546ed6){if(!isInteractive())return console[_0xfd2304(0x183)](a4_0x399678[_0xfd2304(0xe7)]('\x0aError:'),_0xfd2304(0xe4)),console[_0xfd2304(0x183)](a4_0x399678[_0xfd2304(0x156)](_0xfd2304(0x12f))),0x1;const _0x221e5=await confirmKey('\x0aWrite\x20'+(_0x24902c+_0x37517c)+'\x20files?');if(!_0x221e5)return console[_0xfd2304(0x10b)](a4_0x399678['yellow'](_0xfd2304(0xdd)),'-\x20no\x20files\x20written'),0x1;}const {data:_0x2bac69}=await withSpinner(_0xfd2304(0xef),()=>_0x1e667f['llm']['pullProject'](_0x3256d8,_0x41d53f,{'force':_0x546ed6}));return console[_0xfd2304(0x10b)](a4_0x399678[_0xfd2304(0x17c)](_0xfd2304(0xd3)+(_0x24902c+_0x37517c)+_0xfd2304(0xea)+_0x2bac69[_0xfd2304(0xf8)])),saveSessionContext({'llm_project':_0x2bac69['projectName']},_0x4681b0[_0xfd2304(0x10a)]),console['log'](a4_0x399678['green'](_0xfd2304(0x16d)+a4_0x399678['dim']('llm_project')+'\x20=\x20'+a4_0x399678[_0xfd2304(0x118)](_0x2bac69[_0xfd2304(0x100)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x3cfd04(0x175)]='agent:clone';[a4_0x3cfd04(0x18c)]=a4_0x3cfd04(0x181);async[a4_0x3cfd04(0x16f)](_0x4fb4e2){const _0x2fc20d=a4_0x3cfd04,{options:_0x3f8137,args:_0x538a2f,tdx:_0x5086d6}=_0x4fb4e2,_0x43d0a8=_0x538a2f[0x0],_0x30d3a2=_0x3f8137[_0x2fc20d(0x175)],_0x31fc15=_0x3f8137[_0x2fc20d(0x17b)],_0x480349=_0x3f8137[_0x2fc20d(0x17e)],_0x41bbba=_0x3f8137[_0x2fc20d(0x123)],_0x5b2691=_0x3f8137[_0x2fc20d(0x101)];let _0xc60680;const _0x1e2a01=findAgentConfigPath(process['cwd']());if(_0x43d0a8){const _0xd7226e=a4_0x230193[_0x2fc20d(0x171)](_0x43d0a8,'tdx.json');existsSync(_0xd7226e)?(_0xc60680=_0x43d0a8,console[_0x2fc20d(0x10b)](a4_0x399678[_0x2fc20d(0x156)](_0x2fc20d(0x16c)+_0x43d0a8))):_0xc60680=_0x43d0a8;}else{if(_0x1e2a01)_0xc60680=a4_0x230193[_0x2fc20d(0x189)](_0x1e2a01),console[_0x2fc20d(0x10b)](a4_0x399678[_0x2fc20d(0x156)](_0x2fc20d(0x102)+_0xc60680));else{if(_0x5b2691){const _0x40e196=sanitizeForFilesystem(_0x5b2691);let _0x4488fb=_0x40e196,_0x2988e3=a4_0x230193[_0x2fc20d(0x171)](process['cwd'](),_0x2fc20d(0x130),_0x40e196,_0x2fc20d(0xf9));if(!existsSync(_0x2988e3)){const _0x4647a2=normalizeName(_0x5b2691),_0x4b6c6c=a4_0x230193[_0x2fc20d(0x171)](process[_0x2fc20d(0x150)](),_0x2fc20d(0x130),_0x4647a2,_0x2fc20d(0xf9));existsSync(_0x4b6c6c)&&(_0x4488fb=_0x4647a2,_0x2988e3=_0x4b6c6c);}if(existsSync(_0x2988e3))_0xc60680=a4_0x230193[_0x2fc20d(0x189)](_0x2988e3),console[_0x2fc20d(0x10b)](a4_0x399678['dim'](_0x2fc20d(0x16c)+_0xc60680));else{const _0x4b29d2=_0x3f8137['profile'];if(_0x4b29d2)throw new SDKError(ErrorCode[_0x2fc20d(0x169)],_0x2fc20d(0xe8)+_0x5b2691+_0x2fc20d(0x124),undefined,{'helpText':_0x2fc20d(0x135)+_0x2fc20d(0x131)+(_0x2fc20d(0xe3)+_0x5b2691+'\x0a')+(_0x2fc20d(0x172)+_0x4488fb+_0x2fc20d(0x166)+(_0x30d3a2||_0x2fc20d(0xed))+_0x2fc20d(0x146)+_0x4b29d2)});_0xc60680=_0x5b2691,console[_0x2fc20d(0x10b)](a4_0x399678[_0x2fc20d(0x156)](_0x2fc20d(0xd5)+_0x5b2691));}}}}if(!_0xc60680)return console['log'](a4_0x399678[_0x2fc20d(0x14a)](_0x2fc20d(0x10d))),console[_0x2fc20d(0x10b)]('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console[_0x2fc20d(0x10b)](_0x2fc20d(0xfe)),console[_0x2fc20d(0x10b)]('\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)'),console['log'](_0x2fc20d(0x16b)),0x1;if(!_0x30d3a2)throw new SDKError(ErrorCode[_0x2fc20d(0x188)],'New\x20project\x20name\x20is\x20required',undefined,{'helpText':_0x2fc20d(0x147)});if(!_0x480349&&!_0x31fc15){if(!isInteractive())return console[_0x2fc20d(0x183)](a4_0x399678[_0x2fc20d(0xe7)](_0x2fc20d(0x10f)),_0x2fc20d(0xe4)),console['error'](a4_0x399678[_0x2fc20d(0x156)](_0x2fc20d(0x12f))),0x1;const _0x3ccbbc=await confirmKey(_0x2fc20d(0xd7)+_0xc60680+_0x2fc20d(0xd1)+_0x30d3a2+'\x22?');if(!_0x3ccbbc)return console[_0x2fc20d(0x10b)](a4_0x399678['yellow'](_0x2fc20d(0xdd))),0x1;}const {data:_0xb5a3d0}=await withSpinner('Cloning\x20\x22'+_0xc60680+_0x2fc20d(0x15b)+_0x30d3a2+'\x22...',()=>_0x5086d6['llm'][_0x2fc20d(0x115)](_0xc60680,_0x30d3a2,{'dryRun':_0x31fc15}));if(_0x31fc15){console[_0x2fc20d(0x10b)](a4_0x399678[_0x2fc20d(0x14a)](_0x2fc20d(0x122))),console[_0x2fc20d(0x10b)](_0x2fc20d(0x17f)+_0xb5a3d0[_0x2fc20d(0x12b)]),console[_0x2fc20d(0x10b)](_0x2fc20d(0xfc)+_0x30d3a2),console[_0x2fc20d(0x10b)](_0x2fc20d(0xde)),console[_0x2fc20d(0x10b)](_0x2fc20d(0x17a)+_0xb5a3d0[_0x2fc20d(0x108)][_0x2fc20d(0x130)][_0x2fc20d(0x165)]),console[_0x2fc20d(0x10b)](_0x2fc20d(0x105)+_0xb5a3d0[_0x2fc20d(0x108)][_0x2fc20d(0xe1)][_0x2fc20d(0x165)]),console[_0x2fc20d(0x10b)](_0x2fc20d(0x186)+_0xb5a3d0['counts']['prompts'][_0x2fc20d(0x165)]),console[_0x2fc20d(0x10b)]('\x20\x20Form\x20Interfaces:\x20'+_0xb5a3d0[_0x2fc20d(0x108)][_0x2fc20d(0x151)][_0x2fc20d(0x165)]),console[_0x2fc20d(0x10b)](_0x2fc20d(0xeb)+_0xb5a3d0[_0x2fc20d(0x108)][_0x2fc20d(0x152)]['created']);const _0x13bfd4=_0xb5a3d0[_0x2fc20d(0x108)][_0x2fc20d(0x142)][_0x2fc20d(0x165)]>0x0||_0xb5a3d0[_0x2fc20d(0x108)]['experimentalArtifacts'][_0x2fc20d(0x165)]>0x0;return _0x13bfd4&&(console[_0x2fc20d(0x10b)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+_0xb5a3d0[_0x2fc20d(0x108)][_0x2fc20d(0x142)][_0x2fc20d(0x165)]),console[_0x2fc20d(0x10b)](_0x2fc20d(0x119)+_0xb5a3d0[_0x2fc20d(0x108)]['experimentalArtifacts']['created'])),0x0;}const _0x5af332=_0xb5a3d0[_0x2fc20d(0x108)][_0x2fc20d(0x130)][_0x2fc20d(0x180)]>0x0||_0xb5a3d0[_0x2fc20d(0x108)][_0x2fc20d(0xe1)]['errors']>0x0||_0xb5a3d0[_0x2fc20d(0x108)][_0x2fc20d(0xe0)][_0x2fc20d(0x180)]>0x0||_0xb5a3d0[_0x2fc20d(0x108)][_0x2fc20d(0x151)][_0x2fc20d(0x180)]>0x0||_0xb5a3d0[_0x2fc20d(0x108)][_0x2fc20d(0x152)][_0x2fc20d(0x180)]>0x0||_0xb5a3d0[_0x2fc20d(0x108)][_0x2fc20d(0x142)]['errors']>0x0||_0xb5a3d0[_0x2fc20d(0x108)]['experimentalArtifacts']['errors']>0x0;_0x5af332?console['log'](a4_0x399678['yellow']('Project\x20cloned\x20with\x20errors')):console['log'](a4_0x399678[_0x2fc20d(0x17c)](_0x2fc20d(0x15e)));console[_0x2fc20d(0x10b)](_0x2fc20d(0x17f)+_0xb5a3d0[_0x2fc20d(0x12b)]),console['log'](_0x2fc20d(0xfc)+_0xb5a3d0['newProjectName']),console[_0x2fc20d(0x10b)](_0x2fc20d(0x15a)+_0xb5a3d0['newProjectId']),console[_0x2fc20d(0x10b)](),console[_0x2fc20d(0x10b)](_0x2fc20d(0x12c)),console['log'](_0x2fc20d(0x17a)+formatCountSummary(_0xb5a3d0[_0x2fc20d(0x108)][_0x2fc20d(0x130)])),console['log'](_0x2fc20d(0x105)+formatCountSummary(_0xb5a3d0[_0x2fc20d(0x108)]['knowledgeBases'])),console[_0x2fc20d(0x10b)]('\x20\x20Prompts:\x20'+formatCountSummary(_0xb5a3d0[_0x2fc20d(0x108)]['prompts'])),console[_0x2fc20d(0x10b)](_0x2fc20d(0x145)+formatCountSummary(_0xb5a3d0[_0x2fc20d(0x108)][_0x2fc20d(0xf5)])),console[_0x2fc20d(0x10b)](_0x2fc20d(0xf2)+formatCountSummary(_0xb5a3d0['counts']['formInterfaces'])),console['log']('\x20\x20Chat\x20Interfaces:\x20'+formatCountSummary(_0xb5a3d0['counts'][_0x2fc20d(0x152)]));const _0x8f591a=_0xb5a3d0[_0x2fc20d(0x108)]['experimentalKnowledgeBases']['created']>0x0||_0xb5a3d0[_0x2fc20d(0x108)][_0x2fc20d(0x142)][_0x2fc20d(0x161)]>0x0||_0xb5a3d0[_0x2fc20d(0x108)][_0x2fc20d(0x142)]['unchanged']>0x0||_0xb5a3d0[_0x2fc20d(0x108)][_0x2fc20d(0x159)][_0x2fc20d(0x165)]>0x0||_0xb5a3d0[_0x2fc20d(0x108)]['experimentalArtifacts'][_0x2fc20d(0x161)]>0x0||_0xb5a3d0[_0x2fc20d(0x108)][_0x2fc20d(0x159)][_0x2fc20d(0x17d)]>0x0;_0x8f591a&&(console[_0x2fc20d(0x10b)](_0x2fc20d(0xf0)+formatCountSummary(_0xb5a3d0[_0x2fc20d(0x108)][_0x2fc20d(0x142)])),console[_0x2fc20d(0x10b)](_0x2fc20d(0x119)+formatCountSummary(_0xb5a3d0['counts']['experimentalArtifacts'])));if(_0x5af332){console['log'](),console[_0x2fc20d(0x10b)](a4_0x399678['red'](_0x2fc20d(0x178)));for(const _0x2a23db of _0xb5a3d0[_0x2fc20d(0x130)]){_0x2a23db['action']===_0x2fc20d(0x183)&&console[_0x2fc20d(0x10b)](a4_0x399678['red'](_0x2fc20d(0x174)+_0x2a23db[_0x2fc20d(0x10c)]+_0x2fc20d(0xd9)+_0x2a23db['error']));}for(const _0x3eb8d7 of _0xb5a3d0[_0x2fc20d(0xe1)]){_0x3eb8d7[_0x2fc20d(0x168)]==='error'&&console[_0x2fc20d(0x10b)](a4_0x399678[_0x2fc20d(0xe7)](_0x2fc20d(0x187)+_0x3eb8d7[_0x2fc20d(0x175)]+_0x2fc20d(0xd9)+_0x3eb8d7[_0x2fc20d(0x183)]));}for(const _0x32cce9 of _0xb5a3d0['prompts']){_0x32cce9[_0x2fc20d(0x168)]===_0x2fc20d(0x183)&&console[_0x2fc20d(0x10b)](a4_0x399678[_0x2fc20d(0xe7)](_0x2fc20d(0x18a)+_0x32cce9[_0x2fc20d(0x175)]+'\x22:\x20'+_0x32cce9['error']));}for(const _0x1b29e3 of _0xb5a3d0['integrations']){_0x1b29e3[_0x2fc20d(0x168)]===_0x2fc20d(0x183)&&console[_0x2fc20d(0x10b)](a4_0x399678[_0x2fc20d(0xe7)]('\x20\x20Integration\x20\x22'+_0x1b29e3[_0x2fc20d(0x175)]+_0x2fc20d(0xd9)+_0x1b29e3[_0x2fc20d(0x183)]));}for(const _0x5dca34 of _0xb5a3d0[_0x2fc20d(0x151)]){_0x5dca34[_0x2fc20d(0x168)]===_0x2fc20d(0x183)&&console['log'](a4_0x399678[_0x2fc20d(0xe7)](_0x2fc20d(0x15f)+_0x5dca34[_0x2fc20d(0x175)]+_0x2fc20d(0xd9)+_0x5dca34[_0x2fc20d(0x183)]));}for(const _0x5d9407 of _0xb5a3d0['chatInterfaces']){_0x5d9407['action']===_0x2fc20d(0x183)&&console[_0x2fc20d(0x10b)](a4_0x399678['red'](_0x2fc20d(0x11b)+_0x5d9407[_0x2fc20d(0x175)]+_0x2fc20d(0xd9)+_0x5d9407[_0x2fc20d(0x183)]));}for(const _0x3bff77 of _0xb5a3d0[_0x2fc20d(0x142)]){_0x3bff77[_0x2fc20d(0x168)]===_0x2fc20d(0x183)&&console[_0x2fc20d(0x10b)](a4_0x399678[_0x2fc20d(0xe7)]('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0x3bff77[_0x2fc20d(0x175)]+'\x22:\x20'+_0x3bff77[_0x2fc20d(0x183)]));}for(const _0x44f98f of _0xb5a3d0['experimentalArtifacts']){_0x44f98f['action']==='error'&&console[_0x2fc20d(0x10b)](a4_0x399678[_0x2fc20d(0xe7)](_0x2fc20d(0x14b)+_0x44f98f[_0x2fc20d(0x175)]+'\x22:\x20'+_0x44f98f[_0x2fc20d(0x183)]));}return 0x1;}console[_0x2fc20d(0x10b)]();const _0x22794c=getLLMProjectUrl(_0x41bbba,_0xb5a3d0[_0x2fc20d(0x14e)]);return console[_0x2fc20d(0x10b)](_0x2fc20d(0x137)+a4_0x399678[_0x2fc20d(0x118)](_0x22794c)),0x0;}}function a4_0x80b4(){const _0x3c4910=['Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','prompts','knowledgeBases','isNew','\x20\x20tdx\x20agent\x20pull\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','llm','red','Cannot\x20clone\x20from\x20context\x20project\x20\x22','110jnMZsK','\x20files\x20to\x20','\x20\x20Chat\x20Interfaces:\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','<new-name>','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','Writing\x20files...','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','\x20changed','\x20\x20Form\x20Interfaces:\x20','projectId','Analyzing\x20changes\x20to\x20push...','integrations','\x0aChanges\x20to\x20integration\x20\x27','textKnowledgeBases','outputDir','tdx.json','push','\x20updated','New\x20project:\x20','pullAgent','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','\x20resources\x20to\x20\x27','projectName','llmProject','Using\x20current\x20project:\x20','\x22\x20from\x20project\x20\x22','output','\x20\x20Knowledge\x20Bases:\x20','Failed\x20to\x20push\x20agent:\x20','\x0aProject\x20pushed\x20with\x20errors','counts','agent:pull','session','log','agentName','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x0aError:','agentId','parse','\x0aPush\x20','270830YHdWcX','Using\x20project\x20from\x20','cloneProject','\x20successfully','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','cyan','\x20\x20Experimental\x20Artifacts:\x20','agent:push','\x20\x20Chat\x20Interface\x20\x22','\x20\x20Source:\x20','Dry\x20run\x20-\x20no\x20files\x20written','736744bdCKht','\x20|\x20','reason','pushProject','Dry\x20run\x20-\x20no\x20changes\x20made','site','\x22\x20to\x20a\x20different\x20profile','Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','context','\x0aPush\x20summary\x20for\x20\x27','source','Would\x20pull\x20agent:\x20','no_context','sourceProjectName','Summary:','2ArUaGL','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','agents','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','message','Agent:\x20','Chat:\x20','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','projectDir','Project:\x20','\x20new','\x0aChanges\x20to\x20form\x20interface\x20\x27','pushAgent','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x20total','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','Using\x20project:\x20','659442BpbsIi','agent','hasChanges','experimentalKnowledgeBases','\x20\x20Text\x20Knowledge\x20Bases:\x20','arg-dir','\x20\x20Integrations:\x20','\x20--profile\x20','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','912760LEcQqr','Using\x20project\x20from\x20context:\x20','yellow','\x20\x20Experimental\x20Artifact\x20\x22','outputPath','utf-8','newProjectId','found','cwd','formInterfaces','chatInterfaces','Agent\x20','Output:\x20','Pushing\x20agent\x20from\x20\x22','dim','total','llm_project','experimentalArtifacts','New\x20project\x20ID:\x20','\x22\x20to\x20\x22','force','Pushing\x20to\x20project...','Project\x20cloned\x20successfully','\x20\x20Form\x20Interface\x20\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project','updated','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','386298SBRHEq','created','\x20--name\x20','gray','action','INVALID_ARGUMENT','cwd-config','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Using\x20local\x20project:\x20','✔\x20Context\x20set:\x20','1422294oCtwnH','execute','-\x20nothing\x20pushed','join','\x20\x20tdx\x20agent\x20clone\x20agents/','repeat','\x20\x20Agent\x20\x22','name','\x0aChanges\x20to\x20prompt\x20\x27','\x0aChanges:','Errors:','\x20=\x20','\x20\x20Agents:\x20','dryRun','green','unchanged','yes','Source:\x20','errors','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','14nuzvEW','error','diff','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','\x20\x20Prompts:\x20','\x20\x20Knowledge\x20Base\x20\x22','MISSING_ARGUMENT','dirname','\x20\x20Prompt\x20\x22','new','description','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','\x22\x20to\x20new\x20project\x20\x22','\x20resources?','\x0a✔\x20Pulled\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Using\x20context\x20project:\x20','Would\x20push\x20agent:\x20','Clone\x20\x22','335635YgFzsy','\x22:\x20','\x20unchanged','\x22...','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','Cancelled','Would\x20clone:'];a4_0x80b4=function(){return _0x3c4910;};return a4_0x80b4();}export class AgentPushCommand extends BaseCommand{[a4_0x3cfd04(0x175)]=a4_0x3cfd04(0x11a);[a4_0x3cfd04(0x18c)]=a4_0x3cfd04(0x163);async['execute'](_0x59a2f4){const _0x22dbb9=a4_0x3cfd04,{options:_0x48f752,args:_0xcb0e69,tdx:_0xc0567}=_0x59a2f4;let _0x126655=_0xcb0e69[0x0]||process[_0x22dbb9(0x150)]();const _0x9486cb=_0x48f752[_0x22dbb9(0x17b)],_0xaf372e=_0x48f752[_0x22dbb9(0x15c)],_0x61ea1e=_0x48f752[_0x22dbb9(0x17e)],_0x4a7d13=_0x48f752[_0x22dbb9(0x123)],_0x3c296d=a4_0x230193[_0x22dbb9(0x171)](_0x126655,'agent.yml'),_0x51de13=existsSync(_0x3c296d);if(_0x51de13){const {data:_0x3c5670}=await withSpinner(_0x22dbb9(0x155)+_0x126655+_0x22dbb9(0xdb),()=>_0xc0567[_0x22dbb9(0xe6)][_0x22dbb9(0x13a)](_0x126655,{'dryRun':_0x9486cb,'force':_0xaf372e}));if(_0x9486cb)return console[_0x22dbb9(0x10b)](a4_0x399678[_0x22dbb9(0x14a)](_0x22dbb9(0x122))),console[_0x22dbb9(0x10b)](_0x22dbb9(0xd6)+_0x3c5670['agentName']),0x0;if(_0x3c5670[_0x22dbb9(0x168)]===_0x22dbb9(0x183))return console[_0x22dbb9(0x10b)](a4_0x399678[_0x22dbb9(0xe7)](_0x22dbb9(0x106)+_0x3c5670[_0x22dbb9(0x183)])),0x1;console['log'](a4_0x399678[_0x22dbb9(0x17c)](_0x22dbb9(0x153)+_0x3c5670[_0x22dbb9(0x168)]+_0x22dbb9(0x116))),console[_0x22dbb9(0x10b)]('Agent:\x20'+_0x3c5670['agentName']);if(_0x3c5670[_0x22dbb9(0x110)]&&_0x3c5670['projectId']){const _0x1044e1=getLLMAgentChatUrl(_0x4a7d13,_0x3c5670[_0x22dbb9(0xf3)],_0x3c5670[_0x22dbb9(0x110)]);console[_0x22dbb9(0x10b)](_0x22dbb9(0x134)+a4_0x399678[_0x22dbb9(0x118)](_0x1044e1));}return 0x0;}const _0x54c9c0=_0x48f752['llmProject'],_0x24e44f=resolveProjectFromContext(_0x126655,_0x54c9c0);if(_0x24e44f[_0x22dbb9(0x14f)])_0x126655=_0x24e44f[_0x22dbb9(0x136)],_0x24e44f[_0x22dbb9(0x128)]===_0x22dbb9(0x126)&&console[_0x22dbb9(0x10b)](a4_0x399678[_0x22dbb9(0x156)](_0x22dbb9(0x13e)+_0x126655));else{let _0x4aea24=_0x22dbb9(0x12e);_0x24e44f[_0x22dbb9(0x120)]==='no_local_folder'&&(_0x4aea24=_0x24e44f[_0x22dbb9(0x132)]+_0x22dbb9(0x117)+_0x24e44f['llmProject']+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode[_0x22dbb9(0x169)],_0x24e44f[_0x22dbb9(0x120)]===_0x22dbb9(0x12a)?_0x24e44f['message']:'No\x20tdx.json\x20found\x20in\x20'+_0x126655,undefined,{'helpText':_0x4aea24});}const {data:_0x1d0283}=await withSpinner(_0x22dbb9(0xf4),()=>_0xc0567[_0x22dbb9(0xe6)][_0x22dbb9(0x121)](_0x126655,{'dryRun':!![]})),_0xd9bd69=_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0x130)][_0x22dbb9(0x180)]>0x0;if(_0xd9bd69){console['log'](a4_0x399678[_0x22dbb9(0xe7)]('\x0aErrors\x20found:'));for(const _0x4ade0b of _0x1d0283['agents']){_0x4ade0b[_0x22dbb9(0x168)]==='error'&&console[_0x22dbb9(0x10b)](a4_0x399678[_0x22dbb9(0xe7)](_0x22dbb9(0x174)+_0x4ade0b[_0x22dbb9(0x10c)]+_0x22dbb9(0xd9)+_0x4ade0b[_0x22dbb9(0x183)]));}return 0x1;}const _0x4c1c9a=_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0x130)][_0x22dbb9(0x165)]+_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0xe1)][_0x22dbb9(0x165)]+_0x1d0283['counts'][_0x22dbb9(0xf7)][_0x22dbb9(0x165)]+_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0xe0)]['created']+_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0xf5)][_0x22dbb9(0x165)]+_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0x142)][_0x22dbb9(0x165)]+_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0x159)][_0x22dbb9(0x165)]+_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0x151)][_0x22dbb9(0x165)]+_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0x152)][_0x22dbb9(0x165)],_0x207d43=_0x1d0283['counts'][_0x22dbb9(0x130)][_0x22dbb9(0x161)]+_0x1d0283[_0x22dbb9(0x108)]['knowledgeBases'][_0x22dbb9(0x161)]+_0x1d0283['counts'][_0x22dbb9(0xf7)][_0x22dbb9(0x161)]+_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0xe0)][_0x22dbb9(0x161)]+_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0xf5)][_0x22dbb9(0x161)]+_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0x142)][_0x22dbb9(0x161)]+_0x1d0283['counts'][_0x22dbb9(0x159)][_0x22dbb9(0x161)]+_0x1d0283['counts'][_0x22dbb9(0x151)][_0x22dbb9(0x161)]+_0x1d0283['counts'][_0x22dbb9(0x152)]['updated'],_0x305bf0=_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0x130)][_0x22dbb9(0x17d)]+_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0xe1)][_0x22dbb9(0x17d)]+_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0xf7)]['unchanged']+_0x1d0283['counts'][_0x22dbb9(0xe0)]['unchanged']+_0x1d0283['counts'][_0x22dbb9(0xf5)]['unchanged']+_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0x142)]['unchanged']+_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0x159)]['unchanged']+_0x1d0283[_0x22dbb9(0x108)]['formInterfaces'][_0x22dbb9(0x17d)]+_0x1d0283['counts'][_0x22dbb9(0x152)]['unchanged'];console[_0x22dbb9(0x10b)](_0x22dbb9(0x127)+_0x1d0283['projectName']+'\x27:'),console[_0x22dbb9(0x10b)]('\x20\x20'+a4_0x399678[_0x22dbb9(0x17c)]('+\x20'+_0x4c1c9a+_0x22dbb9(0x138))+_0x22dbb9(0x11f)+a4_0x399678[_0x22dbb9(0x14a)]('~\x20'+_0x207d43+_0x22dbb9(0xf1))+_0x22dbb9(0x11f)+a4_0x399678[_0x22dbb9(0x156)]('=\x20'+_0x305bf0+_0x22dbb9(0xda))),console[_0x22dbb9(0x10b)](_0x22dbb9(0x17a)+formatCountSummary(_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0x130)])),console[_0x22dbb9(0x10b)](_0x22dbb9(0x105)+formatCountSummary(_0x1d0283[_0x22dbb9(0x108)]['knowledgeBases'])),console[_0x22dbb9(0x10b)](_0x22dbb9(0x143)+formatCountSummary(_0x1d0283[_0x22dbb9(0x108)]['textKnowledgeBases'])),console[_0x22dbb9(0x10b)](_0x22dbb9(0x186)+formatCountSummary(_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0xe0)])),console['log'](_0x22dbb9(0x145)+formatCountSummary(_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0xf5)])),console['log'](_0x22dbb9(0xf2)+formatCountSummary(_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0x151)])),console[_0x22dbb9(0x10b)]('\x20\x20Chat\x20Interfaces:\x20'+formatCountSummary(_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0x152)]));const _0x32119d=_0x1d0283['counts'][_0x22dbb9(0x142)]['created']>0x0||_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0x142)][_0x22dbb9(0x161)]>0x0||_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0x142)][_0x22dbb9(0x17d)]>0x0||_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0x159)][_0x22dbb9(0x165)]>0x0||_0x1d0283[_0x22dbb9(0x108)]['experimentalArtifacts'][_0x22dbb9(0x161)]>0x0||_0x1d0283[_0x22dbb9(0x108)]['experimentalArtifacts'][_0x22dbb9(0x17d)]>0x0;_0x32119d&&(console[_0x22dbb9(0x10b)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x1d0283['counts'][_0x22dbb9(0x142)])),console[_0x22dbb9(0x10b)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x1d0283[_0x22dbb9(0x108)][_0x22dbb9(0x159)])));console[_0x22dbb9(0x10b)](_0x22dbb9(0x11c)+a4_0x399678[_0x22dbb9(0x118)](_0x126655)),displayDiffs(_0x1d0283['agents'],_0x1d0283[_0x22dbb9(0xe1)],_0x1d0283[_0x22dbb9(0xf7)],_0x1d0283[_0x22dbb9(0xe0)],_0x1d0283[_0x22dbb9(0xf5)],_0x1d0283[_0x22dbb9(0x142)],_0x1d0283['experimentalArtifacts'],_0x1d0283[_0x22dbb9(0x151)],_0x1d0283[_0x22dbb9(0x152)]);if(_0x9486cb)return console[_0x22dbb9(0x10b)](a4_0x399678[_0x22dbb9(0x14a)](_0x22dbb9(0xec))),0x0;if(_0x4c1c9a===0x0&&_0x207d43===0x0){console[_0x22dbb9(0x10b)](a4_0x399678[_0x22dbb9(0x17c)](_0x22dbb9(0x13d)));const _0x4b5e75=getLLMProjectUrl(_0x4a7d13,_0x1d0283[_0x22dbb9(0xf3)]);return console['log'](_0x22dbb9(0x137)+a4_0x399678[_0x22dbb9(0x118)](_0x4b5e75)),0x0;}if(!_0x61ea1e&&!_0xaf372e){if(!isInteractive())return console[_0x22dbb9(0x183)](a4_0x399678[_0x22dbb9(0xe7)](_0x22dbb9(0x10f)),_0x22dbb9(0xe4)),console[_0x22dbb9(0x183)](a4_0x399678[_0x22dbb9(0x156)](_0x22dbb9(0x12f))),0x1;const _0x5dde6c=await confirmKey(_0x22dbb9(0x112)+(_0x4c1c9a+_0x207d43)+_0x22dbb9(0xd2));if(!_0x5dde6c)return console[_0x22dbb9(0x10b)](a4_0x399678['yellow'](_0x22dbb9(0xdd)),_0x22dbb9(0x170)),0x1;}const {data:_0xf1cd69}=await withSpinner(_0x22dbb9(0x15d),()=>_0xc0567[_0x22dbb9(0xe6)][_0x22dbb9(0x121)](_0x126655,{'force':_0xaf372e})),_0x563e62=_0xf1cd69[_0x22dbb9(0x108)]['agents'][_0x22dbb9(0x180)]>0x0||_0xf1cd69[_0x22dbb9(0x108)][_0x22dbb9(0xe1)][_0x22dbb9(0x180)]>0x0||_0xf1cd69[_0x22dbb9(0x108)][_0x22dbb9(0xf7)][_0x22dbb9(0x180)]>0x0||_0xf1cd69['counts']['prompts'][_0x22dbb9(0x180)]>0x0||_0xf1cd69[_0x22dbb9(0x108)][_0x22dbb9(0x151)][_0x22dbb9(0x180)]>0x0||_0xf1cd69[_0x22dbb9(0x108)][_0x22dbb9(0x152)]['errors']>0x0;if(_0x563e62){console['log'](a4_0x399678[_0x22dbb9(0x14a)](_0x22dbb9(0x107))),console[_0x22dbb9(0x10b)](),console[_0x22dbb9(0x10b)](a4_0x399678[_0x22dbb9(0xe7)](_0x22dbb9(0x178)));for(const _0x720087 of _0xf1cd69[_0x22dbb9(0x130)]){_0x720087['action']===_0x22dbb9(0x183)&&console[_0x22dbb9(0x10b)](a4_0x399678[_0x22dbb9(0xe7)](_0x22dbb9(0x174)+_0x720087['agentName']+_0x22dbb9(0xd9)+_0x720087[_0x22dbb9(0x183)]));}for(const _0x4d5a33 of _0xf1cd69['knowledgeBases']){_0x4d5a33['action']==='error'&&console['log'](a4_0x399678['red']('\x20\x20Knowledge\x20Base\x20\x22'+_0x4d5a33[_0x22dbb9(0x175)]+'\x22:\x20'+_0x4d5a33[_0x22dbb9(0x183)]));}for(const _0x5eecc8 of _0xf1cd69[_0x22dbb9(0xf7)]){_0x5eecc8[_0x22dbb9(0x168)]===_0x22dbb9(0x183)&&console['log'](a4_0x399678['red'](_0x22dbb9(0x13b)+_0x5eecc8[_0x22dbb9(0x175)]+'\x22:\x20'+_0x5eecc8['error']));}for(const _0x3cc3e3 of _0xf1cd69[_0x22dbb9(0xe0)]){_0x3cc3e3[_0x22dbb9(0x168)]==='error'&&console[_0x22dbb9(0x10b)](a4_0x399678[_0x22dbb9(0xe7)](_0x22dbb9(0x18a)+_0x3cc3e3[_0x22dbb9(0x175)]+_0x22dbb9(0xd9)+_0x3cc3e3[_0x22dbb9(0x183)]));}for(const _0x4918b7 of _0xf1cd69[_0x22dbb9(0xf5)]){_0x4918b7[_0x22dbb9(0x168)]===_0x22dbb9(0x183)&&console[_0x22dbb9(0x10b)](a4_0x399678['red']('\x20\x20Integration\x20\x22'+_0x4918b7[_0x22dbb9(0x175)]+_0x22dbb9(0xd9)+_0x4918b7[_0x22dbb9(0x183)]));}for(const _0x769fb9 of _0xf1cd69[_0x22dbb9(0x151)]){_0x769fb9[_0x22dbb9(0x168)]===_0x22dbb9(0x183)&&console[_0x22dbb9(0x10b)](a4_0x399678[_0x22dbb9(0xe7)]('\x20\x20Form\x20Interface\x20\x22'+_0x769fb9['name']+'\x22:\x20'+_0x769fb9[_0x22dbb9(0x183)]));}for(const _0x41c74c of _0xf1cd69[_0x22dbb9(0x152)]){_0x41c74c['action']===_0x22dbb9(0x183)&&console['log'](a4_0x399678[_0x22dbb9(0xe7)](_0x22dbb9(0x11b)+_0x41c74c[_0x22dbb9(0x175)]+'\x22:\x20'+_0x41c74c[_0x22dbb9(0x183)]));}return 0x1;}console[_0x22dbb9(0x10b)](a4_0x399678[_0x22dbb9(0x17c)]('\x0a✔\x20Pushed\x20'+(_0x4c1c9a+_0x207d43)+_0x22dbb9(0xff)+_0xf1cd69[_0x22dbb9(0x100)]+'\x27'));const _0xd30ef2=getLLMProjectUrl(_0x4a7d13,_0xf1cd69['projectId']);return console['log'](_0x22dbb9(0x137)+a4_0x399678[_0x22dbb9(0x118)](_0xd30ef2)),0x0;}}
|
|
1
|
+
function a4_0x1b2b(_0x77fc8,_0x250269){_0x77fc8=_0x77fc8-0xfc;const _0x15597c=a4_0x1559();let _0x1b2bfc=_0x15597c[_0x77fc8];return _0x1b2bfc;}function a4_0x1559(){const _0x1371dc=['force','utf-8','New\x20project\x20ID:\x20','Output\x20path:\x20','\x20\x20Text\x20Knowledge\x20Base\x20\x22','description','\x20=\x20','60DcsBDF','red','tdx.json','Cloning\x20\x22','isNew','\x22\x20to\x20\x22','39TLlDCX','Source:\x20','\x20\x20Integration\x20\x22','Agent:\x20','Pulling\x20agent\x20\x22','execute','\x20\x20Text\x20Knowledge\x20Bases:\x20','log','experimentalArtifacts','\x20files?','chatInterfaces','\x20--name\x20','16764790hdrWOE','\x20\x20tdx\x20agent\x20pull\x20','reason','\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','\x20updated','pullAgent','Using\x20context\x20project:\x20','newProjectId','\x0aError:','pullProject','output','\x20\x20Knowledge\x20Bases:\x20','Chat:\x20','\x0aWrite\x20','created','join','llm_project','agents','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','\x20\x20Form\x20Interfaces:\x20','dirname','New\x20project:\x20','agentName','unchanged','source','\x0aChanges\x20to\x20chat\x20interface\x20\x27','agent.yml','total','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','llmProject','projectName','\x20\x20Experimental\x20Artifacts:\x20','updated','Cancelled','\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)','projectId','Status:\x20','INVALID_ARGUMENT','\x20\x20Agent\x20\x22','\x22...','Errors:','\x20\x20Prompts:\x20','Using\x20project\x20from\x20','\x22\x20to\x20new\x20project\x20\x22','225835HxOvTK','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','✔\x20Context\x20set:\x20','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','agent:push','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','Project:\x20','diff','\x22:\x20','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','Summary:','repeat','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','green','\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','\x0aPull\x20summary\x20for\x20\x27','New\x20project\x20name\x20is\x20required','6458607TVdlbH','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','\x0aChanges\x20to\x20integration\x20\x27','\x20\x20Chat\x20Interfaces:\x20','\x20\x20tdx\x20agent\x20clone\x20agents/','\x27\x20to\x20create\x20the\x20folder\x20structure.','outputPath','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','Dry\x20run\x20-\x20no\x20changes\x20made','451493pvDIdu','-\x20nothing\x20pushed','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','found','\x0a✔\x20Pushed\x20','MISSING_ARGUMENT','agentId','\x20\x20Source:\x20','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','Using\x20local\x20project:\x20','3539336bkCVlh','agent:clone','outputDir','2iNdjNT','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','Using\x20project:\x20','parse','sourceProjectName','cyan','error','\x20unchanged','\x22\x20to\x20a\x20different\x20profile','cwd','profile','integrations','prompts','\x20resources\x20to\x20\x27','Pushing\x20to\x20project...','\x20changed','\x20|\x20','Analyzing\x20project\x20\x22','\x20\x20Form\x20Interface\x20\x22','new','no_local_folder','\x20\x20Agents:\x20','\x20errors','arg-dir','pushProject','1279795zAksvw','formInterfaces','agent:pull','\x20\x20Chat\x20Interface\x20\x22','errors','Project\x20cloned\x20successfully','gray','112632NEnsAW','\x20new','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','knowledgeBases','textKnowledgeBases','\x0aProject\x20pushed\x20with\x20errors','Clone\x20\x22','cloneProject','Agent\x20pulled\x20successfully','pushAgent','site','Writing\x20files...','context','\x20--profile\x20','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','Using\x20current\x20project:\x20','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','newProjectName','\x20\x20Prompt\x20\x22','\x20successfully','Project\x20cloned\x20with\x20errors','\x0aChanges\x20to\x20prompt\x20\x27','session','yes','dim','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','push','Analyzing\x20changes\x20to\x20push...','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','<new-name>','\x20\x20Integrations:\x20','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','Would\x20pull\x20agent:\x20','\x20\x20Knowledge\x20Base\x20\x22','message','\x20resources?','\x22\x20from\x20project\x20\x22','dryRun','yellow','Failed\x20to\x20push\x20agent:\x20','action','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','llm','experimentalKnowledgeBases','Would\x20clone:','name','\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','counts','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','no_context','-\x20no\x20files\x20written','Using\x20project\x20from\x20context:\x20','cwd-config'];a4_0x1559=function(){return _0x1371dc;};return a4_0x1559();}const a4_0x586001=a4_0x1b2b;(function(_0x101ac4,_0x44749c){const _0x2710d8=a4_0x1b2b,_0x3dbe72=_0x101ac4();while(!![]){try{const _0x12a629=-parseInt(_0x2710d8(0x127))/0x1*(-parseInt(_0x2710d8(0x14e))/0x2)+parseInt(_0x2710d8(0x1b1))/0x3*(-parseInt(_0x2710d8(0x16e))/0x4)+-parseInt(_0x2710d8(0x167))/0x5+parseInt(_0x2710d8(0x1ab))/0x6*(-parseInt(_0x2710d8(0x141))/0x7)+parseInt(_0x2710d8(0x14b))/0x8+-parseInt(_0x2710d8(0x138))/0x9+parseInt(_0x2710d8(0x1bd))/0xa;if(_0x12a629===_0x44749c)break;else _0x3dbe72['push'](_0x3dbe72['shift']());}catch(_0x14ca92){_0x3dbe72['push'](_0x3dbe72['shift']());}}}(a4_0x1559,0x57ea9));import a4_0x1c7c1e from'chalk';import a4_0x3d9f65 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x15632b){const _0x36f2e8=a4_0x1b2b,_0x56dd4e=[];if(_0x15632b[_0x36f2e8(0x116)]!==undefined)_0x56dd4e[_0x36f2e8(0x189)](_0x15632b[_0x36f2e8(0x116)]+'\x20total');if(_0x15632b[_0x36f2e8(0x161)]!==undefined&&_0x15632b[_0x36f2e8(0x161)]>0x0)_0x56dd4e[_0x36f2e8(0x189)](a4_0x1c7c1e['green'](_0x15632b['new']+_0x36f2e8(0x16f)));if(_0x15632b[_0x36f2e8(0x109)]!==undefined&&_0x15632b[_0x36f2e8(0x109)]>0x0)_0x56dd4e[_0x36f2e8(0x189)](a4_0x1c7c1e['green'](_0x15632b[_0x36f2e8(0x109)]+'\x20created'));if(_0x15632b[_0x36f2e8(0x11b)]!==undefined&&_0x15632b['updated']>0x0)_0x56dd4e[_0x36f2e8(0x189)](a4_0x1c7c1e[_0x36f2e8(0x195)](_0x15632b[_0x36f2e8(0x11b)]+_0x36f2e8(0xff)));if(_0x15632b[_0x36f2e8(0x112)]!==undefined&&_0x15632b['unchanged']>0x0)_0x56dd4e[_0x36f2e8(0x189)](a4_0x1c7c1e[_0x36f2e8(0x16d)](_0x15632b[_0x36f2e8(0x112)]+_0x36f2e8(0x155)));if(_0x15632b[_0x36f2e8(0x16b)]!==undefined&&_0x15632b[_0x36f2e8(0x16b)]>0x0)_0x56dd4e[_0x36f2e8(0x189)](a4_0x1c7c1e[_0x36f2e8(0x1ac)](_0x15632b['errors']+_0x36f2e8(0x164)));return _0x56dd4e[_0x36f2e8(0x10a)](',\x20');}function displayDiffs(_0x1569be,_0x405a65,_0x50f142,_0x3872b5,_0x26c43d,_0x566734,_0x3f8ef3,_0x2d373e,_0x42e72b){const _0x11ec0f=a4_0x1b2b;for(const _0x37ab43 of _0x1569be){if(_0x37ab43['diff']){const _0x194ed2=_0x37ab43[_0x11ec0f(0x111)]||_0x37ab43['name'];console['log']('\x0aChanges\x20to\x20agent\x20\x27'+_0x194ed2+'\x27:'),console[_0x11ec0f(0x1b8)]('─'['repeat'](0x3c)),console[_0x11ec0f(0x1b8)](_0x37ab43['diff']),console[_0x11ec0f(0x1b8)]('─'['repeat'](0x3c));}}for(const _0x190d05 of _0x405a65){_0x190d05[_0x11ec0f(0x12e)]&&(console['log'](_0x11ec0f(0x17d)+_0x190d05[_0x11ec0f(0x19c)]+'\x27:'),console[_0x11ec0f(0x1b8)]('─'[_0x11ec0f(0x132)](0x3c)),console['log'](_0x190d05[_0x11ec0f(0x12e)]),console['log']('─'['repeat'](0x3c)));}for(const _0x501286 of _0x50f142){_0x501286['diff']&&(console[_0x11ec0f(0x1b8)]('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x501286['name']+'\x27:'),console[_0x11ec0f(0x1b8)]('─'['repeat'](0x3c)),console[_0x11ec0f(0x1b8)](_0x501286['diff']),console[_0x11ec0f(0x1b8)]('─'[_0x11ec0f(0x132)](0x3c)));}for(const _0x255bf9 of _0x3872b5){_0x255bf9[_0x11ec0f(0x12e)]&&(console['log'](_0x11ec0f(0x184)+_0x255bf9[_0x11ec0f(0x19c)]+'\x27:'),console[_0x11ec0f(0x1b8)]('─'[_0x11ec0f(0x132)](0x3c)),console[_0x11ec0f(0x1b8)](_0x255bf9['diff']),console[_0x11ec0f(0x1b8)]('─'['repeat'](0x3c)));}for(const _0x2ffbf8 of _0x26c43d){_0x2ffbf8[_0x11ec0f(0x12e)]&&(console[_0x11ec0f(0x1b8)](_0x11ec0f(0x13a)+_0x2ffbf8[_0x11ec0f(0x19c)]+'\x27:'),console[_0x11ec0f(0x1b8)]('─'[_0x11ec0f(0x132)](0x3c)),console['log'](_0x2ffbf8[_0x11ec0f(0x12e)]),console[_0x11ec0f(0x1b8)]('─'[_0x11ec0f(0x132)](0x3c)));}for(const _0xebd549 of _0x566734){_0xebd549[_0x11ec0f(0x12e)]&&(console[_0x11ec0f(0x1b8)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0xebd549[_0x11ec0f(0x19c)]+'\x27:'),console[_0x11ec0f(0x1b8)]('─'[_0x11ec0f(0x132)](0x3c)),console['log'](_0xebd549['diff']),console[_0x11ec0f(0x1b8)]('─'[_0x11ec0f(0x132)](0x3c)));}for(const _0x254512 of _0x3f8ef3){_0x254512[_0x11ec0f(0x12e)]&&(console['log'](_0x11ec0f(0x143)+_0x254512[_0x11ec0f(0x19c)]+'\x27:'),console[_0x11ec0f(0x1b8)]('─'[_0x11ec0f(0x132)](0x3c)),console['log'](_0x254512[_0x11ec0f(0x12e)]),console[_0x11ec0f(0x1b8)]('─'[_0x11ec0f(0x132)](0x3c)));}for(const _0x4e3418 of _0x2d373e){_0x4e3418[_0x11ec0f(0x12e)]&&(console[_0x11ec0f(0x1b8)]('\x0aChanges\x20to\x20form\x20interface\x20\x27'+_0x4e3418[_0x11ec0f(0x19c)]+'\x27:'),console[_0x11ec0f(0x1b8)]('─'[_0x11ec0f(0x132)](0x3c)),console['log'](_0x4e3418[_0x11ec0f(0x12e)]),console[_0x11ec0f(0x1b8)]('─'[_0x11ec0f(0x132)](0x3c)));}for(const _0x58c629 of _0x42e72b){_0x58c629['diff']&&(console[_0x11ec0f(0x1b8)](_0x11ec0f(0x114)+_0x58c629['name']+'\x27:'),console[_0x11ec0f(0x1b8)]('─'['repeat'](0x3c)),console['log'](_0x58c629[_0x11ec0f(0x12e)]),console[_0x11ec0f(0x1b8)]('─'[_0x11ec0f(0x132)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x586001(0x19c)]=a4_0x586001(0x169);[a4_0x586001(0x1a9)]=a4_0x586001(0x18b);async[a4_0x586001(0x1b6)](_0x356a53){const _0x4a3da9=a4_0x586001,{options:_0x308b72,args:_0x5c267a,tdx:_0x121896}=_0x356a53,_0x39013c=_0x5c267a[0x0],_0x44591d=_0x5c267a[0x1],_0x13473c=_0x308b72[_0x4a3da9(0x105)],_0x2c042f=_0x308b72[_0x4a3da9(0x194)],_0x2d8e6a=_0x308b72['force'],_0x5f3f56=_0x308b72[_0x4a3da9(0x186)],_0x455af3=_0x308b72['llmProject'],_0xe20339=_0x308b72['agent'];let _0x3ab151;if(_0x39013c){const _0x342f30=a4_0x3d9f65[_0x4a3da9(0x10a)](_0x39013c,_0x4a3da9(0x1ad));if(existsSync(_0x342f30))try{const _0x8056a0=JSON[_0x4a3da9(0x151)](readFileSync(_0x342f30,_0x4a3da9(0x1a5)));_0x8056a0[_0x4a3da9(0x10b)]&&(_0x3ab151={'llm_project':_0x8056a0[_0x4a3da9(0x10b)]});}catch{}}const _0xf0410b=findAgentConfigPath(process[_0x4a3da9(0x157)]());let _0x136c6e;if(_0xf0410b)try{const _0x55bf4b=JSON[_0x4a3da9(0x151)](readFileSync(_0xf0410b,_0x4a3da9(0x1a5)));_0x55bf4b[_0x4a3da9(0x10b)]&&(_0x136c6e={'llm_project':_0x55bf4b[_0x4a3da9(0x10b)]});}catch{}const _0x3a6bc6=resolveAgentPullArgs({'arg':_0x39013c,'agentNameArg':_0x44591d,'agentFlag':_0xe20339,'contextProject':_0x455af3,'argDirConfig':_0x3ab151,'cwdConfigPath':_0xf0410b||undefined,'cwdConfig':_0x136c6e}),{projectNameOrId:_0x3e4236,targetAgentName:_0x46eaaa,existingOutputDir:_0x25b9a3,source:_0x3a30a8}=_0x3a6bc6;if(_0x3a30a8===_0x4a3da9(0x165))console[_0x4a3da9(0x1b8)](a4_0x1c7c1e[_0x4a3da9(0x187)](_0x4a3da9(0x125)+a4_0x3d9f65[_0x4a3da9(0x10a)](_0x39013c,_0x4a3da9(0x1ad))+':\x20'+_0x3e4236));else{if(_0x3a30a8===_0x4a3da9(0x1a3))console[_0x4a3da9(0x1b8)](a4_0x1c7c1e[_0x4a3da9(0x187)]('Using\x20project:\x20'+_0x3e4236));else _0x3a30a8==='context'&&console['log'](a4_0x1c7c1e[_0x4a3da9(0x187)](_0x4a3da9(0x1a2)+_0x3e4236));}if(!_0x3e4236)return _0xe20339?(console[_0x4a3da9(0x1b8)](a4_0x1c7c1e['yellow'](_0x4a3da9(0x139))),console['log'](_0x4a3da9(0x117)),console[_0x4a3da9(0x1b8)]('Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>')):(console[_0x4a3da9(0x1b8)](a4_0x1c7c1e[_0x4a3da9(0x195)](_0x4a3da9(0x12c))),console[_0x4a3da9(0x1b8)]('Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x4a3da9(0x1b8)](_0x4a3da9(0xfe)),console[_0x4a3da9(0x1b8)](_0x4a3da9(0x135)),console['log']('\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[_0x4a3da9(0x1b8)](_0x4a3da9(0x19d))),0x1;if(_0x46eaaa){const {data:_0x24c598}=await withSpinner(_0x4a3da9(0x1b5)+_0x46eaaa+_0x4a3da9(0x193)+_0x3e4236+_0x4a3da9(0x122),()=>_0x121896['llm'][_0x4a3da9(0x100)](_0x3e4236,_0x46eaaa,_0x13473c,{'dryRun':_0x2c042f,'force':_0x2d8e6a}));if(_0x2c042f)return console[_0x4a3da9(0x1b8)](a4_0x1c7c1e['yellow']('Dry\x20run\x20-\x20no\x20files\x20written')),console[_0x4a3da9(0x1b8)](_0x4a3da9(0x18f)+_0x24c598['agentName']),console[_0x4a3da9(0x1b8)](_0x4a3da9(0x1a7)+_0x24c598[_0x4a3da9(0x13e)]),_0x24c598[_0x4a3da9(0x12e)]&&(console[_0x4a3da9(0x1b8)]('\x0aChanges:'),console['log']('─'[_0x4a3da9(0x132)](0x3c)),console[_0x4a3da9(0x1b8)](_0x24c598['diff']),console[_0x4a3da9(0x1b8)]('─'['repeat'](0x3c))),0x0;return console[_0x4a3da9(0x1b8)](a4_0x1c7c1e[_0x4a3da9(0x134)](_0x4a3da9(0x177))),console[_0x4a3da9(0x1b8)](_0x4a3da9(0x1b4)+_0x24c598[_0x4a3da9(0x111)]),console[_0x4a3da9(0x1b8)]('Output:\x20'+_0x24c598[_0x4a3da9(0x13e)]),console[_0x4a3da9(0x1b8)](_0x4a3da9(0x11f)+(_0x24c598[_0x4a3da9(0x1af)]?a4_0x1c7c1e[_0x4a3da9(0x134)](_0x4a3da9(0x161)):_0x24c598['hasChanges']?a4_0x1c7c1e[_0x4a3da9(0x195)](_0x4a3da9(0x11b)):a4_0x1c7c1e[_0x4a3da9(0x16d)](_0x4a3da9(0x112)))),0x0;}const _0x23b0fa=_0x25b9a3||_0x13473c,{data:_0x376971}=await withSpinner(_0x4a3da9(0x15f)+_0x3e4236+'\x22...',()=>_0x121896[_0x4a3da9(0x199)]['pullProject'](_0x3e4236,_0x23b0fa,{'dryRun':!![]})),_0x1af6e5=_0x376971[_0x4a3da9(0x19e)][_0x4a3da9(0x10c)][_0x4a3da9(0x161)]+_0x376971[_0x4a3da9(0x19e)][_0x4a3da9(0x172)]['new']+_0x376971[_0x4a3da9(0x19e)][_0x4a3da9(0x173)][_0x4a3da9(0x161)]+_0x376971[_0x4a3da9(0x19e)][_0x4a3da9(0x15a)][_0x4a3da9(0x161)]+_0x376971[_0x4a3da9(0x19e)][_0x4a3da9(0x159)]['new']+_0x376971[_0x4a3da9(0x19e)][_0x4a3da9(0x19a)]['new']+_0x376971[_0x4a3da9(0x19e)]['experimentalArtifacts']['new']+_0x376971[_0x4a3da9(0x19e)]['formInterfaces'][_0x4a3da9(0x161)]+_0x376971[_0x4a3da9(0x19e)]['chatInterfaces'][_0x4a3da9(0x161)],_0x1ce596=_0x376971[_0x4a3da9(0x19e)][_0x4a3da9(0x10c)][_0x4a3da9(0x11b)]+_0x376971[_0x4a3da9(0x19e)][_0x4a3da9(0x172)]['updated']+_0x376971[_0x4a3da9(0x19e)][_0x4a3da9(0x173)]['updated']+_0x376971[_0x4a3da9(0x19e)][_0x4a3da9(0x15a)][_0x4a3da9(0x11b)]+_0x376971['counts']['integrations']['updated']+_0x376971[_0x4a3da9(0x19e)]['experimentalKnowledgeBases'][_0x4a3da9(0x11b)]+_0x376971['counts'][_0x4a3da9(0x1b9)][_0x4a3da9(0x11b)]+_0x376971[_0x4a3da9(0x19e)]['formInterfaces'][_0x4a3da9(0x11b)]+_0x376971[_0x4a3da9(0x19e)][_0x4a3da9(0x1bb)][_0x4a3da9(0x11b)],_0x595be6=_0x376971[_0x4a3da9(0x19e)][_0x4a3da9(0x10c)][_0x4a3da9(0x112)]+_0x376971[_0x4a3da9(0x19e)]['knowledgeBases'][_0x4a3da9(0x112)]+_0x376971[_0x4a3da9(0x19e)][_0x4a3da9(0x173)][_0x4a3da9(0x112)]+_0x376971[_0x4a3da9(0x19e)]['prompts'][_0x4a3da9(0x112)]+_0x376971[_0x4a3da9(0x19e)]['integrations']['unchanged']+_0x376971[_0x4a3da9(0x19e)][_0x4a3da9(0x19a)][_0x4a3da9(0x112)]+_0x376971['counts'][_0x4a3da9(0x1b9)][_0x4a3da9(0x112)]+_0x376971[_0x4a3da9(0x19e)][_0x4a3da9(0x168)]['unchanged']+_0x376971[_0x4a3da9(0x19e)][_0x4a3da9(0x1bb)][_0x4a3da9(0x112)];console[_0x4a3da9(0x1b8)](_0x4a3da9(0x136)+_0x376971[_0x4a3da9(0x119)]+'\x27:'),console[_0x4a3da9(0x1b8)]('\x20\x20'+a4_0x1c7c1e['green']('+\x20'+_0x1af6e5+'\x20new')+_0x4a3da9(0x15e)+a4_0x1c7c1e[_0x4a3da9(0x195)]('~\x20'+_0x1ce596+_0x4a3da9(0x15d))+_0x4a3da9(0x15e)+a4_0x1c7c1e[_0x4a3da9(0x187)]('=\x20'+_0x595be6+_0x4a3da9(0x155))),console['log']('\x20\x20Agents:\x20'+formatCountSummary(_0x376971[_0x4a3da9(0x19e)][_0x4a3da9(0x10c)])),console[_0x4a3da9(0x1b8)](_0x4a3da9(0x106)+formatCountSummary(_0x376971[_0x4a3da9(0x19e)]['knowledgeBases'])),console[_0x4a3da9(0x1b8)](_0x4a3da9(0x1b7)+formatCountSummary(_0x376971[_0x4a3da9(0x19e)][_0x4a3da9(0x173)])),console[_0x4a3da9(0x1b8)](_0x4a3da9(0x124)+formatCountSummary(_0x376971['counts'][_0x4a3da9(0x15a)])),console[_0x4a3da9(0x1b8)]('\x20\x20Integrations:\x20'+formatCountSummary(_0x376971[_0x4a3da9(0x19e)][_0x4a3da9(0x159)])),console[_0x4a3da9(0x1b8)](_0x4a3da9(0x10e)+formatCountSummary(_0x376971[_0x4a3da9(0x19e)][_0x4a3da9(0x168)])),console[_0x4a3da9(0x1b8)](_0x4a3da9(0x13b)+formatCountSummary(_0x376971[_0x4a3da9(0x19e)]['chatInterfaces']));const _0x16a6d1=_0x376971[_0x4a3da9(0x19e)][_0x4a3da9(0x19a)][_0x4a3da9(0x116)]>0x0||_0x376971[_0x4a3da9(0x19e)]['experimentalArtifacts'][_0x4a3da9(0x116)]>0x0;_0x16a6d1&&(console['log'](_0x4a3da9(0x10d)+formatCountSummary(_0x376971[_0x4a3da9(0x19e)]['experimentalKnowledgeBases'])),console[_0x4a3da9(0x1b8)](_0x4a3da9(0x11a)+formatCountSummary(_0x376971['counts'][_0x4a3da9(0x1b9)])));console[_0x4a3da9(0x1b8)]('\x20\x20Target:\x20'+a4_0x1c7c1e['cyan'](_0x376971[_0x4a3da9(0x14d)])),displayDiffs(_0x376971[_0x4a3da9(0x10c)],_0x376971[_0x4a3da9(0x172)],_0x376971['textKnowledgeBases'],_0x376971['prompts'],_0x376971[_0x4a3da9(0x159)],_0x376971['experimentalKnowledgeBases'],_0x376971[_0x4a3da9(0x1b9)],_0x376971[_0x4a3da9(0x168)],_0x376971[_0x4a3da9(0x1bb)]);if(_0x2c042f)return console[_0x4a3da9(0x1b8)](a4_0x1c7c1e['yellow']('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x1af6e5===0x0&&_0x1ce596===0x0)return console[_0x4a3da9(0x1b8)](a4_0x1c7c1e[_0x4a3da9(0x134)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x376971['projectName']},_0x308b72[_0x4a3da9(0x185)]),console[_0x4a3da9(0x1b8)](a4_0x1c7c1e[_0x4a3da9(0x134)](_0x4a3da9(0x129)+a4_0x1c7c1e[_0x4a3da9(0x187)]('llm_project')+'\x20=\x20'+a4_0x1c7c1e['cyan'](_0x376971[_0x4a3da9(0x119)]))),0x0;if(!_0x5f3f56&&!_0x2d8e6a){if(!isInteractive())return console[_0x4a3da9(0x154)](a4_0x1c7c1e[_0x4a3da9(0x1ac)](_0x4a3da9(0x103)),_0x4a3da9(0x128)),console[_0x4a3da9(0x154)](a4_0x1c7c1e[_0x4a3da9(0x187)](_0x4a3da9(0x19f))),0x1;const _0x125d0c=await confirmKey(_0x4a3da9(0x108)+(_0x1af6e5+_0x1ce596)+_0x4a3da9(0x1ba));if(!_0x125d0c)return console[_0x4a3da9(0x1b8)](a4_0x1c7c1e[_0x4a3da9(0x195)](_0x4a3da9(0x11c)),_0x4a3da9(0x1a1)),0x1;}const {data:_0x2e474f}=await withSpinner(_0x4a3da9(0x17a),()=>_0x121896[_0x4a3da9(0x199)][_0x4a3da9(0x104)](_0x3e4236,_0x23b0fa,{'force':_0x2d8e6a}));return console[_0x4a3da9(0x1b8)](a4_0x1c7c1e[_0x4a3da9(0x134)]('\x0a✔\x20Pulled\x20'+(_0x1af6e5+_0x1ce596)+'\x20files\x20to\x20'+_0x2e474f[_0x4a3da9(0x14d)])),saveSessionContext({'llm_project':_0x2e474f[_0x4a3da9(0x119)]},_0x308b72[_0x4a3da9(0x185)]),console[_0x4a3da9(0x1b8)](a4_0x1c7c1e[_0x4a3da9(0x134)](_0x4a3da9(0x129)+a4_0x1c7c1e[_0x4a3da9(0x187)]('llm_project')+_0x4a3da9(0x1aa)+a4_0x1c7c1e[_0x4a3da9(0x153)](_0x2e474f['projectName']))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x586001(0x19c)]=a4_0x586001(0x14c);[a4_0x586001(0x1a9)]=a4_0x586001(0x18e);async['execute'](_0x56fc1f){const _0x434a87=a4_0x586001,{options:_0x5d2a31,args:_0x1f570c,tdx:_0x6ebaab}=_0x56fc1f,_0x27f9df=_0x1f570c[0x0],_0x3e2c89=_0x5d2a31['name'],_0x48f52d=_0x5d2a31['dryRun'],_0x4e2405=_0x5d2a31[_0x434a87(0x186)],_0x12e057=_0x5d2a31[_0x434a87(0x179)],_0x3474b9=_0x5d2a31[_0x434a87(0x118)];let _0x5889f1;const _0x4f5b5c=findAgentConfigPath(process[_0x434a87(0x157)]());if(_0x27f9df){const _0xae32c5=a4_0x3d9f65[_0x434a87(0x10a)](_0x27f9df,'tdx.json');existsSync(_0xae32c5)?(_0x5889f1=_0x27f9df,console[_0x434a87(0x1b8)](a4_0x1c7c1e[_0x434a87(0x187)](_0x434a87(0x14a)+_0x27f9df))):_0x5889f1=_0x27f9df;}else{if(_0x4f5b5c)_0x5889f1=a4_0x3d9f65[_0x434a87(0x10f)](_0x4f5b5c),console[_0x434a87(0x1b8)](a4_0x1c7c1e[_0x434a87(0x187)](_0x434a87(0x17e)+_0x5889f1));else{if(_0x3474b9){const _0x4c4e70=sanitizeForFilesystem(_0x3474b9);let _0x486c00=_0x4c4e70,_0x3fca72=a4_0x3d9f65[_0x434a87(0x10a)](process[_0x434a87(0x157)](),_0x434a87(0x10c),_0x4c4e70,'tdx.json');if(!existsSync(_0x3fca72)){const _0x13bdb9=normalizeName(_0x3474b9),_0x814fa3=a4_0x3d9f65['join'](process['cwd'](),_0x434a87(0x10c),_0x13bdb9,_0x434a87(0x1ad));existsSync(_0x814fa3)&&(_0x486c00=_0x13bdb9,_0x3fca72=_0x814fa3);}if(existsSync(_0x3fca72))_0x5889f1=a4_0x3d9f65[_0x434a87(0x10f)](_0x3fca72),console['log'](a4_0x1c7c1e[_0x434a87(0x187)](_0x434a87(0x14a)+_0x5889f1));else{const _0x59cec1=_0x5d2a31[_0x434a87(0x158)];if(_0x59cec1)throw new SDKError(ErrorCode[_0x434a87(0x120)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0x3474b9+_0x434a87(0x156),undefined,{'helpText':_0x434a87(0x188)+_0x434a87(0x198)+(_0x434a87(0xfc)+_0x3474b9+'\x0a')+(_0x434a87(0x13c)+_0x486c00+_0x434a87(0x1bc)+(_0x3e2c89||_0x434a87(0x18c))+_0x434a87(0x17c)+_0x59cec1)});_0x5889f1=_0x3474b9,console[_0x434a87(0x1b8)](a4_0x1c7c1e[_0x434a87(0x187)](_0x434a87(0x101)+_0x3474b9));}}}}if(!_0x5889f1)return console[_0x434a87(0x1b8)](a4_0x1c7c1e[_0x434a87(0x195)](_0x434a87(0x13f))),console[_0x434a87(0x1b8)](_0x434a87(0x12a)),console['log'](_0x434a87(0x149)),console[_0x434a87(0x1b8)](_0x434a87(0x11d)),console[_0x434a87(0x1b8)](_0x434a87(0x133)),0x1;if(!_0x3e2c89)throw new SDKError(ErrorCode[_0x434a87(0x146)],_0x434a87(0x137),undefined,{'helpText':_0x434a87(0x130)});if(!_0x4e2405&&!_0x48f52d){if(!isInteractive())return console[_0x434a87(0x154)](a4_0x1c7c1e['red'](_0x434a87(0x103)),_0x434a87(0x128)),console['error'](a4_0x1c7c1e['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x425d1d=await confirmKey(_0x434a87(0x175)+_0x5889f1+_0x434a87(0x126)+_0x3e2c89+'\x22?');if(!_0x425d1d)return console[_0x434a87(0x1b8)](a4_0x1c7c1e[_0x434a87(0x195)](_0x434a87(0x11c))),0x1;}const {data:_0x18e35d}=await withSpinner(_0x434a87(0x1ae)+_0x5889f1+_0x434a87(0x1b0)+_0x3e2c89+'\x22...',()=>_0x6ebaab[_0x434a87(0x199)][_0x434a87(0x176)](_0x5889f1,_0x3e2c89,{'dryRun':_0x48f52d}));if(_0x48f52d){console[_0x434a87(0x1b8)](a4_0x1c7c1e[_0x434a87(0x195)](_0x434a87(0x140))),console[_0x434a87(0x1b8)](_0x434a87(0x1b2)+_0x18e35d[_0x434a87(0x152)]),console['log'](_0x434a87(0x110)+_0x3e2c89),console[_0x434a87(0x1b8)](_0x434a87(0x19b)),console[_0x434a87(0x1b8)](_0x434a87(0x163)+_0x18e35d[_0x434a87(0x19e)]['agents'][_0x434a87(0x109)]),console[_0x434a87(0x1b8)](_0x434a87(0x106)+_0x18e35d[_0x434a87(0x19e)]['knowledgeBases']['created']),console[_0x434a87(0x1b8)](_0x434a87(0x124)+_0x18e35d[_0x434a87(0x19e)][_0x434a87(0x15a)]['created']),console[_0x434a87(0x1b8)](_0x434a87(0x10e)+_0x18e35d[_0x434a87(0x19e)][_0x434a87(0x168)][_0x434a87(0x109)]),console[_0x434a87(0x1b8)]('\x20\x20Chat\x20Interfaces:\x20'+_0x18e35d[_0x434a87(0x19e)][_0x434a87(0x1bb)]['created']);const _0x44fcd0=_0x18e35d[_0x434a87(0x19e)][_0x434a87(0x19a)]['created']>0x0||_0x18e35d[_0x434a87(0x19e)]['experimentalArtifacts'][_0x434a87(0x109)]>0x0;return _0x44fcd0&&(console['log'](_0x434a87(0x10d)+_0x18e35d[_0x434a87(0x19e)]['experimentalKnowledgeBases'][_0x434a87(0x109)]),console['log'](_0x434a87(0x11a)+_0x18e35d[_0x434a87(0x19e)][_0x434a87(0x1b9)][_0x434a87(0x109)])),0x0;}const _0x3921a9=_0x18e35d[_0x434a87(0x19e)]['agents'][_0x434a87(0x16b)]>0x0||_0x18e35d['counts'][_0x434a87(0x172)][_0x434a87(0x16b)]>0x0||_0x18e35d[_0x434a87(0x19e)][_0x434a87(0x15a)][_0x434a87(0x16b)]>0x0||_0x18e35d[_0x434a87(0x19e)][_0x434a87(0x168)][_0x434a87(0x16b)]>0x0||_0x18e35d[_0x434a87(0x19e)][_0x434a87(0x1bb)][_0x434a87(0x16b)]>0x0||_0x18e35d[_0x434a87(0x19e)][_0x434a87(0x19a)][_0x434a87(0x16b)]>0x0||_0x18e35d[_0x434a87(0x19e)][_0x434a87(0x1b9)][_0x434a87(0x16b)]>0x0;_0x3921a9?console[_0x434a87(0x1b8)](a4_0x1c7c1e[_0x434a87(0x195)](_0x434a87(0x183))):console[_0x434a87(0x1b8)](a4_0x1c7c1e[_0x434a87(0x134)](_0x434a87(0x16c)));console[_0x434a87(0x1b8)](_0x434a87(0x1b2)+_0x18e35d[_0x434a87(0x152)]),console[_0x434a87(0x1b8)](_0x434a87(0x110)+_0x18e35d[_0x434a87(0x180)]),console[_0x434a87(0x1b8)](_0x434a87(0x1a6)+_0x18e35d[_0x434a87(0x102)]),console[_0x434a87(0x1b8)](),console[_0x434a87(0x1b8)](_0x434a87(0x131)),console['log'](_0x434a87(0x163)+formatCountSummary(_0x18e35d['counts'][_0x434a87(0x10c)])),console[_0x434a87(0x1b8)](_0x434a87(0x106)+formatCountSummary(_0x18e35d[_0x434a87(0x19e)][_0x434a87(0x172)])),console['log'](_0x434a87(0x124)+formatCountSummary(_0x18e35d['counts'][_0x434a87(0x15a)])),console[_0x434a87(0x1b8)](_0x434a87(0x18d)+formatCountSummary(_0x18e35d['counts'][_0x434a87(0x159)])),console[_0x434a87(0x1b8)](_0x434a87(0x10e)+formatCountSummary(_0x18e35d[_0x434a87(0x19e)][_0x434a87(0x168)])),console[_0x434a87(0x1b8)](_0x434a87(0x13b)+formatCountSummary(_0x18e35d['counts'][_0x434a87(0x1bb)]));const _0x1c57f2=_0x18e35d[_0x434a87(0x19e)][_0x434a87(0x19a)][_0x434a87(0x109)]>0x0||_0x18e35d['counts'][_0x434a87(0x19a)][_0x434a87(0x11b)]>0x0||_0x18e35d[_0x434a87(0x19e)]['experimentalKnowledgeBases']['unchanged']>0x0||_0x18e35d[_0x434a87(0x19e)][_0x434a87(0x1b9)][_0x434a87(0x109)]>0x0||_0x18e35d['counts'][_0x434a87(0x1b9)][_0x434a87(0x11b)]>0x0||_0x18e35d[_0x434a87(0x19e)]['experimentalArtifacts'][_0x434a87(0x112)]>0x0;_0x1c57f2&&(console['log'](_0x434a87(0x10d)+formatCountSummary(_0x18e35d[_0x434a87(0x19e)][_0x434a87(0x19a)])),console[_0x434a87(0x1b8)](_0x434a87(0x11a)+formatCountSummary(_0x18e35d[_0x434a87(0x19e)][_0x434a87(0x1b9)])));if(_0x3921a9){console[_0x434a87(0x1b8)](),console['log'](a4_0x1c7c1e[_0x434a87(0x1ac)](_0x434a87(0x123)));for(const _0x58c7a0 of _0x18e35d[_0x434a87(0x10c)]){_0x58c7a0[_0x434a87(0x197)]===_0x434a87(0x154)&&console['log'](a4_0x1c7c1e[_0x434a87(0x1ac)](_0x434a87(0x121)+_0x58c7a0[_0x434a87(0x111)]+_0x434a87(0x12f)+_0x58c7a0[_0x434a87(0x154)]));}for(const _0x484d61 of _0x18e35d['knowledgeBases']){_0x484d61[_0x434a87(0x197)]===_0x434a87(0x154)&&console[_0x434a87(0x1b8)](a4_0x1c7c1e[_0x434a87(0x1ac)](_0x434a87(0x190)+_0x484d61['name']+_0x434a87(0x12f)+_0x484d61[_0x434a87(0x154)]));}for(const _0x51092a of _0x18e35d[_0x434a87(0x15a)]){_0x51092a[_0x434a87(0x197)]===_0x434a87(0x154)&&console[_0x434a87(0x1b8)](a4_0x1c7c1e[_0x434a87(0x1ac)](_0x434a87(0x181)+_0x51092a['name']+_0x434a87(0x12f)+_0x51092a[_0x434a87(0x154)]));}for(const _0xb8f772 of _0x18e35d[_0x434a87(0x159)]){_0xb8f772[_0x434a87(0x197)]==='error'&&console[_0x434a87(0x1b8)](a4_0x1c7c1e['red'](_0x434a87(0x1b3)+_0xb8f772[_0x434a87(0x19c)]+'\x22:\x20'+_0xb8f772[_0x434a87(0x154)]));}for(const _0x1af2ae of _0x18e35d['formInterfaces']){_0x1af2ae[_0x434a87(0x197)]===_0x434a87(0x154)&&console['log'](a4_0x1c7c1e['red'](_0x434a87(0x160)+_0x1af2ae[_0x434a87(0x19c)]+_0x434a87(0x12f)+_0x1af2ae[_0x434a87(0x154)]));}for(const _0x28ada7 of _0x18e35d[_0x434a87(0x1bb)]){_0x28ada7['action']===_0x434a87(0x154)&&console[_0x434a87(0x1b8)](a4_0x1c7c1e[_0x434a87(0x1ac)](_0x434a87(0x16a)+_0x28ada7[_0x434a87(0x19c)]+'\x22:\x20'+_0x28ada7[_0x434a87(0x154)]));}for(const _0x37c0b6 of _0x18e35d['experimentalKnowledgeBases']){_0x37c0b6[_0x434a87(0x197)]===_0x434a87(0x154)&&console[_0x434a87(0x1b8)](a4_0x1c7c1e[_0x434a87(0x1ac)](_0x434a87(0x17f)+_0x37c0b6[_0x434a87(0x19c)]+_0x434a87(0x12f)+_0x37c0b6[_0x434a87(0x154)]));}for(const _0x3b87af of _0x18e35d['experimentalArtifacts']){_0x3b87af['action']===_0x434a87(0x154)&&console[_0x434a87(0x1b8)](a4_0x1c7c1e[_0x434a87(0x1ac)]('\x20\x20Experimental\x20Artifact\x20\x22'+_0x3b87af[_0x434a87(0x19c)]+'\x22:\x20'+_0x3b87af[_0x434a87(0x154)]));}return 0x1;}console[_0x434a87(0x1b8)]();const _0x8f415c=getLLMProjectUrl(_0x12e057,_0x18e35d[_0x434a87(0x102)]);return console[_0x434a87(0x1b8)](_0x434a87(0x12d)+a4_0x1c7c1e[_0x434a87(0x153)](_0x8f415c)),0x0;}}export class AgentPushCommand extends BaseCommand{['name']=a4_0x586001(0x12b);[a4_0x586001(0x1a9)]=a4_0x586001(0x14f);async[a4_0x586001(0x1b6)](_0x378111){const _0x45126e=a4_0x586001,{options:_0x7857ec,args:_0x3c4d92,tdx:_0x4e3b9f}=_0x378111;let _0x548e9f=_0x3c4d92[0x0]||process[_0x45126e(0x157)]();const _0x325657=_0x7857ec[_0x45126e(0x194)],_0x4ccb5f=_0x7857ec[_0x45126e(0x1a4)],_0x37cace=_0x7857ec[_0x45126e(0x186)],_0x5f3d44=_0x7857ec[_0x45126e(0x179)],_0x143be3=a4_0x3d9f65['join'](_0x548e9f,_0x45126e(0x115)),_0x52d1b8=existsSync(_0x143be3);if(_0x52d1b8){const {data:_0x358f73}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x548e9f+'\x22...',()=>_0x4e3b9f[_0x45126e(0x199)][_0x45126e(0x178)](_0x548e9f,{'dryRun':_0x325657,'force':_0x4ccb5f}));if(_0x325657)return console[_0x45126e(0x1b8)](a4_0x1c7c1e[_0x45126e(0x195)](_0x45126e(0x140))),console['log']('Would\x20push\x20agent:\x20'+_0x358f73[_0x45126e(0x111)]),0x0;if(_0x358f73[_0x45126e(0x197)]==='error')return console[_0x45126e(0x1b8)](a4_0x1c7c1e[_0x45126e(0x1ac)](_0x45126e(0x196)+_0x358f73[_0x45126e(0x154)])),0x1;console['log'](a4_0x1c7c1e[_0x45126e(0x134)]('Agent\x20'+_0x358f73['action']+_0x45126e(0x182))),console['log'](_0x45126e(0x1b4)+_0x358f73[_0x45126e(0x111)]);if(_0x358f73[_0x45126e(0x147)]&&_0x358f73[_0x45126e(0x11e)]){const _0x30af00=getLLMAgentChatUrl(_0x5f3d44,_0x358f73[_0x45126e(0x11e)],_0x358f73[_0x45126e(0x147)]);console['log'](_0x45126e(0x107)+a4_0x1c7c1e[_0x45126e(0x153)](_0x30af00));}return 0x0;}const _0x2cde61=_0x7857ec[_0x45126e(0x118)],_0xe0c93c=resolveProjectFromContext(_0x548e9f,_0x2cde61);if(_0xe0c93c[_0x45126e(0x144)])_0x548e9f=_0xe0c93c['projectDir'],_0xe0c93c[_0x45126e(0x113)]===_0x45126e(0x17b)&&console[_0x45126e(0x1b8)](a4_0x1c7c1e['dim'](_0x45126e(0x150)+_0x548e9f));else{let _0x4c42b4=_0x45126e(0x170);_0xe0c93c[_0x45126e(0xfd)]===_0x45126e(0x162)&&(_0x4c42b4=_0xe0c93c[_0x45126e(0x191)]+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0xe0c93c[_0x45126e(0x118)]+_0x45126e(0x13d));throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0xe0c93c[_0x45126e(0xfd)]===_0x45126e(0x1a0)?_0xe0c93c[_0x45126e(0x191)]:'No\x20tdx.json\x20found\x20in\x20'+_0x548e9f,undefined,{'helpText':_0x4c42b4});}const {data:_0x3e7ef3}=await withSpinner(_0x45126e(0x18a),()=>_0x4e3b9f['llm'][_0x45126e(0x166)](_0x548e9f,{'dryRun':!![]})),_0x3005b5=_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x10c)][_0x45126e(0x16b)]>0x0;if(_0x3005b5){console[_0x45126e(0x1b8)](a4_0x1c7c1e[_0x45126e(0x1ac)]('\x0aErrors\x20found:'));for(const _0x319749 of _0x3e7ef3['agents']){_0x319749[_0x45126e(0x197)]===_0x45126e(0x154)&&console['log'](a4_0x1c7c1e[_0x45126e(0x1ac)](_0x45126e(0x121)+_0x319749['agentName']+_0x45126e(0x12f)+_0x319749['error']));}return 0x1;}const _0x4f369e=_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x10c)][_0x45126e(0x109)]+_0x3e7ef3[_0x45126e(0x19e)]['knowledgeBases'][_0x45126e(0x109)]+_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x173)][_0x45126e(0x109)]+_0x3e7ef3[_0x45126e(0x19e)]['prompts'][_0x45126e(0x109)]+_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x159)][_0x45126e(0x109)]+_0x3e7ef3[_0x45126e(0x19e)]['experimentalKnowledgeBases'][_0x45126e(0x109)]+_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x1b9)][_0x45126e(0x109)]+_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x168)][_0x45126e(0x109)]+_0x3e7ef3['counts'][_0x45126e(0x1bb)][_0x45126e(0x109)],_0x2b19de=_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x10c)]['updated']+_0x3e7ef3['counts'][_0x45126e(0x172)]['updated']+_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x173)][_0x45126e(0x11b)]+_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x15a)][_0x45126e(0x11b)]+_0x3e7ef3[_0x45126e(0x19e)]['integrations'][_0x45126e(0x11b)]+_0x3e7ef3['counts']['experimentalKnowledgeBases']['updated']+_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x1b9)]['updated']+_0x3e7ef3[_0x45126e(0x19e)]['formInterfaces']['updated']+_0x3e7ef3[_0x45126e(0x19e)]['chatInterfaces'][_0x45126e(0x11b)],_0x1bed72=_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x10c)][_0x45126e(0x112)]+_0x3e7ef3['counts'][_0x45126e(0x172)]['unchanged']+_0x3e7ef3['counts']['textKnowledgeBases']['unchanged']+_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x15a)]['unchanged']+_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x159)][_0x45126e(0x112)]+_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x19a)][_0x45126e(0x112)]+_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x1b9)]['unchanged']+_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x168)][_0x45126e(0x112)]+_0x3e7ef3[_0x45126e(0x19e)]['chatInterfaces'][_0x45126e(0x112)];console['log']('\x0aPush\x20summary\x20for\x20\x27'+_0x3e7ef3[_0x45126e(0x119)]+'\x27:'),console[_0x45126e(0x1b8)]('\x20\x20'+a4_0x1c7c1e[_0x45126e(0x134)]('+\x20'+_0x4f369e+_0x45126e(0x16f))+'\x20|\x20'+a4_0x1c7c1e[_0x45126e(0x195)]('~\x20'+_0x2b19de+_0x45126e(0x15d))+'\x20|\x20'+a4_0x1c7c1e['dim']('=\x20'+_0x1bed72+'\x20unchanged')),console[_0x45126e(0x1b8)](_0x45126e(0x163)+formatCountSummary(_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x10c)])),console['log'](_0x45126e(0x106)+formatCountSummary(_0x3e7ef3[_0x45126e(0x19e)]['knowledgeBases'])),console[_0x45126e(0x1b8)](_0x45126e(0x1b7)+formatCountSummary(_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x173)])),console[_0x45126e(0x1b8)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x3e7ef3[_0x45126e(0x19e)]['prompts'])),console[_0x45126e(0x1b8)](_0x45126e(0x18d)+formatCountSummary(_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x159)])),console[_0x45126e(0x1b8)]('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x168)])),console['log'](_0x45126e(0x13b)+formatCountSummary(_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x1bb)]));const _0x3145a3=_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x19a)][_0x45126e(0x109)]>0x0||_0x3e7ef3['counts'][_0x45126e(0x19a)][_0x45126e(0x11b)]>0x0||_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x19a)][_0x45126e(0x112)]>0x0||_0x3e7ef3[_0x45126e(0x19e)]['experimentalArtifacts']['created']>0x0||_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x1b9)][_0x45126e(0x11b)]>0x0||_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x1b9)][_0x45126e(0x112)]>0x0;_0x3145a3&&(console[_0x45126e(0x1b8)](_0x45126e(0x10d)+formatCountSummary(_0x3e7ef3['counts'][_0x45126e(0x19a)])),console[_0x45126e(0x1b8)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x3e7ef3[_0x45126e(0x19e)][_0x45126e(0x1b9)])));console[_0x45126e(0x1b8)](_0x45126e(0x148)+a4_0x1c7c1e[_0x45126e(0x153)](_0x548e9f)),displayDiffs(_0x3e7ef3['agents'],_0x3e7ef3[_0x45126e(0x172)],_0x3e7ef3[_0x45126e(0x173)],_0x3e7ef3[_0x45126e(0x15a)],_0x3e7ef3[_0x45126e(0x159)],_0x3e7ef3[_0x45126e(0x19a)],_0x3e7ef3['experimentalArtifacts'],_0x3e7ef3[_0x45126e(0x168)],_0x3e7ef3[_0x45126e(0x1bb)]);if(_0x325657)return console['log'](a4_0x1c7c1e[_0x45126e(0x195)](_0x45126e(0x171))),0x0;if(_0x4f369e===0x0&&_0x2b19de===0x0){console[_0x45126e(0x1b8)](a4_0x1c7c1e[_0x45126e(0x134)]('\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date'));const _0x5e28fe=getLLMProjectUrl(_0x5f3d44,_0x3e7ef3[_0x45126e(0x11e)]);return console[_0x45126e(0x1b8)](_0x45126e(0x12d)+a4_0x1c7c1e[_0x45126e(0x153)](_0x5e28fe)),0x0;}if(!_0x37cace&&!_0x4ccb5f){if(!isInteractive())return console[_0x45126e(0x154)](a4_0x1c7c1e[_0x45126e(0x1ac)]('\x0aError:'),_0x45126e(0x128)),console[_0x45126e(0x154)](a4_0x1c7c1e['dim'](_0x45126e(0x19f))),0x1;const _0x51fae2=await confirmKey('\x0aPush\x20'+(_0x4f369e+_0x2b19de)+_0x45126e(0x192));if(!_0x51fae2)return console[_0x45126e(0x1b8)](a4_0x1c7c1e[_0x45126e(0x195)](_0x45126e(0x11c)),_0x45126e(0x142)),0x1;}const {data:_0x27f7eb}=await withSpinner(_0x45126e(0x15c),()=>_0x4e3b9f['llm'][_0x45126e(0x166)](_0x548e9f,{'force':_0x4ccb5f})),_0x5a6689=_0x27f7eb[_0x45126e(0x19e)][_0x45126e(0x10c)][_0x45126e(0x16b)]>0x0||_0x27f7eb[_0x45126e(0x19e)][_0x45126e(0x172)][_0x45126e(0x16b)]>0x0||_0x27f7eb[_0x45126e(0x19e)][_0x45126e(0x173)][_0x45126e(0x16b)]>0x0||_0x27f7eb[_0x45126e(0x19e)]['prompts'][_0x45126e(0x16b)]>0x0||_0x27f7eb[_0x45126e(0x19e)]['formInterfaces'][_0x45126e(0x16b)]>0x0||_0x27f7eb[_0x45126e(0x19e)][_0x45126e(0x1bb)][_0x45126e(0x16b)]>0x0;if(_0x5a6689){console[_0x45126e(0x1b8)](a4_0x1c7c1e['yellow'](_0x45126e(0x174))),console['log'](),console[_0x45126e(0x1b8)](a4_0x1c7c1e['red'](_0x45126e(0x123)));for(const _0x24a621 of _0x27f7eb[_0x45126e(0x10c)]){_0x24a621[_0x45126e(0x197)]==='error'&&console[_0x45126e(0x1b8)](a4_0x1c7c1e['red'](_0x45126e(0x121)+_0x24a621[_0x45126e(0x111)]+_0x45126e(0x12f)+_0x24a621['error']));}for(const _0x34a9f5 of _0x27f7eb[_0x45126e(0x172)]){_0x34a9f5[_0x45126e(0x197)]===_0x45126e(0x154)&&console[_0x45126e(0x1b8)](a4_0x1c7c1e[_0x45126e(0x1ac)](_0x45126e(0x190)+_0x34a9f5[_0x45126e(0x19c)]+_0x45126e(0x12f)+_0x34a9f5[_0x45126e(0x154)]));}for(const _0x312d84 of _0x27f7eb['textKnowledgeBases']){_0x312d84[_0x45126e(0x197)]===_0x45126e(0x154)&&console[_0x45126e(0x1b8)](a4_0x1c7c1e[_0x45126e(0x1ac)](_0x45126e(0x1a8)+_0x312d84[_0x45126e(0x19c)]+_0x45126e(0x12f)+_0x312d84['error']));}for(const _0x2dde8b of _0x27f7eb['prompts']){_0x2dde8b[_0x45126e(0x197)]===_0x45126e(0x154)&&console[_0x45126e(0x1b8)](a4_0x1c7c1e[_0x45126e(0x1ac)](_0x45126e(0x181)+_0x2dde8b[_0x45126e(0x19c)]+_0x45126e(0x12f)+_0x2dde8b[_0x45126e(0x154)]));}for(const _0x1f0535 of _0x27f7eb[_0x45126e(0x159)]){_0x1f0535[_0x45126e(0x197)]===_0x45126e(0x154)&&console['log'](a4_0x1c7c1e['red'](_0x45126e(0x1b3)+_0x1f0535['name']+_0x45126e(0x12f)+_0x1f0535[_0x45126e(0x154)]));}for(const _0x38fae0 of _0x27f7eb[_0x45126e(0x168)]){_0x38fae0[_0x45126e(0x197)]===_0x45126e(0x154)&&console['log'](a4_0x1c7c1e[_0x45126e(0x1ac)]('\x20\x20Form\x20Interface\x20\x22'+_0x38fae0[_0x45126e(0x19c)]+_0x45126e(0x12f)+_0x38fae0[_0x45126e(0x154)]));}for(const _0x5ccd8b of _0x27f7eb['chatInterfaces']){_0x5ccd8b['action']===_0x45126e(0x154)&&console[_0x45126e(0x1b8)](a4_0x1c7c1e[_0x45126e(0x1ac)](_0x45126e(0x16a)+_0x5ccd8b[_0x45126e(0x19c)]+_0x45126e(0x12f)+_0x5ccd8b['error']));}return 0x1;}console[_0x45126e(0x1b8)](a4_0x1c7c1e[_0x45126e(0x134)](_0x45126e(0x145)+(_0x4f369e+_0x2b19de)+_0x45126e(0x15b)+_0x27f7eb[_0x45126e(0x119)]+'\x27'));const _0x1c8149=getLLMProjectUrl(_0x5f3d44,_0x27f7eb['projectId']);return console[_0x45126e(0x1b8)]('Project:\x20'+a4_0x1c7c1e[_0x45126e(0x153)](_0x1c8149)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x5b6d8f=a5_0x1ded;(function(_0x28107c,_0x1f961c){const _0x425a76=a5_0x1ded,_0x45c155=_0x28107c();while(!![]){try{const _0x5507e0=-parseInt(_0x425a76(0xc9))/0x1*(-parseInt(_0x425a76(0xba))/0x2)+parseInt(_0x425a76(0xc8))/0x3*(parseInt(_0x425a76(0x115))/0x4)+parseInt(_0x425a76(0x8b))/0x5*(-parseInt(_0x425a76(0xa4))/0x6)+parseInt(_0x425a76(0x117))/0x7+parseInt(_0x425a76(0x96))/0x8*(parseInt(_0x425a76(0x11a))/0x9)+parseInt(_0x425a76(0x120))/0xa*(parseInt(_0x425a76(0x10a))/0xb)+parseInt(_0x425a76(0x98))/0xc*(-parseInt(_0x425a76(0x8a))/0xd);if(_0x5507e0===_0x1f961c)break;else _0x45c155['push'](_0x45c155['shift']());}catch(_0x3dbb51){_0x45c155['push'](_0x45c155['shift']());}}}(a5_0x2ac0,0xaba09));import*as a5_0x5bcefb from'node:fs';import*as a5_0x2ccfb9 from'node:path';import a5_0x4009f2 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';function a5_0x1ded(_0x3b9a43,_0x1f64ba){_0x3b9a43=_0x3b9a43-0x89;const _0x2ac049=a5_0x2ac0();let _0x1ded97=_0x2ac049[_0x3b9a43];return _0x1ded97;}function a5_0x2ac0(){const _0x42e94d=['/<agent-name>','\x20\x20Site:\x20','Errors:\x20\x20\x20','agent','find','\x22:\x20','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','reason','execute','Tests\x20found:\x20','toLowerCase','timestamp','Failed\x20Tests:','Using\x20agent:\x20','json','status','\x20\x20Round\x20','\x20\x20Agent:\x20','Test\x20Configuration:','\x20\x20Conversation:\x20','name','✗\x20FAIL:\x20','resolve','tags','tests','text','no_context','isSpinning','filter','Passed:\x20\x20\x20','Output\x20written\x20to:\x20','testYmlPath','Conversation\x20URL:\x20','now','FAIL','projectName','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','Executing\x20new\x20tests...','...','length','llm','multiple_agents','yellow','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','table','white','PASS','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','\x20(new)','\x22,\x20but\x20current\x20site\x20is\x20\x22','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','add','repeat','✓\x20PASS:\x20','site','No\x20tests\x20have\x20tags\x20defined.','context','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','Test\x20','11XIqjGT','forEach','llmProject','Failed:\x20\x20\x20','jsonl','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','push','some','\x20\x20Evaluating...\x20','✗\x20ERROR:\x20','includes','3751212QNBpAc','\x20(cached)','9166129sVGFeH','Usage:','conversations','515133HvsWnF','resolveAgentId','executeReeval','Error:\x20No\x20previous\x20test\x20run\x20found.','Duration:\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','10714780hOmSme','cyan','5493449miujTF','26930tgVkJn','dim','rounds','Running\x20test:\x20','testName','\x20-\x20','map','message','trim','Running:\x20','not\x20found','8OzPenm','No\x20tests\x20found\x20with\x20tags:\x20','60Yagema','verbose','utf-8','writeFileSync','red','toISOString','start','agentName','Agent:\x20','Error\x20writing\x20output\x20file:\x20','agentDirs','Run\x20\x27tdx\x20agent\x20pull\x20','804PwKIcu','Evaluating\x20response...','agent:test','projectDir','found','Test\x20Summary','No\x20tests\x20found\x20matching:\x20','no_tests','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','404','Either\x20switch\x20to\x20the\x20\x22','tsv','split','dryRun','Cached\x20run\x20from:\x20','existsSync','Total:\x20\x20\x20\x20',':\x20Sending\x20user\x20input...','stop','Available\x20tags:\x20','ERROR','test.yml','46174WYekLL','no_local_folder','⚠\x20SKIPPED:\x20','join','\x27\x20to\x20create\x20the\x20folder\x20structure.','conversation_url','New\x20tests\x20to\x20execute:\x20','resolveProjectId','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','round','size','green','...\x20','\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path','3aConSz','7rkMdfu','eval','log','Round\x20','source'];a5_0x2ac0=function(){return _0x42e94d;};return a5_0x2ac0();}export class AgentTestCommand extends BaseCommand{[a5_0x5b6d8f(0xe2)]=a5_0x5b6d8f(0xa6);['description']='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x5b6d8f(0xd6)](_0x474e01){const _0x3ce479=a5_0x5b6d8f,{options:_0x4ad89d,args:_0x4e81e3,tdx:_0xdb0621}=_0x474e01,_0x363703=_0x4e81e3[0x0]||'.',_0x2fe113=_0x4ad89d[_0x3ce479(0xb1)],_0xa1f0ea=_0x4ad89d,_0x13acc8=_0xa1f0ea[_0x3ce479(0xca)]===![],_0x7a5d43=_0xa1f0ea['reeval'],_0x41a81d=_0xa1f0ea['name'],_0x27a48c=_0xa1f0ea[_0x3ce479(0xe5)],_0x20035b=_0x4ad89d['site'],_0x30cf12=_0xa1f0ea['output'];if(_0x7a5d43&&_0x13acc8)return console[_0x3ce479(0xcb)](a5_0x4009f2[_0x3ce479(0x9c)](_0x3ce479(0x10f))),0x1;let _0x357389='table';if(_0xa1f0ea[_0x3ce479(0xdc)])_0x357389='json';else{if(_0xa1f0ea[_0x3ce479(0x10e)])_0x357389='jsonl';else{if(_0xa1f0ea[_0x3ce479(0xaf)])_0x357389=_0x3ce479(0xaf);else{if(_0xa1f0ea[_0x3ce479(0xfb)])_0x357389=_0x3ce479(0xfb);}}}const _0x14db5d=_0xa1f0ea['llmProject'];let _0x4fc4c6=_0x363703;const _0x36af5a=a5_0x5bcefb[_0x3ce479(0xb3)](_0x363703),_0x3e16a0=_0x363703==='.';if(!_0x36af5a||_0x3e16a0){const _0x20e6c5=resolveProjectFromContext(_0x363703,_0x14db5d,{'requireFile':_0x3ce479(0xb9)});if(_0x20e6c5[_0x3ce479(0xa8)])_0x4fc4c6=_0x20e6c5[_0x3ce479(0xa7)],_0x20e6c5[_0x3ce479(0xcd)]===_0x3ce479(0x107)&&console['log'](a5_0x4009f2[_0x3ce479(0x8c)](_0x3ce479(0xdb)+_0x4fc4c6));else switch(_0x20e6c5[_0x3ce479(0xd5)]){case _0x3ce479(0xe8):console[_0x3ce479(0xcb)](a5_0x4009f2[_0x3ce479(0xf8)](_0x20e6c5[_0x3ce479(0x92)])),console[_0x3ce479(0xcb)](),console[_0x3ce479(0xcb)](_0x3ce479(0x118)),console[_0x3ce479(0xcb)](_0x3ce479(0xc7)),console['log']('\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x3ce479(0xcb)](),console[_0x3ce479(0xcb)]('Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>');return 0x1;case _0x3ce479(0xbb):console['log'](a5_0x4009f2['yellow'](_0x20e6c5[_0x3ce479(0x92)])),console[_0x3ce479(0xcb)](),console['log'](_0x3ce479(0xa3)+_0x20e6c5[_0x3ce479(0x10c)]+_0x3ce479(0xbe));return 0x1;case _0x3ce479(0xf7):{const _0xa13e3d=a5_0x2ccfb9['basename'](_0x20e6c5['projectDir']);console[_0x3ce479(0xcb)](a5_0x4009f2['yellow']('Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22'+_0x20e6c5[_0x3ce479(0x10c)]+'\x22:'));for(const _0x147933 of _0x20e6c5[_0x3ce479(0xa2)]){console[_0x3ce479(0xcb)]('\x20\x20-\x20'+_0x147933);}return console[_0x3ce479(0xcb)](),console[_0x3ce479(0xcb)](_0x3ce479(0xf2)+_0xa13e3d+_0x3ce479(0xce)),0x1;}case _0x3ce479(0xab):console[_0x3ce479(0xcb)](a5_0x4009f2[_0x3ce479(0xf8)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x20e6c5[_0x3ce479(0x10c)]+'\x22.')),console[_0x3ce479(0xcb)](a5_0x4009f2['dim']('Project\x20path:\x20'+_0x20e6c5[_0x3ce479(0xa7)])),console[_0x3ce479(0xcb)](),console[_0x3ce479(0xcb)](_0x3ce479(0xac));return 0x1;}}const {definition:_0x37c4c2,agentInfo:_0x2d851c}=parseTestFile(_0x4fc4c6);let _0x2e1657=_0x37c4c2[_0x3ce479(0xe6)];if(_0x41a81d){const _0x2a946d=_0x41a81d[_0x3ce479(0xb0)](',')[_0x3ce479(0x91)](_0x1ba675=>_0x1ba675[_0x3ce479(0x93)]());_0x2e1657=_0x37c4c2['tests'][_0x3ce479(0xea)](_0x32c572=>_0x2a946d[_0x3ce479(0x114)](_0x32c572[_0x3ce479(0xe2)]));if(_0x2e1657[_0x3ce479(0xf5)]===0x0)return console[_0x3ce479(0xcb)](a5_0x4009f2[_0x3ce479(0xf8)](_0x3ce479(0xaa)+_0x41a81d)),console[_0x3ce479(0xcb)](a5_0x4009f2[_0x3ce479(0x8c)]('Available\x20tests:\x20'+_0x37c4c2[_0x3ce479(0xe6)]['map'](_0x261d87=>_0x261d87[_0x3ce479(0xe2)])['join'](',\x20'))),0x1;}if(_0x27a48c){const _0x28f3bd=_0x27a48c[_0x3ce479(0xb0)](',')[_0x3ce479(0x91)](_0x3de06d=>_0x3de06d[_0x3ce479(0x93)]()[_0x3ce479(0xd8)]());_0x2e1657=_0x2e1657[_0x3ce479(0xea)](_0x194ffe=>_0x194ffe[_0x3ce479(0xe5)]?.[_0x3ce479(0x111)](_0x52624a=>_0x28f3bd['includes'](_0x52624a['toLowerCase']())));if(_0x2e1657['length']===0x0){console['log'](a5_0x4009f2[_0x3ce479(0xf8)](_0x3ce479(0x97)+_0x27a48c));const _0x433313=new Set();return _0x37c4c2[_0x3ce479(0xe6)][_0x3ce479(0x10b)](_0x1b72d5=>_0x1b72d5['tags']?.[_0x3ce479(0x10b)](_0x3e1f1d=>_0x433313[_0x3ce479(0x102)](_0x3e1f1d))),_0x433313[_0x3ce479(0xc4)]>0x0?console['log'](a5_0x4009f2[_0x3ce479(0x8c)](_0x3ce479(0xb7)+[..._0x433313][_0x3ce479(0xbd)](',\x20'))):console[_0x3ce479(0xcb)](a5_0x4009f2['dim'](_0x3ce479(0x106))),0x1;}}if(_0x7a5d43)return this[_0x3ce479(0x11c)](_0x474e01,{'definition':{'tests':_0x2e1657},'agentInfo':_0x2d851c,'outputFormat':_0x357389,'outputFile':_0x30cf12,'testNames':_0x41a81d});if(_0x2fe113){console[_0x3ce479(0xcb)](a5_0x4009f2['cyan'](_0x3ce479(0xe0))),console[_0x3ce479(0xcb)](_0x3ce479(0xcf)+a5_0x4009f2[_0x3ce479(0xfc)](_0x20035b)),console[_0x3ce479(0xcb)]('\x20\x20Project:\x20'+a5_0x4009f2[_0x3ce479(0xfc)](_0x2d851c[_0x3ce479(0xf1)])),console[_0x3ce479(0xcb)](_0x3ce479(0xdf)+a5_0x4009f2[_0x3ce479(0xfc)](_0x2d851c[_0x3ce479(0x9f)])),console[_0x3ce479(0xcb)](),console[_0x3ce479(0xcb)](_0x3ce479(0xd7)+a5_0x4009f2['white'](_0x2e1657[_0x3ce479(0xf5)]));for(let _0xd512c5=0x0;_0xd512c5<_0x2e1657[_0x3ce479(0xf5)];_0xd512c5++){const _0x2a1213=_0x2e1657[_0xd512c5],_0x655a1e=_0x2a1213[_0x3ce479(0x8d)][_0x3ce479(0xf5)]===0x1?_0x3ce479(0xc3):_0x3ce479(0x8d),_0x4f30a2=_0x2a1213[_0x3ce479(0xe5)]?.[_0x3ce479(0xf5)]?'\x20['+_0x2a1213[_0x3ce479(0xe5)][_0x3ce479(0xbd)](',\x20')+']':'';console['log']('\x20\x20'+(_0xd512c5+0x1)+'.\x20'+a5_0x4009f2['white'](_0x2a1213[_0x3ce479(0xe2)])+'\x20('+_0x2a1213[_0x3ce479(0x8d)][_0x3ce479(0xf5)]+'\x20'+_0x655a1e+')'+a5_0x4009f2[_0x3ce479(0x8c)](_0x4f30a2));}return 0x0;}let _0x295d45,_0x535d10;try{_0x295d45=await _0xdb0621['llm'][_0x3ce479(0xc1)](_0x2d851c['projectName']);}catch(_0x132f95){const _0x17a522=_0x132f95 instanceof Error?_0x132f95[_0x3ce479(0x92)]:String(_0x132f95);return _0x17a522['includes']('404')||_0x17a522[_0x3ce479(0xd8)]()['includes'](_0x3ce479(0x95))?console['log'](a5_0x4009f2['red'](_0x3ce479(0x11f)+_0x2d851c[_0x3ce479(0xf1)])):console[_0x3ce479(0xcb)](a5_0x4009f2[_0x3ce479(0x9c)](_0x3ce479(0xfe)+_0x2d851c['projectName']+'\x22:\x20'+_0x17a522)),0x1;}try{_0x535d10=await _0xdb0621[_0x3ce479(0xf6)][_0x3ce479(0x11b)](_0x2d851c[_0x3ce479(0x9f)],_0x295d45);}catch(_0x8ee2c6){const _0x287c16=_0x8ee2c6 instanceof Error?_0x8ee2c6[_0x3ce479(0x92)]:String(_0x8ee2c6);return _0x287c16['includes'](_0x3ce479(0xad))||_0x287c16[_0x3ce479(0xd8)]()[_0x3ce479(0x114)](_0x3ce479(0x95))?console[_0x3ce479(0xcb)](a5_0x4009f2[_0x3ce479(0x9c)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x2d851c['agentName'])):console[_0x3ce479(0xcb)](a5_0x4009f2['red']('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22'+_0x2d851c[_0x3ce479(0x9f)]+_0x3ce479(0xd3)+_0x287c16)),0x1;}let _0x52e5fd;if(!_0x13acc8)try{_0x52e5fd=await setupEvaluatorAgent(_0xdb0621[_0x3ce479(0xf6)],_0x4ad89d[_0x3ce479(0x99)]);}catch(_0x21b568){const _0x3601ef=_0x21b568 instanceof Error?_0x21b568['message']:String(_0x21b568);return console[_0x3ce479(0xcb)](a5_0x4009f2['red'](_0x3ce479(0xd4)+_0x3601ef)),0x1;}console[_0x3ce479(0xcb)](a5_0x4009f2[_0x3ce479(0x89)]('Running\x20agent\x20tests...')),console['log']('Site:\x20'+a5_0x4009f2[_0x3ce479(0xfc)](_0x20035b)),console[_0x3ce479(0xcb)]('Agent:\x20'+a5_0x4009f2[_0x3ce479(0xfc)](_0x2d851c['projectName']+'/'+_0x2d851c[_0x3ce479(0x9f)])),console[_0x3ce479(0xcb)]();const _0x3454c2=[],_0x21d52c=[],_0x4e4d7b=Date['now']();for(let _0x1baf5b=0x0;_0x1baf5b<_0x2e1657[_0x3ce479(0xf5)];_0x1baf5b++){const _0x13fa2e=_0x2e1657[_0x1baf5b];_0x2e1657[_0x3ce479(0xf5)]>0x1?console[_0x3ce479(0xcb)](_0x3ce479(0x109)+(_0x1baf5b+0x1)+'/'+_0x2e1657['length']+':\x20'+a5_0x4009f2[_0x3ce479(0xfc)](_0x13fa2e['name'])):console[_0x3ce479(0xcb)](_0x3ce479(0x8e)+a5_0x4009f2[_0x3ce479(0xfc)](_0x13fa2e['name']));const _0x409bf2=createCommandSpinner('Round\x201/'+_0x13fa2e[_0x3ce479(0x8d)][_0x3ce479(0xf5)]+_0x3ce479(0xb5));_0x409bf2['start']();try{const {result:_0x4ba862,conversation:_0x5802fe}=await runTest(_0xdb0621[_0x3ce479(0xf6)],_0x13fa2e,{'agentId':_0x535d10,'projectId':_0x295d45,'site':_0x20035b,'noEval':_0x13acc8,'evaluatorId':_0x52e5fd,'onRoundStart':(_0x5b3b51,_0x15e6f5)=>{const _0x5cf059=_0x3ce479;_0x409bf2[_0x5cf059(0xe7)]=_0x5cf059(0xcc)+(_0x5b3b51+0x1)+'/'+_0x15e6f5+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x24fe83,_0x2aab43,_0x402980)=>{const _0x4d7a56=_0x3ce479,_0x1b8f3f=formatElapsed(_0x2aab43);_0x402980?console['log']('\x20\x20Round\x20'+(_0x24fe83+0x1)+'/'+_0x13fa2e[_0x4d7a56(0x8d)]['length']+'...\x20'+a5_0x4009f2[_0x4d7a56(0xc5)]('✓')+'\x20('+_0x1b8f3f+')'):console[_0x4d7a56(0xcb)](_0x4d7a56(0xde)+(_0x24fe83+0x1)+'/'+_0x13fa2e['rounds'][_0x4d7a56(0xf5)]+'...\x20'+a5_0x4009f2['red']('✗'));},'onEvaluationStart':()=>{const _0x4a4e9f=_0x3ce479;_0x409bf2['text']=_0x4a4e9f(0xa5);},'onEvaluationComplete':_0x2e80e2=>{const _0x3b2bc3=_0x3ce479,_0x15b387=formatElapsed(_0x2e80e2);console[_0x3b2bc3(0xcb)]('\x20\x20Evaluating...\x20'+a5_0x4009f2['green']('✓')+'\x20('+_0x15b387+')');}});_0x409bf2['stop'](),_0x3454c2[_0x3ce479(0x110)](_0x4ba862),_0x21d52c['push'](_0x5802fe);if(_0x4ba862[_0x3ce479(0xdd)]==='PASS')console[_0x3ce479(0xcb)](a5_0x4009f2[_0x3ce479(0xc5)]('✓\x20PASS:\x20'+_0x4ba862[_0x3ce479(0xd5)]));else _0x4ba862['status']===_0x3ce479(0xf0)?console[_0x3ce479(0xcb)](a5_0x4009f2[_0x3ce479(0x9c)](_0x3ce479(0xe3)+_0x4ba862['reason'])):console[_0x3ce479(0xcb)](a5_0x4009f2[_0x3ce479(0x9c)](_0x3ce479(0x113)+_0x4ba862['reason']));_0x4ba862[_0x3ce479(0xbf)]&&console['log'](a5_0x4009f2[_0x3ce479(0x8c)](_0x3ce479(0xee)+_0x4ba862[_0x3ce479(0xbf)])),console['log']();}catch(_0x5a47f6){_0x409bf2[_0x3ce479(0xb6)]();const _0x42f519=_0x5a47f6 instanceof Error?_0x5a47f6[_0x3ce479(0x92)]:String(_0x5a47f6);console[_0x3ce479(0xcb)](a5_0x4009f2[_0x3ce479(0x9c)](_0x3ce479(0x113)+_0x42f519)),console['log'](),_0x3454c2[_0x3ce479(0x110)]({'name':_0x13fa2e[_0x3ce479(0xe2)],'status':'ERROR','reason':_0x42f519,'timestamp':new Date()[_0x3ce479(0x9d)](),'duration_ms':0x0});}}const _0x2e01e4=Date['now']()-_0x4e4d7b,_0x512f38=_0x3454c2[_0x3ce479(0xea)](_0xfce0ab=>_0xfce0ab[_0x3ce479(0xdd)]==='PASS')[_0x3ce479(0xf5)],_0x3f9fd1=_0x3454c2['filter'](_0x3042b3=>_0x3042b3[_0x3ce479(0xdd)]==='FAIL')[_0x3ce479(0xf5)],_0x592198=_0x3454c2[_0x3ce479(0xea)](_0x16e8f4=>_0x16e8f4[_0x3ce479(0xdd)]==='ERROR')[_0x3ce479(0xf5)];console[_0x3ce479(0xcb)]('━'[_0x3ce479(0x103)](0x3c)),console[_0x3ce479(0xcb)](_0x3ce479(0xa9)),console['log']('━'[_0x3ce479(0x103)](0x3c)),console[_0x3ce479(0xcb)](_0x3ce479(0xb4)+_0x3454c2[_0x3ce479(0xf5)]),console[_0x3ce479(0xcb)]('Passed:\x20\x20\x20'+a5_0x4009f2[_0x3ce479(0xc5)](_0x512f38)),console[_0x3ce479(0xcb)](_0x3ce479(0x10d)+a5_0x4009f2[_0x3ce479(0x9c)](_0x3f9fd1));_0x592198>0x0&&console[_0x3ce479(0xcb)](_0x3ce479(0xd0)+a5_0x4009f2[_0x3ce479(0x9c)](_0x592198));console[_0x3ce479(0xcb)](_0x3ce479(0x11e)+formatElapsed(_0x2e01e4)),console[_0x3ce479(0xcb)]('━'[_0x3ce479(0x103)](0x3c));const _0xc3b1bc=_0x3454c2[_0x3ce479(0xea)](_0x49a73f=>_0x49a73f[_0x3ce479(0xdd)]!==_0x3ce479(0xfd));if(_0xc3b1bc[_0x3ce479(0xf5)]>0x0){console[_0x3ce479(0xcb)](),console[_0x3ce479(0xcb)](_0x3ce479(0xda));for(const _0x35c10d of _0xc3b1bc){const _0x166447=a5_0x4009f2[_0x3ce479(0x9c)]('✗'),_0x540ed8=_0x35c10d['reason'][_0x3ce479(0xf5)]>0x32?_0x35c10d[_0x3ce479(0xd5)]['substring'](0x0,0x32)+_0x3ce479(0xf4):_0x35c10d[_0x3ce479(0xd5)];console['log']('\x20\x20'+_0x166447+'\x20'+_0x35c10d[_0x3ce479(0xe2)]+':\x20'+_0x540ed8);}}const _0x6c47f6={'summary':{'total':_0x3454c2[_0x3ce479(0xf5)],'passed':_0x512f38,'failed':_0x3f9fd1,'errors':_0x592198>0x0?_0x592198:undefined,'duration_ms':_0x2e01e4},'tests':_0x3454c2,'agent':{'project':_0x2d851c[_0x3ce479(0xf1)],'name':_0x2d851c['agentName'],'site':_0x20035b},'timestamp':new Date(_0x4e4d7b)[_0x3ce479(0x9d)]()};try{const _0x3712b8=buildCachedTestRun(_0x21d52c,{'site':_0x20035b,'projectId':_0x295d45,'projectName':_0x2d851c[_0x3ce479(0xf1)],'agentId':_0x535d10,'agentName':_0x2d851c['agentName'],'testYmlPath':a5_0x2ccfb9[_0x3ce479(0xe4)](_0x2d851c[_0x3ce479(0xed)])});saveLastTestRun(_0x3712b8);}catch{}if(_0x357389!=='table'||_0x30cf12){const _0x49dde3=formatResults(_0x6c47f6,_0x357389);if(_0x30cf12)try{a5_0x5bcefb[_0x3ce479(0x9b)](_0x30cf12,_0x49dde3,_0x3ce479(0x9a)),console['log'](),console['log'](a5_0x4009f2[_0x3ce479(0x8c)]('Output\x20written\x20to:\x20'+_0x30cf12));}catch(_0x322049){return console['log'](),console[_0x3ce479(0xcb)](a5_0x4009f2[_0x3ce479(0x9c)](_0x3ce479(0xa1)+_0x322049)),0x1;}else console[_0x3ce479(0xcb)](),console[_0x3ce479(0xcb)](_0x49dde3);}return _0xc3b1bc[_0x3ce479(0xf5)]>0x0?0x1:0x0;}async[a5_0x5b6d8f(0x11c)](_0xd335ef,_0x5ef9a2){const _0x1a04c5=a5_0x5b6d8f,{options:_0x4eb49d,tdx:_0x3a7e90}=_0xd335ef,{definition:_0x41ab4a,agentInfo:_0x892651,outputFormat:_0x20458b,outputFile:_0x4663de}=_0x5ef9a2,_0x3aece2=_0x4eb49d[_0x1a04c5(0x105)],_0x41e00c=loadLastTestRun();if(!_0x41e00c)return console[_0x1a04c5(0xcb)](a5_0x4009f2[_0x1a04c5(0x9c)](_0x1a04c5(0x11d))),console[_0x1a04c5(0xcb)](a5_0x4009f2[_0x1a04c5(0x8c)](_0x1a04c5(0xf9))),0x1;if(_0x41e00c[_0x1a04c5(0xd1)][_0x1a04c5(0x9f)]!==_0x892651['agentName'])return console['log'](a5_0x4009f2[_0x1a04c5(0x9c)](_0x1a04c5(0xfa)+_0x41e00c[_0x1a04c5(0xd1)][_0x1a04c5(0x9f)]+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x892651[_0x1a04c5(0x9f)]+'\x22.')),console['log'](a5_0x4009f2['dim'](_0x1a04c5(0xc2))),0x1;const _0x4de11d=new Set(_0x41e00c[_0x1a04c5(0x119)][_0x1a04c5(0x91)](_0x5d3a71=>_0x5d3a71[_0x1a04c5(0x8f)])),_0x1b1cdf=_0x41ab4a['tests'][_0x1a04c5(0xea)](_0x579f28=>!_0x4de11d['has'](_0x579f28['name']));if(_0x1b1cdf['length']>0x0&&_0x41e00c['site']!==_0x3aece2)return console['log'](a5_0x4009f2[_0x1a04c5(0x9c)](_0x1a04c5(0x108))),console[_0x1a04c5(0xcb)](a5_0x4009f2[_0x1a04c5(0x8c)]('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x41e00c[_0x1a04c5(0x105)]+_0x1a04c5(0x100)+_0x3aece2+'\x22.')),console[_0x1a04c5(0xcb)](a5_0x4009f2['dim'](_0x1a04c5(0xae)+_0x41e00c['site']+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x23b1d8=_0x41ab4a[_0x1a04c5(0xe6)][_0x1a04c5(0xea)](_0x214607=>_0x4de11d['has'](_0x214607[_0x1a04c5(0xe2)])),_0x368851=_0x1b1cdf;let _0x3deb79;try{_0x3deb79=await setupEvaluatorAgent(_0x3a7e90[_0x1a04c5(0xf6)],_0x4eb49d[_0x1a04c5(0x99)]);}catch(_0x163c22){const _0x34d4bb=_0x163c22 instanceof Error?_0x163c22['message']:String(_0x163c22);return console['log'](a5_0x4009f2[_0x1a04c5(0x9c)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x34d4bb)),0x1;}console[_0x1a04c5(0xcb)](a5_0x4009f2[_0x1a04c5(0x89)]('Re-evaluating\x20cached\x20test\x20run...')),console[_0x1a04c5(0xcb)](_0x1a04c5(0xb2)+a5_0x4009f2[_0x1a04c5(0xfc)](_0x41e00c[_0x1a04c5(0xd9)])),console['log'](_0x1a04c5(0xa0)+a5_0x4009f2[_0x1a04c5(0xfc)](_0x41e00c[_0x1a04c5(0xd1)][_0x1a04c5(0xf1)]+'/'+_0x41e00c[_0x1a04c5(0xd1)][_0x1a04c5(0x9f)]));_0x368851[_0x1a04c5(0xf5)]>0x0&&console[_0x1a04c5(0xcb)](_0x1a04c5(0xc0)+a5_0x4009f2[_0x1a04c5(0xf8)](_0x368851['length']));console[_0x1a04c5(0xcb)]();const _0x33b118=[],_0xeee7ab=Date[_0x1a04c5(0xef)](),_0x1d07a3=createCommandSpinner('Re-evaluating...');if(_0x23b1d8['length']>0x0)try{const _0xe91c75=await reevaluateFromCache(_0x3a7e90[_0x1a04c5(0xf6)],_0x41e00c,{'tests':_0x23b1d8},{'evaluatorId':_0x3deb79,'onTestStart':(_0x503f0a,_0xdefafc,_0x120850)=>{const _0x120ac9=_0x1a04c5;_0x1d07a3[_0x120ac9(0xe7)]='Re-evaluating\x20'+(_0xdefafc+0x1)+'/'+_0x120850+':\x20'+_0x503f0a+_0x120ac9(0xf4);if(!_0x1d07a3[_0x120ac9(0xe9)])_0x1d07a3[_0x120ac9(0x9e)]();},'onTestComplete':(_0xff8312,_0x42b86c)=>{const _0x3c4d9c=_0x1a04c5;_0x1d07a3[_0x3c4d9c(0xb6)]();if(_0x42b86c[_0x3c4d9c(0xdd)]===_0x3c4d9c(0xfd))console[_0x3c4d9c(0xcb)](a5_0x4009f2[_0x3c4d9c(0xc5)](_0x3c4d9c(0x104)+_0xff8312)+a5_0x4009f2[_0x3c4d9c(0x8c)](_0x3c4d9c(0x116)));else _0x42b86c['status']==='FAIL'?console[_0x3c4d9c(0xcb)](a5_0x4009f2[_0x3c4d9c(0x9c)](_0x3c4d9c(0xe3)+_0xff8312+_0x3c4d9c(0x90)+_0x42b86c[_0x3c4d9c(0xd5)])+a5_0x4009f2[_0x3c4d9c(0x8c)](_0x3c4d9c(0x116))):console[_0x3c4d9c(0xcb)](a5_0x4009f2[_0x3c4d9c(0x9c)](_0x3c4d9c(0x113)+_0xff8312+_0x3c4d9c(0x90)+_0x42b86c[_0x3c4d9c(0xd5)]));_0x42b86c[_0x3c4d9c(0xbf)]&&console['log'](a5_0x4009f2['dim'](_0x3c4d9c(0xe1)+_0x42b86c[_0x3c4d9c(0xbf)])),_0x33b118['push'](_0x42b86c);},'onTestSkipped':(_0x3ee387,_0x480c8f)=>{const _0x376d1b=_0x1a04c5;_0x1d07a3['stop'](),console[_0x376d1b(0xcb)](a5_0x4009f2[_0x376d1b(0xf8)](_0x376d1b(0xbc)+_0x3ee387+_0x376d1b(0x90)+_0x480c8f));}});for(const _0x1b042d of _0xe91c75){!_0x33b118[_0x1a04c5(0xd2)](_0x52d045=>_0x52d045[_0x1a04c5(0xe2)]===_0x1b042d['name'])&&_0x33b118[_0x1a04c5(0x110)](_0x1b042d);}}catch(_0x5d2d84){_0x1d07a3[_0x1a04c5(0xb6)]();const _0x4a0a07=_0x5d2d84 instanceof Error?_0x5d2d84['message']:String(_0x5d2d84);return console[_0x1a04c5(0xcb)](a5_0x4009f2['red'](_0x1a04c5(0x101)+_0x4a0a07)),0x1;}_0x1d07a3[_0x1a04c5(0xb6)]();if(_0x368851['length']>0x0){console[_0x1a04c5(0xcb)](),console[_0x1a04c5(0xcb)](a5_0x4009f2[_0x1a04c5(0x89)](_0x1a04c5(0xf3)));const {projectId:_0x4152a2,agentId:_0x333cc5}=_0x41e00c[_0x1a04c5(0xd1)];for(const _0x17dc11 of _0x368851){console[_0x1a04c5(0xcb)](_0x1a04c5(0x94)+a5_0x4009f2[_0x1a04c5(0xfc)](_0x17dc11[_0x1a04c5(0xe2)]));const _0x15302d=createCommandSpinner('Round\x201/'+_0x17dc11[_0x1a04c5(0x8d)][_0x1a04c5(0xf5)]+_0x1a04c5(0xb5));_0x15302d[_0x1a04c5(0x9e)]();try{const {result:_0x2a52f2}=await runTest(_0x3a7e90['llm'],_0x17dc11,{'agentId':_0x333cc5,'projectId':_0x4152a2,'site':_0x41e00c['site'],'noEval':![],'evaluatorId':_0x3deb79,'onRoundStart':(_0x12ac62,_0x447aa4)=>{const _0x3d3bb5=_0x1a04c5;_0x15302d[_0x3d3bb5(0xe7)]='Round\x20'+(_0x12ac62+0x1)+'/'+_0x447aa4+_0x3d3bb5(0xb5);},'onRoundComplete':(_0x40f451,_0x3cc485,_0x1913f1)=>{const _0x59ffea=_0x1a04c5,_0x2a1372=formatElapsed(_0x3cc485);_0x1913f1?console['log'](_0x59ffea(0xde)+(_0x40f451+0x1)+'/'+_0x17dc11[_0x59ffea(0x8d)]['length']+_0x59ffea(0xc6)+a5_0x4009f2[_0x59ffea(0xc5)]('✓')+'\x20('+_0x2a1372+')'):console[_0x59ffea(0xcb)]('\x20\x20Round\x20'+(_0x40f451+0x1)+'/'+_0x17dc11[_0x59ffea(0x8d)]['length']+'...\x20'+a5_0x4009f2[_0x59ffea(0x9c)]('✗'));},'onEvaluationStart':()=>{const _0x223ae0=_0x1a04c5;_0x15302d[_0x223ae0(0xe7)]=_0x223ae0(0xa5);},'onEvaluationComplete':_0x498ccc=>{const _0x3509bb=_0x1a04c5,_0x546ea6=formatElapsed(_0x498ccc);console['log'](_0x3509bb(0x112)+a5_0x4009f2[_0x3509bb(0xc5)]('✓')+'\x20('+_0x546ea6+')');}});_0x15302d[_0x1a04c5(0xb6)](),_0x33b118[_0x1a04c5(0x110)](_0x2a52f2);if(_0x2a52f2[_0x1a04c5(0xdd)]==='PASS')console[_0x1a04c5(0xcb)](a5_0x4009f2['green'](_0x1a04c5(0x104)+_0x2a52f2[_0x1a04c5(0xd5)])+a5_0x4009f2[_0x1a04c5(0x8c)](_0x1a04c5(0xff)));else _0x2a52f2[_0x1a04c5(0xdd)]==='FAIL'?console[_0x1a04c5(0xcb)](a5_0x4009f2[_0x1a04c5(0x9c)](_0x1a04c5(0xe3)+_0x2a52f2[_0x1a04c5(0xd5)])+a5_0x4009f2['dim'](_0x1a04c5(0xff))):console[_0x1a04c5(0xcb)](a5_0x4009f2[_0x1a04c5(0x9c)](_0x1a04c5(0x113)+_0x2a52f2[_0x1a04c5(0xd5)]));_0x2a52f2['conversation_url']&&console[_0x1a04c5(0xcb)](a5_0x4009f2['dim']('\x20\x20Conversation:\x20'+_0x2a52f2[_0x1a04c5(0xbf)]));}catch(_0x4bb754){_0x15302d[_0x1a04c5(0xb6)]();const _0x1952f0=_0x4bb754 instanceof Error?_0x4bb754[_0x1a04c5(0x92)]:String(_0x4bb754);console['log'](a5_0x4009f2['red']('✗\x20ERROR:\x20'+_0x1952f0)),_0x33b118['push']({'name':_0x17dc11[_0x1a04c5(0xe2)],'status':'ERROR','reason':_0x1952f0,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console['log']();const _0x33d752=Date[_0x1a04c5(0xef)]()-_0xeee7ab,_0x547a51=_0x33b118[_0x1a04c5(0xea)](_0x3c8551=>_0x3c8551[_0x1a04c5(0xdd)]===_0x1a04c5(0xfd))[_0x1a04c5(0xf5)],_0x3af590=_0x33b118[_0x1a04c5(0xea)](_0x4bdb8f=>_0x4bdb8f[_0x1a04c5(0xdd)]===_0x1a04c5(0xf0))['length'],_0x1d5d27=_0x33b118['filter'](_0x42f752=>_0x42f752[_0x1a04c5(0xdd)]===_0x1a04c5(0xb8))[_0x1a04c5(0xf5)];console[_0x1a04c5(0xcb)]('━'['repeat'](0x3c)),console[_0x1a04c5(0xcb)]('Re-evaluation\x20Summary'),console[_0x1a04c5(0xcb)]('━'[_0x1a04c5(0x103)](0x3c)),console[_0x1a04c5(0xcb)](_0x1a04c5(0xb4)+_0x33b118[_0x1a04c5(0xf5)]),console[_0x1a04c5(0xcb)](_0x1a04c5(0xeb)+a5_0x4009f2['green'](_0x547a51)),console[_0x1a04c5(0xcb)](_0x1a04c5(0x10d)+a5_0x4009f2[_0x1a04c5(0x9c)](_0x3af590));_0x1d5d27>0x0&&console['log'](_0x1a04c5(0xd0)+a5_0x4009f2[_0x1a04c5(0x9c)](_0x1d5d27));console[_0x1a04c5(0xcb)](_0x1a04c5(0x11e)+formatElapsed(_0x33d752)),console[_0x1a04c5(0xcb)]('━'[_0x1a04c5(0x103)](0x3c));const _0x234244={'summary':{'total':_0x33b118[_0x1a04c5(0xf5)],'passed':_0x547a51,'failed':_0x3af590,'errors':_0x1d5d27>0x0?_0x1d5d27:undefined,'duration_ms':_0x33d752},'tests':_0x33b118,'agent':{'project':_0x892651[_0x1a04c5(0xf1)],'name':_0x892651['agentName'],'site':_0x3aece2},'timestamp':new Date(_0xeee7ab)[_0x1a04c5(0x9d)]()};if(_0x20458b!==_0x1a04c5(0xfb)||_0x4663de){const _0x31fae9=formatResults(_0x234244,_0x20458b);if(_0x4663de)try{a5_0x5bcefb['writeFileSync'](_0x4663de,_0x31fae9,_0x1a04c5(0x9a)),console[_0x1a04c5(0xcb)](),console[_0x1a04c5(0xcb)](a5_0x4009f2[_0x1a04c5(0x8c)](_0x1a04c5(0xec)+_0x4663de));}catch(_0x498b51){return console[_0x1a04c5(0xcb)](),console[_0x1a04c5(0xcb)](a5_0x4009f2[_0x1a04c5(0x9c)]('Error\x20writing\x20output\x20file:\x20'+_0x498b51)),0x1;}else console[_0x1a04c5(0xcb)](),console['log'](_0x31fae9);}const _0x39d3a3=_0x33b118[_0x1a04c5(0xea)](_0x2c8c62=>_0x2c8c62[_0x1a04c5(0xdd)]!==_0x1a04c5(0xfd));return _0x39d3a3['length']>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0x3eb29a=a5_0x28e7;(function(_0x43bc07,_0x23fb95){const _0x1d012d=a5_0x28e7,_0x379a60=_0x43bc07();while(!![]){try{const _0x1f6098=parseInt(_0x1d012d(0x210))/0x1*(parseInt(_0x1d012d(0x23e))/0x2)+parseInt(_0x1d012d(0x1c6))/0x3*(parseInt(_0x1d012d(0x1ce))/0x4)+-parseInt(_0x1d012d(0x21b))/0x5+-parseInt(_0x1d012d(0x1c5))/0x6+-parseInt(_0x1d012d(0x240))/0x7*(-parseInt(_0x1d012d(0x252))/0x8)+-parseInt(_0x1d012d(0x1ec))/0x9*(parseInt(_0x1d012d(0x25c))/0xa)+-parseInt(_0x1d012d(0x21a))/0xb*(-parseInt(_0x1d012d(0x220))/0xc);if(_0x1f6098===_0x23fb95)break;else _0x379a60['push'](_0x379a60['shift']());}catch(_0x142dcf){_0x379a60['push'](_0x379a60['shift']());}}}(a5_0x3d27,0xf0f74));function a5_0x28e7(_0x1f807f,_0x289e77){_0x1f807f=_0x1f807f-0x1c5;const _0x3d274e=a5_0x3d27();let _0x28e704=_0x3d274e[_0x1f807f];return _0x28e704;}import*as a5_0x23eb5e from'node:fs';import*as a5_0x4c8f4e from'node:path';import a5_0x3010a6 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_0x3eb29a(0x24c)]='agent:test';[a5_0x3eb29a(0x228)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x3eb29a(0x1da)](_0x48c123){const _0x35052d=a5_0x3eb29a,{options:_0x1aa8a5,args:_0x181b42,tdx:_0xd62020}=_0x48c123,_0x1ef7a2=_0x181b42[0x0]||'.',_0x274646=_0x1aa8a5[_0x35052d(0x201)],_0xa0e6c8=_0x1aa8a5,_0x5afae7=_0xa0e6c8[_0x35052d(0x239)]===![],_0x48324c=_0xa0e6c8[_0x35052d(0x1ee)],_0xc98336=_0xa0e6c8[_0x35052d(0x24c)],_0x2eeaa2=_0xa0e6c8[_0x35052d(0x1f9)],_0xeffa9f=_0x1aa8a5[_0x35052d(0x221)],_0x3789e3=_0xa0e6c8['output'];if(_0x48324c&&_0x5afae7)return console['log'](a5_0x3010a6['red'](_0x35052d(0x1d0))),0x1;let _0x4e9864=_0x35052d(0x1e5);if(_0xa0e6c8[_0x35052d(0x1c7)])_0x4e9864=_0x35052d(0x1c7);else{if(_0xa0e6c8[_0x35052d(0x20a)])_0x4e9864='jsonl';else{if(_0xa0e6c8['tsv'])_0x4e9864=_0x35052d(0x225);else{if(_0xa0e6c8[_0x35052d(0x1e5)])_0x4e9864='table';}}}const _0x2ccdd3=_0xa0e6c8[_0x35052d(0x1df)];let _0x43ca49=_0x1ef7a2;const _0x51f670=a5_0x23eb5e[_0x35052d(0x1d6)](_0x1ef7a2),_0x3031fc=_0x1ef7a2==='.';if(!_0x51f670||_0x3031fc){const _0x2eea03=resolveProjectFromContext(_0x1ef7a2,_0x2ccdd3,{'requireFile':'test.yml'});if(_0x2eea03[_0x35052d(0x212)])_0x43ca49=_0x2eea03[_0x35052d(0x206)],_0x2eea03[_0x35052d(0x243)]===_0x35052d(0x233)&&console[_0x35052d(0x1c9)](a5_0x3010a6[_0x35052d(0x1fe)](_0x35052d(0x20d)+_0x43ca49));else switch(_0x2eea03[_0x35052d(0x1fd)]){case _0x35052d(0x23d):console[_0x35052d(0x1c9)](a5_0x3010a6[_0x35052d(0x22b)](_0x2eea03['message'])),console['log'](),console[_0x35052d(0x1c9)]('Usage:'),console['log'](_0x35052d(0x205)),console['log'](_0x35052d(0x204)),console['log'](),console[_0x35052d(0x1c9)](_0x35052d(0x253));return 0x1;case'no_local_folder':console['log'](a5_0x3010a6[_0x35052d(0x22b)](_0x2eea03[_0x35052d(0x1d8)])),console[_0x35052d(0x1c9)](),console[_0x35052d(0x1c9)](_0x35052d(0x22e)+_0x2eea03[_0x35052d(0x1df)]+_0x35052d(0x1f4));return 0x1;case'multiple_agents':{const _0x260e2b=a5_0x4c8f4e[_0x35052d(0x217)](_0x2eea03[_0x35052d(0x206)]);console[_0x35052d(0x1c9)](a5_0x3010a6[_0x35052d(0x22b)](_0x35052d(0x251)+_0x2eea03[_0x35052d(0x1df)]+'\x22:'));for(const _0x576691 of _0x2eea03[_0x35052d(0x244)]){console[_0x35052d(0x1c9)](_0x35052d(0x255)+_0x576691);}return console[_0x35052d(0x1c9)](),console[_0x35052d(0x1c9)](_0x35052d(0x250)+_0x260e2b+_0x35052d(0x1f3)),0x1;}case _0x35052d(0x1f1):console[_0x35052d(0x1c9)](a5_0x3010a6[_0x35052d(0x22b)](_0x35052d(0x1ca)+_0x2eea03['llmProject']+'\x22.')),console[_0x35052d(0x1c9)](a5_0x3010a6['dim'](_0x35052d(0x203)+_0x2eea03['projectDir'])),console['log'](),console[_0x35052d(0x1c9)](_0x35052d(0x248));return 0x1;}}const {definition:_0x26c30a,agentInfo:_0x30c9e1}=parseTestFile(_0x43ca49);let _0x26d4d7=_0x26c30a['tests'];if(_0xc98336){const _0x310fa5=_0xc98336[_0x35052d(0x1e6)](',')[_0x35052d(0x20c)](_0x18259d=>_0x18259d['trim']());_0x26d4d7=_0x26c30a['tests'][_0x35052d(0x1fb)](_0x362cb8=>_0x310fa5[_0x35052d(0x245)](_0x362cb8[_0x35052d(0x24c)]));if(_0x26d4d7['length']===0x0)return console[_0x35052d(0x1c9)](a5_0x3010a6[_0x35052d(0x22b)](_0x35052d(0x249)+_0xc98336)),console[_0x35052d(0x1c9)](a5_0x3010a6[_0x35052d(0x1fe)](_0x35052d(0x223)+_0x26c30a['tests'][_0x35052d(0x20c)](_0x3f8278=>_0x3f8278['name'])['join'](',\x20'))),0x1;}if(_0x2eeaa2){const _0x3217dd=_0x2eeaa2[_0x35052d(0x1e6)](',')[_0x35052d(0x20c)](_0x5745cc=>_0x5745cc[_0x35052d(0x1fc)]()['toLowerCase']());_0x26d4d7=_0x26d4d7[_0x35052d(0x1fb)](_0x34f6ef=>_0x34f6ef[_0x35052d(0x1f9)]?.[_0x35052d(0x1f6)](_0x2a35a1=>_0x3217dd[_0x35052d(0x245)](_0x2a35a1[_0x35052d(0x230)]())));if(_0x26d4d7[_0x35052d(0x1f8)]===0x0){console[_0x35052d(0x1c9)](a5_0x3010a6[_0x35052d(0x22b)]('No\x20tests\x20found\x20with\x20tags:\x20'+_0x2eeaa2));const _0x99a8c3=new Set();return _0x26c30a[_0x35052d(0x234)][_0x35052d(0x256)](_0x51a165=>_0x51a165[_0x35052d(0x1f9)]?.[_0x35052d(0x256)](_0x1fcf04=>_0x99a8c3['add'](_0x1fcf04))),_0x99a8c3['size']>0x0?console[_0x35052d(0x1c9)](a5_0x3010a6[_0x35052d(0x1fe)](_0x35052d(0x235)+[..._0x99a8c3]['join'](',\x20'))):console[_0x35052d(0x1c9)](a5_0x3010a6[_0x35052d(0x1fe)](_0x35052d(0x1f2))),0x1;}}if(_0x48324c)return this['executeReeval'](_0x48c123,{'definition':{'tests':_0x26d4d7},'agentInfo':_0x30c9e1,'outputFormat':_0x4e9864,'outputFile':_0x3789e3,'testNames':_0xc98336});if(_0x274646){console['log'](a5_0x3010a6[_0x35052d(0x232)]('Test\x20Configuration:')),console[_0x35052d(0x1c9)](_0x35052d(0x23f)+a5_0x3010a6[_0x35052d(0x1d1)](_0xeffa9f)),console['log'](_0x35052d(0x211)+a5_0x3010a6[_0x35052d(0x1d1)](_0x30c9e1[_0x35052d(0x241)])),console['log'](_0x35052d(0x1d7)+a5_0x3010a6[_0x35052d(0x1d1)](_0x30c9e1[_0x35052d(0x258)])),console['log'](),console['log'](_0x35052d(0x247)+a5_0x3010a6['white'](_0x26d4d7['length']));for(let _0x22984b=0x0;_0x22984b<_0x26d4d7['length'];_0x22984b++){const _0x487474=_0x26d4d7[_0x22984b],_0x26a76e=_0x487474[_0x35052d(0x226)][_0x35052d(0x1f8)]===0x1?_0x35052d(0x1dc):_0x35052d(0x226),_0x46e484=_0x487474[_0x35052d(0x1f9)]?.[_0x35052d(0x1f8)]?'\x20['+_0x487474[_0x35052d(0x1f9)]['join'](',\x20')+']':'';console[_0x35052d(0x1c9)]('\x20\x20'+(_0x22984b+0x1)+'.\x20'+a5_0x3010a6[_0x35052d(0x1d1)](_0x487474[_0x35052d(0x24c)])+'\x20('+_0x487474['rounds']['length']+'\x20'+_0x26a76e+')'+a5_0x3010a6[_0x35052d(0x1fe)](_0x46e484));}return 0x0;}let _0x3d6428,_0xf81cab;try{_0x3d6428=await _0xd62020[_0x35052d(0x24b)]['resolveProjectId'](_0x30c9e1[_0x35052d(0x241)]);}catch(_0x22c0b5){const _0x2d1954=_0x22c0b5 instanceof Error?_0x22c0b5[_0x35052d(0x1d8)]:String(_0x22c0b5);return _0x2d1954[_0x35052d(0x245)](_0x35052d(0x229))||_0x2d1954[_0x35052d(0x230)]()[_0x35052d(0x245)](_0x35052d(0x1d4))?console[_0x35052d(0x1c9)](a5_0x3010a6[_0x35052d(0x20e)](_0x35052d(0x236)+_0x30c9e1[_0x35052d(0x241)])):console[_0x35052d(0x1c9)](a5_0x3010a6[_0x35052d(0x20e)](_0x35052d(0x1d5)+_0x30c9e1[_0x35052d(0x241)]+_0x35052d(0x1e9)+_0x2d1954)),0x1;}try{_0xf81cab=await _0xd62020[_0x35052d(0x24b)][_0x35052d(0x1e2)](_0x30c9e1[_0x35052d(0x258)],_0x3d6428);}catch(_0x5bd303){const _0x596c92=_0x5bd303 instanceof Error?_0x5bd303[_0x35052d(0x1d8)]:String(_0x5bd303);return _0x596c92['includes'](_0x35052d(0x229))||_0x596c92[_0x35052d(0x230)]()[_0x35052d(0x245)](_0x35052d(0x1d4))?console[_0x35052d(0x1c9)](a5_0x3010a6[_0x35052d(0x20e)](_0x35052d(0x1cb)+_0x30c9e1[_0x35052d(0x258)])):console[_0x35052d(0x1c9)](a5_0x3010a6['red'](_0x35052d(0x1d9)+_0x30c9e1[_0x35052d(0x258)]+'\x22:\x20'+_0x596c92)),0x1;}let _0x5d71b7;if(!_0x5afae7)try{_0x5d71b7=await setupEvaluatorAgent(_0xd62020['llm'],_0x1aa8a5['verbose']);}catch(_0x50b9e4){const _0x3def6b=_0x50b9e4 instanceof Error?_0x50b9e4['message']:String(_0x50b9e4);return console[_0x35052d(0x1c9)](a5_0x3010a6['red']('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x3def6b)),0x1;}console[_0x35052d(0x1c9)](a5_0x3010a6[_0x35052d(0x232)](_0x35052d(0x218))),console[_0x35052d(0x1c9)]('Site:\x20'+a5_0x3010a6['white'](_0xeffa9f)),console[_0x35052d(0x1c9)](_0x35052d(0x254)+a5_0x3010a6[_0x35052d(0x1d1)](_0x30c9e1[_0x35052d(0x241)]+'/'+_0x30c9e1[_0x35052d(0x258)])),console[_0x35052d(0x1c9)]();const _0xf7f55c=[],_0xb7500a=[],_0x2eb031=Date[_0x35052d(0x1f0)]();for(let _0x545d90=0x0;_0x545d90<_0x26d4d7['length'];_0x545d90++){const _0xd74fb9=_0x26d4d7[_0x545d90];_0x26d4d7['length']>0x1?console[_0x35052d(0x1c9)](_0x35052d(0x1ef)+(_0x545d90+0x1)+'/'+_0x26d4d7[_0x35052d(0x1f8)]+':\x20'+a5_0x3010a6['white'](_0xd74fb9[_0x35052d(0x24c)])):console[_0x35052d(0x1c9)]('Running\x20test:\x20'+a5_0x3010a6[_0x35052d(0x1d1)](_0xd74fb9[_0x35052d(0x24c)]));const _0x373c8d=createCommandSpinner('Round\x201/'+_0xd74fb9['rounds'][_0x35052d(0x1f8)]+':\x20Sending\x20user\x20input...');_0x373c8d['start']();try{const {result:_0x2880a1,conversation:_0x1b90c7}=await runTest(_0xd62020[_0x35052d(0x24b)],_0xd74fb9,{'agentId':_0xf81cab,'projectId':_0x3d6428,'site':_0xeffa9f,'noEval':_0x5afae7,'evaluatorId':_0x5d71b7,'onRoundStart':(_0x11054f,_0x4f220c)=>{const _0x213192=_0x35052d;_0x373c8d[_0x213192(0x257)]=_0x213192(0x1ea)+(_0x11054f+0x1)+'/'+_0x4f220c+_0x213192(0x1f5);},'onRoundComplete':(_0x44d29e,_0x32c544,_0x458541)=>{const _0x4ef218=_0x35052d,_0x502ed2=formatElapsed(_0x32c544);_0x458541?console[_0x4ef218(0x1c9)](_0x4ef218(0x1cd)+(_0x44d29e+0x1)+'/'+_0xd74fb9[_0x4ef218(0x226)]['length']+_0x4ef218(0x238)+a5_0x3010a6['green']('✓')+'\x20('+_0x502ed2+')'):console['log'](_0x4ef218(0x1cd)+(_0x44d29e+0x1)+'/'+_0xd74fb9[_0x4ef218(0x226)]['length']+_0x4ef218(0x238)+a5_0x3010a6[_0x4ef218(0x20e)]('✗'));},'onEvaluationStart':()=>{const _0x17b4f3=_0x35052d;_0x373c8d[_0x17b4f3(0x257)]=_0x17b4f3(0x1e8);},'onEvaluationComplete':_0xbf6a1a=>{const _0x51eee2=_0x35052d,_0x2d41fb=formatElapsed(_0xbf6a1a);console[_0x51eee2(0x1c9)](_0x51eee2(0x1e0)+a5_0x3010a6['green']('✓')+'\x20('+_0x2d41fb+')');}});_0x373c8d[_0x35052d(0x23b)](),_0xf7f55c[_0x35052d(0x237)](_0x2880a1),_0xb7500a[_0x35052d(0x237)](_0x1b90c7);if(_0x2880a1['status']===_0x35052d(0x222))console[_0x35052d(0x1c9)](a5_0x3010a6[_0x35052d(0x1f7)](_0x35052d(0x209)+_0x2880a1[_0x35052d(0x1fd)]));else _0x2880a1[_0x35052d(0x1e1)]===_0x35052d(0x24e)?console[_0x35052d(0x1c9)](a5_0x3010a6[_0x35052d(0x20e)](_0x35052d(0x246)+_0x2880a1[_0x35052d(0x1fd)])):console[_0x35052d(0x1c9)](a5_0x3010a6[_0x35052d(0x20e)](_0x35052d(0x216)+_0x2880a1[_0x35052d(0x1fd)]));_0x2880a1[_0x35052d(0x227)]&&console[_0x35052d(0x1c9)](a5_0x3010a6[_0x35052d(0x1fe)](_0x35052d(0x242)+_0x2880a1[_0x35052d(0x227)])),console[_0x35052d(0x1c9)]();}catch(_0x518c31){_0x373c8d[_0x35052d(0x23b)]();const _0x8b70cc=_0x518c31 instanceof Error?_0x518c31[_0x35052d(0x1d8)]:String(_0x518c31);console['log'](a5_0x3010a6[_0x35052d(0x20e)]('✗\x20ERROR:\x20'+_0x8b70cc)),console['log'](),_0xf7f55c[_0x35052d(0x237)]({'name':_0xd74fb9['name'],'status':_0x35052d(0x20f),'reason':_0x8b70cc,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x3919c8=Date[_0x35052d(0x1f0)]()-_0x2eb031,_0x2db5dd=_0xf7f55c['filter'](_0x533936=>_0x533936[_0x35052d(0x1e1)]==='PASS')[_0x35052d(0x1f8)],_0x938f52=_0xf7f55c[_0x35052d(0x1fb)](_0x472e28=>_0x472e28['status']===_0x35052d(0x24e))['length'],_0x53f37a=_0xf7f55c[_0x35052d(0x1fb)](_0x4f8ff9=>_0x4f8ff9[_0x35052d(0x1e1)]===_0x35052d(0x20f))[_0x35052d(0x1f8)];console[_0x35052d(0x1c9)]('━'[_0x35052d(0x22f)](0x3c)),console[_0x35052d(0x1c9)](_0x35052d(0x1d2)),console[_0x35052d(0x1c9)]('━'[_0x35052d(0x22f)](0x3c)),console[_0x35052d(0x1c9)](_0x35052d(0x25a)+_0xf7f55c[_0x35052d(0x1f8)]),console[_0x35052d(0x1c9)](_0x35052d(0x224)+a5_0x3010a6[_0x35052d(0x1f7)](_0x2db5dd)),console[_0x35052d(0x1c9)]('Failed:\x20\x20\x20'+a5_0x3010a6[_0x35052d(0x20e)](_0x938f52));_0x53f37a>0x0&&console[_0x35052d(0x1c9)]('Errors:\x20\x20\x20'+a5_0x3010a6[_0x35052d(0x20e)](_0x53f37a));console['log'](_0x35052d(0x1db)+formatElapsed(_0x3919c8)),console['log']('━'['repeat'](0x3c));const _0x1eaffd=_0xf7f55c[_0x35052d(0x1fb)](_0x3a9c39=>_0x3a9c39[_0x35052d(0x1e1)]!==_0x35052d(0x222));if(_0x1eaffd[_0x35052d(0x1f8)]>0x0){console[_0x35052d(0x1c9)](),console['log'](_0x35052d(0x24d));for(const _0x316642 of _0x1eaffd){const _0x5c26af=a5_0x3010a6[_0x35052d(0x20e)]('✗'),_0x2e36c8=_0x316642['reason'][_0x35052d(0x1f8)]>0x32?_0x316642[_0x35052d(0x1fd)]['substring'](0x0,0x32)+_0x35052d(0x1de):_0x316642[_0x35052d(0x1fd)];console['log']('\x20\x20'+_0x5c26af+'\x20'+_0x316642[_0x35052d(0x24c)]+':\x20'+_0x2e36c8);}}const _0x202829={'summary':{'total':_0xf7f55c[_0x35052d(0x1f8)],'passed':_0x2db5dd,'failed':_0x938f52,'errors':_0x53f37a>0x0?_0x53f37a:undefined,'duration_ms':_0x3919c8},'tests':_0xf7f55c,'agent':{'project':_0x30c9e1[_0x35052d(0x241)],'name':_0x30c9e1[_0x35052d(0x258)],'site':_0xeffa9f},'timestamp':new Date(_0x2eb031)[_0x35052d(0x20b)]()};try{const _0x348fba=buildCachedTestRun(_0xb7500a,{'site':_0xeffa9f,'projectId':_0x3d6428,'projectName':_0x30c9e1[_0x35052d(0x241)],'agentId':_0xf81cab,'agentName':_0x30c9e1[_0x35052d(0x258)],'testYmlPath':a5_0x4c8f4e[_0x35052d(0x1d3)](_0x30c9e1[_0x35052d(0x1e7)])});saveLastTestRun(_0x348fba);}catch{}if(_0x4e9864!==_0x35052d(0x1e5)||_0x3789e3){const _0x3262db=formatResults(_0x202829,_0x4e9864);if(_0x3789e3)try{a5_0x23eb5e[_0x35052d(0x259)](_0x3789e3,_0x3262db,'utf-8'),console['log'](),console[_0x35052d(0x1c9)](a5_0x3010a6[_0x35052d(0x1fe)]('Output\x20written\x20to:\x20'+_0x3789e3));}catch(_0x2dc438){return console[_0x35052d(0x1c9)](),console[_0x35052d(0x1c9)](a5_0x3010a6[_0x35052d(0x20e)](_0x35052d(0x1c8)+_0x2dc438)),0x1;}else console[_0x35052d(0x1c9)](),console[_0x35052d(0x1c9)](_0x3262db);}return _0x1eaffd[_0x35052d(0x1f8)]>0x0?0x1:0x0;}async[a5_0x3eb29a(0x25d)](_0x438a42,_0x1301bf){const _0x2e9425=a5_0x3eb29a,{options:_0x22ae34,tdx:_0x59fcd0}=_0x438a42,{definition:_0x2341a1,agentInfo:_0x123180,outputFormat:_0x51a806,outputFile:_0x3005a8}=_0x1301bf,_0x9d4603=_0x22ae34[_0x2e9425(0x221)],_0x151c6b=loadLastTestRun();if(!_0x151c6b)return console['log'](a5_0x3010a6[_0x2e9425(0x20e)]('Error:\x20No\x20previous\x20test\x20run\x20found.')),console[_0x2e9425(0x1c9)](a5_0x3010a6[_0x2e9425(0x1fe)](_0x2e9425(0x208))),0x1;if(_0x151c6b['agent'][_0x2e9425(0x258)]!==_0x123180[_0x2e9425(0x258)])return console[_0x2e9425(0x1c9)](a5_0x3010a6[_0x2e9425(0x20e)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x151c6b[_0x2e9425(0x1cc)][_0x2e9425(0x258)]+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0x123180[_0x2e9425(0x258)]+'\x22.')),console[_0x2e9425(0x1c9)](a5_0x3010a6[_0x2e9425(0x1fe)](_0x2e9425(0x1dd))),0x1;const _0x1b423f=new Set(_0x151c6b['conversations'][_0x2e9425(0x20c)](_0x448230=>_0x448230[_0x2e9425(0x24a)])),_0x524d6d=_0x2341a1[_0x2e9425(0x234)][_0x2e9425(0x1fb)](_0x485948=>!_0x1b423f[_0x2e9425(0x1ed)](_0x485948[_0x2e9425(0x24c)]));if(_0x524d6d['length']>0x0&&_0x151c6b[_0x2e9425(0x221)]!==_0x9d4603)return console[_0x2e9425(0x1c9)](a5_0x3010a6['red'](_0x2e9425(0x21e))),console[_0x2e9425(0x1c9)](a5_0x3010a6[_0x2e9425(0x1fe)](_0x2e9425(0x22a)+_0x151c6b['site']+_0x2e9425(0x202)+_0x9d4603+'\x22.')),console['log'](a5_0x3010a6[_0x2e9425(0x1fe)]('Either\x20switch\x20to\x20the\x20\x22'+_0x151c6b[_0x2e9425(0x221)]+'\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.')),0x1;const _0x510339=_0x2341a1[_0x2e9425(0x234)][_0x2e9425(0x1fb)](_0x596ed3=>_0x1b423f[_0x2e9425(0x1ed)](_0x596ed3[_0x2e9425(0x24c)])),_0x31780d=_0x524d6d;let _0x4e5fcd;try{_0x4e5fcd=await setupEvaluatorAgent(_0x59fcd0[_0x2e9425(0x24b)],_0x22ae34[_0x2e9425(0x1e3)]);}catch(_0x29a40b){const _0x4c250c=_0x29a40b instanceof Error?_0x29a40b[_0x2e9425(0x1d8)]:String(_0x29a40b);return console[_0x2e9425(0x1c9)](a5_0x3010a6[_0x2e9425(0x20e)](_0x2e9425(0x219)+_0x4c250c)),0x1;}console[_0x2e9425(0x1c9)](a5_0x3010a6[_0x2e9425(0x232)](_0x2e9425(0x214))),console[_0x2e9425(0x1c9)](_0x2e9425(0x1cf)+a5_0x3010a6[_0x2e9425(0x1d1)](_0x151c6b[_0x2e9425(0x25b)])),console[_0x2e9425(0x1c9)](_0x2e9425(0x254)+a5_0x3010a6[_0x2e9425(0x1d1)](_0x151c6b[_0x2e9425(0x1cc)][_0x2e9425(0x241)]+'/'+_0x151c6b[_0x2e9425(0x1cc)][_0x2e9425(0x258)]));_0x31780d[_0x2e9425(0x1f8)]>0x0&&console[_0x2e9425(0x1c9)](_0x2e9425(0x22d)+a5_0x3010a6[_0x2e9425(0x22b)](_0x31780d[_0x2e9425(0x1f8)]));console[_0x2e9425(0x1c9)]();const _0x4c9ead=[],_0x3d5efd=Date[_0x2e9425(0x1f0)](),_0x21c341=createCommandSpinner(_0x2e9425(0x24f));if(_0x510339[_0x2e9425(0x1f8)]>0x0)try{const _0x1839ab=await reevaluateFromCache(_0x59fcd0[_0x2e9425(0x24b)],_0x151c6b,{'tests':_0x510339},{'evaluatorId':_0x4e5fcd,'onTestStart':(_0x337c2f,_0x52cf3f,_0x397b59)=>{const _0x1fcb6f=_0x2e9425;_0x21c341[_0x1fcb6f(0x257)]='Re-evaluating\x20'+(_0x52cf3f+0x1)+'/'+_0x397b59+':\x20'+_0x337c2f+'...';if(!_0x21c341['isSpinning'])_0x21c341[_0x1fcb6f(0x21f)]();},'onTestComplete':(_0x956710,_0x192e0e)=>{const _0x51c76f=_0x2e9425;_0x21c341[_0x51c76f(0x23b)]();if(_0x192e0e['status']==='PASS')console[_0x51c76f(0x1c9)](a5_0x3010a6[_0x51c76f(0x1f7)](_0x51c76f(0x209)+_0x956710)+a5_0x3010a6[_0x51c76f(0x1fe)]('\x20(cached)'));else _0x192e0e[_0x51c76f(0x1e1)]==='FAIL'?console['log'](a5_0x3010a6[_0x51c76f(0x20e)]('✗\x20FAIL:\x20'+_0x956710+_0x51c76f(0x23a)+_0x192e0e[_0x51c76f(0x1fd)])+a5_0x3010a6[_0x51c76f(0x1fe)](_0x51c76f(0x215))):console[_0x51c76f(0x1c9)](a5_0x3010a6[_0x51c76f(0x20e)](_0x51c76f(0x216)+_0x956710+_0x51c76f(0x23a)+_0x192e0e[_0x51c76f(0x1fd)]));_0x192e0e[_0x51c76f(0x227)]&&console[_0x51c76f(0x1c9)](a5_0x3010a6[_0x51c76f(0x1fe)](_0x51c76f(0x21c)+_0x192e0e[_0x51c76f(0x227)])),_0x4c9ead[_0x51c76f(0x237)](_0x192e0e);},'onTestSkipped':(_0x370a9f,_0x19c0a3)=>{const _0x50aec5=_0x2e9425;_0x21c341[_0x50aec5(0x23b)](),console[_0x50aec5(0x1c9)](a5_0x3010a6[_0x50aec5(0x22b)](_0x50aec5(0x200)+_0x370a9f+_0x50aec5(0x23a)+_0x19c0a3));}});for(const _0x51d167 of _0x1839ab){!_0x4c9ead[_0x2e9425(0x1fa)](_0x2338a4=>_0x2338a4[_0x2e9425(0x24c)]===_0x51d167[_0x2e9425(0x24c)])&&_0x4c9ead[_0x2e9425(0x237)](_0x51d167);}}catch(_0x8a52e2){_0x21c341['stop']();const _0x2f715c=_0x8a52e2 instanceof Error?_0x8a52e2['message']:String(_0x8a52e2);return console['log'](a5_0x3010a6[_0x2e9425(0x20e)](_0x2e9425(0x21d)+_0x2f715c)),0x1;}_0x21c341[_0x2e9425(0x23b)]();if(_0x31780d['length']>0x0){console[_0x2e9425(0x1c9)](),console[_0x2e9425(0x1c9)](a5_0x3010a6['cyan'](_0x2e9425(0x1ff)));const {projectId:_0x51bb30,agentId:_0x452291}=_0x151c6b[_0x2e9425(0x1cc)];for(const _0x2df987 of _0x31780d){console[_0x2e9425(0x1c9)](_0x2e9425(0x207)+a5_0x3010a6['white'](_0x2df987[_0x2e9425(0x24c)]));const _0x3b6e80=createCommandSpinner(_0x2e9425(0x1e4)+_0x2df987[_0x2e9425(0x226)][_0x2e9425(0x1f8)]+_0x2e9425(0x1f5));_0x3b6e80[_0x2e9425(0x21f)]();try{const {result:_0x3bc13f}=await runTest(_0x59fcd0[_0x2e9425(0x24b)],_0x2df987,{'agentId':_0x452291,'projectId':_0x51bb30,'site':_0x151c6b[_0x2e9425(0x221)],'noEval':![],'evaluatorId':_0x4e5fcd,'onRoundStart':(_0x4dae5e,_0x4f9fd2)=>{const _0x452ec1=_0x2e9425;_0x3b6e80[_0x452ec1(0x257)]=_0x452ec1(0x1ea)+(_0x4dae5e+0x1)+'/'+_0x4f9fd2+_0x452ec1(0x1f5);},'onRoundComplete':(_0x27bb4c,_0x4223df,_0x4dc040)=>{const _0x39ee3e=_0x2e9425,_0x56edae=formatElapsed(_0x4223df);_0x4dc040?console[_0x39ee3e(0x1c9)]('\x20\x20Round\x20'+(_0x27bb4c+0x1)+'/'+_0x2df987[_0x39ee3e(0x226)]['length']+_0x39ee3e(0x238)+a5_0x3010a6[_0x39ee3e(0x1f7)]('✓')+'\x20('+_0x56edae+')'):console[_0x39ee3e(0x1c9)](_0x39ee3e(0x1cd)+(_0x27bb4c+0x1)+'/'+_0x2df987['rounds']['length']+_0x39ee3e(0x238)+a5_0x3010a6[_0x39ee3e(0x20e)]('✗'));},'onEvaluationStart':()=>{const _0x52d2d5=_0x2e9425;_0x3b6e80[_0x52d2d5(0x257)]=_0x52d2d5(0x1e8);},'onEvaluationComplete':_0x945574=>{const _0x4243e2=_0x2e9425,_0xc9b372=formatElapsed(_0x945574);console[_0x4243e2(0x1c9)](_0x4243e2(0x1e0)+a5_0x3010a6['green']('✓')+'\x20('+_0xc9b372+')');}});_0x3b6e80[_0x2e9425(0x23b)](),_0x4c9ead['push'](_0x3bc13f);if(_0x3bc13f[_0x2e9425(0x1e1)]===_0x2e9425(0x222))console['log'](a5_0x3010a6[_0x2e9425(0x1f7)](_0x2e9425(0x209)+_0x3bc13f[_0x2e9425(0x1fd)])+a5_0x3010a6[_0x2e9425(0x1fe)](_0x2e9425(0x231)));else _0x3bc13f[_0x2e9425(0x1e1)]===_0x2e9425(0x24e)?console[_0x2e9425(0x1c9)](a5_0x3010a6[_0x2e9425(0x20e)](_0x2e9425(0x246)+_0x3bc13f['reason'])+a5_0x3010a6[_0x2e9425(0x1fe)](_0x2e9425(0x231))):console[_0x2e9425(0x1c9)](a5_0x3010a6[_0x2e9425(0x20e)](_0x2e9425(0x216)+_0x3bc13f['reason']));_0x3bc13f['conversation_url']&&console[_0x2e9425(0x1c9)](a5_0x3010a6['dim'](_0x2e9425(0x21c)+_0x3bc13f['conversation_url']));}catch(_0x4def42){_0x3b6e80[_0x2e9425(0x23b)]();const _0x48c5b3=_0x4def42 instanceof Error?_0x4def42['message']:String(_0x4def42);console[_0x2e9425(0x1c9)](a5_0x3010a6[_0x2e9425(0x20e)](_0x2e9425(0x216)+_0x48c5b3)),_0x4c9ead['push']({'name':_0x2df987[_0x2e9425(0x24c)],'status':'ERROR','reason':_0x48c5b3,'timestamp':new Date()[_0x2e9425(0x20b)](),'duration_ms':0x0});}}}console[_0x2e9425(0x1c9)]();const _0x46d323=Date['now']()-_0x3d5efd,_0x27a00c=_0x4c9ead[_0x2e9425(0x1fb)](_0x3e93f9=>_0x3e93f9[_0x2e9425(0x1e1)]===_0x2e9425(0x222))[_0x2e9425(0x1f8)],_0x3bc75e=_0x4c9ead[_0x2e9425(0x1fb)](_0x4a8073=>_0x4a8073[_0x2e9425(0x1e1)]===_0x2e9425(0x24e))['length'],_0x4d7aca=_0x4c9ead['filter'](_0x40cf51=>_0x40cf51[_0x2e9425(0x1e1)]===_0x2e9425(0x20f))['length'];console['log']('━'[_0x2e9425(0x22f)](0x3c)),console[_0x2e9425(0x1c9)](_0x2e9425(0x1eb)),console[_0x2e9425(0x1c9)]('━'[_0x2e9425(0x22f)](0x3c)),console[_0x2e9425(0x1c9)]('Total:\x20\x20\x20\x20'+_0x4c9ead[_0x2e9425(0x1f8)]),console[_0x2e9425(0x1c9)](_0x2e9425(0x224)+a5_0x3010a6[_0x2e9425(0x1f7)](_0x27a00c)),console['log'](_0x2e9425(0x22c)+a5_0x3010a6[_0x2e9425(0x20e)](_0x3bc75e));_0x4d7aca>0x0&&console[_0x2e9425(0x1c9)]('Errors:\x20\x20\x20'+a5_0x3010a6[_0x2e9425(0x20e)](_0x4d7aca));console['log']('Duration:\x20'+formatElapsed(_0x46d323)),console[_0x2e9425(0x1c9)]('━'['repeat'](0x3c));const _0x56612a={'summary':{'total':_0x4c9ead[_0x2e9425(0x1f8)],'passed':_0x27a00c,'failed':_0x3bc75e,'errors':_0x4d7aca>0x0?_0x4d7aca:undefined,'duration_ms':_0x46d323},'tests':_0x4c9ead,'agent':{'project':_0x123180[_0x2e9425(0x241)],'name':_0x123180[_0x2e9425(0x258)],'site':_0x9d4603},'timestamp':new Date(_0x3d5efd)[_0x2e9425(0x20b)]()};if(_0x51a806!=='table'||_0x3005a8){const _0x2d7a36=formatResults(_0x56612a,_0x51a806);if(_0x3005a8)try{a5_0x23eb5e[_0x2e9425(0x259)](_0x3005a8,_0x2d7a36,_0x2e9425(0x23c)),console[_0x2e9425(0x1c9)](),console[_0x2e9425(0x1c9)](a5_0x3010a6['dim'](_0x2e9425(0x213)+_0x3005a8));}catch(_0x256e23){return console['log'](),console[_0x2e9425(0x1c9)](a5_0x3010a6[_0x2e9425(0x20e)]('Error\x20writing\x20output\x20file:\x20'+_0x256e23)),0x1;}else console[_0x2e9425(0x1c9)](),console[_0x2e9425(0x1c9)](_0x2d7a36);}const _0x5929d5=_0x4c9ead[_0x2e9425(0x1fb)](_0x24c1f1=>_0x24c1f1['status']!==_0x2e9425(0x222));return _0x5929d5[_0x2e9425(0x1f8)]>0x0?0x1:0x0;}}function a5_0x3d27(){const _0x54456c=['Output\x20written\x20to:\x20','Re-evaluating\x20cached\x20test\x20run...','\x20(cached)','✗\x20ERROR:\x20','basename','Running\x20agent\x20tests...','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','7116758WNJYBD','9606975LrlaUZ','\x20\x20Conversation:\x20','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','start','24dDMSVY','site','PASS','Available\x20tests:\x20','Passed:\x20\x20\x20','tsv','rounds','conversation_url','description','404','Cached\x20run\x20is\x20from\x20site\x20\x22','yellow','Failed:\x20\x20\x20','New\x20tests\x20to\x20execute:\x20','Run\x20\x27tdx\x20agent\x20pull\x20','repeat','toLowerCase','\x20(new)','cyan','context','tests','Available\x20tags:\x20','✗\x20ERROR:\x20Project\x20not\x20found:\x20','push','...\x20','eval','\x20-\x20','stop','utf-8','no_context','4042diINfx','\x20\x20Site:\x20','14wDGtpd','projectName','Conversation\x20URL:\x20','source','agentDirs','includes','✗\x20FAIL:\x20','Tests\x20found:\x20','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','No\x20tests\x20found\x20matching:\x20','testName','llm','name','Failed\x20Tests:','FAIL','Re-evaluating...','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','6665432YpxhGs','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Agent:\x20','\x20\x20-\x20','forEach','text','agentName','writeFileSync','Total:\x20\x20\x20\x20','timestamp','11383470rPELfG','executeReeval','2008770frLpWT','3558DqHtlK','json','Error\x20writing\x20output\x20file:\x20','log','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','agent','\x20\x20Round\x20','3396xRcBUY','Cached\x20run\x20from:\x20','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','white','Test\x20Summary','resolve','not\x20found','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','existsSync','\x20\x20Agent:\x20','message','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','execute','Duration:\x20','round','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','...','llmProject','\x20\x20Evaluating...\x20','status','resolveAgentId','verbose','Round\x201/','table','split','testYmlPath','Evaluating\x20response...','\x22:\x20','Round\x20','Re-evaluation\x20Summary','9SCSdVQ','has','reeval','Test\x20','now','no_tests','No\x20tests\x20have\x20tags\x20defined.','/<agent-name>','\x27\x20to\x20create\x20the\x20folder\x20structure.',':\x20Sending\x20user\x20input...','some','green','length','tags','find','filter','trim','reason','dim','Executing\x20new\x20tests...','⚠\x20SKIPPED:\x20','dryRun','\x22,\x20but\x20current\x20site\x20is\x20\x22','Project\x20path:\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)','\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','projectDir','Running:\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','✓\x20PASS:\x20','jsonl','toISOString','map','Using\x20agent:\x20','red','ERROR','205tnbAWd','\x20\x20Project:\x20','found'];a5_0x3d27=function(){return _0x54456c;};return a5_0x3d27();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a6_0xfd58(_0x277489,_0x352237){_0x277489=_0x277489-0xf4;const _0x37c627=a6_0x37c6();let _0xfd5816=_0x37c627[_0x277489];return _0xfd5816;}const a6_0x21168b=a6_0xfd58;(function(_0x25951c,_0x1a48ae){const _0x683435=a6_0xfd58,_0x1e75b2=_0x25951c();while(!![]){try{const _0x3cf576=-parseInt(_0x683435(0x12a))/0x1*(parseInt(_0x683435(0x107))/0x2)+-parseInt(_0x683435(0x117))/0x3*(parseInt(_0x683435(0x134))/0x4)+parseInt(_0x683435(0x108))/0x5+parseInt(_0x683435(0x10f))/0x6+parseInt(_0x683435(0xfe))/0x7+-parseInt(_0x683435(0x11a))/0x8*(parseInt(_0x683435(0x124))/0x9)+-parseInt(_0x683435(0x130))/0xa*(parseInt(_0x683435(0x112))/0xb);if(_0x3cf576===_0x1a48ae)break;else _0x1e75b2['push'](_0x1e75b2['shift']());}catch(_0x1bc70e){_0x1e75b2['push'](_0x1e75b2['shift']());}}}(a6_0x37c6,0xdf742));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x21168b(0x100),'proxy-authorization',a6_0x21168b(0xfc),a6_0x21168b(0x123),a6_0x21168b(0x135),a6_0x21168b(0x11b),a6_0x21168b(0x118),a6_0x21168b(0x133)]);function a6_0x37c6(){const _0x2876c3=['x-trino-user','3926356BqszyF','set-cookie2','verbose','indexOf','description','entries','join','<\x20HTTP/1.1\x20','request','cdp','cookie','Endpoint\x20must\x20start\x20with\x20/:\x20','9248862XtCCta','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','authorization','keys','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','error','log','message','name','30658IoPQTo','4982485wpwmpi','toUpperCase','substring','api','status','llm','body','3261492iEEsUd','Invalid\x20API\x20type:\x20','has','3256ImWNEF','noColor','Results\x20saved\x20to\x20','isArray','\x22.\x20','3FIfZHd','x-auth-token','workflow','24ZZbbwl','x-xsrf-token','method','data','site','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','GET','includes','type','set-cookie','2177667HPYqbv','output','headers','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','color','file','9PMGaxk','validate','execute','PUT','Error:\x20','cas','3400QvhCLV','length','Invalid\x20header\x20format:\x20\x22'];a6_0x37c6=function(){return _0x2876c3;};return a6_0x37c6();}function isSensitiveHeader(_0x5350df){const _0x3e7ce3=a6_0x21168b;return SENSITIVE_HEADERS[_0x3e7ce3(0x111)](_0x5350df['toLowerCase']());}function parseHeader(_0x388f60){const _0x59d8c7=a6_0x21168b,_0x4a1195=_0x388f60[_0x59d8c7(0xf5)](':');if(_0x4a1195===-0x1)throw new Error(_0x59d8c7(0x132)+_0x388f60+_0x59d8c7(0x116)+_0x59d8c7(0x102));const _0x7a319c=_0x388f60[_0x59d8c7(0x10a)](0x0,_0x4a1195)['trim'](),_0x458048=_0x388f60[_0x59d8c7(0x10a)](_0x4a1195+0x1)['trim']();if(!_0x7a319c)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0x388f60+'\x22');return[_0x7a319c,_0x458048];}export class ApiCommand extends BaseCommand{[a6_0x21168b(0x106)]='api';[a6_0x21168b(0xf6)]=a6_0x21168b(0x11f);[a6_0x21168b(0x12b)](_0x348c44){const _0x5c990d=a6_0x21168b,{args:_0x3b8cd7,options:_0x1946d8}=_0x348c44,_0x24f863=_0x1946d8;if(_0x3b8cd7[_0x5c990d(0x131)]===0x0)return _0x5c990d(0xff);const _0x21e534=_0x3b8cd7[0x0];if(!_0x21e534['startsWith']('/'))return _0x5c990d(0xfd)+_0x21e534;const _0x1c0cd9=_0x24f863[_0x5c990d(0x11d)],_0x272bd9=_0x24f863[_0x5c990d(0x129)];if(_0x1c0cd9&&_0x272bd9)return _0x5c990d(0x127);const _0x4f1c27=_0x24f863[_0x5c990d(0x11c)]||_0x5c990d(0x120),_0x158c73=[_0x5c990d(0x120),'POST',_0x5c990d(0x12d),'DELETE','PATCH'];if(!_0x158c73[_0x5c990d(0x121)](_0x4f1c27[_0x5c990d(0x109)]()))return'Invalid\x20HTTP\x20method:\x20'+_0x4f1c27+'.\x20Valid\x20methods:\x20'+_0x158c73[_0x5c990d(0xf8)](',\x20');const _0x11ae53=_0x24f863[_0x5c990d(0x122)]||'td',_0x4ff19f=['td',_0x5c990d(0xfb),_0x5c990d(0x119),'trino',_0x5c990d(0x10d),'llm-proxy',_0x5c990d(0x12f)];if(!_0x4ff19f[_0x5c990d(0x121)](_0x11ae53))return _0x5c990d(0x110)+_0x11ae53+'.\x20Valid\x20types:\x20'+_0x4ff19f['join'](',\x20');return undefined;}async[a6_0x21168b(0x12c)](_0x58f667){const _0x3934d9=a6_0x21168b,{options:_0x17d5b5,args:_0xe1f722,tdx:_0xd7ac72}=_0x58f667,_0x476c1a=_0x17d5b5,_0x387dd9=_0xe1f722[0x0],_0x27bbfb=(_0x476c1a['method']||_0x3934d9(0x120))[_0x3934d9(0x109)](),_0x1320a7=_0x476c1a[_0x3934d9(0x11d)],_0x3d1479=_0x476c1a[_0x3934d9(0x129)],_0xe9a7c5=_0x476c1a['header'],_0x215e3a=_0x476c1a[_0x3934d9(0x122)]||'td';try{const _0x5ce46e={};if(_0xe9a7c5){const _0xa0dfd8=Array[_0x3934d9(0x115)](_0xe9a7c5)?_0xe9a7c5:[_0xe9a7c5];for(const _0x3c7511 of _0xa0dfd8){const [_0x30256d,_0xf381a9]=parseHeader(_0x3c7511);_0x5ce46e[_0x30256d]=_0xf381a9;}}let _0x3a5126;if(_0x1320a7)_0x3a5126=_0x1320a7;else{if(_0x3d1479)try{_0x3a5126=RawAPI['readBodyFromFile'](_0x3d1479);}catch(_0x738865){return console[_0x3934d9(0x103)](_0x3934d9(0x12e)+(_0x738865 instanceof Error?_0x738865[_0x3934d9(0x105)]:String(_0x738865))),0x1;}}const _0x3d64df={'method':_0x27bbfb,'apiType':_0x215e3a,'includeHeaders':_0x17d5b5[_0x3934d9(0xf4)]};_0x3a5126&&(_0x3d64df[_0x3934d9(0x10e)]=_0x3a5126);Object[_0x3934d9(0x101)](_0x5ce46e)[_0x3934d9(0x131)]>0x0&&(_0x3d64df[_0x3934d9(0x126)]=_0x5ce46e);if(_0x17d5b5[_0x3934d9(0xf4)]){const _0x22887c=resolveSite(_0x17d5b5[_0x3934d9(0x11e)]),_0x4b7b15=getEndpoint(_0x22887c,_0x215e3a),_0x394c5f=''+_0x4b7b15+_0x387dd9;console[_0x3934d9(0x103)]('>\x20'+_0x27bbfb+'\x20'+_0x394c5f);const _0x3bde2c=getAuthHeaders(_0x22887c),_0x1bed8e={..._0x3bde2c,..._0x5ce46e};for(const [_0x159695,_0x1ce830]of Object[_0x3934d9(0xf7)](_0x1bed8e)){!isSensitiveHeader(_0x159695)&&console[_0x3934d9(0x103)]('>\x20'+_0x159695+':\x20'+_0x1ce830);}_0x3a5126&&console['error']('>'),console[_0x3934d9(0x103)]('');}const _0xd66621=await _0xd7ac72[_0x3934d9(0x10b)][_0x3934d9(0xfa)](_0x387dd9,_0x3d64df);if(_0x17d5b5[_0x3934d9(0xf4)]&&_0xd66621[_0x3934d9(0x126)]){console['error'](_0x3934d9(0xf9)+_0xd66621[_0x3934d9(0x10c)]);for(const [_0x354d42,_0x3d1b16]of Object['entries'](_0xd66621[_0x3934d9(0x126)])){!isSensitiveHeader(_0x354d42)&&console['error']('<\x20'+_0x354d42+':\x20'+_0x3d1b16);}console[_0x3934d9(0x103)]('');}const _0x3f0589=Boolean(_0x17d5b5[_0x3934d9(0x125)]),_0x539d89={'color':_0x17d5b5[_0x3934d9(0x128)],'noColor':_0x17d5b5[_0x3934d9(0x113)]||_0x3f0589&&!_0x17d5b5['color']},_0x20eec=colorizeJSON(_0xd66621['data'],_0x539d89);return _0x17d5b5['output']?(writeFileSync(_0x17d5b5[_0x3934d9(0x125)],_0x20eec),console[_0x3934d9(0x103)](_0x3934d9(0x114)+_0x17d5b5[_0x3934d9(0x125)])):console[_0x3934d9(0x104)](_0x20eec),0x0;}catch(_0x473fa4){return _0x473fa4 instanceof Error?(console[_0x3934d9(0x103)](_0x3934d9(0x12e)+_0x473fa4[_0x3934d9(0x105)]),_0x17d5b5[_0x3934d9(0xf4)]&&_0x473fa4['stack']&&console['error']('\x0aStack\x20trace:\x0a'+_0x473fa4['stack'])):console[_0x3934d9(0x103)]('Error:\x20'+String(_0x473fa4)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a7_0x488b54=a7_0xce7e;function a7_0xce7e(_0x54439d,_0x1b9316){_0x54439d=_0x54439d-0xf7;const _0x47bf78=a7_0x47bf();let _0xce7e9=_0x47bf78[_0x54439d];return _0xce7e9;}(function(_0x4fbd04,_0x1e8201){const _0x56fa94=a7_0xce7e,_0x4e167b=_0x4fbd04();while(!![]){try{const _0x38fd71=-parseInt(_0x56fa94(0x157))/0x1*(-parseInt(_0x56fa94(0x15b))/0x2)+-parseInt(_0x56fa94(0x124))/0x3*(parseInt(_0x56fa94(0x152))/0x4)+-parseInt(_0x56fa94(0x14b))/0x5*(-parseInt(_0x56fa94(0x13c))/0x6)+-parseInt(_0x56fa94(0x118))/0x7+-parseInt(_0x56fa94(0x103))/0x8+parseInt(_0x56fa94(0x14c))/0x9+parseInt(_0x56fa94(0xfb))/0xa*(parseInt(_0x56fa94(0x119))/0xb);if(_0x38fd71===_0x1e8201)break;else _0x4e167b['push'](_0x4e167b['shift']());}catch(_0x16aa75){_0x4e167b['push'](_0x4e167b['shift']());}}}(a7_0x47bf,0x61312));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync,loadGlobalProxy}from'../core/config.js';import{getOAuthTokens,saveOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';function a7_0x47bf(){const _0x495265=['✗\x20Validation\x20failed:\x20','email','Sign\x20in\x20with\x20browser\x20(recommended)','98265AEAloy','\x20(site:\x20','method','Validating\x20OAuth\x20tokens...','2nbFbhC','trim','getUserInfo','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','10UVxqyD','tdx:\x20auth\x20setup','site','✓\x20Default\x20site\x20set\x20to\x20','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','For\x20scripts\x20or\x20headless\x20servers','execute','select','3778800JnZRMB','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','text','all','join','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','warn','cyan','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','description','red','auth:clear','System\x20keychain\x20is\x20not\x20available','\x27\x20registered','us01','Read\x20credential\x20from\x20','Read\x20credential\x20from\x20keychain','OAuth\x20tokens','Opening\x20browser\x20for\x20authentication...','\x20(profile:\x20','\x20and\x20','2548217bcFEuB','13713458ZRTjZB','\x20for\x20profile:\x20','create','ERROR','jobs','bold','API\x20key\x20cannot\x20be\x20empty','message','first_name','filter','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','15987JSwfYE','tdx\x20profile:\x20','Setup\x20cancelled','accountName','\x20removed\x20from\x20keychain','dim','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','oauth','You\x20can\x20find\x20your\x20API\x20key\x20at:','Setup\x20API\x20key\x20authentication\x20interactively','Choose\x20how\x20to\x20sign\x20in:','yellow','Credential\x20type:\x20OAuth','Enter\x20your\x20TD\x20API\x20key:','log','Name:\x20','\x20\x20tdx','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','last_name','✓\x20Profile\x20\x27','Use\x20an\x20API\x20key','auth:setup','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','2202OHsrWP','\x20--profile\x20','password','No\x20credentials\x20found\x20in\x20keychain','error','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','✓\x20Authentication\x20successful\x0a','tdx:\x20auth\x20clear','profile','/users/initiate_sso\x20(account:\x20','apiKey','Setting\x20up\x20authentication\x20for\x20site:\x20','apikey','auth','logLevel','2880BeWXmM','1179981bmWICW','/oauth/authorize','/app/mp/ak','\x20\x20user_id:','access_token','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','340lcMAoL','name'];a7_0x47bf=function(){return _0x495265;};return a7_0x47bf();}import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{startOAuthFlow}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x27a895 from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a7_0x4a8097 from'chalk';export async function runOAuthLoginFlow(_0xe7f617,_0x25593f,_0x27e1ab,_0x37ff47){const _0x51a81f=a7_0xce7e,_0x530ad0=await isKeychainAvailable();if(!_0x530ad0)throw new Error(_0x51a81f(0x10b)+_0x51a81f(0x136));let _0x33d86d=_0x37ff47?.[_0x51a81f(0x127)];if(!_0x33d86d){const _0x1f923f=await a7_0x27a895({'type':_0x51a81f(0x105),'name':_0x51a81f(0x127),'message':_0x51a81f(0x104)});if(_0x1f923f[_0x51a81f(0x127)]===undefined)throw new Error('Setup\x20cancelled');_0x33d86d=_0x1f923f[_0x51a81f(0x127)][_0x51a81f(0xf7)]()||undefined;}const _0x760d2b=getConsoleUrl(_0xe7f617);console['log'](_0x51a81f(0x115));_0x33d86d?console[_0x51a81f(0x132)]('\x20\x20'+_0x760d2b+_0x51a81f(0x145)+_0x33d86d+')'):console[_0x51a81f(0x132)]('\x20\x20'+_0x760d2b+_0x51a81f(0x14d));console[_0x51a81f(0x132)](_0x51a81f(0xf9));const _0x531927=loadGlobalProxy()||process.env.HTTPS_PROXY||process.env.HTTP_PROXY,_0x3aba48=await startOAuthFlow(_0xe7f617,{'accountName':_0x33d86d,'proxy':_0x531927});console[_0x51a81f(0x132)](_0x51a81f(0x15a));const _0x1b45b9=TDX[_0x51a81f(0x11b)]({'site':_0xe7f617,'accessToken':_0x3aba48[_0x51a81f(0x150)],'logLevel':_0x27e1ab??LogLevel[_0x51a81f(0x11c)]}),_0x21c44f=await _0x1b45b9[_0x51a81f(0x11d)][_0x51a81f(0xf8)]();console[_0x51a81f(0x132)](a7_0x4a8097['green']('✓\x20Signed\x20in\x20successfully')),console[_0x51a81f(0x132)]('\x20\x20'+a7_0x4a8097[_0x51a81f(0x10a)](_0xe7f617+':'+_0x21c44f['account_id'])+_0x51a81f(0x14f)+_0x21c44f['id']+'\x20\x20('+_0x21c44f['email']+')');!_0x33d86d&&(console[_0x51a81f(0x132)](a7_0x4a8097[_0x51a81f(0x129)]('\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:')),console[_0x51a81f(0x132)](a7_0x4a8097[_0x51a81f(0x129)](_0x51a81f(0xfa))),console[_0x51a81f(0x132)](a7_0x4a8097[_0x51a81f(0x129)](_0x51a81f(0x135))));await saveOAuthTokens(_0x3aba48,_0x25593f),console[_0x51a81f(0x132)]('✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain'+(_0x25593f?_0x51a81f(0x116)+_0x25593f+')':''));if(_0x25593f){const _0x45ab14={'site':_0xe7f617};saveProfileToUserConfig(_0x25593f,_0x45ab14),console['log'](_0x51a81f(0x138)+_0x25593f+_0x51a81f(0x110));}else saveDefaultSiteToUserConfig(_0xe7f617),console[_0x51a81f(0x132)](_0x51a81f(0xfe)+_0xe7f617);const _0x56d972=_0x25593f?_0x51a81f(0x13d)+_0x25593f:'';console[_0x51a81f(0x132)](),console[_0x51a81f(0x132)](_0x51a81f(0xff)),console[_0x51a81f(0x132)](_0x51a81f(0x134)+_0x56d972+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console['log'](_0x51a81f(0x134)+_0x56d972+_0x51a81f(0x151));}export async function promptAuthMethod(){const _0xd0361a=a7_0xce7e,_0x3309c4=await a7_0x27a895({'type':_0xd0361a(0x102),'name':_0xd0361a(0x159),'message':_0xd0361a(0x12e),'choices':[{'title':_0xd0361a(0x156),'description':'Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','value':'oauth'},{'title':_0xd0361a(0x139),'description':_0xd0361a(0x100),'value':_0xd0361a(0x148)}]});return _0x3309c4[_0xd0361a(0x159)]||null;}export class AuthSetupCommand extends BaseCommand{[a7_0x488b54(0x153)]=a7_0x488b54(0x13a);['description']=a7_0x488b54(0x12d);async[a7_0x488b54(0x101)](_0xfa1b4b){const _0x3aa772=a7_0x488b54,{options:_0x258c9e}=_0xfa1b4b,_0x4f4273=_0x258c9e[_0x3aa772(0x144)];console[_0x3aa772(0x132)](a7_0x4a8097[_0x3aa772(0x11e)](_0x3aa772(0xfc)));const _0x4f12de=_0x258c9e[_0x3aa772(0xfd)]||_0x3aa772(0x111),_0x4c95b6=await promptSiteSelection(_0x4f12de,_0x4f4273,_0x3aa772(0x126));if(!_0x4c95b6)return 0x1;const _0x15daf9=resolveSite(_0x4c95b6),_0x666d6=await promptAuthMethod();if(!_0x666d6)return console[_0x3aa772(0x132)]('\x0aSetup\x20cancelled'),0x1;if(_0x666d6===_0x3aa772(0x12b)){const {accountName:_0x1d539c}=_0x258c9e;return await runOAuthLoginFlow(_0x15daf9,_0x4f4273,_0x258c9e[_0x3aa772(0x14a)]??LogLevel[_0x3aa772(0x11c)],{'accountName':_0x1d539c}),0x0;}console[_0x3aa772(0x132)](_0x3aa772(0x147)+_0x15daf9),console[_0x3aa772(0x132)](_0x3aa772(0x12c)),console[_0x3aa772(0x132)]('\x20\x20'+getConsoleUrl(_0x15daf9,_0x3aa772(0x14e)));const _0x51652b=await a7_0x27a895({'type':_0x3aa772(0x13e),'name':'apiKey','message':_0x3aa772(0x131),'validate':_0x5bcb82=>{const _0x54bafb=_0x3aa772;if(!_0x5bcb82||!_0x5bcb82[_0x54bafb(0xf7)]())return _0x54bafb(0x11f);return!![];}});if(!_0x51652b[_0x3aa772(0x146)])return console['log']('\x0aSetup\x20cancelled'),0x1;const _0x19b07f=_0x51652b[_0x3aa772(0x146)];console['log']('Validating\x20API\x20key...');try{const _0x3c8edb=TDX[_0x3aa772(0x11b)]({'site':_0x15daf9,'apiKey':_0x19b07f['trim'](),'logLevel':_0x258c9e[_0x3aa772(0x14a)]??LogLevel[_0x3aa772(0x11c)]}),_0x1ee532=await _0x3c8edb[_0x3aa772(0x11d)][_0x3aa772(0xf8)]();console['log'](_0x3aa772(0x141)+_0x1ee532['email']+')');const _0x12fca1=await isKeychainAvailable();_0x12fca1?(await saveAPIKeyAsync(_0x19b07f[_0x3aa772(0xf7)](),_0x15daf9,_0x4f4273),console['log'](_0x3aa772(0x123)+(_0x4f4273?_0x3aa772(0x116)+_0x4f4273+')':''))):(console[_0x3aa772(0x109)](a7_0x4a8097[_0x3aa772(0x12f)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),console[_0x3aa772(0x109)](a7_0x4a8097[_0x3aa772(0x12f)](_0x3aa772(0x108))));if(_0x4f4273){const _0x3ac421={'site':_0x15daf9};saveProfileToUserConfig(_0x4f4273,_0x3ac421),console[_0x3aa772(0x132)]('✓\x20Profile\x20\x27'+_0x4f4273+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x15daf9),console[_0x3aa772(0x132)](_0x3aa772(0xfe)+_0x15daf9);const _0x4bbf67=_0x4f4273?'\x20--profile\x20'+_0x4f4273:'';return console['log'](),console[_0x3aa772(0x132)](_0x3aa772(0xff)),console[_0x3aa772(0x132)](_0x3aa772(0x134)+_0x4bbf67+_0x3aa772(0x12a)),console[_0x3aa772(0x132)](_0x3aa772(0x134)+_0x4bbf67+_0x3aa772(0x151)),0x0;}catch(_0x33a53e){if(_0x33a53e instanceof HTTPClientError&&_0x33a53e['status']===0x191)return printAuthError(_0x33a53e),0x1;return console['error'](a7_0x4a8097['red'](_0x3aa772(0x154)+(_0x33a53e instanceof Error?_0x33a53e['message']:String(_0x33a53e)))),console['error']('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x488b54(0x153)]=a7_0x488b54(0x149);['description']=a7_0x488b54(0x13b);async['execute'](_0x394b2b){const _0x20731d=a7_0x488b54,{options:_0x3e300d,tdx:_0x1bc869}=_0x394b2b,_0x403cb4=_0x3e300d[_0x20731d(0xfd)],_0x2cbceb=_0x3e300d[_0x20731d(0x144)],_0x34b140=_0x2cbceb?_0x2cbceb:'N/A';console[_0x20731d(0x132)](_0x20731d(0x125)+_0x34b140+_0x20731d(0x158)+_0x403cb4+')');const _0x3a01a5=await getOAuthTokens(_0x2cbceb);if(_0x3a01a5)console['log'](_0x20731d(0x130)),console[_0x20731d(0x132)](_0x20731d(0x113)+(_0x2cbceb?_0x20731d(0x116)+_0x2cbceb+')':''));else{const _0x5a29f2=await resolveAPIKeyAsync(_0x403cb4,_0x2cbceb);if(_0x5a29f2){const {source:_0x5cd09d,isDeprecated:_0x315516}=_0x5a29f2,_0x4778d1=_0x20731d(0x112)+_0x5cd09d;console[_0x20731d(0x132)](_0x315516?a7_0x4a8097[_0x20731d(0x12f)](_0x4778d1):_0x4778d1);}else console[_0x20731d(0x132)](a7_0x4a8097[_0x20731d(0x12f)]('No\x20credential\x20found'));}try{const _0x3566ba=await _0x1bc869[_0x20731d(0x11d)]['getUserInfo']();return console['log'](a7_0x4a8097['green'](_0x20731d(0x142))),console[_0x20731d(0x132)]('User:\x20'+_0x3566ba[_0x20731d(0x155)]),(_0x3566ba[_0x20731d(0x121)]||_0x3566ba[_0x20731d(0x137)])&&console['log'](_0x20731d(0x133)+[_0x3566ba[_0x20731d(0x121)],_0x3566ba[_0x20731d(0x137)]]['filter'](Boolean)[_0x20731d(0x107)]('\x20')),0x0;}catch(_0x59c03b){return _0x59c03b instanceof HTTPClientError&&_0x59c03b['status']===0x191?printAuthError(_0x59c03b,!![],_0x2cbceb):console[_0x20731d(0x140)](a7_0x4a8097[_0x20731d(0x10d)](_0x20731d(0x154)+(_0x59c03b instanceof Error?_0x59c03b[_0x20731d(0x120)]:String(_0x59c03b)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x488b54(0x153)]=a7_0x488b54(0x10e);[a7_0x488b54(0x10c)]='Remove\x20API\x20key\x20from\x20system\x20keychain';async[a7_0x488b54(0x101)](_0x4df59a){const _0x4c7841=a7_0x488b54,{options:_0x22db47}=_0x4df59a,_0x38762f=_0x22db47[_0x4c7841(0x144)];console[_0x4c7841(0x132)](a7_0x4a8097[_0x4c7841(0x11e)](_0x4c7841(0x143)));const _0x25f19d=await isKeychainAvailable();if(!_0x25f19d)return console[_0x4c7841(0x140)](a7_0x4a8097[_0x4c7841(0x10d)](_0x4c7841(0x10f))),0x1;const [_0x40bffb,_0x5f116e]=await Promise[_0x4c7841(0x106)]([deleteKeychainAPIKey(_0x38762f),deleteOAuthTokens(_0x38762f)]);if(_0x40bffb||_0x5f116e){clearCredentialCache();const _0x4478d5=[_0x40bffb&&'API\x20key',_0x5f116e&&_0x4c7841(0x114)][_0x4c7841(0x122)](Boolean)[_0x4c7841(0x107)](_0x4c7841(0x117));return console[_0x4c7841(0x132)]('✓\x20'+_0x4478d5+_0x4c7841(0x128)+(_0x38762f?_0x4c7841(0x116)+_0x38762f+')':'')),0x0;}else return console[_0x4c7841(0x132)](_0x4c7841(0x13f)+(_0x38762f?_0x4c7841(0x11a)+_0x38762f:'')),0x1;}}
|
|
1
|
+
const a7_0x4ca683=a7_0x1ce4;(function(_0x5d3b5e,_0x2fa7c8){const _0x53f1bc=a7_0x1ce4,_0x500aa1=_0x5d3b5e();while(!![]){try{const _0xddd279=parseInt(_0x53f1bc(0x214))/0x1*(parseInt(_0x53f1bc(0x223))/0x2)+parseInt(_0x53f1bc(0x1f6))/0x3*(-parseInt(_0x53f1bc(0x21f))/0x4)+-parseInt(_0x53f1bc(0x1d1))/0x5+parseInt(_0x53f1bc(0x200))/0x6*(-parseInt(_0x53f1bc(0x1cc))/0x7)+parseInt(_0x53f1bc(0x1d2))/0x8*(parseInt(_0x53f1bc(0x1d5))/0x9)+parseInt(_0x53f1bc(0x1d9))/0xa+-parseInt(_0x53f1bc(0x1f3))/0xb*(-parseInt(_0x53f1bc(0x1cf))/0xc);if(_0xddd279===_0x2fa7c8)break;else _0x500aa1['push'](_0x500aa1['shift']());}catch(_0x555a7a){_0x500aa1['push'](_0x500aa1['shift']());}}}(a7_0x44b5,0x512fd));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync,loadGlobalProxy}from'../core/config.js';import{getOAuthTokens,saveOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';import{clearCredentialCache}from'../core/credential-cache.js';import{startOAuthFlow}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x2601f6 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_0x1f8795 from'chalk';function a7_0x44b5(){const _0x582426=['first_name','message','Use\x20an\x20API\x20key','oauth','User:\x20','us01','profile','\x20\x20tdx','\x20removed\x20from\x20keychain','✓\x20Profile\x20\x27','\x20--profile\x20','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','Name:\x20','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','apiKey','API\x20key\x20cannot\x20be\x20empty','Setting\x20up\x20authentication\x20for\x20site:\x20','tdx\x20profile:\x20','No\x20credentials\x20found\x20in\x20keychain','last_name','auth:clear','method','accountName','getUserInfo','11ujinoY','ERROR','auth:setup','1062ywAZRn','/users/initiate_sso\x20(account:\x20','dim','Enter\x20your\x20TD\x20API\x20key:','Credential\x20type:\x20OAuth','select','\x0aSetup\x20cancelled','/app/mp/ak','yellow','\x20\x20(','211746UfYDED','execute','cyan','text','For\x20scripts\x20or\x20headless\x20servers','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','\x20(site:\x20','Setup\x20cancelled','✗\x20Validation\x20failed:\x20','error','Opening\x20browser\x20for\x20authentication...','red','\x20(profile:\x20','Choose\x20how\x20to\x20sign\x20in:','warn','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','create','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','\x20and\x20','47525SXzZsN','join','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','/oauth/authorize','access_token','email','auth','green','Validating\x20OAuth\x20tokens...','No\x20credential\x20found','all','5316GZZtSv','API\x20key','name','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','22aukyFw','trim','site','status','\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','✓\x20Signed\x20in\x20successfully','tdx:\x20auth\x20setup','tdx:\x20auth\x20clear','apikey','description','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','N/A','log','Read\x20credential\x20from\x20keychain','91OzNlRT','password','✓\x20Default\x20site\x20set\x20to\x20','314532DGmZTB','\x20\x20user_id:','1794185ZMTtNa','19768PwWlob','Setup\x20API\x20key\x20authentication\x20interactively','Sign\x20in\x20with\x20browser\x20(recommended)','2079YDfBPZ','\x20for\x20profile:\x20','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','5008400BmHzHS','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'];a7_0x44b5=function(){return _0x582426;};return a7_0x44b5();}export async function runOAuthLoginFlow(_0x59b844,_0x287f2c,_0x2c1194,_0x5a8102){const _0x3b200e=a7_0x1ce4,_0x4be97f=await isKeychainAvailable();if(!_0x4be97f)throw new Error(_0x3b200e(0x206)+_0x3b200e(0x205));let _0x52da58=_0x5a8102?.[_0x3b200e(0x1f1)];if(!_0x52da58){const _0x284549=await a7_0x2601f6({'type':_0x3b200e(0x203),'name':_0x3b200e(0x1f1),'message':_0x3b200e(0x1d7)});if(_0x284549[_0x3b200e(0x1f1)]===undefined)throw new Error(_0x3b200e(0x208));_0x52da58=_0x284549[_0x3b200e(0x1f1)]['trim']()||undefined;}const _0x105412=getConsoleUrl(_0x59b844);console[_0x3b200e(0x1ca)](_0x3b200e(0x20b));_0x52da58?console[_0x3b200e(0x1ca)]('\x20\x20'+_0x105412+_0x3b200e(0x1f7)+_0x52da58+')'):console[_0x3b200e(0x1ca)]('\x20\x20'+_0x105412+_0x3b200e(0x217));console[_0x3b200e(0x1ca)]('Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...');const _0x2919c9=loadGlobalProxy()||process.env.HTTPS_PROXY||process.env.HTTP_PROXY,_0x3e9a45=await startOAuthFlow(_0x59b844,{'accountName':_0x52da58,'proxy':_0x2919c9});console[_0x3b200e(0x1ca)](_0x3b200e(0x21c));const _0x58d84d=TDX[_0x3b200e(0x211)]({'site':_0x59b844,'accessToken':_0x3e9a45[_0x3b200e(0x218)],'logLevel':_0x2c1194??LogLevel[_0x3b200e(0x1f4)]}),_0x488e21=await _0x58d84d['jobs'][_0x3b200e(0x1f2)]();console['log'](a7_0x1f8795[_0x3b200e(0x21b)](_0x3b200e(0x1c3))),console[_0x3b200e(0x1ca)]('\x20\x20'+a7_0x1f8795[_0x3b200e(0x202)](_0x59b844+':'+_0x488e21['account_id'])+_0x3b200e(0x1d0)+_0x488e21['id']+_0x3b200e(0x1ff)+_0x488e21['email']+')');!_0x52da58&&(console[_0x3b200e(0x1ca)](a7_0x1f8795[_0x3b200e(0x1f8)](_0x3b200e(0x1c2))),console[_0x3b200e(0x1ca)](a7_0x1f8795['dim']('\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>')),console[_0x3b200e(0x1ca)](a7_0x1f8795['dim'](_0x3b200e(0x1c8))));await saveOAuthTokens(_0x3e9a45,_0x287f2c),console[_0x3b200e(0x1ca)](_0x3b200e(0x212)+(_0x287f2c?_0x3b200e(0x20d)+_0x287f2c+')':''));if(_0x287f2c){const _0x2c4fda={'site':_0x59b844};saveProfileToUserConfig(_0x287f2c,_0x2c4fda),console['log'](_0x3b200e(0x1e4)+_0x287f2c+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x59b844),console[_0x3b200e(0x1ca)](_0x3b200e(0x1ce)+_0x59b844);const _0x31bdf8=_0x287f2c?_0x3b200e(0x1e5)+_0x287f2c:'';console[_0x3b200e(0x1ca)](),console[_0x3b200e(0x1ca)](_0x3b200e(0x1da)),console['log'](_0x3b200e(0x1e2)+_0x31bdf8+_0x3b200e(0x216)),console[_0x3b200e(0x1ca)](_0x3b200e(0x1e2)+_0x31bdf8+_0x3b200e(0x1e6));}function a7_0x1ce4(_0x21c749,_0x298908){_0x21c749=_0x21c749-0x1bf;const _0x44b52a=a7_0x44b5();let _0x1ce4fc=_0x44b52a[_0x21c749];return _0x1ce4fc;}export async function promptAuthMethod(){const _0x5ea7c7=a7_0x1ce4,_0x51aa40=await a7_0x2601f6({'type':_0x5ea7c7(0x1fb),'name':_0x5ea7c7(0x1f0),'message':_0x5ea7c7(0x20e),'choices':[{'title':_0x5ea7c7(0x1d4),'description':_0x5ea7c7(0x1e8),'value':_0x5ea7c7(0x1de)},{'title':_0x5ea7c7(0x1dd),'description':_0x5ea7c7(0x204),'value':_0x5ea7c7(0x1c6)}]});return _0x51aa40['method']||null;}export class AuthSetupCommand extends BaseCommand{[a7_0x4ca683(0x221)]=a7_0x4ca683(0x1f5);['description']=a7_0x4ca683(0x1d3);async[a7_0x4ca683(0x201)](_0x3d1c40){const _0xbcc19a=a7_0x4ca683,{options:_0x5c9e89}=_0x3d1c40,_0x270957=_0x5c9e89[_0xbcc19a(0x1e1)];console[_0xbcc19a(0x1ca)](a7_0x1f8795['bold'](_0xbcc19a(0x1c4)));const _0x273edb=_0x5c9e89[_0xbcc19a(0x1c0)]||_0xbcc19a(0x1e0),_0xbd303b=await promptSiteSelection(_0x273edb,_0x270957,'Setup\x20cancelled');if(!_0xbd303b)return 0x1;const _0x3f9501=resolveSite(_0xbd303b),_0x3ba2ad=await promptAuthMethod();if(!_0x3ba2ad)return console[_0xbcc19a(0x1ca)](_0xbcc19a(0x1fc)),0x1;if(_0x3ba2ad===_0xbcc19a(0x1de)){const {accountName:_0x373a1a}=_0x5c9e89;return await runOAuthLoginFlow(_0x3f9501,_0x270957,_0x5c9e89['logLevel']??LogLevel[_0xbcc19a(0x1f4)],{'accountName':_0x373a1a}),0x0;}console['log'](_0xbcc19a(0x1eb)+_0x3f9501),console[_0xbcc19a(0x1ca)]('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0xbcc19a(0x1ca)]('\x20\x20'+getConsoleUrl(_0x3f9501,_0xbcc19a(0x1fd)));const _0x5c13dc=await a7_0x2601f6({'type':_0xbcc19a(0x1cd),'name':_0xbcc19a(0x1e9),'message':_0xbcc19a(0x1f9),'validate':_0xf0f908=>{const _0x20c9b8=_0xbcc19a;if(!_0xf0f908||!_0xf0f908[_0x20c9b8(0x1bf)]())return _0x20c9b8(0x1ea);return!![];}});if(!_0x5c13dc['apiKey'])return console[_0xbcc19a(0x1ca)](_0xbcc19a(0x1fc)),0x1;const _0x302241=_0x5c13dc[_0xbcc19a(0x1e9)];console[_0xbcc19a(0x1ca)]('Validating\x20API\x20key...');try{const _0x24f471=TDX['create']({'site':_0x3f9501,'apiKey':_0x302241['trim'](),'logLevel':_0x5c9e89['logLevel']??LogLevel[_0xbcc19a(0x1f4)]}),_0x3642cf=await _0x24f471['jobs'][_0xbcc19a(0x1f2)]();console['log']('✓\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x3642cf[_0xbcc19a(0x219)]+')');const _0x2c79ca=await isKeychainAvailable();_0x2c79ca?(await saveAPIKeyAsync(_0x302241[_0xbcc19a(0x1bf)](),_0x3f9501,_0x270957),console[_0xbcc19a(0x1ca)]('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0x270957?_0xbcc19a(0x20d)+_0x270957+')':''))):(console[_0xbcc19a(0x20f)](a7_0x1f8795['yellow'](_0xbcc19a(0x222))),console[_0xbcc19a(0x20f)](a7_0x1f8795['yellow'](_0xbcc19a(0x1d8))));if(_0x270957){const _0x17e8fd={'site':_0x3f9501};saveProfileToUserConfig(_0x270957,_0x17e8fd),console[_0xbcc19a(0x1ca)]('✓\x20Profile\x20\x27'+_0x270957+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x3f9501),console[_0xbcc19a(0x1ca)](_0xbcc19a(0x1ce)+_0x3f9501);const _0x3d6537=_0x270957?_0xbcc19a(0x1e5)+_0x270957:'';return console[_0xbcc19a(0x1ca)](),console[_0xbcc19a(0x1ca)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0xbcc19a(0x1ca)](_0xbcc19a(0x1e2)+_0x3d6537+_0xbcc19a(0x216)),console['log'](_0xbcc19a(0x1e2)+_0x3d6537+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases'),0x0;}catch(_0x2fa89b){if(_0x2fa89b instanceof HTTPClientError&&_0x2fa89b['status']===0x191)return printAuthError(_0x2fa89b),0x1;return console['error'](a7_0x1f8795['red'](_0xbcc19a(0x209)+(_0x2fa89b instanceof Error?_0x2fa89b[_0xbcc19a(0x1dc)]:String(_0x2fa89b)))),console['error'](_0xbcc19a(0x210)),0x1;}}}export class AuthStatusCommand extends BaseCommand{['name']=a7_0x4ca683(0x21a);[a7_0x4ca683(0x1c7)]='Show\x20authentication\x20status\x20and\x20validate\x20API\x20key';async['execute'](_0x3f5351){const _0x58bb97=a7_0x4ca683,{options:_0x20d6c2,tdx:_0x402ed5}=_0x3f5351,_0x23a5a7=_0x20d6c2['site'],_0xb08098=_0x20d6c2[_0x58bb97(0x1e1)],_0x3237b9=_0xb08098?_0xb08098:_0x58bb97(0x1c9);console[_0x58bb97(0x1ca)](_0x58bb97(0x1ec)+_0x3237b9+_0x58bb97(0x207)+_0x23a5a7+')');const _0x4fb616=await getOAuthTokens(_0xb08098);if(_0x4fb616)console['log'](_0x58bb97(0x1fa)),console[_0x58bb97(0x1ca)](_0x58bb97(0x1cb)+(_0xb08098?'\x20(profile:\x20'+_0xb08098+')':''));else{const _0x2d5c95=await resolveAPIKeyAsync(_0x23a5a7,_0xb08098);if(_0x2d5c95){const {source:_0x1e5ceb,isDeprecated:_0x32a7a4}=_0x2d5c95,_0x3b261a='Read\x20credential\x20from\x20'+_0x1e5ceb;console['log'](_0x32a7a4?a7_0x1f8795['yellow'](_0x3b261a):_0x3b261a);}else console['log'](a7_0x1f8795[_0x58bb97(0x1fe)](_0x58bb97(0x21d)));}try{const _0x42d3cf=await _0x402ed5['jobs'][_0x58bb97(0x1f2)]();return console[_0x58bb97(0x1ca)](a7_0x1f8795[_0x58bb97(0x21b)]('✓\x20Authentication\x20successful\x0a')),console[_0x58bb97(0x1ca)](_0x58bb97(0x1df)+_0x42d3cf[_0x58bb97(0x219)]),(_0x42d3cf[_0x58bb97(0x1db)]||_0x42d3cf[_0x58bb97(0x1ee)])&&console['log'](_0x58bb97(0x1e7)+[_0x42d3cf[_0x58bb97(0x1db)],_0x42d3cf[_0x58bb97(0x1ee)]]['filter'](Boolean)[_0x58bb97(0x215)]('\x20')),0x0;}catch(_0x4822ab){return _0x4822ab instanceof HTTPClientError&&_0x4822ab[_0x58bb97(0x1c1)]===0x191?printAuthError(_0x4822ab,!![],_0xb08098):console['error'](a7_0x1f8795[_0x58bb97(0x20c)]('✗\x20Validation\x20failed:\x20'+(_0x4822ab instanceof Error?_0x4822ab[_0x58bb97(0x1dc)]:String(_0x4822ab)))),0x1;}}}export class AuthClearCommand extends BaseCommand{['name']=a7_0x4ca683(0x1ef);[a7_0x4ca683(0x1c7)]='Remove\x20API\x20key\x20from\x20system\x20keychain';async[a7_0x4ca683(0x201)](_0x459203){const _0x4fd0ef=a7_0x4ca683,{options:_0x5f103d}=_0x459203,_0xfa13e7=_0x5f103d['profile'];console[_0x4fd0ef(0x1ca)](a7_0x1f8795['bold'](_0x4fd0ef(0x1c5)));const _0x2e4732=await isKeychainAvailable();if(!_0x2e4732)return console[_0x4fd0ef(0x20a)](a7_0x1f8795[_0x4fd0ef(0x20c)]('System\x20keychain\x20is\x20not\x20available')),0x1;const [_0x24d08f,_0xd58168]=await Promise[_0x4fd0ef(0x21e)]([deleteKeychainAPIKey(_0xfa13e7),deleteOAuthTokens(_0xfa13e7)]);if(_0x24d08f||_0xd58168){clearCredentialCache();const _0x3a20f2=[_0x24d08f&&_0x4fd0ef(0x220),_0xd58168&&'OAuth\x20tokens']['filter'](Boolean)[_0x4fd0ef(0x215)](_0x4fd0ef(0x213));return console[_0x4fd0ef(0x1ca)]('✓\x20'+_0x3a20f2+_0x4fd0ef(0x1e3)+(_0xfa13e7?_0x4fd0ef(0x20d)+_0xfa13e7+')':'')),0x0;}else return console[_0x4fd0ef(0x1ca)](_0x4fd0ef(0x1ed)+(_0xfa13e7?_0x4fd0ef(0x1d6)+_0xfa13e7:'')),0x1;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cas-command.d.ts","sourceRoot":"","sources":["../../src/commands/cas-command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAqBhE;;GAEG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAC7C,QAAQ,CAAC,IAAI,cAAc;IAC3B,QAAQ,CAAC,WAAW,+BAA+B;IAE7C,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAmCxD;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAC7C,QAAQ,CAAC,IAAI,cAAc;IAC3B,QAAQ,CAAC,WAAW,oCAAoC;IAElD,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAuDxD;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAC7C,QAAQ,CAAC,IAAI,cAAc;IAC3B,QAAQ,CAAC,WAAW,4CAA4C;IAE1D,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAuFxD;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAC7C,QAAQ,CAAC,IAAI,cAAc;IAC3B,QAAQ,CAAC,WAAW,gCAAgC;IAE9C,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"cas-command.d.ts","sourceRoot":"","sources":["../../src/commands/cas-command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAqBhE;;GAEG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAC7C,QAAQ,CAAC,IAAI,cAAc;IAC3B,QAAQ,CAAC,WAAW,+BAA+B;IAE7C,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAmCxD;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAC7C,QAAQ,CAAC,IAAI,cAAc;IAC3B,QAAQ,CAAC,WAAW,oCAAoC;IAElD,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAuDxD;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAC7C,QAAQ,CAAC,IAAI,cAAc;IAC3B,QAAQ,CAAC,WAAW,4CAA4C;IAE1D,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAuFxD;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAC7C,QAAQ,CAAC,IAAI,cAAc;IAC3B,QAAQ,CAAC,WAAW,gCAAgC;IAE9C,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAgPxD;AAED;;;;;;;;;;;;;GAaG;AACH,qBAAa,kBAAmB,SAAQ,WAAW;IACjD,QAAQ,CAAC,IAAI,kBAAkB;IAC/B,QAAQ,CAAC,WAAW,qDAAqD;IAEnE,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CA2FxD;AAED;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,WAAW;IAChD,QAAQ,CAAC,IAAI,iBAAiB;IAC9B,QAAQ,CAAC,WAAW,6CAA6C;IAE3D,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CA0DxD"}
|