splithub 0.4.1 → 0.4.3
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 +38 -3
- package/dist/{alerts-Q46GJETJ.js → alerts-HBGZM7QO.js} +3 -3
- package/dist/{analytics-BVBZVSCN.js → analytics-EMQ6D3OR.js} +4 -4
- package/dist/{chunk-GIYKIJKW.js → chunk-4K2OUYZJ.js} +2 -2
- package/dist/{chunk-MSYL3XZF.js → chunk-BC2MAJMM.js} +3 -3
- package/dist/{chunk-7DFMYJTC.js → chunk-BJ5LGERX.js} +7 -5
- package/dist/chunk-BJ5LGERX.js.map +1 -0
- package/dist/{chunk-NYWJZKOO.js → chunk-H7UWKOP3.js} +3 -3
- package/dist/{chunk-NYWJZKOO.js.map → chunk-H7UWKOP3.js.map} +1 -1
- package/dist/{chunk-J3DANPLP.js → chunk-HIUYWB24.js} +45 -5
- package/dist/chunk-HIUYWB24.js.map +1 -0
- package/dist/{chunk-SHKXD2C6.js → chunk-I5YPJR2U.js} +2 -2
- package/dist/{chunk-WMZLKY6J.js → chunk-J6ZZVUUR.js} +2 -2
- package/dist/{chunk-FDSNZRQQ.js → chunk-LMZVU72P.js} +2 -2
- package/dist/{chunk-SUUNAQAC.js → chunk-MY2IORYY.js} +2 -2
- package/dist/{chunk-QCFQFDEB.js → chunk-N7TBMCZY.js} +2 -2
- package/dist/{chunk-OXVLWFSD.js → chunk-SPWK5RVA.js} +7 -2
- package/dist/chunk-SPWK5RVA.js.map +1 -0
- package/dist/{chunk-VVJ4WRAB.js → chunk-UKBZMXXB.js} +2 -2
- package/dist/{chunk-VY342F4X.js → chunk-XDLMDC5U.js} +3 -3
- package/dist/{connect-BVXKCJNO.js → connect-RDKOJNRQ.js} +5 -5
- package/dist/{create-IBVKGS3D.js → create-TRKY4P4Y.js} +3 -3
- package/dist/{experiment-reports-LL2TFQQN.js → experiment-reports-UPT2SW7Y.js} +4 -4
- package/dist/index.js +14 -12
- package/dist/index.js.map +1 -1
- package/dist/{init-HRCQ5WAA.js → init-JEAYD5YD.js} +4 -4
- package/dist/{links-BQZLMGZJ.js → links-H4I57ZRT.js} +3 -3
- package/dist/{menu-7EZD5NDF.js → menu-JHG7QPAZ.js} +14 -14
- package/dist/{notes-BASGWNNX.js → notes-IQFQ67FF.js} +3 -3
- package/dist/{results-KC24ZZTX.js → results-PSSIKQ2V.js} +5 -5
- package/dist/{skills-J6X6DULX.js → skills-6ZBIPCCU.js} +3 -3
- package/dist/status-AVNRW6D2.js +17 -0
- package/package.json +23 -4
- package/dist/chunk-7DFMYJTC.js.map +0 -1
- package/dist/chunk-J3DANPLP.js.map +0 -1
- package/dist/chunk-OXVLWFSD.js.map +0 -1
- package/dist/status-SK5PPBPL.js +0 -17
- /package/dist/{alerts-Q46GJETJ.js.map → alerts-HBGZM7QO.js.map} +0 -0
- /package/dist/{analytics-BVBZVSCN.js.map → analytics-EMQ6D3OR.js.map} +0 -0
- /package/dist/{chunk-GIYKIJKW.js.map → chunk-4K2OUYZJ.js.map} +0 -0
- /package/dist/{chunk-MSYL3XZF.js.map → chunk-BC2MAJMM.js.map} +0 -0
- /package/dist/{chunk-SHKXD2C6.js.map → chunk-I5YPJR2U.js.map} +0 -0
- /package/dist/{chunk-WMZLKY6J.js.map → chunk-J6ZZVUUR.js.map} +0 -0
- /package/dist/{chunk-FDSNZRQQ.js.map → chunk-LMZVU72P.js.map} +0 -0
- /package/dist/{chunk-SUUNAQAC.js.map → chunk-MY2IORYY.js.map} +0 -0
- /package/dist/{chunk-QCFQFDEB.js.map → chunk-N7TBMCZY.js.map} +0 -0
- /package/dist/{chunk-VVJ4WRAB.js.map → chunk-UKBZMXXB.js.map} +0 -0
- /package/dist/{chunk-VY342F4X.js.map → chunk-XDLMDC5U.js.map} +0 -0
- /package/dist/{connect-BVXKCJNO.js.map → connect-RDKOJNRQ.js.map} +0 -0
- /package/dist/{create-IBVKGS3D.js.map → create-TRKY4P4Y.js.map} +0 -0
- /package/dist/{experiment-reports-LL2TFQQN.js.map → experiment-reports-UPT2SW7Y.js.map} +0 -0
- /package/dist/{init-HRCQ5WAA.js.map → init-JEAYD5YD.js.map} +0 -0
- /package/dist/{links-BQZLMGZJ.js.map → links-H4I57ZRT.js.map} +0 -0
- /package/dist/{menu-7EZD5NDF.js.map → menu-JHG7QPAZ.js.map} +0 -0
- /package/dist/{notes-BASGWNNX.js.map → notes-IQFQ67FF.js.map} +0 -0
- /package/dist/{results-KC24ZZTX.js.map → results-PSSIKQ2V.js.map} +0 -0
- /package/dist/{skills-J6X6DULX.js.map → skills-6ZBIPCCU.js.map} +0 -0
- /package/dist/{status-SK5PPBPL.js.map → status-AVNRW6D2.js.map} +0 -0
|
@@ -231,6 +231,9 @@ There are no variants and no verdicts: reports are counts.
|
|
|
231
231
|
- More reports (SplitHub Cloud), each with the same \`--days\` / \`--from --to\` / \`--filter\` flags:
|
|
232
232
|
- \`analytics funnel site --steps "page:/,event:Signup,goal:paid" [--within visit|7d|30d] [--by country]\`: visitors per step
|
|
233
233
|
in order, \`conversion\` (share of step 1) and \`dropoff\` (share lost since the step before).
|
|
234
|
+
- \`analytics funnels site\`: the funnels saved on the property (its Funnels tab, shared with the team).
|
|
235
|
+
\`--save Signup --steps "page:/,goal:signup" [--within 7d]\` saves one (a saved name updates it), \`--delete <id|name>\`
|
|
236
|
+
removes one, and \`analytics funnel site --funnel Signup\` runs it. Save a funnel the user will want to read again.
|
|
234
237
|
- \`analytics paths site --page /pricing [--prev]\`: where visits went next (or came from).
|
|
235
238
|
- \`analytics retention site [--start visit|event:<name>|goal:<key>] [--return visit|event:<name>] [--period day|week]\`: cohorts
|
|
236
239
|
and how many came back per period.
|
|
@@ -577,6 +580,8 @@ PATCH /v1/properties/<key> { status: running | paused, name?, goals? }
|
|
|
577
580
|
GET /v1/properties/<key>/summary ?from=&to= (YYYY-MM-DD) &<dimension>=a,b[&compare=previous|year|custom&cfrom=&cto=]: totals, days, goals, notes
|
|
578
581
|
GET /v1/properties/<key>/breakdown ?by=source|channel|page|event|goal|country|\u2026&goal=[&compare=\u2026]: rows
|
|
579
582
|
GET /v1/properties/<key>/funnel ?steps=page:/,event:Signup,goal:paid&within=visit|7d|30d[&by=]: steps with visitors, conversion, dropoff
|
|
583
|
+
?funnel=<id> runs a saved funnel (its steps and within)
|
|
584
|
+
GET|POST /v1/properties/<key>/funnels { name, steps[], within? } PATCH|DELETE /v1/properties/<key>/funnels/<id>
|
|
580
585
|
GET /v1/properties/<key>/paths ?page=/pricing&direction=next|prev: rows { value, visits }
|
|
581
586
|
GET /v1/properties/<key>/retention ?start=visit|event:<n>|goal:<k>&return=visit|event:<n>&period=day|week: cohorts
|
|
582
587
|
GET /v1/properties/<key>/realtime | /events?type=page|event | /props?name=&key= | /export.csv?by=|day (&raw=1)
|
|
@@ -665,7 +670,7 @@ Env: \`SPLITHUB_PROJECT_DIR\` (defaults to the MCP client's working directory),
|
|
|
665
670
|
| \`splithub_whoami\` | connected project and keys | |
|
|
666
671
|
| \`splithub_analytics\` | analytics properties; one property's totals, goals, top pages and sources; \`by\` a dimension | counts, never verdicts |
|
|
667
672
|
| \`splithub_analytics_events\` | the latest raw pageviews and events of a property | check tracking after wiring it |
|
|
668
|
-
| \`splithub_analytics_funnel\` / \`_paths\` / \`_retention\` / \`_realtime\` | funnels, next pages, cohorts, visitors now (cloud) | counts, never verdicts |
|
|
673
|
+
| \`splithub_analytics_funnel\` / \`_funnels\` / \`_paths\` / \`_retention\` / \`_realtime\` | funnels (run, save, list), next pages, cohorts, visitors now (cloud) | counts, never verdicts |
|
|
669
674
|
| \`splithub_analytics_connect\` | picks or creates a property and names it on the app's provider | \`wired.status\` none / many: add the snippet yourself |
|
|
670
675
|
| \`splithub_segments\` | saved report filters (cloud) | |
|
|
671
676
|
| \`splithub_notes\` | what happened on a day, per experiment, property or project: list / add / edit / delete (cloud) | add one when you ship |
|
|
@@ -819,4 +824,4 @@ export {
|
|
|
819
824
|
AGENTS_SECTION,
|
|
820
825
|
CURSOR_RULE
|
|
821
826
|
};
|
|
822
|
-
//# sourceMappingURL=chunk-
|
|
827
|
+
//# sourceMappingURL=chunk-SPWK5RVA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/skills-self-hosted.ts","../src/skills-ship.ts","../src/skills-analytics.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.splithub.io/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|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 and how many came back per period.\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- 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","// 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// 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\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.splithub.io/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.splithub.io\\`. 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.splithub.io/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\\` → \\`{ 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|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: cohorts\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.splithub.io/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';\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];\n\nexport const MCP_SERVER_ENTRY = { command: 'npx', args: ['-y', '@splithub/mcp'] };\n","export function configTemplate(project: string, mode: 'self' | 'cloud', key?: string): string {\n const storage = mode === 'self' ? `{ mode: 'self', endpoint: '/api/splithub' }` : `{ mode: 'cloud', key: ${key ? `'${key}'` : \"process.env.NEXT_PUBLIC_SPLITHUB_KEY ?? ''\"} }`;\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.\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- 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;A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ACP,MAAM,OAAO;AAAA,sBACO,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,WAMvB,MAAM,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQxB;AAEO,SAAS,yBAAyB,MAAc,YAAoB,SAAyB;AAClG,SAAO,eAAe,OAAO,oBAAoB,UAAU;AAAA,kBAC3C,IAAI;AAAA;AAAA;AAAA,YAGV,UAAU,SAAM,OAAO;AAAA;AAAA;AAAA;AAAA;AAKnC;AAEO,IAAM,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA4BvB,IAAM,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA,EAKzB,eAAe,QAAQ,qBAAqB,EAAE,CAAC;","names":[]}
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./chunk-ILEPMQNT.js";
|
|
10
10
|
import {
|
|
11
11
|
componentVariantTemplate
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-SPWK5RVA.js";
|
|
13
13
|
import {
|
|
14
14
|
requireConfig
|
|
15
15
|
} from "./chunk-MUDDASN6.js";
|
|
@@ -339,4 +339,4 @@ export {
|
|
|
339
339
|
parseLimits,
|
|
340
340
|
parseExtras
|
|
341
341
|
};
|
|
342
|
-
//# sourceMappingURL=chunk-
|
|
342
|
+
//# sourceMappingURL=chunk-UKBZMXXB.js.map
|
|
@@ -8,12 +8,12 @@ import {
|
|
|
8
8
|
import {
|
|
9
9
|
installSkills,
|
|
10
10
|
loadSkillFiles
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-H7UWKOP3.js";
|
|
12
12
|
import {
|
|
13
13
|
configTemplate,
|
|
14
14
|
nextMiddlewareTemplate,
|
|
15
15
|
nextRouteTemplate
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-SPWK5RVA.js";
|
|
17
17
|
import {
|
|
18
18
|
detectProject,
|
|
19
19
|
installCommand
|
|
@@ -418,4 +418,4 @@ function cancel2() {
|
|
|
418
418
|
export {
|
|
419
419
|
init
|
|
420
420
|
};
|
|
421
|
-
//# sourceMappingURL=chunk-
|
|
421
|
+
//# sourceMappingURL=chunk-XDLMDC5U.js.map
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
import {
|
|
3
3
|
propertyChoices,
|
|
4
4
|
propertySnippets
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-J6ZZVUUR.js";
|
|
6
6
|
import {
|
|
7
7
|
addProperty,
|
|
8
8
|
afterAdded,
|
|
9
9
|
printLive
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-BJ5LGERX.js";
|
|
11
11
|
import "./chunk-CAFWOX3S.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-LMZVU72P.js";
|
|
13
13
|
import {
|
|
14
14
|
str
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-HIUYWB24.js";
|
|
16
16
|
import {
|
|
17
17
|
loadConfig
|
|
18
18
|
} from "./chunk-ILEPMQNT.js";
|
|
@@ -222,4 +222,4 @@ export {
|
|
|
222
222
|
wireProvider,
|
|
223
223
|
wireSource
|
|
224
224
|
};
|
|
225
|
-
//# sourceMappingURL=connect-
|
|
225
|
+
//# sourceMappingURL=connect-RDKOJNRQ.js.map
|
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
parseExtras,
|
|
5
5
|
parseLimits,
|
|
6
6
|
parseWeights
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-UKBZMXXB.js";
|
|
8
8
|
import "./chunk-ILEPMQNT.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-SPWK5RVA.js";
|
|
10
10
|
import "./chunk-MUDDASN6.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-TRKY4P4Y.js.map
|
|
@@ -19,9 +19,9 @@ import {
|
|
|
19
19
|
timelineTable,
|
|
20
20
|
visitLength,
|
|
21
21
|
wantsSlice
|
|
22
|
-
} from "./chunk-
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-
|
|
22
|
+
} from "./chunk-BC2MAJMM.js";
|
|
23
|
+
import "./chunk-LMZVU72P.js";
|
|
24
|
+
import "./chunk-HIUYWB24.js";
|
|
25
25
|
import "./chunk-MUDDASN6.js";
|
|
26
26
|
import "./chunk-4OQEIP33.js";
|
|
27
27
|
import "./chunk-ZISCJRR5.js";
|
|
@@ -46,4 +46,4 @@ export {
|
|
|
46
46
|
visitLength,
|
|
47
47
|
wantsSlice
|
|
48
48
|
};
|
|
49
|
-
//# sourceMappingURL=experiment-reports-
|
|
49
|
+
//# sourceMappingURL=experiment-reports-UPT2SW7Y.js.map
|
package/dist/index.js
CHANGED
|
@@ -41,7 +41,8 @@ Analytics
|
|
|
41
41
|
splithub analytics connect pick or create a property and name it on the app's provider (or get the sh.js tag); [<id>] [--name "Site"] [--force]
|
|
42
42
|
splithub analytics [<id>] every property, or one: visitors, pages, sources, events, goals (--by page|source|channel|country|event|goal|variant --experiment <key>|trait --key <name>, --days 7, --from --to, --filter country=DE, --compare [year|<from>..<to>])
|
|
43
43
|
splithub analytics create --name "Site" add a property (id generated, like sh-x1h78w; live in the cloud at once, no push); pause|resume|archive|restore|remove|events <id>
|
|
44
|
-
splithub analytics funnel <id> --steps "page:/,event:Signup,goal:paid" visitors per step, conversion, drop-off (--within visit|7d|30d, --by <dimension>)
|
|
44
|
+
splithub analytics funnel <id> --steps "page:/,event:Signup,goal:paid" visitors per step, conversion, drop-off (--within visit|7d|30d, --by <dimension>, --funnel <name> runs a saved one)
|
|
45
|
+
splithub analytics funnels <id> saved funnels: --save <name> --steps "..." [--within 7d] (a saved name updates it), --delete <id|name>
|
|
45
46
|
splithub analytics paths <id> --page /pricing [--prev] where visitors go next (or came from)
|
|
46
47
|
splithub analytics retention <id> who comes back, per weekly cohort (--start visit|event:<name>|goal:<key>, --return visit|event:<name>, --period day|week)
|
|
47
48
|
splithub analytics realtime|props|export <id> visitors now; an event's props (--event <name> [--key <prop>]); CSV to stdout (--by <dimension>|day, --raw)
|
|
@@ -159,6 +160,7 @@ async function main() {
|
|
|
159
160
|
compare: { type: "string" },
|
|
160
161
|
segment: { type: "string" },
|
|
161
162
|
steps: { type: "string" },
|
|
163
|
+
funnel: { type: "string" },
|
|
162
164
|
within: { type: "string" },
|
|
163
165
|
page: { type: "string" },
|
|
164
166
|
prev: { type: "boolean", default: false },
|
|
@@ -205,25 +207,25 @@ async function main() {
|
|
|
205
207
|
return;
|
|
206
208
|
}
|
|
207
209
|
if (!command) {
|
|
208
|
-
if (process.stdin.isTTY && process.stdout.isTTY && !values.json) return (await import("./menu-
|
|
210
|
+
if (process.stdin.isTTY && process.stdout.isTTY && !values.json) return (await import("./menu-JHG7QPAZ.js")).menu(values);
|
|
209
211
|
console.log(HELP.trimEnd());
|
|
210
212
|
return;
|
|
211
213
|
}
|
|
212
214
|
switch (command) {
|
|
213
215
|
case "init":
|
|
214
|
-
return (await import("./init-
|
|
216
|
+
return (await import("./init-JEAYD5YD.js")).init(values);
|
|
215
217
|
case "create":
|
|
216
|
-
return (await import("./create-
|
|
218
|
+
return (await import("./create-TRKY4P4Y.js")).create(values);
|
|
217
219
|
case "start":
|
|
218
220
|
case "pause":
|
|
219
221
|
case "finish":
|
|
220
222
|
return (await import("./lifecycle-3GUIJ74P.js")).lifecycle(command, arg, values);
|
|
221
223
|
case "status":
|
|
222
|
-
return (await import("./status-
|
|
224
|
+
return (await import("./status-AVNRW6D2.js")).status(values);
|
|
223
225
|
case "results":
|
|
224
|
-
return (await import("./results-
|
|
226
|
+
return (await import("./results-PSSIKQ2V.js")).results(arg, values);
|
|
225
227
|
case "events":
|
|
226
|
-
return (await import("./experiment-reports-
|
|
228
|
+
return (await import("./experiment-reports-UPT2SW7Y.js")).experimentEvents(typeof values.experiment === "string" ? values.experiment : arg, values);
|
|
227
229
|
case "plan":
|
|
228
230
|
return (await import("./plan-44334RQS.js")).plan(arg, values);
|
|
229
231
|
case "refs":
|
|
@@ -241,13 +243,13 @@ async function main() {
|
|
|
241
243
|
return (await import("./holdout-JJEP6673.js")).holdout(arg, third, values);
|
|
242
244
|
case "analytics":
|
|
243
245
|
case "properties":
|
|
244
|
-
return (await import("./analytics-
|
|
246
|
+
return (await import("./analytics-EMQ6D3OR.js")).analytics(positionals.slice(1), values);
|
|
245
247
|
case "notes":
|
|
246
|
-
return (await import("./notes-
|
|
248
|
+
return (await import("./notes-IQFQ67FF.js")).notes(positionals.slice(1), values);
|
|
247
249
|
case "links":
|
|
248
|
-
return (await import("./links-
|
|
250
|
+
return (await import("./links-H4I57ZRT.js")).links(positionals.slice(1), values);
|
|
249
251
|
case "alerts":
|
|
250
|
-
return (await import("./alerts-
|
|
252
|
+
return (await import("./alerts-HBGZM7QO.js")).alerts(positionals.slice(1), values);
|
|
251
253
|
case "domains":
|
|
252
254
|
return (await import("./domains-CR34APOD.js")).domains(positionals.slice(1), values);
|
|
253
255
|
case "review":
|
|
@@ -259,7 +261,7 @@ async function main() {
|
|
|
259
261
|
case "update":
|
|
260
262
|
return (await import("./update-XF7HWJ3A.js")).update(values);
|
|
261
263
|
case "skills":
|
|
262
|
-
return (await import("./skills-
|
|
264
|
+
return (await import("./skills-6ZBIPCCU.js")).skills(values);
|
|
263
265
|
case "push":
|
|
264
266
|
return (await import("./push-L2IRGUDM.js")).push(values);
|
|
265
267
|
case "pull":
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { createRequire } from 'node:module';\nimport { parseArgs } from 'node:util';\nimport { errorJson, fail } from './errors';\nimport { c } from './ui';\nimport { offerUpdateAfterCommand, startUpdateCheck } from './update';\n\n// Started before the command so the registry answer is usually in by the time it ends.\nconst updateCheck = startUpdateCheck({ argv: process.argv.slice(2), env: process.env, stdinTTY: process.stdin.isTTY, stdoutTTY: process.stdout.isTTY });\n\nconst HELP = `\n${c.bold('splithub')} — experiments and analytics for agent-built apps\n\nUsage\n splithub the menu: experiments, analytics, links, alerts, notes, domains — pick what you need\n\nExperiments\n splithub init set up config, framework files, agent docs\n splithub create add an experiment (wizard, or flags for agents); its goal can be any event you track()\n splithub start|pause|finish <id>\n splithub status all experiments with a verdict headline\n splithub results <id> full verdict for one experiment\n a slice: --from --to (first-exposure days) --filter country=DE (country, region, city, device, os, browser,\n language, host, source, channel, utm_*, landing); one view: --by <dimension> (lift per segment),\n --timeline (per day), --engagement (bounce, visit length per variant), --events (every goal and event\n per variant, lift vs control); --export with --by <dimension> or --events writes CSV\n splithub events --experiment <id> latest raw events of an experiment (--type exposure|goal, --limit 50, --before <ms>, --from --to, --filter)\n splithub plan visitors an experiment needs (asks SplitHub Cloud, no account needed): --baseline 0.05 --mde 0.1 [--variants 2] [<id> for days at its traffic]\n splithub refs <id> files and lines that use the experiment and its goal\n splithub ship <id> --keep <v> finish, remove from the config and rewrite the code to the kept variant (--dry-run shows the diff)\n splithub remove <id> remove an experiment from the config (archived in the cloud when connected)\n splithub holdout set <percent> keep a share of visitors out of every experiment to measure the long-term impact (0-50; --goal); holdout off removes it\n splithub review [<id>] AI reviews stored in the cloud (Pro: at start, on verdict changes, on finish, or on demand)\n\nAnalytics\n splithub analytics connect pick or create a property and name it on the app's provider (or get the sh.js tag); [<id>] [--name \"Site\"] [--force]\n splithub analytics [<id>] every property, or one: visitors, pages, sources, events, goals (--by page|source|channel|country|event|goal|variant --experiment <key>|trait --key <name>, --days 7, --from --to, --filter country=DE, --compare [year|<from>..<to>])\n splithub analytics create --name \"Site\" add a property (id generated, like sh-x1h78w; live in the cloud at once, no push); pause|resume|archive|restore|remove|events <id>\n splithub analytics funnel <id> --steps \"page:/,event:Signup,goal:paid\" visitors per step, conversion, drop-off (--within visit|7d|30d, --by <dimension>)\n splithub analytics paths <id> --page /pricing [--prev] where visitors go next (or came from)\n splithub analytics retention <id> who comes back, per weekly cohort (--start visit|event:<name>|goal:<key>, --return visit|event:<name>, --period day|week)\n splithub analytics realtime|props|export <id> visitors now; an event's props (--event <name> [--key <prop>]); CSV to stdout (--by <dimension>|day, --raw)\n splithub analytics segments saved filters: --save <name> country=DE ..., --delete <id|name>; any report takes --segment <name>\n\nNotes, links, alerts, domains (SplitHub Cloud)\n splithub notes what happened on a day (--experiment <key> | --property <id>, --kind note|issue|win, --days 30)\n splithub notes add \"<text>\" [--kind issue|win] [--experiment <key> | --property <id>] [--day YYYY-MM-DD]; notes edit <id> \"<text>\", notes delete <id>\n splithub links short links and their clicks; links <id|slug> for one link's clicks\n splithub links create <url> [<url> ...] [--slug spring] [--name \"Spring sale\"] [--weights 70,30]; links edit|pause|resume|delete <id|slug>\n splithub alerts alert rules (they run on Pro) and recent alerts; alerts enable|disable|delete|test <id>\n splithub alerts add <condition> srm | winner | loser --lift 10 | exposures --visitors N | conversions --conversions N | duration --days N | no_events --hours 24\n | quota --percent 80 | usage --every 1000 | traffic_drop|traffic_spike --property <id> --percent 50\n | goal_silent --property <id> --goal <key> --hours 24 | event_count --property <id> [--event <name>] --count N [--repeat]\n (--experiment <key>, --name, --cooldown <hours>, --disabled, --pause, --finish, --drop-loser)\n splithub domains which domains may send events, per experiment and property; domains set experiment|property <id> <domain...>, domains clear experiment|property <id>\n\nProject\n splithub push [--dry-run] upload splithub.config.ts to SplitHub Cloud (--dry-run: check and show what would change)\n experiments the cloud has that the file lacks are kept; --prune removes them\n a key that already belonged to another experiment stops the push: --replace <keys> (new experiment, old numbers cleared) or --same <keys> (same experiment, numbers stay)\n splithub pull show the config stored in the cloud\n splithub report status and verdicts as Markdown, raw numbers when self-hosted (used by the GitHub workflow)\n splithub ci init write .github/workflows/splithub.yml (checks on PRs, results comment on a schedule)\n splithub dev [--url] [--hold] open the app with ?sh_debug=1 (console + panel: variants, reasons, events) and watch results\n splithub doctor check the installation\n splithub update [--yes] update splithub (and the project's @splithub/* packages) to the latest release; --json only reports\n splithub skills [--mcp] install / refresh agent skills (library, A/B testing, analytics, API, MCP, self-hosting, ship the winner, full loop); --mcp registers the MCP server\n splithub login [--project <name|id>] connect this directory to a SplitHub Cloud project (sign-in link, no secrets typed)\n splithub projects every directory connected on this machine and its project\n splithub whoami the project this directory is connected to\n splithub logout disconnect this directory\n\ncreate flags\n --kind value|component|redirect|mvt --id <key> --goal <goal> --status running|draft --name \"Hero headline\" --description \"...\" --yes\n value / component / redirect: --variants control,b --weights 50,50\n value: --value control=\"Old text\" --value b=\"New text\" (repeatable)\n redirect: --match /path --to control=/ --to b=/new (repeatable)\n mvt: --factor headline=old:Old,new:New --factor button=blue:#2563eb,green:#16a34a (repeatable; first level = control)\n limits: --traffic 50 (percent of visitors) --max-visitors 10000 --min-days 3 (opt-in days before a verdict, 0-30, default 0) --good-sample 5000 (visitors for a good sample) --start / --end <ISO date>\n metrics: --secondary pricing_view,signup --guardrail refunds:higher,errors (must not get worse; :higher when a rise is bad)\n layers: --layer checkout:0-50 (experiments in one layer never share a visitor; ranges must not overlap)\n\ninit flags\n --mode self|cloud --db sqlite|postgres|mysql|custom (self mode) --key pk_... --no-install --no-login --no-mcp --github-action --yes\n (cloud mode without a saved login prints a link; approve it in the browser and init continues)\n\nGlobal\n --url <url> results endpoint (default: $SPLITHUB_URL, the cloud API in cloud mode, else the local dev server)\n --token <token> admin token (self: $SPLITHUB_ADMIN_TOKEN) or project API key (cloud: $SPLITHUB_API_KEY, else the key saved by \"splithub login\")\n --api <url> cloud API base (default: https://go.splithub.io/v1 or $SPLITHUB_API)\n --json one line of JSON (for agents); errors are { error, code, hint? } and exit 1\n -v, --version\n -h, --help\n`;\n\nasync function main(): Promise<void> {\n // `--compare` alone means the period right before; it takes a value only when one follows (year, previous, from..to).\n const args = process.argv.slice(2).map((a, i, all) => (a === '--compare' && !/^(previous|year)$|\\.\\./.test(all[i + 1] ?? '') ? '--compare=previous' : a));\n const { values, positionals } = parseArgs({\n args,\n allowPositionals: true,\n options: {\n url: { type: 'string' },\n api: { type: 'string' },\n token: { type: 'string' },\n json: { type: 'boolean', default: false },\n yes: { type: 'boolean', short: 'y', default: false },\n help: { type: 'boolean', short: 'h', default: false },\n version: { type: 'boolean', short: 'v', default: false },\n mode: { type: 'string' },\n db: { type: 'string' },\n key: { type: 'string' },\n 'no-install': { type: 'boolean', default: false },\n 'no-login': { type: 'boolean', default: false },\n 'no-mcp': { type: 'boolean', default: false },\n 'no-open': { type: 'boolean', default: false },\n hold: { type: 'boolean', default: false },\n mcp: { type: 'boolean', default: false },\n force: { type: 'boolean', default: false },\n kind: { type: 'string' },\n id: { type: 'string' },\n variants: { type: 'string' },\n weights: { type: 'string' },\n goal: { type: 'string' },\n value: { type: 'string', multiple: true },\n match: { type: 'string' },\n to: { type: 'string', multiple: true },\n factor: { type: 'string', multiple: true },\n status: { type: 'string' },\n description: { type: 'string' },\n name: { type: 'string' },\n replace: { type: 'string' },\n same: { type: 'string' },\n traffic: { type: 'string' },\n 'max-visitors': { type: 'string' },\n 'min-days': { type: 'string' },\n 'good-sample': { type: 'string' },\n start: { type: 'string' },\n end: { type: 'string' },\n project: { type: 'string' },\n keep: { type: 'string' },\n 'dry-run': { type: 'boolean', default: false },\n prune: { type: 'boolean', default: false },\n baseline: { type: 'string' },\n mde: { type: 'string' },\n 'github-action': { type: 'boolean', default: false },\n secondary: { type: 'string', multiple: true },\n guardrail: { type: 'string', multiple: true },\n layer: { type: 'string' },\n goals: { type: 'string' },\n by: { type: 'string' },\n days: { type: 'string' },\n from: { type: 'string' },\n filter: { type: 'string', multiple: true },\n limit: { type: 'string' },\n compare: { type: 'string' },\n segment: { type: 'string' },\n steps: { type: 'string' },\n within: { type: 'string' },\n page: { type: 'string' },\n prev: { type: 'boolean', default: false },\n return: { type: 'string' },\n period: { type: 'string' },\n event: { type: 'string' },\n raw: { type: 'boolean', default: false },\n save: { type: 'string' },\n delete: { type: 'string' },\n day: { type: 'string' },\n property: { type: 'string' },\n experiment: { type: 'string' },\n slug: { type: 'string' },\n every: { type: 'string' },\n count: { type: 'string' },\n percent: { type: 'string' },\n hours: { type: 'string' },\n visitors: { type: 'string' },\n conversions: { type: 'string' },\n lift: { type: 'string' },\n 'min-visitors': { type: 'string' },\n cooldown: { type: 'string' },\n repeat: { type: 'boolean', default: false },\n disabled: { type: 'boolean', default: false },\n pause: { type: 'boolean', default: false },\n finish: { type: 'boolean', default: false },\n 'drop-loser': { type: 'boolean', default: false },\n timeline: { type: 'boolean', default: false },\n engagement: { type: 'boolean', default: false },\n events: { type: 'boolean', default: false },\n export: { type: 'boolean', default: false },\n type: { type: 'string' },\n before: { type: 'string' },\n },\n });\n const [command, arg, third] = positionals;\n if (values.help) {\n console.log(HELP.trimEnd());\n return;\n }\n if (values.version) {\n // dist/index.js sits next to the package.json that npm installed.\n const { version } = createRequire(import.meta.url)('../package.json') as { version: string };\n console.log(values.json ? JSON.stringify({ version }) : version);\n return;\n }\n if (!command) {\n // A terminal → the interactive menu; a pipe or an agent → the help text.\n if (process.stdin.isTTY && process.stdout.isTTY && !values.json) return (await import('./commands/menu')).menu(values);\n console.log(HELP.trimEnd());\n return;\n }\n // Each command loads on demand: `splithub status` never pays for the wizard or the TypeScript compiler.\n switch (command) {\n case 'init':\n return (await import('./commands/init')).init(values);\n case 'create':\n return (await import('./commands/create')).create(values);\n case 'start':\n case 'pause':\n case 'finish':\n return (await import('./commands/lifecycle')).lifecycle(command, arg, values);\n case 'status':\n return (await import('./commands/status')).status(values);\n case 'results':\n return (await import('./commands/results')).results(arg, values);\n case 'events':\n return (await import('./commands/experiment-reports')).experimentEvents(typeof values.experiment === 'string' ? values.experiment : arg, values);\n case 'plan':\n return (await import('./commands/plan')).plan(arg, values);\n case 'refs':\n return (await import('./commands/refs')).refs(arg, values);\n case 'remove':\n return (await import('./commands/remove')).remove(arg, values);\n case 'ship':\n return (await import('./commands/ship')).ship(arg, values);\n case 'report':\n return (await import('./commands/report')).report(values);\n case 'ci':\n if (arg !== 'init') fail('USAGE', `Unknown \"ci ${arg ?? ''}\".`, 'Run npx splithub ci init.');\n return (await import('./commands/ci')).ciInit(values);\n case 'holdout':\n return (await import('./commands/holdout')).holdout(arg, third, values);\n case 'analytics':\n case 'properties':\n return (await import('./commands/analytics')).analytics(positionals.slice(1), values);\n case 'notes':\n return (await import('./commands/notes')).notes(positionals.slice(1), values);\n case 'links':\n return (await import('./commands/links')).links(positionals.slice(1), values);\n case 'alerts':\n return (await import('./commands/alerts')).alerts(positionals.slice(1), values);\n case 'domains':\n return (await import('./commands/domains')).domains(positionals.slice(1), values);\n case 'review':\n return (await import('./commands/review')).review(arg, values);\n case 'dev':\n return (await import('./commands/dev')).dev(values);\n case 'doctor':\n return (await import('./commands/doctor')).doctor(values);\n case 'update':\n return (await import('./commands/update')).update(values);\n case 'skills':\n return (await import('./commands/skills')).skills(values);\n case 'push':\n return (await import('./commands/push')).push(values);\n case 'pull':\n return (await import('./commands/push')).pull(values);\n case 'login':\n return (await import('./commands/login')).login(values);\n case 'logout':\n return (await import('./commands/login')).logout(values);\n case 'whoami':\n return (await import('./commands/login')).whoami(values);\n case 'projects':\n return (await import('./commands/login')).projects(values);\n default:\n fail('USAGE', `Unknown command \"${command}\".`, 'Run npx splithub --help for the list.');\n }\n}\n\nmain()\n .then(() => offerUpdateAfterCommand(updateCheck))\n .catch((error: unknown) => {\n const body = errorJson(error);\n if (process.argv.includes('--json')) console.log(JSON.stringify(body));\n else {\n console.error(c.red(`error: ${body.error}`));\n if (body.scope && !body.error.includes(body.scope)) console.error(c.dim(`Missing scope: ${body.scope}`));\n if (body.hint) console.error(c.dim(body.hint));\n }\n process.exit(1);\n });\n"],"mappings":";;;;;;;;;;;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AA,IACxD,KAAK;AACH,cAAQ,MAAM,OAAO,qBAAkB,GAAG,OAAO,MAAM;AAAA,IACzD,KAAK;AACH,cAAQ,MAAM,OAAO,qBAAkB,GAAG,OAAO,MAAM;AAAA,IACzD,KAAK;AACH,cAAQ,MAAM,OAAO,qBAAkB,GAAG,SAAS,MAAM;AAAA,IAC3D;AACE,WAAK,SAAS,oBAAoB,OAAO,MAAM,uCAAuC;AAAA,EAC1F;AACF;AAEA,KAAK,EACF,KAAK,MAAM,wBAAwB,WAAW,CAAC,EAC/C,MAAM,CAAC,UAAmB;AACzB,QAAM,OAAO,UAAU,KAAK;AAC5B,MAAI,QAAQ,KAAK,SAAS,QAAQ,EAAG,SAAQ,IAAI,KAAK,UAAU,IAAI,CAAC;AAAA,OAChE;AACH,YAAQ,MAAM,EAAE,IAAI,UAAU,KAAK,KAAK,EAAE,CAAC;AAC3C,QAAI,KAAK,SAAS,CAAC,KAAK,MAAM,SAAS,KAAK,KAAK,EAAG,SAAQ,MAAM,EAAE,IAAI,kBAAkB,KAAK,KAAK,EAAE,CAAC;AACvG,QAAI,KAAK,KAAM,SAAQ,MAAM,EAAE,IAAI,KAAK,IAAI,CAAC;AAAA,EAC/C;AACA,UAAQ,KAAK,CAAC;AAChB,CAAC;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { createRequire } from 'node:module';\nimport { parseArgs } from 'node:util';\nimport { errorJson, fail } from './errors';\nimport { c } from './ui';\nimport { offerUpdateAfterCommand, startUpdateCheck } from './update';\n\n// Started before the command so the registry answer is usually in by the time it ends.\nconst updateCheck = startUpdateCheck({ argv: process.argv.slice(2), env: process.env, stdinTTY: process.stdin.isTTY, stdoutTTY: process.stdout.isTTY });\n\nconst HELP = `\n${c.bold('splithub')} — experiments and analytics for agent-built apps\n\nUsage\n splithub the menu: experiments, analytics, links, alerts, notes, domains — pick what you need\n\nExperiments\n splithub init set up config, framework files, agent docs\n splithub create add an experiment (wizard, or flags for agents); its goal can be any event you track()\n splithub start|pause|finish <id>\n splithub status all experiments with a verdict headline\n splithub results <id> full verdict for one experiment\n a slice: --from --to (first-exposure days) --filter country=DE (country, region, city, device, os, browser,\n language, host, source, channel, utm_*, landing); one view: --by <dimension> (lift per segment),\n --timeline (per day), --engagement (bounce, visit length per variant), --events (every goal and event\n per variant, lift vs control); --export with --by <dimension> or --events writes CSV\n splithub events --experiment <id> latest raw events of an experiment (--type exposure|goal, --limit 50, --before <ms>, --from --to, --filter)\n splithub plan visitors an experiment needs (asks SplitHub Cloud, no account needed): --baseline 0.05 --mde 0.1 [--variants 2] [<id> for days at its traffic]\n splithub refs <id> files and lines that use the experiment and its goal\n splithub ship <id> --keep <v> finish, remove from the config and rewrite the code to the kept variant (--dry-run shows the diff)\n splithub remove <id> remove an experiment from the config (archived in the cloud when connected)\n splithub holdout set <percent> keep a share of visitors out of every experiment to measure the long-term impact (0-50; --goal); holdout off removes it\n splithub review [<id>] AI reviews stored in the cloud (Pro: at start, on verdict changes, on finish, or on demand)\n\nAnalytics\n splithub analytics connect pick or create a property and name it on the app's provider (or get the sh.js tag); [<id>] [--name \"Site\"] [--force]\n splithub analytics [<id>] every property, or one: visitors, pages, sources, events, goals (--by page|source|channel|country|event|goal|variant --experiment <key>|trait --key <name>, --days 7, --from --to, --filter country=DE, --compare [year|<from>..<to>])\n splithub analytics create --name \"Site\" add a property (id generated, like sh-x1h78w; live in the cloud at once, no push); pause|resume|archive|restore|remove|events <id>\n splithub analytics funnel <id> --steps \"page:/,event:Signup,goal:paid\" visitors per step, conversion, drop-off (--within visit|7d|30d, --by <dimension>, --funnel <name> runs a saved one)\n splithub analytics funnels <id> saved funnels: --save <name> --steps \"...\" [--within 7d] (a saved name updates it), --delete <id|name>\n splithub analytics paths <id> --page /pricing [--prev] where visitors go next (or came from)\n splithub analytics retention <id> who comes back, per weekly cohort (--start visit|event:<name>|goal:<key>, --return visit|event:<name>, --period day|week)\n splithub analytics realtime|props|export <id> visitors now; an event's props (--event <name> [--key <prop>]); CSV to stdout (--by <dimension>|day, --raw)\n splithub analytics segments saved filters: --save <name> country=DE ..., --delete <id|name>; any report takes --segment <name>\n\nNotes, links, alerts, domains (SplitHub Cloud)\n splithub notes what happened on a day (--experiment <key> | --property <id>, --kind note|issue|win, --days 30)\n splithub notes add \"<text>\" [--kind issue|win] [--experiment <key> | --property <id>] [--day YYYY-MM-DD]; notes edit <id> \"<text>\", notes delete <id>\n splithub links short links and their clicks; links <id|slug> for one link's clicks\n splithub links create <url> [<url> ...] [--slug spring] [--name \"Spring sale\"] [--weights 70,30]; links edit|pause|resume|delete <id|slug>\n splithub alerts alert rules (they run on Pro) and recent alerts; alerts enable|disable|delete|test <id>\n splithub alerts add <condition> srm | winner | loser --lift 10 | exposures --visitors N | conversions --conversions N | duration --days N | no_events --hours 24\n | quota --percent 80 | usage --every 1000 | traffic_drop|traffic_spike --property <id> --percent 50\n | goal_silent --property <id> --goal <key> --hours 24 | event_count --property <id> [--event <name>] --count N [--repeat]\n (--experiment <key>, --name, --cooldown <hours>, --disabled, --pause, --finish, --drop-loser)\n splithub domains which domains may send events, per experiment and property; domains set experiment|property <id> <domain...>, domains clear experiment|property <id>\n\nProject\n splithub push [--dry-run] upload splithub.config.ts to SplitHub Cloud (--dry-run: check and show what would change)\n experiments the cloud has that the file lacks are kept; --prune removes them\n a key that already belonged to another experiment stops the push: --replace <keys> (new experiment, old numbers cleared) or --same <keys> (same experiment, numbers stay)\n splithub pull show the config stored in the cloud\n splithub report status and verdicts as Markdown, raw numbers when self-hosted (used by the GitHub workflow)\n splithub ci init write .github/workflows/splithub.yml (checks on PRs, results comment on a schedule)\n splithub dev [--url] [--hold] open the app with ?sh_debug=1 (console + panel: variants, reasons, events) and watch results\n splithub doctor check the installation\n splithub update [--yes] update splithub (and the project's @splithub/* packages) to the latest release; --json only reports\n splithub skills [--mcp] install / refresh agent skills (library, A/B testing, analytics, API, MCP, self-hosting, ship the winner, full loop); --mcp registers the MCP server\n splithub login [--project <name|id>] connect this directory to a SplitHub Cloud project (sign-in link, no secrets typed)\n splithub projects every directory connected on this machine and its project\n splithub whoami the project this directory is connected to\n splithub logout disconnect this directory\n\ncreate flags\n --kind value|component|redirect|mvt --id <key> --goal <goal> --status running|draft --name \"Hero headline\" --description \"...\" --yes\n value / component / redirect: --variants control,b --weights 50,50\n value: --value control=\"Old text\" --value b=\"New text\" (repeatable)\n redirect: --match /path --to control=/ --to b=/new (repeatable)\n mvt: --factor headline=old:Old,new:New --factor button=blue:#2563eb,green:#16a34a (repeatable; first level = control)\n limits: --traffic 50 (percent of visitors) --max-visitors 10000 --min-days 3 (opt-in days before a verdict, 0-30, default 0) --good-sample 5000 (visitors for a good sample) --start / --end <ISO date>\n metrics: --secondary pricing_view,signup --guardrail refunds:higher,errors (must not get worse; :higher when a rise is bad)\n layers: --layer checkout:0-50 (experiments in one layer never share a visitor; ranges must not overlap)\n\ninit flags\n --mode self|cloud --db sqlite|postgres|mysql|custom (self mode) --key pk_... --no-install --no-login --no-mcp --github-action --yes\n (cloud mode without a saved login prints a link; approve it in the browser and init continues)\n\nGlobal\n --url <url> results endpoint (default: $SPLITHUB_URL, the cloud API in cloud mode, else the local dev server)\n --token <token> admin token (self: $SPLITHUB_ADMIN_TOKEN) or project API key (cloud: $SPLITHUB_API_KEY, else the key saved by \"splithub login\")\n --api <url> cloud API base (default: https://go.splithub.io/v1 or $SPLITHUB_API)\n --json one line of JSON (for agents); errors are { error, code, hint? } and exit 1\n -v, --version\n -h, --help\n`;\n\nasync function main(): Promise<void> {\n // `--compare` alone means the period right before; it takes a value only when one follows (year, previous, from..to).\n const args = process.argv.slice(2).map((a, i, all) => (a === '--compare' && !/^(previous|year)$|\\.\\./.test(all[i + 1] ?? '') ? '--compare=previous' : a));\n const { values, positionals } = parseArgs({\n args,\n allowPositionals: true,\n options: {\n url: { type: 'string' },\n api: { type: 'string' },\n token: { type: 'string' },\n json: { type: 'boolean', default: false },\n yes: { type: 'boolean', short: 'y', default: false },\n help: { type: 'boolean', short: 'h', default: false },\n version: { type: 'boolean', short: 'v', default: false },\n mode: { type: 'string' },\n db: { type: 'string' },\n key: { type: 'string' },\n 'no-install': { type: 'boolean', default: false },\n 'no-login': { type: 'boolean', default: false },\n 'no-mcp': { type: 'boolean', default: false },\n 'no-open': { type: 'boolean', default: false },\n hold: { type: 'boolean', default: false },\n mcp: { type: 'boolean', default: false },\n force: { type: 'boolean', default: false },\n kind: { type: 'string' },\n id: { type: 'string' },\n variants: { type: 'string' },\n weights: { type: 'string' },\n goal: { type: 'string' },\n value: { type: 'string', multiple: true },\n match: { type: 'string' },\n to: { type: 'string', multiple: true },\n factor: { type: 'string', multiple: true },\n status: { type: 'string' },\n description: { type: 'string' },\n name: { type: 'string' },\n replace: { type: 'string' },\n same: { type: 'string' },\n traffic: { type: 'string' },\n 'max-visitors': { type: 'string' },\n 'min-days': { type: 'string' },\n 'good-sample': { type: 'string' },\n start: { type: 'string' },\n end: { type: 'string' },\n project: { type: 'string' },\n keep: { type: 'string' },\n 'dry-run': { type: 'boolean', default: false },\n prune: { type: 'boolean', default: false },\n baseline: { type: 'string' },\n mde: { type: 'string' },\n 'github-action': { type: 'boolean', default: false },\n secondary: { type: 'string', multiple: true },\n guardrail: { type: 'string', multiple: true },\n layer: { type: 'string' },\n goals: { type: 'string' },\n by: { type: 'string' },\n days: { type: 'string' },\n from: { type: 'string' },\n filter: { type: 'string', multiple: true },\n limit: { type: 'string' },\n compare: { type: 'string' },\n segment: { type: 'string' },\n steps: { type: 'string' },\n funnel: { type: 'string' },\n within: { type: 'string' },\n page: { type: 'string' },\n prev: { type: 'boolean', default: false },\n return: { type: 'string' },\n period: { type: 'string' },\n event: { type: 'string' },\n raw: { type: 'boolean', default: false },\n save: { type: 'string' },\n delete: { type: 'string' },\n day: { type: 'string' },\n property: { type: 'string' },\n experiment: { type: 'string' },\n slug: { type: 'string' },\n every: { type: 'string' },\n count: { type: 'string' },\n percent: { type: 'string' },\n hours: { type: 'string' },\n visitors: { type: 'string' },\n conversions: { type: 'string' },\n lift: { type: 'string' },\n 'min-visitors': { type: 'string' },\n cooldown: { type: 'string' },\n repeat: { type: 'boolean', default: false },\n disabled: { type: 'boolean', default: false },\n pause: { type: 'boolean', default: false },\n finish: { type: 'boolean', default: false },\n 'drop-loser': { type: 'boolean', default: false },\n timeline: { type: 'boolean', default: false },\n engagement: { type: 'boolean', default: false },\n events: { type: 'boolean', default: false },\n export: { type: 'boolean', default: false },\n type: { type: 'string' },\n before: { type: 'string' },\n },\n });\n const [command, arg, third] = positionals;\n if (values.help) {\n console.log(HELP.trimEnd());\n return;\n }\n if (values.version) {\n // dist/index.js sits next to the package.json that npm installed.\n const { version } = createRequire(import.meta.url)('../package.json') as { version: string };\n console.log(values.json ? JSON.stringify({ version }) : version);\n return;\n }\n if (!command) {\n // A terminal → the interactive menu; a pipe or an agent → the help text.\n if (process.stdin.isTTY && process.stdout.isTTY && !values.json) return (await import('./commands/menu')).menu(values);\n console.log(HELP.trimEnd());\n return;\n }\n // Each command loads on demand: `splithub status` never pays for the wizard or the TypeScript compiler.\n switch (command) {\n case 'init':\n return (await import('./commands/init')).init(values);\n case 'create':\n return (await import('./commands/create')).create(values);\n case 'start':\n case 'pause':\n case 'finish':\n return (await import('./commands/lifecycle')).lifecycle(command, arg, values);\n case 'status':\n return (await import('./commands/status')).status(values);\n case 'results':\n return (await import('./commands/results')).results(arg, values);\n case 'events':\n return (await import('./commands/experiment-reports')).experimentEvents(typeof values.experiment === 'string' ? values.experiment : arg, values);\n case 'plan':\n return (await import('./commands/plan')).plan(arg, values);\n case 'refs':\n return (await import('./commands/refs')).refs(arg, values);\n case 'remove':\n return (await import('./commands/remove')).remove(arg, values);\n case 'ship':\n return (await import('./commands/ship')).ship(arg, values);\n case 'report':\n return (await import('./commands/report')).report(values);\n case 'ci':\n if (arg !== 'init') fail('USAGE', `Unknown \"ci ${arg ?? ''}\".`, 'Run npx splithub ci init.');\n return (await import('./commands/ci')).ciInit(values);\n case 'holdout':\n return (await import('./commands/holdout')).holdout(arg, third, values);\n case 'analytics':\n case 'properties':\n return (await import('./commands/analytics')).analytics(positionals.slice(1), values);\n case 'notes':\n return (await import('./commands/notes')).notes(positionals.slice(1), values);\n case 'links':\n return (await import('./commands/links')).links(positionals.slice(1), values);\n case 'alerts':\n return (await import('./commands/alerts')).alerts(positionals.slice(1), values);\n case 'domains':\n return (await import('./commands/domains')).domains(positionals.slice(1), values);\n case 'review':\n return (await import('./commands/review')).review(arg, values);\n case 'dev':\n return (await import('./commands/dev')).dev(values);\n case 'doctor':\n return (await import('./commands/doctor')).doctor(values);\n case 'update':\n return (await import('./commands/update')).update(values);\n case 'skills':\n return (await import('./commands/skills')).skills(values);\n case 'push':\n return (await import('./commands/push')).push(values);\n case 'pull':\n return (await import('./commands/push')).pull(values);\n case 'login':\n return (await import('./commands/login')).login(values);\n case 'logout':\n return (await import('./commands/login')).logout(values);\n case 'whoami':\n return (await import('./commands/login')).whoami(values);\n case 'projects':\n return (await import('./commands/login')).projects(values);\n default:\n fail('USAGE', `Unknown command \"${command}\".`, 'Run npx splithub --help for the list.');\n }\n}\n\nmain()\n .then(() => offerUpdateAfterCommand(updateCheck))\n .catch((error: unknown) => {\n const body = errorJson(error);\n if (process.argv.includes('--json')) console.log(JSON.stringify(body));\n else {\n console.error(c.red(`error: ${body.error}`));\n if (body.scope && !body.error.includes(body.scope)) console.error(c.dim(`Missing scope: ${body.scope}`));\n if (body.hint) console.error(c.dim(body.hint));\n }\n process.exit(1);\n });\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,qBAAqB;AAC9B,SAAS,iBAAiB;AAM1B,IAAM,cAAc,iBAAiB,EAAE,MAAM,QAAQ,KAAK,MAAM,CAAC,GAAG,KAAK,QAAQ,KAAK,UAAU,QAAQ,MAAM,OAAO,WAAW,QAAQ,OAAO,MAAM,CAAC;AAEtJ,IAAM,OAAO;AAAA,EACX,EAAE,KAAK,UAAU,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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AoB,OAAO,MAAM,uCAAuC;AAAA,EAC1F;AACF;AAEA,KAAK,EACF,KAAK,MAAM,wBAAwB,WAAW,CAAC,EAC/C,MAAM,CAAC,UAAmB;AACzB,QAAM,OAAO,UAAU,KAAK;AAC5B,MAAI,QAAQ,KAAK,SAAS,QAAQ,EAAG,SAAQ,IAAI,KAAK,UAAU,IAAI,CAAC;AAAA,OAChE;AACH,YAAQ,MAAM,EAAE,IAAI,UAAU,KAAK,KAAK,EAAE,CAAC;AAC3C,QAAI,KAAK,SAAS,CAAC,KAAK,MAAM,SAAS,KAAK,KAAK,EAAG,SAAQ,MAAM,EAAE,IAAI,kBAAkB,KAAK,KAAK,EAAE,CAAC;AACvG,QAAI,KAAK,KAAM,SAAQ,MAAM,EAAE,IAAI,KAAK,IAAI,CAAC;AAAA,EAC/C;AACA,UAAQ,KAAK,CAAC;AAChB,CAAC;","names":[]}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
init
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-XDLMDC5U.js";
|
|
5
5
|
import "./chunk-RMWW4YMN.js";
|
|
6
6
|
import "./chunk-NFZZSF4M.js";
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-H7UWKOP3.js";
|
|
8
|
+
import "./chunk-SPWK5RVA.js";
|
|
9
9
|
import "./chunk-MUDDASN6.js";
|
|
10
10
|
import "./chunk-4OQEIP33.js";
|
|
11
11
|
import "./chunk-ZISCJRR5.js";
|
|
12
12
|
export {
|
|
13
13
|
init
|
|
14
14
|
};
|
|
15
|
-
//# sourceMappingURL=init-
|
|
15
|
+
//# sourceMappingURL=init-JEAYD5YD.js.map
|
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
findLink,
|
|
5
5
|
links,
|
|
6
6
|
nameFromUrl
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-I5YPJR2U.js";
|
|
8
|
+
import "./chunk-HIUYWB24.js";
|
|
9
9
|
import "./chunk-MUDDASN6.js";
|
|
10
10
|
import "./chunk-4OQEIP33.js";
|
|
11
11
|
import "./chunk-ZISCJRR5.js";
|
|
@@ -15,4 +15,4 @@ export {
|
|
|
15
15
|
links,
|
|
16
16
|
nameFromUrl
|
|
17
17
|
};
|
|
18
|
-
//# sourceMappingURL=links-
|
|
18
|
+
//# sourceMappingURL=links-H4I57ZRT.js.map
|