@agentguard-run/burn 0.3.22 → 0.3.24

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/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.24 (2026-09-29)
4
+
5
+ - `calendar` ends with one next step, so it never stops at a number with nothing to do about it. The rule is the one `why` uses for its tip: sub-agents at a fifth or more of the tokens point at the free plugin, or at giving related work to one sub-agent once AgentGuard has held launches on this machine; anything else points at `why`, which names the change for one session. In English, Spanish and Portuguese, and short enough that the command never wraps at 80 columns.
6
+
7
+ ## 0.3.23 (2026-09-29)
8
+
9
+ - Prices GPT-6.1 Sol (`gpt-6.1-sol`), released on September 29, 2026, at the rates on OpenAI's price list, checked the same day: 2, 0.1, 2.5 and 10 USD per million tokens for fresh input, cached input, cache write and output, with the same 272K long-context tier as GPT-6 Sol. Before this row its turns were unpriced in Codex sessions, so a session that used it showed no dollar total.
10
+ - Documents that every price is the provider's standard tier: fast tiers (Claude fast mode, OpenAI Ultrafast at six times the standard Astra rate) are not visible in transcripts, so such sessions are understated.
11
+
3
12
  ## 0.3.22 (2026-09-29)
4
13
 
5
14
  - Prices Claude Sonnet 5.5 (`claude-sonnet-5-5`), released on September 28, 2026, at the rates on Anthropic's price list, checked on 2026-09-29: 2, 0.2, 2.5, 4 and 10 USD per million tokens for fresh input, cache read, five-minute write, one-hour write and output. Before this row its turns were unpriced, so a session that used Sonnet 5.5 showed no dollar total.
package/README.md CHANGED
@@ -314,8 +314,12 @@ Days marked H: AgentGuard held a launch that day.
314
314
  From Claude Code and Codex sessions on this machine, sub-agents included.
315
315
  Claude Code deletes sessions older than 30 days by default.
316
316
  Burn keeps each day's count whenever you run this, so the calendar grows.
