@thehammer/danx-session-telemetry 0.1.31 → 0.1.33
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/dist/.source-hash +1 -1
- package/dist/claim-tracker.d.ts +2 -6
- package/dist/claim-tracker.js +3 -9
- package/dist/pricing.d.ts +14 -0
- package/dist/pricing.js +14 -0
- package/package.json +1 -1
package/dist/.source-hash
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
fcb9cebd4c4e0d000f864b88609af799e759befd5f16cebfdd96438c8e28fd25
|
package/dist/claim-tracker.d.ts
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
/** The
|
|
2
|
-
export declare const
|
|
3
|
-
/** The `danxbot_api` tool of the danxbot plugin's server, which an operator session's sub-agent calls. */
|
|
4
|
-
export declare const PLUGIN_API_TOOL_NAME = "mcp__plugin_danxbot_danx-dashboard__danxbot_api";
|
|
5
|
-
/** Every tool name a sub-agent reaches the dashboard API through. */
|
|
6
|
-
export declare const DASHBOARD_API_TOOL_NAMES: ReadonlySet<string>;
|
|
1
|
+
/** The one tool a sub-agent reaches the dashboard API through (the MCP server key is `danx-dashboard`). */
|
|
2
|
+
export declare const DASHBOARD_API_TOOL_NAME = "mcp__danx-dashboard__danxbot_api";
|
|
7
3
|
/** A card id as the issue routes name it, e.g. `DX-3962`. Also the wire's validation for every card id a claim carries. */
|
|
8
4
|
export declare const ISSUE_ID_PATTERN: RegExp;
|
|
9
5
|
/** Longest card id a claim may carry (`dispatches.issue_id` is `VARCHAR(32)`). */
|
package/dist/claim-tracker.js
CHANGED
|
@@ -46,14 +46,8 @@
|
|
|
46
46
|
* Pure bookkeeping — no `node:` imports, so it rides the browser-safe subpath too.
|
|
47
47
|
*/
|
|
48
48
|
import { MAIN_SOURCE } from "./usage-ledger.js";
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
/** The `danxbot_api` tool of a dispatched worker's `danx-dashboard` server. */
|
|
52
|
-
export const DISPATCH_API_TOOL_NAME = "mcp__danx-dashboard__danxbot_api";
|
|
53
|
-
/** The `danxbot_api` tool of the danxbot plugin's server, which an operator session's sub-agent calls. */
|
|
54
|
-
export const PLUGIN_API_TOOL_NAME = "mcp__plugin_danxbot_danx-dashboard__danxbot_api";
|
|
55
|
-
/** Every tool name a sub-agent reaches the dashboard API through. */
|
|
56
|
-
export const DASHBOARD_API_TOOL_NAMES = new Set([DISPATCH_API_TOOL_NAME, PLUGIN_API_TOOL_NAME]);
|
|
49
|
+
/** The one tool a sub-agent reaches the dashboard API through (the MCP server key is `danx-dashboard`). */
|
|
50
|
+
export const DASHBOARD_API_TOOL_NAME = "mcp__danx-dashboard__danxbot_api";
|
|
57
51
|
/** A card id as the issue routes name it, e.g. `DX-3962`. Also the wire's validation for every card id a claim carries. */
|
|
58
52
|
export const ISSUE_ID_PATTERN = /^[A-Za-z][A-Za-z0-9]*-[0-9]+$/;
|
|
59
53
|
/** Longest card id a claim may carry (`dispatches.issue_id` is `VARCHAR(32)`). */
|
|
@@ -108,7 +102,7 @@ function resultSucceeded(block) {
|
|
|
108
102
|
}
|
|
109
103
|
/** The transition a `tool_use` block asks for, or `null` when it is not a claim or release of a card. */
|
|
110
104
|
function transitionOf(block) {
|
|
111
|
-
if (block.type !== "tool_use" ||
|
|
105
|
+
if (block.type !== "tool_use" || block.name !== DASHBOARD_API_TOOL_NAME)
|
|
112
106
|
return null;
|
|
113
107
|
const input = block.input;
|
|
114
108
|
if (input === null || typeof input !== "object")
|
package/dist/pricing.d.ts
CHANGED
|
@@ -73,6 +73,20 @@ export interface PricedTokens {
|
|
|
73
73
|
export declare const SYNTHETIC_MODEL = "<synthetic>";
|
|
74
74
|
/** The `usage.speed` value a fast-mode reply carries. */
|
|
75
75
|
export declare const FAST_SPEED = "fast";
|
|
76
|
+
/** DX-4593 - whether a `speed:"fast"` request on `model` is billed at the STANDARD row (see `FAST_BILLS_AT_STANDARD_RATE`): it has no fast row of its own. */
|
|
77
|
+
export declare function billsFastAtStandardRate(model: string): boolean;
|
|
78
|
+
/** One row of the list-price table: a model at a speed and its five per-million-token prices. */
|
|
79
|
+
export interface ListPriceRow {
|
|
80
|
+
model: string;
|
|
81
|
+
speed: "standard" | "fast";
|
|
82
|
+
price: ModelPrice;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* DX-4593 - every row of the list-price table as data: each priced model at standard speed, then each model with its own fast row at fast
|
|
86
|
+
* speed. This is the SEED a team's editable price table starts from (`src/token-prices/`); it is a copy, so editing a team's price never
|
|
87
|
+
* changes this table and `priceUsage` keeps pricing the ledger from it.
|
|
88
|
+
*/
|
|
89
|
+
export declare function listListPrices(): ListPriceRow[];
|
|
76
90
|
export type PriceResult = {
|
|
77
91
|
kind: "priced";
|
|
78
92
|
costUsd: number;
|
package/dist/pricing.js
CHANGED
|
@@ -130,6 +130,20 @@ const FAST_BILLS_AT_STANDARD_RATE = new Set([
|
|
|
130
130
|
"claude-opus-4-6",
|
|
131
131
|
"claude-opus-4-6-20250916",
|
|
132
132
|
]);
|
|
133
|
+
/** DX-4593 - whether a `speed:"fast"` request on `model` is billed at the STANDARD row (see `FAST_BILLS_AT_STANDARD_RATE`): it has no fast row of its own. */
|
|
134
|
+
export function billsFastAtStandardRate(model) {
|
|
135
|
+
return FAST_BILLS_AT_STANDARD_RATE.has(model);
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* DX-4593 - every row of the list-price table as data: each priced model at standard speed, then each model with its own fast row at fast
|
|
139
|
+
* speed. This is the SEED a team's editable price table starts from (`src/token-prices/`); it is a copy, so editing a team's price never
|
|
140
|
+
* changes this table and `priceUsage` keeps pricing the ledger from it.
|
|
141
|
+
*/
|
|
142
|
+
export function listListPrices() {
|
|
143
|
+
const standard = Object.entries(PRICING).map(([model, price]) => ({ model, speed: "standard", price: { ...price } }));
|
|
144
|
+
const fast = Object.entries(FAST_PRICING).map(([model, price]) => ({ model, speed: "fast", price: { ...price } }));
|
|
145
|
+
return [...standard, ...fast];
|
|
146
|
+
}
|
|
133
147
|
/**
|
|
134
148
|
* Price one unit of usage. NEVER throws (DX-2963 replaces DX-1720's throw):
|
|
135
149
|
* an unknown model — or a fast reply on a model with no fast price — returns
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thehammer/danx-session-telemetry",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.33",
|
|
4
4
|
"description": "Shared Claude Code transcript collector (DX-2962) — incremental JSONL tailing for the danxbot worker and the danx-dashboard-mcp desktop bridge, so both run identical collector code.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|