@posthog/wizard 2.7.0 → 2.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -0
- package/dist/bin.js +289 -162
- package/dist/bin.js.map +1 -1
- package/dist/src/__tests__/cli.test.js +92 -59
- package/dist/src/__tests__/cli.test.js.map +1 -1
- package/dist/src/__tests__/wizard-abort.test.js +34 -13
- package/dist/src/__tests__/wizard-abort.test.js.map +1 -1
- package/dist/src/frameworks/android/android-wizard-agent.js +2 -2
- package/dist/src/frameworks/android/android-wizard-agent.js.map +1 -1
- package/dist/src/frameworks/angular/angular-wizard-agent.js +2 -2
- package/dist/src/frameworks/angular/angular-wizard-agent.js.map +1 -1
- package/dist/src/frameworks/astro/astro-wizard-agent.js +2 -2
- package/dist/src/frameworks/astro/astro-wizard-agent.js.map +1 -1
- package/dist/src/frameworks/django/django-wizard-agent.js +2 -2
- package/dist/src/frameworks/django/django-wizard-agent.js.map +1 -1
- package/dist/src/frameworks/fastapi/fastapi-wizard-agent.js +2 -2
- package/dist/src/frameworks/fastapi/fastapi-wizard-agent.js.map +1 -1
- package/dist/src/frameworks/flask/flask-wizard-agent.js +2 -2
- package/dist/src/frameworks/flask/flask-wizard-agent.js.map +1 -1
- package/dist/src/frameworks/javascript-node/javascript-node-wizard-agent.js +2 -2
- package/dist/src/frameworks/javascript-node/javascript-node-wizard-agent.js.map +1 -1
- package/dist/src/frameworks/javascript-web/javascript-web-wizard-agent.js +2 -2
- package/dist/src/frameworks/javascript-web/javascript-web-wizard-agent.js.map +1 -1
- package/dist/src/frameworks/laravel/laravel-wizard-agent.js +2 -2
- package/dist/src/frameworks/laravel/laravel-wizard-agent.js.map +1 -1
- package/dist/src/frameworks/nextjs/nextjs-wizard-agent.js +2 -2
- package/dist/src/frameworks/nextjs/nextjs-wizard-agent.js.map +1 -1
- package/dist/src/frameworks/nuxt/nuxt-wizard-agent.js +2 -2
- package/dist/src/frameworks/nuxt/nuxt-wizard-agent.js.map +1 -1
- package/dist/src/frameworks/python/python-wizard-agent.js +2 -2
- package/dist/src/frameworks/python/python-wizard-agent.js.map +1 -1
- package/dist/src/frameworks/rails/rails-wizard-agent.js +2 -2
- package/dist/src/frameworks/rails/rails-wizard-agent.js.map +1 -1
- package/dist/src/frameworks/react-native/react-native-wizard-agent.js +2 -2
- package/dist/src/frameworks/react-native/react-native-wizard-agent.js.map +1 -1
- package/dist/src/frameworks/react-router/react-router-wizard-agent.js +2 -2
- package/dist/src/frameworks/react-router/react-router-wizard-agent.js.map +1 -1
- package/dist/src/frameworks/ruby/ruby-wizard-agent.js +2 -2
- package/dist/src/frameworks/ruby/ruby-wizard-agent.js.map +1 -1
- package/dist/src/frameworks/svelte/svelte-wizard-agent.js +2 -2
- package/dist/src/frameworks/svelte/svelte-wizard-agent.js.map +1 -1
- package/dist/src/frameworks/swift/swift-wizard-agent.js +2 -2
- package/dist/src/frameworks/swift/swift-wizard-agent.js.map +1 -1
- package/dist/src/frameworks/tanstack-router/tanstack-router-wizard-agent.js +2 -2
- package/dist/src/frameworks/tanstack-router/tanstack-router-wizard-agent.js.map +1 -1
- package/dist/src/frameworks/tanstack-start/tanstack-start-wizard-agent.js +2 -2
- package/dist/src/frameworks/tanstack-start/tanstack-start-wizard-agent.js.map +1 -1
- package/dist/src/frameworks/vue/vue-wizard-agent.js +2 -2
- package/dist/src/frameworks/vue/vue-wizard-agent.js.map +1 -1
- package/dist/src/lib/__tests__/agent-interface.test.js +29 -1
- package/dist/src/lib/__tests__/agent-interface.test.js.map +1 -1
- package/dist/src/lib/agent/__tests__/agent-prompt.test.js +57 -0
- package/dist/src/lib/agent/__tests__/agent-prompt.test.js.map +1 -0
- package/dist/src/lib/{agent-interface.d.ts → agent/agent-interface.d.ts} +18 -6
- package/dist/src/lib/{agent-interface.js → agent/agent-interface.js} +63 -13
- package/dist/src/lib/agent/agent-interface.js.map +1 -0
- package/dist/src/lib/agent/agent-prompt.d.ts +23 -0
- package/dist/src/lib/agent/agent-prompt.js +47 -0
- package/dist/src/lib/agent/agent-prompt.js.map +1 -0
- package/dist/src/lib/agent/agent-runner.d.ts +78 -0
- package/dist/src/lib/agent/agent-runner.js +323 -0
- package/dist/src/lib/agent/agent-runner.js.map +1 -0
- package/dist/src/lib/agent/commandments.js.map +1 -0
- package/dist/src/lib/constants.d.ts +10 -1
- package/dist/src/lib/constants.js +13 -1
- package/dist/src/lib/constants.js.map +1 -1
- package/dist/src/lib/detection/__tests__/context.test.js +72 -0
- package/dist/src/lib/detection/__tests__/context.test.js.map +1 -0
- package/dist/src/lib/detection/__tests__/features.test.d.ts +1 -0
- package/dist/src/lib/detection/__tests__/features.test.js +75 -0
- package/dist/src/lib/detection/__tests__/features.test.js.map +1 -0
- package/dist/src/lib/detection/__tests__/package-manager.test.d.ts +1 -0
- package/dist/src/lib/{__tests__/package-manager-detection.test.js → detection/__tests__/package-manager.test.js} +25 -25
- package/dist/src/lib/detection/__tests__/package-manager.test.js.map +1 -0
- package/dist/src/lib/detection/context.d.ts +31 -0
- package/dist/src/lib/detection/context.js +92 -0
- package/dist/src/lib/detection/context.js.map +1 -0
- package/dist/src/lib/detection/features.d.ts +16 -0
- package/dist/src/lib/detection/features.js +56 -0
- package/dist/src/lib/detection/features.js.map +1 -0
- package/dist/src/lib/detection/framework.d.ts +14 -0
- package/dist/src/lib/detection/framework.js +35 -0
- package/dist/src/lib/detection/framework.js.map +1 -0
- package/dist/src/lib/detection/index.d.ts +3 -0
- package/dist/src/lib/detection/index.js +11 -0
- package/dist/src/lib/detection/index.js.map +1 -0
- package/dist/src/lib/{package-manager-detection.js → detection/package-manager.js} +3 -3
- package/dist/src/lib/detection/package-manager.js.map +1 -0
- package/dist/src/lib/framework-config.d.ts +1 -1
- package/dist/src/lib/framework-config.js.map +1 -1
- package/dist/src/lib/health-checks/endpoints.js +2 -1
- package/dist/src/lib/health-checks/endpoints.js.map +1 -1
- package/dist/src/lib/middleware/benchmark.js +1 -1
- package/dist/src/lib/middleware/benchmark.js.map +1 -1
- package/dist/src/lib/middleware/benchmarks/compaction-tracker.js +1 -1
- package/dist/src/lib/middleware/benchmarks/compaction-tracker.js.map +1 -1
- package/dist/src/lib/middleware/benchmarks/json-writer.js +1 -1
- package/dist/src/lib/middleware/benchmarks/json-writer.js.map +1 -1
- package/dist/src/lib/middleware/benchmarks/summary.js +1 -1
- package/dist/src/lib/middleware/benchmarks/summary.js.map +1 -1
- package/dist/src/lib/middleware/config.js +1 -1
- package/dist/src/lib/middleware/config.js.map +1 -1
- package/dist/src/lib/version.d.ts +1 -1
- package/dist/src/lib/version.js +1 -1
- package/dist/src/lib/version.js.map +1 -1
- package/dist/src/lib/wizard-session.d.ts +20 -7
- package/dist/src/lib/wizard-session.js +4 -0
- package/dist/src/lib/wizard-session.js.map +1 -1
- package/dist/src/lib/wizard-tools.d.ts +28 -1
- package/dist/src/lib/wizard-tools.js +24 -0
- package/dist/src/lib/wizard-tools.js.map +1 -1
- package/dist/src/lib/workflows/__tests__/agent-skill.test.d.ts +1 -0
- package/dist/src/lib/workflows/__tests__/agent-skill.test.js +66 -0
- package/dist/src/lib/workflows/__tests__/agent-skill.test.js.map +1 -0
- package/dist/src/lib/workflows/__tests__/revenue-analytics-detect.test.d.ts +1 -0
- package/dist/src/lib/workflows/__tests__/revenue-analytics-detect.test.js +101 -0
- package/dist/src/lib/workflows/__tests__/revenue-analytics-detect.test.js.map +1 -0
- package/dist/src/lib/workflows/__tests__/workflow-registry.test.d.ts +1 -0
- package/dist/src/lib/workflows/__tests__/workflow-registry.test.js +32 -0
- package/dist/src/lib/workflows/__tests__/workflow-registry.test.js.map +1 -0
- package/dist/src/lib/workflows/__tests__/workflow-step.test.d.ts +1 -0
- package/dist/src/lib/workflows/__tests__/workflow-step.test.js +54 -0
- package/dist/src/lib/workflows/__tests__/workflow-step.test.js.map +1 -0
- package/dist/src/lib/workflows/agent-skill/index.d.ts +44 -0
- package/dist/src/lib/workflows/agent-skill/index.js +47 -0
- package/dist/src/lib/workflows/agent-skill/index.js.map +1 -0
- package/dist/src/lib/workflows/agent-skill/steps.d.ts +8 -0
- package/dist/src/lib/workflows/agent-skill/steps.js +32 -0
- package/dist/src/lib/workflows/agent-skill/steps.js.map +1 -0
- package/dist/src/lib/workflows/posthog-integration/detect.d.ts +12 -0
- package/dist/src/lib/workflows/posthog-integration/detect.js +57 -0
- package/dist/src/lib/workflows/posthog-integration/detect.js.map +1 -0
- package/dist/src/lib/workflows/posthog-integration/index.d.ts +3 -0
- package/dist/src/lib/workflows/posthog-integration/index.js +152 -0
- package/dist/src/lib/workflows/posthog-integration/index.js.map +1 -0
- package/dist/src/lib/workflows/posthog-integration/steps.d.ts +9 -0
- package/dist/src/lib/workflows/posthog-integration/steps.js +100 -0
- package/dist/src/lib/workflows/posthog-integration/steps.js.map +1 -0
- package/dist/src/lib/workflows/revenue-analytics/detect.d.ts +40 -0
- package/dist/src/lib/workflows/revenue-analytics/detect.js +156 -0
- package/dist/src/lib/workflows/revenue-analytics/detect.js.map +1 -0
- package/dist/src/lib/workflows/revenue-analytics/index.d.ts +4 -0
- package/dist/src/lib/workflows/revenue-analytics/index.js +30 -0
- package/dist/src/lib/workflows/revenue-analytics/index.js.map +1 -0
- package/dist/src/lib/workflows/revenue-analytics/steps.d.ts +8 -0
- package/dist/src/lib/workflows/revenue-analytics/steps.js +48 -0
- package/dist/src/lib/workflows/revenue-analytics/steps.js.map +1 -0
- package/dist/src/lib/workflows/workflow-registry.d.ts +18 -0
- package/dist/src/lib/workflows/workflow-registry.js +32 -0
- package/dist/src/lib/workflows/workflow-registry.js.map +1 -0
- package/dist/src/lib/workflows/workflow-step.d.ts +126 -0
- package/dist/src/lib/workflows/workflow-step.js +28 -0
- package/dist/src/lib/workflows/workflow-step.js.map +1 -0
- package/dist/src/steps/add-mcp-server-to-clients/index.d.ts +2 -1
- package/dist/src/steps/add-mcp-server-to-clients/index.js.map +1 -1
- package/dist/src/ui/logging-ui.d.ts +6 -3
- package/dist/src/ui/logging-ui.js +7 -0
- package/dist/src/ui/logging-ui.js.map +1 -1
- package/dist/src/ui/tui/__tests__/flows.test.d.ts +1 -0
- package/dist/src/ui/tui/__tests__/flows.test.js +115 -0
- package/dist/src/ui/tui/__tests__/flows.test.js.map +1 -0
- package/dist/src/ui/tui/__tests__/router.test.d.ts +1 -0
- package/dist/src/ui/tui/__tests__/router.test.js +87 -0
- package/dist/src/ui/tui/__tests__/router.test.js.map +1 -0
- package/dist/src/ui/tui/__tests__/store.test.js +100 -10
- package/dist/src/ui/tui/__tests__/store.test.js.map +1 -1
- package/dist/src/ui/tui/flows.d.ts +17 -6
- package/dist/src/ui/tui/flows.js +28 -52
- package/dist/src/ui/tui/flows.js.map +1 -1
- package/dist/src/ui/tui/ink-ui.d.ts +6 -3
- package/dist/src/ui/tui/ink-ui.js +7 -0
- package/dist/src/ui/tui/ink-ui.js.map +1 -1
- package/dist/src/ui/tui/primitives/ProgressList.d.ts +3 -1
- package/dist/src/ui/tui/primitives/ProgressList.js +2 -2
- package/dist/src/ui/tui/primitives/ProgressList.js.map +1 -1
- package/dist/src/ui/tui/router.js +1 -1
- package/dist/src/ui/tui/router.js.map +1 -1
- package/dist/src/ui/tui/screen-registry.js +2 -0
- package/dist/src/ui/tui/screen-registry.js.map +1 -1
- package/dist/src/ui/tui/screens/ManagedSettingsScreen.js.map +1 -1
- package/dist/src/ui/tui/screens/OutroScreen.js +1 -1
- package/dist/src/ui/tui/screens/OutroScreen.js.map +1 -1
- package/dist/src/ui/tui/screens/RevenueIntroScreen.d.ts +16 -0
- package/dist/src/ui/tui/screens/RevenueIntroScreen.js +64 -0
- package/dist/src/ui/tui/screens/RevenueIntroScreen.js.map +1 -0
- package/dist/src/ui/tui/screens/RunScreen.js +1 -1
- package/dist/src/ui/tui/screens/RunScreen.js.map +1 -1
- package/dist/src/ui/tui/screens/SettingsOverrideScreen.js.map +1 -1
- package/dist/src/ui/tui/screens/health/HealthCheckScreen.js +2 -2
- package/dist/src/ui/tui/screens/health/HealthCheckScreen.js.map +1 -1
- package/dist/src/ui/tui/start-tui.js +2 -2
- package/dist/src/ui/tui/start-tui.js.map +1 -1
- package/dist/src/ui/tui/store.d.ts +46 -21
- package/dist/src/ui/tui/store.js +105 -47
- package/dist/src/ui/tui/store.js.map +1 -1
- package/dist/src/ui/wizard-ui.d.ts +13 -3
- package/dist/src/ui/wizard-ui.js.map +1 -1
- package/dist/src/utils/__tests__/provisioning.test.d.ts +1 -0
- package/dist/src/utils/__tests__/provisioning.test.js +192 -0
- package/dist/src/utils/__tests__/provisioning.test.js.map +1 -0
- package/dist/src/utils/file-utils.d.ts +8 -0
- package/dist/src/utils/file-utils.js +32 -0
- package/dist/src/utils/file-utils.js.map +1 -1
- package/dist/src/utils/provisioning.d.ts +25 -0
- package/dist/src/utils/provisioning.js +191 -0
- package/dist/src/utils/provisioning.js.map +1 -0
- package/dist/src/utils/setup-utils.d.ts +4 -1
- package/dist/src/utils/setup-utils.js +46 -2
- package/dist/src/utils/setup-utils.js.map +1 -1
- package/dist/src/utils/types.d.ts +4 -0
- package/dist/src/utils/types.js.map +1 -1
- package/dist/src/utils/wizard-abort.d.ts +3 -0
- package/dist/src/utils/wizard-abort.js +5 -3
- package/dist/src/utils/wizard-abort.js.map +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/dist/src/__tests__/run.test.js +0 -95
- package/dist/src/__tests__/run.test.js.map +0 -1
- package/dist/src/lib/__tests__/package-manager-detection.test.js.map +0 -1
- package/dist/src/lib/agent-interface.js.map +0 -1
- package/dist/src/lib/agent-runner.d.ts +0 -9
- package/dist/src/lib/agent-runner.js +0 -383
- package/dist/src/lib/agent-runner.js.map +0 -1
- package/dist/src/lib/commandments.js.map +0 -1
- package/dist/src/lib/package-manager-detection.js.map +0 -1
- package/dist/src/run.d.ts +0 -22
- package/dist/src/run.js +0 -152
- package/dist/src/run.js.map +0 -1
- /package/dist/src/{__tests__/run.test.d.ts → lib/agent/__tests__/agent-prompt.test.d.ts} +0 -0
- /package/dist/src/lib/{commandments.d.ts → agent/commandments.d.ts} +0 -0
- /package/dist/src/lib/{commandments.js → agent/commandments.js} +0 -0
- /package/dist/src/lib/{__tests__/package-manager-detection.test.d.ts → detection/__tests__/context.test.d.ts} +0 -0
- /package/dist/src/lib/{package-manager-detection.d.ts → detection/package-manager.d.ts} +0 -0
|
@@ -4,14 +4,16 @@
|
|
|
4
4
|
* Owns the Screen and Flow enums (re-exported by router.ts) to avoid
|
|
5
5
|
* circular imports between router ↔ flows.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* Workflow-based flows are derived from WORKFLOW_REGISTRY via
|
|
8
|
+
* workflowToFlowEntries(). MCP add/remove flows are standalone since
|
|
9
|
+
* they don't go through the agent runner.
|
|
10
10
|
*/
|
|
11
|
-
import {
|
|
11
|
+
import type { WizardSession } from '../../lib/wizard-session.js';
|
|
12
|
+
import { type Workflow } from '../../lib/workflows/workflow-step.js';
|
|
12
13
|
/** Screens that participate in linear flows */
|
|
13
14
|
export declare enum Screen {
|
|
14
15
|
Intro = "intro",
|
|
16
|
+
RevenueIntro = "revenue-intro",
|
|
15
17
|
HealthCheck = "health-check",
|
|
16
18
|
Setup = "setup",
|
|
17
19
|
Auth = "auth",
|
|
@@ -24,7 +26,9 @@ export declare enum Screen {
|
|
|
24
26
|
}
|
|
25
27
|
/** Named flows the router can run */
|
|
26
28
|
export declare enum Flow {
|
|
27
|
-
|
|
29
|
+
PostHogIntegration = "posthog-integration",
|
|
30
|
+
RevenueAnalyticsSetup = "revenue-analytics-setup",
|
|
31
|
+
AgentSkill = "agent-skill",
|
|
28
32
|
McpAdd = "mcp-add",
|
|
29
33
|
McpRemove = "mcp-remove"
|
|
30
34
|
}
|
|
@@ -36,5 +40,12 @@ export interface FlowEntry {
|
|
|
36
40
|
/** If provided, screen is considered complete when this returns true. */
|
|
37
41
|
isComplete?: (session: WizardSession) => boolean;
|
|
38
42
|
}
|
|
39
|
-
/**
|
|
43
|
+
/** Raw workflow step arrays — used by the store for gate/onInit definitions. */
|
|
44
|
+
export declare const WORKFLOW_STEPS: Partial<Record<Flow, Workflow>>;
|
|
45
|
+
/**
|
|
46
|
+
* All flow pipelines.
|
|
47
|
+
*
|
|
48
|
+
* Workflow-based flows are derived from the registry.
|
|
49
|
+
* MCP add/remove flows are standalone.
|
|
50
|
+
*/
|
|
40
51
|
export declare const FLOWS: Record<Flow, FlowEntry[]>;
|
package/dist/src/ui/tui/flows.js
CHANGED
|
@@ -4,17 +4,19 @@
|
|
|
4
4
|
* Owns the Screen and Flow enums (re-exported by router.ts) to avoid
|
|
5
5
|
* circular imports between router ↔ flows.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* Workflow-based flows are derived from WORKFLOW_REGISTRY via
|
|
8
|
+
* workflowToFlowEntries(). MCP add/remove flows are standalone since
|
|
9
|
+
* they don't go through the agent runner.
|
|
10
10
|
*/
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
11
|
+
import { workflowToFlowEntries, } from '../../lib/workflows/workflow-step.js';
|
|
12
|
+
import { WORKFLOW_REGISTRY } from '../../lib/workflows/workflow-registry.js';
|
|
13
|
+
import { AGENT_SKILL_STEPS } from '../../lib/workflows/agent-skill/index.js';
|
|
13
14
|
// ── Screen + Flow enums ──────────────────────────────────────────────
|
|
14
15
|
/** Screens that participate in linear flows */
|
|
15
16
|
export var Screen;
|
|
16
17
|
(function (Screen) {
|
|
17
18
|
Screen["Intro"] = "intro";
|
|
19
|
+
Screen["RevenueIntro"] = "revenue-intro";
|
|
18
20
|
Screen["HealthCheck"] = "health-check";
|
|
19
21
|
Screen["Setup"] = "setup";
|
|
20
22
|
Screen["Auth"] = "auth";
|
|
@@ -28,59 +30,33 @@ export var Screen;
|
|
|
28
30
|
/** Named flows the router can run */
|
|
29
31
|
export var Flow;
|
|
30
32
|
(function (Flow) {
|
|
31
|
-
Flow["
|
|
33
|
+
Flow["PostHogIntegration"] = "posthog-integration";
|
|
34
|
+
Flow["RevenueAnalyticsSetup"] = "revenue-analytics-setup";
|
|
35
|
+
Flow["AgentSkill"] = "agent-skill";
|
|
32
36
|
Flow["McpAdd"] = "mcp-add";
|
|
33
37
|
Flow["McpRemove"] = "mcp-remove";
|
|
34
38
|
})(Flow || (Flow = {}));
|
|
39
|
+
// ── Derived from WORKFLOW_REGISTRY ───────────────────────────────────
|
|
40
|
+
/** Raw workflow step arrays — used by the store for gate/onInit definitions. */
|
|
41
|
+
export const WORKFLOW_STEPS = {
|
|
42
|
+
...Object.fromEntries(WORKFLOW_REGISTRY.map((c) => [c.flowKey, c.steps])),
|
|
43
|
+
[Flow.AgentSkill]: AGENT_SKILL_STEPS,
|
|
44
|
+
};
|
|
35
45
|
/**
|
|
36
|
-
*
|
|
46
|
+
* All flow pipelines.
|
|
47
|
+
*
|
|
48
|
+
* Workflow-based flows are derived from the registry.
|
|
49
|
+
* MCP add/remove flows are standalone.
|
|
37
50
|
*/
|
|
38
|
-
function needsSetup(session) {
|
|
39
|
-
const config = session.frameworkConfig;
|
|
40
|
-
if (!config?.metadata.setup?.questions)
|
|
41
|
-
return false;
|
|
42
|
-
return config.metadata.setup.questions.some((q) => !(q.key in session.frameworkContext));
|
|
43
|
-
}
|
|
44
|
-
/** All flow pipelines. Add new screens by appending entries. */
|
|
45
51
|
export const FLOWS = {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
if (!s.readinessResult)
|
|
55
|
-
return false;
|
|
56
|
-
if (s.readinessResult.decision === WizardReadiness.No)
|
|
57
|
-
return s.outageDismissed;
|
|
58
|
-
return true;
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
screen: Screen.Setup,
|
|
63
|
-
show: needsSetup,
|
|
64
|
-
isComplete: (s) => !needsSetup(s),
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
screen: Screen.Auth,
|
|
68
|
-
isComplete: (s) => s.credentials !== null,
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
screen: Screen.Run,
|
|
72
|
-
isComplete: (s) => s.runPhase === RunPhase.Completed || s.runPhase === RunPhase.Error,
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
screen: Screen.Mcp,
|
|
76
|
-
isComplete: (s) => s.mcpComplete,
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
screen: Screen.Outro,
|
|
80
|
-
isComplete: (s) => s.outroDismissed,
|
|
81
|
-
},
|
|
82
|
-
{ screen: Screen.Skills },
|
|
83
|
-
],
|
|
52
|
+
// Derive workflow flows from registry
|
|
53
|
+
...Object.fromEntries(WORKFLOW_REGISTRY.map((c) => [
|
|
54
|
+
c.flowKey,
|
|
55
|
+
workflowToFlowEntries(c.steps),
|
|
56
|
+
])),
|
|
57
|
+
// Generic agent skill flow
|
|
58
|
+
[Flow.AgentSkill]: workflowToFlowEntries(AGENT_SKILL_STEPS),
|
|
59
|
+
// Standalone MCP flows
|
|
84
60
|
[Flow.McpAdd]: [
|
|
85
61
|
{
|
|
86
62
|
screen: Screen.McpAdd,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flows.js","sourceRoot":"","sources":["../../../../src/ui/tui/flows.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"flows.js","sourceRoot":"","sources":["../../../../src/ui/tui/flows.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EACL,qBAAqB,GAEtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAE7E,wEAAwE;AAExE,+CAA+C;AAC/C,MAAM,CAAN,IAAY,MAYX;AAZD,WAAY,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EAAE,CAAC,CAAC,CAAC,WAAW;SACjC;QACD,EAAE,MAAM,EAAE,MAAM,CAAC,KAAK,EAAE;KACzB;IAED,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE;QAChB;YACE,MAAM,EAAE,MAAM,CAAC,SAAS;YACxB,UAAU,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW;SACjC;QACD,EAAE,MAAM,EAAE,MAAM,CAAC,KAAK,EAAE;KACzB;CACF,CAAC","sourcesContent":["/**\n * Flow pipelines — declarative screen sequences for each wizard flow.\n *\n * Owns the Screen and Flow enums (re-exported by router.ts) to avoid\n * circular imports between router ↔ flows.\n *\n * Workflow-based flows are derived from WORKFLOW_REGISTRY via\n * workflowToFlowEntries(). MCP add/remove flows are standalone since\n * they don't go through the agent runner.\n */\n\nimport type { WizardSession } from '../../lib/wizard-session.js';\nimport {\n workflowToFlowEntries,\n type Workflow,\n} from '../../lib/workflows/workflow-step.js';\nimport { WORKFLOW_REGISTRY } from '../../lib/workflows/workflow-registry.js';\nimport { AGENT_SKILL_STEPS } from '../../lib/workflows/agent-skill/index.js';\n\n// ── Screen + Flow enums ──────────────────────────────────────────────\n\n/** Screens that participate in linear flows */\nexport enum Screen {\n Intro = 'intro',\n RevenueIntro = 'revenue-intro',\n HealthCheck = 'health-check',\n Setup = 'setup',\n Auth = 'auth',\n Run = 'run',\n Mcp = 'mcp',\n Skills = 'skills',\n Outro = 'outro',\n McpAdd = 'mcp-add',\n McpRemove = 'mcp-remove',\n}\n\n/** Named flows the router can run */\nexport enum Flow {\n PostHogIntegration = 'posthog-integration',\n RevenueAnalyticsSetup = 'revenue-analytics-setup',\n AgentSkill = 'agent-skill',\n McpAdd = 'mcp-add',\n McpRemove = 'mcp-remove',\n}\n\n// ── Flow definitions ─────────────────────────────────────────────────\n\nexport interface FlowEntry {\n /** Screen to show */\n screen: Screen;\n /** If provided, screen is skipped when this returns false. Omit = always show. */\n show?: (session: WizardSession) => boolean;\n /** If provided, screen is considered complete when this returns true. */\n isComplete?: (session: WizardSession) => boolean;\n}\n\n// ── Derived from WORKFLOW_REGISTRY ───────────────────────────────────\n\n/** Raw workflow step arrays — used by the store for gate/onInit definitions. */\nexport const WORKFLOW_STEPS: Partial<Record<Flow, Workflow>> = {\n ...(Object.fromEntries(\n WORKFLOW_REGISTRY.map((c) => [c.flowKey, c.steps]),\n ) as Partial<Record<Flow, Workflow>>),\n [Flow.AgentSkill]: AGENT_SKILL_STEPS,\n};\n\n/**\n * All flow pipelines.\n *\n * Workflow-based flows are derived from the registry.\n * MCP add/remove flows are standalone.\n */\nexport const FLOWS: Record<Flow, FlowEntry[]> = {\n // Derive workflow flows from registry\n ...(Object.fromEntries(\n WORKFLOW_REGISTRY.map((c) => [\n c.flowKey,\n workflowToFlowEntries(c.steps) as FlowEntry[],\n ]),\n ) as Record<Flow, FlowEntry[]>),\n\n // Generic agent skill flow\n [Flow.AgentSkill]: workflowToFlowEntries(AGENT_SKILL_STEPS) as FlowEntry[],\n\n // Standalone MCP flows\n [Flow.McpAdd]: [\n {\n screen: Screen.McpAdd,\n isComplete: (s) => s.mcpComplete,\n },\n { screen: Screen.Outro },\n ],\n\n [Flow.McpRemove]: [\n {\n screen: Screen.McpRemove,\n isComplete: (s) => s.mcpComplete,\n },\n { screen: Screen.Outro },\n ],\n};\n"]}
|
|
@@ -7,12 +7,15 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import type { WizardUI, SpinnerHandle } from '../wizard-ui.js';
|
|
9
9
|
import type { WizardStore } from './store.js';
|
|
10
|
-
import type { SettingsConflict } from '../../lib/agent-interface.js';
|
|
10
|
+
import type { SettingsConflict } from '../../lib/agent/agent-interface.js';
|
|
11
|
+
import type { WizardReadinessResult } from '../../lib/health-checks/readiness.js';
|
|
12
|
+
import type { OutroData } from '../../lib/wizard-session.js';
|
|
11
13
|
export declare class InkUI implements WizardUI {
|
|
12
14
|
private store;
|
|
13
15
|
constructor(store: WizardStore);
|
|
14
16
|
intro(message: string): void;
|
|
15
17
|
outro(message: string): void;
|
|
18
|
+
outroError(data: OutroData): void;
|
|
16
19
|
setCredentials(credentials: {
|
|
17
20
|
accessToken: string;
|
|
18
21
|
projectApiKey: string;
|
|
@@ -22,8 +25,8 @@ export declare class InkUI implements WizardUI {
|
|
|
22
25
|
setDetectedFramework(label: string): void;
|
|
23
26
|
onEnterScreen(screen: string, fn: () => void): void;
|
|
24
27
|
setLoginUrl(url: string | null): void;
|
|
25
|
-
showBlockingOutage(result:
|
|
26
|
-
setReadinessWarnings(result:
|
|
28
|
+
showBlockingOutage(result: WizardReadinessResult): Promise<void>;
|
|
29
|
+
setReadinessWarnings(result: WizardReadinessResult): void;
|
|
27
30
|
showPortConflict(processInfo: {
|
|
28
31
|
command: string;
|
|
29
32
|
pid: string;
|
|
@@ -33,6 +33,13 @@ export class InkUI {
|
|
|
33
33
|
this.store.setRunPhase(RunPhase.Completed);
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
+
outroError(data) {
|
|
37
|
+
this.store.setOutroData(data);
|
|
38
|
+
// Advance router past the run step so the outro screen renders
|
|
39
|
+
if (this.store.session.runPhase !== RunPhase.Error) {
|
|
40
|
+
this.store.setRunPhase(RunPhase.Error);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
36
43
|
setCredentials(credentials) {
|
|
37
44
|
this.store.setCredentials(credentials);
|
|
38
45
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ink-ui.js","sourceRoot":"","sources":["../../../../src/ui/tui/ink-ui.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"ink-ui.js","sourceRoot":"","sources":["../../../../src/ui/tui/ink-ui.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAOH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAElE,0DAA0D;AAC1D,4CAA4C;AAC5C,MAAM,OAAO,GAAG,iBAAiB,CAAC;AACl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KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;IAClC,CAAC;CACF","sourcesContent":["/**\n * InkUI — Ink-backed implementation of WizardUI.\n *\n * Translates business logic calls into store setter calls.\n * No direct session mutation. No imperative screen transitions.\n * The router derives the active screen from session state.\n */\n\nimport type { WizardUI, SpinnerHandle } from '../wizard-ui.js';\nimport type { WizardStore } from './store.js';\nimport type { SettingsConflict } from '../../lib/agent/agent-interface.js';\nimport type { WizardReadinessResult } from '../../lib/health-checks/readiness.js';\nimport type { OutroData } from '../../lib/wizard-session.js';\nimport { RunPhase, OutroKind } from '../../lib/wizard-session.js';\n\n// Strip ANSI escape codes (chalk formatting) from strings\n// eslint-disable-next-line no-control-regex\nconst ANSI_RE = /\\x1b\\[[0-9;]*m/g;\nfunction stripAnsi(s: string): string {\n return s.replace(ANSI_RE, '');\n}\n\nexport class InkUI implements WizardUI {\n constructor(private store: WizardStore) {}\n\n intro(message: string): void {\n this.store.pushStatus(message);\n }\n\n outro(message: string): void {\n this.store.pushStatus(stripAnsi(message));\n\n if (!this.store.session.outroData) {\n this.store.setOutroData({\n kind: OutroKind.Success,\n message: stripAnsi(message),\n });\n }\n\n // Signal that the main work is done — router resolves to mcp or outro\n if (this.store.session.runPhase === RunPhase.Running) {\n this.store.setRunPhase(RunPhase.Completed);\n }\n }\n\n outroError(data: OutroData): void {\n this.store.setOutroData(data);\n // Advance router past the run step so the outro screen renders\n if (this.store.session.runPhase !== RunPhase.Error) {\n this.store.setRunPhase(RunPhase.Error);\n }\n }\n\n setCredentials(credentials: {\n accessToken: string;\n projectApiKey: string;\n host: string;\n projectId: number;\n }): void {\n this.store.setCredentials(credentials);\n }\n\n setDetectedFramework(label: string): void {\n this.store.setDetectedFramework(label);\n }\n\n onEnterScreen(screen: string, fn: () => void): void {\n this.store.onEnterScreen(\n screen as Parameters<WizardStore['onEnterScreen']>[0],\n fn,\n );\n }\n\n setLoginUrl(url: string | null): void {\n this.store.setLoginUrl(url);\n }\n\n showBlockingOutage(result: WizardReadinessResult): Promise<void> {\n // In the TUI, the HealthCheckScreen handles outage display.\n // This is only called from agent-runner for the CI fallback path.\n this.store.setReadinessResult(result);\n return Promise.resolve();\n }\n\n setReadinessWarnings(result: WizardReadinessResult): void {\n this.store.setReadinessResult(result);\n }\n\n showPortConflict(processInfo: {\n command: string;\n pid: string;\n user: string;\n }): Promise<void> {\n return this.store.showPortConflict(processInfo);\n }\n\n showSettingsOverride(\n conflicts: SettingsConflict[],\n backupAndFix: () => boolean,\n ): Promise<void> {\n return this.store.showSettingsOverride(conflicts, backupAndFix);\n }\n\n showAuthError(): void {\n this.store.showAuthError();\n }\n\n startRun(): void {\n this.store.setRunPhase(RunPhase.Running);\n }\n\n cancel(message: string): void {\n this.store.pushStatus(message);\n }\n\n log = {\n info: (message: string): void => {\n this.store.pushStatus(message);\n },\n warn: (message: string): void => {\n this.store.pushStatus(message);\n },\n error: (message: string): void => {\n this.store.pushStatus(message);\n },\n success: (message: string): void => {\n this.store.pushStatus(message);\n },\n step: (message: string): void => {\n this.store.pushStatus(message);\n },\n };\n\n note(message: string): void {\n this.store.pushStatus(message);\n }\n\n spinner(): SpinnerHandle {\n return {\n start: (message?: string) => {\n if (message) this.store.pushStatus(message);\n },\n stop: (message?: string) => {\n if (message) this.store.pushStatus(message);\n },\n message: (msg?: string) => {\n if (msg) this.store.pushStatus(msg);\n },\n };\n }\n\n pushStatus(message: string): void {\n this.store.pushStatus(message);\n }\n\n syncTodos(\n todos: Array<{ content: string; status: string; activeForm?: string }>,\n ): void {\n this.store.syncTodos(todos);\n }\n\n setEventPlan(events: Array<{ name: string; description: string }>): void {\n this.store.setEventPlan(events);\n }\n}\n"]}
|
|
@@ -10,6 +10,8 @@ export interface ProgressItem {
|
|
|
10
10
|
interface ProgressListProps {
|
|
11
11
|
items: ProgressItem[];
|
|
12
12
|
title?: string;
|
|
13
|
+
workflowLabel?: string | null;
|
|
14
|
+
skillId?: string | null;
|
|
13
15
|
}
|
|
14
|
-
export declare const ProgressList: ({ items, title }: ProgressListProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare const ProgressList: ({ items, title, workflowLabel, skillId, }: ProgressListProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
17
|
export {};
|
|
@@ -7,7 +7,7 @@ import { Box, Text } from 'ink';
|
|
|
7
7
|
import { Spinner } from '@inkjs/ui';
|
|
8
8
|
import { Colors, Icons } from '../styles.js';
|
|
9
9
|
import { LoadingBox } from './LoadingBox.js';
|
|
10
|
-
export const ProgressList = ({ items, title }) => {
|
|
10
|
+
export const ProgressList = ({ items, title, workflowLabel, skillId, }) => {
|
|
11
11
|
const completed = items.filter((t) => t.status === 'completed').length;
|
|
12
12
|
const total = items.length;
|
|
13
13
|
return (_jsxs(Box, { flexDirection: "column", children: [title && (_jsxs(_Fragment, { children: [_jsx(Text, { bold: true, children: title }), _jsx(Text, { children: " " })] })), items.length === 0 && _jsx(LoadingBox, { message: "Analyzing project..." }), items.map((item, i) => {
|
|
@@ -27,6 +27,6 @@ export const ProgressList = ({ items, title }) => {
|
|
|
27
27
|
return (_jsxs(Text, { children: [_jsx(Text, { color: color, children: icon }), _jsxs(Text, { dimColor: item.status === 'pending', children: [" ", label] })] }, i));
|
|
28
28
|
}), total > 0 && (_jsxs(Box, { marginTop: 1, gap: 1, children: [_jsx(Spinner, {}), _jsx(Text, { dimColor: true, children: completed < total
|
|
29
29
|
? `Progress: ${completed}/${total} completed`
|
|
30
|
-
: 'Cleaning up...' })] }))] }));
|
|
30
|
+
: 'Cleaning up...' })] })), (workflowLabel || skillId) && (_jsxs(Box, { flexDirection: "column", marginTop: 2, children: [workflowLabel && _jsxs(Text, { dimColor: true, children: ["workflow: ", workflowLabel] }), skillId && _jsxs(Text, { dimColor: true, children: ["skill: ", skillId] })] }))] }));
|
|
31
31
|
};
|
|
32
32
|
//# sourceMappingURL=ProgressList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressList.js","sourceRoot":"","sources":["../../../../../src/ui/tui/primitives/ProgressList.tsx"],"names":[],"mappings":";AAAA;;;GAGG;AAEH,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"ProgressList.js","sourceRoot":"","sources":["../../../../../src/ui/tui/primitives/ProgressList.tsx"],"names":[],"mappings":";AAAA;;;GAGG;AAEH,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAe7C,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAC3B,KAAK,EACL,KAAK,EACL,aAAa,EACb,OAAO,GACW,EAAE,EAAE;IACtB,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,WAAW,CAAC,CAAC,MAAM,CAAC;IACvE,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC;IAE3B,OAAO,CACL,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,aACxB,KAAK,IAAI,CACR,8BACE,KAAC,IAAI,IAAC,IAAI,kBAAE,KAAK,GAAQ,EACzB,KAAC,IAAI,oBAAS,IACb,CACJ,EACA,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,KAAC,UAAU,IAAC,OAAO,EAAC,sBAAsB,GAAG,EACnE,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE;gBACrB,MA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C,QAAQ,iCAAY,aAAa,IAAQ,EAChE,OAAO,IAAI,MAAC,IAAI,IAAC,QAAQ,8BAAS,OAAO,IAAQ,IAC9C,CACP,IACG,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/**\n * ProgressList — Reusable task checklist with status icons.\n * Extracted from StatusTab logic.\n */\n\nimport { Box, Text } from 'ink';\nimport { Spinner } from '@inkjs/ui';\nimport { Colors, Icons } from '../styles.js';\nimport { LoadingBox } from './LoadingBox.js';\n\nexport interface ProgressItem {\n label: string;\n activeForm?: string;\n status: 'pending' | 'in_progress' | 'completed';\n}\n\ninterface ProgressListProps {\n items: ProgressItem[];\n title?: string;\n workflowLabel?: string | null;\n skillId?: string | null;\n}\n\nexport const ProgressList = ({\n items,\n title,\n workflowLabel,\n skillId,\n}: ProgressListProps) => {\n const completed = items.filter((t) => t.status === 'completed').length;\n const total = items.length;\n\n return (\n <Box flexDirection=\"column\">\n {title && (\n <>\n <Text bold>{title}</Text>\n <Text> </Text>\n </>\n )}\n {items.length === 0 && <LoadingBox message=\"Analyzing project...\" />}\n {items.map((item, i) => {\n const icon =\n item.status === 'completed'\n ? Icons.squareFilled\n : item.status === 'in_progress'\n ? Icons.triangleRight\n : Icons.squareOpen;\n const color =\n item.status === 'completed'\n ? Colors.success\n : item.status === 'in_progress'\n ? Colors.primary\n : Colors.muted;\n const label =\n item.status === 'in_progress' && item.activeForm\n ? item.activeForm\n : item.label;\n\n return (\n <Text key={i}>\n <Text color={color}>{icon}</Text>\n <Text dimColor={item.status === 'pending'}> {label}</Text>\n </Text>\n );\n })}\n {total > 0 && (\n <Box marginTop={1} gap={1}>\n <Spinner />\n <Text dimColor>\n {completed < total\n ? `Progress: ${completed}/${total} completed`\n : 'Cleaning up...'}\n </Text>\n </Box>\n )}\n {(workflowLabel || skillId) && (\n <Box flexDirection=\"column\" marginTop={2}>\n {workflowLabel && <Text dimColor>workflow: {workflowLabel}</Text>}\n {skillId && <Text dimColor>skill: {skillId}</Text>}\n </Box>\n )}\n </Box>\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.js","sourceRoot":"","sources":["../../../../src/ui/tui/router.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAkB,MAAM,YAAY,CAAC;AAEjE,gEAAgE;AAChE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;AAGxB,yEAAyE;AAEzE,+CAA+C;AAC/C,MAAM,CAAN,IAAY,OAKX;AALD,WAAY,OAAO;IACjB,iDAAsC,CAAA;IACtC,+CAAoC,CAAA;IACpC,yCAA8B,CAAA;IAC9B,mCAAwB,CAAA;AAC1B,CAAC,EALW,OAAO,KAAP,OAAO,QAKlB;AAKD,yEAAyE;AAEzE,MAAM,OAAO,YAAY;IACf,IAAI,CAAc;IAClB,QAAQ,CAAO;IACf,QAAQ,GAAc,EAAE,CAAC;IAEjC,YAAY,WAAiB,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"router.js","sourceRoot":"","sources":["../../../../src/ui/tui/router.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAkB,MAAM,YAAY,CAAC;AAEjE,gEAAgE;AAChE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;AAGxB,yEAAyE;AAEzE,+CAA+C;AAC/C,MAAM,CAAN,IAAY,OAKX;AALD,WAAY,OAAO;IACjB,iDAAsC,CAAA;IACtC,+CAAoC,CAAA;IACpC,yCAA8B,CAAA;IAC9B,mCAAwB,CAAA;AAC1B,CAAC,EALW,OAAO,KAAP,OAAO,QAKlB;AAKD,yEAAyE;AAEzE,MAAM,OAAO,YAAY;IACf,IAAI,CAAc;IAClB,QAAQ,CAAO;IACf,QAAQ,GAAc,EAAE,CAAC;IAEjC,YAAY,WAAiB,IAAI,CAAC,kBAAkB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IAClC,CAAC;IAED;;;OAGG;IACH,WAAW,CAAC,OAAgB;QAC1B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,UAAU;QACR,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;IACtB,CAAC;IAED;;OAEG;IACK,cAAc,GAA0B,IAAI,CAAC;IAErD,IAAI,gBAAgB;QAClB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAED,6DAA6D;IAC7D,aAAa,CAAC,GAA0B;QACtC,IAAI,CAAC,cAAc,GAAG,GAAG,CAAC;IAC5B,CAAC;CACF","sourcesContent":["/**\n * WizardRouter — declarative flow pipelines + overlay stack.\n *\n * Two layers:\n * Flow cursor — linear pipeline of screens, advanced with next()\n * Overlay stack — interrupts (outage, auth-expired, etc.) that push/pop\n *\n * The visible screen is: top of overlay stack if non-empty, otherwise the flow cursor.\n *\n * Adding a flow screen = append to a pipeline array.\n * Adding an overlay = call pushOverlay() from anywhere.\n * No switch statements, no hardcoded transitions in business logic.\n */\n\nimport type { WizardSession } from '../../lib/wizard-session.js';\nimport { FLOWS, Screen, Flow, type FlowEntry } from './flows.js';\n\n// Re-export so existing imports from './router.js' keep working\nexport { Screen, Flow };\nexport type { FlowEntry };\n\n// ── Screen name taxonomy ──────────────────────────────────────────────\n\n/** Screens that interrupt flows as overlays */\nexport enum Overlay {\n SettingsOverride = 'settings-override',\n ManagedSettings = 'managed-settings',\n PortConflict = 'port-conflict',\n AuthError = 'auth-error',\n}\n\n/** Union of all screen names */\nexport type ScreenName = Screen | Overlay;\n\n// ── Router ────────────────────────────────────────────────────────────\n\nexport class WizardRouter {\n private flow: FlowEntry[];\n private flowName: Flow;\n private overlays: Overlay[] = [];\n\n constructor(flowName: Flow = Flow.PostHogIntegration) {\n this.flowName = flowName;\n this.flow = FLOWS[flowName];\n }\n\n /**\n * Resolve which screen should be active based on session state.\n * Walks the flow pipeline, skipping hidden entries and completed entries,\n * returns the first incomplete screen.\n */\n resolve(session: WizardSession): ScreenName {\n if (this.overlays.length > 0) {\n return this.overlays[this.overlays.length - 1];\n }\n\n for (const entry of this.flow) {\n if (entry.show && !entry.show(session)) continue;\n if (entry.isComplete && entry.isComplete(session)) continue;\n return entry.screen;\n }\n\n // All entries complete — show the last screen (outro)\n return this.flow[this.flow.length - 1].screen;\n }\n\n /** The screen that should be rendered right now. */\n get activeScreen(): ScreenName {\n // Overlays take priority — resolve() handles this too,\n // but activeScreen is called before session is available in some paths\n if (this.overlays.length > 0) {\n return this.overlays[this.overlays.length - 1];\n }\n return this.flow[0].screen;\n }\n\n /** The name of the active flow. */\n get activeFlow(): Flow {\n return this.flowName;\n }\n\n /** Whether an overlay is currently active. */\n get hasOverlay(): boolean {\n return this.overlays.length > 0;\n }\n\n /**\n * Push an overlay that interrupts the current flow.\n * The flow resumes when the overlay is dismissed via popOverlay().\n */\n pushOverlay(overlay: Overlay): void {\n this.overlays.push(overlay);\n }\n\n /**\n * Dismiss the topmost overlay. The flow screen underneath resumes.\n */\n popOverlay(): void {\n this.overlays.pop();\n }\n\n /**\n * Direction hint for screen transitions.\n */\n private _lastDirection: 'push' | 'pop' | null = null;\n\n get lastNavDirection(): 'push' | 'pop' | null {\n return this._lastDirection;\n }\n\n /** @internal — called by store wrapper to track direction */\n _setDirection(dir: 'push' | 'pop' | null): void {\n this._lastDirection = dir;\n }\n}\n"]}
|
|
@@ -5,6 +5,7 @@ import { SettingsOverrideScreen } from './screens/SettingsOverrideScreen.js';
|
|
|
5
5
|
import { ManagedSettingsScreen } from './screens/ManagedSettingsScreen.js';
|
|
6
6
|
import { PortConflictScreen } from './screens/PortConflictScreen.js';
|
|
7
7
|
import { IntroScreen } from './screens/IntroScreen.js';
|
|
8
|
+
import { RevenueIntroScreen } from './screens/RevenueIntroScreen.js';
|
|
8
9
|
import { SetupScreen } from './screens/SetupScreen.js';
|
|
9
10
|
import { AuthScreen } from './screens/AuthScreen.js';
|
|
10
11
|
import { RunScreen } from './screens/RunScreen.js';
|
|
@@ -27,6 +28,7 @@ export function createScreens(store, services) {
|
|
|
27
28
|
[Overlay.AuthError]: _jsx(AuthErrorScreen, {}),
|
|
28
29
|
// Wizard flow
|
|
29
30
|
[Screen.Intro]: _jsx(IntroScreen, { store: store }),
|
|
31
|
+
[Screen.RevenueIntro]: _jsx(RevenueIntroScreen, { store: store }),
|
|
30
32
|
[Screen.HealthCheck]: _jsx(HealthCheckScreen, { store: store }),
|
|
31
33
|
[Screen.Setup]: _jsx(SetupScreen, { store: store }),
|
|
32
34
|
[Screen.Auth]: _jsx(AuthScreen, { store: store }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screen-registry.js","sourceRoot":"","sources":["../../../../src/ui/tui/screen-registry.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAmB,MAAM,aAAa,CAAC;AAE/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE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AK,GAAI;QAE7C,uBAAuB;QACvB,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CACf,KAAC,SAAS,IAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,CAAC,YAAY,EAAE,UAAU,SAAG,CACzE;QACD,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAClB,KAAC,SAAS,IACR,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,QAAQ,CAAC,YAAY,EAChC,IAAI,EAAC,QAAQ,EACb,UAAU,SACV,CACH;KACF,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Screen registry — maps screen names to React components.\n *\n * Adding a new screen:\n * 1. Create the component in screens/\n * 2. Add an entry here\n * 3. Add the screen name to the router flow (router.ts)\n *\n * App.tsx never needs to change.\n */\n\nimport type { ReactNode } from 'react';\nimport type { WizardStore } from './store.js';\nimport { Screen, Overlay, type ScreenName } from './router.js';\n\nimport { HealthCheckScreen } from './screens/health/HealthCheckScreen.js';\nimport { SettingsOverrideScreen } from './screens/SettingsOverrideScreen.js';\nimport { ManagedSettingsScreen } from './screens/ManagedSettingsScreen.js';\nimport { PortConflictScreen } from './screens/PortConflictScreen.js';\nimport { IntroScreen } from './screens/IntroScreen.js';\nimport { SetupScreen } from './screens/SetupScreen.js';\nimport { AuthScreen } from './screens/AuthScreen.js';\nimport { RunScreen } from './screens/RunScreen.js';\nimport { McpScreen } from './screens/McpScreen.js';\nimport { SkillsScreen } from './screens/SkillsScreen.js';\nimport { OutroScreen } from './screens/OutroScreen.js';\nimport { AuthErrorScreen } from './screens/AuthErrorScreen.js';\nimport { createMcpInstaller } from './services/mcp-installer.js';\nimport type { McpInstaller } from './services/mcp-installer.js';\n\nexport interface ScreenServices {\n mcpInstaller: McpInstaller;\n}\n\nexport function createServices(): ScreenServices {\n return {\n mcpInstaller: createMcpInstaller(),\n };\n}\n\nexport function createScreens(\n store: WizardStore,\n services: ScreenServices,\n): Record<ScreenName, ReactNode> {\n return {\n // Overlays\n [Overlay.SettingsOverride]: <SettingsOverrideScreen store={store} />,\n [Overlay.ManagedSettings]: <ManagedSettingsScreen store={store} />,\n [Overlay.PortConflict]: <PortConflictScreen store={store} />,\n [Overlay.AuthError]: <AuthErrorScreen />,\n\n // Wizard flow\n [Screen.Intro]: <IntroScreen store={store} />,\n [Screen.HealthCheck]: <HealthCheckScreen store={store} />,\n [Screen.Setup]: <SetupScreen store={store} />,\n [Screen.Auth]: <AuthScreen store={store} />,\n [Screen.Run]: <RunScreen store={store} />,\n [Screen.Mcp]: <McpScreen store={store} installer={services.mcpInstaller} />,\n [Screen.Skills]: <SkillsScreen store={store} />,\n [Screen.Outro]: <OutroScreen store={store} />,\n\n // Standalone MCP flows\n [Screen.McpAdd]: (\n <McpScreen store={store} installer={services.mcpInstaller} standalone />\n ),\n [Screen.McpRemove]: (\n <McpScreen\n store={store}\n installer={services.mcpInstaller}\n mode=\"remove\"\n standalone\n />\n ),\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"screen-registry.js","sourceRoot":"","sources":["../../../../src/ui/tui/screen-registry.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAmB,MAAM,aAAa,CAAC;AAE/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EA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,KAAK,EAAE,KAAK,GAAI;QACzC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,KAAC,SAAS,IAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,CAAC,YAAY,GAAI;QAC3E,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,KAAC,YAAY,IAAC,KAAK,EAAE,KAAK,GAAI;QAC/C,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,KAAC,WAAW,IAAC,KAAK,EAAE,KAAK,GAAI;QAE7C,uBAAuB;QACvB,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CACf,KAAC,SAAS,IAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,CAAC,YAAY,EAAE,UAAU,SAAG,CACzE;QACD,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAClB,KAAC,SAAS,IACR,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,QAAQ,CAAC,YAAY,EAChC,IAAI,EAAC,QAAQ,EACb,UAAU,SACV,CACH;KACF,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Screen registry — maps screen names to React components.\n *\n * Adding a new screen:\n * 1. Create the component in screens/\n * 2. Add an entry here\n * 3. Add the screen name to the router flow (router.ts)\n *\n * App.tsx never needs to change.\n */\n\nimport type { ReactNode } from 'react';\nimport type { WizardStore } from './store.js';\nimport { Screen, Overlay, type ScreenName } from './router.js';\n\nimport { HealthCheckScreen } from './screens/health/HealthCheckScreen.js';\nimport { SettingsOverrideScreen } from './screens/SettingsOverrideScreen.js';\nimport { ManagedSettingsScreen } from './screens/ManagedSettingsScreen.js';\nimport { PortConflictScreen } from './screens/PortConflictScreen.js';\nimport { IntroScreen } from './screens/IntroScreen.js';\nimport { RevenueIntroScreen } from './screens/RevenueIntroScreen.js';\nimport { SetupScreen } from './screens/SetupScreen.js';\nimport { AuthScreen } from './screens/AuthScreen.js';\nimport { RunScreen } from './screens/RunScreen.js';\nimport { McpScreen } from './screens/McpScreen.js';\nimport { SkillsScreen } from './screens/SkillsScreen.js';\nimport { OutroScreen } from './screens/OutroScreen.js';\nimport { AuthErrorScreen } from './screens/AuthErrorScreen.js';\nimport { createMcpInstaller } from './services/mcp-installer.js';\nimport type { McpInstaller } from './services/mcp-installer.js';\n\nexport interface ScreenServices {\n mcpInstaller: McpInstaller;\n}\n\nexport function createServices(): ScreenServices {\n return {\n mcpInstaller: createMcpInstaller(),\n };\n}\n\nexport function createScreens(\n store: WizardStore,\n services: ScreenServices,\n): Record<ScreenName, ReactNode> {\n return {\n // Overlays\n [Overlay.SettingsOverride]: <SettingsOverrideScreen store={store} />,\n [Overlay.ManagedSettings]: <ManagedSettingsScreen store={store} />,\n [Overlay.PortConflict]: <PortConflictScreen store={store} />,\n [Overlay.AuthError]: <AuthErrorScreen />,\n\n // Wizard flow\n [Screen.Intro]: <IntroScreen store={store} />,\n [Screen.RevenueIntro]: <RevenueIntroScreen store={store} />,\n [Screen.HealthCheck]: <HealthCheckScreen store={store} />,\n [Screen.Setup]: <SetupScreen store={store} />,\n [Screen.Auth]: <AuthScreen store={store} />,\n [Screen.Run]: <RunScreen store={store} />,\n [Screen.Mcp]: <McpScreen store={store} installer={services.mcpInstaller} />,\n [Screen.Skills]: <SkillsScreen store={store} />,\n [Screen.Outro]: <OutroScreen store={store} />,\n\n // Standalone MCP flows\n [Screen.McpAdd]: (\n <McpScreen store={store} installer={services.mcpInstaller} standalone />\n ),\n [Screen.McpRemove]: (\n <McpScreen\n store={store}\n installer={services.mcpInstaller}\n mode=\"remove\"\n standalone\n />\n ),\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManagedSettingsScreen.js","sourceRoot":"","sources":["../../../../../src/ui/tui/screens/ManagedSettingsScreen.tsx"],"names":[],"mappings":";AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,oBAAoB,EAAE,MAAM,O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AGJ,KAAC,IAAI,IAAC,QAAQ,4IAGP,EACN,iBAAiB,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CACnC,MAAC,GAAG,IAAuB,aAAa,EAAC,QAAQ,EAAC,SAAS,EAAE,CAAC,aAC5D,KAAC,IAAI,IAAC,IAAI,kBAAE,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAQ,EAChD,KAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,WAAW,EAAE,CAAC,YACvC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAC1B,MAAC,IAAI,eACF,KAAK,CAAC,MAAM,EAAE,GAAG,EAClB,KAAC,IAAI,IAAC,KAAK,EAAC,QAAQ,EAAC,IAAI,kBACtB,GAAG,GACC,KAJE,GAAG,CAKP,CACR,CAAC,GACE,KAXE,QAAQ,CAAC,MAAM,CAYnB,CACP,CAAC,EACF,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,YACf,KAAC,IAAI,IAAC,QAAQ,2GAGP,GACH,IACO,CAChB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/**\n * ManagedSettingsScreen — Modal when IT/org-managed settings contain overrides\n * that block the Wizard from reaching the PostHog LLM Gateway.\n *\n * Unlike SettingsOverrideScreen, the wizard cannot back up or modify these files.\n * The user must contact their IT administrator to resolve the conflict.\n */\n\nimport { Box, Text } from 'ink';\nimport { useSyncExternalStore } from 'react';\nimport type { WizardStore } from '../store.js';\nimport { ConfirmationInput, ModalOverlay } from '../primitives/index.js';\nimport { Icons } from '../styles.js';\nimport type { SettingsConflict } from '../../../lib/agent-interface.js';\n\nfunction sourceLabel(source: SettingsConflict['source']): string {\n switch (source) {\n case 'managed':\n return 'Managed settings (IT/org-managed)';\n case 'project':\n return '.claude/settings.json';\n default:\n return source;\n }\n}\n\ninterface ManagedSettingsScreenProps {\n store: WizardStore;\n}\n\nexport const ManagedSettingsScreen = ({\n store,\n}: ManagedSettingsScreenProps) => {\n useSyncExternalStore(\n (cb) => store.subscribe(cb),\n () => store.getSnapshot(),\n );\n\n const conflicts = store.session.settingsConflicts;\n const readOnlyConflicts = conflicts?.filter((c) => !c.writable);\n\n if (!readOnlyConflicts || readOnlyConflicts.length === 0) {\n return null;\n }\n\n return (\n <ModalOverlay\n borderColor=\"red\"\n title={`${Icons.warning} Organization settings conflict`}\n width={68}\n footer={\n <ConfirmationInput\n message=\"Contact your IT administrator to resolve this.\"\n confirmLabel=\"\"\n cancelLabel=\"Exit [Esc]\"\n onConfirm={() => process.exit(1)}\n onCancel={() => process.exit(1)}\n />\n }\n >\n <Text dimColor>\n Your organization's managed settings contain overrides that prevent\n the Wizard from reaching the PostHog LLM Gateway.\n </Text>\n {readOnlyConflicts.map((conflict) => (\n <Box key={conflict.source} flexDirection=\"column\" marginTop={1}>\n <Text bold>{sourceLabel(conflict.source)}</Text>\n <Box flexDirection=\"column\" paddingLeft={2}>\n {conflict.keys.map((key) => (\n <Text key={key}>\n {Icons.bullet}{' '}\n <Text color=\"yellow\" bold>\n {key}\n </Text>\n </Text>\n ))}\n </Box>\n </Box>\n ))}\n <Box marginTop={1}>\n <Text dimColor>\n Try running \"claude auth logout\" or contact your IT administrator to\n resolve this.\n </Text>\n </Box>\n </ModalOverlay>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"ManagedSettingsScreen.js","sourceRoot":"","sources":["../../../../../src/ui/tui/screens/ManagedSettingsScreen.tsx"],"names":[],"mappings":";AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAE7C,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAGrC,SAAS,WAAW,CAAC,MAAkC;IACrD,QAAQ,MAAM,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KAAC,IAAI,IAAC,IAAI,kBAAE,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAQ,EAChD,KAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,WAAW,EAAE,CAAC,YACvC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAC1B,MAAC,IAAI,eACF,KAAK,CAAC,MAAM,EAAE,GAAG,EAClB,KAAC,IAAI,IAAC,KAAK,EAAC,QAAQ,EAAC,IAAI,kBACtB,GAAG,GACC,KAJE,GAAG,CAKP,CACR,CAAC,GACE,KAXE,QAAQ,CAAC,MAAM,CAYnB,CACP,CAAC,EACF,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,YACf,KAAC,IAAI,IAAC,QAAQ,2GAGP,GACH,IACO,CAChB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/**\n * ManagedSettingsScreen — Modal when IT/org-managed settings contain overrides\n * that block the Wizard from reaching the PostHog LLM Gateway.\n *\n * Unlike SettingsOverrideScreen, the wizard cannot back up or modify these files.\n * The user must contact their IT administrator to resolve the conflict.\n */\n\nimport { Box, Text } from 'ink';\nimport { useSyncExternalStore } from 'react';\nimport type { WizardStore } from '../store.js';\nimport { ConfirmationInput, ModalOverlay } from '../primitives/index.js';\nimport { Icons } from '../styles.js';\nimport type { SettingsConflict } from '../../../lib/agent/agent-interface.js';\n\nfunction sourceLabel(source: SettingsConflict['source']): string {\n switch (source) {\n case 'managed':\n return 'Managed settings (IT/org-managed)';\n case 'project':\n return '.claude/settings.json';\n default:\n return source;\n }\n}\n\ninterface ManagedSettingsScreenProps {\n store: WizardStore;\n}\n\nexport const ManagedSettingsScreen = ({\n store,\n}: ManagedSettingsScreenProps) => {\n useSyncExternalStore(\n (cb) => store.subscribe(cb),\n () => store.getSnapshot(),\n );\n\n const conflicts = store.session.settingsConflicts;\n const readOnlyConflicts = conflicts?.filter((c) => !c.writable);\n\n if (!readOnlyConflicts || readOnlyConflicts.length === 0) {\n return null;\n }\n\n return (\n <ModalOverlay\n borderColor=\"red\"\n title={`${Icons.warning} Organization settings conflict`}\n width={68}\n footer={\n <ConfirmationInput\n message=\"Contact your IT administrator to resolve this.\"\n confirmLabel=\"\"\n cancelLabel=\"Exit [Esc]\"\n onConfirm={() => process.exit(1)}\n onCancel={() => process.exit(1)}\n />\n }\n >\n <Text dimColor>\n Your organization's managed settings contain overrides that prevent\n the Wizard from reaching the PostHog LLM Gateway.\n </Text>\n {readOnlyConflicts.map((conflict) => (\n <Box key={conflict.source} flexDirection=\"column\" marginTop={1}>\n <Text bold>{sourceLabel(conflict.source)}</Text>\n <Box flexDirection=\"column\" paddingLeft={2}>\n {conflict.keys.map((key) => (\n <Text key={key}>\n {Icons.bullet}{' '}\n <Text color=\"yellow\" bold>\n {key}\n </Text>\n </Text>\n ))}\n </Box>\n </Box>\n ))}\n <Box marginTop={1}>\n <Text dimColor>\n Try running \"claude auth logout\" or contact your IT administrator to\n resolve this.\n </Text>\n </Box>\n </ModalOverlay>\n );\n};\n"]}
|
|
@@ -17,6 +17,6 @@ export const OutroScreen = ({ store }) => {
|
|
|
17
17
|
if (!outroData) {
|
|
18
18
|
return (_jsx(Box, { flexDirection: "column", flexGrow: 1, children: _jsx(Text, { dimColor: true, children: "Finishing up..." }) }));
|
|
19
19
|
}
|
|
20
|
-
return (_jsxs(Box, { flexDirection: "column", flexGrow: 1, children: [outroData.kind === OutroKind.Success && (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Text, { color: "green", bold: true, children: ['\u2714', "
|
|
20
|
+
return (_jsxs(Box, { flexDirection: "column", flexGrow: 1, children: [outroData.kind === OutroKind.Success && (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Text, { color: "green", bold: true, children: ['\u2714', " ", outroData.message || 'Done!'] }), outroData.reportFile && (_jsx(Box, { marginTop: 1, children: _jsxs(Text, { children: ["Check ", _jsxs(Text, { bold: true, children: ["./", outroData.reportFile] }), " for details"] }) })), outroData.changes && outroData.changes.length > 0 && (_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [_jsx(Text, { color: "cyan", bold: true, children: "What the agent did:" }), outroData.changes.map((change, i) => (_jsxs(Text, { children: ['\u2022', " ", change] }, i)))] })), store.eventPlan.length > 0 && (_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [_jsx(Text, { color: "cyan", bold: true, children: "Events added:" }), store.eventPlan.map((event) => (_jsxs(Text, { children: ['\u2022', " ", _jsx(Text, { bold: true, children: event.name }), _jsxs(Text, { dimColor: true, children: [" ", event.description] })] }, event.name)))] })), outroData.docsUrl && (_jsx(Box, { marginTop: 1, children: _jsxs(Text, { children: ["Learn more: ", _jsx(Text, { color: "cyan", children: outroData.docsUrl })] }) })), outroData.continueUrl && (_jsx(Box, { children: _jsxs(Text, { children: ["Continue onboarding:", ' ', _jsx(Text, { color: "cyan", children: outroData.continueUrl })] }) })), _jsx(Box, { marginTop: 1, children: _jsx(Text, { dimColor: true, children: "Note: This wizard uses an LLM agent to analyze and modify your project. Please review the changes made." }) }), _jsx(Box, { children: _jsx(Text, { dimColor: true, children: "How did this work for you? Drop us a line: wizard@posthog.com" }) })] })), outroData.kind === OutroKind.Error && (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Text, { color: "red", bold: true, children: ['\u2718', " ", outroData.message || 'An error occurred'] }), outroData.body && (_jsx(Box, { marginTop: 1, children: _jsx(Text, { dimColor: true, children: outroData.body }) })), outroData.docsUrl && (_jsx(Box, { marginTop: 1, children: _jsxs(Text, { children: ["Docs: ", _jsx(Text, { color: "cyan", children: outroData.docsUrl })] }) }))] })), outroData.kind === OutroKind.Cancel && (_jsx(Box, { flexDirection: "column", children: _jsxs(Text, { color: "yellow", children: ['\u25A0', " ", outroData.message || 'Cancelled'] }) })), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: Colors.muted, children: "Press any key to continue" }) })] }));
|
|
21
21
|
};
|
|
22
22
|
//# sourceMappingURL=OutroScreen.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OutroScreen.js","sourceRoot":"","sources":["../../../../../src/ui/tui/screens/OutroScreen.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAC1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAMtC,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAAE,KAAK,EAAoB,EAAE,EAAE;IACzD,oBAAoB,CAClB,CAAC,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,CAAC,EAC3B,GAAG,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,CAC1B,CAAC;IAEF,QAAQ,CAAC,GAAG,EAAE;QACZ,KAAK,CAAC,iBAAiB,EAAE,CAAC;IAC5B,CAAC,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC;IAE1C,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,OAAO,CACL,KAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,QAAQ,EAAE,CAAC,YACrC,KAAC,IAAI,IAAC,QAAQ,sCAAuB,GACjC,CACP,CAAC;IACJ,CAAC;IAED,OAAO,CACL,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,QAAQ,EAAE,CAAC,aACpC,SAAS,CAAC,IAAI,KAAK,SAAS,CAAC,OAAO,IAAI,CACvC,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,aACzB,MAAC,IAAI,IAAC,KAAK,EAAC,OAAO,EAAC,IAAI,mBACrB,QAAQ,
|
|
1
|
+
{"version":3,"file":"OutroScreen.js","sourceRoot":"","sources":["../../../../../src/ui/tui/screens/OutroScreen.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AED,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,YACf,KAAC,IAAI,IAAC,QAAQ,8HAGP,GACH,EACN,KAAC,GAAG,cACF,KAAC,IAAI,IAAC,QAAQ,oFAEP,GACH,IACF,CACP,EAEA,SAAS,CAAC,IAAI,KAAK,SAAS,CAAC,KAAK,IAAI,CACrC,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,aACzB,MAAC,IAAI,IAAC,KAAK,EAAC,KAAK,EAAC,IAAI,mBACnB,QAAQ,OAAG,SAAS,CAAC,OAAO,IAAI,mBAAmB,IAC/C,EAEN,SAAS,CAAC,IAAI,IAAI,CACjB,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,YACf,KAAC,IAAI,IAAC,QAAQ,kBAAE,SAAS,CAAC,IAAI,GAAQ,GAClC,CACP,EAEA,SAAS,CAAC,OAAO,IAAI,CACpB,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,YACf,MAAC,IAAI,yBACG,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,YAAE,SAAS,CAAC,OAAO,GAAQ,IAC9C,GACH,CACP,IACG,CACP,EAEA,SAAS,CAAC,IAAI,KAAK,SAAS,CAAC,MAAM,IAAI,CACtC,KAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,YACzB,MAAC,IAAI,IAAC,KAAK,EAAC,QAAQ,aACjB,QAAQ,OAAG,SAAS,CAAC,OAAO,IAAI,WAAW,IACvC,GACH,CACP,EAED,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,YACf,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,KAAK,0CAAkC,GACvD,IACF,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/**\n * OutroScreen — Summary after the agent run.\n * Reads store.session.outroData to render success, error, or cancel view.\n * Keeps the process alive until the user presses a key to exit.\n */\n\nimport { Box, Text, useInput } from 'ink';\nimport { useSyncExternalStore } from 'react';\nimport type { WizardStore } from '../store.js';\nimport { OutroKind } from '../../../lib/wizard-session.js';\nimport { Colors } from '../styles.js';\n\ninterface OutroScreenProps {\n store: WizardStore;\n}\n\nexport const OutroScreen = ({ store }: OutroScreenProps) => {\n useSyncExternalStore(\n (cb) => store.subscribe(cb),\n () => store.getSnapshot(),\n );\n\n useInput(() => {\n store.setOutroDismissed();\n });\n\n const outroData = store.session.outroData;\n\n if (!outroData) {\n return (\n <Box flexDirection=\"column\" flexGrow={1}>\n <Text dimColor>Finishing up...</Text>\n </Box>\n );\n }\n\n return (\n <Box flexDirection=\"column\" flexGrow={1}>\n {outroData.kind === OutroKind.Success && (\n <Box flexDirection=\"column\">\n <Text color=\"green\" bold>\n {'\\u2714'} {outroData.message || 'Done!'}\n </Text>\n\n {outroData.reportFile && (\n <Box marginTop={1}>\n <Text>\n Check <Text bold>./{outroData.reportFile}</Text> for details\n </Text>\n </Box>\n )}\n\n {outroData.changes && outroData.changes.length > 0 && (\n <Box flexDirection=\"column\" marginTop={1}>\n <Text color=\"cyan\" bold>\n What the agent did:\n </Text>\n {outroData.changes.map((change, i) => (\n <Text key={i}>\n {'\\u2022'} {change}\n </Text>\n ))}\n </Box>\n )}\n\n {store.eventPlan.length > 0 && (\n <Box flexDirection=\"column\" marginTop={1}>\n <Text color=\"cyan\" bold>\n Events added:\n </Text>\n {store.eventPlan.map((event) => (\n <Text key={event.name}>\n {'\\u2022'} <Text bold>{event.name}</Text>\n <Text dimColor> {event.description}</Text>\n </Text>\n ))}\n </Box>\n )}\n\n {outroData.docsUrl && (\n <Box marginTop={1}>\n <Text>\n Learn more: <Text color=\"cyan\">{outroData.docsUrl}</Text>\n </Text>\n </Box>\n )}\n\n {outroData.continueUrl && (\n <Box>\n <Text>\n Continue onboarding:{' '}\n <Text color=\"cyan\">{outroData.continueUrl}</Text>\n </Text>\n </Box>\n )}\n\n <Box marginTop={1}>\n <Text dimColor>\n Note: This wizard uses an LLM agent to analyze and modify your\n project. Please review the changes made.\n </Text>\n </Box>\n <Box>\n <Text dimColor>\n How did this work for you? Drop us a line: wizard@posthog.com\n </Text>\n </Box>\n </Box>\n )}\n\n {outroData.kind === OutroKind.Error && (\n <Box flexDirection=\"column\">\n <Text color=\"red\" bold>\n {'\\u2718'} {outroData.message || 'An error occurred'}\n </Text>\n\n {outroData.body && (\n <Box marginTop={1}>\n <Text dimColor>{outroData.body}</Text>\n </Box>\n )}\n\n {outroData.docsUrl && (\n <Box marginTop={1}>\n <Text>\n Docs: <Text color=\"cyan\">{outroData.docsUrl}</Text>\n </Text>\n </Box>\n )}\n </Box>\n )}\n\n {outroData.kind === OutroKind.Cancel && (\n <Box flexDirection=\"column\">\n <Text color=\"yellow\">\n {'\\u25A0'} {outroData.message || 'Cancelled'}\n </Text>\n </Box>\n )}\n\n <Box marginTop={1}>\n <Text color={Colors.muted}>Press any key to continue</Text>\n </Box>\n </Box>\n );\n};\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RevenueIntroScreen — Welcome screen for the revenue analytics flow.
|
|
3
|
+
*
|
|
4
|
+
* Renders one of two states:
|
|
5
|
+
* - Detection succeeded: shows detected SDKs + continue/cancel
|
|
6
|
+
* - Detection failed: shows the error + exit prompt
|
|
7
|
+
*
|
|
8
|
+
* Reads `frameworkContext.detectError` and `frameworkContext.detectedPosthogSdks`
|
|
9
|
+
* / `detectedStripeSdks` set by detectRevenuePrerequisites().
|
|
10
|
+
*/
|
|
11
|
+
import type { WizardStore } from '../store.js';
|
|
12
|
+
interface RevenueIntroScreenProps {
|
|
13
|
+
store: WizardStore;
|
|
14
|
+
}
|
|
15
|
+
export declare const RevenueIntroScreen: ({ store }: RevenueIntroScreenProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* RevenueIntroScreen — Welcome screen for the revenue analytics flow.
|
|
4
|
+
*
|
|
5
|
+
* Renders one of two states:
|
|
6
|
+
* - Detection succeeded: shows detected SDKs + continue/cancel
|
|
7
|
+
* - Detection failed: shows the error + exit prompt
|
|
8
|
+
*
|
|
9
|
+
* Reads `frameworkContext.detectError` and `frameworkContext.detectedPosthogSdks`
|
|
10
|
+
* / `detectedStripeSdks` set by detectRevenuePrerequisites().
|
|
11
|
+
*/
|
|
12
|
+
import path from 'path';
|
|
13
|
+
import { Box, Text } from 'ink';
|
|
14
|
+
import { useSyncExternalStore } from 'react';
|
|
15
|
+
import { PickerMenu } from '../primitives/index.js';
|
|
16
|
+
import { POSTHOG_SDKS, STRIPE_SDKS, } from '../../../lib/workflows/revenue-analytics/index.js';
|
|
17
|
+
const WizardTitle = () => (_jsxs(Text, { bold: true, children: [_jsx(Text, { color: "#1D4AFF", children: '\u2588' }), _jsx(Text, { color: "#F54E00", children: '\u2588' }), _jsx(Text, { color: "#F9BD2B", children: '\u2588' }), ' Revenue Analytics Wizard 💸'] }));
|
|
18
|
+
const DetectErrorView = ({ error }) => (_jsxs(Box, { flexDirection: "column", flexGrow: 1, alignItems: "center", justifyContent: "center", children: [_jsx(Box, { flexDirection: "column", alignItems: "center", marginBottom: 1, children: _jsx(WizardTitle, {}) }), _jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsxs(Text, { color: "red", bold: true, children: ['\u2718', " Cannot set up revenue analytics"] }), _jsx(Box, { marginTop: 1, flexDirection: "column", children: _jsx(DetectErrorBody, { error: error }) })] }), _jsx(PickerMenu, { options: [{ label: 'Exit', value: 'exit' }], onSelect: () => process.exit(1) })] }));
|
|
19
|
+
const DetectErrorBody = ({ error }) => {
|
|
20
|
+
switch (error.kind) {
|
|
21
|
+
case 'bad-directory': {
|
|
22
|
+
const reasonText = {
|
|
23
|
+
missing: 'does not exist',
|
|
24
|
+
'not-dir': 'is not a directory',
|
|
25
|
+
unreadable: 'could not be accessed',
|
|
26
|
+
}[error.reason];
|
|
27
|
+
return (_jsxs(_Fragment, { children: [_jsxs(Text, { children: ["This path ", reasonText, ":"] }), _jsxs(Text, { dimColor: true, children: [' ', error.path] })] }));
|
|
28
|
+
}
|
|
29
|
+
case 'no-package-json':
|
|
30
|
+
return (_jsxs(_Fragment, { children: [_jsx(Text, { children: "No package.json found in this directory." }), _jsx(Text, { dimColor: true, children: "Revenue analytics currently supports Node.js / TypeScript projects." }), _jsx(Text, { dimColor: true, children: "Run this command from your project root." })] }));
|
|
31
|
+
case 'no-sdks':
|
|
32
|
+
return (_jsxs(_Fragment, { children: [_jsxs(Text, { children: ["Neither PostHog nor Stripe SDKs detected (scanned", ' ', error.scannedCount, " package.json file", error.scannedCount === 1 ? '' : 's', ")."] }), _jsxs(Box, { marginTop: 1, flexDirection: "column", children: [_jsx(Text, { children: "Revenue analytics requires:" }), _jsxs(Text, { dimColor: true, children: [' \u2022', " A PostHog SDK (", POSTHOG_SDKS.slice(0, 3).join(', '), ", \u2026)"] }), _jsxs(Text, { dimColor: true, children: [' \u2022', " A Stripe SDK (", STRIPE_SDKS.join(', '), ")"] })] }), _jsx(Box, { marginTop: 1, children: _jsxs(Text, { dimColor: true, children: ["Install Stripe and run ", _jsx(Text, { bold: true, children: "npx @posthog/wizard" }), " to set up PostHog."] }) })] }));
|
|
33
|
+
case 'missing-posthog':
|
|
34
|
+
return (_jsxs(_Fragment, { children: [_jsxs(Text, { children: ["Found Stripe (", error.foundStripe.join(', '), ") but no PostHog SDK."] }), _jsx(Box, { marginTop: 1, children: _jsxs(Text, { dimColor: true, children: ["Run ", _jsx(Text, { bold: true, children: "npx @posthog/wizard" }), " first to set up the base PostHog integration."] }) })] }));
|
|
35
|
+
case 'missing-stripe':
|
|
36
|
+
return (_jsxs(_Fragment, { children: [_jsxs(Text, { children: ["Found PostHog (", error.foundPosthog.join(', '), ") but no Stripe SDK."] }), _jsx(Text, { dimColor: true, children: "Revenue analytics currently supports Stripe only." }), _jsxs(Box, { marginTop: 1, flexDirection: "column", children: [_jsx(Text, { dimColor: true, children: "Install one of:" }), STRIPE_SDKS.map((sdk) => (_jsxs(Text, { dimColor: true, children: [' \u2022', " ", sdk] }, sdk)))] })] }));
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
export const RevenueIntroScreen = ({ store }) => {
|
|
40
|
+
useSyncExternalStore((cb) => store.subscribe(cb), () => store.getSnapshot());
|
|
41
|
+
const { session } = store;
|
|
42
|
+
const detectError = session.frameworkContext.detectError;
|
|
43
|
+
const detectedPosthogSdks = session.frameworkContext.detectedPosthogSdks ??
|
|
44
|
+
[];
|
|
45
|
+
const detectedStripeSdks = session.frameworkContext.detectedStripeSdks ?? [];
|
|
46
|
+
const detectedPackagePaths = session.frameworkContext.detectedPackagePaths ??
|
|
47
|
+
[];
|
|
48
|
+
if (detectError) {
|
|
49
|
+
return _jsx(DetectErrorView, { error: detectError });
|
|
50
|
+
}
|
|
51
|
+
return (_jsxs(Box, { flexDirection: "column", flexGrow: 1, alignItems: "center", justifyContent: "center", children: [_jsxs(Box, { flexDirection: "column", alignItems: "center", marginBottom: 1, children: [_jsx(WizardTitle, {}), _jsx(Box, { flexDirection: "column", alignItems: "center", marginTop: 1, children: _jsx(Box, { marginTop: 1, children: _jsx(Text, { children: "Let's wire up your revenue dashboards with Stripe!" }) }) })] }), _jsxs(Box, { flexDirection: "column", children: [_jsxs(Text, { children: [_jsxs(Text, { children: ["Directory ", _jsx(Text, { color: "green", children: '\u2714' }), ' '] }), _jsxs(Text, { children: ['/', path.basename(session.installDir)] })] }), detectedPosthogSdks.length > 0 && (_jsxs(Text, { children: [_jsxs(Text, { children: ["PostHog ", _jsx(Text, { color: "green", children: '\u2714' }), ' '] }), _jsxs(Text, { children: [detectedPosthogSdks.join(', '), " (detected)"] })] })), detectedStripeSdks.length > 0 && (_jsxs(Text, { children: [_jsxs(Text, { children: ["Stripe ", _jsx(Text, { color: "green", children: '\u2714' }), ' '] }), _jsxs(Text, { children: [detectedStripeSdks.join(', '), " (detected)"] })] })), detectedPackagePaths.length > 1 && (_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [_jsxs(Text, { dimColor: true, children: ["Found in ", detectedPackagePaths.length, " packages:"] }), detectedPackagePaths.map((p) => (_jsxs(Text, { dimColor: true, children: [' ', '\u2022', " ", p] }, p)))] })), _jsxs(Box, { flexDirection: "column", marginTop: 1, children: [_jsx(Text, { dimColor: true, children: "What the wizard will do next:" }), _jsxs(Text, { dimColor: true, children: ['\u2022', " Links Stripe customers and their purchases to PostHog persons"] }), _jsxs(Text, { dimColor: true, children: ['\u2022', " Unlocks analytics like revenue per user, top customers, and lifetime value"] })] }), _jsx(Box, { marginTop: 1, children: _jsx(PickerMenu, { options: [
|
|
52
|
+
{ label: 'Continue', value: 'continue' },
|
|
53
|
+
{ label: 'Cancel', value: 'cancel' },
|
|
54
|
+
], onSelect: (value) => {
|
|
55
|
+
const choice = Array.isArray(value) ? value[0] : value;
|
|
56
|
+
if (choice === 'cancel') {
|
|
57
|
+
process.exit(0);
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
store.completeSetup();
|
|
61
|
+
}
|
|
62
|
+
} }) })] })] }));
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=RevenueIntroScreen.js.map
|