@thehammer/danx-session-telemetry 0.1.34 → 0.1.36

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/README.md CHANGED
File without changes
@@ -0,0 +1 @@
1
+ 6f01c504839b9ec80215ac78cd4d16fa5b3ccb645eaaca9343a0f91fd97c62eb
@@ -1,5 +1,9 @@
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";
1
+ /** The `danxbot_api` tool of a dispatched worker's `danx-dashboard` server. */
2
+ export declare const DISPATCH_API_TOOL_NAME = "mcp__danx-dashboard__danxbot_api";
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>;
3
7
  /** 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. */
4
8
  export declare const ISSUE_ID_PATTERN: RegExp;
5
9
  /** Longest card id a claim may carry (`dispatches.issue_id` is `VARCHAR(32)`). */
@@ -46,8 +46,14 @@
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
- /** 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";
49
+ // DX-4578: both names are live, neither a fallback. A dispatched worker's clean-room config names the server `danx-dashboard`; an operator
50
+ // session's sub-agent reaches it through the danxbot plugin's server (`plugin:danxbot:danx-dashboard`, tools `mcp__plugin_danxbot_danx-dashboard__*`).
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]);
51
57
  /** 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. */
52
58
  export const ISSUE_ID_PATTERN = /^[A-Za-z][A-Za-z0-9]*-[0-9]+$/;
53
59
  /** Longest card id a claim may carry (`dispatches.issue_id` is `VARCHAR(32)`). */
@@ -102,7 +108,7 @@ function resultSucceeded(block) {
102
108
  }
103
109
  /** The transition a `tool_use` block asks for, or `null` when it is not a claim or release of a card. */
104
110
  function transitionOf(block) {
105
- if (block.type !== "tool_use" || block.name !== DASHBOARD_API_TOOL_NAME)
111
+ if (block.type !== "tool_use" || typeof block.name !== "string" || !DASHBOARD_API_TOOL_NAMES.has(block.name))
106
112
  return null;
107
113
  const input = block.input;
108
114
  if (input === null || typeof input !== "object")
@@ -433,7 +433,7 @@ export declare class SessionLogWatcher {
433
433
  *
434
434
  * This method gives the finalize backstop a deterministic, cause-agnostic
435
435
  * way to resolve the file: by the time a dispatch finalizes, the agent's
436
- * the dispatch-complete call's tool_use is already written to the JSONL, so the file
436
+ * `danxbot_complete` tool_use is already written to the JSONL, so the file
437
437
  * is guaranteed present on disk. It scans the watcher's OWN `sessionDir`
438
438
  * (the dir derived from `agentCwd` at construction — the same dir claude
439
439
  * wrote to) for the dispatch tag. Returns the file path, or null when no
@@ -451,7 +451,7 @@ export declare class SessionLogWatcher {
451
451
  * Read any JSONL bytes appended since the last scheduled poll tick. Used by
452
452
  * the launcher's cleanup path to capture the agent's final assistant entry
453
453
  * (the one carrying the closing `usage` block + the `tool_use` for
454
- * the dispatch-complete call) before stop() halts polling. Without this, the row
454
+ * `danxbot_complete`) before stop() halts polling. Without this, the row
455
455
  * finalized by `DispatchTracker.finalize` snapshots stale `job.usage` and
456
456
  * the dispatches table undercounts every token + counter field by exactly
457
457
  * what the JSONL grew between ticks.
@@ -653,7 +653,7 @@ export class SessionLogWatcher {
653
653
  *
654
654
  * This method gives the finalize backstop a deterministic, cause-agnostic
655
655
  * way to resolve the file: by the time a dispatch finalizes, the agent's
656
- * the dispatch-complete call's tool_use is already written to the JSONL, so the file
656
+ * `danxbot_complete` tool_use is already written to the JSONL, so the file
657
657
  * is guaranteed present on disk. It scans the watcher's OWN `sessionDir`
658
658
  * (the dir derived from `agentCwd` at construction — the same dir claude
659
659
  * wrote to) for the dispatch tag. Returns the file path, or null when no
@@ -692,7 +692,7 @@ export class SessionLogWatcher {
692
692
  * Read any JSONL bytes appended since the last scheduled poll tick. Used by
693
693
  * the launcher's cleanup path to capture the agent's final assistant entry
694
694
  * (the one carrying the closing `usage` block + the `tool_use` for
695
- * the dispatch-complete call) before stop() halts polling. Without this, the row
695
+ * `danxbot_complete`) before stop() halts polling. Without this, the row
696
696
  * finalized by `DispatchTracker.finalize` snapshots stale `job.usage` and
697
697
  * the dispatches table undercounts every token + counter field by exactly
698
698
  * what the JSONL grew between ticks.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thehammer/danx-session-telemetry",
3
- "version": "0.1.34",
3
+ "version": "0.1.36",
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",