@relayburn/sdk 2.8.7 → 2.10.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/CHANGELOG.md +16 -0
- package/package.json +5 -5
- package/src/index.d.ts +34 -0
- package/src/index.js +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [2.10.0] - 2026-05-24
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- `hotspots()` attribution result carries a new `mcpServers` field —
|
|
10
|
+
per-server rollup of `mcp__<server>__<tool>` tool calls with summed
|
|
11
|
+
cost/tokens/ride-turns and top representative tool basenames. (#424)
|
|
12
|
+
|
|
13
|
+
## [2.9.0] - 2026-05-21
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- `writeStamp({ sessionId | messageId, enrichment, ts?, ledgerHome? })` writes
|
|
18
|
+
a stamp by exact selector — companion to `writePendingStamp` for launchers
|
|
19
|
+
that preallocate the session id (Claude `--session-id`).
|
|
20
|
+
|
|
5
21
|
## [2.5.0] - 2026-05-08
|
|
6
22
|
|
|
7
23
|
### Added
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@relayburn/sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.10.0",
|
|
4
4
|
"description": "Embeddable Relayburn SDK — napi-rs bindings over the Rust relayburn-sdk crate (2.x). Drop-in replacement for the TS @relayburn/sdk@1.x.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -43,10 +43,10 @@
|
|
|
43
43
|
]
|
|
44
44
|
},
|
|
45
45
|
"optionalDependencies": {
|
|
46
|
-
"@relayburn/sdk-darwin-arm64": "2.
|
|
47
|
-
"@relayburn/sdk-darwin-x64": "2.
|
|
48
|
-
"@relayburn/sdk-linux-arm64-gnu": "2.
|
|
49
|
-
"@relayburn/sdk-linux-x64-gnu": "2.
|
|
46
|
+
"@relayburn/sdk-darwin-arm64": "2.10.0",
|
|
47
|
+
"@relayburn/sdk-darwin-x64": "2.10.0",
|
|
48
|
+
"@relayburn/sdk-linux-arm64-gnu": "2.10.0",
|
|
49
|
+
"@relayburn/sdk-linux-x64-gnu": "2.10.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@napi-rs/cli": "^2.18.4",
|
package/src/index.d.ts
CHANGED
|
@@ -58,6 +58,27 @@ export declare function writePendingStamp(
|
|
|
58
58
|
opts: WritePendingStampOptions,
|
|
59
59
|
): Promise<PendingStampWriteResult>
|
|
60
60
|
|
|
61
|
+
export interface WriteStampOptions {
|
|
62
|
+
/** Target a session by exact id. At least one of `sessionId` or `messageId` must be set. */
|
|
63
|
+
sessionId?: string;
|
|
64
|
+
/** Target a single turn by exact message id. At least one of `sessionId` or `messageId` must be set. */
|
|
65
|
+
messageId?: string;
|
|
66
|
+
/** Enrichment key/value pairs to fold onto matched turns. Must be non-empty. */
|
|
67
|
+
enrichment: Record<string, string>;
|
|
68
|
+
/** ISO timestamp the caller observed, e.g. `2026-05-21T12:00:00Z`. Defaults to now when omitted. */
|
|
69
|
+
ts?: string;
|
|
70
|
+
ledgerHome?: string;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Write a stamp targeting an exact session id or message id. Use when the
|
|
75
|
+
* launcher knows the session id up front — for example, a Claude launcher
|
|
76
|
+
* that preallocates `--session-id <uuid>` before spawn — so the
|
|
77
|
+
* enrichment lands by selector without going through the sidecar
|
|
78
|
+
* `writePendingStamp` manifest matching path.
|
|
79
|
+
*/
|
|
80
|
+
export declare function writeStamp(opts: WriteStampOptions): Promise<void>
|
|
81
|
+
|
|
61
82
|
export interface SummaryOptions {
|
|
62
83
|
session?: string;
|
|
63
84
|
project?: string;
|
|
@@ -259,6 +280,18 @@ export interface HotspotsSubagentRow {
|
|
|
259
280
|
totalCost: number;
|
|
260
281
|
}
|
|
261
282
|
|
|
283
|
+
export interface HotspotsMcpServerRow {
|
|
284
|
+
/** MCP server name (the `<server>` segment of `mcp__<server>__<tool>`). */
|
|
285
|
+
server: string;
|
|
286
|
+
callCount: number;
|
|
287
|
+
initialTokens: number | bigint;
|
|
288
|
+
persistenceTokens: number | bigint;
|
|
289
|
+
ridingTurns: number;
|
|
290
|
+
totalCost: number;
|
|
291
|
+
/** Up to three representative tool basenames (cost desc, then name asc). */
|
|
292
|
+
topTools: string[];
|
|
293
|
+
}
|
|
294
|
+
|
|
262
295
|
export interface HotspotsSessionTotal {
|
|
263
296
|
sessionId: string;
|
|
264
297
|
grandCost: number;
|
|
@@ -286,6 +319,7 @@ export interface HotspotsAttributionResult {
|
|
|
286
319
|
bashVerbs: HotspotsBashVerbRow[];
|
|
287
320
|
bash: HotspotsBashRow[];
|
|
288
321
|
subagents: HotspotsSubagentRow[];
|
|
322
|
+
mcpServers: HotspotsMcpServerRow[];
|
|
289
323
|
fidelity: HotspotsFidelityBlock;
|
|
290
324
|
refused?: boolean;
|
|
291
325
|
refusalReason?: string;
|
package/src/index.js
CHANGED
|
@@ -124,6 +124,10 @@ export async function writePendingStamp(opts) {
|
|
|
124
124
|
return coerceBigInts(await binding.writePendingStamp(opts));
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
+
export async function writeStamp(opts) {
|
|
128
|
+
await binding.writeStamp(opts);
|
|
129
|
+
}
|
|
130
|
+
|
|
127
131
|
export function computeCompareExcluded(summary, minimum) {
|
|
128
132
|
const out = { total: 0, aggregateOnly: 0, costOnly: 0, partial: 0, usageOnly: 0 };
|
|
129
133
|
if (minimum === 'partial') return out;
|