@treasuredata/tdx 2026.10.0 → 2026.10.2
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.d.ts +1 -1
- package/dist/cli-categories.js +1 -1
- package/dist/cli-categories.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-journey-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.d.ts.map +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-command.js.map +1 -1
- package/dist/commands/claude-statusline-command.d.ts.map +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-statusline-command.js.map +1 -1
- package/dist/commands/codex-command.d.ts.map +1 -1
- package/dist/commands/codex-command.js +1 -1
- package/dist/commands/codex-command.js.map +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-always-on-campaign-pull-command.js +1 -1
- package/dist/commands/engage-always-on-campaign-push-command.js +1 -1
- package/dist/commands/engage-always-on-campaign-validate-command.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-readiness-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-in-browser-message-command.js +1 -1
- package/dist/commands/engage-landing-page-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/engage-workspace-assignment-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/opencode-command.d.ts +10 -3
- package/dist/commands/opencode-command.d.ts.map +1 -1
- package/dist/commands/opencode-command.js +1 -1
- package/dist/commands/opencode-command.js.map +1 -1
- package/dist/commands/p13n-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.d.ts.map +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/profiles-command.js.map +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.d.ts +8 -0
- package/dist/commands/upgrade-command.d.ts.map +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/upgrade-command.js.map +1 -1
- package/dist/commands/usage-command.d.ts +10 -0
- package/dist/commands/usage-command.d.ts.map +1 -0
- package/dist/commands/usage-command.js +1 -0
- package/dist/commands/usage-command.js.map +1 -0
- 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.d.ts +2 -1
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/config.js.map +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.d.ts +1 -0
- package/dist/core/profile.d.ts.map +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/profile.js.map +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/site-mismatch.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.d.ts +5 -4
- package/dist/proxy/claude-usage-tracker.d.ts.map +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/claude-usage-tracker.js.map +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/auth-token.js +1 -1
- package/dist/sdk/cas/audience-context.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-schema.js +1 -1
- package/dist/sdk/cas/cas-audience-validator.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-schema.js +1 -1
- package/dist/sdk/cas/cas-segment-validator.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/cas/validate-files.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/p13n-studio-api-client.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/always-on-campaign-pull.js +1 -1
- package/dist/sdk/engage/always-on-campaign-push.js +1 -1
- package/dist/sdk/engage/always-on-campaign-validator.js +1 -1
- package/dist/sdk/engage/always-on-campaign-yaml.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-readiness-workflow.js +1 -1
- package/dist/sdk/engage/campaign-readiness.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/in-browser-message-pull.js +1 -1
- package/dist/sdk/engage/in-browser-message-push.js +1 -1
- package/dist/sdk/engage/in-browser-message-validator.js +1 -1
- package/dist/sdk/engage/in-browser-message-yaml.js +1 -1
- package/dist/sdk/engage/landing-page-init.js +1 -1
- package/dist/sdk/engage/landing-page-public-asset.js +1 -1
- package/dist/sdk/engage/landing-page-pull.js +1 -1
- package/dist/sdk/engage/landing-page-push.js +1 -1
- package/dist/sdk/engage/landing-page-static-site.js +1 -1
- package/dist/sdk/engage/landing-page-validator.js +1 -1
- package/dist/sdk/engage/landing-page-workspace.js +1 -1
- package/dist/sdk/engage/landing-page-yaml.js +1 -1
- package/dist/sdk/engage/list-campaign-schema.js +1 -1
- package/dist/sdk/engage/list-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/always-on-campaign-schema.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/in-browser-message-schema.js +1 -1
- package/dist/sdk/engage/types/landing-page-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage/workspace-assignments.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/codex-usage.d.ts +13 -0
- package/dist/sdk/llm/codex-usage.d.ts.map +1 -0
- package/dist/sdk/llm/codex-usage.js +1 -0
- package/dist/sdk/llm/codex-usage.js.map +1 -0
- 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/llm/work-models.d.ts +52 -0
- package/dist/sdk/llm/work-models.d.ts.map +1 -0
- package/dist/sdk/llm/work-models.js +1 -0
- package/dist/sdk/llm/work-models.js.map +1 -0
- package/dist/sdk/p13n-studio-errors.js +1 -1
- package/dist/sdk/p13n-studio.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/audience-context.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/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/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/td-user.d.ts +3 -0
- package/dist/utils/td-user.d.ts.map +1 -0
- package/dist/utils/td-user.js +1 -0
- package/dist/utils/td-user.js.map +1 -0
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
- package/dist/commands/ai-usage-command-base.d.ts +0 -26
- package/dist/commands/ai-usage-command-base.d.ts.map +0 -1
- package/dist/commands/ai-usage-command-base.js +0 -1
- package/dist/commands/ai-usage-command-base.js.map +0 -1
- package/dist/commands/claude-usage-command.d.ts +0 -19
- package/dist/commands/claude-usage-command.d.ts.map +0 -1
- package/dist/commands/claude-usage-command.js +0 -1
- package/dist/commands/claude-usage-command.js.map +0 -1
- package/dist/commands/opencode-usage-command.d.ts +0 -19
- package/dist/commands/opencode-usage-command.d.ts.map +0 -1
- package/dist/commands/opencode-usage-command.js +0 -1
- package/dist/commands/opencode-usage-command.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a3_0x409813=a3_0x1bef;(function(_0x29cf16,_0x1d15cf){const _0x2999b2=a3_0x1bef,_0x4a4d0c=_0x29cf16();while(!![]){try{const _0x51b3ab=parseInt(_0x2999b2(0xbf))/0x1+parseInt(_0x2999b2(0xc4))/0x2+-parseInt(_0x2999b2(0xb9))/0x3+-parseInt(_0x2999b2(0xaf))/0x4+-parseInt(_0x2999b2(0xbc))/0x5+parseInt(_0x2999b2(0xba))/0x6+parseInt(_0x2999b2(0xab))/0x7;if(_0x51b3ab===_0x1d15cf)break;else _0x4a4d0c['push'](_0x4a4d0c['shift']());}catch(_0x4de8e0){_0x4a4d0c['push'](_0x4a4d0c['shift']());}}}(a3_0x3632,0x471aa));import{BaseCommand}from'./command.js';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';function a3_0x1bef(_0x462d5c,_0xdfd2d4){_0x462d5c=_0x462d5c-0xa9;const _0x363217=a3_0x3632();let _0x1bef30=_0x363217[_0x462d5c];return _0x1bef30;}export class ActivationsCommand extends BaseCommand{[a3_0x409813(0xc8)]='activations';[a3_0x409813(0xb0)]=a3_0x409813(0xc6);async[a3_0x409813(0xb6)](_0x38adba){const _0x3b5156=a3_0x409813,{options:_0x371d40,args:_0x500609,tdx:_0x34e79f}=_0x38adba;if(_0x500609[_0x3b5156(0xa9)]===0x0)return console['error'](_0x3b5156(0xae)),console[_0x3b5156(0xc7)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;try{const {parentId:_0x29eb85,childId:_0x64468f}=parseSegmentRef(_0x500609[0x0]);if(!_0x64468f)return console['error'](_0x3b5156(0xb4)),console[_0x3b5156(0xc7)](_0x3b5156(0xc1)),0x1;_0x371d40[_0x3b5156(0xb8)]&&(console[_0x3b5156(0xc7)](_0x3b5156(0xb3)+_0x371d40['site']),console[_0x3b5156(0xc7)]('Parent\x20name:\x20'+_0x29eb85),console[_0x3b5156(0xc7)]('Child\x20name:\x20'+_0x64468f));const _0x13aebc=await withSpinner(_0x3b5156(0xc2)+_0x29eb85+_0x3b5156(0xbe),()=>_0x34e79f[_0x3b5156(0xb1)]['resolveParentId'](_0x29eb85),{'verbose':_0x371d40[_0x3b5156(0xb8)]}),_0x4420d0=_0x13aebc[_0x3b5156(0xb5)];_0x371d40[_0x3b5156(0xb8)]&&console[_0x3b5156(0xc7)](_0x3b5156(0xbb)+_0x4420d0);const _0xe6a396=await withSpinner(_0x3b5156(0xb7)+_0x64468f+_0x3b5156(0xbe),()=>_0x34e79f['segment']['resolveSegmentId'](_0x4420d0,_0x64468f),{'verbose':_0x371d40[_0x3b5156(0xb8)]}),_0x246854=_0xe6a396[_0x3b5156(0xb5)];_0x371d40['verbose']&&console['error'](_0x3b5156(0xc0)+_0x246854);const _0x31b6d1=await withSpinner(_0x3b5156(0xc3)+_0x64468f+'\x27...',()=>_0x34e79f['segment'][_0x3b5156(0xaa)](_0x4420d0,_0x246854),{'verbose':_0x371d40[_0x3b5156(0xb8)]}),_0x1cdbc3=_0x31b6d1['data'];return console['error']('✔\x20Found\x20'+_0x1cdbc3[_0x3b5156(0xa9)]+_0x3b5156(0xbd)+(_0x1cdbc3[_0x3b5156(0xa9)]!==0x1?'s':'')),await handleSDKOutput(_0x1cdbc3,_0x371d40),0x0;}catch(_0x5604fa){if(_0x5604fa instanceof SDKError)return console['error'](_0x3b5156(0xb2)+_0x5604fa[_0x3b5156(0xac)]),_0x5604fa[_0x3b5156(0xc5)]&&console[_0x3b5156(0xc7)](_0x3b5156(0xad)+_0x5604fa['cause']),0x1;throw _0x5604fa;}}}function a3_0x3632(){const _0x1f6fcf=['\x20activation','\x27...','105976jeMIOd','Resolved\x20child\x20ID:\x20','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','Resolving\x20parent\x20segment\x20\x27','Listing\x20activations\x20for\x20segment\x20\x27','256170XTYBtW','cause','List\x20activations\x20for\x20a\x20segment','error','name','length','listActivations','6962277TwobuA','message','\x20\x20Cause:\x20','Error:\x20Segment\x20name\x20is\x20required','2075568RJfjWr','description','segment','Error:\x20','Site:\x20','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','data','execute','Resolving\x20child\x20segment\x20\x27','verbose','606687bOmhsM','779148HgCMkV','Resolved\x20parent\x20ID:\x20','1730835dPsfgJ'];a3_0x3632=function(){return _0x1f6fcf;};return a3_0x3632();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a4_0x16f2(_0x30832d,_0x380ce9){_0x30832d=_0x30832d-0x7b;const _0x13a8bf=a4_0x13a8();let _0x16f243=_0x13a8bf[_0x30832d];return _0x16f243;}const a4_0x3622c6=a4_0x16f2;(function(_0x49c9d6,_0x5a0e36){const _0x23db02=a4_0x16f2,_0x476db6=_0x49c9d6();while(!![]){try{const _0x58fd96=parseInt(_0x23db02(0xa7))/0x1*(-parseInt(_0x23db02(0xbe))/0x2)+-parseInt(_0x23db02(0x9c))/0x3+-parseInt(_0x23db02(0xdf))/0x4+-parseInt(_0x23db02(0xfe))/0x5*(parseInt(_0x23db02(0x7c))/0x6)+parseInt(_0x23db02(0xe7))/0x7+parseInt(_0x23db02(0xf8))/0x8+parseInt(_0x23db02(0xdd))/0x9*(parseInt(_0x23db02(0x92))/0xa);if(_0x58fd96===_0x5a0e36)break;else _0x476db6['push'](_0x476db6['shift']());}catch(_0x1c2029){_0x476db6['push'](_0x476db6['shift']());}}}(a4_0x13a8,0x7aaa8));import a4_0x2632f5 from'chalk';import a4_0x102520 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';function a4_0x13a8(){const _0x53e74e=['\x20\x20Source:\x20','agentName','Analyzing\x20project\x20\x22','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','push','yes','\x20errors','Would\x20push\x20agent:\x20','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','green','no_context','\x20|\x20','prompts','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','<new-name>','cwd-config','Dry\x20run\x20-\x20no\x20files\x20written','Cannot\x20clone\x20from\x20context\x20project\x20\x22','\x20\x20Knowledge\x20Bases:\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','\x20resources?','pushAgent','gray','Using\x20project\x20from\x20','agents','Pulling\x20agent\x20\x22','log','projectDir','counts','\x0aWrite\x20','total','\x20\x20Chat\x20Interfaces:\x20','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x20\x20Prompt\x20\x22','\x20\x20Form\x20Interfaces:\x20','formInterfaces','projectId','2342094qFTpZG','\x20--name\x20','\x20\x20Integration\x20\x22','tdx.json','\x20total','dirname','agent:pull','Pushing\x20to\x20project...','updated','Project:\x20','Using\x20local\x20project:\x20','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20files\x20to\x20','\x0aPull\x20summary\x20for\x20\x27','created','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)','sourceProjectName','llm','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','\x20updated','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','16987970HoAFZT','isNew','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x20\x20tdx\x20agent\x20pull\x20','knowledgeBases','Using\x20project:\x20','agent:clone','Dry\x20run\x20-\x20no\x20changes\x20made','Would\x20clone:','force','2285052lGTMUf','Agent\x20','\x20\x20Experimental\x20Artifacts:\x20','action','\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)','\x20\x20Agents:\x20','New\x20project\x20ID:\x20','context','-\x20no\x20files\x20written','\x20\x20Integrations:\x20','llmProject','198LrTLmk','\x0aPush\x20summary\x20for\x20\x27','no_local_folder','newProjectId','Cancelled','cwd','Output\x20path:\x20','Cloning\x20\x22','\x20changed','\x20\x20Prompts:\x20','projectName','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','description','Source:\x20','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','\x20\x20Experimental\x20Artifact\x20\x22','yellow','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','new','unchanged','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','dim','Project\x20cloned\x20with\x20errors','5668VEpTzF','experimentalArtifacts','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','pullAgent','Using\x20context\x20project:\x20','cyan','session','Chat:\x20','\x20=\x20','\x20\x20Form\x20Interface\x20\x22','\x22...','\x22\x20from\x20project\x20\x22','chatInterfaces','\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','join','error','\x20\x20Chat\x20Interface\x20\x22','found','Writing\x20files...','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','diff','output','textKnowledgeBases','\x20\x20tdx\x20agent\x20clone\x20agents/','\x20successfully','reason','pullProject','\x20unchanged','errors','agent.yml','\x0aChanges\x20to\x20prompt\x20\x27','9pmZSFi','Using\x20project\x20from\x20context:\x20','2527644IGTeQO','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','Using\x20current\x20project:\x20','No\x20tdx.json\x20found\x20in\x20','Output:\x20','Clone\x20\x22','agentId','New\x20project:\x20','3855705tzsXtt','\x22:\x20','cloneProject','pushProject','red','-\x20nothing\x20pushed','\x22\x20to\x20a\x20different\x20profile','✔\x20Context\x20set:\x20','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','parse','llm_project','\x0aChanges\x20to\x20integration\x20\x27','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','\x20\x20Text\x20Knowledge\x20Bases:\x20','integrations','\x20\x20Agent\x20\x22','7906024XHlAiB','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','Summary:','\x0aErrors\x20found:','experimentalKnowledgeBases','10WsAwHU','\x0aProject\x20pushed\x20with\x20errors','\x0aPush\x20','execute','\x20new','outputPath','utf-8','source','hasChanges','\x0aError:','\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','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','name','\x20created','dryRun','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Agent\x20pulled\x20successfully','repeat','\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','site','INVALID_ARGUMENT','\x20resources\x20to\x20\x27'];a4_0x13a8=function(){return _0x53e74e;};return a4_0x13a8();}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(_0xb421e0){const _0x46483c=a4_0x16f2,_0x23a270=[];if(_0xb421e0['total']!==undefined)_0x23a270['push'](_0xb421e0['total']+_0x46483c(0x80));if(_0xb421e0[_0x46483c(0xb9)]!==undefined&&_0xb421e0[_0x46483c(0xb9)]>0x0)_0x23a270['push'](a4_0x2632f5[_0x46483c(0x11d)](_0xb421e0[_0x46483c(0xb9)]+'\x20new'));if(_0xb421e0['created']!==undefined&&_0xb421e0['created']>0x0)_0x23a270['push'](a4_0x2632f5['green'](_0xb421e0[_0x46483c(0x8b)]+_0x46483c(0x10b)));if(_0xb421e0['updated']!==undefined&&_0xb421e0[_0x46483c(0x84)]>0x0)_0x23a270[_0x46483c(0x118)](a4_0x2632f5[_0x46483c(0xb7)](_0xb421e0[_0x46483c(0x84)]+_0x46483c(0x90)));if(_0xb421e0[_0x46483c(0xba)]!==undefined&&_0xb421e0[_0x46483c(0xba)]>0x0)_0x23a270['push'](a4_0x2632f5[_0x46483c(0x12a)](_0xb421e0[_0x46483c(0xba)]+'\x20unchanged'));if(_0xb421e0[_0x46483c(0xda)]!==undefined&&_0xb421e0[_0x46483c(0xda)]>0x0)_0x23a270['push'](a4_0x2632f5[_0x46483c(0xeb)](_0xb421e0[_0x46483c(0xda)]+_0x46483c(0x11a)));return _0x23a270[_0x46483c(0xcc)](',\x20');}function displayDiffs(_0x5167c6,_0x33a730,_0x986fb7,_0x578887,_0x195978,_0x5dbae9,_0x48fc96,_0x239f00,_0x195720){const _0x218eab=a4_0x16f2;for(const _0xa310af of _0x5167c6){if(_0xa310af[_0x218eab(0xd2)]){const _0x3601ee=_0xa310af['agentName']||_0xa310af[_0x218eab(0x10a)];console['log']('\x0aChanges\x20to\x20agent\x20\x27'+_0x3601ee+'\x27:'),console[_0x218eab(0x12e)]('─'[_0x218eab(0x10f)](0x3c)),console[_0x218eab(0x12e)](_0xa310af[_0x218eab(0xd2)]),console[_0x218eab(0x12e)]('─'['repeat'](0x3c));}}for(const _0x55b9bc of _0x33a730){_0x55b9bc[_0x218eab(0xd2)]&&(console['log'](_0x218eab(0x109)+_0x55b9bc['name']+'\x27:'),console[_0x218eab(0x12e)]('─'[_0x218eab(0x10f)](0x3c)),console[_0x218eab(0x12e)](_0x55b9bc['diff']),console[_0x218eab(0x12e)]('─'['repeat'](0x3c)));}for(const _0x1b9dab of _0x986fb7){_0x1b9dab[_0x218eab(0xd2)]&&(console[_0x218eab(0x12e)]('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x1b9dab[_0x218eab(0x10a)]+'\x27:'),console[_0x218eab(0x12e)]('─'[_0x218eab(0x10f)](0x3c)),console['log'](_0x1b9dab[_0x218eab(0xd2)]),console['log']('─'['repeat'](0x3c)));}for(const _0xd75a7f of _0x578887){_0xd75a7f['diff']&&(console['log'](_0x218eab(0xdc)+_0xd75a7f[_0x218eab(0x10a)]+'\x27:'),console[_0x218eab(0x12e)]('─'['repeat'](0x3c)),console['log'](_0xd75a7f[_0x218eab(0xd2)]),console[_0x218eab(0x12e)]('─'[_0x218eab(0x10f)](0x3c)));}for(const _0x2dfa36 of _0x195978){_0x2dfa36['diff']&&(console['log'](_0x218eab(0xf2)+_0x2dfa36[_0x218eab(0x10a)]+'\x27:'),console[_0x218eab(0x12e)]('─'[_0x218eab(0x10f)](0x3c)),console[_0x218eab(0x12e)](_0x2dfa36[_0x218eab(0xd2)]),console[_0x218eab(0x12e)]('─'[_0x218eab(0x10f)](0x3c)));}for(const _0x375694 of _0x5dbae9){_0x375694[_0x218eab(0xd2)]&&(console[_0x218eab(0x12e)](_0x218eab(0x134)+_0x375694[_0x218eab(0x10a)]+'\x27:'),console['log']('─'[_0x218eab(0x10f)](0x3c)),console[_0x218eab(0x12e)](_0x375694[_0x218eab(0xd2)]),console[_0x218eab(0x12e)]('─'['repeat'](0x3c)));}for(const _0x48d76a of _0x48fc96){_0x48d76a[_0x218eab(0xd2)]&&(console['log'](_0x218eab(0x121)+_0x48d76a[_0x218eab(0x10a)]+'\x27:'),console['log']('─'[_0x218eab(0x10f)](0x3c)),console[_0x218eab(0x12e)](_0x48d76a[_0x218eab(0xd2)]),console[_0x218eab(0x12e)]('─'[_0x218eab(0x10f)](0x3c)));}for(const _0x35d4e8 of _0x239f00){_0x35d4e8[_0x218eab(0xd2)]&&(console[_0x218eab(0x12e)]('\x0aChanges\x20to\x20form\x20interface\x20\x27'+_0x35d4e8[_0x218eab(0x10a)]+'\x27:'),console[_0x218eab(0x12e)]('─'[_0x218eab(0x10f)](0x3c)),console[_0x218eab(0x12e)](_0x35d4e8['diff']),console[_0x218eab(0x12e)]('─'['repeat'](0x3c)));}for(const _0x273b2a of _0x195720){_0x273b2a[_0x218eab(0xd2)]&&(console[_0x218eab(0x12e)]('\x0aChanges\x20to\x20chat\x20interface\x20\x27'+_0x273b2a[_0x218eab(0x10a)]+'\x27:'),console[_0x218eab(0x12e)]('─'[_0x218eab(0x10f)](0x3c)),console[_0x218eab(0x12e)](_0x273b2a['diff']),console[_0x218eab(0x12e)]('─'[_0x218eab(0x10f)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x3622c6(0x10a)]=a4_0x3622c6(0x82);[a4_0x3622c6(0xb3)]=a4_0x3622c6(0xef);async[a4_0x3622c6(0x101)](_0x250714){const _0x3c36bb=a4_0x3622c6,{options:_0x272b00,args:_0x586616,tdx:_0x38a973}=_0x250714,_0x1b33fb=_0x586616[0x0],_0x266330=_0x586616[0x1],_0xc21a4b=_0x272b00[_0x3c36bb(0xd3)],_0x5be9b4=_0x272b00['dryRun'],_0x21a47c=_0x272b00['force'],_0x323aee=_0x272b00['yes'],_0x1a0c2f=_0x272b00[_0x3c36bb(0xa6)],_0x72426b=_0x272b00['agent'];let _0xa4cf2b;if(_0x1b33fb){const _0x271415=a4_0x102520[_0x3c36bb(0xcc)](_0x1b33fb,_0x3c36bb(0x7f));if(existsSync(_0x271415))try{const _0x1a74bc=JSON[_0x3c36bb(0xf0)](readFileSync(_0x271415,_0x3c36bb(0x104)));_0x1a74bc[_0x3c36bb(0xf1)]&&(_0xa4cf2b={'llm_project':_0x1a74bc[_0x3c36bb(0xf1)]});}catch{}}const _0x459440=findAgentConfigPath(process['cwd']());let _0x2e396a;if(_0x459440)try{const _0x2ea2cf=JSON[_0x3c36bb(0xf0)](readFileSync(_0x459440,_0x3c36bb(0x104)));_0x2ea2cf[_0x3c36bb(0xf1)]&&(_0x2e396a={'llm_project':_0x2ea2cf[_0x3c36bb(0xf1)]});}catch{}const _0x1ba540=resolveAgentPullArgs({'arg':_0x1b33fb,'agentNameArg':_0x266330,'agentFlag':_0x72426b,'contextProject':_0x1a0c2f,'argDirConfig':_0xa4cf2b,'cwdConfigPath':_0x459440||undefined,'cwdConfig':_0x2e396a}),{projectNameOrId:_0x4ff38f,targetAgentName:_0x1ba9e4,existingOutputDir:_0x26b75b,source:_0x19b25b}=_0x1ba540;if(_0x19b25b==='arg-dir')console['log'](a4_0x2632f5[_0x3c36bb(0xbc)](_0x3c36bb(0x12b)+a4_0x102520['join'](_0x1b33fb,_0x3c36bb(0x7f))+':\x20'+_0x4ff38f));else{if(_0x19b25b===_0x3c36bb(0x123))console[_0x3c36bb(0x12e)](a4_0x2632f5[_0x3c36bb(0xbc)](_0x3c36bb(0x97)+_0x4ff38f));else _0x19b25b===_0x3c36bb(0xa3)&&console['log'](a4_0x2632f5[_0x3c36bb(0xbc)](_0x3c36bb(0xde)+_0x4ff38f));}if(!_0x4ff38f)return _0x72426b?(console[_0x3c36bb(0x12e)](a4_0x2632f5[_0x3c36bb(0xb7)](_0x3c36bb(0x8f))),console[_0x3c36bb(0x12e)](_0x3c36bb(0x87)),console[_0x3c36bb(0x12e)](_0x3c36bb(0xb2))):(console[_0x3c36bb(0x12e)](a4_0x2632f5['yellow'](_0x3c36bb(0xc0))),console[_0x3c36bb(0x12e)](_0x3c36bb(0x8c)),console['log'](_0x3c36bb(0xf9)),console['log'](_0x3c36bb(0xcb)),console[_0x3c36bb(0x12e)](_0x3c36bb(0x108)),console[_0x3c36bb(0x12e)](_0x3c36bb(0x110))),0x1;if(_0x1ba9e4){const {data:_0x2f5ca8}=await withSpinner(_0x3c36bb(0x12d)+_0x1ba9e4+_0x3c36bb(0xc9)+_0x4ff38f+_0x3c36bb(0xc8),()=>_0x38a973[_0x3c36bb(0x8e)][_0x3c36bb(0xc1)](_0x4ff38f,_0x1ba9e4,_0xc21a4b,{'dryRun':_0x5be9b4,'force':_0x21a47c}));if(_0x5be9b4)return console[_0x3c36bb(0x12e)](a4_0x2632f5[_0x3c36bb(0xb7)](_0x3c36bb(0x124))),console[_0x3c36bb(0x12e)]('Would\x20pull\x20agent:\x20'+_0x2f5ca8[_0x3c36bb(0x115)]),console['log'](_0x3c36bb(0xad)+_0x2f5ca8[_0x3c36bb(0x103)]),_0x2f5ca8[_0x3c36bb(0xd2)]&&(console[_0x3c36bb(0x12e)]('\x0aChanges:'),console[_0x3c36bb(0x12e)]('─'['repeat'](0x3c)),console[_0x3c36bb(0x12e)](_0x2f5ca8[_0x3c36bb(0xd2)]),console[_0x3c36bb(0x12e)]('─'[_0x3c36bb(0x10f)](0x3c))),0x0;return console[_0x3c36bb(0x12e)](a4_0x2632f5[_0x3c36bb(0x11d)](_0x3c36bb(0x10e))),console[_0x3c36bb(0x12e)]('Agent:\x20'+_0x2f5ca8['agentName']),console[_0x3c36bb(0x12e)](_0x3c36bb(0xe3)+_0x2f5ca8[_0x3c36bb(0x103)]),console['log']('Status:\x20'+(_0x2f5ca8[_0x3c36bb(0x93)]?a4_0x2632f5['green'](_0x3c36bb(0xb9)):_0x2f5ca8[_0x3c36bb(0x106)]?a4_0x2632f5[_0x3c36bb(0xb7)]('updated'):a4_0x2632f5[_0x3c36bb(0x12a)]('unchanged'))),0x0;}const _0x3736a2=_0x26b75b||_0xc21a4b,{data:_0x7b7d11}=await withSpinner(_0x3c36bb(0x116)+_0x4ff38f+'\x22...',()=>_0x38a973[_0x3c36bb(0x8e)][_0x3c36bb(0xd8)](_0x4ff38f,_0x3736a2,{'dryRun':!![]})),_0xfcbb29=_0x7b7d11['counts']['agents'][_0x3c36bb(0xb9)]+_0x7b7d11[_0x3c36bb(0x130)]['knowledgeBases'][_0x3c36bb(0xb9)]+_0x7b7d11[_0x3c36bb(0x130)][_0x3c36bb(0xd4)][_0x3c36bb(0xb9)]+_0x7b7d11['counts'][_0x3c36bb(0x120)][_0x3c36bb(0xb9)]+_0x7b7d11[_0x3c36bb(0x130)]['integrations'][_0x3c36bb(0xb9)]+_0x7b7d11[_0x3c36bb(0x130)][_0x3c36bb(0xfd)]['new']+_0x7b7d11[_0x3c36bb(0x130)][_0x3c36bb(0xbf)][_0x3c36bb(0xb9)]+_0x7b7d11['counts'][_0x3c36bb(0x138)][_0x3c36bb(0xb9)]+_0x7b7d11[_0x3c36bb(0x130)][_0x3c36bb(0xca)][_0x3c36bb(0xb9)],_0x2760ff=_0x7b7d11[_0x3c36bb(0x130)][_0x3c36bb(0x12c)]['updated']+_0x7b7d11['counts'][_0x3c36bb(0x96)][_0x3c36bb(0x84)]+_0x7b7d11[_0x3c36bb(0x130)][_0x3c36bb(0xd4)][_0x3c36bb(0x84)]+_0x7b7d11[_0x3c36bb(0x130)][_0x3c36bb(0x120)][_0x3c36bb(0x84)]+_0x7b7d11[_0x3c36bb(0x130)][_0x3c36bb(0xf6)][_0x3c36bb(0x84)]+_0x7b7d11[_0x3c36bb(0x130)]['experimentalKnowledgeBases'][_0x3c36bb(0x84)]+_0x7b7d11[_0x3c36bb(0x130)][_0x3c36bb(0xbf)][_0x3c36bb(0x84)]+_0x7b7d11[_0x3c36bb(0x130)][_0x3c36bb(0x138)][_0x3c36bb(0x84)]+_0x7b7d11['counts'][_0x3c36bb(0xca)][_0x3c36bb(0x84)],_0x44bac9=_0x7b7d11[_0x3c36bb(0x130)][_0x3c36bb(0x12c)][_0x3c36bb(0xba)]+_0x7b7d11[_0x3c36bb(0x130)]['knowledgeBases'][_0x3c36bb(0xba)]+_0x7b7d11[_0x3c36bb(0x130)]['textKnowledgeBases'][_0x3c36bb(0xba)]+_0x7b7d11[_0x3c36bb(0x130)][_0x3c36bb(0x120)]['unchanged']+_0x7b7d11[_0x3c36bb(0x130)][_0x3c36bb(0xf6)]['unchanged']+_0x7b7d11[_0x3c36bb(0x130)][_0x3c36bb(0xfd)]['unchanged']+_0x7b7d11[_0x3c36bb(0x130)]['experimentalArtifacts']['unchanged']+_0x7b7d11[_0x3c36bb(0x130)][_0x3c36bb(0x138)][_0x3c36bb(0xba)]+_0x7b7d11[_0x3c36bb(0x130)][_0x3c36bb(0xca)][_0x3c36bb(0xba)];console[_0x3c36bb(0x12e)](_0x3c36bb(0x8a)+_0x7b7d11[_0x3c36bb(0xb1)]+'\x27:'),console['log']('\x20\x20'+a4_0x2632f5[_0x3c36bb(0x11d)]('+\x20'+_0xfcbb29+_0x3c36bb(0x102))+_0x3c36bb(0x11f)+a4_0x2632f5[_0x3c36bb(0xb7)]('~\x20'+_0x2760ff+_0x3c36bb(0xaf))+'\x20|\x20'+a4_0x2632f5[_0x3c36bb(0xbc)]('=\x20'+_0x44bac9+_0x3c36bb(0xd9))),console['log'](_0x3c36bb(0xa1)+formatCountSummary(_0x7b7d11[_0x3c36bb(0x130)]['agents'])),console['log']('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x7b7d11[_0x3c36bb(0x130)][_0x3c36bb(0x96)])),console[_0x3c36bb(0x12e)](_0x3c36bb(0xf5)+formatCountSummary(_0x7b7d11[_0x3c36bb(0x130)][_0x3c36bb(0xd4)])),console['log'](_0x3c36bb(0xb0)+formatCountSummary(_0x7b7d11[_0x3c36bb(0x130)]['prompts'])),console[_0x3c36bb(0x12e)](_0x3c36bb(0xa5)+formatCountSummary(_0x7b7d11[_0x3c36bb(0x130)][_0x3c36bb(0xf6)])),console[_0x3c36bb(0x12e)](_0x3c36bb(0x137)+formatCountSummary(_0x7b7d11[_0x3c36bb(0x130)][_0x3c36bb(0x138)])),console['log'](_0x3c36bb(0x133)+formatCountSummary(_0x7b7d11[_0x3c36bb(0x130)][_0x3c36bb(0xca)]));const _0x4f09d9=_0x7b7d11[_0x3c36bb(0x130)][_0x3c36bb(0xfd)][_0x3c36bb(0x132)]>0x0||_0x7b7d11[_0x3c36bb(0x130)][_0x3c36bb(0xbf)][_0x3c36bb(0x132)]>0x0;_0x4f09d9&&(console[_0x3c36bb(0x12e)](_0x3c36bb(0x117)+formatCountSummary(_0x7b7d11[_0x3c36bb(0x130)][_0x3c36bb(0xfd)])),console[_0x3c36bb(0x12e)](_0x3c36bb(0x9e)+formatCountSummary(_0x7b7d11[_0x3c36bb(0x130)][_0x3c36bb(0xbf)])));console[_0x3c36bb(0x12e)]('\x20\x20Target:\x20'+a4_0x2632f5[_0x3c36bb(0xc3)](_0x7b7d11['outputDir'])),displayDiffs(_0x7b7d11[_0x3c36bb(0x12c)],_0x7b7d11[_0x3c36bb(0x96)],_0x7b7d11[_0x3c36bb(0xd4)],_0x7b7d11[_0x3c36bb(0x120)],_0x7b7d11[_0x3c36bb(0xf6)],_0x7b7d11['experimentalKnowledgeBases'],_0x7b7d11[_0x3c36bb(0xbf)],_0x7b7d11[_0x3c36bb(0x138)],_0x7b7d11[_0x3c36bb(0xca)]);if(_0x5be9b4)return console['log'](a4_0x2632f5['yellow']('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0xfcbb29===0x0&&_0x2760ff===0x0)return console[_0x3c36bb(0x12e)](a4_0x2632f5[_0x3c36bb(0x11d)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x7b7d11['projectName']},_0x272b00['session']),console[_0x3c36bb(0x12e)](a4_0x2632f5[_0x3c36bb(0x11d)]('✔\x20Context\x20set:\x20'+a4_0x2632f5[_0x3c36bb(0xbc)](_0x3c36bb(0xf1))+_0x3c36bb(0xc6)+a4_0x2632f5[_0x3c36bb(0xc3)](_0x7b7d11[_0x3c36bb(0xb1)]))),0x0;if(!_0x323aee&&!_0x21a47c){if(!isInteractive())return console[_0x3c36bb(0xcd)](a4_0x2632f5[_0x3c36bb(0xeb)]('\x0aError:'),_0x3c36bb(0x88)),console['error'](a4_0x2632f5[_0x3c36bb(0xbc)](_0x3c36bb(0x10d))),0x1;const _0x54baef=await confirmKey(_0x3c36bb(0x131)+(_0xfcbb29+_0x2760ff)+'\x20files?');if(!_0x54baef)return console['log'](a4_0x2632f5[_0x3c36bb(0xb7)](_0x3c36bb(0xab)),_0x3c36bb(0xa4)),0x1;}const {data:_0xacd207}=await withSpinner(_0x3c36bb(0xd0),()=>_0x38a973[_0x3c36bb(0x8e)][_0x3c36bb(0xd8)](_0x4ff38f,_0x3736a2,{'force':_0x21a47c}));return console['log'](a4_0x2632f5[_0x3c36bb(0x11d)]('\x0a✔\x20Pulled\x20'+(_0xfcbb29+_0x2760ff)+_0x3c36bb(0x89)+_0xacd207['outputDir'])),saveSessionContext({'llm_project':_0xacd207[_0x3c36bb(0xb1)]},_0x272b00[_0x3c36bb(0xc4)]),console['log'](a4_0x2632f5['green'](_0x3c36bb(0xee)+a4_0x2632f5[_0x3c36bb(0xbc)](_0x3c36bb(0xf1))+_0x3c36bb(0xc6)+a4_0x2632f5[_0x3c36bb(0xc3)](_0xacd207[_0x3c36bb(0xb1)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x3622c6(0x10a)]=a4_0x3622c6(0x98);[a4_0x3622c6(0xb3)]=a4_0x3622c6(0xb5);async[a4_0x3622c6(0x101)](_0xb732d6){const _0x3d8262=a4_0x3622c6,{options:_0x491cae,args:_0x16e563,tdx:_0x793fd6}=_0xb732d6,_0x4f17e6=_0x16e563[0x0],_0x267f04=_0x491cae[_0x3d8262(0x10a)],_0x1215a1=_0x491cae['dryRun'],_0x5b159a=_0x491cae[_0x3d8262(0x119)],_0x494d4f=_0x491cae[_0x3d8262(0x111)],_0x3159b3=_0x491cae[_0x3d8262(0xa6)];let _0x3b4011;const _0x48ff68=findAgentConfigPath(process['cwd']());if(_0x4f17e6){const _0xcc3dda=a4_0x102520[_0x3d8262(0xcc)](_0x4f17e6,_0x3d8262(0x7f));existsSync(_0xcc3dda)?(_0x3b4011=_0x4f17e6,console[_0x3d8262(0x12e)](a4_0x2632f5[_0x3d8262(0xbc)](_0x3d8262(0x86)+_0x4f17e6))):_0x3b4011=_0x4f17e6;}else{if(_0x48ff68)_0x3b4011=a4_0x102520[_0x3d8262(0x81)](_0x48ff68),console[_0x3d8262(0x12e)](a4_0x2632f5[_0x3d8262(0xbc)](_0x3d8262(0xe1)+_0x3b4011));else{if(_0x3159b3){const _0x53db84=sanitizeForFilesystem(_0x3159b3);let _0x122f2f=_0x53db84,_0x2cef65=a4_0x102520[_0x3d8262(0xcc)](process[_0x3d8262(0xac)](),_0x3d8262(0x12c),_0x53db84,_0x3d8262(0x7f));if(!existsSync(_0x2cef65)){const _0x2ce745=normalizeName(_0x3159b3),_0x159399=a4_0x102520[_0x3d8262(0xcc)](process[_0x3d8262(0xac)](),_0x3d8262(0x12c),_0x2ce745,_0x3d8262(0x7f));existsSync(_0x159399)&&(_0x122f2f=_0x2ce745,_0x2cef65=_0x159399);}if(existsSync(_0x2cef65))_0x3b4011=a4_0x102520[_0x3d8262(0x81)](_0x2cef65),console[_0x3d8262(0x12e)](a4_0x2632f5['dim'](_0x3d8262(0x86)+_0x3b4011));else{const _0x59ca17=_0x491cae['profile'];if(_0x59ca17)throw new SDKError(ErrorCode[_0x3d8262(0x112)],_0x3d8262(0x125)+_0x3159b3+_0x3d8262(0xed),undefined,{'helpText':_0x3d8262(0xd1)+_0x3d8262(0x11c)+(_0x3d8262(0x95)+_0x3159b3+'\x0a')+(_0x3d8262(0xd5)+_0x122f2f+_0x3d8262(0x7d)+(_0x267f04||_0x3d8262(0x122))+'\x20--profile\x20'+_0x59ca17)});_0x3b4011=_0x3159b3,console[_0x3d8262(0x12e)](a4_0x2632f5['dim'](_0x3d8262(0xc2)+_0x3159b3));}}}}if(!_0x3b4011)return console[_0x3d8262(0x12e)](a4_0x2632f5['yellow'](_0x3d8262(0xe0))),console[_0x3d8262(0x12e)](_0x3d8262(0xfa)),console['log']('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console[_0x3d8262(0x12e)](_0x3d8262(0xa0)),console['log'](_0x3d8262(0xf4)),0x1;if(!_0x267f04)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],'New\x20project\x20name\x20is\x20required',undefined,{'helpText':_0x3d8262(0xbb)});if(!_0x5b159a&&!_0x1215a1){if(!isInteractive())return console['error'](a4_0x2632f5[_0x3d8262(0xeb)]('\x0aError:'),_0x3d8262(0x88)),console['error'](a4_0x2632f5['dim'](_0x3d8262(0x10d))),0x1;const _0x5a5ed8=await confirmKey(_0x3d8262(0xe4)+_0x3b4011+'\x22\x20to\x20new\x20project\x20\x22'+_0x267f04+'\x22?');if(!_0x5a5ed8)return console[_0x3d8262(0x12e)](a4_0x2632f5[_0x3d8262(0xb7)](_0x3d8262(0xab))),0x1;}const {data:_0x1d490b}=await withSpinner(_0x3d8262(0xae)+_0x3b4011+'\x22\x20to\x20\x22'+_0x267f04+_0x3d8262(0xc8),()=>_0x793fd6[_0x3d8262(0x8e)][_0x3d8262(0xe9)](_0x3b4011,_0x267f04,{'dryRun':_0x1215a1}));if(_0x1215a1){console[_0x3d8262(0x12e)](a4_0x2632f5[_0x3d8262(0xb7)](_0x3d8262(0x99))),console[_0x3d8262(0x12e)]('Source:\x20'+_0x1d490b['sourceProjectName']),console[_0x3d8262(0x12e)](_0x3d8262(0xe6)+_0x267f04),console[_0x3d8262(0x12e)](_0x3d8262(0x9a)),console[_0x3d8262(0x12e)](_0x3d8262(0xa1)+_0x1d490b['counts'][_0x3d8262(0x12c)][_0x3d8262(0x8b)]),console[_0x3d8262(0x12e)]('\x20\x20Knowledge\x20Bases:\x20'+_0x1d490b[_0x3d8262(0x130)][_0x3d8262(0x96)][_0x3d8262(0x8b)]),console[_0x3d8262(0x12e)](_0x3d8262(0xb0)+_0x1d490b[_0x3d8262(0x130)][_0x3d8262(0x120)]['created']),console[_0x3d8262(0x12e)](_0x3d8262(0x137)+_0x1d490b['counts'][_0x3d8262(0x138)][_0x3d8262(0x8b)]),console['log'](_0x3d8262(0x133)+_0x1d490b[_0x3d8262(0x130)][_0x3d8262(0xca)][_0x3d8262(0x8b)]);const _0x1a9605=_0x1d490b[_0x3d8262(0x130)]['experimentalKnowledgeBases']['created']>0x0||_0x1d490b['counts'][_0x3d8262(0xbf)][_0x3d8262(0x8b)]>0x0;return _0x1a9605&&(console['log']('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+_0x1d490b[_0x3d8262(0x130)][_0x3d8262(0xfd)][_0x3d8262(0x8b)]),console['log'](_0x3d8262(0x9e)+_0x1d490b[_0x3d8262(0x130)][_0x3d8262(0xbf)][_0x3d8262(0x8b)])),0x0;}const _0x1b2501=_0x1d490b[_0x3d8262(0x130)][_0x3d8262(0x12c)][_0x3d8262(0xda)]>0x0||_0x1d490b[_0x3d8262(0x130)]['knowledgeBases']['errors']>0x0||_0x1d490b[_0x3d8262(0x130)][_0x3d8262(0x120)][_0x3d8262(0xda)]>0x0||_0x1d490b[_0x3d8262(0x130)][_0x3d8262(0x138)][_0x3d8262(0xda)]>0x0||_0x1d490b[_0x3d8262(0x130)]['chatInterfaces']['errors']>0x0||_0x1d490b['counts'][_0x3d8262(0xfd)][_0x3d8262(0xda)]>0x0||_0x1d490b['counts'][_0x3d8262(0xbf)][_0x3d8262(0xda)]>0x0;_0x1b2501?console['log'](a4_0x2632f5['yellow'](_0x3d8262(0xbd))):console['log'](a4_0x2632f5[_0x3d8262(0x11d)]('Project\x20cloned\x20successfully'));console[_0x3d8262(0x12e)](_0x3d8262(0xb4)+_0x1d490b[_0x3d8262(0x8d)]),console[_0x3d8262(0x12e)]('New\x20project:\x20'+_0x1d490b['newProjectName']),console[_0x3d8262(0x12e)](_0x3d8262(0xa2)+_0x1d490b[_0x3d8262(0xaa)]),console[_0x3d8262(0x12e)](),console['log'](_0x3d8262(0xfb)),console[_0x3d8262(0x12e)](_0x3d8262(0xa1)+formatCountSummary(_0x1d490b[_0x3d8262(0x130)]['agents'])),console[_0x3d8262(0x12e)](_0x3d8262(0x126)+formatCountSummary(_0x1d490b['counts'][_0x3d8262(0x96)])),console[_0x3d8262(0x12e)](_0x3d8262(0xb0)+formatCountSummary(_0x1d490b[_0x3d8262(0x130)][_0x3d8262(0x120)])),console[_0x3d8262(0x12e)](_0x3d8262(0xa5)+formatCountSummary(_0x1d490b[_0x3d8262(0x130)][_0x3d8262(0xf6)])),console[_0x3d8262(0x12e)]('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0x1d490b['counts'][_0x3d8262(0x138)])),console[_0x3d8262(0x12e)](_0x3d8262(0x133)+formatCountSummary(_0x1d490b[_0x3d8262(0x130)][_0x3d8262(0xca)]));const _0x5d9ccd=_0x1d490b[_0x3d8262(0x130)][_0x3d8262(0xfd)][_0x3d8262(0x8b)]>0x0||_0x1d490b[_0x3d8262(0x130)][_0x3d8262(0xfd)][_0x3d8262(0x84)]>0x0||_0x1d490b[_0x3d8262(0x130)][_0x3d8262(0xfd)]['unchanged']>0x0||_0x1d490b['counts'][_0x3d8262(0xbf)][_0x3d8262(0x8b)]>0x0||_0x1d490b[_0x3d8262(0x130)]['experimentalArtifacts'][_0x3d8262(0x84)]>0x0||_0x1d490b[_0x3d8262(0x130)][_0x3d8262(0xbf)][_0x3d8262(0xba)]>0x0;_0x5d9ccd&&(console['log'](_0x3d8262(0x117)+formatCountSummary(_0x1d490b[_0x3d8262(0x130)][_0x3d8262(0xfd)])),console[_0x3d8262(0x12e)](_0x3d8262(0x9e)+formatCountSummary(_0x1d490b['counts'][_0x3d8262(0xbf)])));if(_0x1b2501){console['log'](),console[_0x3d8262(0x12e)](a4_0x2632f5[_0x3d8262(0xeb)]('Errors:'));for(const _0x276147 of _0x1d490b[_0x3d8262(0x12c)]){_0x276147[_0x3d8262(0x9f)]===_0x3d8262(0xcd)&&console[_0x3d8262(0x12e)](a4_0x2632f5['red'](_0x3d8262(0xf7)+_0x276147[_0x3d8262(0x115)]+_0x3d8262(0xe8)+_0x276147[_0x3d8262(0xcd)]));}for(const _0x4f0e27 of _0x1d490b[_0x3d8262(0x96)]){_0x4f0e27[_0x3d8262(0x9f)]===_0x3d8262(0xcd)&&console[_0x3d8262(0x12e)](a4_0x2632f5['red']('\x20\x20Knowledge\x20Base\x20\x22'+_0x4f0e27[_0x3d8262(0x10a)]+_0x3d8262(0xe8)+_0x4f0e27['error']));}for(const _0x13ed7f of _0x1d490b[_0x3d8262(0x120)]){_0x13ed7f[_0x3d8262(0x9f)]===_0x3d8262(0xcd)&&console[_0x3d8262(0x12e)](a4_0x2632f5[_0x3d8262(0xeb)](_0x3d8262(0x136)+_0x13ed7f[_0x3d8262(0x10a)]+_0x3d8262(0xe8)+_0x13ed7f[_0x3d8262(0xcd)]));}for(const _0x51ca08 of _0x1d490b['integrations']){_0x51ca08[_0x3d8262(0x9f)]===_0x3d8262(0xcd)&&console[_0x3d8262(0x12e)](a4_0x2632f5[_0x3d8262(0xeb)]('\x20\x20Integration\x20\x22'+_0x51ca08[_0x3d8262(0x10a)]+_0x3d8262(0xe8)+_0x51ca08['error']));}for(const _0x2971e0 of _0x1d490b['formInterfaces']){_0x2971e0[_0x3d8262(0x9f)]===_0x3d8262(0xcd)&&console[_0x3d8262(0x12e)](a4_0x2632f5[_0x3d8262(0xeb)](_0x3d8262(0xc7)+_0x2971e0[_0x3d8262(0x10a)]+'\x22:\x20'+_0x2971e0['error']));}for(const _0x56089e of _0x1d490b[_0x3d8262(0xca)]){_0x56089e['action']===_0x3d8262(0xcd)&&console['log'](a4_0x2632f5[_0x3d8262(0xeb)](_0x3d8262(0xce)+_0x56089e[_0x3d8262(0x10a)]+_0x3d8262(0xe8)+_0x56089e['error']));}for(const _0x3f02ae of _0x1d490b[_0x3d8262(0xfd)]){_0x3f02ae[_0x3d8262(0x9f)]===_0x3d8262(0xcd)&&console['log'](a4_0x2632f5[_0x3d8262(0xeb)](_0x3d8262(0x94)+_0x3f02ae[_0x3d8262(0x10a)]+_0x3d8262(0xe8)+_0x3f02ae['error']));}for(const _0x36b893 of _0x1d490b[_0x3d8262(0xbf)]){_0x36b893[_0x3d8262(0x9f)]==='error'&&console['log'](a4_0x2632f5['red'](_0x3d8262(0xb6)+_0x36b893[_0x3d8262(0x10a)]+_0x3d8262(0xe8)+_0x36b893[_0x3d8262(0xcd)]));}return 0x1;}console[_0x3d8262(0x12e)]();const _0x29add2=getLLMProjectUrl(_0x494d4f,_0x1d490b['newProjectId']);return console['log']('Project:\x20'+a4_0x2632f5[_0x3d8262(0xc3)](_0x29add2)),0x0;}}export class AgentPushCommand extends BaseCommand{['name']='agent:push';[a4_0x3622c6(0xb3)]=a4_0x3622c6(0xb8);async['execute'](_0x32c95c){const _0x3f2c79=a4_0x3622c6,{options:_0x3a9c12,args:_0x28e090,tdx:_0xa2eef2}=_0x32c95c;let _0x18df78=_0x28e090[0x0]||process['cwd']();const _0x1feab5=_0x3a9c12[_0x3f2c79(0x10c)],_0x5dddd4=_0x3a9c12[_0x3f2c79(0x9b)],_0x2a47ac=_0x3a9c12['yes'],_0x4148a5=_0x3a9c12[_0x3f2c79(0x111)],_0x58682e=a4_0x102520[_0x3f2c79(0xcc)](_0x18df78,_0x3f2c79(0xdb)),_0x3501f1=existsSync(_0x58682e);if(_0x3501f1){const {data:_0x54bc1a}=await withSpinner('Pushing\x20agent\x20from\x20\x22'+_0x18df78+_0x3f2c79(0xc8),()=>_0xa2eef2[_0x3f2c79(0x8e)][_0x3f2c79(0x129)](_0x18df78,{'dryRun':_0x1feab5,'force':_0x5dddd4}));if(_0x1feab5)return console[_0x3f2c79(0x12e)](a4_0x2632f5[_0x3f2c79(0xb7)](_0x3f2c79(0x99))),console[_0x3f2c79(0x12e)](_0x3f2c79(0x11b)+_0x54bc1a[_0x3f2c79(0x115)]),0x0;if(_0x54bc1a[_0x3f2c79(0x9f)]===_0x3f2c79(0xcd))return console['log'](a4_0x2632f5[_0x3f2c79(0xeb)]('Failed\x20to\x20push\x20agent:\x20'+_0x54bc1a[_0x3f2c79(0xcd)])),0x1;console[_0x3f2c79(0x12e)](a4_0x2632f5[_0x3f2c79(0x11d)](_0x3f2c79(0x9d)+_0x54bc1a[_0x3f2c79(0x9f)]+_0x3f2c79(0xd6))),console[_0x3f2c79(0x12e)]('Agent:\x20'+_0x54bc1a[_0x3f2c79(0x115)]);if(_0x54bc1a[_0x3f2c79(0xe5)]&&_0x54bc1a[_0x3f2c79(0x7b)]){const _0x1ac72a=getLLMAgentChatUrl(_0x4148a5,_0x54bc1a[_0x3f2c79(0x7b)],_0x54bc1a[_0x3f2c79(0xe5)]);console[_0x3f2c79(0x12e)](_0x3f2c79(0xc5)+a4_0x2632f5['cyan'](_0x1ac72a));}return 0x0;}const _0x19ed12=_0x3a9c12[_0x3f2c79(0xa6)],_0x1ab3c4=resolveProjectFromContext(_0x18df78,_0x19ed12);if(_0x1ab3c4[_0x3f2c79(0xcf)])_0x18df78=_0x1ab3c4[_0x3f2c79(0x12f)],_0x1ab3c4[_0x3f2c79(0x105)]==='context'&&console[_0x3f2c79(0x12e)](a4_0x2632f5[_0x3f2c79(0xbc)](_0x3f2c79(0x97)+_0x18df78));else{let _0x595b09='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x1ab3c4[_0x3f2c79(0xd7)]===_0x3f2c79(0xa9)&&(_0x595b09=_0x1ab3c4['message']+_0x3f2c79(0xf3)+_0x1ab3c4[_0x3f2c79(0xa6)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode[_0x3f2c79(0x112)],_0x1ab3c4[_0x3f2c79(0xd7)]===_0x3f2c79(0x11e)?_0x1ab3c4['message']:_0x3f2c79(0xe2)+_0x18df78,undefined,{'helpText':_0x595b09});}const {data:_0x1168f7}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0xa2eef2['llm'][_0x3f2c79(0xea)](_0x18df78,{'dryRun':!![]})),_0x4e95f8=_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0x12c)][_0x3f2c79(0xda)]>0x0;if(_0x4e95f8){console[_0x3f2c79(0x12e)](a4_0x2632f5[_0x3f2c79(0xeb)](_0x3f2c79(0xfc)));for(const _0x59d281 of _0x1168f7[_0x3f2c79(0x12c)]){_0x59d281[_0x3f2c79(0x9f)]===_0x3f2c79(0xcd)&&console[_0x3f2c79(0x12e)](a4_0x2632f5[_0x3f2c79(0xeb)](_0x3f2c79(0xf7)+_0x59d281['agentName']+'\x22:\x20'+_0x59d281[_0x3f2c79(0xcd)]));}return 0x1;}const _0x5d34df=_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0x12c)][_0x3f2c79(0x8b)]+_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0x96)][_0x3f2c79(0x8b)]+_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0xd4)][_0x3f2c79(0x8b)]+_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0x120)][_0x3f2c79(0x8b)]+_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0xf6)][_0x3f2c79(0x8b)]+_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0xfd)][_0x3f2c79(0x8b)]+_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0xbf)][_0x3f2c79(0x8b)]+_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0x138)][_0x3f2c79(0x8b)]+_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0xca)]['created'],_0x252d52=_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0x12c)]['updated']+_0x1168f7[_0x3f2c79(0x130)]['knowledgeBases'][_0x3f2c79(0x84)]+_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0xd4)][_0x3f2c79(0x84)]+_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0x120)]['updated']+_0x1168f7['counts'][_0x3f2c79(0xf6)]['updated']+_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0xfd)][_0x3f2c79(0x84)]+_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0xbf)][_0x3f2c79(0x84)]+_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0x138)]['updated']+_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0xca)][_0x3f2c79(0x84)],_0x1fff48=_0x1168f7['counts'][_0x3f2c79(0x12c)]['unchanged']+_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0x96)]['unchanged']+_0x1168f7['counts'][_0x3f2c79(0xd4)][_0x3f2c79(0xba)]+_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0x120)][_0x3f2c79(0xba)]+_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0xf6)][_0x3f2c79(0xba)]+_0x1168f7['counts'][_0x3f2c79(0xfd)][_0x3f2c79(0xba)]+_0x1168f7['counts'][_0x3f2c79(0xbf)][_0x3f2c79(0xba)]+_0x1168f7['counts'][_0x3f2c79(0x138)][_0x3f2c79(0xba)]+_0x1168f7[_0x3f2c79(0x130)]['chatInterfaces']['unchanged'];console[_0x3f2c79(0x12e)](_0x3f2c79(0xa8)+_0x1168f7['projectName']+'\x27:'),console[_0x3f2c79(0x12e)]('\x20\x20'+a4_0x2632f5['green']('+\x20'+_0x5d34df+_0x3f2c79(0x102))+'\x20|\x20'+a4_0x2632f5[_0x3f2c79(0xb7)]('~\x20'+_0x252d52+_0x3f2c79(0xaf))+_0x3f2c79(0x11f)+a4_0x2632f5[_0x3f2c79(0xbc)]('=\x20'+_0x1fff48+'\x20unchanged')),console[_0x3f2c79(0x12e)](_0x3f2c79(0xa1)+formatCountSummary(_0x1168f7['counts']['agents'])),console[_0x3f2c79(0x12e)](_0x3f2c79(0x126)+formatCountSummary(_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0x96)])),console['log'](_0x3f2c79(0xf5)+formatCountSummary(_0x1168f7['counts']['textKnowledgeBases'])),console[_0x3f2c79(0x12e)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0x120)])),console['log'](_0x3f2c79(0xa5)+formatCountSummary(_0x1168f7[_0x3f2c79(0x130)]['integrations'])),console[_0x3f2c79(0x12e)]('\x20\x20Form\x20Interfaces:\x20'+formatCountSummary(_0x1168f7['counts'][_0x3f2c79(0x138)])),console[_0x3f2c79(0x12e)]('\x20\x20Chat\x20Interfaces:\x20'+formatCountSummary(_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0xca)]));const _0x17b9ed=_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0xfd)][_0x3f2c79(0x8b)]>0x0||_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0xfd)][_0x3f2c79(0x84)]>0x0||_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0xfd)][_0x3f2c79(0xba)]>0x0||_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0xbf)][_0x3f2c79(0x8b)]>0x0||_0x1168f7['counts'][_0x3f2c79(0xbf)][_0x3f2c79(0x84)]>0x0||_0x1168f7['counts'][_0x3f2c79(0xbf)][_0x3f2c79(0xba)]>0x0;_0x17b9ed&&(console[_0x3f2c79(0x12e)](_0x3f2c79(0x117)+formatCountSummary(_0x1168f7[_0x3f2c79(0x130)]['experimentalKnowledgeBases'])),console[_0x3f2c79(0x12e)](_0x3f2c79(0x9e)+formatCountSummary(_0x1168f7[_0x3f2c79(0x130)][_0x3f2c79(0xbf)])));console[_0x3f2c79(0x12e)](_0x3f2c79(0x114)+a4_0x2632f5[_0x3f2c79(0xc3)](_0x18df78)),displayDiffs(_0x1168f7['agents'],_0x1168f7[_0x3f2c79(0x96)],_0x1168f7[_0x3f2c79(0xd4)],_0x1168f7['prompts'],_0x1168f7[_0x3f2c79(0xf6)],_0x1168f7[_0x3f2c79(0xfd)],_0x1168f7[_0x3f2c79(0xbf)],_0x1168f7[_0x3f2c79(0x138)],_0x1168f7[_0x3f2c79(0xca)]);if(_0x1feab5)return console[_0x3f2c79(0x12e)](a4_0x2632f5[_0x3f2c79(0xb7)](_0x3f2c79(0x127))),0x0;if(_0x5d34df===0x0&&_0x252d52===0x0){console[_0x3f2c79(0x12e)](a4_0x2632f5[_0x3f2c79(0x11d)](_0x3f2c79(0x91)));const _0x1d431b=getLLMProjectUrl(_0x4148a5,_0x1168f7['projectId']);return console[_0x3f2c79(0x12e)](_0x3f2c79(0x85)+a4_0x2632f5[_0x3f2c79(0xc3)](_0x1d431b)),0x0;}if(!_0x2a47ac&&!_0x5dddd4){if(!isInteractive())return console[_0x3f2c79(0xcd)](a4_0x2632f5[_0x3f2c79(0xeb)](_0x3f2c79(0x107)),_0x3f2c79(0x88)),console[_0x3f2c79(0xcd)](a4_0x2632f5[_0x3f2c79(0xbc)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x15dc7d=await confirmKey(_0x3f2c79(0x100)+(_0x5d34df+_0x252d52)+_0x3f2c79(0x128));if(!_0x15dc7d)return console[_0x3f2c79(0x12e)](a4_0x2632f5[_0x3f2c79(0xb7)](_0x3f2c79(0xab)),_0x3f2c79(0xec)),0x1;}const {data:_0x36c9bb}=await withSpinner(_0x3f2c79(0x83),()=>_0xa2eef2[_0x3f2c79(0x8e)][_0x3f2c79(0xea)](_0x18df78,{'force':_0x5dddd4})),_0x4165a6=_0x36c9bb[_0x3f2c79(0x130)][_0x3f2c79(0x12c)]['errors']>0x0||_0x36c9bb[_0x3f2c79(0x130)]['knowledgeBases']['errors']>0x0||_0x36c9bb[_0x3f2c79(0x130)][_0x3f2c79(0xd4)][_0x3f2c79(0xda)]>0x0||_0x36c9bb[_0x3f2c79(0x130)]['prompts'][_0x3f2c79(0xda)]>0x0||_0x36c9bb[_0x3f2c79(0x130)][_0x3f2c79(0x138)][_0x3f2c79(0xda)]>0x0||_0x36c9bb[_0x3f2c79(0x130)][_0x3f2c79(0xca)][_0x3f2c79(0xda)]>0x0;if(_0x4165a6){console[_0x3f2c79(0x12e)](a4_0x2632f5[_0x3f2c79(0xb7)](_0x3f2c79(0xff))),console[_0x3f2c79(0x12e)](),console['log'](a4_0x2632f5[_0x3f2c79(0xeb)]('Errors:'));for(const _0x11abe6 of _0x36c9bb[_0x3f2c79(0x12c)]){_0x11abe6[_0x3f2c79(0x9f)]===_0x3f2c79(0xcd)&&console[_0x3f2c79(0x12e)](a4_0x2632f5[_0x3f2c79(0xeb)](_0x3f2c79(0xf7)+_0x11abe6[_0x3f2c79(0x115)]+_0x3f2c79(0xe8)+_0x11abe6[_0x3f2c79(0xcd)]));}for(const _0x478f23 of _0x36c9bb['knowledgeBases']){_0x478f23[_0x3f2c79(0x9f)]===_0x3f2c79(0xcd)&&console[_0x3f2c79(0x12e)](a4_0x2632f5[_0x3f2c79(0xeb)]('\x20\x20Knowledge\x20Base\x20\x22'+_0x478f23[_0x3f2c79(0x10a)]+_0x3f2c79(0xe8)+_0x478f23[_0x3f2c79(0xcd)]));}for(const _0x55d057 of _0x36c9bb['textKnowledgeBases']){_0x55d057[_0x3f2c79(0x9f)]===_0x3f2c79(0xcd)&&console[_0x3f2c79(0x12e)](a4_0x2632f5[_0x3f2c79(0xeb)](_0x3f2c79(0x135)+_0x55d057[_0x3f2c79(0x10a)]+_0x3f2c79(0xe8)+_0x55d057[_0x3f2c79(0xcd)]));}for(const _0x13b287 of _0x36c9bb[_0x3f2c79(0x120)]){_0x13b287[_0x3f2c79(0x9f)]===_0x3f2c79(0xcd)&&console[_0x3f2c79(0x12e)](a4_0x2632f5[_0x3f2c79(0xeb)]('\x20\x20Prompt\x20\x22'+_0x13b287['name']+_0x3f2c79(0xe8)+_0x13b287['error']));}for(const _0x4def40 of _0x36c9bb['integrations']){_0x4def40[_0x3f2c79(0x9f)]===_0x3f2c79(0xcd)&&console[_0x3f2c79(0x12e)](a4_0x2632f5[_0x3f2c79(0xeb)](_0x3f2c79(0x7e)+_0x4def40[_0x3f2c79(0x10a)]+'\x22:\x20'+_0x4def40[_0x3f2c79(0xcd)]));}for(const _0x4e59d0 of _0x36c9bb[_0x3f2c79(0x138)]){_0x4e59d0[_0x3f2c79(0x9f)]===_0x3f2c79(0xcd)&&console[_0x3f2c79(0x12e)](a4_0x2632f5[_0x3f2c79(0xeb)](_0x3f2c79(0xc7)+_0x4e59d0['name']+'\x22:\x20'+_0x4e59d0['error']));}for(const _0xe8cbf9 of _0x36c9bb[_0x3f2c79(0xca)]){_0xe8cbf9['action']==='error'&&console[_0x3f2c79(0x12e)](a4_0x2632f5[_0x3f2c79(0xeb)](_0x3f2c79(0xce)+_0xe8cbf9['name']+_0x3f2c79(0xe8)+_0xe8cbf9[_0x3f2c79(0xcd)]));}return 0x1;}console['log'](a4_0x2632f5[_0x3f2c79(0x11d)]('\x0a✔\x20Pushed\x20'+(_0x5d34df+_0x252d52)+_0x3f2c79(0x113)+_0x36c9bb['projectName']+'\x27'));const _0x4d2717=getLLMProjectUrl(_0x4148a5,_0x36c9bb[_0x3f2c79(0x7b)]);return console[_0x3f2c79(0x12e)](_0x3f2c79(0x85)+a4_0x2632f5['cyan'](_0x4d2717)),0x0;}}
|
|
1
|
+
const a4_0x3cf511=a4_0x1bbf;(function(_0x58560f,_0x40f2a2){const _0x287218=a4_0x1bbf,_0x44c462=_0x58560f();while(!![]){try{const _0x1616da=parseInt(_0x287218(0x1fa))/0x1+parseInt(_0x287218(0x274))/0x2*(-parseInt(_0x287218(0x271))/0x3)+parseInt(_0x287218(0x251))/0x4*(parseInt(_0x287218(0x2b1))/0x5)+-parseInt(_0x287218(0x219))/0x6+-parseInt(_0x287218(0x283))/0x7*(parseInt(_0x287218(0x231))/0x8)+parseInt(_0x287218(0x28d))/0x9+parseInt(_0x287218(0x1f0))/0xa;if(_0x1616da===_0x40f2a2)break;else _0x44c462['push'](_0x44c462['shift']());}catch(_0x1f42a3){_0x44c462['push'](_0x44c462['shift']());}}}(a4_0x37bf,0x44d1e));import a4_0x22a571 from'chalk';import a4_0x2854d7 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a4_0x1bbf(_0x4bc5fa,_0x22f212){_0x4bc5fa=_0x4bc5fa-0x1ed;const _0x37bf52=a4_0x37bf();let _0x1bbf29=_0x37bf52[_0x4bc5fa];return _0x1bbf29;}import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';function a4_0x37bf(){const _0x21e528=['Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','llm','projectName','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','Project\x20cloned\x20with\x20errors','green','8528DzlcnA','Using\x20local\x20project:\x20','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)','✔\x20Context\x20set:\x20','Cancelled','\x0aChanges\x20to\x20integration\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project','reason','dirname','\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','error','Pushing\x20agent\x20from\x20\x22','log','context','llm_project','force','cwd','\x20\x20Integration\x20\x22','\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','sourceProjectName','\x0a✔\x20Pulled\x20','\x20unchanged','New\x20project:\x20','agent:pull','cyan','execute','cloneProject','agents','\x20\x20Agents:\x20','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','Chat:\x20','\x20--name\x20','4sRfWJi','\x20created','\x20\x20Prompt\x20\x22','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x20\x20Form\x20Interfaces:\x20','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','errors','\x20\x20Source:\x20','agentId','agentName','Pulling\x20agent\x20\x22','Using\x20project\x20from\x20context:\x20','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','INVALID_ARGUMENT','\x20\x20Target:\x20','\x0aChanges:','Status:\x20','\x20\x20Knowledge\x20Bases:\x20','\x20\x20Text\x20Knowledge\x20Bases:\x20','\x0aChanges\x20to\x20prompt\x20\x27','updated','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','\x20\x20Chat\x20Interface\x20\x22','agent','\x20\x20Agent\x20\x22','\x20\x20Chat\x20Interfaces:\x20','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','\x20\x20tdx\x20agent\x20pull\x20','70359oSeoqH','name','-\x20nothing\x20pushed','6cGaJGV','\x0a✔\x20Pushed\x20','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','total','tdx.json','agent.yml','Errors:','Project\x20cloned\x20successfully','newProjectId','utf-8','MISSING_ARGUMENT','new','\x0aChanges\x20to\x20agent\x20\x27','experimentalKnowledgeBases','2534iQNDAR','textKnowledgeBases','Output:\x20','join','\x20new','Writing\x20files...','pushProject','pushAgent','newProjectName','chatInterfaces','338292VvqisN','action','\x22...','push','Would\x20push\x20agent:\x20','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x22:\x20','\x20\x20Knowledge\x20Base\x20\x22','\x20changed','message','output','yellow','\x20--profile\x20','\x0aProject\x20pushed\x20with\x20errors','pullProject','\x0aPush\x20summary\x20for\x20\x27','counts','Dry\x20run\x20-\x20no\x20changes\x20made','no_context','\x20\x20Integrations:\x20','\x20errors','Using\x20context\x20project:\x20','cwd-config','Failed\x20to\x20push\x20agent:\x20','created','parse','found','\x20files\x20to\x20','\x20files?','\x20=\x20','prompts','yes','description','knowledgeBases','No\x20tdx.json\x20found\x20in\x20','Analyzing\x20project\x20\x22','1004925XzecxD','dryRun','outputPath','\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','profile','2171410EnwTTQ','Project:\x20','Would\x20pull\x20agent:\x20','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x0aError:','Using\x20project\x20from\x20','experimentalArtifacts','Output\x20path:\x20','\x20|\x20','unchanged','547523cfkafz','gray','Source:\x20','projectId','Agent:\x20','formInterfaces','\x20\x20Prompts:\x20','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','hasChanges','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','\x22\x20to\x20new\x20project\x20\x22','\x20resources\x20to\x20\x27','\x0aPull\x20summary\x20for\x20\x27','\x0aPush\x20','session','\x20\x20Experimental\x20Artifacts:\x20','\x20\x20Form\x20Interface\x20\x22','\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)','Would\x20clone:','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','repeat','dim','no_local_folder','outputDir','\x20total','\x22\x20to\x20\x22','Using\x20current\x20project:\x20','\x20successfully','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','isNew','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','1590600zNEoXb','\x0aErrors\x20found:','\x22\x20from\x20project\x20\x22','Cannot\x20clone\x20from\x20context\x20project\x20\x22','<new-name>','Summary:','diff','arg-dir','integrations','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','llmProject','red','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','site','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','Pushing\x20to\x20project...','\x20resources?','\x22\x20to\x20a\x20different\x20profile'];a4_0x37bf=function(){return _0x21e528;};return a4_0x37bf();}import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x5d1b65){const _0x4195ba=a4_0x1bbf,_0x17851a=[];if(_0x5d1b65[_0x4195ba(0x278)]!==undefined)_0x17851a[_0x4195ba(0x290)](_0x5d1b65[_0x4195ba(0x278)]+_0x4195ba(0x212));if(_0x5d1b65['new']!==undefined&&_0x5d1b65['new']>0x0)_0x17851a[_0x4195ba(0x290)](a4_0x22a571[_0x4195ba(0x230)](_0x5d1b65[_0x4195ba(0x280)]+_0x4195ba(0x287)));if(_0x5d1b65[_0x4195ba(0x2a5)]!==undefined&&_0x5d1b65[_0x4195ba(0x2a5)]>0x0)_0x17851a[_0x4195ba(0x290)](a4_0x22a571[_0x4195ba(0x230)](_0x5d1b65[_0x4195ba(0x2a5)]+_0x4195ba(0x252)));if(_0x5d1b65[_0x4195ba(0x269)]!==undefined&&_0x5d1b65[_0x4195ba(0x269)]>0x0)_0x17851a['push'](a4_0x22a571[_0x4195ba(0x298)](_0x5d1b65[_0x4195ba(0x269)]+'\x20updated'));if(_0x5d1b65['unchanged']!==undefined&&_0x5d1b65[_0x4195ba(0x1f9)]>0x0)_0x17851a['push'](a4_0x22a571[_0x4195ba(0x1fb)](_0x5d1b65[_0x4195ba(0x1f9)]+_0x4195ba(0x246)));if(_0x5d1b65[_0x4195ba(0x25b)]!==undefined&&_0x5d1b65['errors']>0x0)_0x17851a[_0x4195ba(0x290)](a4_0x22a571['red'](_0x5d1b65[_0x4195ba(0x25b)]+_0x4195ba(0x2a1)));return _0x17851a[_0x4195ba(0x286)](',\x20');}function displayDiffs(_0x323de2,_0x52ad57,_0x1daf1a,_0x12a330,_0x471e7d,_0x155675,_0x6d32c9,_0x219560,_0xad9d0){const _0x34fddb=a4_0x1bbf;for(const _0x1537d9 of _0x323de2){if(_0x1537d9[_0x34fddb(0x21f)]){const _0x2e6372=_0x1537d9[_0x34fddb(0x25e)]||_0x1537d9['name'];console[_0x34fddb(0x23d)](_0x34fddb(0x281)+_0x2e6372+'\x27:'),console[_0x34fddb(0x23d)]('─'[_0x34fddb(0x20e)](0x3c)),console[_0x34fddb(0x23d)](_0x1537d9[_0x34fddb(0x21f)]),console[_0x34fddb(0x23d)]('─'[_0x34fddb(0x20e)](0x3c));}}for(const _0x2a6f35 of _0x52ad57){_0x2a6f35['diff']&&(console['log'](_0x34fddb(0x254)+_0x2a6f35[_0x34fddb(0x272)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x34fddb(0x23d)](_0x2a6f35['diff']),console[_0x34fddb(0x23d)]('─'[_0x34fddb(0x20e)](0x3c)));}for(const _0x1bbcff of _0x1daf1a){_0x1bbcff[_0x34fddb(0x21f)]&&(console[_0x34fddb(0x23d)]('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x1bbcff[_0x34fddb(0x272)]+'\x27:'),console[_0x34fddb(0x23d)]('─'[_0x34fddb(0x20e)](0x3c)),console[_0x34fddb(0x23d)](_0x1bbcff['diff']),console['log']('─'[_0x34fddb(0x20e)](0x3c)));}for(const _0x268797 of _0x12a330){_0x268797[_0x34fddb(0x21f)]&&(console['log'](_0x34fddb(0x268)+_0x268797['name']+'\x27:'),console[_0x34fddb(0x23d)]('─'[_0x34fddb(0x20e)](0x3c)),console['log'](_0x268797[_0x34fddb(0x21f)]),console[_0x34fddb(0x23d)]('─'[_0x34fddb(0x20e)](0x3c)));}for(const _0x580ee0 of _0x471e7d){_0x580ee0[_0x34fddb(0x21f)]&&(console['log'](_0x34fddb(0x236)+_0x580ee0['name']+'\x27:'),console[_0x34fddb(0x23d)]('─'[_0x34fddb(0x20e)](0x3c)),console['log'](_0x580ee0[_0x34fddb(0x21f)]),console[_0x34fddb(0x23d)]('─'[_0x34fddb(0x20e)](0x3c)));}for(const _0x56a6ca of _0x155675){_0x56a6ca[_0x34fddb(0x21f)]&&(console['log'](_0x34fddb(0x24e)+_0x56a6ca[_0x34fddb(0x272)]+'\x27:'),console['log']('─'[_0x34fddb(0x20e)](0x3c)),console[_0x34fddb(0x23d)](_0x56a6ca[_0x34fddb(0x21f)]),console[_0x34fddb(0x23d)]('─'[_0x34fddb(0x20e)](0x3c)));}for(const _0x87820c of _0x6d32c9){_0x87820c[_0x34fddb(0x21f)]&&(console[_0x34fddb(0x23d)](_0x34fddb(0x277)+_0x87820c['name']+'\x27:'),console[_0x34fddb(0x23d)]('─'[_0x34fddb(0x20e)](0x3c)),console['log'](_0x87820c['diff']),console['log']('─'['repeat'](0x3c)));}for(const _0x5e504e of _0x219560){_0x5e504e['diff']&&(console[_0x34fddb(0x23d)]('\x0aChanges\x20to\x20form\x20interface\x20\x27'+_0x5e504e[_0x34fddb(0x272)]+'\x27:'),console[_0x34fddb(0x23d)]('─'['repeat'](0x3c)),console[_0x34fddb(0x23d)](_0x5e504e[_0x34fddb(0x21f)]),console[_0x34fddb(0x23d)]('─'[_0x34fddb(0x20e)](0x3c)));}for(const _0x3977e0 of _0xad9d0){_0x3977e0[_0x34fddb(0x21f)]&&(console[_0x34fddb(0x23d)]('\x0aChanges\x20to\x20chat\x20interface\x20\x27'+_0x3977e0[_0x34fddb(0x272)]+'\x27:'),console[_0x34fddb(0x23d)]('─'[_0x34fddb(0x20e)](0x3c)),console[_0x34fddb(0x23d)](_0x3977e0[_0x34fddb(0x21f)]),console['log']('─'['repeat'](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x3cf511(0x272)]=a4_0x3cf511(0x248);[a4_0x3cf511(0x2ad)]=a4_0x3cf511(0x1f3);async[a4_0x3cf511(0x24a)](_0x2847b2){const _0xd264b4=a4_0x3cf511,{options:_0x3c0966,args:_0xca8ddd,tdx:_0x449096}=_0x2847b2,_0x3f330c=_0xca8ddd[0x0],_0x3c8943=_0xca8ddd[0x1],_0x1c41cc=_0x3c0966[_0xd264b4(0x297)],_0x3ac747=_0x3c0966[_0xd264b4(0x2b2)],_0x276b74=_0x3c0966[_0xd264b4(0x240)],_0x2b9635=_0x3c0966[_0xd264b4(0x2ac)],_0x5d2d85=_0x3c0966[_0xd264b4(0x223)],_0x21c697=_0x3c0966[_0xd264b4(0x26c)];let _0xf69d44;if(_0x3f330c){const _0x229018=a4_0x2854d7[_0xd264b4(0x286)](_0x3f330c,'tdx.json');if(existsSync(_0x229018))try{const _0x3dca2c=JSON[_0xd264b4(0x2a6)](readFileSync(_0x229018,_0xd264b4(0x27e)));_0x3dca2c[_0xd264b4(0x23f)]&&(_0xf69d44={'llm_project':_0x3dca2c[_0xd264b4(0x23f)]});}catch{}}const _0x12b415=findAgentConfigPath(process[_0xd264b4(0x241)]());let _0x9f6c46;if(_0x12b415)try{const _0x3d7671=JSON[_0xd264b4(0x2a6)](readFileSync(_0x12b415,_0xd264b4(0x27e)));_0x3d7671['llm_project']&&(_0x9f6c46={'llm_project':_0x3d7671[_0xd264b4(0x23f)]});}catch{}const _0x4b0cb0=resolveAgentPullArgs({'arg':_0x3f330c,'agentNameArg':_0x3c8943,'agentFlag':_0x21c697,'contextProject':_0x5d2d85,'argDirConfig':_0xf69d44,'cwdConfigPath':_0x12b415||undefined,'cwdConfig':_0x9f6c46}),{projectNameOrId:_0x58b25d,targetAgentName:_0x22b383,existingOutputDir:_0x1e525d,source:_0x5441af}=_0x4b0cb0;if(_0x5441af===_0xd264b4(0x220))console[_0xd264b4(0x23d)](a4_0x22a571['dim'](_0xd264b4(0x1f5)+a4_0x2854d7[_0xd264b4(0x286)](_0x3f330c,'tdx.json')+':\x20'+_0x58b25d));else{if(_0x5441af===_0xd264b4(0x2a3))console[_0xd264b4(0x23d)](a4_0x22a571[_0xd264b4(0x20f)]('Using\x20project:\x20'+_0x58b25d));else _0x5441af===_0xd264b4(0x23e)&&console[_0xd264b4(0x23d)](a4_0x22a571[_0xd264b4(0x20f)](_0xd264b4(0x260)+_0x58b25d));}if(!_0x58b25d)return _0x21c697?(console[_0xd264b4(0x23d)](a4_0x22a571['yellow'](_0xd264b4(0x26a))),console[_0xd264b4(0x23d)](_0xd264b4(0x259)),console['log']('Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>')):(console[_0xd264b4(0x23d)](a4_0x22a571[_0xd264b4(0x298)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0xd264b4(0x23d)](_0xd264b4(0x233)),console[_0xd264b4(0x23d)](_0xd264b4(0x1ee)),console[_0xd264b4(0x23d)](_0xd264b4(0x243)),console[_0xd264b4(0x23d)](_0xd264b4(0x237)),console[_0xd264b4(0x23d)](_0xd264b4(0x23a))),0x1;if(_0x22b383){const {data:_0x521a30}=await withSpinner(_0xd264b4(0x25f)+_0x22b383+_0xd264b4(0x21b)+_0x58b25d+_0xd264b4(0x28f),()=>_0x449096[_0xd264b4(0x22c)]['pullAgent'](_0x58b25d,_0x22b383,_0x1c41cc,{'dryRun':_0x3ac747,'force':_0x276b74}));if(_0x3ac747)return console[_0xd264b4(0x23d)](a4_0x22a571['yellow']('Dry\x20run\x20-\x20no\x20files\x20written')),console[_0xd264b4(0x23d)](_0xd264b4(0x1f2)+_0x521a30[_0xd264b4(0x25e)]),console[_0xd264b4(0x23d)](_0xd264b4(0x1f7)+_0x521a30[_0xd264b4(0x1ed)]),_0x521a30[_0xd264b4(0x21f)]&&(console[_0xd264b4(0x23d)](_0xd264b4(0x264)),console['log']('─'['repeat'](0x3c)),console[_0xd264b4(0x23d)](_0x521a30[_0xd264b4(0x21f)]),console[_0xd264b4(0x23d)]('─'[_0xd264b4(0x20e)](0x3c))),0x0;return console[_0xd264b4(0x23d)](a4_0x22a571[_0xd264b4(0x230)]('Agent\x20pulled\x20successfully')),console[_0xd264b4(0x23d)](_0xd264b4(0x1fe)+_0x521a30[_0xd264b4(0x25e)]),console['log'](_0xd264b4(0x285)+_0x521a30[_0xd264b4(0x1ed)]),console[_0xd264b4(0x23d)](_0xd264b4(0x265)+(_0x521a30[_0xd264b4(0x217)]?a4_0x22a571[_0xd264b4(0x230)](_0xd264b4(0x280)):_0x521a30[_0xd264b4(0x202)]?a4_0x22a571[_0xd264b4(0x298)](_0xd264b4(0x269)):a4_0x22a571['gray'](_0xd264b4(0x1f9)))),0x0;}const _0xa26bba=_0x1e525d||_0x1c41cc,{data:_0x17b7e0}=await withSpinner(_0xd264b4(0x2b0)+_0x58b25d+_0xd264b4(0x28f),()=>_0x449096[_0xd264b4(0x22c)][_0xd264b4(0x29b)](_0x58b25d,_0xa26bba,{'dryRun':!![]})),_0x1d6361=_0x17b7e0[_0xd264b4(0x29d)]['agents'][_0xd264b4(0x280)]+_0x17b7e0['counts'][_0xd264b4(0x2ae)][_0xd264b4(0x280)]+_0x17b7e0['counts']['textKnowledgeBases'][_0xd264b4(0x280)]+_0x17b7e0[_0xd264b4(0x29d)][_0xd264b4(0x2ab)][_0xd264b4(0x280)]+_0x17b7e0[_0xd264b4(0x29d)][_0xd264b4(0x221)]['new']+_0x17b7e0[_0xd264b4(0x29d)][_0xd264b4(0x282)][_0xd264b4(0x280)]+_0x17b7e0[_0xd264b4(0x29d)][_0xd264b4(0x1f6)]['new']+_0x17b7e0[_0xd264b4(0x29d)][_0xd264b4(0x1ff)]['new']+_0x17b7e0[_0xd264b4(0x29d)]['chatInterfaces'][_0xd264b4(0x280)],_0x521b06=_0x17b7e0[_0xd264b4(0x29d)][_0xd264b4(0x24c)]['updated']+_0x17b7e0[_0xd264b4(0x29d)]['knowledgeBases'][_0xd264b4(0x269)]+_0x17b7e0['counts']['textKnowledgeBases'][_0xd264b4(0x269)]+_0x17b7e0[_0xd264b4(0x29d)][_0xd264b4(0x2ab)][_0xd264b4(0x269)]+_0x17b7e0[_0xd264b4(0x29d)][_0xd264b4(0x221)][_0xd264b4(0x269)]+_0x17b7e0[_0xd264b4(0x29d)]['experimentalKnowledgeBases']['updated']+_0x17b7e0[_0xd264b4(0x29d)][_0xd264b4(0x1f6)][_0xd264b4(0x269)]+_0x17b7e0[_0xd264b4(0x29d)][_0xd264b4(0x1ff)][_0xd264b4(0x269)]+_0x17b7e0['counts'][_0xd264b4(0x28c)][_0xd264b4(0x269)],_0x5cf6df=_0x17b7e0['counts'][_0xd264b4(0x24c)]['unchanged']+_0x17b7e0[_0xd264b4(0x29d)][_0xd264b4(0x2ae)][_0xd264b4(0x1f9)]+_0x17b7e0[_0xd264b4(0x29d)][_0xd264b4(0x284)][_0xd264b4(0x1f9)]+_0x17b7e0[_0xd264b4(0x29d)]['prompts'][_0xd264b4(0x1f9)]+_0x17b7e0[_0xd264b4(0x29d)][_0xd264b4(0x221)][_0xd264b4(0x1f9)]+_0x17b7e0[_0xd264b4(0x29d)]['experimentalKnowledgeBases']['unchanged']+_0x17b7e0[_0xd264b4(0x29d)]['experimentalArtifacts'][_0xd264b4(0x1f9)]+_0x17b7e0[_0xd264b4(0x29d)]['formInterfaces'][_0xd264b4(0x1f9)]+_0x17b7e0['counts'][_0xd264b4(0x28c)][_0xd264b4(0x1f9)];console[_0xd264b4(0x23d)](_0xd264b4(0x206)+_0x17b7e0[_0xd264b4(0x22d)]+'\x27:'),console[_0xd264b4(0x23d)]('\x20\x20'+a4_0x22a571['green']('+\x20'+_0x1d6361+_0xd264b4(0x287))+_0xd264b4(0x1f8)+a4_0x22a571[_0xd264b4(0x298)]('~\x20'+_0x521b06+'\x20changed')+_0xd264b4(0x1f8)+a4_0x22a571[_0xd264b4(0x20f)]('=\x20'+_0x5cf6df+_0xd264b4(0x246))),console[_0xd264b4(0x23d)](_0xd264b4(0x24d)+formatCountSummary(_0x17b7e0[_0xd264b4(0x29d)][_0xd264b4(0x24c)])),console[_0xd264b4(0x23d)](_0xd264b4(0x266)+formatCountSummary(_0x17b7e0[_0xd264b4(0x29d)][_0xd264b4(0x2ae)])),console[_0xd264b4(0x23d)](_0xd264b4(0x267)+formatCountSummary(_0x17b7e0[_0xd264b4(0x29d)]['textKnowledgeBases'])),console[_0xd264b4(0x23d)](_0xd264b4(0x200)+formatCountSummary(_0x17b7e0[_0xd264b4(0x29d)]['prompts'])),console['log'](_0xd264b4(0x2a0)+formatCountSummary(_0x17b7e0['counts']['integrations'])),console[_0xd264b4(0x23d)](_0xd264b4(0x256)+formatCountSummary(_0x17b7e0[_0xd264b4(0x29d)][_0xd264b4(0x1ff)])),console[_0xd264b4(0x23d)]('\x20\x20Chat\x20Interfaces:\x20'+formatCountSummary(_0x17b7e0['counts'][_0xd264b4(0x28c)]));const _0x32d767=_0x17b7e0[_0xd264b4(0x29d)]['experimentalKnowledgeBases'][_0xd264b4(0x278)]>0x0||_0x17b7e0[_0xd264b4(0x29d)][_0xd264b4(0x1f6)]['total']>0x0;_0x32d767&&(console[_0xd264b4(0x23d)](_0xd264b4(0x203)+formatCountSummary(_0x17b7e0[_0xd264b4(0x29d)]['experimentalKnowledgeBases'])),console[_0xd264b4(0x23d)](_0xd264b4(0x209)+formatCountSummary(_0x17b7e0['counts'][_0xd264b4(0x1f6)])));console['log'](_0xd264b4(0x263)+a4_0x22a571['cyan'](_0x17b7e0[_0xd264b4(0x211)])),displayDiffs(_0x17b7e0[_0xd264b4(0x24c)],_0x17b7e0[_0xd264b4(0x2ae)],_0x17b7e0['textKnowledgeBases'],_0x17b7e0[_0xd264b4(0x2ab)],_0x17b7e0[_0xd264b4(0x221)],_0x17b7e0['experimentalKnowledgeBases'],_0x17b7e0['experimentalArtifacts'],_0x17b7e0[_0xd264b4(0x1ff)],_0x17b7e0['chatInterfaces']);if(_0x3ac747)return console[_0xd264b4(0x23d)](a4_0x22a571[_0xd264b4(0x298)](_0xd264b4(0x216))),0x0;if(_0x1d6361===0x0&&_0x521b06===0x0)return console['log'](a4_0x22a571['green'](_0xd264b4(0x26f))),saveSessionContext({'llm_project':_0x17b7e0['projectName']},_0x3c0966[_0xd264b4(0x208)]),console[_0xd264b4(0x23d)](a4_0x22a571['green'](_0xd264b4(0x234)+a4_0x22a571[_0xd264b4(0x20f)](_0xd264b4(0x23f))+_0xd264b4(0x2aa)+a4_0x22a571[_0xd264b4(0x249)](_0x17b7e0['projectName']))),0x0;if(!_0x2b9635&&!_0x276b74){if(!isInteractive())return console['error'](a4_0x22a571[_0xd264b4(0x224)](_0xd264b4(0x1f4)),_0xd264b4(0x222)),console[_0xd264b4(0x23b)](a4_0x22a571['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x137d70=await confirmKey('\x0aWrite\x20'+(_0x1d6361+_0x521b06)+_0xd264b4(0x2a9));if(!_0x137d70)return console[_0xd264b4(0x23d)](a4_0x22a571[_0xd264b4(0x298)](_0xd264b4(0x235)),'-\x20no\x20files\x20written'),0x1;}const {data:_0x26989f}=await withSpinner(_0xd264b4(0x288),()=>_0x449096['llm'][_0xd264b4(0x29b)](_0x58b25d,_0xa26bba,{'force':_0x276b74}));return console['log'](a4_0x22a571[_0xd264b4(0x230)](_0xd264b4(0x245)+(_0x1d6361+_0x521b06)+_0xd264b4(0x2a8)+_0x26989f['outputDir'])),saveSessionContext({'llm_project':_0x26989f[_0xd264b4(0x22d)]},_0x3c0966[_0xd264b4(0x208)]),console[_0xd264b4(0x23d)](a4_0x22a571[_0xd264b4(0x230)](_0xd264b4(0x234)+a4_0x22a571[_0xd264b4(0x20f)](_0xd264b4(0x23f))+_0xd264b4(0x2aa)+a4_0x22a571[_0xd264b4(0x249)](_0x26989f['projectName']))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x3cf511(0x272)]='agent:clone';['description']=a4_0x3cf511(0x22b);async[a4_0x3cf511(0x24a)](_0x3125e1){const _0x20fb15=a4_0x3cf511,{options:_0x16466d,args:_0x26ec69,tdx:_0x282e03}=_0x3125e1,_0x412f5f=_0x26ec69[0x0],_0xa3085c=_0x16466d[_0x20fb15(0x272)],_0x4e9023=_0x16466d[_0x20fb15(0x2b2)],_0x39cfa4=_0x16466d[_0x20fb15(0x2ac)],_0x1dbd64=_0x16466d[_0x20fb15(0x226)],_0x52ba84=_0x16466d[_0x20fb15(0x223)];let _0x48feee;const _0x4fcc65=findAgentConfigPath(process[_0x20fb15(0x241)]());if(_0x412f5f){const _0x3ef0e0=a4_0x2854d7[_0x20fb15(0x286)](_0x412f5f,_0x20fb15(0x279));existsSync(_0x3ef0e0)?(_0x48feee=_0x412f5f,console['log'](a4_0x22a571[_0x20fb15(0x20f)](_0x20fb15(0x232)+_0x412f5f))):_0x48feee=_0x412f5f;}else{if(_0x4fcc65)_0x48feee=a4_0x2854d7['dirname'](_0x4fcc65),console[_0x20fb15(0x23d)](a4_0x22a571[_0x20fb15(0x20f)](_0x20fb15(0x214)+_0x48feee));else{if(_0x52ba84){const _0x10fd90=sanitizeForFilesystem(_0x52ba84);let _0x1db3c8=_0x10fd90,_0x30c840=a4_0x2854d7[_0x20fb15(0x286)](process[_0x20fb15(0x241)](),'agents',_0x10fd90,'tdx.json');if(!existsSync(_0x30c840)){const _0x5bc3ff=normalizeName(_0x52ba84),_0x4ba9e2=a4_0x2854d7['join'](process[_0x20fb15(0x241)](),_0x20fb15(0x24c),_0x5bc3ff,_0x20fb15(0x279));existsSync(_0x4ba9e2)&&(_0x1db3c8=_0x5bc3ff,_0x30c840=_0x4ba9e2);}if(existsSync(_0x30c840))_0x48feee=a4_0x2854d7[_0x20fb15(0x239)](_0x30c840),console[_0x20fb15(0x23d)](a4_0x22a571[_0x20fb15(0x20f)](_0x20fb15(0x232)+_0x48feee));else{const _0x380315=_0x16466d[_0x20fb15(0x1ef)];if(_0x380315)throw new SDKError(ErrorCode[_0x20fb15(0x262)],_0x20fb15(0x21c)+_0x52ba84+_0x20fb15(0x22a),undefined,{'helpText':_0x20fb15(0x22e)+_0x20fb15(0x255)+(_0x20fb15(0x270)+_0x52ba84+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0x1db3c8+_0x20fb15(0x250)+(_0xa3085c||_0x20fb15(0x21d))+_0x20fb15(0x299)+_0x380315)});_0x48feee=_0x52ba84,console[_0x20fb15(0x23d)](a4_0x22a571[_0x20fb15(0x20f)](_0x20fb15(0x2a2)+_0x52ba84));}}}}if(!_0x48feee)return console[_0x20fb15(0x23d)](a4_0x22a571['yellow']('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x20fb15(0x23d)](_0x20fb15(0x218)),console[_0x20fb15(0x23d)](_0x20fb15(0x261)),console[_0x20fb15(0x23d)](_0x20fb15(0x20b)),console[_0x20fb15(0x23d)](_0x20fb15(0x225)),0x1;if(!_0xa3085c)throw new SDKError(ErrorCode[_0x20fb15(0x27f)],'New\x20project\x20name\x20is\x20required',undefined,{'helpText':_0x20fb15(0x227)});if(!_0x39cfa4&&!_0x4e9023){if(!isInteractive())return console[_0x20fb15(0x23b)](a4_0x22a571['red'](_0x20fb15(0x1f4)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x20fb15(0x23b)](a4_0x22a571[_0x20fb15(0x20f)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x1cf662=await confirmKey('Clone\x20\x22'+_0x48feee+_0x20fb15(0x204)+_0xa3085c+'\x22?');if(!_0x1cf662)return console[_0x20fb15(0x23d)](a4_0x22a571[_0x20fb15(0x298)](_0x20fb15(0x235))),0x1;}const {data:_0x3ff8d3}=await withSpinner('Cloning\x20\x22'+_0x48feee+_0x20fb15(0x213)+_0xa3085c+_0x20fb15(0x28f),()=>_0x282e03['llm'][_0x20fb15(0x24b)](_0x48feee,_0xa3085c,{'dryRun':_0x4e9023}));if(_0x4e9023){console[_0x20fb15(0x23d)](a4_0x22a571['yellow']('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x20fb15(0x23d)]('Source:\x20'+_0x3ff8d3[_0x20fb15(0x244)]),console[_0x20fb15(0x23d)](_0x20fb15(0x247)+_0xa3085c),console[_0x20fb15(0x23d)](_0x20fb15(0x20c)),console[_0x20fb15(0x23d)](_0x20fb15(0x24d)+_0x3ff8d3[_0x20fb15(0x29d)][_0x20fb15(0x24c)][_0x20fb15(0x2a5)]),console[_0x20fb15(0x23d)](_0x20fb15(0x266)+_0x3ff8d3[_0x20fb15(0x29d)][_0x20fb15(0x2ae)][_0x20fb15(0x2a5)]),console['log'](_0x20fb15(0x200)+_0x3ff8d3[_0x20fb15(0x29d)][_0x20fb15(0x2ab)][_0x20fb15(0x2a5)]),console[_0x20fb15(0x23d)](_0x20fb15(0x256)+_0x3ff8d3[_0x20fb15(0x29d)][_0x20fb15(0x1ff)][_0x20fb15(0x2a5)]),console['log'](_0x20fb15(0x26e)+_0x3ff8d3['counts'][_0x20fb15(0x28c)][_0x20fb15(0x2a5)]);const _0x5d7391=_0x3ff8d3[_0x20fb15(0x29d)][_0x20fb15(0x282)][_0x20fb15(0x2a5)]>0x0||_0x3ff8d3[_0x20fb15(0x29d)]['experimentalArtifacts']['created']>0x0;return _0x5d7391&&(console['log']('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+_0x3ff8d3[_0x20fb15(0x29d)][_0x20fb15(0x282)][_0x20fb15(0x2a5)]),console[_0x20fb15(0x23d)]('\x20\x20Experimental\x20Artifacts:\x20'+_0x3ff8d3[_0x20fb15(0x29d)][_0x20fb15(0x1f6)][_0x20fb15(0x2a5)])),0x0;}const _0x1942a6=_0x3ff8d3[_0x20fb15(0x29d)][_0x20fb15(0x24c)][_0x20fb15(0x25b)]>0x0||_0x3ff8d3[_0x20fb15(0x29d)][_0x20fb15(0x2ae)][_0x20fb15(0x25b)]>0x0||_0x3ff8d3[_0x20fb15(0x29d)][_0x20fb15(0x2ab)]['errors']>0x0||_0x3ff8d3[_0x20fb15(0x29d)][_0x20fb15(0x1ff)]['errors']>0x0||_0x3ff8d3[_0x20fb15(0x29d)]['chatInterfaces'][_0x20fb15(0x25b)]>0x0||_0x3ff8d3[_0x20fb15(0x29d)][_0x20fb15(0x282)][_0x20fb15(0x25b)]>0x0||_0x3ff8d3['counts'][_0x20fb15(0x1f6)]['errors']>0x0;_0x1942a6?console[_0x20fb15(0x23d)](a4_0x22a571[_0x20fb15(0x298)](_0x20fb15(0x22f))):console[_0x20fb15(0x23d)](a4_0x22a571['green'](_0x20fb15(0x27c)));console[_0x20fb15(0x23d)](_0x20fb15(0x1fc)+_0x3ff8d3['sourceProjectName']),console['log'](_0x20fb15(0x247)+_0x3ff8d3[_0x20fb15(0x28b)]),console['log']('New\x20project\x20ID:\x20'+_0x3ff8d3[_0x20fb15(0x27d)]),console[_0x20fb15(0x23d)](),console['log'](_0x20fb15(0x21e)),console[_0x20fb15(0x23d)](_0x20fb15(0x24d)+formatCountSummary(_0x3ff8d3[_0x20fb15(0x29d)]['agents'])),console[_0x20fb15(0x23d)](_0x20fb15(0x266)+formatCountSummary(_0x3ff8d3['counts'][_0x20fb15(0x2ae)])),console[_0x20fb15(0x23d)](_0x20fb15(0x200)+formatCountSummary(_0x3ff8d3[_0x20fb15(0x29d)][_0x20fb15(0x2ab)])),console[_0x20fb15(0x23d)](_0x20fb15(0x2a0)+formatCountSummary(_0x3ff8d3[_0x20fb15(0x29d)]['integrations'])),console[_0x20fb15(0x23d)](_0x20fb15(0x256)+formatCountSummary(_0x3ff8d3[_0x20fb15(0x29d)]['formInterfaces'])),console[_0x20fb15(0x23d)](_0x20fb15(0x26e)+formatCountSummary(_0x3ff8d3[_0x20fb15(0x29d)]['chatInterfaces']));const _0x3f6c51=_0x3ff8d3[_0x20fb15(0x29d)][_0x20fb15(0x282)][_0x20fb15(0x2a5)]>0x0||_0x3ff8d3[_0x20fb15(0x29d)]['experimentalKnowledgeBases'][_0x20fb15(0x269)]>0x0||_0x3ff8d3[_0x20fb15(0x29d)]['experimentalKnowledgeBases'][_0x20fb15(0x1f9)]>0x0||_0x3ff8d3[_0x20fb15(0x29d)][_0x20fb15(0x1f6)][_0x20fb15(0x2a5)]>0x0||_0x3ff8d3[_0x20fb15(0x29d)]['experimentalArtifacts'][_0x20fb15(0x269)]>0x0||_0x3ff8d3[_0x20fb15(0x29d)]['experimentalArtifacts'][_0x20fb15(0x1f9)]>0x0;_0x3f6c51&&(console[_0x20fb15(0x23d)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x3ff8d3[_0x20fb15(0x29d)][_0x20fb15(0x282)])),console[_0x20fb15(0x23d)](_0x20fb15(0x209)+formatCountSummary(_0x3ff8d3[_0x20fb15(0x29d)][_0x20fb15(0x1f6)])));if(_0x1942a6){console[_0x20fb15(0x23d)](),console[_0x20fb15(0x23d)](a4_0x22a571[_0x20fb15(0x224)](_0x20fb15(0x27b)));for(const _0x389e2e of _0x3ff8d3['agents']){_0x389e2e[_0x20fb15(0x28e)]===_0x20fb15(0x23b)&&console[_0x20fb15(0x23d)](a4_0x22a571[_0x20fb15(0x224)](_0x20fb15(0x26d)+_0x389e2e[_0x20fb15(0x25e)]+'\x22:\x20'+_0x389e2e[_0x20fb15(0x23b)]));}for(const _0x12b933 of _0x3ff8d3['knowledgeBases']){_0x12b933[_0x20fb15(0x28e)]===_0x20fb15(0x23b)&&console[_0x20fb15(0x23d)](a4_0x22a571['red'](_0x20fb15(0x294)+_0x12b933[_0x20fb15(0x272)]+_0x20fb15(0x293)+_0x12b933[_0x20fb15(0x23b)]));}for(const _0x12ac04 of _0x3ff8d3['prompts']){_0x12ac04[_0x20fb15(0x28e)]===_0x20fb15(0x23b)&&console[_0x20fb15(0x23d)](a4_0x22a571[_0x20fb15(0x224)](_0x20fb15(0x253)+_0x12ac04[_0x20fb15(0x272)]+'\x22:\x20'+_0x12ac04[_0x20fb15(0x23b)]));}for(const _0x18f360 of _0x3ff8d3[_0x20fb15(0x221)]){_0x18f360['action']===_0x20fb15(0x23b)&&console[_0x20fb15(0x23d)](a4_0x22a571['red'](_0x20fb15(0x242)+_0x18f360['name']+_0x20fb15(0x293)+_0x18f360[_0x20fb15(0x23b)]));}for(const _0x5abc59 of _0x3ff8d3[_0x20fb15(0x1ff)]){_0x5abc59[_0x20fb15(0x28e)]===_0x20fb15(0x23b)&&console['log'](a4_0x22a571['red'](_0x20fb15(0x20a)+_0x5abc59[_0x20fb15(0x272)]+_0x20fb15(0x293)+_0x5abc59[_0x20fb15(0x23b)]));}for(const _0x51c0d7 of _0x3ff8d3[_0x20fb15(0x28c)]){_0x51c0d7[_0x20fb15(0x28e)]===_0x20fb15(0x23b)&&console[_0x20fb15(0x23d)](a4_0x22a571[_0x20fb15(0x224)](_0x20fb15(0x26b)+_0x51c0d7['name']+'\x22:\x20'+_0x51c0d7[_0x20fb15(0x23b)]));}for(const _0x3937a8 of _0x3ff8d3[_0x20fb15(0x282)]){_0x3937a8['action']===_0x20fb15(0x23b)&&console[_0x20fb15(0x23d)](a4_0x22a571[_0x20fb15(0x224)](_0x20fb15(0x258)+_0x3937a8[_0x20fb15(0x272)]+_0x20fb15(0x293)+_0x3937a8[_0x20fb15(0x23b)]));}for(const _0x55de3b of _0x3ff8d3[_0x20fb15(0x1f6)]){_0x55de3b[_0x20fb15(0x28e)]==='error'&&console[_0x20fb15(0x23d)](a4_0x22a571[_0x20fb15(0x224)]('\x20\x20Experimental\x20Artifact\x20\x22'+_0x55de3b['name']+_0x20fb15(0x293)+_0x55de3b[_0x20fb15(0x23b)]));}return 0x1;}console[_0x20fb15(0x23d)]();const _0x4f9736=getLLMProjectUrl(_0x1dbd64,_0x3ff8d3[_0x20fb15(0x27d)]);return console[_0x20fb15(0x23d)](_0x20fb15(0x1f1)+a4_0x22a571[_0x20fb15(0x249)](_0x4f9736)),0x0;}}export class AgentPushCommand extends BaseCommand{['name']='agent:push';[a4_0x3cf511(0x2ad)]=a4_0x3cf511(0x276);async[a4_0x3cf511(0x24a)](_0x3a0b4c){const _0x5e3343=a4_0x3cf511,{options:_0x42b14d,args:_0x2800e4,tdx:_0x375201}=_0x3a0b4c;let _0x5028ad=_0x2800e4[0x0]||process[_0x5e3343(0x241)]();const _0x4b299d=_0x42b14d[_0x5e3343(0x2b2)],_0x149963=_0x42b14d[_0x5e3343(0x240)],_0x40c394=_0x42b14d[_0x5e3343(0x2ac)],_0x393693=_0x42b14d['site'],_0x148b90=a4_0x2854d7[_0x5e3343(0x286)](_0x5028ad,_0x5e3343(0x27a)),_0x540b3a=existsSync(_0x148b90);if(_0x540b3a){const {data:_0x28d73d}=await withSpinner(_0x5e3343(0x23c)+_0x5028ad+'\x22...',()=>_0x375201[_0x5e3343(0x22c)][_0x5e3343(0x28a)](_0x5028ad,{'dryRun':_0x4b299d,'force':_0x149963}));if(_0x4b299d)return console[_0x5e3343(0x23d)](a4_0x22a571[_0x5e3343(0x298)](_0x5e3343(0x29e))),console[_0x5e3343(0x23d)](_0x5e3343(0x291)+_0x28d73d['agentName']),0x0;if(_0x28d73d[_0x5e3343(0x28e)]===_0x5e3343(0x23b))return console[_0x5e3343(0x23d)](a4_0x22a571[_0x5e3343(0x224)](_0x5e3343(0x2a4)+_0x28d73d[_0x5e3343(0x23b)])),0x1;console[_0x5e3343(0x23d)](a4_0x22a571[_0x5e3343(0x230)]('Agent\x20'+_0x28d73d[_0x5e3343(0x28e)]+_0x5e3343(0x215))),console['log'](_0x5e3343(0x1fe)+_0x28d73d[_0x5e3343(0x25e)]);if(_0x28d73d[_0x5e3343(0x25d)]&&_0x28d73d[_0x5e3343(0x1fd)]){const _0x3c08ae=getLLMAgentChatUrl(_0x393693,_0x28d73d['projectId'],_0x28d73d[_0x5e3343(0x25d)]);console['log'](_0x5e3343(0x24f)+a4_0x22a571['cyan'](_0x3c08ae));}return 0x0;}const _0x178f33=_0x42b14d[_0x5e3343(0x223)],_0x4dc67a=resolveProjectFromContext(_0x5028ad,_0x178f33);if(_0x4dc67a[_0x5e3343(0x2a7)])_0x5028ad=_0x4dc67a['projectDir'],_0x4dc67a['source']===_0x5e3343(0x23e)&&console[_0x5e3343(0x23d)](a4_0x22a571[_0x5e3343(0x20f)]('Using\x20project:\x20'+_0x5028ad));else{let _0x9bba39='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x4dc67a['reason']===_0x5e3343(0x210)&&(_0x9bba39=_0x4dc67a[_0x5e3343(0x296)]+_0x5e3343(0x257)+_0x4dc67a[_0x5e3343(0x223)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');throw new SDKError(ErrorCode[_0x5e3343(0x262)],_0x4dc67a[_0x5e3343(0x238)]===_0x5e3343(0x29f)?_0x4dc67a[_0x5e3343(0x296)]:_0x5e3343(0x2af)+_0x5028ad,undefined,{'helpText':_0x9bba39});}const {data:_0x34db73}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x375201[_0x5e3343(0x22c)][_0x5e3343(0x289)](_0x5028ad,{'dryRun':!![]})),_0x540776=_0x34db73[_0x5e3343(0x29d)][_0x5e3343(0x24c)]['errors']>0x0;if(_0x540776){console[_0x5e3343(0x23d)](a4_0x22a571[_0x5e3343(0x224)](_0x5e3343(0x21a)));for(const _0x10e487 of _0x34db73[_0x5e3343(0x24c)]){_0x10e487['action']===_0x5e3343(0x23b)&&console[_0x5e3343(0x23d)](a4_0x22a571['red'](_0x5e3343(0x26d)+_0x10e487[_0x5e3343(0x25e)]+_0x5e3343(0x293)+_0x10e487['error']));}return 0x1;}const _0x32c9a7=_0x34db73[_0x5e3343(0x29d)][_0x5e3343(0x24c)][_0x5e3343(0x2a5)]+_0x34db73[_0x5e3343(0x29d)]['knowledgeBases'][_0x5e3343(0x2a5)]+_0x34db73[_0x5e3343(0x29d)][_0x5e3343(0x284)]['created']+_0x34db73['counts'][_0x5e3343(0x2ab)]['created']+_0x34db73[_0x5e3343(0x29d)][_0x5e3343(0x221)][_0x5e3343(0x2a5)]+_0x34db73[_0x5e3343(0x29d)][_0x5e3343(0x282)][_0x5e3343(0x2a5)]+_0x34db73[_0x5e3343(0x29d)][_0x5e3343(0x1f6)][_0x5e3343(0x2a5)]+_0x34db73['counts']['formInterfaces'][_0x5e3343(0x2a5)]+_0x34db73[_0x5e3343(0x29d)]['chatInterfaces']['created'],_0x234601=_0x34db73[_0x5e3343(0x29d)][_0x5e3343(0x24c)][_0x5e3343(0x269)]+_0x34db73['counts'][_0x5e3343(0x2ae)][_0x5e3343(0x269)]+_0x34db73[_0x5e3343(0x29d)][_0x5e3343(0x284)][_0x5e3343(0x269)]+_0x34db73[_0x5e3343(0x29d)][_0x5e3343(0x2ab)][_0x5e3343(0x269)]+_0x34db73['counts']['integrations'][_0x5e3343(0x269)]+_0x34db73[_0x5e3343(0x29d)][_0x5e3343(0x282)][_0x5e3343(0x269)]+_0x34db73[_0x5e3343(0x29d)][_0x5e3343(0x1f6)][_0x5e3343(0x269)]+_0x34db73[_0x5e3343(0x29d)][_0x5e3343(0x1ff)]['updated']+_0x34db73[_0x5e3343(0x29d)][_0x5e3343(0x28c)][_0x5e3343(0x269)],_0x4142c8=_0x34db73[_0x5e3343(0x29d)]['agents'][_0x5e3343(0x1f9)]+_0x34db73[_0x5e3343(0x29d)]['knowledgeBases']['unchanged']+_0x34db73[_0x5e3343(0x29d)][_0x5e3343(0x284)]['unchanged']+_0x34db73['counts'][_0x5e3343(0x2ab)][_0x5e3343(0x1f9)]+_0x34db73[_0x5e3343(0x29d)][_0x5e3343(0x221)]['unchanged']+_0x34db73['counts']['experimentalKnowledgeBases'][_0x5e3343(0x1f9)]+_0x34db73[_0x5e3343(0x29d)][_0x5e3343(0x1f6)][_0x5e3343(0x1f9)]+_0x34db73[_0x5e3343(0x29d)][_0x5e3343(0x1ff)]['unchanged']+_0x34db73[_0x5e3343(0x29d)][_0x5e3343(0x28c)]['unchanged'];console[_0x5e3343(0x23d)](_0x5e3343(0x29c)+_0x34db73['projectName']+'\x27:'),console[_0x5e3343(0x23d)]('\x20\x20'+a4_0x22a571[_0x5e3343(0x230)]('+\x20'+_0x32c9a7+'\x20new')+_0x5e3343(0x1f8)+a4_0x22a571['yellow']('~\x20'+_0x234601+_0x5e3343(0x295))+_0x5e3343(0x1f8)+a4_0x22a571['dim']('=\x20'+_0x4142c8+'\x20unchanged')),console[_0x5e3343(0x23d)](_0x5e3343(0x24d)+formatCountSummary(_0x34db73[_0x5e3343(0x29d)]['agents'])),console[_0x5e3343(0x23d)](_0x5e3343(0x266)+formatCountSummary(_0x34db73[_0x5e3343(0x29d)][_0x5e3343(0x2ae)])),console[_0x5e3343(0x23d)](_0x5e3343(0x267)+formatCountSummary(_0x34db73[_0x5e3343(0x29d)][_0x5e3343(0x284)])),console[_0x5e3343(0x23d)](_0x5e3343(0x200)+formatCountSummary(_0x34db73[_0x5e3343(0x29d)]['prompts'])),console[_0x5e3343(0x23d)](_0x5e3343(0x2a0)+formatCountSummary(_0x34db73['counts'][_0x5e3343(0x221)])),console[_0x5e3343(0x23d)](_0x5e3343(0x256)+formatCountSummary(_0x34db73[_0x5e3343(0x29d)][_0x5e3343(0x1ff)])),console['log'](_0x5e3343(0x26e)+formatCountSummary(_0x34db73[_0x5e3343(0x29d)][_0x5e3343(0x28c)]));const _0x15e3e5=_0x34db73[_0x5e3343(0x29d)][_0x5e3343(0x282)][_0x5e3343(0x2a5)]>0x0||_0x34db73[_0x5e3343(0x29d)]['experimentalKnowledgeBases'][_0x5e3343(0x269)]>0x0||_0x34db73[_0x5e3343(0x29d)][_0x5e3343(0x282)][_0x5e3343(0x1f9)]>0x0||_0x34db73[_0x5e3343(0x29d)][_0x5e3343(0x1f6)][_0x5e3343(0x2a5)]>0x0||_0x34db73[_0x5e3343(0x29d)][_0x5e3343(0x1f6)]['updated']>0x0||_0x34db73['counts']['experimentalArtifacts'][_0x5e3343(0x1f9)]>0x0;_0x15e3e5&&(console[_0x5e3343(0x23d)](_0x5e3343(0x203)+formatCountSummary(_0x34db73[_0x5e3343(0x29d)][_0x5e3343(0x282)])),console[_0x5e3343(0x23d)](_0x5e3343(0x209)+formatCountSummary(_0x34db73[_0x5e3343(0x29d)][_0x5e3343(0x1f6)])));console[_0x5e3343(0x23d)](_0x5e3343(0x25c)+a4_0x22a571[_0x5e3343(0x249)](_0x5028ad)),displayDiffs(_0x34db73[_0x5e3343(0x24c)],_0x34db73[_0x5e3343(0x2ae)],_0x34db73[_0x5e3343(0x284)],_0x34db73['prompts'],_0x34db73[_0x5e3343(0x221)],_0x34db73[_0x5e3343(0x282)],_0x34db73['experimentalArtifacts'],_0x34db73[_0x5e3343(0x1ff)],_0x34db73['chatInterfaces']);if(_0x4b299d)return console[_0x5e3343(0x23d)](a4_0x22a571[_0x5e3343(0x298)](_0x5e3343(0x25a))),0x0;if(_0x32c9a7===0x0&&_0x234601===0x0){console[_0x5e3343(0x23d)](a4_0x22a571[_0x5e3343(0x230)](_0x5e3343(0x201)));const _0x465b94=getLLMProjectUrl(_0x393693,_0x34db73[_0x5e3343(0x1fd)]);return console['log'](_0x5e3343(0x1f1)+a4_0x22a571[_0x5e3343(0x249)](_0x465b94)),0x0;}if(!_0x40c394&&!_0x149963){if(!isInteractive())return console[_0x5e3343(0x23b)](a4_0x22a571[_0x5e3343(0x224)](_0x5e3343(0x1f4)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x5e3343(0x23b)](a4_0x22a571[_0x5e3343(0x20f)](_0x5e3343(0x20d))),0x1;const _0x42d760=await confirmKey(_0x5e3343(0x207)+(_0x32c9a7+_0x234601)+_0x5e3343(0x229));if(!_0x42d760)return console[_0x5e3343(0x23d)](a4_0x22a571[_0x5e3343(0x298)]('Cancelled'),_0x5e3343(0x273)),0x1;}const {data:_0x148bf0}=await withSpinner(_0x5e3343(0x228),()=>_0x375201[_0x5e3343(0x22c)][_0x5e3343(0x289)](_0x5028ad,{'force':_0x149963})),_0xfb38f2=_0x148bf0[_0x5e3343(0x29d)][_0x5e3343(0x24c)][_0x5e3343(0x25b)]>0x0||_0x148bf0['counts'][_0x5e3343(0x2ae)]['errors']>0x0||_0x148bf0[_0x5e3343(0x29d)][_0x5e3343(0x284)][_0x5e3343(0x25b)]>0x0||_0x148bf0[_0x5e3343(0x29d)][_0x5e3343(0x2ab)][_0x5e3343(0x25b)]>0x0||_0x148bf0[_0x5e3343(0x29d)][_0x5e3343(0x1ff)][_0x5e3343(0x25b)]>0x0||_0x148bf0[_0x5e3343(0x29d)][_0x5e3343(0x28c)]['errors']>0x0;if(_0xfb38f2){console[_0x5e3343(0x23d)](a4_0x22a571[_0x5e3343(0x298)](_0x5e3343(0x29a))),console['log'](),console[_0x5e3343(0x23d)](a4_0x22a571[_0x5e3343(0x224)]('Errors:'));for(const _0x24582a of _0x148bf0[_0x5e3343(0x24c)]){_0x24582a['action']===_0x5e3343(0x23b)&&console[_0x5e3343(0x23d)](a4_0x22a571[_0x5e3343(0x224)](_0x5e3343(0x26d)+_0x24582a['agentName']+_0x5e3343(0x293)+_0x24582a[_0x5e3343(0x23b)]));}for(const _0x2d44f5 of _0x148bf0[_0x5e3343(0x2ae)]){_0x2d44f5[_0x5e3343(0x28e)]===_0x5e3343(0x23b)&&console[_0x5e3343(0x23d)](a4_0x22a571['red']('\x20\x20Knowledge\x20Base\x20\x22'+_0x2d44f5['name']+_0x5e3343(0x293)+_0x2d44f5['error']));}for(const _0xba46ef of _0x148bf0[_0x5e3343(0x284)]){_0xba46ef[_0x5e3343(0x28e)]===_0x5e3343(0x23b)&&console['log'](a4_0x22a571[_0x5e3343(0x224)](_0x5e3343(0x292)+_0xba46ef['name']+_0x5e3343(0x293)+_0xba46ef[_0x5e3343(0x23b)]));}for(const _0xeeb2eb of _0x148bf0[_0x5e3343(0x2ab)]){_0xeeb2eb[_0x5e3343(0x28e)]===_0x5e3343(0x23b)&&console[_0x5e3343(0x23d)](a4_0x22a571[_0x5e3343(0x224)]('\x20\x20Prompt\x20\x22'+_0xeeb2eb['name']+'\x22:\x20'+_0xeeb2eb['error']));}for(const _0x42fc24 of _0x148bf0[_0x5e3343(0x221)]){_0x42fc24[_0x5e3343(0x28e)]==='error'&&console[_0x5e3343(0x23d)](a4_0x22a571[_0x5e3343(0x224)]('\x20\x20Integration\x20\x22'+_0x42fc24[_0x5e3343(0x272)]+_0x5e3343(0x293)+_0x42fc24[_0x5e3343(0x23b)]));}for(const _0x68e241 of _0x148bf0[_0x5e3343(0x1ff)]){_0x68e241[_0x5e3343(0x28e)]===_0x5e3343(0x23b)&&console['log'](a4_0x22a571[_0x5e3343(0x224)]('\x20\x20Form\x20Interface\x20\x22'+_0x68e241[_0x5e3343(0x272)]+_0x5e3343(0x293)+_0x68e241['error']));}for(const _0x4a2140 of _0x148bf0[_0x5e3343(0x28c)]){_0x4a2140[_0x5e3343(0x28e)]===_0x5e3343(0x23b)&&console[_0x5e3343(0x23d)](a4_0x22a571['red'](_0x5e3343(0x26b)+_0x4a2140[_0x5e3343(0x272)]+_0x5e3343(0x293)+_0x4a2140[_0x5e3343(0x23b)]));}return 0x1;}console[_0x5e3343(0x23d)](a4_0x22a571[_0x5e3343(0x230)](_0x5e3343(0x275)+(_0x32c9a7+_0x234601)+_0x5e3343(0x205)+_0x148bf0[_0x5e3343(0x22d)]+'\x27'));const _0x44a96a=getLLMProjectUrl(_0x393693,_0x148bf0[_0x5e3343(0x1fd)]);return console[_0x5e3343(0x23d)](_0x5e3343(0x1f1)+a4_0x22a571[_0x5e3343(0x249)](_0x44a96a)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x3af3c2=a5_0x5c7f;(function(_0x333229,_0x384949){const _0x36f947=a5_0x5c7f,_0x32a957=_0x333229();while(!![]){try{const _0x5f059b=parseInt(_0x36f947(0x1a0))/0x1*(-parseInt(_0x36f947(0x187))/0x2)+-parseInt(_0x36f947(0x1b6))/0x3+-parseInt(_0x36f947(0x1dd))/0x4+-parseInt(_0x36f947(0x17b))/0x5+parseInt(_0x36f947(0x1c5))/0x6+parseInt(_0x36f947(0x192))/0x7*(parseInt(_0x36f947(0x1c7))/0x8)+-parseInt(_0x36f947(0x1ed))/0x9*(-parseInt(_0x36f947(0x15b))/0xa);if(_0x5f059b===_0x384949)break;else _0x32a957['push'](_0x32a957['shift']());}catch(_0x21caa7){_0x32a957['push'](_0x32a957['shift']());}}}(a5_0x2a53,0x64c28));function a5_0x2a53(){const _0x53274c=['agentName','conversation_url','7joFNhu','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','projectDir','Error:\x20No\x20previous\x20test\x20run\x20found.','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','projectName','✗\x20ERROR:\x20','\x20\x20Project:\x20','PASS','FAIL','text','\x27\x20to\x20create\x20the\x20folder\x20structure.','Tests\x20found:\x20','tags','146578zbkMql','map','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','\x20(cached)','jsonl','source','not\x20found','Duration:\x20','Test\x20Configuration:','\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)','dryRun','resolve','Round\x201/','\x22:\x20','Available\x20tags:\x20','Failed\x20Tests:','Output\x20written\x20to:\x20','green','Failed:\x20\x20\x20','404','reeval','Re-evaluating...','729531AooHRK','repeat','message','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','start','site','forEach','\x22,\x20but\x20current\x20site\x20is\x20\x22',':\x20Sending\x20user\x20input...','Evaluating\x20response...','find','timestamp','Executing\x20new\x20tests...','eval','table','4163658FwsTdT','split','4623848zKRHxZ','toLowerCase','status','Either\x20switch\x20to\x20the\x20\x22','log','Running\x20test:\x20','\x20\x20-\x20','red','\x20\x20Evaluating...\x20','Conversation\x20URL:\x20','join','now','Agent:\x20','✓\x20PASS:\x20','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','cyan','context','trim','Errors:\x20\x20\x20','no_local_folder','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','Test\x20','1029540FUhdoL','Site:\x20','Running\x20agent\x20tests...','yellow','ERROR','writeFileSync','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','test.yml','rounds','Available\x20tests:\x20','multiple_agents','Passed:\x20\x20\x20','\x20-\x20','no_context','Re-evaluating\x20cached\x20test\x20run...','...\x20','444159OgEinH','dim','length','Re-evaluating\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','Run\x20tests\x20for\x20an\x20LLM\x20agent','✗\x20FAIL:\x20','tests','agent:test','reason','conversations','toISOString','70ozPPqi','filter','/<agent-name>','basename','...','⚠\x20SKIPPED:\x20','stop','includes','agent','\x20\x20Agent:\x20','New\x20tests\x20to\x20execute:\x20','has','description','llm','llmProject','white','name','Error\x20writing\x20output\x20file:\x20','resolveProjectId','Total:\x20\x20\x20\x20','testName','Run\x20\x27tdx\x20agent\x20pull\x20','add','push','Round\x20','json','verbose','size','\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','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','Cached\x20run\x20from:\x20','agentDirs','2787645TwTcdK','executeReeval','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','No\x20tests\x20found\x20matching:\x20','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','Usage:','utf-8','existsSync','\x20\x20Conversation:\x20','\x20\x20Round\x20','some','2TYrOhy','found','✗\x20ERROR:\x20Project\x20not\x20found:\x20','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Cached\x20run\x20is\x20from\x20site\x20\x22','execute','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','no_tests','Using\x20agent:\x20'];a5_0x2a53=function(){return _0x53274c;};return a5_0x2a53();}import*as a5_0x4b70d2 from'node:fs';import*as a5_0x328980 from'node:path';import a5_0x1acfce from'chalk';import{BaseCommand}from'./command.js';function a5_0x5c7f(_0x9feecd,_0x1dab52){_0x9feecd=_0x9feecd-0x156;const _0x2a5326=a5_0x2a53();let _0x5c7fb7=_0x2a5326[_0x9feecd];return _0x5c7fb7;}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_0x3af3c2(0x16b)]=a5_0x3af3c2(0x157);[a5_0x3af3c2(0x167)]=a5_0x3af3c2(0x1f2);async[a5_0x3af3c2(0x18c)](_0x5a788e){const _0x33a6a0=a5_0x3af3c2,{options:_0x5d8784,args:_0x37764a,tdx:_0x499546}=_0x5a788e,_0x409e1e=_0x37764a[0x0]||'.',_0x5ea2cd=_0x5d8784[_0x33a6a0(0x1aa)],_0x2a3909=_0x5d8784,_0x16e749=_0x2a3909[_0x33a6a0(0x1c3)]===![],_0x2bcebc=_0x2a3909[_0x33a6a0(0x1b4)],_0x552e81=_0x2a3909[_0x33a6a0(0x16b)],_0x4fda8c=_0x2a3909['tags'],_0x5d55ae=_0x5d8784[_0x33a6a0(0x1bb)],_0x122e7f=_0x2a3909['output'];if(_0x2bcebc&&_0x16e749)return console[_0x33a6a0(0x1cb)](a5_0x1acfce[_0x33a6a0(0x1ce)](_0x33a6a0(0x17d))),0x1;let _0x519b32='table';if(_0x2a3909[_0x33a6a0(0x174)])_0x519b32=_0x33a6a0(0x174);else{if(_0x2a3909[_0x33a6a0(0x1a4)])_0x519b32=_0x33a6a0(0x1a4);else{if(_0x2a3909['tsv'])_0x519b32='tsv';else{if(_0x2a3909[_0x33a6a0(0x1c4)])_0x519b32=_0x33a6a0(0x1c4);}}}const _0x2addaf=_0x2a3909['llmProject'];let _0x86ce56=_0x409e1e;const _0x3ab527=a5_0x4b70d2[_0x33a6a0(0x183)](_0x409e1e),_0x499c7c=_0x409e1e==='.';if(!_0x3ab527||_0x499c7c){const _0x281420=resolveProjectFromContext(_0x409e1e,_0x2addaf,{'requireFile':_0x33a6a0(0x1e4)});if(_0x281420[_0x33a6a0(0x188)])_0x86ce56=_0x281420[_0x33a6a0(0x194)],_0x281420[_0x33a6a0(0x1a5)]===_0x33a6a0(0x1d7)&&console[_0x33a6a0(0x1cb)](a5_0x1acfce['dim'](_0x33a6a0(0x18f)+_0x86ce56));else switch(_0x281420[_0x33a6a0(0x158)]){case _0x33a6a0(0x1ea):console[_0x33a6a0(0x1cb)](a5_0x1acfce['yellow'](_0x281420[_0x33a6a0(0x1b8)])),console[_0x33a6a0(0x1cb)](),console[_0x33a6a0(0x1cb)](_0x33a6a0(0x181)),console['log'](_0x33a6a0(0x177)),console[_0x33a6a0(0x1cb)](_0x33a6a0(0x1a9)),console['log'](),console[_0x33a6a0(0x1cb)](_0x33a6a0(0x17e));return 0x1;case _0x33a6a0(0x1da):console[_0x33a6a0(0x1cb)](a5_0x1acfce[_0x33a6a0(0x1e0)](_0x281420[_0x33a6a0(0x1b8)])),console[_0x33a6a0(0x1cb)](),console[_0x33a6a0(0x1cb)](_0x33a6a0(0x170)+_0x281420['llmProject']+_0x33a6a0(0x19d));return 0x1;case _0x33a6a0(0x1e7):{const _0x4ac8de=a5_0x328980[_0x33a6a0(0x15e)](_0x281420['projectDir']);console[_0x33a6a0(0x1cb)](a5_0x1acfce[_0x33a6a0(0x1e0)](_0x33a6a0(0x180)+_0x281420[_0x33a6a0(0x169)]+'\x22:'));for(const _0x35fe87 of _0x281420[_0x33a6a0(0x17a)]){console[_0x33a6a0(0x1cb)](_0x33a6a0(0x1cd)+_0x35fe87);}return console['log'](),console['log'](_0x33a6a0(0x193)+_0x4ac8de+_0x33a6a0(0x15d)),0x1;}case _0x33a6a0(0x18e):console[_0x33a6a0(0x1cb)](a5_0x1acfce['yellow']('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x281420[_0x33a6a0(0x169)]+'\x22.')),console[_0x33a6a0(0x1cb)](a5_0x1acfce['dim']('Project\x20path:\x20'+_0x281420[_0x33a6a0(0x194)])),console[_0x33a6a0(0x1cb)](),console[_0x33a6a0(0x1cb)](_0x33a6a0(0x1d5));return 0x1;}}const {definition:_0x3d33e6,agentInfo:_0x530be9}=parseTestFile(_0x86ce56);let _0x1b23e9=_0x3d33e6[_0x33a6a0(0x156)];if(_0x552e81){const _0x283fa0=_0x552e81[_0x33a6a0(0x1c6)](',')[_0x33a6a0(0x1a1)](_0x36f28a=>_0x36f28a[_0x33a6a0(0x1d8)]());_0x1b23e9=_0x3d33e6[_0x33a6a0(0x156)][_0x33a6a0(0x15c)](_0x1c5e10=>_0x283fa0[_0x33a6a0(0x162)](_0x1c5e10['name']));if(_0x1b23e9[_0x33a6a0(0x1ef)]===0x0)return console[_0x33a6a0(0x1cb)](a5_0x1acfce[_0x33a6a0(0x1e0)](_0x33a6a0(0x17f)+_0x552e81)),console[_0x33a6a0(0x1cb)](a5_0x1acfce[_0x33a6a0(0x1ee)](_0x33a6a0(0x1e6)+_0x3d33e6[_0x33a6a0(0x156)][_0x33a6a0(0x1a1)](_0x10c1d0=>_0x10c1d0[_0x33a6a0(0x16b)])[_0x33a6a0(0x1d1)](',\x20'))),0x1;}if(_0x4fda8c){const _0x43ed32=_0x4fda8c[_0x33a6a0(0x1c6)](',')[_0x33a6a0(0x1a1)](_0x3daf38=>_0x3daf38[_0x33a6a0(0x1d8)]()['toLowerCase']());_0x1b23e9=_0x1b23e9['filter'](_0x375e20=>_0x375e20[_0x33a6a0(0x19f)]?.[_0x33a6a0(0x186)](_0x14f749=>_0x43ed32[_0x33a6a0(0x162)](_0x14f749[_0x33a6a0(0x1c8)]())));if(_0x1b23e9[_0x33a6a0(0x1ef)]===0x0){console[_0x33a6a0(0x1cb)](a5_0x1acfce[_0x33a6a0(0x1e0)]('No\x20tests\x20found\x20with\x20tags:\x20'+_0x4fda8c));const _0x140897=new Set();return _0x3d33e6[_0x33a6a0(0x156)][_0x33a6a0(0x1bc)](_0x2db13c=>_0x2db13c['tags']?.[_0x33a6a0(0x1bc)](_0x45b235=>_0x140897[_0x33a6a0(0x171)](_0x45b235))),_0x140897[_0x33a6a0(0x176)]>0x0?console[_0x33a6a0(0x1cb)](a5_0x1acfce[_0x33a6a0(0x1ee)](_0x33a6a0(0x1ae)+[..._0x140897][_0x33a6a0(0x1d1)](',\x20'))):console[_0x33a6a0(0x1cb)](a5_0x1acfce[_0x33a6a0(0x1ee)]('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0x2bcebc)return this['executeReeval'](_0x5a788e,{'definition':{'tests':_0x1b23e9},'agentInfo':_0x530be9,'outputFormat':_0x519b32,'outputFile':_0x122e7f,'testNames':_0x552e81});if(_0x5ea2cd){console[_0x33a6a0(0x1cb)](a5_0x1acfce[_0x33a6a0(0x1d6)](_0x33a6a0(0x1a8))),console[_0x33a6a0(0x1cb)]('\x20\x20Site:\x20'+a5_0x1acfce[_0x33a6a0(0x16a)](_0x5d55ae)),console[_0x33a6a0(0x1cb)](_0x33a6a0(0x199)+a5_0x1acfce[_0x33a6a0(0x16a)](_0x530be9[_0x33a6a0(0x197)])),console[_0x33a6a0(0x1cb)](_0x33a6a0(0x164)+a5_0x1acfce[_0x33a6a0(0x16a)](_0x530be9[_0x33a6a0(0x190)])),console[_0x33a6a0(0x1cb)](),console[_0x33a6a0(0x1cb)](_0x33a6a0(0x19e)+a5_0x1acfce[_0x33a6a0(0x16a)](_0x1b23e9[_0x33a6a0(0x1ef)]));for(let _0x2ddd6a=0x0;_0x2ddd6a<_0x1b23e9['length'];_0x2ddd6a++){const _0x6c9932=_0x1b23e9[_0x2ddd6a],_0x414e67=_0x6c9932[_0x33a6a0(0x1e5)]['length']===0x1?'round':_0x33a6a0(0x1e5),_0x28f43f=_0x6c9932[_0x33a6a0(0x19f)]?.[_0x33a6a0(0x1ef)]?'\x20['+_0x6c9932[_0x33a6a0(0x19f)][_0x33a6a0(0x1d1)](',\x20')+']':'';console[_0x33a6a0(0x1cb)]('\x20\x20'+(_0x2ddd6a+0x1)+'.\x20'+a5_0x1acfce[_0x33a6a0(0x16a)](_0x6c9932[_0x33a6a0(0x16b)])+'\x20('+_0x6c9932[_0x33a6a0(0x1e5)][_0x33a6a0(0x1ef)]+'\x20'+_0x414e67+')'+a5_0x1acfce['dim'](_0x28f43f));}return 0x0;}let _0x359e79,_0x2e3851;try{_0x359e79=await _0x499546['llm'][_0x33a6a0(0x16d)](_0x530be9[_0x33a6a0(0x197)]);}catch(_0x3b2e46){const _0x1c6313=_0x3b2e46 instanceof Error?_0x3b2e46[_0x33a6a0(0x1b8)]:String(_0x3b2e46);return _0x1c6313[_0x33a6a0(0x162)](_0x33a6a0(0x1b3))||_0x1c6313['toLowerCase']()[_0x33a6a0(0x162)](_0x33a6a0(0x1a6))?console[_0x33a6a0(0x1cb)](a5_0x1acfce['red'](_0x33a6a0(0x189)+_0x530be9[_0x33a6a0(0x197)])):console['log'](a5_0x1acfce[_0x33a6a0(0x1ce)](_0x33a6a0(0x1db)+_0x530be9[_0x33a6a0(0x197)]+_0x33a6a0(0x1ad)+_0x1c6313)),0x1;}try{_0x2e3851=await _0x499546[_0x33a6a0(0x168)]['resolveAgentId'](_0x530be9[_0x33a6a0(0x190)],_0x359e79);}catch(_0xcb0d98){const _0x3c0192=_0xcb0d98 instanceof Error?_0xcb0d98[_0x33a6a0(0x1b8)]:String(_0xcb0d98);return _0x3c0192[_0x33a6a0(0x162)](_0x33a6a0(0x1b3))||_0x3c0192[_0x33a6a0(0x1c8)]()[_0x33a6a0(0x162)](_0x33a6a0(0x1a6))?console[_0x33a6a0(0x1cb)](a5_0x1acfce[_0x33a6a0(0x1ce)]('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x530be9['agentName'])):console[_0x33a6a0(0x1cb)](a5_0x1acfce[_0x33a6a0(0x1ce)](_0x33a6a0(0x1f1)+_0x530be9[_0x33a6a0(0x190)]+_0x33a6a0(0x1ad)+_0x3c0192)),0x1;}let _0x5107fd;if(!_0x16e749)try{_0x5107fd=await setupEvaluatorAgent(_0x499546['llm'],_0x5d8784[_0x33a6a0(0x175)]);}catch(_0x5ba344){const _0x1445bc=_0x5ba344 instanceof Error?_0x5ba344['message']:String(_0x5ba344);return console['log'](a5_0x1acfce[_0x33a6a0(0x1ce)](_0x33a6a0(0x18d)+_0x1445bc)),0x1;}console[_0x33a6a0(0x1cb)](a5_0x1acfce['cyan'](_0x33a6a0(0x1df))),console[_0x33a6a0(0x1cb)](_0x33a6a0(0x1de)+a5_0x1acfce['white'](_0x5d55ae)),console[_0x33a6a0(0x1cb)](_0x33a6a0(0x1d3)+a5_0x1acfce[_0x33a6a0(0x16a)](_0x530be9[_0x33a6a0(0x197)]+'/'+_0x530be9[_0x33a6a0(0x190)])),console['log']();const _0x4ef3dc=[],_0x48790a=[],_0x29331e=Date[_0x33a6a0(0x1d2)]();for(let _0x2130d2=0x0;_0x2130d2<_0x1b23e9['length'];_0x2130d2++){const _0x55922d=_0x1b23e9[_0x2130d2];_0x1b23e9[_0x33a6a0(0x1ef)]>0x1?console[_0x33a6a0(0x1cb)](_0x33a6a0(0x1dc)+(_0x2130d2+0x1)+'/'+_0x1b23e9['length']+':\x20'+a5_0x1acfce[_0x33a6a0(0x16a)](_0x55922d[_0x33a6a0(0x16b)])):console['log'](_0x33a6a0(0x1cc)+a5_0x1acfce[_0x33a6a0(0x16a)](_0x55922d[_0x33a6a0(0x16b)]));const _0x4bfd55=createCommandSpinner(_0x33a6a0(0x1ac)+_0x55922d[_0x33a6a0(0x1e5)][_0x33a6a0(0x1ef)]+':\x20Sending\x20user\x20input...');_0x4bfd55[_0x33a6a0(0x1ba)]();try{const {result:_0x54b1cc,conversation:_0x4f1e2e}=await runTest(_0x499546['llm'],_0x55922d,{'agentId':_0x2e3851,'projectId':_0x359e79,'site':_0x5d55ae,'noEval':_0x16e749,'evaluatorId':_0x5107fd,'onRoundStart':(_0x39d844,_0x27a9ba)=>{const _0x38d5e6=_0x33a6a0;_0x4bfd55['text']=_0x38d5e6(0x173)+(_0x39d844+0x1)+'/'+_0x27a9ba+_0x38d5e6(0x1be);},'onRoundComplete':(_0xa3496a,_0x381a87,_0x5f432e)=>{const _0x52f349=_0x33a6a0,_0x20a843=formatElapsed(_0x381a87);_0x5f432e?console[_0x52f349(0x1cb)]('\x20\x20Round\x20'+(_0xa3496a+0x1)+'/'+_0x55922d[_0x52f349(0x1e5)][_0x52f349(0x1ef)]+_0x52f349(0x1ec)+a5_0x1acfce['green']('✓')+'\x20('+_0x20a843+')'):console['log']('\x20\x20Round\x20'+(_0xa3496a+0x1)+'/'+_0x55922d['rounds'][_0x52f349(0x1ef)]+'...\x20'+a5_0x1acfce['red']('✗'));},'onEvaluationStart':()=>{const _0x3d52cd=_0x33a6a0;_0x4bfd55[_0x3d52cd(0x19c)]=_0x3d52cd(0x1bf);},'onEvaluationComplete':_0x4eee73=>{const _0x47aca2=_0x33a6a0,_0xe36a0b=formatElapsed(_0x4eee73);console[_0x47aca2(0x1cb)]('\x20\x20Evaluating...\x20'+a5_0x1acfce[_0x47aca2(0x1b1)]('✓')+'\x20('+_0xe36a0b+')');}});_0x4bfd55[_0x33a6a0(0x161)](),_0x4ef3dc[_0x33a6a0(0x172)](_0x54b1cc),_0x48790a[_0x33a6a0(0x172)](_0x4f1e2e);if(_0x54b1cc[_0x33a6a0(0x1c9)]===_0x33a6a0(0x19a))console[_0x33a6a0(0x1cb)](a5_0x1acfce['green'](_0x33a6a0(0x1d4)+_0x54b1cc[_0x33a6a0(0x158)]));else _0x54b1cc[_0x33a6a0(0x1c9)]===_0x33a6a0(0x19b)?console[_0x33a6a0(0x1cb)](a5_0x1acfce[_0x33a6a0(0x1ce)](_0x33a6a0(0x1f3)+_0x54b1cc[_0x33a6a0(0x158)])):console[_0x33a6a0(0x1cb)](a5_0x1acfce[_0x33a6a0(0x1ce)]('✗\x20ERROR:\x20'+_0x54b1cc[_0x33a6a0(0x158)]));_0x54b1cc[_0x33a6a0(0x191)]&&console[_0x33a6a0(0x1cb)](a5_0x1acfce['dim'](_0x33a6a0(0x1d0)+_0x54b1cc[_0x33a6a0(0x191)])),console[_0x33a6a0(0x1cb)]();}catch(_0x2f97b3){_0x4bfd55[_0x33a6a0(0x161)]();const _0x130fa6=_0x2f97b3 instanceof Error?_0x2f97b3['message']:String(_0x2f97b3);console[_0x33a6a0(0x1cb)](a5_0x1acfce[_0x33a6a0(0x1ce)]('✗\x20ERROR:\x20'+_0x130fa6)),console[_0x33a6a0(0x1cb)](),_0x4ef3dc['push']({'name':_0x55922d[_0x33a6a0(0x16b)],'status':_0x33a6a0(0x1e1),'reason':_0x130fa6,'timestamp':new Date()[_0x33a6a0(0x15a)](),'duration_ms':0x0});}}const _0x536cf1=Date['now']()-_0x29331e,_0x19b60e=_0x4ef3dc[_0x33a6a0(0x15c)](_0x36fe04=>_0x36fe04['status']==='PASS')[_0x33a6a0(0x1ef)],_0x9e8042=_0x4ef3dc['filter'](_0x2a29c8=>_0x2a29c8[_0x33a6a0(0x1c9)]===_0x33a6a0(0x19b))[_0x33a6a0(0x1ef)],_0x36d332=_0x4ef3dc[_0x33a6a0(0x15c)](_0x1272ef=>_0x1272ef['status']===_0x33a6a0(0x1e1))[_0x33a6a0(0x1ef)];console[_0x33a6a0(0x1cb)]('━'[_0x33a6a0(0x1b7)](0x3c)),console['log']('Test\x20Summary'),console['log']('━'[_0x33a6a0(0x1b7)](0x3c)),console[_0x33a6a0(0x1cb)](_0x33a6a0(0x16e)+_0x4ef3dc['length']),console['log'](_0x33a6a0(0x1e8)+a5_0x1acfce[_0x33a6a0(0x1b1)](_0x19b60e)),console['log']('Failed:\x20\x20\x20'+a5_0x1acfce['red'](_0x9e8042));_0x36d332>0x0&&console[_0x33a6a0(0x1cb)](_0x33a6a0(0x1d9)+a5_0x1acfce['red'](_0x36d332));console[_0x33a6a0(0x1cb)](_0x33a6a0(0x1a7)+formatElapsed(_0x536cf1)),console[_0x33a6a0(0x1cb)]('━'['repeat'](0x3c));const _0x460825=_0x4ef3dc[_0x33a6a0(0x15c)](_0xdfbef7=>_0xdfbef7['status']!=='PASS');if(_0x460825[_0x33a6a0(0x1ef)]>0x0){console[_0x33a6a0(0x1cb)](),console[_0x33a6a0(0x1cb)](_0x33a6a0(0x1af));for(const _0x1ef427 of _0x460825){const _0x21e911=a5_0x1acfce[_0x33a6a0(0x1ce)]('✗'),_0x430085=_0x1ef427[_0x33a6a0(0x158)][_0x33a6a0(0x1ef)]>0x32?_0x1ef427[_0x33a6a0(0x158)]['substring'](0x0,0x32)+_0x33a6a0(0x15f):_0x1ef427[_0x33a6a0(0x158)];console[_0x33a6a0(0x1cb)]('\x20\x20'+_0x21e911+'\x20'+_0x1ef427[_0x33a6a0(0x16b)]+':\x20'+_0x430085);}}const _0x4ba06d={'summary':{'total':_0x4ef3dc[_0x33a6a0(0x1ef)],'passed':_0x19b60e,'failed':_0x9e8042,'errors':_0x36d332>0x0?_0x36d332:undefined,'duration_ms':_0x536cf1},'tests':_0x4ef3dc,'agent':{'project':_0x530be9[_0x33a6a0(0x197)],'name':_0x530be9[_0x33a6a0(0x190)],'site':_0x5d55ae},'timestamp':new Date(_0x29331e)['toISOString']()};try{const _0x297cbf=buildCachedTestRun(_0x48790a,{'site':_0x5d55ae,'projectId':_0x359e79,'projectName':_0x530be9[_0x33a6a0(0x197)],'agentId':_0x2e3851,'agentName':_0x530be9[_0x33a6a0(0x190)],'testYmlPath':a5_0x328980[_0x33a6a0(0x1ab)](_0x530be9['testYmlPath'])});saveLastTestRun(_0x297cbf);}catch{}if(_0x519b32!=='table'||_0x122e7f){const _0x58e79e=formatResults(_0x4ba06d,_0x519b32);if(_0x122e7f)try{a5_0x4b70d2['writeFileSync'](_0x122e7f,_0x58e79e,_0x33a6a0(0x182)),console[_0x33a6a0(0x1cb)](),console[_0x33a6a0(0x1cb)](a5_0x1acfce[_0x33a6a0(0x1ee)]('Output\x20written\x20to:\x20'+_0x122e7f));}catch(_0x294336){return console[_0x33a6a0(0x1cb)](),console[_0x33a6a0(0x1cb)](a5_0x1acfce[_0x33a6a0(0x1ce)](_0x33a6a0(0x16c)+_0x294336)),0x1;}else console['log'](),console['log'](_0x58e79e);}return _0x460825[_0x33a6a0(0x1ef)]>0x0?0x1:0x0;}async[a5_0x3af3c2(0x17c)](_0x137edc,_0x5f1503){const _0x31dbf2=a5_0x3af3c2,{options:_0x57d96b,tdx:_0x582a7d}=_0x137edc,{definition:_0x37256f,agentInfo:_0x20614b,outputFormat:_0x385354,outputFile:_0x4d33a7}=_0x5f1503,_0x1c6e97=_0x57d96b['site'],_0x475728=loadLastTestRun();if(!_0x475728)return console[_0x31dbf2(0x1cb)](a5_0x1acfce[_0x31dbf2(0x1ce)](_0x31dbf2(0x195))),console[_0x31dbf2(0x1cb)](a5_0x1acfce[_0x31dbf2(0x1ee)](_0x31dbf2(0x196))),0x1;if(_0x475728[_0x31dbf2(0x163)][_0x31dbf2(0x190)]!==_0x20614b[_0x31dbf2(0x190)])return console[_0x31dbf2(0x1cb)](a5_0x1acfce['red'](_0x31dbf2(0x1a2)+_0x475728[_0x31dbf2(0x163)][_0x31dbf2(0x190)]+_0x31dbf2(0x1b9)+_0x20614b[_0x31dbf2(0x190)]+'\x22.')),console[_0x31dbf2(0x1cb)](a5_0x1acfce['dim']('Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.')),0x1;const _0x45dcc7=new Set(_0x475728[_0x31dbf2(0x159)][_0x31dbf2(0x1a1)](_0x118209=>_0x118209[_0x31dbf2(0x16f)])),_0x4520d3=_0x37256f[_0x31dbf2(0x156)][_0x31dbf2(0x15c)](_0x23927b=>!_0x45dcc7[_0x31dbf2(0x166)](_0x23927b['name']));if(_0x4520d3[_0x31dbf2(0x1ef)]>0x0&&_0x475728[_0x31dbf2(0x1bb)]!==_0x1c6e97)return console[_0x31dbf2(0x1cb)](a5_0x1acfce[_0x31dbf2(0x1ce)](_0x31dbf2(0x178))),console['log'](a5_0x1acfce[_0x31dbf2(0x1ee)](_0x31dbf2(0x18b)+_0x475728[_0x31dbf2(0x1bb)]+_0x31dbf2(0x1bd)+_0x1c6e97+'\x22.')),console[_0x31dbf2(0x1cb)](a5_0x1acfce['dim'](_0x31dbf2(0x1ca)+_0x475728['site']+_0x31dbf2(0x1e3))),0x1;const _0x2a5e03=_0x37256f[_0x31dbf2(0x156)][_0x31dbf2(0x15c)](_0x2c2920=>_0x45dcc7['has'](_0x2c2920[_0x31dbf2(0x16b)])),_0x81fd68=_0x4520d3;let _0x4dd153;try{_0x4dd153=await setupEvaluatorAgent(_0x582a7d['llm'],_0x57d96b['verbose']);}catch(_0x6bfd6b){const _0x4883ac=_0x6bfd6b instanceof Error?_0x6bfd6b['message']:String(_0x6bfd6b);return console[_0x31dbf2(0x1cb)](a5_0x1acfce['red'](_0x31dbf2(0x18d)+_0x4883ac)),0x1;}console[_0x31dbf2(0x1cb)](a5_0x1acfce[_0x31dbf2(0x1d6)](_0x31dbf2(0x1eb))),console[_0x31dbf2(0x1cb)](_0x31dbf2(0x179)+a5_0x1acfce[_0x31dbf2(0x16a)](_0x475728[_0x31dbf2(0x1c1)])),console[_0x31dbf2(0x1cb)](_0x31dbf2(0x1d3)+a5_0x1acfce[_0x31dbf2(0x16a)](_0x475728[_0x31dbf2(0x163)]['projectName']+'/'+_0x475728[_0x31dbf2(0x163)][_0x31dbf2(0x190)]));_0x81fd68[_0x31dbf2(0x1ef)]>0x0&&console[_0x31dbf2(0x1cb)](_0x31dbf2(0x165)+a5_0x1acfce['yellow'](_0x81fd68['length']));console[_0x31dbf2(0x1cb)]();const _0x2dd544=[],_0x4902a7=Date['now'](),_0x3d58ea=createCommandSpinner(_0x31dbf2(0x1b5));if(_0x2a5e03[_0x31dbf2(0x1ef)]>0x0)try{const _0x5534fd=await reevaluateFromCache(_0x582a7d[_0x31dbf2(0x168)],_0x475728,{'tests':_0x2a5e03},{'evaluatorId':_0x4dd153,'onTestStart':(_0x31128f,_0x1d35da,_0x28bb9c)=>{const _0xae30b1=_0x31dbf2;_0x3d58ea[_0xae30b1(0x19c)]=_0xae30b1(0x1f0)+(_0x1d35da+0x1)+'/'+_0x28bb9c+':\x20'+_0x31128f+'...';if(!_0x3d58ea['isSpinning'])_0x3d58ea[_0xae30b1(0x1ba)]();},'onTestComplete':(_0x5a4953,_0x303713)=>{const _0x1654da=_0x31dbf2;_0x3d58ea[_0x1654da(0x161)]();if(_0x303713[_0x1654da(0x1c9)]===_0x1654da(0x19a))console['log'](a5_0x1acfce[_0x1654da(0x1b1)]('✓\x20PASS:\x20'+_0x5a4953)+a5_0x1acfce[_0x1654da(0x1ee)](_0x1654da(0x1a3)));else _0x303713['status']===_0x1654da(0x19b)?console[_0x1654da(0x1cb)](a5_0x1acfce[_0x1654da(0x1ce)]('✗\x20FAIL:\x20'+_0x5a4953+_0x1654da(0x1e9)+_0x303713[_0x1654da(0x158)])+a5_0x1acfce['dim'](_0x1654da(0x1a3))):console[_0x1654da(0x1cb)](a5_0x1acfce[_0x1654da(0x1ce)](_0x1654da(0x198)+_0x5a4953+_0x1654da(0x1e9)+_0x303713['reason']));_0x303713[_0x1654da(0x191)]&&console['log'](a5_0x1acfce[_0x1654da(0x1ee)](_0x1654da(0x184)+_0x303713[_0x1654da(0x191)])),_0x2dd544[_0x1654da(0x172)](_0x303713);},'onTestSkipped':(_0x204dea,_0x804663)=>{const _0x58dfb5=_0x31dbf2;_0x3d58ea[_0x58dfb5(0x161)](),console[_0x58dfb5(0x1cb)](a5_0x1acfce['yellow'](_0x58dfb5(0x160)+_0x204dea+'\x20-\x20'+_0x804663));}});for(const _0x593480 of _0x5534fd){!_0x2dd544[_0x31dbf2(0x1c0)](_0x1a6295=>_0x1a6295['name']===_0x593480[_0x31dbf2(0x16b)])&&_0x2dd544[_0x31dbf2(0x172)](_0x593480);}}catch(_0x151e26){_0x3d58ea[_0x31dbf2(0x161)]();const _0x2019c9=_0x151e26 instanceof Error?_0x151e26[_0x31dbf2(0x1b8)]:String(_0x151e26);return console[_0x31dbf2(0x1cb)](a5_0x1acfce[_0x31dbf2(0x1ce)](_0x31dbf2(0x18a)+_0x2019c9)),0x1;}_0x3d58ea['stop']();if(_0x81fd68[_0x31dbf2(0x1ef)]>0x0){console[_0x31dbf2(0x1cb)](),console[_0x31dbf2(0x1cb)](a5_0x1acfce['cyan'](_0x31dbf2(0x1c2)));const {projectId:_0x5e9eb6,agentId:_0x66ed63}=_0x475728['agent'];for(const _0x45a70f of _0x81fd68){console[_0x31dbf2(0x1cb)]('Running:\x20'+a5_0x1acfce[_0x31dbf2(0x16a)](_0x45a70f[_0x31dbf2(0x16b)]));const _0x247a87=createCommandSpinner(_0x31dbf2(0x1ac)+_0x45a70f[_0x31dbf2(0x1e5)][_0x31dbf2(0x1ef)]+':\x20Sending\x20user\x20input...');_0x247a87[_0x31dbf2(0x1ba)]();try{const {result:_0x20be5d}=await runTest(_0x582a7d[_0x31dbf2(0x168)],_0x45a70f,{'agentId':_0x66ed63,'projectId':_0x5e9eb6,'site':_0x475728[_0x31dbf2(0x1bb)],'noEval':![],'evaluatorId':_0x4dd153,'onRoundStart':(_0x132d9b,_0x596f7d)=>{const _0x4a419e=_0x31dbf2;_0x247a87['text']=_0x4a419e(0x173)+(_0x132d9b+0x1)+'/'+_0x596f7d+_0x4a419e(0x1be);},'onRoundComplete':(_0x146683,_0x3f5c45,_0x3627f4)=>{const _0x45c39f=_0x31dbf2,_0x306a57=formatElapsed(_0x3f5c45);_0x3627f4?console['log']('\x20\x20Round\x20'+(_0x146683+0x1)+'/'+_0x45a70f[_0x45c39f(0x1e5)][_0x45c39f(0x1ef)]+'...\x20'+a5_0x1acfce['green']('✓')+'\x20('+_0x306a57+')'):console[_0x45c39f(0x1cb)](_0x45c39f(0x185)+(_0x146683+0x1)+'/'+_0x45a70f[_0x45c39f(0x1e5)]['length']+'...\x20'+a5_0x1acfce['red']('✗'));},'onEvaluationStart':()=>{const _0x194747=_0x31dbf2;_0x247a87['text']=_0x194747(0x1bf);},'onEvaluationComplete':_0x8e2415=>{const _0x425903=_0x31dbf2,_0x15ca74=formatElapsed(_0x8e2415);console['log'](_0x425903(0x1cf)+a5_0x1acfce['green']('✓')+'\x20('+_0x15ca74+')');}});_0x247a87[_0x31dbf2(0x161)](),_0x2dd544[_0x31dbf2(0x172)](_0x20be5d);if(_0x20be5d[_0x31dbf2(0x1c9)]===_0x31dbf2(0x19a))console['log'](a5_0x1acfce[_0x31dbf2(0x1b1)](_0x31dbf2(0x1d4)+_0x20be5d[_0x31dbf2(0x158)])+a5_0x1acfce[_0x31dbf2(0x1ee)]('\x20(new)'));else _0x20be5d[_0x31dbf2(0x1c9)]===_0x31dbf2(0x19b)?console[_0x31dbf2(0x1cb)](a5_0x1acfce[_0x31dbf2(0x1ce)](_0x31dbf2(0x1f3)+_0x20be5d['reason'])+a5_0x1acfce[_0x31dbf2(0x1ee)]('\x20(new)')):console[_0x31dbf2(0x1cb)](a5_0x1acfce[_0x31dbf2(0x1ce)](_0x31dbf2(0x198)+_0x20be5d['reason']));_0x20be5d[_0x31dbf2(0x191)]&&console[_0x31dbf2(0x1cb)](a5_0x1acfce[_0x31dbf2(0x1ee)]('\x20\x20Conversation:\x20'+_0x20be5d['conversation_url']));}catch(_0x511872){_0x247a87[_0x31dbf2(0x161)]();const _0x584165=_0x511872 instanceof Error?_0x511872[_0x31dbf2(0x1b8)]:String(_0x511872);console[_0x31dbf2(0x1cb)](a5_0x1acfce[_0x31dbf2(0x1ce)](_0x31dbf2(0x198)+_0x584165)),_0x2dd544['push']({'name':_0x45a70f['name'],'status':_0x31dbf2(0x1e1),'reason':_0x584165,'timestamp':new Date()[_0x31dbf2(0x15a)](),'duration_ms':0x0});}}}console[_0x31dbf2(0x1cb)]();const _0x1a4cef=Date['now']()-_0x4902a7,_0x541d61=_0x2dd544['filter'](_0x1705db=>_0x1705db['status']===_0x31dbf2(0x19a))[_0x31dbf2(0x1ef)],_0x30d147=_0x2dd544[_0x31dbf2(0x15c)](_0x2526f0=>_0x2526f0[_0x31dbf2(0x1c9)]===_0x31dbf2(0x19b))['length'],_0x204728=_0x2dd544[_0x31dbf2(0x15c)](_0x4f1423=>_0x4f1423[_0x31dbf2(0x1c9)]===_0x31dbf2(0x1e1))[_0x31dbf2(0x1ef)];console[_0x31dbf2(0x1cb)]('━'[_0x31dbf2(0x1b7)](0x3c)),console[_0x31dbf2(0x1cb)]('Re-evaluation\x20Summary'),console[_0x31dbf2(0x1cb)]('━'['repeat'](0x3c)),console['log']('Total:\x20\x20\x20\x20'+_0x2dd544[_0x31dbf2(0x1ef)]),console[_0x31dbf2(0x1cb)](_0x31dbf2(0x1e8)+a5_0x1acfce[_0x31dbf2(0x1b1)](_0x541d61)),console[_0x31dbf2(0x1cb)](_0x31dbf2(0x1b2)+a5_0x1acfce[_0x31dbf2(0x1ce)](_0x30d147));_0x204728>0x0&&console[_0x31dbf2(0x1cb)](_0x31dbf2(0x1d9)+a5_0x1acfce[_0x31dbf2(0x1ce)](_0x204728));console[_0x31dbf2(0x1cb)](_0x31dbf2(0x1a7)+formatElapsed(_0x1a4cef)),console[_0x31dbf2(0x1cb)]('━'[_0x31dbf2(0x1b7)](0x3c));const _0x3594d1={'summary':{'total':_0x2dd544[_0x31dbf2(0x1ef)],'passed':_0x541d61,'failed':_0x30d147,'errors':_0x204728>0x0?_0x204728:undefined,'duration_ms':_0x1a4cef},'tests':_0x2dd544,'agent':{'project':_0x20614b[_0x31dbf2(0x197)],'name':_0x20614b[_0x31dbf2(0x190)],'site':_0x1c6e97},'timestamp':new Date(_0x4902a7)[_0x31dbf2(0x15a)]()};if(_0x385354!==_0x31dbf2(0x1c4)||_0x4d33a7){const _0xab7c70=formatResults(_0x3594d1,_0x385354);if(_0x4d33a7)try{a5_0x4b70d2[_0x31dbf2(0x1e2)](_0x4d33a7,_0xab7c70,_0x31dbf2(0x182)),console[_0x31dbf2(0x1cb)](),console['log'](a5_0x1acfce[_0x31dbf2(0x1ee)](_0x31dbf2(0x1b0)+_0x4d33a7));}catch(_0x416cd2){return console[_0x31dbf2(0x1cb)](),console[_0x31dbf2(0x1cb)](a5_0x1acfce['red'](_0x31dbf2(0x16c)+_0x416cd2)),0x1;}else console[_0x31dbf2(0x1cb)](),console[_0x31dbf2(0x1cb)](_0xab7c70);}const _0x41f550=_0x2dd544[_0x31dbf2(0x15c)](_0x169533=>_0x169533[_0x31dbf2(0x1c9)]!==_0x31dbf2(0x19a));return _0x41f550[_0x31dbf2(0x1ef)]>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0x2268b5=a5_0x1048;(function(_0x1dd9a0,_0x274619){const _0x244d6f=a5_0x1048,_0x521ad1=_0x1dd9a0();while(!![]){try{const _0x3f3d19=-parseInt(_0x244d6f(0xf2))/0x1*(parseInt(_0x244d6f(0xfc))/0x2)+-parseInt(_0x244d6f(0x160))/0x3*(parseInt(_0x244d6f(0x12a))/0x4)+-parseInt(_0x244d6f(0x125))/0x5*(parseInt(_0x244d6f(0x120))/0x6)+-parseInt(_0x244d6f(0xf4))/0x7*(-parseInt(_0x244d6f(0x13f))/0x8)+parseInt(_0x244d6f(0x11d))/0x9+-parseInt(_0x244d6f(0x10b))/0xa*(parseInt(_0x244d6f(0xea))/0xb)+parseInt(_0x244d6f(0x106))/0xc*(parseInt(_0x244d6f(0x122))/0xd);if(_0x3f3d19===_0x274619)break;else _0x521ad1['push'](_0x521ad1['shift']());}catch(_0x21b9a3){_0x521ad1['push'](_0x521ad1['shift']());}}}(a5_0x1175,0x788af));function a5_0x1048(_0x2f0c5b,_0x212f3b){_0x2f0c5b=_0x2f0c5b-0xde;const _0x1175a2=a5_0x1175();let _0x104898=_0x1175a2[_0x2f0c5b];return _0x104898;}import*as a5_0x592087 from'node:fs';import*as a5_0x5a4176 from'node:path';function a5_0x1175(){const _0x3caaba=['Total:\x20\x20\x20\x20','output','yellow','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','...','name','Using\x20agent:\x20','Error\x20writing\x20output\x20file:\x20','message','found','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','join','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','llm','length','✗\x20FAIL:\x20','test.yml','white','\x20\x20Round\x20','testYmlPath','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','resolveProjectId','Available\x20tags:\x20','rounds','\x20\x20Conversation:\x20','Usage:','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','1261084kqGtPp','table','find','no_tests','Cached\x20run\x20is\x20from\x20site\x20\x22','conversations','toLowerCase','Conversation\x20URL:\x20','96371sVCDIg','verbose','7NBgaqB','No\x20tests\x20found\x20matching:\x20','dryRun','Cached\x20run\x20from:\x20','projectName','Test\x20','source','split','10mJPBGq','utf-8','round','FAIL','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','\x20\x20Project:\x20','context','toISOString','repeat','Site:\x20','241236XOmREf','trim','cyan','\x20\x20Evaluating...\x20','llmProject','20gULFpj','description','json','log','text','Executing\x20new\x20tests...','\x22,\x20but\x20current\x20site\x20is\x20\x22','404','\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','Evaluating\x20response...','stop','dim','\x20(cached)','Output\x20written\x20to:\x20','start','projectDir','Round\x201/','site','504729dMYtgA','\x20\x20-\x20','now','27942cibXUc','agentName','858tdRfYY','filter','green','515NLYGHj','eval','\x20-\x20','push','\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)','28XixTSv','No\x20tests\x20have\x20tags\x20defined.','agent:test','Test\x20Configuration:','Agent:\x20','not\x20found','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','red','Errors:\x20\x20\x20','Duration:\x20','Run\x20\x27tdx\x20agent\x20pull\x20',':\x20Sending\x20user\x20input...','some','agent','resolveAgentId','tests','testName','ERROR','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','Run\x20tests\x20for\x20an\x20LLM\x20agent','PASS','3322248pZIDad','executeReeval','/<agent-name>','⚠\x20SKIPPED:\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','agentDirs','includes','\x20(new)','\x20\x20Agent:\x20','tsv','reason','status','✓\x20PASS:\x20','Project\x20path:\x20','Available\x20tests:\x20','Re-evaluating\x20cached\x20test\x20run...','tags','\x20\x20Site:\x20','jsonl','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Running\x20agent\x20tests...','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','forEach','✗\x20ERROR:\x20Project\x20not\x20found:\x20','\x22:\x20','conversation_url','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Failed:\x20\x20\x20','Re-evaluating\x20','...\x20','isSpinning','writeFileSync','map','48687cIVOcy','has','✗\x20ERROR:\x20','Test\x20Summary','Tests\x20found:\x20','Round\x20','resolve'];a5_0x1175=function(){return _0x3caaba;};return a5_0x1175();}import a5_0x1bb067 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_0x2268b5(0x16c)]=a5_0x2268b5(0x12c);[a5_0x2268b5(0x10c)]=a5_0x2268b5(0x13d);async['execute'](_0x37f812){const _0x386090=a5_0x2268b5,{options:_0x3b6729,args:_0x466e67,tdx:_0x3deb5e}=_0x37f812,_0x33f9ed=_0x466e67[0x0]||'.',_0x3fef50=_0x3b6729[_0x386090(0xf6)],_0x2d6779=_0x3b6729,_0x523bc1=_0x2d6779[_0x386090(0x126)]===![],_0x4fc5ec=_0x2d6779['reeval'],_0x276d8e=_0x2d6779[_0x386090(0x16c)],_0x5f24e0=_0x2d6779[_0x386090(0x14f)],_0x3242d2=_0x3b6729[_0x386090(0x11c)],_0x4a1420=_0x2d6779[_0x386090(0x168)];if(_0x4fc5ec&&_0x523bc1)return console[_0x386090(0x10e)](a5_0x1bb067[_0x386090(0x131)](_0x386090(0x171))),0x1;let _0x224782='table';if(_0x2d6779['json'])_0x224782=_0x386090(0x10d);else{if(_0x2d6779[_0x386090(0x151)])_0x224782=_0x386090(0x151);else{if(_0x2d6779['tsv'])_0x224782=_0x386090(0x148);else{if(_0x2d6779[_0x386090(0xeb)])_0x224782='table';}}}const _0x3a0c1b=_0x2d6779[_0x386090(0x10a)];let _0x5af38e=_0x33f9ed;const _0x4df140=a5_0x592087['existsSync'](_0x33f9ed),_0x2da532=_0x33f9ed==='.';if(!_0x4df140||_0x2da532){const _0x1518a7=resolveProjectFromContext(_0x33f9ed,_0x3a0c1b,{'requireFile':_0x386090(0xdf)});if(_0x1518a7[_0x386090(0x170)])_0x5af38e=_0x1518a7[_0x386090(0x11a)],_0x1518a7[_0x386090(0xfa)]===_0x386090(0x102)&&console[_0x386090(0x10e)](a5_0x1bb067['dim'](_0x386090(0x16d)+_0x5af38e));else switch(_0x1518a7[_0x386090(0x149)]){case'no_context':console[_0x386090(0x10e)](a5_0x1bb067[_0x386090(0x169)](_0x1518a7[_0x386090(0x16f)])),console['log'](),console[_0x386090(0x10e)](_0x386090(0xe8)),console[_0x386090(0x10e)](_0x386090(0x113)),console[_0x386090(0x10e)](_0x386090(0x129)),console['log'](),console[_0x386090(0x10e)](_0x386090(0x152));return 0x1;case'no_local_folder':console[_0x386090(0x10e)](a5_0x1bb067[_0x386090(0x169)](_0x1518a7[_0x386090(0x16f)])),console['log'](),console[_0x386090(0x10e)](_0x386090(0x134)+_0x1518a7[_0x386090(0x10a)]+_0x386090(0x143));return 0x1;case'multiple_agents':{const _0x1a5965=a5_0x5a4176['basename'](_0x1518a7[_0x386090(0x11a)]);console['log'](a5_0x1bb067[_0x386090(0x169)]('Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22'+_0x1518a7[_0x386090(0x10a)]+'\x22:'));for(const _0x2317b9 of _0x1518a7[_0x386090(0x144)]){console['log'](_0x386090(0x11e)+_0x2317b9);}return console['log'](),console[_0x386090(0x10e)]('Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/'+_0x1a5965+_0x386090(0x141)),0x1;}case _0x386090(0xed):console[_0x386090(0x10e)](a5_0x1bb067[_0x386090(0x169)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x1518a7[_0x386090(0x10a)]+'\x22.')),console[_0x386090(0x10e)](a5_0x1bb067[_0x386090(0x116)](_0x386090(0x14c)+_0x1518a7['projectDir'])),console['log'](),console[_0x386090(0x10e)]('Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.');return 0x1;}}const {definition:_0xf1a4bd,agentInfo:_0x2d2330}=parseTestFile(_0x5af38e);let _0x4f257d=_0xf1a4bd[_0x386090(0x139)];if(_0x276d8e){const _0x2d0c60=_0x276d8e[_0x386090(0xfb)](',')[_0x386090(0x15f)](_0x144717=>_0x144717[_0x386090(0x107)]());_0x4f257d=_0xf1a4bd[_0x386090(0x139)]['filter'](_0x52c55b=>_0x2d0c60[_0x386090(0x145)](_0x52c55b[_0x386090(0x16c)]));if(_0x4f257d[_0x386090(0x175)]===0x0)return console[_0x386090(0x10e)](a5_0x1bb067['yellow'](_0x386090(0xf5)+_0x276d8e)),console['log'](a5_0x1bb067[_0x386090(0x116)](_0x386090(0x14d)+_0xf1a4bd['tests']['map'](_0x2bdd5d=>_0x2bdd5d['name'])[_0x386090(0x172)](',\x20'))),0x1;}if(_0x5f24e0){const _0x4b52e7=_0x5f24e0[_0x386090(0xfb)](',')[_0x386090(0x15f)](_0x369428=>_0x369428[_0x386090(0x107)]()['toLowerCase']());_0x4f257d=_0x4f257d[_0x386090(0x123)](_0x1ca061=>_0x1ca061[_0x386090(0x14f)]?.[_0x386090(0x136)](_0x48b0d3=>_0x4b52e7['includes'](_0x48b0d3[_0x386090(0xf0)]())));if(_0x4f257d[_0x386090(0x175)]===0x0){console[_0x386090(0x10e)](a5_0x1bb067[_0x386090(0x169)]('No\x20tests\x20found\x20with\x20tags:\x20'+_0x5f24e0));const _0x25b6f9=new Set();return _0xf1a4bd[_0x386090(0x139)][_0x386090(0x155)](_0x32958b=>_0x32958b['tags']?.[_0x386090(0x155)](_0x549fc5=>_0x25b6f9['add'](_0x549fc5))),_0x25b6f9['size']>0x0?console[_0x386090(0x10e)](a5_0x1bb067['dim'](_0x386090(0xe5)+[..._0x25b6f9][_0x386090(0x172)](',\x20'))):console[_0x386090(0x10e)](a5_0x1bb067[_0x386090(0x116)](_0x386090(0x12b))),0x1;}}if(_0x4fc5ec)return this[_0x386090(0x140)](_0x37f812,{'definition':{'tests':_0x4f257d},'agentInfo':_0x2d2330,'outputFormat':_0x224782,'outputFile':_0x4a1420,'testNames':_0x276d8e});if(_0x3fef50){console['log'](a5_0x1bb067[_0x386090(0x108)](_0x386090(0x12d))),console[_0x386090(0x10e)](_0x386090(0x150)+a5_0x1bb067[_0x386090(0xe0)](_0x3242d2)),console[_0x386090(0x10e)](_0x386090(0x101)+a5_0x1bb067[_0x386090(0xe0)](_0x2d2330[_0x386090(0xf8)])),console[_0x386090(0x10e)](_0x386090(0x147)+a5_0x1bb067[_0x386090(0xe0)](_0x2d2330['agentName'])),console[_0x386090(0x10e)](),console[_0x386090(0x10e)](_0x386090(0x164)+a5_0x1bb067[_0x386090(0xe0)](_0x4f257d['length']));for(let _0x32bd42=0x0;_0x32bd42<_0x4f257d['length'];_0x32bd42++){const _0x556a97=_0x4f257d[_0x32bd42],_0x48bc25=_0x556a97[_0x386090(0xe6)]['length']===0x1?_0x386090(0xfe):'rounds',_0x5a0a1a=_0x556a97[_0x386090(0x14f)]?.['length']?'\x20['+_0x556a97[_0x386090(0x14f)][_0x386090(0x172)](',\x20')+']':'';console[_0x386090(0x10e)]('\x20\x20'+(_0x32bd42+0x1)+'.\x20'+a5_0x1bb067[_0x386090(0xe0)](_0x556a97[_0x386090(0x16c)])+'\x20('+_0x556a97[_0x386090(0xe6)][_0x386090(0x175)]+'\x20'+_0x48bc25+')'+a5_0x1bb067[_0x386090(0x116)](_0x5a0a1a));}return 0x0;}let _0x5b4c45,_0x4a9b2e;try{_0x5b4c45=await _0x3deb5e['llm'][_0x386090(0xe4)](_0x2d2330[_0x386090(0xf8)]);}catch(_0x54c66f){const _0x499e52=_0x54c66f instanceof Error?_0x54c66f[_0x386090(0x16f)]:String(_0x54c66f);return _0x499e52[_0x386090(0x145)](_0x386090(0x112))||_0x499e52[_0x386090(0xf0)]()[_0x386090(0x145)](_0x386090(0x12f))?console['log'](a5_0x1bb067[_0x386090(0x131)](_0x386090(0x156)+_0x2d2330[_0x386090(0xf8)])):console[_0x386090(0x10e)](a5_0x1bb067[_0x386090(0x131)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0x2d2330[_0x386090(0xf8)]+_0x386090(0x157)+_0x499e52)),0x1;}try{_0x4a9b2e=await _0x3deb5e[_0x386090(0x174)][_0x386090(0x138)](_0x2d2330['agentName'],_0x5b4c45);}catch(_0x3246d0){const _0x1b1184=_0x3246d0 instanceof Error?_0x3246d0[_0x386090(0x16f)]:String(_0x3246d0);return _0x1b1184[_0x386090(0x145)](_0x386090(0x112))||_0x1b1184[_0x386090(0xf0)]()[_0x386090(0x145)](_0x386090(0x12f))?console[_0x386090(0x10e)](a5_0x1bb067[_0x386090(0x131)](_0x386090(0x100)+_0x2d2330['agentName'])):console['log'](a5_0x1bb067[_0x386090(0x131)](_0x386090(0xe3)+_0x2d2330[_0x386090(0x121)]+_0x386090(0x157)+_0x1b1184)),0x1;}let _0x4aa9f1;if(!_0x523bc1)try{_0x4aa9f1=await setupEvaluatorAgent(_0x3deb5e[_0x386090(0x174)],_0x3b6729[_0x386090(0xf3)]);}catch(_0x3e1a35){const _0x3d6a17=_0x3e1a35 instanceof Error?_0x3e1a35[_0x386090(0x16f)]:String(_0x3e1a35);return console[_0x386090(0x10e)](a5_0x1bb067['red'](_0x386090(0x130)+_0x3d6a17)),0x1;}console[_0x386090(0x10e)](a5_0x1bb067['cyan'](_0x386090(0x153))),console['log'](_0x386090(0x105)+a5_0x1bb067[_0x386090(0xe0)](_0x3242d2)),console[_0x386090(0x10e)](_0x386090(0x12e)+a5_0x1bb067[_0x386090(0xe0)](_0x2d2330[_0x386090(0xf8)]+'/'+_0x2d2330[_0x386090(0x121)])),console[_0x386090(0x10e)]();const _0x3484f7=[],_0x21c365=[],_0x217809=Date['now']();for(let _0x4ae37a=0x0;_0x4ae37a<_0x4f257d[_0x386090(0x175)];_0x4ae37a++){const _0x423373=_0x4f257d[_0x4ae37a];_0x4f257d[_0x386090(0x175)]>0x1?console[_0x386090(0x10e)](_0x386090(0xf9)+(_0x4ae37a+0x1)+'/'+_0x4f257d[_0x386090(0x175)]+':\x20'+a5_0x1bb067[_0x386090(0xe0)](_0x423373[_0x386090(0x16c)])):console[_0x386090(0x10e)]('Running\x20test:\x20'+a5_0x1bb067[_0x386090(0xe0)](_0x423373[_0x386090(0x16c)]));const _0x1c8c9a=createCommandSpinner(_0x386090(0x11b)+_0x423373[_0x386090(0xe6)][_0x386090(0x175)]+':\x20Sending\x20user\x20input...');_0x1c8c9a[_0x386090(0x119)]();try{const {result:_0x17f4e7,conversation:_0x39de77}=await runTest(_0x3deb5e['llm'],_0x423373,{'agentId':_0x4a9b2e,'projectId':_0x5b4c45,'site':_0x3242d2,'noEval':_0x523bc1,'evaluatorId':_0x4aa9f1,'onRoundStart':(_0x50cd44,_0x529105)=>{const _0x1241ae=_0x386090;_0x1c8c9a[_0x1241ae(0x10f)]=_0x1241ae(0x165)+(_0x50cd44+0x1)+'/'+_0x529105+_0x1241ae(0x135);},'onRoundComplete':(_0x12bcab,_0x420d3f,_0x45b334)=>{const _0x3f37a0=_0x386090,_0x1e92fe=formatElapsed(_0x420d3f);_0x45b334?console['log'](_0x3f37a0(0xe1)+(_0x12bcab+0x1)+'/'+_0x423373[_0x3f37a0(0xe6)][_0x3f37a0(0x175)]+_0x3f37a0(0x15c)+a5_0x1bb067[_0x3f37a0(0x124)]('✓')+'\x20('+_0x1e92fe+')'):console['log'](_0x3f37a0(0xe1)+(_0x12bcab+0x1)+'/'+_0x423373[_0x3f37a0(0xe6)][_0x3f37a0(0x175)]+_0x3f37a0(0x15c)+a5_0x1bb067[_0x3f37a0(0x131)]('✗'));},'onEvaluationStart':()=>{const _0x21e20e=_0x386090;_0x1c8c9a[_0x21e20e(0x10f)]=_0x21e20e(0x114);},'onEvaluationComplete':_0x25e3ba=>{const _0x48b40f=_0x386090,_0x2dbfda=formatElapsed(_0x25e3ba);console['log'](_0x48b40f(0x109)+a5_0x1bb067['green']('✓')+'\x20('+_0x2dbfda+')');}});_0x1c8c9a[_0x386090(0x115)](),_0x3484f7[_0x386090(0x128)](_0x17f4e7),_0x21c365[_0x386090(0x128)](_0x39de77);if(_0x17f4e7[_0x386090(0x14a)]===_0x386090(0x13e))console[_0x386090(0x10e)](a5_0x1bb067[_0x386090(0x124)](_0x386090(0x14b)+_0x17f4e7['reason']));else _0x17f4e7[_0x386090(0x14a)]===_0x386090(0xff)?console[_0x386090(0x10e)](a5_0x1bb067[_0x386090(0x131)]('✗\x20FAIL:\x20'+_0x17f4e7[_0x386090(0x149)])):console[_0x386090(0x10e)](a5_0x1bb067['red'](_0x386090(0x162)+_0x17f4e7[_0x386090(0x149)]));_0x17f4e7[_0x386090(0x158)]&&console[_0x386090(0x10e)](a5_0x1bb067[_0x386090(0x116)](_0x386090(0xf1)+_0x17f4e7[_0x386090(0x158)])),console[_0x386090(0x10e)]();}catch(_0x14c964){_0x1c8c9a[_0x386090(0x115)]();const _0x552b04=_0x14c964 instanceof Error?_0x14c964[_0x386090(0x16f)]:String(_0x14c964);console['log'](a5_0x1bb067['red'](_0x386090(0x162)+_0x552b04)),console['log'](),_0x3484f7[_0x386090(0x128)]({'name':_0x423373[_0x386090(0x16c)],'status':_0x386090(0x13b),'reason':_0x552b04,'timestamp':new Date()[_0x386090(0x103)](),'duration_ms':0x0});}}const _0xd1e994=Date['now']()-_0x217809,_0xb7cf57=_0x3484f7[_0x386090(0x123)](_0x113e40=>_0x113e40['status']==='PASS')[_0x386090(0x175)],_0x5bf9f7=_0x3484f7[_0x386090(0x123)](_0x52b7e8=>_0x52b7e8[_0x386090(0x14a)]==='FAIL')['length'],_0x5b72ff=_0x3484f7[_0x386090(0x123)](_0x3779ed=>_0x3779ed[_0x386090(0x14a)]===_0x386090(0x13b))['length'];console['log']('━'[_0x386090(0x104)](0x3c)),console['log'](_0x386090(0x163)),console['log']('━'[_0x386090(0x104)](0x3c)),console[_0x386090(0x10e)](_0x386090(0x167)+_0x3484f7[_0x386090(0x175)]),console[_0x386090(0x10e)]('Passed:\x20\x20\x20'+a5_0x1bb067[_0x386090(0x124)](_0xb7cf57)),console['log'](_0x386090(0x15a)+a5_0x1bb067[_0x386090(0x131)](_0x5bf9f7));_0x5b72ff>0x0&&console[_0x386090(0x10e)](_0x386090(0x132)+a5_0x1bb067[_0x386090(0x131)](_0x5b72ff));console[_0x386090(0x10e)](_0x386090(0x133)+formatElapsed(_0xd1e994)),console[_0x386090(0x10e)]('━'['repeat'](0x3c));const _0xfa7cde=_0x3484f7[_0x386090(0x123)](_0x3c98e8=>_0x3c98e8[_0x386090(0x14a)]!==_0x386090(0x13e));if(_0xfa7cde[_0x386090(0x175)]>0x0){console[_0x386090(0x10e)](),console['log']('Failed\x20Tests:');for(const _0x4ebc37 of _0xfa7cde){const _0x286252=a5_0x1bb067['red']('✗'),_0xfe644e=_0x4ebc37[_0x386090(0x149)][_0x386090(0x175)]>0x32?_0x4ebc37[_0x386090(0x149)]['substring'](0x0,0x32)+'...':_0x4ebc37[_0x386090(0x149)];console[_0x386090(0x10e)]('\x20\x20'+_0x286252+'\x20'+_0x4ebc37[_0x386090(0x16c)]+':\x20'+_0xfe644e);}}const _0x2f9067={'summary':{'total':_0x3484f7[_0x386090(0x175)],'passed':_0xb7cf57,'failed':_0x5bf9f7,'errors':_0x5b72ff>0x0?_0x5b72ff:undefined,'duration_ms':_0xd1e994},'tests':_0x3484f7,'agent':{'project':_0x2d2330[_0x386090(0xf8)],'name':_0x2d2330['agentName'],'site':_0x3242d2},'timestamp':new Date(_0x217809)['toISOString']()};try{const _0x3caceb=buildCachedTestRun(_0x21c365,{'site':_0x3242d2,'projectId':_0x5b4c45,'projectName':_0x2d2330[_0x386090(0xf8)],'agentId':_0x4a9b2e,'agentName':_0x2d2330[_0x386090(0x121)],'testYmlPath':a5_0x5a4176[_0x386090(0x166)](_0x2d2330[_0x386090(0xe2)])});saveLastTestRun(_0x3caceb);}catch{}if(_0x224782!=='table'||_0x4a1420){const _0x5cbe5a=formatResults(_0x2f9067,_0x224782);if(_0x4a1420)try{a5_0x592087[_0x386090(0x15e)](_0x4a1420,_0x5cbe5a,_0x386090(0xfd)),console[_0x386090(0x10e)](),console[_0x386090(0x10e)](a5_0x1bb067[_0x386090(0x116)]('Output\x20written\x20to:\x20'+_0x4a1420));}catch(_0x1e74f7){return console[_0x386090(0x10e)](),console[_0x386090(0x10e)](a5_0x1bb067[_0x386090(0x131)](_0x386090(0x16e)+_0x1e74f7)),0x1;}else console[_0x386090(0x10e)](),console['log'](_0x5cbe5a);}return _0xfa7cde['length']>0x0?0x1:0x0;}async[a5_0x2268b5(0x140)](_0x39a227,_0x12020d){const _0x4cf91b=a5_0x2268b5,{options:_0x3d6f01,tdx:_0x4ea653}=_0x39a227,{definition:_0x33413c,agentInfo:_0x1d8ad5,outputFormat:_0x24efa9,outputFile:_0xb49d79}=_0x12020d,_0x3261f2=_0x3d6f01[_0x4cf91b(0x11c)],_0x1c3571=loadLastTestRun();if(!_0x1c3571)return console[_0x4cf91b(0x10e)](a5_0x1bb067[_0x4cf91b(0x131)]('Error:\x20No\x20previous\x20test\x20run\x20found.')),console['log'](a5_0x1bb067[_0x4cf91b(0x116)](_0x4cf91b(0x16a))),0x1;if(_0x1c3571[_0x4cf91b(0x137)]['agentName']!==_0x1d8ad5['agentName'])return console[_0x4cf91b(0x10e)](a5_0x1bb067[_0x4cf91b(0x131)]('Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22'+_0x1c3571[_0x4cf91b(0x137)][_0x4cf91b(0x121)]+_0x4cf91b(0x173)+_0x1d8ad5[_0x4cf91b(0x121)]+'\x22.')),console[_0x4cf91b(0x10e)](a5_0x1bb067[_0x4cf91b(0x116)](_0x4cf91b(0x13c))),0x1;const _0x4ba7=new Set(_0x1c3571[_0x4cf91b(0xef)][_0x4cf91b(0x15f)](_0x438fa4=>_0x438fa4[_0x4cf91b(0x13a)])),_0xda7523=_0x33413c['tests'][_0x4cf91b(0x123)](_0x391464=>!_0x4ba7[_0x4cf91b(0x161)](_0x391464['name']));if(_0xda7523[_0x4cf91b(0x175)]>0x0&&_0x1c3571[_0x4cf91b(0x11c)]!==_0x3261f2)return console[_0x4cf91b(0x10e)](a5_0x1bb067['red'](_0x4cf91b(0xe9))),console[_0x4cf91b(0x10e)](a5_0x1bb067[_0x4cf91b(0x116)](_0x4cf91b(0xee)+_0x1c3571[_0x4cf91b(0x11c)]+_0x4cf91b(0x111)+_0x3261f2+'\x22.')),console[_0x4cf91b(0x10e)](a5_0x1bb067[_0x4cf91b(0x116)]('Either\x20switch\x20to\x20the\x20\x22'+_0x1c3571['site']+_0x4cf91b(0x154))),0x1;const _0x55641a=_0x33413c[_0x4cf91b(0x139)]['filter'](_0x2f7e5d=>_0x4ba7[_0x4cf91b(0x161)](_0x2f7e5d[_0x4cf91b(0x16c)])),_0x392686=_0xda7523;let _0x5e55bd;try{_0x5e55bd=await setupEvaluatorAgent(_0x4ea653[_0x4cf91b(0x174)],_0x3d6f01[_0x4cf91b(0xf3)]);}catch(_0x1d1654){const _0x4f1e57=_0x1d1654 instanceof Error?_0x1d1654[_0x4cf91b(0x16f)]:String(_0x1d1654);return console['log'](a5_0x1bb067[_0x4cf91b(0x131)](_0x4cf91b(0x130)+_0x4f1e57)),0x1;}console['log'](a5_0x1bb067[_0x4cf91b(0x108)](_0x4cf91b(0x14e))),console['log'](_0x4cf91b(0xf7)+a5_0x1bb067[_0x4cf91b(0xe0)](_0x1c3571['timestamp'])),console[_0x4cf91b(0x10e)]('Agent:\x20'+a5_0x1bb067[_0x4cf91b(0xe0)](_0x1c3571[_0x4cf91b(0x137)][_0x4cf91b(0xf8)]+'/'+_0x1c3571[_0x4cf91b(0x137)][_0x4cf91b(0x121)]));_0x392686[_0x4cf91b(0x175)]>0x0&&console[_0x4cf91b(0x10e)]('New\x20tests\x20to\x20execute:\x20'+a5_0x1bb067[_0x4cf91b(0x169)](_0x392686[_0x4cf91b(0x175)]));console[_0x4cf91b(0x10e)]();const _0x20ebb1=[],_0x1d038b=Date[_0x4cf91b(0x11f)](),_0x510979=createCommandSpinner('Re-evaluating...');if(_0x55641a[_0x4cf91b(0x175)]>0x0)try{const _0x3353d9=await reevaluateFromCache(_0x4ea653[_0x4cf91b(0x174)],_0x1c3571,{'tests':_0x55641a},{'evaluatorId':_0x5e55bd,'onTestStart':(_0x3498ed,_0x13507a,_0xf2b605)=>{const _0x276c8c=_0x4cf91b;_0x510979[_0x276c8c(0x10f)]=_0x276c8c(0x15b)+(_0x13507a+0x1)+'/'+_0xf2b605+':\x20'+_0x3498ed+_0x276c8c(0x16b);if(!_0x510979[_0x276c8c(0x15d)])_0x510979['start']();},'onTestComplete':(_0x254472,_0x26c2e8)=>{const _0x5ac96d=_0x4cf91b;_0x510979[_0x5ac96d(0x115)]();if(_0x26c2e8[_0x5ac96d(0x14a)]==='PASS')console[_0x5ac96d(0x10e)](a5_0x1bb067[_0x5ac96d(0x124)](_0x5ac96d(0x14b)+_0x254472)+a5_0x1bb067['dim'](_0x5ac96d(0x117)));else _0x26c2e8[_0x5ac96d(0x14a)]===_0x5ac96d(0xff)?console[_0x5ac96d(0x10e)](a5_0x1bb067[_0x5ac96d(0x131)](_0x5ac96d(0xde)+_0x254472+'\x20-\x20'+_0x26c2e8[_0x5ac96d(0x149)])+a5_0x1bb067[_0x5ac96d(0x116)](_0x5ac96d(0x117))):console[_0x5ac96d(0x10e)](a5_0x1bb067[_0x5ac96d(0x131)]('✗\x20ERROR:\x20'+_0x254472+_0x5ac96d(0x127)+_0x26c2e8[_0x5ac96d(0x149)]));_0x26c2e8[_0x5ac96d(0x158)]&&console[_0x5ac96d(0x10e)](a5_0x1bb067[_0x5ac96d(0x116)](_0x5ac96d(0xe7)+_0x26c2e8[_0x5ac96d(0x158)])),_0x20ebb1['push'](_0x26c2e8);},'onTestSkipped':(_0x1c6745,_0x32d592)=>{const _0x50a822=_0x4cf91b;_0x510979[_0x50a822(0x115)](),console['log'](a5_0x1bb067[_0x50a822(0x169)](_0x50a822(0x142)+_0x1c6745+'\x20-\x20'+_0x32d592));}});for(const _0x50f4f5 of _0x3353d9){!_0x20ebb1[_0x4cf91b(0xec)](_0x358757=>_0x358757[_0x4cf91b(0x16c)]===_0x50f4f5[_0x4cf91b(0x16c)])&&_0x20ebb1['push'](_0x50f4f5);}}catch(_0x373cf8){_0x510979[_0x4cf91b(0x115)]();const _0x43428e=_0x373cf8 instanceof Error?_0x373cf8[_0x4cf91b(0x16f)]:String(_0x373cf8);return console[_0x4cf91b(0x10e)](a5_0x1bb067['red'](_0x4cf91b(0x159)+_0x43428e)),0x1;}_0x510979[_0x4cf91b(0x115)]();if(_0x392686[_0x4cf91b(0x175)]>0x0){console[_0x4cf91b(0x10e)](),console['log'](a5_0x1bb067[_0x4cf91b(0x108)](_0x4cf91b(0x110)));const {projectId:_0x26a6a6,agentId:_0x175e49}=_0x1c3571[_0x4cf91b(0x137)];for(const _0x176022 of _0x392686){console[_0x4cf91b(0x10e)]('Running:\x20'+a5_0x1bb067[_0x4cf91b(0xe0)](_0x176022[_0x4cf91b(0x16c)]));const _0x5cbb3f=createCommandSpinner(_0x4cf91b(0x11b)+_0x176022[_0x4cf91b(0xe6)][_0x4cf91b(0x175)]+_0x4cf91b(0x135));_0x5cbb3f[_0x4cf91b(0x119)]();try{const {result:_0x2dc0a0}=await runTest(_0x4ea653[_0x4cf91b(0x174)],_0x176022,{'agentId':_0x175e49,'projectId':_0x26a6a6,'site':_0x1c3571[_0x4cf91b(0x11c)],'noEval':![],'evaluatorId':_0x5e55bd,'onRoundStart':(_0x4ec3c2,_0x1f06eb)=>{const _0x197b2c=_0x4cf91b;_0x5cbb3f['text']=_0x197b2c(0x165)+(_0x4ec3c2+0x1)+'/'+_0x1f06eb+_0x197b2c(0x135);},'onRoundComplete':(_0x2f4956,_0x3505af,_0x217257)=>{const _0x5ef52b=_0x4cf91b,_0x579149=formatElapsed(_0x3505af);_0x217257?console[_0x5ef52b(0x10e)](_0x5ef52b(0xe1)+(_0x2f4956+0x1)+'/'+_0x176022[_0x5ef52b(0xe6)][_0x5ef52b(0x175)]+_0x5ef52b(0x15c)+a5_0x1bb067['green']('✓')+'\x20('+_0x579149+')'):console[_0x5ef52b(0x10e)](_0x5ef52b(0xe1)+(_0x2f4956+0x1)+'/'+_0x176022[_0x5ef52b(0xe6)][_0x5ef52b(0x175)]+'...\x20'+a5_0x1bb067[_0x5ef52b(0x131)]('✗'));},'onEvaluationStart':()=>{_0x5cbb3f['text']='Evaluating\x20response...';},'onEvaluationComplete':_0x40daaa=>{const _0x2b9f55=_0x4cf91b,_0x319857=formatElapsed(_0x40daaa);console['log'](_0x2b9f55(0x109)+a5_0x1bb067[_0x2b9f55(0x124)]('✓')+'\x20('+_0x319857+')');}});_0x5cbb3f[_0x4cf91b(0x115)](),_0x20ebb1[_0x4cf91b(0x128)](_0x2dc0a0);if(_0x2dc0a0['status']===_0x4cf91b(0x13e))console[_0x4cf91b(0x10e)](a5_0x1bb067[_0x4cf91b(0x124)]('✓\x20PASS:\x20'+_0x2dc0a0[_0x4cf91b(0x149)])+a5_0x1bb067['dim'](_0x4cf91b(0x146)));else _0x2dc0a0[_0x4cf91b(0x14a)]===_0x4cf91b(0xff)?console[_0x4cf91b(0x10e)](a5_0x1bb067[_0x4cf91b(0x131)](_0x4cf91b(0xde)+_0x2dc0a0[_0x4cf91b(0x149)])+a5_0x1bb067['dim']('\x20(new)')):console[_0x4cf91b(0x10e)](a5_0x1bb067[_0x4cf91b(0x131)]('✗\x20ERROR:\x20'+_0x2dc0a0[_0x4cf91b(0x149)]));_0x2dc0a0[_0x4cf91b(0x158)]&&console[_0x4cf91b(0x10e)](a5_0x1bb067[_0x4cf91b(0x116)](_0x4cf91b(0xe7)+_0x2dc0a0[_0x4cf91b(0x158)]));}catch(_0x52d606){_0x5cbb3f[_0x4cf91b(0x115)]();const _0x3d73d7=_0x52d606 instanceof Error?_0x52d606[_0x4cf91b(0x16f)]:String(_0x52d606);console[_0x4cf91b(0x10e)](a5_0x1bb067[_0x4cf91b(0x131)]('✗\x20ERROR:\x20'+_0x3d73d7)),_0x20ebb1[_0x4cf91b(0x128)]({'name':_0x176022[_0x4cf91b(0x16c)],'status':_0x4cf91b(0x13b),'reason':_0x3d73d7,'timestamp':new Date()[_0x4cf91b(0x103)](),'duration_ms':0x0});}}}console[_0x4cf91b(0x10e)]();const _0x23a8bc=Date[_0x4cf91b(0x11f)]()-_0x1d038b,_0x37d007=_0x20ebb1[_0x4cf91b(0x123)](_0x5c1549=>_0x5c1549[_0x4cf91b(0x14a)]===_0x4cf91b(0x13e))[_0x4cf91b(0x175)],_0x2870f0=_0x20ebb1[_0x4cf91b(0x123)](_0x35c8c3=>_0x35c8c3['status']===_0x4cf91b(0xff))[_0x4cf91b(0x175)],_0x42f0fb=_0x20ebb1['filter'](_0x338229=>_0x338229['status']===_0x4cf91b(0x13b))[_0x4cf91b(0x175)];console[_0x4cf91b(0x10e)]('━'[_0x4cf91b(0x104)](0x3c)),console[_0x4cf91b(0x10e)]('Re-evaluation\x20Summary'),console[_0x4cf91b(0x10e)]('━'[_0x4cf91b(0x104)](0x3c)),console[_0x4cf91b(0x10e)]('Total:\x20\x20\x20\x20'+_0x20ebb1[_0x4cf91b(0x175)]),console[_0x4cf91b(0x10e)]('Passed:\x20\x20\x20'+a5_0x1bb067[_0x4cf91b(0x124)](_0x37d007)),console['log'](_0x4cf91b(0x15a)+a5_0x1bb067['red'](_0x2870f0));_0x42f0fb>0x0&&console[_0x4cf91b(0x10e)](_0x4cf91b(0x132)+a5_0x1bb067[_0x4cf91b(0x131)](_0x42f0fb));console[_0x4cf91b(0x10e)](_0x4cf91b(0x133)+formatElapsed(_0x23a8bc)),console[_0x4cf91b(0x10e)]('━'['repeat'](0x3c));const _0x704ca2={'summary':{'total':_0x20ebb1[_0x4cf91b(0x175)],'passed':_0x37d007,'failed':_0x2870f0,'errors':_0x42f0fb>0x0?_0x42f0fb:undefined,'duration_ms':_0x23a8bc},'tests':_0x20ebb1,'agent':{'project':_0x1d8ad5['projectName'],'name':_0x1d8ad5[_0x4cf91b(0x121)],'site':_0x3261f2},'timestamp':new Date(_0x1d038b)['toISOString']()};if(_0x24efa9!==_0x4cf91b(0xeb)||_0xb49d79){const _0x539a0d=formatResults(_0x704ca2,_0x24efa9);if(_0xb49d79)try{a5_0x592087['writeFileSync'](_0xb49d79,_0x539a0d,_0x4cf91b(0xfd)),console['log'](),console['log'](a5_0x1bb067[_0x4cf91b(0x116)](_0x4cf91b(0x118)+_0xb49d79));}catch(_0x26578f){return console[_0x4cf91b(0x10e)](),console[_0x4cf91b(0x10e)](a5_0x1bb067[_0x4cf91b(0x131)](_0x4cf91b(0x16e)+_0x26578f)),0x1;}else console[_0x4cf91b(0x10e)](),console[_0x4cf91b(0x10e)](_0x539a0d);}const _0x5c7bdc=_0x20ebb1[_0x4cf91b(0x123)](_0x3c1f32=>_0x3c1f32[_0x4cf91b(0x14a)]!=='PASS');return _0x5c7bdc[_0x4cf91b(0x175)]>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x99efa1=a6_0x2cb9;(function(_0x352f89,_0x2ed2ea){const _0x4ff557=a6_0x2cb9,_0x429610=_0x352f89();while(!![]){try{const _0x259a06=-parseInt(_0x4ff557(0x208))/0x1*(-parseInt(_0x4ff557(0x1ee))/0x2)+parseInt(_0x4ff557(0x207))/0x3+parseInt(_0x4ff557(0x21e))/0x4+parseInt(_0x4ff557(0x1ec))/0x5*(parseInt(_0x4ff557(0x210))/0x6)+parseInt(_0x4ff557(0x1f3))/0x7*(-parseInt(_0x4ff557(0x217))/0x8)+-parseInt(_0x4ff557(0x1f9))/0x9+-parseInt(_0x4ff557(0x1f0))/0xa;if(_0x259a06===_0x2ed2ea)break;else _0x429610['push'](_0x429610['shift']());}catch(_0x59cf62){_0x429610['push'](_0x429610['shift']());}}}(a6_0x3e40,0x9502c));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';function a6_0x3e40(){const _0xc72c34=['substring','log','Invalid\x20API\x20type:\x20','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','cdp','7441524TdPNwQ','stack','Error:\x20','file','\x22.\x20','header','Results\x20saved\x20to\x20','validate','proxy-authorization','data','POST','method','includes','GET','1041324tfXXgh','19597GaclvW','llm-proxy','headers','verbose','\x0aStack\x20trace:\x0a','entries','output','noColor','835914httDHb','indexOf','toUpperCase','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','<\x20HTTP/1.1\x20','trino','Invalid\x20HTTP\x20method:\x20','2357720wSlSeH','Endpoint\x20must\x20start\x20with\x20/:\x20','x-trino-user','length','us01','type','isArray','4672576wtKpcS','message','cas','x-xsrf-token','keys','site','status','join','trim','error','40yrmLjO','set-cookie2','110xDzNBc','.\x20Valid\x20types:\x20','16810250dcxcAl','api','llm','14YGrrge'];a6_0x3e40=function(){return _0xc72c34;};return a6_0x3e40();}import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';function a6_0x2cb9(_0x565369,_0x1be2a7){_0x565369=_0x565369-0x1e5;const _0x3e40fe=a6_0x3e40();let _0x2cb90a=_0x3e40fe[_0x565369];return _0x2cb90a;}import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set(['authorization',a6_0x99efa1(0x201),'cookie','set-cookie',a6_0x99efa1(0x1ed),a6_0x99efa1(0x1e5),'x-auth-token',a6_0x99efa1(0x219)]);function isSensitiveHeader(_0x25b682){return SENSITIVE_HEADERS['has'](_0x25b682['toLowerCase']());}function parseHeader(_0x37c11a){const _0x4a4873=a6_0x99efa1,_0x372c18=_0x37c11a[_0x4a4873(0x211)](':');if(_0x372c18===-0x1)throw new Error('Invalid\x20header\x20format:\x20\x22'+_0x37c11a+_0x4a4873(0x1fd)+_0x4a4873(0x213));const _0x3d6fe7=_0x37c11a[_0x4a4873(0x1f4)](0x0,_0x372c18)[_0x4a4873(0x1ea)](),_0x446405=_0x37c11a[_0x4a4873(0x1f4)](_0x372c18+0x1)[_0x4a4873(0x1ea)]();if(!_0x3d6fe7)throw new Error('Header\x20key\x20cannot\x20be\x20empty:\x20\x22'+_0x37c11a+'\x22');return[_0x3d6fe7,_0x446405];}export class ApiCommand extends BaseCommand{['name']='api';['description']='Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs';[a6_0x99efa1(0x200)](_0x38d483){const _0x1cdb94=a6_0x99efa1,{args:_0x11042f,options:_0x47fb1c}=_0x38d483,_0x5dec0f=_0x47fb1c;if(_0x11042f[_0x1cdb94(0x21a)]===0x0)return'Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list';const _0x129548=_0x11042f[0x0];if(!_0x129548['startsWith']('/'))return _0x1cdb94(0x218)+_0x129548;const _0x3a1c02=_0x5dec0f[_0x1cdb94(0x202)],_0x433931=_0x5dec0f[_0x1cdb94(0x1fc)];if(_0x3a1c02&&_0x433931)return _0x1cdb94(0x1f7);const _0x41b58a=_0x5dec0f[_0x1cdb94(0x204)]||_0x1cdb94(0x206),_0x2e1b78=[_0x1cdb94(0x206),_0x1cdb94(0x203),'PUT','DELETE','PATCH'];if(!_0x2e1b78[_0x1cdb94(0x205)](_0x41b58a[_0x1cdb94(0x212)]()))return _0x1cdb94(0x216)+_0x41b58a+'.\x20Valid\x20methods:\x20'+_0x2e1b78['join'](',\x20');const _0x3930d8=_0x5dec0f[_0x1cdb94(0x21c)]||'td',_0x33ade0=['td',_0x1cdb94(0x1f8),'workflow',_0x1cdb94(0x215),_0x1cdb94(0x1f2),_0x1cdb94(0x209),_0x1cdb94(0x220)];if(!_0x33ade0[_0x1cdb94(0x205)](_0x3930d8))return _0x1cdb94(0x1f6)+_0x3930d8+_0x1cdb94(0x1ef)+_0x33ade0[_0x1cdb94(0x1e9)](',\x20');return undefined;}async['execute'](_0x3626de){const _0xf1ca17=a6_0x99efa1,{options:_0x4fa49f,args:_0x96dc3f,tdx:_0x73044d}=_0x3626de,_0x363e08=_0x4fa49f,_0x2854d1=_0x96dc3f[0x0],_0x15f09c=(_0x363e08['method']||'GET')['toUpperCase'](),_0x340e75=_0x363e08['data'],_0x55a837=_0x363e08[_0xf1ca17(0x1fc)],_0x501efa=_0x363e08[_0xf1ca17(0x1fe)],_0x169e24=_0x363e08['type']||'td';try{const _0x3f1780={};if(_0x501efa){const _0x4c694f=Array[_0xf1ca17(0x21d)](_0x501efa)?_0x501efa:[_0x501efa];for(const _0x4989a8 of _0x4c694f){const [_0x5ba4ae,_0x1820f6]=parseHeader(_0x4989a8);_0x3f1780[_0x5ba4ae]=_0x1820f6;}}let _0x246ce3;if(_0x340e75)_0x246ce3=_0x340e75;else{if(_0x55a837)try{_0x246ce3=RawAPI['readBodyFromFile'](_0x55a837);}catch(_0x29c0e7){return console[_0xf1ca17(0x1eb)](_0xf1ca17(0x1fb)+(_0x29c0e7 instanceof Error?_0x29c0e7[_0xf1ca17(0x21f)]:String(_0x29c0e7))),0x1;}}const _0x2f465f={'method':_0x15f09c,'apiType':_0x169e24,'includeHeaders':_0x4fa49f['verbose']};_0x246ce3&&(_0x2f465f['body']=_0x246ce3);Object[_0xf1ca17(0x1e6)](_0x3f1780)[_0xf1ca17(0x21a)]>0x0&&(_0x2f465f['headers']=_0x3f1780);if(_0x4fa49f[_0xf1ca17(0x20b)]){const _0x446825=resolveSite(_0x4fa49f[_0xf1ca17(0x1e7)]??_0xf1ca17(0x21b)),_0x5e1ea3=getEndpoint(_0x446825,_0x169e24),_0x687d9b=''+_0x5e1ea3+_0x2854d1;console[_0xf1ca17(0x1eb)]('>\x20'+_0x15f09c+'\x20'+_0x687d9b);const _0x28694d=getAuthHeaders(_0x446825),_0x3800de={..._0x28694d,..._0x3f1780};for(const [_0x140bec,_0x494318]of Object[_0xf1ca17(0x20d)](_0x3800de)){!isSensitiveHeader(_0x140bec)&&console[_0xf1ca17(0x1eb)]('>\x20'+_0x140bec+':\x20'+_0x494318);}_0x246ce3&&console[_0xf1ca17(0x1eb)]('>'),console['error']('');}const _0x19c6fd=await _0x73044d[_0xf1ca17(0x1f1)]['request'](_0x2854d1,_0x2f465f);if(_0x4fa49f[_0xf1ca17(0x20b)]&&_0x19c6fd['headers']){console[_0xf1ca17(0x1eb)](_0xf1ca17(0x214)+_0x19c6fd[_0xf1ca17(0x1e8)]);for(const [_0x216220,_0x567f68]of Object[_0xf1ca17(0x20d)](_0x19c6fd[_0xf1ca17(0x20a)])){!isSensitiveHeader(_0x216220)&&console['error']('<\x20'+_0x216220+':\x20'+_0x567f68);}console[_0xf1ca17(0x1eb)]('');}const _0x25473e=Boolean(_0x4fa49f['output']),_0x2c621a={'color':_0x4fa49f['color'],'noColor':_0x4fa49f[_0xf1ca17(0x20f)]||_0x25473e&&!_0x4fa49f['color']},_0x26bb4f=colorizeJSON(_0x19c6fd[_0xf1ca17(0x202)],_0x2c621a);return _0x4fa49f[_0xf1ca17(0x20e)]?(writeFileSync(_0x4fa49f[_0xf1ca17(0x20e)],_0x26bb4f),console['error'](_0xf1ca17(0x1ff)+_0x4fa49f[_0xf1ca17(0x20e)])):console[_0xf1ca17(0x1f5)](_0x26bb4f),0x0;}catch(_0x3abd71){return _0x3abd71 instanceof Error?(console[_0xf1ca17(0x1eb)]('Error:\x20'+_0x3abd71[_0xf1ca17(0x21f)]),_0x4fa49f[_0xf1ca17(0x20b)]&&_0x3abd71[_0xf1ca17(0x1fa)]&&console['error'](_0xf1ca17(0x20c)+_0x3abd71[_0xf1ca17(0x1fa)])):console[_0xf1ca17(0x1eb)](_0xf1ca17(0x1fb)+String(_0x3abd71)),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a8_0xc5945b=a8_0x3d6a;(function(_0xd631e0,_0x333e7e){const _0x54def5=a8_0x3d6a,_0x5d545c=_0xd631e0();while(!![]){try{const _0x1797de=-parseInt(_0x54def5(0x1b7))/0x1*(parseInt(_0x54def5(0x18b))/0x2)+-parseInt(_0x54def5(0x1ab))/0x3+parseInt(_0x54def5(0x1a8))/0x4+-parseInt(_0x54def5(0x194))/0x5+-parseInt(_0x54def5(0x198))/0x6+-parseInt(_0x54def5(0x1cc))/0x7+-parseInt(_0x54def5(0x178))/0x8*(-parseInt(_0x54def5(0x1b3))/0x9);if(_0x1797de===_0x333e7e)break;else _0x5d545c['push'](_0x5d545c['shift']());}catch(_0x6d924d){_0x5d545c['push'](_0x5d545c['shift']());}}}(a8_0x4e33,0x9e37b));import{BaseCommand,printAuthError}from'./command.js';function a8_0x3d6a(_0x537ff0,_0x5e1157){_0x537ff0=_0x537ff0-0x16e;const _0x4e3306=a8_0x4e33();let _0x3d6a3a=_0x4e3306[_0x537ff0];return _0x3d6a3a;}import{resolveOAuthAccessToken}from'../sdk/auth-token.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 a8_0x57b26a from'prompts';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';function a8_0x4e33(){const _0x1f540a=['oauth','method','\x27\x20registered','N/A','✓\x20Default\x20site\x20set\x20to\x20','access_token','getUserInfo','email','\x20\x20(','yellow','Remove\x20API\x20key\x20from\x20system\x20keychain','auth','29236SyCCAj','Opening\x20browser\x20for\x20authentication...','account_id','916353KmxjAr','API\x20key','password','message','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','Name:\x20','/oauth/authorize','filter','14138433wabXoP','API\x20key\x20cannot\x20be\x20empty','tdx\x20profile:\x20','status','1cMxzkC','ERROR','Print\x20the\x20current\x20OAuth\x20access\x20token','stdout','Show\x20authentication\x20status\x20and\x20validate\x20API\x20key','Use\x20an\x20API\x20key','cyan','warn','name','apikey','bold','\x20(site:\x20','\x20(profile:\x20','OAuth\x20tokens','Enter\x20your\x20TD\x20API\x20key:','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','create','Credential\x20type:\x20OAuth','\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','\x20\x20tdx','\x0aSetup\x20cancelled','2287208wKUvRJ','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','last_name','✓\x20Profile\x20\x27','No\x20credentials\x20found\x20in\x20keychain','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','✓\x20Authentication\x20successful\x0a','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','first_name','System\x20keychain\x20is\x20not\x20available','✓\x20Signed\x20in\x20successfully','/app/mp/ak','auth:token','\x20and\x20','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','join','green','jobs','execute','tdx:\x20auth\x20clear','Validating\x20API\x20key...','\x20for\x20profile:\x20','Read\x20credential\x20from\x20','16zlbbvU','us01','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','dim','Setting\x20up\x20authentication\x20for\x20site:\x20','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','No\x20credential\x20found','trim','Setup\x20cancelled','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','Choose\x20how\x20to\x20sign\x20in:','apiKey','Read\x20credential\x20from\x20keychain','Sign\x20in\x20with\x20browser\x20(recommended)','accountName','red','text','error','all','846094CurGWf','logLevel','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','site','log','\x20\x20user_id:','User:\x20','Validating\x20OAuth\x20tokens...','3868570EtNaoO','/users/initiate_sso\x20(account:\x20','description','✗\x20Validation\x20failed:\x20','4033008igWryr','select','profile','\x20--profile\x20'];a8_0x4e33=function(){return _0x1f540a;};return a8_0x4e33();}import a8_0x544b60 from'chalk';export async function runOAuthLoginFlow(_0x1262bb,_0x55fd41,_0x41c84d,_0x1c8a33){const _0x3a3737=a8_0x3d6a,_0x43c5e1=await isKeychainAvailable();if(!_0x43c5e1)throw new Error('System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20'+_0x3a3737(0x1d3));let _0x463436=_0x1c8a33?.['accountName'];if(!_0x463436){const _0x31fa63=await a8_0x57b26a({'type':_0x3a3737(0x188),'name':_0x3a3737(0x186),'message':_0x3a3737(0x1d1)});if(_0x31fa63[_0x3a3737(0x186)]===undefined)throw new Error('Setup\x20cancelled');_0x463436=_0x31fa63[_0x3a3737(0x186)]['trim']()||undefined;}const _0x22b07e=getConsoleUrl(_0x1262bb);console[_0x3a3737(0x190)](_0x3a3737(0x1a9));_0x463436?console[_0x3a3737(0x190)]('\x20\x20'+_0x22b07e+_0x3a3737(0x195)+_0x463436+')'):console[_0x3a3737(0x190)]('\x20\x20'+_0x22b07e+_0x3a3737(0x1b1));console['log'](_0x3a3737(0x16f));const _0x4e614c=loadGlobalProxy()||process.env.HTTPS_PROXY||process.env.HTTP_PROXY,_0x188903=await startOAuthFlow(_0x1262bb,{'accountName':_0x463436,'proxy':_0x4e614c});console['log'](_0x3a3737(0x193));const _0x42f2d4=TDX[_0x3a3737(0x1c7)]({'site':_0x1262bb,'accessToken':_0x188903[_0x3a3737(0x1a1)],'logLevel':_0x41c84d??LogLevel['ERROR']}),_0x417f0e=await _0x42f2d4[_0x3a3737(0x172)][_0x3a3737(0x1a2)]();console[_0x3a3737(0x190)](a8_0x544b60['green'](_0x3a3737(0x1d6))),console['log']('\x20\x20'+a8_0x544b60[_0x3a3737(0x1bd)](_0x1262bb+':'+_0x417f0e[_0x3a3737(0x1aa)])+_0x3a3737(0x191)+_0x417f0e['id']+_0x3a3737(0x1a4)+_0x417f0e[_0x3a3737(0x1a3)]+')');!_0x463436&&(console[_0x3a3737(0x190)](a8_0x544b60[_0x3a3737(0x17b)](_0x3a3737(0x1c9))),console[_0x3a3737(0x190)](a8_0x544b60['dim']('\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>')),console['log'](a8_0x544b60[_0x3a3737(0x17b)](_0x3a3737(0x1c6))));await saveOAuthTokens(_0x188903,_0x55fd41),console[_0x3a3737(0x190)](_0x3a3737(0x18e)+(_0x55fd41?'\x20(profile:\x20'+_0x55fd41+')':''));if(_0x55fd41){const _0x32632a={'site':_0x1262bb};saveProfileToUserConfig(_0x55fd41,_0x32632a),console['log'](_0x3a3737(0x1cf)+_0x55fd41+_0x3a3737(0x19e));}else saveDefaultSiteToUserConfig(_0x1262bb),console[_0x3a3737(0x190)](_0x3a3737(0x1a0)+_0x1262bb);const _0x2296ed=_0x55fd41?'\x20--profile\x20'+_0x55fd41:'';console[_0x3a3737(0x190)](),console[_0x3a3737(0x190)](_0x3a3737(0x17d)),console[_0x3a3737(0x190)](_0x3a3737(0x1ca)+_0x2296ed+_0x3a3737(0x1cd)),console[_0x3a3737(0x190)](_0x3a3737(0x1ca)+_0x2296ed+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases');}export async function promptAuthMethod(){const _0x5a14df=a8_0x3d6a,_0x401faf=await a8_0x57b26a({'type':_0x5a14df(0x199),'name':'method','message':_0x5a14df(0x182),'choices':[{'title':_0x5a14df(0x185),'description':'Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','value':'oauth'},{'title':_0x5a14df(0x1bc),'description':'For\x20scripts\x20or\x20headless\x20servers','value':_0x5a14df(0x1c0)}]});return _0x401faf[_0x5a14df(0x19d)]||null;}export class AuthSetupCommand extends BaseCommand{[a8_0xc5945b(0x1bf)]='auth:setup';[a8_0xc5945b(0x196)]='Setup\x20API\x20key\x20authentication\x20interactively';async[a8_0xc5945b(0x173)](_0x12eac7){const _0x149148=a8_0xc5945b,{options:_0x2abe20}=_0x12eac7,_0x35b1c6=_0x2abe20['profile'];console['log'](a8_0x544b60['bold']('tdx:\x20auth\x20setup'));const _0x2af7a7=_0x2abe20['site']||_0x149148(0x179),_0x9c33c2=await promptSiteSelection(_0x2af7a7,_0x35b1c6,_0x149148(0x180));if(!_0x9c33c2)return 0x1;const _0x3c6e6b=resolveSite(_0x9c33c2),_0x26b2a1=await promptAuthMethod();if(!_0x26b2a1)return console[_0x149148(0x190)](_0x149148(0x1cb)),0x1;if(_0x26b2a1===_0x149148(0x19c)){const {accountName:_0x245750}=_0x2abe20;return await runOAuthLoginFlow(_0x3c6e6b,_0x35b1c6,_0x2abe20[_0x149148(0x18c)]??LogLevel['ERROR'],{'accountName':_0x245750}),0x0;}console[_0x149148(0x190)](_0x149148(0x17c)+_0x3c6e6b),console[_0x149148(0x190)]('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0x149148(0x190)]('\x20\x20'+getConsoleUrl(_0x3c6e6b,_0x149148(0x1d7)));const _0xf48c7=await a8_0x57b26a({'type':_0x149148(0x1ad),'name':_0x149148(0x183),'message':_0x149148(0x1c5),'validate':_0x3c0eaa=>{const _0x41db9f=_0x149148;if(!_0x3c0eaa||!_0x3c0eaa[_0x41db9f(0x17f)]())return _0x41db9f(0x1b4);return!![];}});if(!_0xf48c7[_0x149148(0x183)])return console['log']('\x0aSetup\x20cancelled'),0x1;const _0xc6dc6b=_0xf48c7[_0x149148(0x183)];console[_0x149148(0x190)](_0x149148(0x175));try{const _0x5e23d2=TDX[_0x149148(0x1c7)]({'site':_0x3c6e6b,'apiKey':_0xc6dc6b[_0x149148(0x17f)](),'logLevel':_0x2abe20['logLevel']??LogLevel[_0x149148(0x1b8)]}),_0x252dbd=await _0x5e23d2[_0x149148(0x172)]['getUserInfo']();console['log'](_0x149148(0x181)+_0x252dbd[_0x149148(0x1a3)]+')');const _0x27380d=await isKeychainAvailable();_0x27380d?(await saveAPIKeyAsync(_0xc6dc6b[_0x149148(0x17f)](),_0x3c6e6b,_0x35b1c6),console['log'](_0x149148(0x18d)+(_0x35b1c6?_0x149148(0x1c3)+_0x35b1c6+')':''))):(console['warn'](a8_0x544b60[_0x149148(0x1a5)](_0x149148(0x17a))),console[_0x149148(0x1be)](a8_0x544b60['yellow']('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));if(_0x35b1c6){const _0x1276b5={'site':_0x3c6e6b};saveProfileToUserConfig(_0x35b1c6,_0x1276b5),console[_0x149148(0x190)](_0x149148(0x1cf)+_0x35b1c6+_0x149148(0x19e));}else saveDefaultSiteToUserConfig(_0x3c6e6b),console[_0x149148(0x190)](_0x149148(0x1a0)+_0x3c6e6b);const _0x5ae055=_0x35b1c6?_0x149148(0x19b)+_0x35b1c6:'';return console[_0x149148(0x190)](),console['log'](_0x149148(0x17d)),console[_0x149148(0x190)](_0x149148(0x1ca)+_0x5ae055+_0x149148(0x1cd)),console['log'](_0x149148(0x1ca)+_0x5ae055+_0x149148(0x1af)),0x0;}catch(_0x81dfec){if(_0x81dfec instanceof HTTPClientError&&_0x81dfec[_0x149148(0x1b6)]===0x191)return printAuthError(_0x81dfec),0x1;return console[_0x149148(0x189)](a8_0x544b60[_0x149148(0x187)]('✗\x20Validation\x20failed:\x20'+(_0x81dfec instanceof Error?_0x81dfec['message']:String(_0x81dfec)))),console['error']('API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.'),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a8_0xc5945b(0x1bf)]=a8_0xc5945b(0x1a7);[a8_0xc5945b(0x196)]=a8_0xc5945b(0x1bb);async[a8_0xc5945b(0x173)](_0x3aa27b){const _0x5cc4c3=a8_0xc5945b,{options:_0x4a973f,tdx:_0x3ff2b8}=_0x3aa27b,_0x34a713=_0x4a973f['site'],_0x525681=_0x4a973f[_0x5cc4c3(0x19a)],_0x377d91=_0x525681?_0x525681:_0x5cc4c3(0x19f);console[_0x5cc4c3(0x190)](_0x5cc4c3(0x1b5)+_0x377d91+_0x5cc4c3(0x1c2)+_0x34a713+')');const _0x48e563=await getOAuthTokens(_0x525681);if(_0x48e563)console[_0x5cc4c3(0x190)](_0x5cc4c3(0x1c8)),console[_0x5cc4c3(0x190)](_0x5cc4c3(0x184)+(_0x525681?_0x5cc4c3(0x1c3)+_0x525681+')':''));else{const _0x3224e7=await resolveAPIKeyAsync(_0x34a713,_0x525681);if(_0x3224e7){const {source:_0x3a836f,isDeprecated:_0x1a83cd}=_0x3224e7,_0x577124=_0x5cc4c3(0x177)+_0x3a836f;console[_0x5cc4c3(0x190)](_0x1a83cd?a8_0x544b60[_0x5cc4c3(0x1a5)](_0x577124):_0x577124);}else console[_0x5cc4c3(0x190)](a8_0x544b60[_0x5cc4c3(0x1a5)](_0x5cc4c3(0x17e)));}try{const _0x285701=await _0x3ff2b8[_0x5cc4c3(0x172)]['getUserInfo']();return console[_0x5cc4c3(0x190)](a8_0x544b60[_0x5cc4c3(0x171)](_0x5cc4c3(0x1d2))),console[_0x5cc4c3(0x190)](_0x5cc4c3(0x192)+_0x285701[_0x5cc4c3(0x1a3)]),(_0x285701[_0x5cc4c3(0x1d4)]||_0x285701[_0x5cc4c3(0x1ce)])&&console[_0x5cc4c3(0x190)](_0x5cc4c3(0x1b0)+[_0x285701[_0x5cc4c3(0x1d4)],_0x285701[_0x5cc4c3(0x1ce)]][_0x5cc4c3(0x1b2)](Boolean)[_0x5cc4c3(0x170)]('\x20')),0x0;}catch(_0x2c7123){return _0x2c7123 instanceof HTTPClientError&&_0x2c7123[_0x5cc4c3(0x1b6)]===0x191?printAuthError(_0x2c7123,!![],_0x525681):console[_0x5cc4c3(0x189)](a8_0x544b60[_0x5cc4c3(0x187)](_0x5cc4c3(0x197)+(_0x2c7123 instanceof Error?_0x2c7123[_0x5cc4c3(0x1ae)]:String(_0x2c7123)))),0x1;}}}export class AuthTokenCommand extends BaseCommand{['name']=a8_0xc5945b(0x1d8);[a8_0xc5945b(0x196)]=a8_0xc5945b(0x1b9);async['execute'](_0x424049){const _0xf69e27=a8_0xc5945b,{options:_0x4fd504}=_0x424049,_0x3f6516=await resolveOAuthAccessToken({'site':resolveSite(_0x4fd504[_0xf69e27(0x18f)]||_0xf69e27(0x179)),'profile':_0x4fd504[_0xf69e27(0x19a)],'proxy':loadGlobalProxy()});return process[_0xf69e27(0x1ba)]['write'](_0x3f6516+'\x0a'),0x0;}}export class AuthClearCommand extends BaseCommand{[a8_0xc5945b(0x1bf)]='auth:clear';[a8_0xc5945b(0x196)]=a8_0xc5945b(0x1a6);async[a8_0xc5945b(0x173)](_0x1505db){const _0x1d6dc1=a8_0xc5945b,{options:_0x2ac843}=_0x1505db,_0x5f57d5=_0x2ac843[_0x1d6dc1(0x19a)];console[_0x1d6dc1(0x190)](a8_0x544b60[_0x1d6dc1(0x1c1)](_0x1d6dc1(0x174)));const _0x42b182=await isKeychainAvailable();if(!_0x42b182)return console[_0x1d6dc1(0x189)](a8_0x544b60[_0x1d6dc1(0x187)](_0x1d6dc1(0x1d5))),0x1;const [_0x2134b4,_0x3db5ef]=await Promise[_0x1d6dc1(0x18a)]([deleteKeychainAPIKey(_0x5f57d5),deleteOAuthTokens(_0x5f57d5)]);if(_0x2134b4||_0x3db5ef){clearCredentialCache();const _0x1dcb48=[_0x2134b4&&_0x1d6dc1(0x1ac),_0x3db5ef&&_0x1d6dc1(0x1c4)][_0x1d6dc1(0x1b2)](Boolean)[_0x1d6dc1(0x170)](_0x1d6dc1(0x16e));return console[_0x1d6dc1(0x190)]('✓\x20'+_0x1dcb48+'\x20removed\x20from\x20keychain'+(_0x5f57d5?_0x1d6dc1(0x1c3)+_0x5f57d5+')':'')),0x0;}else return console[_0x1d6dc1(0x190)](_0x1d6dc1(0x1d0)+(_0x5f57d5?_0x1d6dc1(0x176)+_0x5f57d5:'')),0x1;}}
|
|
1
|
+
const a7_0x5821b3=a7_0x53bd;(function(_0x33fb89,_0x978e15){const _0xe75ee2=a7_0x53bd,_0x497cc1=_0x33fb89();while(!![]){try{const _0x1e7889=parseInt(_0xe75ee2(0x10c))/0x1*(-parseInt(_0xe75ee2(0x122))/0x2)+parseInt(_0xe75ee2(0x109))/0x3*(-parseInt(_0xe75ee2(0xc7))/0x4)+-parseInt(_0xe75ee2(0x10f))/0x5*(parseInt(_0xe75ee2(0xbe))/0x6)+-parseInt(_0xe75ee2(0xe8))/0x7*(-parseInt(_0xe75ee2(0x11b))/0x8)+-parseInt(_0xe75ee2(0x124))/0x9+parseInt(_0xe75ee2(0x112))/0xa*(parseInt(_0xe75ee2(0xd2))/0xb)+parseInt(_0xe75ee2(0xc4))/0xc*(parseInt(_0xe75ee2(0xf9))/0xd);if(_0x1e7889===_0x978e15)break;else _0x497cc1['push'](_0x497cc1['shift']());}catch(_0x506f4e){_0x497cc1['push'](_0x497cc1['shift']());}}}(a7_0x1c39,0x1ddf8));import{BaseCommand,printAuthError}from'./command.js';import{resolveOAuthAccessToken}from'../sdk/auth-token.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_0x53bd(_0xb91b59,_0x55cfda){_0xb91b59=_0xb91b59-0xbb;const _0x1c3950=a7_0x1c39();let _0x53bd45=_0x1c3950[_0xb91b59];return _0x53bd45;}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_0x4a33e2 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_0x1ac085 from'chalk';function a7_0x1c39(){const _0x32d0af=['dim','auth:setup','Validating\x20OAuth\x20tokens...','\x27\x20registered','User:\x20','1236llgvJd','join','Setup\x20cancelled','52ceibZQ','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','all','No\x20credential\x20found','getUserInfo','first_name','System\x20keychain\x20is\x20not\x20available','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','auth:token','2582217whhXnd','✓\x20Authentication\x20successful\x0a','last_name','/oauth/authorize','filter','\x20\x20(','error','\x0aSetup\x20cancelled','green','select','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','/app/mp/ak','apiKey','Choose\x20how\x20to\x20sign\x20in:','\x20\x20tdx','N/A','message','Opening\x20browser\x20for\x20authentication...','\x20(profile:\x20','status','jobs','428239OGHpJo','yellow','No\x20credentials\x20found\x20in\x20keychain','profile','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','execute','method','✓\x20Default\x20site\x20set\x20to\x20','access_token','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','bold','log','trim','tdx:\x20auth\x20clear','oauth','warn','\x20removed\x20from\x20keychain','42016AQubMh','Setup\x20API\x20key\x20authentication\x20interactively','auth','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','write','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','✗\x20Validation\x20failed:\x20','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','Enter\x20your\x20TD\x20API\x20key:','accountName','logLevel','/users/initiate_sso\x20(account:\x20','description','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','password','Validating\x20API\x20key...','44550MZHhPe','tdx:\x20auth\x20setup','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','1DIbyYY','Name:\x20','tdx\x20profile:\x20','8340gNUmbb','\x20and\x20','API\x20key\x20cannot\x20be\x20empty','10MvWgnQ','API\x20key','Remove\x20API\x20key\x20from\x20system\x20keychain','text','account_id','red','\x20\x20user_id:','For\x20scripts\x20or\x20headless\x20servers','Read\x20credential\x20from\x20','16qbuMBQ','name','Print\x20the\x20current\x20OAuth\x20access\x20token','Read\x20credential\x20from\x20keychain','site','\x20--profile\x20','create','121650cxeGjH','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','1457766WwiitQ','\x20for\x20profile:\x20','OAuth\x20tokens','✓\x20Signed\x20in\x20successfully','email','ERROR','546rgLFBM'];a7_0x1c39=function(){return _0x32d0af;};return a7_0x1c39();}export async function runOAuthLoginFlow(_0x2ac4b3,_0x3d2020,_0x3e2bfc,_0x44b4ae){const _0x5b1e49=a7_0x53bd,_0x21aea6=await isKeychainAvailable();if(!_0x21aea6)throw new Error(_0x5b1e49(0xcf)+_0x5b1e49(0xdc));let _0x481795=_0x44b4ae?.[_0x5b1e49(0x102)];if(!_0x481795){const _0x23949b=await a7_0x4a33e2({'type':_0x5b1e49(0x115),'name':'accountName','message':_0x5b1e49(0x100)});if(_0x23949b[_0x5b1e49(0x102)]===undefined)throw new Error(_0x5b1e49(0xc6));_0x481795=_0x23949b[_0x5b1e49(0x102)]['trim']()||undefined;}const _0x4ebf15=getConsoleUrl(_0x2ac4b3);console[_0x5b1e49(0xf3)](_0x5b1e49(0xe4));_0x481795?console['log']('\x20\x20'+_0x4ebf15+_0x5b1e49(0x104)+_0x481795+')'):console[_0x5b1e49(0xf3)]('\x20\x20'+_0x4ebf15+_0x5b1e49(0xd5));console[_0x5b1e49(0xf3)](_0x5b1e49(0xc8));const _0x1437a9=loadGlobalProxy()||process.env.HTTPS_PROXY||process.env.HTTP_PROXY,_0x579ac1=await startOAuthFlow(_0x2ac4b3,{'accountName':_0x481795,'proxy':_0x1437a9});console[_0x5b1e49(0xf3)](_0x5b1e49(0xc1));const _0x180242=TDX[_0x5b1e49(0x121)]({'site':_0x2ac4b3,'accessToken':_0x579ac1[_0x5b1e49(0xf0)],'logLevel':_0x3e2bfc??LogLevel[_0x5b1e49(0xbd)]}),_0x20d831=await _0x180242[_0x5b1e49(0xe7)][_0x5b1e49(0xcc)]();console['log'](a7_0x1ac085[_0x5b1e49(0xda)](_0x5b1e49(0xbb))),console[_0x5b1e49(0xf3)]('\x20\x20'+a7_0x1ac085['cyan'](_0x2ac4b3+':'+_0x20d831[_0x5b1e49(0x116)])+_0x5b1e49(0x118)+_0x20d831['id']+_0x5b1e49(0xd7)+_0x20d831[_0x5b1e49(0xbc)]+')');!_0x481795&&(console[_0x5b1e49(0xf3)](a7_0x1ac085['dim']('\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:')),console['log'](a7_0x1ac085[_0x5b1e49(0xbf)](_0x5b1e49(0xfe))),console['log'](a7_0x1ac085[_0x5b1e49(0xbf)](_0x5b1e49(0xd0))));await saveOAuthTokens(_0x579ac1,_0x3d2020),console[_0x5b1e49(0xf3)]('✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain'+(_0x3d2020?'\x20(profile:\x20'+_0x3d2020+')':''));if(_0x3d2020){const _0x11d39f={'site':_0x2ac4b3};saveProfileToUserConfig(_0x3d2020,_0x11d39f),console[_0x5b1e49(0xf3)]('✓\x20Profile\x20\x27'+_0x3d2020+_0x5b1e49(0xc2));}else saveDefaultSiteToUserConfig(_0x2ac4b3),console[_0x5b1e49(0xf3)]('✓\x20Default\x20site\x20set\x20to\x20'+_0x2ac4b3);const _0x31ab98=_0x3d2020?_0x5b1e49(0x120)+_0x3d2020:'';console[_0x5b1e49(0xf3)](),console[_0x5b1e49(0xf3)]('You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:'),console[_0x5b1e49(0xf3)](_0x5b1e49(0xe1)+_0x31ab98+_0x5b1e49(0xfc)),console[_0x5b1e49(0xf3)](_0x5b1e49(0xe1)+_0x31ab98+_0x5b1e49(0xf1));}export async function promptAuthMethod(){const _0x33a768=a7_0x53bd,_0x4e74ba=await a7_0x4a33e2({'type':_0x33a768(0xdb),'name':_0x33a768(0xee),'message':_0x33a768(0xe0),'choices':[{'title':'Sign\x20in\x20with\x20browser\x20(recommended)','description':_0x33a768(0xec),'value':_0x33a768(0xf6)},{'title':'Use\x20an\x20API\x20key','description':_0x33a768(0x119),'value':'apikey'}]});return _0x4e74ba[_0x33a768(0xee)]||null;}export class AuthSetupCommand extends BaseCommand{['name']=a7_0x5821b3(0xc0);[a7_0x5821b3(0x105)]=a7_0x5821b3(0xfa);async[a7_0x5821b3(0xed)](_0xc12f7e){const _0x463731=a7_0x5821b3,{options:_0xadb544}=_0xc12f7e,_0x89d5c6=_0xadb544[_0x463731(0xeb)];console[_0x463731(0xf3)](a7_0x1ac085[_0x463731(0xf2)](_0x463731(0x10a)));const _0x401690=_0xadb544[_0x463731(0x11f)]||'us01',_0x2272e4=await promptSiteSelection(_0x401690,_0x89d5c6,_0x463731(0xc6));if(!_0x2272e4)return 0x1;const _0x317a04=resolveSite(_0x2272e4),_0x150518=await promptAuthMethod();if(!_0x150518)return console[_0x463731(0xf3)](_0x463731(0xd9)),0x1;if(_0x150518===_0x463731(0xf6)){const {accountName:_0x5b6586}=_0xadb544;return await runOAuthLoginFlow(_0x317a04,_0x89d5c6,_0xadb544[_0x463731(0x103)]??LogLevel[_0x463731(0xbd)],{'accountName':_0x5b6586}),0x0;}console['log']('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x317a04),console[_0x463731(0xf3)]('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0x463731(0xf3)]('\x20\x20'+getConsoleUrl(_0x317a04,_0x463731(0xde)));const _0x91b9d8=await a7_0x4a33e2({'type':_0x463731(0x107),'name':_0x463731(0xdf),'message':_0x463731(0x101),'validate':_0x102c15=>{const _0x4cc97d=_0x463731;if(!_0x102c15||!_0x102c15[_0x4cc97d(0xf4)]())return _0x4cc97d(0x111);return!![];}});if(!_0x91b9d8[_0x463731(0xdf)])return console[_0x463731(0xf3)]('\x0aSetup\x20cancelled'),0x1;const _0x198a77=_0x91b9d8[_0x463731(0xdf)];console[_0x463731(0xf3)](_0x463731(0x108));try{const _0x2325d2=TDX[_0x463731(0x121)]({'site':_0x317a04,'apiKey':_0x198a77['trim'](),'logLevel':_0xadb544[_0x463731(0x103)]??LogLevel['ERROR']}),_0xb16044=await _0x2325d2[_0x463731(0xe7)][_0x463731(0xcc)]();console[_0x463731(0xf3)](_0x463731(0xc9)+_0xb16044[_0x463731(0xbc)]+')');const _0x11e735=await isKeychainAvailable();_0x11e735?(await saveAPIKeyAsync(_0x198a77[_0x463731(0xf4)](),_0x317a04,_0x89d5c6),console[_0x463731(0xf3)]('✓\x20API\x20key\x20saved\x20to\x20system\x20keychain'+(_0x89d5c6?_0x463731(0xe5)+_0x89d5c6+')':''))):(console[_0x463731(0xf7)](a7_0x1ac085[_0x463731(0xe9)](_0x463731(0xdd))),console['warn'](a7_0x1ac085[_0x463731(0xe9)](_0x463731(0x106))));if(_0x89d5c6){const _0x212528={'site':_0x317a04};saveProfileToUserConfig(_0x89d5c6,_0x212528),console[_0x463731(0xf3)]('✓\x20Profile\x20\x27'+_0x89d5c6+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x317a04),console['log'](_0x463731(0xef)+_0x317a04);const _0x14f14f=_0x89d5c6?_0x463731(0x120)+_0x89d5c6:'';return console['log'](),console[_0x463731(0xf3)](_0x463731(0x10b)),console[_0x463731(0xf3)](_0x463731(0xe1)+_0x14f14f+_0x463731(0xfc)),console['log'](_0x463731(0xe1)+_0x14f14f+_0x463731(0xf1)),0x0;}catch(_0x2d9c8b){if(_0x2d9c8b instanceof HTTPClientError&&_0x2d9c8b[_0x463731(0xe6)]===0x191)return printAuthError(_0x2d9c8b),0x1;return console['error'](a7_0x1ac085['red'](_0x463731(0xff)+(_0x2d9c8b instanceof Error?_0x2d9c8b[_0x463731(0xe3)]:String(_0x2d9c8b)))),console[_0x463731(0xd8)](_0x463731(0x123)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x5821b3(0x11c)]=a7_0x5821b3(0xfb);[a7_0x5821b3(0x105)]='Show\x20authentication\x20status\x20and\x20validate\x20API\x20key';async[a7_0x5821b3(0xed)](_0xa79d8a){const _0x1bdd34=a7_0x5821b3,{options:_0x4fa949,tdx:_0x5d7ba2}=_0xa79d8a,_0x1aeb76=_0x4fa949[_0x1bdd34(0x11f)],_0x2da35e=_0x4fa949[_0x1bdd34(0xeb)],_0x28338d=_0x2da35e?_0x2da35e:_0x1bdd34(0xe2);console[_0x1bdd34(0xf3)](_0x1bdd34(0x10e)+_0x28338d+'\x20(site:\x20'+_0x1aeb76+')');const _0x5c2233=await getOAuthTokens(_0x2da35e);if(_0x5c2233)console[_0x1bdd34(0xf3)]('Credential\x20type:\x20OAuth'),console[_0x1bdd34(0xf3)](_0x1bdd34(0x11e)+(_0x2da35e?_0x1bdd34(0xe5)+_0x2da35e+')':''));else{const _0x3890ff=await resolveAPIKeyAsync(_0x1aeb76,_0x2da35e);if(_0x3890ff){const {source:_0x52f0c3,isDeprecated:_0xfc3fa6}=_0x3890ff,_0x819dc4=_0x1bdd34(0x11a)+_0x52f0c3;console['log'](_0xfc3fa6?a7_0x1ac085['yellow'](_0x819dc4):_0x819dc4);}else console[_0x1bdd34(0xf3)](a7_0x1ac085[_0x1bdd34(0xe9)](_0x1bdd34(0xcb)));}try{const _0x1f5d2d=await _0x5d7ba2[_0x1bdd34(0xe7)][_0x1bdd34(0xcc)]();return console['log'](a7_0x1ac085[_0x1bdd34(0xda)](_0x1bdd34(0xd3))),console[_0x1bdd34(0xf3)](_0x1bdd34(0xc3)+_0x1f5d2d[_0x1bdd34(0xbc)]),(_0x1f5d2d[_0x1bdd34(0xcd)]||_0x1f5d2d[_0x1bdd34(0xd4)])&&console[_0x1bdd34(0xf3)](_0x1bdd34(0x10d)+[_0x1f5d2d[_0x1bdd34(0xcd)],_0x1f5d2d[_0x1bdd34(0xd4)]][_0x1bdd34(0xd6)](Boolean)[_0x1bdd34(0xc5)]('\x20')),0x0;}catch(_0x21e8be){return _0x21e8be instanceof HTTPClientError&&_0x21e8be[_0x1bdd34(0xe6)]===0x191?printAuthError(_0x21e8be,!![],_0x2da35e):console[_0x1bdd34(0xd8)](a7_0x1ac085[_0x1bdd34(0x117)](_0x1bdd34(0xff)+(_0x21e8be instanceof Error?_0x21e8be['message']:String(_0x21e8be)))),0x1;}}}export class AuthTokenCommand extends BaseCommand{[a7_0x5821b3(0x11c)]=a7_0x5821b3(0xd1);['description']=a7_0x5821b3(0x11d);async['execute'](_0x525024){const _0x3e7f6c=a7_0x5821b3,{options:_0x3d56a4}=_0x525024,_0x3cb80f=await resolveOAuthAccessToken({'site':resolveSite(_0x3d56a4['site']||'us01'),'profile':_0x3d56a4[_0x3e7f6c(0xeb)],'proxy':loadGlobalProxy()});return process['stdout'][_0x3e7f6c(0xfd)](_0x3cb80f+'\x0a'),0x0;}}export class AuthClearCommand extends BaseCommand{['name']='auth:clear';[a7_0x5821b3(0x105)]=a7_0x5821b3(0x114);async[a7_0x5821b3(0xed)](_0x34d603){const _0x14dbd8=a7_0x5821b3,{options:_0x2bca76}=_0x34d603,_0x1a5a83=_0x2bca76['profile'];console['log'](a7_0x1ac085[_0x14dbd8(0xf2)](_0x14dbd8(0xf5)));const _0x16f3aa=await isKeychainAvailable();if(!_0x16f3aa)return console[_0x14dbd8(0xd8)](a7_0x1ac085[_0x14dbd8(0x117)](_0x14dbd8(0xce))),0x1;const [_0x50b175,_0x3bf1e2]=await Promise[_0x14dbd8(0xca)]([deleteKeychainAPIKey(_0x1a5a83),deleteOAuthTokens(_0x1a5a83)]);if(_0x50b175||_0x3bf1e2){clearCredentialCache();const _0x2c4dbb=[_0x50b175&&_0x14dbd8(0x113),_0x3bf1e2&&_0x14dbd8(0x126)]['filter'](Boolean)[_0x14dbd8(0xc5)](_0x14dbd8(0x110));return console[_0x14dbd8(0xf3)]('✓\x20'+_0x2c4dbb+_0x14dbd8(0xf8)+(_0x1a5a83?_0x14dbd8(0xe5)+_0x1a5a83+')':'')),0x0;}else return console['log'](_0x14dbd8(0xea)+(_0x1a5a83?_0x14dbd8(0x125)+_0x1a5a83:'')),0x1;}}
|