burnwatch 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "burnwatch",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "Passive cost memory for vibe coding — detects paid services, tracks spend, injects budget context into your AI coding sessions.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -0,0 +1,153 @@
1
+ ---
2
+ name: burnwatch-interview
3
+ description: Conversational service interview — the agent walks the user through confirming plans, budgets, and API keys for each detected service. Use after burnwatch init when running in an agent context (non-TTY), or when the user says /burnwatch-interview.
4
+ user-invocable: true
5
+ allowed-tools: Read, Bash, Glob, Grep
6
+ ---
7
+
8
+ # /burnwatch-interview — Agent-Driven Service Interview
9
+
10
+ You are the interviewer. burnwatch has auto-detected services and applied defaults — your job is to walk the user through confirming or correcting each one in natural conversation.
11
+
12
+ ## Step 1: Get the current state
13
+
14
+ Run this to get the structured state of all detected services:
15
+
16
+ ```bash
17
+ cd $PROJECT_ROOT && node ./node_modules/.bin/burnwatch interview --json
18
+ ```
19
+
20
+ If burnwatch is installed globally or via npx, use that path instead. Parse the JSON output.
21
+
22
+ ## Step 2: Present the overview
23
+
24
+ Start with a brief summary:
25
+
26
+ > I found **N services** in your project. Right now they're configured with defaults — let me walk you through each one so we get accurate tracking.
27
+ >
28
+ > **Current state:** X with API keys (LIVE), Y estimated, Z with no tracking (BLIND)
29
+ > **Total budget:** $NNN/mo (all defaults — let's fix that)
30
+
31
+ ## Step 3: Interview by risk group
32
+
33
+ Walk through services grouped by risk (the JSON is pre-sorted). For each group:
34
+
35
+ ### LLM / AI Services (ask first — highest variable cost)
36
+ - These are the most important to get right
37
+ - Ask: "What's your actual monthly spend on Anthropic/OpenAI? The default is $100 — too high? too low?"
38
+ - If they have an admin API key, offer to probe: "If you give me your admin key I can check your actual spend"
39
+
40
+ ### Usage-Based Services (Scrapfly, Browserbase, Stripe)
41
+ - Credit-pool services: "What Scrapfly plan are you on? The probe detected Pro with 1M credits — correct?"
42
+ - Ask about actual budget, not just plan cost
43
+
44
+ ### Infrastructure (Vercel, Supabase, AWS)
45
+ - Tiered services: "Are you on Supabase Free or Pro? This matters because Pro is $25/mo with overages"
46
+
47
+ ### Flat-Rate / Free Tier
48
+ - These are usually quick: "PostHog and Inngest are set to Free/$0 — correct? Moving on."
49
+ - Don't dwell on these unless the user has something to say
50
+
51
+ ## Step 4: For each service, use `burnwatch configure`
52
+
53
+ After the user confirms or corrects, write it back:
54
+
55
+ ```bash
56
+ burnwatch configure --service <id> --plan "<plan name>" --budget <N>
57
+ ```
58
+
59
+ If they provide an API key:
60
+ ```bash
61
+ burnwatch configure --service <id> --key "<KEY>" --budget <N>
62
+ ```
63
+
64
+ To exclude a service:
65
+ ```bash
66
+ burnwatch configure --service <id> --exclude
67
+ ```
68
+
69
+ The configure command outputs JSON confirming what was written. Check the `success` field.
70
+
71
+ ## Step 5: Show the result
72
+
73
+ After all services are configured, run:
74
+
75
+ ```bash
76
+ burnwatch status
77
+ ```
78
+
79
+ Present the brief and celebrate what's tracked vs what's still blind.
80
+
81
+ ## Key Behaviors
82
+
83
+ - **Group questions.** Don't ask 14 questions one at a time. "Your LLMs — Anthropic and OpenAI. What plans and budgets?" is one question, not two.
84
+ - **Lead with what you know.** If the probe detected their Scrapfly plan, say "I detected you're on Pro with 1M credits and you've used 250K so far. Budget $100/mo? [Y/n]" — don't make them scroll through options.
85
+ - **Be brief for obvious services.** Free tier PostHog? "PostHog: Free, $0. Next."
86
+ - **Highlight what matters.** If Anthropic is at $87 of a $100 budget, say so. If Scrapfly credits are 85% consumed, flag it.
87
+ - **Use the probe data.** The interview JSON includes `probeResult` for services where we got live data. Show it: "Your Anthropic spend this month is $47.23 so far."
88
+ - **Respect the user's time.** If they say "defaults are fine for everything" — write them all and move on. Don't force 14 confirmations.
89
+ - **One `configure` call per service.** Don't batch. This makes it clear what was written and lets the user correct individual services.
90
+
91
+ ## Example Flow
92
+
93
+ ```
94
+ Agent: I found 8 services in your project. Let me walk through each one
95
+ to make sure we're tracking accurately.
96
+
97
+ Right now everything has default budgets — let's fix that.
98
+
99
+ First, your LLMs:
100
+ • Anthropic — defaulted to "API Usage" plan, $100/mo budget.
101
+ I probed your API and you've spent $47.23 this month.
102
+ • OpenAI — defaulted to "API Usage", $100/mo. No admin key,
103
+ so I can't check actual spend.
104
+
105
+ What are your actual budgets for these?
106
+
107
+ User: Anthropic $150 is better, I've been using it heavily.
108
+ OpenAI keep at $100, and here's my admin key: sk-admin-xxx
109
+
110
+ Agent: Got it. Let me update both...
111
+
112
+ [runs: burnwatch configure --service anthropic --budget 150]
113
+ [runs: burnwatch configure --service openai --key sk-admin-xxx --budget 100]
114
+
115
+ ✅ Anthropic: API Usage | LIVE | $150/mo
116
+ ✅ OpenAI: API Usage | LIVE | $100/mo (probed: 12.3K tokens this month)
117
+
118
+ Next, Scrapfly — I detected you're on Pro ($100/mo, 1M credits).
119
+ You've used 250K credits so far. Keep the $100 budget?
120
+
121
+ User: Yeah that's right.
122
+
123
+ Agent: [runs: burnwatch configure --service scrapfly --plan pro --budget 100]
124
+ ✅ Scrapfly: Pro | LIVE | $100/mo | 1M credits
125
+
126
+ PostHog, Inngest, and Resend are all on free tiers at $0.
127
+ Sound right?
128
+
129
+ User: Yep.
130
+
131
+ Agent: [runs configure for each]
132
+
133
+ All done! Here's your updated spend brief:
134
+ [runs: burnwatch status]
135
+ ```
136
+
137
+ ## Probe Data Reference
138
+
139
+ Services with probes and what they return:
140
+
141
+ | Service | Confidence | What's detected |
142
+ |---------|-----------|-----------------|
143
+ | Scrapfly | high | Plan name, credits used/total |
144
+ | Vercel | high | Plan tier (hobby/pro/enterprise) |
145
+ | Supabase | high | Plan tier (free/pro/team) |
146
+ | Anthropic | medium | USD spend this billing period |
147
+ | OpenAI | medium | Token usage this period |
148
+ | Stripe | medium | Balance (available + pending) |
149
+ | Browserbase | medium | Session count, browser hours |
150
+ | Upstash | low | Database count (key validation) |
151
+ | PostHog | low | Org found (key validation) |
152
+ | Gemini, Resend, Inngest, Voyage AI | none | No API — ask user directly |
153
+ | AWS | none | Too complex — flag as BLIND |