@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.
- package/dist/src/attention.js +12 -2
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/package.json +1 -1
package/dist/src/attention.js
CHANGED
|
@@ -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
|
-
|
|
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 {
|
package/dist/src/version.d.ts
CHANGED
package/dist/src/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@koalaauto/agentchannel",
|
|
3
|
-
"version": "3.99.
|
|
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",
|