317
+
318
+ Next: see where one session's tokens went: npx agentguard-burn why
317
319
  ```
318
320
 
321
+ The last line is the one next step, chosen the way `why` chooses its tip: when sub-agents took a fifth or more of the tokens it points at the free plugin (or, once AgentGuard has held launches on this machine, at giving related work to one sub-agent); otherwise it points at `why`, which names the change for one session.
322
+
319
323
  Claude Code deletes transcripts after 30 days by default (`cleanupPeriodDays`), so each run keeps a daily count per transcript file in `calendar/daily.json` under the Burn home (`AGENTGUARD_HOME`, default `~/.agentguard`): tokens, sub-agent tokens and dollars per day, with no paths and no content, owner-only and written atomically. A transcript still on disk is always counted from the transcript; a deleted transcript's days come from the daily count; no file-day is counted from both. Run `calendar` at least once within Claude Code's retention period to keep every day. `calendar/cache.json` keeps each response's counts, keyed by the transcript's path digest, size and modification time, so a later run re-reads only the transcripts that changed; a new Burn version or a pricing override recounts everything once.
320
324
 
321
325
  `calendar json` is never translated: every day of the span with its figures and level, the totals, the busiest day and where the figures came from. `--lang es|pt` and your locale choose the language exactly as for `why`. Nothing in the calendar compares you with anyone else.
@@ -18,7 +18,7 @@
18
18
  */
19
19
  import { Canvas, type CanvasColor } from '../canvas';
20
20
  import { type CalendarReport } from './calendar';
21
- import { type WhyLang } from './i18n';
21
+ import { type CalendarText, type WhyLang } from './i18n';
22
22
  import type { DollarRange } from './pricing';
23
23
  export type CalendarSkin = 'plain' | 'colour';
24
24
  /** `big`: two characters a day; `compact`: one. Both put one space between weeks. */
@@ -65,6 +65,14 @@ export declare function wrap(text: string, width: number, indent?: string): stri
65
65
  * size (calendarCells); the span was already chosen to fit it.
66
66
  */
67
67
  export declare function calendarLines(report: CalendarReport, lang: WhyLang, columns: number, skin: CalendarSkin): CalendarLine[];
68
+ /** The calendar's closing line, by the rule `why` uses for its own tip: sub-agents at a fifth or more of the
69
+ * tokens point at the free plugin, or at one sub-agent for related work when AgentGuard already held launches
70
+ * here (the plugin is installed); anything else points at `why`, which names the change for one session. */
71
+ export declare function calendarNext(totals: {
72
+ tokens: number;
73
+ subagentTokens: number;
74
+ heldLaunches: number;
75
+ }, text: CalendarText): string;
68
76
  /** Plain text: shade characters and day letters, no control sequences, trailing spaces trimmed. */
69
77
  export declare function renderCalendar(report: CalendarReport, lang?: WhyLang, columns?: number): string;
70
78
  /** The colour face on a canvas sized to the report, never paged: a calendar is one block. */
@@ -4,6 +4,7 @@ exports.calendarCells = exports.calendarGridWidth = exports.CALENDAR_MARKERS = e
4
4
  exports.calendarDollars = calendarDollars;
5
5
  exports.wrap = wrap;
6
6
  exports.calendarLines = calendarLines;
7
+ exports.calendarNext = calendarNext;
7
8
  exports.renderCalendar = renderCalendar;
8
9
  exports.drawCalendar = drawCalendar;
9
10
  /**
@@ -229,8 +230,19 @@ function calendarLines(report, lang, columns, skin) {
229
230
  if (report.historyShort)
230
231
  for (const sentence of text.shortHistory)
231
232
  paragraph(sentence, 'slate');
233
+ // The one next step, last, so the calendar never ends on a number with nothing to do about it.
234
+ lines.push([]);
235
+ paragraph(calendarNext(totals, text), 'white');
232
236
  return lines;
233
237
  }
238
+ /** The calendar's closing line, by the rule `why` uses for its own tip: sub-agents at a fifth or more of the
239
+ * tokens point at the free plugin, or at one sub-agent for related work when AgentGuard already held launches
240
+ * here (the plugin is installed); anything else points at `why`, which names the change for one session. */
241
+ function calendarNext(totals, text) {
242
+ if (totals.tokens <= 0 || totals.subagentTokens / totals.tokens < 0.2)
243
+ return text.next.why;
244
+ return (totals.heldLaunches > 0 ? text.next.fanoutPlugin : text.next.fanout)((0, render_1.share)(totals.subagentTokens, totals.tokens));
245
+ }
234
246
  /** Plain text: shade characters and day letters, no control sequences, trailing spaces trimmed. */
235
247
  function renderCalendar(report, lang = 'en', columns = 80) {
236
248
  return calendarLines(report, lang, columns, 'plain').map(line => line.map(part => part.text).join('').trimEnd()).join('\n');
@@ -189,5 +189,12 @@ export interface CalendarText {
189
189
  shortHistory: readonly [string, string];
190
190
  /** Stderr when the daily counts cannot be written. */
191
191
  saveFailed: string;
192
+ /** The one next step, printed last, by the rule `why` uses: sub-agents at a fifth or more of the tokens get the
193
+ * plugin (or, when AgentGuard already held launches here, one sub-agent for related work); otherwise `why`. */
194
+ next: {
195
+ fanout: (share: string) => string;
196
+ fanoutPlugin: (share: string) => string;
197
+ why: string;
198
+ };
192
199
  }
193
200
  export declare const CALENDAR_TEXT: Readonly<Record<WhyLang, CalendarText>>;
@@ -288,6 +288,11 @@ const calendarEn = {
288
288
  noData: 'No Claude Code or Codex sessions found on this machine yet.',
289
289
  shortHistory: ['Claude Code deletes sessions older than 30 days by default.', 'Burn keeps each day\'s count whenever you run this, so the calendar grows.'],
290
290
  saveFailed: 'Burn could not store the counts from this run.',
291
+ next: {
292
+ fanout: share => `Next: sub-agents used ${share} of these tokens. AgentGuard's free plugin asks you before the next sub-agent past your limit starts: agentguard.run/try`,
293
+ fanoutPlugin: share => `Next: sub-agents used ${share} of these tokens. Give related work to one sub-agent instead of several.`,
294
+ why: 'Next: see where one session\'s tokens went: npx agentguard-burn why',
295
+ },
291
296
  };
