@whisperr/wizard 0.1.10 → 0.1.11

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.
Files changed (2) hide show
  1. package/dist/index.js +66 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -6,8 +6,8 @@ import * as p from "@clack/prompts";
6
6
 
7
7
  // src/core/config.ts
8
8
  var DEFAULT_API_BASE = "https://api.whisperr.net";
9
- var DEFAULT_MODEL = "claude-opus-4-8";
10
- var DEFAULT_EFFORT = "low";
9
+ var DEFAULT_MODEL = "claude-sonnet-4-6";
10
+ var DEFAULT_EFFORT = "high";
11
11
  var EFFORT_LEVELS = ["low", "medium", "high", "xhigh", "max"];
12
12
  function resolveEffort() {
13
13
  const raw = (process.env.WHISPERR_WIZARD_EFFORT ?? "").toLowerCase();
@@ -1022,6 +1022,31 @@ describe the SAME person, so they belong on the SAME surface. If you wired
1022
1022
  account_created into one controller and are about to put identify() in a
1023
1023
  different one, stop \u2014 that's the tell you've split the subject. Co-locate them.
1024
1024
 
1025
+ WHAT THE EVENT MEANS \u2014 place by SEMANTICS, not by keyword. This is where most
1026
+ mistakes happen. An event names a SPECIFIC moment, not "something happened
1027
+ nearby." For each event, before you place it:
1028
+ - Model the exact transition. \`subscription_started\` is the FIRST subscription,
1029
+ NOT every payment \u2014 renewals, retries, and reactivations are DIFFERENT events.
1030
+ Firing one event on a path that also handles the other cases is a real bug.
1031
+ - Read the control flow and find the branch that separates look-alike cases.
1032
+ Payment/callback handlers routinely route initial vs recurring/renewal, success
1033
+ vs retry, trial vs paid through ONE function. Key the event to the right branch
1034
+ (e.g. a \`RENEW_CARD\` / \`is_recurring\` / \`type\` check), or branch yourself and
1035
+ emit the correct event per case. Do not drop one event on the shared success
1036
+ line and move on \u2014 open the function and see which cases it actually covers.
1037
+ - Read the codebase's own flags literally. A field like \`type: promo|standard\`
1038
+ is pricing tier, not lifecycle \u2014 confirm what a flag means before keying on it.
1039
+ - Capture the discriminators as properties. The fields that tell cases apart \u2014
1040
+ charge_type, is_recurring, payment_source/gateway, amount, plan, currency \u2014 are
1041
+ exactly what makes the event usable for churn (a failed RENEWAL is a churn
1042
+ signal; a failed first charge is not). If the code sets such a field right
1043
+ there (e.g. \`type => 'initial'\`), pass it. A billing event without them is
1044
+ half-blind.
1045
+ - Cover the whole lifecycle. Two gateways each with an initial and a recurring
1046
+ path is FOUR call sites \u2014 instrument all of them. A recurring/secondary
1047
+ callback with no events is a churn blind spot. If you deliberately skip a path,
1048
+ say so in the summary.
1049
+
1025
1050
  Every step costs time and the user is watching. Work FAST and DECISIVELY.
1026
1051
 
1027
1052
  EFFICIENCY \u2014 non-negotiable:
@@ -1222,6 +1247,44 @@ ${core.summary}`);
1222
1247
  eventsComplete = !events.maxedOut;
1223
1248
  if (events.summary) summaries.push(`Events:
1224
1249
  ${events.summary}`);
1250
+ }
1251
+ if (core.ok) {
1252
+ progress?.onPhase?.("Reviewing & correcting placements");
1253
+ const reviewPrompt = [
1254
+ `You wired the Whisperr ${playbook.target.displayName} SDK into this repo.`,
1255
+ "Now AUDIT YOUR OWN WORK and fix mistakes before finishing.",
1256
+ `Project root: ${repoPath}`,
1257
+ "",
1258
+ "Run `git diff` and read the surrounding code to see exactly what you added.",
1259
+ "For every identify() and track() call, verify \u2014 and FIX in place:",
1260
+ "1. Subject \u2014 keys to the END USER, never an admin/staff/operator/seller.",
1261
+ " identify() sits on the SAME surface as account_created (same person).",
1262
+ "2. Lifecycle \u2014 the event fires ONLY on its real moment. A 'first time'",
1263
+ " event (e.g. subscription_started) must NOT fire on a renewal/recurring",
1264
+ " path; look for RENEW_CARD / is_recurring / type branches in the SAME",
1265
+ " handler. If one path handles both cases, branch and emit the right",
1266
+ " event per case.",
1267
+ "3. Discriminators \u2014 billing/subscription events carry the properties that",
1268
+ " tell cases apart when the code exposes them (charge_type / is_recurring",
1269
+ " / payment_source / amount / plan). Add the ones you missed.",
1270
+ "4. Coverage \u2014 every gateway/callback path that should emit an event does;",
1271
+ " no recurring or secondary path left as a dead zone.",
1272
+ "Change ONLY what is genuinely wrong or incomplete \u2014 do not churn correct",
1273
+ "calls or re-explore the whole repo. Be surgical. End with a one-line,",
1274
+ "plain-text note of what you corrected, or 'No corrections needed.'."
1275
+ ].join("\n");
1276
+ const review = await runPass({
1277
+ prompt: reviewPrompt,
1278
+ systemPrompt: systemPrompt9,
1279
+ repoPath,
1280
+ model: config.model,
1281
+ effort: config.effort,
1282
+ maxTurns: 25,
1283
+ progress
1284
+ });
1285
+ costUsd += review.costUsd;
1286
+ if (review.summary) summaries.push(`Review:
1287
+ ${review.summary}`);
1225
1288
  }
1226
1289
  return {
1227
1290
  summary: summaries.join("\n\n"),
@@ -1827,7 +1890,7 @@ async function main() {
1827
1890
  return;
1828
1891
  }
1829
1892
  if ("version" in parsed) {
1830
- console.log("0.1.10");
1893
+ console.log("0.1.11");
1831
1894
  return;
1832
1895
  }
1833
1896
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whisperr/wizard",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "description": "Whisperr Wizard — one command to integrate the Whisperr SDK into your app. Authenticates with your onboarded account and uses an AI coding agent to wire up identify() and your business events automatically.",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,