ework-web 0.10.88 → 0.10.90

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": "ework-web",
3
- "version": "0.10.88",
3
+ "version": "0.10.90",
4
4
  "type": "module",
5
5
  "description": "ework-web — standalone multi-project issue tracker. Local SQLite-backed, no external API dependency. Bun + TypeScript + SSR HTML.",
6
6
  "license": "MIT",
@@ -118,6 +118,7 @@ export function buildPiSessionPage(sessionId: string, limit: number, asc = false
118
118
 
119
119
  const cards: PiCard[] = [];
120
120
  const openTools = new Map<string, PiToolCall>();
121
+ const seenContent = new Set<string>();
121
122
  let inputTok = 0, outputTok = 0, cacheTok = 0, peakTok = 0;
122
123
  let cwd = "";
123
124
  let first = "", last = "";
@@ -129,6 +130,13 @@ export function buildPiSessionPage(sessionId: string, limit: number, asc = false
129
130
  }
130
131
  if (e.type !== "message" || !e.message) continue;
131
132
  const m = e.message;
133
+ // pi re-emits identical message content as new events (streaming steps,
134
+ // re-persisted context, repeated tool results). Collapse exact repeats —
135
+ // usage excluded from the key so re-emissions still merge, and their
136
+ // (identical) usage is only counted once.
137
+ const contentKey = `${m.role ?? ""}\u0000${JSON.stringify(m.content ?? [])}`;
138
+ if (seenContent.has(contentKey)) continue;
139
+ seenContent.add(contentKey);
132
140
  const u = m.usage;
133
141
  if (u) {
134
142
  inputTok += u.input ?? 0;
@@ -79,7 +79,8 @@ CREATE TABLE IF NOT EXISTS {{comments}} (
79
79
  UNIQUE uq_comments_upstream (upstream_comment_id),
80
80
  CONSTRAINT {{fk_comments_issue}} FOREIGN KEY (issue_id) REFERENCES {{issues}}(id) ON DELETE CASCADE,
81
81
  CONSTRAINT {{fk_comments_author}} FOREIGN KEY (author) REFERENCES {{users}}(login),
82
- model VARCHAR(128) NOT NULL DEFAULT '',
82
+ model VARCHAR(128) NOT NULL DEFAULT ''
83
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
83
84
  CREATE INDEX comments_issue_created ON {{comments}} (issue_id, created_at);
84
85
  CREATE INDEX comments_author ON {{comments}} (author);
85
86