@treasuredata/tdx 2026.4.55 → 2026.5.0
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/README.md +6 -6
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts +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.d.ts +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.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.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.d.ts +85 -0
- package/dist/commands/engage-command.d.ts.map +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-command.js.map +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.d.ts +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.d.ts +2 -1
- package/dist/commands/journey-command.d.ts.map +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-command.js.map +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.d.ts +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.d.ts +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.d.ts +3 -3
- package/dist/commands/segment-push-command.d.ts.map +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-push-command.js.map +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.d.ts +31 -0
- package/dist/commands/table-deleted.d.ts.map +1 -0
- package/dist/commands/table-deleted.js +1 -0
- package/dist/commands/table-deleted.js.map +1 -0
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.d.ts +6 -5
- package/dist/commands/workflow-command.d.ts.map +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/commands/workflow-command.js.map +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/constants.js.map +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/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.d.ts +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.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.d.ts +17 -0
- package/dist/proxy/passthrough-server.d.ts.map +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/passthrough-server.js.map +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.d.ts +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.d.ts.map +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/cdp-api-client.js.map +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.d.ts +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.d.ts +75 -1
- package/dist/sdk/client/engage-api-client.d.ts.map +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/engage-api-client.js.map +1 -1
- package/dist/sdk/client/http-client.d.ts +1 -1
- package/dist/sdk/client/http-client.d.ts.map +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/http-client.js.map +1 -1
- package/dist/sdk/client/llm-api-client.d.ts +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.d.ts +23 -2
- package/dist/sdk/client/td-api-client.d.ts.map +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/td-api-client.js.map +1 -1
- package/dist/sdk/client/trino-api-client.d.ts +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js.map +1 -1
- package/dist/sdk/client/workflow-client.d.ts +9 -2
- package/dist/sdk/client/workflow-client.d.ts.map +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/client/workflow-client.js.map +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-validator.js.map +1 -1
- package/dist/sdk/engage/campaign-yaml.d.ts +1 -1
- package/dist/sdk/engage/campaign-yaml.d.ts.map +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js.map +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.d.ts +2 -2
- package/dist/sdk/engage/types/campaign-def.d.ts.map +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js.map +1 -1
- package/dist/sdk/engage/types/campaign-schema.d.ts +256 -8
- package/dist/sdk/engage/types/campaign-schema.d.ts.map +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js.map +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.d.ts +62 -1
- package/dist/sdk/engage.d.ts.map +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/engage.js.map +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.d.ts +3 -3
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.d.ts +6 -0
- package/dist/sdk/journey.d.ts.map +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/journey.js.map +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.d.ts.map +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/index.js.map +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.d.ts +33 -9
- package/dist/sdk/llm/model-factors.d.ts.map +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/llm/model-factors.js.map +1 -1
- package/dist/sdk/llm/user-settings.d.ts +3 -0
- package/dist/sdk/llm/user-settings.d.ts.map +1 -0
- package/dist/sdk/llm/user-settings.js +1 -0
- package/dist/sdk/llm/user-settings.js.map +1 -0
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/deleted-table-validation.d.ts +19 -0
- package/dist/sdk/query/deleted-table-validation.d.ts.map +1 -0
- package/dist/sdk/query/deleted-table-validation.js +1 -0
- package/dist/sdk/query/deleted-table-validation.js.map +1 -0
- package/dist/sdk/query/index.d.ts +43 -0
- package/dist/sdk/query/index.d.ts.map +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/index.js.map +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.d.ts.map +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/file-discovery.js.map +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/journey-yaml.js.map +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.d.ts +2 -2
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.d.ts +1 -1
- package/dist/sdk/segment/push-workflow.d.ts.map +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js.map +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/segment-validator.js.map +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.d.ts +4 -2
- package/dist/sdk/segment/types/segment-schema.d.ts.map +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js.map +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.d.ts +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/cdp.d.ts +7 -3
- package/dist/sdk/types/cdp.d.ts.map +1 -1
- package/dist/sdk/types/connection.d.ts +1 -1
- package/dist/sdk/types/database.d.ts +28 -0
- package/dist/sdk/types/database.d.ts.map +1 -1
- package/dist/sdk/types/engage.d.ts +178 -1
- package/dist/sdk/types/engage.d.ts.map +1 -1
- package/dist/sdk/types/index.d.ts +2 -2
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/index.js.map +1 -1
- package/dist/sdk/types/llm.d.ts +7 -3
- package/dist/sdk/types/llm.d.ts.map +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.d.ts +7 -0
- package/dist/sdk/types/workspace.d.ts.map +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/types/workspace.js.map +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.d.ts +16 -3
- package/dist/sdk/workflow/index.d.ts.map +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/index.js.map +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.d.ts +65 -0
- package/dist/sdk/workflow/task-graph.d.ts.map +1 -0
- package/dist/sdk/workflow/task-graph.js +1 -0
- package/dist/sdk/workflow/task-graph.js.map +1 -0
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.d.ts +7 -0
- package/dist/sdk/workspace/access-tracker.d.ts.map +1 -0
- package/dist/sdk/workspace/access-tracker.js +1 -0
- package/dist/sdk/workspace/access-tracker.js.map +1 -0
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.d.ts +53 -1
- package/dist/sdk/workspace/git.d.ts.map +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/git.js.map +1 -1
- package/dist/sdk/workspace/index.d.ts +25 -1
- package/dist/sdk/workspace/index.d.ts.map +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/index.js.map +1 -1
- package/dist/sdk/workspace/templates.d.ts.map +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/templates.js.map +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.d.ts +2 -0
- package/dist/sdk/workspace/wikilinks.d.ts.map +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/sdk/workspace/wikilinks.js.map +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.d.ts +3 -0
- package/dist/utils/process.d.ts.map +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/process.js.map +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.d.ts +10 -2
- package/dist/utils/version-check.d.ts.map +1 -1
- package/dist/utils/version-check.js +1 -1
- package/dist/utils/version-check.js.map +1 -1
- package/package.json +61 -22
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a3_0x2b42cf=a3_0xb6fa;(function(_0x2e44e7,_0x5c7f29){const _0x26d694=a3_0xb6fa,_0xee17cb=_0x2e44e7();while(!![]){try{const _0x2662f8=parseInt(_0x26d694(0xcd))/0x1+-parseInt(_0x26d694(0xd3))/0x2*(-parseInt(_0x26d694(0xbe))/0x3)+-parseInt(_0x26d694(0xca))/0x4+-parseInt(_0x26d694(0xba))/0x5*(parseInt(_0x26d694(0xc2))/0x6)+-parseInt(_0x26d694(0xc0))/0x7+parseInt(_0x26d694(0xb6))/0x8*(-parseInt(_0x26d694(0xcb))/0x9)+parseInt(_0x26d694(0xcc))/0xa;if(_0x2662f8===_0x5c7f29)break;else _0xee17cb['push'](_0xee17cb['shift']());}catch(_0x4de00b){_0xee17cb['push'](_0xee17cb['shift']());}}}(a3_0x2b61,0xc4a2d));import{BaseCommand}from'./command.js';function a3_0x2b61(){const _0x2c96d5=['\x20activation','cause','data','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','message','segment','site','2639872sZdqmC','27tDElfd','18172840kozyXN','798017mLaRsm','Resolved\x20child\x20ID:\x20','verbose','listActivations','Resolving\x20parent\x20segment\x20\x27','length','718LEKIcr','resolveSegmentId','\x27...','Error:\x20','845984oeifrF','description','Parent\x20name:\x20','Resolving\x20child\x20segment\x20\x27','270vYrbve','\x20\x20Cause:\x20','Child\x20name:\x20','resolveParentId','5679DKUKtd','error','838299ZgeHeR','✔\x20Found\x20','154722qmESqs'];a3_0x2b61=function(){return _0x2c96d5;};return a3_0x2b61();}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_0xb6fa(_0x2b6d74,_0x7478d7){_0x2b6d74=_0x2b6d74-0xb4;const _0x2b6109=a3_0x2b61();let _0xb6fa25=_0x2b6109[_0x2b6d74];return _0xb6fa25;}export class ActivationsCommand extends BaseCommand{['name']='activations';[a3_0x2b42cf(0xb7)]='List\x20activations\x20for\x20a\x20segment';async['execute'](_0x11983e){const _0xd102fc=a3_0x2b42cf,{options:_0x5a5743,args:_0x31fbc7,tdx:_0x1896cb}=_0x11983e;if(_0x31fbc7[_0xd102fc(0xd2)]===0x0)return console[_0xd102fc(0xbf)]('Error:\x20Segment\x20name\x20is\x20required'),console[_0xd102fc(0xbf)](_0xd102fc(0xc6)),0x1;try{const {parentId:_0x321d9f,childId:_0x319b4c}=parseSegmentRef(_0x31fbc7[0x0]);if(!_0x319b4c)return console['error']('Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations'),console[_0xd102fc(0xbf)](_0xd102fc(0xc6)),0x1;_0x5a5743[_0xd102fc(0xcf)]&&(console['error']('Site:\x20'+_0x5a5743[_0xd102fc(0xc9)]),console[_0xd102fc(0xbf)](_0xd102fc(0xb8)+_0x321d9f),console[_0xd102fc(0xbf)](_0xd102fc(0xbc)+_0x319b4c));const _0x2987d2=await withSpinner(_0xd102fc(0xd1)+_0x321d9f+_0xd102fc(0xb4),()=>_0x1896cb[_0xd102fc(0xc8)][_0xd102fc(0xbd)](_0x321d9f),{'verbose':_0x5a5743[_0xd102fc(0xcf)]}),_0x4cc41a=_0x2987d2[_0xd102fc(0xc5)];_0x5a5743[_0xd102fc(0xcf)]&&console['error']('Resolved\x20parent\x20ID:\x20'+_0x4cc41a);const _0x38c6a0=await withSpinner(_0xd102fc(0xb9)+_0x319b4c+'\x27...',()=>_0x1896cb['segment'][_0xd102fc(0xd4)](_0x4cc41a,_0x319b4c),{'verbose':_0x5a5743[_0xd102fc(0xcf)]}),_0x39bbfe=_0x38c6a0[_0xd102fc(0xc5)];_0x5a5743[_0xd102fc(0xcf)]&&console[_0xd102fc(0xbf)](_0xd102fc(0xce)+_0x39bbfe);const _0x17c370=await withSpinner('Listing\x20activations\x20for\x20segment\x20\x27'+_0x319b4c+_0xd102fc(0xb4),()=>_0x1896cb[_0xd102fc(0xc8)][_0xd102fc(0xd0)](_0x4cc41a,_0x39bbfe),{'verbose':_0x5a5743[_0xd102fc(0xcf)]}),_0x21d41c=_0x17c370[_0xd102fc(0xc5)];return console[_0xd102fc(0xbf)](_0xd102fc(0xc1)+_0x21d41c['length']+_0xd102fc(0xc3)+(_0x21d41c[_0xd102fc(0xd2)]!==0x1?'s':'')),await handleSDKOutput(_0x21d41c,_0x5a5743),0x0;}catch(_0x2aa947){if(_0x2aa947 instanceof SDKError)return console['error'](_0xd102fc(0xb5)+_0x2aa947[_0xd102fc(0xc7)]),_0x2aa947[_0xd102fc(0xc4)]&&console[_0xd102fc(0xbf)](_0xd102fc(0xbb)+_0x2aa947[_0xd102fc(0xc4)]),0x1;throw _0x2aa947;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x254f59=a4_0x3235;(function(_0x36b4b3,_0x5d4968){const _0x58028f=a4_0x3235,_0x44d09e=_0x36b4b3();while(!![]){try{const _0x2cae97=-parseInt(_0x58028f(0xf9))/0x1+-parseInt(_0x58028f(0xda))/0x2+parseInt(_0x58028f(0x10c))/0x3*(-parseInt(_0x58028f(0xd2))/0x4)+-parseInt(_0x58028f(0x120))/0x5*(parseInt(_0x58028f(0x159))/0x6)+parseInt(_0x58028f(0xdd))/0x7*(parseInt(_0x58028f(0x108))/0x8)+-parseInt(_0x58028f(0x147))/0x9+-parseInt(_0x58028f(0xf8))/0xa*(-parseInt(_0x58028f(0x156))/0xb);if(_0x2cae97===_0x5d4968)break;else _0x44d09e['push'](_0x44d09e['shift']());}catch(_0x32a2fd){_0x44d09e['push'](_0x44d09e['shift']());}}}(a4_0x2bea,0x1e6b9));import a4_0x51c2cf from'chalk';import a4_0x6eb13a from'path';import{existsSync,readFileSync}from'fs';function a4_0x3235(_0x4fc1e7,_0x311c8a){_0x4fc1e7=_0x4fc1e7-0xcc;const _0x2beac6=a4_0x2bea();let _0x32354b=_0x2beac6[_0x4fc1e7];return _0x32354b;}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';function a4_0x2bea(){const _0x2ca018=['223505UGvFHH','\x0aChanges\x20to\x20form\x20interface\x20\x27','\x20\x20Agents:\x20','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','Cancelled','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','\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)','\x20resources?','\x0aError:','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','gray','Would\x20clone:','force','\x22\x20from\x20project\x20\x22','log','1048TGwWdl','\x20created','unchanged','\x22...','6jrgzjP','\x20\x20tdx\x20agent\x20pull\x20','New\x20project:\x20','New\x20project\x20ID:\x20','output','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','no_local_folder','Project:\x20','dim','agent.yml','updated','Analyzing\x20changes\x20to\x20push...','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','site','\x0aPush\x20summary\x20for\x20\x27','Would\x20push\x20agent:\x20','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','\x0aErrors\x20found:','Using\x20current\x20project:\x20','Using\x20project:\x20','5GRXDRr','-\x20no\x20files\x20written','created','Output\x20path:\x20','\x0a✔\x20Pulled\x20','Errors:','red','Summary:','pullAgent','Dry\x20run\x20-\x20no\x20files\x20written','Cloning\x20\x22','description','\x20\x20Form\x20Interface\x20\x22','Output:\x20','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','integrations','Pushing\x20agent\x20from\x20\x22','Status:\x20','profile','\x20unchanged','utf-8','diff','\x20--profile\x20','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','\x20\x20tdx\x20agent\x20clone\x20agents/','agentName','errors','experimentalKnowledgeBases','\x0a✔\x20Pushed\x20','Source:\x20','prompts','Would\x20pull\x20agent:\x20','\x22:\x20','tdx.json','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','green','INVALID_ARGUMENT','agents','Dry\x20run\x20-\x20no\x20changes\x20made','704961cmSeQf','<new-name>','llm_project','\x20resources\x20to\x20\x27','dirname','agentId','\x0aChanges\x20to\x20chat\x20interface\x20\x27','join','name','counts','action','session','\x0aChanges\x20to\x20prompt\x20\x27','textKnowledgeBases','total','161183wrbjbw','Cannot\x20clone\x20from\x20context\x20project\x20\x22','agent:push','724314oTpgic','\x20--name\x20','MISSING_ARGUMENT','message','\x0aPull\x20summary\x20for\x20\x27','\x20\x20Chat\x20Interface\x20\x22','\x20\x20Knowledge\x20Base\x20\x22','\x20\x20Chat\x20Interfaces:\x20','\x20\x20Agent\x20\x22','Agent\x20pulled\x20successfully','isNew','error','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','push','\x20\x20Form\x20Interfaces:\x20','\x22\x20to\x20a\x20different\x20profile','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Pulling\x20agent\x20\x22','\x20\x20Text\x20Knowledge\x20Bases:\x20','formInterfaces','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)','execute','Using\x20context\x20project:\x20','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','llmProject','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','cyan','Pushing\x20to\x20project...','outputPath','parse','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','\x0aWrite\x20','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','\x0aChanges:','\x20=\x20','agent:pull','dryRun','projectName','pushProject','Analyzing\x20project\x20\x22','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','source','new','chatInterfaces','knowledgeBases','\x20errors','\x0aProject\x20pushed\x20with\x20errors','projectId','\x20\x20Prompt\x20\x22','\x20\x20Prompts:\x20','yellow','cwd-config','cwd','54848dTfHPW','sourceProjectName','\x20\x20Source:\x20','\x20\x20Integrations:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project','New\x20project\x20name\x20is\x20required','Project\x20cloned\x20with\x20errors','\x27\x20to\x20create\x20the\x20folder\x20structure.','52652cBEkJV','pullProject','newProjectId','7nRITPe','\x0aChanges\x20to\x20integration\x20\x27','\x20changed','\x20|\x20','\x22\x20to\x20new\x20project\x20\x22','\x20\x20Knowledge\x20Bases:\x20','llm','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','yes','No\x20tdx.json\x20found\x20in\x20','experimentalArtifacts','-\x20nothing\x20pushed','\x20updated','found','\x20\x20Experimental\x20Artifacts:\x20','Project\x20cloned\x20successfully','arg-dir','Agent:\x20','\x20new','✔\x20Context\x20set:\x20','Using\x20local\x20project:\x20','Clone\x20\x22','Writing\x20files...','Agent\x20','context','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','repeat','410UmyDSi'];a4_0x2bea=function(){return _0x2ca018;};return a4_0x2bea();}import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x16575e){const _0x207a05=a4_0x3235,_0x3387a3=[];if(_0x16575e[_0x207a05(0x155)]!==undefined)_0x3387a3['push'](_0x16575e['total']+'\x20total');if(_0x16575e[_0x207a05(0x183)]!==undefined&&_0x16575e[_0x207a05(0x183)]>0x0)_0x3387a3[_0x207a05(0x166)](a4_0x51c2cf['green'](_0x16575e[_0x207a05(0x183)]+_0x207a05(0xef)));if(_0x16575e[_0x207a05(0x122)]!==undefined&&_0x16575e['created']>0x0)_0x3387a3[_0x207a05(0x166)](a4_0x51c2cf[_0x207a05(0x143)](_0x16575e[_0x207a05(0x122)]+_0x207a05(0x109)));if(_0x16575e[_0x207a05(0x116)]!==undefined&&_0x16575e[_0x207a05(0x116)]>0x0)_0x3387a3['push'](a4_0x51c2cf[_0x207a05(0xcf)](_0x16575e[_0x207a05(0x116)]+_0x207a05(0xe9)));if(_0x16575e[_0x207a05(0x10a)]!==undefined&&_0x16575e['unchanged']>0x0)_0x3387a3[_0x207a05(0x166)](a4_0x51c2cf[_0x207a05(0x103)](_0x16575e[_0x207a05(0x10a)]+_0x207a05(0x133)));if(_0x16575e[_0x207a05(0x13a)]!==undefined&&_0x16575e[_0x207a05(0x13a)]>0x0)_0x3387a3['push'](a4_0x51c2cf[_0x207a05(0x126)](_0x16575e['errors']+_0x207a05(0x186)));return _0x3387a3[_0x207a05(0x14e)](',\x20');}function displayDiffs(_0xeaae8c,_0x4c1645,_0x23f5c9,_0x368095,_0x2eb332,_0x117863,_0x2ab7f3,_0x5844f7,_0x5f4d08){const _0x211d76=a4_0x3235;for(const _0x2a9cf6 of _0xeaae8c){if(_0x2a9cf6[_0x211d76(0x135)]){const _0x27e5ea=_0x2a9cf6[_0x211d76(0x139)]||_0x2a9cf6['name'];console[_0x211d76(0x107)]('\x0aChanges\x20to\x20agent\x20\x27'+_0x27e5ea+'\x27:'),console[_0x211d76(0x107)]('─'[_0x211d76(0xf7)](0x3c)),console[_0x211d76(0x107)](_0x2a9cf6[_0x211d76(0x135)]),console[_0x211d76(0x107)]('─'[_0x211d76(0xf7)](0x3c));}}for(const _0x30b89a of _0x4c1645){_0x30b89a[_0x211d76(0x135)]&&(console[_0x211d76(0x107)]('\x0aChanges\x20to\x20knowledge\x20base\x20\x27'+_0x30b89a[_0x211d76(0x14f)]+'\x27:'),console[_0x211d76(0x107)]('─'[_0x211d76(0xf7)](0x3c)),console[_0x211d76(0x107)](_0x30b89a[_0x211d76(0x135)]),console[_0x211d76(0x107)]('─'[_0x211d76(0xf7)](0x3c)));}for(const _0x20bc74 of _0x23f5c9){_0x20bc74[_0x211d76(0x135)]&&(console[_0x211d76(0x107)](_0x211d76(0x137)+_0x20bc74[_0x211d76(0x14f)]+'\x27:'),console[_0x211d76(0x107)]('─'['repeat'](0x3c)),console[_0x211d76(0x107)](_0x20bc74['diff']),console[_0x211d76(0x107)]('─'[_0x211d76(0xf7)](0x3c)));}for(const _0x2785e3 of _0x368095){_0x2785e3[_0x211d76(0x135)]&&(console[_0x211d76(0x107)](_0x211d76(0x153)+_0x2785e3['name']+'\x27:'),console[_0x211d76(0x107)]('─'['repeat'](0x3c)),console['log'](_0x2785e3[_0x211d76(0x135)]),console[_0x211d76(0x107)]('─'['repeat'](0x3c)));}for(const _0x49c40b of _0x2eb332){_0x49c40b['diff']&&(console[_0x211d76(0x107)](_0x211d76(0xde)+_0x49c40b[_0x211d76(0x14f)]+'\x27:'),console[_0x211d76(0x107)]('─'[_0x211d76(0xf7)](0x3c)),console[_0x211d76(0x107)](_0x49c40b['diff']),console['log']('─'[_0x211d76(0xf7)](0x3c)));}for(const _0x2df45b of _0x117863){_0x2df45b[_0x211d76(0x135)]&&(console[_0x211d76(0x107)](_0x211d76(0x177)+_0x2df45b['name']+'\x27:'),console['log']('─'[_0x211d76(0xf7)](0x3c)),console[_0x211d76(0x107)](_0x2df45b[_0x211d76(0x135)]),console[_0x211d76(0x107)]('─'['repeat'](0x3c)));}for(const _0x491a6e of _0x2ab7f3){_0x491a6e['diff']&&(console[_0x211d76(0x107)](_0x211d76(0x181)+_0x491a6e[_0x211d76(0x14f)]+'\x27:'),console['log']('─'[_0x211d76(0xf7)](0x3c)),console['log'](_0x491a6e[_0x211d76(0x135)]),console[_0x211d76(0x107)]('─'['repeat'](0x3c)));}for(const _0x5d5dbb of _0x5844f7){_0x5d5dbb[_0x211d76(0x135)]&&(console[_0x211d76(0x107)](_0x211d76(0xfa)+_0x5d5dbb[_0x211d76(0x14f)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console[_0x211d76(0x107)](_0x5d5dbb[_0x211d76(0x135)]),console[_0x211d76(0x107)]('─'['repeat'](0x3c)));}for(const _0x36ea94 of _0x5f4d08){_0x36ea94[_0x211d76(0x135)]&&(console['log'](_0x211d76(0x14d)+_0x36ea94['name']+'\x27:'),console[_0x211d76(0x107)]('─'['repeat'](0x3c)),console[_0x211d76(0x107)](_0x36ea94[_0x211d76(0x135)]),console[_0x211d76(0x107)]('─'[_0x211d76(0xf7)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']=a4_0x254f59(0x17c);[a4_0x254f59(0x12b)]=a4_0x254f59(0x165);async[a4_0x254f59(0x16e)](_0x4fa758){const _0x2c86fd=a4_0x254f59,{options:_0x5c7773,args:_0x31badc,tdx:_0x465e20}=_0x4fa758,_0x1767eb=_0x31badc[0x0],_0x4b4fc2=_0x31badc[0x1],_0x48b870=_0x5c7773[_0x2c86fd(0x110)],_0x166168=_0x5c7773['dryRun'],_0x2b9b91=_0x5c7773[_0x2c86fd(0x105)],_0xaabc90=_0x5c7773[_0x2c86fd(0xe5)],_0x274d29=_0x5c7773['llmProject'],_0x1ef40b=_0x5c7773['agent'];let _0xae3edc;if(_0x1767eb){const _0x1091c2=a4_0x6eb13a['join'](_0x1767eb,'tdx.json');if(existsSync(_0x1091c2))try{const _0x41528d=JSON[_0x2c86fd(0x176)](readFileSync(_0x1091c2,_0x2c86fd(0x134)));_0x41528d[_0x2c86fd(0x149)]&&(_0xae3edc={'llm_project':_0x41528d[_0x2c86fd(0x149)]});}catch{}}const _0x3af025=findAgentConfigPath(process[_0x2c86fd(0xd1)]());let _0x45612b;if(_0x3af025)try{const _0xa7103c=JSON['parse'](readFileSync(_0x3af025,'utf-8'));_0xa7103c[_0x2c86fd(0x149)]&&(_0x45612b={'llm_project':_0xa7103c[_0x2c86fd(0x149)]});}catch{}const _0x3bb6fd=resolveAgentPullArgs({'arg':_0x1767eb,'agentNameArg':_0x4b4fc2,'agentFlag':_0x1ef40b,'contextProject':_0x274d29,'argDirConfig':_0xae3edc,'cwdConfigPath':_0x3af025||undefined,'cwdConfig':_0x45612b}),{projectNameOrId:_0x5326d8,targetAgentName:_0x1e6729,existingOutputDir:_0x31ad8b,source:_0x8f736a}=_0x3bb6fd;if(_0x8f736a===_0x2c86fd(0xed))console[_0x2c86fd(0x107)](a4_0x51c2cf[_0x2c86fd(0x114)]('Using\x20project\x20from\x20'+a4_0x6eb13a[_0x2c86fd(0x14e)](_0x1767eb,'tdx.json')+':\x20'+_0x5326d8));else{if(_0x8f736a===_0x2c86fd(0xd0))console[_0x2c86fd(0x107)](a4_0x51c2cf[_0x2c86fd(0x114)](_0x2c86fd(0x11f)+_0x5326d8));else _0x8f736a===_0x2c86fd(0xf5)&&console[_0x2c86fd(0x107)](a4_0x51c2cf[_0x2c86fd(0x114)]('Using\x20project\x20from\x20context:\x20'+_0x5326d8));}if(!_0x5326d8)return _0x1ef40b?(console[_0x2c86fd(0x107)](a4_0x51c2cf[_0x2c86fd(0xcf)](_0x2c86fd(0x102))),console[_0x2c86fd(0x107)](_0x2c86fd(0xfe)),console[_0x2c86fd(0x107)]('Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>')):(console[_0x2c86fd(0x107)](a4_0x51c2cf[_0x2c86fd(0xcf)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console['log'](_0x2c86fd(0x16d)),console[_0x2c86fd(0x107)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project'),console[_0x2c86fd(0x107)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory'),console[_0x2c86fd(0x107)](_0x2c86fd(0xd6)),console[_0x2c86fd(0x107)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project')),0x1;if(_0x1e6729){const {data:_0x10ed02}=await withSpinner(_0x2c86fd(0x16a)+_0x1e6729+_0x2c86fd(0x106)+_0x5326d8+'\x22...',()=>_0x465e20['llm'][_0x2c86fd(0x128)](_0x5326d8,_0x1e6729,_0x48b870,{'dryRun':_0x166168,'force':_0x2b9b91}));if(_0x166168)return console['log'](a4_0x51c2cf[_0x2c86fd(0xcf)](_0x2c86fd(0x129))),console['log'](_0x2c86fd(0x13f)+_0x10ed02[_0x2c86fd(0x139)]),console[_0x2c86fd(0x107)](_0x2c86fd(0x123)+_0x10ed02[_0x2c86fd(0x175)]),_0x10ed02[_0x2c86fd(0x135)]&&(console[_0x2c86fd(0x107)](_0x2c86fd(0x17a)),console[_0x2c86fd(0x107)]('─'[_0x2c86fd(0xf7)](0x3c)),console[_0x2c86fd(0x107)](_0x10ed02[_0x2c86fd(0x135)]),console[_0x2c86fd(0x107)]('─'[_0x2c86fd(0xf7)](0x3c))),0x0;return console[_0x2c86fd(0x107)](a4_0x51c2cf['green'](_0x2c86fd(0x162))),console['log'](_0x2c86fd(0xee)+_0x10ed02[_0x2c86fd(0x139)]),console[_0x2c86fd(0x107)](_0x2c86fd(0x12d)+_0x10ed02[_0x2c86fd(0x175)]),console[_0x2c86fd(0x107)](_0x2c86fd(0x131)+(_0x10ed02[_0x2c86fd(0x163)]?a4_0x51c2cf[_0x2c86fd(0x143)]('new'):_0x10ed02['hasChanges']?a4_0x51c2cf['yellow'](_0x2c86fd(0x116)):a4_0x51c2cf[_0x2c86fd(0x103)](_0x2c86fd(0x10a)))),0x0;}const _0x485804=_0x31ad8b||_0x48b870,{data:_0x43e8c5}=await withSpinner(_0x2c86fd(0x180)+_0x5326d8+_0x2c86fd(0x10b),()=>_0x465e20[_0x2c86fd(0xe3)][_0x2c86fd(0xdb)](_0x5326d8,_0x485804,{'dryRun':!![]})),_0x31d022=_0x43e8c5[_0x2c86fd(0x150)][_0x2c86fd(0x145)][_0x2c86fd(0x183)]+_0x43e8c5[_0x2c86fd(0x150)][_0x2c86fd(0x185)]['new']+_0x43e8c5[_0x2c86fd(0x150)][_0x2c86fd(0x154)]['new']+_0x43e8c5[_0x2c86fd(0x150)][_0x2c86fd(0x13e)][_0x2c86fd(0x183)]+_0x43e8c5[_0x2c86fd(0x150)][_0x2c86fd(0x12f)][_0x2c86fd(0x183)]+_0x43e8c5[_0x2c86fd(0x150)][_0x2c86fd(0x13b)][_0x2c86fd(0x183)]+_0x43e8c5[_0x2c86fd(0x150)][_0x2c86fd(0xe7)][_0x2c86fd(0x183)]+_0x43e8c5[_0x2c86fd(0x150)]['formInterfaces'][_0x2c86fd(0x183)]+_0x43e8c5[_0x2c86fd(0x150)][_0x2c86fd(0x184)][_0x2c86fd(0x183)],_0x535c82=_0x43e8c5[_0x2c86fd(0x150)][_0x2c86fd(0x145)][_0x2c86fd(0x116)]+_0x43e8c5[_0x2c86fd(0x150)][_0x2c86fd(0x185)][_0x2c86fd(0x116)]+_0x43e8c5['counts']['textKnowledgeBases']['updated']+_0x43e8c5[_0x2c86fd(0x150)][_0x2c86fd(0x13e)]['updated']+_0x43e8c5['counts'][_0x2c86fd(0x12f)][_0x2c86fd(0x116)]+_0x43e8c5[_0x2c86fd(0x150)][_0x2c86fd(0x13b)][_0x2c86fd(0x116)]+_0x43e8c5[_0x2c86fd(0x150)]['experimentalArtifacts'][_0x2c86fd(0x116)]+_0x43e8c5['counts'][_0x2c86fd(0x16c)]['updated']+_0x43e8c5[_0x2c86fd(0x150)][_0x2c86fd(0x184)][_0x2c86fd(0x116)],_0x4ffcdc=_0x43e8c5['counts']['agents'][_0x2c86fd(0x10a)]+_0x43e8c5['counts'][_0x2c86fd(0x185)][_0x2c86fd(0x10a)]+_0x43e8c5['counts']['textKnowledgeBases'][_0x2c86fd(0x10a)]+_0x43e8c5[_0x2c86fd(0x150)]['prompts'][_0x2c86fd(0x10a)]+_0x43e8c5[_0x2c86fd(0x150)]['integrations'][_0x2c86fd(0x10a)]+_0x43e8c5[_0x2c86fd(0x150)][_0x2c86fd(0x13b)][_0x2c86fd(0x10a)]+_0x43e8c5[_0x2c86fd(0x150)][_0x2c86fd(0xe7)][_0x2c86fd(0x10a)]+_0x43e8c5['counts'][_0x2c86fd(0x16c)][_0x2c86fd(0x10a)]+_0x43e8c5[_0x2c86fd(0x150)][_0x2c86fd(0x184)]['unchanged'];console[_0x2c86fd(0x107)](_0x2c86fd(0x15d)+_0x43e8c5['projectName']+'\x27:'),console[_0x2c86fd(0x107)]('\x20\x20'+a4_0x51c2cf['green']('+\x20'+_0x31d022+_0x2c86fd(0xef))+_0x2c86fd(0xe0)+a4_0x51c2cf[_0x2c86fd(0xcf)]('~\x20'+_0x535c82+_0x2c86fd(0xdf))+'\x20|\x20'+a4_0x51c2cf['dim']('=\x20'+_0x4ffcdc+_0x2c86fd(0x133))),console['log'](_0x2c86fd(0xfb)+formatCountSummary(_0x43e8c5['counts'][_0x2c86fd(0x145)])),console[_0x2c86fd(0x107)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x43e8c5[_0x2c86fd(0x150)][_0x2c86fd(0x185)])),console['log'](_0x2c86fd(0x16b)+formatCountSummary(_0x43e8c5[_0x2c86fd(0x150)][_0x2c86fd(0x154)])),console[_0x2c86fd(0x107)](_0x2c86fd(0xce)+formatCountSummary(_0x43e8c5[_0x2c86fd(0x150)][_0x2c86fd(0x13e)])),console[_0x2c86fd(0x107)](_0x2c86fd(0xd5)+formatCountSummary(_0x43e8c5[_0x2c86fd(0x150)][_0x2c86fd(0x12f)])),console[_0x2c86fd(0x107)](_0x2c86fd(0x167)+formatCountSummary(_0x43e8c5[_0x2c86fd(0x150)][_0x2c86fd(0x16c)])),console[_0x2c86fd(0x107)]('\x20\x20Chat\x20Interfaces:\x20'+formatCountSummary(_0x43e8c5[_0x2c86fd(0x150)][_0x2c86fd(0x184)]));const _0x3bb08a=_0x43e8c5[_0x2c86fd(0x150)]['experimentalKnowledgeBases'][_0x2c86fd(0x155)]>0x0||_0x43e8c5['counts']['experimentalArtifacts'][_0x2c86fd(0x155)]>0x0;_0x3bb08a&&(console[_0x2c86fd(0x107)](_0x2c86fd(0x179)+formatCountSummary(_0x43e8c5[_0x2c86fd(0x150)][_0x2c86fd(0x13b)])),console[_0x2c86fd(0x107)](_0x2c86fd(0xeb)+formatCountSummary(_0x43e8c5['counts'][_0x2c86fd(0xe7)])));console[_0x2c86fd(0x107)]('\x20\x20Target:\x20'+a4_0x51c2cf[_0x2c86fd(0x173)](_0x43e8c5['outputDir'])),displayDiffs(_0x43e8c5[_0x2c86fd(0x145)],_0x43e8c5[_0x2c86fd(0x185)],_0x43e8c5[_0x2c86fd(0x154)],_0x43e8c5[_0x2c86fd(0x13e)],_0x43e8c5[_0x2c86fd(0x12f)],_0x43e8c5[_0x2c86fd(0x13b)],_0x43e8c5[_0x2c86fd(0xe7)],_0x43e8c5[_0x2c86fd(0x16c)],_0x43e8c5[_0x2c86fd(0x184)]);if(_0x166168)return console[_0x2c86fd(0x107)](a4_0x51c2cf[_0x2c86fd(0xcf)](_0x2c86fd(0x118))),0x0;if(_0x31d022===0x0&&_0x535c82===0x0)return console['log'](a4_0x51c2cf[_0x2c86fd(0x143)]('\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'llm_project':_0x43e8c5[_0x2c86fd(0x17e)]},_0x5c7773[_0x2c86fd(0x152)]),console[_0x2c86fd(0x107)](a4_0x51c2cf['green'](_0x2c86fd(0xf0)+a4_0x51c2cf[_0x2c86fd(0x114)](_0x2c86fd(0x149))+_0x2c86fd(0x17b)+a4_0x51c2cf[_0x2c86fd(0x173)](_0x43e8c5[_0x2c86fd(0x17e)]))),0x0;if(!_0xaabc90&&!_0x2b9b91){if(!isInteractive())return console['error'](a4_0x51c2cf['red']('\x0aError:'),_0x2c86fd(0x172)),console['error'](a4_0x51c2cf[_0x2c86fd(0x114)](_0x2c86fd(0xf6))),0x1;const _0x51b396=await confirmKey(_0x2c86fd(0x178)+(_0x31d022+_0x535c82)+'\x20files?');if(!_0x51b396)return console['log'](a4_0x51c2cf[_0x2c86fd(0xcf)](_0x2c86fd(0xfd)),_0x2c86fd(0x121)),0x1;}const {data:_0xbe917}=await withSpinner(_0x2c86fd(0xf3),()=>_0x465e20[_0x2c86fd(0xe3)]['pullProject'](_0x5326d8,_0x485804,{'force':_0x2b9b91}));return console[_0x2c86fd(0x107)](a4_0x51c2cf['green'](_0x2c86fd(0x124)+(_0x31d022+_0x535c82)+'\x20files\x20to\x20'+_0xbe917['outputDir'])),saveSessionContext({'llm_project':_0xbe917[_0x2c86fd(0x17e)]},_0x5c7773[_0x2c86fd(0x152)]),console[_0x2c86fd(0x107)](a4_0x51c2cf['green'](_0x2c86fd(0xf0)+a4_0x51c2cf['dim'](_0x2c86fd(0x149))+_0x2c86fd(0x17b)+a4_0x51c2cf[_0x2c86fd(0x173)](_0xbe917['projectName']))),0x0;}}export class AgentCloneCommand extends BaseCommand{['name']='agent:clone';['description']=a4_0x254f59(0xfc);async[a4_0x254f59(0x16e)](_0x290e1f){const _0x44c7f1=a4_0x254f59,{options:_0xaab5c6,args:_0x5eb370,tdx:_0x2365c4}=_0x290e1f,_0x3e5d57=_0x5eb370[0x0],_0x3e0ed8=_0xaab5c6[_0x44c7f1(0x14f)],_0x5f0702=_0xaab5c6[_0x44c7f1(0x17d)],_0x1034d4=_0xaab5c6[_0x44c7f1(0xe5)],_0x374324=_0xaab5c6[_0x44c7f1(0x119)],_0x375e7e=_0xaab5c6[_0x44c7f1(0x171)];let _0x135cb3;const _0x35c15b=findAgentConfigPath(process[_0x44c7f1(0xd1)]());if(_0x3e5d57){const _0x47ad5b=a4_0x6eb13a[_0x44c7f1(0x14e)](_0x3e5d57,_0x44c7f1(0x141));existsSync(_0x47ad5b)?(_0x135cb3=_0x3e5d57,console['log'](a4_0x51c2cf[_0x44c7f1(0x114)](_0x44c7f1(0xf1)+_0x3e5d57))):_0x135cb3=_0x3e5d57;}else{if(_0x35c15b)_0x135cb3=a4_0x6eb13a[_0x44c7f1(0x14b)](_0x35c15b),console[_0x44c7f1(0x107)](a4_0x51c2cf[_0x44c7f1(0x114)](_0x44c7f1(0x11e)+_0x135cb3));else{if(_0x375e7e){const _0x3a1301=sanitizeForFilesystem(_0x375e7e);let _0x2bb368=_0x3a1301,_0x4edcf1=a4_0x6eb13a[_0x44c7f1(0x14e)](process['cwd'](),_0x44c7f1(0x145),_0x3a1301,_0x44c7f1(0x141));if(!existsSync(_0x4edcf1)){const _0x3265ca=normalizeName(_0x375e7e),_0x59173a=a4_0x6eb13a[_0x44c7f1(0x14e)](process[_0x44c7f1(0xd1)](),_0x44c7f1(0x145),_0x3265ca,_0x44c7f1(0x141));existsSync(_0x59173a)&&(_0x2bb368=_0x3265ca,_0x4edcf1=_0x59173a);}if(existsSync(_0x4edcf1))_0x135cb3=a4_0x6eb13a[_0x44c7f1(0x14b)](_0x4edcf1),console[_0x44c7f1(0x107)](a4_0x51c2cf[_0x44c7f1(0x114)](_0x44c7f1(0xf1)+_0x135cb3));else{const _0x1c1f06=_0xaab5c6[_0x44c7f1(0x132)];if(_0x1c1f06)throw new SDKError(ErrorCode[_0x44c7f1(0x144)],_0x44c7f1(0x157)+_0x375e7e+_0x44c7f1(0x168),undefined,{'helpText':'When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a'+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+(_0x44c7f1(0x10d)+_0x375e7e+'\x0a')+(_0x44c7f1(0x138)+_0x2bb368+_0x44c7f1(0x15a)+(_0x3e0ed8||_0x44c7f1(0x148))+_0x44c7f1(0x136)+_0x1c1f06)});_0x135cb3=_0x375e7e,console['log'](a4_0x51c2cf[_0x44c7f1(0x114)](_0x44c7f1(0x16f)+_0x375e7e));}}}}if(!_0x135cb3)return console['log'](a4_0x51c2cf['yellow']('No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a')),console[_0x44c7f1(0x107)](_0x44c7f1(0xe4)),console[_0x44c7f1(0x107)]('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console[_0x44c7f1(0x107)](_0x44c7f1(0xff)),console['log'](_0x44c7f1(0x169)),0x1;if(!_0x3e0ed8)throw new SDKError(ErrorCode[_0x44c7f1(0x15b)],_0x44c7f1(0xd7),undefined,{'helpText':_0x44c7f1(0x170)});if(!_0x1034d4&&!_0x5f0702){if(!isInteractive())return console[_0x44c7f1(0x164)](a4_0x51c2cf[_0x44c7f1(0x126)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x44c7f1(0x164)](a4_0x51c2cf[_0x44c7f1(0x114)](_0x44c7f1(0xf6))),0x1;const _0x4f05d1=await confirmKey(_0x44c7f1(0xf2)+_0x135cb3+_0x44c7f1(0xe1)+_0x3e0ed8+'\x22?');if(!_0x4f05d1)return console['log'](a4_0x51c2cf[_0x44c7f1(0xcf)](_0x44c7f1(0xfd))),0x1;}const {data:_0x158ac1}=await withSpinner(_0x44c7f1(0x12a)+_0x135cb3+'\x22\x20to\x20\x22'+_0x3e0ed8+'\x22...',()=>_0x2365c4[_0x44c7f1(0xe3)]['cloneProject'](_0x135cb3,_0x3e0ed8,{'dryRun':_0x5f0702}));if(_0x5f0702){console[_0x44c7f1(0x107)](a4_0x51c2cf['yellow'](_0x44c7f1(0x146))),console[_0x44c7f1(0x107)](_0x44c7f1(0x13d)+_0x158ac1[_0x44c7f1(0xd3)]),console[_0x44c7f1(0x107)](_0x44c7f1(0x10e)+_0x3e0ed8),console['log'](_0x44c7f1(0x104)),console[_0x44c7f1(0x107)](_0x44c7f1(0xfb)+_0x158ac1['counts'][_0x44c7f1(0x145)][_0x44c7f1(0x122)]),console[_0x44c7f1(0x107)](_0x44c7f1(0xe2)+_0x158ac1['counts']['knowledgeBases'][_0x44c7f1(0x122)]),console[_0x44c7f1(0x107)](_0x44c7f1(0xce)+_0x158ac1[_0x44c7f1(0x150)]['prompts'][_0x44c7f1(0x122)]),console[_0x44c7f1(0x107)](_0x44c7f1(0x167)+_0x158ac1[_0x44c7f1(0x150)][_0x44c7f1(0x16c)][_0x44c7f1(0x122)]),console[_0x44c7f1(0x107)](_0x44c7f1(0x160)+_0x158ac1[_0x44c7f1(0x150)][_0x44c7f1(0x184)]['created']);const _0x3d4efa=_0x158ac1[_0x44c7f1(0x150)][_0x44c7f1(0x13b)][_0x44c7f1(0x122)]>0x0||_0x158ac1['counts'][_0x44c7f1(0xe7)][_0x44c7f1(0x122)]>0x0;return _0x3d4efa&&(console[_0x44c7f1(0x107)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+_0x158ac1[_0x44c7f1(0x150)][_0x44c7f1(0x13b)][_0x44c7f1(0x122)]),console[_0x44c7f1(0x107)](_0x44c7f1(0xeb)+_0x158ac1[_0x44c7f1(0x150)]['experimentalArtifacts'][_0x44c7f1(0x122)])),0x0;}const _0x1cd95b=_0x158ac1[_0x44c7f1(0x150)]['agents'][_0x44c7f1(0x13a)]>0x0||_0x158ac1[_0x44c7f1(0x150)][_0x44c7f1(0x185)]['errors']>0x0||_0x158ac1[_0x44c7f1(0x150)]['prompts'][_0x44c7f1(0x13a)]>0x0||_0x158ac1[_0x44c7f1(0x150)][_0x44c7f1(0x16c)][_0x44c7f1(0x13a)]>0x0||_0x158ac1['counts'][_0x44c7f1(0x184)][_0x44c7f1(0x13a)]>0x0||_0x158ac1[_0x44c7f1(0x150)]['experimentalKnowledgeBases'][_0x44c7f1(0x13a)]>0x0||_0x158ac1[_0x44c7f1(0x150)][_0x44c7f1(0xe7)][_0x44c7f1(0x13a)]>0x0;_0x1cd95b?console[_0x44c7f1(0x107)](a4_0x51c2cf[_0x44c7f1(0xcf)](_0x44c7f1(0xd8))):console['log'](a4_0x51c2cf[_0x44c7f1(0x143)](_0x44c7f1(0xec)));console[_0x44c7f1(0x107)]('Source:\x20'+_0x158ac1[_0x44c7f1(0xd3)]),console[_0x44c7f1(0x107)](_0x44c7f1(0x10e)+_0x158ac1['newProjectName']),console[_0x44c7f1(0x107)](_0x44c7f1(0x10f)+_0x158ac1[_0x44c7f1(0xdc)]),console[_0x44c7f1(0x107)](),console[_0x44c7f1(0x107)](_0x44c7f1(0x127)),console[_0x44c7f1(0x107)]('\x20\x20Agents:\x20'+formatCountSummary(_0x158ac1[_0x44c7f1(0x150)][_0x44c7f1(0x145)])),console[_0x44c7f1(0x107)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x158ac1[_0x44c7f1(0x150)][_0x44c7f1(0x185)])),console[_0x44c7f1(0x107)](_0x44c7f1(0xce)+formatCountSummary(_0x158ac1[_0x44c7f1(0x150)][_0x44c7f1(0x13e)])),console[_0x44c7f1(0x107)](_0x44c7f1(0xd5)+formatCountSummary(_0x158ac1[_0x44c7f1(0x150)][_0x44c7f1(0x12f)])),console[_0x44c7f1(0x107)](_0x44c7f1(0x167)+formatCountSummary(_0x158ac1[_0x44c7f1(0x150)]['formInterfaces'])),console[_0x44c7f1(0x107)](_0x44c7f1(0x160)+formatCountSummary(_0x158ac1[_0x44c7f1(0x150)][_0x44c7f1(0x184)]));const _0x2caff8=_0x158ac1[_0x44c7f1(0x150)][_0x44c7f1(0x13b)][_0x44c7f1(0x122)]>0x0||_0x158ac1['counts'][_0x44c7f1(0x13b)][_0x44c7f1(0x116)]>0x0||_0x158ac1[_0x44c7f1(0x150)][_0x44c7f1(0x13b)][_0x44c7f1(0x10a)]>0x0||_0x158ac1['counts'][_0x44c7f1(0xe7)][_0x44c7f1(0x122)]>0x0||_0x158ac1['counts'][_0x44c7f1(0xe7)][_0x44c7f1(0x116)]>0x0||_0x158ac1[_0x44c7f1(0x150)][_0x44c7f1(0xe7)][_0x44c7f1(0x10a)]>0x0;_0x2caff8&&(console[_0x44c7f1(0x107)](_0x44c7f1(0x179)+formatCountSummary(_0x158ac1[_0x44c7f1(0x150)][_0x44c7f1(0x13b)])),console[_0x44c7f1(0x107)](_0x44c7f1(0xeb)+formatCountSummary(_0x158ac1['counts'][_0x44c7f1(0xe7)])));if(_0x1cd95b){console['log'](),console[_0x44c7f1(0x107)](a4_0x51c2cf['red']('Errors:'));for(const _0x1d43ac of _0x158ac1[_0x44c7f1(0x145)]){_0x1d43ac[_0x44c7f1(0x151)]===_0x44c7f1(0x164)&&console['log'](a4_0x51c2cf[_0x44c7f1(0x126)](_0x44c7f1(0x161)+_0x1d43ac[_0x44c7f1(0x139)]+_0x44c7f1(0x140)+_0x1d43ac[_0x44c7f1(0x164)]));}for(const _0x41614a of _0x158ac1[_0x44c7f1(0x185)]){_0x41614a['action']==='error'&&console[_0x44c7f1(0x107)](a4_0x51c2cf['red'](_0x44c7f1(0x15f)+_0x41614a['name']+_0x44c7f1(0x140)+_0x41614a['error']));}for(const _0x3f6ec5 of _0x158ac1[_0x44c7f1(0x13e)]){_0x3f6ec5[_0x44c7f1(0x151)]===_0x44c7f1(0x164)&&console['log'](a4_0x51c2cf[_0x44c7f1(0x126)](_0x44c7f1(0xcd)+_0x3f6ec5['name']+_0x44c7f1(0x140)+_0x3f6ec5[_0x44c7f1(0x164)]));}for(const _0x511b7e of _0x158ac1[_0x44c7f1(0x12f)]){_0x511b7e[_0x44c7f1(0x151)]==='error'&&console[_0x44c7f1(0x107)](a4_0x51c2cf[_0x44c7f1(0x126)]('\x20\x20Integration\x20\x22'+_0x511b7e[_0x44c7f1(0x14f)]+'\x22:\x20'+_0x511b7e[_0x44c7f1(0x164)]));}for(const _0x4f7f63 of _0x158ac1[_0x44c7f1(0x16c)]){_0x4f7f63[_0x44c7f1(0x151)]===_0x44c7f1(0x164)&&console[_0x44c7f1(0x107)](a4_0x51c2cf[_0x44c7f1(0x126)]('\x20\x20Form\x20Interface\x20\x22'+_0x4f7f63[_0x44c7f1(0x14f)]+_0x44c7f1(0x140)+_0x4f7f63[_0x44c7f1(0x164)]));}for(const _0x9ef2aa of _0x158ac1[_0x44c7f1(0x184)]){_0x9ef2aa[_0x44c7f1(0x151)]==='error'&&console[_0x44c7f1(0x107)](a4_0x51c2cf[_0x44c7f1(0x126)]('\x20\x20Chat\x20Interface\x20\x22'+_0x9ef2aa[_0x44c7f1(0x14f)]+_0x44c7f1(0x140)+_0x9ef2aa[_0x44c7f1(0x164)]));}for(const _0x3f3808 of _0x158ac1[_0x44c7f1(0x13b)]){_0x3f3808[_0x44c7f1(0x151)]===_0x44c7f1(0x164)&&console[_0x44c7f1(0x107)](a4_0x51c2cf[_0x44c7f1(0x126)]('\x20\x20Experimental\x20Knowledge\x20Base\x20\x22'+_0x3f3808[_0x44c7f1(0x14f)]+_0x44c7f1(0x140)+_0x3f3808['error']));}for(const _0x4b8236 of _0x158ac1[_0x44c7f1(0xe7)]){_0x4b8236[_0x44c7f1(0x151)]==='error'&&console[_0x44c7f1(0x107)](a4_0x51c2cf[_0x44c7f1(0x126)]('\x20\x20Experimental\x20Artifact\x20\x22'+_0x4b8236[_0x44c7f1(0x14f)]+_0x44c7f1(0x140)+_0x4b8236[_0x44c7f1(0x164)]));}return 0x1;}console[_0x44c7f1(0x107)]();const _0x244bb1=getLLMProjectUrl(_0x374324,_0x158ac1[_0x44c7f1(0xdc)]);return console[_0x44c7f1(0x107)](_0x44c7f1(0x113)+a4_0x51c2cf['cyan'](_0x244bb1)),0x0;}}export class AgentPushCommand extends BaseCommand{['name']=a4_0x254f59(0x158);[a4_0x254f59(0x12b)]='Push\x20local\x20agent\x20files\x20to\x20LLM\x20project';async[a4_0x254f59(0x16e)](_0x458263){const _0xa15064=a4_0x254f59,{options:_0x289da7,args:_0x352d42,tdx:_0x4bbb0f}=_0x458263;let _0x266cd0=_0x352d42[0x0]||process[_0xa15064(0xd1)]();const _0x5b6802=_0x289da7[_0xa15064(0x17d)],_0x53c1bc=_0x289da7['force'],_0x504671=_0x289da7[_0xa15064(0xe5)],_0xa0d8eb=_0x289da7[_0xa15064(0x119)],_0x2aade7=a4_0x6eb13a['join'](_0x266cd0,_0xa15064(0x115)),_0x2db0e9=existsSync(_0x2aade7);if(_0x2db0e9){const {data:_0x595318}=await withSpinner(_0xa15064(0x130)+_0x266cd0+_0xa15064(0x10b),()=>_0x4bbb0f[_0xa15064(0xe3)]['pushAgent'](_0x266cd0,{'dryRun':_0x5b6802,'force':_0x53c1bc}));if(_0x5b6802)return console[_0xa15064(0x107)](a4_0x51c2cf[_0xa15064(0xcf)](_0xa15064(0x146))),console['log'](_0xa15064(0x11b)+_0x595318[_0xa15064(0x139)]),0x0;if(_0x595318[_0xa15064(0x151)]===_0xa15064(0x164))return console['log'](a4_0x51c2cf['red']('Failed\x20to\x20push\x20agent:\x20'+_0x595318[_0xa15064(0x164)])),0x1;console[_0xa15064(0x107)](a4_0x51c2cf[_0xa15064(0x143)](_0xa15064(0xf4)+_0x595318[_0xa15064(0x151)]+'\x20successfully')),console[_0xa15064(0x107)](_0xa15064(0xee)+_0x595318[_0xa15064(0x139)]);if(_0x595318[_0xa15064(0x14c)]&&_0x595318['projectId']){const _0x2e872f=getLLMAgentChatUrl(_0xa0d8eb,_0x595318[_0xa15064(0xcc)],_0x595318[_0xa15064(0x14c)]);console[_0xa15064(0x107)]('Chat:\x20'+a4_0x51c2cf[_0xa15064(0x173)](_0x2e872f));}return 0x0;}const _0x5cbde6=_0x289da7[_0xa15064(0x171)],_0x5c94b2=resolveProjectFromContext(_0x266cd0,_0x5cbde6);if(_0x5c94b2[_0xa15064(0xea)])_0x266cd0=_0x5c94b2['projectDir'],_0x5c94b2[_0xa15064(0x182)]===_0xa15064(0xf5)&&console[_0xa15064(0x107)](a4_0x51c2cf[_0xa15064(0x114)]('Using\x20project:\x20'+_0x266cd0));else{let _0x2f59d9=_0xa15064(0x111);_0x5c94b2['reason']===_0xa15064(0x112)&&(_0x2f59d9=_0x5c94b2[_0xa15064(0x15c)]+_0xa15064(0x11c)+_0x5c94b2['llmProject']+_0xa15064(0xd9));throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x5c94b2['reason']==='no_context'?_0x5c94b2['message']:_0xa15064(0xe6)+_0x266cd0,undefined,{'helpText':_0x2f59d9});}const {data:_0x2e1155}=await withSpinner(_0xa15064(0x117),()=>_0x4bbb0f[_0xa15064(0xe3)][_0xa15064(0x17f)](_0x266cd0,{'dryRun':!![]})),_0x1995dc=_0x2e1155[_0xa15064(0x150)][_0xa15064(0x145)][_0xa15064(0x13a)]>0x0;if(_0x1995dc){console[_0xa15064(0x107)](a4_0x51c2cf[_0xa15064(0x126)](_0xa15064(0x11d)));for(const _0x135202 of _0x2e1155[_0xa15064(0x145)]){_0x135202[_0xa15064(0x151)]==='error'&&console[_0xa15064(0x107)](a4_0x51c2cf['red'](_0xa15064(0x161)+_0x135202[_0xa15064(0x139)]+_0xa15064(0x140)+_0x135202[_0xa15064(0x164)]));}return 0x1;}const _0x12e7f1=_0x2e1155[_0xa15064(0x150)][_0xa15064(0x145)][_0xa15064(0x122)]+_0x2e1155[_0xa15064(0x150)][_0xa15064(0x185)]['created']+_0x2e1155[_0xa15064(0x150)][_0xa15064(0x154)]['created']+_0x2e1155[_0xa15064(0x150)]['prompts']['created']+_0x2e1155['counts'][_0xa15064(0x12f)][_0xa15064(0x122)]+_0x2e1155[_0xa15064(0x150)][_0xa15064(0x13b)][_0xa15064(0x122)]+_0x2e1155[_0xa15064(0x150)][_0xa15064(0xe7)]['created']+_0x2e1155['counts']['formInterfaces'][_0xa15064(0x122)]+_0x2e1155[_0xa15064(0x150)][_0xa15064(0x184)][_0xa15064(0x122)],_0x55172a=_0x2e1155[_0xa15064(0x150)][_0xa15064(0x145)][_0xa15064(0x116)]+_0x2e1155['counts'][_0xa15064(0x185)][_0xa15064(0x116)]+_0x2e1155[_0xa15064(0x150)][_0xa15064(0x154)][_0xa15064(0x116)]+_0x2e1155[_0xa15064(0x150)]['prompts'][_0xa15064(0x116)]+_0x2e1155['counts'][_0xa15064(0x12f)][_0xa15064(0x116)]+_0x2e1155[_0xa15064(0x150)]['experimentalKnowledgeBases'][_0xa15064(0x116)]+_0x2e1155[_0xa15064(0x150)][_0xa15064(0xe7)][_0xa15064(0x116)]+_0x2e1155[_0xa15064(0x150)][_0xa15064(0x16c)][_0xa15064(0x116)]+_0x2e1155['counts'][_0xa15064(0x184)][_0xa15064(0x116)],_0x3d0808=_0x2e1155[_0xa15064(0x150)][_0xa15064(0x145)][_0xa15064(0x10a)]+_0x2e1155['counts'][_0xa15064(0x185)]['unchanged']+_0x2e1155['counts'][_0xa15064(0x154)][_0xa15064(0x10a)]+_0x2e1155['counts'][_0xa15064(0x13e)]['unchanged']+_0x2e1155[_0xa15064(0x150)][_0xa15064(0x12f)][_0xa15064(0x10a)]+_0x2e1155[_0xa15064(0x150)][_0xa15064(0x13b)][_0xa15064(0x10a)]+_0x2e1155['counts'][_0xa15064(0xe7)][_0xa15064(0x10a)]+_0x2e1155[_0xa15064(0x150)][_0xa15064(0x16c)]['unchanged']+_0x2e1155['counts'][_0xa15064(0x184)][_0xa15064(0x10a)];console[_0xa15064(0x107)](_0xa15064(0x11a)+_0x2e1155['projectName']+'\x27:'),console['log']('\x20\x20'+a4_0x51c2cf['green']('+\x20'+_0x12e7f1+_0xa15064(0xef))+'\x20|\x20'+a4_0x51c2cf['yellow']('~\x20'+_0x55172a+_0xa15064(0xdf))+_0xa15064(0xe0)+a4_0x51c2cf[_0xa15064(0x114)]('=\x20'+_0x3d0808+_0xa15064(0x133))),console['log'](_0xa15064(0xfb)+formatCountSummary(_0x2e1155['counts'][_0xa15064(0x145)])),console['log']('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x2e1155[_0xa15064(0x150)]['knowledgeBases'])),console['log'](_0xa15064(0x16b)+formatCountSummary(_0x2e1155[_0xa15064(0x150)][_0xa15064(0x154)])),console['log'](_0xa15064(0xce)+formatCountSummary(_0x2e1155[_0xa15064(0x150)][_0xa15064(0x13e)])),console[_0xa15064(0x107)](_0xa15064(0xd5)+formatCountSummary(_0x2e1155[_0xa15064(0x150)]['integrations'])),console[_0xa15064(0x107)](_0xa15064(0x167)+formatCountSummary(_0x2e1155[_0xa15064(0x150)][_0xa15064(0x16c)])),console[_0xa15064(0x107)](_0xa15064(0x160)+formatCountSummary(_0x2e1155[_0xa15064(0x150)][_0xa15064(0x184)]));const _0x2008c1=_0x2e1155['counts'][_0xa15064(0x13b)][_0xa15064(0x122)]>0x0||_0x2e1155[_0xa15064(0x150)][_0xa15064(0x13b)]['updated']>0x0||_0x2e1155['counts'][_0xa15064(0x13b)][_0xa15064(0x10a)]>0x0||_0x2e1155[_0xa15064(0x150)][_0xa15064(0xe7)][_0xa15064(0x122)]>0x0||_0x2e1155[_0xa15064(0x150)][_0xa15064(0xe7)]['updated']>0x0||_0x2e1155['counts']['experimentalArtifacts']['unchanged']>0x0;_0x2008c1&&(console['log']('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x2e1155[_0xa15064(0x150)]['experimentalKnowledgeBases'])),console[_0xa15064(0x107)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x2e1155[_0xa15064(0x150)][_0xa15064(0xe7)])));console[_0xa15064(0x107)](_0xa15064(0xd4)+a4_0x51c2cf[_0xa15064(0x173)](_0x266cd0)),displayDiffs(_0x2e1155[_0xa15064(0x145)],_0x2e1155[_0xa15064(0x185)],_0x2e1155[_0xa15064(0x154)],_0x2e1155[_0xa15064(0x13e)],_0x2e1155[_0xa15064(0x12f)],_0x2e1155[_0xa15064(0x13b)],_0x2e1155[_0xa15064(0xe7)],_0x2e1155[_0xa15064(0x16c)],_0x2e1155[_0xa15064(0x184)]);if(_0x5b6802)return console[_0xa15064(0x107)](a4_0x51c2cf[_0xa15064(0xcf)](_0xa15064(0x142))),0x0;if(_0x12e7f1===0x0&&_0x55172a===0x0){console[_0xa15064(0x107)](a4_0x51c2cf[_0xa15064(0x143)](_0xa15064(0x12e)));const _0x2d2241=getLLMProjectUrl(_0xa0d8eb,_0x2e1155['projectId']);return console[_0xa15064(0x107)](_0xa15064(0x113)+a4_0x51c2cf[_0xa15064(0x173)](_0x2d2241)),0x0;}if(!_0x504671&&!_0x53c1bc){if(!isInteractive())return console[_0xa15064(0x164)](a4_0x51c2cf['red'](_0xa15064(0x101)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0xa15064(0x164)](a4_0x51c2cf[_0xa15064(0x114)](_0xa15064(0xf6))),0x1;const _0x34ad80=await confirmKey('\x0aPush\x20'+(_0x12e7f1+_0x55172a)+_0xa15064(0x100));if(!_0x34ad80)return console[_0xa15064(0x107)](a4_0x51c2cf['yellow'](_0xa15064(0xfd)),_0xa15064(0xe8)),0x1;}const {data:_0x218aea}=await withSpinner(_0xa15064(0x174),()=>_0x4bbb0f[_0xa15064(0xe3)]['pushProject'](_0x266cd0,{'force':_0x53c1bc})),_0x44c30f=_0x218aea[_0xa15064(0x150)]['agents'][_0xa15064(0x13a)]>0x0||_0x218aea[_0xa15064(0x150)][_0xa15064(0x185)][_0xa15064(0x13a)]>0x0||_0x218aea['counts'][_0xa15064(0x154)]['errors']>0x0||_0x218aea['counts'][_0xa15064(0x13e)][_0xa15064(0x13a)]>0x0||_0x218aea[_0xa15064(0x150)]['formInterfaces'][_0xa15064(0x13a)]>0x0||_0x218aea[_0xa15064(0x150)][_0xa15064(0x184)][_0xa15064(0x13a)]>0x0;if(_0x44c30f){console[_0xa15064(0x107)](a4_0x51c2cf[_0xa15064(0xcf)](_0xa15064(0x187))),console['log'](),console[_0xa15064(0x107)](a4_0x51c2cf[_0xa15064(0x126)](_0xa15064(0x125)));for(const _0x1f6261 of _0x218aea[_0xa15064(0x145)]){_0x1f6261[_0xa15064(0x151)]===_0xa15064(0x164)&&console['log'](a4_0x51c2cf[_0xa15064(0x126)](_0xa15064(0x161)+_0x1f6261['agentName']+_0xa15064(0x140)+_0x1f6261[_0xa15064(0x164)]));}for(const _0x3ca4f5 of _0x218aea['knowledgeBases']){_0x3ca4f5[_0xa15064(0x151)]===_0xa15064(0x164)&&console[_0xa15064(0x107)](a4_0x51c2cf[_0xa15064(0x126)](_0xa15064(0x15f)+_0x3ca4f5[_0xa15064(0x14f)]+_0xa15064(0x140)+_0x3ca4f5[_0xa15064(0x164)]));}for(const _0x2c72f7 of _0x218aea['textKnowledgeBases']){_0x2c72f7[_0xa15064(0x151)]===_0xa15064(0x164)&&console[_0xa15064(0x107)](a4_0x51c2cf[_0xa15064(0x126)]('\x20\x20Text\x20Knowledge\x20Base\x20\x22'+_0x2c72f7[_0xa15064(0x14f)]+_0xa15064(0x140)+_0x2c72f7[_0xa15064(0x164)]));}for(const _0x52475f of _0x218aea[_0xa15064(0x13e)]){_0x52475f[_0xa15064(0x151)]===_0xa15064(0x164)&&console['log'](a4_0x51c2cf[_0xa15064(0x126)](_0xa15064(0xcd)+_0x52475f[_0xa15064(0x14f)]+_0xa15064(0x140)+_0x52475f['error']));}for(const _0xf4471b of _0x218aea[_0xa15064(0x12f)]){_0xf4471b['action']===_0xa15064(0x164)&&console[_0xa15064(0x107)](a4_0x51c2cf[_0xa15064(0x126)]('\x20\x20Integration\x20\x22'+_0xf4471b['name']+_0xa15064(0x140)+_0xf4471b[_0xa15064(0x164)]));}for(const _0x57b926 of _0x218aea[_0xa15064(0x16c)]){_0x57b926[_0xa15064(0x151)]===_0xa15064(0x164)&&console[_0xa15064(0x107)](a4_0x51c2cf[_0xa15064(0x126)](_0xa15064(0x12c)+_0x57b926[_0xa15064(0x14f)]+_0xa15064(0x140)+_0x57b926['error']));}for(const _0x22f069 of _0x218aea[_0xa15064(0x184)]){_0x22f069['action']==='error'&&console[_0xa15064(0x107)](a4_0x51c2cf['red'](_0xa15064(0x15e)+_0x22f069[_0xa15064(0x14f)]+_0xa15064(0x140)+_0x22f069[_0xa15064(0x164)]));}return 0x1;}console[_0xa15064(0x107)](a4_0x51c2cf[_0xa15064(0x143)](_0xa15064(0x13c)+(_0x12e7f1+_0x55172a)+_0xa15064(0x14a)+_0x218aea[_0xa15064(0x17e)]+'\x27'));const _0x570737=getLLMProjectUrl(_0xa0d8eb,_0x218aea['projectId']);return console[_0xa15064(0x107)](_0xa15064(0x113)+a4_0x51c2cf[_0xa15064(0x173)](_0x570737)),0x0;}}
|
|
1
|
+
function a4_0xc744(){const _0x2c1e42=['dirname','experimentalArtifacts','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','pullProject','agent:pull','error','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','\x20--name\x20','MISSING_ARGUMENT','agent:clone','\x20\x20Prompts:\x20','Using\x20context\x20project:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20<agent>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20project','Chat:\x20','\x20\x20Agents:\x20','Dry\x20run\x20-\x20no\x20files\x20written','execute','23895oCPTJq','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','knowledgeBases','site','\x22\x20to\x20a\x20different\x20profile','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','Would\x20push\x20agent:\x20','sourceProjectName','INVALID_ARGUMENT','Analyzing\x20changes\x20to\x20push...','\x20--profile\x20','Writing\x20files...','\x20\x20Form\x20Interface\x20\x22','<new-name>','projectDir','Using\x20local\x20project:\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','message','isNew','\x20|\x20','\x0aChanges:','Cannot\x20clone\x20from\x20context\x20project\x20\x22','agents','total','session','\x20\x20Integrations:\x20','errors','newProjectId','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20\x20Knowledge\x20Bases:\x20','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','dryRun','pushAgent','\x20errors','\x20\x20tdx\x20agent\x20pull\x20','no_context','updated','Summary:','\x0aErrors\x20found:','push','agent','\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory','New\x20project:\x20','23459220byCNbH','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','prompts','Using\x20project\x20from\x20context:\x20','chatInterfaces','New\x20project\x20ID:\x20','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','Dry\x20run\x20-\x20no\x20changes\x20made','\x0aPush\x20','arg-dir','cwd-config','\x20\x20Form\x20Interfaces:\x20','textKnowledgeBases','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x20\x20Integration\x20\x22','cyan','outputDir','\x20\x20Agent\x20\x22','agent.yml','yellow','\x0aChanges\x20to\x20chat\x20interface\x20\x27','no_local_folder','4575186YadLZP','\x20files\x20to\x20','\x0aChanges\x20to\x20prompt\x20\x27','Status:\x20','232jJJesz','red','\x22\x20from\x20project\x20\x22','name','\x20resources\x20to\x20\x27','Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)','counts','\x0aPull\x20summary\x20for\x20\x27','newProjectName','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','\x20\x20Knowledge\x20Base\x20\x22','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','cloneProject','gray','Pulling\x20agent\x20\x22','\x20\x20Target:\x20','\x22...','context','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\x0a✔\x20Pushed\x20','output','description','196944mWybvY','Project:\x20','\x20files?','integrations','\x20created','llmProject','\x20\x20Text\x20Knowledge\x20Base\x20\x22','Output:\x20','Using\x20project:\x20','\x20\x20Text\x20Knowledge\x20Bases:\x20','Would\x20clone:','created','formInterfaces','Source:\x20','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','Pushing\x20agent\x20from\x20\x22','yes','parse','projectId','✔\x20Context\x20set:\x20','\x20unchanged','\x22\x20to\x20new\x20project\x20\x22','6098625aouMDO','agentName','\x22:\x20','diff','log','agentId','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','green','llm','\x20\x20Chat\x20Interfaces:\x20','hasChanges','\x20changed','repeat','action','\x20\x20Prompt\x20\x22','Errors:','unchanged','\x20\x20Experimental\x20Artifacts:\x20','\x0aPush\x20summary\x20for\x20\x27','\x0aWrite\x20','\x0a✔\x20Pulled\x20','utf-8','\x20\x20tdx\x20agent\x20clone\x20agents/','cwd','tdx.json','\x20\x20Experimental\x20Artifact\x20\x22','\x0aChanges\x20to\x20integration\x20\x27','Would\x20pull\x20agent:\x20','-\x20no\x20files\x20written','\x20=\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','\x20updated','Failed\x20to\x20push\x20agent:\x20','profile','\x0aChanges\x20to\x20form\x20interface\x20\x27','\x20new','\x20resources?','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','projectName','New\x20project\x20name\x20is\x20required','108mcBLvP','pushProject','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed','Clone\x20\x22','664127eTFMwR','experimentalKnowledgeBases','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','\x0aProject\x20pushed\x20with\x20errors','join','llm_project','39354ojcrtH','pullAgent','outputPath','reason','Agent:\x20','new','Cancelled','force','2LSVROV','\x20\x20Chat\x20Interface\x20\x22','dim','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Output\x20path:\x20','-\x20nothing\x20pushed'];a4_0xc744=function(){return _0x2c1e42;};return a4_0xc744();}const a4_0x47b8d4=a4_0x2003;(function(_0x1f6893,_0x2a516e){const _0x2883cf=a4_0x2003,_0x2873e0=_0x1f6893();while(!![]){try{const _0x2e1d8e=-parseInt(_0x2883cf(0xf0))/0x1+-parseInt(_0x2883cf(0xfe))/0x2*(parseInt(_0x2883cf(0xae))/0x3)+parseInt(_0x2883cf(0xec))/0x4*(parseInt(_0x2883cf(0x115))/0x5)+-parseInt(_0x2883cf(0x94))/0x6+-parseInt(_0x2883cf(0xf6))/0x7*(-parseInt(_0x2883cf(0x98))/0x8)+-parseInt(_0x2883cf(0xc4))/0x9+parseInt(_0x2883cf(0x7d))/0xa;if(_0x2e1d8e===_0x2a516e)break;else _0x2873e0['push'](_0x2873e0['shift']());}catch(_0x10b161){_0x2873e0['push'](_0x2873e0['shift']());}}}(a4_0xc744,0x7245e));import a4_0x4e43e9 from'chalk';import a4_0x1dc0a1 from'path';import{existsSync,readFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{withSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{findAgentConfigPath,resolveProjectFromContext,resolveAgentPullArgs}from'../sdk/agent/agent-config.js';import{saveSessionContext}from'../core/session.js';import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x1fef8a){const _0x1d3573=a4_0x2003,_0x951a17=[];if(_0x1fef8a['total']!==undefined)_0x951a17['push'](_0x1fef8a[_0x1d3573(0x69)]+'\x20total');if(_0x1fef8a[_0x1d3573(0xfb)]!==undefined&&_0x1fef8a[_0x1d3573(0xfb)]>0x0)_0x951a17[_0x1d3573(0x79)](a4_0x4e43e9[_0x1d3573(0xcb)](_0x1fef8a[_0x1d3573(0xfb)]+_0x1d3573(0xe7)));if(_0x1fef8a['created']!==undefined&&_0x1fef8a['created']>0x0)_0x951a17[_0x1d3573(0x79)](a4_0x4e43e9[_0x1d3573(0xcb)](_0x1fef8a['created']+_0x1d3573(0xb2)));if(_0x1fef8a[_0x1d3573(0x76)]!==undefined&&_0x1fef8a[_0x1d3573(0x76)]>0x0)_0x951a17[_0x1d3573(0x79)](a4_0x4e43e9[_0x1d3573(0x91)](_0x1fef8a[_0x1d3573(0x76)]+_0x1d3573(0xe3)));if(_0x1fef8a[_0x1d3573(0xd4)]!==undefined&&_0x1fef8a['unchanged']>0x0)_0x951a17[_0x1d3573(0x79)](a4_0x4e43e9[_0x1d3573(0xa5)](_0x1fef8a[_0x1d3573(0xd4)]+'\x20unchanged'));if(_0x1fef8a[_0x1d3573(0x6c)]!==undefined&&_0x1fef8a['errors']>0x0)_0x951a17[_0x1d3573(0x79)](a4_0x4e43e9[_0x1d3573(0x99)](_0x1fef8a['errors']+_0x1d3573(0x73)));return _0x951a17[_0x1d3573(0xf4)](',\x20');}function displayDiffs(_0x389642,_0xea1730,_0x39cc86,_0xae70db,_0x2734a3,_0x44f770,_0xd25f0,_0x35fab0,_0x4bccb0){const _0xc1049f=a4_0x2003;for(const _0x3b8cb5 of _0x389642){if(_0x3b8cb5[_0xc1049f(0xc7)]){const _0x452952=_0x3b8cb5['agentName']||_0x3b8cb5[_0xc1049f(0x9b)];console[_0xc1049f(0xc8)]('\x0aChanges\x20to\x20agent\x20\x27'+_0x452952+'\x27:'),console['log']('─'[_0xc1049f(0xd0)](0x3c)),console[_0xc1049f(0xc8)](_0x3b8cb5['diff']),console[_0xc1049f(0xc8)]('─'[_0xc1049f(0xd0)](0x3c));}}for(const _0x57be43 of _0xea1730){_0x57be43[_0xc1049f(0xc7)]&&(console[_0xc1049f(0xc8)](_0xc1049f(0x83)+_0x57be43['name']+'\x27:'),console[_0xc1049f(0xc8)]('─'[_0xc1049f(0xd0)](0x3c)),console[_0xc1049f(0xc8)](_0x57be43[_0xc1049f(0xc7)]),console['log']('─'['repeat'](0x3c)));}for(const _0x57e549 of _0x39cc86){_0x57e549[_0xc1049f(0xc7)]&&(console['log']('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x57e549[_0xc1049f(0x9b)]+'\x27:'),console[_0xc1049f(0xc8)]('─'[_0xc1049f(0xd0)](0x3c)),console[_0xc1049f(0xc8)](_0x57e549['diff']),console[_0xc1049f(0xc8)]('─'[_0xc1049f(0xd0)](0x3c)));}for(const _0x591e63 of _0xae70db){_0x591e63[_0xc1049f(0xc7)]&&(console[_0xc1049f(0xc8)](_0xc1049f(0x96)+_0x591e63[_0xc1049f(0x9b)]+'\x27:'),console[_0xc1049f(0xc8)]('─'[_0xc1049f(0xd0)](0x3c)),console['log'](_0x591e63[_0xc1049f(0xc7)]),console[_0xc1049f(0xc8)]('─'[_0xc1049f(0xd0)](0x3c)));}for(const _0x49337d of _0x2734a3){_0x49337d[_0xc1049f(0xc7)]&&(console['log'](_0xc1049f(0xde)+_0x49337d[_0xc1049f(0x9b)]+'\x27:'),console[_0xc1049f(0xc8)]('─'['repeat'](0x3c)),console[_0xc1049f(0xc8)](_0x49337d[_0xc1049f(0xc7)]),console['log']('─'[_0xc1049f(0xd0)](0x3c)));}for(const _0x1cc7c2 of _0x44f770){_0x1cc7c2[_0xc1049f(0xc7)]&&(console['log'](_0xc1049f(0x70)+_0x1cc7c2[_0xc1049f(0x9b)]+'\x27:'),console[_0xc1049f(0xc8)]('─'['repeat'](0x3c)),console[_0xc1049f(0xc8)](_0x1cc7c2[_0xc1049f(0xc7)]),console[_0xc1049f(0xc8)]('─'[_0xc1049f(0xd0)](0x3c)));}for(const _0x4e69df of _0xd25f0){_0x4e69df[_0xc1049f(0xc7)]&&(console[_0xc1049f(0xc8)]('\x0aChanges\x20to\x20experimental\x20artifact\x20\x27'+_0x4e69df[_0xc1049f(0x9b)]+'\x27:'),console[_0xc1049f(0xc8)]('─'[_0xc1049f(0xd0)](0x3c)),console['log'](_0x4e69df[_0xc1049f(0xc7)]),console['log']('─'[_0xc1049f(0xd0)](0x3c)));}for(const _0x104844 of _0x35fab0){_0x104844[_0xc1049f(0xc7)]&&(console['log'](_0xc1049f(0xe6)+_0x104844[_0xc1049f(0x9b)]+'\x27:'),console[_0xc1049f(0xc8)]('─'['repeat'](0x3c)),console['log'](_0x104844['diff']),console[_0xc1049f(0xc8)]('─'[_0xc1049f(0xd0)](0x3c)));}for(const _0x1ac9a1 of _0x4bccb0){_0x1ac9a1[_0xc1049f(0xc7)]&&(console[_0xc1049f(0xc8)](_0xc1049f(0x92)+_0x1ac9a1['name']+'\x27:'),console[_0xc1049f(0xc8)]('─'[_0xc1049f(0xd0)](0x3c)),console[_0xc1049f(0xc8)](_0x1ac9a1[_0xc1049f(0xc7)]),console[_0xc1049f(0xc8)]('─'[_0xc1049f(0xd0)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x47b8d4(0x9b)]=a4_0x47b8d4(0x108);[a4_0x47b8d4(0xad)]=a4_0x47b8d4(0xca);async['execute'](_0x71fec4){const _0x39484f=a4_0x47b8d4,{options:_0x51cede,args:_0x424893,tdx:_0x31b9c4}=_0x71fec4,_0x430e62=_0x424893[0x0],_0x2a5704=_0x424893[0x1],_0x5759b6=_0x51cede[_0x39484f(0xac)],_0x47c4ec=_0x51cede[_0x39484f(0x71)],_0x522ef3=_0x51cede[_0x39484f(0xfd)],_0x61365a=_0x51cede[_0x39484f(0xbe)],_0x245995=_0x51cede[_0x39484f(0xb3)],_0x54528c=_0x51cede[_0x39484f(0x7a)];let _0x328321;if(_0x430e62){const _0x3e8858=a4_0x1dc0a1[_0x39484f(0xf4)](_0x430e62,_0x39484f(0xdc));if(existsSync(_0x3e8858))try{const _0x5c5d84=JSON[_0x39484f(0xbf)](readFileSync(_0x3e8858,_0x39484f(0xd9)));_0x5c5d84[_0x39484f(0xf5)]&&(_0x328321={'llm_project':_0x5c5d84[_0x39484f(0xf5)]});}catch{}}const _0x3d99b8=findAgentConfigPath(process[_0x39484f(0xdb)]());let _0x2439e6;if(_0x3d99b8)try{const _0x5ddf4c=JSON[_0x39484f(0xbf)](readFileSync(_0x3d99b8,'utf-8'));_0x5ddf4c[_0x39484f(0xf5)]&&(_0x2439e6={'llm_project':_0x5ddf4c[_0x39484f(0xf5)]});}catch{}const _0x18fe4b=resolveAgentPullArgs({'arg':_0x430e62,'agentNameArg':_0x2a5704,'agentFlag':_0x54528c,'contextProject':_0x245995,'argDirConfig':_0x328321,'cwdConfigPath':_0x3d99b8||undefined,'cwdConfig':_0x2439e6}),{projectNameOrId:_0x271d18,targetAgentName:_0x12c88a,existingOutputDir:_0x1e21c3,source:_0x380986}=_0x18fe4b;if(_0x380986===_0x39484f(0x87))console[_0x39484f(0xc8)](a4_0x4e43e9['dim']('Using\x20project\x20from\x20'+a4_0x1dc0a1[_0x39484f(0xf4)](_0x430e62,_0x39484f(0xdc))+':\x20'+_0x271d18));else{if(_0x380986===_0x39484f(0x88))console['log'](a4_0x4e43e9[_0x39484f(0x100)](_0x39484f(0xb6)+_0x271d18));else _0x380986===_0x39484f(0xa9)&&console['log'](a4_0x4e43e9[_0x39484f(0x100)](_0x39484f(0x80)+_0x271d18));}if(!_0x271d18)return _0x54528c?(console[_0x39484f(0xc8)](a4_0x4e43e9[_0x39484f(0x91)](_0x39484f(0xa3))),console['log']('Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>'),console[_0x39484f(0xc8)]('Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>')):(console[_0x39484f(0xc8)](a4_0x4e43e9[_0x39484f(0x91)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x39484f(0xc8)](_0x39484f(0x9d)),console[_0x39484f(0xc8)](_0x39484f(0xe2)),console['log']('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory'),console[_0x39484f(0xc8)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20--agent\x20<name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20agent\x20from\x20context\x20project'),console[_0x39484f(0xc8)](_0x39484f(0x110))),0x1;if(_0x12c88a){const {data:_0x40d1ba}=await withSpinner(_0x39484f(0xa6)+_0x12c88a+_0x39484f(0x9a)+_0x271d18+_0x39484f(0xa8),()=>_0x31b9c4[_0x39484f(0xcc)][_0x39484f(0xf7)](_0x271d18,_0x12c88a,_0x5759b6,{'dryRun':_0x47c4ec,'force':_0x522ef3}));if(_0x47c4ec)return console[_0x39484f(0xc8)](a4_0x4e43e9[_0x39484f(0x91)](_0x39484f(0x113))),console['log'](_0x39484f(0xdf)+_0x40d1ba['agentName']),console[_0x39484f(0xc8)](_0x39484f(0x102)+_0x40d1ba[_0x39484f(0xf8)]),_0x40d1ba[_0x39484f(0xc7)]&&(console[_0x39484f(0xc8)](_0x39484f(0x66)),console[_0x39484f(0xc8)]('─'[_0x39484f(0xd0)](0x3c)),console[_0x39484f(0xc8)](_0x40d1ba[_0x39484f(0xc7)]),console['log']('─'[_0x39484f(0xd0)](0x3c))),0x0;return console[_0x39484f(0xc8)](a4_0x4e43e9['green']('Agent\x20pulled\x20successfully')),console['log'](_0x39484f(0xfa)+_0x40d1ba['agentName']),console['log'](_0x39484f(0xb5)+_0x40d1ba[_0x39484f(0xf8)]),console[_0x39484f(0xc8)](_0x39484f(0x97)+(_0x40d1ba[_0x39484f(0x128)]?a4_0x4e43e9['green'](_0x39484f(0xfb)):_0x40d1ba[_0x39484f(0xce)]?a4_0x4e43e9[_0x39484f(0x91)](_0x39484f(0x76)):a4_0x4e43e9[_0x39484f(0xa5)](_0x39484f(0xd4)))),0x0;}const _0x7019e8=_0x1e21c3||_0x5759b6,{data:_0x5589d4}=await withSpinner('Analyzing\x20project\x20\x22'+_0x271d18+'\x22...',()=>_0x31b9c4[_0x39484f(0xcc)][_0x39484f(0x107)](_0x271d18,_0x7019e8,{'dryRun':!![]})),_0x271fc3=_0x5589d4[_0x39484f(0x9e)]['agents']['new']+_0x5589d4['counts'][_0x39484f(0x118)][_0x39484f(0xfb)]+_0x5589d4['counts'][_0x39484f(0x8a)][_0x39484f(0xfb)]+_0x5589d4[_0x39484f(0x9e)][_0x39484f(0x7f)][_0x39484f(0xfb)]+_0x5589d4[_0x39484f(0x9e)]['integrations'][_0x39484f(0xfb)]+_0x5589d4['counts'][_0x39484f(0xf1)][_0x39484f(0xfb)]+_0x5589d4[_0x39484f(0x9e)][_0x39484f(0x105)]['new']+_0x5589d4[_0x39484f(0x9e)][_0x39484f(0xba)][_0x39484f(0xfb)]+_0x5589d4[_0x39484f(0x9e)][_0x39484f(0x81)]['new'],_0x14ce0b=_0x5589d4[_0x39484f(0x9e)][_0x39484f(0x68)]['updated']+_0x5589d4[_0x39484f(0x9e)][_0x39484f(0x118)][_0x39484f(0x76)]+_0x5589d4['counts']['textKnowledgeBases']['updated']+_0x5589d4[_0x39484f(0x9e)][_0x39484f(0x7f)][_0x39484f(0x76)]+_0x5589d4['counts'][_0x39484f(0xb1)][_0x39484f(0x76)]+_0x5589d4['counts']['experimentalKnowledgeBases'][_0x39484f(0x76)]+_0x5589d4[_0x39484f(0x9e)]['experimentalArtifacts'][_0x39484f(0x76)]+_0x5589d4[_0x39484f(0x9e)]['formInterfaces']['updated']+_0x5589d4[_0x39484f(0x9e)][_0x39484f(0x81)][_0x39484f(0x76)],_0x310353=_0x5589d4[_0x39484f(0x9e)]['agents'][_0x39484f(0xd4)]+_0x5589d4['counts'][_0x39484f(0x118)][_0x39484f(0xd4)]+_0x5589d4[_0x39484f(0x9e)][_0x39484f(0x8a)]['unchanged']+_0x5589d4[_0x39484f(0x9e)][_0x39484f(0x7f)][_0x39484f(0xd4)]+_0x5589d4[_0x39484f(0x9e)][_0x39484f(0xb1)]['unchanged']+_0x5589d4[_0x39484f(0x9e)][_0x39484f(0xf1)]['unchanged']+_0x5589d4[_0x39484f(0x9e)][_0x39484f(0x105)][_0x39484f(0xd4)]+_0x5589d4[_0x39484f(0x9e)][_0x39484f(0xba)][_0x39484f(0xd4)]+_0x5589d4[_0x39484f(0x9e)][_0x39484f(0x81)][_0x39484f(0xd4)];console[_0x39484f(0xc8)](_0x39484f(0x9f)+_0x5589d4[_0x39484f(0xea)]+'\x27:'),console[_0x39484f(0xc8)]('\x20\x20'+a4_0x4e43e9[_0x39484f(0xcb)]('+\x20'+_0x271fc3+_0x39484f(0xe7))+'\x20|\x20'+a4_0x4e43e9['yellow']('~\x20'+_0x14ce0b+_0x39484f(0xcf))+'\x20|\x20'+a4_0x4e43e9[_0x39484f(0x100)]('=\x20'+_0x310353+_0x39484f(0xc2))),console[_0x39484f(0xc8)]('\x20\x20Agents:\x20'+formatCountSummary(_0x5589d4[_0x39484f(0x9e)][_0x39484f(0x68)])),console[_0x39484f(0xc8)](_0x39484f(0x6f)+formatCountSummary(_0x5589d4[_0x39484f(0x9e)][_0x39484f(0x118)])),console['log'](_0x39484f(0xb7)+formatCountSummary(_0x5589d4[_0x39484f(0x9e)]['textKnowledgeBases'])),console[_0x39484f(0xc8)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x5589d4[_0x39484f(0x9e)][_0x39484f(0x7f)])),console['log']('\x20\x20Integrations:\x20'+formatCountSummary(_0x5589d4[_0x39484f(0x9e)][_0x39484f(0xb1)])),console[_0x39484f(0xc8)](_0x39484f(0x89)+formatCountSummary(_0x5589d4[_0x39484f(0x9e)][_0x39484f(0xba)])),console[_0x39484f(0xc8)](_0x39484f(0xcd)+formatCountSummary(_0x5589d4['counts'][_0x39484f(0x81)]));const _0x4e5fd7=_0x5589d4[_0x39484f(0x9e)][_0x39484f(0xf1)]['total']>0x0||_0x5589d4[_0x39484f(0x9e)][_0x39484f(0x105)][_0x39484f(0x69)]>0x0;_0x4e5fd7&&(console[_0x39484f(0xc8)](_0x39484f(0xe9)+formatCountSummary(_0x5589d4[_0x39484f(0x9e)][_0x39484f(0xf1)])),console[_0x39484f(0xc8)](_0x39484f(0xd5)+formatCountSummary(_0x5589d4['counts'][_0x39484f(0x105)])));console[_0x39484f(0xc8)](_0x39484f(0xa7)+a4_0x4e43e9['cyan'](_0x5589d4['outputDir'])),displayDiffs(_0x5589d4['agents'],_0x5589d4[_0x39484f(0x118)],_0x5589d4[_0x39484f(0x8a)],_0x5589d4[_0x39484f(0x7f)],_0x5589d4['integrations'],_0x5589d4[_0x39484f(0xf1)],_0x5589d4[_0x39484f(0x105)],_0x5589d4[_0x39484f(0xba)],_0x5589d4['chatInterfaces']);if(_0x47c4ec)return console[_0x39484f(0xc8)](a4_0x4e43e9['yellow'](_0x39484f(0x117))),0x0;if(_0x271fc3===0x0&&_0x14ce0b===0x0)return console[_0x39484f(0xc8)](a4_0x4e43e9['green'](_0x39484f(0xf2))),saveSessionContext({'llm_project':_0x5589d4['projectName']},_0x51cede[_0x39484f(0x6a)]),console[_0x39484f(0xc8)](a4_0x4e43e9[_0x39484f(0xcb)](_0x39484f(0xc1)+a4_0x4e43e9[_0x39484f(0x100)](_0x39484f(0xf5))+_0x39484f(0xe1)+a4_0x4e43e9[_0x39484f(0x8d)](_0x5589d4[_0x39484f(0xea)]))),0x0;if(!_0x61365a&&!_0x522ef3){if(!isInteractive())return console[_0x39484f(0x109)](a4_0x4e43e9[_0x39484f(0x99)]('\x0aError:'),_0x39484f(0x6e)),console[_0x39484f(0x109)](a4_0x4e43e9['dim'](_0x39484f(0x116))),0x1;const _0x45e438=await confirmKey(_0x39484f(0xd7)+(_0x271fc3+_0x14ce0b)+_0x39484f(0xb0));if(!_0x45e438)return console['log'](a4_0x4e43e9[_0x39484f(0x91)](_0x39484f(0xfc)),_0x39484f(0xe0)),0x1;}const {data:_0x2ace84}=await withSpinner(_0x39484f(0x121),()=>_0x31b9c4[_0x39484f(0xcc)][_0x39484f(0x107)](_0x271d18,_0x7019e8,{'force':_0x522ef3}));return console[_0x39484f(0xc8)](a4_0x4e43e9[_0x39484f(0xcb)](_0x39484f(0xd8)+(_0x271fc3+_0x14ce0b)+_0x39484f(0x95)+_0x2ace84[_0x39484f(0x8e)])),saveSessionContext({'llm_project':_0x2ace84[_0x39484f(0xea)]},_0x51cede[_0x39484f(0x6a)]),console['log'](a4_0x4e43e9[_0x39484f(0xcb)](_0x39484f(0xc1)+a4_0x4e43e9[_0x39484f(0x100)](_0x39484f(0xf5))+_0x39484f(0xe1)+a4_0x4e43e9[_0x39484f(0x8d)](_0x2ace84[_0x39484f(0xea)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x47b8d4(0x9b)]=a4_0x47b8d4(0x10d);[a4_0x47b8d4(0xad)]=a4_0x47b8d4(0x11b);async[a4_0x47b8d4(0x114)](_0x23cf20){const _0x4b611d=a4_0x47b8d4,{options:_0x246a2b,args:_0x213e51,tdx:_0x3032e9}=_0x23cf20,_0xf3335f=_0x213e51[0x0],_0x6fc69a=_0x246a2b['name'],_0x2c69b6=_0x246a2b[_0x4b611d(0x71)],_0x2a0f2b=_0x246a2b['yes'],_0x26124b=_0x246a2b['site'],_0x4bc8c4=_0x246a2b[_0x4b611d(0xb3)];let _0x24ab6a;const _0x4859ae=findAgentConfigPath(process[_0x4b611d(0xdb)]());if(_0xf3335f){const _0xd78192=a4_0x1dc0a1[_0x4b611d(0xf4)](_0xf3335f,_0x4b611d(0xdc));existsSync(_0xd78192)?(_0x24ab6a=_0xf3335f,console[_0x4b611d(0xc8)](a4_0x4e43e9[_0x4b611d(0x100)](_0x4b611d(0x125)+_0xf3335f))):_0x24ab6a=_0xf3335f;}else{if(_0x4859ae)_0x24ab6a=a4_0x1dc0a1['dirname'](_0x4859ae),console[_0x4b611d(0xc8)](a4_0x4e43e9[_0x4b611d(0x100)]('Using\x20current\x20project:\x20'+_0x24ab6a));else{if(_0x4bc8c4){const _0x12111c=sanitizeForFilesystem(_0x4bc8c4);let _0x27eb5c=_0x12111c,_0x12fe1f=a4_0x1dc0a1[_0x4b611d(0xf4)](process['cwd'](),_0x4b611d(0x68),_0x12111c,_0x4b611d(0xdc));if(!existsSync(_0x12fe1f)){const _0x38e88e=normalizeName(_0x4bc8c4),_0x10a088=a4_0x1dc0a1['join'](process[_0x4b611d(0xdb)](),_0x4b611d(0x68),_0x38e88e,_0x4b611d(0xdc));existsSync(_0x10a088)&&(_0x27eb5c=_0x38e88e,_0x12fe1f=_0x10a088);}if(existsSync(_0x12fe1f))_0x24ab6a=a4_0x1dc0a1[_0x4b611d(0x104)](_0x12fe1f),console[_0x4b611d(0xc8)](a4_0x4e43e9['dim'](_0x4b611d(0x125)+_0x24ab6a));else{const _0x3abd61=_0x246a2b[_0x4b611d(0xe5)];if(_0x3abd61)throw new SDKError(ErrorCode[_0x4b611d(0x11e)],_0x4b611d(0x67)+_0x4bc8c4+_0x4b611d(0x11a),undefined,{'helpText':'When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a'+_0x4b611d(0x10a)+(_0x4b611d(0x74)+_0x4bc8c4+'\x0a')+(_0x4b611d(0xda)+_0x27eb5c+_0x4b611d(0x10b)+(_0x6fc69a||_0x4b611d(0x123))+_0x4b611d(0x120)+_0x3abd61)});_0x24ab6a=_0x4bc8c4,console[_0x4b611d(0xc8)](a4_0x4e43e9[_0x4b611d(0x100)](_0x4b611d(0x10f)+_0x4bc8c4));}}}}if(!_0x24ab6a)return console[_0x4b611d(0xc8)](a4_0x4e43e9[_0x4b611d(0x91)](_0x4b611d(0x7e))),console[_0x4b611d(0xc8)]('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console['log'](_0x4b611d(0x7b)),console[_0x4b611d(0xc8)]('\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)'),console['log'](_0x4b611d(0x101)),0x1;if(!_0x6fc69a)throw new SDKError(ErrorCode[_0x4b611d(0x10c)],_0x4b611d(0xeb),undefined,{'helpText':_0x4b611d(0xbc)});if(!_0x2a0f2b&&!_0x2c69b6){if(!isInteractive())return console[_0x4b611d(0x109)](a4_0x4e43e9['red']('\x0aError:'),_0x4b611d(0x6e)),console[_0x4b611d(0x109)](a4_0x4e43e9['dim'](_0x4b611d(0x116))),0x1;const _0x3a3d14=await confirmKey(_0x4b611d(0xef)+_0x24ab6a+_0x4b611d(0xc3)+_0x6fc69a+'\x22?');if(!_0x3a3d14)return console['log'](a4_0x4e43e9[_0x4b611d(0x91)](_0x4b611d(0xfc))),0x1;}const {data:_0x37dbe7}=await withSpinner('Cloning\x20\x22'+_0x24ab6a+'\x22\x20to\x20\x22'+_0x6fc69a+_0x4b611d(0xa8),()=>_0x3032e9[_0x4b611d(0xcc)][_0x4b611d(0xa4)](_0x24ab6a,_0x6fc69a,{'dryRun':_0x2c69b6}));if(_0x2c69b6){console[_0x4b611d(0xc8)](a4_0x4e43e9[_0x4b611d(0x91)](_0x4b611d(0x85))),console[_0x4b611d(0xc8)](_0x4b611d(0xbb)+_0x37dbe7[_0x4b611d(0x11d)]),console['log'](_0x4b611d(0x7c)+_0x6fc69a),console['log'](_0x4b611d(0xb8)),console[_0x4b611d(0xc8)](_0x4b611d(0x112)+_0x37dbe7[_0x4b611d(0x9e)][_0x4b611d(0x68)][_0x4b611d(0xb9)]),console[_0x4b611d(0xc8)](_0x4b611d(0x6f)+_0x37dbe7['counts'][_0x4b611d(0x118)][_0x4b611d(0xb9)]),console[_0x4b611d(0xc8)](_0x4b611d(0x10e)+_0x37dbe7[_0x4b611d(0x9e)]['prompts'][_0x4b611d(0xb9)]),console[_0x4b611d(0xc8)](_0x4b611d(0x89)+_0x37dbe7[_0x4b611d(0x9e)][_0x4b611d(0xba)][_0x4b611d(0xb9)]),console[_0x4b611d(0xc8)]('\x20\x20Chat\x20Interfaces:\x20'+_0x37dbe7['counts'][_0x4b611d(0x81)][_0x4b611d(0xb9)]);const _0x44d3d6=_0x37dbe7[_0x4b611d(0x9e)][_0x4b611d(0xf1)][_0x4b611d(0xb9)]>0x0||_0x37dbe7[_0x4b611d(0x9e)][_0x4b611d(0x105)][_0x4b611d(0xb9)]>0x0;return _0x44d3d6&&(console[_0x4b611d(0xc8)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+_0x37dbe7['counts']['experimentalKnowledgeBases'][_0x4b611d(0xb9)]),console[_0x4b611d(0xc8)]('\x20\x20Experimental\x20Artifacts:\x20'+_0x37dbe7[_0x4b611d(0x9e)][_0x4b611d(0x105)][_0x4b611d(0xb9)])),0x0;}const _0x379bd5=_0x37dbe7[_0x4b611d(0x9e)][_0x4b611d(0x68)][_0x4b611d(0x6c)]>0x0||_0x37dbe7[_0x4b611d(0x9e)][_0x4b611d(0x118)][_0x4b611d(0x6c)]>0x0||_0x37dbe7[_0x4b611d(0x9e)][_0x4b611d(0x7f)][_0x4b611d(0x6c)]>0x0||_0x37dbe7['counts'][_0x4b611d(0xba)][_0x4b611d(0x6c)]>0x0||_0x37dbe7[_0x4b611d(0x9e)]['chatInterfaces']['errors']>0x0||_0x37dbe7['counts']['experimentalKnowledgeBases']['errors']>0x0||_0x37dbe7[_0x4b611d(0x9e)][_0x4b611d(0x105)][_0x4b611d(0x6c)]>0x0;_0x379bd5?console[_0x4b611d(0xc8)](a4_0x4e43e9['yellow']('Project\x20cloned\x20with\x20errors')):console['log'](a4_0x4e43e9['green']('Project\x20cloned\x20successfully'));console[_0x4b611d(0xc8)](_0x4b611d(0xbb)+_0x37dbe7[_0x4b611d(0x11d)]),console['log']('New\x20project:\x20'+_0x37dbe7[_0x4b611d(0xa0)]),console[_0x4b611d(0xc8)](_0x4b611d(0x82)+_0x37dbe7['newProjectId']),console[_0x4b611d(0xc8)](),console[_0x4b611d(0xc8)](_0x4b611d(0x77)),console['log'](_0x4b611d(0x112)+formatCountSummary(_0x37dbe7['counts']['agents'])),console[_0x4b611d(0xc8)](_0x4b611d(0x6f)+formatCountSummary(_0x37dbe7[_0x4b611d(0x9e)][_0x4b611d(0x118)])),console[_0x4b611d(0xc8)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x37dbe7[_0x4b611d(0x9e)][_0x4b611d(0x7f)])),console[_0x4b611d(0xc8)](_0x4b611d(0x6b)+formatCountSummary(_0x37dbe7[_0x4b611d(0x9e)][_0x4b611d(0xb1)])),console[_0x4b611d(0xc8)](_0x4b611d(0x89)+formatCountSummary(_0x37dbe7['counts'][_0x4b611d(0xba)])),console['log']('\x20\x20Chat\x20Interfaces:\x20'+formatCountSummary(_0x37dbe7[_0x4b611d(0x9e)][_0x4b611d(0x81)]));const _0x4215d4=_0x37dbe7['counts'][_0x4b611d(0xf1)][_0x4b611d(0xb9)]>0x0||_0x37dbe7[_0x4b611d(0x9e)][_0x4b611d(0xf1)][_0x4b611d(0x76)]>0x0||_0x37dbe7[_0x4b611d(0x9e)][_0x4b611d(0xf1)][_0x4b611d(0xd4)]>0x0||_0x37dbe7['counts'][_0x4b611d(0x105)]['created']>0x0||_0x37dbe7[_0x4b611d(0x9e)][_0x4b611d(0x105)][_0x4b611d(0x76)]>0x0||_0x37dbe7['counts'][_0x4b611d(0x105)][_0x4b611d(0xd4)]>0x0;_0x4215d4&&(console[_0x4b611d(0xc8)]('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x37dbe7[_0x4b611d(0x9e)][_0x4b611d(0xf1)])),console[_0x4b611d(0xc8)](_0x4b611d(0xd5)+formatCountSummary(_0x37dbe7['counts']['experimentalArtifacts'])));if(_0x379bd5){console[_0x4b611d(0xc8)](),console[_0x4b611d(0xc8)](a4_0x4e43e9[_0x4b611d(0x99)](_0x4b611d(0xd3)));for(const _0xd3e2c5 of _0x37dbe7[_0x4b611d(0x68)]){_0xd3e2c5[_0x4b611d(0xd1)]===_0x4b611d(0x109)&&console[_0x4b611d(0xc8)](a4_0x4e43e9['red']('\x20\x20Agent\x20\x22'+_0xd3e2c5[_0x4b611d(0xc5)]+_0x4b611d(0xc6)+_0xd3e2c5[_0x4b611d(0x109)]));}for(const _0x4d1b50 of _0x37dbe7[_0x4b611d(0x118)]){_0x4d1b50[_0x4b611d(0xd1)]===_0x4b611d(0x109)&&console[_0x4b611d(0xc8)](a4_0x4e43e9['red']('\x20\x20Knowledge\x20Base\x20\x22'+_0x4d1b50[_0x4b611d(0x9b)]+_0x4b611d(0xc6)+_0x4d1b50['error']));}for(const _0x497fab of _0x37dbe7[_0x4b611d(0x7f)]){_0x497fab['action']===_0x4b611d(0x109)&&console[_0x4b611d(0xc8)](a4_0x4e43e9[_0x4b611d(0x99)]('\x20\x20Prompt\x20\x22'+_0x497fab[_0x4b611d(0x9b)]+_0x4b611d(0xc6)+_0x497fab['error']));}for(const _0x364d89 of _0x37dbe7[_0x4b611d(0xb1)]){_0x364d89[_0x4b611d(0xd1)]===_0x4b611d(0x109)&&console[_0x4b611d(0xc8)](a4_0x4e43e9[_0x4b611d(0x99)](_0x4b611d(0x8c)+_0x364d89[_0x4b611d(0x9b)]+_0x4b611d(0xc6)+_0x364d89[_0x4b611d(0x109)]));}for(const _0x170101 of _0x37dbe7[_0x4b611d(0xba)]){_0x170101[_0x4b611d(0xd1)]===_0x4b611d(0x109)&&console[_0x4b611d(0xc8)](a4_0x4e43e9[_0x4b611d(0x99)](_0x4b611d(0x122)+_0x170101[_0x4b611d(0x9b)]+_0x4b611d(0xc6)+_0x170101[_0x4b611d(0x109)]));}for(const _0x4cc0a3 of _0x37dbe7[_0x4b611d(0x81)]){_0x4cc0a3['action']==='error'&&console['log'](a4_0x4e43e9[_0x4b611d(0x99)](_0x4b611d(0xff)+_0x4cc0a3[_0x4b611d(0x9b)]+_0x4b611d(0xc6)+_0x4cc0a3[_0x4b611d(0x109)]));}for(const _0x4a202b of _0x37dbe7[_0x4b611d(0xf1)]){_0x4a202b[_0x4b611d(0xd1)]===_0x4b611d(0x109)&&console[_0x4b611d(0xc8)](a4_0x4e43e9[_0x4b611d(0x99)](_0x4b611d(0x84)+_0x4a202b[_0x4b611d(0x9b)]+_0x4b611d(0xc6)+_0x4a202b[_0x4b611d(0x109)]));}for(const _0x2b47b1 of _0x37dbe7[_0x4b611d(0x105)]){_0x2b47b1[_0x4b611d(0xd1)]===_0x4b611d(0x109)&&console[_0x4b611d(0xc8)](a4_0x4e43e9['red'](_0x4b611d(0xdd)+_0x2b47b1[_0x4b611d(0x9b)]+_0x4b611d(0xc6)+_0x2b47b1['error']));}return 0x1;}console['log']();const _0x417c60=getLLMProjectUrl(_0x26124b,_0x37dbe7[_0x4b611d(0x6d)]);return console[_0x4b611d(0xc8)]('Project:\x20'+a4_0x4e43e9[_0x4b611d(0x8d)](_0x417c60)),0x0;}}function a4_0x2003(_0x1bc253,_0x2e056b){_0x1bc253=_0x1bc253-0x66;const _0xc74432=a4_0xc744();let _0x20033a=_0xc74432[_0x1bc253];return _0x20033a;}export class AgentPushCommand extends BaseCommand{[a4_0x47b8d4(0x9b)]='agent:push';['description']=a4_0x47b8d4(0xa1);async[a4_0x47b8d4(0x114)](_0x4f94f7){const _0x2a408e=a4_0x47b8d4,{options:_0xd3da08,args:_0x33892d,tdx:_0x25de30}=_0x4f94f7;let _0xd752e5=_0x33892d[0x0]||process[_0x2a408e(0xdb)]();const _0x2aadaa=_0xd3da08[_0x2a408e(0x71)],_0x25f2c9=_0xd3da08[_0x2a408e(0xfd)],_0x12a1f1=_0xd3da08[_0x2a408e(0xbe)],_0x14f59c=_0xd3da08[_0x2a408e(0x119)],_0x115b06=a4_0x1dc0a1[_0x2a408e(0xf4)](_0xd752e5,_0x2a408e(0x90)),_0x3f001d=existsSync(_0x115b06);if(_0x3f001d){const {data:_0x42a1e6}=await withSpinner(_0x2a408e(0xbd)+_0xd752e5+_0x2a408e(0xa8),()=>_0x25de30[_0x2a408e(0xcc)][_0x2a408e(0x72)](_0xd752e5,{'dryRun':_0x2aadaa,'force':_0x25f2c9}));if(_0x2aadaa)return console[_0x2a408e(0xc8)](a4_0x4e43e9['yellow'](_0x2a408e(0x85))),console['log'](_0x2a408e(0x11c)+_0x42a1e6['agentName']),0x0;if(_0x42a1e6[_0x2a408e(0xd1)]===_0x2a408e(0x109))return console[_0x2a408e(0xc8)](a4_0x4e43e9[_0x2a408e(0x99)](_0x2a408e(0xe4)+_0x42a1e6[_0x2a408e(0x109)])),0x1;console[_0x2a408e(0xc8)](a4_0x4e43e9['green']('Agent\x20'+_0x42a1e6[_0x2a408e(0xd1)]+'\x20successfully')),console[_0x2a408e(0xc8)]('Agent:\x20'+_0x42a1e6['agentName']);if(_0x42a1e6['agentId']&&_0x42a1e6[_0x2a408e(0xc0)]){const _0x576367=getLLMAgentChatUrl(_0x14f59c,_0x42a1e6['projectId'],_0x42a1e6[_0x2a408e(0xc9)]);console[_0x2a408e(0xc8)](_0x2a408e(0x111)+a4_0x4e43e9[_0x2a408e(0x8d)](_0x576367));}return 0x0;}const _0x11ab5d=_0xd3da08[_0x2a408e(0xb3)],_0x396f52=resolveProjectFromContext(_0xd752e5,_0x11ab5d);if(_0x396f52['found'])_0xd752e5=_0x396f52[_0x2a408e(0x124)],_0x396f52['source']===_0x2a408e(0xa9)&&console[_0x2a408e(0xc8)](a4_0x4e43e9['dim'](_0x2a408e(0xb6)+_0xd752e5));else{let _0x43c834=_0x2a408e(0xaa);_0x396f52[_0x2a408e(0xf9)]===_0x2a408e(0x93)&&(_0x43c834=_0x396f52[_0x2a408e(0x127)]+_0x2a408e(0x106)+_0x396f52['llmProject']+_0x2a408e(0x126));throw new SDKError(ErrorCode[_0x2a408e(0x11e)],_0x396f52[_0x2a408e(0xf9)]===_0x2a408e(0x75)?_0x396f52[_0x2a408e(0x127)]:'No\x20tdx.json\x20found\x20in\x20'+_0xd752e5,undefined,{'helpText':_0x43c834});}const {data:_0x2fa7b4}=await withSpinner(_0x2a408e(0x11f),()=>_0x25de30['llm'][_0x2a408e(0xed)](_0xd752e5,{'dryRun':!![]})),_0x2ee506=_0x2fa7b4['counts'][_0x2a408e(0x68)]['errors']>0x0;if(_0x2ee506){console['log'](a4_0x4e43e9[_0x2a408e(0x99)](_0x2a408e(0x78)));for(const _0x681b30 of _0x2fa7b4[_0x2a408e(0x68)]){_0x681b30[_0x2a408e(0xd1)]==='error'&&console[_0x2a408e(0xc8)](a4_0x4e43e9[_0x2a408e(0x99)]('\x20\x20Agent\x20\x22'+_0x681b30[_0x2a408e(0xc5)]+_0x2a408e(0xc6)+_0x681b30[_0x2a408e(0x109)]));}return 0x1;}const _0x2ddedb=_0x2fa7b4[_0x2a408e(0x9e)]['agents'][_0x2a408e(0xb9)]+_0x2fa7b4[_0x2a408e(0x9e)][_0x2a408e(0x118)][_0x2a408e(0xb9)]+_0x2fa7b4[_0x2a408e(0x9e)]['textKnowledgeBases'][_0x2a408e(0xb9)]+_0x2fa7b4['counts'][_0x2a408e(0x7f)][_0x2a408e(0xb9)]+_0x2fa7b4[_0x2a408e(0x9e)]['integrations'][_0x2a408e(0xb9)]+_0x2fa7b4[_0x2a408e(0x9e)][_0x2a408e(0xf1)][_0x2a408e(0xb9)]+_0x2fa7b4[_0x2a408e(0x9e)][_0x2a408e(0x105)][_0x2a408e(0xb9)]+_0x2fa7b4[_0x2a408e(0x9e)]['formInterfaces']['created']+_0x2fa7b4[_0x2a408e(0x9e)][_0x2a408e(0x81)]['created'],_0x411d54=_0x2fa7b4[_0x2a408e(0x9e)][_0x2a408e(0x68)][_0x2a408e(0x76)]+_0x2fa7b4[_0x2a408e(0x9e)][_0x2a408e(0x118)][_0x2a408e(0x76)]+_0x2fa7b4['counts']['textKnowledgeBases'][_0x2a408e(0x76)]+_0x2fa7b4[_0x2a408e(0x9e)][_0x2a408e(0x7f)]['updated']+_0x2fa7b4[_0x2a408e(0x9e)][_0x2a408e(0xb1)][_0x2a408e(0x76)]+_0x2fa7b4['counts'][_0x2a408e(0xf1)][_0x2a408e(0x76)]+_0x2fa7b4[_0x2a408e(0x9e)]['experimentalArtifacts'][_0x2a408e(0x76)]+_0x2fa7b4[_0x2a408e(0x9e)][_0x2a408e(0xba)][_0x2a408e(0x76)]+_0x2fa7b4['counts'][_0x2a408e(0x81)][_0x2a408e(0x76)],_0xaf0b4d=_0x2fa7b4[_0x2a408e(0x9e)][_0x2a408e(0x68)]['unchanged']+_0x2fa7b4[_0x2a408e(0x9e)]['knowledgeBases'][_0x2a408e(0xd4)]+_0x2fa7b4[_0x2a408e(0x9e)][_0x2a408e(0x8a)][_0x2a408e(0xd4)]+_0x2fa7b4[_0x2a408e(0x9e)][_0x2a408e(0x7f)]['unchanged']+_0x2fa7b4['counts']['integrations'][_0x2a408e(0xd4)]+_0x2fa7b4[_0x2a408e(0x9e)][_0x2a408e(0xf1)][_0x2a408e(0xd4)]+_0x2fa7b4[_0x2a408e(0x9e)][_0x2a408e(0x105)][_0x2a408e(0xd4)]+_0x2fa7b4[_0x2a408e(0x9e)][_0x2a408e(0xba)][_0x2a408e(0xd4)]+_0x2fa7b4['counts'][_0x2a408e(0x81)][_0x2a408e(0xd4)];console[_0x2a408e(0xc8)](_0x2a408e(0xd6)+_0x2fa7b4[_0x2a408e(0xea)]+'\x27:'),console[_0x2a408e(0xc8)]('\x20\x20'+a4_0x4e43e9[_0x2a408e(0xcb)]('+\x20'+_0x2ddedb+_0x2a408e(0xe7))+_0x2a408e(0x129)+a4_0x4e43e9[_0x2a408e(0x91)]('~\x20'+_0x411d54+'\x20changed')+_0x2a408e(0x129)+a4_0x4e43e9[_0x2a408e(0x100)]('=\x20'+_0xaf0b4d+_0x2a408e(0xc2))),console[_0x2a408e(0xc8)](_0x2a408e(0x112)+formatCountSummary(_0x2fa7b4[_0x2a408e(0x9e)][_0x2a408e(0x68)])),console[_0x2a408e(0xc8)](_0x2a408e(0x6f)+formatCountSummary(_0x2fa7b4[_0x2a408e(0x9e)][_0x2a408e(0x118)])),console[_0x2a408e(0xc8)](_0x2a408e(0xb7)+formatCountSummary(_0x2fa7b4['counts']['textKnowledgeBases'])),console[_0x2a408e(0xc8)](_0x2a408e(0x10e)+formatCountSummary(_0x2fa7b4[_0x2a408e(0x9e)][_0x2a408e(0x7f)])),console['log'](_0x2a408e(0x6b)+formatCountSummary(_0x2fa7b4[_0x2a408e(0x9e)]['integrations'])),console['log'](_0x2a408e(0x89)+formatCountSummary(_0x2fa7b4[_0x2a408e(0x9e)][_0x2a408e(0xba)])),console[_0x2a408e(0xc8)](_0x2a408e(0xcd)+formatCountSummary(_0x2fa7b4[_0x2a408e(0x9e)][_0x2a408e(0x81)]));const _0x1f1e43=_0x2fa7b4[_0x2a408e(0x9e)]['experimentalKnowledgeBases'][_0x2a408e(0xb9)]>0x0||_0x2fa7b4[_0x2a408e(0x9e)]['experimentalKnowledgeBases'][_0x2a408e(0x76)]>0x0||_0x2fa7b4[_0x2a408e(0x9e)][_0x2a408e(0xf1)][_0x2a408e(0xd4)]>0x0||_0x2fa7b4['counts'][_0x2a408e(0x105)]['created']>0x0||_0x2fa7b4[_0x2a408e(0x9e)][_0x2a408e(0x105)]['updated']>0x0||_0x2fa7b4[_0x2a408e(0x9e)]['experimentalArtifacts']['unchanged']>0x0;_0x1f1e43&&(console[_0x2a408e(0xc8)](_0x2a408e(0xe9)+formatCountSummary(_0x2fa7b4['counts'][_0x2a408e(0xf1)])),console[_0x2a408e(0xc8)](_0x2a408e(0xd5)+formatCountSummary(_0x2fa7b4[_0x2a408e(0x9e)][_0x2a408e(0x105)])));console['log']('\x20\x20Source:\x20'+a4_0x4e43e9['cyan'](_0xd752e5)),displayDiffs(_0x2fa7b4[_0x2a408e(0x68)],_0x2fa7b4['knowledgeBases'],_0x2fa7b4[_0x2a408e(0x8a)],_0x2fa7b4[_0x2a408e(0x7f)],_0x2fa7b4[_0x2a408e(0xb1)],_0x2fa7b4['experimentalKnowledgeBases'],_0x2fa7b4[_0x2a408e(0x105)],_0x2fa7b4['formInterfaces'],_0x2fa7b4[_0x2a408e(0x81)]);if(_0x2aadaa)return console[_0x2a408e(0xc8)](a4_0x4e43e9['yellow'](_0x2a408e(0xee))),0x0;if(_0x2ddedb===0x0&&_0x411d54===0x0){console[_0x2a408e(0xc8)](a4_0x4e43e9[_0x2a408e(0xcb)](_0x2a408e(0x8b)));const _0x4ed86a=getLLMProjectUrl(_0x14f59c,_0x2fa7b4[_0x2a408e(0xc0)]);return console[_0x2a408e(0xc8)]('Project:\x20'+a4_0x4e43e9['cyan'](_0x4ed86a)),0x0;}if(!_0x12a1f1&&!_0x25f2c9){if(!isInteractive())return console['error'](a4_0x4e43e9['red']('\x0aError:'),_0x2a408e(0x6e)),console[_0x2a408e(0x109)](a4_0x4e43e9[_0x2a408e(0x100)](_0x2a408e(0x116))),0x1;const _0x53d326=await confirmKey(_0x2a408e(0x86)+(_0x2ddedb+_0x411d54)+_0x2a408e(0xe8));if(!_0x53d326)return console[_0x2a408e(0xc8)](a4_0x4e43e9['yellow'](_0x2a408e(0xfc)),_0x2a408e(0x103)),0x1;}const {data:_0x179ed1}=await withSpinner('Pushing\x20to\x20project...',()=>_0x25de30[_0x2a408e(0xcc)][_0x2a408e(0xed)](_0xd752e5,{'force':_0x25f2c9})),_0x1a7dac=_0x179ed1[_0x2a408e(0x9e)][_0x2a408e(0x68)][_0x2a408e(0x6c)]>0x0||_0x179ed1[_0x2a408e(0x9e)][_0x2a408e(0x118)]['errors']>0x0||_0x179ed1[_0x2a408e(0x9e)][_0x2a408e(0x8a)]['errors']>0x0||_0x179ed1[_0x2a408e(0x9e)][_0x2a408e(0x7f)]['errors']>0x0||_0x179ed1[_0x2a408e(0x9e)]['formInterfaces'][_0x2a408e(0x6c)]>0x0||_0x179ed1['counts'][_0x2a408e(0x81)][_0x2a408e(0x6c)]>0x0;if(_0x1a7dac){console[_0x2a408e(0xc8)](a4_0x4e43e9['yellow'](_0x2a408e(0xf3))),console[_0x2a408e(0xc8)](),console[_0x2a408e(0xc8)](a4_0x4e43e9[_0x2a408e(0x99)]('Errors:'));for(const _0x5ef56e of _0x179ed1[_0x2a408e(0x68)]){_0x5ef56e[_0x2a408e(0xd1)]===_0x2a408e(0x109)&&console[_0x2a408e(0xc8)](a4_0x4e43e9['red'](_0x2a408e(0x8f)+_0x5ef56e[_0x2a408e(0xc5)]+'\x22:\x20'+_0x5ef56e[_0x2a408e(0x109)]));}for(const _0xee507e of _0x179ed1['knowledgeBases']){_0xee507e['action']===_0x2a408e(0x109)&&console[_0x2a408e(0xc8)](a4_0x4e43e9[_0x2a408e(0x99)](_0x2a408e(0xa2)+_0xee507e[_0x2a408e(0x9b)]+_0x2a408e(0xc6)+_0xee507e[_0x2a408e(0x109)]));}for(const _0x373bfe of _0x179ed1[_0x2a408e(0x8a)]){_0x373bfe[_0x2a408e(0xd1)]==='error'&&console[_0x2a408e(0xc8)](a4_0x4e43e9['red'](_0x2a408e(0xb4)+_0x373bfe[_0x2a408e(0x9b)]+_0x2a408e(0xc6)+_0x373bfe[_0x2a408e(0x109)]));}for(const _0x3d9236 of _0x179ed1['prompts']){_0x3d9236[_0x2a408e(0xd1)]===_0x2a408e(0x109)&&console[_0x2a408e(0xc8)](a4_0x4e43e9[_0x2a408e(0x99)](_0x2a408e(0xd2)+_0x3d9236['name']+_0x2a408e(0xc6)+_0x3d9236[_0x2a408e(0x109)]));}for(const _0x29076a of _0x179ed1[_0x2a408e(0xb1)]){_0x29076a[_0x2a408e(0xd1)]===_0x2a408e(0x109)&&console[_0x2a408e(0xc8)](a4_0x4e43e9[_0x2a408e(0x99)](_0x2a408e(0x8c)+_0x29076a[_0x2a408e(0x9b)]+_0x2a408e(0xc6)+_0x29076a[_0x2a408e(0x109)]));}for(const _0x21898d of _0x179ed1[_0x2a408e(0xba)]){_0x21898d['action']==='error'&&console['log'](a4_0x4e43e9['red'](_0x2a408e(0x122)+_0x21898d[_0x2a408e(0x9b)]+_0x2a408e(0xc6)+_0x21898d['error']));}for(const _0x220e33 of _0x179ed1[_0x2a408e(0x81)]){_0x220e33[_0x2a408e(0xd1)]==='error'&&console[_0x2a408e(0xc8)](a4_0x4e43e9[_0x2a408e(0x99)]('\x20\x20Chat\x20Interface\x20\x22'+_0x220e33['name']+_0x2a408e(0xc6)+_0x220e33['error']));}return 0x1;}console[_0x2a408e(0xc8)](a4_0x4e43e9[_0x2a408e(0xcb)](_0x2a408e(0xab)+(_0x2ddedb+_0x411d54)+_0x2a408e(0x9c)+_0x179ed1['projectName']+'\x27'));const _0x2a8ee5=getLLMProjectUrl(_0x14f59c,_0x179ed1[_0x2a408e(0xc0)]);return console[_0x2a408e(0xc8)](_0x2a408e(0xaf)+a4_0x4e43e9[_0x2a408e(0x8d)](_0x2a8ee5)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x47ca9b=a5_0x2965;(function(_0x2cae8a,_0x3b1e95){const _0x2194ba=a5_0x2965,_0x5b346e=_0x2cae8a();while(!![]){try{const _0x3d9b91=-parseInt(_0x2194ba(0x211))/0x1*(parseInt(_0x2194ba(0x247))/0x2)+parseInt(_0x2194ba(0x261))/0x3+parseInt(_0x2194ba(0x236))/0x4*(-parseInt(_0x2194ba(0x1fb))/0x5)+-parseInt(_0x2194ba(0x26f))/0x6*(-parseInt(_0x2194ba(0x1df))/0x7)+-parseInt(_0x2194ba(0x216))/0x8+-parseInt(_0x2194ba(0x1fe))/0x9*(-parseInt(_0x2194ba(0x271))/0xa)+-parseInt(_0x2194ba(0x205))/0xb*(-parseInt(_0x2194ba(0x220))/0xc);if(_0x3d9b91===_0x3b1e95)break;else _0x5b346e['push'](_0x5b346e['shift']());}catch(_0x2f6192){_0x5b346e['push'](_0x5b346e['shift']());}}}(a5_0x4278,0x9766a));import*as a5_0x5691f7 from'node:fs';function a5_0x4278(){const _0x338f27=['testName','FAIL','Available\x20tags:\x20','Tests\x20found:\x20','add','text',':\x20Sending\x20user\x20input...','Re-evaluation\x20Summary','now','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','length','forEach','conversation_url','6lyujzQ','Executing\x20new\x20tests...','4268280ITsdAB','resolveProjectId','conversations','Conversation\x20URL:\x20','filter','Errors:\x20\x20\x20','no_tests','jsonl','5804281aASCVr','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','testYmlPath','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','projectName','cyan','resolveAgentId','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','Available\x20tests:\x20','utf-8','trim','\x22:\x20','Passed:\x20\x20\x20','split','ERROR','not\x20found','Test\x20','\x20\x20Evaluating...\x20','Run\x20tests\x20for\x20an\x20LLM\x20agent','\x20(new)','...','Cached\x20run\x20from:\x20','Running:\x20','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','No\x20tests\x20found\x20with\x20tags:\x20','✗\x20ERROR:\x20','Evaluating\x20response...','white','398370TuWAFD','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','dim','9hUuYff','projectDir','agent:test','\x20\x20Round\x20','name','⚠\x20SKIPPED:\x20','executeReeval','901846oBkRPk','Usage:','tags','Error\x20writing\x20output\x20file:\x20','Error:\x20No\x20previous\x20test\x20run\x20found.','Failed\x20Tests:','reeval','join','round','Re-evaluating...','writeFileSync','\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)','133UEkZYo','tests','execute','\x20-\x20','table','6504624CtnOkW','has','Failed:\x20\x20\x20','context','isSpinning','llmProject','Round\x201/','tsv','Site:\x20','includes','72hSPxgZ','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','/<agent-name>','resolve','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','yellow','PASS','toLowerCase','size','reason','New\x20tests\x20to\x20execute:\x20','Project\x20path:\x20','basename','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','Total:\x20\x20\x20\x20','\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path','json','\x20\x20Project:\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','toISOString','Round\x20','start','8BMtlnx','✗\x20ERROR:\x20Project\x20not\x20found:\x20','push','agentName','verbose','log','Output\x20written\x20to:\x20','status','...\x20','\x22,\x20but\x20current\x20site\x20is\x20\x22','stop','✓\x20PASS:\x20','Either\x20switch\x20to\x20the\x20\x22','Cached\x20run\x20is\x20from\x20site\x20\x22','agent','green','red','16838YyThHm','eval','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','\x20(cached)','map','✗\x20FAIL:\x20','find','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','Re-evaluating\x20cached\x20test\x20run...','site','404','message','substring','\x20\x20Conversation:\x20','existsSync','some','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','agentDirs','repeat','Running\x20agent\x20tests...','timestamp','multiple_agents','llm','Test\x20Configuration:','Duration:\x20','rounds','2893092YwPzlU'];a5_0x4278=function(){return _0x338f27;};return a5_0x4278();}function a5_0x2965(_0x538d24,_0x5793bd){_0x538d24=_0x538d24-0x1db;const _0x427889=a5_0x4278();let _0x296511=_0x427889[_0x538d24];return _0x296511;}import*as a5_0x55dadf from'node:path';import a5_0x2602b0 from'chalk';import{BaseCommand}from'./command.js';import{parseTestFile,runTest,formatResults,setupEvaluatorAgent,loadLastTestRun,saveLastTestRun,buildCachedTestRun,reevaluateFromCache}from'../sdk/agent/test/index.js';import{resolveProjectFromContext}from'../sdk/agent/agent-config.js';import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{['name']=a5_0x47ca9b(0x200);['description']=a5_0x47ca9b(0x1f1);async[a5_0x47ca9b(0x213)](_0x148849){const _0x4c46ad=a5_0x47ca9b,{options:_0x2bf6b0,args:_0x1f4927,tdx:_0x5a731b}=_0x148849,_0x59dfdc=_0x1f4927[0x0]||'.',_0x13f645=_0x2bf6b0['dryRun'],_0x69b938=_0x2bf6b0,_0x4dae95=_0x69b938[_0x4c46ad(0x248)]===![],_0x37d5cf=_0x69b938[_0x4c46ad(0x20b)],_0x1315a8=_0x69b938[_0x4c46ad(0x202)],_0x5e899b=_0x69b938[_0x4c46ad(0x207)],_0x5abc47=_0x2bf6b0[_0x4c46ad(0x250)],_0x44cc7b=_0x69b938['output'];if(_0x37d5cf&&_0x4dae95)return console[_0x4c46ad(0x23b)](a5_0x2602b0['red'](_0x4c46ad(0x257))),0x1;let _0x524962=_0x4c46ad(0x215);if(_0x69b938['json'])_0x524962=_0x4c46ad(0x230);else{if(_0x69b938[_0x4c46ad(0x1de)])_0x524962='jsonl';else{if(_0x69b938[_0x4c46ad(0x21d)])_0x524962=_0x4c46ad(0x21d);else{if(_0x69b938[_0x4c46ad(0x215)])_0x524962='table';}}}const _0x19548d=_0x69b938[_0x4c46ad(0x21b)];let _0x2e2bd4=_0x59dfdc;const _0x3b176d=a5_0x5691f7[_0x4c46ad(0x255)](_0x59dfdc),_0x4f5293=_0x59dfdc==='.';if(!_0x3b176d||_0x4f5293){const _0x170294=resolveProjectFromContext(_0x59dfdc,_0x19548d,{'requireFile':'test.yml'});if(_0x170294['found'])_0x2e2bd4=_0x170294[_0x4c46ad(0x1ff)],_0x170294['source']===_0x4c46ad(0x219)&&console[_0x4c46ad(0x23b)](a5_0x2602b0[_0x4c46ad(0x1fd)]('Using\x20agent:\x20'+_0x2e2bd4));else switch(_0x170294[_0x4c46ad(0x229)]){case'no_context':console[_0x4c46ad(0x23b)](a5_0x2602b0[_0x4c46ad(0x225)](_0x170294[_0x4c46ad(0x252)])),console[_0x4c46ad(0x23b)](),console[_0x4c46ad(0x23b)](_0x4c46ad(0x206)),console[_0x4c46ad(0x23b)](_0x4c46ad(0x22f)),console[_0x4c46ad(0x23b)](_0x4c46ad(0x210)),console[_0x4c46ad(0x23b)](),console[_0x4c46ad(0x23b)](_0x4c46ad(0x1fc));return 0x1;case'no_local_folder':console[_0x4c46ad(0x23b)](a5_0x2602b0[_0x4c46ad(0x225)](_0x170294[_0x4c46ad(0x252)])),console['log'](),console[_0x4c46ad(0x23b)]('Run\x20\x27tdx\x20agent\x20pull\x20'+_0x170294[_0x4c46ad(0x21b)]+_0x4c46ad(0x232));return 0x1;case _0x4c46ad(0x25c):{const _0x215c1b=a5_0x55dadf[_0x4c46ad(0x22c)](_0x170294[_0x4c46ad(0x1ff)]);console[_0x4c46ad(0x23b)](a5_0x2602b0[_0x4c46ad(0x225)]('Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22'+_0x170294['llmProject']+'\x22:'));for(const _0x48e62e of _0x170294[_0x4c46ad(0x258)]){console[_0x4c46ad(0x23b)]('\x20\x20-\x20'+_0x48e62e);}return console['log'](),console['log'](_0x4c46ad(0x221)+_0x215c1b+_0x4c46ad(0x222)),0x1;}case _0x4c46ad(0x1dd):console[_0x4c46ad(0x23b)](a5_0x2602b0[_0x4c46ad(0x225)]('No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22'+_0x170294['llmProject']+'\x22.')),console[_0x4c46ad(0x23b)](a5_0x2602b0[_0x4c46ad(0x1fd)](_0x4c46ad(0x22b)+_0x170294[_0x4c46ad(0x1ff)])),console['log'](),console[_0x4c46ad(0x23b)](_0x4c46ad(0x1f6));return 0x1;}}const {definition:_0xfa5241,agentInfo:_0x2af70e}=parseTestFile(_0x2e2bd4);let _0x5f4cbd=_0xfa5241['tests'];if(_0x1315a8){const _0x575e96=_0x1315a8[_0x4c46ad(0x1ec)](',')[_0x4c46ad(0x24b)](_0x1c655d=>_0x1c655d['trim']());_0x5f4cbd=_0xfa5241[_0x4c46ad(0x212)][_0x4c46ad(0x1db)](_0x567876=>_0x575e96[_0x4c46ad(0x21f)](_0x567876[_0x4c46ad(0x202)]));if(_0x5f4cbd[_0x4c46ad(0x26c)]===0x0)return console[_0x4c46ad(0x23b)](a5_0x2602b0[_0x4c46ad(0x225)]('No\x20tests\x20found\x20matching:\x20'+_0x1315a8)),console['log'](a5_0x2602b0[_0x4c46ad(0x1fd)](_0x4c46ad(0x1e7)+_0xfa5241['tests'][_0x4c46ad(0x24b)](_0x48e536=>_0x48e536[_0x4c46ad(0x202)])[_0x4c46ad(0x20c)](',\x20'))),0x1;}if(_0x5e899b){const _0x55c605=_0x5e899b[_0x4c46ad(0x1ec)](',')[_0x4c46ad(0x24b)](_0x9d1304=>_0x9d1304[_0x4c46ad(0x1e9)]()[_0x4c46ad(0x227)]());_0x5f4cbd=_0x5f4cbd[_0x4c46ad(0x1db)](_0x4e19b9=>_0x4e19b9[_0x4c46ad(0x207)]?.[_0x4c46ad(0x256)](_0x4ad59a=>_0x55c605['includes'](_0x4ad59a[_0x4c46ad(0x227)]())));if(_0x5f4cbd[_0x4c46ad(0x26c)]===0x0){console['log'](a5_0x2602b0[_0x4c46ad(0x225)](_0x4c46ad(0x1f7)+_0x5e899b));const _0x1a2022=new Set();return _0xfa5241['tests'][_0x4c46ad(0x26d)](_0x54aeb9=>_0x54aeb9[_0x4c46ad(0x207)]?.[_0x4c46ad(0x26d)](_0x3dbe2c=>_0x1a2022[_0x4c46ad(0x266)](_0x3dbe2c))),_0x1a2022[_0x4c46ad(0x228)]>0x0?console['log'](a5_0x2602b0[_0x4c46ad(0x1fd)](_0x4c46ad(0x264)+[..._0x1a2022][_0x4c46ad(0x20c)](',\x20'))):console[_0x4c46ad(0x23b)](a5_0x2602b0[_0x4c46ad(0x1fd)]('No\x20tests\x20have\x20tags\x20defined.')),0x1;}}if(_0x37d5cf)return this['executeReeval'](_0x148849,{'definition':{'tests':_0x5f4cbd},'agentInfo':_0x2af70e,'outputFormat':_0x524962,'outputFile':_0x44cc7b,'testNames':_0x1315a8});if(_0x13f645){console['log'](a5_0x2602b0[_0x4c46ad(0x1e4)](_0x4c46ad(0x25e))),console[_0x4c46ad(0x23b)]('\x20\x20Site:\x20'+a5_0x2602b0[_0x4c46ad(0x1fa)](_0x5abc47)),console['log'](_0x4c46ad(0x231)+a5_0x2602b0[_0x4c46ad(0x1fa)](_0x2af70e[_0x4c46ad(0x1e3)])),console[_0x4c46ad(0x23b)]('\x20\x20Agent:\x20'+a5_0x2602b0[_0x4c46ad(0x1fa)](_0x2af70e[_0x4c46ad(0x239)])),console[_0x4c46ad(0x23b)](),console[_0x4c46ad(0x23b)](_0x4c46ad(0x265)+a5_0x2602b0['white'](_0x5f4cbd[_0x4c46ad(0x26c)]));for(let _0x327a41=0x0;_0x327a41<_0x5f4cbd[_0x4c46ad(0x26c)];_0x327a41++){const _0xc09f0d=_0x5f4cbd[_0x327a41],_0x51d2ec=_0xc09f0d[_0x4c46ad(0x260)][_0x4c46ad(0x26c)]===0x1?_0x4c46ad(0x20d):_0x4c46ad(0x260),_0x15b25e=_0xc09f0d[_0x4c46ad(0x207)]?.[_0x4c46ad(0x26c)]?'\x20['+_0xc09f0d['tags'][_0x4c46ad(0x20c)](',\x20')+']':'';console[_0x4c46ad(0x23b)]('\x20\x20'+(_0x327a41+0x1)+'.\x20'+a5_0x2602b0['white'](_0xc09f0d[_0x4c46ad(0x202)])+'\x20('+_0xc09f0d[_0x4c46ad(0x260)]['length']+'\x20'+_0x51d2ec+')'+a5_0x2602b0[_0x4c46ad(0x1fd)](_0x15b25e));}return 0x0;}let _0x182853,_0x3667b9;try{_0x182853=await _0x5a731b[_0x4c46ad(0x25d)][_0x4c46ad(0x272)](_0x2af70e[_0x4c46ad(0x1e3)]);}catch(_0x2fd26a){const _0x26d219=_0x2fd26a instanceof Error?_0x2fd26a['message']:String(_0x2fd26a);return _0x26d219[_0x4c46ad(0x21f)](_0x4c46ad(0x251))||_0x26d219['toLowerCase']()[_0x4c46ad(0x21f)](_0x4c46ad(0x1ee))?console[_0x4c46ad(0x23b)](a5_0x2602b0['red'](_0x4c46ad(0x237)+_0x2af70e[_0x4c46ad(0x1e3)])):console[_0x4c46ad(0x23b)](a5_0x2602b0['red']('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0x2af70e['projectName']+'\x22:\x20'+_0x26d219)),0x1;}try{_0x3667b9=await _0x5a731b[_0x4c46ad(0x25d)][_0x4c46ad(0x1e5)](_0x2af70e[_0x4c46ad(0x239)],_0x182853);}catch(_0x248a5a){const _0x33669f=_0x248a5a instanceof Error?_0x248a5a[_0x4c46ad(0x252)]:String(_0x248a5a);return _0x33669f[_0x4c46ad(0x21f)](_0x4c46ad(0x251))||_0x33669f[_0x4c46ad(0x227)]()['includes'](_0x4c46ad(0x1ee))?console[_0x4c46ad(0x23b)](a5_0x2602b0[_0x4c46ad(0x246)](_0x4c46ad(0x1e6)+_0x2af70e[_0x4c46ad(0x239)])):console[_0x4c46ad(0x23b)](a5_0x2602b0[_0x4c46ad(0x246)](_0x4c46ad(0x249)+_0x2af70e[_0x4c46ad(0x239)]+_0x4c46ad(0x1ea)+_0x33669f)),0x1;}let _0x5f1189;if(!_0x4dae95)try{_0x5f1189=await setupEvaluatorAgent(_0x5a731b[_0x4c46ad(0x25d)],_0x2bf6b0[_0x4c46ad(0x23a)]);}catch(_0x23dcc1){const _0x3d454f=_0x23dcc1 instanceof Error?_0x23dcc1['message']:String(_0x23dcc1);return console[_0x4c46ad(0x23b)](a5_0x2602b0[_0x4c46ad(0x246)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x3d454f)),0x1;}console[_0x4c46ad(0x23b)](a5_0x2602b0[_0x4c46ad(0x1e4)](_0x4c46ad(0x25a))),console['log'](_0x4c46ad(0x21e)+a5_0x2602b0[_0x4c46ad(0x1fa)](_0x5abc47)),console[_0x4c46ad(0x23b)]('Agent:\x20'+a5_0x2602b0[_0x4c46ad(0x1fa)](_0x2af70e[_0x4c46ad(0x1e3)]+'/'+_0x2af70e['agentName'])),console[_0x4c46ad(0x23b)]();const _0x544311=[],_0x2208d3=[],_0x2f165d=Date[_0x4c46ad(0x26a)]();for(let _0x1c091c=0x0;_0x1c091c<_0x5f4cbd[_0x4c46ad(0x26c)];_0x1c091c++){const _0x3beaef=_0x5f4cbd[_0x1c091c];_0x5f4cbd[_0x4c46ad(0x26c)]>0x1?console[_0x4c46ad(0x23b)](_0x4c46ad(0x1ef)+(_0x1c091c+0x1)+'/'+_0x5f4cbd[_0x4c46ad(0x26c)]+':\x20'+a5_0x2602b0['white'](_0x3beaef[_0x4c46ad(0x202)])):console[_0x4c46ad(0x23b)]('Running\x20test:\x20'+a5_0x2602b0[_0x4c46ad(0x1fa)](_0x3beaef[_0x4c46ad(0x202)]));const _0x54d484=createCommandSpinner(_0x4c46ad(0x21c)+_0x3beaef['rounds'][_0x4c46ad(0x26c)]+_0x4c46ad(0x268));_0x54d484[_0x4c46ad(0x235)]();try{const {result:_0x1b1b73,conversation:_0xa73b15}=await runTest(_0x5a731b[_0x4c46ad(0x25d)],_0x3beaef,{'agentId':_0x3667b9,'projectId':_0x182853,'site':_0x5abc47,'noEval':_0x4dae95,'evaluatorId':_0x5f1189,'onRoundStart':(_0x25e5a9,_0x2ed0f4)=>{const _0x37d074=_0x4c46ad;_0x54d484['text']=_0x37d074(0x234)+(_0x25e5a9+0x1)+'/'+_0x2ed0f4+_0x37d074(0x268);},'onRoundComplete':(_0x4df772,_0x375841,_0x30f70d)=>{const _0x489b61=_0x4c46ad,_0x51790a=formatElapsed(_0x375841);_0x30f70d?console['log'](_0x489b61(0x201)+(_0x4df772+0x1)+'/'+_0x3beaef[_0x489b61(0x260)][_0x489b61(0x26c)]+'...\x20'+a5_0x2602b0[_0x489b61(0x245)]('✓')+'\x20('+_0x51790a+')'):console[_0x489b61(0x23b)](_0x489b61(0x201)+(_0x4df772+0x1)+'/'+_0x3beaef[_0x489b61(0x260)]['length']+_0x489b61(0x23e)+a5_0x2602b0[_0x489b61(0x246)]('✗'));},'onEvaluationStart':()=>{const _0x5ee27e=_0x4c46ad;_0x54d484[_0x5ee27e(0x267)]=_0x5ee27e(0x1f9);},'onEvaluationComplete':_0x2d3e84=>{const _0x1a7f9b=_0x4c46ad,_0x353c35=formatElapsed(_0x2d3e84);console[_0x1a7f9b(0x23b)](_0x1a7f9b(0x1f0)+a5_0x2602b0[_0x1a7f9b(0x245)]('✓')+'\x20('+_0x353c35+')');}});_0x54d484[_0x4c46ad(0x240)](),_0x544311[_0x4c46ad(0x238)](_0x1b1b73),_0x2208d3[_0x4c46ad(0x238)](_0xa73b15);if(_0x1b1b73[_0x4c46ad(0x23d)]===_0x4c46ad(0x226))console[_0x4c46ad(0x23b)](a5_0x2602b0['green'](_0x4c46ad(0x241)+_0x1b1b73[_0x4c46ad(0x229)]));else _0x1b1b73[_0x4c46ad(0x23d)]===_0x4c46ad(0x263)?console[_0x4c46ad(0x23b)](a5_0x2602b0['red'](_0x4c46ad(0x24c)+_0x1b1b73['reason'])):console['log'](a5_0x2602b0[_0x4c46ad(0x246)](_0x4c46ad(0x1f8)+_0x1b1b73[_0x4c46ad(0x229)]));_0x1b1b73[_0x4c46ad(0x26e)]&&console[_0x4c46ad(0x23b)](a5_0x2602b0['dim'](_0x4c46ad(0x274)+_0x1b1b73[_0x4c46ad(0x26e)])),console[_0x4c46ad(0x23b)]();}catch(_0x3e0f6a){_0x54d484['stop']();const _0x5bc07f=_0x3e0f6a instanceof Error?_0x3e0f6a['message']:String(_0x3e0f6a);console[_0x4c46ad(0x23b)](a5_0x2602b0['red']('✗\x20ERROR:\x20'+_0x5bc07f)),console[_0x4c46ad(0x23b)](),_0x544311[_0x4c46ad(0x238)]({'name':_0x3beaef[_0x4c46ad(0x202)],'status':_0x4c46ad(0x1ed),'reason':_0x5bc07f,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}const _0x13bfb6=Date['now']()-_0x2f165d,_0x5dc135=_0x544311[_0x4c46ad(0x1db)](_0x5186e4=>_0x5186e4['status']===_0x4c46ad(0x226))['length'],_0x51a3fd=_0x544311['filter'](_0x3bdb4b=>_0x3bdb4b[_0x4c46ad(0x23d)]===_0x4c46ad(0x263))[_0x4c46ad(0x26c)],_0x14e142=_0x544311[_0x4c46ad(0x1db)](_0x265834=>_0x265834[_0x4c46ad(0x23d)]===_0x4c46ad(0x1ed))[_0x4c46ad(0x26c)];console[_0x4c46ad(0x23b)]('━'[_0x4c46ad(0x259)](0x3c)),console[_0x4c46ad(0x23b)]('Test\x20Summary'),console['log']('━'[_0x4c46ad(0x259)](0x3c)),console[_0x4c46ad(0x23b)](_0x4c46ad(0x22e)+_0x544311[_0x4c46ad(0x26c)]),console['log'](_0x4c46ad(0x1eb)+a5_0x2602b0[_0x4c46ad(0x245)](_0x5dc135)),console[_0x4c46ad(0x23b)]('Failed:\x20\x20\x20'+a5_0x2602b0[_0x4c46ad(0x246)](_0x51a3fd));_0x14e142>0x0&&console['log'](_0x4c46ad(0x1dc)+a5_0x2602b0[_0x4c46ad(0x246)](_0x14e142));console[_0x4c46ad(0x23b)](_0x4c46ad(0x25f)+formatElapsed(_0x13bfb6)),console[_0x4c46ad(0x23b)]('━'[_0x4c46ad(0x259)](0x3c));const _0x467bc9=_0x544311[_0x4c46ad(0x1db)](_0x420e3e=>_0x420e3e[_0x4c46ad(0x23d)]!=='PASS');if(_0x467bc9[_0x4c46ad(0x26c)]>0x0){console[_0x4c46ad(0x23b)](),console[_0x4c46ad(0x23b)](_0x4c46ad(0x20a));for(const _0x4e1bc0 of _0x467bc9){const _0x10fdde=a5_0x2602b0[_0x4c46ad(0x246)]('✗'),_0x28e9b6=_0x4e1bc0[_0x4c46ad(0x229)][_0x4c46ad(0x26c)]>0x32?_0x4e1bc0[_0x4c46ad(0x229)][_0x4c46ad(0x253)](0x0,0x32)+_0x4c46ad(0x1f3):_0x4e1bc0[_0x4c46ad(0x229)];console['log']('\x20\x20'+_0x10fdde+'\x20'+_0x4e1bc0[_0x4c46ad(0x202)]+':\x20'+_0x28e9b6);}}const _0x2b4af0={'summary':{'total':_0x544311['length'],'passed':_0x5dc135,'failed':_0x51a3fd,'errors':_0x14e142>0x0?_0x14e142:undefined,'duration_ms':_0x13bfb6},'tests':_0x544311,'agent':{'project':_0x2af70e[_0x4c46ad(0x1e3)],'name':_0x2af70e[_0x4c46ad(0x239)],'site':_0x5abc47},'timestamp':new Date(_0x2f165d)['toISOString']()};try{const _0x296856=buildCachedTestRun(_0x2208d3,{'site':_0x5abc47,'projectId':_0x182853,'projectName':_0x2af70e[_0x4c46ad(0x1e3)],'agentId':_0x3667b9,'agentName':_0x2af70e[_0x4c46ad(0x239)],'testYmlPath':a5_0x55dadf[_0x4c46ad(0x223)](_0x2af70e[_0x4c46ad(0x1e1)])});saveLastTestRun(_0x296856);}catch{}if(_0x524962!=='table'||_0x44cc7b){const _0x2b0472=formatResults(_0x2b4af0,_0x524962);if(_0x44cc7b)try{a5_0x5691f7[_0x4c46ad(0x20f)](_0x44cc7b,_0x2b0472,_0x4c46ad(0x1e8)),console[_0x4c46ad(0x23b)](),console['log'](a5_0x2602b0[_0x4c46ad(0x1fd)](_0x4c46ad(0x23c)+_0x44cc7b));}catch(_0x308789){return console[_0x4c46ad(0x23b)](),console[_0x4c46ad(0x23b)](a5_0x2602b0[_0x4c46ad(0x246)](_0x4c46ad(0x208)+_0x308789)),0x1;}else console[_0x4c46ad(0x23b)](),console[_0x4c46ad(0x23b)](_0x2b0472);}return _0x467bc9['length']>0x0?0x1:0x0;}async[a5_0x47ca9b(0x204)](_0x44e6f0,_0x5c5edd){const _0x5b58cc=a5_0x47ca9b,{options:_0x5d83b3,tdx:_0x39528b}=_0x44e6f0,{definition:_0x44db0e,agentInfo:_0x4f64f7,outputFormat:_0x30fcae,outputFile:_0x3ea67d}=_0x5c5edd,_0x73de1d=_0x5d83b3[_0x5b58cc(0x250)],_0x461373=loadLastTestRun();if(!_0x461373)return console[_0x5b58cc(0x23b)](a5_0x2602b0[_0x5b58cc(0x246)](_0x5b58cc(0x209))),console['log'](a5_0x2602b0['dim'](_0x5b58cc(0x24e))),0x1;if(_0x461373[_0x5b58cc(0x244)]['agentName']!==_0x4f64f7[_0x5b58cc(0x239)])return console[_0x5b58cc(0x23b)](a5_0x2602b0['red'](_0x5b58cc(0x224)+_0x461373[_0x5b58cc(0x244)][_0x5b58cc(0x239)]+_0x5b58cc(0x1e0)+_0x4f64f7[_0x5b58cc(0x239)]+'\x22.')),console['log'](a5_0x2602b0['dim'](_0x5b58cc(0x1e2))),0x1;const _0xce3c3b=new Set(_0x461373[_0x5b58cc(0x273)]['map'](_0x692ec1=>_0x692ec1[_0x5b58cc(0x262)])),_0x164029=_0x44db0e[_0x5b58cc(0x212)][_0x5b58cc(0x1db)](_0x334af2=>!_0xce3c3b[_0x5b58cc(0x217)](_0x334af2[_0x5b58cc(0x202)]));if(_0x164029[_0x5b58cc(0x26c)]>0x0&&_0x461373['site']!==_0x73de1d)return console[_0x5b58cc(0x23b)](a5_0x2602b0[_0x5b58cc(0x246)]('Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.')),console[_0x5b58cc(0x23b)](a5_0x2602b0[_0x5b58cc(0x1fd)](_0x5b58cc(0x243)+_0x461373['site']+_0x5b58cc(0x23f)+_0x73de1d+'\x22.')),console[_0x5b58cc(0x23b)](a5_0x2602b0['dim'](_0x5b58cc(0x242)+_0x461373[_0x5b58cc(0x250)]+_0x5b58cc(0x22d))),0x1;const _0x34aa3a=_0x44db0e['tests']['filter'](_0x2de607=>_0xce3c3b[_0x5b58cc(0x217)](_0x2de607[_0x5b58cc(0x202)])),_0x2e9ede=_0x164029;let _0x112c0e;try{_0x112c0e=await setupEvaluatorAgent(_0x39528b[_0x5b58cc(0x25d)],_0x5d83b3[_0x5b58cc(0x23a)]);}catch(_0x41387d){const _0x97e4e2=_0x41387d instanceof Error?_0x41387d[_0x5b58cc(0x252)]:String(_0x41387d);return console['log'](a5_0x2602b0['red']('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x97e4e2)),0x1;}console[_0x5b58cc(0x23b)](a5_0x2602b0[_0x5b58cc(0x1e4)](_0x5b58cc(0x24f))),console[_0x5b58cc(0x23b)](_0x5b58cc(0x1f4)+a5_0x2602b0[_0x5b58cc(0x1fa)](_0x461373[_0x5b58cc(0x25b)])),console[_0x5b58cc(0x23b)]('Agent:\x20'+a5_0x2602b0['white'](_0x461373[_0x5b58cc(0x244)][_0x5b58cc(0x1e3)]+'/'+_0x461373[_0x5b58cc(0x244)][_0x5b58cc(0x239)]));_0x2e9ede['length']>0x0&&console[_0x5b58cc(0x23b)](_0x5b58cc(0x22a)+a5_0x2602b0['yellow'](_0x2e9ede[_0x5b58cc(0x26c)]));console[_0x5b58cc(0x23b)]();const _0x4e9a75=[],_0x12b85a=Date[_0x5b58cc(0x26a)](),_0x55d4d2=createCommandSpinner(_0x5b58cc(0x20e));if(_0x34aa3a[_0x5b58cc(0x26c)]>0x0)try{const _0x52a8b5=await reevaluateFromCache(_0x39528b['llm'],_0x461373,{'tests':_0x34aa3a},{'evaluatorId':_0x112c0e,'onTestStart':(_0x23893c,_0x38ce77,_0x3c1dbd)=>{const _0x36319e=_0x5b58cc;_0x55d4d2[_0x36319e(0x267)]='Re-evaluating\x20'+(_0x38ce77+0x1)+'/'+_0x3c1dbd+':\x20'+_0x23893c+_0x36319e(0x1f3);if(!_0x55d4d2[_0x36319e(0x21a)])_0x55d4d2[_0x36319e(0x235)]();},'onTestComplete':(_0x1fa881,_0xd43593)=>{const _0x10d9d8=_0x5b58cc;_0x55d4d2['stop']();if(_0xd43593['status']==='PASS')console['log'](a5_0x2602b0[_0x10d9d8(0x245)](_0x10d9d8(0x241)+_0x1fa881)+a5_0x2602b0[_0x10d9d8(0x1fd)](_0x10d9d8(0x24a)));else _0xd43593[_0x10d9d8(0x23d)]===_0x10d9d8(0x263)?console[_0x10d9d8(0x23b)](a5_0x2602b0[_0x10d9d8(0x246)](_0x10d9d8(0x24c)+_0x1fa881+_0x10d9d8(0x214)+_0xd43593[_0x10d9d8(0x229)])+a5_0x2602b0['dim'](_0x10d9d8(0x24a))):console['log'](a5_0x2602b0[_0x10d9d8(0x246)](_0x10d9d8(0x1f8)+_0x1fa881+_0x10d9d8(0x214)+_0xd43593[_0x10d9d8(0x229)]));_0xd43593[_0x10d9d8(0x26e)]&&console[_0x10d9d8(0x23b)](a5_0x2602b0[_0x10d9d8(0x1fd)](_0x10d9d8(0x254)+_0xd43593[_0x10d9d8(0x26e)])),_0x4e9a75[_0x10d9d8(0x238)](_0xd43593);},'onTestSkipped':(_0x146ea3,_0x21f91c)=>{const _0x360834=_0x5b58cc;_0x55d4d2[_0x360834(0x240)](),console[_0x360834(0x23b)](a5_0x2602b0[_0x360834(0x225)](_0x360834(0x203)+_0x146ea3+'\x20-\x20'+_0x21f91c));}});for(const _0x2a2e4c of _0x52a8b5){!_0x4e9a75[_0x5b58cc(0x24d)](_0x26d449=>_0x26d449['name']===_0x2a2e4c[_0x5b58cc(0x202)])&&_0x4e9a75[_0x5b58cc(0x238)](_0x2a2e4c);}}catch(_0x3eb817){_0x55d4d2[_0x5b58cc(0x240)]();const _0x43870f=_0x3eb817 instanceof Error?_0x3eb817[_0x5b58cc(0x252)]:String(_0x3eb817);return console[_0x5b58cc(0x23b)](a5_0x2602b0[_0x5b58cc(0x246)](_0x5b58cc(0x26b)+_0x43870f)),0x1;}_0x55d4d2[_0x5b58cc(0x240)]();if(_0x2e9ede[_0x5b58cc(0x26c)]>0x0){console[_0x5b58cc(0x23b)](),console[_0x5b58cc(0x23b)](a5_0x2602b0[_0x5b58cc(0x1e4)](_0x5b58cc(0x270)));const {projectId:_0x2a42bc,agentId:_0x32c67d}=_0x461373[_0x5b58cc(0x244)];for(const _0x5ce826 of _0x2e9ede){console[_0x5b58cc(0x23b)](_0x5b58cc(0x1f5)+a5_0x2602b0['white'](_0x5ce826['name']));const _0x1d1782=createCommandSpinner(_0x5b58cc(0x21c)+_0x5ce826['rounds'][_0x5b58cc(0x26c)]+_0x5b58cc(0x268));_0x1d1782[_0x5b58cc(0x235)]();try{const {result:_0x5c6455}=await runTest(_0x39528b[_0x5b58cc(0x25d)],_0x5ce826,{'agentId':_0x32c67d,'projectId':_0x2a42bc,'site':_0x461373[_0x5b58cc(0x250)],'noEval':![],'evaluatorId':_0x112c0e,'onRoundStart':(_0x5c35d0,_0x33d0c7)=>{const _0x188f72=_0x5b58cc;_0x1d1782[_0x188f72(0x267)]=_0x188f72(0x234)+(_0x5c35d0+0x1)+'/'+_0x33d0c7+_0x188f72(0x268);},'onRoundComplete':(_0x465063,_0x3b5c59,_0x4decff)=>{const _0x53dbe6=_0x5b58cc,_0x4e2ef0=formatElapsed(_0x3b5c59);_0x4decff?console[_0x53dbe6(0x23b)](_0x53dbe6(0x201)+(_0x465063+0x1)+'/'+_0x5ce826[_0x53dbe6(0x260)][_0x53dbe6(0x26c)]+_0x53dbe6(0x23e)+a5_0x2602b0['green']('✓')+'\x20('+_0x4e2ef0+')'):console[_0x53dbe6(0x23b)]('\x20\x20Round\x20'+(_0x465063+0x1)+'/'+_0x5ce826['rounds'][_0x53dbe6(0x26c)]+_0x53dbe6(0x23e)+a5_0x2602b0['red']('✗'));},'onEvaluationStart':()=>{const _0xa16ea=_0x5b58cc;_0x1d1782['text']=_0xa16ea(0x1f9);},'onEvaluationComplete':_0x198b78=>{const _0x3ed614=_0x5b58cc,_0x1031a5=formatElapsed(_0x198b78);console[_0x3ed614(0x23b)](_0x3ed614(0x1f0)+a5_0x2602b0['green']('✓')+'\x20('+_0x1031a5+')');}});_0x1d1782[_0x5b58cc(0x240)](),_0x4e9a75[_0x5b58cc(0x238)](_0x5c6455);if(_0x5c6455[_0x5b58cc(0x23d)]===_0x5b58cc(0x226))console['log'](a5_0x2602b0[_0x5b58cc(0x245)](_0x5b58cc(0x241)+_0x5c6455[_0x5b58cc(0x229)])+a5_0x2602b0['dim'](_0x5b58cc(0x1f2)));else _0x5c6455[_0x5b58cc(0x23d)]===_0x5b58cc(0x263)?console[_0x5b58cc(0x23b)](a5_0x2602b0['red'](_0x5b58cc(0x24c)+_0x5c6455['reason'])+a5_0x2602b0['dim'](_0x5b58cc(0x1f2))):console['log'](a5_0x2602b0['red'](_0x5b58cc(0x1f8)+_0x5c6455['reason']));_0x5c6455[_0x5b58cc(0x26e)]&&console['log'](a5_0x2602b0[_0x5b58cc(0x1fd)](_0x5b58cc(0x254)+_0x5c6455['conversation_url']));}catch(_0x1e141e){_0x1d1782[_0x5b58cc(0x240)]();const _0x237c3f=_0x1e141e instanceof Error?_0x1e141e[_0x5b58cc(0x252)]:String(_0x1e141e);console[_0x5b58cc(0x23b)](a5_0x2602b0[_0x5b58cc(0x246)](_0x5b58cc(0x1f8)+_0x237c3f)),_0x4e9a75[_0x5b58cc(0x238)]({'name':_0x5ce826[_0x5b58cc(0x202)],'status':_0x5b58cc(0x1ed),'reason':_0x237c3f,'timestamp':new Date()[_0x5b58cc(0x233)](),'duration_ms':0x0});}}}console[_0x5b58cc(0x23b)]();const _0x1eded7=Date[_0x5b58cc(0x26a)]()-_0x12b85a,_0x5ef88f=_0x4e9a75['filter'](_0x37900c=>_0x37900c[_0x5b58cc(0x23d)]===_0x5b58cc(0x226))[_0x5b58cc(0x26c)],_0x143211=_0x4e9a75[_0x5b58cc(0x1db)](_0x2289e7=>_0x2289e7[_0x5b58cc(0x23d)]===_0x5b58cc(0x263))['length'],_0x361b0f=_0x4e9a75[_0x5b58cc(0x1db)](_0x22741d=>_0x22741d[_0x5b58cc(0x23d)]===_0x5b58cc(0x1ed))['length'];console[_0x5b58cc(0x23b)]('━'[_0x5b58cc(0x259)](0x3c)),console[_0x5b58cc(0x23b)](_0x5b58cc(0x269)),console[_0x5b58cc(0x23b)]('━'[_0x5b58cc(0x259)](0x3c)),console[_0x5b58cc(0x23b)](_0x5b58cc(0x22e)+_0x4e9a75['length']),console[_0x5b58cc(0x23b)](_0x5b58cc(0x1eb)+a5_0x2602b0[_0x5b58cc(0x245)](_0x5ef88f)),console[_0x5b58cc(0x23b)](_0x5b58cc(0x218)+a5_0x2602b0[_0x5b58cc(0x246)](_0x143211));_0x361b0f>0x0&&console[_0x5b58cc(0x23b)](_0x5b58cc(0x1dc)+a5_0x2602b0[_0x5b58cc(0x246)](_0x361b0f));console[_0x5b58cc(0x23b)](_0x5b58cc(0x25f)+formatElapsed(_0x1eded7)),console[_0x5b58cc(0x23b)]('━'[_0x5b58cc(0x259)](0x3c));const _0x2752c2={'summary':{'total':_0x4e9a75['length'],'passed':_0x5ef88f,'failed':_0x143211,'errors':_0x361b0f>0x0?_0x361b0f:undefined,'duration_ms':_0x1eded7},'tests':_0x4e9a75,'agent':{'project':_0x4f64f7['projectName'],'name':_0x4f64f7[_0x5b58cc(0x239)],'site':_0x73de1d},'timestamp':new Date(_0x12b85a)[_0x5b58cc(0x233)]()};if(_0x30fcae!==_0x5b58cc(0x215)||_0x3ea67d){const _0x9631e6=formatResults(_0x2752c2,_0x30fcae);if(_0x3ea67d)try{a5_0x5691f7['writeFileSync'](_0x3ea67d,_0x9631e6,_0x5b58cc(0x1e8)),console['log'](),console[_0x5b58cc(0x23b)](a5_0x2602b0['dim'](_0x5b58cc(0x23c)+_0x3ea67d));}catch(_0xac615a){return console[_0x5b58cc(0x23b)](),console[_0x5b58cc(0x23b)](a5_0x2602b0[_0x5b58cc(0x246)](_0x5b58cc(0x208)+_0xac615a)),0x1;}else console[_0x5b58cc(0x23b)](),console[_0x5b58cc(0x23b)](_0x9631e6);}const _0x24dadc=_0x4e9a75[_0x5b58cc(0x1db)](_0x4d7687=>_0x4d7687[_0x5b58cc(0x23d)]!==_0x5b58cc(0x226));return _0x24dadc[_0x5b58cc(0x26c)]>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0xef2f7=a5_0x3ee2;(function(_0xb54169,_0x2ed4d3){const _0x934c15=a5_0x3ee2,_0x335bbb=_0xb54169();while(!![]){try{const _0x54b826=parseInt(_0x934c15(0x10a))/0x1*(-parseInt(_0x934c15(0xbc))/0x2)+parseInt(_0x934c15(0xf3))/0x3*(-parseInt(_0x934c15(0x144))/0x4)+-parseInt(_0x934c15(0x119))/0x5+parseInt(_0x934c15(0xc9))/0x6*(-parseInt(_0x934c15(0x146))/0x7)+parseInt(_0x934c15(0x140))/0x8+-parseInt(_0x934c15(0xe0))/0x9*(-parseInt(_0x934c15(0x130))/0xa)+parseInt(_0x934c15(0x14a))/0xb*(parseInt(_0x934c15(0x14c))/0xc);if(_0x54b826===_0x2ed4d3)break;else _0x335bbb['push'](_0x335bbb['shift']());}catch(_0x2caf75){_0x335bbb['push'](_0x335bbb['shift']());}}}(a5_0x164f,0x323b5));import*as a5_0x417471 from'node:fs';import*as a5_0x38cb8d from'node:path';function a5_0x164f(){const _0x1236ee=['map',':\x20Sending\x20user\x20input...','white','yellow','trim','no_context','agent','144938VMezuz','existsSync','utf-8','Re-evaluating\x20','start','not\x20found','now','projectDir','toISOString','timestamp','\x20\x20Conversation:\x20','Evaluating\x20response...','Using\x20agent:\x20','8520FslPUA','writeFileSync','Re-evaluating...','Either\x20switch\x20to\x20the\x20\x22','executeReeval','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','basename','FAIL','found','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','split','Errors:\x20\x20\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','forEach','Round\x201/','rounds','Agent:\x20','dim','\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)','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','agent:test','projectName','substring','499536MHUCBT','resolve','Running\x20test:\x20','\x22,\x20but\x20current\x20site\x20is\x20\x22','PASS','Error:\x20No\x20previous\x20test\x20run\x20found.','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','\x20(cached)','reeval','Round\x20','✗\x20ERROR:\x20','Test\x20','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','Running\x20agent\x20tests...','\x22:\x20','cyan','green','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','\x20\x20Evaluating...\x20','3YbllTO','status','agentName','\x20\x20Project:\x20','verbose','resolveAgentId','eval','Conversation\x20URL:\x20','description','Executing\x20new\x20tests...','testName','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','ERROR','red','stop','join','message','\x20\x20Agent:\x20','has','\x20\x20-\x20','reason','conversation_url','Total:\x20\x20\x20\x20','1ZZtfiz','log','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','tsv','isSpinning','Run\x20tests\x20for\x20an\x20LLM\x20agent','testYmlPath','push','Failed\x20Tests:','jsonl','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','\x20\x20tdx\x20agent\x20test\x20<path>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20from\x20path','No\x20tests\x20have\x20tags\x20defined.','filter','repeat','206270OiQfLO','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','Available\x20tags:\x20','Error\x20writing\x20output\x20file:\x20','Cached\x20run\x20from:\x20','no_local_folder','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','length','context','source','✗\x20ERROR:\x20Project\x20not\x20found:\x20','\x20-\x20','some','llmProject','resolveProjectId','site','tests','Failed:\x20\x20\x20','json','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','\x20\x20Site:\x20','add','output','10EtWsRP','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','find','round','⚠\x20SKIPPED:\x20','tags','no_tests','Available\x20tests:\x20','Re-evaluating\x20cached\x20test\x20run...','name','includes','llm','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','table','No\x20tests\x20found\x20with\x20tags:\x20','✗\x20FAIL:\x20','2742584DbSpnA','...','404','text','1536028lYGeqm','Output\x20written\x20to:\x20','1771rHTgQZ','conversations','✓\x20PASS:\x20','\x20\x20Round\x20','18788lwgbaa','Cached\x20run\x20is\x20from\x20site\x20\x22','4668OuRkFy','...\x20','\x20(new)','toLowerCase'];a5_0x164f=function(){return _0x1236ee;};return a5_0x164f();}import a5_0x2e2218 from'chalk';function a5_0x3ee2(_0x2938a4,_0x352df6){_0x2938a4=_0x2938a4-0xbb;const _0x164fd0=a5_0x164f();let _0x3ee253=_0x164fd0[_0x2938a4];return _0x3ee253;}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_0xef2f7(0x139)]=a5_0xef2f7(0xdd);[a5_0xef2f7(0xfb)]=a5_0xef2f7(0x10f);async['execute'](_0x4951bc){const _0x2bf69b=a5_0xef2f7,{options:_0x11bcf5,args:_0x4ecbe2,tdx:_0x9cf46a}=_0x4951bc,_0x52bcd9=_0x4ecbe2[0x0]||'.',_0x3de9da=_0x11bcf5['dryRun'],_0x3c9d60=_0x11bcf5,_0x14757c=_0x3c9d60[_0x2bf69b(0xf9)]===![],_0x35f9f6=_0x3c9d60[_0x2bf69b(0xe8)],_0x5c1fea=_0x3c9d60[_0x2bf69b(0x139)],_0x41ea18=_0x3c9d60[_0x2bf69b(0x135)],_0x11b54c=_0x11bcf5['site'],_0x525b83=_0x3c9d60[_0x2bf69b(0x12f)];if(_0x35f9f6&&_0x14757c)return console[_0x2bf69b(0x10b)](a5_0x2e2218['red'](_0x2bf69b(0xce))),0x1;let _0x3db5b1=_0x2bf69b(0x13d);if(_0x3c9d60[_0x2bf69b(0x12b)])_0x3db5b1=_0x2bf69b(0x12b);else{if(_0x3c9d60[_0x2bf69b(0x113)])_0x3db5b1=_0x2bf69b(0x113);else{if(_0x3c9d60['tsv'])_0x3db5b1=_0x2bf69b(0x10d);else{if(_0x3c9d60['table'])_0x3db5b1=_0x2bf69b(0x13d);}}}const _0x5d7d7d=_0x3c9d60['llmProject'];let _0x26d1fb=_0x52bcd9;const _0x478203=a5_0x417471[_0x2bf69b(0xbd)](_0x52bcd9),_0x45b632=_0x52bcd9==='.';if(!_0x478203||_0x45b632){const _0x16585e=resolveProjectFromContext(_0x52bcd9,_0x5d7d7d,{'requireFile':'test.yml'});if(_0x16585e[_0x2bf69b(0xd1)])_0x26d1fb=_0x16585e[_0x2bf69b(0xc3)],_0x16585e[_0x2bf69b(0x122)]===_0x2bf69b(0x121)&&console[_0x2bf69b(0x10b)](a5_0x2e2218[_0x2bf69b(0xda)](_0x2bf69b(0xc8)+_0x26d1fb));else switch(_0x16585e[_0x2bf69b(0x107)]){case _0x2bf69b(0x155):console['log'](a5_0x2e2218['yellow'](_0x16585e[_0x2bf69b(0x103)])),console[_0x2bf69b(0x10b)](),console[_0x2bf69b(0x10b)]('Usage:'),console[_0x2bf69b(0x10b)](_0x2bf69b(0x115)),console['log'](_0x2bf69b(0xdb)),console[_0x2bf69b(0x10b)](),console['log'](_0x2bf69b(0x11a));return 0x1;case _0x2bf69b(0x11e):console[_0x2bf69b(0x10b)](a5_0x2e2218[_0x2bf69b(0x153)](_0x16585e[_0x2bf69b(0x103)])),console[_0x2bf69b(0x10b)](),console[_0x2bf69b(0x10b)]('Run\x20\x27tdx\x20agent\x20pull\x20'+_0x16585e[_0x2bf69b(0x126)]+'\x27\x20to\x20create\x20the\x20folder\x20structure.');return 0x1;case'multiple_agents':{const _0x1a9dbd=a5_0x38cb8d[_0x2bf69b(0xcf)](_0x16585e[_0x2bf69b(0xc3)]);console[_0x2bf69b(0x10b)](a5_0x2e2218[_0x2bf69b(0x153)](_0x2bf69b(0xd2)+_0x16585e[_0x2bf69b(0x126)]+'\x22:'));for(const _0x198209 of _0x16585e['agentDirs']){console[_0x2bf69b(0x10b)](_0x2bf69b(0x106)+_0x198209);}return console[_0x2bf69b(0x10b)](),console[_0x2bf69b(0x10b)](_0x2bf69b(0xdc)+_0x1a9dbd+'/<agent-name>'),0x1;}case _0x2bf69b(0x136):console['log'](a5_0x2e2218['yellow'](_0x2bf69b(0x114)+_0x16585e[_0x2bf69b(0x126)]+'\x22.')),console[_0x2bf69b(0x10b)](a5_0x2e2218['dim']('Project\x20path:\x20'+_0x16585e['projectDir'])),console[_0x2bf69b(0x10b)](),console['log'](_0x2bf69b(0xe6));return 0x1;}}const {definition:_0x17393c,agentInfo:_0x2a7942}=parseTestFile(_0x26d1fb);let _0x40c218=_0x17393c[_0x2bf69b(0x129)];if(_0x5c1fea){const _0x248519=_0x5c1fea[_0x2bf69b(0xd3)](',')[_0x2bf69b(0x150)](_0x36347d=>_0x36347d[_0x2bf69b(0x154)]());_0x40c218=_0x17393c[_0x2bf69b(0x129)]['filter'](_0x505223=>_0x248519[_0x2bf69b(0x13a)](_0x505223['name']));if(_0x40c218[_0x2bf69b(0x120)]===0x0)return console[_0x2bf69b(0x10b)](a5_0x2e2218[_0x2bf69b(0x153)]('No\x20tests\x20found\x20matching:\x20'+_0x5c1fea)),console['log'](a5_0x2e2218[_0x2bf69b(0xda)](_0x2bf69b(0x137)+_0x17393c[_0x2bf69b(0x129)][_0x2bf69b(0x150)](_0x5f3339=>_0x5f3339[_0x2bf69b(0x139)])[_0x2bf69b(0x102)](',\x20'))),0x1;}if(_0x41ea18){const _0x147858=_0x41ea18[_0x2bf69b(0xd3)](',')[_0x2bf69b(0x150)](_0x1086a8=>_0x1086a8[_0x2bf69b(0x154)]()[_0x2bf69b(0x14f)]());_0x40c218=_0x40c218['filter'](_0x5c7e05=>_0x5c7e05[_0x2bf69b(0x135)]?.[_0x2bf69b(0x125)](_0x25b86a=>_0x147858['includes'](_0x25b86a['toLowerCase']())));if(_0x40c218[_0x2bf69b(0x120)]===0x0){console[_0x2bf69b(0x10b)](a5_0x2e2218[_0x2bf69b(0x153)](_0x2bf69b(0x13e)+_0x41ea18));const _0x470d7b=new Set();return _0x17393c['tests']['forEach'](_0x330da9=>_0x330da9[_0x2bf69b(0x135)]?.[_0x2bf69b(0xd6)](_0x696543=>_0x470d7b[_0x2bf69b(0x12e)](_0x696543))),_0x470d7b['size']>0x0?console[_0x2bf69b(0x10b)](a5_0x2e2218[_0x2bf69b(0xda)](_0x2bf69b(0x11b)+[..._0x470d7b][_0x2bf69b(0x102)](',\x20'))):console['log'](a5_0x2e2218[_0x2bf69b(0xda)](_0x2bf69b(0x116))),0x1;}}if(_0x35f9f6)return this[_0x2bf69b(0xcd)](_0x4951bc,{'definition':{'tests':_0x40c218},'agentInfo':_0x2a7942,'outputFormat':_0x3db5b1,'outputFile':_0x525b83,'testNames':_0x5c1fea});if(_0x3de9da){console['log'](a5_0x2e2218[_0x2bf69b(0xef)]('Test\x20Configuration:')),console['log'](_0x2bf69b(0x12d)+a5_0x2e2218['white'](_0x11b54c)),console[_0x2bf69b(0x10b)](_0x2bf69b(0xf6)+a5_0x2e2218[_0x2bf69b(0x152)](_0x2a7942[_0x2bf69b(0xde)])),console[_0x2bf69b(0x10b)](_0x2bf69b(0x104)+a5_0x2e2218[_0x2bf69b(0x152)](_0x2a7942[_0x2bf69b(0xf5)])),console[_0x2bf69b(0x10b)](),console['log']('Tests\x20found:\x20'+a5_0x2e2218[_0x2bf69b(0x152)](_0x40c218[_0x2bf69b(0x120)]));for(let _0x236c7d=0x0;_0x236c7d<_0x40c218[_0x2bf69b(0x120)];_0x236c7d++){const _0x193900=_0x40c218[_0x236c7d],_0x2acd77=_0x193900['rounds'][_0x2bf69b(0x120)]===0x1?_0x2bf69b(0x133):'rounds',_0x37a3ff=_0x193900[_0x2bf69b(0x135)]?.['length']?'\x20['+_0x193900[_0x2bf69b(0x135)][_0x2bf69b(0x102)](',\x20')+']':'';console[_0x2bf69b(0x10b)]('\x20\x20'+(_0x236c7d+0x1)+'.\x20'+a5_0x2e2218[_0x2bf69b(0x152)](_0x193900[_0x2bf69b(0x139)])+'\x20('+_0x193900[_0x2bf69b(0xd8)][_0x2bf69b(0x120)]+'\x20'+_0x2acd77+')'+a5_0x2e2218[_0x2bf69b(0xda)](_0x37a3ff));}return 0x0;}let _0x383fd9,_0x71dbfd;try{_0x383fd9=await _0x9cf46a['llm'][_0x2bf69b(0x127)](_0x2a7942[_0x2bf69b(0xde)]);}catch(_0x4d8bd5){const _0x1aa32f=_0x4d8bd5 instanceof Error?_0x4d8bd5[_0x2bf69b(0x103)]:String(_0x4d8bd5);return _0x1aa32f[_0x2bf69b(0x13a)](_0x2bf69b(0x142))||_0x1aa32f['toLowerCase']()[_0x2bf69b(0x13a)](_0x2bf69b(0xc1))?console[_0x2bf69b(0x10b)](a5_0x2e2218[_0x2bf69b(0x100)](_0x2bf69b(0x123)+_0x2a7942[_0x2bf69b(0xde)])):console['log'](a5_0x2e2218[_0x2bf69b(0x100)]('✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22'+_0x2a7942[_0x2bf69b(0xde)]+_0x2bf69b(0xee)+_0x1aa32f)),0x1;}try{_0x71dbfd=await _0x9cf46a[_0x2bf69b(0x13b)][_0x2bf69b(0xf8)](_0x2a7942[_0x2bf69b(0xf5)],_0x383fd9);}catch(_0x11b06e){const _0x37497b=_0x11b06e instanceof Error?_0x11b06e[_0x2bf69b(0x103)]:String(_0x11b06e);return _0x37497b[_0x2bf69b(0x13a)](_0x2bf69b(0x142))||_0x37497b[_0x2bf69b(0x14f)]()[_0x2bf69b(0x13a)](_0x2bf69b(0xc1))?console[_0x2bf69b(0x10b)](a5_0x2e2218['red'](_0x2bf69b(0x12c)+_0x2a7942['agentName'])):console['log'](a5_0x2e2218[_0x2bf69b(0x100)](_0x2bf69b(0xd5)+_0x2a7942[_0x2bf69b(0xf5)]+_0x2bf69b(0xee)+_0x37497b)),0x1;}let _0x229c12;if(!_0x14757c)try{_0x229c12=await setupEvaluatorAgent(_0x9cf46a['llm'],_0x11bcf5['verbose']);}catch(_0x1d00eb){const _0x40ab8d=_0x1d00eb instanceof Error?_0x1d00eb[_0x2bf69b(0x103)]:String(_0x1d00eb);return console[_0x2bf69b(0x10b)](a5_0x2e2218[_0x2bf69b(0x100)]('✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20'+_0x40ab8d)),0x1;}console['log'](a5_0x2e2218[_0x2bf69b(0xef)](_0x2bf69b(0xed))),console[_0x2bf69b(0x10b)]('Site:\x20'+a5_0x2e2218[_0x2bf69b(0x152)](_0x11b54c)),console['log'](_0x2bf69b(0xd9)+a5_0x2e2218[_0x2bf69b(0x152)](_0x2a7942[_0x2bf69b(0xde)]+'/'+_0x2a7942[_0x2bf69b(0xf5)])),console[_0x2bf69b(0x10b)]();const _0x4f29ce=[],_0x5a6fe1=[],_0x24f911=Date[_0x2bf69b(0xc2)]();for(let _0x32288f=0x0;_0x32288f<_0x40c218[_0x2bf69b(0x120)];_0x32288f++){const _0x2e2bb5=_0x40c218[_0x32288f];_0x40c218['length']>0x1?console[_0x2bf69b(0x10b)](_0x2bf69b(0xeb)+(_0x32288f+0x1)+'/'+_0x40c218[_0x2bf69b(0x120)]+':\x20'+a5_0x2e2218['white'](_0x2e2bb5['name'])):console['log'](_0x2bf69b(0xe2)+a5_0x2e2218[_0x2bf69b(0x152)](_0x2e2bb5[_0x2bf69b(0x139)]));const _0x306338=createCommandSpinner(_0x2bf69b(0xd7)+_0x2e2bb5['rounds'][_0x2bf69b(0x120)]+':\x20Sending\x20user\x20input...');_0x306338[_0x2bf69b(0xc0)]();try{const {result:_0x5b4bd6,conversation:_0x464238}=await runTest(_0x9cf46a[_0x2bf69b(0x13b)],_0x2e2bb5,{'agentId':_0x71dbfd,'projectId':_0x383fd9,'site':_0x11b54c,'noEval':_0x14757c,'evaluatorId':_0x229c12,'onRoundStart':(_0x12846d,_0x47b08b)=>{const _0x2a6d6d=_0x2bf69b;_0x306338['text']=_0x2a6d6d(0xe9)+(_0x12846d+0x1)+'/'+_0x47b08b+_0x2a6d6d(0x151);},'onRoundComplete':(_0x289ca8,_0x17819b,_0x571f79)=>{const _0x2e9372=_0x2bf69b,_0xa4f5c4=formatElapsed(_0x17819b);_0x571f79?console['log'](_0x2e9372(0x149)+(_0x289ca8+0x1)+'/'+_0x2e2bb5['rounds'][_0x2e9372(0x120)]+_0x2e9372(0x14d)+a5_0x2e2218[_0x2e9372(0xf0)]('✓')+'\x20('+_0xa4f5c4+')'):console[_0x2e9372(0x10b)](_0x2e9372(0x149)+(_0x289ca8+0x1)+'/'+_0x2e2bb5['rounds'][_0x2e9372(0x120)]+_0x2e9372(0x14d)+a5_0x2e2218[_0x2e9372(0x100)]('✗'));},'onEvaluationStart':()=>{const _0x26c3de=_0x2bf69b;_0x306338[_0x26c3de(0x143)]=_0x26c3de(0xc7);},'onEvaluationComplete':_0x186b8b=>{const _0x227df4=_0x2bf69b,_0x1067df=formatElapsed(_0x186b8b);console[_0x227df4(0x10b)](_0x227df4(0xf2)+a5_0x2e2218[_0x227df4(0xf0)]('✓')+'\x20('+_0x1067df+')');}});_0x306338[_0x2bf69b(0x101)](),_0x4f29ce[_0x2bf69b(0x111)](_0x5b4bd6),_0x5a6fe1[_0x2bf69b(0x111)](_0x464238);if(_0x5b4bd6[_0x2bf69b(0xf4)]==='PASS')console[_0x2bf69b(0x10b)](a5_0x2e2218[_0x2bf69b(0xf0)](_0x2bf69b(0x148)+_0x5b4bd6[_0x2bf69b(0x107)]));else _0x5b4bd6[_0x2bf69b(0xf4)]===_0x2bf69b(0xd0)?console[_0x2bf69b(0x10b)](a5_0x2e2218['red'](_0x2bf69b(0x13f)+_0x5b4bd6[_0x2bf69b(0x107)])):console[_0x2bf69b(0x10b)](a5_0x2e2218[_0x2bf69b(0x100)](_0x2bf69b(0xea)+_0x5b4bd6[_0x2bf69b(0x107)]));_0x5b4bd6[_0x2bf69b(0x108)]&&console[_0x2bf69b(0x10b)](a5_0x2e2218['dim'](_0x2bf69b(0xfa)+_0x5b4bd6[_0x2bf69b(0x108)])),console[_0x2bf69b(0x10b)]();}catch(_0x54ac1e){_0x306338[_0x2bf69b(0x101)]();const _0x274c4a=_0x54ac1e instanceof Error?_0x54ac1e[_0x2bf69b(0x103)]:String(_0x54ac1e);console[_0x2bf69b(0x10b)](a5_0x2e2218[_0x2bf69b(0x100)](_0x2bf69b(0xea)+_0x274c4a)),console[_0x2bf69b(0x10b)](),_0x4f29ce[_0x2bf69b(0x111)]({'name':_0x2e2bb5[_0x2bf69b(0x139)],'status':_0x2bf69b(0xff),'reason':_0x274c4a,'timestamp':new Date()[_0x2bf69b(0xc4)](),'duration_ms':0x0});}}const _0x12ea52=Date['now']()-_0x24f911,_0x27b476=_0x4f29ce[_0x2bf69b(0x117)](_0x2e9622=>_0x2e9622['status']===_0x2bf69b(0xe4))[_0x2bf69b(0x120)],_0x1640c5=_0x4f29ce['filter'](_0x499135=>_0x499135[_0x2bf69b(0xf4)]===_0x2bf69b(0xd0))[_0x2bf69b(0x120)],_0x159be6=_0x4f29ce['filter'](_0x30bd6e=>_0x30bd6e[_0x2bf69b(0xf4)]===_0x2bf69b(0xff))[_0x2bf69b(0x120)];console[_0x2bf69b(0x10b)]('━'[_0x2bf69b(0x118)](0x3c)),console['log']('Test\x20Summary'),console[_0x2bf69b(0x10b)]('━'[_0x2bf69b(0x118)](0x3c)),console[_0x2bf69b(0x10b)]('Total:\x20\x20\x20\x20'+_0x4f29ce[_0x2bf69b(0x120)]),console[_0x2bf69b(0x10b)]('Passed:\x20\x20\x20'+a5_0x2e2218[_0x2bf69b(0xf0)](_0x27b476)),console['log'](_0x2bf69b(0x12a)+a5_0x2e2218[_0x2bf69b(0x100)](_0x1640c5));_0x159be6>0x0&&console['log'](_0x2bf69b(0xd4)+a5_0x2e2218[_0x2bf69b(0x100)](_0x159be6));console[_0x2bf69b(0x10b)]('Duration:\x20'+formatElapsed(_0x12ea52)),console[_0x2bf69b(0x10b)]('━'[_0x2bf69b(0x118)](0x3c));const _0x5d7f84=_0x4f29ce[_0x2bf69b(0x117)](_0x55ae3b=>_0x55ae3b[_0x2bf69b(0xf4)]!=='PASS');if(_0x5d7f84['length']>0x0){console['log'](),console['log'](_0x2bf69b(0x112));for(const _0x4a66f2 of _0x5d7f84){const _0x500886=a5_0x2e2218[_0x2bf69b(0x100)]('✗'),_0x36e0a0=_0x4a66f2[_0x2bf69b(0x107)][_0x2bf69b(0x120)]>0x32?_0x4a66f2[_0x2bf69b(0x107)][_0x2bf69b(0xdf)](0x0,0x32)+_0x2bf69b(0x141):_0x4a66f2['reason'];console[_0x2bf69b(0x10b)]('\x20\x20'+_0x500886+'\x20'+_0x4a66f2[_0x2bf69b(0x139)]+':\x20'+_0x36e0a0);}}const _0x3d9d0a={'summary':{'total':_0x4f29ce['length'],'passed':_0x27b476,'failed':_0x1640c5,'errors':_0x159be6>0x0?_0x159be6:undefined,'duration_ms':_0x12ea52},'tests':_0x4f29ce,'agent':{'project':_0x2a7942[_0x2bf69b(0xde)],'name':_0x2a7942['agentName'],'site':_0x11b54c},'timestamp':new Date(_0x24f911)[_0x2bf69b(0xc4)]()};try{const _0xa208da=buildCachedTestRun(_0x5a6fe1,{'site':_0x11b54c,'projectId':_0x383fd9,'projectName':_0x2a7942['projectName'],'agentId':_0x71dbfd,'agentName':_0x2a7942[_0x2bf69b(0xf5)],'testYmlPath':a5_0x38cb8d[_0x2bf69b(0xe1)](_0x2a7942[_0x2bf69b(0x110)])});saveLastTestRun(_0xa208da);}catch{}if(_0x3db5b1!==_0x2bf69b(0x13d)||_0x525b83){const _0x20d413=formatResults(_0x3d9d0a,_0x3db5b1);if(_0x525b83)try{a5_0x417471[_0x2bf69b(0xca)](_0x525b83,_0x20d413,_0x2bf69b(0xbe)),console[_0x2bf69b(0x10b)](),console['log'](a5_0x2e2218[_0x2bf69b(0xda)](_0x2bf69b(0x145)+_0x525b83));}catch(_0x556659){return console[_0x2bf69b(0x10b)](),console['log'](a5_0x2e2218[_0x2bf69b(0x100)]('Error\x20writing\x20output\x20file:\x20'+_0x556659)),0x1;}else console['log'](),console[_0x2bf69b(0x10b)](_0x20d413);}return _0x5d7f84[_0x2bf69b(0x120)]>0x0?0x1:0x0;}async['executeReeval'](_0x32afd6,_0x592a01){const _0x13e8dd=a5_0xef2f7,{options:_0x27318d,tdx:_0x5cc7dc}=_0x32afd6,{definition:_0x21134b,agentInfo:_0x54348d,outputFormat:_0x3d1800,outputFile:_0x52edd0}=_0x592a01,_0x456762=_0x27318d[_0x13e8dd(0x128)],_0x87ef1b=loadLastTestRun();if(!_0x87ef1b)return console[_0x13e8dd(0x10b)](a5_0x2e2218[_0x13e8dd(0x100)](_0x13e8dd(0xe5))),console[_0x13e8dd(0x10b)](a5_0x2e2218[_0x13e8dd(0xda)](_0x13e8dd(0xfe))),0x1;if(_0x87ef1b['agent']['agentName']!==_0x54348d[_0x13e8dd(0xf5)])return console[_0x13e8dd(0x10b)](a5_0x2e2218[_0x13e8dd(0x100)](_0x13e8dd(0x11f)+_0x87ef1b[_0x13e8dd(0xbb)][_0x13e8dd(0xf5)]+_0x13e8dd(0x13c)+_0x54348d[_0x13e8dd(0xf5)]+'\x22.')),console['log'](a5_0x2e2218[_0x13e8dd(0xda)](_0x13e8dd(0x131))),0x1;const _0x3b8a85=new Set(_0x87ef1b[_0x13e8dd(0x147)]['map'](_0x44d7e7=>_0x44d7e7[_0x13e8dd(0xfd)])),_0x1ef178=_0x21134b[_0x13e8dd(0x129)][_0x13e8dd(0x117)](_0x14f751=>!_0x3b8a85[_0x13e8dd(0x105)](_0x14f751[_0x13e8dd(0x139)]));if(_0x1ef178[_0x13e8dd(0x120)]>0x0&&_0x87ef1b[_0x13e8dd(0x128)]!==_0x456762)return console[_0x13e8dd(0x10b)](a5_0x2e2218[_0x13e8dd(0x100)](_0x13e8dd(0xec))),console[_0x13e8dd(0x10b)](a5_0x2e2218['dim'](_0x13e8dd(0x14b)+_0x87ef1b['site']+_0x13e8dd(0xe3)+_0x456762+'\x22.')),console[_0x13e8dd(0x10b)](a5_0x2e2218[_0x13e8dd(0xda)](_0x13e8dd(0xcc)+_0x87ef1b['site']+_0x13e8dd(0x10c))),0x1;const _0x433537=_0x21134b[_0x13e8dd(0x129)]['filter'](_0x43b240=>_0x3b8a85[_0x13e8dd(0x105)](_0x43b240[_0x13e8dd(0x139)])),_0x386789=_0x1ef178;let _0x5ac000;try{_0x5ac000=await setupEvaluatorAgent(_0x5cc7dc['llm'],_0x27318d[_0x13e8dd(0xf7)]);}catch(_0x1c330b){const _0x44f478=_0x1c330b instanceof Error?_0x1c330b[_0x13e8dd(0x103)]:String(_0x1c330b);return console[_0x13e8dd(0x10b)](a5_0x2e2218[_0x13e8dd(0x100)](_0x13e8dd(0xf1)+_0x44f478)),0x1;}console['log'](a5_0x2e2218['cyan'](_0x13e8dd(0x138))),console[_0x13e8dd(0x10b)](_0x13e8dd(0x11d)+a5_0x2e2218[_0x13e8dd(0x152)](_0x87ef1b[_0x13e8dd(0xc5)])),console[_0x13e8dd(0x10b)](_0x13e8dd(0xd9)+a5_0x2e2218[_0x13e8dd(0x152)](_0x87ef1b[_0x13e8dd(0xbb)]['projectName']+'/'+_0x87ef1b['agent'][_0x13e8dd(0xf5)]));_0x386789['length']>0x0&&console[_0x13e8dd(0x10b)]('New\x20tests\x20to\x20execute:\x20'+a5_0x2e2218[_0x13e8dd(0x153)](_0x386789[_0x13e8dd(0x120)]));console['log']();const _0x5e6696=[],_0x418bf1=Date['now'](),_0x64ef13=createCommandSpinner(_0x13e8dd(0xcb));if(_0x433537[_0x13e8dd(0x120)]>0x0)try{const _0x584473=await reevaluateFromCache(_0x5cc7dc[_0x13e8dd(0x13b)],_0x87ef1b,{'tests':_0x433537},{'evaluatorId':_0x5ac000,'onTestStart':(_0x405575,_0x538241,_0x5261e0)=>{const _0x539501=_0x13e8dd;_0x64ef13[_0x539501(0x143)]=_0x539501(0xbf)+(_0x538241+0x1)+'/'+_0x5261e0+':\x20'+_0x405575+_0x539501(0x141);if(!_0x64ef13[_0x539501(0x10e)])_0x64ef13[_0x539501(0xc0)]();},'onTestComplete':(_0x37bdba,_0x3f7581)=>{const _0x13bc23=_0x13e8dd;_0x64ef13[_0x13bc23(0x101)]();if(_0x3f7581['status']==='PASS')console[_0x13bc23(0x10b)](a5_0x2e2218['green'](_0x13bc23(0x148)+_0x37bdba)+a5_0x2e2218[_0x13bc23(0xda)](_0x13bc23(0xe7)));else _0x3f7581[_0x13bc23(0xf4)]==='FAIL'?console[_0x13bc23(0x10b)](a5_0x2e2218[_0x13bc23(0x100)]('✗\x20FAIL:\x20'+_0x37bdba+_0x13bc23(0x124)+_0x3f7581[_0x13bc23(0x107)])+a5_0x2e2218[_0x13bc23(0xda)](_0x13bc23(0xe7))):console[_0x13bc23(0x10b)](a5_0x2e2218['red']('✗\x20ERROR:\x20'+_0x37bdba+_0x13bc23(0x124)+_0x3f7581[_0x13bc23(0x107)]));_0x3f7581[_0x13bc23(0x108)]&&console[_0x13bc23(0x10b)](a5_0x2e2218[_0x13bc23(0xda)](_0x13bc23(0xc6)+_0x3f7581['conversation_url'])),_0x5e6696[_0x13bc23(0x111)](_0x3f7581);},'onTestSkipped':(_0xa7cbcc,_0x26e990)=>{const _0x43b2e4=_0x13e8dd;_0x64ef13[_0x43b2e4(0x101)](),console[_0x43b2e4(0x10b)](a5_0x2e2218[_0x43b2e4(0x153)](_0x43b2e4(0x134)+_0xa7cbcc+_0x43b2e4(0x124)+_0x26e990));}});for(const _0x10357a of _0x584473){!_0x5e6696[_0x13e8dd(0x132)](_0xe7b563=>_0xe7b563[_0x13e8dd(0x139)]===_0x10357a['name'])&&_0x5e6696[_0x13e8dd(0x111)](_0x10357a);}}catch(_0x6c118a){_0x64ef13[_0x13e8dd(0x101)]();const _0x54e596=_0x6c118a instanceof Error?_0x6c118a[_0x13e8dd(0x103)]:String(_0x6c118a);return console[_0x13e8dd(0x10b)](a5_0x2e2218['red']('✗\x20ERROR:\x20Re-evaluation\x20failed:\x20'+_0x54e596)),0x1;}_0x64ef13[_0x13e8dd(0x101)]();if(_0x386789[_0x13e8dd(0x120)]>0x0){console[_0x13e8dd(0x10b)](),console[_0x13e8dd(0x10b)](a5_0x2e2218[_0x13e8dd(0xef)](_0x13e8dd(0xfc)));const {projectId:_0x30d121,agentId:_0x349b85}=_0x87ef1b[_0x13e8dd(0xbb)];for(const _0xddc155 of _0x386789){console[_0x13e8dd(0x10b)]('Running:\x20'+a5_0x2e2218[_0x13e8dd(0x152)](_0xddc155[_0x13e8dd(0x139)]));const _0x15f271=createCommandSpinner(_0x13e8dd(0xd7)+_0xddc155[_0x13e8dd(0xd8)]['length']+_0x13e8dd(0x151));_0x15f271[_0x13e8dd(0xc0)]();try{const {result:_0x5d7c1}=await runTest(_0x5cc7dc[_0x13e8dd(0x13b)],_0xddc155,{'agentId':_0x349b85,'projectId':_0x30d121,'site':_0x87ef1b[_0x13e8dd(0x128)],'noEval':![],'evaluatorId':_0x5ac000,'onRoundStart':(_0x349b91,_0x29a053)=>{const _0x42e458=_0x13e8dd;_0x15f271[_0x42e458(0x143)]=_0x42e458(0xe9)+(_0x349b91+0x1)+'/'+_0x29a053+_0x42e458(0x151);},'onRoundComplete':(_0x4c7aa6,_0x4ad4c7,_0x139b88)=>{const _0x1b9edb=_0x13e8dd,_0x83d4b9=formatElapsed(_0x4ad4c7);_0x139b88?console[_0x1b9edb(0x10b)](_0x1b9edb(0x149)+(_0x4c7aa6+0x1)+'/'+_0xddc155[_0x1b9edb(0xd8)][_0x1b9edb(0x120)]+_0x1b9edb(0x14d)+a5_0x2e2218[_0x1b9edb(0xf0)]('✓')+'\x20('+_0x83d4b9+')'):console[_0x1b9edb(0x10b)](_0x1b9edb(0x149)+(_0x4c7aa6+0x1)+'/'+_0xddc155[_0x1b9edb(0xd8)]['length']+_0x1b9edb(0x14d)+a5_0x2e2218['red']('✗'));},'onEvaluationStart':()=>{const _0x586a4b=_0x13e8dd;_0x15f271['text']=_0x586a4b(0xc7);},'onEvaluationComplete':_0x35ed59=>{const _0x1a03f3=_0x13e8dd,_0x1e81f5=formatElapsed(_0x35ed59);console[_0x1a03f3(0x10b)](_0x1a03f3(0xf2)+a5_0x2e2218[_0x1a03f3(0xf0)]('✓')+'\x20('+_0x1e81f5+')');}});_0x15f271[_0x13e8dd(0x101)](),_0x5e6696[_0x13e8dd(0x111)](_0x5d7c1);if(_0x5d7c1[_0x13e8dd(0xf4)]===_0x13e8dd(0xe4))console[_0x13e8dd(0x10b)](a5_0x2e2218['green'](_0x13e8dd(0x148)+_0x5d7c1[_0x13e8dd(0x107)])+a5_0x2e2218[_0x13e8dd(0xda)](_0x13e8dd(0x14e)));else _0x5d7c1['status']===_0x13e8dd(0xd0)?console['log'](a5_0x2e2218[_0x13e8dd(0x100)](_0x13e8dd(0x13f)+_0x5d7c1[_0x13e8dd(0x107)])+a5_0x2e2218['dim'](_0x13e8dd(0x14e))):console[_0x13e8dd(0x10b)](a5_0x2e2218[_0x13e8dd(0x100)](_0x13e8dd(0xea)+_0x5d7c1[_0x13e8dd(0x107)]));_0x5d7c1['conversation_url']&&console[_0x13e8dd(0x10b)](a5_0x2e2218['dim'](_0x13e8dd(0xc6)+_0x5d7c1[_0x13e8dd(0x108)]));}catch(_0x3c5080){_0x15f271[_0x13e8dd(0x101)]();const _0x20afc0=_0x3c5080 instanceof Error?_0x3c5080['message']:String(_0x3c5080);console[_0x13e8dd(0x10b)](a5_0x2e2218[_0x13e8dd(0x100)](_0x13e8dd(0xea)+_0x20afc0)),_0x5e6696[_0x13e8dd(0x111)]({'name':_0xddc155['name'],'status':_0x13e8dd(0xff),'reason':_0x20afc0,'timestamp':new Date()[_0x13e8dd(0xc4)](),'duration_ms':0x0});}}}console[_0x13e8dd(0x10b)]();const _0x1969e4=Date[_0x13e8dd(0xc2)]()-_0x418bf1,_0xe3fc91=_0x5e6696[_0x13e8dd(0x117)](_0x3a875c=>_0x3a875c[_0x13e8dd(0xf4)]===_0x13e8dd(0xe4))[_0x13e8dd(0x120)],_0x1c77f9=_0x5e6696[_0x13e8dd(0x117)](_0x3a8a43=>_0x3a8a43['status']===_0x13e8dd(0xd0))[_0x13e8dd(0x120)],_0x46acbb=_0x5e6696[_0x13e8dd(0x117)](_0x145328=>_0x145328['status']==='ERROR')['length'];console['log']('━'[_0x13e8dd(0x118)](0x3c)),console[_0x13e8dd(0x10b)]('Re-evaluation\x20Summary'),console['log']('━'[_0x13e8dd(0x118)](0x3c)),console['log'](_0x13e8dd(0x109)+_0x5e6696[_0x13e8dd(0x120)]),console[_0x13e8dd(0x10b)]('Passed:\x20\x20\x20'+a5_0x2e2218['green'](_0xe3fc91)),console['log']('Failed:\x20\x20\x20'+a5_0x2e2218[_0x13e8dd(0x100)](_0x1c77f9));_0x46acbb>0x0&&console['log'](_0x13e8dd(0xd4)+a5_0x2e2218[_0x13e8dd(0x100)](_0x46acbb));console[_0x13e8dd(0x10b)]('Duration:\x20'+formatElapsed(_0x1969e4)),console[_0x13e8dd(0x10b)]('━'[_0x13e8dd(0x118)](0x3c));const _0x5e03a8={'summary':{'total':_0x5e6696['length'],'passed':_0xe3fc91,'failed':_0x1c77f9,'errors':_0x46acbb>0x0?_0x46acbb:undefined,'duration_ms':_0x1969e4},'tests':_0x5e6696,'agent':{'project':_0x54348d[_0x13e8dd(0xde)],'name':_0x54348d[_0x13e8dd(0xf5)],'site':_0x456762},'timestamp':new Date(_0x418bf1)[_0x13e8dd(0xc4)]()};if(_0x3d1800!==_0x13e8dd(0x13d)||_0x52edd0){const _0x664c3b=formatResults(_0x5e03a8,_0x3d1800);if(_0x52edd0)try{a5_0x417471['writeFileSync'](_0x52edd0,_0x664c3b,_0x13e8dd(0xbe)),console[_0x13e8dd(0x10b)](),console[_0x13e8dd(0x10b)](a5_0x2e2218[_0x13e8dd(0xda)](_0x13e8dd(0x145)+_0x52edd0));}catch(_0x5272f1){return console[_0x13e8dd(0x10b)](),console[_0x13e8dd(0x10b)](a5_0x2e2218['red'](_0x13e8dd(0x11c)+_0x5272f1)),0x1;}else console[_0x13e8dd(0x10b)](),console[_0x13e8dd(0x10b)](_0x664c3b);}const _0x451319=_0x5e6696['filter'](_0x24960b=>_0x24960b[_0x13e8dd(0xf4)]!==_0x13e8dd(0xe4));return _0x451319['length']>0x0?0x1:0x0;}}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* API command - Make raw HTTP requests to TD APIs
|
|
3
3
|
*
|
|
4
4
|
* Provides curl-style interface for making authenticated requests
|
|
5
|
-
* to any Treasure
|
|
5
|
+
* to any Treasure AI API endpoint.
|
|
6
6
|
*/
|
|
7
7
|
import { BaseCommand, type CommandContext } from './command.js';
|
|
8
8
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x4023eb=a6_0x2994;(function(_0x69733c,_0x199b62){const _0x780305=a6_0x2994,_0x57516e=_0x69733c();while(!![]){try{const _0x4b3649=-parseInt(_0x780305(0xe8))/0x1+-parseInt(_0x780305(0xea))/0x2+parseInt(_0x780305(0xcd))/0x3*(-parseInt(_0x780305(0xf6))/0x4)+-parseInt(_0x780305(0xfa))/0x5+parseInt(_0x780305(0xdf))/0x6+parseInt(_0x780305(0x108))/0x7+parseInt(_0x780305(0xf5))/0x8;if(_0x4b3649===_0x199b62)break;else _0x57516e['push'](_0x57516e['shift']());}catch(_0x2c4b0b){_0x57516e['push'](_0x57516e['shift']());}}}(a6_0x1f9d,0xeced2));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';import{writeFileSync}from'fs';import{getEndpoint}from'../sdk/types/index.js';import{resolveSite}from'../core/config.js';import{getAuthHeaders}from'../core/auth.js';const SENSITIVE_HEADERS=new Set([a6_0x4023eb(0xe9),a6_0x4023eb(0xfd),a6_0x4023eb(0xd7),a6_0x4023eb(0xdb),a6_0x4023eb(0xd3),a6_0x4023eb(0xe2),a6_0x4023eb(0x10c),a6_0x4023eb(0xe7)]);function isSensitiveHeader(_0x5a724c){const _0x1425c2=a6_0x4023eb;return SENSITIVE_HEADERS[_0x1425c2(0x10d)](_0x5a724c[_0x1425c2(0xd6)]());}function parseHeader(_0x563d48){const _0x39ca13=a6_0x4023eb,_0xae4958=_0x563d48[_0x39ca13(0xda)](':');if(_0xae4958===-0x1)throw new Error(_0x39ca13(0x104)+_0x563d48+_0x39ca13(0xee)+_0x39ca13(0x102));const _0x90aa89=_0x563d48[_0x39ca13(0x106)](0x0,_0xae4958)[_0x39ca13(0xd9)](),_0xe5a9f7=_0x563d48[_0x39ca13(0x106)](_0xae4958+0x1)['trim']();if(!_0x90aa89)throw new Error(_0x39ca13(0xfc)+_0x563d48+'\x22');return[_0x90aa89,_0xe5a9f7];}function a6_0x2994(_0x345de2,_0x56d73c){_0x345de2=_0x345de2-0xcc;const _0x1f9d72=a6_0x1f9d();let _0x299435=_0x1f9d72[_0x345de2];return _0x299435;}export class ApiCommand extends BaseCommand{[a6_0x4023eb(0xed)]=a6_0x4023eb(0x10f);['description']=a6_0x4023eb(0xf8);[a6_0x4023eb(0xef)](_0x54a49f){const _0x1eaabd=a6_0x4023eb,{args:_0x4b49aa,options:_0x4950c8}=_0x54a49f,_0x46890c=_0x4950c8;if(_0x4b49aa[_0x1eaabd(0xf2)]===0x0)return _0x1eaabd(0xf3);const _0xea52fb=_0x4b49aa[0x0];if(!_0xea52fb[_0x1eaabd(0xe1)]('/'))return _0x1eaabd(0x107)+_0xea52fb;const _0x8788cd=_0x46890c[_0x1eaabd(0x110)],_0x1343b6=_0x46890c[_0x1eaabd(0xeb)];if(_0x8788cd&&_0x1343b6)return'Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.';const _0x4bedab=_0x46890c[_0x1eaabd(0xcc)]||_0x1eaabd(0xde),_0x9c3338=[_0x1eaabd(0xde),'POST',_0x1eaabd(0x100),'DELETE',_0x1eaabd(0xf0)];if(!_0x9c3338['includes'](_0x4bedab[_0x1eaabd(0xd0)]()))return _0x1eaabd(0xe4)+_0x4bedab+_0x1eaabd(0xd4)+_0x9c3338['join'](',\x20');const _0x3e6be5=_0x46890c[_0x1eaabd(0xfb)]||'td',_0x4e19f2=['td',_0x1eaabd(0xd5),_0x1eaabd(0xd8),_0x1eaabd(0xcf),_0x1eaabd(0xe3),_0x1eaabd(0x10a),'cas'];if(!_0x4e19f2['includes'](_0x3e6be5))return _0x1eaabd(0xe5)+_0x3e6be5+_0x1eaabd(0x10e)+_0x4e19f2[_0x1eaabd(0xe0)](',\x20');return undefined;}async['execute'](_0x2bb53c){const _0x370698=a6_0x4023eb,{options:_0x533ddb,args:_0x205815,tdx:_0x277196}=_0x2bb53c,_0x1b9f08=_0x533ddb,_0x381bff=_0x205815[0x0],_0x2f16ad=(_0x1b9f08[_0x370698(0xcc)]||_0x370698(0xde))[_0x370698(0xd0)](),_0x5e9e4e=_0x1b9f08[_0x370698(0x110)],_0x227dc5=_0x1b9f08['file'],_0x2f129a=_0x1b9f08[_0x370698(0xec)],_0x1bde7f=_0x1b9f08[_0x370698(0xfb)]||'td';try{const _0x3c7615={};if(_0x2f129a){const _0x2a45c4=Array[_0x370698(0x111)](_0x2f129a)?_0x2f129a:[_0x2f129a];for(const _0x34ef82 of _0x2a45c4){const [_0x3c98a3,_0x23fb99]=parseHeader(_0x34ef82);_0x3c7615[_0x3c98a3]=_0x23fb99;}}let _0x4d7dd8;if(_0x5e9e4e)_0x4d7dd8=_0x5e9e4e;else{if(_0x227dc5)try{_0x4d7dd8=RawAPI[_0x370698(0x109)](_0x227dc5);}catch(_0x959d51){return console[_0x370698(0xf7)](_0x370698(0xd1)+(_0x959d51 instanceof Error?_0x959d51['message']:String(_0x959d51))),0x1;}}const _0x39caf7={'method':_0x2f16ad,'apiType':_0x1bde7f,'includeHeaders':_0x533ddb[_0x370698(0x105)]};_0x4d7dd8&&(_0x39caf7['body']=_0x4d7dd8);Object[_0x370698(0xdd)](_0x3c7615)['length']>0x0&&(_0x39caf7['headers']=_0x3c7615);if(_0x533ddb[_0x370698(0x105)]){const _0xdae7f6=resolveSite(_0x533ddb[_0x370698(0xf1)]),_0x2f6f41=getEndpoint(_0xdae7f6,_0x1bde7f),_0x418566=''+_0x2f6f41+_0x381bff;console['error']('>\x20'+_0x2f16ad+'\x20'+_0x418566);const _0x48bbce=getAuthHeaders(_0xdae7f6),_0x3578d5={..._0x48bbce,..._0x3c7615};for(const [_0x4f1c81,_0x251442]of Object[_0x370698(0xff)](_0x3578d5)){!isSensitiveHeader(_0x4f1c81)&&console[_0x370698(0xf7)]('>\x20'+_0x4f1c81+':\x20'+_0x251442);}_0x4d7dd8&&console[_0x370698(0xf7)]('>'),console[_0x370698(0xf7)]('');}const _0x451ac6=await _0x277196['api']['request'](_0x381bff,_0x39caf7);if(_0x533ddb[_0x370698(0x105)]&&_0x451ac6['headers']){console[_0x370698(0xf7)](_0x370698(0xf4)+_0x451ac6['status']);for(const [_0x514de7,_0x2fd994]of Object['entries'](_0x451ac6[_0x370698(0xce)])){!isSensitiveHeader(_0x514de7)&&console['error']('<\x20'+_0x514de7+':\x20'+_0x2fd994);}console[_0x370698(0xf7)]('');}const _0x3e3027=Boolean(_0x533ddb['output']),_0x5a9f96={'color':_0x533ddb['color'],'noColor':_0x533ddb[_0x370698(0xe6)]||_0x3e3027&&!_0x533ddb[_0x370698(0xfe)]},_0x22d61b=colorizeJSON(_0x451ac6[_0x370698(0x110)],_0x5a9f96);return _0x533ddb['output']?(writeFileSync(_0x533ddb[_0x370698(0x10b)],_0x22d61b),console[_0x370698(0xf7)](_0x370698(0x101)+_0x533ddb[_0x370698(0x10b)])):console[_0x370698(0xd2)](_0x22d61b),0x0;}catch(_0xc85d6f){return _0xc85d6f instanceof Error?(console[_0x370698(0xf7)](_0x370698(0xd1)+_0xc85d6f[_0x370698(0xdc)]),_0x533ddb[_0x370698(0x105)]&&_0xc85d6f[_0x370698(0x103)]&&console[_0x370698(0xf7)](_0x370698(0xf9)+_0xc85d6f[_0x370698(0x103)])):console[_0x370698(0xf7)](_0x370698(0xd1)+String(_0xc85d6f)),0x1;}}}function a6_0x1f9d(){const _0x43bafc=['.\x20Valid\x20types:\x20','api','data','isArray','method','111trPPlp','headers','trino','toUpperCase','Error:\x20','log','set-cookie2','.\x20Valid\x20methods:\x20','cdp','toLowerCase','cookie','workflow','trim','indexOf','set-cookie','message','keys','GET','4215930AGYtVO','join','startsWith','x-xsrf-token','llm','Invalid\x20HTTP\x20method:\x20','Invalid\x20API\x20type:\x20','noColor','x-trino-user','1502166sFKsfH','authorization','468692DDBHHz','file','header','name','\x22.\x20','validate','PATCH','site','length','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','<\x20HTTP/1.1\x20','11375152ecPtlG','107012GraFDT','error','Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs','\x0aStack\x20trace:\x0a','414590anTKgQ','type','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','proxy-authorization','color','entries','PUT','Results\x20saved\x20to\x20','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','stack','Invalid\x20header\x20format:\x20\x22','verbose','substring','Endpoint\x20must\x20start\x20with\x20/:\x20','11586344aRAvKb','readBodyFromFile','llm-proxy','output','x-auth-token','has'];a6_0x1f9d=function(){return _0x43bafc;};return a6_0x1f9d();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a7_0x57ba4d=a7_0x1f57;(function(_0x468ffa,_0x2e0fb1){const _0x3e55d0=a7_0x1f57,_0x1f3efa=_0x468ffa();while(!![]){try{const _0x14bd72=parseInt(_0x3e55d0(0x1ef))/0x1+-parseInt(_0x3e55d0(0x23f))/0x2*(parseInt(_0x3e55d0(0x229))/0x3)+-parseInt(_0x3e55d0(0x22d))/0x4*(-parseInt(_0x3e55d0(0x1fc))/0x5)+parseInt(_0x3e55d0(0x223))/0x6*(parseInt(_0x3e55d0(0x238))/0x7)+parseInt(_0x3e55d0(0x222))/0x8*(-parseInt(_0x3e55d0(0x212))/0x9)+parseInt(_0x3e55d0(0x1fd))/0xa*(parseInt(_0x3e55d0(0x216))/0xb)+-parseInt(_0x3e55d0(0x242))/0xc;if(_0x14bd72===_0x2e0fb1)break;else _0x1f3efa['push'](_0x1f3efa['shift']());}catch(_0x31c585){_0x1f3efa['push'](_0x1f3efa['shift']());}}}(a7_0x5da4,0xca104));import{BaseCommand,printAuthError}from'./command.js';function a7_0x5da4(){const _0x4be488=['red','Validating\x20API\x20key...','account_id','profile','oauth','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','status','ERROR','join','No\x20credentials\x20found\x20in\x20keychain','trim','all','first_name','OAuth\x20tokens','tdx:\x20auth\x20clear','last_name','description','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','\x27\x20registered','367029pnNBMd','site','log','✓\x20Profile\x20\x27','3060827JycaQC','email','\x20--profile\x20','filter','You\x20can\x20find\x20your\x20API\x20key\x20at:','apikey','Setup\x20API\x20key\x20authentication\x20interactively','tdx:\x20auth\x20setup','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','apiKey','\x0aSetup\x20cancelled','execute','112PKXgNC','118182pyUwrs','✓\x20Default\x20site\x20set\x20to\x20','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','password','create','select','681BCqIaH','Sign\x20in\x20with\x20browser\x20(recommended)','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','21552XyzsmD','Use\x20an\x20API\x20key','auth:setup','tdx\x20profile:\x20','/app/mp/ak','dim','us01','text','API\x20key\x20cannot\x20be\x20empty','Setup\x20cancelled','\x20\x20user_id:','7hrPyRm','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','cyan','message','\x20for\x20profile:\x20','Name:\x20','7346YLkTKU','\x20(profile:\x20','Read\x20credential\x20from\x20','12687660xUuOlt','\x20\x20tdx','✗\x20Validation\x20failed:\x20','name','green','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>','yellow','warn','\x20and\x20','For\x20scripts\x20or\x20headless\x20servers','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','Enter\x20your\x20TD\x20API\x20key:','Read\x20credential\x20from\x20keychain','getUserInfo','method','Credential\x20type:\x20OAuth','auth','1240977EXqBPl','\x20(site:\x20','N/A','System\x20keychain\x20is\x20not\x20available','Choose\x20how\x20to\x20sign\x20in:','error','\x20\x20(','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','accountName','logLevel','jobs','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','User:\x20','850GhvxkQ','40LspMvj'];a7_0x5da4=function(){return _0x4be488;};return a7_0x5da4();}import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens,saveOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{deleteOAuthTokens}from'../core/oauth-keychain.js';function a7_0x1f57(_0x36c27a,_0x2a9589){_0x36c27a=_0x36c27a-0x1ee;const _0x5da4e1=a7_0x5da4();let _0x1f57eb=_0x5da4e1[_0x36c27a];return _0x1f57eb;}import{clearCredentialCache}from'../core/credential-cache.js';import{startOAuthFlow}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import a7_0x4bb23a 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_0x56d2f0 from'chalk';export async function runOAuthLoginFlow(_0x5d4b6b,_0x32b0e7,_0x9a0249,_0x53b6c8){const _0x57e4fa=a7_0x1f57,_0x31970e=await isKeychainAvailable();if(!_0x31970e)throw new Error(_0x57e4fa(0x1fa)+_0x57e4fa(0x23a));let _0x43416e=_0x53b6c8?.['accountName'];if(!_0x43416e){const _0x118f99=await a7_0x4bb23a({'type':_0x57e4fa(0x234),'name':_0x57e4fa(0x1f7),'message':_0x57e4fa(0x203)});if(_0x118f99['accountName']===undefined)throw new Error('Setup\x20cancelled');_0x43416e=_0x118f99[_0x57e4fa(0x1f7)][_0x57e4fa(0x208)]()||undefined;}const _0x1c7bee=getConsoleUrl(_0x5d4b6b);console[_0x57e4fa(0x214)]('Opening\x20browser\x20for\x20authentication...');_0x43416e?console[_0x57e4fa(0x214)]('\x20\x20'+_0x1c7bee+'/users/initiate_sso\x20(account:\x20'+_0x43416e+')'):console[_0x57e4fa(0x214)]('\x20\x20'+_0x1c7bee+'/oauth/authorize');console[_0x57e4fa(0x214)]('Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...');const _0x5350b1=await startOAuthFlow(_0x5d4b6b,{'accountName':_0x43416e});console[_0x57e4fa(0x214)]('Validating\x20OAuth\x20tokens...');const _0x3e369b=TDX[_0x57e4fa(0x227)]({'site':_0x5d4b6b,'accessToken':_0x5350b1['access_token'],'logLevel':_0x9a0249??LogLevel['ERROR']}),_0x347d1e=await _0x3e369b[_0x57e4fa(0x1f9)][_0x57e4fa(0x250)]();console[_0x57e4fa(0x214)](a7_0x56d2f0[_0x57e4fa(0x246)]('✓\x20Signed\x20in\x20successfully')),console[_0x57e4fa(0x214)]('\x20\x20'+a7_0x56d2f0[_0x57e4fa(0x23b)](_0x5d4b6b+':'+_0x347d1e[_0x57e4fa(0x200)])+_0x57e4fa(0x237)+_0x347d1e['id']+_0x57e4fa(0x1f5)+_0x347d1e[_0x57e4fa(0x217)]+')');!_0x43416e&&(console['log'](a7_0x56d2f0[_0x57e4fa(0x232)](_0x57e4fa(0x210))),console[_0x57e4fa(0x214)](a7_0x56d2f0[_0x57e4fa(0x232)](_0x57e4fa(0x247))),console[_0x57e4fa(0x214)](a7_0x56d2f0[_0x57e4fa(0x232)]('\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions')));await saveOAuthTokens(_0x5350b1,_0x32b0e7),console['log'](_0x57e4fa(0x239)+(_0x32b0e7?'\x20(profile:\x20'+_0x32b0e7+')':''));if(_0x32b0e7){const _0xaa8a18={'site':_0x5d4b6b};saveProfileToUserConfig(_0x32b0e7,_0xaa8a18),console['log'](_0x57e4fa(0x215)+_0x32b0e7+_0x57e4fa(0x211));}else saveDefaultSiteToUserConfig(_0x5d4b6b),console[_0x57e4fa(0x214)](_0x57e4fa(0x224)+_0x5d4b6b);const _0xef0396=_0x32b0e7?_0x57e4fa(0x218)+_0x32b0e7:'';console[_0x57e4fa(0x214)](),console[_0x57e4fa(0x214)](_0x57e4fa(0x1f6)),console['log'](_0x57e4fa(0x243)+_0xef0396+_0x57e4fa(0x22c)),console[_0x57e4fa(0x214)](_0x57e4fa(0x243)+_0xef0396+_0x57e4fa(0x21e));}export async function promptAuthMethod(){const _0x5bdd9a=a7_0x1f57,_0x488388=await a7_0x4bb23a({'type':_0x5bdd9a(0x228),'name':_0x5bdd9a(0x251),'message':_0x5bdd9a(0x1f3),'choices':[{'title':_0x5bdd9a(0x22a),'description':_0x5bdd9a(0x24d),'value':_0x5bdd9a(0x202)},{'title':_0x5bdd9a(0x22e),'description':_0x5bdd9a(0x24b),'value':_0x5bdd9a(0x21b)}]});return _0x488388['method']||null;}export class AuthSetupCommand extends BaseCommand{[a7_0x57ba4d(0x245)]=a7_0x57ba4d(0x22f);[a7_0x57ba4d(0x20e)]=a7_0x57ba4d(0x21c);async['execute'](_0x505ebd){const _0x396e81=a7_0x57ba4d,{options:_0x281fcc}=_0x505ebd,_0x334d38=_0x281fcc['profile'];console[_0x396e81(0x214)](a7_0x56d2f0['bold'](_0x396e81(0x21d)));const _0x350e63=_0x281fcc[_0x396e81(0x213)]||_0x396e81(0x233),_0x26c190=await promptSiteSelection(_0x350e63,_0x334d38,_0x396e81(0x236));if(!_0x26c190)return 0x1;const _0x33d266=resolveSite(_0x26c190),_0x18e6b3=await promptAuthMethod();if(!_0x18e6b3)return console[_0x396e81(0x214)](_0x396e81(0x220)),0x1;if(_0x18e6b3==='oauth'){const {accountName:_0x18ecec}=_0x281fcc;return await runOAuthLoginFlow(_0x33d266,_0x334d38,_0x281fcc[_0x396e81(0x1f8)]??LogLevel['ERROR'],{'accountName':_0x18ecec}),0x0;}console[_0x396e81(0x214)]('Setting\x20up\x20authentication\x20for\x20site:\x20'+_0x33d266),console[_0x396e81(0x214)](_0x396e81(0x21a)),console[_0x396e81(0x214)]('\x20\x20'+getConsoleUrl(_0x33d266,_0x396e81(0x231)));const _0x266bdc=await a7_0x4bb23a({'type':_0x396e81(0x226),'name':_0x396e81(0x21f),'message':_0x396e81(0x24e),'validate':_0x252103=>{const _0x170f4a=_0x396e81;if(!_0x252103||!_0x252103[_0x170f4a(0x208)]())return _0x170f4a(0x235);return!![];}});if(!_0x266bdc[_0x396e81(0x21f)])return console[_0x396e81(0x214)](_0x396e81(0x220)),0x1;const _0x28bf08=_0x266bdc[_0x396e81(0x21f)];console[_0x396e81(0x214)](_0x396e81(0x1ff));try{const _0x5980de=TDX[_0x396e81(0x227)]({'site':_0x33d266,'apiKey':_0x28bf08[_0x396e81(0x208)](),'logLevel':_0x281fcc[_0x396e81(0x1f8)]??LogLevel[_0x396e81(0x205)]}),_0x93caf2=await _0x5980de[_0x396e81(0x1f9)]['getUserInfo']();console['log']('✓\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x93caf2[_0x396e81(0x217)]+')');const _0x5d7ef5=await isKeychainAvailable();_0x5d7ef5?(await saveAPIKeyAsync(_0x28bf08['trim'](),_0x33d266,_0x334d38),console['log'](_0x396e81(0x225)+(_0x334d38?_0x396e81(0x240)+_0x334d38+')':''))):(console['warn'](a7_0x56d2f0[_0x396e81(0x248)](_0x396e81(0x24c))),console[_0x396e81(0x249)](a7_0x56d2f0['yellow'](_0x396e81(0x20f))));if(_0x334d38){const _0x5aa0bd={'site':_0x33d266};saveProfileToUserConfig(_0x334d38,_0x5aa0bd),console[_0x396e81(0x214)]('✓\x20Profile\x20\x27'+_0x334d38+_0x396e81(0x211));}else saveDefaultSiteToUserConfig(_0x33d266),console[_0x396e81(0x214)](_0x396e81(0x224)+_0x33d266);const _0xe7f53f=_0x334d38?_0x396e81(0x218)+_0x334d38:'';return console[_0x396e81(0x214)](),console[_0x396e81(0x214)](_0x396e81(0x1f6)),console[_0x396e81(0x214)](_0x396e81(0x243)+_0xe7f53f+_0x396e81(0x22c)),console[_0x396e81(0x214)](_0x396e81(0x243)+_0xe7f53f+_0x396e81(0x21e)),0x0;}catch(_0x5e6aae){if(_0x5e6aae instanceof HTTPClientError&&_0x5e6aae[_0x396e81(0x204)]===0x191)return printAuthError(_0x5e6aae),0x1;return console['error'](a7_0x56d2f0[_0x396e81(0x1fe)](_0x396e81(0x244)+(_0x5e6aae instanceof Error?_0x5e6aae[_0x396e81(0x23c)]:String(_0x5e6aae)))),console[_0x396e81(0x1f4)](_0x396e81(0x22b)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x57ba4d(0x245)]=a7_0x57ba4d(0x1ee);[a7_0x57ba4d(0x20e)]='Show\x20authentication\x20status\x20and\x20validate\x20API\x20key';async[a7_0x57ba4d(0x221)](_0x64503c){const _0x1c2bc6=a7_0x57ba4d,{options:_0x3e8a4b,tdx:_0x28b2a0}=_0x64503c,_0x40d161=_0x3e8a4b[_0x1c2bc6(0x213)],_0x42805b=_0x3e8a4b[_0x1c2bc6(0x201)],_0x2a7c00=_0x42805b?_0x42805b:_0x1c2bc6(0x1f1);console[_0x1c2bc6(0x214)](_0x1c2bc6(0x230)+_0x2a7c00+_0x1c2bc6(0x1f0)+_0x40d161+')');const _0x3fa1f4=await getOAuthTokens(_0x42805b);if(_0x3fa1f4)console['log'](_0x1c2bc6(0x252)),console[_0x1c2bc6(0x214)](_0x1c2bc6(0x24f)+(_0x42805b?_0x1c2bc6(0x240)+_0x42805b+')':''));else{const _0x18d9f0=await resolveAPIKeyAsync(_0x40d161,_0x42805b);if(_0x18d9f0){const {source:_0x4feb7d,isDeprecated:_0x328a54}=_0x18d9f0,_0x192336=_0x1c2bc6(0x241)+_0x4feb7d;console[_0x1c2bc6(0x214)](_0x328a54?a7_0x56d2f0[_0x1c2bc6(0x248)](_0x192336):_0x192336);}else console[_0x1c2bc6(0x214)](a7_0x56d2f0['yellow']('No\x20credential\x20found'));}try{const _0x553cc3=await _0x28b2a0[_0x1c2bc6(0x1f9)][_0x1c2bc6(0x250)]();return console[_0x1c2bc6(0x214)](a7_0x56d2f0[_0x1c2bc6(0x246)]('✓\x20Authentication\x20successful\x0a')),console[_0x1c2bc6(0x214)](_0x1c2bc6(0x1fb)+_0x553cc3[_0x1c2bc6(0x217)]),(_0x553cc3[_0x1c2bc6(0x20a)]||_0x553cc3['last_name'])&&console[_0x1c2bc6(0x214)](_0x1c2bc6(0x23e)+[_0x553cc3['first_name'],_0x553cc3[_0x1c2bc6(0x20d)]]['filter'](Boolean)[_0x1c2bc6(0x206)]('\x20')),0x0;}catch(_0x194adc){return _0x194adc instanceof HTTPClientError&&_0x194adc[_0x1c2bc6(0x204)]===0x191?printAuthError(_0x194adc,!![],_0x42805b):console[_0x1c2bc6(0x1f4)](a7_0x56d2f0['red'](_0x1c2bc6(0x244)+(_0x194adc instanceof Error?_0x194adc['message']:String(_0x194adc)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x57ba4d(0x245)]='auth:clear';[a7_0x57ba4d(0x20e)]='Remove\x20API\x20key\x20from\x20system\x20keychain';async[a7_0x57ba4d(0x221)](_0x3d3d3e){const _0x344963=a7_0x57ba4d,{options:_0x1fe85d}=_0x3d3d3e,_0x338346=_0x1fe85d[_0x344963(0x201)];console[_0x344963(0x214)](a7_0x56d2f0['bold'](_0x344963(0x20c)));const _0x2bfe10=await isKeychainAvailable();if(!_0x2bfe10)return console[_0x344963(0x1f4)](a7_0x56d2f0[_0x344963(0x1fe)](_0x344963(0x1f2))),0x1;const [_0x5a5a07,_0x3b4df9]=await Promise[_0x344963(0x209)]([deleteKeychainAPIKey(_0x338346),deleteOAuthTokens(_0x338346)]);if(_0x5a5a07||_0x3b4df9){clearCredentialCache();const _0x45df32=[_0x5a5a07&&'API\x20key',_0x3b4df9&&_0x344963(0x20b)][_0x344963(0x219)](Boolean)['join'](_0x344963(0x24a));return console[_0x344963(0x214)]('✓\x20'+_0x45df32+'\x20removed\x20from\x20keychain'+(_0x338346?_0x344963(0x240)+_0x338346+')':'')),0x0;}else return console[_0x344963(0x214)](_0x344963(0x207)+(_0x338346?_0x344963(0x23d)+_0x338346:'')),0x1;}}
|
|
1
|
+
const a7_0x7de4da=a7_0x5d6c;(function(_0x356208,_0x560ca2){const _0x1d1237=a7_0x5d6c,_0x23cb6a=_0x356208();while(!![]){try{const _0x23fabd=parseInt(_0x1d1237(0x1b5))/0x1+-parseInt(_0x1d1237(0x1d2))/0x2*(parseInt(_0x1d1237(0x1b9))/0x3)+parseInt(_0x1d1237(0x177))/0x4+-parseInt(_0x1d1237(0x189))/0x5*(-parseInt(_0x1d1237(0x1b7))/0x6)+-parseInt(_0x1d1237(0x16c))/0x7+-parseInt(_0x1d1237(0x1c7))/0x8*(-parseInt(_0x1d1237(0x1ce))/0x9)+-parseInt(_0x1d1237(0x1a8))/0xa*(parseInt(_0x1d1237(0x17d))/0xb);if(_0x23fabd===_0x560ca2)break;else _0x23cb6a['push'](_0x23cb6a['shift']());}catch(_0x4c3cec){_0x23cb6a['push'](_0x23cb6a['shift']());}}}(a7_0x5d78,0xee2c2));import{BaseCommand,printAuthError}from'./command.js';import{saveAPIKeyAsync,resolveSite,resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens,saveOAuthTokens}from'../core/oauth-keychain.js';import{saveProfileToUserConfig,saveDefaultSiteToUserConfig}from'../core/profile.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';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';function a7_0x5d78(){const _0x2281a8=['trim','join','\x20removed\x20from\x20keychain','You\x20can\x20find\x20your\x20API\x20key\x20at:','/oauth/authorize','System\x20keychain\x20is\x20not\x20available.\x20OAuth\x20tokens\x20cannot\x20be\x20saved.\x20','green','first_name','No\x20credentials\x20found\x20in\x20keychain','3110210gppLJr','✓\x20OAuth\x20tokens\x20saved\x20to\x20system\x20keychain','User:\x20','name','access_token','warn','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','oauth','✓\x20API\x20key\x20saved\x20to\x20system\x20keychain','profile','method','For\x20scripts\x20or\x20headless\x20servers','account_id','1198410TxUMMM','\x20and\x20','1093818WGMrmp','red','344094rKoiaW','accountName','\x0aSetup\x20cancelled','us01','Setup\x20cancelled','No\x20credential\x20found','\x20\x20(','Setup\x20API\x20key\x20authentication\x20interactively','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','description','message','API\x20key','Opens\x20your\x20browser\x20to\x20sign\x20in\x20with\x20SSO','\x20--profile\x20','64ydeisS','dim','OAuth\x20tokens','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','\x20for\x20profile:\x20','create','✓\x20Authentication\x20successful\x0a','429597ChTHEw','tdx:\x20auth\x20setup','yellow','site','34DvWDaH','5682180UapTuw','Read\x20credential\x20from\x20','\x27\x20registered','last_name','Waiting\x20for\x20authorization\x20(timeout:\x202\x20minutes)...','\x20\x20tdx','/users/initiate_sso\x20(account:\x20','email','log','apiKey','✓\x20Signed\x20in\x20successfully','6225568GRZxki','Account\x20name\x20for\x20SSO\x20(press\x20Enter\x20to\x20skip):','auth','Remove\x20API\x20key\x20from\x20system\x20keychain','select','\x20(site:\x20','11AbuxGz','API\x20key\x20was\x20not\x20saved.\x20Please\x20try\x20again.','✓\x20Default\x20site\x20set\x20to\x20','Read\x20credential\x20from\x20keychain','jobs','\x20\x20\x20\x202.\x20Or\x20use\x20a\x20different\x20browser\x20profile\x20to\x20avoid\x20cached\x20sessions','tdx\x20profile:\x20','getUserInfo','Use\x20\x22tdx\x20auth\x20setup\x22\x20with\x20an\x20API\x20key\x20instead.','You\x20can\x20now\x20use\x20tdx\x20commands.\x20Try:','Sign\x20in\x20with\x20browser\x20(recommended)','API\x20key\x20cannot\x20be\x20empty','25FnILAh','\x20\x20If\x20this\x20is\x20not\x20the\x20expected\x20account:','bold','all','\x20(profile:\x20','auth:clear','✓\x20API\x20key\x20is\x20valid\x20(User:\x20','status','Validating\x20OAuth\x20tokens...','ERROR','Setting\x20up\x20authentication\x20for\x20site:\x20','System\x20keychain\x20is\x20not\x20available','execute','Use\x20an\x20API\x20key','filter','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','✓\x20Profile\x20\x27','Enter\x20your\x20TD\x20API\x20key:','Name:\x20','error','logLevel','\x20\x20\x20\x201.\x20Run:\x20tdx\x20auth\x20setup\x20--account-name\x20<name>'];a7_0x5d78=function(){return _0x2281a8;};return a7_0x5d78();}import a7_0x392f68 from'prompts';function a7_0x5d6c(_0x5d2795,_0x3abe56){_0x5d2795=_0x5d2795-0x16c;const _0x5d7891=a7_0x5d78();let _0x5d6c8d=_0x5d7891[_0x5d2795];return _0x5d6c8d;}import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a7_0x1dd40a from'chalk';export async function runOAuthLoginFlow(_0x115523,_0x3a76b1,_0x5b5826,_0x450cd){const _0x4c2d56=a7_0x5d6c,_0x4115e2=await isKeychainAvailable();if(!_0x4115e2)throw new Error(_0x4c2d56(0x1a4)+_0x4c2d56(0x185));let _0x145d44=_0x450cd?.[_0x4c2d56(0x1ba)];if(!_0x145d44){const _0x15c6db=await a7_0x392f68({'type':'text','name':_0x4c2d56(0x1ba),'message':_0x4c2d56(0x178)});if(_0x15c6db[_0x4c2d56(0x1ba)]===undefined)throw new Error(_0x4c2d56(0x1bd));_0x145d44=_0x15c6db['accountName'][_0x4c2d56(0x19f)]()||undefined;}const _0x17768f=getConsoleUrl(_0x115523);console[_0x4c2d56(0x174)]('Opening\x20browser\x20for\x20authentication...');_0x145d44?console[_0x4c2d56(0x174)]('\x20\x20'+_0x17768f+_0x4c2d56(0x172)+_0x145d44+')'):console['log']('\x20\x20'+_0x17768f+_0x4c2d56(0x1a3));console[_0x4c2d56(0x174)](_0x4c2d56(0x170));const _0x1c012c=await startOAuthFlow(_0x115523,{'accountName':_0x145d44});console[_0x4c2d56(0x174)](_0x4c2d56(0x191));const _0x466b82=TDX[_0x4c2d56(0x1cc)]({'site':_0x115523,'accessToken':_0x1c012c[_0x4c2d56(0x1ac)],'logLevel':_0x5b5826??LogLevel[_0x4c2d56(0x192)]}),_0x80db2c=await _0x466b82[_0x4c2d56(0x181)][_0x4c2d56(0x184)]();console[_0x4c2d56(0x174)](a7_0x1dd40a[_0x4c2d56(0x1a5)](_0x4c2d56(0x176))),console[_0x4c2d56(0x174)]('\x20\x20'+a7_0x1dd40a['cyan'](_0x115523+':'+_0x80db2c[_0x4c2d56(0x1b4)])+'\x20\x20user_id:'+_0x80db2c['id']+_0x4c2d56(0x1bf)+_0x80db2c['email']+')');!_0x145d44&&(console[_0x4c2d56(0x174)](a7_0x1dd40a['dim'](_0x4c2d56(0x18a))),console[_0x4c2d56(0x174)](a7_0x1dd40a[_0x4c2d56(0x1c8)](_0x4c2d56(0x19e))),console[_0x4c2d56(0x174)](a7_0x1dd40a[_0x4c2d56(0x1c8)](_0x4c2d56(0x182))));await saveOAuthTokens(_0x1c012c,_0x3a76b1),console[_0x4c2d56(0x174)](_0x4c2d56(0x1a9)+(_0x3a76b1?_0x4c2d56(0x18d)+_0x3a76b1+')':''));if(_0x3a76b1){const _0x8ba459={'site':_0x115523};saveProfileToUserConfig(_0x3a76b1,_0x8ba459),console['log'](_0x4c2d56(0x199)+_0x3a76b1+'\x27\x20registered');}else saveDefaultSiteToUserConfig(_0x115523),console[_0x4c2d56(0x174)](_0x4c2d56(0x17f)+_0x115523);const _0x5ce622=_0x3a76b1?_0x4c2d56(0x1c6)+_0x3a76b1:'';console['log'](),console['log'](_0x4c2d56(0x186)),console[_0x4c2d56(0x174)](_0x4c2d56(0x171)+_0x5ce622+_0x4c2d56(0x1ae)),console[_0x4c2d56(0x174)](_0x4c2d56(0x171)+_0x5ce622+'\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases');}export async function promptAuthMethod(){const _0x2f17a6=a7_0x5d6c,_0x7d5e96=await a7_0x392f68({'type':_0x2f17a6(0x17b),'name':'method','message':'Choose\x20how\x20to\x20sign\x20in:','choices':[{'title':_0x2f17a6(0x187),'description':_0x2f17a6(0x1c5),'value':_0x2f17a6(0x1af)},{'title':_0x2f17a6(0x196),'description':_0x2f17a6(0x1b3),'value':'apikey'}]});return _0x7d5e96[_0x2f17a6(0x1b2)]||null;}export class AuthSetupCommand extends BaseCommand{[a7_0x7de4da(0x1ab)]='auth:setup';[a7_0x7de4da(0x1c2)]=a7_0x7de4da(0x1c0);async['execute'](_0x179442){const _0x4795a9=a7_0x7de4da,{options:_0x1ffd77}=_0x179442,_0x2d875c=_0x1ffd77[_0x4795a9(0x1b1)];console[_0x4795a9(0x174)](a7_0x1dd40a[_0x4795a9(0x18b)](_0x4795a9(0x1cf)));const _0x3c49cd=_0x1ffd77[_0x4795a9(0x1d1)]||_0x4795a9(0x1bc),_0x4a0db4=await promptSiteSelection(_0x3c49cd,_0x2d875c,_0x4795a9(0x1bd));if(!_0x4a0db4)return 0x1;const _0x50bb22=resolveSite(_0x4a0db4),_0x4d606d=await promptAuthMethod();if(!_0x4d606d)return console[_0x4795a9(0x174)](_0x4795a9(0x1bb)),0x1;if(_0x4d606d==='oauth'){const {accountName:_0x1f1497}=_0x1ffd77;return await runOAuthLoginFlow(_0x50bb22,_0x2d875c,_0x1ffd77[_0x4795a9(0x19d)]??LogLevel['ERROR'],{'accountName':_0x1f1497}),0x0;}console[_0x4795a9(0x174)](_0x4795a9(0x193)+_0x50bb22),console[_0x4795a9(0x174)](_0x4795a9(0x1a2)),console['log']('\x20\x20'+getConsoleUrl(_0x50bb22,'/app/mp/ak'));const _0x452f83=await a7_0x392f68({'type':'password','name':_0x4795a9(0x175),'message':_0x4795a9(0x19a),'validate':_0x305ca3=>{const _0xa20871=_0x4795a9;if(!_0x305ca3||!_0x305ca3['trim']())return _0xa20871(0x188);return!![];}});if(!_0x452f83[_0x4795a9(0x175)])return console['log'](_0x4795a9(0x1bb)),0x1;const _0x247511=_0x452f83['apiKey'];console['log']('Validating\x20API\x20key...');try{const _0x48468a=TDX[_0x4795a9(0x1cc)]({'site':_0x50bb22,'apiKey':_0x247511[_0x4795a9(0x19f)](),'logLevel':_0x1ffd77[_0x4795a9(0x19d)]??LogLevel[_0x4795a9(0x192)]}),_0x19b15c=await _0x48468a[_0x4795a9(0x181)][_0x4795a9(0x184)]();console[_0x4795a9(0x174)](_0x4795a9(0x18f)+_0x19b15c[_0x4795a9(0x173)]+')');const _0x5acbcf=await isKeychainAvailable();_0x5acbcf?(await saveAPIKeyAsync(_0x247511[_0x4795a9(0x19f)](),_0x50bb22,_0x2d875c),console[_0x4795a9(0x174)](_0x4795a9(0x1b0)+(_0x2d875c?_0x4795a9(0x18d)+_0x2d875c+')':''))):(console['warn'](a7_0x1dd40a[_0x4795a9(0x1d0)](_0x4795a9(0x198))),console[_0x4795a9(0x1ad)](a7_0x1dd40a['yellow'](_0x4795a9(0x1ca))));if(_0x2d875c){const _0x4f0e42={'site':_0x50bb22};saveProfileToUserConfig(_0x2d875c,_0x4f0e42),console['log'](_0x4795a9(0x199)+_0x2d875c+_0x4795a9(0x16e));}else saveDefaultSiteToUserConfig(_0x50bb22),console[_0x4795a9(0x174)](_0x4795a9(0x17f)+_0x50bb22);const _0x250515=_0x2d875c?_0x4795a9(0x1c6)+_0x2d875c:'';return console['log'](),console[_0x4795a9(0x174)](_0x4795a9(0x186)),console['log']('\x20\x20tdx'+_0x250515+_0x4795a9(0x1ae)),console[_0x4795a9(0x174)](_0x4795a9(0x171)+_0x250515+_0x4795a9(0x1c1)),0x0;}catch(_0x2da112){if(_0x2da112 instanceof HTTPClientError&&_0x2da112[_0x4795a9(0x190)]===0x191)return printAuthError(_0x2da112),0x1;return console[_0x4795a9(0x19c)](a7_0x1dd40a['red']('✗\x20Validation\x20failed:\x20'+(_0x2da112 instanceof Error?_0x2da112[_0x4795a9(0x1c3)]:String(_0x2da112)))),console[_0x4795a9(0x19c)](_0x4795a9(0x17e)),0x1;}}}export class AuthStatusCommand extends BaseCommand{[a7_0x7de4da(0x1ab)]=a7_0x7de4da(0x179);['description']='Show\x20authentication\x20status\x20and\x20validate\x20API\x20key';async['execute'](_0xf80949){const _0x531f84=a7_0x7de4da,{options:_0x308de8,tdx:_0x138181}=_0xf80949,_0x2f95e9=_0x308de8['site'],_0x31f7e0=_0x308de8['profile'],_0x363569=_0x31f7e0?_0x31f7e0:'N/A';console['log'](_0x531f84(0x183)+_0x363569+_0x531f84(0x17c)+_0x2f95e9+')');const _0x4d68d6=await getOAuthTokens(_0x31f7e0);if(_0x4d68d6)console[_0x531f84(0x174)]('Credential\x20type:\x20OAuth'),console[_0x531f84(0x174)](_0x531f84(0x180)+(_0x31f7e0?_0x531f84(0x18d)+_0x31f7e0+')':''));else{const _0x2b76e5=await resolveAPIKeyAsync(_0x2f95e9,_0x31f7e0);if(_0x2b76e5){const {source:_0x4a721c,isDeprecated:_0xbf4fb1}=_0x2b76e5,_0x484262=_0x531f84(0x16d)+_0x4a721c;console[_0x531f84(0x174)](_0xbf4fb1?a7_0x1dd40a[_0x531f84(0x1d0)](_0x484262):_0x484262);}else console[_0x531f84(0x174)](a7_0x1dd40a['yellow'](_0x531f84(0x1be)));}try{const _0x36fda5=await _0x138181['jobs'][_0x531f84(0x184)]();return console[_0x531f84(0x174)](a7_0x1dd40a[_0x531f84(0x1a5)](_0x531f84(0x1cd))),console[_0x531f84(0x174)](_0x531f84(0x1aa)+_0x36fda5[_0x531f84(0x173)]),(_0x36fda5[_0x531f84(0x1a6)]||_0x36fda5[_0x531f84(0x16f)])&&console[_0x531f84(0x174)](_0x531f84(0x19b)+[_0x36fda5['first_name'],_0x36fda5['last_name']][_0x531f84(0x197)](Boolean)[_0x531f84(0x1a0)]('\x20')),0x0;}catch(_0x1e82ad){return _0x1e82ad instanceof HTTPClientError&&_0x1e82ad[_0x531f84(0x190)]===0x191?printAuthError(_0x1e82ad,!![],_0x31f7e0):console[_0x531f84(0x19c)](a7_0x1dd40a[_0x531f84(0x1b8)]('✗\x20Validation\x20failed:\x20'+(_0x1e82ad instanceof Error?_0x1e82ad[_0x531f84(0x1c3)]:String(_0x1e82ad)))),0x1;}}}export class AuthClearCommand extends BaseCommand{[a7_0x7de4da(0x1ab)]=a7_0x7de4da(0x18e);[a7_0x7de4da(0x1c2)]=a7_0x7de4da(0x17a);async[a7_0x7de4da(0x195)](_0x4e326){const _0x2f1245=a7_0x7de4da,{options:_0x4e790c}=_0x4e326,_0x131cad=_0x4e790c['profile'];console[_0x2f1245(0x174)](a7_0x1dd40a['bold']('tdx:\x20auth\x20clear'));const _0x362dc5=await isKeychainAvailable();if(!_0x362dc5)return console[_0x2f1245(0x19c)](a7_0x1dd40a[_0x2f1245(0x1b8)](_0x2f1245(0x194))),0x1;const [_0x19f6f1,_0x22a328]=await Promise[_0x2f1245(0x18c)]([deleteKeychainAPIKey(_0x131cad),deleteOAuthTokens(_0x131cad)]);if(_0x19f6f1||_0x22a328){clearCredentialCache();const _0x30c088=[_0x19f6f1&&_0x2f1245(0x1c4),_0x22a328&&_0x2f1245(0x1c9)][_0x2f1245(0x197)](Boolean)[_0x2f1245(0x1a0)](_0x2f1245(0x1b6));return console['log']('✓\x20'+_0x30c088+_0x2f1245(0x1a1)+(_0x131cad?_0x2f1245(0x18d)+_0x131cad+')':'')),0x0;}else return console[_0x2f1245(0x174)](_0x2f1245(0x1a7)+(_0x131cad?_0x2f1245(0x1cb)+_0x131cad:'')),0x1;}}
|