@amplitude/wizard 1.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +47 -0
- package/README.md +119 -0
- package/dist/bin.d.ts +2 -0
- package/dist/bin.js +763 -0
- package/dist/package.json +144 -0
- package/dist/src/frameworks/android/android-wizard-agent.d.ts +6 -0
- package/dist/src/frameworks/android/android-wizard-agent.js +72 -0
- package/dist/src/frameworks/android/utils.d.ts +11 -0
- package/dist/src/frameworks/android/utils.js +32 -0
- package/dist/src/frameworks/django/django-wizard-agent.d.ts +8 -0
- package/dist/src/frameworks/django/django-wizard-agent.js +171 -0
- package/dist/src/frameworks/django/utils.d.ts +31 -0
- package/dist/src/frameworks/django/utils.js +305 -0
- package/dist/src/frameworks/fastapi/fastapi-wizard-agent.d.ts +11 -0
- package/dist/src/frameworks/fastapi/fastapi-wizard-agent.js +189 -0
- package/dist/src/frameworks/fastapi/utils.d.ts +26 -0
- package/dist/src/frameworks/fastapi/utils.js +257 -0
- package/dist/src/frameworks/flask/flask-wizard-agent.d.ts +8 -0
- package/dist/src/frameworks/flask/flask-wizard-agent.js +177 -0
- package/dist/src/frameworks/flask/utils.d.ts +28 -0
- package/dist/src/frameworks/flask/utils.js +343 -0
- package/dist/src/frameworks/flutter/flutter-wizard-agent.d.ts +4 -0
- package/dist/src/frameworks/flutter/flutter-wizard-agent.js +57 -0
- package/dist/src/frameworks/flutter/utils.d.ts +7 -0
- package/dist/src/frameworks/flutter/utils.js +64 -0
- package/dist/src/frameworks/generic/generic-wizard-agent.d.ts +2 -0
- package/dist/src/frameworks/generic/generic-wizard-agent.js +176 -0
- package/dist/src/frameworks/go/go-wizard-agent.d.ts +4 -0
- package/dist/src/frameworks/go/go-wizard-agent.js +57 -0
- package/dist/src/frameworks/go/utils.d.ts +5 -0
- package/dist/src/frameworks/go/utils.js +44 -0
- package/dist/src/frameworks/java/java-wizard-agent.d.ts +7 -0
- package/dist/src/frameworks/java/java-wizard-agent.js +73 -0
- package/dist/src/frameworks/java/utils.d.ts +15 -0
- package/dist/src/frameworks/java/utils.js +64 -0
- package/dist/src/frameworks/javascript-node/javascript-node-wizard-agent.d.ts +4 -0
- package/dist/src/frameworks/javascript-node/javascript-node-wizard-agent.js +57 -0
- package/dist/src/frameworks/javascript-web/javascript-web-wizard-agent.d.ts +3 -0
- package/dist/src/frameworks/javascript-web/javascript-web-wizard-agent.js +151 -0
- package/dist/src/frameworks/javascript-web/utils.d.ts +28 -0
- package/dist/src/frameworks/javascript-web/utils.js +153 -0
- package/dist/src/frameworks/nextjs/nextjs-wizard-agent.d.ts +7 -0
- package/dist/src/frameworks/nextjs/nextjs-wizard-agent.js +98 -0
- package/dist/src/frameworks/nextjs/utils.d.ts +12 -0
- package/dist/src/frameworks/nextjs/utils.js +51 -0
- package/dist/src/frameworks/python/python-wizard-agent.d.ts +7 -0
- package/dist/src/frameworks/python/python-wizard-agent.js +193 -0
- package/dist/src/frameworks/python/utils.d.ts +28 -0
- package/dist/src/frameworks/python/utils.js +146 -0
- package/dist/src/frameworks/react-native/react-native-wizard-agent.d.ts +6 -0
- package/dist/src/frameworks/react-native/react-native-wizard-agent.js +84 -0
- package/dist/src/frameworks/react-native/utils.d.ts +21 -0
- package/dist/src/frameworks/react-native/utils.js +82 -0
- package/dist/src/frameworks/react-router/react-router-wizard-agent.d.ts +7 -0
- package/dist/src/frameworks/react-router/react-router-wizard-agent.js +98 -0
- package/dist/src/frameworks/react-router/utils.d.ts +13 -0
- package/dist/src/frameworks/react-router/utils.js +160 -0
- package/dist/src/frameworks/swift/swift-wizard-agent.d.ts +7 -0
- package/dist/src/frameworks/swift/swift-wizard-agent.js +72 -0
- package/dist/src/frameworks/swift/utils.d.ts +12 -0
- package/dist/src/frameworks/swift/utils.js +82 -0
- package/dist/src/frameworks/unity/unity-wizard-agent.d.ts +6 -0
- package/dist/src/frameworks/unity/unity-wizard-agent.js +79 -0
- package/dist/src/frameworks/unity/utils.d.ts +12 -0
- package/dist/src/frameworks/unity/utils.js +66 -0
- package/dist/src/frameworks/unreal/unreal-wizard-agent.d.ts +6 -0
- package/dist/src/frameworks/unreal/unreal-wizard-agent.js +77 -0
- package/dist/src/frameworks/unreal/utils.d.ts +10 -0
- package/dist/src/frameworks/unreal/utils.js +29 -0
- package/dist/src/frameworks/vue/vue-wizard-agent.d.ts +4 -0
- package/dist/src/frameworks/vue/vue-wizard-agent.js +64 -0
- package/dist/src/lib/agent-hooks.d.ts +26 -0
- package/dist/src/lib/agent-hooks.js +118 -0
- package/dist/src/lib/agent-interface.d.ts +175 -0
- package/dist/src/lib/agent-interface.js +1217 -0
- package/dist/src/lib/agent-runner.d.ts +9 -0
- package/dist/src/lib/agent-runner.js +415 -0
- package/dist/src/lib/ampli-config.d.ts +105 -0
- package/dist/src/lib/ampli-config.js +178 -0
- package/dist/src/lib/api.d.ts +107 -0
- package/dist/src/lib/api.js +442 -0
- package/dist/src/lib/commandments.d.ts +1 -0
- package/dist/src/lib/commandments.js +24 -0
- package/dist/src/lib/console-query.d.ts +27 -0
- package/dist/src/lib/console-query.js +121 -0
- package/dist/src/lib/constants.d.ts +124 -0
- package/dist/src/lib/constants.js +170 -0
- package/dist/src/lib/detect-amplitude.d.ts +31 -0
- package/dist/src/lib/detect-amplitude.js +407 -0
- package/dist/src/lib/framework-config.d.ts +188 -0
- package/dist/src/lib/framework-config.js +21 -0
- package/dist/src/lib/health-checks/endpoints.d.ts +3 -0
- package/dist/src/lib/health-checks/endpoints.js +45 -0
- package/dist/src/lib/health-checks/index.d.ts +4 -0
- package/dist/src/lib/health-checks/index.js +22 -0
- package/dist/src/lib/health-checks/readiness.d.ts +24 -0
- package/dist/src/lib/health-checks/readiness.js +118 -0
- package/dist/src/lib/health-checks/statuspage.d.ts +9 -0
- package/dist/src/lib/health-checks/statuspage.js +104 -0
- package/dist/src/lib/health-checks/types.d.ts +31 -0
- package/dist/src/lib/health-checks/types.js +9 -0
- package/dist/src/lib/helper-functions.d.ts +1 -0
- package/dist/src/lib/helper-functions.js +5 -0
- package/dist/src/lib/middleware/benchmark.d.ts +54 -0
- package/dist/src/lib/middleware/benchmark.js +48 -0
- package/dist/src/lib/middleware/benchmarks/cache-tracker.d.ts +44 -0
- package/dist/src/lib/middleware/benchmarks/cache-tracker.js +80 -0
- package/dist/src/lib/middleware/benchmarks/compaction-tracker.d.ts +29 -0
- package/dist/src/lib/middleware/benchmarks/compaction-tracker.js +59 -0
- package/dist/src/lib/middleware/benchmarks/context-size-tracker.d.ts +26 -0
- package/dist/src/lib/middleware/benchmarks/context-size-tracker.js +55 -0
- package/dist/src/lib/middleware/benchmarks/cost-tracker.d.ts +16 -0
- package/dist/src/lib/middleware/benchmarks/cost-tracker.js +75 -0
- package/dist/src/lib/middleware/benchmarks/duration-tracker.d.ts +20 -0
- package/dist/src/lib/middleware/benchmarks/duration-tracker.js +39 -0
- package/dist/src/lib/middleware/benchmarks/index.d.ts +9 -0
- package/dist/src/lib/middleware/benchmarks/index.js +67 -0
- package/dist/src/lib/middleware/benchmarks/json-writer.d.ts +15 -0
- package/dist/src/lib/middleware/benchmarks/json-writer.js +144 -0
- package/dist/src/lib/middleware/benchmarks/summary.d.ts +9 -0
- package/dist/src/lib/middleware/benchmarks/summary.js +105 -0
- package/dist/src/lib/middleware/benchmarks/token-tracker.d.ts +40 -0
- package/dist/src/lib/middleware/benchmarks/token-tracker.js +76 -0
- package/dist/src/lib/middleware/benchmarks/turn-counter.d.ts +34 -0
- package/dist/src/lib/middleware/benchmarks/turn-counter.js +58 -0
- package/dist/src/lib/middleware/config.d.ts +24 -0
- package/dist/src/lib/middleware/config.js +96 -0
- package/dist/src/lib/middleware/index.d.ts +11 -0
- package/dist/src/lib/middleware/index.js +17 -0
- package/dist/src/lib/middleware/phase-detector.d.ts +8 -0
- package/dist/src/lib/middleware/phase-detector.js +63 -0
- package/dist/src/lib/middleware/pipeline.d.ts +29 -0
- package/dist/src/lib/middleware/pipeline.js +81 -0
- package/dist/src/lib/middleware/schemas.d.ts +27 -0
- package/dist/src/lib/middleware/schemas.js +84 -0
- package/dist/src/lib/middleware/types.d.ts +94 -0
- package/dist/src/lib/middleware/types.js +8 -0
- package/dist/src/lib/package-manager-detection.d.ts +42 -0
- package/dist/src/lib/package-manager-detection.js +292 -0
- package/dist/src/lib/registry.d.ts +3 -0
- package/dist/src/lib/registry.js +42 -0
- package/dist/src/lib/safe-tools.d.ts +2 -0
- package/dist/src/lib/safe-tools.js +214 -0
- package/dist/src/lib/wizard-session.d.ts +220 -0
- package/dist/src/lib/wizard-session.js +127 -0
- package/dist/src/lib/wizard-tools.d.ts +82 -0
- package/dist/src/lib/wizard-tools.js +499 -0
- package/dist/src/run.d.ts +19 -0
- package/dist/src/run.js +151 -0
- package/dist/src/steps/add-mcp-server-to-clients/MCPClient.d.ts +30 -0
- package/dist/src/steps/add-mcp-server-to-clients/MCPClient.js +141 -0
- package/dist/src/steps/add-mcp-server-to-clients/clients/claude-code.d.ts +29 -0
- package/dist/src/steps/add-mcp-server-to-clients/clients/claude-code.js +180 -0
- package/dist/src/steps/add-mcp-server-to-clients/clients/claude.d.ts +20 -0
- package/dist/src/steps/add-mcp-server-to-clients/clients/claude.js +63 -0
- package/dist/src/steps/add-mcp-server-to-clients/clients/codex.d.ts +28 -0
- package/dist/src/steps/add-mcp-server-to-clients/clients/codex.js +77 -0
- package/dist/src/steps/add-mcp-server-to-clients/clients/cursor.d.ts +24 -0
- package/dist/src/steps/add-mcp-server-to-clients/clients/cursor.js +60 -0
- package/dist/src/steps/add-mcp-server-to-clients/clients/visual-studio-code.d.ts +27 -0
- package/dist/src/steps/add-mcp-server-to-clients/clients/visual-studio-code.js +101 -0
- package/dist/src/steps/add-mcp-server-to-clients/clients/zed.d.ts +26 -0
- package/dist/src/steps/add-mcp-server-to-clients/clients/zed.js +102 -0
- package/dist/src/steps/add-mcp-server-to-clients/defaults.d.ts +44 -0
- package/dist/src/steps/add-mcp-server-to-clients/defaults.js +123 -0
- package/dist/src/steps/add-mcp-server-to-clients/index.d.ts +19 -0
- package/dist/src/steps/add-mcp-server-to-clients/index.js +110 -0
- package/dist/src/steps/add-or-update-environment-variables.d.ts +10 -0
- package/dist/src/steps/add-or-update-environment-variables.js +188 -0
- package/dist/src/steps/index.d.ts +4 -0
- package/dist/src/steps/index.js +20 -0
- package/dist/src/steps/run-prettier.d.ts +5 -0
- package/dist/src/steps/run-prettier.js +90 -0
- package/dist/src/steps/upload-environment-variables/EnvironmentProvider.d.ts +11 -0
- package/dist/src/steps/upload-environment-variables/EnvironmentProvider.js +11 -0
- package/dist/src/steps/upload-environment-variables/index.d.ts +6 -0
- package/dist/src/steps/upload-environment-variables/index.js +37 -0
- package/dist/src/steps/upload-environment-variables/providers/vercel.d.ts +15 -0
- package/dist/src/steps/upload-environment-variables/providers/vercel.js +145 -0
- package/dist/src/telemetry.d.ts +2 -0
- package/dist/src/telemetry.js +12 -0
- package/dist/src/ui/index.d.ts +8 -0
- package/dist/src/ui/index.js +16 -0
- package/dist/src/ui/logging-ui.d.ts +56 -0
- package/dist/src/ui/logging-ui.js +157 -0
- package/dist/src/ui/tui/App.d.ts +6 -0
- package/dist/src/ui/tui/App.js +34 -0
- package/dist/src/ui/tui/components/AmplitudeLogo.d.ts +5 -0
- package/dist/src/ui/tui/components/AmplitudeLogo.js +81 -0
- package/dist/src/ui/tui/components/AmplitudeTextLogo.d.ts +3 -0
- package/dist/src/ui/tui/components/AmplitudeTextLogo.js +31 -0
- package/dist/src/ui/tui/components/ConsoleView.d.ts +23 -0
- package/dist/src/ui/tui/components/ConsoleView.js +220 -0
- package/dist/src/ui/tui/components/TitleBar.d.ts +6 -0
- package/dist/src/ui/tui/components/TitleBar.js +16 -0
- package/dist/src/ui/tui/console-commands.d.ts +16 -0
- package/dist/src/ui/tui/console-commands.js +31 -0
- package/dist/src/ui/tui/context/CommandModeContext.d.ts +2 -0
- package/dist/src/ui/tui/context/CommandModeContext.js +3 -0
- package/dist/src/ui/tui/flows.d.ts +48 -0
- package/dist/src/ui/tui/flows.js +154 -0
- package/dist/src/ui/tui/hooks/useScreenInput.d.ts +13 -0
- package/dist/src/ui/tui/hooks/useScreenInput.js +18 -0
- package/dist/src/ui/tui/hooks/useStdoutDimensions.d.ts +9 -0
- package/dist/src/ui/tui/hooks/useStdoutDimensions.js +29 -0
- package/dist/src/ui/tui/ink-ui.d.ts +62 -0
- package/dist/src/ui/tui/ink-ui.js +142 -0
- package/dist/src/ui/tui/primitives/CardLayout.d.ts +12 -0
- package/dist/src/ui/tui/primitives/CardLayout.js +9 -0
- package/dist/src/ui/tui/primitives/ConfirmationInput.d.ts +13 -0
- package/dist/src/ui/tui/primitives/ConfirmationInput.js +35 -0
- package/dist/src/ui/tui/primitives/DissolveTransition.d.ts +21 -0
- package/dist/src/ui/tui/primitives/DissolveTransition.js +143 -0
- package/dist/src/ui/tui/primitives/EventPlanViewer.d.ts +9 -0
- package/dist/src/ui/tui/primitives/EventPlanViewer.js +9 -0
- package/dist/src/ui/tui/primitives/KagiSmallWebViewer.d.ts +7 -0
- package/dist/src/ui/tui/primitives/KagiSmallWebViewer.js +101 -0
- package/dist/src/ui/tui/primitives/LoadingBox.d.ts +8 -0
- package/dist/src/ui/tui/primitives/LoadingBox.js +9 -0
- package/dist/src/ui/tui/primitives/LogViewer.d.ts +11 -0
- package/dist/src/ui/tui/primitives/LogViewer.js +55 -0
- package/dist/src/ui/tui/primitives/PickerMenu.d.ts +20 -0
- package/dist/src/ui/tui/primitives/PickerMenu.js +212 -0
- package/dist/src/ui/tui/primitives/ProgressList.d.ts +15 -0
- package/dist/src/ui/tui/primitives/ProgressList.js +29 -0
- package/dist/src/ui/tui/primitives/PromptLabel.d.ts +11 -0
- package/dist/src/ui/tui/primitives/PromptLabel.js +12 -0
- package/dist/src/ui/tui/primitives/ReportViewer.d.ts +12 -0
- package/dist/src/ui/tui/primitives/ReportViewer.js +99 -0
- package/dist/src/ui/tui/primitives/ScreenErrorBoundary.d.ts +26 -0
- package/dist/src/ui/tui/primitives/ScreenErrorBoundary.js +29 -0
- package/dist/src/ui/tui/primitives/SlashCommandInput.d.ts +21 -0
- package/dist/src/ui/tui/primitives/SlashCommandInput.js +85 -0
- package/dist/src/ui/tui/primitives/SnakeGame.d.ts +1 -0
- package/dist/src/ui/tui/primitives/SnakeGame.js +1 -0
- package/dist/src/ui/tui/primitives/SplitView.d.ts +11 -0
- package/dist/src/ui/tui/primitives/SplitView.js +8 -0
- package/dist/src/ui/tui/primitives/TabContainer.d.ts +18 -0
- package/dist/src/ui/tui/primitives/TabContainer.js +30 -0
- package/dist/src/ui/tui/primitives/index.d.ts +23 -0
- package/dist/src/ui/tui/primitives/index.js +19 -0
- package/dist/src/ui/tui/router.d.ts +61 -0
- package/dist/src/ui/tui/router.js +104 -0
- package/dist/src/ui/tui/screen-registry.d.ts +19 -0
- package/dist/src/ui/tui/screen-registry.js +56 -0
- package/dist/src/ui/tui/screens/ActivationOptionsScreen.d.ts +12 -0
- package/dist/src/ui/tui/screens/ActivationOptionsScreen.js +57 -0
- package/dist/src/ui/tui/screens/AuthScreen.d.ts +18 -0
- package/dist/src/ui/tui/screens/AuthScreen.js +107 -0
- package/dist/src/ui/tui/screens/ChecklistScreen.d.ts +22 -0
- package/dist/src/ui/tui/screens/ChecklistScreen.js +122 -0
- package/dist/src/ui/tui/screens/DataIngestionCheckScreen.d.ts +24 -0
- package/dist/src/ui/tui/screens/DataIngestionCheckScreen.js +113 -0
- package/dist/src/ui/tui/screens/DataSetupScreen.d.ts +17 -0
- package/dist/src/ui/tui/screens/DataSetupScreen.js +73 -0
- package/dist/src/ui/tui/screens/IntroScreen.d.ts +16 -0
- package/dist/src/ui/tui/screens/IntroScreen.js +86 -0
- package/dist/src/ui/tui/screens/LoginScreen.d.ts +15 -0
- package/dist/src/ui/tui/screens/LoginScreen.js +65 -0
- package/dist/src/ui/tui/screens/LogoutScreen.d.ts +12 -0
- package/dist/src/ui/tui/screens/LogoutScreen.js +28 -0
- package/dist/src/ui/tui/screens/McpScreen.d.ts +26 -0
- package/dist/src/ui/tui/screens/McpScreen.js +148 -0
- package/dist/src/ui/tui/screens/OutageScreen.d.ts +10 -0
- package/dist/src/ui/tui/screens/OutageScreen.js +17 -0
- package/dist/src/ui/tui/screens/OutroScreen.d.ts +11 -0
- package/dist/src/ui/tui/screens/OutroScreen.js +69 -0
- package/dist/src/ui/tui/screens/RegionSelectScreen.d.ts +17 -0
- package/dist/src/ui/tui/screens/RegionSelectScreen.js +40 -0
- package/dist/src/ui/tui/screens/RunScreen.d.ts +16 -0
- package/dist/src/ui/tui/screens/RunScreen.js +212 -0
- package/dist/src/ui/tui/screens/SettingsOverrideScreen.d.ts +10 -0
- package/dist/src/ui/tui/screens/SettingsOverrideScreen.js +23 -0
- package/dist/src/ui/tui/screens/SetupScreen.d.ts +13 -0
- package/dist/src/ui/tui/screens/SetupScreen.js +73 -0
- package/dist/src/ui/tui/screens/SlackScreen.d.ts +25 -0
- package/dist/src/ui/tui/screens/SlackScreen.js +97 -0
- package/dist/src/ui/tui/services/mcp-installer.d.ts +25 -0
- package/dist/src/ui/tui/services/mcp-installer.js +82 -0
- package/dist/src/ui/tui/start-tui.d.ts +10 -0
- package/dist/src/ui/tui/start-tui.js +50 -0
- package/dist/src/ui/tui/store.d.ts +231 -0
- package/dist/src/ui/tui/store.js +568 -0
- package/dist/src/ui/tui/styles.d.ts +31 -0
- package/dist/src/ui/tui/styles.js +33 -0
- package/dist/src/ui/wizard-ui.d.ts +110 -0
- package/dist/src/ui/wizard-ui.js +18 -0
- package/dist/src/utils/ampli-settings.d.ts +37 -0
- package/dist/src/utils/ampli-settings.js +182 -0
- package/dist/src/utils/analytics.d.ts +35 -0
- package/dist/src/utils/analytics.js +133 -0
- package/dist/src/utils/anthropic-status.d.ts +17 -0
- package/dist/src/utils/anthropic-status.js +51 -0
- package/dist/src/utils/api-key-store.d.ts +35 -0
- package/dist/src/utils/api-key-store.js +176 -0
- package/dist/src/utils/bash.d.ts +2 -0
- package/dist/src/utils/bash.js +53 -0
- package/dist/src/utils/custom-headers.d.ts +9 -0
- package/dist/src/utils/custom-headers.js +23 -0
- package/dist/src/utils/debug.d.ts +23 -0
- package/dist/src/utils/debug.js +86 -0
- package/dist/src/utils/environment.d.ts +4 -0
- package/dist/src/utils/environment.js +76 -0
- package/dist/src/utils/file-utils.d.ts +2 -0
- package/dist/src/utils/file-utils.js +16 -0
- package/dist/src/utils/get-api-key.d.ts +17 -0
- package/dist/src/utils/get-api-key.js +50 -0
- package/dist/src/utils/logging.d.ts +9 -0
- package/dist/src/utils/logging.js +48 -0
- package/dist/src/utils/oauth.d.ts +53 -0
- package/dist/src/utils/oauth.js +354 -0
- package/dist/src/utils/package-json.d.ts +25 -0
- package/dist/src/utils/package-json.js +26 -0
- package/dist/src/utils/package-manager.d.ts +21 -0
- package/dist/src/utils/package-manager.js +208 -0
- package/dist/src/utils/semver.d.ts +21 -0
- package/dist/src/utils/semver.js +61 -0
- package/dist/src/utils/setup-utils.d.ts +82 -0
- package/dist/src/utils/setup-utils.js +467 -0
- package/dist/src/utils/shell-completions.d.ts +10 -0
- package/dist/src/utils/shell-completions.js +199 -0
- package/dist/src/utils/string.d.ts +1 -0
- package/dist/src/utils/string.js +8 -0
- package/dist/src/utils/types.d.ts +72 -0
- package/dist/src/utils/types.js +2 -0
- package/dist/src/utils/urls.d.ts +14 -0
- package/dist/src/utils/urls.js +69 -0
- package/dist/src/utils/vendor/is-unicorn-supported.d.ts +1 -0
- package/dist/src/utils/vendor/is-unicorn-supported.js +23 -0
- package/dist/src/utils/wizard-abort.d.ts +13 -0
- package/dist/src/utils/wizard-abort.js +56 -0
- package/man/amplitude-wizard.1 +170 -0
- package/package.json +144 -0
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.BASH_COMPLETION_SCRIPT = exports.ZSH_COMPLETION_SCRIPT = void 0;
|
|
37
|
+
exports.detectShell = detectShell;
|
|
38
|
+
exports.installCompletions = installCompletions;
|
|
39
|
+
const fs = __importStar(require("node:fs"));
|
|
40
|
+
const os = __importStar(require("node:os"));
|
|
41
|
+
const path = __importStar(require("node:path"));
|
|
42
|
+
const EVAL_LINE = `eval "$(amplitude-wizard completion)"`;
|
|
43
|
+
/** Substring used to detect whether the eval line is already present. */
|
|
44
|
+
const MARKER = 'amplitude-wizard completion';
|
|
45
|
+
function detectShell() {
|
|
46
|
+
const shell = process.env.SHELL ?? '';
|
|
47
|
+
if (shell.endsWith('zsh'))
|
|
48
|
+
return 'zsh';
|
|
49
|
+
if (shell.endsWith('bash'))
|
|
50
|
+
return 'bash';
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
function getRcFile(shell) {
|
|
54
|
+
const home = os.homedir();
|
|
55
|
+
if (shell === 'zsh')
|
|
56
|
+
return path.join(home, '.zshrc');
|
|
57
|
+
// On macOS bash sessions are login shells; prefer .bash_profile if present.
|
|
58
|
+
const bashProfile = path.join(home, '.bash_profile');
|
|
59
|
+
if (fs.existsSync(bashProfile))
|
|
60
|
+
return bashProfile;
|
|
61
|
+
return path.join(home, '.bashrc');
|
|
62
|
+
}
|
|
63
|
+
// Inject shell variable syntax (${) without triggering TS template interpolation.
|
|
64
|
+
const DB = '${';
|
|
65
|
+
exports.ZSH_COMPLETION_SCRIPT = `###-begin-amplitude-wizard-completions-###
|
|
66
|
+
|
|
67
|
+
_amplitude_wizard() {
|
|
68
|
+
local state
|
|
69
|
+
local -a commands global_opts wizard_opts
|
|
70
|
+
|
|
71
|
+
commands=(
|
|
72
|
+
'login:Log in to your Amplitude account'
|
|
73
|
+
'logout:Log out of your Amplitude account'
|
|
74
|
+
'whoami:Show the currently logged-in Amplitude account'
|
|
75
|
+
'slack:Set up Amplitude Slack integration'
|
|
76
|
+
'mcp:MCP server management commands'
|
|
77
|
+
'completion:Print shell completion script'
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
global_opts=(
|
|
81
|
+
'--debug[Enable verbose logging]'
|
|
82
|
+
'--verbose[Print diagnostic info to the run log]'
|
|
83
|
+
'--signup[Create a new Amplitude account during setup]'
|
|
84
|
+
'--ci[Enable non-interactive CI mode]'
|
|
85
|
+
'--api-key[Amplitude project API key]:key:'
|
|
86
|
+
'--project-id[Amplitude project ID]:id:'
|
|
87
|
+
'--local-mcp[Use local MCP server at http://localhost:8787/mcp]'
|
|
88
|
+
{-h,--help}'[Show help]'
|
|
89
|
+
{-v,--version}'[Show version]'
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
wizard_opts=(
|
|
93
|
+
'--force-install[Force package install even if peer checks fail]'
|
|
94
|
+
'--install-dir[Directory to install Amplitude in]:dir:_files -/'
|
|
95
|
+
'--integration[Framework integration to set up]:integration:(nextjs vue react-router django flask fastapi javascript_web javascript_node python)'
|
|
96
|
+
'--menu[Show integration selection menu instead of auto-detecting]'
|
|
97
|
+
'--benchmark[Run in benchmark mode with per-phase token tracking]'
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
_arguments -C \\
|
|
101
|
+
'1: :->cmd' \\
|
|
102
|
+
'*:: :->args'
|
|
103
|
+
|
|
104
|
+
case $state in
|
|
105
|
+
cmd)
|
|
106
|
+
_describe 'command' commands
|
|
107
|
+
_arguments $global_opts $wizard_opts
|
|
108
|
+
;;
|
|
109
|
+
args)
|
|
110
|
+
case ${DB}words[1]} in
|
|
111
|
+
mcp)
|
|
112
|
+
local -a mcp_cmds
|
|
113
|
+
mcp_cmds=('add:Install Amplitude MCP server' 'remove:Remove Amplitude MCP server')
|
|
114
|
+
_arguments -C '1: :->sub' '*:: :->subargs'
|
|
115
|
+
case $state in
|
|
116
|
+
sub) _describe 'mcp command' mcp_cmds ;;
|
|
117
|
+
subargs) _arguments '--local[Use local MCP server at http://localhost:8787]' ;;
|
|
118
|
+
esac
|
|
119
|
+
;;
|
|
120
|
+
login)
|
|
121
|
+
_arguments '--zone[Amplitude data center zone]:zone:(us eu)'
|
|
122
|
+
;;
|
|
123
|
+
*)
|
|
124
|
+
_arguments $global_opts $wizard_opts
|
|
125
|
+
;;
|
|
126
|
+
esac
|
|
127
|
+
;;
|
|
128
|
+
esac
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
(( $+functions[compdef] )) || { autoload -Uz compinit; compinit; }
|
|
132
|
+
compdef _amplitude_wizard amplitude-wizard
|
|
133
|
+
###-end-amplitude-wizard-completions-###`;
|
|
134
|
+
exports.BASH_COMPLETION_SCRIPT = `###-begin-amplitude-wizard-completions-###
|
|
135
|
+
_amplitude_wizard_completions() {
|
|
136
|
+
local cur prev
|
|
137
|
+
cur="${DB}COMP_WORDS[COMP_CWORD]}"
|
|
138
|
+
prev="${DB}COMP_WORDS[COMP_CWORD-1]}"
|
|
139
|
+
|
|
140
|
+
local commands="login logout whoami slack mcp completion"
|
|
141
|
+
local global_flags="--debug --verbose --signup --ci --api-key --project-id --local-mcp --help --version"
|
|
142
|
+
local wizard_flags="--force-install --install-dir --integration --menu --benchmark"
|
|
143
|
+
local integrations="nextjs vue react-router django flask fastapi javascript_web javascript_node python"
|
|
144
|
+
|
|
145
|
+
if [[ ${DB}COMP_CWORD} -eq 1 ]]; then
|
|
146
|
+
COMPREPLY=($(compgen -W "$commands $global_flags $wizard_flags" -- "$cur"))
|
|
147
|
+
return
|
|
148
|
+
fi
|
|
149
|
+
|
|
150
|
+
case "${DB}COMP_WORDS[1]}" in
|
|
151
|
+
mcp)
|
|
152
|
+
if [[ ${DB}COMP_CWORD} -eq 2 ]]; then
|
|
153
|
+
COMPREPLY=($(compgen -W "add remove" -- "$cur"))
|
|
154
|
+
else
|
|
155
|
+
COMPREPLY=($(compgen -W "--local" -- "$cur"))
|
|
156
|
+
fi
|
|
157
|
+
;;
|
|
158
|
+
login)
|
|
159
|
+
if [[ "$prev" == "--zone" ]]; then
|
|
160
|
+
COMPREPLY=($(compgen -W "us eu" -- "$cur"))
|
|
161
|
+
else
|
|
162
|
+
COMPREPLY=($(compgen -W "--zone" -- "$cur"))
|
|
163
|
+
fi
|
|
164
|
+
;;
|
|
165
|
+
*)
|
|
166
|
+
if [[ "$prev" == "--integration" ]]; then
|
|
167
|
+
COMPREPLY=($(compgen -W "$integrations" -- "$cur"))
|
|
168
|
+
elif [[ "$prev" == "--install-dir" ]]; then
|
|
169
|
+
COMPREPLY=($(compgen -d -- "$cur"))
|
|
170
|
+
else
|
|
171
|
+
COMPREPLY=($(compgen -W "$global_flags $wizard_flags" -- "$cur"))
|
|
172
|
+
fi
|
|
173
|
+
;;
|
|
174
|
+
esac
|
|
175
|
+
}
|
|
176
|
+
complete -F _amplitude_wizard_completions amplitude-wizard
|
|
177
|
+
###-end-amplitude-wizard-completions-###`;
|
|
178
|
+
/**
|
|
179
|
+
* Silently appends `eval "$(amplitude-wizard completion)"` to the user's shell
|
|
180
|
+
* RC file if it isn't already there. Call fire-and-forget at startup.
|
|
181
|
+
*/
|
|
182
|
+
function installCompletions() {
|
|
183
|
+
try {
|
|
184
|
+
const shell = detectShell();
|
|
185
|
+
if (!shell)
|
|
186
|
+
return;
|
|
187
|
+
const rcFile = getRcFile(shell);
|
|
188
|
+
if (fs.existsSync(rcFile)) {
|
|
189
|
+
const contents = fs.readFileSync(rcFile, 'utf-8');
|
|
190
|
+
if (contents.includes(MARKER))
|
|
191
|
+
return; // already installed
|
|
192
|
+
}
|
|
193
|
+
const line = `\n# Amplitude Wizard shell completions\n${EVAL_LINE}\n`;
|
|
194
|
+
fs.appendFileSync(rcFile, line, 'utf-8');
|
|
195
|
+
}
|
|
196
|
+
catch {
|
|
197
|
+
// Never surface completion-install errors to the user.
|
|
198
|
+
}
|
|
199
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function stripAnsii(str: string): string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.stripAnsii = stripAnsii;
|
|
4
|
+
function stripAnsii(str) {
|
|
5
|
+
return str.replace(
|
|
6
|
+
// eslint-disable-next-line no-control-regex
|
|
7
|
+
/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, '');
|
|
8
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
export type AmplitudeProjectData = Record<string, unknown>;
|
|
2
|
+
export type PreselectedProject = {
|
|
3
|
+
project: AmplitudeProjectData;
|
|
4
|
+
authToken: string;
|
|
5
|
+
};
|
|
6
|
+
export type WizardOptions = {
|
|
7
|
+
/**
|
|
8
|
+
* Whether to enable debug mode.
|
|
9
|
+
*/
|
|
10
|
+
debug: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Whether to force install the SDK package to continue with the installation in case
|
|
13
|
+
* any package manager checks are failing (e.g. peer dependency versions).
|
|
14
|
+
*
|
|
15
|
+
* Use with caution and only if you know what you're doing.
|
|
16
|
+
*
|
|
17
|
+
* Does not apply to all wizard flows (currently NPM only)
|
|
18
|
+
*/
|
|
19
|
+
forceInstall: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* The directory to run the wizard in.
|
|
22
|
+
*/
|
|
23
|
+
installDir: string;
|
|
24
|
+
/**
|
|
25
|
+
* Whether to select the default option for all questions automatically.
|
|
26
|
+
*/
|
|
27
|
+
default: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Whether to create a new Amplitude account during setup.
|
|
30
|
+
*/
|
|
31
|
+
signup: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Whether to use the local MCP server at http://localhost:8787/mcp
|
|
34
|
+
*/
|
|
35
|
+
localMcp: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* CI mode - non-interactive execution
|
|
38
|
+
*/
|
|
39
|
+
ci: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Personal API key (phx_xxx) - used for LLM gateway auth, skips OAuth
|
|
42
|
+
*/
|
|
43
|
+
apiKey?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Amplitude project ID. When set (e.g. in CI with --project-id), the wizard uses this project
|
|
46
|
+
* instead of the default from the API key or OAuth.
|
|
47
|
+
*/
|
|
48
|
+
projectId?: number;
|
|
49
|
+
/**
|
|
50
|
+
* Whether to show the menu for manual integration selection instead of auto-detecting.
|
|
51
|
+
*/
|
|
52
|
+
menu: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Whether to run in benchmark mode with per-phase token tracking.
|
|
55
|
+
* When enabled, the wizard runs each workflow phase as a separate agent call
|
|
56
|
+
* and writes detailed usage data to /tmp/amplitude-wizard-benchmark.json.
|
|
57
|
+
*/
|
|
58
|
+
benchmark: boolean;
|
|
59
|
+
};
|
|
60
|
+
export interface Feature {
|
|
61
|
+
id: string;
|
|
62
|
+
prompt: string;
|
|
63
|
+
enabledHint?: string;
|
|
64
|
+
disabledHint?: string;
|
|
65
|
+
}
|
|
66
|
+
export type FileChange = {
|
|
67
|
+
filePath: string;
|
|
68
|
+
oldContent?: string;
|
|
69
|
+
newContent: string;
|
|
70
|
+
};
|
|
71
|
+
export type CloudRegion = 'us' | 'eu';
|
|
72
|
+
export type AIModel = 'gpt-5-mini' | 'o4-mini' | 'gemini-2.5-flash' | 'gemini-2.5-pro';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CloudRegion } from './types';
|
|
2
|
+
export declare const getHostFromRegion: (region: CloudRegion) => "http://localhost:8010" | "https://api2.amplitude.com" | "https://api.eu.amplitude.com";
|
|
3
|
+
export declare const getCloudUrlFromRegion: (region: CloudRegion) => "https://app.amplitude.com" | "https://eu.amplitude.com";
|
|
4
|
+
export declare function detectRegionFromToken(accessToken: string): Promise<CloudRegion>;
|
|
5
|
+
/**
|
|
6
|
+
* Get the LLM proxy URL for the Claude Agent SDK.
|
|
7
|
+
*
|
|
8
|
+
* Routes through the wizard-proxy-router in Thunder (javascript repo), which
|
|
9
|
+
* validates Amplitude OAuth tokens and proxies to GCP Vertex AI.
|
|
10
|
+
*
|
|
11
|
+
* Override with WIZARD_LLM_PROXY_URL env var for explicit URL override.
|
|
12
|
+
* The Claude Agent SDK uses this as ANTHROPIC_BASE_URL and appends /v1/messages.
|
|
13
|
+
*/
|
|
14
|
+
export declare const getLlmGatewayUrlFromHost: (host: string) => string;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getLlmGatewayUrlFromHost = exports.getCloudUrlFromRegion = exports.getHostFromRegion = void 0;
|
|
7
|
+
exports.detectRegionFromToken = detectRegionFromToken;
|
|
8
|
+
const axios_1 = __importDefault(require("axios"));
|
|
9
|
+
const constants_1 = require("../lib/constants");
|
|
10
|
+
const getHostFromRegion = (region) => {
|
|
11
|
+
if (constants_1.IS_DEV) {
|
|
12
|
+
return 'http://localhost:8010';
|
|
13
|
+
}
|
|
14
|
+
if (region === 'eu') {
|
|
15
|
+
return 'https://api.eu.amplitude.com';
|
|
16
|
+
}
|
|
17
|
+
return 'https://api2.amplitude.com';
|
|
18
|
+
};
|
|
19
|
+
exports.getHostFromRegion = getHostFromRegion;
|
|
20
|
+
const getCloudUrlFromRegion = (region) => {
|
|
21
|
+
if (region === 'eu') {
|
|
22
|
+
return 'https://eu.amplitude.com';
|
|
23
|
+
}
|
|
24
|
+
return 'https://app.amplitude.com';
|
|
25
|
+
};
|
|
26
|
+
exports.getCloudUrlFromRegion = getCloudUrlFromRegion;
|
|
27
|
+
async function detectRegionFromToken(accessToken) {
|
|
28
|
+
if (constants_1.IS_DEV) {
|
|
29
|
+
return 'us';
|
|
30
|
+
}
|
|
31
|
+
const headers = {
|
|
32
|
+
Authorization: `Bearer ${accessToken}`,
|
|
33
|
+
'User-Agent': constants_1.WIZARD_USER_AGENT,
|
|
34
|
+
};
|
|
35
|
+
const [usResult, euResult] = await Promise.allSettled([
|
|
36
|
+
axios_1.default.get('https://us.amplitude.com/api/users/@me/', { headers }),
|
|
37
|
+
axios_1.default.get('https://eu.amplitude.com/api/users/@me/', { headers }),
|
|
38
|
+
]);
|
|
39
|
+
if (usResult.status === 'fulfilled')
|
|
40
|
+
return 'us';
|
|
41
|
+
if (euResult.status === 'fulfilled')
|
|
42
|
+
return 'eu';
|
|
43
|
+
throw new Error('Could not determine cloud region from access token. Please check your Amplitude account.');
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Get the LLM proxy URL for the Claude Agent SDK.
|
|
47
|
+
*
|
|
48
|
+
* Routes through the wizard-proxy-router in Thunder (javascript repo), which
|
|
49
|
+
* validates Amplitude OAuth tokens and proxies to GCP Vertex AI.
|
|
50
|
+
*
|
|
51
|
+
* Override with WIZARD_LLM_PROXY_URL env var for explicit URL override.
|
|
52
|
+
* The Claude Agent SDK uses this as ANTHROPIC_BASE_URL and appends /v1/messages.
|
|
53
|
+
*/
|
|
54
|
+
const getLlmGatewayUrlFromHost = (host) => {
|
|
55
|
+
// Allow explicit override for local proxy development
|
|
56
|
+
const proxyOverride = process.env.WIZARD_LLM_PROXY_URL;
|
|
57
|
+
if (proxyOverride) {
|
|
58
|
+
return proxyOverride;
|
|
59
|
+
}
|
|
60
|
+
if (host.includes('localhost')) {
|
|
61
|
+
// Local dev: point at the local proxy (start with `pnpm proxy` in the wizard repo)
|
|
62
|
+
return 'http://localhost:3030/wizard';
|
|
63
|
+
}
|
|
64
|
+
if (host.includes('eu.amplitude.com')) {
|
|
65
|
+
return 'https://core.eu.amplitude.com/wizard';
|
|
66
|
+
}
|
|
67
|
+
return 'https://core.amplitude.com/wizard';
|
|
68
|
+
};
|
|
69
|
+
exports.getLlmGatewayUrlFromHost = getLlmGatewayUrlFromHost;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isUnicodeSupported(): boolean;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Vendored from: https://github.com/sindresorhus/is-unicode-supported/blob/c80c691dde9e2fcfe3996810858c6672c8f35ad9/index.js#L3
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.isUnicodeSupported = isUnicodeSupported;
|
|
5
|
+
// MIT License
|
|
6
|
+
// Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
7
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
8
|
+
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
9
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
10
|
+
function isUnicodeSupported() {
|
|
11
|
+
if (process.platform !== 'win32') {
|
|
12
|
+
return process.env.TERM !== 'linux'; // Linux console (kernel)
|
|
13
|
+
}
|
|
14
|
+
return (Boolean(process.env.CI) ||
|
|
15
|
+
Boolean(process.env.WT_SESSION) || // Windows Terminal
|
|
16
|
+
Boolean(process.env.TERMINUS_SUBLIME) || // Terminus (<0.2.27)
|
|
17
|
+
process.env.ConEmuTask === '{cmd::Cmder}' || // ConEmu and cmder
|
|
18
|
+
process.env.TERM_PROGRAM === 'Terminus-Sublime' ||
|
|
19
|
+
process.env.TERM_PROGRAM === 'vscode' ||
|
|
20
|
+
process.env.TERM === 'xterm-256color' ||
|
|
21
|
+
process.env.TERM === 'alacritty' ||
|
|
22
|
+
process.env.TERMINAL_EMULATOR === 'JetBrains-JediTerm');
|
|
23
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare class WizardError extends Error {
|
|
2
|
+
readonly context?: Record<string, unknown> | undefined;
|
|
3
|
+
constructor(message: string, context?: Record<string, unknown> | undefined);
|
|
4
|
+
}
|
|
5
|
+
interface WizardAbortOptions {
|
|
6
|
+
message?: string;
|
|
7
|
+
error?: Error | WizardError;
|
|
8
|
+
exitCode?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare function registerCleanup(fn: () => void): void;
|
|
11
|
+
export declare function clearCleanup(): void;
|
|
12
|
+
export declare function wizardAbort(options?: WizardAbortOptions): Promise<never>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WizardError = void 0;
|
|
4
|
+
exports.registerCleanup = registerCleanup;
|
|
5
|
+
exports.clearCleanup = clearCleanup;
|
|
6
|
+
exports.wizardAbort = wizardAbort;
|
|
7
|
+
/**
|
|
8
|
+
* Single exit point for the wizard. Use instead of process.exit() directly.
|
|
9
|
+
*
|
|
10
|
+
* Sequence: cleanup -> error capture (optional) -> analytics shutdown -> outro -> process.exit
|
|
11
|
+
*
|
|
12
|
+
* WizardError is a data carrier passed to wizardAbort() for analytics context, never thrown.
|
|
13
|
+
* The legacy abort() in setup-utils.ts delegates here.
|
|
14
|
+
*/
|
|
15
|
+
const analytics_1 = require("./analytics");
|
|
16
|
+
const ui_1 = require("../ui");
|
|
17
|
+
class WizardError extends Error {
|
|
18
|
+
context;
|
|
19
|
+
constructor(message, context) {
|
|
20
|
+
super(message);
|
|
21
|
+
this.context = context;
|
|
22
|
+
this.name = 'WizardError';
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.WizardError = WizardError;
|
|
26
|
+
const cleanupFns = [];
|
|
27
|
+
function registerCleanup(fn) {
|
|
28
|
+
cleanupFns.push(fn);
|
|
29
|
+
}
|
|
30
|
+
function clearCleanup() {
|
|
31
|
+
cleanupFns.length = 0;
|
|
32
|
+
}
|
|
33
|
+
async function wizardAbort(options) {
|
|
34
|
+
const { message = 'Wizard setup cancelled.', error, exitCode = 1, } = options ?? {};
|
|
35
|
+
// 1. Run registered cleanup functions
|
|
36
|
+
for (const fn of cleanupFns) {
|
|
37
|
+
try {
|
|
38
|
+
fn();
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
/* cleanup should not prevent exit */
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
// 2. Capture error in analytics (if provided)
|
|
45
|
+
if (error) {
|
|
46
|
+
analytics_1.analytics.captureException(error, {
|
|
47
|
+
...((error instanceof WizardError && error.context) || {}),
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
// 3. Shutdown analytics
|
|
51
|
+
await analytics_1.analytics.shutdown(error ? 'error' : 'cancelled');
|
|
52
|
+
// 4. Display message to user
|
|
53
|
+
(0, ui_1.getUI)().cancel(message);
|
|
54
|
+
// 5. Exit (fires 'exit' event so TUI cleanup runs)
|
|
55
|
+
return process.exit(exitCode);
|
|
56
|
+
}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
.TH AMPLITUDE\-WIZARD 1 "2026" "@amplitude/wizard" "Amplitude Wizard"
|
|
2
|
+
.SH NAME
|
|
3
|
+
amplitude\-wizard \- instrument your app with Amplitude analytics
|
|
4
|
+
.SH SYNOPSIS
|
|
5
|
+
.B amplitude\-wizard
|
|
6
|
+
[\fIOPTIONS\fR]
|
|
7
|
+
.br
|
|
8
|
+
.B amplitude\-wizard
|
|
9
|
+
\fICOMMAND\fR [\fIOPTIONS\fR]
|
|
10
|
+
.SH DESCRIPTION
|
|
11
|
+
\fBamplitude\-wizard\fR is an interactive CLI that instruments applications with
|
|
12
|
+
Amplitude analytics. It authenticates the user, detects the project framework,
|
|
13
|
+
runs a Claude\-powered agent to set up the SDK and track events, and guides the
|
|
14
|
+
user through their first chart and dashboard.
|
|
15
|
+
.PP
|
|
16
|
+
Run without arguments to launch the interactive TUI wizard. The wizard
|
|
17
|
+
auto\-detects your framework (Next.js, React, Vue, Django, Flask, FastAPI, etc.)
|
|
18
|
+
and writes the necessary SDK boilerplate.
|
|
19
|
+
.SH COMMANDS
|
|
20
|
+
.TP
|
|
21
|
+
\fB(default)\fR
|
|
22
|
+
Run the interactive Amplitude setup wizard. Launches a full\-screen TUI.
|
|
23
|
+
.TP
|
|
24
|
+
\fBlogin\fR
|
|
25
|
+
Log in to your Amplitude account via browser OAuth. Credentials are stored in
|
|
26
|
+
\fI~/.ampli.json\fR for subsequent runs.
|
|
27
|
+
.TP
|
|
28
|
+
\fBlogout\fR
|
|
29
|
+
Remove the locally stored Amplitude credentials.
|
|
30
|
+
.TP
|
|
31
|
+
\fBwhoami\fR
|
|
32
|
+
Print the currently logged\-in user and org.
|
|
33
|
+
.TP
|
|
34
|
+
\fBslack\fR
|
|
35
|
+
Set up the Amplitude Slack integration.
|
|
36
|
+
.TP
|
|
37
|
+
\fBmcp add\fR
|
|
38
|
+
Install the Amplitude MCP server into supported AI clients (Claude, Cursor, etc.).
|
|
39
|
+
.TP
|
|
40
|
+
\fBmcp remove\fR
|
|
41
|
+
Remove the Amplitude MCP server from supported AI clients.
|
|
42
|
+
.TP
|
|
43
|
+
\fBcompletion\fR
|
|
44
|
+
Print a shell completion script for bash or zsh. Source it in your shell rc:
|
|
45
|
+
.RS
|
|
46
|
+
.nf
|
|
47
|
+
eval "$(amplitude\-wizard completion)"
|
|
48
|
+
.fi
|
|
49
|
+
.RE
|
|
50
|
+
.SH OPTIONS
|
|
51
|
+
.SS Global options
|
|
52
|
+
.TP
|
|
53
|
+
\fB\-\-debug\fR
|
|
54
|
+
Enable verbose logging to the log file and console.
|
|
55
|
+
Environment variable: \fBAMPLITUDE_WIZARD_DEBUG\fR
|
|
56
|
+
.TP
|
|
57
|
+
\fB\-\-verbose\fR
|
|
58
|
+
Print diagnostic info (working directory, detected framework, config) to the
|
|
59
|
+
run log.
|
|
60
|
+
Environment variable: \fBAMPLITUDE_WIZARD_VERBOSE\fR
|
|
61
|
+
.TP
|
|
62
|
+
\fB\-\-signup\fR
|
|
63
|
+
Create a new Amplitude account during setup instead of logging in.
|
|
64
|
+
Environment variable: \fBAMPLITUDE_WIZARD_SIGNUP\fR
|
|
65
|
+
.TP
|
|
66
|
+
\fB\-\-ci\fR
|
|
67
|
+
Enable non\-interactive CI mode. Requires \fB\-\-api\-key\fR and \fB\-\-install\-dir\fR.
|
|
68
|
+
Environment variable: \fBAMPLITUDE_WIZARD_CI\fR
|
|
69
|
+
.TP
|
|
70
|
+
\fB\-\-api\-key\fR \fIKEY\fR
|
|
71
|
+
Amplitude project API key. Skips the browser OAuth flow entirely.
|
|
72
|
+
Environment variable: \fBAMPLITUDE_WIZARD_API_KEY\fR
|
|
73
|
+
.TP
|
|
74
|
+
\fB\-\-project\-id\fR \fIID\fR
|
|
75
|
+
Amplitude project ID. Optional; defaults to the project associated with the
|
|
76
|
+
API key or the saved OAuth session.
|
|
77
|
+
Environment variable: \fBAMPLITUDE_WIZARD_PROJECT_ID\fR
|
|
78
|
+
.TP
|
|
79
|
+
\fB\-\-local\-mcp\fR
|
|
80
|
+
Route MCP calls to a local server at \fIhttp://localhost:8787/mcp\fR instead of
|
|
81
|
+
the production endpoint.
|
|
82
|
+
Environment variable: \fBAMPLITUDE_WIZARD_LOCAL_MCP\fR
|
|
83
|
+
.TP
|
|
84
|
+
\fB\-h\fR, \fB\-\-help\fR
|
|
85
|
+
Show help and exit.
|
|
86
|
+
.TP
|
|
87
|
+
\fB\-v\fR, \fB\-\-version\fR
|
|
88
|
+
Print the package version and exit.
|
|
89
|
+
.SS Wizard (default command) options
|
|
90
|
+
.TP
|
|
91
|
+
\fB\-\-integration\fR \fIFRAMEWORK\fR
|
|
92
|
+
Skip auto\-detection and use the specified framework integration. Choices:
|
|
93
|
+
\fBnextjs\fR, \fBvue\fR, \fBreact\-router\fR, \fBdjango\fR, \fBflask\fR, \fBfastapi\fR,
|
|
94
|
+
\fBjavascript_web\fR, \fBjavascript_node\fR, \fBpython\fR.
|
|
95
|
+
Environment variable: \fBAMPLITUDE_WIZARD_INTEGRATION\fR
|
|
96
|
+
.TP
|
|
97
|
+
\fB\-\-install\-dir\fR \fIDIR\fR
|
|
98
|
+
Directory to install Amplitude in. Defaults to the current working directory.
|
|
99
|
+
Environment variable: \fBAMPLITUDE_WIZARD_INSTALL_DIR\fR
|
|
100
|
+
.TP
|
|
101
|
+
\fB\-\-force\-install\fR
|
|
102
|
+
Force package installation even if peer dependency checks fail.
|
|
103
|
+
Environment variable: \fBAMPLITUDE_WIZARD_FORCE_INSTALL\fR
|
|
104
|
+
.TP
|
|
105
|
+
\fB\-\-menu\fR
|
|
106
|
+
Show the framework selection menu instead of auto\-detecting.
|
|
107
|
+
Environment variable: \fBAMPLITUDE_WIZARD_MENU\fR
|
|
108
|
+
.TP
|
|
109
|
+
\fB\-\-benchmark\fR
|
|
110
|
+
Run in benchmark mode with per\-phase token tracking.
|
|
111
|
+
Environment variable: \fBAMPLITUDE_WIZARD_BENCHMARK\fR
|
|
112
|
+
.SS login options
|
|
113
|
+
.TP
|
|
114
|
+
\fB\-\-zone\fR \fIus\fR|\fIeu\fR
|
|
115
|
+
Amplitude data center zone. Default: \fBus\fR.
|
|
116
|
+
.SH ENVIRONMENT
|
|
117
|
+
All flags can also be set as environment variables by prefixing with
|
|
118
|
+
\fBAMPLITUDE_WIZARD_\fR and uppercasing. For example:
|
|
119
|
+
.PP
|
|
120
|
+
.nf
|
|
121
|
+
export AMPLITUDE_WIZARD_API_KEY=my\-key
|
|
122
|
+
export AMPLITUDE_WIZARD_CI=true
|
|
123
|
+
amplitude\-wizard
|
|
124
|
+
.fi
|
|
125
|
+
.SH FILES
|
|
126
|
+
.TP
|
|
127
|
+
\fI~/.ampli.json\fR
|
|
128
|
+
Stores the OAuth access token, refresh token, and user metadata (name, email,
|
|
129
|
+
org, zone). Written by \fBlogin\fR and cleared by \fBlogout\fR.
|
|
130
|
+
.TP
|
|
131
|
+
\fI./ampli.json\fR
|
|
132
|
+
Project\-level config written by the wizard after setup. Contains the Amplitude
|
|
133
|
+
Source ID, Workspace ID, SDK runtime, and branch information.
|
|
134
|
+
.TP
|
|
135
|
+
\fI/tmp/amplitude\-wizard.log\fR
|
|
136
|
+
Runtime log file. Captures verbose/debug output and agent traces.
|
|
137
|
+
.SH EXAMPLES
|
|
138
|
+
.TP
|
|
139
|
+
Run the wizard in the current directory:
|
|
140
|
+
.nf
|
|
141
|
+
amplitude\-wizard
|
|
142
|
+
.fi
|
|
143
|
+
.TP
|
|
144
|
+
Run the wizard against a specific directory:
|
|
145
|
+
.nf
|
|
146
|
+
amplitude\-wizard \-\-install\-dir /path/to/project
|
|
147
|
+
.fi
|
|
148
|
+
.TP
|
|
149
|
+
Run in CI (non\-interactive):
|
|
150
|
+
.nf
|
|
151
|
+
amplitude\-wizard \-\-ci \-\-api\-key <key> \-\-install\-dir .
|
|
152
|
+
.fi
|
|
153
|
+
.TP
|
|
154
|
+
Force Next.js integration without auto\-detection:
|
|
155
|
+
.nf
|
|
156
|
+
amplitude\-wizard \-\-integration nextjs
|
|
157
|
+
.fi
|
|
158
|
+
.TP
|
|
159
|
+
Set up shell completions (bash/zsh):
|
|
160
|
+
.nf
|
|
161
|
+
echo 'eval "$(amplitude\-wizard completion)"' >> ~/.zshrc
|
|
162
|
+
source ~/.zshrc
|
|
163
|
+
.fi
|
|
164
|
+
.TP
|
|
165
|
+
Log in to the EU data center:
|
|
166
|
+
.nf
|
|
167
|
+
amplitude\-wizard login \-\-zone eu
|
|
168
|
+
.fi
|
|
169
|
+
.SH SEE ALSO
|
|
170
|
+
Full documentation and source: \fIhttps://github.com/amplitude/wizard\fR
|