292
297
  const calendarEs = {
293
298
  weekdays: ['Do', 'Lu', 'Ma', 'Mi', 'Ju', 'Vi', 'Sá'],
@@ -313,6 +318,11 @@ const calendarEs = {
313
318
  noData: 'Todavía no hay sesiones de Claude Code ni de Codex en esta máquina.',
314
319
  shortHistory: ['Claude Code borra las sesiones de más de 30 días de forma predeterminada.', 'Burn guarda el conteo diario cada vez que lo ejecutas, y el calendario crece.'],
315
320
  saveFailed: 'Burn no pudo guardar los conteos de esta ejecución.',
321
+ next: {
322
+ fanout: share => `Próximo paso: los subagentes usaron el ${share} de estos tokens. El plugin gratuito de AgentGuard te pregunta antes de que empiece el siguiente subagente por encima de tu límite: agentguard.run/try`,
323
+ fanoutPlugin: share => `Próximo paso: los subagentes usaron el ${share} de estos tokens. Dale el trabajo relacionado a un solo subagente en vez de varios.`,
324
+ why: 'Próximo paso: a dónde fue cada token de una sesión: npx agentguard-burn why',
325
+ },
316
326
  };
317
327
  const calendarPt = {
318
328
  weekdays: ['Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sáb'],
@@ -338,5 +348,10 @@ const calendarPt = {
338
348
  noData: 'Ainda não há sessões do Claude Code nem do Codex nesta máquina.',
339
349
  shortHistory: ['O Claude Code apaga as sessões com mais de 30 dias por padrão.', 'O Burn salva a contagem diária a cada execução, então o calendário cresce.'],
340
350
  saveFailed: 'O Burn não conseguiu salvar as contagens desta execução.',
351
+ next: {
352
+ fanout: share => `Próximo passo: os subagentes usaram ${share} destes tokens. O plugin gratuito do AgentGuard pergunta a você antes que o próximo subagente acima do seu limite comece: agentguard.run/try`,
353
+ fanoutPlugin: share => `Próximo passo: os subagentes usaram ${share} destes tokens. Dê o trabalho relacionado a um só subagente em vez de vários.`,
354
+ why: 'Próximo passo: para onde foi cada token de uma sessão: npx agentguard-burn why',
355
+ },
341
356
  };
342
357
  exports.CALENDAR_TEXT = { en: calendarEn, es: calendarEs, pt: calendarPt };
@@ -39,6 +39,8 @@ exports.MODEL_PRICING = Object.freeze({
39
39
  'claude-haiku-4-5-20251001': rates(1, 0.1, 1.25, 2, 5),
40
40
  'gpt-6-astra': openaiRates(10, 1, 12.5, 50, 'https://developers.openai.com/api/docs/pricing'),
41
41
  'gpt-6-sol': Object.freeze({ ...openaiRates(2, 0.2, 2.5, 10, 'https://developers.openai.com/api/docs/pricing'), verifiedAt: '2026-09-22' }),
42
+ // Verified 2026-09-29: GPT-6.1 Sol (released that day) lists GPT-6 Sol's rates with cached input at 0.10, same 272K tier.
43
+ 'gpt-6.1-sol': Object.freeze({ ...openaiRates(2, 0.1, 2.5, 10, 'https://developers.openai.com/api/docs/pricing'), verifiedAt: '2026-09-29' }),
42
44
  'gpt-6-luna': Object.freeze({ ...openaiRates(0.1, 0.01, 0.125, 0.5, 'https://developers.openai.com/api/docs/pricing'), verifiedAt: '2026-09-22' }),
43
45
  'gpt-5.6-sol': openaiRates(4, 0.4, 5, 20, 'https://developers.openai.com/api/docs/pricing'),
44
46
  'gpt-5.6-luna': openaiRates(0.2, 0.02, 0.25, 1.2, 'https://developers.openai.com/api/docs/pricing'),
@@ -55,7 +55,9 @@ The verdict names the exact setting: `"promptCacheTtl": "1h"` in `settings.json`
55
55
 
56
56
  ## Pricing sources and overrides
57
57
 
58
- Every bundled row includes its exact model identifier, `sourceUrl` and `verifiedAt`. The rates were checked on 2026-09-17, except `claude-opus-5-5`, `gpt-6-sol` and `gpt-6-luna`, which were checked on 2026-09-22, and `claude-sonnet-5-5`, which was checked on 2026-09-29. The runtime never downloads pricing. Run `agentguard-burn pricing` to inspect the installed table.
58
+ **Standard tier only.** Every row is the provider's standard per-token price. Faster tiers cost more (Claude's fast mode is a premium on Opus models; OpenAI's Ultrafast on GPT-6 Astra is six times the standard rate, at $60 in and $300 out per million tokens as of 2026-09-29), and the transcripts Burn reads do not say which tier a response ran on, so a session on one of those tiers is priced BELOW what it would cost. Batch and flex discounts are not applied either.
59
+
60
+ Every bundled row includes its exact model identifier, `sourceUrl` and `verifiedAt`. The rates were checked on 2026-09-17, except `claude-opus-5-5`, `gpt-6-sol` and `gpt-6-luna`, which were checked on 2026-09-22, and `claude-sonnet-5-5` and `gpt-6.1-sol`, which were checked on 2026-09-29. The runtime never downloads pricing. Run `agentguard-burn pricing` to inspect the installed table.
59
61
 
60
62
  The Claude rows use the [official model price list](https://platform.claude.com/docs/en/about-claude/pricing). Amounts below are USD per million tokens in the order fresh input, cache read, five-minute write, one-hour write, output:
61
63
 
@@ -70,6 +72,7 @@ The [OpenAI API price list](https://developers.openai.com/api/docs/pricing) supp
70
72
 
71
73
  * `gpt-6-astra`: 10, 1, 12.5, 50.
72
74
  * `gpt-6-sol`: 2, 0.2, 2.5, 10.
75
+ * `gpt-6.1-sol`: 2, 0.1, 2.5, 10.
73
76
  * `gpt-6-luna`: 0.1, 0.01, 0.125, 0.5.
74
77
  * `gpt-5.6-sol`: 4, 0.4, 5, 20. These are the published promotional rates on the verification date.
75
78
  * `gpt-5.6-luna`: 0.2, 0.02, 0.25, 1.2.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentguard-run/burn",
3
- "version": "0.3.22",
3
+ "version": "0.3.24",
4
4
  "description": "Local session usage and runaway-agent circuit breaker. Explain tokens, cache rewrites and API list cost, track pace, warn on heavy turns, and gate agent fan-out with signed receipts. Developer command ranking requires explicit --rank.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "homepage": "https://agentguard.run/burn",