pi-ptc-meter 1.0.13 → 1.0.14

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.
Files changed (2) hide show
  1. package/README.md +50 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # pi-ptc-meter
2
2
 
3
+ > 中文 · [English](#english)(页面内折叠)
4
+
3
5
  每轮工具调用计量:统计调用次数与耗时,并把数字回灌给模型。
4
6
 
5
7
  ## 安装
@@ -38,3 +40,51 @@ pi install npm:pi-ptc-meter
38
40
  ## License
39
41
 
40
42
  MIT
43
+
44
+ ---
45
+
46
+ <a id="english"></a>
47
+
48
+ <details>
49
+ <summary><b>English</b></summary>
50
+
51
+ Per-turn tool-call metering: counts calls and duration, then feeds the numbers back to the model.
52
+
53
+ ## Install
54
+
55
+ ```bash
56
+ pi install npm:pi-ptc-meter
57
+ ```
58
+
59
+ ## Configuration
60
+
61
+ Config file `~/.pi/ptc-meter.json` (optional; invalid JSON falls back):
62
+
63
+ | Key | Default | Description |
64
+ | --- | --- | --- |
65
+ | `threshold` | `39` | Per-turn call threshold (> 0) |
66
+ | `inject` | `true` | Enable the feedback message |
67
+ | `notify` | `false` | Use UI notifications instead |
68
+
69
+ Also: log `~/.pi/ptc-meter.jsonl` (1 MiB truncation, tail-preserving); no environment variables.
70
+
71
+ ## Commands
72
+
73
+ | Command | Purpose |
74
+ | --- | --- |
75
+ | `/ptc [n]` | Last n turns: counts, duration, estimates, median, over-threshold |
76
+
77
+ ## What it does (source facts)
78
+
79
+ - `tool_call`: increments a counter (never intercepts or rewrites).
80
+ - `turn_end`: records calls and duration (no disk write).
81
+ - `agent_end`: writes one log line per run.
82
+ - `before_agent_start`: settles the previous turn and feeds back counts, duration, deviation and the baseline median as a `nextTurn` trailing message.
83
+ - `session_start`: resets module-level counters.
84
+ - The `ptc_meter` system section holds only a byte-stable skeleton.
85
+
86
+ ## License
87
+
88
+ MIT
89
+
90
+ </details>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-ptc-meter",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "description": "Measures tool-call batching per turn and feeds the numbers back to the model.",
5
5
  "type": "module",
6
6
  "license": "MIT",