@agentsignalnet/claude-plugin 0.2.111 → 0.2.112
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/.claude-plugin/plugin.json +1 -1
- package/package.json +1 -1
- package/scripts/dashboard.mjs +90 -14
package/package.json
CHANGED
package/scripts/dashboard.mjs
CHANGED
|
@@ -1459,6 +1459,15 @@ const PAGE = `<!doctype html>
|
|
|
1459
1459
|
const OPEN = new Set();
|
|
1460
1460
|
/** The rendered agent tree per channel, so reopening one costs nothing. */
|
|
1461
1461
|
const BRANCHES = new Map();
|
|
1462
|
+
/*
|
|
1463
|
+
A THIRD STATE, because two were not enough.
|
|
1464
|
+
|
|
1465
|
+
BRANCHES held HTML, and its two readings were "not set yet" (reading) and
|
|
1466
|
+
"set" (draw it, or say the channel is empty when it is ''). A read that
|
|
1467
|
+
FAILED had no way to be spelled, so it borrowed one of those and lied. A
|
|
1468
|
+
symbol cannot collide with any markup, so the three states stay distinct.
|
|
1469
|
+
*/
|
|
1470
|
+
const UNREADABLE = Symbol('unreadable');
|
|
1462
1471
|
/** Whether the channel being read has been opened for the first time yet. */
|
|
1463
1472
|
let OPENED_ONCE = false;
|
|
1464
1473
|
|
|
@@ -1491,8 +1500,32 @@ const PAGE = `<!doctype html>
|
|
|
1491
1500
|
try {
|
|
1492
1501
|
list = await (await fetch(q('/agents' + (ref ? '?channel=' + encodeURIComponent(ref) : '')))).json();
|
|
1493
1502
|
} catch {
|
|
1503
|
+
BRANCHES.set(ref ?? '', UNREADABLE);
|
|
1504
|
+
drawRail();
|
|
1505
|
+
return;
|
|
1506
|
+
}
|
|
1507
|
+
|
|
1508
|
+
/*
|
|
1509
|
+
THE SERVER SAYS WHY, AND THIS USED TO THROW IT AWAY.
|
|
1510
|
+
|
|
1511
|
+
/agents returns an object carrying "error" when the upstream call is
|
|
1512
|
+
refused -- a revoked key, a channel this key is no longer in, an API that
|
|
1513
|
+
cannot be reached -- and "recipients ?? []" turned all of that into
|
|
1514
|
+
nobody.
|
|
1515
|
+
Worse than a wrong count: the early return below meant BRANCHES was never
|
|
1516
|
+
set, so the rail sat on "reading…" indefinitely for a read that had
|
|
1517
|
+
already finished and failed.
|
|
1518
|
+
|
|
1519
|
+
An empty channel and an unreadable one are opposite facts and the rail
|
|
1520
|
+
now draws them differently.
|
|
1521
|
+
*/
|
|
1522
|
+
if (list && list.error) {
|
|
1523
|
+
BRANCHES.set(ref ?? '', UNREADABLE);
|
|
1524
|
+
if (active) ROSTER = [];
|
|
1525
|
+
drawRail();
|
|
1494
1526
|
return;
|
|
1495
1527
|
}
|
|
1528
|
+
|
|
1496
1529
|
if (active) ROSTER = list.recipients ?? [];
|
|
1497
1530
|
// People are listed too, and a person has no chat to open -- nothing is
|
|
1498
1531
|
// sent FROM a phone. Agents only.
|
|
@@ -1759,10 +1792,15 @@ const PAGE = `<!doctype html>
|
|
|
1759
1792
|
const body =
|
|
1760
1793
|
branch === undefined
|
|
1761
1794
|
? '<p class="none">reading…</p>'
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1795
|
+
: branch === UNREADABLE
|
|
1796
|
+
// NOT "no agents yet". The read failed, and saying a channel is
|
|
1797
|
+
// empty because we could not look at it is the one answer that
|
|
1798
|
+
// sends somebody looking for the wrong problem.
|
|
1799
|
+
? '<p class="none">could not read this channel</p>'
|
|
1800
|
+
// A channel really can have no agents yet -- a company that has just
|
|
1801
|
+
// been created. Without this the expanded channel is blank, which
|
|
1802
|
+
// reads as still loading rather than as an answer.
|
|
1803
|
+
: branch || '<p class="none">no agents yet</p>';
|
|
1766
1804
|
return '<div class="chan">' + head + '<div class="chan-body">' + body + '</div></div>';
|
|
1767
1805
|
}).join('');
|
|
1768
1806
|
|
|
@@ -3253,9 +3291,45 @@ const server = createServer(async (req, res) => {
|
|
|
3253
3291
|
onboardingOn && inScope(onboardingOn)
|
|
3254
3292
|
? await upstream('/v1/agents', onboardingOn.key)
|
|
3255
3293
|
: { error: 'unscoped' };
|
|
3256
|
-
|
|
3294
|
+
/*
|
|
3295
|
+
A ROSTER THAT COULD NOT BE READ IS NOT AN EMPTY ONE.
|
|
3296
|
+
|
|
3297
|
+
This was `roster.error ? []`, and every step below then reported on a
|
|
3298
|
+
channel it had never seen. Two of them said something false rather than
|
|
3299
|
+
nothing: "Have somebody to reach" printed "nobody else in this channel
|
|
3300
|
+
yet", and "Say what each agent does" printed "all described" -- because
|
|
3301
|
+
zero agents means zero undescribed ones, so a failed read came out as a
|
|
3302
|
+
clean bill of health.
|
|
3303
|
+
|
|
3304
|
+
Observed on 2026-08-23: a dashboard holding a key for a channel the
|
|
3305
|
+
session had since left showed 0 people, with no way to tell that from a
|
|
3306
|
+
channel that really is empty. The key is in the keychain, so the channel
|
|
3307
|
+
is listed at startup and looks watched.
|
|
3308
|
+
|
|
3309
|
+
`rosterFailed` carries the reason through, and every step that leans on
|
|
3310
|
+
the roster is now NOT DONE while it is set -- unknown must not read as
|
|
3311
|
+
complete, which is the direction this failed in.
|
|
3312
|
+
*/
|
|
3313
|
+
/*
|
|
3314
|
+
TWO REASONS THE ROSTER IS ABSENT, AND ONLY ONE IS A FAILURE.
|
|
3315
|
+
|
|
3316
|
+
`unscoped` is this file refusing to read on purpose, because the company
|
|
3317
|
+
question is still open and reading would put one company's counts under
|
|
3318
|
+
another's name. Nothing went wrong and there is nothing to report; the
|
|
3319
|
+
steps stay not-done and say what they always said.
|
|
3320
|
+
|
|
3321
|
+
Anything else came from upstream -- a revoked key, a channel this key is
|
|
3322
|
+
no longer in, an API that cannot be reached -- and that is the case this
|
|
3323
|
+
whole block exists for. Conflating the two was caught by
|
|
3324
|
+
a-dashboard-shows-one-companys-people, which asserts the wording of the
|
|
3325
|
+
open-question state.
|
|
3326
|
+
*/
|
|
3327
|
+
const rosterFailed =
|
|
3328
|
+
roster.error && roster.error !== 'unscoped' ? String(roster.error) : null;
|
|
3329
|
+
const others = rosterFailed
|
|
3257
3330
|
? []
|
|
3258
3331
|
: (roster.recipients ?? []).filter((r) => r.key !== (self && self.key));
|
|
3332
|
+
const unread = rosterFailed ? `could not read this channel — ${rosterFailed}` : null;
|
|
3259
3333
|
const current = settings();
|
|
3260
3334
|
|
|
3261
3335
|
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
@@ -3282,19 +3356,21 @@ const server = createServer(async (req, res) => {
|
|
|
3282
3356
|
// Derived from the roster, because the description is what other
|
|
3283
3357
|
// agents read when deciding who to hand work to. An agent with no
|
|
3284
3358
|
// description is reachable and unchoosable.
|
|
3285
|
-
done: others.length > 0 && others.every((r) => !r.is_agent || r.description),
|
|
3286
|
-
detail:
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3359
|
+
done: !rosterFailed && others.length > 0 && others.every((r) => !r.is_agent || r.description),
|
|
3360
|
+
detail:
|
|
3361
|
+
unread ??
|
|
3362
|
+
(() => {
|
|
3363
|
+
const bare = others.filter((r) => r.is_agent && !r.description);
|
|
3364
|
+
return bare.length ? `${bare.length} with no description` : 'all described';
|
|
3365
|
+
})(),
|
|
3290
3366
|
},
|
|
3291
3367
|
{
|
|
3292
3368
|
id: 'reach',
|
|
3293
3369
|
title: 'Have somebody to reach',
|
|
3294
|
-
done: others.length > 0,
|
|
3295
|
-
detail:
|
|
3296
|
-
|
|
3297
|
-
: 'nobody else in this channel yet',
|
|
3370
|
+
done: !rosterFailed && others.length > 0,
|
|
3371
|
+
detail:
|
|
3372
|
+
unread ??
|
|
3373
|
+
(others.length ? `${others.length} reachable` : 'nobody else in this channel yet'),
|
|
3298
3374
|
},
|
|
3299
3375
|
{
|
|
3300
3376
|
id: 'limits',
|