@treasuredata/tdx 2026.9.1 → 2026.9.3
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 +1 -8
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/ai-usage-command-base.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.d.ts +11 -0
- 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/codex-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-always-on-campaign-pull-command.js +1 -1
- package/dist/commands/engage-always-on-campaign-push-command.js +1 -1
- package/dist/commands/engage-always-on-campaign-validate-command.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.d.ts +1 -0
- package/dist/commands/engage-campaign-push-command.d.ts.map +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js.map +1 -1
- package/dist/commands/engage-campaign-readiness-command.d.ts +8 -0
- package/dist/commands/engage-campaign-readiness-command.d.ts.map +1 -0
- package/dist/commands/engage-campaign-readiness-command.js +1 -0
- package/dist/commands/engage-campaign-readiness-command.js.map +1 -0
- package/dist/commands/engage-campaign-validate-command.d.ts +1 -0
- package/dist/commands/engage-campaign-validate-command.d.ts.map +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js.map +1 -1
- package/dist/commands/engage-command.d.ts +1 -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-in-browser-message-command.js +1 -1
- package/dist/commands/engage-landing-page-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/engage-workspace-assignment-command.d.ts +55 -0
- package/dist/commands/engage-workspace-assignment-command.d.ts.map +1 -0
- package/dist/commands/engage-workspace-assignment-command.js +1 -0
- package/dist/commands/engage-workspace-assignment-command.js.map +1 -0
- package/dist/commands/job-command.js +1 -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/opencode-command.js +1 -1
- package/dist/commands/opencode-usage-command.js +1 -1
- package/dist/commands/p13n-command.d.ts +36 -0
- package/dist/commands/p13n-command.d.ts.map +1 -1
- package/dist/commands/p13n-command.js +1 -1
- package/dist/commands/p13n-command.js.map +1 -1
- package/dist/commands/parent-segment-command.d.ts.map +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/parent-segment-command.js.map +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-move-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/table-deleted.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/site-mismatch.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/tools/work-create-item.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.d.ts +1 -0
- 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.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.d.ts +2 -0
- package/dist/proxy/sse-usage-parser.d.ts.map +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/proxy/sse-usage-parser.js.map +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/auth-token.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-schema.js +1 -1
- package/dist/sdk/cas/cas-audience-validator.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-schema.js +1 -1
- package/dist/sdk/cas/cas-segment-validator.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/cas/validate-files.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.d.ts +6 -5
- package/dist/sdk/client/delivery-api-client.d.ts.map +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js.map +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.d.ts +20 -2
- 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.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/p13n-studio-api-client.d.ts +53 -1
- package/dist/sdk/client/p13n-studio-api-client.d.ts.map +1 -1
- package/dist/sdk/client/p13n-studio-api-client.js +1 -1
- package/dist/sdk/client/p13n-studio-api-client.js.map +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.d.ts +19 -22
- package/dist/sdk/delivery.d.ts.map +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/delivery.js.map +1 -1
- package/dist/sdk/engage/always-on-campaign-pull.js +1 -1
- package/dist/sdk/engage/always-on-campaign-push.js +1 -1
- package/dist/sdk/engage/always-on-campaign-validator.js +1 -1
- package/dist/sdk/engage/always-on-campaign-yaml.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-readiness-workflow.d.ts +44 -0
- package/dist/sdk/engage/campaign-readiness-workflow.d.ts.map +1 -0
- package/dist/sdk/engage/campaign-readiness-workflow.js +1 -0
- package/dist/sdk/engage/campaign-readiness-workflow.js.map +1 -0
- package/dist/sdk/engage/campaign-readiness.d.ts +38 -0
- package/dist/sdk/engage/campaign-readiness.d.ts.map +1 -0
- package/dist/sdk/engage/campaign-readiness.js +1 -0
- package/dist/sdk/engage/campaign-readiness.js.map +1 -0
- package/dist/sdk/engage/campaign-validator.d.ts +8 -0
- package/dist/sdk/engage/campaign-validator.d.ts.map +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.js +1 -1
- package/dist/sdk/engage/in-browser-message-pull.js +1 -1
- package/dist/sdk/engage/in-browser-message-push.js +1 -1
- package/dist/sdk/engage/in-browser-message-validator.js +1 -1
- package/dist/sdk/engage/in-browser-message-yaml.js +1 -1
- package/dist/sdk/engage/landing-page-init.js +1 -1
- package/dist/sdk/engage/landing-page-public-asset.js +1 -1
- package/dist/sdk/engage/landing-page-pull.js +1 -1
- package/dist/sdk/engage/landing-page-push.js +1 -1
- package/dist/sdk/engage/landing-page-static-site.js +1 -1
- package/dist/sdk/engage/landing-page-validator.js +1 -1
- package/dist/sdk/engage/landing-page-workspace.js +1 -1
- package/dist/sdk/engage/landing-page-yaml.js +1 -1
- package/dist/sdk/engage/list-campaign-schema.d.ts +48 -0
- package/dist/sdk/engage/list-campaign-schema.d.ts.map +1 -0
- package/dist/sdk/engage/list-campaign-schema.js +1 -0
- package/dist/sdk/engage/list-campaign-schema.js.map +1 -0
- package/dist/sdk/engage/list-campaign-yaml.d.ts +31 -0
- package/dist/sdk/engage/list-campaign-yaml.d.ts.map +1 -0
- package/dist/sdk/engage/list-campaign-yaml.js +1 -0
- package/dist/sdk/engage/list-campaign-yaml.js.map +1 -0
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/always-on-campaign-schema.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/in-browser-message-schema.js +1 -1
- package/dist/sdk/engage/types/landing-page-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage/workspace-assignments.d.ts +23 -0
- package/dist/sdk/engage/workspace-assignments.d.ts.map +1 -0
- package/dist/sdk/engage/workspace-assignments.js +1 -0
- package/dist/sdk/engage/workspace-assignments.js.map +1 -0
- package/dist/sdk/engage.d.ts +40 -2
- 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 -2
- 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 +4 -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.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.d.ts +5 -3
- 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.js +1 -1
- package/dist/sdk/p13n-studio-errors.d.ts +47 -1
- package/dist/sdk/p13n-studio-errors.d.ts.map +1 -1
- package/dist/sdk/p13n-studio-errors.js +1 -1
- package/dist/sdk/p13n-studio-errors.js.map +1 -1
- package/dist/sdk/p13n-studio.d.ts +180 -12
- package/dist/sdk/p13n-studio.d.ts.map +1 -1
- package/dist/sdk/p13n-studio.js +1 -1
- package/dist/sdk/p13n-studio.js.map +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/deleted-table-validation.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/audience-context.d.ts +42 -26
- package/dist/sdk/segment/audience-context.d.ts.map +1 -1
- package/dist/sdk/segment/audience-context.js +1 -1
- package/dist/sdk/segment/audience-context.js.map +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.d.ts +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/validate-files.js.map +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.d.ts +18 -13
- package/dist/sdk/segment.d.ts.map +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/segment.js.map +1 -1
- package/dist/sdk/types/engage.d.ts +118 -2
- 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/p13n-studio.d.ts +56 -0
- package/dist/sdk/types/p13n-studio.d.ts.map +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/util/tree-search.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/task-graph.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.d.ts +10 -0
- package/dist/test-utils/http-mock.d.ts.map +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/http-mock.js.map +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/claude-code-state.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/proxy-fetch.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a3_0x4f3827=a3_0x201a;(function(_0x2da8bf,_0x145453){const _0x1129f3=a3_0x201a,_0x2f5835=_0x2da8bf();while(!![]){try{const _0x3a80dc=-parseInt(_0x1129f3(0x172))/0x1+-parseInt(_0x1129f3(0x16a))/0x2*(parseInt(_0x1129f3(0x16b))/0x3)+-parseInt(_0x1129f3(0x16e))/0x4+parseInt(_0x1129f3(0x15a))/0x5*(-parseInt(_0x1129f3(0x16f))/0x6)+-parseInt(_0x1129f3(0x170))/0x7+-parseInt(_0x1129f3(0x162))/0x8*(parseInt(_0x1129f3(0x171))/0x9)+-parseInt(_0x1129f3(0x15f))/0xa*(-parseInt(_0x1129f3(0x175))/0xb);if(_0x3a80dc===_0x145453)break;else _0x2f5835['push'](_0x2f5835['shift']());}catch(_0x306e7c){_0x2f5835['push'](_0x2f5835['shift']());}}}(a3_0x4181,0x52eb9));import{BaseCommand}from'./command.js';function a3_0x201a(_0x258150,_0x57bd88){_0x258150=_0x258150-0x159;const _0x418189=a3_0x4181();let _0x201a54=_0x418189[_0x258150];return _0x201a54;}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_0x4181(){const _0x4685ac=['verbose','3977677dReNBi','Resolving\x20parent\x20segment\x20\x27','data','error','execute','site','Site:\x20','Usage:\x20tdx\x20activations\x20<parent_name/child_name>','name','104165hGJzJw','✔\x20Found\x20','segment','cause','\x27...','60HUukIJ','resolveSegmentId','\x20\x20Cause:\x20','32HYSVKD','Error:\x20Segment\x20name\x20is\x20required','description','activations','resolveParentId','length','message','Listing\x20activations\x20for\x20segment\x20\x27','3022Nrcryt','690PjQzGz','Error:\x20Child\x20segment\x20name\x20is\x20required\x20for\x20activations','listActivations','2037264zQMBtn','48uzBAKa','4114950qswBKW','33039RRUfls','203957upoZkK','\x20activation'];a3_0x4181=function(){return _0x4685ac;};return a3_0x4181();}export class ActivationsCommand extends BaseCommand{[a3_0x4f3827(0x159)]=a3_0x4f3827(0x165);[a3_0x4f3827(0x164)]='List\x20activations\x20for\x20a\x20segment';async[a3_0x4f3827(0x179)](_0x2a8171){const _0x30167e=a3_0x4f3827,{options:_0x7d7a54,args:_0x2ed483,tdx:_0x19e6b4}=_0x2a8171;if(_0x2ed483[_0x30167e(0x167)]===0x0)return console['error'](_0x30167e(0x163)),console[_0x30167e(0x178)](_0x30167e(0x17c)),0x1;try{const {parentId:_0x1c0c3d,childId:_0x362873}=parseSegmentRef(_0x2ed483[0x0]);if(!_0x362873)return console['error'](_0x30167e(0x16c)),console[_0x30167e(0x178)]('Usage:\x20tdx\x20activations\x20<parent_name/child_name>'),0x1;_0x7d7a54['verbose']&&(console[_0x30167e(0x178)](_0x30167e(0x17b)+_0x7d7a54[_0x30167e(0x17a)]),console['error']('Parent\x20name:\x20'+_0x1c0c3d),console[_0x30167e(0x178)]('Child\x20name:\x20'+_0x362873));const _0xf9b0c4=await withSpinner(_0x30167e(0x176)+_0x1c0c3d+'\x27...',()=>_0x19e6b4[_0x30167e(0x15c)][_0x30167e(0x166)](_0x1c0c3d),{'verbose':_0x7d7a54[_0x30167e(0x174)]}),_0x405f95=_0xf9b0c4[_0x30167e(0x177)];_0x7d7a54[_0x30167e(0x174)]&&console[_0x30167e(0x178)]('Resolved\x20parent\x20ID:\x20'+_0x405f95);const _0x183543=await withSpinner('Resolving\x20child\x20segment\x20\x27'+_0x362873+_0x30167e(0x15e),()=>_0x19e6b4[_0x30167e(0x15c)][_0x30167e(0x160)](_0x405f95,_0x362873),{'verbose':_0x7d7a54['verbose']}),_0x13522d=_0x183543[_0x30167e(0x177)];_0x7d7a54[_0x30167e(0x174)]&&console[_0x30167e(0x178)]('Resolved\x20child\x20ID:\x20'+_0x13522d);const _0x4190a9=await withSpinner(_0x30167e(0x169)+_0x362873+_0x30167e(0x15e),()=>_0x19e6b4[_0x30167e(0x15c)][_0x30167e(0x16d)](_0x405f95,_0x13522d),{'verbose':_0x7d7a54[_0x30167e(0x174)]}),_0x18e9f1=_0x4190a9[_0x30167e(0x177)];return console[_0x30167e(0x178)](_0x30167e(0x15b)+_0x18e9f1['length']+_0x30167e(0x173)+(_0x18e9f1[_0x30167e(0x167)]!==0x1?'s':'')),await handleSDKOutput(_0x18e9f1,_0x7d7a54),0x0;}catch(_0x33f7be){if(_0x33f7be instanceof SDKError)return console['error']('Error:\x20'+_0x33f7be[_0x30167e(0x168)]),_0x33f7be[_0x30167e(0x15d)]&&console[_0x30167e(0x178)](_0x30167e(0x161)+_0x33f7be[_0x30167e(0x15d)]),0x1;throw _0x33f7be;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a4_0x1c6899=a4_0x1107;function a4_0x1107(_0x4ad24d,_0x57014a){_0x4ad24d=_0x4ad24d-0x1d0;const _0x46eca8=a4_0x46ec();let _0x1107c7=_0x46eca8[_0x4ad24d];return _0x1107c7;}function a4_0x46ec(){const _0x231fe4=['Using\x20project:\x20','\x20total','\x0aChanges\x20to\x20form\x20interface\x20\x27','created','message','force','\x20\x20Integration\x20\x22','\x20\x20tdx\x20agent\x20pull\x20','cyan','diff','found','agent.yml','projectDir','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\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)','Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>','tdx.json','projectName','\x0aPush\x20','\x0aChanges\x20to\x20prompt\x20\x27','site','\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','INVALID_ARGUMENT','\x20resources\x20to\x20\x27','dirname','pushAgent','\x20\x20Chat\x20Interfaces:\x20','\x20\x20Form\x20Interface\x20\x22','cwd','counts','execute','\x20successfully','\x20\x20Target:\x20','name','18615PzvZGL','unchanged','red','chatInterfaces','\x0a✔\x20Pushed\x20','\x20\x20Prompts:\x20','\x20created','parse','llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x0aWrite\x20','Cloning\x20\x22','\x20\x20Prompt\x20\x22','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x0aRun\x20\x27tdx\x20agent\x20pull\x20','agentId','cloneProject','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','Source:\x20','projectId','Dry\x20run\x20-\x20no\x20changes\x20made','\x0aChanges\x20to\x20integration\x20\x27','new','\x20\x20Chat\x20Interface\x20\x22','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x0aErrors\x20found:','agent:push','\x22\x20to\x20new\x20project\x20\x22','\x20resources?','updated','reason','Output:\x20','\x0aPull\x20summary\x20for\x20\x27','\x20errors','\x20\x20Form\x20Interfaces:\x20','sourceProjectName','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x20\x20Agent\x20\x22','-\x20nothing\x20pushed','repeat','\x20\x20Experimental\x20Artifact\x20\x22','dryRun','\x0aChanges\x20to\x20chat\x20interface\x20\x27','Agent\x20pulled\x20successfully','formInterfaces','\x20\x20Knowledge\x20Bases:\x20','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project','error','errors','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','session','84rDKWki','Cancelled','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','<new-name>','Pushing\x20agent\x20from\x20\x22','arg-dir','cwd-config','experimentalKnowledgeBases','\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27','New\x20project:\x20','-\x20no\x20files\x20written','\x22\x20from\x20project\x20\x22','Analyzing\x20changes\x20to\x20push...','\x20=\x20','Chat:\x20','\x20changed','agents','\x20new','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)','\x22:\x20','421897llbIuw','Would\x20pull\x20agent:\x20','\x20|\x20','Using\x20project\x20from\x20context:\x20','outputDir','experimentalArtifacts','source','Status:\x20','26905572MLWaId','Using\x20local\x20project:\x20','context','Using\x20current\x20project:\x20','\x20files?','green','No\x20tdx.json\x20found\x20in\x20','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','Pushing\x20to\x20project...','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','log','220438WKaQRn','\x0aPush\x20summary\x20for\x20\x27','llm_project','Output\x20path:\x20','Errors:','\x20unchanged','prompts','Dry\x20run\x20-\x20no\x20files\x20written','\x20files\x20to\x20','dim','pullProject','yellow','Analyzing\x20project\x20\x22','6941808gMZbyV','Agent:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<local-dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20to\x20existing\x20local\x20directory','push','gray','MISSING_ARGUMENT','isNew','agentName','\x0aChanges:','\x20\x20Experimental\x20Artifacts:\x20','newProjectId','33cmzPNR','\x20\x20tdx\x20agent\x20clone\x20agents/','action','\x20\x20Knowledge\x20Base\x20\x22','hasChanges','\x20\x20Integrations:\x20','Writing\x20files...','Would\x20push\x20agent:\x20','\x20\x20Agents:\x20','llm','newProjectName','join','no_local_folder','yes','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','pushProject','\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','utf-8','Project:\x20','agent','\x22...','description','Project\x20cloned\x20with\x20errors','total','\x20--profile\x20','Using\x20context\x20project:\x20','\x20--name\x20','\x20\x20Text\x20Knowledge\x20Bases:\x20','Summary:','\x20\x20Text\x20Knowledge\x20Base\x20\x22','\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27','integrations','pullAgent','✔\x20Context\x20set:\x20','llmProject','1412500UpeyLV','689810liWMMQ','textKnowledgeBases','knowledgeBases','\x0aError:','New\x20project\x20ID:\x20','profile','Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>','\x20updated','outputPath'];a4_0x46ec=function(){return _0x231fe4;};return a4_0x46ec();}(function(_0x208b42,_0x1d3d6d){const _0x7bf5cc=a4_0x1107,_0x355dfd=_0x208b42();while(!![]){try{const _0x3aa864=-parseInt(_0x7bf5cc(0x27e))/0x1+-parseInt(_0x7bf5cc(0x242))/0x2*(parseInt(_0x7bf5cc(0x25a))/0x3)+-parseInt(_0x7bf5cc(0x27d))/0x4+-parseInt(_0x7bf5cc(0x1e6))/0x5+parseInt(_0x7bf5cc(0x21a))/0x6*(parseInt(_0x7bf5cc(0x22e))/0x7)+-parseInt(_0x7bf5cc(0x24f))/0x8+parseInt(_0x7bf5cc(0x236))/0x9;if(_0x3aa864===_0x1d3d6d)break;else _0x355dfd['push'](_0x355dfd['shift']());}catch(_0x398a4c){_0x355dfd['push'](_0x355dfd['shift']());}}}(a4_0x46ec,0xac7cd));import a4_0x33712f from'chalk';import a4_0x21a3c8 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(_0x732e5f){const _0x7bc9ef=a4_0x1107,_0x444ece=[];if(_0x732e5f['total']!==undefined)_0x444ece[_0x7bc9ef(0x252)](_0x732e5f['total']+_0x7bc9ef(0x288));if(_0x732e5f[_0x7bc9ef(0x1fc)]!==undefined&&_0x732e5f[_0x7bc9ef(0x1fc)]>0x0)_0x444ece[_0x7bc9ef(0x252)](a4_0x33712f[_0x7bc9ef(0x23b)](_0x732e5f[_0x7bc9ef(0x1fc)]+'\x20new'));if(_0x732e5f[_0x7bc9ef(0x28a)]!==undefined&&_0x732e5f[_0x7bc9ef(0x28a)]>0x0)_0x444ece['push'](a4_0x33712f[_0x7bc9ef(0x23b)](_0x732e5f[_0x7bc9ef(0x28a)]+_0x7bc9ef(0x1ec)));if(_0x732e5f[_0x7bc9ef(0x203)]!==undefined&&_0x732e5f[_0x7bc9ef(0x203)]>0x0)_0x444ece[_0x7bc9ef(0x252)](a4_0x33712f[_0x7bc9ef(0x24d)](_0x732e5f[_0x7bc9ef(0x203)]+_0x7bc9ef(0x285)));if(_0x732e5f['unchanged']!==undefined&&_0x732e5f[_0x7bc9ef(0x1e7)]>0x0)_0x444ece[_0x7bc9ef(0x252)](a4_0x33712f[_0x7bc9ef(0x253)](_0x732e5f['unchanged']+_0x7bc9ef(0x247)));if(_0x732e5f[_0x7bc9ef(0x217)]!==undefined&&_0x732e5f[_0x7bc9ef(0x217)]>0x0)_0x444ece[_0x7bc9ef(0x252)](a4_0x33712f[_0x7bc9ef(0x1e8)](_0x732e5f[_0x7bc9ef(0x217)]+_0x7bc9ef(0x207)));return _0x444ece['join'](',\x20');}function displayDiffs(_0x1023e1,_0x200940,_0x48f486,_0x160066,_0x2677a3,_0x98d738,_0x5d4383,_0x58e97f,_0x4c68f0){const _0xba4df3=a4_0x1107;for(const _0x4acc76 of _0x1023e1){if(_0x4acc76[_0xba4df3(0x290)]){const _0x1d642e=_0x4acc76[_0xba4df3(0x256)]||_0x4acc76[_0xba4df3(0x1e5)];console[_0xba4df3(0x241)]('\x0aChanges\x20to\x20agent\x20\x27'+_0x1d642e+'\x27:'),console[_0xba4df3(0x241)]('─'[_0xba4df3(0x20d)](0x3c)),console[_0xba4df3(0x241)](_0x4acc76[_0xba4df3(0x290)]),console['log']('─'[_0xba4df3(0x20d)](0x3c));}}for(const _0x425e5b of _0x200940){_0x425e5b[_0xba4df3(0x290)]&&(console[_0xba4df3(0x241)](_0xba4df3(0x214)+_0x425e5b[_0xba4df3(0x1e5)]+'\x27:'),console['log']('─'[_0xba4df3(0x20d)](0x3c)),console[_0xba4df3(0x241)](_0x425e5b[_0xba4df3(0x290)]),console[_0xba4df3(0x241)]('─'['repeat'](0x3c)));}for(const _0x542ff1 of _0x48f486){_0x542ff1[_0xba4df3(0x290)]&&(console[_0xba4df3(0x241)](_0xba4df3(0x278)+_0x542ff1[_0xba4df3(0x1e5)]+'\x27:'),console['log']('─'[_0xba4df3(0x20d)](0x3c)),console[_0xba4df3(0x241)](_0x542ff1[_0xba4df3(0x290)]),console[_0xba4df3(0x241)]('─'[_0xba4df3(0x20d)](0x3c)));}for(const _0x193164 of _0x160066){_0x193164[_0xba4df3(0x290)]&&(console['log'](_0xba4df3(0x1d7)+_0x193164['name']+'\x27:'),console[_0xba4df3(0x241)]('─'['repeat'](0x3c)),console[_0xba4df3(0x241)](_0x193164[_0xba4df3(0x290)]),console[_0xba4df3(0x241)]('─'['repeat'](0x3c)));}for(const _0x31ea4f of _0x2677a3){_0x31ea4f['diff']&&(console['log'](_0xba4df3(0x1fb)+_0x31ea4f[_0xba4df3(0x1e5)]+'\x27:'),console['log']('─'['repeat'](0x3c)),console['log'](_0x31ea4f[_0xba4df3(0x290)]),console[_0xba4df3(0x241)]('─'[_0xba4df3(0x20d)](0x3c)));}for(const _0x13ecaa of _0x98d738){_0x13ecaa['diff']&&(console['log'](_0xba4df3(0x222)+_0x13ecaa[_0xba4df3(0x1e5)]+'\x27:'),console[_0xba4df3(0x241)]('─'[_0xba4df3(0x20d)](0x3c)),console[_0xba4df3(0x241)](_0x13ecaa[_0xba4df3(0x290)]),console['log']('─'[_0xba4df3(0x20d)](0x3c)));}for(const _0x270973 of _0x5d4383){_0x270973[_0xba4df3(0x290)]&&(console[_0xba4df3(0x241)]('\x0aChanges\x20to\x20experimental\x20artifact\x20\x27'+_0x270973[_0xba4df3(0x1e5)]+'\x27:'),console[_0xba4df3(0x241)]('─'['repeat'](0x3c)),console['log'](_0x270973[_0xba4df3(0x290)]),console[_0xba4df3(0x241)]('─'[_0xba4df3(0x20d)](0x3c)));}for(const _0x2cb3c6 of _0x58e97f){_0x2cb3c6['diff']&&(console[_0xba4df3(0x241)](_0xba4df3(0x289)+_0x2cb3c6[_0xba4df3(0x1e5)]+'\x27:'),console[_0xba4df3(0x241)]('─'[_0xba4df3(0x20d)](0x3c)),console[_0xba4df3(0x241)](_0x2cb3c6[_0xba4df3(0x290)]),console[_0xba4df3(0x241)]('─'[_0xba4df3(0x20d)](0x3c)));}for(const _0x110d6a of _0x4c68f0){_0x110d6a[_0xba4df3(0x290)]&&(console[_0xba4df3(0x241)](_0xba4df3(0x210)+_0x110d6a[_0xba4df3(0x1e5)]+'\x27:'),console[_0xba4df3(0x241)]('─'[_0xba4df3(0x20d)](0x3c)),console[_0xba4df3(0x241)](_0x110d6a[_0xba4df3(0x290)]),console[_0xba4df3(0x241)]('─'[_0xba4df3(0x20d)](0x3c)));}}export class AgentPullCommand extends BaseCommand{['name']='agent:pull';['description']=a4_0x1c6899(0x1d1);async[a4_0x1c6899(0x1e2)](_0x3b892d){const _0xa12523=a4_0x1c6899,{options:_0x11bf4c,args:_0x54e08e,tdx:_0x43cab2}=_0x3b892d,_0x3b185e=_0x54e08e[0x0],_0x47b914=_0x54e08e[0x1],_0x1b2495=_0x11bf4c['output'],_0x3ed9a6=_0x11bf4c[_0xa12523(0x20f)],_0x1602ca=_0x11bf4c[_0xa12523(0x28c)],_0x3addc3=_0x11bf4c[_0xa12523(0x267)],_0x140f01=_0x11bf4c[_0xa12523(0x27c)],_0x56383a=_0x11bf4c[_0xa12523(0x26d)];let _0x21e085;if(_0x3b185e){const _0x45d976=a4_0x21a3c8[_0xa12523(0x265)](_0x3b185e,_0xa12523(0x1d4));if(existsSync(_0x45d976))try{const _0x3f78bf=JSON['parse'](readFileSync(_0x45d976,'utf-8'));_0x3f78bf[_0xa12523(0x244)]&&(_0x21e085={'llm_project':_0x3f78bf[_0xa12523(0x244)]});}catch{}}const _0x448317=findAgentConfigPath(process[_0xa12523(0x1e0)]());let _0x15a6a7;if(_0x448317)try{const _0x1b32ae=JSON[_0xa12523(0x1ed)](readFileSync(_0x448317,_0xa12523(0x26b)));_0x1b32ae[_0xa12523(0x244)]&&(_0x15a6a7={'llm_project':_0x1b32ae[_0xa12523(0x244)]});}catch{}const _0x10b522=resolveAgentPullArgs({'arg':_0x3b185e,'agentNameArg':_0x47b914,'agentFlag':_0x56383a,'contextProject':_0x140f01,'argDirConfig':_0x21e085,'cwdConfigPath':_0x448317||undefined,'cwdConfig':_0x15a6a7}),{projectNameOrId:_0x436d24,targetAgentName:_0x3640db,existingOutputDir:_0x520cb7,source:_0x32418c}=_0x10b522;if(_0x32418c===_0xa12523(0x21f))console[_0xa12523(0x241)](a4_0x33712f['dim']('Using\x20project\x20from\x20'+a4_0x21a3c8[_0xa12523(0x265)](_0x3b185e,'tdx.json')+':\x20'+_0x436d24));else{if(_0x32418c===_0xa12523(0x220))console[_0xa12523(0x241)](a4_0x33712f[_0xa12523(0x24b)](_0xa12523(0x287)+_0x436d24));else _0x32418c==='context'&&console['log'](a4_0x33712f[_0xa12523(0x24b)](_0xa12523(0x231)+_0x436d24));}if(!_0x436d24)return _0x56383a?(console[_0xa12523(0x241)](a4_0x33712f['yellow']('The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a')),console[_0xa12523(0x241)](_0xa12523(0x284)),console['log'](_0xa12523(0x1d3))):(console[_0xa12523(0x241)](a4_0x33712f[_0xa12523(0x24d)](_0xa12523(0x1ee))),console[_0xa12523(0x241)](_0xa12523(0x22c)),console[_0xa12523(0x241)]('\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[_0xa12523(0x241)](_0xa12523(0x251)),console[_0xa12523(0x241)](_0xa12523(0x26a)),console[_0xa12523(0x241)](_0xa12523(0x1d9))),0x1;if(_0x3640db){const {data:_0x5b381d}=await withSpinner('Pulling\x20agent\x20\x22'+_0x3640db+_0xa12523(0x225)+_0x436d24+_0xa12523(0x26e),()=>_0x43cab2[_0xa12523(0x263)][_0xa12523(0x27a)](_0x436d24,_0x3640db,_0x1b2495,{'dryRun':_0x3ed9a6,'force':_0x1602ca}));if(_0x3ed9a6)return console['log'](a4_0x33712f['yellow'](_0xa12523(0x249))),console[_0xa12523(0x241)](_0xa12523(0x22f)+_0x5b381d[_0xa12523(0x256)]),console[_0xa12523(0x241)](_0xa12523(0x245)+_0x5b381d[_0xa12523(0x286)]),_0x5b381d[_0xa12523(0x290)]&&(console['log'](_0xa12523(0x257)),console[_0xa12523(0x241)]('─'[_0xa12523(0x20d)](0x3c)),console[_0xa12523(0x241)](_0x5b381d[_0xa12523(0x290)]),console[_0xa12523(0x241)]('─'[_0xa12523(0x20d)](0x3c))),0x0;return console[_0xa12523(0x241)](a4_0x33712f[_0xa12523(0x23b)](_0xa12523(0x211))),console[_0xa12523(0x241)](_0xa12523(0x250)+_0x5b381d[_0xa12523(0x256)]),console[_0xa12523(0x241)](_0xa12523(0x205)+_0x5b381d[_0xa12523(0x286)]),console[_0xa12523(0x241)](_0xa12523(0x235)+(_0x5b381d[_0xa12523(0x255)]?a4_0x33712f[_0xa12523(0x23b)]('new'):_0x5b381d[_0xa12523(0x25e)]?a4_0x33712f[_0xa12523(0x24d)](_0xa12523(0x203)):a4_0x33712f[_0xa12523(0x253)](_0xa12523(0x1e7)))),0x0;}const _0x39596f=_0x520cb7||_0x1b2495,{data:_0x573ea5}=await withSpinner(_0xa12523(0x24e)+_0x436d24+_0xa12523(0x26e),()=>_0x43cab2[_0xa12523(0x263)]['pullProject'](_0x436d24,_0x39596f,{'dryRun':!![]})),_0x488b82=_0x573ea5['counts']['agents'][_0xa12523(0x1fc)]+_0x573ea5[_0xa12523(0x1e1)]['knowledgeBases'][_0xa12523(0x1fc)]+_0x573ea5[_0xa12523(0x1e1)]['textKnowledgeBases'][_0xa12523(0x1fc)]+_0x573ea5['counts'][_0xa12523(0x248)][_0xa12523(0x1fc)]+_0x573ea5[_0xa12523(0x1e1)][_0xa12523(0x279)][_0xa12523(0x1fc)]+_0x573ea5[_0xa12523(0x1e1)][_0xa12523(0x221)][_0xa12523(0x1fc)]+_0x573ea5[_0xa12523(0x1e1)]['experimentalArtifacts']['new']+_0x573ea5[_0xa12523(0x1e1)][_0xa12523(0x212)][_0xa12523(0x1fc)]+_0x573ea5['counts'][_0xa12523(0x1e9)]['new'],_0x21e7a9=_0x573ea5[_0xa12523(0x1e1)]['agents']['updated']+_0x573ea5['counts'][_0xa12523(0x280)][_0xa12523(0x203)]+_0x573ea5[_0xa12523(0x1e1)]['textKnowledgeBases']['updated']+_0x573ea5[_0xa12523(0x1e1)][_0xa12523(0x248)][_0xa12523(0x203)]+_0x573ea5['counts'][_0xa12523(0x279)]['updated']+_0x573ea5[_0xa12523(0x1e1)]['experimentalKnowledgeBases'][_0xa12523(0x203)]+_0x573ea5[_0xa12523(0x1e1)]['experimentalArtifacts'][_0xa12523(0x203)]+_0x573ea5[_0xa12523(0x1e1)][_0xa12523(0x212)][_0xa12523(0x203)]+_0x573ea5[_0xa12523(0x1e1)][_0xa12523(0x1e9)][_0xa12523(0x203)],_0xfe0260=_0x573ea5[_0xa12523(0x1e1)]['agents']['unchanged']+_0x573ea5[_0xa12523(0x1e1)][_0xa12523(0x280)][_0xa12523(0x1e7)]+_0x573ea5[_0xa12523(0x1e1)][_0xa12523(0x27f)][_0xa12523(0x1e7)]+_0x573ea5[_0xa12523(0x1e1)]['prompts'][_0xa12523(0x1e7)]+_0x573ea5['counts'][_0xa12523(0x279)]['unchanged']+_0x573ea5[_0xa12523(0x1e1)]['experimentalKnowledgeBases'][_0xa12523(0x1e7)]+_0x573ea5[_0xa12523(0x1e1)][_0xa12523(0x233)][_0xa12523(0x1e7)]+_0x573ea5[_0xa12523(0x1e1)]['formInterfaces']['unchanged']+_0x573ea5[_0xa12523(0x1e1)]['chatInterfaces'][_0xa12523(0x1e7)];console[_0xa12523(0x241)](_0xa12523(0x206)+_0x573ea5[_0xa12523(0x1d5)]+'\x27:'),console[_0xa12523(0x241)]('\x20\x20'+a4_0x33712f['green']('+\x20'+_0x488b82+'\x20new')+_0xa12523(0x230)+a4_0x33712f[_0xa12523(0x24d)]('~\x20'+_0x21e7a9+_0xa12523(0x229))+_0xa12523(0x230)+a4_0x33712f[_0xa12523(0x24b)]('=\x20'+_0xfe0260+_0xa12523(0x247))),console[_0xa12523(0x241)](_0xa12523(0x262)+formatCountSummary(_0x573ea5[_0xa12523(0x1e1)][_0xa12523(0x22a)])),console[_0xa12523(0x241)](_0xa12523(0x213)+formatCountSummary(_0x573ea5[_0xa12523(0x1e1)]['knowledgeBases'])),console['log'](_0xa12523(0x275)+formatCountSummary(_0x573ea5[_0xa12523(0x1e1)][_0xa12523(0x27f)])),console['log'](_0xa12523(0x1eb)+formatCountSummary(_0x573ea5['counts'][_0xa12523(0x248)])),console[_0xa12523(0x241)](_0xa12523(0x25f)+formatCountSummary(_0x573ea5['counts'][_0xa12523(0x279)])),console[_0xa12523(0x241)](_0xa12523(0x208)+formatCountSummary(_0x573ea5[_0xa12523(0x1e1)][_0xa12523(0x212)])),console['log'](_0xa12523(0x1de)+formatCountSummary(_0x573ea5['counts']['chatInterfaces']));const _0x216e0c=_0x573ea5[_0xa12523(0x1e1)][_0xa12523(0x221)]['total']>0x0||_0x573ea5[_0xa12523(0x1e1)][_0xa12523(0x233)][_0xa12523(0x271)]>0x0;_0x216e0c&&(console[_0xa12523(0x241)](_0xa12523(0x23d)+formatCountSummary(_0x573ea5[_0xa12523(0x1e1)][_0xa12523(0x221)])),console[_0xa12523(0x241)](_0xa12523(0x258)+formatCountSummary(_0x573ea5[_0xa12523(0x1e1)]['experimentalArtifacts'])));console[_0xa12523(0x241)](_0xa12523(0x1e4)+a4_0x33712f[_0xa12523(0x28f)](_0x573ea5[_0xa12523(0x232)])),displayDiffs(_0x573ea5['agents'],_0x573ea5[_0xa12523(0x280)],_0x573ea5[_0xa12523(0x27f)],_0x573ea5[_0xa12523(0x248)],_0x573ea5[_0xa12523(0x279)],_0x573ea5[_0xa12523(0x221)],_0x573ea5[_0xa12523(0x233)],_0x573ea5[_0xa12523(0x212)],_0x573ea5[_0xa12523(0x1e9)]);if(_0x3ed9a6)return console['log'](a4_0x33712f[_0xa12523(0x24d)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x488b82===0x0&&_0x21e7a9===0x0)return console['log'](a4_0x33712f['green'](_0xa12523(0x240))),saveSessionContext({'llm_project':_0x573ea5[_0xa12523(0x1d5)]},_0x11bf4c[_0xa12523(0x219)]),console[_0xa12523(0x241)](a4_0x33712f[_0xa12523(0x23b)](_0xa12523(0x27b)+a4_0x33712f[_0xa12523(0x24b)]('llm_project')+_0xa12523(0x227)+a4_0x33712f['cyan'](_0x573ea5[_0xa12523(0x1d5)]))),0x0;if(!_0x3addc3&&!_0x1602ca){if(!isInteractive())return console[_0xa12523(0x216)](a4_0x33712f['red'](_0xa12523(0x281)),_0xa12523(0x1f3)),console[_0xa12523(0x216)](a4_0x33712f[_0xa12523(0x24b)](_0xa12523(0x1ef))),0x1;const _0x310ebd=await confirmKey(_0xa12523(0x1f0)+(_0x488b82+_0x21e7a9)+_0xa12523(0x23a));if(!_0x310ebd)return console[_0xa12523(0x241)](a4_0x33712f['yellow'](_0xa12523(0x21b)),_0xa12523(0x224)),0x1;}const {data:_0x1f13e2}=await withSpinner(_0xa12523(0x260),()=>_0x43cab2[_0xa12523(0x263)][_0xa12523(0x24c)](_0x436d24,_0x39596f,{'force':_0x1602ca}));return console[_0xa12523(0x241)](a4_0x33712f[_0xa12523(0x23b)]('\x0a✔\x20Pulled\x20'+(_0x488b82+_0x21e7a9)+_0xa12523(0x24a)+_0x1f13e2['outputDir'])),saveSessionContext({'llm_project':_0x1f13e2['projectName']},_0x11bf4c[_0xa12523(0x219)]),console[_0xa12523(0x241)](a4_0x33712f[_0xa12523(0x23b)](_0xa12523(0x27b)+a4_0x33712f['dim']('llm_project')+_0xa12523(0x227)+a4_0x33712f['cyan'](_0x1f13e2[_0xa12523(0x1d5)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x1c6899(0x1e5)]='agent:clone';[a4_0x1c6899(0x26f)]=a4_0x1c6899(0x1f7);async[a4_0x1c6899(0x1e2)](_0x31f1ae){const _0x28695b=a4_0x1c6899,{options:_0x45b089,args:_0x1e538c,tdx:_0x53f453}=_0x31f1ae,_0x2af92c=_0x1e538c[0x0],_0x465c59=_0x45b089[_0x28695b(0x1e5)],_0x3fd0b9=_0x45b089[_0x28695b(0x20f)],_0x44ad0b=_0x45b089[_0x28695b(0x267)],_0x4ef885=_0x45b089[_0x28695b(0x1d8)],_0xa46fec=_0x45b089['llmProject'];let _0x17a88b;const _0x4d1aa6=findAgentConfigPath(process['cwd']());if(_0x2af92c){const _0x1bffcb=a4_0x21a3c8[_0x28695b(0x265)](_0x2af92c,_0x28695b(0x1d4));existsSync(_0x1bffcb)?(_0x17a88b=_0x2af92c,console[_0x28695b(0x241)](a4_0x33712f['dim']('Using\x20local\x20project:\x20'+_0x2af92c))):_0x17a88b=_0x2af92c;}else{if(_0x4d1aa6)_0x17a88b=a4_0x21a3c8[_0x28695b(0x1dc)](_0x4d1aa6),console[_0x28695b(0x241)](a4_0x33712f[_0x28695b(0x24b)](_0x28695b(0x239)+_0x17a88b));else{if(_0xa46fec){const _0x3c1929=sanitizeForFilesystem(_0xa46fec);let _0x29dfa5=_0x3c1929,_0x2a9891=a4_0x21a3c8[_0x28695b(0x265)](process[_0x28695b(0x1e0)](),_0x28695b(0x22a),_0x3c1929,_0x28695b(0x1d4));if(!existsSync(_0x2a9891)){const _0x289c03=normalizeName(_0xa46fec),_0x304fc2=a4_0x21a3c8[_0x28695b(0x265)](process['cwd'](),_0x28695b(0x22a),_0x289c03,_0x28695b(0x1d4));existsSync(_0x304fc2)&&(_0x29dfa5=_0x289c03,_0x2a9891=_0x304fc2);}if(existsSync(_0x2a9891))_0x17a88b=a4_0x21a3c8[_0x28695b(0x1dc)](_0x2a9891),console[_0x28695b(0x241)](a4_0x33712f['dim'](_0x28695b(0x237)+_0x17a88b));else{const _0x1d3950=_0x45b089[_0x28695b(0x283)];if(_0x1d3950)throw new SDKError(ErrorCode[_0x28695b(0x1da)],'Cannot\x20clone\x20from\x20context\x20project\x20\x22'+_0xa46fec+'\x22\x20to\x20a\x20different\x20profile',undefined,{'helpText':_0x28695b(0x21c)+'First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a'+(_0x28695b(0x28e)+_0xa46fec+'\x0a')+(_0x28695b(0x25b)+_0x29dfa5+_0x28695b(0x274)+(_0x465c59||_0x28695b(0x21d))+_0x28695b(0x272)+_0x1d3950)});_0x17a88b=_0xa46fec,console['log'](a4_0x33712f[_0x28695b(0x24b)](_0x28695b(0x273)+_0xa46fec));}}}}if(!_0x17a88b)return console[_0x28695b(0x241)](a4_0x33712f[_0x28695b(0x24d)](_0x28695b(0x268))),console[_0x28695b(0x241)](_0x28695b(0x215)),console[_0x28695b(0x241)]('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console[_0x28695b(0x241)](_0x28695b(0x1d2)),console[_0x28695b(0x241)]('\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>'),0x1;if(!_0x465c59)throw new SDKError(ErrorCode[_0x28695b(0x254)],'New\x20project\x20name\x20is\x20required',undefined,{'helpText':'Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>'});if(!_0x44ad0b&&!_0x3fd0b9){if(!isInteractive())return console['error'](a4_0x33712f[_0x28695b(0x1e8)](_0x28695b(0x281)),_0x28695b(0x1f3)),console[_0x28695b(0x216)](a4_0x33712f['dim'](_0x28695b(0x1ef))),0x1;const _0x23f47e=await confirmKey('Clone\x20\x22'+_0x17a88b+_0x28695b(0x201)+_0x465c59+'\x22?');if(!_0x23f47e)return console[_0x28695b(0x241)](a4_0x33712f[_0x28695b(0x24d)](_0x28695b(0x21b))),0x1;}const {data:_0x19e1ee}=await withSpinner(_0x28695b(0x1f1)+_0x17a88b+'\x22\x20to\x20\x22'+_0x465c59+'\x22...',()=>_0x53f453[_0x28695b(0x263)][_0x28695b(0x1f6)](_0x17a88b,_0x465c59,{'dryRun':_0x3fd0b9}));if(_0x3fd0b9){console[_0x28695b(0x241)](a4_0x33712f[_0x28695b(0x24d)](_0x28695b(0x1fa))),console[_0x28695b(0x241)](_0x28695b(0x1f8)+_0x19e1ee[_0x28695b(0x209)]),console[_0x28695b(0x241)](_0x28695b(0x223)+_0x465c59),console['log']('Would\x20clone:'),console['log'](_0x28695b(0x262)+_0x19e1ee[_0x28695b(0x1e1)][_0x28695b(0x22a)][_0x28695b(0x28a)]),console[_0x28695b(0x241)]('\x20\x20Knowledge\x20Bases:\x20'+_0x19e1ee[_0x28695b(0x1e1)]['knowledgeBases'][_0x28695b(0x28a)]),console[_0x28695b(0x241)](_0x28695b(0x1eb)+_0x19e1ee['counts']['prompts'][_0x28695b(0x28a)]),console['log'](_0x28695b(0x208)+_0x19e1ee[_0x28695b(0x1e1)][_0x28695b(0x212)][_0x28695b(0x28a)]),console[_0x28695b(0x241)](_0x28695b(0x1de)+_0x19e1ee[_0x28695b(0x1e1)][_0x28695b(0x1e9)][_0x28695b(0x28a)]);const _0x5c6f9a=_0x19e1ee['counts'][_0x28695b(0x221)]['created']>0x0||_0x19e1ee['counts'][_0x28695b(0x233)][_0x28695b(0x28a)]>0x0;return _0x5c6f9a&&(console[_0x28695b(0x241)](_0x28695b(0x23d)+_0x19e1ee[_0x28695b(0x1e1)][_0x28695b(0x221)][_0x28695b(0x28a)]),console[_0x28695b(0x241)]('\x20\x20Experimental\x20Artifacts:\x20'+_0x19e1ee['counts'][_0x28695b(0x233)][_0x28695b(0x28a)])),0x0;}const _0x2d935f=_0x19e1ee[_0x28695b(0x1e1)][_0x28695b(0x22a)][_0x28695b(0x217)]>0x0||_0x19e1ee[_0x28695b(0x1e1)][_0x28695b(0x280)][_0x28695b(0x217)]>0x0||_0x19e1ee[_0x28695b(0x1e1)][_0x28695b(0x248)]['errors']>0x0||_0x19e1ee[_0x28695b(0x1e1)][_0x28695b(0x212)]['errors']>0x0||_0x19e1ee[_0x28695b(0x1e1)][_0x28695b(0x1e9)][_0x28695b(0x217)]>0x0||_0x19e1ee[_0x28695b(0x1e1)][_0x28695b(0x221)][_0x28695b(0x217)]>0x0||_0x19e1ee[_0x28695b(0x1e1)][_0x28695b(0x233)][_0x28695b(0x217)]>0x0;_0x2d935f?console['log'](a4_0x33712f[_0x28695b(0x24d)](_0x28695b(0x270))):console['log'](a4_0x33712f[_0x28695b(0x23b)]('Project\x20cloned\x20successfully'));console[_0x28695b(0x241)](_0x28695b(0x1f8)+_0x19e1ee['sourceProjectName']),console['log'](_0x28695b(0x223)+_0x19e1ee[_0x28695b(0x264)]),console[_0x28695b(0x241)](_0x28695b(0x282)+_0x19e1ee['newProjectId']),console[_0x28695b(0x241)](),console[_0x28695b(0x241)](_0x28695b(0x276)),console['log'](_0x28695b(0x262)+formatCountSummary(_0x19e1ee[_0x28695b(0x1e1)]['agents'])),console[_0x28695b(0x241)](_0x28695b(0x213)+formatCountSummary(_0x19e1ee[_0x28695b(0x1e1)]['knowledgeBases'])),console[_0x28695b(0x241)](_0x28695b(0x1eb)+formatCountSummary(_0x19e1ee['counts']['prompts'])),console[_0x28695b(0x241)](_0x28695b(0x25f)+formatCountSummary(_0x19e1ee[_0x28695b(0x1e1)][_0x28695b(0x279)])),console[_0x28695b(0x241)](_0x28695b(0x208)+formatCountSummary(_0x19e1ee['counts']['formInterfaces'])),console['log'](_0x28695b(0x1de)+formatCountSummary(_0x19e1ee[_0x28695b(0x1e1)][_0x28695b(0x1e9)]));const _0x1ea94a=_0x19e1ee[_0x28695b(0x1e1)][_0x28695b(0x221)][_0x28695b(0x28a)]>0x0||_0x19e1ee['counts'][_0x28695b(0x221)]['updated']>0x0||_0x19e1ee['counts']['experimentalKnowledgeBases']['unchanged']>0x0||_0x19e1ee['counts'][_0x28695b(0x233)][_0x28695b(0x28a)]>0x0||_0x19e1ee['counts']['experimentalArtifacts'][_0x28695b(0x203)]>0x0||_0x19e1ee[_0x28695b(0x1e1)][_0x28695b(0x233)]['unchanged']>0x0;_0x1ea94a&&(console[_0x28695b(0x241)](_0x28695b(0x23d)+formatCountSummary(_0x19e1ee['counts'][_0x28695b(0x221)])),console[_0x28695b(0x241)]('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x19e1ee['counts'][_0x28695b(0x233)])));if(_0x2d935f){console[_0x28695b(0x241)](),console[_0x28695b(0x241)](a4_0x33712f['red'](_0x28695b(0x246)));for(const _0x2b9b0d of _0x19e1ee[_0x28695b(0x22a)]){_0x2b9b0d[_0x28695b(0x25c)]===_0x28695b(0x216)&&console[_0x28695b(0x241)](a4_0x33712f[_0x28695b(0x1e8)]('\x20\x20Agent\x20\x22'+_0x2b9b0d['agentName']+'\x22:\x20'+_0x2b9b0d[_0x28695b(0x216)]));}for(const _0x5e1896 of _0x19e1ee['knowledgeBases']){_0x5e1896[_0x28695b(0x25c)]===_0x28695b(0x216)&&console[_0x28695b(0x241)](a4_0x33712f['red']('\x20\x20Knowledge\x20Base\x20\x22'+_0x5e1896[_0x28695b(0x1e5)]+'\x22:\x20'+_0x5e1896['error']));}for(const _0x3b73dc of _0x19e1ee[_0x28695b(0x248)]){_0x3b73dc[_0x28695b(0x25c)]===_0x28695b(0x216)&&console['log'](a4_0x33712f[_0x28695b(0x1e8)](_0x28695b(0x1f2)+_0x3b73dc[_0x28695b(0x1e5)]+_0x28695b(0x22d)+_0x3b73dc[_0x28695b(0x216)]));}for(const _0x5dac43 of _0x19e1ee[_0x28695b(0x279)]){_0x5dac43['action']===_0x28695b(0x216)&&console['log'](a4_0x33712f[_0x28695b(0x1e8)](_0x28695b(0x28d)+_0x5dac43[_0x28695b(0x1e5)]+_0x28695b(0x22d)+_0x5dac43['error']));}for(const _0x1e149d of _0x19e1ee['formInterfaces']){_0x1e149d[_0x28695b(0x25c)]===_0x28695b(0x216)&&console[_0x28695b(0x241)](a4_0x33712f['red']('\x20\x20Form\x20Interface\x20\x22'+_0x1e149d[_0x28695b(0x1e5)]+'\x22:\x20'+_0x1e149d['error']));}for(const _0x48cc13 of _0x19e1ee['chatInterfaces']){_0x48cc13['action']===_0x28695b(0x216)&&console[_0x28695b(0x241)](a4_0x33712f[_0x28695b(0x1e8)](_0x28695b(0x1fd)+_0x48cc13['name']+'\x22:\x20'+_0x48cc13[_0x28695b(0x216)]));}for(const _0x35f590 of _0x19e1ee[_0x28695b(0x221)]){_0x35f590[_0x28695b(0x25c)]===_0x28695b(0x216)&&console[_0x28695b(0x241)](a4_0x33712f[_0x28695b(0x1e8)](_0x28695b(0x20a)+_0x35f590[_0x28695b(0x1e5)]+_0x28695b(0x22d)+_0x35f590['error']));}for(const _0x5108a9 of _0x19e1ee[_0x28695b(0x233)]){_0x5108a9[_0x28695b(0x25c)]===_0x28695b(0x216)&&console[_0x28695b(0x241)](a4_0x33712f[_0x28695b(0x1e8)](_0x28695b(0x20e)+_0x5108a9[_0x28695b(0x1e5)]+'\x22:\x20'+_0x5108a9[_0x28695b(0x216)]));}return 0x1;}console[_0x28695b(0x241)]();const _0x106719=getLLMProjectUrl(_0x4ef885,_0x19e1ee[_0x28695b(0x259)]);return console[_0x28695b(0x241)](_0x28695b(0x26c)+a4_0x33712f[_0x28695b(0x28f)](_0x106719)),0x0;}}export class AgentPushCommand extends BaseCommand{['name']=a4_0x1c6899(0x200);[a4_0x1c6899(0x26f)]=a4_0x1c6899(0x218);async['execute'](_0x1774fc){const _0x5dc35c=a4_0x1c6899,{options:_0x39d2ad,args:_0x157547,tdx:_0x1dedfc}=_0x1774fc;let _0x45905e=_0x157547[0x0]||process['cwd']();const _0x157487=_0x39d2ad[_0x5dc35c(0x20f)],_0x1ab134=_0x39d2ad[_0x5dc35c(0x28c)],_0x2ce656=_0x39d2ad[_0x5dc35c(0x267)],_0x51bd3f=_0x39d2ad[_0x5dc35c(0x1d8)],_0x520d52=a4_0x21a3c8['join'](_0x45905e,_0x5dc35c(0x292)),_0x49b7f4=existsSync(_0x520d52);if(_0x49b7f4){const {data:_0x27a1a1}=await withSpinner(_0x5dc35c(0x21e)+_0x45905e+_0x5dc35c(0x26e),()=>_0x1dedfc[_0x5dc35c(0x263)][_0x5dc35c(0x1dd)](_0x45905e,{'dryRun':_0x157487,'force':_0x1ab134}));if(_0x157487)return console[_0x5dc35c(0x241)](a4_0x33712f[_0x5dc35c(0x24d)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x5dc35c(0x241)](_0x5dc35c(0x261)+_0x27a1a1[_0x5dc35c(0x256)]),0x0;if(_0x27a1a1[_0x5dc35c(0x25c)]===_0x5dc35c(0x216))return console[_0x5dc35c(0x241)](a4_0x33712f[_0x5dc35c(0x1e8)]('Failed\x20to\x20push\x20agent:\x20'+_0x27a1a1[_0x5dc35c(0x216)])),0x1;console['log'](a4_0x33712f['green']('Agent\x20'+_0x27a1a1[_0x5dc35c(0x25c)]+_0x5dc35c(0x1e3))),console[_0x5dc35c(0x241)](_0x5dc35c(0x250)+_0x27a1a1['agentName']);if(_0x27a1a1[_0x5dc35c(0x1f5)]&&_0x27a1a1['projectId']){const _0x4ae801=getLLMAgentChatUrl(_0x51bd3f,_0x27a1a1[_0x5dc35c(0x1f9)],_0x27a1a1['agentId']);console[_0x5dc35c(0x241)](_0x5dc35c(0x228)+a4_0x33712f[_0x5dc35c(0x28f)](_0x4ae801));}return 0x0;}const _0xd4a3b=_0x39d2ad[_0x5dc35c(0x27c)],_0x2f6cf3=resolveProjectFromContext(_0x45905e,_0xd4a3b);if(_0x2f6cf3[_0x5dc35c(0x291)])_0x45905e=_0x2f6cf3[_0x5dc35c(0x1d0)],_0x2f6cf3[_0x5dc35c(0x234)]===_0x5dc35c(0x238)&&console[_0x5dc35c(0x241)](a4_0x33712f[_0x5dc35c(0x24b)](_0x5dc35c(0x287)+_0x45905e));else{let _0x3cf1d6='Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.';_0x2f6cf3['reason']===_0x5dc35c(0x266)&&(_0x3cf1d6=_0x2f6cf3[_0x5dc35c(0x28b)]+_0x5dc35c(0x1f4)+_0x2f6cf3['llmProject']+_0x5dc35c(0x23f));throw new SDKError(ErrorCode[_0x5dc35c(0x1da)],_0x2f6cf3[_0x5dc35c(0x204)]==='no_context'?_0x2f6cf3[_0x5dc35c(0x28b)]:_0x5dc35c(0x23c)+_0x45905e,undefined,{'helpText':_0x3cf1d6});}const {data:_0x2c8e94}=await withSpinner(_0x5dc35c(0x226),()=>_0x1dedfc['llm']['pushProject'](_0x45905e,{'dryRun':!![]})),_0x28f814=_0x2c8e94['counts'][_0x5dc35c(0x22a)][_0x5dc35c(0x217)]>0x0;if(_0x28f814){console['log'](a4_0x33712f[_0x5dc35c(0x1e8)](_0x5dc35c(0x1ff)));for(const _0x34ac47 of _0x2c8e94[_0x5dc35c(0x22a)]){_0x34ac47[_0x5dc35c(0x25c)]===_0x5dc35c(0x216)&&console[_0x5dc35c(0x241)](a4_0x33712f[_0x5dc35c(0x1e8)]('\x20\x20Agent\x20\x22'+_0x34ac47[_0x5dc35c(0x256)]+_0x5dc35c(0x22d)+_0x34ac47[_0x5dc35c(0x216)]));}return 0x1;}const _0x48529f=_0x2c8e94[_0x5dc35c(0x1e1)]['agents'][_0x5dc35c(0x28a)]+_0x2c8e94[_0x5dc35c(0x1e1)][_0x5dc35c(0x280)][_0x5dc35c(0x28a)]+_0x2c8e94[_0x5dc35c(0x1e1)][_0x5dc35c(0x27f)][_0x5dc35c(0x28a)]+_0x2c8e94[_0x5dc35c(0x1e1)][_0x5dc35c(0x248)][_0x5dc35c(0x28a)]+_0x2c8e94[_0x5dc35c(0x1e1)][_0x5dc35c(0x279)][_0x5dc35c(0x28a)]+_0x2c8e94[_0x5dc35c(0x1e1)][_0x5dc35c(0x221)]['created']+_0x2c8e94[_0x5dc35c(0x1e1)][_0x5dc35c(0x233)]['created']+_0x2c8e94['counts'][_0x5dc35c(0x212)][_0x5dc35c(0x28a)]+_0x2c8e94[_0x5dc35c(0x1e1)][_0x5dc35c(0x1e9)][_0x5dc35c(0x28a)],_0x509403=_0x2c8e94[_0x5dc35c(0x1e1)][_0x5dc35c(0x22a)]['updated']+_0x2c8e94[_0x5dc35c(0x1e1)]['knowledgeBases'][_0x5dc35c(0x203)]+_0x2c8e94['counts'][_0x5dc35c(0x27f)][_0x5dc35c(0x203)]+_0x2c8e94[_0x5dc35c(0x1e1)][_0x5dc35c(0x248)][_0x5dc35c(0x203)]+_0x2c8e94[_0x5dc35c(0x1e1)][_0x5dc35c(0x279)][_0x5dc35c(0x203)]+_0x2c8e94[_0x5dc35c(0x1e1)][_0x5dc35c(0x221)]['updated']+_0x2c8e94['counts']['experimentalArtifacts'][_0x5dc35c(0x203)]+_0x2c8e94['counts']['formInterfaces'][_0x5dc35c(0x203)]+_0x2c8e94[_0x5dc35c(0x1e1)][_0x5dc35c(0x1e9)][_0x5dc35c(0x203)],_0xa73c42=_0x2c8e94[_0x5dc35c(0x1e1)][_0x5dc35c(0x22a)][_0x5dc35c(0x1e7)]+_0x2c8e94[_0x5dc35c(0x1e1)]['knowledgeBases'][_0x5dc35c(0x1e7)]+_0x2c8e94[_0x5dc35c(0x1e1)][_0x5dc35c(0x27f)][_0x5dc35c(0x1e7)]+_0x2c8e94[_0x5dc35c(0x1e1)]['prompts'][_0x5dc35c(0x1e7)]+_0x2c8e94['counts'][_0x5dc35c(0x279)]['unchanged']+_0x2c8e94[_0x5dc35c(0x1e1)][_0x5dc35c(0x221)][_0x5dc35c(0x1e7)]+_0x2c8e94[_0x5dc35c(0x1e1)][_0x5dc35c(0x233)][_0x5dc35c(0x1e7)]+_0x2c8e94[_0x5dc35c(0x1e1)][_0x5dc35c(0x212)][_0x5dc35c(0x1e7)]+_0x2c8e94[_0x5dc35c(0x1e1)][_0x5dc35c(0x1e9)][_0x5dc35c(0x1e7)];console['log'](_0x5dc35c(0x243)+_0x2c8e94['projectName']+'\x27:'),console['log']('\x20\x20'+a4_0x33712f['green']('+\x20'+_0x48529f+_0x5dc35c(0x22b))+_0x5dc35c(0x230)+a4_0x33712f[_0x5dc35c(0x24d)]('~\x20'+_0x509403+_0x5dc35c(0x229))+_0x5dc35c(0x230)+a4_0x33712f[_0x5dc35c(0x24b)]('=\x20'+_0xa73c42+_0x5dc35c(0x247))),console[_0x5dc35c(0x241)](_0x5dc35c(0x262)+formatCountSummary(_0x2c8e94[_0x5dc35c(0x1e1)]['agents'])),console['log']('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x2c8e94[_0x5dc35c(0x1e1)][_0x5dc35c(0x280)])),console[_0x5dc35c(0x241)](_0x5dc35c(0x275)+formatCountSummary(_0x2c8e94[_0x5dc35c(0x1e1)][_0x5dc35c(0x27f)])),console[_0x5dc35c(0x241)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x2c8e94[_0x5dc35c(0x1e1)][_0x5dc35c(0x248)])),console['log'](_0x5dc35c(0x25f)+formatCountSummary(_0x2c8e94[_0x5dc35c(0x1e1)][_0x5dc35c(0x279)])),console[_0x5dc35c(0x241)](_0x5dc35c(0x208)+formatCountSummary(_0x2c8e94['counts'][_0x5dc35c(0x212)])),console[_0x5dc35c(0x241)]('\x20\x20Chat\x20Interfaces:\x20'+formatCountSummary(_0x2c8e94['counts']['chatInterfaces']));const _0x5a3a33=_0x2c8e94[_0x5dc35c(0x1e1)][_0x5dc35c(0x221)][_0x5dc35c(0x28a)]>0x0||_0x2c8e94[_0x5dc35c(0x1e1)][_0x5dc35c(0x221)][_0x5dc35c(0x203)]>0x0||_0x2c8e94[_0x5dc35c(0x1e1)][_0x5dc35c(0x221)][_0x5dc35c(0x1e7)]>0x0||_0x2c8e94[_0x5dc35c(0x1e1)][_0x5dc35c(0x233)][_0x5dc35c(0x28a)]>0x0||_0x2c8e94[_0x5dc35c(0x1e1)][_0x5dc35c(0x233)][_0x5dc35c(0x203)]>0x0||_0x2c8e94[_0x5dc35c(0x1e1)]['experimentalArtifacts']['unchanged']>0x0;_0x5a3a33&&(console['log']('\x20\x20Experimental\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0x2c8e94[_0x5dc35c(0x1e1)]['experimentalKnowledgeBases'])),console['log']('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x2c8e94[_0x5dc35c(0x1e1)][_0x5dc35c(0x233)])));console[_0x5dc35c(0x241)]('\x20\x20Source:\x20'+a4_0x33712f['cyan'](_0x45905e)),displayDiffs(_0x2c8e94[_0x5dc35c(0x22a)],_0x2c8e94['knowledgeBases'],_0x2c8e94['textKnowledgeBases'],_0x2c8e94[_0x5dc35c(0x248)],_0x2c8e94[_0x5dc35c(0x279)],_0x2c8e94[_0x5dc35c(0x221)],_0x2c8e94['experimentalArtifacts'],_0x2c8e94['formInterfaces'],_0x2c8e94['chatInterfaces']);if(_0x157487)return console['log'](a4_0x33712f[_0x5dc35c(0x24d)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x48529f===0x0&&_0x509403===0x0){console[_0x5dc35c(0x241)](a4_0x33712f[_0x5dc35c(0x23b)](_0x5dc35c(0x1fe)));const _0x37c711=getLLMProjectUrl(_0x51bd3f,_0x2c8e94[_0x5dc35c(0x1f9)]);return console[_0x5dc35c(0x241)](_0x5dc35c(0x26c)+a4_0x33712f[_0x5dc35c(0x28f)](_0x37c711)),0x0;}if(!_0x2ce656&&!_0x1ab134){if(!isInteractive())return console['error'](a4_0x33712f['red'](_0x5dc35c(0x281)),_0x5dc35c(0x1f3)),console[_0x5dc35c(0x216)](a4_0x33712f[_0x5dc35c(0x24b)](_0x5dc35c(0x1ef))),0x1;const _0x17a1c7=await confirmKey(_0x5dc35c(0x1d6)+(_0x48529f+_0x509403)+_0x5dc35c(0x202));if(!_0x17a1c7)return console[_0x5dc35c(0x241)](a4_0x33712f[_0x5dc35c(0x24d)](_0x5dc35c(0x21b)),_0x5dc35c(0x20c)),0x1;}const {data:_0x370b1a}=await withSpinner(_0x5dc35c(0x23e),()=>_0x1dedfc[_0x5dc35c(0x263)][_0x5dc35c(0x269)](_0x45905e,{'force':_0x1ab134})),_0x327d36=_0x370b1a[_0x5dc35c(0x1e1)][_0x5dc35c(0x22a)][_0x5dc35c(0x217)]>0x0||_0x370b1a[_0x5dc35c(0x1e1)][_0x5dc35c(0x280)][_0x5dc35c(0x217)]>0x0||_0x370b1a[_0x5dc35c(0x1e1)][_0x5dc35c(0x27f)][_0x5dc35c(0x217)]>0x0||_0x370b1a['counts'][_0x5dc35c(0x248)]['errors']>0x0||_0x370b1a[_0x5dc35c(0x1e1)][_0x5dc35c(0x212)]['errors']>0x0||_0x370b1a[_0x5dc35c(0x1e1)][_0x5dc35c(0x1e9)][_0x5dc35c(0x217)]>0x0;if(_0x327d36){console[_0x5dc35c(0x241)](a4_0x33712f['yellow']('\x0aProject\x20pushed\x20with\x20errors')),console[_0x5dc35c(0x241)](),console['log'](a4_0x33712f[_0x5dc35c(0x1e8)]('Errors:'));for(const _0xc9b765 of _0x370b1a[_0x5dc35c(0x22a)]){_0xc9b765['action']===_0x5dc35c(0x216)&&console[_0x5dc35c(0x241)](a4_0x33712f[_0x5dc35c(0x1e8)](_0x5dc35c(0x20b)+_0xc9b765['agentName']+_0x5dc35c(0x22d)+_0xc9b765[_0x5dc35c(0x216)]));}for(const _0xdad9a1 of _0x370b1a[_0x5dc35c(0x280)]){_0xdad9a1[_0x5dc35c(0x25c)]==='error'&&console[_0x5dc35c(0x241)](a4_0x33712f[_0x5dc35c(0x1e8)](_0x5dc35c(0x25d)+_0xdad9a1['name']+_0x5dc35c(0x22d)+_0xdad9a1['error']));}for(const _0x4cdb34 of _0x370b1a[_0x5dc35c(0x27f)]){_0x4cdb34[_0x5dc35c(0x25c)]==='error'&&console[_0x5dc35c(0x241)](a4_0x33712f[_0x5dc35c(0x1e8)](_0x5dc35c(0x277)+_0x4cdb34[_0x5dc35c(0x1e5)]+_0x5dc35c(0x22d)+_0x4cdb34[_0x5dc35c(0x216)]));}for(const _0x1c1a04 of _0x370b1a[_0x5dc35c(0x248)]){_0x1c1a04[_0x5dc35c(0x25c)]===_0x5dc35c(0x216)&&console[_0x5dc35c(0x241)](a4_0x33712f[_0x5dc35c(0x1e8)](_0x5dc35c(0x1f2)+_0x1c1a04[_0x5dc35c(0x1e5)]+_0x5dc35c(0x22d)+_0x1c1a04[_0x5dc35c(0x216)]));}for(const _0x12a630 of _0x370b1a['integrations']){_0x12a630['action']==='error'&&console[_0x5dc35c(0x241)](a4_0x33712f[_0x5dc35c(0x1e8)](_0x5dc35c(0x28d)+_0x12a630[_0x5dc35c(0x1e5)]+'\x22:\x20'+_0x12a630[_0x5dc35c(0x216)]));}for(const _0x216334 of _0x370b1a[_0x5dc35c(0x212)]){_0x216334[_0x5dc35c(0x25c)]==='error'&&console[_0x5dc35c(0x241)](a4_0x33712f['red'](_0x5dc35c(0x1df)+_0x216334[_0x5dc35c(0x1e5)]+_0x5dc35c(0x22d)+_0x216334[_0x5dc35c(0x216)]));}for(const _0x50bdbc of _0x370b1a[_0x5dc35c(0x1e9)]){_0x50bdbc[_0x5dc35c(0x25c)]===_0x5dc35c(0x216)&&console[_0x5dc35c(0x241)](a4_0x33712f[_0x5dc35c(0x1e8)]('\x20\x20Chat\x20Interface\x20\x22'+_0x50bdbc[_0x5dc35c(0x1e5)]+'\x22:\x20'+_0x50bdbc[_0x5dc35c(0x216)]));}return 0x1;}console[_0x5dc35c(0x241)](a4_0x33712f[_0x5dc35c(0x23b)](_0x5dc35c(0x1ea)+(_0x48529f+_0x509403)+_0x5dc35c(0x1db)+_0x370b1a[_0x5dc35c(0x1d5)]+'\x27'));const _0x194b4c=getLLMProjectUrl(_0x51bd3f,_0x370b1a['projectId']);return console[_0x5dc35c(0x241)]('Project:\x20'+a4_0x33712f[_0x5dc35c(0x28f)](_0x194b4c)),0x0;}}
|
|
1
|
+
const a4_0x548581=a4_0x39d3;(function(_0x3de63c,_0x1878c3){const _0xab7ab7=a4_0x39d3,_0x405e3a=_0x3de63c();while(!![]){try{const _0x480692=parseInt(_0xab7ab7(0x217))/0x1+-parseInt(_0xab7ab7(0x18c))/0x2+parseInt(_0xab7ab7(0x171))/0x3+parseInt(_0xab7ab7(0x1fb))/0x4+-parseInt(_0xab7ab7(0x1b3))/0x5*(parseInt(_0xab7ab7(0x1e1))/0x6)+parseInt(_0xab7ab7(0x193))/0x7+-parseInt(_0xab7ab7(0x205))/0x8*(-parseInt(_0xab7ab7(0x1a8))/0x9);if(_0x480692===_0x1878c3)break;else _0x405e3a['push'](_0x405e3a['shift']());}catch(_0x3df993){_0x405e3a['push'](_0x405e3a['shift']());}}}(a4_0x335b,0xa86c5));function a4_0x335b(){const _0x3a4e17=['action','Cancelled','Writing\x20files...','message','Cloning\x20\x22','Using\x20local\x20project:\x20','\x0a✔\x20All\x20resources\x20are\x20up\x20to\x20date','\x0aError:','2106255mREbsO','counts','tdx.json','\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','\x0aPush\x20summary\x20for\x20\x27','\x20\x20Integrations:\x20','\x0aChanges\x20to\x20chat\x20interface\x20\x27','\x20resources?','red','\x0aWrite\x20','agent:clone','agent:pull','sourceProjectName','\x20|\x20','Would\x20push\x20agent:\x20','Would\x20pull\x20agent:\x20','profile','\x20\x20Form\x20Interfaces:\x20','\x0a✔\x20Pushed\x20','MISSING_ARGUMENT','textKnowledgeBases','dim','description','errors','unchanged','Analyzing\x20project\x20\x22','dryRun','692132aLyYXa','no_context','site','\x20\x20Experimental\x20Knowledge\x20Base\x20\x22','\x20new','The\x20--agent\x20flag\x20requires\x20llm_project\x20context\x20or\x20a\x20project\x20argument.\x0a','\x20\x20Prompts:\x20','1062516tHQiMW','\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','integrations','\x0aPush\x20','new','\x20\x20Knowledge\x20Bases:\x20','log','cyan','yes','execute','\x20\x20Experimental\x20Knowledge\x20Bases:\x20','projectName','No\x20tdx.json\x20found\x20in\x20','llmProject','diff','updated','outputDir','repeat','New\x20project\x20ID:\x20','context','\x20--profile\x20','370485BZJCOb','source','agentName','INVALID_ARGUMENT','\x20total','✔\x20Context\x20set:\x20','\x0aPull\x20summary\x20for\x20\x27','\x0aProject\x20pushed\x20with\x20errors','\x20\x20Chat\x20Interfaces:\x20','arg-dir','\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','5mRNTNf','utf-8','newProjectName','llm_project','Using\x20project\x20from\x20','Using\x20current\x20project:\x20','agentId','Usage:\x20tdx\x20agent\x20clone\x20[source]\x20--name\x20<new-name>','\x22:\x20','\x20files\x20to\x20','created','\x20\x20Text\x20Knowledge\x20Base\x20\x22','reason','knowledgeBases','experimentalArtifacts','Agent:\x20','\x20\x20Chat\x20Interface\x20\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20agents\x20from\x20project','\x20\x20Agent\x20\x22','Dry\x20run\x20-\x20no\x20changes\x20made','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20resources\x20to\x20\x27','Using\x20project\x20from\x20context:\x20','Errors:','\x20unchanged','No\x20source\x20project\x20specified.\x20Use\x20one\x20of:\x0a','output','parse','pullAgent','cwd-config','Agent\x20pulled\x20successfully','First\x20pull\x20the\x20project\x20locally,\x20then\x20clone\x20from\x20the\x20local\x20files:\x0a','push','\x0aChanges\x20to\x20experimental\x20artifact\x20\x27','Using\x20project:\x20','\x0aSet\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','total','yellow','gray','\x20\x20tdx\x20agent\x20pull\x20','chatInterfaces','\x22\x20to\x20a\x20different\x20profile','Push\x20local\x20agent\x20files\x20to\x20LLM\x20project','Project:\x20','newProjectId','llm','4984020cgUDXP','\x20\x20Source:\x20','Pull\x20agents\x20from\x20LLM\x20project\x20to\x20local\x20files','\x27\x20to\x20create\x20the\x20folder\x20structure.','green','\x20\x20tdx\x20agent\x20clone\x20--name\x20<new-name>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clone\x20from\x20context\x20(llm_project)','\x20\x20Target:\x20','Using\x20context\x20project:\x20','Pushing\x20agent\x20from\x20\x22','\x20\x20Experimental\x20Artifact\x20\x22','\x0a✔\x20Pulled\x20','Project\x20cloned\x20successfully','\x20\x20Form\x20Interface\x20\x22','outputPath','When\x20using\x20--profile,\x20you\x20must\x20specify\x20a\x20local\x20directory\x20as\x20source.\x0a','error','-\x20nothing\x20pushed','pushProject','experimentalKnowledgeBases','pushAgent','\x20=\x20','prompts','Would\x20clone:','\x20\x20Experimental\x20Artifacts:\x20','join','\x0aChanges\x20to\x20knowledge\x20base\x20\x27','291188QrtWEp','no_local_folder','\x22...','\x0aChanges\x20to\x20agent\x20\x27','Run\x20\x27tdx\x20agent\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure,\x20or\x20specify\x20an\x20agent\x20directory\x20with\x20agent.yml.','\x0a✔\x20All\x20files\x20are\x20up\x20to\x20date','\x20\x20Text\x20Knowledge\x20Bases:\x20','Clone\x20\x22','hasChanges','force','8MGDSWF','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','dirname','session','\x20\x20Knowledge\x20Base\x20\x22','agent','Pushing\x20to\x20project...','cloneProject','Dry\x20run\x20-\x20no\x20files\x20written','\x20\x20Prompt\x20\x22','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','name','formInterfaces','Failed\x20to\x20push\x20agent:\x20','Summary:','cwd','\x0aErrors\x20found:','New\x20project:\x20','898762ZLsuTR','pullProject','Clone\x20an\x20LLM\x20project\x20to\x20a\x20new\x20project','New\x20project\x20name\x20is\x20required','\x22\x20to\x20\x22','\x0aChanges\x20to\x20prompt\x20\x27','projectId','Pulling\x20agent\x20\x22','\x20changed','Agent\x20','agents','Cannot\x20clone\x20from\x20context\x20project\x20\x22','\x20\x20Agents:\x20','isNew','-\x20no\x20files\x20written'];a4_0x335b=function(){return _0x3a4e17;};return a4_0x335b();}import a4_0x2eb76c from'chalk';import a4_0x2853a9 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';function a4_0x39d3(_0x4c1708,_0x4d069d){_0x4c1708=_0x4c1708-0x15e;const _0x335b89=a4_0x335b();let _0x39d3f6=_0x335b89[_0x4c1708];return _0x39d3f6;}import{sanitizeForFilesystem,normalizeName}from'../sdk/agent/agent-yaml.js';import{getLLMProjectUrl,getLLMAgentChatUrl}from'../sdk/client/endpoints.js';function formatCountSummary(_0x5486f4){const _0x8b1c9e=a4_0x39d3,_0x182a3d=[];if(_0x5486f4[_0x8b1c9e(0x1d7)]!==undefined)_0x182a3d['push'](_0x5486f4[_0x8b1c9e(0x1d7)]+_0x8b1c9e(0x1ac));if(_0x5486f4[_0x8b1c9e(0x197)]!==undefined&&_0x5486f4['new']>0x0)_0x182a3d[_0x8b1c9e(0x1d3)](a4_0x2eb76c[_0x8b1c9e(0x1e5)](_0x5486f4['new']+_0x8b1c9e(0x190)));if(_0x5486f4[_0x8b1c9e(0x1bd)]!==undefined&&_0x5486f4[_0x8b1c9e(0x1bd)]>0x0)_0x182a3d[_0x8b1c9e(0x1d3)](a4_0x2eb76c[_0x8b1c9e(0x1e5)](_0x5486f4[_0x8b1c9e(0x1bd)]+'\x20created'));if(_0x5486f4[_0x8b1c9e(0x1a2)]!==undefined&&_0x5486f4[_0x8b1c9e(0x1a2)]>0x0)_0x182a3d[_0x8b1c9e(0x1d3)](a4_0x2eb76c['yellow'](_0x5486f4['updated']+'\x20updated'));if(_0x5486f4[_0x8b1c9e(0x189)]!==undefined&&_0x5486f4[_0x8b1c9e(0x189)]>0x0)_0x182a3d['push'](a4_0x2eb76c[_0x8b1c9e(0x1d9)](_0x5486f4[_0x8b1c9e(0x189)]+_0x8b1c9e(0x1cb)));if(_0x5486f4[_0x8b1c9e(0x188)]!==undefined&&_0x5486f4['errors']>0x0)_0x182a3d[_0x8b1c9e(0x1d3)](a4_0x2eb76c['red'](_0x5486f4[_0x8b1c9e(0x188)]+'\x20errors'));return _0x182a3d[_0x8b1c9e(0x1f9)](',\x20');}function displayDiffs(_0x305aa0,_0x51f90d,_0x3ad12d,_0x39258b,_0x4016db,_0x51a477,_0x10661b,_0x4aa83c,_0x36b92d){const _0xb9600b=a4_0x39d3;for(const _0x2edcf5 of _0x305aa0){if(_0x2edcf5[_0xb9600b(0x1a1)]){const _0x306d26=_0x2edcf5[_0xb9600b(0x1aa)]||_0x2edcf5[_0xb9600b(0x210)];console['log'](_0xb9600b(0x1fe)+_0x306d26+'\x27:'),console[_0xb9600b(0x199)]('─'['repeat'](0x3c)),console[_0xb9600b(0x199)](_0x2edcf5[_0xb9600b(0x1a1)]),console[_0xb9600b(0x199)]('─'['repeat'](0x3c));}}for(const _0x1fba5f of _0x51f90d){_0x1fba5f['diff']&&(console[_0xb9600b(0x199)](_0xb9600b(0x1fa)+_0x1fba5f[_0xb9600b(0x210)]+'\x27:'),console['log']('─'[_0xb9600b(0x1a4)](0x3c)),console[_0xb9600b(0x199)](_0x1fba5f[_0xb9600b(0x1a1)]),console[_0xb9600b(0x199)]('─'[_0xb9600b(0x1a4)](0x3c)));}for(const _0x37d92c of _0x3ad12d){_0x37d92c[_0xb9600b(0x1a1)]&&(console[_0xb9600b(0x199)]('\x0aChanges\x20to\x20text\x20knowledge\x20base\x20\x27'+_0x37d92c[_0xb9600b(0x210)]+'\x27:'),console['log']('─'[_0xb9600b(0x1a4)](0x3c)),console[_0xb9600b(0x199)](_0x37d92c[_0xb9600b(0x1a1)]),console[_0xb9600b(0x199)]('─'[_0xb9600b(0x1a4)](0x3c)));}for(const _0x4b700a of _0x39258b){_0x4b700a[_0xb9600b(0x1a1)]&&(console[_0xb9600b(0x199)](_0xb9600b(0x15f)+_0x4b700a[_0xb9600b(0x210)]+'\x27:'),console[_0xb9600b(0x199)]('─'['repeat'](0x3c)),console[_0xb9600b(0x199)](_0x4b700a[_0xb9600b(0x1a1)]),console[_0xb9600b(0x199)]('─'[_0xb9600b(0x1a4)](0x3c)));}for(const _0x29d1b7 of _0x4016db){_0x29d1b7['diff']&&(console[_0xb9600b(0x199)]('\x0aChanges\x20to\x20integration\x20\x27'+_0x29d1b7[_0xb9600b(0x210)]+'\x27:'),console[_0xb9600b(0x199)]('─'[_0xb9600b(0x1a4)](0x3c)),console[_0xb9600b(0x199)](_0x29d1b7[_0xb9600b(0x1a1)]),console[_0xb9600b(0x199)]('─'[_0xb9600b(0x1a4)](0x3c)));}for(const _0x1a7a03 of _0x51a477){_0x1a7a03[_0xb9600b(0x1a1)]&&(console[_0xb9600b(0x199)]('\x0aChanges\x20to\x20experimental\x20knowledge\x20base\x20\x27'+_0x1a7a03[_0xb9600b(0x210)]+'\x27:'),console[_0xb9600b(0x199)]('─'[_0xb9600b(0x1a4)](0x3c)),console[_0xb9600b(0x199)](_0x1a7a03[_0xb9600b(0x1a1)]),console[_0xb9600b(0x199)]('─'[_0xb9600b(0x1a4)](0x3c)));}for(const _0x2d0b9f of _0x10661b){_0x2d0b9f['diff']&&(console['log'](_0xb9600b(0x1d4)+_0x2d0b9f[_0xb9600b(0x210)]+'\x27:'),console[_0xb9600b(0x199)]('─'[_0xb9600b(0x1a4)](0x3c)),console[_0xb9600b(0x199)](_0x2d0b9f[_0xb9600b(0x1a1)]),console['log']('─'[_0xb9600b(0x1a4)](0x3c)));}for(const _0x4d293a of _0x4aa83c){_0x4d293a[_0xb9600b(0x1a1)]&&(console[_0xb9600b(0x199)]('\x0aChanges\x20to\x20form\x20interface\x20\x27'+_0x4d293a[_0xb9600b(0x210)]+'\x27:'),console[_0xb9600b(0x199)]('─'[_0xb9600b(0x1a4)](0x3c)),console[_0xb9600b(0x199)](_0x4d293a[_0xb9600b(0x1a1)]),console[_0xb9600b(0x199)]('─'[_0xb9600b(0x1a4)](0x3c)));}for(const _0x3cc575 of _0x36b92d){_0x3cc575['diff']&&(console[_0xb9600b(0x199)](_0xb9600b(0x177)+_0x3cc575[_0xb9600b(0x210)]+'\x27:'),console[_0xb9600b(0x199)]('─'[_0xb9600b(0x1a4)](0x3c)),console[_0xb9600b(0x199)](_0x3cc575['diff']),console[_0xb9600b(0x199)]('─'[_0xb9600b(0x1a4)](0x3c)));}}export class AgentPullCommand extends BaseCommand{[a4_0x548581(0x210)]=a4_0x548581(0x17c);[a4_0x548581(0x187)]=a4_0x548581(0x1e3);async[a4_0x548581(0x19c)](_0x3bd507){const _0x4db717=a4_0x548581,{options:_0x404418,args:_0x419587,tdx:_0x1bf585}=_0x3bd507,_0x33b6b5=_0x419587[0x0],_0x35d6e3=_0x419587[0x1],_0x497872=_0x404418[_0x4db717(0x1cd)],_0x4a0e8e=_0x404418[_0x4db717(0x18b)],_0x443b81=_0x404418[_0x4db717(0x204)],_0x16aba6=_0x404418[_0x4db717(0x19b)],_0x4c2628=_0x404418[_0x4db717(0x1a0)],_0x33ca8c=_0x404418[_0x4db717(0x20a)];let _0x4eb937;if(_0x33b6b5){const _0x4e5cd7=a4_0x2853a9[_0x4db717(0x1f9)](_0x33b6b5,_0x4db717(0x173));if(existsSync(_0x4e5cd7))try{const _0x54b777=JSON[_0x4db717(0x1ce)](readFileSync(_0x4e5cd7,_0x4db717(0x1b4)));_0x54b777[_0x4db717(0x1b6)]&&(_0x4eb937={'llm_project':_0x54b777[_0x4db717(0x1b6)]});}catch{}}const _0x1956ce=findAgentConfigPath(process[_0x4db717(0x214)]());let _0x314c22;if(_0x1956ce)try{const _0xdf7128=JSON[_0x4db717(0x1ce)](readFileSync(_0x1956ce,_0x4db717(0x1b4)));_0xdf7128['llm_project']&&(_0x314c22={'llm_project':_0xdf7128[_0x4db717(0x1b6)]});}catch{}const _0x3eea46=resolveAgentPullArgs({'arg':_0x33b6b5,'agentNameArg':_0x35d6e3,'agentFlag':_0x33ca8c,'contextProject':_0x4c2628,'argDirConfig':_0x4eb937,'cwdConfigPath':_0x1956ce||undefined,'cwdConfig':_0x314c22}),{projectNameOrId:_0xd0ba54,targetAgentName:_0x360369,existingOutputDir:_0x2f3860,source:_0x1df413}=_0x3eea46;if(_0x1df413===_0x4db717(0x1b1))console[_0x4db717(0x199)](a4_0x2eb76c['dim'](_0x4db717(0x1b7)+a4_0x2853a9[_0x4db717(0x1f9)](_0x33b6b5,_0x4db717(0x173))+':\x20'+_0xd0ba54));else{if(_0x1df413===_0x4db717(0x1d0))console[_0x4db717(0x199)](a4_0x2eb76c[_0x4db717(0x186)](_0x4db717(0x1d5)+_0xd0ba54));else _0x1df413==='context'&&console[_0x4db717(0x199)](a4_0x2eb76c[_0x4db717(0x186)](_0x4db717(0x1c9)+_0xd0ba54));}if(!_0xd0ba54)return _0x33ca8c?(console[_0x4db717(0x199)](a4_0x2eb76c[_0x4db717(0x1d8)](_0x4db717(0x191))),console[_0x4db717(0x199)]('Set\x20context:\x20\x20tdx\x20use\x20llm_project\x20<name>'),console['log']('Or\x20specify:\x20\x20\x20tdx\x20agent\x20pull\x20<project>\x20--agent\x20<name>')):(console[_0x4db717(0x199)](a4_0x2eb76c[_0x4db717(0x1d8)]('llm_project\x20is\x20not\x20set.\x20Use\x20`tdx\x20use\x20llm_project\x20<name>`\x20to\x20set\x20it.\x0a')),console['log']('Usage:\x20tdx\x20agent\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20project\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x4db717(0x199)](_0x4db717(0x1c4)),console[_0x4db717(0x199)](_0x4db717(0x174)),console[_0x4db717(0x199)](_0x4db717(0x1b2)),console[_0x4db717(0x199)](_0x4db717(0x194))),0x1;if(_0x360369){const {data:_0x43bdab}=await withSpinner(_0x4db717(0x161)+_0x360369+'\x22\x20from\x20project\x20\x22'+_0xd0ba54+_0x4db717(0x1fd),()=>_0x1bf585[_0x4db717(0x1e0)][_0x4db717(0x1cf)](_0xd0ba54,_0x360369,_0x497872,{'dryRun':_0x4a0e8e,'force':_0x443b81}));if(_0x4a0e8e)return console[_0x4db717(0x199)](a4_0x2eb76c[_0x4db717(0x1d8)](_0x4db717(0x20d))),console[_0x4db717(0x199)](_0x4db717(0x180)+_0x43bdab['agentName']),console[_0x4db717(0x199)]('Output\x20path:\x20'+_0x43bdab[_0x4db717(0x1ee)]),_0x43bdab['diff']&&(console[_0x4db717(0x199)]('\x0aChanges:'),console[_0x4db717(0x199)]('─'[_0x4db717(0x1a4)](0x3c)),console[_0x4db717(0x199)](_0x43bdab[_0x4db717(0x1a1)]),console['log']('─'[_0x4db717(0x1a4)](0x3c))),0x0;return console[_0x4db717(0x199)](a4_0x2eb76c[_0x4db717(0x1e5)](_0x4db717(0x1d1))),console[_0x4db717(0x199)](_0x4db717(0x1c2)+_0x43bdab[_0x4db717(0x1aa)]),console[_0x4db717(0x199)]('Output:\x20'+_0x43bdab[_0x4db717(0x1ee)]),console['log']('Status:\x20'+(_0x43bdab[_0x4db717(0x167)]?a4_0x2eb76c['green'](_0x4db717(0x197)):_0x43bdab[_0x4db717(0x203)]?a4_0x2eb76c['yellow'](_0x4db717(0x1a2)):a4_0x2eb76c[_0x4db717(0x1d9)](_0x4db717(0x189)))),0x0;}const _0xb07bbb=_0x2f3860||_0x497872,{data:_0x43af13}=await withSpinner(_0x4db717(0x18a)+_0xd0ba54+_0x4db717(0x1fd),()=>_0x1bf585[_0x4db717(0x1e0)][_0x4db717(0x218)](_0xd0ba54,_0xb07bbb,{'dryRun':!![]})),_0x14d10b=_0x43af13[_0x4db717(0x172)][_0x4db717(0x164)][_0x4db717(0x197)]+_0x43af13[_0x4db717(0x172)]['knowledgeBases'][_0x4db717(0x197)]+_0x43af13[_0x4db717(0x172)]['textKnowledgeBases'][_0x4db717(0x197)]+_0x43af13[_0x4db717(0x172)][_0x4db717(0x1f6)][_0x4db717(0x197)]+_0x43af13[_0x4db717(0x172)][_0x4db717(0x195)][_0x4db717(0x197)]+_0x43af13[_0x4db717(0x172)][_0x4db717(0x1f3)][_0x4db717(0x197)]+_0x43af13[_0x4db717(0x172)][_0x4db717(0x1c1)][_0x4db717(0x197)]+_0x43af13['counts']['formInterfaces']['new']+_0x43af13[_0x4db717(0x172)][_0x4db717(0x1db)][_0x4db717(0x197)],_0x7bb37d=_0x43af13['counts']['agents'][_0x4db717(0x1a2)]+_0x43af13[_0x4db717(0x172)][_0x4db717(0x1c0)][_0x4db717(0x1a2)]+_0x43af13[_0x4db717(0x172)][_0x4db717(0x185)][_0x4db717(0x1a2)]+_0x43af13[_0x4db717(0x172)][_0x4db717(0x1f6)][_0x4db717(0x1a2)]+_0x43af13[_0x4db717(0x172)][_0x4db717(0x195)][_0x4db717(0x1a2)]+_0x43af13[_0x4db717(0x172)][_0x4db717(0x1f3)][_0x4db717(0x1a2)]+_0x43af13[_0x4db717(0x172)][_0x4db717(0x1c1)][_0x4db717(0x1a2)]+_0x43af13[_0x4db717(0x172)]['formInterfaces'][_0x4db717(0x1a2)]+_0x43af13[_0x4db717(0x172)][_0x4db717(0x1db)]['updated'],_0x177e65=_0x43af13[_0x4db717(0x172)][_0x4db717(0x164)]['unchanged']+_0x43af13[_0x4db717(0x172)][_0x4db717(0x1c0)][_0x4db717(0x189)]+_0x43af13['counts'][_0x4db717(0x185)][_0x4db717(0x189)]+_0x43af13['counts'][_0x4db717(0x1f6)]['unchanged']+_0x43af13[_0x4db717(0x172)][_0x4db717(0x195)][_0x4db717(0x189)]+_0x43af13['counts'][_0x4db717(0x1f3)]['unchanged']+_0x43af13[_0x4db717(0x172)][_0x4db717(0x1c1)][_0x4db717(0x189)]+_0x43af13[_0x4db717(0x172)]['formInterfaces']['unchanged']+_0x43af13['counts'][_0x4db717(0x1db)]['unchanged'];console[_0x4db717(0x199)](_0x4db717(0x1ae)+_0x43af13[_0x4db717(0x19e)]+'\x27:'),console[_0x4db717(0x199)]('\x20\x20'+a4_0x2eb76c['green']('+\x20'+_0x14d10b+_0x4db717(0x190))+_0x4db717(0x17e)+a4_0x2eb76c['yellow']('~\x20'+_0x7bb37d+'\x20changed')+_0x4db717(0x17e)+a4_0x2eb76c[_0x4db717(0x186)]('=\x20'+_0x177e65+_0x4db717(0x1cb))),console[_0x4db717(0x199)](_0x4db717(0x166)+formatCountSummary(_0x43af13['counts'][_0x4db717(0x164)])),console[_0x4db717(0x199)](_0x4db717(0x198)+formatCountSummary(_0x43af13['counts']['knowledgeBases'])),console[_0x4db717(0x199)](_0x4db717(0x201)+formatCountSummary(_0x43af13['counts']['textKnowledgeBases'])),console[_0x4db717(0x199)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x43af13[_0x4db717(0x172)][_0x4db717(0x1f6)])),console[_0x4db717(0x199)](_0x4db717(0x176)+formatCountSummary(_0x43af13[_0x4db717(0x172)][_0x4db717(0x195)])),console[_0x4db717(0x199)](_0x4db717(0x182)+formatCountSummary(_0x43af13[_0x4db717(0x172)][_0x4db717(0x211)])),console[_0x4db717(0x199)](_0x4db717(0x1b0)+formatCountSummary(_0x43af13[_0x4db717(0x172)][_0x4db717(0x1db)]));const _0x47a832=_0x43af13[_0x4db717(0x172)][_0x4db717(0x1f3)][_0x4db717(0x1d7)]>0x0||_0x43af13[_0x4db717(0x172)][_0x4db717(0x1c1)][_0x4db717(0x1d7)]>0x0;_0x47a832&&(console[_0x4db717(0x199)](_0x4db717(0x19d)+formatCountSummary(_0x43af13[_0x4db717(0x172)][_0x4db717(0x1f3)])),console['log']('\x20\x20Experimental\x20Artifacts:\x20'+formatCountSummary(_0x43af13[_0x4db717(0x172)][_0x4db717(0x1c1)])));console[_0x4db717(0x199)](_0x4db717(0x1e7)+a4_0x2eb76c[_0x4db717(0x19a)](_0x43af13[_0x4db717(0x1a3)])),displayDiffs(_0x43af13[_0x4db717(0x164)],_0x43af13[_0x4db717(0x1c0)],_0x43af13[_0x4db717(0x185)],_0x43af13[_0x4db717(0x1f6)],_0x43af13[_0x4db717(0x195)],_0x43af13['experimentalKnowledgeBases'],_0x43af13[_0x4db717(0x1c1)],_0x43af13[_0x4db717(0x211)],_0x43af13[_0x4db717(0x1db)]);if(_0x4a0e8e)return console['log'](a4_0x2eb76c[_0x4db717(0x1d8)](_0x4db717(0x1c7))),0x0;if(_0x14d10b===0x0&&_0x7bb37d===0x0)return console[_0x4db717(0x199)](a4_0x2eb76c[_0x4db717(0x1e5)](_0x4db717(0x200))),saveSessionContext({'llm_project':_0x43af13[_0x4db717(0x19e)]},_0x404418[_0x4db717(0x208)]),console[_0x4db717(0x199)](a4_0x2eb76c[_0x4db717(0x1e5)](_0x4db717(0x1ad)+a4_0x2eb76c[_0x4db717(0x186)](_0x4db717(0x1b6))+_0x4db717(0x1f5)+a4_0x2eb76c[_0x4db717(0x19a)](_0x43af13[_0x4db717(0x19e)]))),0x0;if(!_0x16aba6&&!_0x443b81){if(!isInteractive())return console['error'](a4_0x2eb76c[_0x4db717(0x179)](_0x4db717(0x170)),_0x4db717(0x206)),console['error'](a4_0x2eb76c['dim'](_0x4db717(0x20f))),0x1;const _0x1649bd=await confirmKey(_0x4db717(0x17a)+(_0x14d10b+_0x7bb37d)+'\x20files?');if(!_0x1649bd)return console[_0x4db717(0x199)](a4_0x2eb76c[_0x4db717(0x1d8)]('Cancelled'),_0x4db717(0x168)),0x1;}const {data:_0x2ce20e}=await withSpinner(_0x4db717(0x16b),()=>_0x1bf585[_0x4db717(0x1e0)]['pullProject'](_0xd0ba54,_0xb07bbb,{'force':_0x443b81}));return console[_0x4db717(0x199)](a4_0x2eb76c['green'](_0x4db717(0x1eb)+(_0x14d10b+_0x7bb37d)+_0x4db717(0x1bc)+_0x2ce20e[_0x4db717(0x1a3)])),saveSessionContext({'llm_project':_0x2ce20e[_0x4db717(0x19e)]},_0x404418[_0x4db717(0x208)]),console['log'](a4_0x2eb76c[_0x4db717(0x1e5)]('✔\x20Context\x20set:\x20'+a4_0x2eb76c[_0x4db717(0x186)]('llm_project')+_0x4db717(0x1f5)+a4_0x2eb76c[_0x4db717(0x19a)](_0x2ce20e[_0x4db717(0x19e)]))),0x0;}}export class AgentCloneCommand extends BaseCommand{[a4_0x548581(0x210)]=a4_0x548581(0x17b);[a4_0x548581(0x187)]=a4_0x548581(0x219);async[a4_0x548581(0x19c)](_0x3907c4){const _0x14e8d9=a4_0x548581,{options:_0x477cff,args:_0xc13c6,tdx:_0x5f1b09}=_0x3907c4,_0x1f8ca7=_0xc13c6[0x0],_0x1fc857=_0x477cff[_0x14e8d9(0x210)],_0x2dceac=_0x477cff[_0x14e8d9(0x18b)],_0x22faab=_0x477cff[_0x14e8d9(0x19b)],_0x42e367=_0x477cff[_0x14e8d9(0x18e)],_0x541f89=_0x477cff[_0x14e8d9(0x1a0)];let _0x20b23b;const _0x2f3ce7=findAgentConfigPath(process[_0x14e8d9(0x214)]());if(_0x1f8ca7){const _0x434a71=a4_0x2853a9[_0x14e8d9(0x1f9)](_0x1f8ca7,_0x14e8d9(0x173));existsSync(_0x434a71)?(_0x20b23b=_0x1f8ca7,console[_0x14e8d9(0x199)](a4_0x2eb76c[_0x14e8d9(0x186)](_0x14e8d9(0x16e)+_0x1f8ca7))):_0x20b23b=_0x1f8ca7;}else{if(_0x2f3ce7)_0x20b23b=a4_0x2853a9[_0x14e8d9(0x207)](_0x2f3ce7),console[_0x14e8d9(0x199)](a4_0x2eb76c[_0x14e8d9(0x186)](_0x14e8d9(0x1b8)+_0x20b23b));else{if(_0x541f89){const _0x45423d=sanitizeForFilesystem(_0x541f89);let _0xa44c9=_0x45423d,_0x4541fa=a4_0x2853a9[_0x14e8d9(0x1f9)](process[_0x14e8d9(0x214)](),_0x14e8d9(0x164),_0x45423d,_0x14e8d9(0x173));if(!existsSync(_0x4541fa)){const _0x4fc36e=normalizeName(_0x541f89),_0x5d18d3=a4_0x2853a9[_0x14e8d9(0x1f9)](process[_0x14e8d9(0x214)](),_0x14e8d9(0x164),_0x4fc36e,_0x14e8d9(0x173));existsSync(_0x5d18d3)&&(_0xa44c9=_0x4fc36e,_0x4541fa=_0x5d18d3);}if(existsSync(_0x4541fa))_0x20b23b=a4_0x2853a9[_0x14e8d9(0x207)](_0x4541fa),console['log'](a4_0x2eb76c['dim'](_0x14e8d9(0x16e)+_0x20b23b));else{const _0x347efd=_0x477cff[_0x14e8d9(0x181)];if(_0x347efd)throw new SDKError(ErrorCode[_0x14e8d9(0x1ab)],_0x14e8d9(0x165)+_0x541f89+_0x14e8d9(0x1dc),undefined,{'helpText':_0x14e8d9(0x1ef)+_0x14e8d9(0x1d2)+(_0x14e8d9(0x1da)+_0x541f89+'\x0a')+('\x20\x20tdx\x20agent\x20clone\x20agents/'+_0xa44c9+'\x20--name\x20'+(_0x1fc857||'<new-name>')+_0x14e8d9(0x1a7)+_0x347efd)});_0x20b23b=_0x541f89,console[_0x14e8d9(0x199)](a4_0x2eb76c[_0x14e8d9(0x186)](_0x14e8d9(0x1e8)+_0x541f89));}}}}if(!_0x20b23b)return console[_0x14e8d9(0x199)](a4_0x2eb76c['yellow'](_0x14e8d9(0x1cc))),console['log']('\x20\x20tdx\x20agent\x20clone\x20<project>\x20--name\x20<new-name>\x20\x20\x20\x20#\x20Clone\x20from\x20remote\x20project'),console['log']('\x20\x20tdx\x20agent\x20clone\x20<local-dir>\x20--name\x20<new-name>\x20\x20#\x20Clone\x20from\x20local\x20directory'),console[_0x14e8d9(0x199)](_0x14e8d9(0x1e6)),console['log'](_0x14e8d9(0x1d6)),0x1;if(!_0x1fc857)throw new SDKError(ErrorCode[_0x14e8d9(0x184)],_0x14e8d9(0x21a),undefined,{'helpText':_0x14e8d9(0x1ba)});if(!_0x22faab&&!_0x2dceac){if(!isInteractive())return console[_0x14e8d9(0x1f0)](a4_0x2eb76c[_0x14e8d9(0x179)](_0x14e8d9(0x170)),_0x14e8d9(0x206)),console[_0x14e8d9(0x1f0)](a4_0x2eb76c[_0x14e8d9(0x186)](_0x14e8d9(0x20f))),0x1;const _0x3a7eac=await confirmKey(_0x14e8d9(0x202)+_0x20b23b+'\x22\x20to\x20new\x20project\x20\x22'+_0x1fc857+'\x22?');if(!_0x3a7eac)return console['log'](a4_0x2eb76c[_0x14e8d9(0x1d8)](_0x14e8d9(0x16a))),0x1;}const {data:_0x490c7d}=await withSpinner(_0x14e8d9(0x16d)+_0x20b23b+_0x14e8d9(0x15e)+_0x1fc857+_0x14e8d9(0x1fd),()=>_0x5f1b09['llm'][_0x14e8d9(0x20c)](_0x20b23b,_0x1fc857,{'dryRun':_0x2dceac}));if(_0x2dceac){console[_0x14e8d9(0x199)](a4_0x2eb76c[_0x14e8d9(0x1d8)]('Dry\x20run\x20-\x20no\x20changes\x20made')),console[_0x14e8d9(0x199)]('Source:\x20'+_0x490c7d[_0x14e8d9(0x17d)]),console['log'](_0x14e8d9(0x216)+_0x1fc857),console[_0x14e8d9(0x199)](_0x14e8d9(0x1f7)),console[_0x14e8d9(0x199)](_0x14e8d9(0x166)+_0x490c7d['counts'][_0x14e8d9(0x164)][_0x14e8d9(0x1bd)]),console[_0x14e8d9(0x199)](_0x14e8d9(0x198)+_0x490c7d[_0x14e8d9(0x172)][_0x14e8d9(0x1c0)]['created']),console[_0x14e8d9(0x199)](_0x14e8d9(0x192)+_0x490c7d[_0x14e8d9(0x172)]['prompts'][_0x14e8d9(0x1bd)]),console[_0x14e8d9(0x199)](_0x14e8d9(0x182)+_0x490c7d[_0x14e8d9(0x172)][_0x14e8d9(0x211)]['created']),console[_0x14e8d9(0x199)]('\x20\x20Chat\x20Interfaces:\x20'+_0x490c7d[_0x14e8d9(0x172)][_0x14e8d9(0x1db)]['created']);const _0x411776=_0x490c7d['counts']['experimentalKnowledgeBases']['created']>0x0||_0x490c7d[_0x14e8d9(0x172)][_0x14e8d9(0x1c1)][_0x14e8d9(0x1bd)]>0x0;return _0x411776&&(console[_0x14e8d9(0x199)](_0x14e8d9(0x19d)+_0x490c7d[_0x14e8d9(0x172)][_0x14e8d9(0x1f3)]['created']),console[_0x14e8d9(0x199)](_0x14e8d9(0x1f8)+_0x490c7d[_0x14e8d9(0x172)][_0x14e8d9(0x1c1)][_0x14e8d9(0x1bd)])),0x0;}const _0x46d3e9=_0x490c7d['counts'][_0x14e8d9(0x164)]['errors']>0x0||_0x490c7d[_0x14e8d9(0x172)]['knowledgeBases'][_0x14e8d9(0x188)]>0x0||_0x490c7d[_0x14e8d9(0x172)][_0x14e8d9(0x1f6)][_0x14e8d9(0x188)]>0x0||_0x490c7d['counts'][_0x14e8d9(0x211)][_0x14e8d9(0x188)]>0x0||_0x490c7d['counts'][_0x14e8d9(0x1db)][_0x14e8d9(0x188)]>0x0||_0x490c7d[_0x14e8d9(0x172)][_0x14e8d9(0x1f3)][_0x14e8d9(0x188)]>0x0||_0x490c7d[_0x14e8d9(0x172)][_0x14e8d9(0x1c1)]['errors']>0x0;_0x46d3e9?console['log'](a4_0x2eb76c[_0x14e8d9(0x1d8)]('Project\x20cloned\x20with\x20errors')):console[_0x14e8d9(0x199)](a4_0x2eb76c[_0x14e8d9(0x1e5)](_0x14e8d9(0x1ec)));console[_0x14e8d9(0x199)]('Source:\x20'+_0x490c7d[_0x14e8d9(0x17d)]),console[_0x14e8d9(0x199)]('New\x20project:\x20'+_0x490c7d[_0x14e8d9(0x1b5)]),console[_0x14e8d9(0x199)](_0x14e8d9(0x1a5)+_0x490c7d['newProjectId']),console[_0x14e8d9(0x199)](),console[_0x14e8d9(0x199)](_0x14e8d9(0x213)),console[_0x14e8d9(0x199)](_0x14e8d9(0x166)+formatCountSummary(_0x490c7d['counts'][_0x14e8d9(0x164)])),console['log'](_0x14e8d9(0x198)+formatCountSummary(_0x490c7d['counts'][_0x14e8d9(0x1c0)])),console[_0x14e8d9(0x199)]('\x20\x20Prompts:\x20'+formatCountSummary(_0x490c7d[_0x14e8d9(0x172)][_0x14e8d9(0x1f6)])),console[_0x14e8d9(0x199)](_0x14e8d9(0x176)+formatCountSummary(_0x490c7d[_0x14e8d9(0x172)]['integrations'])),console['log'](_0x14e8d9(0x182)+formatCountSummary(_0x490c7d['counts'][_0x14e8d9(0x211)])),console[_0x14e8d9(0x199)](_0x14e8d9(0x1b0)+formatCountSummary(_0x490c7d[_0x14e8d9(0x172)]['chatInterfaces']));const _0x519e0d=_0x490c7d[_0x14e8d9(0x172)][_0x14e8d9(0x1f3)][_0x14e8d9(0x1bd)]>0x0||_0x490c7d[_0x14e8d9(0x172)][_0x14e8d9(0x1f3)]['updated']>0x0||_0x490c7d['counts'][_0x14e8d9(0x1f3)][_0x14e8d9(0x189)]>0x0||_0x490c7d[_0x14e8d9(0x172)][_0x14e8d9(0x1c1)][_0x14e8d9(0x1bd)]>0x0||_0x490c7d[_0x14e8d9(0x172)][_0x14e8d9(0x1c1)]['updated']>0x0||_0x490c7d['counts'][_0x14e8d9(0x1c1)][_0x14e8d9(0x189)]>0x0;_0x519e0d&&(console[_0x14e8d9(0x199)](_0x14e8d9(0x19d)+formatCountSummary(_0x490c7d[_0x14e8d9(0x172)]['experimentalKnowledgeBases'])),console[_0x14e8d9(0x199)](_0x14e8d9(0x1f8)+formatCountSummary(_0x490c7d['counts'][_0x14e8d9(0x1c1)])));if(_0x46d3e9){console['log'](),console[_0x14e8d9(0x199)](a4_0x2eb76c[_0x14e8d9(0x179)](_0x14e8d9(0x1ca)));for(const _0x1dc48c of _0x490c7d[_0x14e8d9(0x164)]){_0x1dc48c[_0x14e8d9(0x169)]==='error'&&console[_0x14e8d9(0x199)](a4_0x2eb76c[_0x14e8d9(0x179)](_0x14e8d9(0x1c5)+_0x1dc48c[_0x14e8d9(0x1aa)]+_0x14e8d9(0x1bb)+_0x1dc48c[_0x14e8d9(0x1f0)]));}for(const _0x4be18b of _0x490c7d['knowledgeBases']){_0x4be18b[_0x14e8d9(0x169)]===_0x14e8d9(0x1f0)&&console[_0x14e8d9(0x199)](a4_0x2eb76c[_0x14e8d9(0x179)](_0x14e8d9(0x209)+_0x4be18b['name']+_0x14e8d9(0x1bb)+_0x4be18b['error']));}for(const _0x339eba of _0x490c7d[_0x14e8d9(0x1f6)]){_0x339eba[_0x14e8d9(0x169)]===_0x14e8d9(0x1f0)&&console['log'](a4_0x2eb76c[_0x14e8d9(0x179)]('\x20\x20Prompt\x20\x22'+_0x339eba[_0x14e8d9(0x210)]+_0x14e8d9(0x1bb)+_0x339eba[_0x14e8d9(0x1f0)]));}for(const _0xf77c79 of _0x490c7d['integrations']){_0xf77c79[_0x14e8d9(0x169)]===_0x14e8d9(0x1f0)&&console[_0x14e8d9(0x199)](a4_0x2eb76c[_0x14e8d9(0x179)]('\x20\x20Integration\x20\x22'+_0xf77c79[_0x14e8d9(0x210)]+'\x22:\x20'+_0xf77c79[_0x14e8d9(0x1f0)]));}for(const _0x37a53d of _0x490c7d['formInterfaces']){_0x37a53d[_0x14e8d9(0x169)]===_0x14e8d9(0x1f0)&&console[_0x14e8d9(0x199)](a4_0x2eb76c['red'](_0x14e8d9(0x1ed)+_0x37a53d[_0x14e8d9(0x210)]+_0x14e8d9(0x1bb)+_0x37a53d[_0x14e8d9(0x1f0)]));}for(const _0x2ebb90 of _0x490c7d['chatInterfaces']){_0x2ebb90[_0x14e8d9(0x169)]===_0x14e8d9(0x1f0)&&console[_0x14e8d9(0x199)](a4_0x2eb76c[_0x14e8d9(0x179)](_0x14e8d9(0x1c3)+_0x2ebb90[_0x14e8d9(0x210)]+_0x14e8d9(0x1bb)+_0x2ebb90[_0x14e8d9(0x1f0)]));}for(const _0x5a94d7 of _0x490c7d['experimentalKnowledgeBases']){_0x5a94d7[_0x14e8d9(0x169)]===_0x14e8d9(0x1f0)&&console[_0x14e8d9(0x199)](a4_0x2eb76c['red'](_0x14e8d9(0x18f)+_0x5a94d7[_0x14e8d9(0x210)]+_0x14e8d9(0x1bb)+_0x5a94d7[_0x14e8d9(0x1f0)]));}for(const _0x581098 of _0x490c7d[_0x14e8d9(0x1c1)]){_0x581098[_0x14e8d9(0x169)]===_0x14e8d9(0x1f0)&&console['log'](a4_0x2eb76c[_0x14e8d9(0x179)](_0x14e8d9(0x1ea)+_0x581098['name']+'\x22:\x20'+_0x581098[_0x14e8d9(0x1f0)]));}return 0x1;}console[_0x14e8d9(0x199)]();const _0x3192dc=getLLMProjectUrl(_0x42e367,_0x490c7d[_0x14e8d9(0x1df)]);return console[_0x14e8d9(0x199)](_0x14e8d9(0x1de)+a4_0x2eb76c[_0x14e8d9(0x19a)](_0x3192dc)),0x0;}}export class AgentPushCommand extends BaseCommand{[a4_0x548581(0x210)]='agent:push';[a4_0x548581(0x187)]=a4_0x548581(0x1dd);async['execute'](_0x4870e0){const _0x295e53=a4_0x548581,{options:_0x5a50b1,args:_0x167776,tdx:_0x55f3c1}=_0x4870e0;let _0x33412b=_0x167776[0x0]||process[_0x295e53(0x214)]();const _0x1da88d=_0x5a50b1['dryRun'],_0x33fa42=_0x5a50b1['force'],_0x598892=_0x5a50b1['yes'],_0x1fd251=_0x5a50b1[_0x295e53(0x18e)],_0x31e7c1=a4_0x2853a9['join'](_0x33412b,'agent.yml'),_0x27abdd=existsSync(_0x31e7c1);if(_0x27abdd){const {data:_0x9f7f9b}=await withSpinner(_0x295e53(0x1e9)+_0x33412b+_0x295e53(0x1fd),()=>_0x55f3c1[_0x295e53(0x1e0)][_0x295e53(0x1f4)](_0x33412b,{'dryRun':_0x1da88d,'force':_0x33fa42}));if(_0x1da88d)return console[_0x295e53(0x199)](a4_0x2eb76c['yellow'](_0x295e53(0x1c6))),console[_0x295e53(0x199)](_0x295e53(0x17f)+_0x9f7f9b[_0x295e53(0x1aa)]),0x0;if(_0x9f7f9b['action']===_0x295e53(0x1f0))return console[_0x295e53(0x199)](a4_0x2eb76c[_0x295e53(0x179)](_0x295e53(0x212)+_0x9f7f9b[_0x295e53(0x1f0)])),0x1;console[_0x295e53(0x199)](a4_0x2eb76c[_0x295e53(0x1e5)](_0x295e53(0x163)+_0x9f7f9b[_0x295e53(0x169)]+'\x20successfully')),console[_0x295e53(0x199)]('Agent:\x20'+_0x9f7f9b[_0x295e53(0x1aa)]);if(_0x9f7f9b[_0x295e53(0x1b9)]&&_0x9f7f9b[_0x295e53(0x160)]){const _0x52c08b=getLLMAgentChatUrl(_0x1fd251,_0x9f7f9b[_0x295e53(0x160)],_0x9f7f9b[_0x295e53(0x1b9)]);console[_0x295e53(0x199)]('Chat:\x20'+a4_0x2eb76c['cyan'](_0x52c08b));}return 0x0;}const _0x4249bb=_0x5a50b1[_0x295e53(0x1a0)],_0xbbe47e=resolveProjectFromContext(_0x33412b,_0x4249bb);if(_0xbbe47e['found'])_0x33412b=_0xbbe47e['projectDir'],_0xbbe47e[_0x295e53(0x1a9)]===_0x295e53(0x1a6)&&console[_0x295e53(0x199)](a4_0x2eb76c[_0x295e53(0x186)](_0x295e53(0x1d5)+_0x33412b));else{let _0xc60d79=_0x295e53(0x1ff);_0xbbe47e[_0x295e53(0x1bf)]===_0x295e53(0x1fc)&&(_0xc60d79=_0xbbe47e[_0x295e53(0x16c)]+'\x0aRun\x20\x27tdx\x20agent\x20pull\x20'+_0xbbe47e[_0x295e53(0x1a0)]+_0x295e53(0x1e4));throw new SDKError(ErrorCode[_0x295e53(0x1ab)],_0xbbe47e[_0x295e53(0x1bf)]===_0x295e53(0x18d)?_0xbbe47e[_0x295e53(0x16c)]:_0x295e53(0x19f)+_0x33412b,undefined,{'helpText':_0xc60d79});}const {data:_0xcfb7d3}=await withSpinner('Analyzing\x20changes\x20to\x20push...',()=>_0x55f3c1[_0x295e53(0x1e0)][_0x295e53(0x1f2)](_0x33412b,{'dryRun':!![]})),_0x46de5d=_0xcfb7d3['counts']['agents'][_0x295e53(0x188)]>0x0;if(_0x46de5d){console['log'](a4_0x2eb76c['red'](_0x295e53(0x215)));for(const _0x535657 of _0xcfb7d3[_0x295e53(0x164)]){_0x535657['action']===_0x295e53(0x1f0)&&console[_0x295e53(0x199)](a4_0x2eb76c['red']('\x20\x20Agent\x20\x22'+_0x535657['agentName']+_0x295e53(0x1bb)+_0x535657[_0x295e53(0x1f0)]));}return 0x1;}const _0x271cf7=_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x164)][_0x295e53(0x1bd)]+_0xcfb7d3['counts'][_0x295e53(0x1c0)][_0x295e53(0x1bd)]+_0xcfb7d3[_0x295e53(0x172)]['textKnowledgeBases'][_0x295e53(0x1bd)]+_0xcfb7d3['counts'][_0x295e53(0x1f6)][_0x295e53(0x1bd)]+_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x195)][_0x295e53(0x1bd)]+_0xcfb7d3['counts'][_0x295e53(0x1f3)]['created']+_0xcfb7d3['counts']['experimentalArtifacts'][_0x295e53(0x1bd)]+_0xcfb7d3['counts'][_0x295e53(0x211)][_0x295e53(0x1bd)]+_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x1db)][_0x295e53(0x1bd)],_0x2aaf81=_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x164)]['updated']+_0xcfb7d3['counts'][_0x295e53(0x1c0)]['updated']+_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x185)][_0x295e53(0x1a2)]+_0xcfb7d3[_0x295e53(0x172)]['prompts']['updated']+_0xcfb7d3[_0x295e53(0x172)]['integrations'][_0x295e53(0x1a2)]+_0xcfb7d3['counts'][_0x295e53(0x1f3)]['updated']+_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x1c1)][_0x295e53(0x1a2)]+_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x211)]['updated']+_0xcfb7d3['counts']['chatInterfaces'][_0x295e53(0x1a2)],_0x5d4268=_0xcfb7d3['counts'][_0x295e53(0x164)]['unchanged']+_0xcfb7d3['counts'][_0x295e53(0x1c0)][_0x295e53(0x189)]+_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x185)][_0x295e53(0x189)]+_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x1f6)][_0x295e53(0x189)]+_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x195)]['unchanged']+_0xcfb7d3[_0x295e53(0x172)]['experimentalKnowledgeBases'][_0x295e53(0x189)]+_0xcfb7d3[_0x295e53(0x172)]['experimentalArtifacts'][_0x295e53(0x189)]+_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x211)]['unchanged']+_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x1db)][_0x295e53(0x189)];console['log'](_0x295e53(0x175)+_0xcfb7d3[_0x295e53(0x19e)]+'\x27:'),console[_0x295e53(0x199)]('\x20\x20'+a4_0x2eb76c[_0x295e53(0x1e5)]('+\x20'+_0x271cf7+'\x20new')+_0x295e53(0x17e)+a4_0x2eb76c[_0x295e53(0x1d8)]('~\x20'+_0x2aaf81+_0x295e53(0x162))+_0x295e53(0x17e)+a4_0x2eb76c[_0x295e53(0x186)]('=\x20'+_0x5d4268+_0x295e53(0x1cb))),console[_0x295e53(0x199)](_0x295e53(0x166)+formatCountSummary(_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x164)])),console[_0x295e53(0x199)]('\x20\x20Knowledge\x20Bases:\x20'+formatCountSummary(_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x1c0)])),console[_0x295e53(0x199)](_0x295e53(0x201)+formatCountSummary(_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x185)])),console[_0x295e53(0x199)](_0x295e53(0x192)+formatCountSummary(_0xcfb7d3['counts'][_0x295e53(0x1f6)])),console['log'](_0x295e53(0x176)+formatCountSummary(_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x195)])),console[_0x295e53(0x199)](_0x295e53(0x182)+formatCountSummary(_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x211)])),console[_0x295e53(0x199)]('\x20\x20Chat\x20Interfaces:\x20'+formatCountSummary(_0xcfb7d3['counts'][_0x295e53(0x1db)]));const _0x498de6=_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x1f3)][_0x295e53(0x1bd)]>0x0||_0xcfb7d3[_0x295e53(0x172)]['experimentalKnowledgeBases']['updated']>0x0||_0xcfb7d3['counts'][_0x295e53(0x1f3)][_0x295e53(0x189)]>0x0||_0xcfb7d3['counts'][_0x295e53(0x1c1)][_0x295e53(0x1bd)]>0x0||_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x1c1)][_0x295e53(0x1a2)]>0x0||_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x1c1)]['unchanged']>0x0;_0x498de6&&(console[_0x295e53(0x199)](_0x295e53(0x19d)+formatCountSummary(_0xcfb7d3[_0x295e53(0x172)][_0x295e53(0x1f3)])),console[_0x295e53(0x199)](_0x295e53(0x1f8)+formatCountSummary(_0xcfb7d3[_0x295e53(0x172)]['experimentalArtifacts'])));console[_0x295e53(0x199)](_0x295e53(0x1e2)+a4_0x2eb76c['cyan'](_0x33412b)),displayDiffs(_0xcfb7d3[_0x295e53(0x164)],_0xcfb7d3[_0x295e53(0x1c0)],_0xcfb7d3[_0x295e53(0x185)],_0xcfb7d3[_0x295e53(0x1f6)],_0xcfb7d3[_0x295e53(0x195)],_0xcfb7d3[_0x295e53(0x1f3)],_0xcfb7d3['experimentalArtifacts'],_0xcfb7d3[_0x295e53(0x211)],_0xcfb7d3[_0x295e53(0x1db)]);if(_0x1da88d)return console[_0x295e53(0x199)](a4_0x2eb76c[_0x295e53(0x1d8)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20pushed')),0x0;if(_0x271cf7===0x0&&_0x2aaf81===0x0){console['log'](a4_0x2eb76c[_0x295e53(0x1e5)](_0x295e53(0x16f)));const _0x5b98b3=getLLMProjectUrl(_0x1fd251,_0xcfb7d3[_0x295e53(0x160)]);return console[_0x295e53(0x199)](_0x295e53(0x1de)+a4_0x2eb76c[_0x295e53(0x19a)](_0x5b98b3)),0x0;}if(!_0x598892&&!_0x33fa42){if(!isInteractive())return console['error'](a4_0x2eb76c[_0x295e53(0x179)](_0x295e53(0x170)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x295e53(0x1f0)](a4_0x2eb76c['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x46b959=await confirmKey(_0x295e53(0x196)+(_0x271cf7+_0x2aaf81)+_0x295e53(0x178));if(!_0x46b959)return console[_0x295e53(0x199)](a4_0x2eb76c['yellow'](_0x295e53(0x16a)),_0x295e53(0x1f1)),0x1;}const {data:_0x4b3528}=await withSpinner(_0x295e53(0x20b),()=>_0x55f3c1[_0x295e53(0x1e0)][_0x295e53(0x1f2)](_0x33412b,{'force':_0x33fa42})),_0x505d49=_0x4b3528[_0x295e53(0x172)][_0x295e53(0x164)]['errors']>0x0||_0x4b3528[_0x295e53(0x172)][_0x295e53(0x1c0)][_0x295e53(0x188)]>0x0||_0x4b3528[_0x295e53(0x172)]['textKnowledgeBases'][_0x295e53(0x188)]>0x0||_0x4b3528[_0x295e53(0x172)]['prompts']['errors']>0x0||_0x4b3528[_0x295e53(0x172)][_0x295e53(0x211)][_0x295e53(0x188)]>0x0||_0x4b3528[_0x295e53(0x172)][_0x295e53(0x1db)][_0x295e53(0x188)]>0x0;if(_0x505d49){console[_0x295e53(0x199)](a4_0x2eb76c[_0x295e53(0x1d8)](_0x295e53(0x1af))),console[_0x295e53(0x199)](),console[_0x295e53(0x199)](a4_0x2eb76c[_0x295e53(0x179)](_0x295e53(0x1ca)));for(const _0x13e171 of _0x4b3528[_0x295e53(0x164)]){_0x13e171['action']===_0x295e53(0x1f0)&&console[_0x295e53(0x199)](a4_0x2eb76c['red'](_0x295e53(0x1c5)+_0x13e171[_0x295e53(0x1aa)]+_0x295e53(0x1bb)+_0x13e171['error']));}for(const _0x14ef0c of _0x4b3528[_0x295e53(0x1c0)]){_0x14ef0c[_0x295e53(0x169)]===_0x295e53(0x1f0)&&console['log'](a4_0x2eb76c['red'](_0x295e53(0x209)+_0x14ef0c[_0x295e53(0x210)]+'\x22:\x20'+_0x14ef0c[_0x295e53(0x1f0)]));}for(const _0x34b265 of _0x4b3528[_0x295e53(0x185)]){_0x34b265['action']===_0x295e53(0x1f0)&&console['log'](a4_0x2eb76c[_0x295e53(0x179)](_0x295e53(0x1be)+_0x34b265[_0x295e53(0x210)]+_0x295e53(0x1bb)+_0x34b265[_0x295e53(0x1f0)]));}for(const _0x5af133 of _0x4b3528[_0x295e53(0x1f6)]){_0x5af133[_0x295e53(0x169)]==='error'&&console['log'](a4_0x2eb76c['red'](_0x295e53(0x20e)+_0x5af133['name']+_0x295e53(0x1bb)+_0x5af133[_0x295e53(0x1f0)]));}for(const _0xf86436 of _0x4b3528[_0x295e53(0x195)]){_0xf86436[_0x295e53(0x169)]===_0x295e53(0x1f0)&&console[_0x295e53(0x199)](a4_0x2eb76c[_0x295e53(0x179)]('\x20\x20Integration\x20\x22'+_0xf86436[_0x295e53(0x210)]+_0x295e53(0x1bb)+_0xf86436[_0x295e53(0x1f0)]));}for(const _0x3eae41 of _0x4b3528['formInterfaces']){_0x3eae41[_0x295e53(0x169)]===_0x295e53(0x1f0)&&console['log'](a4_0x2eb76c['red']('\x20\x20Form\x20Interface\x20\x22'+_0x3eae41[_0x295e53(0x210)]+_0x295e53(0x1bb)+_0x3eae41[_0x295e53(0x1f0)]));}for(const _0x58441d of _0x4b3528[_0x295e53(0x1db)]){_0x58441d['action']==='error'&&console[_0x295e53(0x199)](a4_0x2eb76c[_0x295e53(0x179)](_0x295e53(0x1c3)+_0x58441d[_0x295e53(0x210)]+_0x295e53(0x1bb)+_0x58441d[_0x295e53(0x1f0)]));}return 0x1;}console[_0x295e53(0x199)](a4_0x2eb76c[_0x295e53(0x1e5)](_0x295e53(0x183)+(_0x271cf7+_0x2aaf81)+_0x295e53(0x1c8)+_0x4b3528['projectName']+'\x27'));const _0x3505ba=getLLMProjectUrl(_0x1fd251,_0x4b3528[_0x295e53(0x160)]);return console[_0x295e53(0x199)](_0x295e53(0x1de)+a4_0x2eb76c[_0x295e53(0x19a)](_0x3505ba)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a5_0x4c0922=a5_0x4088;(function(_0x113159,_0x412914){const _0x16df86=a5_0x4088,_0x3895bc=_0x113159();while(!![]){try{const _0x50ce68=-parseInt(_0x16df86(0x12d))/0x1*(-parseInt(_0x16df86(0x13d))/0x2)+parseInt(_0x16df86(0x12b))/0x3*(-parseInt(_0x16df86(0xf3))/0x4)+parseInt(_0x16df86(0xf5))/0x5*(-parseInt(_0x16df86(0xef))/0x6)+parseInt(_0x16df86(0x136))/0x7*(-parseInt(_0x16df86(0x14b))/0x8)+-parseInt(_0x16df86(0x12a))/0x9+parseInt(_0x16df86(0x14a))/0xa+parseInt(_0x16df86(0xdd))/0xb;if(_0x50ce68===_0x412914)break;else _0x3895bc['push'](_0x3895bc['shift']());}catch(_0x10b911){_0x3895bc['push'](_0x3895bc['shift']());}}}(a5_0x9cc7,0x6aa2b));import*as a5_0x5a58c7 from'node:fs';import*as a5_0x4c008d from'node:path';import a5_0x259fd0 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';function a5_0x4088(_0x3139c3,_0x2b9651){_0x3139c3=_0x3139c3-0xbb;const _0x9cc71b=a5_0x9cc7();let _0x4088b1=_0x9cc71b[_0x3139c3];return _0x4088b1;}import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';function a5_0x9cc7(){const _0x40ad6e=['resolveProjectId','Running\x20agent\x20tests...','toISOString','52468PnMLmf','\x20\x20-\x20','Test\x20Summary','white','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','Output\x20written\x20to:\x20','Round\x201/','conversation_url','Errors:\x20\x20\x20','rounds','repeat','Available\x20tags:\x20','length','7572050RyrtUx','423152qDWUIz','\x20\x20Project:\x20','writeFileSync','Test\x20','execute','not\x20found','No\x20tests\x20have\x20tags\x20defined.','New\x20tests\x20to\x20execute:\x20','PASS','ERROR','agentName','site','agent:test','log','tags','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','Running\x20test:\x20','\x20(cached)','name','\x20\x20Round\x20','Run\x20tests\x20for\x20an\x20LLM\x20agent','✓\x20PASS:\x20','No\x20tests\x20found\x20with\x20tags:\x20','\x20\x20Agent:\x20','no_context','testYmlPath','\x22,\x20but\x20current\x20site\x20is\x20\x22','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/',':\x20Sending\x20user\x20input...','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','Re-evaluating...','jsonl','green','trim','Using\x20agent:\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','Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','message','404','Agent:\x20','Re-evaluating\x20','18340509DbkrAw','Conversation\x20URL:\x20','Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','status','context','yellow','Cached\x20run\x20from:\x20','\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)','size','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','FAIL','Total:\x20\x20\x20\x20','join','red','no_tests','filter','output','36498AFpxIC','split','existsSync','dryRun','468yJNeQe','executeReeval','190stcaxg','verbose','toLowerCase','utf-8','eval','push','stop','\x27\x20to\x20create\x20the\x20folder\x20structure.','\x20-\x20','forEach','✗\x20FAIL:\x20','Failed\x20Tests:','\x20(new)','map','Run\x20\x27tdx\x20agent\x20pull\x20','llmProject','/<agent-name>','...','projectName','Project\x20path:\x20','Duration:\x20','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','Round\x20','projectDir','\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22','round','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','✗\x20ERROR:\x20','...\x20','⚠\x20SKIPPED:\x20','found','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','Test\x20Configuration:','text','✗\x20ERROR:\x20Agent\x20not\x20found:\x20','cyan','start','tests','\x20\x20Site:\x20','Error\x20writing\x20output\x20file:\x20','some','now','Re-evaluation\x20Summary','Failed:\x20\x20\x20','llm','find','Re-evaluating\x20cached\x20test\x20run...','Executing\x20new\x20tests...','agent','table','✗\x20ERROR:\x20Project\x20not\x20found:\x20','Error:\x20No\x20previous\x20test\x20run\x20found.','has','7733250WEKFXr','14133ZadOgR','\x20\x20Conversation:\x20','11sbCXRR','\x20\x20Evaluating...\x20','Passed:\x20\x20\x20','reason','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','Tests\x20found:\x20','dim','\x22:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','84BSmLVL','includes','test.yml','tsv'];a5_0x9cc7=function(){return _0x40ad6e;};return a5_0x9cc7();}export class AgentTestCommand extends BaseCommand{[a5_0x4c0922(0xc4)]=a5_0x4c0922(0xbe);['description']=a5_0x4c0922(0xc6);async[a5_0x4c0922(0x14f)](_0x2ccc8d){const _0x5a729c=a5_0x4c0922,{options:_0x23ddab,args:_0x232a47,tdx:_0x31cdc2}=_0x2ccc8d,_0x55a87b=_0x232a47[0x0]||'.',_0x29baac=_0x23ddab[_0x5a729c(0xf2)],_0x3b140c=_0x23ddab,_0x2f8c3c=_0x3b140c[_0x5a729c(0xf9)]===![],_0x3c5c6e=_0x3b140c['reeval'],_0x4c08fe=_0x3b140c[_0x5a729c(0xc4)],_0x1b5d41=_0x3b140c[_0x5a729c(0xc0)],_0x23cf1f=_0x23ddab['site'],_0x2c0ea5=_0x3b140c[_0x5a729c(0xee)];if(_0x3c5c6e&&_0x2f8c3c)return console[_0x5a729c(0xbf)](a5_0x259fd0[_0x5a729c(0xeb)](_0x5a729c(0xd7))),0x1;let _0x57dfb8='table';if(_0x3b140c[_0x5a729c(0xd6)])_0x57dfb8=_0x5a729c(0xd6);else{if(_0x3b140c['jsonl'])_0x57dfb8=_0x5a729c(0xd1);else{if(_0x3b140c[_0x5a729c(0x139)])_0x57dfb8=_0x5a729c(0x139);else{if(_0x3b140c[_0x5a729c(0x126)])_0x57dfb8=_0x5a729c(0x126);}}}const _0x3430a9=_0x3b140c['llmProject'];let _0x1f3f2c=_0x55a87b;const _0x362132=a5_0x5a58c7[_0x5a729c(0xf1)](_0x55a87b),_0x195302=_0x55a87b==='.';if(!_0x362132||_0x195302){const _0x29bf23=resolveProjectFromContext(_0x55a87b,_0x3430a9,{'requireFile':_0x5a729c(0x138)});if(_0x29bf23[_0x5a729c(0x113)])_0x1f3f2c=_0x29bf23['projectDir'],_0x29bf23['source']===_0x5a729c(0xe2)&&console[_0x5a729c(0xbf)](a5_0x259fd0[_0x5a729c(0x133)](_0x5a729c(0xd4)+_0x1f3f2c));else switch(_0x29bf23[_0x5a729c(0x130)]){case _0x5a729c(0xca):console[_0x5a729c(0xbf)](a5_0x259fd0[_0x5a729c(0xe3)](_0x29bf23[_0x5a729c(0xd9)])),console[_0x5a729c(0xbf)](),console[_0x5a729c(0xbf)]('Usage:'),console[_0x5a729c(0xbf)](_0x5a729c(0xd5)),console['log'](_0x5a729c(0xe5)),console[_0x5a729c(0xbf)](),console[_0x5a729c(0xbf)](_0x5a729c(0xdf));return 0x1;case'no_local_folder':console['log'](a5_0x259fd0[_0x5a729c(0xe3)](_0x29bf23['message'])),console['log'](),console[_0x5a729c(0xbf)](_0x5a729c(0x103)+_0x29bf23[_0x5a729c(0x104)]+_0x5a729c(0xfc));return 0x1;case'multiple_agents':{const _0x5b2b90=a5_0x4c008d['basename'](_0x29bf23['projectDir']);console['log'](a5_0x259fd0[_0x5a729c(0xe3)]('Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22'+_0x29bf23[_0x5a729c(0x104)]+'\x22:'));for(const _0x5c330f of _0x29bf23['agentDirs']){console[_0x5a729c(0xbf)](_0x5a729c(0x13e)+_0x5c330f);}return console['log'](),console[_0x5a729c(0xbf)](_0x5a729c(0xcd)+_0x5b2b90+_0x5a729c(0x105)),0x1;}case _0x5a729c(0xec):console[_0x5a729c(0xbf)](a5_0x259fd0[_0x5a729c(0xe3)](_0x5a729c(0x114)+_0x29bf23[_0x5a729c(0x104)]+'\x22.')),console[_0x5a729c(0xbf)](a5_0x259fd0['dim'](_0x5a729c(0x108)+_0x29bf23[_0x5a729c(0x10c)])),console['log'](),console['log'](_0x5a729c(0x10f));return 0x1;}}const {definition:_0x3a2a77,agentInfo:_0x5e7bbc}=parseTestFile(_0x1f3f2c);let _0x54433a=_0x3a2a77[_0x5a729c(0x11a)];if(_0x4c08fe){const _0x16bb70=_0x4c08fe['split'](',')[_0x5a729c(0x102)](_0x298b85=>_0x298b85[_0x5a729c(0xd3)]());_0x54433a=_0x3a2a77[_0x5a729c(0x11a)][_0x5a729c(0xed)](_0x1bcf88=>_0x16bb70['includes'](_0x1bcf88['name']));if(_0x54433a[_0x5a729c(0x149)]===0x0)return console['log'](a5_0x259fd0[_0x5a729c(0xe3)]('No\x20tests\x20found\x20matching:\x20'+_0x4c08fe)),console[_0x5a729c(0xbf)](a5_0x259fd0[_0x5a729c(0x133)]('Available\x20tests:\x20'+_0x3a2a77['tests'][_0x5a729c(0x102)](_0x13d2cb=>_0x13d2cb[_0x5a729c(0xc4)])['join'](',\x20'))),0x1;}if(_0x1b5d41){const _0x22f23c=_0x1b5d41[_0x5a729c(0xf0)](',')[_0x5a729c(0x102)](_0x530fe4=>_0x530fe4['trim']()['toLowerCase']());_0x54433a=_0x54433a[_0x5a729c(0xed)](_0x39c4a1=>_0x39c4a1[_0x5a729c(0xc0)]?.[_0x5a729c(0x11d)](_0x2c103f=>_0x22f23c[_0x5a729c(0x137)](_0x2c103f[_0x5a729c(0xf7)]())));if(_0x54433a[_0x5a729c(0x149)]===0x0){console[_0x5a729c(0xbf)](a5_0x259fd0[_0x5a729c(0xe3)](_0x5a729c(0xc8)+_0x1b5d41));const _0x132d18=new Set();return _0x3a2a77[_0x5a729c(0x11a)][_0x5a729c(0xfe)](_0x424092=>_0x424092[_0x5a729c(0xc0)]?.[_0x5a729c(0xfe)](_0x3e0d9a=>_0x132d18['add'](_0x3e0d9a))),_0x132d18[_0x5a729c(0xe6)]>0x0?console[_0x5a729c(0xbf)](a5_0x259fd0[_0x5a729c(0x133)](_0x5a729c(0x148)+[..._0x132d18][_0x5a729c(0xea)](',\x20'))):console['log'](a5_0x259fd0[_0x5a729c(0x133)](_0x5a729c(0x151))),0x1;}}if(_0x3c5c6e)return this['executeReeval'](_0x2ccc8d,{'definition':{'tests':_0x54433a},'agentInfo':_0x5e7bbc,'outputFormat':_0x57dfb8,'outputFile':_0x2c0ea5,'testNames':_0x4c08fe});if(_0x29baac){console[_0x5a729c(0xbf)](a5_0x259fd0['cyan'](_0x5a729c(0x115))),console[_0x5a729c(0xbf)](_0x5a729c(0x11b)+a5_0x259fd0[_0x5a729c(0x140)](_0x23cf1f)),console[_0x5a729c(0xbf)](_0x5a729c(0x14c)+a5_0x259fd0[_0x5a729c(0x140)](_0x5e7bbc[_0x5a729c(0x107)])),console[_0x5a729c(0xbf)](_0x5a729c(0xc9)+a5_0x259fd0[_0x5a729c(0x140)](_0x5e7bbc['agentName'])),console['log'](),console[_0x5a729c(0xbf)](_0x5a729c(0x132)+a5_0x259fd0[_0x5a729c(0x140)](_0x54433a['length']));for(let _0x246b11=0x0;_0x246b11<_0x54433a[_0x5a729c(0x149)];_0x246b11++){const _0x538e27=_0x54433a[_0x246b11],_0x1c4be2=_0x538e27['rounds']['length']===0x1?_0x5a729c(0x10e):'rounds',_0x21be65=_0x538e27[_0x5a729c(0xc0)]?.['length']?'\x20['+_0x538e27['tags']['join'](',\x20')+']':'';console[_0x5a729c(0xbf)]('\x20\x20'+(_0x246b11+0x1)+'.\x20'+a5_0x259fd0[_0x5a729c(0x140)](_0x538e27[_0x5a729c(0xc4)])+'\x20('+_0x538e27[_0x5a729c(0x146)][_0x5a729c(0x149)]+'\x20'+_0x1c4be2+')'+a5_0x259fd0['dim'](_0x21be65));}return 0x0;}let _0x44fbaf,_0x3e3554;try{_0x44fbaf=await _0x31cdc2[_0x5a729c(0x121)][_0x5a729c(0x13a)](_0x5e7bbc['projectName']);}catch(_0x29c8ca){const _0x5c8370=_0x29c8ca instanceof Error?_0x29c8ca[_0x5a729c(0xd9)]:String(_0x29c8ca);return _0x5c8370[_0x5a729c(0x137)](_0x5a729c(0xda))||_0x5c8370[_0x5a729c(0xf7)]()[_0x5a729c(0x137)](_0x5a729c(0x150))?console[_0x5a729c(0xbf)](a5_0x259fd0[_0x5a729c(0xeb)](_0x5a729c(0x127)+_0x5e7bbc[_0x5a729c(0x107)])):console[_0x5a729c(0xbf)](a5_0x259fd0[_0x5a729c(0xeb)](_0x5a729c(0x135)+_0x5e7bbc[_0x5a729c(0x107)]+_0x5a729c(0x134)+_0x5c8370)),0x1;}try{_0x3e3554=await _0x31cdc2['llm']['resolveAgentId'](_0x5e7bbc[_0x5a729c(0xbc)],_0x44fbaf);}catch(_0x237d47){const _0x455a76=_0x237d47 instanceof Error?_0x237d47[_0x5a729c(0xd9)]:String(_0x237d47);return _0x455a76[_0x5a729c(0x137)]('404')||_0x455a76['toLowerCase']()[_0x5a729c(0x137)](_0x5a729c(0x150))?console[_0x5a729c(0xbf)](a5_0x259fd0['red'](_0x5a729c(0x117)+_0x5e7bbc[_0x5a729c(0xbc)])):console['log'](a5_0x259fd0[_0x5a729c(0xeb)](_0x5a729c(0xd8)+_0x5e7bbc[_0x5a729c(0xbc)]+_0x5a729c(0x134)+_0x455a76)),0x1;}let _0x52e4d0;if(!_0x2f8c3c)try{_0x52e4d0=await setupEvaluatorAgent(_0x31cdc2[_0x5a729c(0x121)],_0x23ddab['verbose']);}catch(_0x4006be){const _0x18c464=_0x4006be instanceof Error?_0x4006be[_0x5a729c(0xd9)]:String(_0x4006be);return console[_0x5a729c(0xbf)](a5_0x259fd0[_0x5a729c(0xeb)](_0x5a729c(0xe0)+_0x18c464)),0x1;}console['log'](a5_0x259fd0['cyan'](_0x5a729c(0x13b))),console[_0x5a729c(0xbf)]('Site:\x20'+a5_0x259fd0[_0x5a729c(0x140)](_0x23cf1f)),console[_0x5a729c(0xbf)](_0x5a729c(0xdb)+a5_0x259fd0[_0x5a729c(0x140)](_0x5e7bbc[_0x5a729c(0x107)]+'/'+_0x5e7bbc['agentName'])),console[_0x5a729c(0xbf)]();const _0x272536=[],_0x2fd993=[],_0x354449=Date[_0x5a729c(0x11e)]();for(let _0x3518a1=0x0;_0x3518a1<_0x54433a[_0x5a729c(0x149)];_0x3518a1++){const _0x5d031c=_0x54433a[_0x3518a1];_0x54433a['length']>0x1?console[_0x5a729c(0xbf)](_0x5a729c(0x14e)+(_0x3518a1+0x1)+'/'+_0x54433a[_0x5a729c(0x149)]+':\x20'+a5_0x259fd0[_0x5a729c(0x140)](_0x5d031c['name'])):console[_0x5a729c(0xbf)](_0x5a729c(0xc2)+a5_0x259fd0[_0x5a729c(0x140)](_0x5d031c[_0x5a729c(0xc4)]));const _0x59f0af=createCommandSpinner('Round\x201/'+_0x5d031c[_0x5a729c(0x146)]['length']+_0x5a729c(0xce));_0x59f0af[_0x5a729c(0x119)]();try{const {result:_0x20a0ec,conversation:_0xab7611}=await runTest(_0x31cdc2[_0x5a729c(0x121)],_0x5d031c,{'agentId':_0x3e3554,'projectId':_0x44fbaf,'site':_0x23cf1f,'noEval':_0x2f8c3c,'evaluatorId':_0x52e4d0,'onRoundStart':(_0x5e247e,_0x1c1400)=>{const _0x4828da=_0x5a729c;_0x59f0af[_0x4828da(0x116)]=_0x4828da(0x10b)+(_0x5e247e+0x1)+'/'+_0x1c1400+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x3686a5,_0x13be3b,_0x74edc5)=>{const _0xd22e2f=_0x5a729c,_0x4eff99=formatElapsed(_0x13be3b);_0x74edc5?console['log'](_0xd22e2f(0xc5)+(_0x3686a5+0x1)+'/'+_0x5d031c[_0xd22e2f(0x146)][_0xd22e2f(0x149)]+_0xd22e2f(0x111)+a5_0x259fd0[_0xd22e2f(0xd2)]('✓')+'\x20('+_0x4eff99+')'):console[_0xd22e2f(0xbf)](_0xd22e2f(0xc5)+(_0x3686a5+0x1)+'/'+_0x5d031c['rounds'][_0xd22e2f(0x149)]+'...\x20'+a5_0x259fd0['red']('✗'));},'onEvaluationStart':()=>{const _0x2dab5b=_0x5a729c;_0x59f0af[_0x2dab5b(0x116)]='Evaluating\x20response...';},'onEvaluationComplete':_0x411f28=>{const _0x1ce89d=_0x5a729c,_0xd68608=formatElapsed(_0x411f28);console[_0x1ce89d(0xbf)](_0x1ce89d(0x12e)+a5_0x259fd0['green']('✓')+'\x20('+_0xd68608+')');}});_0x59f0af['stop'](),_0x272536[_0x5a729c(0xfa)](_0x20a0ec),_0x2fd993['push'](_0xab7611);if(_0x20a0ec[_0x5a729c(0xe1)]===_0x5a729c(0x153))console[_0x5a729c(0xbf)](a5_0x259fd0[_0x5a729c(0xd2)](_0x5a729c(0xc7)+_0x20a0ec[_0x5a729c(0x130)]));else _0x20a0ec[_0x5a729c(0xe1)]==='FAIL'?console[_0x5a729c(0xbf)](a5_0x259fd0[_0x5a729c(0xeb)](_0x5a729c(0xff)+_0x20a0ec[_0x5a729c(0x130)])):console[_0x5a729c(0xbf)](a5_0x259fd0['red'](_0x5a729c(0x110)+_0x20a0ec[_0x5a729c(0x130)]));_0x20a0ec[_0x5a729c(0x144)]&&console[_0x5a729c(0xbf)](a5_0x259fd0[_0x5a729c(0x133)](_0x5a729c(0xde)+_0x20a0ec['conversation_url'])),console[_0x5a729c(0xbf)]();}catch(_0x488a58){_0x59f0af['stop']();const _0x4e03cb=_0x488a58 instanceof Error?_0x488a58[_0x5a729c(0xd9)]:String(_0x488a58);console[_0x5a729c(0xbf)](a5_0x259fd0[_0x5a729c(0xeb)](_0x5a729c(0x110)+_0x4e03cb)),console[_0x5a729c(0xbf)](),_0x272536[_0x5a729c(0xfa)]({'name':_0x5d031c[_0x5a729c(0xc4)],'status':_0x5a729c(0xbb),'reason':_0x4e03cb,'timestamp':new Date()[_0x5a729c(0x13c)](),'duration_ms':0x0});}}const _0x510047=Date[_0x5a729c(0x11e)]()-_0x354449,_0x5195b7=_0x272536['filter'](_0x21e32e=>_0x21e32e[_0x5a729c(0xe1)]===_0x5a729c(0x153))[_0x5a729c(0x149)],_0x3cc9db=_0x272536[_0x5a729c(0xed)](_0x18f42b=>_0x18f42b['status']===_0x5a729c(0xe8))[_0x5a729c(0x149)],_0x91e326=_0x272536['filter'](_0x499c28=>_0x499c28[_0x5a729c(0xe1)]===_0x5a729c(0xbb))[_0x5a729c(0x149)];console[_0x5a729c(0xbf)]('━'['repeat'](0x3c)),console[_0x5a729c(0xbf)](_0x5a729c(0x13f)),console['log']('━'[_0x5a729c(0x147)](0x3c)),console[_0x5a729c(0xbf)](_0x5a729c(0xe9)+_0x272536[_0x5a729c(0x149)]),console[_0x5a729c(0xbf)]('Passed:\x20\x20\x20'+a5_0x259fd0['green'](_0x5195b7)),console[_0x5a729c(0xbf)](_0x5a729c(0x120)+a5_0x259fd0['red'](_0x3cc9db));_0x91e326>0x0&&console[_0x5a729c(0xbf)](_0x5a729c(0x145)+a5_0x259fd0['red'](_0x91e326));console['log'](_0x5a729c(0x109)+formatElapsed(_0x510047)),console[_0x5a729c(0xbf)]('━'[_0x5a729c(0x147)](0x3c));const _0x4bd3e8=_0x272536[_0x5a729c(0xed)](_0x91a320=>_0x91a320[_0x5a729c(0xe1)]!==_0x5a729c(0x153));if(_0x4bd3e8[_0x5a729c(0x149)]>0x0){console[_0x5a729c(0xbf)](),console['log'](_0x5a729c(0x100));for(const _0x218e43 of _0x4bd3e8){const _0x3e1541=a5_0x259fd0[_0x5a729c(0xeb)]('✗'),_0x55d681=_0x218e43[_0x5a729c(0x130)][_0x5a729c(0x149)]>0x32?_0x218e43[_0x5a729c(0x130)]['substring'](0x0,0x32)+_0x5a729c(0x106):_0x218e43[_0x5a729c(0x130)];console[_0x5a729c(0xbf)]('\x20\x20'+_0x3e1541+'\x20'+_0x218e43[_0x5a729c(0xc4)]+':\x20'+_0x55d681);}}const _0x15a5dc={'summary':{'total':_0x272536[_0x5a729c(0x149)],'passed':_0x5195b7,'failed':_0x3cc9db,'errors':_0x91e326>0x0?_0x91e326:undefined,'duration_ms':_0x510047},'tests':_0x272536,'agent':{'project':_0x5e7bbc[_0x5a729c(0x107)],'name':_0x5e7bbc[_0x5a729c(0xbc)],'site':_0x23cf1f},'timestamp':new Date(_0x354449)[_0x5a729c(0x13c)]()};try{const _0x303fb4=buildCachedTestRun(_0x2fd993,{'site':_0x23cf1f,'projectId':_0x44fbaf,'projectName':_0x5e7bbc[_0x5a729c(0x107)],'agentId':_0x3e3554,'agentName':_0x5e7bbc['agentName'],'testYmlPath':a5_0x4c008d['resolve'](_0x5e7bbc[_0x5a729c(0xcb)])});saveLastTestRun(_0x303fb4);}catch{}if(_0x57dfb8!==_0x5a729c(0x126)||_0x2c0ea5){const _0x2f21fd=formatResults(_0x15a5dc,_0x57dfb8);if(_0x2c0ea5)try{a5_0x5a58c7[_0x5a729c(0x14d)](_0x2c0ea5,_0x2f21fd,_0x5a729c(0xf8)),console[_0x5a729c(0xbf)](),console['log'](a5_0x259fd0['dim']('Output\x20written\x20to:\x20'+_0x2c0ea5));}catch(_0x3b66df){return console[_0x5a729c(0xbf)](),console[_0x5a729c(0xbf)](a5_0x259fd0[_0x5a729c(0xeb)](_0x5a729c(0x11c)+_0x3b66df)),0x1;}else console[_0x5a729c(0xbf)](),console[_0x5a729c(0xbf)](_0x2f21fd);}return _0x4bd3e8[_0x5a729c(0x149)]>0x0?0x1:0x0;}async[a5_0x4c0922(0xf4)](_0x47124e,_0x104f30){const _0x55870b=a5_0x4c0922,{options:_0x1a703f,tdx:_0x268c6f}=_0x47124e,{definition:_0x72f932,agentInfo:_0x31e09c,outputFormat:_0x17be4f,outputFile:_0x5cc679}=_0x104f30,_0x4b7f72=_0x1a703f['site'],_0x3a398b=loadLastTestRun();if(!_0x3a398b)return console[_0x55870b(0xbf)](a5_0x259fd0[_0x55870b(0xeb)](_0x55870b(0x128))),console[_0x55870b(0xbf)](a5_0x259fd0[_0x55870b(0x133)](_0x55870b(0x10a))),0x1;if(_0x3a398b[_0x55870b(0x125)][_0x55870b(0xbc)]!==_0x31e09c[_0x55870b(0xbc)])return console[_0x55870b(0xbf)](a5_0x259fd0[_0x55870b(0xeb)](_0x55870b(0xcf)+_0x3a398b[_0x55870b(0x125)][_0x55870b(0xbc)]+_0x55870b(0x10d)+_0x31e09c[_0x55870b(0xbc)]+'\x22.')),console[_0x55870b(0xbf)](a5_0x259fd0[_0x55870b(0x133)](_0x55870b(0x131))),0x1;const _0x551824=new Set(_0x3a398b['conversations'][_0x55870b(0x102)](_0xb1aefd=>_0xb1aefd['testName'])),_0x146440=_0x72f932[_0x55870b(0x11a)]['filter'](_0x4d58ce=>!_0x551824['has'](_0x4d58ce[_0x55870b(0xc4)]));if(_0x146440[_0x55870b(0x149)]>0x0&&_0x3a398b['site']!==_0x4b7f72)return console['log'](a5_0x259fd0[_0x55870b(0xeb)](_0x55870b(0xc1))),console['log'](a5_0x259fd0[_0x55870b(0x133)]('Cached\x20run\x20is\x20from\x20site\x20\x22'+_0x3a398b[_0x55870b(0xbd)]+_0x55870b(0xcc)+_0x4b7f72+'\x22.')),console[_0x55870b(0xbf)](a5_0x259fd0[_0x55870b(0x133)]('Either\x20switch\x20to\x20the\x20\x22'+_0x3a398b[_0x55870b(0xbd)]+_0x55870b(0xe7))),0x1;const _0x437984=_0x72f932['tests'][_0x55870b(0xed)](_0x3109d4=>_0x551824[_0x55870b(0x129)](_0x3109d4[_0x55870b(0xc4)])),_0xb50ad8=_0x146440;let _0x5b0a98;try{_0x5b0a98=await setupEvaluatorAgent(_0x268c6f['llm'],_0x1a703f[_0x55870b(0xf6)]);}catch(_0x26f874){const _0x521628=_0x26f874 instanceof Error?_0x26f874['message']:String(_0x26f874);return console['log'](a5_0x259fd0['red'](_0x55870b(0xe0)+_0x521628)),0x1;}console['log'](a5_0x259fd0['cyan'](_0x55870b(0x123))),console[_0x55870b(0xbf)](_0x55870b(0xe4)+a5_0x259fd0[_0x55870b(0x140)](_0x3a398b['timestamp'])),console[_0x55870b(0xbf)](_0x55870b(0xdb)+a5_0x259fd0[_0x55870b(0x140)](_0x3a398b[_0x55870b(0x125)]['projectName']+'/'+_0x3a398b[_0x55870b(0x125)][_0x55870b(0xbc)]));_0xb50ad8[_0x55870b(0x149)]>0x0&&console[_0x55870b(0xbf)](_0x55870b(0x152)+a5_0x259fd0[_0x55870b(0xe3)](_0xb50ad8[_0x55870b(0x149)]));console[_0x55870b(0xbf)]();const _0x1f0f95=[],_0x38d4da=Date[_0x55870b(0x11e)](),_0x6e55ff=createCommandSpinner(_0x55870b(0xd0));if(_0x437984[_0x55870b(0x149)]>0x0)try{const _0x3e17f3=await reevaluateFromCache(_0x268c6f[_0x55870b(0x121)],_0x3a398b,{'tests':_0x437984},{'evaluatorId':_0x5b0a98,'onTestStart':(_0x2fdbdd,_0x3c1600,_0x475a43)=>{const _0x59f59b=_0x55870b;_0x6e55ff[_0x59f59b(0x116)]=_0x59f59b(0xdc)+(_0x3c1600+0x1)+'/'+_0x475a43+':\x20'+_0x2fdbdd+'...';if(!_0x6e55ff['isSpinning'])_0x6e55ff['start']();},'onTestComplete':(_0x7adf72,_0x4126b8)=>{const _0x5dabfa=_0x55870b;_0x6e55ff[_0x5dabfa(0xfb)]();if(_0x4126b8['status']===_0x5dabfa(0x153))console[_0x5dabfa(0xbf)](a5_0x259fd0[_0x5dabfa(0xd2)](_0x5dabfa(0xc7)+_0x7adf72)+a5_0x259fd0[_0x5dabfa(0x133)](_0x5dabfa(0xc3)));else _0x4126b8[_0x5dabfa(0xe1)]===_0x5dabfa(0xe8)?console[_0x5dabfa(0xbf)](a5_0x259fd0['red'](_0x5dabfa(0xff)+_0x7adf72+'\x20-\x20'+_0x4126b8[_0x5dabfa(0x130)])+a5_0x259fd0['dim'](_0x5dabfa(0xc3))):console[_0x5dabfa(0xbf)](a5_0x259fd0[_0x5dabfa(0xeb)](_0x5dabfa(0x110)+_0x7adf72+_0x5dabfa(0xfd)+_0x4126b8[_0x5dabfa(0x130)]));_0x4126b8['conversation_url']&&console['log'](a5_0x259fd0['dim'](_0x5dabfa(0x12c)+_0x4126b8[_0x5dabfa(0x144)])),_0x1f0f95[_0x5dabfa(0xfa)](_0x4126b8);},'onTestSkipped':(_0x438121,_0x12121c)=>{const _0x5b28bf=_0x55870b;_0x6e55ff['stop'](),console[_0x5b28bf(0xbf)](a5_0x259fd0[_0x5b28bf(0xe3)](_0x5b28bf(0x112)+_0x438121+_0x5b28bf(0xfd)+_0x12121c));}});for(const _0x4663b7 of _0x3e17f3){!_0x1f0f95[_0x55870b(0x122)](_0x41b34f=>_0x41b34f[_0x55870b(0xc4)]===_0x4663b7[_0x55870b(0xc4)])&&_0x1f0f95[_0x55870b(0xfa)](_0x4663b7);}}catch(_0x23f99c){_0x6e55ff[_0x55870b(0xfb)]();const _0x291814=_0x23f99c instanceof Error?_0x23f99c['message']:String(_0x23f99c);return console[_0x55870b(0xbf)](a5_0x259fd0[_0x55870b(0xeb)](_0x55870b(0x141)+_0x291814)),0x1;}_0x6e55ff[_0x55870b(0xfb)]();if(_0xb50ad8['length']>0x0){console[_0x55870b(0xbf)](),console[_0x55870b(0xbf)](a5_0x259fd0[_0x55870b(0x118)](_0x55870b(0x124)));const {projectId:_0x4bae60,agentId:_0x2b975a}=_0x3a398b['agent'];for(const _0xf41f57 of _0xb50ad8){console[_0x55870b(0xbf)]('Running:\x20'+a5_0x259fd0[_0x55870b(0x140)](_0xf41f57[_0x55870b(0xc4)]));const _0x3a0e57=createCommandSpinner(_0x55870b(0x143)+_0xf41f57[_0x55870b(0x146)]['length']+_0x55870b(0xce));_0x3a0e57[_0x55870b(0x119)]();try{const {result:_0x32cb73}=await runTest(_0x268c6f[_0x55870b(0x121)],_0xf41f57,{'agentId':_0x2b975a,'projectId':_0x4bae60,'site':_0x3a398b['site'],'noEval':![],'evaluatorId':_0x5b0a98,'onRoundStart':(_0xbfb64,_0x43930a)=>{const _0x2affbc=_0x55870b;_0x3a0e57[_0x2affbc(0x116)]=_0x2affbc(0x10b)+(_0xbfb64+0x1)+'/'+_0x43930a+_0x2affbc(0xce);},'onRoundComplete':(_0x7ea447,_0x2d2f8f,_0x52c4e6)=>{const _0x1edc7d=_0x55870b,_0x25390c=formatElapsed(_0x2d2f8f);_0x52c4e6?console['log'](_0x1edc7d(0xc5)+(_0x7ea447+0x1)+'/'+_0xf41f57['rounds'][_0x1edc7d(0x149)]+_0x1edc7d(0x111)+a5_0x259fd0[_0x1edc7d(0xd2)]('✓')+'\x20('+_0x25390c+')'):console[_0x1edc7d(0xbf)](_0x1edc7d(0xc5)+(_0x7ea447+0x1)+'/'+_0xf41f57[_0x1edc7d(0x146)][_0x1edc7d(0x149)]+'...\x20'+a5_0x259fd0['red']('✗'));},'onEvaluationStart':()=>{const _0x4695fb=_0x55870b;_0x3a0e57[_0x4695fb(0x116)]='Evaluating\x20response...';},'onEvaluationComplete':_0x41e00e=>{const _0x36d274=_0x55870b,_0x24b05a=formatElapsed(_0x41e00e);console['log']('\x20\x20Evaluating...\x20'+a5_0x259fd0[_0x36d274(0xd2)]('✓')+'\x20('+_0x24b05a+')');}});_0x3a0e57[_0x55870b(0xfb)](),_0x1f0f95[_0x55870b(0xfa)](_0x32cb73);if(_0x32cb73[_0x55870b(0xe1)]===_0x55870b(0x153))console['log'](a5_0x259fd0['green'](_0x55870b(0xc7)+_0x32cb73['reason'])+a5_0x259fd0[_0x55870b(0x133)]('\x20(new)'));else _0x32cb73['status']==='FAIL'?console[_0x55870b(0xbf)](a5_0x259fd0[_0x55870b(0xeb)](_0x55870b(0xff)+_0x32cb73[_0x55870b(0x130)])+a5_0x259fd0[_0x55870b(0x133)](_0x55870b(0x101))):console['log'](a5_0x259fd0[_0x55870b(0xeb)](_0x55870b(0x110)+_0x32cb73[_0x55870b(0x130)]));_0x32cb73[_0x55870b(0x144)]&&console[_0x55870b(0xbf)](a5_0x259fd0['dim'](_0x55870b(0x12c)+_0x32cb73[_0x55870b(0x144)]));}catch(_0x5dab7e){_0x3a0e57['stop']();const _0x966600=_0x5dab7e instanceof Error?_0x5dab7e['message']:String(_0x5dab7e);console['log'](a5_0x259fd0['red'](_0x55870b(0x110)+_0x966600)),_0x1f0f95[_0x55870b(0xfa)]({'name':_0xf41f57[_0x55870b(0xc4)],'status':_0x55870b(0xbb),'reason':_0x966600,'timestamp':new Date()['toISOString'](),'duration_ms':0x0});}}}console[_0x55870b(0xbf)]();const _0xa3c062=Date[_0x55870b(0x11e)]()-_0x38d4da,_0x5e206b=_0x1f0f95[_0x55870b(0xed)](_0x54876c=>_0x54876c[_0x55870b(0xe1)]===_0x55870b(0x153))[_0x55870b(0x149)],_0x1ff65f=_0x1f0f95[_0x55870b(0xed)](_0x30e9ba=>_0x30e9ba[_0x55870b(0xe1)]===_0x55870b(0xe8))[_0x55870b(0x149)],_0x471170=_0x1f0f95[_0x55870b(0xed)](_0x46eb12=>_0x46eb12[_0x55870b(0xe1)]===_0x55870b(0xbb))['length'];console[_0x55870b(0xbf)]('━'[_0x55870b(0x147)](0x3c)),console[_0x55870b(0xbf)](_0x55870b(0x11f)),console[_0x55870b(0xbf)]('━'[_0x55870b(0x147)](0x3c)),console[_0x55870b(0xbf)](_0x55870b(0xe9)+_0x1f0f95['length']),console[_0x55870b(0xbf)](_0x55870b(0x12f)+a5_0x259fd0[_0x55870b(0xd2)](_0x5e206b)),console[_0x55870b(0xbf)]('Failed:\x20\x20\x20'+a5_0x259fd0[_0x55870b(0xeb)](_0x1ff65f));_0x471170>0x0&&console[_0x55870b(0xbf)]('Errors:\x20\x20\x20'+a5_0x259fd0[_0x55870b(0xeb)](_0x471170));console[_0x55870b(0xbf)](_0x55870b(0x109)+formatElapsed(_0xa3c062)),console['log']('━'[_0x55870b(0x147)](0x3c));const _0x26a0b0={'summary':{'total':_0x1f0f95['length'],'passed':_0x5e206b,'failed':_0x1ff65f,'errors':_0x471170>0x0?_0x471170:undefined,'duration_ms':_0xa3c062},'tests':_0x1f0f95,'agent':{'project':_0x31e09c['projectName'],'name':_0x31e09c[_0x55870b(0xbc)],'site':_0x4b7f72},'timestamp':new Date(_0x38d4da)['toISOString']()};if(_0x17be4f!=='table'||_0x5cc679){const _0x4e21ba=formatResults(_0x26a0b0,_0x17be4f);if(_0x5cc679)try{a5_0x5a58c7[_0x55870b(0x14d)](_0x5cc679,_0x4e21ba,_0x55870b(0xf8)),console[_0x55870b(0xbf)](),console[_0x55870b(0xbf)](a5_0x259fd0['dim'](_0x55870b(0x142)+_0x5cc679));}catch(_0x381a91){return console[_0x55870b(0xbf)](),console[_0x55870b(0xbf)](a5_0x259fd0[_0x55870b(0xeb)](_0x55870b(0x11c)+_0x381a91)),0x1;}else console[_0x55870b(0xbf)](),console[_0x55870b(0xbf)](_0x4e21ba);}const _0x529427=_0x1f0f95['filter'](_0x25fbad=>_0x25fbad[_0x55870b(0xe1)]!=='PASS');return _0x529427[_0x55870b(0x149)]>0x0?0x1:0x0;}}
|
|
1
|
+
const a5_0x222562=a5_0x2373;(function(_0x194b83,_0x3eb3ee){const _0x1da68e=a5_0x2373,_0x4b29fc=_0x194b83();while(!![]){try{const _0x5b6080=-parseInt(_0x1da68e(0x172))/0x1*(parseInt(_0x1da68e(0x15e))/0x2)+-parseInt(_0x1da68e(0x12b))/0x3*(parseInt(_0x1da68e(0x18a))/0x4)+parseInt(_0x1da68e(0xf4))/0x5*(parseInt(_0x1da68e(0x139))/0x6)+parseInt(_0x1da68e(0x165))/0x7*(-parseInt(_0x1da68e(0x144))/0x8)+-parseInt(_0x1da68e(0x10e))/0x9+-parseInt(_0x1da68e(0x143))/0xa*(-parseInt(_0x1da68e(0x13a))/0xb)+parseInt(_0x1da68e(0x107))/0xc;if(_0x5b6080===_0x3eb3ee)break;else _0x4b29fc['push'](_0x4b29fc['shift']());}catch(_0x516284){_0x4b29fc['push'](_0x4b29fc['shift']());}}}(a5_0x2080,0xd78ca));import*as a5_0x15b21f from'node:fs';function a5_0x2080(){const _0x11fbdd=['\x20-\x20','jsonl','New\x20tests\x20to\x20execute:\x20','\x20\x20tdx\x20agent\x20test\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20tests\x20(requires\x20context\x20or\x20tdx.json)','Running\x20test:\x20','Running:\x20','\x20\x20-\x20','site','tags','context','✗\x20FAIL:\x20','resolve','verbose','join','\x20(cached)','✗\x20ERROR:\x20Failed\x20to\x20set\x20up\x20evaluator:\x20','reeval','94026jNlMJI','size','\x22\x20site\x20or\x20run\x20a\x20fresh\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20cache.','Run\x20`tdx\x20agent\x20test`\x20to\x20generate\x20new\x20conversations\x20for\x20this\x20agent.','agentName','resolveAgentId','Test\x20Configuration:','repeat','add','tsv','PASS','includes','Duration:\x20','Conversation\x20URL:\x20','114gOUVKc','11IgHcQZ','message','✗\x20ERROR:\x20Project\x20not\x20found:\x20','llmProject','\x20\x20Conversation:\x20','Error:\x20Cached\x20run\x20is\x20for\x20agent\x20\x22','found','/<agent-name>','source','3760810DfbDyD','325312zyNWjO','toISOString','Error:\x20No\x20previous\x20test\x20run\x20found.','writeFileSync','\x20\x20Project:\x20','executeReeval','no_tests','utf-8','red','description','status','Round\x20','rounds','agentDirs','ERROR','now','conversation_url','Usage:','isSpinning','conversations','Round\x201/','Agent:\x20','\x27\x20to\x20create\x20the\x20folder\x20structure.','Executing\x20new\x20tests...','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20project\x20\x22','dim','1338094jiJsSc','name','projectDir','\x20\x20Evaluating...\x20','Project\x20path:\x20','timestamp','Re-evaluation\x20Summary','217SVqyVP','tests','Running\x20agent\x20tests...','...','some','execute','\x20\x20Site:\x20','green','stop','Run\x20`tdx\x20agent\x20test`\x20first\x20to\x20generate\x20conversations.','No\x20tests\x20found\x20with\x20tags:\x20','projectName','multiple_agents','1KVsinY','\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','\x22:\x20','split','...\x20','Either\x20switch\x20to\x20the\x20\x22','output','Re-evaluating\x20cached\x20test\x20run...','existsSync','table','agent:test','Multiple\x20agents\x20with\x20tests\x20found\x20in\x20project\x20\x22','FAIL','has','Failed:\x20\x20\x20','Passed:\x20\x20\x20','reason','No\x20tests\x20have\x20tags\x20defined.','Test\x20','white','Specify\x20an\x20agent:\x20tdx\x20agent\x20test\x20agents/','round','Failed\x20Tests:','Errors:\x20\x20\x20','164jqaYPn','Cached\x20run\x20from:\x20','forEach','Test\x20Summary','404','378470vAlcBk','log','Create\x20a\x20test.yml\x20in\x20an\x20agent\x20directory\x20to\x20run\x20evaluations.','Total:\x20\x20\x20\x20','trim','json','✓\x20PASS:\x20','Cached\x20run\x20is\x20from\x20site\x20\x22','\x20\x20Agent:\x20','✗\x20ERROR:\x20Re-evaluation\x20failed:\x20','No\x20test.yml\x20found\x20in\x20any\x20agent\x20under\x20project\x20\x22','no_context','\x20\x20Round\x20','cyan','start','push','toLowerCase','text','agent','35577180exMlPf','Error:\x20Cannot\x20execute\x20new\x20tests\x20-\x20site\x20mismatch.','yellow','Error\x20writing\x20output\x20file:\x20','Re-evaluating...','✗\x20ERROR:\x20','map','6133401cQHIWa','Available\x20tests:\x20','length','no_local_folder','Output\x20written\x20to:\x20','✗\x20ERROR:\x20Failed\x20to\x20resolve\x20agent\x20\x22','resolveProjectId',':\x20Sending\x20user\x20input...','llm','testName','filter','not\x20found'];a5_0x2080=function(){return _0x11fbdd;};return a5_0x2080();}import*as a5_0x3575f6 from'node:path';import a5_0x1bac87 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';function a5_0x2373(_0x456def,_0x13ce25){_0x456def=_0x456def-0xf4;const _0x208091=a5_0x2080();let _0x237381=_0x208091[_0x456def];return _0x237381;}import{createCommandSpinner,formatElapsed}from'../utils/spinner.js';export class AgentTestCommand extends BaseCommand{[a5_0x222562(0x15f)]=a5_0x222562(0x17c);[a5_0x222562(0x14d)]='Run\x20tests\x20for\x20an\x20LLM\x20agent';async[a5_0x222562(0x16a)](_0xfc7681){const _0x191717=a5_0x222562,{options:_0x2e1904,args:_0x2282fe,tdx:_0x338079}=_0xfc7681,_0x355578=_0x2282fe[0x0]||'.',_0x182584=_0x2e1904['dryRun'],_0x7006fc=_0x2e1904,_0x2351f1=_0x7006fc['eval']===![],_0x5b96fe=_0x7006fc[_0x191717(0x12a)],_0x12500a=_0x7006fc[_0x191717(0x15f)],_0x718b03=_0x7006fc[_0x191717(0x122)],_0x53ca69=_0x2e1904[_0x191717(0x121)],_0x946f4b=_0x7006fc[_0x191717(0x178)];if(_0x5b96fe&&_0x2351f1)return console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x14c)]('Error:\x20Cannot\x20use\x20--reeval\x20with\x20--no-eval')),0x1;let _0x2e0f27=_0x191717(0x17b);if(_0x7006fc[_0x191717(0xf9)])_0x2e0f27='json';else{if(_0x7006fc[_0x191717(0x11b)])_0x2e0f27=_0x191717(0x11b);else{if(_0x7006fc[_0x191717(0x134)])_0x2e0f27=_0x191717(0x134);else{if(_0x7006fc['table'])_0x2e0f27=_0x191717(0x17b);}}}const _0x49133c=_0x7006fc['llmProject'];let _0x10d656=_0x355578;const _0x537b07=a5_0x15b21f[_0x191717(0x17a)](_0x355578),_0x461b67=_0x355578==='.';if(!_0x537b07||_0x461b67){const _0x256792=resolveProjectFromContext(_0x355578,_0x49133c,{'requireFile':'test.yml'});if(_0x256792[_0x191717(0x140)])_0x10d656=_0x256792[_0x191717(0x160)],_0x256792[_0x191717(0x142)]===_0x191717(0x123)&&console['log'](a5_0x1bac87[_0x191717(0x15d)]('Using\x20agent:\x20'+_0x10d656));else switch(_0x256792['reason']){case _0x191717(0xff):console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x109)](_0x256792['message'])),console[_0x191717(0xf5)](),console[_0x191717(0xf5)](_0x191717(0x155)),console[_0x191717(0xf5)](_0x191717(0x173)),console[_0x191717(0xf5)](_0x191717(0x11d)),console['log'](),console['log']('Set\x20context\x20with:\x20tdx\x20use\x20llm_project\x20<name>');return 0x1;case _0x191717(0x111):console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x109)](_0x256792['message'])),console[_0x191717(0xf5)](),console['log']('Run\x20\x27tdx\x20agent\x20pull\x20'+_0x256792[_0x191717(0x13d)]+_0x191717(0x15a));return 0x1;case _0x191717(0x171):{const _0xd9d497=a5_0x3575f6['basename'](_0x256792[_0x191717(0x160)]);console['log'](a5_0x1bac87[_0x191717(0x109)](_0x191717(0x17d)+_0x256792[_0x191717(0x13d)]+'\x22:'));for(const _0x19ec5c of _0x256792[_0x191717(0x151)]){console[_0x191717(0xf5)](_0x191717(0x120)+_0x19ec5c);}return console['log'](),console['log'](_0x191717(0x186)+_0xd9d497+_0x191717(0x141)),0x1;}case _0x191717(0x14a):console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x109)](_0x191717(0xfe)+_0x256792[_0x191717(0x13d)]+'\x22.')),console[_0x191717(0xf5)](a5_0x1bac87['dim'](_0x191717(0x162)+_0x256792[_0x191717(0x160)])),console[_0x191717(0xf5)](),console[_0x191717(0xf5)](_0x191717(0xf6));return 0x1;}}const {definition:_0x39719e,agentInfo:_0x5c94e1}=parseTestFile(_0x10d656);let _0x5e2016=_0x39719e[_0x191717(0x166)];if(_0x12500a){const _0x4a4aec=_0x12500a[_0x191717(0x175)](',')[_0x191717(0x10d)](_0x19a918=>_0x19a918[_0x191717(0xf8)]());_0x5e2016=_0x39719e[_0x191717(0x166)]['filter'](_0x817aa5=>_0x4a4aec['includes'](_0x817aa5['name']));if(_0x5e2016[_0x191717(0x110)]===0x0)return console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x109)]('No\x20tests\x20found\x20matching:\x20'+_0x12500a)),console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x15d)](_0x191717(0x10f)+_0x39719e[_0x191717(0x166)][_0x191717(0x10d)](_0x1ddfe7=>_0x1ddfe7['name'])[_0x191717(0x127)](',\x20'))),0x1;}if(_0x718b03){const _0x5c2c6f=_0x718b03[_0x191717(0x175)](',')[_0x191717(0x10d)](_0x596a70=>_0x596a70['trim']()[_0x191717(0x104)]());_0x5e2016=_0x5e2016[_0x191717(0x118)](_0x509a01=>_0x509a01[_0x191717(0x122)]?.[_0x191717(0x169)](_0x3ba687=>_0x5c2c6f[_0x191717(0x136)](_0x3ba687[_0x191717(0x104)]())));if(_0x5e2016[_0x191717(0x110)]===0x0){console[_0x191717(0xf5)](a5_0x1bac87['yellow'](_0x191717(0x16f)+_0x718b03));const _0x2563c9=new Set();return _0x39719e['tests']['forEach'](_0x448c29=>_0x448c29[_0x191717(0x122)]?.[_0x191717(0x18c)](_0x24a1b7=>_0x2563c9[_0x191717(0x133)](_0x24a1b7))),_0x2563c9[_0x191717(0x12c)]>0x0?console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x15d)]('Available\x20tags:\x20'+[..._0x2563c9]['join'](',\x20'))):console['log'](a5_0x1bac87[_0x191717(0x15d)](_0x191717(0x183))),0x1;}}if(_0x5b96fe)return this[_0x191717(0x149)](_0xfc7681,{'definition':{'tests':_0x5e2016},'agentInfo':_0x5c94e1,'outputFormat':_0x2e0f27,'outputFile':_0x946f4b,'testNames':_0x12500a});if(_0x182584){console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x101)](_0x191717(0x131))),console[_0x191717(0xf5)](_0x191717(0x16b)+a5_0x1bac87[_0x191717(0x185)](_0x53ca69)),console['log'](_0x191717(0x148)+a5_0x1bac87[_0x191717(0x185)](_0x5c94e1[_0x191717(0x170)])),console[_0x191717(0xf5)](_0x191717(0xfc)+a5_0x1bac87[_0x191717(0x185)](_0x5c94e1['agentName'])),console[_0x191717(0xf5)](),console[_0x191717(0xf5)]('Tests\x20found:\x20'+a5_0x1bac87[_0x191717(0x185)](_0x5e2016[_0x191717(0x110)]));for(let _0x28929e=0x0;_0x28929e<_0x5e2016[_0x191717(0x110)];_0x28929e++){const _0x3adfc4=_0x5e2016[_0x28929e],_0x5f3275=_0x3adfc4[_0x191717(0x150)][_0x191717(0x110)]===0x1?_0x191717(0x187):_0x191717(0x150),_0x362072=_0x3adfc4[_0x191717(0x122)]?.[_0x191717(0x110)]?'\x20['+_0x3adfc4[_0x191717(0x122)][_0x191717(0x127)](',\x20')+']':'';console[_0x191717(0xf5)]('\x20\x20'+(_0x28929e+0x1)+'.\x20'+a5_0x1bac87[_0x191717(0x185)](_0x3adfc4[_0x191717(0x15f)])+'\x20('+_0x3adfc4['rounds'][_0x191717(0x110)]+'\x20'+_0x5f3275+')'+a5_0x1bac87[_0x191717(0x15d)](_0x362072));}return 0x0;}let _0x19a720,_0xe31e65;try{_0x19a720=await _0x338079[_0x191717(0x116)][_0x191717(0x114)](_0x5c94e1[_0x191717(0x170)]);}catch(_0x2ad4d4){const _0x3531ae=_0x2ad4d4 instanceof Error?_0x2ad4d4['message']:String(_0x2ad4d4);return _0x3531ae['includes'](_0x191717(0x18e))||_0x3531ae['toLowerCase']()['includes'](_0x191717(0x119))?console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x14c)](_0x191717(0x13c)+_0x5c94e1[_0x191717(0x170)])):console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x14c)](_0x191717(0x15c)+_0x5c94e1[_0x191717(0x170)]+_0x191717(0x174)+_0x3531ae)),0x1;}try{_0xe31e65=await _0x338079[_0x191717(0x116)][_0x191717(0x130)](_0x5c94e1[_0x191717(0x12f)],_0x19a720);}catch(_0x5e90b6){const _0x33c00b=_0x5e90b6 instanceof Error?_0x5e90b6[_0x191717(0x13b)]:String(_0x5e90b6);return _0x33c00b[_0x191717(0x136)](_0x191717(0x18e))||_0x33c00b[_0x191717(0x104)]()[_0x191717(0x136)](_0x191717(0x119))?console[_0x191717(0xf5)](a5_0x1bac87['red']('✗\x20ERROR:\x20Agent\x20not\x20found:\x20'+_0x5c94e1[_0x191717(0x12f)])):console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x14c)](_0x191717(0x113)+_0x5c94e1['agentName']+'\x22:\x20'+_0x33c00b)),0x1;}let _0x5da48f;if(!_0x2351f1)try{_0x5da48f=await setupEvaluatorAgent(_0x338079[_0x191717(0x116)],_0x2e1904[_0x191717(0x126)]);}catch(_0x8dba4d){const _0x334039=_0x8dba4d instanceof Error?_0x8dba4d[_0x191717(0x13b)]:String(_0x8dba4d);return console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x14c)](_0x191717(0x129)+_0x334039)),0x1;}console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x101)](_0x191717(0x167))),console['log']('Site:\x20'+a5_0x1bac87[_0x191717(0x185)](_0x53ca69)),console[_0x191717(0xf5)](_0x191717(0x159)+a5_0x1bac87[_0x191717(0x185)](_0x5c94e1[_0x191717(0x170)]+'/'+_0x5c94e1['agentName'])),console[_0x191717(0xf5)]();const _0x3fbc3b=[],_0x281f5f=[],_0x3c8464=Date['now']();for(let _0x124f4e=0x0;_0x124f4e<_0x5e2016[_0x191717(0x110)];_0x124f4e++){const _0x2228e0=_0x5e2016[_0x124f4e];_0x5e2016['length']>0x1?console['log'](_0x191717(0x184)+(_0x124f4e+0x1)+'/'+_0x5e2016[_0x191717(0x110)]+':\x20'+a5_0x1bac87[_0x191717(0x185)](_0x2228e0['name'])):console[_0x191717(0xf5)](_0x191717(0x11e)+a5_0x1bac87[_0x191717(0x185)](_0x2228e0[_0x191717(0x15f)]));const _0x4b0756=createCommandSpinner(_0x191717(0x158)+_0x2228e0[_0x191717(0x150)][_0x191717(0x110)]+_0x191717(0x115));_0x4b0756[_0x191717(0x102)]();try{const {result:_0x9f945c,conversation:_0x4fc834}=await runTest(_0x338079['llm'],_0x2228e0,{'agentId':_0xe31e65,'projectId':_0x19a720,'site':_0x53ca69,'noEval':_0x2351f1,'evaluatorId':_0x5da48f,'onRoundStart':(_0x257f47,_0x341fab)=>{const _0x5720f9=_0x191717;_0x4b0756[_0x5720f9(0x105)]=_0x5720f9(0x14f)+(_0x257f47+0x1)+'/'+_0x341fab+':\x20Sending\x20user\x20input...';},'onRoundComplete':(_0x568c26,_0x2a4e80,_0x36ec12)=>{const _0x83aaee=_0x191717,_0x27a11e=formatElapsed(_0x2a4e80);_0x36ec12?console[_0x83aaee(0xf5)](_0x83aaee(0x100)+(_0x568c26+0x1)+'/'+_0x2228e0['rounds'][_0x83aaee(0x110)]+_0x83aaee(0x176)+a5_0x1bac87[_0x83aaee(0x16c)]('✓')+'\x20('+_0x27a11e+')'):console[_0x83aaee(0xf5)]('\x20\x20Round\x20'+(_0x568c26+0x1)+'/'+_0x2228e0['rounds'][_0x83aaee(0x110)]+_0x83aaee(0x176)+a5_0x1bac87['red']('✗'));},'onEvaluationStart':()=>{const _0x5ad15e=_0x191717;_0x4b0756[_0x5ad15e(0x105)]='Evaluating\x20response...';},'onEvaluationComplete':_0x2806ac=>{const _0x24c1a6=_0x191717,_0xf65c18=formatElapsed(_0x2806ac);console[_0x24c1a6(0xf5)](_0x24c1a6(0x161)+a5_0x1bac87[_0x24c1a6(0x16c)]('✓')+'\x20('+_0xf65c18+')');}});_0x4b0756[_0x191717(0x16d)](),_0x3fbc3b[_0x191717(0x103)](_0x9f945c),_0x281f5f[_0x191717(0x103)](_0x4fc834);if(_0x9f945c[_0x191717(0x14e)]==='PASS')console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x16c)](_0x191717(0xfa)+_0x9f945c[_0x191717(0x182)]));else _0x9f945c[_0x191717(0x14e)]===_0x191717(0x17e)?console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x14c)](_0x191717(0x124)+_0x9f945c[_0x191717(0x182)])):console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x14c)](_0x191717(0x10c)+_0x9f945c['reason']));_0x9f945c[_0x191717(0x154)]&&console['log'](a5_0x1bac87[_0x191717(0x15d)](_0x191717(0x138)+_0x9f945c[_0x191717(0x154)])),console['log']();}catch(_0x1b7bd9){_0x4b0756[_0x191717(0x16d)]();const _0x5794e6=_0x1b7bd9 instanceof Error?_0x1b7bd9[_0x191717(0x13b)]:String(_0x1b7bd9);console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x14c)](_0x191717(0x10c)+_0x5794e6)),console[_0x191717(0xf5)](),_0x3fbc3b[_0x191717(0x103)]({'name':_0x2228e0[_0x191717(0x15f)],'status':_0x191717(0x152),'reason':_0x5794e6,'timestamp':new Date()[_0x191717(0x145)](),'duration_ms':0x0});}}const _0xfa4fa0=Date[_0x191717(0x153)]()-_0x3c8464,_0x3d9dcd=_0x3fbc3b['filter'](_0x54851b=>_0x54851b[_0x191717(0x14e)]===_0x191717(0x135))[_0x191717(0x110)],_0x4718de=_0x3fbc3b[_0x191717(0x118)](_0x127727=>_0x127727[_0x191717(0x14e)]===_0x191717(0x17e))['length'],_0x4b1b23=_0x3fbc3b[_0x191717(0x118)](_0x55e4c0=>_0x55e4c0['status']==='ERROR')['length'];console[_0x191717(0xf5)]('━'['repeat'](0x3c)),console['log'](_0x191717(0x18d)),console[_0x191717(0xf5)]('━'[_0x191717(0x132)](0x3c)),console['log'](_0x191717(0xf7)+_0x3fbc3b['length']),console[_0x191717(0xf5)]('Passed:\x20\x20\x20'+a5_0x1bac87[_0x191717(0x16c)](_0x3d9dcd)),console[_0x191717(0xf5)](_0x191717(0x180)+a5_0x1bac87[_0x191717(0x14c)](_0x4718de));_0x4b1b23>0x0&&console['log'](_0x191717(0x189)+a5_0x1bac87[_0x191717(0x14c)](_0x4b1b23));console[_0x191717(0xf5)](_0x191717(0x137)+formatElapsed(_0xfa4fa0)),console[_0x191717(0xf5)]('━'[_0x191717(0x132)](0x3c));const _0x5e23d9=_0x3fbc3b[_0x191717(0x118)](_0x402f3f=>_0x402f3f[_0x191717(0x14e)]!==_0x191717(0x135));if(_0x5e23d9[_0x191717(0x110)]>0x0){console[_0x191717(0xf5)](),console[_0x191717(0xf5)](_0x191717(0x188));for(const _0x391380 of _0x5e23d9){const _0x4f16df=a5_0x1bac87[_0x191717(0x14c)]('✗'),_0x4ed12d=_0x391380[_0x191717(0x182)][_0x191717(0x110)]>0x32?_0x391380['reason']['substring'](0x0,0x32)+_0x191717(0x168):_0x391380[_0x191717(0x182)];console['log']('\x20\x20'+_0x4f16df+'\x20'+_0x391380[_0x191717(0x15f)]+':\x20'+_0x4ed12d);}}const _0x457fd3={'summary':{'total':_0x3fbc3b[_0x191717(0x110)],'passed':_0x3d9dcd,'failed':_0x4718de,'errors':_0x4b1b23>0x0?_0x4b1b23:undefined,'duration_ms':_0xfa4fa0},'tests':_0x3fbc3b,'agent':{'project':_0x5c94e1['projectName'],'name':_0x5c94e1['agentName'],'site':_0x53ca69},'timestamp':new Date(_0x3c8464)[_0x191717(0x145)]()};try{const _0x455b34=buildCachedTestRun(_0x281f5f,{'site':_0x53ca69,'projectId':_0x19a720,'projectName':_0x5c94e1['projectName'],'agentId':_0xe31e65,'agentName':_0x5c94e1[_0x191717(0x12f)],'testYmlPath':a5_0x3575f6[_0x191717(0x125)](_0x5c94e1['testYmlPath'])});saveLastTestRun(_0x455b34);}catch{}if(_0x2e0f27!==_0x191717(0x17b)||_0x946f4b){const _0x441789=formatResults(_0x457fd3,_0x2e0f27);if(_0x946f4b)try{a5_0x15b21f[_0x191717(0x147)](_0x946f4b,_0x441789,_0x191717(0x14b)),console[_0x191717(0xf5)](),console[_0x191717(0xf5)](a5_0x1bac87[_0x191717(0x15d)](_0x191717(0x112)+_0x946f4b));}catch(_0x2dedd9){return console[_0x191717(0xf5)](),console[_0x191717(0xf5)](a5_0x1bac87['red'](_0x191717(0x10a)+_0x2dedd9)),0x1;}else console['log'](),console[_0x191717(0xf5)](_0x441789);}return _0x5e23d9[_0x191717(0x110)]>0x0?0x1:0x0;}async[a5_0x222562(0x149)](_0x4d17d7,_0x159f50){const _0x430068=a5_0x222562,{options:_0x176d2b,tdx:_0x39f9f0}=_0x4d17d7,{definition:_0x1fac99,agentInfo:_0xd33f37,outputFormat:_0x13924f,outputFile:_0x4afe5b}=_0x159f50,_0x35bf15=_0x176d2b['site'],_0x460934=loadLastTestRun();if(!_0x460934)return console[_0x430068(0xf5)](a5_0x1bac87[_0x430068(0x14c)](_0x430068(0x146))),console[_0x430068(0xf5)](a5_0x1bac87['dim'](_0x430068(0x16e))),0x1;if(_0x460934[_0x430068(0x106)][_0x430068(0x12f)]!==_0xd33f37[_0x430068(0x12f)])return console[_0x430068(0xf5)](a5_0x1bac87[_0x430068(0x14c)](_0x430068(0x13f)+_0x460934['agent'][_0x430068(0x12f)]+'\x22,\x20but\x20test.yml\x20is\x20for\x20agent\x20\x22'+_0xd33f37['agentName']+'\x22.')),console[_0x430068(0xf5)](a5_0x1bac87[_0x430068(0x15d)](_0x430068(0x12e))),0x1;const _0x110ca1=new Set(_0x460934[_0x430068(0x157)][_0x430068(0x10d)](_0x4a14e6=>_0x4a14e6[_0x430068(0x117)])),_0x5d360a=_0x1fac99['tests']['filter'](_0x28a049=>!_0x110ca1[_0x430068(0x17f)](_0x28a049['name']));if(_0x5d360a[_0x430068(0x110)]>0x0&&_0x460934[_0x430068(0x121)]!==_0x35bf15)return console['log'](a5_0x1bac87[_0x430068(0x14c)](_0x430068(0x108))),console[_0x430068(0xf5)](a5_0x1bac87['dim'](_0x430068(0xfb)+_0x460934['site']+'\x22,\x20but\x20current\x20site\x20is\x20\x22'+_0x35bf15+'\x22.')),console['log'](a5_0x1bac87[_0x430068(0x15d)](_0x430068(0x177)+_0x460934[_0x430068(0x121)]+_0x430068(0x12d))),0x1;const _0x144045=_0x1fac99[_0x430068(0x166)]['filter'](_0x229fa8=>_0x110ca1[_0x430068(0x17f)](_0x229fa8[_0x430068(0x15f)])),_0x9a4d48=_0x5d360a;let _0x404b5a;try{_0x404b5a=await setupEvaluatorAgent(_0x39f9f0[_0x430068(0x116)],_0x176d2b['verbose']);}catch(_0x13311b){const _0xd4aaa=_0x13311b instanceof Error?_0x13311b[_0x430068(0x13b)]:String(_0x13311b);return console[_0x430068(0xf5)](a5_0x1bac87['red'](_0x430068(0x129)+_0xd4aaa)),0x1;}console[_0x430068(0xf5)](a5_0x1bac87[_0x430068(0x101)](_0x430068(0x179))),console[_0x430068(0xf5)](_0x430068(0x18b)+a5_0x1bac87[_0x430068(0x185)](_0x460934[_0x430068(0x163)])),console['log'](_0x430068(0x159)+a5_0x1bac87[_0x430068(0x185)](_0x460934[_0x430068(0x106)][_0x430068(0x170)]+'/'+_0x460934[_0x430068(0x106)][_0x430068(0x12f)]));_0x9a4d48[_0x430068(0x110)]>0x0&&console['log'](_0x430068(0x11c)+a5_0x1bac87[_0x430068(0x109)](_0x9a4d48[_0x430068(0x110)]));console[_0x430068(0xf5)]();const _0x3c4d09=[],_0x1bf0eb=Date['now'](),_0xaf8d15=createCommandSpinner(_0x430068(0x10b));if(_0x144045[_0x430068(0x110)]>0x0)try{const _0x4d8302=await reevaluateFromCache(_0x39f9f0['llm'],_0x460934,{'tests':_0x144045},{'evaluatorId':_0x404b5a,'onTestStart':(_0xa2abc1,_0x1633cb,_0x556308)=>{const _0x1ad402=_0x430068;_0xaf8d15[_0x1ad402(0x105)]='Re-evaluating\x20'+(_0x1633cb+0x1)+'/'+_0x556308+':\x20'+_0xa2abc1+_0x1ad402(0x168);if(!_0xaf8d15[_0x1ad402(0x156)])_0xaf8d15[_0x1ad402(0x102)]();},'onTestComplete':(_0x51768a,_0x4390aa)=>{const _0x2fc65c=_0x430068;_0xaf8d15[_0x2fc65c(0x16d)]();if(_0x4390aa[_0x2fc65c(0x14e)]==='PASS')console[_0x2fc65c(0xf5)](a5_0x1bac87[_0x2fc65c(0x16c)](_0x2fc65c(0xfa)+_0x51768a)+a5_0x1bac87[_0x2fc65c(0x15d)](_0x2fc65c(0x128)));else _0x4390aa[_0x2fc65c(0x14e)]===_0x2fc65c(0x17e)?console['log'](a5_0x1bac87[_0x2fc65c(0x14c)](_0x2fc65c(0x124)+_0x51768a+_0x2fc65c(0x11a)+_0x4390aa[_0x2fc65c(0x182)])+a5_0x1bac87[_0x2fc65c(0x15d)]('\x20(cached)')):console[_0x2fc65c(0xf5)](a5_0x1bac87[_0x2fc65c(0x14c)]('✗\x20ERROR:\x20'+_0x51768a+_0x2fc65c(0x11a)+_0x4390aa['reason']));_0x4390aa[_0x2fc65c(0x154)]&&console[_0x2fc65c(0xf5)](a5_0x1bac87['dim']('\x20\x20Conversation:\x20'+_0x4390aa['conversation_url'])),_0x3c4d09[_0x2fc65c(0x103)](_0x4390aa);},'onTestSkipped':(_0x578160,_0x6b8d5e)=>{const _0x2717d7=_0x430068;_0xaf8d15[_0x2717d7(0x16d)](),console[_0x2717d7(0xf5)](a5_0x1bac87[_0x2717d7(0x109)]('⚠\x20SKIPPED:\x20'+_0x578160+'\x20-\x20'+_0x6b8d5e));}});for(const _0x3399d1 of _0x4d8302){!_0x3c4d09['find'](_0x19d8c7=>_0x19d8c7[_0x430068(0x15f)]===_0x3399d1[_0x430068(0x15f)])&&_0x3c4d09[_0x430068(0x103)](_0x3399d1);}}catch(_0x1cba77){_0xaf8d15[_0x430068(0x16d)]();const _0x2f08a0=_0x1cba77 instanceof Error?_0x1cba77[_0x430068(0x13b)]:String(_0x1cba77);return console[_0x430068(0xf5)](a5_0x1bac87[_0x430068(0x14c)](_0x430068(0xfd)+_0x2f08a0)),0x1;}_0xaf8d15[_0x430068(0x16d)]();if(_0x9a4d48[_0x430068(0x110)]>0x0){console[_0x430068(0xf5)](),console['log'](a5_0x1bac87[_0x430068(0x101)](_0x430068(0x15b)));const {projectId:_0x8ed771,agentId:_0x5e9fc1}=_0x460934[_0x430068(0x106)];for(const _0x6c32ff of _0x9a4d48){console[_0x430068(0xf5)](_0x430068(0x11f)+a5_0x1bac87[_0x430068(0x185)](_0x6c32ff['name']));const _0x1ba6ec=createCommandSpinner('Round\x201/'+_0x6c32ff[_0x430068(0x150)][_0x430068(0x110)]+':\x20Sending\x20user\x20input...');_0x1ba6ec['start']();try{const {result:_0xda30ac}=await runTest(_0x39f9f0[_0x430068(0x116)],_0x6c32ff,{'agentId':_0x5e9fc1,'projectId':_0x8ed771,'site':_0x460934[_0x430068(0x121)],'noEval':![],'evaluatorId':_0x404b5a,'onRoundStart':(_0x301a06,_0x2c620e)=>{const _0x213245=_0x430068;_0x1ba6ec[_0x213245(0x105)]=_0x213245(0x14f)+(_0x301a06+0x1)+'/'+_0x2c620e+_0x213245(0x115);},'onRoundComplete':(_0x4d0e6d,_0x2caca7,_0x7b38be)=>{const _0x6c5f94=_0x430068,_0x54d390=formatElapsed(_0x2caca7);_0x7b38be?console[_0x6c5f94(0xf5)](_0x6c5f94(0x100)+(_0x4d0e6d+0x1)+'/'+_0x6c32ff[_0x6c5f94(0x150)][_0x6c5f94(0x110)]+'...\x20'+a5_0x1bac87[_0x6c5f94(0x16c)]('✓')+'\x20('+_0x54d390+')'):console[_0x6c5f94(0xf5)]('\x20\x20Round\x20'+(_0x4d0e6d+0x1)+'/'+_0x6c32ff[_0x6c5f94(0x150)][_0x6c5f94(0x110)]+_0x6c5f94(0x176)+a5_0x1bac87[_0x6c5f94(0x14c)]('✗'));},'onEvaluationStart':()=>{const _0x2266f8=_0x430068;_0x1ba6ec[_0x2266f8(0x105)]='Evaluating\x20response...';},'onEvaluationComplete':_0x5acc8c=>{const _0xee3371=_0x430068,_0x1e6455=formatElapsed(_0x5acc8c);console[_0xee3371(0xf5)]('\x20\x20Evaluating...\x20'+a5_0x1bac87[_0xee3371(0x16c)]('✓')+'\x20('+_0x1e6455+')');}});_0x1ba6ec[_0x430068(0x16d)](),_0x3c4d09[_0x430068(0x103)](_0xda30ac);if(_0xda30ac[_0x430068(0x14e)]==='PASS')console[_0x430068(0xf5)](a5_0x1bac87['green'](_0x430068(0xfa)+_0xda30ac['reason'])+a5_0x1bac87['dim']('\x20(new)'));else _0xda30ac['status']==='FAIL'?console[_0x430068(0xf5)](a5_0x1bac87['red'](_0x430068(0x124)+_0xda30ac[_0x430068(0x182)])+a5_0x1bac87[_0x430068(0x15d)]('\x20(new)')):console[_0x430068(0xf5)](a5_0x1bac87[_0x430068(0x14c)](_0x430068(0x10c)+_0xda30ac[_0x430068(0x182)]));_0xda30ac[_0x430068(0x154)]&&console[_0x430068(0xf5)](a5_0x1bac87[_0x430068(0x15d)](_0x430068(0x13e)+_0xda30ac['conversation_url']));}catch(_0x3b948b){_0x1ba6ec['stop']();const _0x1cd3e9=_0x3b948b instanceof Error?_0x3b948b['message']:String(_0x3b948b);console[_0x430068(0xf5)](a5_0x1bac87[_0x430068(0x14c)](_0x430068(0x10c)+_0x1cd3e9)),_0x3c4d09['push']({'name':_0x6c32ff[_0x430068(0x15f)],'status':_0x430068(0x152),'reason':_0x1cd3e9,'timestamp':new Date()[_0x430068(0x145)](),'duration_ms':0x0});}}}console[_0x430068(0xf5)]();const _0xb9a542=Date['now']()-_0x1bf0eb,_0x2f8364=_0x3c4d09[_0x430068(0x118)](_0x4e5cd7=>_0x4e5cd7[_0x430068(0x14e)]==='PASS')[_0x430068(0x110)],_0x32e58c=_0x3c4d09[_0x430068(0x118)](_0x1ba691=>_0x1ba691['status']===_0x430068(0x17e))[_0x430068(0x110)],_0x58a971=_0x3c4d09['filter'](_0x219104=>_0x219104['status']==='ERROR')[_0x430068(0x110)];console[_0x430068(0xf5)]('━'['repeat'](0x3c)),console[_0x430068(0xf5)](_0x430068(0x164)),console[_0x430068(0xf5)]('━'[_0x430068(0x132)](0x3c)),console[_0x430068(0xf5)]('Total:\x20\x20\x20\x20'+_0x3c4d09[_0x430068(0x110)]),console[_0x430068(0xf5)](_0x430068(0x181)+a5_0x1bac87[_0x430068(0x16c)](_0x2f8364)),console['log'](_0x430068(0x180)+a5_0x1bac87[_0x430068(0x14c)](_0x32e58c));_0x58a971>0x0&&console[_0x430068(0xf5)]('Errors:\x20\x20\x20'+a5_0x1bac87[_0x430068(0x14c)](_0x58a971));console[_0x430068(0xf5)](_0x430068(0x137)+formatElapsed(_0xb9a542)),console[_0x430068(0xf5)]('━'[_0x430068(0x132)](0x3c));const _0x7db2be={'summary':{'total':_0x3c4d09[_0x430068(0x110)],'passed':_0x2f8364,'failed':_0x32e58c,'errors':_0x58a971>0x0?_0x58a971:undefined,'duration_ms':_0xb9a542},'tests':_0x3c4d09,'agent':{'project':_0xd33f37['projectName'],'name':_0xd33f37['agentName'],'site':_0x35bf15},'timestamp':new Date(_0x1bf0eb)[_0x430068(0x145)]()};if(_0x13924f!==_0x430068(0x17b)||_0x4afe5b){const _0x22f687=formatResults(_0x7db2be,_0x13924f);if(_0x4afe5b)try{a5_0x15b21f[_0x430068(0x147)](_0x4afe5b,_0x22f687,_0x430068(0x14b)),console[_0x430068(0xf5)](),console['log'](a5_0x1bac87[_0x430068(0x15d)](_0x430068(0x112)+_0x4afe5b));}catch(_0x203bb0){return console[_0x430068(0xf5)](),console[_0x430068(0xf5)](a5_0x1bac87[_0x430068(0x14c)](_0x430068(0x10a)+_0x203bb0)),0x1;}else console[_0x430068(0xf5)](),console[_0x430068(0xf5)](_0x22f687);}const _0x2fd87f=_0x3c4d09['filter'](_0x28ff18=>_0x28ff18['status']!==_0x430068(0x135));return _0x2fd87f['length']>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a6_0x24e0ec=a6_0x4883;function a6_0x4883(_0x74af0d,_0x4f03d9){_0x74af0d=_0x74af0d-0xf1;const _0x1bf44d=a6_0x1bf4();let _0x48830e=_0x1bf44d[_0x74af0d];return _0x48830e;}(function(_0xccae8f,_0x8408ff){const _0x16aa22=a6_0x4883,_0x23b8ce=_0xccae8f();while(!![]){try{const _0x28ab85=parseInt(_0x16aa22(0x10f))/0x1+-parseInt(_0x16aa22(0x124))/0x2+parseInt(_0x16aa22(0xfc))/0x3*(-parseInt(_0x16aa22(0xf8))/0x4)+parseInt(_0x16aa22(0x12c))/0x5*(parseInt(_0x16aa22(0x12f))/0x6)+parseInt(_0x16aa22(0x132))/0x7*(parseInt(_0x16aa22(0x123))/0x8)+parseInt(_0x16aa22(0x126))/0x9+-parseInt(_0x16aa22(0x121))/0xa;if(_0x28ab85===_0x8408ff)break;else _0x23b8ce['push'](_0x23b8ce['shift']());}catch(_0x28a939){_0x23b8ce['push'](_0x23b8ce['shift']());}}}(a6_0x1bf4,0x99454));import a6_0x13bc6a from'chalk';import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{getAllProfileStats,getAllSourceStats,getUsageSummary}from'../proxy/claude-usage-tracker.js';function a6_0x1bf4(){const _0x2e2e49=['red','getCommandName','Last\x20Used','toFixed','Usage\x20by\x20Profile','Usage\x20by\x20Source','error','Month','Error:\x20','sources','max','todayCredits','shouldShowSources','outputStructured','en-US','profile','numeric','16204370QphTFy','toLocaleDateString','8sMnxjZ','46002XmENdI','\x20\x20Month:\x20\x20\x20','2894130GTVgKb','length','source','\x20days\x20ago','getTime','2-digit','1455yGevVS','\x20\x20Total:\x20\x20\x20','jsonl','18696kcJzTz','Show\x20AI\x20Suite\x20credit\x20usage\x20by\x20profile','\x0aAI\x20Suite\x20Credit\x20Usage\x20Summary','3663499BLlEEU','outputTable','map','monthCredits','entryCount','(default)','\x20credits','cyan','padStart','never','lastUsedAt','dim','35420qVtPxQ','\x20\x20Today:\x20\x20\x20','\x20\x20No\x20usage\x20data\x20recorded\x20yet.','Today','21oivcvo','message','Credits','execute','bold','yesterday','repeat','description','log','padEnd','en-CA','json','profileCount','all','format','Source','credits','default','totalCredits','581536LHZwhk'];a6_0x1bf4=function(){return _0x2e2e49;};return a6_0x1bf4();}function formatCredits(_0x4020fc){const _0x1c1712=a6_0x4883;return _0x4020fc[_0x1c1712(0x113)](0x2);}function formatLastUsed(_0x92e14){const _0x5a28f7=a6_0x4883;if(!_0x92e14)return _0x5a28f7(0xf5);const _0xec9318=new Date(_0x92e14),_0x21a89c=new Date(),_0x381e33=_0xec9318[_0x5a28f7(0x122)](_0x5a28f7(0x106)),_0x34d743=_0x21a89c[_0x5a28f7(0x122)](_0x5a28f7(0x106));if(_0x381e33===_0x34d743)return'today\x20'+_0xec9318['toLocaleTimeString'](_0x5a28f7(0x11e),{'hour':_0x5a28f7(0x12b),'minute':_0x5a28f7(0x12b)});const _0x5e058e=new Date(_0x381e33),_0x464ba3=new Date(_0x34d743),_0x214b42=Math['round']((_0x464ba3['getTime']()-_0x5e058e[_0x5a28f7(0x12a)]())/(0x18*0x3c*0x3c*0x3e8));if(_0x214b42===0x1)return _0x5a28f7(0x101);else return _0x214b42>0x1&&_0x214b42<0x7?_0x214b42+_0x5a28f7(0x129):_0xec9318[_0x5a28f7(0x122)](_0x5a28f7(0x11e),{'month':'short','day':_0x5a28f7(0x120)});}export class AIUsageCommandBase extends BaseCommand{['name']='usage';[a6_0x24e0ec(0x103)]=a6_0x24e0ec(0x130);async[a6_0x24e0ec(0xff)](_0x1229da){const _0x3695cb=a6_0x24e0ec,{options:_0x566389}=_0x1229da,_0xf27a88=_0x566389[_0x3695cb(0x10a)]===_0x3695cb(0x107)||_0x566389[_0x3695cb(0x10a)]===_0x3695cb(0x12e)||_0x566389[_0x3695cb(0x107)];try{const [_0x90ae16,_0x9257d5,_0x4337db]=await Promise[_0x3695cb(0x109)]([getAllProfileStats(),this[_0x3695cb(0x11c)]()?getAllSourceStats():Promise['resolve']([]),getUsageSummary()]);return _0xf27a88?await this[_0x3695cb(0x11d)](_0x90ae16,_0x9257d5,_0x4337db,_0x566389):this[_0x3695cb(0x133)](_0x90ae16,_0x9257d5,_0x4337db),0x0;}catch(_0x22e20d){const _0x21e16c=_0x22e20d instanceof Error?_0x22e20d[_0x3695cb(0xfd)]:'Unknown\x20error';return console[_0x3695cb(0x116)](a6_0x13bc6a[_0x3695cb(0x110)](_0x3695cb(0x118)+_0x21e16c)),0x1;}}async[a6_0x24e0ec(0x11d)](_0x5d7939,_0x36ce28,_0xea82ad,_0x2cb2f4){const _0x3b97f9=a6_0x24e0ec,_0x5a2afb={'summary':{'todayCredits':_0xea82ad['todayCredits'],'monthCredits':_0xea82ad['monthCredits'],'totalCredits':_0xea82ad['totalCredits'],'profileCount':_0xea82ad[_0x3b97f9(0x108)]},'profiles':_0x5d7939[_0x3b97f9(0x134)](_0x1ad010=>({'profile':_0x1ad010[_0x3b97f9(0x11f)],'credits':_0x1ad010[_0x3b97f9(0x10c)],'requests':_0x1ad010['entryCount'],'lastUsedAt':_0x1ad010[_0x3b97f9(0xf6)]}))};this[_0x3b97f9(0x11c)]()&&(_0x5a2afb[_0x3b97f9(0x119)]=_0x36ce28['map'](_0x40581d=>({'source':_0x40581d[_0x3b97f9(0x128)],'credits':_0x40581d[_0x3b97f9(0x10c)],'todayCredits':_0x40581d['todayCredits'],'monthCredits':_0x40581d['monthCredits'],'requests':_0x40581d[_0x3b97f9(0x136)]}))),await handleSDKOutput([_0x5a2afb],_0x2cb2f4);}[a6_0x24e0ec(0x133)](_0x375cff,_0x181628,_0x376a53){const _0x30bba2=a6_0x24e0ec;console['log'](a6_0x13bc6a[_0x30bba2(0x100)](_0x30bba2(0x131))),console['log'](a6_0x13bc6a[_0x30bba2(0xf7)]('─'[_0x30bba2(0x102)](0x32))),console['log'](_0x30bba2(0xf9)+a6_0x13bc6a[_0x30bba2(0xf3)](formatCredits(_0x376a53[_0x30bba2(0x11b)]))+_0x30bba2(0xf2)),console[_0x30bba2(0x104)](_0x30bba2(0x125)+a6_0x13bc6a[_0x30bba2(0xf3)](formatCredits(_0x376a53['monthCredits']))+_0x30bba2(0xf2)),console[_0x30bba2(0x104)](_0x30bba2(0x12d)+a6_0x13bc6a['cyan'](formatCredits(_0x376a53[_0x30bba2(0x10e)]))+'\x20credits'),console[_0x30bba2(0x104)]();if(this[_0x30bba2(0x11c)]()&&_0x181628[_0x30bba2(0x127)]>0x0){console[_0x30bba2(0x104)](a6_0x13bc6a[_0x30bba2(0x100)](_0x30bba2(0x115))),console[_0x30bba2(0x104)](a6_0x13bc6a[_0x30bba2(0xf7)]('─'[_0x30bba2(0x102)](0x3c)));const _0x18931a=0xc,_0x3de839=0xa,_0x105ef0=0xa,_0x344728=0xa;console['log']('\x20\x20'+_0x30bba2(0x10b)[_0x30bba2(0x105)](_0x18931a)+'\x20\x20'+'Total'[_0x30bba2(0xf4)](_0x3de839)+'\x20\x20'+_0x30bba2(0xfb)[_0x30bba2(0xf4)](_0x105ef0)+'\x20\x20'+_0x30bba2(0x117)[_0x30bba2(0xf4)](_0x344728));for(const _0x4e3a41 of _0x181628){console[_0x30bba2(0x104)]('\x20\x20'+_0x4e3a41[_0x30bba2(0x128)]['padEnd'](_0x18931a)+'\x20\x20'+a6_0x13bc6a[_0x30bba2(0xf3)](formatCredits(_0x4e3a41[_0x30bba2(0x10c)])['padStart'](_0x3de839))+'\x20\x20'+formatCredits(_0x4e3a41[_0x30bba2(0x11b)])[_0x30bba2(0xf4)](_0x105ef0)+'\x20\x20'+formatCredits(_0x4e3a41[_0x30bba2(0x135)])[_0x30bba2(0xf4)](_0x344728));}console[_0x30bba2(0x104)]();}if(_0x375cff['length']===0x0){console[_0x30bba2(0x104)](a6_0x13bc6a['dim'](_0x30bba2(0xfa))),console['log'](a6_0x13bc6a['dim']('\x20\x20Run\x20\x22'+this[_0x30bba2(0x111)]()+'\x22\x20to\x20start\x20using\x20AI\x20Suite.\x0a'));return;}console[_0x30bba2(0x104)](a6_0x13bc6a[_0x30bba2(0x100)](_0x30bba2(0x114))),console[_0x30bba2(0x104)](a6_0x13bc6a[_0x30bba2(0xf7)]('─'['repeat'](0x3c)));const _0x210326=Math[_0x30bba2(0x11a)](0xc,..._0x375cff[_0x30bba2(0x134)](_0x598ae7=>_0x598ae7[_0x30bba2(0x11f)]==='default'?_0x30bba2(0xf1)[_0x30bba2(0x127)]:_0x598ae7['profile'][_0x30bba2(0x127)])),_0x4f0fe1=0xa,_0x156e17=0xa;console[_0x30bba2(0x104)]('\x20\x20'+'Profile'[_0x30bba2(0x105)](_0x210326)+'\x20\x20'+_0x30bba2(0xfe)['padStart'](_0x4f0fe1)+'\x20\x20'+'Requests'[_0x30bba2(0xf4)](_0x156e17)+'\x20\x20'+_0x30bba2(0x112));for(const _0x3d3bb5 of _0x375cff){const _0x3b9eb7=_0x3d3bb5[_0x30bba2(0x11f)]===_0x30bba2(0x10d)?_0x30bba2(0xf1):_0x3d3bb5[_0x30bba2(0x11f)],_0x35406d=_0x3b9eb7[_0x30bba2(0x105)](_0x210326),_0x4eb503=_0x3d3bb5[_0x30bba2(0x11f)]===_0x30bba2(0x10d)?a6_0x13bc6a[_0x30bba2(0xf7)](_0x35406d):_0x35406d;console['log']('\x20\x20'+_0x4eb503+'\x20\x20'+a6_0x13bc6a[_0x30bba2(0xf3)](formatCredits(_0x3d3bb5[_0x30bba2(0x10c)])[_0x30bba2(0xf4)](_0x4f0fe1))+'\x20\x20'+String(_0x3d3bb5[_0x30bba2(0x136)])['padStart'](_0x156e17)+'\x20\x20'+a6_0x13bc6a[_0x30bba2(0xf7)](formatLastUsed(_0x3d3bb5['lastUsedAt'])));}console[_0x30bba2(0x104)](),console[_0x30bba2(0x104)](a6_0x13bc6a[_0x30bba2(0xf7)]('Note:\x20Credit\x20values\x20are\x20estimates\x20based\x20on\x20token\x20usage.')),console[_0x30bba2(0x104)]();}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a7_0x2428(_0x8c4c77,_0x4a595c){_0x8c4c77=_0x8c4c77-0x186;const _0x46cfeb=a7_0x46cf();let _0x24283a=_0x46cfeb[_0x8c4c77];return _0x24283a;}const a7_0x341c00=a7_0x2428;(function(_0x386180,_0x11fac6){const _0x3f3d59=a7_0x2428,_0x444e28=_0x386180();while(!![]){try{const _0x2038b5=-parseInt(_0x3f3d59(0x1b1))/0x1+parseInt(_0x3f3d59(0x1c9))/0x2+parseInt(_0x3f3d59(0x19d))/0x3+-parseInt(_0x3f3d59(0x18c))/0x4+parseInt(_0x3f3d59(0x19c))/0x5*(-parseInt(_0x3f3d59(0x1b2))/0x6)+-parseInt(_0x3f3d59(0x1c2))/0x7+parseInt(_0x3f3d59(0x1b9))/0x8*(parseInt(_0x3f3d59(0x196))/0x9);if(_0x2038b5===_0x11fac6)break;else _0x444e28['push'](_0x444e28['shift']());}catch(_0x1398da){_0x444e28['push'](_0x444e28['shift']());}}}(a7_0x46cf,0x53b26));import{BaseCommand}from'./command.js';import{RawAPI}from'../sdk/api.js';import{colorizeJSON}from'../utils/colors.js';function a7_0x46cf(){const _0x5df5ee=['Error:\x20','set-cookie','Expected\x20format:\x20\x22Key:\x20Value\x22\x20or\x20\x22Key:Value\x22','header','workflow','toLowerCase','3103205WtilVS','set-cookie2','length','stack','headers','method','substring','304828aDxsqV','output','isArray','us01','cookie','has','includes','2467980YcVCdR','PATCH','GET','error','verbose','toUpperCase','Endpoint\x20is\x20required.\x20Example:\x20tdx\x20api\x20/v3/database/list','cdp','name','log','9qmcSUM','x-xsrf-token','trim','Invalid\x20HTTP\x20method:\x20','DELETE','api','5cdOeTh','1598154GYKFXA','request','Header\x20key\x20cannot\x20be\x20empty:\x20\x22','x-auth-token','data','PUT','body','proxy-authorization','message','noColor','readBodyFromFile','color','file','Results\x20saved\x20to\x20','x-trino-user','status','authorization','Invalid\x20header\x20format:\x20\x22','llm-proxy','type','296557FWousy','2518182JmKYqs','.\x20Valid\x20types:\x20','join','cas','Cannot\x20use\x20both\x20--data\x20and\x20--file\x20options.\x20Choose\x20one.','\x0aStack\x20trace:\x0a','execute','11474032LhdSez','validate','site'];a7_0x46cf=function(){return _0x5df5ee;};return a7_0x46cf();}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([a7_0x341c00(0x1ad),a7_0x341c00(0x1a4),a7_0x341c00(0x189),a7_0x341c00(0x1bd),a7_0x341c00(0x1c3),a7_0x341c00(0x197),a7_0x341c00(0x1a0),a7_0x341c00(0x1ab)]);function isSensitiveHeader(_0x1356a3){const _0x4580c1=a7_0x341c00;return SENSITIVE_HEADERS[_0x4580c1(0x18a)](_0x1356a3[_0x4580c1(0x1c1)]());}function parseHeader(_0x44ff6a){const _0x4932da=a7_0x341c00,_0x33bd0c=_0x44ff6a['indexOf'](':');if(_0x33bd0c===-0x1)throw new Error(_0x4932da(0x1ae)+_0x44ff6a+'\x22.\x20'+_0x4932da(0x1be));const _0x1baf0f=_0x44ff6a['substring'](0x0,_0x33bd0c)[_0x4932da(0x198)](),_0x37ea0c=_0x44ff6a[_0x4932da(0x1c8)](_0x33bd0c+0x1)['trim']();if(!_0x1baf0f)throw new Error(_0x4932da(0x19f)+_0x44ff6a+'\x22');return[_0x1baf0f,_0x37ea0c];}export class ApiCommand extends BaseCommand{[a7_0x341c00(0x194)]=a7_0x341c00(0x19b);['description']='Make\x20raw\x20HTTP\x20requests\x20to\x20TD\x20APIs';[a7_0x341c00(0x1ba)](_0x50fbe7){const _0x120dc1=a7_0x341c00,{args:_0x1efa30,options:_0x2f1352}=_0x50fbe7,_0x2215e9=_0x2f1352;if(_0x1efa30[_0x120dc1(0x1c4)]===0x0)return _0x120dc1(0x192);const _0xf4f0b9=_0x1efa30[0x0];if(!_0xf4f0b9['startsWith']('/'))return'Endpoint\x20must\x20start\x20with\x20/:\x20'+_0xf4f0b9;const _0x12011a=_0x2215e9['data'],_0x12546e=_0x2215e9[_0x120dc1(0x1a9)];if(_0x12011a&&_0x12546e)return _0x120dc1(0x1b6);const _0x9c6453=_0x2215e9[_0x120dc1(0x1c7)]||'GET',_0x1272f3=[_0x120dc1(0x18e),'POST',_0x120dc1(0x1a2),_0x120dc1(0x19a),_0x120dc1(0x18d)];if(!_0x1272f3['includes'](_0x9c6453[_0x120dc1(0x191)]()))return _0x120dc1(0x199)+_0x9c6453+'.\x20Valid\x20methods:\x20'+_0x1272f3[_0x120dc1(0x1b4)](',\x20');const _0x3be0c2=_0x2215e9['type']||'td',_0x172f85=['td',_0x120dc1(0x193),_0x120dc1(0x1c0),'trino','llm',_0x120dc1(0x1af),_0x120dc1(0x1b5)];if(!_0x172f85[_0x120dc1(0x18b)](_0x3be0c2))return'Invalid\x20API\x20type:\x20'+_0x3be0c2+_0x120dc1(0x1b3)+_0x172f85['join'](',\x20');return undefined;}async[a7_0x341c00(0x1b8)](_0x274928){const _0x4d774a=a7_0x341c00,{options:_0x40d4ce,args:_0x317d02,tdx:_0x11b39c}=_0x274928,_0x1d08f2=_0x40d4ce,_0x524af5=_0x317d02[0x0],_0x21e2e3=(_0x1d08f2[_0x4d774a(0x1c7)]||_0x4d774a(0x18e))[_0x4d774a(0x191)](),_0x8ebec=_0x1d08f2[_0x4d774a(0x1a1)],_0x2c8e0a=_0x1d08f2[_0x4d774a(0x1a9)],_0x5ea09a=_0x1d08f2[_0x4d774a(0x1bf)],_0x1ec29b=_0x1d08f2[_0x4d774a(0x1b0)]||'td';try{const _0x1af3a3={};if(_0x5ea09a){const _0x3331af=Array[_0x4d774a(0x187)](_0x5ea09a)?_0x5ea09a:[_0x5ea09a];for(const _0x3a0f7d of _0x3331af){const [_0x5f305f,_0x2cbdbd]=parseHeader(_0x3a0f7d);_0x1af3a3[_0x5f305f]=_0x2cbdbd;}}let _0x27ef08;if(_0x8ebec)_0x27ef08=_0x8ebec;else{if(_0x2c8e0a)try{_0x27ef08=RawAPI[_0x4d774a(0x1a7)](_0x2c8e0a);}catch(_0x630057){return console[_0x4d774a(0x18f)](_0x4d774a(0x1bc)+(_0x630057 instanceof Error?_0x630057['message']:String(_0x630057))),0x1;}}const _0x4179d8={'method':_0x21e2e3,'apiType':_0x1ec29b,'includeHeaders':_0x40d4ce[_0x4d774a(0x190)]};_0x27ef08&&(_0x4179d8[_0x4d774a(0x1a3)]=_0x27ef08);Object['keys'](_0x1af3a3)[_0x4d774a(0x1c4)]>0x0&&(_0x4179d8[_0x4d774a(0x1c6)]=_0x1af3a3);if(_0x40d4ce[_0x4d774a(0x190)]){const _0x3cd915=resolveSite(_0x40d4ce[_0x4d774a(0x1bb)]??_0x4d774a(0x188)),_0x3be765=getEndpoint(_0x3cd915,_0x1ec29b),_0x91bf6c=''+_0x3be765+_0x524af5;console[_0x4d774a(0x18f)]('>\x20'+_0x21e2e3+'\x20'+_0x91bf6c);const _0x26be68=getAuthHeaders(_0x3cd915),_0xf5d39c={..._0x26be68,..._0x1af3a3};for(const [_0x265ea8,_0x2171e7]of Object['entries'](_0xf5d39c)){!isSensitiveHeader(_0x265ea8)&&console['error']('>\x20'+_0x265ea8+':\x20'+_0x2171e7);}_0x27ef08&&console[_0x4d774a(0x18f)]('>'),console[_0x4d774a(0x18f)]('');}const _0x55b0b2=await _0x11b39c[_0x4d774a(0x19b)][_0x4d774a(0x19e)](_0x524af5,_0x4179d8);if(_0x40d4ce[_0x4d774a(0x190)]&&_0x55b0b2[_0x4d774a(0x1c6)]){console[_0x4d774a(0x18f)]('<\x20HTTP/1.1\x20'+_0x55b0b2[_0x4d774a(0x1ac)]);for(const [_0x4e818c,_0x120e6b]of Object['entries'](_0x55b0b2[_0x4d774a(0x1c6)])){!isSensitiveHeader(_0x4e818c)&&console[_0x4d774a(0x18f)]('<\x20'+_0x4e818c+':\x20'+_0x120e6b);}console[_0x4d774a(0x18f)]('');}const _0x255c59=Boolean(_0x40d4ce[_0x4d774a(0x186)]),_0x4ba211={'color':_0x40d4ce[_0x4d774a(0x1a8)],'noColor':_0x40d4ce[_0x4d774a(0x1a6)]||_0x255c59&&!_0x40d4ce[_0x4d774a(0x1a8)]},_0x4c4113=colorizeJSON(_0x55b0b2[_0x4d774a(0x1a1)],_0x4ba211);return _0x40d4ce[_0x4d774a(0x186)]?(writeFileSync(_0x40d4ce['output'],_0x4c4113),console[_0x4d774a(0x18f)](_0x4d774a(0x1aa)+_0x40d4ce[_0x4d774a(0x186)])):console[_0x4d774a(0x195)](_0x4c4113),0x0;}catch(_0x1a5792){return _0x1a5792 instanceof Error?(console[_0x4d774a(0x18f)](_0x4d774a(0x1bc)+_0x1a5792[_0x4d774a(0x1a5)]),_0x40d4ce[_0x4d774a(0x190)]&&_0x1a5792[_0x4d774a(0x1c5)]&&console['error'](_0x4d774a(0x1b7)+_0x1a5792[_0x4d774a(0x1c5)])):console[_0x4d774a(0x18f)](_0x4d774a(0x1bc)+String(_0x1a5792)),0x1;}}}
|