splithub 0.5.1 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{alerts-RXUG22S7.js → alerts-B7LKEY3J.js} +4 -4
- package/dist/{analytics-3TFARFQE.js → analytics-YY3O3HGL.js} +5 -5
- package/dist/{chunk-5JKDO4IN.js → chunk-3H7W4UIT.js} +3 -3
- package/dist/{chunk-5Y6HUYA6.js → chunk-4K2CNZYY.js} +2 -2
- package/dist/{chunk-ZHM47JI5.js → chunk-57IKDCOM.js} +5 -5
- package/dist/{chunk-LWJSVUMI.js → chunk-BWYRU47V.js} +2 -2
- package/dist/{chunk-YRHCGHV7.js → chunk-DBGNAB2J.js} +3 -3
- package/dist/{chunk-SXFGWWE7.js → chunk-FSMUHH4G.js} +6 -6
- package/dist/{chunk-NFZZSF4M.js → chunk-H2OU4PJA.js} +2 -2
- package/dist/{chunk-WQETHW5W.js → chunk-K7KLCGYY.js} +3 -3
- package/dist/{chunk-JZH4ZC2R.js → chunk-KXER4ZZ3.js} +3 -3
- package/dist/{chunk-WV6RNTIM.js → chunk-LFEVNQ75.js} +2 -2
- package/dist/{chunk-WV6RNTIM.js.map → chunk-LFEVNQ75.js.map} +1 -1
- package/dist/{chunk-XTHEBWKY.js → chunk-LGL7JY6Y.js} +3 -3
- package/dist/{chunk-OXQZJCAC.js → chunk-LOYPA5WN.js} +6 -6
- package/dist/chunk-LOYPA5WN.js.map +1 -0
- package/dist/{chunk-FCV7PQN6.js → chunk-NQDGMBRF.js} +4 -4
- package/dist/{chunk-YZPQK4N7.js → chunk-OH735OOS.js} +2 -2
- package/dist/{chunk-CAFWOX3S.js → chunk-OTK6B4QC.js} +2 -2
- package/dist/{chunk-Z2LTGGUG.js → chunk-Q6JPYA4Y.js} +3 -3
- package/dist/{chunk-56WHXKGA.js → chunk-QJQKARDO.js} +2 -2
- package/dist/{chunk-RBV5NIMY.js → chunk-RZGKAVA6.js} +2 -2
- package/dist/{chunk-G2URJ423.js → chunk-SAH2BATZ.js} +3 -3
- package/dist/{chunk-4OQEIP33.js → chunk-W66MJG3R.js} +2 -2
- package/dist/chunk-W66MJG3R.js.map +1 -0
- package/dist/{chunk-Q4W6H7XO.js → chunk-X2ICUB5B.js} +5 -5
- package/dist/chunk-X2ICUB5B.js.map +1 -0
- package/dist/{connect-SHXP65T2.js → connect-5TIWPEIS.js} +8 -8
- package/dist/{create-HRROFCS2.js → create-J2WN55LX.js} +3 -3
- package/dist/{dev-4O4ZVVKH.js → dev-4UQ6KKB7.js} +3 -3
- package/dist/{doctor-GCAMTBJG.js → doctor-HYTPYAEW.js} +4 -4
- package/dist/domains-YIY7HXOS.js +10 -0
- package/dist/{experiment-reports-WMODMYBX.js → experiment-reports-WCMLX34L.js} +5 -5
- package/dist/index.js +27 -27
- package/dist/index.js.map +1 -1
- package/dist/init-PTDL6EON.js +19 -0
- package/dist/{lifecycle-C6RF5MC6.js → lifecycle-NKPKM76H.js} +3 -3
- package/dist/{links-JWPXODYS.js → links-YD6QLNKY.js} +4 -4
- package/dist/{login-OT77MNKL.js → login-4OQI2Q45.js} +3 -3
- package/dist/{menu-XMAEYJNC.js → menu-APVGU6TP.js} +22 -22
- package/dist/{notes-QN5XW2TI.js → notes-NSWGMP2V.js} +4 -4
- package/dist/{plan-UHBAQXRB.js → plan-DZGPGSIE.js} +2 -2
- package/dist/{push-UJHOXRO3.js → push-AI2M56OS.js} +3 -3
- package/dist/{remove-MSEG2USQ.js → remove-R3AS4XYY.js} +2 -2
- package/dist/{report-E6EJECSP.js → report-VTJZEITT.js} +2 -2
- package/dist/{results-OJJKMZ4O.js → results-PZERL5HO.js} +6 -6
- package/dist/{review-GIYBPVP3.js → review-IB7Y2OIF.js} +2 -2
- package/dist/{ship-6A6EWZEX.js → ship-CFM5M6N3.js} +2 -2
- package/dist/{skills-4G73YN3S.js → skills-GJGOA4HL.js} +4 -4
- package/dist/status-SOOLWHLW.js +17 -0
- package/package.json +4 -4
- package/dist/chunk-4OQEIP33.js.map +0 -1
- package/dist/chunk-OXQZJCAC.js.map +0 -1
- package/dist/chunk-Q4W6H7XO.js.map +0 -1
- package/dist/domains-CR34APOD.js +0 -10
- package/dist/init-X2D3YAMU.js +0 -19
- package/dist/status-SDXLN4SE.js +0 -17
- /package/dist/{alerts-RXUG22S7.js.map → alerts-B7LKEY3J.js.map} +0 -0
- /package/dist/{analytics-3TFARFQE.js.map → analytics-YY3O3HGL.js.map} +0 -0
- /package/dist/{chunk-5JKDO4IN.js.map → chunk-3H7W4UIT.js.map} +0 -0
- /package/dist/{chunk-5Y6HUYA6.js.map → chunk-4K2CNZYY.js.map} +0 -0
- /package/dist/{chunk-ZHM47JI5.js.map → chunk-57IKDCOM.js.map} +0 -0
- /package/dist/{chunk-LWJSVUMI.js.map → chunk-BWYRU47V.js.map} +0 -0
- /package/dist/{chunk-YRHCGHV7.js.map → chunk-DBGNAB2J.js.map} +0 -0
- /package/dist/{chunk-SXFGWWE7.js.map → chunk-FSMUHH4G.js.map} +0 -0
- /package/dist/{chunk-NFZZSF4M.js.map → chunk-H2OU4PJA.js.map} +0 -0
- /package/dist/{chunk-WQETHW5W.js.map → chunk-K7KLCGYY.js.map} +0 -0
- /package/dist/{chunk-JZH4ZC2R.js.map → chunk-KXER4ZZ3.js.map} +0 -0
- /package/dist/{chunk-XTHEBWKY.js.map → chunk-LGL7JY6Y.js.map} +0 -0
- /package/dist/{chunk-FCV7PQN6.js.map → chunk-NQDGMBRF.js.map} +0 -0
- /package/dist/{chunk-YZPQK4N7.js.map → chunk-OH735OOS.js.map} +0 -0
- /package/dist/{chunk-CAFWOX3S.js.map → chunk-OTK6B4QC.js.map} +0 -0
- /package/dist/{chunk-Z2LTGGUG.js.map → chunk-Q6JPYA4Y.js.map} +0 -0
- /package/dist/{chunk-56WHXKGA.js.map → chunk-QJQKARDO.js.map} +0 -0
- /package/dist/{chunk-RBV5NIMY.js.map → chunk-RZGKAVA6.js.map} +0 -0
- /package/dist/{chunk-G2URJ423.js.map → chunk-SAH2BATZ.js.map} +0 -0
- /package/dist/{connect-SHXP65T2.js.map → connect-5TIWPEIS.js.map} +0 -0
- /package/dist/{create-HRROFCS2.js.map → create-J2WN55LX.js.map} +0 -0
- /package/dist/{dev-4O4ZVVKH.js.map → dev-4UQ6KKB7.js.map} +0 -0
- /package/dist/{doctor-GCAMTBJG.js.map → doctor-HYTPYAEW.js.map} +0 -0
- /package/dist/{domains-CR34APOD.js.map → domains-YIY7HXOS.js.map} +0 -0
- /package/dist/{experiment-reports-WMODMYBX.js.map → experiment-reports-WCMLX34L.js.map} +0 -0
- /package/dist/{init-X2D3YAMU.js.map → init-PTDL6EON.js.map} +0 -0
- /package/dist/{lifecycle-C6RF5MC6.js.map → lifecycle-NKPKM76H.js.map} +0 -0
- /package/dist/{links-JWPXODYS.js.map → links-YD6QLNKY.js.map} +0 -0
- /package/dist/{login-OT77MNKL.js.map → login-4OQI2Q45.js.map} +0 -0
- /package/dist/{menu-XMAEYJNC.js.map → menu-APVGU6TP.js.map} +0 -0
- /package/dist/{notes-QN5XW2TI.js.map → notes-NSWGMP2V.js.map} +0 -0
- /package/dist/{plan-UHBAQXRB.js.map → plan-DZGPGSIE.js.map} +0 -0
- /package/dist/{push-UJHOXRO3.js.map → push-AI2M56OS.js.map} +0 -0
- /package/dist/{remove-MSEG2USQ.js.map → remove-R3AS4XYY.js.map} +0 -0
- /package/dist/{report-E6EJECSP.js.map → report-VTJZEITT.js.map} +0 -0
- /package/dist/{results-OJJKMZ4O.js.map → results-PZERL5HO.js.map} +0 -0
- /package/dist/{review-GIYBPVP3.js.map → review-IB7Y2OIF.js.map} +0 -0
- /package/dist/{ship-6A6EWZEX.js.map → ship-CFM5M6N3.js.map} +0 -0
- /package/dist/{skills-4G73YN3S.js.map → skills-GJGOA4HL.js.map} +0 -0
- /package/dist/{status-SDXLN4SE.js.map → status-SOOLWHLW.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/skills-self-hosted.ts","../src/skills-ship.ts","../src/skills-analytics.ts","../src/skills-apps.ts","../src/skills.ts","../src/templates.ts"],"sourcesContent":["// Skill: SplitHub with the user's own database (self mode) and reporting from the cloud.\n// Bundled fallback; SplitHub Cloud serves the current text at GET /v1/skills.\nexport const SKILL_SELF_HOSTED = `---\nname: splithub-self-hosted\ndescription: Keep SplitHub events in your own database (self mode): which tables, how to write a Store for Postgres, MySQL, Prisma, Drizzle, Supabase or anything else, where the ingest route lives, how the CLI reads results from it, and how to get cloud data into your own database for reports. Use when the user wants data in their infra or asks about tables, schema or reporting.\n---\n\n# SplitHub with your own database\n\nTwo ways to own the data:\n\n1. **Self mode** — the app hosts the ingest route and the store; nothing leaves your infra.\n \\`splithub.config.ts\\`: \\`storage: { mode: 'self', endpoint: '/api/splithub' }\\`.\n2. **Cloud + export** — events go to SplitHub Cloud; you pull summaries into your warehouse for reports.\n\n## Self mode: the pieces\n\n- Route: \\`app/api/splithub/[[...path]]/route.ts\\` (Next.js) or any fetch-style handler from\n \\`createSplitHubHandler({ config, store, adminToken })\\` in \\`@splithub/node\\`. It accepts\n \\`POST /events\\` from the SDK and answers \\`GET /status\\`, \\`GET /results/<id>\\` for the CLI\n (\\`npx splithub status\\` talks to the local dev server, or \\`--url https://your.app/api/splithub\\`).\n Self-hosted reads are raw numbers per variant (\\`variants[]\\`: visitors, conversions, rate, revenue)\n with \\`analysis: { available: false }\\`. Verdicts, data-quality stars and recommendations come with SplitHub Cloud,\n and so do slices, breakdowns, timelines and raw experiment events (\\`results --from/--filter/--by\\` answer \\`NOT_CLOUD\\` here).\n With an analytics property the SDK sends \\`track()\\` as one \\`event\\` row and a page as one \\`page\\` row; the handler\n stores the goal rows experiments need next to them (goals of the config's experiments only), so the store sees goals as before.\n- Store: an object with three methods (below). Ready-made: \\`@splithub/adapter-sqlite\\`\n (Node 22.13+, \\`node:sqlite\\`, zero setup) and \\`@splithub/adapter-d1\\` (Cloudflare D1).\n \\`npx splithub init --mode self --db postgres|mysql|custom\\` writes \\`splithub/store.ts\\` with a\n working Postgres (pg) or MySQL (mysql2) store, or a documented stub for anything else.\n- Admin token: set \\`SPLITHUB_ADMIN_TOKEN\\` in the app and \\`--token\\` / \\`SPLITHUB_ADMIN_TOKEN\\` for\n the CLI, so results are not public.\n\n## The events table\n\nOne table, one row per event. Column names are yours; the templates use these:\n\n| column | type | meaning |\n|---|---|---|\n| id | text, primary key | client-generated, unique; dedupe on it (retries resend batches) |\n| type | text | \\`exposure\\` or \\`goal\\` |\n| experiment, variant | text | for exposures |\n| goal | text | for goals |\n| visitor_id, session_id | text | \\`sh_vid\\` cookie / session |\n| ts | bigint | client time, unix ms |\n| url | text | page |\n| props | json | goal payload, e.g. \\`{ \"revenue\": 49 }\\` |\n| received_at | bigint | server time, unix ms |\n| host, country, device, browser | text | request metadata (fill from headers if you want breakdowns) |\n\nIndexes: \\`(type, experiment, visitor_id, ts)\\` and \\`(type, goal, visitor_id, ts)\\`.\n\n## The Store interface (\\`@splithub/node\\`)\n\n\\`\\`\\`ts\ninterface Store {\n insertEvents(events: StoredEvent[]): Promise<number>; // skip existing ids, return inserted count\n variantCounts(experiment: string, goal: string): Promise<VariantCounts[]>; // per variant: exposures, conversions, revenue\n summaries(): Promise<ExperimentSummary[]>; // per experiment: exposures, visitors, first/last ts\n close?(): Promise<void> | void;\n}\n\\`\\`\\`\n\nAttribution rule — keep it exactly, so self-hosted results equal the cloud's:\n**a visitor converts for a variant when they sent the goal at or after their first exposure to\nthat variant; exposures and conversions count unique visitors.** The SQL in the generated\n\\`splithub/store.ts\\` implements it (CTE \\`first_exposure\\`, then goals joined with \\`ts >= first_ts\\`).\n\nPrisma / Drizzle: map the table in your schema and write the three methods with the ORM, or run the\none raw query for \\`variantCounts\\`. Supabase: the same SQL as a Postgres function called through\n\\`rpc\\`. Mongo: \\`$group\\` by variant and visitor with \\`$min ts\\`, then \\`$lookup\\` goals.\n\n## Reports from the cloud into your database\n\n- CSV: dashboard → experiment → Export (summary, daily timeline, raw events up to 50k rows).\n- Webhook channel for alerts and the digest: POST JSON to your endpoint when something happens.\n- Scheduled pull: a cron in your app calls \\`GET /v1/status\\` and \\`GET /v1/results/<id>\\` with the\n API key (\\`sk_…\\`) and stores the verdicts. Raw events live 30–90 days in the cloud (plan dependent),\n aggregates a year: pull summaries, not raw rows, for long-term reporting.\n- Need every raw event forever in your infra? Use self mode; one store per project.\n\n## Do not\n\n- Put database credentials in \\`splithub.config.ts\\` (it ships to the browser). They belong in the route's env.\n- Call a winner from raw rates: a higher rate is often noise. Say the numbers as they are; verdicts come with SplitHub Cloud.\n`;\n","// Skills: ship the winner (`splithub ship`) and the full agent loop. Installed next\n// to the other skills by `splithub init` / `splithub skills`.\n\nexport const SKILL_SHIP = `---\nname: splithub-ship\ndescription: Ship the winner of an experiment and remove the experiment from the code: keep only the winning value, component or page, delete the losing variants, finish the experiment and clean splithub.config.ts. Use when an experiment has a verdict and the user says ship it, roll out the winner, remove the experiment, or clean up; and whenever an experiment shows status finished and the user agreed on which variant to keep.\n---\n\n# Shipping the winner\n\nGoal: the app behaves exactly as the kept variant did, with no experiment left in the code or in the config.\n\n## 1. Decide\n\n\\`npx splithub results <id> --json\\` (MCP: \\`splithub_results\\`). Act on \\`verdict.status\\`:\n- \\`winner_found\\`: keep \\`verdict.winner\\`.\n- \\`no_significant_difference\\`: keep the control, or the simpler variant if the user agrees.\n- \\`insufficient_sample\\`: do not ship. Say when to look again: \\`daysToVerdict\\` days at the current traffic.\n- \\`srm_detected\\`: do not ship. The split is broken; fix the setup first.\n- \\`guardrail_breached\\`: do not ship the variant in \\`verdict.guardrailBreached\\`; it made a guardrail worse. Say what broke.\nAsk the user which variant to keep before going on. Never pick from raw rates.\n\n## 2. Preview, then ship\n\n\\`\\`\\`bash\nnpx splithub ship <id> --keep <variant> --dry-run --json # diff + leftovers, nothing written\nnpx splithub ship <id> --keep <variant> --json # apply\n\\`\\`\\`\nMCP: \\`splithub_ship\\` with \\`dryRun: true\\`, then without. It archives the experiment in the cloud (numbers stay readable), removes it from\n\\`splithub.config.ts\\` (checked by reloading the file) and rewrites the code:\n- \\`<Experiment id>\\` → the kept \\`<Variant>\\`'s children; the other variants are dropped.\n- \\`useValue('<id>')\\` / \\`sh.value('<id>')\\` → the kept value as a literal.\n- \\`useVariant('<id>')\\` comparisons, ternaries, \\`&&\\`, \\`if\\` and \\`switch\\` → the kept branch.\n- Unused \\`Experiment\\`, \\`Variant\\`, \\`useVariant\\`, \\`useValue\\` imports go.\n\n## 3. Finish by hand\n\n- \\`leftovers[]\\`: each \\`{ file, line, text, reason }\\` still mentions the experiment; rewrite those yourself.\n- component kind: delete components and files only the losing variants used (e.g. \\`splithub/<id>/\\`).\n- redirect kind: make the kept URL the real page (move the route or add a permanent redirect), delete the other page.\n- Goal: keep \\`track('<goal>')\\` when another experiment measures it (\\`next\\` says so); otherwise ask before removing it.\n- Cloud mode: \\`npx splithub push\\`. Then \\`npx splithub doctor\\` and the project's typecheck and tests.\n- \\`npx splithub refs <id> --json\\` must return \\`count: 0\\` for the experiment.\n\nReport what changed (files, the kept content) and the verdict in one line with its numbers. Never reuse the id.\n`;\n\nexport const SKILL_LOOP = `---\nname: splithub-loop\ndescription: The whole experiment loop for an agent with SplitHub, step by step with the MCP tools and CLI --json fields: plan, create, implement, check, push, read results, finish, ship. Use when the user asks to run an experiment end to end, or to pick up an experiment where it stands.\n---\n\n# The full loop\n\nEach step: MCP tool, or the CLI with \\`--json\\` (one line of JSON; errors are \\`{ error, code, hint }\\`, exit 1).\n\n| step | MCP tool | CLI | read |\n|---|---|---|---|\n| 0. size it | \\`splithub_plan\\` | \\`plan --baseline 0.05 --mde 0.1 [<id>]\\` | \\`perVariant\\`, \\`total\\`, \\`traffic.daysLeft\\` |\n| 1. create | \\`splithub_experiment_create\\` | \\`create --kind … --id … --goal … --yes\\` | \\`snippet\\`, \\`files\\`, \\`nextStep\\`, \\`handoff\\` |\n| 2. implement | (edit code) | | wire \\`snippet\\`; \\`track('<goal>')\\` where it converts |\n| 3. check | \\`splithub_doctor\\`, \\`splithub_refs\\` | \\`doctor\\`, \\`refs <id>\\` | \\`ok\\`, \\`checks[]\\`; \\`refs[]\\` shows the wiring |\n| 4. push (cloud) | \\`splithub_push\\` | \\`push\\` (\\`--dry-run\\` to preview) | \\`adopted\\`, \\`diff\\` |\n| 5. results | \\`splithub_status\\`, \\`splithub_results\\` | \\`status\\`, \\`results <id>\\` | \\`verdict.status\\`, \\`verdict.message\\`, \\`verdict.notes[]\\`, \\`daysToVerdict\\` |\n| 6. finish | \\`splithub_experiment_status\\` | \\`finish <id>\\` | \\`live\\`, \\`next\\` |\n| 7. ship | \\`splithub_ship\\` | \\`ship <id> --keep <v> [--dry-run]\\` | \\`diff\\`, \\`leftovers[]\\`, \\`next\\` |\n\nRules that keep the answer honest:\n- Plan before creating: if \\`traffic.daysLeft\\` is months, try a bigger change or a busier page.\n- \\`create\\` writes a running experiment; it goes live when the code is deployed (and pushed in cloud mode). Tell the user.\n- Verdicts are sequential (always-valid): checking any day is safe. Quote \\`verdict.message\\` and the always-valid\n \\`comparisons[].sequential.pValue\\`, not the fixed-horizon \\`pValue\\` (p = 0.01 there can still be not significant).\n Relay \\`verdict.notes[]\\`. Verdicts depend on sample size, not days. Say \\`verdict.sample.quality\\` (small | ok | good;\n good = every variant has its share of \\`goodSample\\`, default 5000 visitors, \\`create --good-sample\\`) next to the verdict.\n- \\`daysToVerdict\\` is the re-check date: schedule (or tell the user) a look in that many days instead of polling.\n- \\`srm_detected\\`: the split is broken; fix the setup, do not read the numbers.\n- \\`guardrail_breached\\`: don't ship. A variant made a guardrail worse (\\`verdict.guardrailBreached[]\\`), e.g. \"bold wins on\n signups but raises refunds\". \\`verdict.metrics[]\\` has the secondary metrics and guardrails, read like the main table.\n- Guard what matters when creating: \\`--secondary pricing_view --guardrail refunds:higher\\` (MCP: \\`secondary\\`, \\`guardrails\\`).\n Experiments that could clash on one page go in one layer: \\`--layer checkout:0-50\\` and \\`checkout:50-100\\` never share a visitor.\n- \\`splithub holdout set 5\\` keeps 5% of visitors out of every experiment; the \\`__holdout\\` row (\"Holdout: long-term impact\")\n compares them with everyone else.\n- Ask the user which variant to keep before \\`ship\\`; preview with \\`dryRun\\` and show them the diff.\n- Error \\`code\\` → action: \\`NOT_LOGGED_IN\\` → \\`splithub_login\\`, show the link, wait, retry · \\`INSUFFICIENT_SCOPE\\` → the key\n can only read; ask for a key with write scope · \\`NO_CONFIG\\` → \\`splithub_init\\` ·\n \\`EXPERIMENT_NOT_FOUND\\` → \\`splithub_status\\` for ids · \\`CONFIG_UNSAFE\\` → edit the config by hand where the experiment is\n defined · \\`CONFIG_WRITE\\` → the file was restored; edit by hand, then \\`doctor\\`.\n`;\n","// Skill: analytics properties (pageviews and custom events, read as reports).\n\nexport const SKILL_ANALYTICS = `---\nname: splithub-analytics\ndescription: Collect and read web analytics with SplitHub: analytics properties (pageviews, events with track(), identified users, sources, channels, pages, goals and conversions), setting one up in the app (analytics connect), funnels, paths, retention, realtime, event props, CSV export, segments, notes and alerts on traffic, sh.js or the SDK, allowed domains. Use when the user wants traffic numbers, page or source reports, event tracking, funnels, or asks to \"add analytics\" to an app that uses SplitHub or could.\n---\n\n# SplitHub analytics\n\nAn analytics property is a stream of pageviews and custom events, like a site in Google Analytics. It sits next to the\nexperiments: same config file, same CLI, same key, same storage choice (SplitHub Cloud or the app's own database).\nThere are no variants and no verdicts: reports are counts.\n\n## Set it up\n\n1. One step: \\`npx splithub analytics connect --json\\` (or Analytics → Set up in the \\`npx splithub\\` menu) picks the project's\n property (or creates one: \\`--name \"Marketing site\"\\`; a given id is used, \\`connect sh-x1h78w\\`) and adds\n \\`property=\"sh-…\"\\` to the one \\`<SplitHubProvider>\\` / \\`<SplitHubNextProvider>\\` in the code. It answers \\`wired.status\\`:\n added | already | other (another property is named there: ask, then \\`--force\\`) | none | many (add \\`snippets.provider\\`\n or \\`snippets.script\\` yourself), plus \\`snippets.track\\` and \\`next\\`.\n By hand: \\`npx splithub analytics create --name \"Marketing site\" --json\\` writes \\`properties: { 'sh-x1h78w': { name: … } }\\`\n into \\`splithub.config.ts\\` (self-hosted projects keep their properties there). Cloud mode: both also create it in the\n cloud at once (\\`live: applied\\`), so no push is needed; when \\`live\\` names a missing API key, \\`npx splithub login\\` and run it\n again, or \\`npx splithub push\\`. A property made in the dashboard needs no push either; its id is on its page.\n2. Send events. Events go only to a property named by its id, never to a guess:\n - SDK: \\`<SplitHubProvider config={config} property=\"sh-x1h78w\">\\`: a pageview on load and on every client-side route change.\n - Events: one call, \\`const track = useTrack(); track('Video Played', { id: 3 })\\` (or \\`client.track(...)\\`). Names: letters,\n digits, spaces and \\`_ . : / -\\`, up to 64 characters; props: a flat object up to 4 KB. The same call counts for\n experiments whose goal is that event. Only what the app passes to \\`track()\\` is sent.\n - Users: \\`const identify = useIdentify(); identify(user.id, { plan: 'pro' })\\` after sign-in (\\`identify(null)\\` on sign-out;\n sh.js: \\`splithub.identify(id, traits)\\`) ties visits to the app's user; reports then count \\`users\\`. No emails or names in traits.\n - No SDK: \\`<script src=\"https://go.sh2.uk/sh.js\" data-key=\"pk_…\" async></script>\\` sends pageviews (SPA navigations\n included) and \\`window.splithub.track(name, props)\\` once the tag has \\`data-property=\"sh-x1h78w\"\\`.\n - One install covers analytics and experiments: the provider (or sh.js) with \\`property\\` collects pageviews and runs\n experiments. Each \\`track()\\` sends one event row and each page one page row; experiments whose goal is that event or\n page count them from those rows, so nothing extra is sent or billed. Never add sh.js and the SDK for the same\n property: when both run on a page, only the first collects pageviews.\n - Servers and other languages: \\`POST /v1/events\\` with \\`{ type: 'page', prop, url, vid, sid, ts, id, title?, ref? }\\` or\n \\`{ type: 'event', prop, name, props?, … }\\` (splithub-api skill).\n3. Development never sends to the cloud (same rule as experiments): check a deploy or \\`vite preview\\`.\n4. Events: any name is recorded, nothing to declare first. A goal is an event marked as one (\\`goals\\` in the config, the\n goal switch on an event in the dashboard, or simply naming the event as an experiment's goal); goals count as\n conversions in every property (a property's \\`goals\\` list narrows that). \\`value\\` is what one conversion is worth\n when the event carries no \\`revenue\\` prop; \\`event: 'Video Played'\\` matches an event name that is not a valid key.\n\n## Read it\n\n- \\`npx splithub analytics --json\\`: every property with visitors, visits, pageviews and bounce for the last 30 days.\n- \\`npx splithub status --json\\` (SplitHub Cloud) also lists every property under \\`properties\\`: the last 7 days against the 7 before\n (visitors, \\`change\\`, goal conversions); \\`npx splithub report\\` adds them as an Analytics table. The digest (Pro, set in the\n dashboard under Alerts) covers properties too: visitors, top sources and pages, goals and events against the period before.\n- \\`npx splithub analytics site --json\\` (\\`--days 7\\`, or \\`--from 2026-10-01 --to 2026-10-31\\`): totals, \\`users\\` (identified),\n goals (conversions = unique visitors who reached the goal in the range, completions, revenue), top pages, top sources, notes.\n- \\`--by page|source|channel|referrer|utm_source|utm_medium|utm_campaign|country|device|browser|os|platform|app_version|entry|exit|event|goal\\`; with a\n visit dimension, \\`--goal signup\\` adds conversions per row; \\`--by variant --experiment hero\\` splits visits by the\n variant each visitor saw, \\`--by trait --key plan\\` by an identify() trait. \\`--filter country=DE,FR --filter source=\"(none)\"\\` narrows any report.\n- \\`npx splithub analytics events site --json\\`: the latest raw pageviews and events, to check tracking right after wiring it.\n- More reports (SplitHub Cloud), each with the same \\`--days\\` / \\`--from --to\\` / \\`--filter\\` flags:\n - \\`analytics funnel site --steps \"page:/,event:Signup,goal:paid\" [--within visit|7d|30d] [--by country]\\`: visitors per step\n in order, \\`conversion\\` (share of step 1) and \\`dropoff\\` (share lost since the step before).\n - \\`analytics funnels site\\`: the funnels saved on the property (its Funnels tab, shared with the team).\n \\`--save Signup --steps \"page:/,goal:signup\" [--within 7d]\\` saves one (a saved name updates it), \\`--delete <id|name>\\`\n removes one, and \\`analytics funnel site --funnel Signup\\` runs it. Save a funnel the user will want to read again.\n - \\`analytics paths site --page /pricing [--prev]\\`: where visits went next (or came from).\n - \\`analytics retention site [--start visit|event:<name>|goal:<key>] [--return visit|event:<name>] [--period day|week]\\`: cohorts\n \\`{ start, users, retained[] }\\`, \\`retained[0]\\` = the cohort period itself; up to 90 days or 26 weeks (\\`clamped\\`).\n - \\`analytics realtime site\\`: visitors in the last 5 minutes, top pages and sources.\n - \\`analytics props site --event Signup [--key plan]\\`: an event's prop names, or one prop's values.\n - \\`analytics export site --by page|day [--raw] > report.csv\\`: CSV to stdout.\n - \\`--compare\\` on a report adds the period right before (\\`previous\\`), \\`--compare year\\` the same days a year earlier, \\`--compare 2026-08-01..2026-08-31\\` chosen days; \\`--segment \"Paid traffic\"\\` applies a saved segment\n (\\`analytics segments\\`, \\`--save <name> country=DE\\`, \\`--delete <id|name>\\`).\n - Notes mark a day on the charts: \\`npx splithub notes add \"Launched new pricing\" [--kind win] [--property site] [--day 2026-10-05]\\`,\n \\`notes --property site\\` lists them; add one when you ship something that may move traffic.\n - Alerts on a property (SplitHub Cloud, Pro): \\`npx splithub alerts add traffic_drop --property site --percent 50\\`, \\`traffic_spike\\`,\n \\`goal_silent --property site --goal signup --hours 24\\`, \\`event_count --property site --event Signup --count 1000 [--repeat]\\`.\n- Words: a visit (\\`sessions\\`) ends after 30 minutes without events; a bounce is a visit with one page and no event;\n \\`source\\` is the UTM source or the referrer's site (Google, Facebook, …), \\`(none)\\` = direct; \\`channel\\` groups them (Direct,\n Organic Search, Paid Social, Email, Referral, …); a conversion is a visitor reaching a goal (once per visitor in the range);\n \\`duration\\` is in milliseconds. Bots are never counted.\n- Self-hosted (\\`mode: 'self'\\`): the same commands give raw counts from the app's database (pageviews, visitors,\n sessions, events by name) for \\`--days\\` or \\`--from --to\\` (UTC days). Filters, \\`--by\\`, \\`--compare\\` and reports with sources,\n pages, visits and conversions come with SplitHub Cloud: say so.\n\n## Manage it\n\n- \\`npx splithub analytics pause site\\` / \\`resume site\\`: live in the cloud within a minute; paused events are dropped and not billed.\n- \\`npx splithub analytics archive site\\` / \\`restore site\\` (SplitHub Cloud): like Archive in the dashboard, it stops collecting and leaves\n the list (\\`archived\\` in it), numbers kept; restored comes back paused.\n- \\`npx splithub analytics remove site\\`: out of the config (push next); a dashboard-made property is deleted with its numbers.\n- Allowed domains are per experiment and per property: \\`npx splithub domains set property site example.com\\` (subdomains included),\n \\`npx splithub domains clear property site\\` (any domain again), \\`npx splithub domains\\` lists them all. An empty list\n accepts every origin. Add localhost too when testing from it.\n- Apps: \\`kind: 'app'\\` on a property (\\`analytics create --kind app\\`, the default in an app project) shows screens, versions and\n retention in the dashboard; screens are page events (the \\`splithub-apps\\` skill).\n- Billing: every pageview and custom event counts like one exposure against the project's allowance.\n\n## Do not\n\n- Put personal data in event props (emails, names, ids from other systems).\n- Fire an event in a render loop or on every scroll: each one is stored and billed.\n- Read analytics counts as an experiment result: use \\`splithub results\\` for experiments.\n`;\n","// Skill: experiments and analytics in mobile and desktop apps (React Native / Expo, iOS, Android).\n\nexport const SKILL_APPS = `---\nname: splithub-apps\ndescription: Run SplitHub experiments and analytics in a mobile or desktop app: React Native and Expo (@splithub/react-native), native iOS (Swift package SplitHub) and Android (io.splithub:splithub). Screens, app_version targeting, retention, and why app experiments are created in the cloud. Use when the project has react-native, expo, an Xcode project or an Android Gradle build, or the user asks to A/B test or measure an app.\n---\n\n# SplitHub in apps\n\nSame experiments, goals and analytics as on the web. Two things differ: an app's config is built into the binary,\nand screens take the place of pages.\n\n## Install\n\n- React Native / Expo: \\`npx splithub init --mode cloud --yes --json\\`. It installs \\`@splithub/react-native\\` (plus\n \\`@react-native-async-storage/async-storage\\`, through \\`npx expo install\\` on Expo) and wraps the entry in\n \\`<SplitHubProvider config={config}>\\`: \\`app/_layout.tsx\\` with Expo Router (adds \\`<ExpoRouterScreens />\\`),\n else \\`App.tsx\\` (adds \\`<NavigationScreens />\\` inside \\`<NavigationContainer>\\` with React Navigation). Both come from\n \\`@splithub/react-native\\`; the hooks \\`useExpoRouterTracking()\\` / \\`useNavigationTracking(ref)\\` do the same by hand.\n Without a config file: \\`<SplitHubProvider publicKey=\"pk_…\" property=\"sh-…\">\\`.\n \\`app.entry.status\\`: added | already | manual (wire \\`nextStep\\` by hand). Hooks are the web ones, imported from\n \\`@splithub/react-native\\`: \\`useValue\\`, \\`useVariant\\`, \\`<Experiment>\\`, \\`useTrack\\`, \\`useIdentify\\`.\n- iOS: Swift package \\`SplitHub\\` (Xcode: File → Add Package Dependencies → \\`https://github.com/splithub-io/splithub-sdk\\`).\n \\`SplitHub.start(publicKey: \"pk_…\", property: \"sh-…\")\\` once at launch; \\`SplitHub.variant(\"id\")\\`, SwiftUI \\`SplitHubExperiment(\"id\") { variant in }\\`.\n- Android: \\`implementation(\"io.splithub:splithub:<version>\")\\` (+ \\`io.splithub:splithub-compose\\` for Compose).\n \\`SplitHub.start(this, \"pk_…\", property = \"sh-…\")\\` in \\`Application.onCreate\\`; \\`SplitHub.variant(\"id\")\\`, Compose \\`Experiment(\"id\") { variant -> }\\`, \\`TrackScreen(\"Home\")\\`.\n- Native apps have no \\`splithub.config.ts\\`: \\`init\\` prints the install lines and a quick start, and experiments come from the cloud.\n- Analytics: \\`npx splithub analytics connect --json\\` names a property on the provider; in an app project it is created with \\`kind: 'app'\\`.\n- \\`npx splithub doctor\\` checks the package, the storage module and the provider.\n\n## Experiments reach apps through the cloud\n\n- The config file ships inside the binary: an experiment added there reaches users only with the next store release,\n and only users who update. Old versions stay on what they were built with.\n- Start new experiments in the dashboard (no release; installed apps get them on the next launch with network). Pause,\n finish, weights and values set in the dashboard or with \\`npx splithub pause|start|finish <id>\\` also apply live.\n- Still \\`npx splithub push\\` after any config change, so the cloud and the file agree. Apps also receive the pushed\n experiments from the cloud (overrides JSON with \\`?all=1\\`), so a pushed experiment reaches an app whose build has its variants.\n- Redirect experiments do nothing in an app: use \\`value\\` (copy, prices, flags as JSON) or \\`component\\`.\n- Assignment is the same local hash on every platform: a visitor gets the same variant on web, iOS and Android.\n\n## Screens, versions, platforms\n\n- A screen is a \\`page\\` event: url \\`/<screen name>\\` (or the route path with Expo Router), title the screen name. Every\n page report, funnel (\\`page:/Checkout\\`) and pageview goal (\\`{ type: 'pageview', path: '/Checkout' }\\`) works on screens.\n- Without a navigation tracker: \\`useScreen('Settings')\\` (React Native), \\`SplitHub.screen(\"Settings\")\\` (iOS, Android).\n- Target app versions in the experiment's flow (dashboard targeting, or by hand):\n \\`{ type: 'condition', conditions: [{ field: 'app_version', op: 'gte', value: '2.4' }], then: 'split', else: 'skip' }\\`.\n \\`gte\\` / \\`lt\\` compare dotted versions part by part (\\`2.10.0\\` ≥ \\`2.9\\`). \\`platform\\` is \\`ios | android | macos | windows | linux | web\\`.\n Gate on the version that ships the variant code, so older builds skip the experiment.\n- Break down or filter by them: \\`results <id> --by platform\\`, \\`--by app_version\\`, \\`--filter platform=ios\\`;\n \\`analytics <property> --by app_version\\`, \\`--filter app_version=2.5.0\\`.\n- Events sent offline are kept on the device and arrive later with their own time: today's numbers can still grow.\n\n## Retention\n\n\\`npx splithub analytics retention <property> [--period day|week] [--from --to] --json\\`: \\`cohorts[] { start, users, retained[] }\\`,\n\\`retained[0]\\` is the cohort period itself, \\`retained[n] / users\\` the share back in period n. Up to 90 days or 26 weeks\n(\\`clamped: true\\` when cut). \\`--start event:Signup\\` and \\`--return event:<name>\\` change who counts. Counts, never a verdict.\n`;\n","// Agent skills installed by `splithub init` / `splithub skills`. One folder per\n// topic under .claude/skills/, so an agent loads only what the task needs:\n// splithub — the library, the config file, the CLI, where things live\n// ab-testing — what a good test is, metrics, sample size, when to stop\n// splithub-api — the HTTP API (keys, endpoints, payloads) for scripts and servers\n// splithub-mcp — the MCP server: tools, how to register it in Claude Code / Cursor\n// splithub-ship — keep a variant and take the test out (`splithub ship`)\n// splithub-loop — the whole loop for an agent, tool by tool\n// splithub-analytics — analytics properties: pageviews, events, reports, allowed domains\n// splithub-apps — React Native / Expo, iOS and Android: install, screens, versions, retention\n// Same text goes to .cursor/rules and the AGENTS.md section points here.\n\nexport interface Skill {\n dir: string;\n body: string;\n}\n\nexport const SKILL_SPLITHUB = `---\nname: splithub\ndescription: Add, change, run or read experiments in an app that uses SplitHub (@splithub/react, splithub.config.ts, the splithub CLI, SplitHub Cloud). Use when the user asks to A/B test a component, headline, image, price, CTA or page, asks which variant is winning, or wants to start, pause or finish an experiment; also for notes on the charts, alert rules (events used, traffic, goals, winners), short links and allowed domains.\n---\n\n# SplitHub for coding agents\n\nThree pieces: \\`splithub.config.ts\\` (the experiments; source of truth when it exists),\n\\`@splithub/react\\` (renders variants), the \\`splithub\\` CLI (creates, pushes, reads results).\nEvents go to the app's own database (self mode) or to SplitHub Cloud (cloud mode).\n\n## Where things live\n\n- Config: \\`splithub.config.ts\\` in the project root. Experiments and goals. Ships to the browser: never put secrets in it.\n- Credentials: \\`npx splithub login\\` (or \\`init --mode cloud\\`) prints a link; the human approves it in the browser; the CLI\n stores a project API key for this folder. Never ask the user to paste keys. CI uses \\`SPLITHUB_API_KEY\\`.\n- The public key (\\`pk_\\`) ends up in \\`storage.key\\` of the config from any of: \\`login\\` (saved credentials), the first\n \\`push\\`, \\`init --key\\`, or \\`SPLITHUB_API_KEY\\` in the environment (init asks the cloud). Missing key = events go nowhere.\n- Cloud: \\`npx splithub push\\` uploads the config. Experiments the cloud has from an earlier push that the file lacks are\n kept (\\`kept\\` in the answer); only \\`npx splithub push --prune\\` removes them, and only when the user asked for that.\n \\`npx splithub pull\\` writes dashboard-created experiments into the file.\n- Results: \\`npx splithub status --json\\` (in the cloud it also has \\`properties\\`: each analytics property's last 7 days), \\`npx splithub results <id> --json\\`. Sizing: \\`npx splithub plan --baseline 0.05 --mde 0.1\\`.\n- Closer reads (cloud): \\`results <id> --from --to --filter country=DE\\` (a slice), \\`--by <dimension>\\`, \\`--timeline\\`, \\`--engagement\\`,\n \\`--events\\`, \\`--export --by <dimension>\\` or \\`--export --events\\` (CSV); \\`npx splithub events --experiment <id>\\` for the raw tail. See \"Read results\".\n- Code that uses an experiment: \\`npx splithub refs <id> --json\\`. Keep a variant and remove the experiment: \\`npx splithub ship <id> --keep <v>\\`.\n- \\`--json\\` prints one line; errors are \\`{ error, code, hint }\\` with exit code 1. \\`INSUFFICIENT_SCOPE\\` adds \\`scope\\`\n (e.g. \\`notes:write\\`): the API key is limited to some areas; ask the user for a key with that scope. The \\`splithub-loop\\` skill has the whole flow.\n- Everything interactive: \\`npx splithub\\`, one menu: Experiments, Analytics, Short links, Alerts, Notes, Allowed domains,\n push / pull, local testing, doctor, agent skills. Everything scriptable: subcommands + \\`--json\\` (\\`npx splithub --help\\`).\n- Web analytics (pageviews, events, sources, pages, funnels) live in analytics properties: \\`npx splithub analytics connect\\`\n sets one up in the app; the \\`splithub-analytics\\` skill has the rest.\n- Apps (React Native, Expo, iOS, Android): the \\`splithub-apps\\` skill. The config is built into the binary, so new\n experiments for an app start in the dashboard; screens are page events; target versions with \\`app_version\\` \\`gte\\`.\n\n## Pick the kind\n\n| kind | use it when | create | read in code |\n|---|---|---|---|\n| \\`value\\` | only data changes: text, number, image URL, price, JSON. The default choice: no new components. | \\`--variants control,bold --value control=\"Old text\" --value bold=\"New text\"\\` | \\`const text = useValue<string>('<id>')\\`; server components: \\`getValue\\` from \\`@splithub/next\\`; no SDK: \\`sh.value('<id>')\\` |\n| \\`component\\` | structure changes: a layout, a section, a flow, a different component per variant | \\`--variants control,bold\\` (the CLI scaffolds \\`splithub/<id>/<Variant>.tsx\\` stubs) | \\`<Experiment id=\"<id>\"><Variant name=\"control\">…</Variant><Variant name=\"bold\">…</Variant></Experiment>\\`, or \\`useVariant('<id>')\\` in a switch |\n| \\`redirect\\` | a whole page changes: another URL per variant | \\`--match / --to control=/ --to v2=/home-v2\\` | nothing: \\`@splithub/next\\` middleware or the drop-in script \\`<script src=\"https://go.sh2.uk/sh.js\" data-key=\"pk_…\">\\` sends visitors there |\n| \\`mvt\\` | several things change at once (headline × button × image) and the user wants to know which of them matters; every combination is tested and each factor is read on its own | \\`--factor headline=old:\"Old text\",new:\"New text\" --factor button=blue:#2563eb,green:#16a34a\\` (no \\`--variants\\`; first level = control; at most 4 factors × 4 levels, 16 combinations) | \\`const { headline, button } = useValue<{ headline: string; button: string }>('<id>')\\` |\n\nmvt needs more visitors than a two-variant experiment: every combination must reach the minimum on its own (the results show the\ncombinations and, below them, each factor summed over its combinations). With little traffic, change one thing with \\`value\\`.\n\n## Create an experiment\n\n1. \\`npx splithub create --kind <value|component|redirect|mvt> --id <key> … --goal <event name> --yes --json\\` (see the table).\n The key is the experiment's id for good: never reuse one from an earlier experiment. \\`--name \"Signup button\"\\` adds a human\n name (dashboard, CLI) that can change any time. \\`push\\` fails with \\`KEY_CONFLICT\\` when a key already belongs to\n another experiment: ask the user, then rename the key, or push with \\`--replace <key>\\` (new experiment, old numbers cleared)\n or \\`--same <key>\\` (same experiment). \\`KEY_DELETED\\`: a deleted experiment used the key; pick a new one.\n2. Goal: any event the app sends with \\`track('<name>', props?)\\`, the one call for every event. Nothing to declare\n first: a name not in \\`goals\\` becomes an event goal keyed by its slug (\\`Video Played\\` → \\`video-played\\`) and \\`create\\`\n says so. A goal is just an event marked as one; page visits and clicks are goals declared in \\`goals\\`:\n \\`{ type: 'pageview', path: '/thanks' }\\`, \\`{ type: 'click', selector: '#buy' }\\` (tracked automatically by the SDK and the script).\n With an analytics property on the provider, the same \\`track()\\` and pageviews feed both: one install, one row per action.\n3. Wire it in code. \\`create\\` writes \\`status: 'running'\\`: the experiment goes live for every visitor, first page view\n included, as soon as this code is deployed. Use \\`--status draft\\` only when the user asks to hold it.\n4. Cloud mode: \\`npx splithub push\\` after any config change.\n5. Hand-off, always: end your reply by saying the experiment is **running in the config** and goes live when the user deploys\n this code; nothing is recorded before that, and local development never sends events to the cloud. Tell them how to\n check it locally (\\`?sh_force=<id>:<variant>\\`) and that Pause in the dashboard or \\`npx splithub pause <id>\\` holds it.\n In cloud mode a status set in the dashboard wins over the file for every visitor, first page included.\n For a draft (only if asked): say visitors do not see it and nothing is recorded until \\`npx splithub start <id>\\`.\n\nA draft is invisible to visitors. To check one before starting: \\`runDraftsInDev: true\\` at the top level of the config\nserves drafts like running experiments in development only (\\`NODE_ENV=development\\`: \\`next dev\\`, \\`vite\\`);\n\\`?sh_force=<id>:<variant>\\` shows one variant on any page, draft or not, without recording an exposure;\n\\`?sh_debug=1\\` (or \\`npx splithub dev\\`) logs every decision and opens a panel to switch variants.\nIn development the SDK explains drafts, paused experiments and held-back events in one line each. Vite apps: add \\`splithub()\\`\nfrom \\`@splithub/core/vite\\` to the plugins in vite.config so these lines and a summary of every experiment appear in the\nterminal that runs \\`vite\\`; Next.js server code prints them in its terminal anyway.\n\nKeys: lowercase a-z 0-9 - _, max 64 chars. First variant = control. Weights are relative (50/50, 1/1, 90/10).\nTargeting (country, device, UTM, cookie, time) is a \\`flow\\` graph on the experiment, edited in the dashboard; \\`pull\\` brings it into the file.\n\n## Read results\n\n\\`verdict.status\\` ∈ no_data | insufficient_sample | srm_detected | winner_found | no_significant_difference.\nReport \\`verdict.message\\` verbatim and the numbers behind it (visitors per variant, lift, the always-valid\n\\`comparisons[].sequential.pValue\\` and \\`sequential.ci\\`; the plain \\`pValue\\` is fixed-horizon, for display only) and relay\n\\`verdict.notes[]\\`. Verdicts are sequential and depend on sample size, not days: safe to check any time. \\`verdict.sample.quality\\` is\nsmall (below 100 visitors per variant or 50 conversions), ok, or good (every variant has its share of \\`goodSample\\`, default 5000\nvisitors; \\`create --good-sample\\`); say it next to the verdict. \\`verdict.sample.stars\\` (0..5) scores data quality from\n\\`verdict.sample.checks[]\\`: report the stars and the unmet labels; they never override the verdict. \\`daysToVerdict\\` says when to look again.\nNever declare a winner from raw rates. \\`srm_detected\\` means the split is broken: fix the setup before anything else.\n\n### Slices, breakdowns, timelines (SplitHub Cloud)\n\n- A slice: \\`npx splithub results <id> --from 2026-10-01 --to 2026-10-15 --filter country=DE --filter channel=\"Paid Search\" --json\\`.\n \\`from\\` / \\`to\\` are first-exposure days (project time zone): the visitors who entered the experiment then, with all their\n later conversions. Filters: country, region, city, device, os, browser, language, host, source, channel, utm_source,\n utm_medium, utm_campaign, utm_term, utm_content, landing or page (the page of the first exposure); comma-separated values,\n \\`(none)\\` matches empty. The answer carries \\`scope\\` and its verdict is computed on the slice only: say so and quote\n \\`scope.note\\`. The decision stays with the unfiltered verdict; a slice carries no \\`voice\\` (no advice).\n- One view at a time, same range and filters (\\`--json\\` adds \\`view\\`): \\`--by country|device|source|channel|page|landing|utm_campaign|…\\`\n gives \\`segments[]\\` with each variant's cells and its lift against the control inside the segment (\\`significant\\`, \\`better\\`,\n \\`small\\` = too few visitors); \\`--timeline\\` gives visitors and conversions per day and variant (a day = visitors first seen\n that day); \\`--engagement\\` gives bounce rate, pages per visit and visit length per variant from the analytics property on\n the same visitors (\\`property: null\\` = none); \\`--events\\` gives \\`rows[]\\` for every goal (the experiment's goal, metrics and\n guardrails first, \\`measured\\`) and event of these visitors, each with \\`perVariant\\` visitors and rate and \\`comparisons[]\\` against\n the control (\\`property: null\\` = goals only: other events need analytics on the same site). \\`--export --by <dimension>\\` prints\n the breakdown as CSV, \\`--export --events\\` the events table.\n- \\`npx splithub events --experiment <id> [--type exposure|goal] [--limit 50] [--before <nextBefore>]\\` lists the raw exposures\n and goals (same filters; 7 days, 30 on Pro). Use it to check the wiring.\n- Segments and events are for hypotheses: never call a winner from one segment or one event. With several segments, one will look great by chance.\n A self-hosted endpoint answers none of these (\\`NOT_CLOUD\\`); its results stay raw counts.\n\n## Finish, and what to do when an experiment is finished\n\n\\`npx splithub finish <id>\\` stops the experiment (live within a minute in cloud mode). A finished experiment keeps its numbers for as long\nas it stays in the config; the code still contains every variant until someone removes it.\n\nWhenever you see an experiment with \\`status: finished\\` (in \\`status\\`, \\`results\\`, the MCP tools, or right after you finished it):\n1. Read \\`npx splithub results <id> --json\\` and tell the user the verdict in one line with its numbers.\n2. Ask two questions, do not assume: **which variant to keep** (recommend \\`verdict.winner\\`; with no significant\n difference, the control or the simpler one) and **whether to remove the experiment from the code now**.\n3. On yes, follow the \\`splithub-ship\\` skill: \\`npx splithub ship <id> --keep <variant> --dry-run\\`, show the diff, then run it\n without \\`--dry-run\\`; fix the \\`leftovers\\`, \\`push\\` in cloud mode, run \\`doctor\\` and the project's checks.\n4. On no, leave everything: a finished experiment costs nothing and the user may come back to it.\n\nA \\`paused\\` experiment is not over: say so and ask whether to resume (\\`start\\`) or finish it.\n\n## Around experiments (SplitHub Cloud)\n\n- **Notes**: what happened on a day, marked on experiment timelines and analytics charts. \\`npx splithub notes add \"Launched the\n new pricing page\" [--kind note|issue|win] [--experiment <key> | --property <id>] [--day 2026-10-05]\\` (none = the whole\n project); \\`notes\\` lists them (\\`--experiment\\`, \\`--property\\`, \\`--kind\\`, \\`--days\\`), \\`notes edit <id> \"<text>\"\\`, \\`notes delete <id>\\`.\n Add one when you ship something that may move the numbers.\n- **Alerts** (they fire on Pro; added on another plan they are saved switched off): \\`npx splithub alerts\\` lists rules, progress\n and recent alerts; \\`alerts add <condition>\\`: experiments \\`srm\\`, \\`winner\\`, \\`loser --lift 10\\`, \\`exposures --visitors N\\`,\n \\`conversions --conversions N\\`, \\`duration --days N\\`, \\`no_events --hours 24\\` (\\`--experiment <key>\\`, else every running one;\n \\`--pause\\`, \\`--finish\\`, \\`--drop-loser\\` act on it); account \\`quota --percent 80\\`, \\`usage --every 1000\\` (each time this month's\n events cross another 1,000); analytics \\`traffic_drop|traffic_spike --property <id> --percent 50\\`, \\`goal_silent --property <id>\n --goal <key> --hours 24\\`, \\`event_count --property <id> [--event <name>] --count 500 [--repeat]\\`. \\`alerts enable|disable|delete|test <id>\\`\n (\\`test\\` = what would fire now, nothing sent). Channels (email, Slack, Discord, webhook) are set in the dashboard.\n- **Short links**: \\`npx splithub links create https://example.com/spring [--slug spring] [--name \"Spring\"]\\`; several URLs with\n \\`--weights 70,30\\` split visitors between pages. \\`links\\` lists them with clicks, \\`links <slug>\\` shows one link's clicks,\n \\`links pause|resume|delete <slug>\\`.\n- **Allowed domains**: \\`npx splithub domains set experiment <key> example.com\\` (subdomains included), \\`domains clear experiment <key>\\`,\n \\`domains\\` lists them. No list = any origin.\n\n## Do not\n\n- Nest an \\`<Experiment>\\` inside a \\`<Variant>\\` of the same id; call hooks conditionally.\n- Change \\`seed\\`, weights or variants of a running experiment (reshuffles visitors). Create a new experiment instead.\n- Edit in the dashboard what the config file owns: file experiments are read-only there (pause/finish still work).\n- Run more than 2-3 experiments on one page of a low-traffic site.\n- Put secrets, API keys or database credentials in the config or in the browser. \\`pk_\\` is public, \\`sk_\\` is not.\n`;\n\nexport const SKILL_AB_TESTING = `---\nname: ab-testing\ndescription: How to design, run and read an experiment correctly: hypothesis, control, primary metric, sample size, significance, SRM, peeking, when to stop. Use before creating an experiment or when interpreting results, with any tool.\n---\n\n# A/B testing, the parts that matter\n\nAn experiment splits visitors at random into variants and compares one metric. It answers one question:\n\"does this change move this metric?\" Everything below exists to keep that answer honest.\n\n## Before creating an experiment\n\n1. **One hypothesis, one primary metric.** \"A shorter signup form raises signup completion.\" The metric is a goal\n (event, page visit or click) that happens after the exposure. Pick it before looking at data.\n2. **Control first.** The first variant is what exists today. Change one thing per variant; several unrelated changes\n in one variant cannot be attributed.\n3. **Traffic reality.** Rough rule: to detect a relative lift L on a baseline rate p you need about\n \\`16 · p(1-p) / (p·L)²\\` visitors per variant (95% confidence, 80% power).\n Examples: baseline 5%, lift 20% → ~7,600 per variant; baseline 2%, lift 10% → ~78,000 per variant.\n If the site cannot reach that in 2-4 weeks, try a bigger change or a higher-traffic page.\n4. **Few experiments per page.** Interactions between simultaneous experiments on the same page muddy both.\n\n## While it runs\n\n- **Do not peek and stop early.** Checking daily and stopping at the first \"significant\" moment inflates false\n positives several times. Decide the sample or the duration up front; run whole weeks (weekday/weekend cycles).\n- **SRM (sample ratio mismatch).** If the split is 50/50 and you see 60/40, the assignment or the tracking is broken\n (bots, caching, redirect loops, a variant that errors). Fix first; results from an SRM run are meaningless.\n- **Keep variants frozen.** Changing copy, weights or targeting mid-run reshuffles who saw what. Start a new experiment.\n- **Watch the guardrails.** A variant that wins the primary metric but breaks revenue, errors or latency is not a win.\n\n## Reading results\n\n- Significance (p < 0.05 after correction for several variants) says the difference is unlikely to be noise;\n the confidence interval says how big it plausibly is. A \"winner\" with a CI that touches 0 is a weak win.\n- \"No significant difference\" with a sample smaller than needed means **keep running**, not \"no effect\".\n With enough sample it means the change does not matter: ship whichever is cheaper or cleaner.\n- Relative lift is on the baseline rate: 5% → 6% is +20% relative, +1 point absolute. Report both.\n- Attribution: conversions count only after the visitor's first exposure, per unique visitor.\n- Segments (country, device) are for hypotheses, not verdicts: slicing after the fact finds noise.\n\n## When to stop\n\n- Winner found with the planned sample → ship it, finish the experiment, remove the losing code.\n- Planned sample reached, no difference → ship the simpler variant, finish.\n- SRM or broken tracking → stop, fix, restart as a new experiment.\n- The business moved on → finish; do not leave experiments running forever (they cost events and split traffic).\n\n## Vocabulary\n\nexposure = a visitor saw a variant · conversion = the goal happened after exposure · lift = relative change in rate ·\np-value = chance of seeing this difference by luck · CI = range the true difference likely lies in ·\nSRM = the split differs from the configured weights · guardrail = a metric that must not get worse.\n`;\n\nexport const SKILL_SPLITHUB_API = `---\nname: splithub-api\ndescription: Use the SplitHub Cloud HTTP API directly: public key event ingest, API-key endpoints for config, status, results, overrides, analytics reports, notes, short links and alert rules. Use when writing a server, a script, a non-JS client, or when the CLI is not available.\n---\n\n# SplitHub Cloud API\n\nBase URL: \\`https://go.sh2.uk\\`. JSON in, JSON out (no envelope under \\`/v1/*\\`). Two credentials:\n\n- **Public key \\`pk_…\\`**: identifies the project to browsers and SDKs. Safe to ship. Can only send events and read\n the public overrides JSON.\n- **API key \\`sk_…\\`**: project-scoped secret for servers, CI and the CLI (\\`npx splithub login\\` mints one through a\n browser approval; or Settings → API keys in the dashboard). Never in client code. It can be limited to some areas:\n see API keys and scopes below.\n\n## Send events (public key)\n\n\\`\\`\\`http\nPOST /v1/events\nAuthorization: Bearer pk_live_…\nContent-Type: application/json\n\n{ \"project\": \"my-app\", \"sdk\": \"custom/1.0\", \"events\": [\n { \"id\": \"e_01h…\", \"type\": \"exposure\", \"exp\": \"hero-cta\", \"var\": \"bold\", \"vid\": \"v_abc\", \"sid\": \"s_1\", \"ts\": 1760000000000, \"url\": \"/\" },\n { \"id\": \"g_01h…\", \"type\": \"goal\", \"goal\": \"signup\", \"vid\": \"v_abc\", \"sid\": \"s_1\", \"ts\": 1760000010000, \"props\": { \"revenue\": 49 } }\n] }\n\\`\\`\\`\n\n- Analytics properties take two more types: \\`{ \"type\": \"page\", \"prop\": \"site\", \"url\": \"/pricing\", \"title\"?, \"ref\"?, … }\\`\n (\\`ref\\` = document.referrer) and \\`{ \"type\": \"event\", \"prop\": \"site\", \"name\": \"Video Played\", \"props\"?: { … }, … }\\`.\n Both are billed like one exposure each; events of a property that is paused or unknown are dropped.\n An \\`event\\` row also converts the experiments whose goal is that event, and a \\`page\\` row the page-visit goals its path\n matches (not billed again): send one row per action, not a goal row next to it (one within 1 s is counted once).\n \\`{ \"type\": \"identify\", \"prop\": \"site\", \"uid\": \"user_42\", \"traits\"?: { \"plan\": \"pro\" }, … }\\` ties the visitor to your user\n (not billed). Requests from bots are dropped.\n- \\`id\\`: unique per event (8-64 chars, [a-z0-9_-]); duplicates are ignored. \\`vid\\`: stable visitor id (cookie \\`sh_vid\\`).\n- Reply \\`202 { ok, received, inserted, dropped }\\`. A project with nothing running or no config yet answers\n \\`202 { ok, inserted: 0, idle: 'no_running' | 'no_config' }\\`: nothing stored, not an error. \\`429\\` with \\`code\\` ∈\n quota_exceeded | deleted: back off for \\`Retry-After\\` seconds; nothing was stored. Allowed domains are set per experiment and per\n property: events from another origin are dropped, and \\`403 origin_not_allowed\\` comes back when nothing in the batch was allowed.\n- Exposures for experiments that are not running are dropped and not billed. Goals are never billed.\n\n## API keys and scopes\n\nA key can do everything (\\`*\\`, the default) or only some areas, each with read or write (write includes read).\nPick them in Settings → API keys when creating the key.\n\n| Area | Covers |\n|---|---|\n| \\`experiments\\` | status, results, report, config push, overrides, archive, reviews |\n| \\`analytics\\` | properties, their reports, segments, the event catalog |\n| \\`events\\` | read: raw events and \\`export.csv?raw=1\\`; write: send events from your server with this key |\n| \\`notes\\`, \\`links\\`, \\`alerts\\`, \\`domains\\` | those endpoints |\n\nScope strings: \\`<area>:read\\` / \\`<area>:write\\` (e.g. \\`notes:write\\`, \\`analytics:read\\`), \\`read\\` / \\`write\\` for every area,\n\\`*\\` for everything. Keys made before scopes existed have \\`*\\`.\n\nServer-side sending: a key with \\`events:write\\` can post to \\`POST /v1/events\\` instead of the public key. It is trusted,\nso there is no origin check; keep it on the server.\n\n\\`\\`\\`bash\ncurl -X POST https://go.sh2.uk/v1/events \\\\\n -H \"Authorization: Bearer $SPLITHUB_API_KEY\" -H \"Content-Type: application/json\" \\\\\n -d '{ \"sdk\": \"server/1.0\", \"events\": [\n { \"id\": \"g_order_1042\", \"type\": \"goal\", \"goal\": \"purchase\", \"vid\": \"v_abc\", \"ts\": 1760000010000, \"props\": { \"revenue\": 49 } },\n { \"id\": \"e_order_1042\", \"type\": \"event\", \"prop\": \"site\", \"name\": \"Order Paid\", \"vid\": \"v_abc\", \"ts\": 1760000010000 }\n ] }'\n\\`\\`\\`\n\n\\`vid\\` is the visitor's \\`sh_vid\\` cookie, so the goal lands on the variant they saw. A request the key may not make\nanswers \\`403 { code: 'insufficient_scope', scope: 'notes:write', error, hint }\\`: \\`scope\\` names the missing one, and the CLI\nshows it (\\`--json\\` adds \\`scope\\`). Ask the user for a key with that scope; don't retry with another key.\n\n## Live config for clients (public key)\n\n\\`GET /v1/overrides/<pk>.json\\` (apps add \\`?all=1\\`: \\`added\\` then also carries the pushed experiments) → \\`{ version, experiments: { <id>: { status?, traffic?, weights?, values? } }, added: [ …hosted experiments… ], goals: [...], ctx: { country, region, city } }\\`.\nPoll it at most once a minute; the SDK caches it in localStorage. \\`ctx\\` is the visitor's geo for targeting.\n\n## Project endpoints (API key)\n\n\\`\\`\\`http\nGET /v1/status every experiment: status, visitors, days, verdict headline\nGET /v1/results/<experiment> full verdict: sample, comparisons (lift, p-value, CI, P(beat)), srm, winner\n ?from=&to= (first-exposure days) &country=DE&channel=…: the verdict on that slice, with scope { filtered, range, filters, note }\nGET /v1/experiments/<experiment>/timeline ?from=&to=&<filters>: exposures[] and conversions[] per day and variant, notes\nGET /v1/experiments/<experiment>/breakdown/<by> by country|region|city|device|os|platform|app_version|browser|language|host|page (= url)|referrer|source|channel|landing|utm_*:\n order[], segments[] { dim, cells, comparisons { lift, pValue, significant, better }, total, small }\nGET /v1/experiments/<experiment>/engagement { property, variants[] { visitors, sessions, pagesPerVisit, bounceRate, avgVisit } } (&property=)\nGET /v1/experiments/<experiment>/events-summary { property, variants[], visitors, rows[] { name, goalKey, isGoal, measured, perVariant, comparisons, small } } (&property=)\nGET /v1/experiments/<experiment>/export.breakdown.csv?by= the breakdown as CSV, lift per segment\nGET /v1/experiments/<experiment>/export.events-summary.csv the events table as CSV, lift per event\nGET /v1/experiments/<experiment>/events ?type=exposure|goal&before=&limit=&<filters>: raw events, nextBefore (needs events:read)\nGET /v1/config the config stored in the cloud (file + dashboard experiments)\nPUT /v1/config { config, prune? } push a normalized config (what defineConfig returns); answers cloudOnly experiments to adopt and kept ones (from an earlier push, missing from this one; prune: true removes them)\nGET /v1/overrides live overrides\nPUT /v1/overrides/<experiment> { status | traffic | weights | values } pause / resume / reweight without a deploy\nDELETE /v1/overrides/<experiment>\nGET /v1/properties analytics properties: live status, goals, domains, last 30 days\nPOST /v1/properties { key, name?, goals?, domains? } create one (dashboard-owned)\nPATCH /v1/properties/<key> { status: running | paused, name?, goals? }\nGET /v1/properties/<key>/summary ?from=&to= (YYYY-MM-DD) &<dimension>=a,b[&compare=previous|year|custom&cfrom=&cto=]: totals, days, goals, notes\nGET /v1/properties/<key>/breakdown ?by=source|channel|page|event|goal|country|…&goal=[&compare=…]: rows\nGET /v1/properties/<key>/funnel ?steps=page:/,event:Signup,goal:paid&within=visit|7d|30d[&by=]: steps with visitors, conversion, dropoff\n ?funnel=<id> runs a saved funnel (its steps and within)\nGET|POST /v1/properties/<key>/funnels { name, steps[], within? } PATCH|DELETE /v1/properties/<key>/funnels/<id>\nGET /v1/properties/<key>/paths ?page=/pricing&direction=next|prev: rows { value, visits }\nGET /v1/properties/<key>/retention ?start=visit|event:<n>|goal:<k>&return=visit|event:<n>&period=day|week&from=&to=: { period, cohorts[] { start, users, retained[] } }\nGET /v1/properties/<key>/realtime | /events?type=page|event | /props?name=&key= | /export.csv?by=|day (&raw=1)\nGET|POST /v1/segments { name, filters, propertyKey? } PATCH|DELETE /v1/segments/<id>\nGET /v1/domains every allowed domain and where it applies, observed origins\nPUT /v1/domains/<experiment|property>/<key> { hosts: [...] } replace one list ([] = any origin)\nGET /v1/notes ?experiment=&property=&kind=&from=&to=[&exact=1] newest first; experiment / property also return project-wide notes unless exact=1\nPOST /v1/notes { text (≤ 2000), day? (default today, project time zone), kind?: note|issue|win, experimentKey? | propertyKey? (none = whole project) }\nPATCH|DELETE /v1/notes/<id> { text?, day?, kind? }\nGET /v1/links short links: shortUrl, destinations [{ id, url, weight }], status, totalClicks\nPOST /v1/links { name, destinations: [{ url, weight? }], shortCode?, description?, clickLimit? }\nPATCH|DELETE /v1/links/<id> { name?, shortCode?, status: active|paused, destinations?, description? } GET /v1/links/<id>/stats: byDay (30 days), byDestination, byCountry, byDevice, byReferrer\nGET /v1/alerts rules, channels, digest, history, conditions, plan\nPOST /v1/alerts/rules { condition, params, actions?: { notify, pause, finish, dropLoser }, name?, experiment?, enabled?, cooldownHours? }\nPATCH|DELETE /v1/alerts/rules/<id> POST /v1/alerts/rules/<id>/test (dry run: what would fire now)\n\\`\\`\\`\n\nAlert conditions and params: experiments \\`srm\\`, \\`winner\\` { minVisitors? }, \\`loser\\` { lift, minVisitors? }, \\`exposures\\` { visitors },\n\\`conversions\\` { conversions }, \\`duration\\` { days }, \\`no_events\\` { hours }; account \\`quota\\` { percent }, \\`usage\\` { every } (each time this\nmonth's billed events cross another multiple); analytics \\`traffic_drop\\` / \\`traffic_spike\\` { property, percent }, \\`goal_silent\\`\n{ property, goal, hours }, \\`event_count\\` { property, event? (any event when absent), count, repeat? }. \\`params.progress\\` { total, fired,\nmonth? } is read-only. Enabled rules need Pro: \\`402 pro_required\\` otherwise (save it with \\`enabled: false\\`).\n\n\\`Authorization: Bearer sk_live_…\\` on each. Status values: draft | running | paused | finished.\n\n## Dashboard-scope endpoints (session, same shapes the dashboard uses)\n\nUnder \\`/v1/projects/<projectId>/…\\` with a user session: \\`experiments\\` (hosted experiments CRUD incl. \\`flow\\` targeting),\n\\`goals\\`, \\`timeline\\`, \\`breakdown\\`, \\`realtime\\`, \\`events\\`, \\`export\\`, \\`notes\\`, \\`domains\\`, \\`properties\\`, \\`links\\`, \\`alerts\\`, \\`billing\\`, \\`ai\\`.\nScripts should prefer the API-key endpoints above; the session ones exist for the UI.\n\n## Drop-in script (no SDK)\n\n\\`<script src=\"https://go.sh2.uk/sh.js\" data-key=\"pk_live_…\"></script>\\` in \\`<head>\\`: redirect experiments, page-visit and\nclick goals from the cloud config, \\`window.splithub.track(name, props)\\` for every event (goals included), pageviews\nfor analytics properties (\\`data-property=\"site\"\\`). An app with the SDK does not need it: one install per property,\nor only the first of the two collects pageviews.\n\\`<meta name=\"splithub-experiment\" content=\"<id>\">\\` on a tested page for an instant decision.\n\n## Errors\n\n\\`400\\` validation (message in \\`error\\`), \\`401\\` bad key, \\`403\\` forbidden (\\`insufficient_scope\\` names the missing \\`scope\\`), \\`404\\` unknown experiment/project, \\`409\\` state\n(e.g. \\`config_not_pushed\\`, \\`file_owned\\`), \\`429\\` gate or rate limit. Bodies: \\`{ error, code?, hint? }\\`, auth errors included; \\`hint\\` is the next step.\n`;\n\nexport const SKILL_SPLITHUB_MCP = `---\nname: splithub-mcp\ndescription: Use or set up the SplitHub MCP server (@splithub/mcp) so an agent can create experiments, read verdicts, start/pause/finish experiments and push config through tools instead of shelling out, plus analytics, notes, alerts and short links. Use when the user asks to connect SplitHub to Claude Code, Cursor, Codex or another MCP client.\n---\n\n# SplitHub MCP server\n\n\\`@splithub/mcp\\` is a stdio MCP server that wraps the \\`splithub\\` CLI for the current project folder.\nSame credentials and config file as the CLI; nothing extra to configure.\n\n## Register it\n\nClaude Code (project scope, committed in \\`.mcp.json\\`):\n\n\\`\\`\\`json\n{ \"mcpServers\": { \"splithub\": { \"command\": \"npx\", \"args\": [\"-y\", \"@splithub/mcp\"] } } }\n\\`\\`\\`\n\nor \\`claude mcp add splithub -- npx -y @splithub/mcp\\`. Cursor: the same object in \\`.cursor/mcp.json\\`.\nCodex / other clients: command \\`npx\\`, args \\`-y @splithub/mcp\\`. \\`npx splithub skills --mcp\\` writes both files.\nEnv: \\`SPLITHUB_PROJECT_DIR\\` (defaults to the MCP client's working directory), \\`SPLITHUB_API\\` (staging or self-hosted cloud), \\`SPLITHUB_API_KEY\\` (CI).\n\n## Tools\n\n| tool | does | notes |\n|---|---|---|\n| \\`splithub_status\\` | all experiments with verdict headline | start here |\n| \\`splithub_results\\` | full verdict for one experiment; from / to / filters for a slice, by / timeline / engagement / events for one view (cloud) | report \\`verdict.message\\` verbatim; \\`daysToVerdict\\` = when to check again; a slice's verdict is not the experiment's |\n| \\`splithub_experiment_events\\` | the latest raw exposures and goals of an experiment (cloud) | check the wiring |\n| \\`splithub_review\\` | stored AI reviews (Pro): at start, on verdict changes, on finish, on demand | quote them as the analyst's opinion, the verdict stays the source of truth |\n| \\`splithub_plan\\` | visitors per variant for a baseline and a lift; days at an experiment's traffic | before creating |\n| \\`splithub_experiment_create\\` | adds an experiment to splithub.config.ts | kind value / component / redirect / mvt, id, variants (or factors for mvt), goal, values/to, weights, traffic, maxVisitors, start/end; running by default |\n| \\`splithub_refs\\` | files and lines that use an experiment and its goal | check the wiring, find leftovers |\n| \\`splithub_ship\\` | finish, remove from the config, rewrite the code to the kept variant | \\`dryRun: true\\` first; returns \\`diff\\` and \\`leftovers\\` |\n| \\`splithub_remove\\` | removes an experiment from the config (archived in the cloud) | when the code is already clean |\n| \\`splithub_projects\\` | every folder on this machine connected to a cloud project | |\n| \\`splithub_init\\` | sets up the config, framework files and skills | once per project |\n| \\`splithub_experiment_status\\` | start / pause / finish | applies live in cloud mode; after \\`finished\\`, ask which variant to keep and whether to clean the code (splithub-ship skill) |\n| \\`splithub_push\\` / \\`splithub_pull\\` | sync the config with the cloud | pull adopts dashboard-created experiments |\n| \\`splithub_doctor\\` | checks the installation | run after wiring code |\n| \\`splithub_login\\` | returns a sign-in link; the human approves it in the browser | show the link, then call \\`splithub_whoami\\` |\n| \\`splithub_whoami\\` | connected project and keys | |\n| \\`splithub_analytics\\` | analytics properties; one property's totals, goals, top pages and sources; \\`by\\` a dimension | counts, never verdicts |\n| \\`splithub_analytics_events\\` | the latest raw pageviews and events of a property | check tracking after wiring it |\n| \\`splithub_analytics_funnel\\` / \\`_funnels\\` / \\`_paths\\` / \\`_retention\\` / \\`_realtime\\` | funnels (run, save, list), next pages, cohorts, visitors now (cloud) | counts, never verdicts |\n| \\`splithub_analytics_connect\\` | picks or creates a property and names it on the app's provider | \\`wired.status\\` none / many: add the snippet yourself |\n| \\`splithub_segments\\` | saved report filters (cloud) | |\n| \\`splithub_notes\\` | what happened on a day, per experiment, property or project: list / add / edit / delete (cloud) | add one when you ship |\n| \\`splithub_alerts\\` | alert rules: list / add / enable / disable / delete / test (cloud, fire on Pro) | conditions in the splithub skill |\n| \\`splithub_links\\` | short links: list / stats / create / edit / pause / resume / delete (cloud) | several URLs split by weight |\n| \\`splithub_property_create\\` | adds an analytics property to splithub.config.ts and to the cloud | no push needed |\n| \\`splithub_property_status\\` | pause / resume, archive / restore (cloud) or remove a property | live in cloud mode |\n| \\`splithub_domains\\` | allowed domains per experiment and property; set or clear one list | empty = any origin |\n\nOld names still answer for one release: \\`splithub_create_experiment\\`, \\`splithub_set_status\\`, \\`splithub_create_property\\`,\n\\`splithub_set_property_status\\`. Use the names above.\n\n## Working rules\n\n- Create (running by default) → wire in code → \\`doctor\\` → \\`push\\` (cloud mode) → tell the user it goes live when they\n deploy this code and that \\`set_status paused\\` or Pause in the dashboard holds it.\n- Results: never call a winner from raw rates; quote the verdict. \\`srm_detected\\` = fix the setup first.\n- Running experiments are frozen: no weight / variant / seed edits; create a new one.\n- Errors carry a \\`code\\`. \\`NOT_LOGGED_IN\\`: call \\`splithub_login\\`, show the link to the user, wait for them, then retry.\n- The whole loop (plan → create → implement → doctor → push → results → finish → ship) is in the \\`splithub-loop\\` skill.\n- A \\`finished\\` experiment in \\`splithub_status\\` or \\`splithub_results\\` means the experiment is over but its code is still there: report\n the verdict, ask which variant to keep and whether to remove the experiment from the code, then follow the \\`splithub-ship\\` skill.\n`;\n\nexport { SKILL_SELF_HOSTED } from './skills-self-hosted';\nimport { SKILL_SELF_HOSTED } from './skills-self-hosted';\nexport { SKILL_LOOP, SKILL_SHIP } from './skills-ship';\nimport { SKILL_LOOP, SKILL_SHIP } from './skills-ship';\nexport { SKILL_ANALYTICS } from './skills-analytics';\nimport { SKILL_ANALYTICS } from './skills-analytics';\nexport { SKILL_APPS } from './skills-apps';\nimport { SKILL_APPS } from './skills-apps';\n\nexport const SKILLS: Skill[] = [\n { dir: 'splithub', body: SKILL_SPLITHUB },\n { dir: 'ab-testing', body: SKILL_AB_TESTING },\n { dir: 'splithub-api', body: SKILL_SPLITHUB_API },\n { dir: 'splithub-mcp', body: SKILL_SPLITHUB_MCP },\n { dir: 'splithub-self-hosted', body: SKILL_SELF_HOSTED },\n { dir: 'splithub-ship', body: SKILL_SHIP },\n { dir: 'splithub-loop', body: SKILL_LOOP },\n { dir: 'splithub-analytics', body: SKILL_ANALYTICS },\n { dir: 'splithub-apps', body: SKILL_APPS },\n];\n\nexport const MCP_SERVER_ENTRY = { command: 'npx', args: ['-y', '@splithub/mcp'] };\n","export function configTemplate(project: string, mode: 'self' | 'cloud', key?: string, options: { app?: boolean } = {}): string {\n // An app has no origin of its own: self-hosted events go to the server's full URL, and Expo inlines EXPO_PUBLIC_* variables.\n const endpoint = options.app ? \"process.env.EXPO_PUBLIC_SPLITHUB_ENDPOINT ?? 'https://example.com/api/splithub'\" : \"'/api/splithub'\";\n const envKey = options.app ? 'EXPO_PUBLIC_SPLITHUB_KEY' : 'NEXT_PUBLIC_SPLITHUB_KEY';\n const storage = mode === 'self' ? `{ mode: 'self', endpoint: ${endpoint} }` : `{ mode: 'cloud', key: ${key ? `'${key}'` : `process.env.${envKey} ?? ''`} }`;\n const appNote = options.app\n ? `\n// In an app this file is built into the binary: a new experiment here reaches users with the next\n// store release. Create experiments in the dashboard to start them without a release.`\n : '';\n return `import { defineConfig } from '@splithub/core';\n\n// SplitHub experiments. This file is the source of truth: the SDK, the CLI\n// and the dashboard all read it. Keys: lowercase a-z 0-9 - _. First variant = control.${appNote}\nexport default defineConfig({\n project: '${project}',\n storage: ${storage},\n // Drafts behave like running experiments while you develop (next dev, vite); production ignores them.\n runDraftsInDev: true,\n\n goals: {\n // events you mark as goals: call track('signup') where it happens.\n // An experiment's goal may also be any other event name you track().\n signup: { type: 'event' },\n },\n\n experiments: {\n // run \\`npx splithub create\\` or add entries here:\n //\n // 'hero-title': {\n // kind: 'value',\n // status: 'running',\n // variants: {\n // control: { weight: 50, value: 'Ship faster' },\n // direct: { weight: 50, value: 'Know which version wins' },\n // },\n // goal: 'signup',\n // },\n },\n});\n`;\n}\n\nexport function nextMiddlewareTemplate(configImport: string): string {\n return `import { splithubMiddleware } from '@splithub/next';\nimport splithub from '${configImport}';\n\n// Sets the visitor cookie, forwards it to Server Components and serves\n// redirect experiments with an invisible rewrite.\nexport default splithubMiddleware(splithub);\n\nexport const config = {\n matcher: ['/((?!_next|api|.*\\\\\\\\..*).*)'],\n};\n`;\n}\n\nexport function nextRouteTemplate(configImport: string, store: { imports: string; factory: string } = { imports: \"import { sqliteStore } from '@splithub/adapter-sqlite';\", factory: \"sqliteStore({ file: process.env.SPLITHUB_DB ?? './splithub.db' })\" }): string {\n return `import { createSplitHubHandler } from '@splithub/node';\n${store.imports}\nimport config from '${configImport}';\n\n// Self-hosted ingest + results: events stay in your database. The CLI reads\n// status / results from this route; set SPLITHUB_ADMIN_TOKEN to protect it.\nconst handler = createSplitHubHandler({\n config,\n store: ${store.factory},\n adminToken: process.env.SPLITHUB_ADMIN_TOKEN,\n});\n\nexport const POST = handler;\nexport const GET = handler;\nexport const runtime = 'nodejs';\n`;\n}\n\nexport function componentVariantTemplate(name: string, experiment: string, variant: string): string {\n return `// Variant \"${variant}\" of experiment \"${experiment}\". Edit freely.\nexport function ${name}() {\n return (\n <section>\n <h2>${experiment} · ${variant}</h2>\n </section>\n );\n}\n`;\n}\n\nexport const AGENTS_SECTION = `\n## A/B testing (SplitHub)\n\nThis project uses SplitHub (\\`@splithub/react\\`). Experiments are declared in\n\\`splithub.config.ts\\` and rendered with \\`<Experiment id>\\` / \\`useVariant(id)\\` /\n\\`useValue(id)\\`. Events: \\`useTrack()\\` then \\`track('<event name>')\\`; an experiment's goal is any event name.\n\n- Not connected yet? \\`npx splithub init --mode cloud\\` (or \\`npx splithub login\\`) prints a link: show it to the user, they sign in and approve, the CLI gets the keys. Never ask the user to paste keys.\n- New experiment: \\`npx splithub create --kind value|component|redirect|mvt --id <key> --variants control,<other> --goal <event name> --yes\\`\n then wire it in code (value → \\`useValue\\`, component → \\`<Experiment>\\` with one \\`<Variant>\\` per key, redirect → nothing,\n mvt → \\`--factor name=level:value,…\\` and \\`const { a, b } = useValue(id)\\`).\n- Results: \\`npx splithub results <id> --json\\`; report \\`verdict.message\\` verbatim, never call a winner from raw rates.\n- Lifecycle: \\`npx splithub start|pause|finish <id>\\`. Check setup: \\`npx splithub doctor\\`.\n- A \\`finished\\` experiment still has all its variants in the code: report the verdict, ask which variant to keep and whether to\n remove the experiment from the code, then follow .claude/skills/splithub-ship/SKILL.md. Never delete experiment code unasked.\n- \\`create\\` writes \\`status: 'running'\\`: the experiment goes live when the code is deployed. Always tell the user that, and that\n \\`npx splithub pause <id>\\` or Pause in the dashboard holds it. Never change \\`seed\\` of a running experiment.\n- Analytics: set it up with \\`npx splithub analytics connect --json\\` (names the property on the provider), read it with\n \\`npx splithub analytics <property> --json\\`; also \\`funnel\\`, \\`paths\\`, \\`retention\\`, \\`realtime\\`, \\`export\\` (SplitHub Cloud).\n Details: .claude/skills/splithub-analytics/SKILL.md\n- Notes, alerts, links, domains (SplitHub Cloud): \\`npx splithub notes add \"<what shipped>\"\\` when you ship, \\`npx splithub alerts\\` (rules, e.g.\n \\`alerts add usage --every 1000\\`), \\`npx splithub links\\` (short links), \\`npx splithub domains\\`. Humans: \\`npx splithub\\` opens the menu.\n- Apps (React Native / Expo / iOS / Android): new experiments start in the dashboard (the config is built into the binary);\n screens are page events. Details: .claude/skills/splithub-apps/SKILL.md\n- Config ships to the browser: no secrets in it. Full rules: .claude/skills/splithub/SKILL.md\n`;\n\nexport { SKILL_SPLITHUB as SKILL_MD } from './skills';\nimport { SKILL_SPLITHUB } from './skills';\n\nexport const CURSOR_RULE = `---\ndescription: SplitHub A/B testing conventions\nglobs: [\"splithub.config.ts\", \"splithub/**\", \"**/*.tsx\"]\nalwaysApply: false\n---\n${SKILL_SPLITHUB.replace(/^---[\\s\\S]*?---\\n/, '')}`;\n"],"mappings":";;;AAEO,IAAM,oBAAoB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;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
|
7
7
|
filterFlags,
|
|
8
8
|
n,
|
|
9
9
|
reportQuery,
|
|
10
10
|
str
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-OH735OOS.js";
|
|
12
12
|
import {
|
|
13
13
|
request,
|
|
14
14
|
requestText
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-W66MJG3R.js";
|
|
16
16
|
import {
|
|
17
17
|
c,
|
|
18
18
|
fail,
|
|
@@ -240,4 +240,4 @@ export {
|
|
|
240
240
|
eventsByVariantCsv,
|
|
241
241
|
experimentEvents
|
|
242
242
|
};
|
|
243
|
-
//# sourceMappingURL=chunk-
|
|
243
|
+
//# sourceMappingURL=chunk-NQDGMBRF.js.map
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
requestText,
|
|
8
8
|
requireCloudToken,
|
|
9
9
|
resolveTarget
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-W66MJG3R.js";
|
|
11
11
|
import {
|
|
12
12
|
bar,
|
|
13
13
|
c,
|
|
@@ -295,4 +295,4 @@ export {
|
|
|
295
295
|
exportCsv,
|
|
296
296
|
segments
|
|
297
297
|
};
|
|
298
|
-
//# sourceMappingURL=chunk-
|
|
298
|
+
//# sourceMappingURL=chunk-OH735OOS.js.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
request,
|
|
4
4
|
requireCloudToken
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-W66MJG3R.js";
|
|
6
6
|
import {
|
|
7
7
|
c,
|
|
8
8
|
fail,
|
|
@@ -46,4 +46,4 @@ ${c.bold("Seen sending events")}`);
|
|
|
46
46
|
export {
|
|
47
47
|
domains
|
|
48
48
|
};
|
|
49
|
-
//# sourceMappingURL=chunk-
|
|
49
|
+
//# sourceMappingURL=chunk-OTK6B4QC.js.map
|
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
cloudOnly,
|
|
4
4
|
n,
|
|
5
5
|
str
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-OH735OOS.js";
|
|
7
7
|
import {
|
|
8
8
|
request,
|
|
9
9
|
requireCloudToken
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-W66MJG3R.js";
|
|
11
11
|
import {
|
|
12
12
|
bar,
|
|
13
13
|
c,
|
|
@@ -196,4 +196,4 @@ export {
|
|
|
196
196
|
destinationsFrom,
|
|
197
197
|
links
|
|
198
198
|
};
|
|
199
|
-
//# sourceMappingURL=chunk-
|
|
199
|
+
//# sourceMappingURL=chunk-Q6JPYA4Y.js.map
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "./chunk-6K3MHBT7.js";
|
|
11
11
|
import {
|
|
12
12
|
applyLiveStatus
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-W66MJG3R.js";
|
|
14
14
|
import {
|
|
15
15
|
c,
|
|
16
16
|
fail,
|
|
@@ -51,4 +51,4 @@ async function lifecycle(command, id, flags) {
|
|
|
51
51
|
export {
|
|
52
52
|
lifecycle
|
|
53
53
|
};
|
|
54
|
-
//# sourceMappingURL=chunk-
|
|
54
|
+
//# sourceMappingURL=chunk-QJQKARDO.js.map
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
fetchStatus,
|
|
7
7
|
resolveTarget
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-W66MJG3R.js";
|
|
9
9
|
import {
|
|
10
10
|
c
|
|
11
11
|
} from "./chunk-ZISCJRR5.js";
|
|
@@ -69,4 +69,4 @@ async function dev(flags) {
|
|
|
69
69
|
export {
|
|
70
70
|
dev
|
|
71
71
|
};
|
|
72
|
-
//# sourceMappingURL=chunk-
|
|
72
|
+
//# sourceMappingURL=chunk-RZGKAVA6.js.map
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
cloudOnly,
|
|
4
4
|
reportQuery,
|
|
5
5
|
str
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-OH735OOS.js";
|
|
7
7
|
import {
|
|
8
8
|
request
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-W66MJG3R.js";
|
|
10
10
|
import {
|
|
11
11
|
c,
|
|
12
12
|
fail,
|
|
@@ -122,4 +122,4 @@ export {
|
|
|
122
122
|
noteScope,
|
|
123
123
|
notes
|
|
124
124
|
};
|
|
125
|
-
//# sourceMappingURL=chunk-
|
|
125
|
+
//# sourceMappingURL=chunk-SAH2BATZ.js.map
|
|
@@ -52,7 +52,7 @@ function removeCredential(api, root = process.cwd()) {
|
|
|
52
52
|
|
|
53
53
|
// src/api.ts
|
|
54
54
|
import { readFileSync as readFileSync2 } from "fs";
|
|
55
|
-
var CLOUD_API = "https://go.
|
|
55
|
+
var CLOUD_API = "https://go.sh2.uk/v1";
|
|
56
56
|
function storageFromConfig(project) {
|
|
57
57
|
const fallback = { mode: "self", endpoint: "/api/splithub" };
|
|
58
58
|
if (!project?.configFile) return fallback;
|
|
@@ -203,4 +203,4 @@ export {
|
|
|
203
203
|
fetchPlan,
|
|
204
204
|
fetchSkills
|
|
205
205
|
};
|
|
206
|
-
//# sourceMappingURL=chunk-
|
|
206
|
+
//# sourceMappingURL=chunk-W66MJG3R.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/credentials.ts","../src/api.ts"],"sourcesContent":["// Credentials saved by `splithub login`: ~/.config/splithub/credentials.json\n// { \"<api base>\": { \"<project root>\": { apiKey, projectId, projectName, savedAt } } }\n// `cloudTarget` falls back to the entry for the current directory when neither\n// --token nor SPLITHUB_API_KEY is set.\nimport { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';\nimport { homedir } from 'node:os';\nimport { join, resolve } from 'node:path';\n\nexport interface SavedCredential {\n apiKey: string;\n projectId: string | null;\n projectName: string | null;\n /** Public key of the project (pk_...), written into splithub.config.ts by init. */\n publicKey?: string | null;\n savedAt: string;\n}\n\ntype Store = Record<string, Record<string, SavedCredential>>;\n\nexport function credentialsFile(): string {\n const base = process.env.XDG_CONFIG_HOME || (process.platform === 'win32' ? process.env.APPDATA || join(homedir(), 'AppData', 'Roaming') : join(homedir(), '.config'));\n return join(base, 'splithub', 'credentials.json');\n}\n\nfunction read(): Store {\n const file = credentialsFile();\n if (!existsSync(file)) return {};\n try {\n return JSON.parse(readFileSync(file, 'utf8')) as Store;\n } catch {\n return {};\n }\n}\n\nexport function loadCredential(api: string, root = process.cwd()): SavedCredential | null {\n return read()[api]?.[resolve(root)] ?? null;\n}\n\nexport function saveCredential(api: string, root: string, cred: SavedCredential): string {\n const file = credentialsFile();\n const store = read();\n store[api] = { ...(store[api] ?? {}), [resolve(root)]: cred };\n mkdirSync(join(file, '..'), { recursive: true });\n writeFileSync(file, JSON.stringify(store, null, 2) + '\\n', { mode: 0o600 });\n return file;\n}\n\n/** Every saved credential on this machine: which directory is connected to which project. */\nexport function listCredentials(api?: string): Array<{ api: string; root: string; cred: SavedCredential }> {\n const store = read();\n const out: Array<{ api: string; root: string; cred: SavedCredential }> = [];\n for (const [a, dirs] of Object.entries(store)) {\n if (api && a !== api) continue;\n for (const [root, cred] of Object.entries(dirs)) out.push({ api: a, root, cred });\n }\n return out.sort((x, y) => y.cred.savedAt.localeCompare(x.cred.savedAt));\n}\n\nexport function removeCredential(api: string, root = process.cwd()): boolean {\n const store = read();\n const key = resolve(root);\n if (!store[api]?.[key]) return false;\n delete store[api][key];\n writeFileSync(credentialsFile(), JSON.stringify(store, null, 2) + '\\n', { mode: 0o600 });\n return true;\n}\n","import type { RawResults, RawStatusRow } from '@splithub/node';\nimport { readFileSync } from 'node:fs';\nimport { loadCredential } from './credentials';\nimport { CliError, fail } from './errors';\nimport type { ProjectInfo } from './project';\n\nexport interface Target {\n url: string;\n token?: string;\n /** SplitHub Cloud (verdicts computed there); false for a self-hosted endpoint or an explicit --url. */\n cloud?: boolean;\n}\n\nexport const CLOUD_API = 'https://go.sh2.uk/v1';\n\n/** Storage settings from splithub.config.ts, read textually to avoid loading the config. */\nfunction storageFromConfig(project?: ProjectInfo): { mode: 'self' | 'cloud'; endpoint: string } {\n const fallback = { mode: 'self' as const, endpoint: '/api/splithub' };\n if (!project?.configFile) return fallback;\n try {\n const src = readFileSync(project.configFile, 'utf8');\n const mode = /mode\\s*:\\s*['\"](cloud|self)['\"]/.exec(src)?.[1] as 'self' | 'cloud' | undefined;\n const endpoint = /endpoint\\s*:\\s*['\"]([^'\"]+)['\"]/.exec(src)?.[1];\n return { mode: mode ?? 'self', endpoint: endpoint ?? '/api/splithub' };\n } catch {\n return fallback;\n }\n}\n\n/** Cloud API base + project API key (sk_...). */\nexport function cloudTarget(flags: Record<string, unknown>): Target {\n const url = (typeof flags.api === 'string' && flags.api) || process.env.SPLITHUB_API || CLOUD_API;\n const base = url.replace(/\\/+$/, '');\n const token = (typeof flags.token === 'string' && flags.token) || process.env.SPLITHUB_API_KEY || loadCredential(base)?.apiKey || undefined;\n return { url: base, token, cloud: true };\n}\n\n/**\n * Where to read results from:\n * - --url / SPLITHUB_URL always win;\n * - cloud mode → the cloud API with the project API key;\n * - self mode → the local dev server (3000 for Next.js, 5173 for Vite) + the endpoint from the config.\n */\nexport function resolveTarget(flags: Record<string, unknown>, project?: ProjectInfo): Target {\n const explicit = (typeof flags.url === 'string' && flags.url) || process.env.SPLITHUB_URL;\n const storage = storageFromConfig(project);\n if (!explicit && storage.mode === 'cloud') return cloudTarget(flags);\n const port = project?.framework === 'next' ? 3000 : 5173;\n const url = explicit || `http://localhost:${port}${storage.endpoint}`;\n const token = (typeof flags.token === 'string' && flags.token) || process.env.SPLITHUB_ADMIN_TOKEN || undefined;\n return { url: url.replace(/\\/+$/, ''), token, cloud: false };\n}\n\n/**\n * Readable message from an API error body. /v1 answers `{ error: 'text', code, hint? }`; servers before\n * 0.4.0 sent auth errors as `{ success: false, error: { code, message } }`, still read here.\n */\nexport function apiErrorMessage(status: number, body: unknown, fallback: string): string {\n const error = (body as { error?: unknown } | null)?.error;\n const text = typeof error === 'string' ? error : typeof (error as { message?: unknown } | undefined)?.message === 'string' ? (error as { message: string }).message : fallback;\n return status === 401 ? `${text} This folder is not signed in: run npx splithub login (or set SPLITHUB_API_KEY).` : text;\n}\n\n/** CliError for a failed API response: 401 → NOT_LOGGED_IN, 404 on an experiment → EXPERIMENT_NOT_FOUND. The server's `hint` wins over ours. */\nexport function apiError(status: number, body: unknown, fallback: string, experiment?: string): CliError {\n const message = apiErrorMessage(status, body, fallback);\n const b = body as { code?: unknown; needed?: unknown; scope?: unknown; hint?: unknown } | null;\n const serverHint = typeof b?.hint === 'string' && b.hint ? b.hint : undefined;\n if (status === 401) return new CliError('NOT_LOGGED_IN', message, serverHint ?? 'Run npx splithub login (or set SPLITHUB_API_KEY), then retry.');\n if (status === 403 && b?.code === 'insufficient_scope') {\n // Older servers sent only `needed` (read | write); newer ones name the area too (`notes:write`).\n const scope = typeof b.scope === 'string' && b.scope ? b.scope : typeof b.needed === 'string' ? b.needed : 'write';\n return new CliError('INSUFFICIENT_SCOPE', message, serverHint ?? `This API key lacks the \"${scope}\" scope. Create one with it in the dashboard (Settings, API keys) or run npx splithub login --yes.`, scope);\n }\n if (status === 402 && b?.code === 'pro_required') return new CliError('PRO_REQUIRED', message, serverHint ?? 'Alert rules run on Pro: upgrade in the dashboard (Billing), then turn the rule on.');\n if (status === 404 && experiment) return new CliError('EXPERIMENT_NOT_FOUND', message, serverHint ?? 'Check the id with npx splithub status. In cloud mode, push the config first.');\n return new CliError('API_ERROR', message, serverHint);\n}\n\nexport async function request<T>(target: Target, path: string, init: RequestInit = {}, experiment?: string): Promise<T> {\n const headers: Record<string, string> = { ...((init.headers as Record<string, string> | undefined) ?? {}) };\n if (target.token) headers.authorization = `Bearer ${target.token}`;\n if (init.body) headers['content-type'] = 'application/json';\n let res: Response;\n try {\n res = await fetch(`${target.url}${path}`, { ...init, headers });\n } catch (error) {\n const hint = target.cloud ? 'Check your connection, or set --api / SPLITHUB_API.' : 'Is your app running? Set --url or SPLITHUB_URL.';\n throw new CliError('UNREACHABLE', `Can't reach ${target.url}: ${error instanceof Error ? error.message : String(error)}.`, hint);\n }\n const body: unknown = await res.json().catch(() => ({}));\n if (!res.ok) throw apiError(res.status, body, `${target.url}${path} responded ${res.status}`, experiment);\n return body as T;\n}\n\n/** A text answer (CSV exports); errors still arrive as JSON. */\nexport async function requestText(target: Target, path: string): Promise<string> {\n const headers: Record<string, string> = target.token ? { authorization: `Bearer ${target.token}` } : {};\n let res: Response;\n try {\n res = await fetch(`${target.url}${path}`, { headers });\n } catch (error) {\n throw new CliError('UNREACHABLE', `Can't reach ${target.url}: ${error instanceof Error ? error.message : String(error)}.`, 'Check your connection, or set --api / SPLITHUB_API.');\n }\n const text = await res.text();\n if (!res.ok) {\n let body: unknown = {};\n try {\n body = JSON.parse(text);\n } catch {\n // not JSON\n }\n throw apiError(res.status, body, `${target.url}${path} responded ${res.status}`);\n }\n return text;\n}\n\n/** Cloud target that must carry an API key. */\nexport function requireCloudToken(flags: Record<string, unknown>): Target & { token: string } {\n const target = cloudTarget(flags);\n if (!target.token) fail('NOT_LOGGED_IN', 'This folder is not connected to SplitHub Cloud.', 'Run npx splithub login, or pass --token sk_... / SPLITHUB_API_KEY.');\n return target as Target & { token: string };\n}\n\n/** PUT /overrides/<experiment>: live status, traffic or weights without a deploy. */\nexport function putOverride(target: Target, experiment: string, body: Record<string, unknown>): Promise<unknown> {\n return request<unknown>(target, `/overrides/${encodeURIComponent(experiment)}`, { method: 'PUT', body: JSON.stringify(body) }, experiment);\n}\n\n/**\n * Apply a status live in cloud mode. Never throws: the config file already changed,\n * so a refused or unreachable cloud is reported, not fatal.\n */\nexport async function applyLiveStatus(flags: Record<string, unknown>, experiment: string, status: string): Promise<string> {\n const target = cloudTarget(flags);\n if (!target.token) return 'no API key (run npx splithub login or set SPLITHUB_API_KEY to apply it without a deploy)';\n try {\n await putOverride(target, experiment, { status });\n return 'applied';\n } catch (error) {\n return `cloud refused: ${error instanceof Error ? error.message : String(error)}`;\n }\n}\n\n/**\n * Archive an experiment in the cloud (PUT /archive/<id>): it stops, keeps its numbers and leaves the\n * active list. Older servers without the route get it finished instead. Never throws.\n */\nexport async function archiveLive(flags: Record<string, unknown>, experiment: string): Promise<string> {\n const target = cloudTarget(flags);\n if (!target.token) return 'no API key (run npx splithub login or set SPLITHUB_API_KEY to archive it in the cloud)';\n try {\n await request<unknown>(target, `/archive/${encodeURIComponent(experiment)}`, { method: 'PUT', body: '{}' });\n return 'archived';\n } catch (error) {\n // 404 from a server without the route (or any non-auth refusal): finishing still stops the test.\n if (error instanceof CliError && (error.code === 'EXPERIMENT_NOT_FOUND' || error.code === 'API_ERROR')) {\n const finished = await applyLiveStatus(flags, experiment, 'finished');\n return finished === 'applied' ? 'finished' : finished;\n }\n return `cloud refused: ${error instanceof Error ? error.message : String(error)}`;\n }\n}\n\n// Response shapes. Cloud answers carry the verdict and ready-to-print words; a self-hosted endpoint\n// (@splithub/node) answers raw counts with `analysis: { available: false }`. Only what the CLI reads is typed.\n\nexport interface Voice {\n scenario: string;\n line: string;\n advice: string;\n}\n\n/** Ready-to-print verdict label and lines, computed by the server. */\nexport interface Display {\n label: string;\n lines: string[];\n next?: string;\n}\n\nexport interface VariantCounts {\n variant: string;\n exposures: number;\n conversions: number;\n revenue?: number;\n}\n\nexport interface Interval {\n low: number;\n high: number;\n}\n\nexport interface Comparison {\n variant: string;\n relativeLift: number | null;\n probabilityToBeat: number;\n pValue: number;\n ci: Interval;\n sequential?: { pValue: number; ci: Interval };\n}\n\nexport interface MetricResult {\n metric: string;\n role: 'secondary' | 'guardrail';\n worse?: 'lower' | 'higher';\n variants: VariantCounts[];\n comparisons: Comparison[];\n}\n\nexport interface Verdict {\n status: string;\n message: string;\n winner: string | null;\n notes?: string[];\n comparisons: Comparison[];\n sample: { variants: VariantCounts[]; stars?: number; checks?: Array<{ met: boolean; label: string }> };\n metrics?: MetricResult[];\n guardrailBreached?: Array<{ metric: string; variant: string }>;\n}\n\nexport interface FactorResult {\n key: string;\n best: string | null;\n levels: Array<{ level: string; exposures: number; conversions: number; rate: number; relativeLift: number | null; pValue: number | null }>;\n}\n\n/** Cloud results. `display`, `voice` and `daysToVerdict` are optional: older servers omit them. */\nexport interface CloudResults {\n experiment: string;\n kind: string;\n status: string;\n goal: string | null;\n description: string | null;\n verdict: Verdict;\n daysToVerdict?: number | null;\n voice?: Voice | null;\n display?: Display;\n factors?: FactorResult[];\n /** Present when the results are a slice: first-exposure days and visitor filters. */\n scope?: { filtered: boolean; range: { from: string; to: string } | null; filters: Record<string, string | string[]>; note?: string };\n analysis?: undefined;\n}\n\nexport interface CloudStatusRow {\n experiment: string;\n kind: string;\n status: string;\n goal: string | null;\n visitors: number;\n days: number;\n verdict: string | null;\n headline: string | null;\n sample?: string | null;\n stars?: number | null;\n daysToVerdict?: number | null;\n voice?: Voice | null;\n display?: Display;\n}\n\nexport type { RawResults, RawStatusRow };\nexport type Analysis = RawResults['analysis'];\nexport type Results = CloudResults | RawResults;\nexport type StatusRow = CloudStatusRow | (RawStatusRow & { headline?: undefined; verdict?: undefined; sample?: undefined; stars?: undefined; daysToVerdict?: undefined; display?: undefined });\n/** One analytics property in `GET /v1/status` (SplitHub Cloud): its last 7 days against the 7 before. */\nexport interface StatusProperty {\n property: string;\n name: string;\n status: string;\n visitors: number;\n previousVisitors: number;\n /** Relative change; null when the 7 days before had no visitors. */\n change: number | null;\n pageviews: number;\n conversions: Array<{ goal: string; conversions: number; change: number | null }>;\n}\n\nexport interface StatusData {\n project: string;\n experiments: StatusRow[];\n /** SplitHub Cloud: analytics properties (archived left out); older servers and self-hosted omit it. */\n properties?: StatusProperty[];\n propertiesRange?: { from: string; to: string };\n /** Present (available: false) on self-hosted endpoints. */\n analysis?: Analysis;\n}\n\n/** Self-hosted answers: counts only, the verdict comes with SplitHub Cloud. */\nexport const isRawResults = (r: Results): r is RawResults => (r as { analysis?: { available?: boolean } }).analysis?.available === false;\n\nexport const fetchStatus = (t: Target) => request<StatusData>(t, '/status');\nexport const fetchResults = (t: Target, key: string) => request<Results>(t, `/results/${encodeURIComponent(key)}`, {}, key);\nexport const fetchReport = (t: Target) => request<{ project: string; markdown: string }>(t, '/report');\n\nexport interface PlanResult {\n baseline: number;\n mde: number;\n variants: number;\n confidence: number;\n perVariant: number;\n total: number;\n}\n\n/** GET /plan on SplitHub Cloud: public, no API key needed. */\nexport const fetchPlan = (t: Target, q: { baseline: number; mde: number; variants: number }) =>\n request<PlanResult>({ url: t.url, cloud: true }, `/plan?${new URLSearchParams({ baseline: String(q.baseline), mde: String(q.mde), variants: String(q.variants) }).toString()}`);\n\nexport interface SkillFile {\n /** Relative to the project root. `AGENTS.md` is a section to append, not a whole file. */\n path: string;\n body: string;\n}\n\n/** GET /skills on SplitHub Cloud; null on any error or after `timeoutMs`, so the caller uses the bundled copies. */\nexport async function fetchSkills(flags: Record<string, unknown>, timeoutMs = 1500): Promise<SkillFile[] | null> {\n try {\n const res = await fetch(`${cloudTarget(flags).url}/skills`, { signal: AbortSignal.timeout(timeoutMs) });\n if (!res.ok) return null;\n const body = (await res.json()) as { files?: unknown };\n if (!Array.isArray(body.files)) return null;\n const files = body.files.filter((f): f is SkillFile => typeof (f as SkillFile | null)?.path === 'string' && typeof (f as SkillFile).body === 'string');\n return files.length ? files : null;\n } catch {\n return null;\n }\n}\n"],"mappings":";;;;;;;AAIA,SAAS,YAAY,WAAW,cAAc,qBAAqB;AACnE,SAAS,eAAe;AACxB,SAAS,MAAM,eAAe;AAavB,SAAS,kBAA0B;AACxC,QAAM,OAAO,QAAQ,IAAI,oBAAoB,QAAQ,aAAa,UAAU,QAAQ,IAAI,WAAW,KAAK,QAAQ,GAAG,WAAW,SAAS,IAAI,KAAK,QAAQ,GAAG,SAAS;AACpK,SAAO,KAAK,MAAM,YAAY,kBAAkB;AAClD;AAEA,SAAS,OAAc;AACrB,QAAM,OAAO,gBAAgB;AAC7B,MAAI,CAAC,WAAW,IAAI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AAE,KAAK,OAAO,KAAK,GAAG,SAAS,IAAI,gBAAgB,EAAE,UAAU,OAAO,EAAE,QAAQ,GAAG,KAAK,OAAO,EAAE,GAAG,GAAG,UAAU,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,SAAS,CAAC,EAAE;AAShL,eAAsB,YAAY,OAAgC,YAAY,MAAmC;AAC/G,MAAI;AACF,UAAM,MAAM,MAAM,MAAM,GAAG,YAAY,KAAK,EAAE,GAAG,WAAW,EAAE,QAAQ,YAAY,QAAQ,SAAS,EAAE,CAAC;AACtG,QAAI,CAAC,IAAI,GAAI,QAAO;AACpB,UAAM,OAAQ,MAAM,IAAI,KAAK;AAC7B,QAAI,CAAC,MAAM,QAAQ,KAAK,KAAK,EAAG,QAAO;AACvC,UAAM,QAAQ,KAAK,MAAM,OAAO,CAAC,MAAsB,OAAQ,GAAwB,SAAS,YAAY,OAAQ,EAAgB,SAAS,QAAQ;AACrJ,WAAO,MAAM,SAAS,QAAQ;AAAA,EAChC,QAAQ;AACN,WAAO;AAAA,EACT;AACF;","names":["readFileSync","readFileSync"]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
analytics
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-57IKDCOM.js";
|
|
5
5
|
import {
|
|
6
6
|
domains
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-OTK6B4QC.js";
|
|
8
8
|
import {
|
|
9
9
|
loadConfig
|
|
10
10
|
} from "./chunk-K5GDEVMA.js";
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
import {
|
|
15
15
|
request,
|
|
16
16
|
resolveTarget
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-W66MJG3R.js";
|
|
18
18
|
|
|
19
19
|
// src/commands/menu-analytics.ts
|
|
20
20
|
import * as p from "@clack/prompts";
|
|
@@ -66,7 +66,7 @@ function propertyChoices(data) {
|
|
|
66
66
|
function propertySnippets(key, publicKey) {
|
|
67
67
|
return {
|
|
68
68
|
provider: `<SplitHubProvider config={config} property="${key}">`,
|
|
69
|
-
script: `<script src="https://go.
|
|
69
|
+
script: `<script src="https://go.sh2.uk/sh.js" data-key="${publicKey ?? "pk_\u2026"}" data-property="${key}" async></script>`
|
|
70
70
|
};
|
|
71
71
|
}
|
|
72
72
|
function parseHosts(input) {
|
|
@@ -234,4 +234,4 @@ export {
|
|
|
234
234
|
analyticsMenu,
|
|
235
235
|
domainsMenu
|
|
236
236
|
};
|
|
237
|
-
//# sourceMappingURL=chunk-
|
|
237
|
+
//# sourceMappingURL=chunk-X2ICUB5B.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/menu-analytics.ts"],"sourcesContent":["// The menu's analytics steps: set up (connect), properties (list, create, report, raw events, pause/resume), the\n// cloud reports (realtime, funnel, paths, retention) and allowed domains. Each step calls the same command function as `splithub analytics …` /\n// `splithub domains …`, so the output is the one scripts see without --json.\nimport * as p from '@clack/prompts';\nimport { newPropertyId } from '@splithub/core';\nimport { request, resolveTarget } from '../api';\nimport { loadConfig } from '../config-file';\nimport { detectProject } from '../project';\nimport { analytics } from './analytics';\nimport { domains } from './domains';\nimport type { Flags } from './init';\n\nexport type Mode = 'cloud' | 'self';\ntype AnalyticsAction = 'connect' | 'list' | 'report' | 'realtime' | 'funnel' | 'paths' | 'retention' | 'events' | 'create' | 'toggle' | 'back';\nexport interface PropertyChoice {\n value: string;\n label: string;\n hint: string;\n status: string;\n}\n\nexport const REPORT_SPANS = [7, 30, 90] as const;\nexport const REPORT_BREAKDOWNS = ['page', 'source', 'channel', 'country', 'device', 'event', 'goal'] as const;\nexport const FUNNEL_WITHIN = [\n { value: 'visit', label: 'In one visit' },\n { value: '7d', label: 'Within 7 days' },\n { value: '30d', label: 'Within 30 days' },\n] as const;\n\n/** Why a typed funnel is refused, or undefined: 2 to 8 steps, each page:, event: or goal:. */\nexport function funnelStepsError(input: string): string | undefined {\n const steps = input.split(',').map((s) => s.trim()).filter(Boolean);\n if (steps.length < 2) return 'Two steps at least, separated by commas';\n if (steps.length > 8) return 'Eight steps at most';\n const bad = steps.find((s) => !/^(page:\\/\\S*|event:.+|goal:.+)$/.test(s));\n return bad ? `\"${bad}\": start with page:/, event: or goal:` : undefined;\n}\nexport const CLOUD_ONLY = 'Allowed domains come with SplitHub Cloud: a self-hosted endpoint accepts events from wherever you mount it.';\n\n/** Options of the Analytics submenu. Realtime, funnels, paths and retention come with SplitHub Cloud; the rest reads raw counts when self-hosted. */\nexport function analyticsOptions(mode: Mode = 'cloud'): Array<{ value: AnalyticsAction; label: string; hint?: string }> {\n const cloud: Array<{ value: AnalyticsAction; label: string; hint?: string }> = [\n { value: 'realtime', label: \"Who's here now\", hint: 'last 5 minutes' },\n { value: 'funnel', label: 'Build a funnel', hint: 'pages, events, goals in order' },\n { value: 'paths', label: 'Where visitors go next' },\n { value: 'retention', label: 'Who comes back', hint: 'weekly cohorts' },\n ];\n return [\n { value: 'connect', label: 'Set up analytics in this app', hint: 'pick a property, name it in the code, send events' },\n { value: 'list', label: 'See all properties', hint: 'last 30 days' },\n { value: 'report', label: 'Open a report', hint: 'visitors, pages, sources, goals' },\n ...(mode === 'cloud' ? cloud : []),\n { value: 'events', label: 'Latest raw events' },\n { value: 'create', label: 'Create a property' },\n { value: 'toggle', label: 'Pause or resume a property' },\n { value: 'back', label: 'Back' },\n ];\n}\n\n/** Select options from `GET /properties`: the cloud answers `{ key, name, status, last30 }`, self-hosted `{ property, name, status, counts }`. */\nexport function propertyChoices(data: { properties: Array<Record<string, unknown>> }): PropertyChoice[] {\n return data.properties.flatMap((row) => {\n const key = typeof row.key === 'string' ? row.key : typeof row.property === 'string' ? row.property : null;\n if (!key) return [];\n const name = typeof row.name === 'string' && row.name ? row.name : null;\n const status = typeof row.status === 'string' ? row.status : 'running';\n const sums = (row.last30 ?? row.counts) as { visitors?: unknown } | null | undefined;\n const visitors = typeof sums?.visitors === 'number' ? sums.visitors : null;\n return [{ value: key, label: name ? `${name} (${key})` : key, hint: visitors === null ? status : `${status} · ${visitors.toLocaleString('en-US')} visitors`, status }];\n });\n}\n\n/** Where to name the property so its events arrive: the React provider prop and the sh.js tag. */\nexport function propertySnippets(key: string, publicKey?: string | null): { provider: string; script: string } {\n return {\n provider: `<SplitHubProvider config={config} property=\"${key}\">`,\n script: `<script src=\"https://go.sh2.uk/sh.js\" data-key=\"${publicKey ?? 'pk_…'}\" data-property=\"${key}\" async></script>`,\n };\n}\n\n/** Hosts typed in one line: spaces or commas, schemes and paths dropped (`https://a.com/x` → `a.com`). */\nexport function parseHosts(input: string): string[] {\n const hosts = input\n .split(/[\\s,]+/)\n .map((h) => h.trim().toLowerCase().replace(/^[a-z]+:\\/\\//, '').replace(/[/?#].*$/, ''))\n .filter(Boolean);\n return [...new Set(hosts)];\n}\n\nasync function choices(flags: Flags): Promise<PropertyChoice[]> {\n const project = detectProject();\n try {\n return propertyChoices(await request<{ properties: Array<Record<string, unknown>> }>(resolveTarget(flags, project), '/properties'));\n } catch {\n // The dev server is down or the folder is not connected: the config file still knows the ids.\n if (!project.configFile) return [];\n const config = await loadConfig(project.configFile);\n return (config.properties ?? []).map((prop) => ({ value: prop.key, label: prop.name ? `${prop.name} (${prop.key})` : prop.key, hint: prop.status, status: prop.status }));\n }\n}\n\nexport async function pickProperty(flags: Flags, message: string): Promise<PropertyChoice | null> {\n const list = await choices(flags);\n if (list.length === 0) {\n p.log.warn('No analytics properties yet. Create one first.');\n return null;\n }\n const picked = await p.select({ message, options: list.map(({ value, label, hint }) => ({ value, label, hint })) });\n if (p.isCancel(picked)) return null;\n return list.find((x) => x.value === picked) ?? null;\n}\n\nasync function createStep(flags: Flags): Promise<void> {\n const name = await p.text({ message: 'Name of the property', placeholder: 'Marketing site' });\n if (p.isCancel(name)) return;\n const key = newPropertyId();\n await analytics(['create', key], { ...flags, name: name.trim() || undefined });\n const s = propertySnippets(key);\n p.note(`React / Next.js:\\n ${s.provider}\\n\\nAny site, with sh.js:\\n ${s.script}`, `Send events to ${key}`);\n}\n\nasync function reportStep(flags: Flags, mode: Mode): Promise<void> {\n const prop = await pickProperty(flags, 'Which property?');\n if (!prop) return;\n let days: number = 30;\n for (;;) {\n const span = await p.select({ message: 'Which period?', initialValue: days, options: REPORT_SPANS.map((d) => ({ value: d, label: `Last ${d} days` })) });\n if (p.isCancel(span)) return;\n days = span;\n await analytics([prop.value], { ...flags, days: String(days) });\n // Self-hosted answers raw counts only; breakdowns are computed in the cloud.\n if (mode !== 'cloud') return;\n for (;;) {\n console.log();\n const by = await p.select<string>({\n message: 'Break it down?',\n options: [...REPORT_BREAKDOWNS.map((b) => ({ value: b, label: `By ${b}` })), ...(mode === 'cloud' ? [{ value: 'compare', label: 'Compare with the period before' }] : []), { value: 'span', label: 'Another period' }, { value: 'done', label: 'Done' }],\n });\n if (p.isCancel(by) || by === 'done') return;\n if (by === 'span') break;\n if (by === 'compare') await analytics([prop.value], { ...flags, days: String(days), compare: 'previous' });\n else await analytics([prop.value], { ...flags, days: String(days), by });\n }\n }\n}\n\nasync function funnelStep(flags: Flags): Promise<void> {\n const prop = await pickProperty(flags, 'Funnel of which property?');\n if (!prop) return;\n const steps = await p.text({ message: 'Steps, in order', placeholder: 'page:/, page:/pricing, event:Signup, goal:paid', validate: funnelStepsError });\n if (p.isCancel(steps)) return;\n const within = await p.select<string>({ message: 'Counted when they happen', options: FUNNEL_WITHIN.map((w) => ({ value: w.value, label: w.label })) });\n if (p.isCancel(within)) return;\n await analytics(['funnel', prop.value], { ...flags, steps, within });\n}\n\nasync function pathsStep(flags: Flags): Promise<void> {\n const prop = await pickProperty(flags, 'Paths of which property?');\n if (!prop) return;\n const page = await p.text({ message: 'Which page?', placeholder: '/pricing', validate: (v) => (v.trim().startsWith('/') ? undefined : 'A path like /pricing') });\n if (p.isCancel(page)) return;\n const direction = await p.select<'next' | 'prev'>({ message: 'Show', options: [{ value: 'next', label: 'Where visitors go next' }, { value: 'prev', label: 'Where they came from' }] });\n if (p.isCancel(direction)) return;\n await analytics(['paths', prop.value], { ...flags, page: page.trim(), prev: direction === 'prev' });\n}\n\nasync function retentionStep(flags: Flags): Promise<void> {\n const prop = await pickProperty(flags, 'Retention of which property?');\n if (!prop) return;\n const period = await p.select<'week' | 'day'>({ message: 'Cohorts by', options: [{ value: 'week', label: 'Week', hint: 'last 12 weeks' }, { value: 'day', label: 'Day', hint: 'last 30 days' }] });\n if (p.isCancel(period)) return;\n await analytics(['retention', prop.value], { ...flags, period, days: period === 'week' ? '84' : '30' });\n}\n\nexport async function analyticsMenu(flags: Flags, mode: Mode): Promise<void> {\n for (;;) {\n const action = await p.select<AnalyticsAction>({ message: 'Analytics', options: analyticsOptions(mode) });\n if (p.isCancel(action) || action === 'back') return;\n switch (action) {\n case 'connect':\n await analytics(['connect'], flags);\n break;\n case 'list':\n await analytics([], flags);\n break;\n case 'report':\n await reportStep(flags, mode);\n break;\n case 'realtime': {\n const prop = await pickProperty(flags, 'Which property?');\n if (prop) await analytics(['realtime', prop.value], flags);\n break;\n }\n case 'funnel':\n await funnelStep(flags);\n break;\n case 'paths':\n await pathsStep(flags);\n break;\n case 'retention':\n await retentionStep(flags);\n break;\n case 'events': {\n const prop = await pickProperty(flags, 'Events of which property?');\n if (prop) await analytics(['events', prop.value], flags);\n break;\n }\n case 'create':\n await createStep(flags);\n break;\n case 'toggle': {\n const prop = await pickProperty(flags, 'Which property?');\n if (!prop) break;\n const verb = prop.status === 'paused' ? 'resume' : 'pause';\n const ok = await p.confirm({ message: `${verb === 'pause' ? 'Pause' : 'Resume'} ${prop.label}?` });\n if (ok === true) await analytics([verb, prop.value], flags);\n break;\n }\n }\n console.log();\n }\n}\n\n/** Allowed domains: the list, then set or clear one experiment's or property's origins. */\nexport async function domainsMenu(flags: Flags, mode: Mode, pickExperiment: (flags: Flags, message: string) => Promise<string | null>): Promise<void> {\n if (mode !== 'cloud') {\n p.log.info(CLOUD_ONLY);\n return;\n }\n await domains([], flags);\n console.log();\n const action = await p.select<'set' | 'clear' | 'back'>({\n message: 'Change one?',\n options: [\n { value: 'set', label: 'Limit to some domains', hint: 'subdomains are included' },\n { value: 'clear', label: 'Accept any origin again' },\n { value: 'back', label: 'Back' },\n ],\n });\n if (p.isCancel(action) || action === 'back') return;\n const kind = await p.select<'experiment' | 'property'>({ message: 'For what?', options: [{ value: 'experiment', label: 'An experiment' }, { value: 'property', label: 'An analytics property' }] });\n if (p.isCancel(kind)) return;\n const key = kind === 'experiment' ? await pickExperiment(flags, 'Which experiment?') : (await pickProperty(flags, 'Which property?'))?.value;\n if (!key) return;\n if (action === 'clear') return domains(['clear', kind, key], flags);\n const typed = await p.text({ message: 'Domains, separated by spaces or commas', placeholder: 'example.com app.example.com', validate: (v) => (parseHosts(v).length === 0 ? 'Type at least one domain' : undefined) });\n if (p.isCancel(typed)) return;\n await domains(['set', kind, key, ...parseHosts(typed)], flags);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAGA,YAAY,OAAO;AACnB,SAAS,qBAAqB;AAiBvB,IAAM,eAAe,CAAC,GAAG,IAAI,EAAE;AAC/B,IAAM,oBAAoB,CAAC,QAAQ,UAAU,WAAW,WAAW,UAAU,SAAS,MAAM;AAC5F,IAAM,gBAAgB;AAAA,EAC3B,EAAE,OAAO,SAAS,OAAO,eAAe;AAAA,EACxC,EAAE,OAAO,MAAM,OAAO,gBAAgB;AAAA,EACtC,EAAE,OAAO,OAAO,OAAO,iBAAiB;AAC1C;AAGO,SAAS,iBAAiB,OAAmC;AAClE,QAAM,QAAQ,MAAM,MAAM,GAAG,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,OAAO;AAClE,MAAI,MAAM,SAAS,EAAG,QAAO;AAC7B,MAAI,MAAM,SAAS,EAAG,QAAO;AAC7B,QAAM,MAAM,MAAM,KAAK,CAAC,MAAM,CAAC,kCAAkC,KAAK,CAAC,CAAC;AACxE,SAAO,MAAM,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AAC,EAAE,CAAC;AAClM,MAAM,WAAS,IAAI,EAAG;AACtB,QAAM,MAAM,SAAS,eAAe,MAAM,eAAe,OAAO,mBAAmB,KAAK,MAAM,aAAa,OAAO,iBAAiB,IAAI;AACvI,MAAI,CAAC,IAAK;AACV,MAAI,WAAW,QAAS,QAAO,QAAQ,CAAC,SAAS,MAAM,GAAG,GAAG,KAAK;AAClE,QAAM,QAAQ,MAAQ,OAAK,EAAE,SAAS,0CAA0C,aAAa,+BAA+B,UAAU,CAAC,MAAO,WAAW,CAAC,EAAE,WAAW,IAAI,6BAA6B,OAAW,CAAC;AACpN,MAAM,WAAS,KAAK,EAAG;AACvB,QAAM,QAAQ,CAAC,OAAO,MAAM,KAAK,GAAG,WAAW,KAAK,CAAC,GAAG,KAAK;AAC/D;","names":[]}
|
|
@@ -2,21 +2,21 @@
|
|
|
2
2
|
import {
|
|
3
3
|
propertyChoices,
|
|
4
4
|
propertySnippets
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-X2ICUB5B.js";
|
|
6
6
|
import {
|
|
7
7
|
addProperty,
|
|
8
8
|
afterAdded,
|
|
9
9
|
printLive
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-57IKDCOM.js";
|
|
11
|
+
import "./chunk-OTK6B4QC.js";
|
|
12
|
+
import "./chunk-SAH2BATZ.js";
|
|
13
13
|
import {
|
|
14
14
|
str
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-OH735OOS.js";
|
|
16
16
|
import {
|
|
17
17
|
RN_PACKAGE,
|
|
18
18
|
isReactNativeApp
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-LFEVNQ75.js";
|
|
20
20
|
import {
|
|
21
21
|
loadConfig
|
|
22
22
|
} from "./chunk-K5GDEVMA.js";
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
import {
|
|
28
28
|
cloudTarget,
|
|
29
29
|
request
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-W66MJG3R.js";
|
|
31
31
|
import {
|
|
32
32
|
c,
|
|
33
33
|
fail,
|
|
@@ -235,4 +235,4 @@ export {
|
|
|
235
235
|
wireProvider,
|
|
236
236
|
wireSource
|
|
237
237
|
};
|
|
238
|
-
//# sourceMappingURL=connect-
|
|
238
|
+
//# sourceMappingURL=connect-5TIWPEIS.js.map
|
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
parseExtras,
|
|
5
5
|
parseLimits,
|
|
6
6
|
parseWeights
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-BWYRU47V.js";
|
|
8
8
|
import "./chunk-K5GDEVMA.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-LOYPA5WN.js";
|
|
10
10
|
import "./chunk-6K3MHBT7.js";
|
|
11
11
|
import "./chunk-ZISCJRR5.js";
|
|
12
12
|
export {
|
|
@@ -15,4 +15,4 @@ export {
|
|
|
15
15
|
parseLimits,
|
|
16
16
|
parseWeights
|
|
17
17
|
};
|
|
18
|
-
//# sourceMappingURL=create-
|
|
18
|
+
//# sourceMappingURL=create-J2WN55LX.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
dev
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-RZGKAVA6.js";
|
|
5
5
|
import "./chunk-6K3MHBT7.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-W66MJG3R.js";
|
|
7
7
|
import "./chunk-ZISCJRR5.js";
|
|
8
8
|
export {
|
|
9
9
|
dev
|
|
10
10
|
};
|
|
11
|
-
//# sourceMappingURL=dev-
|
|
11
|
+
//# sourceMappingURL=dev-4UQ6KKB7.js.map
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
import {
|
|
3
3
|
appChecks,
|
|
4
4
|
doctor
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-KXER4ZZ3.js";
|
|
6
6
|
import "./chunk-4B2SGVPD.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-LFEVNQ75.js";
|
|
8
8
|
import "./chunk-HFIBLDUA.js";
|
|
9
9
|
import "./chunk-K5GDEVMA.js";
|
|
10
10
|
import "./chunk-6K3MHBT7.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-W66MJG3R.js";
|
|
12
12
|
import "./chunk-ZISCJRR5.js";
|
|
13
13
|
export {
|
|
14
14
|
appChecks,
|
|
15
15
|
doctor
|
|
16
16
|
};
|
|
17
|
-
//# sourceMappingURL=doctor-
|
|
17
|
+
//# sourceMappingURL=doctor-HYTPYAEW.js.map
|