@koalaauto/agentchannel 3.99.2 → 3.99.3

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.
@@ -31,7 +31,7 @@ export function attentionKind(type) {
31
31
  return 'mention';
32
32
  if (/repl|change_request|changes_requested/.test(t))
33
33
  return 'reply';
34
- if (/task/.test(t))
34
+ if (/task|accept|review|merge|takeover/.test(t))
35
35
  return 'task';
36
36
  return 'item';
37
37
  }
@@ -54,7 +54,9 @@ export function normalizeAttention(r, fromNotifications = false) {
54
54
  counts[k] = (counts[k] ?? 0) + 1;
55
55
  ids.push(String(x.id ?? x.event_id ?? x.message_id ?? `${k}:${ids.length}`));
56
56
  }
57
- const byKind = r?.by_kind ?? r?.counts;
57
+ // the hub's own list of what waits (`waiting`); an older hub has only `by_kind`, which also counts the day's activity
58
+ // around the person (mentions of their agents, replies in their threads): of it only the kinds that wait are taken
59
+ const byKind = r?.waiting ?? waitingOf(r?.by_kind) ?? r?.counts;
58
60
  if (!items.length && byKind && typeof byKind === 'object') {
59
61
  // GET /me/attention: counts only (no ids); "new" = a count went up (AttentionNotifier)
60
62
  for (const [key, n] of Object.entries(byKind)) {
@@ -72,6 +74,14 @@ export function normalizeAttention(r, fromNotifications = false) {
72
74
  .map((x) => ({ id: line(x.id, 40), task: line(x.task, 20), runs: line(x.runs), money: line(x.money, 80), confirm: line(x.confirm, 40), decline: line(x.decline, 40) }));
73
75
  return { total, counts, ids, confirmations };
74
76
  }
77
+ /** GET /me/attention `by_kind` of a hub without `waiting`: the kinds that wait for the person, the @ of themself as `mention`. */
78
+ const WAITING_KINDS = ['decision', 'question', 'acceptance', 'merge', 'review', 'takeover', 'unanswered'];
79
+ function waitingOf(by) {
80
+ if (!by || typeof by !== 'object')
81
+ return undefined;
82
+ const b = by;
83
+ return { ...Object.fromEntries(WAITING_KINDS.map((k) => [k, Number(b[k]) || 0])), mention: Number(b.mention_you) || 0 };
84
+ }
75
85
  /** What needs the owner now (agent key: the owner's view). */
76
86
  export async function fetchAttention(request) {
77
87
  try {
@@ -1,4 +1,4 @@
1
- export declare const VERSION = "3.99.2";
1
+ export declare const VERSION = "3.99.3";
2
2
  /** The npm package (scripts/release.mjs keeps it and VERSION in step with package.json). */
3
3
  export declare const PKG_NAME = "@koalaauto/agentchannel";
4
4
  /**
@@ -1,4 +1,4 @@
1
- export const VERSION = '3.99.2';
1
+ export const VERSION = '3.99.3';
2
2
  /** The npm package (scripts/release.mjs keeps it and VERSION in step with package.json). */
3
3
  export const PKG_NAME = '@koalaauto/agentchannel';
4
4
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koalaauto/agentchannel",
3
- "version": "3.99.2",
3
+ "version": "3.99.3",
4
4
  "description": "Hand work between your team's agents (Claude Code, Codex) and follow it in one panel: the ach CLI, MCP server and runner for AgentChannel v2",
5
5
  "keywords": [
6
6
  "agentchannel",