"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.JAVASCRIPT_NODE_AGENT_CONFIG = void 0;
const constants_1 = require("../../lib/constants");
const package_json_1 = require("../../utils/package-json");
const package_json_light_1 = require("../../utils/package-json-light");
const package_manager_detection_light_1 = require("../../lib/package-manager-detection-light");
const utils_1 = require("../javascript-web/utils");
exports.JAVASCRIPT_NODE_AGENT_CONFIG = {
    metadata: {
        name: 'Node.js',
        glyph: '🟩',
        glyphColor: '#5FA04E',
        integration: constants_1.Integration.javascriptNode,
        beta: true,
        docsUrl: 'https://amplitude.com/docs/sdks/analytics/browser/browser-sdk-2',
    },
    detection: {
        packageName: '@amplitude/analytics-node',
        packageDisplayName: 'Node.js',
        usesPackageJson: false,
        getVersion: () => undefined,
        detectPackageManager: package_manager_detection_light_1.detectNodePackageManagersLight,
        detect: async (options) => {
            const packageJson = await (0, package_json_light_1.tryGetPackageJson)(options);
            if (!packageJson)
                return false;
            // Don't claim projects that belong to a specific framework
            for (const frameworkPkg of utils_1.FRAMEWORK_PACKAGES) {
                if ((0, package_json_1.hasPackageInstalled)(frameworkPkg, packageJson)) {
                    return false;
                }
            }
            return true;
        },
    },
    environment: {
        uploadToHosting: false,
        getEnvVars: (apiKey, _host) => ({
            AMPLITUDE_API_KEY: apiKey,
        }),
    },
    analytics: {
        getTags: () => ({}),
    },
    prompts: {
        projectTypeDetection: 'This is a server-side Node.js project. Look for package.json and lockfiles to confirm.',
        packageInstallation: 'Use npm, yarn, pnpm, or bun based on the existing lockfile (package-lock.json, yarn.lock, pnpm-lock.yaml, bun.lockb). Install @amplitude/analytics-node as a regular dependency.',
        getAdditionalContextLines: () => [
            `Framework docs ID: javascript_node (use amplitude://docs/frameworks/javascript_node for documentation)`,
        ],
    },
    ui: {
        successMessage: 'Amplitude integration complete',
        estimatedDurationMinutes: 5,
        getOutroChanges: () => [
            `Analyzed your Node.js project structure`,
            `Installed the @amplitude/analytics-node package`,
            `Created Amplitude initialization with proper configuration`,
            `Added example code for events and user identification`,
        ],
        getOutroNextSteps: () => [
            'Use the Amplitude client instance for all tracking calls',
            'NEVER send PII in event properties (no emails, names, or user content)',
            'Use amplitude.track() for events and amplitude.identify() for users',
            'Visit your Amplitude dashboard to see incoming events',
        ],
    },
};
