tanuki-telemetry 1.3.5 → 1.3.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tanuki-telemetry",
3
- "version": "1.3.5",
3
+ "version": "1.3.6",
4
4
  "description": "Workflow monitor and telemetry dashboard for Claude Code autonomous agents",
5
5
  "type": "module",
6
6
  "bin": {
@@ -15,7 +15,7 @@ Compare two sets of images (reference vs generated) with pixel-diff heatmaps and
15
15
  - `template-names`: One or more slide template names to test (space-separated). Matched against `presentation_template.name` in local Supabase DB (case-insensitive LIKE).
16
16
  - `--session-id=<id>`: Attach to an existing telemetry session instead of creating a new one.
17
17
  - `--skip-generation`: Use existing generated presentations in the DB — don't re-generate.
18
- - `--output-dir=<path>`: Override output directory (default: `~/junior-main/outputs/slide-comparisons/`)
18
+ - `--output-dir=<path>`: Override output directory (default: `~/.tanuki/data/slide-comparisons/`)
19
19
 
20
20
  ---
21
21
 
@@ -380,7 +380,7 @@ mcp__telemetry__log_event({
380
380
  slide_title: "<Title>", // e.g., "Cover", "Metrics Dashboard"
381
381
  severity: "<critical|notable|minor|good>",
382
382
  finding_title: "<short title>", // e.g., "Client logo removed"
383
- finding_details: "<full description>", // e.g., "Reference has 'Junior | TRINITY' dual logo..."
383
+ finding_details: "<full description>", // e.g., "Reference has 'Acme | PARTNER' dual logo..."
384
384
  diff_pct: <X.X>, // pixel diff percentage for this slide
385
385
  comparison_image: "<absolute path>", // path to the annotated comparison PNG
386
386
  ref_image: "<absolute path>", // path to the reference slide PNG
@@ -414,7 +414,7 @@ metadata: {
414
414
  slide_title: "Table of Contents",
415
415
  severity: "notable",
416
416
  finding_title: "Logo expanded",
417
- finding_details: "Reference: icon-only Junior logo. Generated: full 'Junior' wordmark with icon — different logo variant.",
417
+ finding_details: "Reference: icon-only client logo. Generated: full wordmark with icon — different logo variant.",
418
418
  ...
419
419
  }
420
420
 
@@ -17,9 +17,9 @@ These are NON-NEGOTIABLE. Violating any of these makes the session useless for r
17
17
 
18
18
  **3. UPDATE PLAN STEPS.** Call `mcp__telemetry__update_plan_step` as you start and finish each step. Every step must go through `in_progress` → `completed`/`failed`/`skipped`.
19
19
 
20
- **4. LOG SCREENSHOTS.** Call `mcp__telemetry__log_screenshot` for EVERY screenshot taken. Use the full absolute path: `/Users/ykim/junior-main/outputs/<worktree>/screenshots/<name>.png`
20
+ **4. LOG SCREENSHOTS.** Call `mcp__telemetry__log_screenshot` for EVERY screenshot taken. Use the full absolute path: `$TANUKI_OUTPUTS/<worktree>/screenshots/<name>.png`
21
21
 
22
- **4b. LOG ARTIFACTS.** Call `mcp__telemetry__log_artifact` for EVERY non-screenshot file output: generated reports, templates, rubrics, PPTX files, summaries, configs, CSV exports, etc. Use the full absolute path: `/Users/ykim/junior-main/outputs/<worktree>/artifacts/<name>.<ext>`. Artifacts appear on the dashboard with download links. Screenshots go to `log_screenshot`; everything else goes to `log_artifact`.
22
+ **4b. LOG ARTIFACTS.** Call `mcp__telemetry__log_artifact` for EVERY non-screenshot file output: generated reports, templates, rubrics, PPTX files, summaries, configs, CSV exports, etc. Use the full absolute path: `$TANUKI_OUTPUTS/<worktree>/artifacts/<name>.<ext>`. Artifacts appear on the dashboard with download links. Screenshots go to `log_screenshot`; everything else goes to `log_artifact`.
23
23
 
24
24
  **5. INCLUDE METADATA.** Every `log_event` call MUST include the `metadata` field with structured context (file paths, commands, exit codes, error output, decision reasoning). Events without metadata are useless.
25
25
 
@@ -64,7 +64,7 @@ These are NON-NEGOTIABLE. Violating any of these makes the session useless for r
64
64
  /start-work <worktree-name(optional)> <flags(optional)>
65
65
  ```
66
66
 
67
- **Default repo:** `~/junior-main/junior` (hardcoded — worktrees go in `~/junior-main/junior-worktrees/`)
67
+ **Default repo:** `$PROJECT_DIR` (set in environment or CLAUDE.md — worktrees go in `$WORKTREES_DIR/`)
68
68
 
69
69
  **Arguments:**
70
70
  - `worktree-name`: Name for worktree/workspace. If omitted, will be derived from ticket or user input.
@@ -96,11 +96,11 @@ Before starting any work, verify the telemetry server is running:
96
96
  - Tell the user: "Telemetry MCP is not running. Attempting to start it..."
97
97
  - Try to start it:
98
98
  ```bash
99
- docker run --rm -d --name telemetry-mcp -i -v /Users/ykim/junior-main/outputs:/data telemetry-mcp:latest
99
+ docker run --rm -d --name telemetry-mcp -i -v $TANUKI_OUTPUTS:/data telemetry-mcp:latest
100
100
  ```
101
101
  - If the image doesn't exist, rebuild it:
102
102
  ```bash
103
- cd /Users/ykim/.claude/mcp-servers/telemetry && docker compose build && docker compose up -d
103
+ cd ~/.claude/mcp-servers/telemetry && docker compose build && docker compose up -d
104
104
  ```
105
105
  - Retry the `list_sessions` call
106
106
  - If it STILL fails → warn the user: "Telemetry unavailable — proceeding without logging. Run `docker compose up` in `~/.claude/mcp-servers/telemetry/` to fix."
@@ -187,7 +187,7 @@ Structure metadata depending on event type:
187
187
  ```
188
188
  - **any event with a screenshot** — include `screenshot_path` in metadata to attach the image inline on the dashboard:
189
189
  ```json
190
- { "screenshot_path": "/Users/ykim/junior-main/outputs/<worktree>/screenshots/01-feature.png", "description": "Test failure output" }
190
+ { "screenshot_path": "$TANUKI_OUTPUTS/<worktree>/screenshots/01-feature.png", "description": "Test failure output" }
191
191
  ```
192
192
  The dashboard renders the screenshot inline when you expand the event. Use this whenever a screenshot provides evidence for a decision, error, or finding.
193
193
 
@@ -202,14 +202,14 @@ If you do something that would be a meaningful line in a `git log` or a step you
202
202
  ### 1.0 Parse Arguments
203
203
 
204
204
  Parse `$ARGUMENTS`:
205
- - `home-dir` is always `~/junior-main/junior` (hardcoded)
206
- - Worktree directory is always `~/junior-main/junior-worktrees/`
205
+ - `home-dir` is `$PROJECT_DIR` (from environment or CLAUDE.md)
206
+ - Worktree directory is `$WORKTREES_DIR/`
207
207
  - Detect flags: `--remote`, `--resume`, `--parallel`, `--context="<text>"`
208
208
  - Extract `--context` value if present (everything between the quotes)
209
209
  - Remaining non-flag args: first = `worktree-name`
210
210
 
211
- **Auto-detect current worktree:** If no `worktree-name` is provided (with or without `--resume`), check if the current working directory is inside `~/junior-main/junior-worktrees/`. If so:
212
- - Infer `worktree-name` from the directory name (e.g., cwd `~/junior-main/junior-worktrees/fix-auth-bug` → `worktree-name = fix-auth-bug`)
211
+ **Auto-detect current worktree:** If no `worktree-name` is provided (with or without `--resume`), check if the current working directory is inside `$WORKTREES_DIR/`. If so:
212
+ - Infer `worktree-name` from the directory name (e.g., cwd `$WORKTREES_DIR/fix-auth-bug` → `worktree-name = fix-auth-bug`)
213
213
  - Automatically treat this as a `--resume` flow (no need for the flag)
214
214
 
215
215
  ### 1.1 Environment Setup
@@ -223,23 +223,23 @@ Parse `$ARGUMENTS`:
223
223
  ```
224
224
  3. `cd` into the worktree (if not already there)
225
225
  4. Check `git status` — report any uncommitted work
226
- 5. Check if `~/junior-main/outputs/<worktree-name>/handoff.md` exists from a prior session — if so, read it and present a recap of where the last agent left off, what's working, what's not, and recommended next steps
227
- 6. Check if `~/junior-main/outputs/<worktree-name>/summary.md` exists — if so, the work may already be done
226
+ 5. Check if `$TANUKI_OUTPUTS/<worktree-name>/handoff.md` exists from a prior session — if so, read it and present a recap of where the last agent left off, what's working, what's not, and recommended next steps
227
+ 6. Check if `$TANUKI_OUTPUTS/<worktree-name>/summary.md` exists — if so, the work may already be done
228
228
  7. Skip to **PHASE 2** (scope)
229
229
 
230
230
  #### If `--remote` flag (new Coder workspace):
231
231
 
232
232
  1. Create workspace:
233
233
  ```bash
234
- coder create <worktree-name> --template junior-workspace --yes
234
+ coder create <worktree-name> --template <workspace-template> --yes
235
235
  ```
236
236
  2. Set up branch:
237
237
  ```bash
238
- coder ssh <worktree-name> -- bash -c 'cd /workspace/junior && git fetch origin && git checkout -b <worktree-name> origin/develop && git pull'
238
+ coder ssh <worktree-name> -- bash -c 'cd /workspace/$PROJECT && git fetch origin && git checkout -b <worktree-name> origin/develop && git pull'
239
239
  ```
240
240
  3. Install deps:
241
241
  ```bash
242
- coder ssh <worktree-name> -- bash -c 'cd /workspace/junior && yarn install'
242
+ coder ssh <worktree-name> -- bash -c 'cd /workspace/$PROJECT && yarn install'
243
243
  ```
244
244
 
245
245
  #### Default (new local worktree):
@@ -943,7 +943,7 @@ cd <worktree-dir> && yarn dev &
943
943
 
944
944
  **Remote mode:**
945
945
  ```bash
946
- coder ssh <name> -- bash -c 'cd /workspace/junior && yarn dev &'
946
+ coder ssh <name> -- bash -c 'cd /workspace/$PROJECT && yarn dev &'
947
947
  # Get the forwarded port URL
948
948
  ```
949
949
 
@@ -959,7 +959,7 @@ Wait for the dev server to be ready (poll `http://localhost:3000` or the remote
959
959
 
960
960
  ```bash
961
961
  # 1. Create the screenshots directory first
962
- mkdir -p ~/junior-main/outputs/<worktree-name>/screenshots ~/junior-main/outputs/<worktree-name>/artifacts
962
+ mkdir -p $TANUKI_OUTPUTS/<worktree-name>/screenshots $TANUKI_OUTPUTS/<worktree-name>/artifacts
963
963
  ```
964
964
 
965
965
  ```bash
@@ -967,7 +967,7 @@ mkdir -p ~/junior-main/outputs/<worktree-name>/screenshots ~/junior-main/outputs
967
967
  npx agent-browser \
968
968
  --url "http://localhost:3000/<page>" \
969
969
  --width 1920 --height 1080 \
970
- --output ~/junior-main/outputs/<worktree-name>/screenshots/01-feature-main-view.png
970
+ --output $TANUKI_OUTPUTS/<worktree-name>/screenshots/01-feature-main-view.png
971
971
  ```
972
972
 
973
973
  ```
@@ -976,7 +976,7 @@ mcp__telemetry__log_screenshot({
976
976
  session_id,
977
977
  phase: "verification",
978
978
  description: "Main feature view with data loaded",
979
- file_path: "/Users/ykim/junior-main/outputs/<worktree-name>/screenshots/01-feature-main-view.png"
979
+ file_path: "$TANUKI_OUTPUTS/<worktree-name>/screenshots/01-feature-main-view.png"
980
980
  })
981
981
  ```
982
982
 
@@ -1002,7 +1002,7 @@ mcp__telemetry__log_event({
1002
1002
 
1003
1003
  Name screenshots descriptively:
1004
1004
  ```
1005
- ~/junior-main/outputs/<worktree-name>/screenshots/
1005
+ $TANUKI_OUTPUTS/<worktree-name>/screenshots/
1006
1006
  01-feature-main-view.png
1007
1007
  01-feature-main-view-comparison.png (if comparing to reference)
1008
1008
  01-feature-main-view-fixed.png (after a fix iteration)
@@ -1092,7 +1092,7 @@ kill %1 # or the appropriate PID
1092
1092
  Output goes in the **centralized outputs directory**, not inside the worktree:
1093
1093
 
1094
1094
  ```
1095
- ~/junior-main/outputs/<worktree-name>/
1095
+ $TANUKI_OUTPUTS/<worktree-name>/
1096
1096
  summary.md
1097
1097
  quality-analysis.md (if iterating on quality — tracks score progression across sessions)
1098
1098
  handoff.md
@@ -1134,7 +1134,7 @@ mcp__telemetry__log_event({
1134
1134
  session_id, phase: "deliverables", event_type: "info",
1135
1135
  message: "Quality analysis report: <overall-score>/10",
1136
1136
  metadata: {
1137
- report_path: "~/junior-main/outputs/<worktree>/quality-analysis.md",
1137
+ report_path: "$TANUKI_OUTPUTS/<worktree>/quality-analysis.md",
1138
1138
  overall_score: <number>,
1139
1139
  score_breakdown: { <category>: <score>, ... },
1140
1140
  version: "<V1|V2|V3...>"
@@ -1143,7 +1143,7 @@ mcp__telemetry__log_event({
1143
1143
  ```
1144
1144
 
1145
1145
  ```bash
1146
- mkdir -p ~/junior-main/outputs/<worktree-name>/screenshots ~/junior-main/outputs/<worktree-name>/artifacts
1146
+ mkdir -p $TANUKI_OUTPUTS/<worktree-name>/screenshots $TANUKI_OUTPUTS/<worktree-name>/artifacts
1147
1147
  ```
1148
1148
 
1149
1149
  ### 5.2 Write Summary
@@ -1189,7 +1189,7 @@ Log the summary as an artifact:
1189
1189
  ```
1190
1190
  mcp__telemetry__log_artifact({
1191
1191
  session_id,
1192
- file_path: "~/junior-main/outputs/<worktree-name>/summary.md",
1192
+ file_path: "$TANUKI_OUTPUTS/<worktree-name>/summary.md",
1193
1193
  artifact_type: "summary",
1194
1194
  description: "Work summary for <worktree-name>"
1195
1195
  })
@@ -1271,7 +1271,7 @@ mcp__telemetry__log_session_end({
1271
1271
 
1272
1272
  ### 5.6.1 Write Handoff Notes
1273
1273
 
1274
- **Always** write handoff notes to `~/junior-main/outputs/<worktree-name>/handoff.md`, regardless of session outcome. If the session is interrupted, failed, or even completed successfully, the next `--resume` session needs context.
1274
+ **Always** write handoff notes to `$TANUKI_OUTPUTS/<worktree-name>/handoff.md`, regardless of session outcome. If the session is interrupted, failed, or even completed successfully, the next `--resume` session needs context.
1275
1275
 
1276
1276
  ```markdown
1277
1277
  # Handoff: <worktree-name>
@@ -1315,7 +1315,7 @@ mcp__telemetry__log_event({
1315
1315
  ```
1316
1316
  mcp__telemetry__log_artifact({
1317
1317
  session_id,
1318
- file_path: "~/junior-main/outputs/<worktree-name>/handoff.md",
1318
+ file_path: "$TANUKI_OUTPUTS/<worktree-name>/handoff.md",
1319
1319
  artifact_type: "report",
1320
1320
  description: "Handoff notes for <worktree-name>"
1321
1321
  })
@@ -1358,7 +1358,7 @@ yarn dev
1358
1358
  # Then visit <relevant-url>
1359
1359
 
1360
1360
  ### Telemetry: http://localhost:3333
1361
- ### Output report: ~/junior-main/outputs/<worktree-name>/summary.md
1361
+ ### Output report: $TANUKI_OUTPUTS/<worktree-name>/summary.md
1362
1362
  ```
1363
1363
 
1364
1364
  ---
@@ -1551,8 +1551,8 @@ mcp__telemetry__log_event({
1551
1551
 
1552
1552
  ```bash
1553
1553
  # For each stream — use descriptive task-based names, NOT "stream-1":
1554
- git worktree add ~/junior-main/junior-worktrees/<parent>--<task-slug> -b <parent-branch>/<task-slug>
1555
- cmux new-workspace --cwd ~/junior-main/junior-worktrees/<parent>--<task-slug> --command "claude"
1554
+ git worktree add $WORKTREES_DIR/<parent>--<task-slug> -b <parent-branch>/<task-slug>
1555
+ cmux new-workspace --cwd $WORKTREES_DIR/<parent>--<task-slug> --command "claude"
1556
1556
  ```
1557
1557
 
1558
1558
  #### Step 3: Inject the sub-agent prompt via cmux send