@agentguard-run/burn 0.3.20 → 0.3.22

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.
@@ -11,6 +11,7 @@
11
11
  import type { ReaderCursor } from './history/claude-transcript';
12
12
  import { type WhyLang } from './insights/i18n';
13
13
  import { type DollarRange, type PricingTable } from './insights/pricing';
14
+ import type { Policy } from './types';
14
15
  /** Fewer finished sub-agents than this say too little about the next one, so the line is left out. */
15
16
  export declare const MIN_FINISHED_SUBAGENTS = 3;
16
17
  export interface FinishedSubagents {
@@ -36,3 +37,13 @@ export declare function finishedSubagents(cursor: Pick<ReaderCursor, 'children'
36
37
  * is English on every host, so the hook passes 'en'.
37
38
  */
38
39
  export declare function subagentCostLine(summary: FinishedSubagents | null, lang?: WhyLang): string | null;
40
+ /**
41
+ * The line a STOP prints, exactly as Burn's own Claude Code hook prints it: the
42
+ * summary of a cursor that readSessionIncremental advanced, priced with the
43
+ * rates `why` uses (burn-pricing.json under `home`, or the policy's pricing
44
+ * file), in English like the rest of the STOP text. Null below three finished
45
+ * sub-agents. Best effort: a pricing file that cannot be read costs the line its
46
+ * dollars, and nothing here throws, so it can never turn a prompt into a
47
+ * failed-closed refusal.
48
+ */
49
+ export declare function decisionCostLine(cursor: Pick<ReaderCursor, 'children' | 'completed'>, home: string, policy?: Policy): string | null;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MIN_FINISHED_SUBAGENTS = void 0;
4
4
  exports.finishedSubagents = finishedSubagents;
5
5
  exports.subagentCostLine = subagentCostLine;
6
+ exports.decisionCostLine = decisionCostLine;
6
7
  const i18n_1 = require("./insights/i18n");
7
8
  const live_1 = require("./insights/live");
8
9
  const pricing_1 = require("./insights/pricing");
@@ -63,3 +64,27 @@ function subagentCostLine(summary, lang = 'en') {
63
64
  return null;
64
65
  return i18n_1.DECISION_TEXT[lang].finished(summary.count, (0, stop_text_1.shortTokens)(summary.meanTokens), summary.meanUsd ? (0, live_1.dollars)(summary.meanUsd, i18n_1.WHY_TEXT[lang]) : null);
65
66
  }
67
+ /**
68
+ * The line a STOP prints, exactly as Burn's own Claude Code hook prints it: the
69
+ * summary of a cursor that readSessionIncremental advanced, priced with the
70
+ * rates `why` uses (burn-pricing.json under `home`, or the policy's pricing
71
+ * file), in English like the rest of the STOP text. Null below three finished
72
+ * sub-agents. Best effort: a pricing file that cannot be read costs the line its
73
+ * dollars, and nothing here throws, so it can never turn a prompt into a
74
+ * failed-closed refusal.
75
+ */
76
+ function decisionCostLine(cursor, home, policy) {
77
+ let rates;
78
+ try {
79
+ rates = (0, live_1.readPricing)(home, policy);
80
+ }
81
+ catch {
82
+ rates = null;
83
+ }
84
+ try {
85
+ return subagentCostLine(finishedSubagents(cursor, rates ?? {}, rates !== null));
86
+ }
87
+ catch {
88
+ return null;
89
+ }
90
+ }
@@ -55,7 +55,7 @@ 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. The runtime never downloads pricing. Run `agentguard-burn pricing` to inspect the installed table.
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.
59
59
 
60
60
  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
61
 
@@ -63,7 +63,7 @@ The Claude rows use the [official model price list](https://platform.claude.com/
63
63
  * `claude-fable-5`: 10, 1, 12.5, 20, 50.
64
64
  * `claude-opus-5-5`: 4, 0.2, 5, 8, 20.
65
65
  * `claude-opus-5` and `claude-opus-4-8`: 5, 0.5, 6.25, 10, 25.
66
- * `claude-sonnet-5`: 2, 0.2, 2.5, 4, 10.
66
+ * `claude-sonnet-5-5` and `claude-sonnet-5`: 2, 0.2, 2.5, 4, 10.
67
67
  * `claude-haiku-4-5-20251001`: 1, 0.1, 1.25, 2, 5.
68
68
 
69
69
  The [OpenAI API price list](https://developers.openai.com/api/docs/pricing) supplies these standard rates in the order fresh input, cache read, cache write, output:
package/package.json CHANGED
@@ -1,8 +1,12 @@
1
1
  {
2
2
  "name": "@agentguard-run/burn",
3
- "version": "0.3.20",
3
+ "version": "0.3.22",
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
+ "homepage": "https://agentguard.run/burn",
7
+ "bugs": {
8
+ "url": "https://github.com/MerchantGuard/agentguard-codex-plugin/issues"
9
+ },
6
10
  "type": "commonjs",
7
11
  "main": "dist/src/index.js",
8
12
  "types": "dist/src/index.d.ts",