@posthog/wizard 2.9.0 → 2.10.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 +40 -0
- package/dist/McpScreen-BmHapIaP.js +3357 -0
- package/dist/McpScreen-BmHapIaP.js.map +1 -0
- package/dist/add-mcp-server-to-clients-DZtISNrs.js +455 -0
- package/dist/add-mcp-server-to-clients-DZtISNrs.js.map +1 -0
- package/dist/agent-runner-CGwrcr57.js +1112 -0
- package/dist/agent-runner-CGwrcr57.js.map +1 -0
- package/dist/agent-skill-BVjJqol6.js +59 -0
- package/dist/agent-skill-BVjJqol6.js.map +1 -0
- package/dist/analytics-C4jO5Qda.js +207 -0
- package/dist/analytics-C4jO5Qda.js.map +1 -0
- package/dist/analytics-CpjaBpx6.js +2 -0
- package/dist/bin.d.ts +1 -2
- package/dist/bin.js +635 -524
- package/dist/bin.js.map +1 -1
- package/dist/craft-pre-release.sh +10 -0
- package/dist/debug-CIyf0ZGx.js +2 -0
- package/dist/debug-CyJ_3dTP.js +201 -0
- package/dist/debug-CyJ_3dTP.js.map +1 -0
- package/dist/defaults-DoVkE0gW.js +234 -0
- package/dist/defaults-DoVkE0gW.js.map +1 -0
- package/dist/detection-CkLpxBCD.js +122 -0
- package/dist/detection-CkLpxBCD.js.map +1 -0
- package/dist/env-api-key-K8TdTDII.js +20 -0
- package/dist/env-api-key-K8TdTDII.js.map +1 -0
- package/dist/file-utils-BWneZy6p.js +38 -0
- package/dist/file-utils-BWneZy6p.js.map +1 -0
- package/dist/generate-version.cjs +11 -0
- package/dist/package-json-BQgl5C3Z.js +2 -0
- package/dist/package-json-Ctq6LSl8.js +25 -0
- package/dist/package-json-Ctq6LSl8.js.map +1 -0
- package/dist/package-manager-nUQ-ebjr.js +222 -0
- package/dist/package-manager-nUQ-ebjr.js.map +1 -0
- package/dist/posthog-integration-BzxdDK4z.js +230 -0
- package/dist/posthog-integration-BzxdDK4z.js.map +1 -0
- package/dist/readiness-Dn7eq8NE.js +2156 -0
- package/dist/readiness-Dn7eq8NE.js.map +1 -0
- package/dist/registry-s55_iuJT.js +2922 -0
- package/dist/registry-s55_iuJT.js.map +1 -0
- package/dist/rolldown-runtime-B_-DWIq7.js +15 -0
- package/dist/router-D5A1Sb4p.js +141 -0
- package/dist/router-D5A1Sb4p.js.map +1 -0
- package/dist/setup-utils-CdDnllRW.js +928 -0
- package/dist/setup-utils-CdDnllRW.js.map +1 -0
- package/dist/smoke-test-ci.sh +165 -0
- package/dist/start-playground-B8qCLu7U.js +1005 -0
- package/dist/start-playground-B8qCLu7U.js.map +1 -0
- package/dist/start-tui-PygiIyNC.js +1887 -0
- package/dist/start-tui-PygiIyNC.js.map +1 -0
- package/dist/steps-CySv8XdD.js +146 -0
- package/dist/steps-CySv8XdD.js.map +1 -0
- package/dist/telemetry-Ct_GGkSO.js +13 -0
- package/dist/telemetry-Ct_GGkSO.js.map +1 -0
- package/dist/wizard-abort-7HUIsqv1.js +39 -0
- package/dist/wizard-abort-7HUIsqv1.js.map +1 -0
- package/dist/wizard-abort-Dhjb2o08.js +2 -0
- package/dist/wizard-session-Db6R023m.js +62 -0
- package/dist/wizard-session-Db6R023m.js.map +1 -0
- package/dist/wizard-session-y7nf6aKH.js +2 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +16 -8
- package/dist/src/__tests__/cli.test.d.ts +0 -1
- package/dist/src/__tests__/cli.test.js +0 -256
- package/dist/src/__tests__/cli.test.js.map +0 -1
- package/dist/src/__tests__/package-json.test.d.ts +0 -1
- package/dist/src/__tests__/package-json.test.js +0 -173
- package/dist/src/__tests__/package-json.test.js.map +0 -1
- package/dist/src/__tests__/wizard-abort.test.d.ts +0 -1
- package/dist/src/__tests__/wizard-abort.test.js +0 -148
- package/dist/src/__tests__/wizard-abort.test.js.map +0 -1
- package/dist/src/frameworks/android/android-wizard-agent.d.ts +0 -6
- package/dist/src/frameworks/android/android-wizard-agent.js +0 -142
- package/dist/src/frameworks/android/android-wizard-agent.js.map +0 -1
- package/dist/src/frameworks/android/utils.d.ts +0 -11
- package/dist/src/frameworks/android/utils.js +0 -97
- package/dist/src/frameworks/android/utils.js.map +0 -1
- package/dist/src/frameworks/angular/angular-wizard-agent.d.ts +0 -4
- package/dist/src/frameworks/angular/angular-wizard-agent.js +0 -65
- package/dist/src/frameworks/angular/angular-wizard-agent.js.map +0 -1
- package/dist/src/frameworks/angular/utils.d.ts +0 -4
- package/dist/src/frameworks/angular/utils.js +0 -9
- package/dist/src/frameworks/angular/utils.js.map +0 -1
- package/dist/src/frameworks/astro/astro-wizard-agent.d.ts +0 -7
- package/dist/src/frameworks/astro/astro-wizard-agent.js +0 -102
- package/dist/src/frameworks/astro/astro-wizard-agent.js.map +0 -1
- package/dist/src/frameworks/astro/utils.d.ts +0 -14
- package/dist/src/frameworks/astro/utils.js +0 -114
- package/dist/src/frameworks/astro/utils.js.map +0 -1
- package/dist/src/frameworks/django/django-wizard-agent.d.ts +0 -8
- package/dist/src/frameworks/django/django-wizard-agent.js +0 -173
- package/dist/src/frameworks/django/django-wizard-agent.js.map +0 -1
- package/dist/src/frameworks/django/utils.d.ts +0 -31
- package/dist/src/frameworks/django/utils.js +0 -306
- package/dist/src/frameworks/django/utils.js.map +0 -1
- package/dist/src/frameworks/fastapi/fastapi-wizard-agent.d.ts +0 -5
- package/dist/src/frameworks/fastapi/fastapi-wizard-agent.js +0 -191
- package/dist/src/frameworks/fastapi/fastapi-wizard-agent.js.map +0 -1
- package/dist/src/frameworks/fastapi/utils.d.ts +0 -26
- package/dist/src/frameworks/fastapi/utils.js +0 -258
- package/dist/src/frameworks/fastapi/utils.js.map +0 -1
- package/dist/src/frameworks/flask/flask-wizard-agent.d.ts +0 -8
- package/dist/src/frameworks/flask/flask-wizard-agent.js +0 -179
- package/dist/src/frameworks/flask/flask-wizard-agent.js.map +0 -1
- package/dist/src/frameworks/flask/utils.d.ts +0 -28
- package/dist/src/frameworks/flask/utils.js +0 -344
- package/dist/src/frameworks/flask/utils.js.map +0 -1
- package/dist/src/frameworks/javascript-node/javascript-node-wizard-agent.d.ts +0 -4
- package/dist/src/frameworks/javascript-node/javascript-node-wizard-agent.js +0 -61
- package/dist/src/frameworks/javascript-node/javascript-node-wizard-agent.js.map +0 -1
- package/dist/src/frameworks/javascript-web/javascript-web-wizard-agent.d.ts +0 -3
- package/dist/src/frameworks/javascript-web/javascript-web-wizard-agent.js +0 -152
- package/dist/src/frameworks/javascript-web/javascript-web-wizard-agent.js.map +0 -1
- package/dist/src/frameworks/javascript-web/utils.d.ts +0 -28
- package/dist/src/frameworks/javascript-web/utils.js +0 -147
- package/dist/src/frameworks/javascript-web/utils.js.map +0 -1
- package/dist/src/frameworks/laravel/laravel-wizard-agent.d.ts +0 -10
- package/dist/src/frameworks/laravel/laravel-wizard-agent.js +0 -182
- package/dist/src/frameworks/laravel/laravel-wizard-agent.js.map +0 -1
- package/dist/src/frameworks/laravel/utils.d.ts +0 -38
- package/dist/src/frameworks/laravel/utils.js +0 -238
- package/dist/src/frameworks/laravel/utils.js.map +0 -1
- package/dist/src/frameworks/nextjs/nextjs-wizard-agent.d.ts +0 -7
- package/dist/src/frameworks/nextjs/nextjs-wizard-agent.js +0 -94
- package/dist/src/frameworks/nextjs/nextjs-wizard-agent.js.map +0 -1
- package/dist/src/frameworks/nextjs/utils.d.ts +0 -12
- package/dist/src/frameworks/nextjs/utils.js +0 -52
- package/dist/src/frameworks/nextjs/utils.js.map +0 -1
- package/dist/src/frameworks/nuxt/nuxt-wizard-agent.d.ts +0 -6
- package/dist/src/frameworks/nuxt/nuxt-wizard-agent.js +0 -77
- package/dist/src/frameworks/nuxt/nuxt-wizard-agent.js.map +0 -1
- package/dist/src/frameworks/python/python-wizard-agent.d.ts +0 -7
- package/dist/src/frameworks/python/python-wizard-agent.js +0 -195
- package/dist/src/frameworks/python/python-wizard-agent.js.map +0 -1
- package/dist/src/frameworks/python/utils.d.ts +0 -28
- package/dist/src/frameworks/python/utils.js +0 -147
- package/dist/src/frameworks/python/utils.js.map +0 -1
- package/dist/src/frameworks/rails/rails-wizard-agent.d.ts +0 -8
- package/dist/src/frameworks/rails/rails-wizard-agent.js +0 -90
- package/dist/src/frameworks/rails/rails-wizard-agent.js.map +0 -1
- package/dist/src/frameworks/rails/utils.d.ts +0 -37
- package/dist/src/frameworks/rails/utils.js +0 -187
- package/dist/src/frameworks/rails/utils.js.map +0 -1
- package/dist/src/frameworks/react-native/react-native-wizard-agent.d.ts +0 -7
- package/dist/src/frameworks/react-native/react-native-wizard-agent.js +0 -89
- package/dist/src/frameworks/react-native/react-native-wizard-agent.js.map +0 -1
- package/dist/src/frameworks/react-native/utils.d.ts +0 -8
- package/dist/src/frameworks/react-native/utils.js +0 -28
- package/dist/src/frameworks/react-native/utils.js.map +0 -1
- package/dist/src/frameworks/react-router/react-router-wizard-agent.d.ts +0 -7
- package/dist/src/frameworks/react-router/react-router-wizard-agent.js +0 -94
- package/dist/src/frameworks/react-router/react-router-wizard-agent.js.map +0 -1
- package/dist/src/frameworks/react-router/utils.d.ts +0 -13
- package/dist/src/frameworks/react-router/utils.js +0 -161
- package/dist/src/frameworks/react-router/utils.js.map +0 -1
- package/dist/src/frameworks/ruby/ruby-wizard-agent.d.ts +0 -7
- package/dist/src/frameworks/ruby/ruby-wizard-agent.js +0 -113
- package/dist/src/frameworks/ruby/ruby-wizard-agent.js.map +0 -1
- package/dist/src/frameworks/ruby/utils.d.ts +0 -25
- package/dist/src/frameworks/ruby/utils.js +0 -158
- package/dist/src/frameworks/ruby/utils.js.map +0 -1
- package/dist/src/frameworks/svelte/svelte-wizard-agent.d.ts +0 -4
- package/dist/src/frameworks/svelte/svelte-wizard-agent.js +0 -61
- package/dist/src/frameworks/svelte/svelte-wizard-agent.js.map +0 -1
- package/dist/src/frameworks/swift/swift-wizard-agent.d.ts +0 -7
- package/dist/src/frameworks/swift/swift-wizard-agent.js +0 -143
- package/dist/src/frameworks/swift/swift-wizard-agent.js.map +0 -1
- package/dist/src/frameworks/swift/utils.d.ts +0 -8
- package/dist/src/frameworks/swift/utils.js +0 -105
- package/dist/src/frameworks/swift/utils.js.map +0 -1
- package/dist/src/frameworks/tanstack-router/tanstack-router-wizard-agent.d.ts +0 -7
- package/dist/src/frameworks/tanstack-router/tanstack-router-wizard-agent.js +0 -96
- package/dist/src/frameworks/tanstack-router/tanstack-router-wizard-agent.js.map +0 -1
- package/dist/src/frameworks/tanstack-router/utils.d.ts +0 -11
- package/dist/src/frameworks/tanstack-router/utils.js +0 -149
- package/dist/src/frameworks/tanstack-router/utils.js.map +0 -1
- package/dist/src/frameworks/tanstack-start/tanstack-start-wizard-agent.d.ts +0 -4
- package/dist/src/frameworks/tanstack-start/tanstack-start-wizard-agent.js +0 -64
- package/dist/src/frameworks/tanstack-start/tanstack-start-wizard-agent.js.map +0 -1
- package/dist/src/frameworks/tanstack-start/utils.d.ts +0 -4
- package/dist/src/frameworks/tanstack-start/utils.js +0 -9
- package/dist/src/frameworks/tanstack-start/utils.js.map +0 -1
- package/dist/src/frameworks/vue/vue-wizard-agent.d.ts +0 -4
- package/dist/src/frameworks/vue/vue-wizard-agent.js +0 -62
- package/dist/src/frameworks/vue/vue-wizard-agent.js.map +0 -1
- package/dist/src/lib/__tests__/agent-interface.test.d.ts +0 -1
- package/dist/src/lib/__tests__/agent-interface.test.js +0 -317
- package/dist/src/lib/__tests__/agent-interface.test.js.map +0 -1
- package/dist/src/lib/__tests__/cloudflare-detection.test.d.ts +0 -1
- package/dist/src/lib/__tests__/cloudflare-detection.test.js +0 -119
- package/dist/src/lib/__tests__/cloudflare-detection.test.js.map +0 -1
- package/dist/src/lib/__tests__/wizard-tools.test.d.ts +0 -1
- package/dist/src/lib/__tests__/wizard-tools.test.js +0 -200
- package/dist/src/lib/__tests__/wizard-tools.test.js.map +0 -1
- package/dist/src/lib/__tests__/yara-hooks.test.d.ts +0 -1
- package/dist/src/lib/__tests__/yara-hooks.test.js +0 -432
- package/dist/src/lib/__tests__/yara-hooks.test.js.map +0 -1
- package/dist/src/lib/__tests__/yara-scanner.test.d.ts +0 -1
- package/dist/src/lib/__tests__/yara-scanner.test.js +0 -613
- package/dist/src/lib/__tests__/yara-scanner.test.js.map +0 -1
- package/dist/src/lib/agent/__tests__/agent-prompt.test.d.ts +0 -1
- package/dist/src/lib/agent/__tests__/agent-prompt.test.js +0 -57
- package/dist/src/lib/agent/__tests__/agent-prompt.test.js.map +0 -1
- package/dist/src/lib/agent/agent-interface.d.ts +0 -171
- package/dist/src/lib/agent/agent-interface.js +0 -1082
- package/dist/src/lib/agent/agent-interface.js.map +0 -1
- package/dist/src/lib/agent/agent-prompt.d.ts +0 -23
- package/dist/src/lib/agent/agent-prompt.js +0 -47
- package/dist/src/lib/agent/agent-prompt.js.map +0 -1
- package/dist/src/lib/agent/agent-runner.d.ts +0 -78
- package/dist/src/lib/agent/agent-runner.js +0 -323
- package/dist/src/lib/agent/agent-runner.js.map +0 -1
- package/dist/src/lib/agent/commandments.d.ts +0 -1
- package/dist/src/lib/agent/commandments.js +0 -26
- package/dist/src/lib/agent/commandments.js.map +0 -1
- package/dist/src/lib/api.d.ts +0 -75
- package/dist/src/lib/api.js +0 -105
- package/dist/src/lib/api.js.map +0 -1
- package/dist/src/lib/cloudflare-detection.d.ts +0 -14
- package/dist/src/lib/cloudflare-detection.js +0 -74
- package/dist/src/lib/cloudflare-detection.js.map +0 -1
- package/dist/src/lib/constants.d.ts +0 -74
- package/dist/src/lib/constants.js +0 -98
- package/dist/src/lib/constants.js.map +0 -1
- package/dist/src/lib/detection/__tests__/context.test.d.ts +0 -1
- package/dist/src/lib/detection/__tests__/context.test.js +0 -72
- package/dist/src/lib/detection/__tests__/context.test.js.map +0 -1
- package/dist/src/lib/detection/__tests__/features.test.d.ts +0 -1
- package/dist/src/lib/detection/__tests__/features.test.js +0 -75
- package/dist/src/lib/detection/__tests__/features.test.js.map +0 -1
- package/dist/src/lib/detection/__tests__/package-manager.test.d.ts +0 -1
- package/dist/src/lib/detection/__tests__/package-manager.test.js +0 -195
- package/dist/src/lib/detection/__tests__/package-manager.test.js.map +0 -1
- package/dist/src/lib/detection/context.d.ts +0 -31
- package/dist/src/lib/detection/context.js +0 -92
- package/dist/src/lib/detection/context.js.map +0 -1
- package/dist/src/lib/detection/features.d.ts +0 -16
- package/dist/src/lib/detection/features.js +0 -56
- package/dist/src/lib/detection/features.js.map +0 -1
- package/dist/src/lib/detection/framework.d.ts +0 -14
- package/dist/src/lib/detection/framework.js +0 -35
- package/dist/src/lib/detection/framework.js.map +0 -1
- package/dist/src/lib/detection/index.d.ts +0 -3
- package/dist/src/lib/detection/index.js +0 -11
- package/dist/src/lib/detection/index.js.map +0 -1
- package/dist/src/lib/detection/package-manager.d.ts +0 -37
- package/dist/src/lib/detection/package-manager.js +0 -183
- package/dist/src/lib/detection/package-manager.js.map +0 -1
- package/dist/src/lib/framework-config.d.ts +0 -175
- package/dist/src/lib/framework-config.js +0 -22
- package/dist/src/lib/framework-config.js.map +0 -1
- package/dist/src/lib/health-checks/__tests__/health-checks.test.d.ts +0 -18
- package/dist/src/lib/health-checks/__tests__/health-checks.test.js +0 -759
- package/dist/src/lib/health-checks/__tests__/health-checks.test.js.map +0 -1
- package/dist/src/lib/health-checks/endpoints.d.ts +0 -4
- package/dist/src/lib/health-checks/endpoints.js +0 -49
- package/dist/src/lib/health-checks/endpoints.js.map +0 -1
- package/dist/src/lib/health-checks/index.d.ts +0 -4
- package/dist/src/lib/health-checks/index.js +0 -24
- package/dist/src/lib/health-checks/index.js.map +0 -1
- package/dist/src/lib/health-checks/readiness.d.ts +0 -29
- package/dist/src/lib/health-checks/readiness.js +0 -188
- package/dist/src/lib/health-checks/readiness.js.map +0 -1
- package/dist/src/lib/health-checks/statuspage.d.ts +0 -9
- package/dist/src/lib/health-checks/statuspage.js +0 -105
- package/dist/src/lib/health-checks/statuspage.js.map +0 -1
- package/dist/src/lib/health-checks/types.d.ts +0 -32
- package/dist/src/lib/health-checks/types.js +0 -10
- package/dist/src/lib/health-checks/types.js.map +0 -1
- package/dist/src/lib/helper-functions.d.ts +0 -1
- package/dist/src/lib/helper-functions.js +0 -6
- package/dist/src/lib/helper-functions.js.map +0 -1
- package/dist/src/lib/middleware/benchmark.d.ts +0 -54
- package/dist/src/lib/middleware/benchmark.js +0 -45
- package/dist/src/lib/middleware/benchmark.js.map +0 -1
- package/dist/src/lib/middleware/benchmarks/cache-tracker.d.ts +0 -44
- package/dist/src/lib/middleware/benchmarks/cache-tracker.js +0 -81
- package/dist/src/lib/middleware/benchmarks/cache-tracker.js.map +0 -1
- package/dist/src/lib/middleware/benchmarks/compaction-tracker.d.ts +0 -29
- package/dist/src/lib/middleware/benchmarks/compaction-tracker.js +0 -60
- package/dist/src/lib/middleware/benchmarks/compaction-tracker.js.map +0 -1
- package/dist/src/lib/middleware/benchmarks/context-size-tracker.d.ts +0 -26
- package/dist/src/lib/middleware/benchmarks/context-size-tracker.js +0 -56
- package/dist/src/lib/middleware/benchmarks/context-size-tracker.js.map +0 -1
- package/dist/src/lib/middleware/benchmarks/cost-tracker.d.ts +0 -16
- package/dist/src/lib/middleware/benchmarks/cost-tracker.js +0 -76
- package/dist/src/lib/middleware/benchmarks/cost-tracker.js.map +0 -1
- package/dist/src/lib/middleware/benchmarks/duration-tracker.d.ts +0 -20
- package/dist/src/lib/middleware/benchmarks/duration-tracker.js +0 -40
- package/dist/src/lib/middleware/benchmarks/duration-tracker.js.map +0 -1
- package/dist/src/lib/middleware/benchmarks/index.d.ts +0 -9
- package/dist/src/lib/middleware/benchmarks/index.js +0 -60
- package/dist/src/lib/middleware/benchmarks/index.js.map +0 -1
- package/dist/src/lib/middleware/benchmarks/json-writer.d.ts +0 -15
- package/dist/src/lib/middleware/benchmarks/json-writer.js +0 -144
- package/dist/src/lib/middleware/benchmarks/json-writer.js.map +0 -1
- package/dist/src/lib/middleware/benchmarks/summary.d.ts +0 -9
- package/dist/src/lib/middleware/benchmarks/summary.js +0 -102
- package/dist/src/lib/middleware/benchmarks/summary.js.map +0 -1
- package/dist/src/lib/middleware/benchmarks/token-tracker.d.ts +0 -40
- package/dist/src/lib/middleware/benchmarks/token-tracker.js +0 -77
- package/dist/src/lib/middleware/benchmarks/token-tracker.js.map +0 -1
- package/dist/src/lib/middleware/benchmarks/turn-counter.d.ts +0 -34
- package/dist/src/lib/middleware/benchmarks/turn-counter.js +0 -59
- package/dist/src/lib/middleware/benchmarks/turn-counter.js.map +0 -1
- package/dist/src/lib/middleware/config.d.ts +0 -24
- package/dist/src/lib/middleware/config.js +0 -78
- package/dist/src/lib/middleware/config.js.map +0 -1
- package/dist/src/lib/middleware/index.d.ts +0 -11
- package/dist/src/lib/middleware/index.js +0 -18
- package/dist/src/lib/middleware/index.js.map +0 -1
- package/dist/src/lib/middleware/phase-detector.d.ts +0 -7
- package/dist/src/lib/middleware/phase-detector.js +0 -64
- package/dist/src/lib/middleware/phase-detector.js.map +0 -1
- package/dist/src/lib/middleware/pipeline.d.ts +0 -29
- package/dist/src/lib/middleware/pipeline.js +0 -82
- package/dist/src/lib/middleware/pipeline.js.map +0 -1
- package/dist/src/lib/middleware/types.d.ts +0 -40
- package/dist/src/lib/middleware/types.js +0 -9
- package/dist/src/lib/middleware/types.js.map +0 -1
- package/dist/src/lib/registry.d.ts +0 -3
- package/dist/src/lib/registry.js +0 -49
- package/dist/src/lib/registry.js.map +0 -1
- package/dist/src/lib/safe-tools.d.ts +0 -2
- package/dist/src/lib/safe-tools.js +0 -215
- package/dist/src/lib/safe-tools.js.map +0 -1
- package/dist/src/lib/skill-install.d.ts +0 -10
- package/dist/src/lib/skill-install.js +0 -23
- package/dist/src/lib/skill-install.js.map +0 -1
- package/dist/src/lib/version.d.ts +0 -1
- package/dist/src/lib/version.js +0 -6
- package/dist/src/lib/version.js.map +0 -1
- package/dist/src/lib/wizard-session.d.ts +0 -146
- package/dist/src/lib/wizard-session.js +0 -116
- package/dist/src/lib/wizard-session.js.map +0 -1
- package/dist/src/lib/wizard-tools.d.ts +0 -91
- package/dist/src/lib/wizard-tools.js +0 -389
- package/dist/src/lib/wizard-tools.js.map +0 -1
- package/dist/src/lib/workflows/__tests__/agent-skill.test.d.ts +0 -1
- package/dist/src/lib/workflows/__tests__/agent-skill.test.js +0 -66
- package/dist/src/lib/workflows/__tests__/agent-skill.test.js.map +0 -1
- package/dist/src/lib/workflows/__tests__/revenue-analytics-detect.test.d.ts +0 -1
- package/dist/src/lib/workflows/__tests__/revenue-analytics-detect.test.js +0 -101
- package/dist/src/lib/workflows/__tests__/revenue-analytics-detect.test.js.map +0 -1
- package/dist/src/lib/workflows/__tests__/workflow-registry.test.d.ts +0 -1
- package/dist/src/lib/workflows/__tests__/workflow-registry.test.js +0 -32
- package/dist/src/lib/workflows/__tests__/workflow-registry.test.js.map +0 -1
- package/dist/src/lib/workflows/__tests__/workflow-step.test.d.ts +0 -1
- package/dist/src/lib/workflows/__tests__/workflow-step.test.js +0 -54
- package/dist/src/lib/workflows/__tests__/workflow-step.test.js.map +0 -1
- package/dist/src/lib/workflows/agent-skill/index.d.ts +0 -44
- package/dist/src/lib/workflows/agent-skill/index.js +0 -47
- package/dist/src/lib/workflows/agent-skill/index.js.map +0 -1
- package/dist/src/lib/workflows/agent-skill/steps.d.ts +0 -8
- package/dist/src/lib/workflows/agent-skill/steps.js +0 -32
- package/dist/src/lib/workflows/agent-skill/steps.js.map +0 -1
- package/dist/src/lib/workflows/posthog-integration/detect.d.ts +0 -12
- package/dist/src/lib/workflows/posthog-integration/detect.js +0 -57
- package/dist/src/lib/workflows/posthog-integration/detect.js.map +0 -1
- package/dist/src/lib/workflows/posthog-integration/index.d.ts +0 -3
- package/dist/src/lib/workflows/posthog-integration/index.js +0 -152
- package/dist/src/lib/workflows/posthog-integration/index.js.map +0 -1
- package/dist/src/lib/workflows/posthog-integration/steps.d.ts +0 -9
- package/dist/src/lib/workflows/posthog-integration/steps.js +0 -100
- package/dist/src/lib/workflows/posthog-integration/steps.js.map +0 -1
- package/dist/src/lib/workflows/revenue-analytics/detect.d.ts +0 -40
- package/dist/src/lib/workflows/revenue-analytics/detect.js +0 -156
- package/dist/src/lib/workflows/revenue-analytics/detect.js.map +0 -1
- package/dist/src/lib/workflows/revenue-analytics/index.d.ts +0 -4
- package/dist/src/lib/workflows/revenue-analytics/index.js +0 -30
- package/dist/src/lib/workflows/revenue-analytics/index.js.map +0 -1
- package/dist/src/lib/workflows/revenue-analytics/steps.d.ts +0 -8
- package/dist/src/lib/workflows/revenue-analytics/steps.js +0 -48
- package/dist/src/lib/workflows/revenue-analytics/steps.js.map +0 -1
- package/dist/src/lib/workflows/workflow-registry.d.ts +0 -18
- package/dist/src/lib/workflows/workflow-registry.js +0 -32
- package/dist/src/lib/workflows/workflow-registry.js.map +0 -1
- package/dist/src/lib/workflows/workflow-step.d.ts +0 -126
- package/dist/src/lib/workflows/workflow-step.js +0 -28
- package/dist/src/lib/workflows/workflow-step.js.map +0 -1
- package/dist/src/lib/yara-hooks.d.ts +0 -44
- package/dist/src/lib/yara-hooks.js +0 -377
- package/dist/src/lib/yara-hooks.js.map +0 -1
- package/dist/src/lib/yara-scanner.d.ts +0 -61
- package/dist/src/lib/yara-scanner.js +0 -328
- package/dist/src/lib/yara-scanner.js.map +0 -1
- package/dist/src/steps/add-mcp-server-to-clients/MCPClient.d.ts +0 -30
- package/dist/src/steps/add-mcp-server-to-clients/MCPClient.js +0 -138
- package/dist/src/steps/add-mcp-server-to-clients/MCPClient.js.map +0 -1
- package/dist/src/steps/add-mcp-server-to-clients/__tests__/defaults.test.d.ts +0 -1
- package/dist/src/steps/add-mcp-server-to-clients/__tests__/defaults.test.js +0 -72
- package/dist/src/steps/add-mcp-server-to-clients/__tests__/defaults.test.js.map +0 -1
- package/dist/src/steps/add-mcp-server-to-clients/clients/__tests__/claude.test.d.ts +0 -1
- package/dist/src/steps/add-mcp-server-to-clients/clients/__tests__/claude.test.js +0 -341
- package/dist/src/steps/add-mcp-server-to-clients/clients/__tests__/claude.test.js.map +0 -1
- package/dist/src/steps/add-mcp-server-to-clients/clients/__tests__/codex.test.d.ts +0 -1
- package/dist/src/steps/add-mcp-server-to-clients/clients/__tests__/codex.test.js +0 -108
- package/dist/src/steps/add-mcp-server-to-clients/clients/__tests__/codex.test.js.map +0 -1
- package/dist/src/steps/add-mcp-server-to-clients/clients/claude-code.d.ts +0 -89
- package/dist/src/steps/add-mcp-server-to-clients/clients/claude-code.js +0 -169
- package/dist/src/steps/add-mcp-server-to-clients/clients/claude-code.js.map +0 -1
- package/dist/src/steps/add-mcp-server-to-clients/clients/claude.d.ts +0 -80
- package/dist/src/steps/add-mcp-server-to-clients/clients/claude.js +0 -64
- package/dist/src/steps/add-mcp-server-to-clients/clients/claude.js.map +0 -1
- package/dist/src/steps/add-mcp-server-to-clients/clients/codex.d.ts +0 -88
- package/dist/src/steps/add-mcp-server-to-clients/clients/codex.js +0 -76
- package/dist/src/steps/add-mcp-server-to-clients/clients/codex.js.map +0 -1
- package/dist/src/steps/add-mcp-server-to-clients/clients/cursor.d.ts +0 -84
- package/dist/src/steps/add-mcp-server-to-clients/clients/cursor.js +0 -61
- package/dist/src/steps/add-mcp-server-to-clients/clients/cursor.js.map +0 -1
- package/dist/src/steps/add-mcp-server-to-clients/clients/visual-studio-code.d.ts +0 -92
- package/dist/src/steps/add-mcp-server-to-clients/clients/visual-studio-code.js +0 -101
- package/dist/src/steps/add-mcp-server-to-clients/clients/visual-studio-code.js.map +0 -1
- package/dist/src/steps/add-mcp-server-to-clients/clients/zed.d.ts +0 -110
- package/dist/src/steps/add-mcp-server-to-clients/clients/zed.js +0 -102
- package/dist/src/steps/add-mcp-server-to-clients/clients/zed.js.map +0 -1
- package/dist/src/steps/add-mcp-server-to-clients/defaults.d.ts +0 -119
- package/dist/src/steps/add-mcp-server-to-clients/defaults.js +0 -239
- package/dist/src/steps/add-mcp-server-to-clients/defaults.js.map +0 -1
- package/dist/src/steps/add-mcp-server-to-clients/index.d.ts +0 -23
- package/dist/src/steps/add-mcp-server-to-clients/index.js +0 -111
- package/dist/src/steps/add-mcp-server-to-clients/index.js.map +0 -1
- package/dist/src/steps/add-or-update-environment-variables.d.ts +0 -10
- package/dist/src/steps/add-or-update-environment-variables.js +0 -188
- package/dist/src/steps/add-or-update-environment-variables.js.map +0 -1
- package/dist/src/steps/index.d.ts +0 -4
- package/dist/src/steps/index.js +0 -21
- package/dist/src/steps/index.js.map +0 -1
- package/dist/src/steps/run-prettier.d.ts +0 -5
- package/dist/src/steps/run-prettier.js +0 -91
- package/dist/src/steps/run-prettier.js.map +0 -1
- package/dist/src/steps/upload-environment-variables/EnvironmentProvider.d.ts +0 -11
- package/dist/src/steps/upload-environment-variables/EnvironmentProvider.js +0 -12
- package/dist/src/steps/upload-environment-variables/EnvironmentProvider.js.map +0 -1
- package/dist/src/steps/upload-environment-variables/index.d.ts +0 -6
- package/dist/src/steps/upload-environment-variables/index.js +0 -38
- package/dist/src/steps/upload-environment-variables/index.js.map +0 -1
- package/dist/src/steps/upload-environment-variables/providers/__tests__/vercel.test.d.ts +0 -1
- package/dist/src/steps/upload-environment-variables/providers/__tests__/vercel.test.js +0 -117
- package/dist/src/steps/upload-environment-variables/providers/__tests__/vercel.test.js.map +0 -1
- package/dist/src/steps/upload-environment-variables/providers/vercel.d.ts +0 -15
- package/dist/src/steps/upload-environment-variables/providers/vercel.js +0 -142
- package/dist/src/steps/upload-environment-variables/providers/vercel.js.map +0 -1
- package/dist/src/telemetry.d.ts +0 -2
- package/dist/src/telemetry.js +0 -13
- package/dist/src/telemetry.js.map +0 -1
- package/dist/src/ui/index.d.ts +0 -8
- package/dist/src/ui/index.js +0 -17
- package/dist/src/ui/index.js.map +0 -1
- package/dist/src/ui/logging-ui.d.ts +0 -52
- package/dist/src/ui/logging-ui.js +0 -121
- package/dist/src/ui/logging-ui.js.map +0 -1
- package/dist/src/ui/tui/App.d.ts +0 -6
- package/dist/src/ui/tui/App.js +0 -10
- package/dist/src/ui/tui/App.js.map +0 -1
- package/dist/src/ui/tui/__tests__/flows.test.d.ts +0 -1
- package/dist/src/ui/tui/__tests__/flows.test.js +0 -115
- package/dist/src/ui/tui/__tests__/flows.test.js.map +0 -1
- package/dist/src/ui/tui/__tests__/layout-helpers.test.d.ts +0 -1
- package/dist/src/ui/tui/__tests__/layout-helpers.test.js +0 -68
- package/dist/src/ui/tui/__tests__/layout-helpers.test.js.map +0 -1
- package/dist/src/ui/tui/__tests__/router.test.d.ts +0 -1
- package/dist/src/ui/tui/__tests__/router.test.js +0 -87
- package/dist/src/ui/tui/__tests__/router.test.js.map +0 -1
- package/dist/src/ui/tui/__tests__/store.test.d.ts +0 -1
- package/dist/src/ui/tui/__tests__/store.test.js +0 -889
- package/dist/src/ui/tui/__tests__/store.test.js.map +0 -1
- package/dist/src/ui/tui/components/LearnCard.d.ts +0 -10
- package/dist/src/ui/tui/components/LearnCard.js +0 -217
- package/dist/src/ui/tui/components/LearnCard.js.map +0 -1
- package/dist/src/ui/tui/components/ServiceHealthList.d.ts +0 -15
- package/dist/src/ui/tui/components/ServiceHealthList.js +0 -57
- package/dist/src/ui/tui/components/ServiceHealthList.js.map +0 -1
- package/dist/src/ui/tui/components/TipsCard.d.ts +0 -9
- package/dist/src/ui/tui/components/TipsCard.js +0 -55
- package/dist/src/ui/tui/components/TipsCard.js.map +0 -1
- package/dist/src/ui/tui/components/TitleBar.d.ts +0 -6
- package/dist/src/ui/tui/components/TitleBar.js +0 -17
- package/dist/src/ui/tui/components/TitleBar.js.map +0 -1
- package/dist/src/ui/tui/flows.d.ts +0 -51
- package/dist/src/ui/tui/flows.js +0 -75
- package/dist/src/ui/tui/flows.js.map +0 -1
- package/dist/src/ui/tui/hooks/useStdoutDimensions.d.ts +0 -9
- package/dist/src/ui/tui/hooks/useStdoutDimensions.js +0 -37
- package/dist/src/ui/tui/hooks/useStdoutDimensions.js.map +0 -1
- package/dist/src/ui/tui/ink-ui.d.ts +0 -58
- package/dist/src/ui/tui/ink-ui.js +0 -125
- package/dist/src/ui/tui/ink-ui.js.map +0 -1
- package/dist/src/ui/tui/package.json +0 -1
- package/dist/src/ui/tui/playground/PlaygroundApp.d.ts +0 -12
- package/dist/src/ui/tui/playground/PlaygroundApp.js +0 -44
- package/dist/src/ui/tui/playground/PlaygroundApp.js.map +0 -1
- package/dist/src/ui/tui/playground/demos/HealthCheckDemo.d.ts +0 -11
- package/dist/src/ui/tui/playground/demos/HealthCheckDemo.js +0 -57
- package/dist/src/ui/tui/playground/demos/HealthCheckDemo.js.map +0 -1
- package/dist/src/ui/tui/playground/demos/InputDemo.d.ts +0 -4
- package/dist/src/ui/tui/playground/demos/InputDemo.js +0 -53
- package/dist/src/ui/tui/playground/demos/InputDemo.js.map +0 -1
- package/dist/src/ui/tui/playground/demos/LayoutDemo.d.ts +0 -5
- package/dist/src/ui/tui/playground/demos/LayoutDemo.js +0 -25
- package/dist/src/ui/tui/playground/demos/LayoutDemo.js.map +0 -1
- package/dist/src/ui/tui/playground/demos/LogDemo.d.ts +0 -5
- package/dist/src/ui/tui/playground/demos/LogDemo.js +0 -53
- package/dist/src/ui/tui/playground/demos/LogDemo.js.map +0 -1
- package/dist/src/ui/tui/playground/demos/ModalDemo.d.ts +0 -6
- package/dist/src/ui/tui/playground/demos/ModalDemo.js +0 -13
- package/dist/src/ui/tui/playground/demos/ModalDemo.js.map +0 -1
- package/dist/src/ui/tui/playground/demos/ProgressDemo.d.ts +0 -5
- package/dist/src/ui/tui/playground/demos/ProgressDemo.js +0 -58
- package/dist/src/ui/tui/playground/demos/ProgressDemo.js.map +0 -1
- package/dist/src/ui/tui/playground/demos/RunScreenDemo.d.ts +0 -11
- package/dist/src/ui/tui/playground/demos/RunScreenDemo.js +0 -159
- package/dist/src/ui/tui/playground/demos/RunScreenDemo.js.map +0 -1
- package/dist/src/ui/tui/playground/demos/WelcomeDemo.d.ts +0 -9
- package/dist/src/ui/tui/playground/demos/WelcomeDemo.js +0 -15
- package/dist/src/ui/tui/playground/demos/WelcomeDemo.js.map +0 -1
- package/dist/src/ui/tui/playground/start-playground.d.ts +0 -4
- package/dist/src/ui/tui/playground/start-playground.js +0 -24
- package/dist/src/ui/tui/playground/start-playground.js.map +0 -1
- package/dist/src/ui/tui/primitives/CardLayout.d.ts +0 -12
- package/dist/src/ui/tui/primitives/CardLayout.js +0 -10
- package/dist/src/ui/tui/primitives/CardLayout.js.map +0 -1
- package/dist/src/ui/tui/primitives/ConfirmationInput.d.ts +0 -13
- package/dist/src/ui/tui/primitives/ConfirmationInput.js +0 -35
- package/dist/src/ui/tui/primitives/ConfirmationInput.js.map +0 -1
- package/dist/src/ui/tui/primitives/ContentSequencer.d.ts +0 -42
- package/dist/src/ui/tui/primitives/ContentSequencer.js +0 -137
- package/dist/src/ui/tui/primitives/ContentSequencer.js.map +0 -1
- package/dist/src/ui/tui/primitives/DissolveTransition.d.ts +0 -21
- package/dist/src/ui/tui/primitives/DissolveTransition.js +0 -149
- package/dist/src/ui/tui/primitives/DissolveTransition.js.map +0 -1
- package/dist/src/ui/tui/primitives/Divider.d.ts +0 -6
- package/dist/src/ui/tui/primitives/Divider.js +0 -15
- package/dist/src/ui/tui/primitives/Divider.js.map +0 -1
- package/dist/src/ui/tui/primitives/EventPlanViewer.d.ts +0 -9
- package/dist/src/ui/tui/primitives/EventPlanViewer.js +0 -9
- package/dist/src/ui/tui/primitives/EventPlanViewer.js.map +0 -1
- package/dist/src/ui/tui/primitives/GroupedPickerMenu.d.ts +0 -23
- package/dist/src/ui/tui/primitives/GroupedPickerMenu.js +0 -182
- package/dist/src/ui/tui/primitives/GroupedPickerMenu.js.map +0 -1
- package/dist/src/ui/tui/primitives/HNViewer.d.ts +0 -7
- package/dist/src/ui/tui/primitives/HNViewer.js +0 -63
- package/dist/src/ui/tui/primitives/HNViewer.js.map +0 -1
- package/dist/src/ui/tui/primitives/LinesBlock.d.ts +0 -16
- package/dist/src/ui/tui/primitives/LinesBlock.js +0 -37
- package/dist/src/ui/tui/primitives/LinesBlock.js.map +0 -1
- package/dist/src/ui/tui/primitives/LoadingBox.d.ts +0 -8
- package/dist/src/ui/tui/primitives/LoadingBox.js +0 -10
- package/dist/src/ui/tui/primitives/LoadingBox.js.map +0 -1
- package/dist/src/ui/tui/primitives/LogViewer.d.ts +0 -11
- package/dist/src/ui/tui/primitives/LogViewer.js +0 -55
- package/dist/src/ui/tui/primitives/LogViewer.js.map +0 -1
- package/dist/src/ui/tui/primitives/ModalOverlay.d.ts +0 -25
- package/dist/src/ui/tui/primitives/ModalOverlay.js +0 -7
- package/dist/src/ui/tui/primitives/ModalOverlay.js.map +0 -1
- package/dist/src/ui/tui/primitives/NodeBlock.d.ts +0 -13
- package/dist/src/ui/tui/primitives/NodeBlock.js +0 -17
- package/dist/src/ui/tui/primitives/NodeBlock.js.map +0 -1
- package/dist/src/ui/tui/primitives/PickerMenu.d.ts +0 -20
- package/dist/src/ui/tui/primitives/PickerMenu.js +0 -143
- package/dist/src/ui/tui/primitives/PickerMenu.js.map +0 -1
- package/dist/src/ui/tui/primitives/ProgressList.d.ts +0 -17
- package/dist/src/ui/tui/primitives/ProgressList.js +0 -32
- package/dist/src/ui/tui/primitives/ProgressList.js.map +0 -1
- package/dist/src/ui/tui/primitives/PromptLabel.d.ts +0 -11
- package/dist/src/ui/tui/primitives/PromptLabel.js +0 -13
- package/dist/src/ui/tui/primitives/PromptLabel.js.map +0 -1
- package/dist/src/ui/tui/primitives/ScreenContainer.d.ts +0 -16
- package/dist/src/ui/tui/primitives/ScreenContainer.js +0 -36
- package/dist/src/ui/tui/primitives/ScreenContainer.js.map +0 -1
- package/dist/src/ui/tui/primitives/ScreenErrorBoundary.d.ts +0 -22
- package/dist/src/ui/tui/primitives/ScreenErrorBoundary.js +0 -35
- package/dist/src/ui/tui/primitives/ScreenErrorBoundary.js.map +0 -1
- package/dist/src/ui/tui/primitives/SplitView.d.ts +0 -11
- package/dist/src/ui/tui/primitives/SplitView.js +0 -9
- package/dist/src/ui/tui/primitives/SplitView.js.map +0 -1
- package/dist/src/ui/tui/primitives/TabContainer.d.ts +0 -23
- package/dist/src/ui/tui/primitives/TabContainer.js +0 -45
- package/dist/src/ui/tui/primitives/TabContainer.js.map +0 -1
- package/dist/src/ui/tui/primitives/TextBlock.d.ts +0 -41
- package/dist/src/ui/tui/primitives/TextBlock.js +0 -144
- package/dist/src/ui/tui/primitives/TextBlock.js.map +0 -1
- package/dist/src/ui/tui/primitives/content-types.d.ts +0 -37
- package/dist/src/ui/tui/primitives/content-types.js +0 -19
- package/dist/src/ui/tui/primitives/content-types.js.map +0 -1
- package/dist/src/ui/tui/primitives/index.d.ts +0 -27
- package/dist/src/ui/tui/primitives/index.js +0 -24
- package/dist/src/ui/tui/primitives/index.js.map +0 -1
- package/dist/src/ui/tui/primitives/layout-helpers.d.ts +0 -36
- package/dist/src/ui/tui/primitives/layout-helpers.js +0 -95
- package/dist/src/ui/tui/primitives/layout-helpers.js.map +0 -1
- package/dist/src/ui/tui/primitives/text-helpers.d.ts +0 -10
- package/dist/src/ui/tui/primitives/text-helpers.js +0 -43
- package/dist/src/ui/tui/primitives/text-helpers.js.map +0 -1
- package/dist/src/ui/tui/router.d.ts +0 -58
- package/dist/src/ui/tui/router.js +0 -96
- package/dist/src/ui/tui/router.js.map +0 -1
- package/dist/src/ui/tui/screen-registry.d.ts +0 -19
- package/dist/src/ui/tui/screen-registry.js +0 -44
- package/dist/src/ui/tui/screen-registry.js.map +0 -1
- package/dist/src/ui/tui/screens/AuthErrorScreen.d.ts +0 -7
- package/dist/src/ui/tui/screens/AuthErrorScreen.js +0 -16
- package/dist/src/ui/tui/screens/AuthErrorScreen.js.map +0 -1
- package/dist/src/ui/tui/screens/AuthScreen.d.ts +0 -13
- package/dist/src/ui/tui/screens/AuthScreen.js +0 -20
- package/dist/src/ui/tui/screens/AuthScreen.js.map +0 -1
- package/dist/src/ui/tui/screens/IntroScreen.d.ts +0 -16
- package/dist/src/ui/tui/screens/IntroScreen.js +0 -79
- package/dist/src/ui/tui/screens/IntroScreen.js.map +0 -1
- package/dist/src/ui/tui/screens/ManagedSettingsScreen.d.ts +0 -13
- package/dist/src/ui/tui/screens/ManagedSettingsScreen.js +0 -32
- package/dist/src/ui/tui/screens/ManagedSettingsScreen.js.map +0 -1
- package/dist/src/ui/tui/screens/McpScreen.d.ts +0 -24
- package/dist/src/ui/tui/screens/McpScreen.js +0 -127
- package/dist/src/ui/tui/screens/McpScreen.js.map +0 -1
- package/dist/src/ui/tui/screens/OutroScreen.d.ts +0 -11
- package/dist/src/ui/tui/screens/OutroScreen.js +0 -22
- package/dist/src/ui/tui/screens/OutroScreen.js.map +0 -1
- package/dist/src/ui/tui/screens/PortConflictScreen.d.ts +0 -11
- package/dist/src/ui/tui/screens/PortConflictScreen.js +0 -30
- package/dist/src/ui/tui/screens/PortConflictScreen.js.map +0 -1
- package/dist/src/ui/tui/screens/RevenueIntroScreen.d.ts +0 -16
- package/dist/src/ui/tui/screens/RevenueIntroScreen.js +0 -64
- package/dist/src/ui/tui/screens/RevenueIntroScreen.js.map +0 -1
- package/dist/src/ui/tui/screens/RunScreen.d.ts +0 -16
- package/dist/src/ui/tui/screens/RunScreen.js +0 -73
- package/dist/src/ui/tui/screens/RunScreen.js.map +0 -1
- package/dist/src/ui/tui/screens/SettingsOverrideScreen.d.ts +0 -6
- package/dist/src/ui/tui/screens/SettingsOverrideScreen.js +0 -30
- package/dist/src/ui/tui/screens/SettingsOverrideScreen.js.map +0 -1
- package/dist/src/ui/tui/screens/SetupScreen.d.ts +0 -13
- package/dist/src/ui/tui/screens/SetupScreen.js +0 -74
- package/dist/src/ui/tui/screens/SetupScreen.js.map +0 -1
- package/dist/src/ui/tui/screens/SkillsScreen.d.ts +0 -14
- package/dist/src/ui/tui/screens/SkillsScreen.js +0 -71
- package/dist/src/ui/tui/screens/SkillsScreen.js.map +0 -1
- package/dist/src/ui/tui/screens/health/HealthCheckScreen.d.ts +0 -14
- package/dist/src/ui/tui/screens/health/HealthCheckScreen.js +0 -77
- package/dist/src/ui/tui/screens/health/HealthCheckScreen.js.map +0 -1
- package/dist/src/ui/tui/services/mcp-installer.d.ts +0 -21
- package/dist/src/ui/tui/services/mcp-installer.js +0 -58
- package/dist/src/ui/tui/services/mcp-installer.js.map +0 -1
- package/dist/src/ui/tui/start-tui.d.ts +0 -9
- package/dist/src/ui/tui/start-tui.js +0 -41
- package/dist/src/ui/tui/start-tui.js.map +0 -1
- package/dist/src/ui/tui/store.d.ts +0 -190
- package/dist/src/ui/tui/store.js +0 -472
- package/dist/src/ui/tui/store.js.map +0 -1
- package/dist/src/ui/tui/styles.d.ts +0 -32
- package/dist/src/ui/tui/styles.js +0 -35
- package/dist/src/ui/tui/styles.js.map +0 -1
- package/dist/src/ui/wizard-ui.d.ts +0 -81
- package/dist/src/ui/wizard-ui.js +0 -19
- package/dist/src/ui/wizard-ui.js.map +0 -1
- package/dist/src/utils/__tests__/analytics.test.d.ts +0 -1
- package/dist/src/utils/__tests__/analytics.test.js +0 -136
- package/dist/src/utils/__tests__/analytics.test.js.map +0 -1
- package/dist/src/utils/__tests__/provisioning.test.d.ts +0 -1
- package/dist/src/utils/__tests__/provisioning.test.js +0 -192
- package/dist/src/utils/__tests__/provisioning.test.js.map +0 -1
- package/dist/src/utils/__tests__/semver.test.d.ts +0 -1
- package/dist/src/utils/__tests__/semver.test.js +0 -159
- package/dist/src/utils/__tests__/semver.test.js.map +0 -1
- package/dist/src/utils/__tests__/setup-utils.test.d.ts +0 -1
- package/dist/src/utils/__tests__/setup-utils.test.js +0 -138
- package/dist/src/utils/__tests__/setup-utils.test.js.map +0 -1
- package/dist/src/utils/analytics.d.ts +0 -33
- package/dist/src/utils/analytics.js +0 -137
- package/dist/src/utils/analytics.js.map +0 -1
- package/dist/src/utils/anthropic-status.d.ts +0 -17
- package/dist/src/utils/anthropic-status.js +0 -49
- package/dist/src/utils/anthropic-status.js.map +0 -1
- package/dist/src/utils/bash.d.ts +0 -2
- package/dist/src/utils/bash.js +0 -54
- package/dist/src/utils/bash.js.map +0 -1
- package/dist/src/utils/custom-headers.d.ts +0 -9
- package/dist/src/utils/custom-headers.js +0 -24
- package/dist/src/utils/custom-headers.js.map +0 -1
- package/dist/src/utils/debug.d.ts +0 -29
- package/dist/src/utils/debug.js +0 -87
- package/dist/src/utils/debug.js.map +0 -1
- package/dist/src/utils/env-api-key.d.ts +0 -5
- package/dist/src/utils/env-api-key.js +0 -57
- package/dist/src/utils/env-api-key.js.map +0 -1
- package/dist/src/utils/environment.d.ts +0 -4
- package/dist/src/utils/environment.js +0 -77
- package/dist/src/utils/environment.js.map +0 -1
- package/dist/src/utils/file-utils.d.ts +0 -10
- package/dist/src/utils/file-utils.js +0 -49
- package/dist/src/utils/file-utils.js.map +0 -1
- package/dist/src/utils/logging.d.ts +0 -9
- package/dist/src/utils/logging.js +0 -47
- package/dist/src/utils/logging.js.map +0 -1
- package/dist/src/utils/oauth.d.ts +0 -33
- package/dist/src/utils/oauth.js +0 -288
- package/dist/src/utils/oauth.js.map +0 -1
- package/dist/src/utils/package-json.d.ts +0 -30
- package/dist/src/utils/package-json.js +0 -47
- package/dist/src/utils/package-json.js.map +0 -1
- package/dist/src/utils/package-manager.d.ts +0 -21
- package/dist/src/utils/package-manager.js +0 -210
- package/dist/src/utils/package-manager.js.map +0 -1
- package/dist/src/utils/provisioning.d.ts +0 -25
- package/dist/src/utils/provisioning.js +0 -191
- package/dist/src/utils/provisioning.js.map +0 -1
- package/dist/src/utils/rules/astro-rules.md +0 -44
- package/dist/src/utils/rules/next-rules.md +0 -9
- package/dist/src/utils/rules/react-native-rules.md +0 -7
- package/dist/src/utils/rules/react-rules.md +0 -7
- package/dist/src/utils/rules/svelte-rules.md +0 -7
- package/dist/src/utils/rules/universal.md +0 -32
- package/dist/src/utils/semver.d.ts +0 -21
- package/dist/src/utils/semver.js +0 -87
- package/dist/src/utils/semver.js.map +0 -1
- package/dist/src/utils/setup-utils.d.ts +0 -79
- package/dist/src/utils/setup-utils.js +0 -406
- package/dist/src/utils/setup-utils.js.map +0 -1
- package/dist/src/utils/string.d.ts +0 -1
- package/dist/src/utils/string.js +0 -9
- package/dist/src/utils/string.js.map +0 -1
- package/dist/src/utils/types.d.ts +0 -85
- package/dist/src/utils/types.js +0 -3
- package/dist/src/utils/types.js.map +0 -1
- package/dist/src/utils/urls.d.ts +0 -7
- package/dist/src/utils/urls.js +0 -78
- package/dist/src/utils/urls.js.map +0 -1
- package/dist/src/utils/vendor/is-unicorn-supported.d.ts +0 -1
- package/dist/src/utils/vendor/is-unicorn-supported.js +0 -24
- package/dist/src/utils/vendor/is-unicorn-supported.js.map +0 -1
- package/dist/src/utils/wizard-abort.d.ts +0 -16
- package/dist/src/utils/wizard-abort.js +0 -59
- package/dist/src/utils/wizard-abort.js.map +0 -1
|
@@ -0,0 +1,1112 @@
|
|
|
1
|
+
import { a as getLogFilePath, c as getUI, f as runtimeEnv, i as enableDebugLogs, o as initLogFile, s as logToFile, t as configureLogFile } from "./debug-CyJ_3dTP.js";
|
|
2
|
+
import { n as analytics, w as getSkillsBaseUrl } from "./analytics-C4jO5Qda.js";
|
|
3
|
+
import { a as getCloudUrlFromRegion, t as getOrAskForProjectData } from "./setup-utils-CdDnllRW.js";
|
|
4
|
+
import { n as registerCleanup, r as wizardAbort, t as WizardError } from "./wizard-abort-7HUIsqv1.js";
|
|
5
|
+
import { a as backupAndFixClaudeSettings, c as initializeAgent, d as formatScanReport, f as writeScanReport, h as installSkillById, i as AgentSignals, l as restoreClaudeSettings, n as evaluateWizardReadiness, o as buildWizardMetadata, s as checkAllSettingsConflicts, u as runAgent$1 } from "./readiness-Dn7eq8NE.js";
|
|
6
|
+
import { r as detectNodePackageManagers } from "./package-manager-nUQ-ebjr.js";
|
|
7
|
+
import fs, { existsSync } from "fs";
|
|
8
|
+
import path, { join } from "path";
|
|
9
|
+
//#region src/lib/middleware/phase-detector.ts
|
|
10
|
+
/** Phase transitions from [STATUS] in assistant text. Keep in sync with workflow "Status to report" bullets. */
|
|
11
|
+
const PHASES_ORDER = [
|
|
12
|
+
"1.0-begin",
|
|
13
|
+
"1.1-edit",
|
|
14
|
+
"1.2-revise",
|
|
15
|
+
"1.3-conclude"
|
|
16
|
+
];
|
|
17
|
+
const STATUS_PHRASES_BY_PHASE = {
|
|
18
|
+
"1.0-begin": [
|
|
19
|
+
"Checking project structure",
|
|
20
|
+
"Verifying PostHog dependencies",
|
|
21
|
+
"Generating events based on project"
|
|
22
|
+
],
|
|
23
|
+
"1.1-edit": ["Inserting PostHog capture code"],
|
|
24
|
+
"1.2-revise": [
|
|
25
|
+
"Finding and correcting errors",
|
|
26
|
+
"Report details of any errors you fix",
|
|
27
|
+
"Linting, building and prettying"
|
|
28
|
+
],
|
|
29
|
+
"1.3-conclude": ["Configured dashboard", "Created setup report"]
|
|
30
|
+
};
|
|
31
|
+
var PhaseDetector = class {
|
|
32
|
+
currentPhase = "setup";
|
|
33
|
+
detect(message) {
|
|
34
|
+
if (message.type !== "assistant") return null;
|
|
35
|
+
const nextPhase = this.getNextPhase();
|
|
36
|
+
if (nextPhase === null) return null;
|
|
37
|
+
const content = message.message?.content;
|
|
38
|
+
if (!Array.isArray(content)) return null;
|
|
39
|
+
for (const block of content) {
|
|
40
|
+
if (block.type !== "text" || typeof block.text !== "string") continue;
|
|
41
|
+
if (!block.text.includes("[STATUS]")) continue;
|
|
42
|
+
const phrases = STATUS_PHRASES_BY_PHASE[nextPhase];
|
|
43
|
+
for (const phrase of phrases) if (block.text.includes(phrase)) {
|
|
44
|
+
this.currentPhase = nextPhase;
|
|
45
|
+
return nextPhase;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
getNextPhase() {
|
|
51
|
+
if (this.currentPhase === "setup") return "1.0-begin";
|
|
52
|
+
const i = PHASES_ORDER.indexOf(this.currentPhase);
|
|
53
|
+
if (i < 0 || i >= PHASES_ORDER.length - 1) return null;
|
|
54
|
+
return PHASES_ORDER[i + 1];
|
|
55
|
+
}
|
|
56
|
+
reset() {
|
|
57
|
+
this.currentPhase = "setup";
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region src/lib/middleware/pipeline.ts
|
|
62
|
+
/**
|
|
63
|
+
* Middleware pipeline orchestrator.
|
|
64
|
+
*
|
|
65
|
+
* Implements the same { onMessage, finalize } interface that runAgent() expects,
|
|
66
|
+
* while internally dispatching to an ordered list of middleware plugins.
|
|
67
|
+
*/
|
|
68
|
+
var MiddlewarePipeline = class {
|
|
69
|
+
middlewares;
|
|
70
|
+
store = /* @__PURE__ */ new Map();
|
|
71
|
+
phaseDetector;
|
|
72
|
+
autoDetectPhases;
|
|
73
|
+
_currentPhase = "setup";
|
|
74
|
+
_currentPhaseFreshContext = true;
|
|
75
|
+
constructor(middlewares, opts) {
|
|
76
|
+
this.middlewares = middlewares;
|
|
77
|
+
this.phaseDetector = opts?.phaseDetector ?? new PhaseDetector();
|
|
78
|
+
this.autoDetectPhases = opts?.autoDetectPhases ?? true;
|
|
79
|
+
const ctx = this.createContext();
|
|
80
|
+
for (const mw of this.middlewares) mw.onInit?.(ctx);
|
|
81
|
+
}
|
|
82
|
+
/** Feed an SDK message through all middleware (satisfies tracker.onMessage) */
|
|
83
|
+
onMessage(message) {
|
|
84
|
+
if (this.autoDetectPhases) {
|
|
85
|
+
const newPhase = this.phaseDetector.detect(message);
|
|
86
|
+
if (newPhase && newPhase !== this._currentPhase) this.transitionPhase(newPhase, false);
|
|
87
|
+
}
|
|
88
|
+
const ctx = this.createContext();
|
|
89
|
+
const storeHandle = this.createStore();
|
|
90
|
+
for (const mw of this.middlewares) mw.onMessage?.(message, ctx, storeHandle);
|
|
91
|
+
}
|
|
92
|
+
/** Finalize the run (satisfies tracker.finalize) */
|
|
93
|
+
finalize(resultMessage, totalDurationMs) {
|
|
94
|
+
const ctx = this.createContext();
|
|
95
|
+
const storeHandle = this.createStore();
|
|
96
|
+
let result;
|
|
97
|
+
for (const mw of this.middlewares) {
|
|
98
|
+
const r = mw.onFinalize?.(resultMessage, totalDurationMs, ctx, storeHandle);
|
|
99
|
+
if (r !== void 0) result = r;
|
|
100
|
+
}
|
|
101
|
+
return result;
|
|
102
|
+
}
|
|
103
|
+
/** Explicit phase start (for phased runner support) */
|
|
104
|
+
startPhase(name, freshContext) {
|
|
105
|
+
this.transitionPhase(name, freshContext);
|
|
106
|
+
}
|
|
107
|
+
transitionPhase(newPhase, freshContext) {
|
|
108
|
+
const oldPhase = this._currentPhase;
|
|
109
|
+
this._currentPhase = newPhase;
|
|
110
|
+
this._currentPhaseFreshContext = freshContext;
|
|
111
|
+
const ctx = this.createContext();
|
|
112
|
+
const storeHandle = this.createStore();
|
|
113
|
+
for (const mw of this.middlewares) mw.onPhaseTransition?.(oldPhase, newPhase, ctx, storeHandle);
|
|
114
|
+
}
|
|
115
|
+
createContext() {
|
|
116
|
+
return {
|
|
117
|
+
currentPhase: this._currentPhase,
|
|
118
|
+
currentPhaseFreshContext: this._currentPhaseFreshContext,
|
|
119
|
+
get: (key) => this.store.get(key)
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
createStore() {
|
|
123
|
+
return { set: (key, value) => this.store.set(key, value) };
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
//#endregion
|
|
127
|
+
//#region src/lib/middleware/config.ts
|
|
128
|
+
/**
|
|
129
|
+
* Benchmark configuration loader.
|
|
130
|
+
*
|
|
131
|
+
* Loads .benchmark-config.json from the working directory with sensible defaults.
|
|
132
|
+
* All fields are optional — missing fields fall back to defaults.
|
|
133
|
+
*/
|
|
134
|
+
const DEFAULT_CONFIG = {
|
|
135
|
+
plugins: {
|
|
136
|
+
tokens: true,
|
|
137
|
+
cache: true,
|
|
138
|
+
turns: true,
|
|
139
|
+
compactions: true,
|
|
140
|
+
contextSize: true,
|
|
141
|
+
cost: true,
|
|
142
|
+
duration: true,
|
|
143
|
+
summary: true,
|
|
144
|
+
jsonWriter: true
|
|
145
|
+
},
|
|
146
|
+
output: {
|
|
147
|
+
benchmarkPath: "/tmp/posthog-wizard-benchmark.json",
|
|
148
|
+
benchmarkEnabled: true,
|
|
149
|
+
logPath: "/tmp/posthog-wizard.log",
|
|
150
|
+
logEnabled: true,
|
|
151
|
+
suppressWizardLogs: false
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
function loadBenchmarkConfig(installDir) {
|
|
155
|
+
const configPath = runtimeEnv("POSTHOG_WIZARD_BENCHMARK_CONFIG") ?? path.join(installDir, ".benchmark-config.json");
|
|
156
|
+
try {
|
|
157
|
+
const raw = fs.readFileSync(configPath, "utf-8");
|
|
158
|
+
const parsed = JSON.parse(raw);
|
|
159
|
+
const config = {
|
|
160
|
+
plugins: {
|
|
161
|
+
...DEFAULT_CONFIG.plugins,
|
|
162
|
+
...parsed.plugins
|
|
163
|
+
},
|
|
164
|
+
output: {
|
|
165
|
+
...DEFAULT_CONFIG.output,
|
|
166
|
+
...parsed.output
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
const benchFile = runtimeEnv("POSTHOG_WIZARD_BENCHMARK_FILE");
|
|
170
|
+
if (benchFile) config.output.benchmarkPath = benchFile;
|
|
171
|
+
const logDir = runtimeEnv("POSTHOG_WIZARD_LOG_DIR");
|
|
172
|
+
if (logDir) config.output.logPath = path.join(logDir, "posthog-wizard.log");
|
|
173
|
+
if (!config.output.benchmarkEnabled) config.plugins.jsonWriter = false;
|
|
174
|
+
logToFile(`${AgentSignals.BENCHMARK} Loaded config from ${configPath}`);
|
|
175
|
+
return config;
|
|
176
|
+
} catch {
|
|
177
|
+
const config = structuredClone(DEFAULT_CONFIG);
|
|
178
|
+
const benchFile2 = runtimeEnv("POSTHOG_WIZARD_BENCHMARK_FILE");
|
|
179
|
+
if (benchFile2) config.output.benchmarkPath = benchFile2;
|
|
180
|
+
const logDir2 = runtimeEnv("POSTHOG_WIZARD_LOG_DIR");
|
|
181
|
+
if (logDir2) config.output.logPath = path.join(logDir2, "posthog-wizard.log");
|
|
182
|
+
return config;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
//#endregion
|
|
186
|
+
//#region src/lib/middleware/benchmarks/turn-counter.ts
|
|
187
|
+
var TurnCounterPlugin = class {
|
|
188
|
+
name = "turns";
|
|
189
|
+
lastMessageId = null;
|
|
190
|
+
phaseTurns = 0;
|
|
191
|
+
totalTurns = 0;
|
|
192
|
+
isDuplicate = false;
|
|
193
|
+
phaseSnapshots = [];
|
|
194
|
+
currentPhase = "setup";
|
|
195
|
+
onMessage(message, _ctx, store) {
|
|
196
|
+
if (message.type !== "assistant") {
|
|
197
|
+
this.isDuplicate = false;
|
|
198
|
+
store.set("turns", this.getData());
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
const msgId = message.message?.id;
|
|
202
|
+
this.isDuplicate = msgId != null && msgId === this.lastMessageId;
|
|
203
|
+
if (msgId) this.lastMessageId = msgId;
|
|
204
|
+
if (!this.isDuplicate) {
|
|
205
|
+
this.phaseTurns++;
|
|
206
|
+
this.totalTurns++;
|
|
207
|
+
}
|
|
208
|
+
store.set("turns", this.getData());
|
|
209
|
+
}
|
|
210
|
+
onPhaseTransition(fromPhase, _toPhase, _ctx, store) {
|
|
211
|
+
this.phaseSnapshots.push({
|
|
212
|
+
phase: fromPhase,
|
|
213
|
+
turns: this.phaseTurns
|
|
214
|
+
});
|
|
215
|
+
this.currentPhase = _toPhase;
|
|
216
|
+
this.phaseTurns = 0;
|
|
217
|
+
this.lastMessageId = null;
|
|
218
|
+
store.set("turns", this.getData());
|
|
219
|
+
}
|
|
220
|
+
onFinalize(_resultMessage, _totalDurationMs, _ctx, store) {
|
|
221
|
+
this.phaseSnapshots.push({
|
|
222
|
+
phase: this.currentPhase,
|
|
223
|
+
turns: this.phaseTurns
|
|
224
|
+
});
|
|
225
|
+
store.set("turns", this.getData());
|
|
226
|
+
}
|
|
227
|
+
getData() {
|
|
228
|
+
return {
|
|
229
|
+
isDuplicate: this.isDuplicate,
|
|
230
|
+
phaseTurns: this.phaseTurns,
|
|
231
|
+
totalTurns: this.totalTurns,
|
|
232
|
+
phaseSnapshots: [...this.phaseSnapshots]
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
//#endregion
|
|
237
|
+
//#region src/lib/middleware/benchmarks/token-tracker.ts
|
|
238
|
+
var TokenTrackerPlugin = class {
|
|
239
|
+
name = "tokens";
|
|
240
|
+
phaseInput = 0;
|
|
241
|
+
phaseOutput = 0;
|
|
242
|
+
totalInput = 0;
|
|
243
|
+
totalOutput = 0;
|
|
244
|
+
lastUsage = null;
|
|
245
|
+
phaseSnapshots = [];
|
|
246
|
+
currentPhase = "setup";
|
|
247
|
+
phaseMessagesWithUsage = 0;
|
|
248
|
+
onMessage(message, ctx, store) {
|
|
249
|
+
if (message.type !== "assistant") return;
|
|
250
|
+
if (ctx.get("turns")?.isDuplicate) return;
|
|
251
|
+
const usage = message.message?.usage;
|
|
252
|
+
if (usage) {
|
|
253
|
+
const input = Number(usage.input_tokens ?? 0) + Number(usage.cache_read_input_tokens ?? 0) + Number(usage.cache_creation_input_tokens ?? 0);
|
|
254
|
+
const output = Number(usage.output_tokens ?? 0);
|
|
255
|
+
this.phaseInput += input;
|
|
256
|
+
this.phaseOutput += output;
|
|
257
|
+
this.totalInput += input;
|
|
258
|
+
this.totalOutput += output;
|
|
259
|
+
this.lastUsage = usage;
|
|
260
|
+
this.phaseMessagesWithUsage += 1;
|
|
261
|
+
}
|
|
262
|
+
store.set("tokens", this.getData());
|
|
263
|
+
}
|
|
264
|
+
onPhaseTransition(fromPhase, toPhase, _ctx, store) {
|
|
265
|
+
this.phaseSnapshots.push({
|
|
266
|
+
phase: fromPhase,
|
|
267
|
+
inputTokens: this.phaseInput,
|
|
268
|
+
outputTokens: this.phaseOutput,
|
|
269
|
+
messagesWithUsage: this.phaseMessagesWithUsage
|
|
270
|
+
});
|
|
271
|
+
this.currentPhase = toPhase;
|
|
272
|
+
this.phaseInput = 0;
|
|
273
|
+
this.phaseOutput = 0;
|
|
274
|
+
this.phaseMessagesWithUsage = 0;
|
|
275
|
+
store.set("tokens", this.getData());
|
|
276
|
+
}
|
|
277
|
+
onFinalize(_resultMessage, _totalDurationMs, _ctx, store) {
|
|
278
|
+
this.phaseSnapshots.push({
|
|
279
|
+
phase: this.currentPhase,
|
|
280
|
+
inputTokens: this.phaseInput,
|
|
281
|
+
outputTokens: this.phaseOutput,
|
|
282
|
+
messagesWithUsage: this.phaseMessagesWithUsage
|
|
283
|
+
});
|
|
284
|
+
store.set("tokens", this.getData());
|
|
285
|
+
}
|
|
286
|
+
getData() {
|
|
287
|
+
return {
|
|
288
|
+
phaseInput: this.phaseInput,
|
|
289
|
+
phaseOutput: this.phaseOutput,
|
|
290
|
+
totalInput: this.totalInput,
|
|
291
|
+
totalOutput: this.totalOutput,
|
|
292
|
+
lastUsage: this.lastUsage,
|
|
293
|
+
phaseSnapshots: [...this.phaseSnapshots]
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
};
|
|
297
|
+
//#endregion
|
|
298
|
+
//#region src/lib/middleware/benchmarks/cache-tracker.ts
|
|
299
|
+
var CacheTrackerPlugin = class {
|
|
300
|
+
name = "cache";
|
|
301
|
+
phaseRead = 0;
|
|
302
|
+
phaseCreation = 0;
|
|
303
|
+
phaseCreation5m = 0;
|
|
304
|
+
phaseCreation1h = 0;
|
|
305
|
+
totalRead = 0;
|
|
306
|
+
totalCreation = 0;
|
|
307
|
+
totalCreation5m = 0;
|
|
308
|
+
totalCreation1h = 0;
|
|
309
|
+
phaseSnapshots = [];
|
|
310
|
+
currentPhase = "setup";
|
|
311
|
+
onMessage(message, ctx, store) {
|
|
312
|
+
if (message.type !== "assistant") return;
|
|
313
|
+
if (ctx.get("turns")?.isDuplicate) return;
|
|
314
|
+
const usage = message.message?.usage;
|
|
315
|
+
if (usage) {
|
|
316
|
+
const read = Number(usage.cache_read_input_tokens ?? 0);
|
|
317
|
+
const creation = Number(usage.cache_creation_input_tokens ?? 0);
|
|
318
|
+
const cc = usage.cache_creation;
|
|
319
|
+
const creation5m = Number(cc?.ephemeral_5m_input_tokens ?? 0);
|
|
320
|
+
const creation1h = Number(cc?.ephemeral_1h_input_tokens ?? 0);
|
|
321
|
+
this.phaseRead += read;
|
|
322
|
+
this.phaseCreation += creation;
|
|
323
|
+
this.phaseCreation5m += creation5m;
|
|
324
|
+
this.phaseCreation1h += creation1h;
|
|
325
|
+
this.totalRead += read;
|
|
326
|
+
this.totalCreation += creation;
|
|
327
|
+
}
|
|
328
|
+
store.set("cache", this.getData());
|
|
329
|
+
}
|
|
330
|
+
onPhaseTransition(fromPhase, toPhase, _ctx, store) {
|
|
331
|
+
this.phaseSnapshots.push({
|
|
332
|
+
phase: fromPhase,
|
|
333
|
+
cacheReadTokens: this.phaseRead,
|
|
334
|
+
cacheCreationTokens: this.phaseCreation,
|
|
335
|
+
cacheCreation5m: this.phaseCreation5m,
|
|
336
|
+
cacheCreation1h: this.phaseCreation1h
|
|
337
|
+
});
|
|
338
|
+
this.currentPhase = toPhase;
|
|
339
|
+
this.phaseRead = 0;
|
|
340
|
+
this.phaseCreation = 0;
|
|
341
|
+
this.phaseCreation5m = 0;
|
|
342
|
+
this.phaseCreation1h = 0;
|
|
343
|
+
store.set("cache", this.getData());
|
|
344
|
+
}
|
|
345
|
+
onFinalize(_resultMessage, _totalDurationMs, _ctx, store) {
|
|
346
|
+
this.phaseSnapshots.push({
|
|
347
|
+
phase: this.currentPhase,
|
|
348
|
+
cacheReadTokens: this.phaseRead,
|
|
349
|
+
cacheCreationTokens: this.phaseCreation,
|
|
350
|
+
cacheCreation5m: this.phaseCreation5m,
|
|
351
|
+
cacheCreation1h: this.phaseCreation1h
|
|
352
|
+
});
|
|
353
|
+
store.set("cache", this.getData());
|
|
354
|
+
}
|
|
355
|
+
getData() {
|
|
356
|
+
return {
|
|
357
|
+
phaseRead: this.phaseRead,
|
|
358
|
+
phaseCreation: this.phaseCreation,
|
|
359
|
+
totalRead: this.totalRead,
|
|
360
|
+
totalCreation: this.totalCreation,
|
|
361
|
+
totalCreation5m: this.totalCreation5m,
|
|
362
|
+
totalCreation1h: this.totalCreation1h,
|
|
363
|
+
phaseSnapshots: [...this.phaseSnapshots]
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
};
|
|
367
|
+
//#endregion
|
|
368
|
+
//#region src/lib/middleware/benchmarks/compaction-tracker.ts
|
|
369
|
+
var CompactionTrackerPlugin = class {
|
|
370
|
+
name = "compactions";
|
|
371
|
+
phaseCompactions = 0;
|
|
372
|
+
phasePreTokens = [];
|
|
373
|
+
totalCompactions = 0;
|
|
374
|
+
phaseSnapshots = [];
|
|
375
|
+
currentPhase = "setup";
|
|
376
|
+
onMessage(message, ctx, store) {
|
|
377
|
+
if (message.type !== "system" || message.subtype !== "compact_boundary") return;
|
|
378
|
+
const preTokens = message.compact_metadata?.pre_tokens ?? 0;
|
|
379
|
+
const trigger = message.compact_metadata?.trigger ?? "unknown";
|
|
380
|
+
this.phaseCompactions++;
|
|
381
|
+
this.totalCompactions++;
|
|
382
|
+
this.phasePreTokens.push(preTokens);
|
|
383
|
+
logToFile(`${AgentSignals.BENCHMARK} [COMPACTION] Context compacted during "${ctx.currentPhase}" (trigger: ${trigger}, pre_tokens: ${preTokens})`);
|
|
384
|
+
store.set("compactions", this.getData());
|
|
385
|
+
}
|
|
386
|
+
onPhaseTransition(fromPhase, toPhase, _ctx, store) {
|
|
387
|
+
this.phaseSnapshots.push({
|
|
388
|
+
phase: fromPhase,
|
|
389
|
+
compactions: this.phaseCompactions,
|
|
390
|
+
preTokens: [...this.phasePreTokens]
|
|
391
|
+
});
|
|
392
|
+
this.currentPhase = toPhase;
|
|
393
|
+
this.phaseCompactions = 0;
|
|
394
|
+
this.phasePreTokens = [];
|
|
395
|
+
store.set("compactions", this.getData());
|
|
396
|
+
}
|
|
397
|
+
onFinalize(_resultMessage, _totalDurationMs, _ctx, store) {
|
|
398
|
+
this.phaseSnapshots.push({
|
|
399
|
+
phase: this.currentPhase,
|
|
400
|
+
compactions: this.phaseCompactions,
|
|
401
|
+
preTokens: [...this.phasePreTokens]
|
|
402
|
+
});
|
|
403
|
+
store.set("compactions", this.getData());
|
|
404
|
+
}
|
|
405
|
+
getData() {
|
|
406
|
+
return {
|
|
407
|
+
phaseCompactions: this.phaseCompactions,
|
|
408
|
+
phasePreTokens: [...this.phasePreTokens],
|
|
409
|
+
totalCompactions: this.totalCompactions,
|
|
410
|
+
phaseSnapshots: [...this.phaseSnapshots]
|
|
411
|
+
};
|
|
412
|
+
}
|
|
413
|
+
};
|
|
414
|
+
//#endregion
|
|
415
|
+
//#region src/lib/middleware/benchmarks/context-size-tracker.ts
|
|
416
|
+
var ContextSizeTrackerPlugin = class {
|
|
417
|
+
name = "contextSize";
|
|
418
|
+
phaseSnapshots = [];
|
|
419
|
+
lastContextTokensOut;
|
|
420
|
+
onPhaseTransition(fromPhase, _toPhase, ctx, store) {
|
|
421
|
+
const tokens = ctx.get("tokens");
|
|
422
|
+
const contextTokensOut = this.computeContextTokensOut(tokens?.lastUsage);
|
|
423
|
+
this.phaseSnapshots.push({
|
|
424
|
+
phase: fromPhase,
|
|
425
|
+
contextTokensIn: ctx.currentPhaseFreshContext ? void 0 : this.lastContextTokensOut,
|
|
426
|
+
contextTokensOut,
|
|
427
|
+
freshContext: ctx.currentPhaseFreshContext
|
|
428
|
+
});
|
|
429
|
+
this.lastContextTokensOut = contextTokensOut;
|
|
430
|
+
store.set("contextSize", this.getData());
|
|
431
|
+
}
|
|
432
|
+
onFinalize(_resultMessage, _totalDurationMs, ctx, store) {
|
|
433
|
+
const tokens = ctx.get("tokens");
|
|
434
|
+
const contextTokensOut = this.computeContextTokensOut(tokens?.lastUsage);
|
|
435
|
+
this.phaseSnapshots.push({
|
|
436
|
+
phase: ctx.currentPhase,
|
|
437
|
+
contextTokensIn: ctx.currentPhaseFreshContext ? void 0 : this.lastContextTokensOut,
|
|
438
|
+
contextTokensOut,
|
|
439
|
+
freshContext: ctx.currentPhaseFreshContext
|
|
440
|
+
});
|
|
441
|
+
store.set("contextSize", this.getData());
|
|
442
|
+
}
|
|
443
|
+
computeContextTokensOut(usage) {
|
|
444
|
+
if (!usage) return void 0;
|
|
445
|
+
return Number(usage.input_tokens ?? 0) + Number(usage.cache_read_input_tokens ?? 0) + Number(usage.cache_creation_input_tokens ?? 0);
|
|
446
|
+
}
|
|
447
|
+
getData() {
|
|
448
|
+
return { phaseSnapshots: [...this.phaseSnapshots] };
|
|
449
|
+
}
|
|
450
|
+
};
|
|
451
|
+
//#endregion
|
|
452
|
+
//#region src/lib/middleware/benchmarks/cost-tracker.ts
|
|
453
|
+
/** Claude Sonnet 4.6 pricing (USD per 1M tokens) */
|
|
454
|
+
const PRICE_PER_MTOK = {
|
|
455
|
+
input: 3,
|
|
456
|
+
output: 15,
|
|
457
|
+
cacheRead: .3,
|
|
458
|
+
cacheCreation5m: 3.75,
|
|
459
|
+
cacheCreation1h: 6
|
|
460
|
+
};
|
|
461
|
+
function computeCost(inputTokens, outputTokens, cacheReadTokens, cacheCreation5m, cacheCreation1h, cacheCreationFallback) {
|
|
462
|
+
const hasBreakdown = cacheCreation5m > 0 || cacheCreation1h > 0;
|
|
463
|
+
return inputTokens * (PRICE_PER_MTOK.input / 1e6) + outputTokens * (PRICE_PER_MTOK.output / 1e6) + cacheReadTokens * (PRICE_PER_MTOK.cacheRead / 1e6) + (hasBreakdown ? cacheCreation5m * (PRICE_PER_MTOK.cacheCreation5m / 1e6) + cacheCreation1h * (PRICE_PER_MTOK.cacheCreation1h / 1e6) : cacheCreationFallback * (PRICE_PER_MTOK.cacheCreation5m / 1e6));
|
|
464
|
+
}
|
|
465
|
+
var CostTrackerPlugin = class {
|
|
466
|
+
name = "cost";
|
|
467
|
+
phaseCosts = [];
|
|
468
|
+
totalCost = 0;
|
|
469
|
+
onPhaseTransition(fromPhase, _toPhase, ctx, store) {
|
|
470
|
+
const tokens = ctx.get("tokens");
|
|
471
|
+
const cache = ctx.get("cache");
|
|
472
|
+
const tokenSnap = tokens?.phaseSnapshots.at(-1);
|
|
473
|
+
const cacheSnap = cache?.phaseSnapshots.at(-1);
|
|
474
|
+
const totalIn = tokenSnap?.inputTokens ?? 0;
|
|
475
|
+
const read = cacheSnap?.cacheReadTokens ?? 0;
|
|
476
|
+
const creation = cacheSnap?.cacheCreationTokens ?? 0;
|
|
477
|
+
const c5m = cacheSnap?.cacheCreation5m ?? 0;
|
|
478
|
+
const c1h = cacheSnap?.cacheCreation1h ?? 0;
|
|
479
|
+
const phaseCost = computeCost(Math.max(0, totalIn - read - creation), tokenSnap?.outputTokens ?? 0, read, c5m, c1h, creation);
|
|
480
|
+
this.phaseCosts.push({
|
|
481
|
+
phase: fromPhase,
|
|
482
|
+
cost: phaseCost
|
|
483
|
+
});
|
|
484
|
+
this.totalCost += phaseCost;
|
|
485
|
+
store.set("cost", this.getData());
|
|
486
|
+
}
|
|
487
|
+
onFinalize(resultMessage, _totalDurationMs, ctx, store) {
|
|
488
|
+
const tokens = ctx.get("tokens");
|
|
489
|
+
const cache = ctx.get("cache");
|
|
490
|
+
const tokenSnap = tokens?.phaseSnapshots.at(-1);
|
|
491
|
+
const cacheSnap = cache?.phaseSnapshots.at(-1);
|
|
492
|
+
const totalIn = tokenSnap?.inputTokens ?? 0;
|
|
493
|
+
const read = cacheSnap?.cacheReadTokens ?? 0;
|
|
494
|
+
const creation = cacheSnap?.cacheCreationTokens ?? 0;
|
|
495
|
+
const c5m = cacheSnap?.cacheCreation5m ?? 0;
|
|
496
|
+
const c1h = cacheSnap?.cacheCreation1h ?? 0;
|
|
497
|
+
const lastPhaseCost = computeCost(Math.max(0, totalIn - read - creation), tokenSnap?.outputTokens ?? 0, read, c5m, c1h, creation);
|
|
498
|
+
this.phaseCosts.push({
|
|
499
|
+
phase: ctx.currentPhase,
|
|
500
|
+
cost: lastPhaseCost
|
|
501
|
+
});
|
|
502
|
+
this.totalCost += lastPhaseCost;
|
|
503
|
+
const sdkTotal = Number(resultMessage?.usage?.total_cost_usd ?? 0) || Number(resultMessage?.total_cost_usd ?? 0);
|
|
504
|
+
if (sdkTotal > 0 && this.totalCost > 0) {
|
|
505
|
+
const scale = sdkTotal / this.totalCost;
|
|
506
|
+
this.phaseCosts = this.phaseCosts.map((p) => ({
|
|
507
|
+
phase: p.phase,
|
|
508
|
+
cost: p.cost * scale
|
|
509
|
+
}));
|
|
510
|
+
this.totalCost = sdkTotal;
|
|
511
|
+
}
|
|
512
|
+
store.set("cost", this.getData());
|
|
513
|
+
}
|
|
514
|
+
getData() {
|
|
515
|
+
return {
|
|
516
|
+
totalCost: this.totalCost,
|
|
517
|
+
phaseCosts: [...this.phaseCosts]
|
|
518
|
+
};
|
|
519
|
+
}
|
|
520
|
+
};
|
|
521
|
+
//#endregion
|
|
522
|
+
//#region src/lib/middleware/benchmarks/duration-tracker.ts
|
|
523
|
+
var DurationTrackerPlugin = class {
|
|
524
|
+
name = "duration";
|
|
525
|
+
phaseStartTime = Date.now();
|
|
526
|
+
phaseSnapshots = [];
|
|
527
|
+
onPhaseTransition(fromPhase, _toPhase, _ctx, store) {
|
|
528
|
+
const now = Date.now();
|
|
529
|
+
this.phaseSnapshots.push({
|
|
530
|
+
phase: fromPhase,
|
|
531
|
+
startTime: this.phaseStartTime,
|
|
532
|
+
endTime: now,
|
|
533
|
+
durationMs: now - this.phaseStartTime
|
|
534
|
+
});
|
|
535
|
+
this.phaseStartTime = now;
|
|
536
|
+
store.set("duration", {
|
|
537
|
+
phaseSnapshots: [...this.phaseSnapshots],
|
|
538
|
+
totalDurationMs: 0
|
|
539
|
+
});
|
|
540
|
+
}
|
|
541
|
+
onFinalize(_resultMessage, totalDurationMs, ctx, store) {
|
|
542
|
+
const now = Date.now();
|
|
543
|
+
this.phaseSnapshots.push({
|
|
544
|
+
phase: ctx.currentPhase,
|
|
545
|
+
startTime: this.phaseStartTime,
|
|
546
|
+
endTime: now,
|
|
547
|
+
durationMs: now - this.phaseStartTime
|
|
548
|
+
});
|
|
549
|
+
store.set("duration", {
|
|
550
|
+
phaseSnapshots: [...this.phaseSnapshots],
|
|
551
|
+
totalDurationMs
|
|
552
|
+
});
|
|
553
|
+
}
|
|
554
|
+
};
|
|
555
|
+
//#endregion
|
|
556
|
+
//#region src/lib/middleware/benchmarks/summary.ts
|
|
557
|
+
function fmtDuration(ms) {
|
|
558
|
+
const s = Math.round(ms / 1e3);
|
|
559
|
+
const m = Math.floor(s / 60);
|
|
560
|
+
return m > 0 ? `${m}m ${s % 60}s` : `${s}s`;
|
|
561
|
+
}
|
|
562
|
+
function fmtTok(n) {
|
|
563
|
+
if (n >= 1e6) return `${(n / 1e6).toFixed(1)}M`;
|
|
564
|
+
if (n >= 1e3) return `${(n / 1e3).toFixed(1)}K`;
|
|
565
|
+
return n.toLocaleString();
|
|
566
|
+
}
|
|
567
|
+
function fmtCost(usd) {
|
|
568
|
+
if (usd > 0 && usd < .01) return `$${usd.toFixed(4)}`;
|
|
569
|
+
return `$${usd.toFixed(2)}`;
|
|
570
|
+
}
|
|
571
|
+
function printPhase(s) {
|
|
572
|
+
const baseIn = Math.max(0, s.inputTokens - s.cacheRead - s.cacheCreation5m - s.cacheCreation1h);
|
|
573
|
+
return [
|
|
574
|
+
`${s.phase}: ${fmtDuration(s.durationMs)}, ${s.turns} turns, cost: ${fmtCost(s.cost)}`,
|
|
575
|
+
` in: ${fmtTok(baseIn)}, out: ${fmtTok(s.outputTokens)}, cache_read: ${fmtTok(s.cacheRead)}, cache_5m: ${fmtTok(s.cacheCreation5m)}, cache_1h: ${fmtTok(s.cacheCreation1h)}`,
|
|
576
|
+
s.compactions > 0 ? ` ${s.compactions} compaction(s)` : null,
|
|
577
|
+
s.contextOut !== void 0 ? ` ctx_out: ${fmtTok(s.contextOut)}` : null
|
|
578
|
+
].filter(Boolean).join("\n");
|
|
579
|
+
}
|
|
580
|
+
function getPhaseStats(i, ctx) {
|
|
581
|
+
const dur = ctx.get("duration")?.phaseSnapshots[i];
|
|
582
|
+
if (!dur) return null;
|
|
583
|
+
const tokens = ctx.get("tokens");
|
|
584
|
+
const turns = ctx.get("turns");
|
|
585
|
+
const cost = ctx.get("cost");
|
|
586
|
+
const compactions = ctx.get("compactions");
|
|
587
|
+
const contextSize = ctx.get("contextSize");
|
|
588
|
+
const cache = ctx.get("cache");
|
|
589
|
+
return {
|
|
590
|
+
phase: dur.phase,
|
|
591
|
+
durationMs: dur.durationMs,
|
|
592
|
+
turns: turns?.phaseSnapshots[i]?.turns ?? 0,
|
|
593
|
+
inputTokens: tokens?.phaseSnapshots[i]?.inputTokens ?? 0,
|
|
594
|
+
outputTokens: tokens?.phaseSnapshots[i]?.outputTokens ?? 0,
|
|
595
|
+
cacheRead: cache?.phaseSnapshots[i]?.cacheReadTokens ?? 0,
|
|
596
|
+
cacheCreation5m: cache?.phaseSnapshots[i]?.cacheCreation5m ?? 0,
|
|
597
|
+
cacheCreation1h: cache?.phaseSnapshots[i]?.cacheCreation1h ?? 0,
|
|
598
|
+
cost: cost?.phaseCosts[i]?.cost ?? 0,
|
|
599
|
+
compactions: compactions?.phaseSnapshots[i]?.compactions ?? 0,
|
|
600
|
+
contextOut: contextSize?.phaseSnapshots[i]?.contextTokensOut
|
|
601
|
+
};
|
|
602
|
+
}
|
|
603
|
+
var SummaryPlugin = class {
|
|
604
|
+
name = "summary";
|
|
605
|
+
spinner;
|
|
606
|
+
constructor(spinner) {
|
|
607
|
+
this.spinner = spinner;
|
|
608
|
+
}
|
|
609
|
+
onPhaseTransition(fromPhase, toPhase, ctx, _store) {
|
|
610
|
+
const stats = getPhaseStats((ctx.get("duration")?.phaseSnapshots.length ?? 1) - 1, ctx);
|
|
611
|
+
if (stats) this.spinner.stop(`${AgentSignals.BENCHMARK} ${printPhase(stats)}`);
|
|
612
|
+
else this.spinner.stop(`${AgentSignals.BENCHMARK} ${fromPhase}`);
|
|
613
|
+
getUI().log.info(`${AgentSignals.BENCHMARK} Starting phase: ${toPhase}`);
|
|
614
|
+
this.spinner.start(`Integrating PostHog (${toPhase})...`);
|
|
615
|
+
}
|
|
616
|
+
onFinalize(_resultMessage, totalDurationMs, ctx, _store) {
|
|
617
|
+
const duration = ctx.get("duration");
|
|
618
|
+
const cost = ctx.get("cost");
|
|
619
|
+
const tokens = ctx.get("tokens");
|
|
620
|
+
const cache = ctx.get("cache");
|
|
621
|
+
const phaseCount = duration?.phaseSnapshots.length ?? 0;
|
|
622
|
+
const totalCost = cost?.totalCost ?? 0;
|
|
623
|
+
getUI().log.info("");
|
|
624
|
+
getUI().log.info(`◇ ${AgentSignals.BENCHMARK} ${phaseCount} phases in ${fmtDuration(totalDurationMs)}, cost: ${fmtCost(totalCost)}`);
|
|
625
|
+
getUI().log.info(` total in: ${fmtTok(tokens?.totalInput ?? 0)}, out: ${fmtTok(tokens?.totalOutput ?? 0)}, cache_read: ${fmtTok(cache?.totalRead ?? 0)}, cache_5m: ${fmtTok(cache?.totalCreation5m ?? 0)}, cache_1h: ${fmtTok(cache?.totalCreation1h ?? 0)}`);
|
|
626
|
+
getUI().log.info("");
|
|
627
|
+
getUI().log.info(`● ${AgentSignals.BENCHMARK} Summary by phase:`);
|
|
628
|
+
if (duration?.phaseSnapshots) for (let i = 0; i < duration.phaseSnapshots.length; i++) {
|
|
629
|
+
const stats = getPhaseStats(i, ctx);
|
|
630
|
+
if (stats) getUI().log.info(printPhase(stats));
|
|
631
|
+
}
|
|
632
|
+
getUI().log.info("");
|
|
633
|
+
}
|
|
634
|
+
};
|
|
635
|
+
//#endregion
|
|
636
|
+
//#region src/lib/middleware/benchmarks/json-writer.ts
|
|
637
|
+
/**
|
|
638
|
+
* JSON file output plugin.
|
|
639
|
+
*
|
|
640
|
+
* Assembles the BenchmarkData structure from all upstream plugin data
|
|
641
|
+
* and writes it to a JSON file. Returns the BenchmarkData for backward compat.
|
|
642
|
+
*/
|
|
643
|
+
/**
|
|
644
|
+
* Sum token usage across all models from the SDK's modelUsage field.
|
|
645
|
+
*/
|
|
646
|
+
function sumModelUsage(modelUsage) {
|
|
647
|
+
let input_tokens = 0;
|
|
648
|
+
let output_tokens = 0;
|
|
649
|
+
let cache_creation_input_tokens = 0;
|
|
650
|
+
let cache_read_input_tokens = 0;
|
|
651
|
+
for (const model of Object.values(modelUsage)) {
|
|
652
|
+
input_tokens += model.inputTokens ?? 0;
|
|
653
|
+
output_tokens += model.outputTokens ?? 0;
|
|
654
|
+
cache_creation_input_tokens += model.cacheCreationInputTokens ?? 0;
|
|
655
|
+
cache_read_input_tokens += model.cacheReadInputTokens ?? 0;
|
|
656
|
+
}
|
|
657
|
+
return {
|
|
658
|
+
input_tokens,
|
|
659
|
+
output_tokens,
|
|
660
|
+
cache_creation_input_tokens,
|
|
661
|
+
cache_read_input_tokens
|
|
662
|
+
};
|
|
663
|
+
}
|
|
664
|
+
var JsonWriterPlugin = class {
|
|
665
|
+
name = "jsonWriter";
|
|
666
|
+
outputPath;
|
|
667
|
+
constructor(outputPath) {
|
|
668
|
+
this.outputPath = outputPath;
|
|
669
|
+
}
|
|
670
|
+
onFinalize(resultMessage, totalDurationMs, ctx, _store) {
|
|
671
|
+
const tokens = ctx.get("tokens");
|
|
672
|
+
const cache = ctx.get("cache");
|
|
673
|
+
const turns = ctx.get("turns");
|
|
674
|
+
const cost = ctx.get("cost");
|
|
675
|
+
const duration = ctx.get("duration");
|
|
676
|
+
const compactions = ctx.get("compactions");
|
|
677
|
+
const contextSize = ctx.get("contextSize");
|
|
678
|
+
const aggregateUsage = sumModelUsage(resultMessage?.modelUsage ?? {});
|
|
679
|
+
const phaseCount = duration?.phaseSnapshots.length ?? 0;
|
|
680
|
+
const steps = [];
|
|
681
|
+
for (let i = 0; i < phaseCount; i++) {
|
|
682
|
+
const dur = duration.phaseSnapshots[i];
|
|
683
|
+
const tokenSnap = tokens?.phaseSnapshots[i];
|
|
684
|
+
const cacheSnap = cache?.phaseSnapshots[i];
|
|
685
|
+
const turnSnap = turns?.phaseSnapshots[i];
|
|
686
|
+
const costSnap = cost?.phaseCosts[i];
|
|
687
|
+
const compSnap = compactions?.phaseSnapshots[i];
|
|
688
|
+
const ctxSnap = contextSize?.phaseSnapshots[i];
|
|
689
|
+
const step = {
|
|
690
|
+
name: dur.phase,
|
|
691
|
+
usage: {
|
|
692
|
+
input_tokens: tokenSnap?.inputTokens ?? 0,
|
|
693
|
+
output_tokens: tokenSnap?.outputTokens ?? 0,
|
|
694
|
+
cache_creation_input_tokens: cacheSnap?.cacheCreationTokens ?? 0,
|
|
695
|
+
cache_read_input_tokens: cacheSnap?.cacheReadTokens ?? 0,
|
|
696
|
+
...(cacheSnap?.cacheCreation5m ?? 0) + (cacheSnap?.cacheCreation1h ?? 0) > 0 && { cache_creation: {
|
|
697
|
+
ephemeral_5m_input_tokens: cacheSnap?.cacheCreation5m ?? 0,
|
|
698
|
+
ephemeral_1h_input_tokens: cacheSnap?.cacheCreation1h ?? 0
|
|
699
|
+
} }
|
|
700
|
+
},
|
|
701
|
+
modelUsage: {},
|
|
702
|
+
totalCostUsd: costSnap?.cost ?? 0,
|
|
703
|
+
durationMs: dur.durationMs,
|
|
704
|
+
durationApiMs: 0,
|
|
705
|
+
numTurns: turnSnap?.turns ?? 0,
|
|
706
|
+
...ctxSnap?.contextTokensIn !== void 0 && { contextTokensIn: ctxSnap.contextTokensIn },
|
|
707
|
+
...ctxSnap?.contextTokensOut !== void 0 && { contextTokensOut: ctxSnap.contextTokensOut },
|
|
708
|
+
...compSnap && compSnap.compactions > 0 ? {
|
|
709
|
+
compactions: compSnap.compactions,
|
|
710
|
+
compactionPreTokens: compSnap.preTokens
|
|
711
|
+
} : {}
|
|
712
|
+
};
|
|
713
|
+
steps.push(step);
|
|
714
|
+
}
|
|
715
|
+
const totalTurns = turns?.totalTurns ?? 0;
|
|
716
|
+
const totalCost = cost?.totalCost ?? 0;
|
|
717
|
+
const totalCompactions = compactions?.totalCompactions ?? 0;
|
|
718
|
+
const fromModelUsage = aggregateUsage.input_tokens + aggregateUsage.cache_read_input_tokens + aggregateUsage.cache_creation_input_tokens;
|
|
719
|
+
const inputTokens = fromModelUsage > 0 ? fromModelUsage : (tokens?.totalInput ?? 0) + (cache?.totalRead ?? 0) + (cache?.totalCreation ?? 0);
|
|
720
|
+
const outputTokens = aggregateUsage.output_tokens > 0 ? aggregateUsage.output_tokens : tokens?.totalOutput ?? 0;
|
|
721
|
+
const benchmark = {
|
|
722
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
723
|
+
steps,
|
|
724
|
+
totals: {
|
|
725
|
+
totalCostUsd: totalCost,
|
|
726
|
+
durationMs: totalDurationMs,
|
|
727
|
+
inputTokens,
|
|
728
|
+
outputTokens,
|
|
729
|
+
numTurns: resultMessage?.num_turns ?? totalTurns,
|
|
730
|
+
totalCompactions,
|
|
731
|
+
totalCacheReadTokens: cache?.totalRead ?? 0,
|
|
732
|
+
totalCacheCreation5mTokens: cache?.totalCreation5m ?? 0,
|
|
733
|
+
totalCacheCreation1hTokens: cache?.totalCreation1h ?? 0
|
|
734
|
+
}
|
|
735
|
+
};
|
|
736
|
+
this.writeBenchmarkData(benchmark);
|
|
737
|
+
return benchmark;
|
|
738
|
+
}
|
|
739
|
+
writeBenchmarkData(data) {
|
|
740
|
+
try {
|
|
741
|
+
fs.writeFileSync(this.outputPath, JSON.stringify(data, null, 2));
|
|
742
|
+
logToFile(`Benchmark data written to ${this.outputPath}`);
|
|
743
|
+
getUI().log.info(`● ${AgentSignals.BENCHMARK} Results written to ${this.outputPath}`);
|
|
744
|
+
} catch (error) {
|
|
745
|
+
logToFile("Failed to write benchmark data:", error);
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
};
|
|
749
|
+
//#endregion
|
|
750
|
+
//#region src/lib/middleware/benchmarks/index.ts
|
|
751
|
+
const PLUGIN_REGISTRY = {
|
|
752
|
+
turns: () => new TurnCounterPlugin(),
|
|
753
|
+
tokens: () => new TokenTrackerPlugin(),
|
|
754
|
+
cache: () => new CacheTrackerPlugin(),
|
|
755
|
+
compactions: () => new CompactionTrackerPlugin(),
|
|
756
|
+
contextSize: () => new ContextSizeTrackerPlugin(),
|
|
757
|
+
cost: () => new CostTrackerPlugin(),
|
|
758
|
+
duration: () => new DurationTrackerPlugin(),
|
|
759
|
+
summary: (opts) => new SummaryPlugin(opts.spinner),
|
|
760
|
+
jsonWriter: (opts) => new JsonWriterPlugin(opts.outputPath)
|
|
761
|
+
};
|
|
762
|
+
/**
|
|
763
|
+
* Execution order — data producers before consumers:
|
|
764
|
+
* turns (dedup) -> tokens -> cache -> compactions -> contextSize -> cost -> duration -> summary -> jsonWriter
|
|
765
|
+
*/
|
|
766
|
+
const PLUGIN_ORDER = [
|
|
767
|
+
"turns",
|
|
768
|
+
"tokens",
|
|
769
|
+
"cache",
|
|
770
|
+
"compactions",
|
|
771
|
+
"contextSize",
|
|
772
|
+
"cost",
|
|
773
|
+
"duration",
|
|
774
|
+
"summary",
|
|
775
|
+
"jsonWriter"
|
|
776
|
+
];
|
|
777
|
+
function createPluginsFromConfig(config, opts) {
|
|
778
|
+
const resolvedOpts = {
|
|
779
|
+
...opts,
|
|
780
|
+
outputPath: opts.outputPath ?? config.output.benchmarkPath
|
|
781
|
+
};
|
|
782
|
+
const effectivePlugins = { ...config.plugins };
|
|
783
|
+
if (config.output.suppressWizardLogs) effectivePlugins.summary = false;
|
|
784
|
+
return PLUGIN_ORDER.filter((name) => effectivePlugins[name] !== false).map((name) => PLUGIN_REGISTRY[name]).filter(Boolean).map((factory) => factory(resolvedOpts));
|
|
785
|
+
}
|
|
786
|
+
//#endregion
|
|
787
|
+
//#region src/lib/middleware/benchmark.ts
|
|
788
|
+
/**
|
|
789
|
+
* Benchmark tracking for wizard runs.
|
|
790
|
+
*
|
|
791
|
+
* Usage:
|
|
792
|
+
* const pipeline = createBenchmarkPipeline(spinner, options);
|
|
793
|
+
* pipeline.onMessage(message);
|
|
794
|
+
* pipeline.finalize(resultMessage, durationMs);
|
|
795
|
+
*/
|
|
796
|
+
/**
|
|
797
|
+
* Create a middleware pipeline configured for benchmarking.
|
|
798
|
+
* Loads .benchmark-config.json from the install dir, falls back to defaults.
|
|
799
|
+
*/
|
|
800
|
+
function createBenchmarkPipeline(spinner, options, configOverride) {
|
|
801
|
+
const config = configOverride ?? loadBenchmarkConfig(options.installDir);
|
|
802
|
+
configureLogFile({
|
|
803
|
+
path: config.output.logPath,
|
|
804
|
+
enabled: config.output.logEnabled
|
|
805
|
+
});
|
|
806
|
+
const plugins = createPluginsFromConfig(config, {
|
|
807
|
+
spinner,
|
|
808
|
+
phased: false,
|
|
809
|
+
outputPath: config.output.benchmarkPath
|
|
810
|
+
});
|
|
811
|
+
if (!config.output.suppressWizardLogs) {
|
|
812
|
+
getUI().log.info(`${AgentSignals.BENCHMARK} Verbose logs: ${getLogFilePath()}`);
|
|
813
|
+
getUI().log.info(`${AgentSignals.BENCHMARK} Benchmark data will be written to: ${config.output.benchmarkPath}`);
|
|
814
|
+
}
|
|
815
|
+
logToFile(`${AgentSignals.BENCHMARK} Tracking enabled, starting with setup phase`);
|
|
816
|
+
return new MiddlewarePipeline(plugins, {
|
|
817
|
+
phaseDetector: new PhaseDetector(),
|
|
818
|
+
autoDetectPhases: true
|
|
819
|
+
});
|
|
820
|
+
}
|
|
821
|
+
//#endregion
|
|
822
|
+
//#region src/lib/agent/agent-prompt.ts
|
|
823
|
+
function defaultProjectPrompt(ctx) {
|
|
824
|
+
return `You have access to the PostHog MCP server.
|
|
825
|
+
|
|
826
|
+
Project context:
|
|
827
|
+
- PostHog Project ID: ${ctx.projectId}
|
|
828
|
+
- PostHog public token: ${ctx.projectApiKey}
|
|
829
|
+
- PostHog Host: ${ctx.host}`;
|
|
830
|
+
}
|
|
831
|
+
function skillPrompt(skillPath, reportFile) {
|
|
832
|
+
return `A PostHog skill has been installed at ${skillPath}/. Read ${skillPath}/SKILL.md and follow its instructions completely.
|
|
833
|
+
|
|
834
|
+
After completing the skill workflow, write a brief markdown report to ./${reportFile} summarizing:
|
|
835
|
+
- What changes were made to the project
|
|
836
|
+
- Which files were modified or created
|
|
837
|
+
- Any manual steps the user should take next
|
|
838
|
+
|
|
839
|
+
Important: You must read a file immediately before attempting to write it, even if you have previously read it; failure to do so will cause a tool failure.`;
|
|
840
|
+
}
|
|
841
|
+
/**
|
|
842
|
+
* Assemble the final agent prompt from the workflow's run config.
|
|
843
|
+
*/
|
|
844
|
+
function assemblePrompt(runDef, ctx) {
|
|
845
|
+
const parts = [];
|
|
846
|
+
parts.push(defaultProjectPrompt(ctx));
|
|
847
|
+
if (runDef.customPrompt) parts.push(runDef.customPrompt(ctx));
|
|
848
|
+
if (ctx.skillPath) parts.push(skillPrompt(ctx.skillPath, runDef.reportFile));
|
|
849
|
+
return parts.join("\n\n");
|
|
850
|
+
}
|
|
851
|
+
//#endregion
|
|
852
|
+
//#region src/lib/agent/agent-runner.ts
|
|
853
|
+
/**
|
|
854
|
+
* Unified workflow runner.
|
|
855
|
+
*
|
|
856
|
+
* Single configurable pipeline for all workflows. Each workflow
|
|
857
|
+
* provides a WorkflowRun (via the `run` field on WorkflowConfig)
|
|
858
|
+
* that controls:
|
|
859
|
+
* - Whether a skill is pre-installed or discovered at runtime
|
|
860
|
+
* - How the agent prompt is built
|
|
861
|
+
* - What MCP servers and package manager detector to use
|
|
862
|
+
* - What happens after the agent completes
|
|
863
|
+
*
|
|
864
|
+
* The pipeline itself is fixed:
|
|
865
|
+
* init → health check → settings → OAuth → [skill install] →
|
|
866
|
+
* agent init → prompt → run → errors → [postRun] → outro
|
|
867
|
+
*/
|
|
868
|
+
function sessionToOptions(session) {
|
|
869
|
+
return {
|
|
870
|
+
installDir: session.installDir,
|
|
871
|
+
debug: session.debug,
|
|
872
|
+
forceInstall: session.forceInstall,
|
|
873
|
+
default: false,
|
|
874
|
+
signup: session.signup,
|
|
875
|
+
localMcp: session.localMcp,
|
|
876
|
+
ci: session.ci,
|
|
877
|
+
menu: session.menu,
|
|
878
|
+
benchmark: session.benchmark,
|
|
879
|
+
projectId: session.projectId,
|
|
880
|
+
apiKey: session.apiKey,
|
|
881
|
+
yaraReport: session.yaraReport
|
|
882
|
+
};
|
|
883
|
+
}
|
|
884
|
+
/**
|
|
885
|
+
* Resolve a WorkflowConfig's agent run definition and execute the pipeline.
|
|
886
|
+
* Entry point for bin.ts — handles buildRunConfig, bootstrap, and (future) run field.
|
|
887
|
+
*/
|
|
888
|
+
async function runAgent(workflowConfig, session) {
|
|
889
|
+
if (!workflowConfig.run) throw new Error(`Workflow "${workflowConfig.flowKey}" has no run configuration.`);
|
|
890
|
+
await runWorkflow(session, typeof workflowConfig.run === "function" ? await workflowConfig.run(session) : workflowConfig.run);
|
|
891
|
+
}
|
|
892
|
+
/**
|
|
893
|
+
* Run a workflow's agent pipeline.
|
|
894
|
+
*
|
|
895
|
+
* This is the single execution path for all workflows — both skill-based
|
|
896
|
+
* (revenue analytics) and framework-based (core integration). The
|
|
897
|
+
* `WorkflowRun` controls what varies between them.
|
|
898
|
+
*/
|
|
899
|
+
async function runWorkflow(session, config) {
|
|
900
|
+
initLogFile();
|
|
901
|
+
logToFile(`[agent-runner] START ${config.integrationLabel}`);
|
|
902
|
+
if (session.debug) enableDebugLogs();
|
|
903
|
+
const skillsBaseUrl = getSkillsBaseUrl(session.localMcp);
|
|
904
|
+
if (!session.readinessResult) {
|
|
905
|
+
logToFile("[agent-runner] evaluating wizard readiness");
|
|
906
|
+
const readiness = await evaluateWizardReadiness();
|
|
907
|
+
logToFile(`[agent-runner] readiness=${readiness.decision}`);
|
|
908
|
+
if (readiness.decision === "no") await getUI().showBlockingOutage(readiness);
|
|
909
|
+
else if (readiness.decision === "yes_with_warnings") getUI().setReadinessWarnings(readiness);
|
|
910
|
+
}
|
|
911
|
+
const settingsConflicts = checkAllSettingsConflicts(session.installDir);
|
|
912
|
+
logToFile(`[agent-runner] settings conflicts: ${settingsConflicts.length > 0 ? settingsConflicts.map((c) => `${c.source}(${c.keys.join(",")})`).join("; ") : "none"}`);
|
|
913
|
+
if (settingsConflicts.length > 0) {
|
|
914
|
+
for (const conflict of settingsConflicts) {
|
|
915
|
+
const level = conflict.source === "managed" ? "org" : conflict.source;
|
|
916
|
+
analytics.wizardCapture("settings conflict detected", {
|
|
917
|
+
level,
|
|
918
|
+
keys: conflict.keys
|
|
919
|
+
});
|
|
920
|
+
}
|
|
921
|
+
await getUI().showSettingsOverride(settingsConflicts, () => backupAndFixClaudeSettings(session.installDir));
|
|
922
|
+
logToFile("[agent-runner] settings override resolved");
|
|
923
|
+
}
|
|
924
|
+
analytics.wizardCapture("agent started", {
|
|
925
|
+
integration: config.integrationLabel,
|
|
926
|
+
workflow: config.integrationLabel,
|
|
927
|
+
skill_id: config.skillId ?? null
|
|
928
|
+
});
|
|
929
|
+
logToFile("[agent-runner] starting OAuth");
|
|
930
|
+
const { projectApiKey, host, accessToken, projectId, cloudRegion } = await getOrAskForProjectData({
|
|
931
|
+
signup: session.signup,
|
|
932
|
+
ci: session.ci,
|
|
933
|
+
apiKey: session.apiKey,
|
|
934
|
+
projectId: session.projectId
|
|
935
|
+
});
|
|
936
|
+
session.credentials = {
|
|
937
|
+
accessToken,
|
|
938
|
+
projectApiKey,
|
|
939
|
+
host,
|
|
940
|
+
projectId
|
|
941
|
+
};
|
|
942
|
+
getUI().setCredentials(session.credentials);
|
|
943
|
+
let skillPath;
|
|
944
|
+
if (config.skillId) {
|
|
945
|
+
logToFile(`[agent-runner] installing skill ${config.skillId}`);
|
|
946
|
+
const installResult = await installSkillById(config.skillId, session.installDir, skillsBaseUrl);
|
|
947
|
+
if (installResult.kind !== "ok") {
|
|
948
|
+
await abortOnInstallFailure(config.integrationLabel, installResult);
|
|
949
|
+
return;
|
|
950
|
+
}
|
|
951
|
+
skillPath = installResult.path;
|
|
952
|
+
logToFile(`[agent-runner] skill installed at ${skillPath}`);
|
|
953
|
+
}
|
|
954
|
+
const spinner = getUI().spinner();
|
|
955
|
+
const wizardFlags = await analytics.getAllFlagsForWizard();
|
|
956
|
+
const wizardMetadata = buildWizardMetadata(wizardFlags);
|
|
957
|
+
const mcpUrl = session.localMcp ? "http://localhost:8787/mcp" : runtimeEnv("MCP_URL") || (cloudRegion === "eu" ? "https://mcp-eu.posthog.com/mcp" : "https://mcp.posthog.com/mcp");
|
|
958
|
+
const restoreSettings = () => restoreClaudeSettings(session.installDir);
|
|
959
|
+
getUI().onEnterScreen("outro", restoreSettings);
|
|
960
|
+
if (session.yaraReport) registerCleanup(() => {
|
|
961
|
+
const reportPath = writeScanReport();
|
|
962
|
+
if (reportPath) {
|
|
963
|
+
const summary = formatScanReport();
|
|
964
|
+
getUI().log.info(`YARA scan report: ${reportPath}${summary ?? ""}`);
|
|
965
|
+
}
|
|
966
|
+
});
|
|
967
|
+
getUI().startRun();
|
|
968
|
+
const agent = await initializeAgent({
|
|
969
|
+
workingDirectory: session.installDir,
|
|
970
|
+
posthogMcpUrl: mcpUrl,
|
|
971
|
+
posthogApiKey: accessToken,
|
|
972
|
+
posthogApiHost: host,
|
|
973
|
+
additionalMcpServers: config.additionalMcpServers,
|
|
974
|
+
detectPackageManager: config.detectPackageManager ?? detectNodePackageManagers,
|
|
975
|
+
skillsBaseUrl,
|
|
976
|
+
wizardFlags,
|
|
977
|
+
wizardMetadata
|
|
978
|
+
}, sessionToOptions(session));
|
|
979
|
+
const middleware = session.benchmark ? createBenchmarkPipeline(spinner, sessionToOptions(session)) : void 0;
|
|
980
|
+
const agentResult = await runAgent$1(agent, assemblePrompt(config, {
|
|
981
|
+
projectId,
|
|
982
|
+
projectApiKey,
|
|
983
|
+
host,
|
|
984
|
+
skillPath
|
|
985
|
+
}), sessionToOptions(session), spinner, {
|
|
986
|
+
estimatedDurationMinutes: config.estimatedDurationMinutes,
|
|
987
|
+
spinnerMessage: config.spinnerMessage,
|
|
988
|
+
successMessage: config.successMessage,
|
|
989
|
+
errorMessage: config.errorMessage ?? `${config.integrationLabel} failed`,
|
|
990
|
+
additionalFeatureQueue: config.additionalFeatureQueue ?? [],
|
|
991
|
+
abortCases: config.abortCases
|
|
992
|
+
}, middleware);
|
|
993
|
+
if (agentResult.error === "WIZARD_ABORT") {
|
|
994
|
+
const reason = agentResult.message ?? "";
|
|
995
|
+
const matched = config.abortCases?.find((c) => c.match.test(reason));
|
|
996
|
+
const outroData = matched ? {
|
|
997
|
+
kind: "error",
|
|
998
|
+
message: matched.message,
|
|
999
|
+
body: matched.body,
|
|
1000
|
+
docsUrl: matched.docsUrl
|
|
1001
|
+
} : {
|
|
1002
|
+
kind: "error",
|
|
1003
|
+
message: `${config.integrationLabel} aborted`,
|
|
1004
|
+
body: reason || "The agent aborted the workflow.",
|
|
1005
|
+
docsUrl: config.docsUrl
|
|
1006
|
+
};
|
|
1007
|
+
analytics.wizardCapture("agent aborted", {
|
|
1008
|
+
integration: config.integrationLabel,
|
|
1009
|
+
reason,
|
|
1010
|
+
matched: matched?.message ?? null
|
|
1011
|
+
});
|
|
1012
|
+
await wizardAbort({
|
|
1013
|
+
outroData,
|
|
1014
|
+
error: new WizardError(`Agent aborted: ${reason}`, {
|
|
1015
|
+
integration: config.integrationLabel,
|
|
1016
|
+
error_type: "WIZARD_ABORT",
|
|
1017
|
+
reason
|
|
1018
|
+
})
|
|
1019
|
+
});
|
|
1020
|
+
}
|
|
1021
|
+
if (agentResult.error === "WIZARD_MCP_MISSING") await wizardAbort({
|
|
1022
|
+
message: `Could not access the PostHog MCP server
|
|
1023
|
+
|
|
1024
|
+
The wizard was unable to connect to the PostHog MCP server.
|
|
1025
|
+
This could be due to a network issue or a configuration problem.
|
|
1026
|
+
|
|
1027
|
+
Please try again, or check the documentation:\n${config.docsUrl}`,
|
|
1028
|
+
error: new WizardError("Agent could not access PostHog MCP server", {
|
|
1029
|
+
integration: config.integrationLabel,
|
|
1030
|
+
error_type: "WIZARD_MCP_MISSING",
|
|
1031
|
+
signal: AgentSignals.ERROR_MCP_MISSING
|
|
1032
|
+
})
|
|
1033
|
+
});
|
|
1034
|
+
if (agentResult.error === "WIZARD_RESOURCE_MISSING") await wizardAbort({
|
|
1035
|
+
message: `Could not access the setup resource
|
|
1036
|
+
|
|
1037
|
+
This may indicate a version mismatch or a temporary service issue.
|
|
1038
|
+
|
|
1039
|
+
Please try again, or check the documentation:\n${config.docsUrl}`,
|
|
1040
|
+
error: new WizardError("Agent could not access setup resource", {
|
|
1041
|
+
integration: config.integrationLabel,
|
|
1042
|
+
error_type: "WIZARD_RESOURCE_MISSING",
|
|
1043
|
+
signal: AgentSignals.ERROR_RESOURCE_MISSING
|
|
1044
|
+
})
|
|
1045
|
+
});
|
|
1046
|
+
if (agentResult.error === "WIZARD_YARA_VIOLATION") await wizardAbort({
|
|
1047
|
+
message: "Security violation detected.\nPlease report this to: wizard@posthog.com",
|
|
1048
|
+
error: new WizardError("YARA scanner terminated session", {
|
|
1049
|
+
integration: config.integrationLabel,
|
|
1050
|
+
error_type: "WIZARD_YARA_VIOLATION"
|
|
1051
|
+
})
|
|
1052
|
+
});
|
|
1053
|
+
if (agentResult.error === "WIZARD_RATE_LIMIT" || agentResult.error === "WIZARD_API_ERROR") {
|
|
1054
|
+
analytics.wizardCapture("agent api error", {
|
|
1055
|
+
integration: config.integrationLabel,
|
|
1056
|
+
error_type: agentResult.error,
|
|
1057
|
+
error_message: agentResult.message
|
|
1058
|
+
});
|
|
1059
|
+
await wizardAbort({
|
|
1060
|
+
message: `API Error\n\n${agentResult.message || "Unknown error"}\n\nPlease report this to: wizard@posthog.com`,
|
|
1061
|
+
error: new WizardError(`API error: ${agentResult.message}`, {
|
|
1062
|
+
integration: config.integrationLabel,
|
|
1063
|
+
error_type: agentResult.error
|
|
1064
|
+
})
|
|
1065
|
+
});
|
|
1066
|
+
}
|
|
1067
|
+
if (config.postRun) await config.postRun(session, {
|
|
1068
|
+
accessToken,
|
|
1069
|
+
projectApiKey,
|
|
1070
|
+
host,
|
|
1071
|
+
projectId
|
|
1072
|
+
});
|
|
1073
|
+
if (config.buildOutroData) session.outroData = config.buildOutroData(session, {
|
|
1074
|
+
accessToken,
|
|
1075
|
+
projectApiKey,
|
|
1076
|
+
host,
|
|
1077
|
+
projectId
|
|
1078
|
+
}, cloudRegion);
|
|
1079
|
+
else {
|
|
1080
|
+
const continueUrl = session.signup ? `${getCloudUrlFromRegion(cloudRegion)}/products?source=wizard` : void 0;
|
|
1081
|
+
const reportExists = existsSync(join(session.installDir, config.reportFile));
|
|
1082
|
+
session.outroData = {
|
|
1083
|
+
kind: "success",
|
|
1084
|
+
message: config.successMessage,
|
|
1085
|
+
reportFile: reportExists ? config.reportFile : void 0,
|
|
1086
|
+
docsUrl: config.docsUrl,
|
|
1087
|
+
continueUrl
|
|
1088
|
+
};
|
|
1089
|
+
}
|
|
1090
|
+
getUI().outro(config.successMessage);
|
|
1091
|
+
await analytics.shutdown("success");
|
|
1092
|
+
}
|
|
1093
|
+
async function abortOnInstallFailure(integrationLabel, result) {
|
|
1094
|
+
if (result.kind === "ok") return;
|
|
1095
|
+
await wizardAbort({
|
|
1096
|
+
message: (() => {
|
|
1097
|
+
switch (result.kind) {
|
|
1098
|
+
case "menu-fetch-failed": return "Could not fetch the skill menu from context-mill.\nCheck your network connection and try again.";
|
|
1099
|
+
case "skill-not-found": return `Could not find the "${result.skillId}" skill in the context-mill menu.\nPlease try again later.`;
|
|
1100
|
+
case "download-failed": return `Failed to install skill: ${result.message}\nPlease try again.`;
|
|
1101
|
+
}
|
|
1102
|
+
})(),
|
|
1103
|
+
error: new WizardError(`Skill install failed: ${result.kind}`, {
|
|
1104
|
+
integration: integrationLabel,
|
|
1105
|
+
error_type: result.kind
|
|
1106
|
+
})
|
|
1107
|
+
});
|
|
1108
|
+
}
|
|
1109
|
+
//#endregion
|
|
1110
|
+
export { runAgent };
|
|
1111
|
+
|
|
1112
|
+
//# sourceMappingURL=agent-runner-CGwrcr57.js.map
|