Official
chat
Built-in chat UI (JavaScript UI plugin).
The app opens the listing; nothing installs until an agent in your Plugins workspace has read the files and you enable the plugin. In a terminal: dvg install divergence/chat@0.2.9
Permissions in 0.2.9
Files
time.ts1.8 KB
// How the transcript tells time: how long a turn or a subagent went, and when a message was sent.
/** "42s", "3m 05s", "1h 02m": a span of time to the nearest second. */
export function duration(ms: number): string {
const seconds = Math.max(0, Math.round(ms / 1000));
if (seconds < 60) return `${seconds}s`;
const minutes = Math.floor(seconds / 60);
if (minutes < 60) return `${minutes}m ${String(seconds % 60).padStart(2, "0")}s`;
return `${Math.floor(minutes / 60)}h ${String(minutes % 60).padStart(2, "0")}m`;
}
// Midnight of a date's day as a UTC time, so that the days between two dates
// stay whole across a change of the clock.
const day = (date: Date) => Date.UTC(date.getFullYear(), date.getMonth(), date.getDate());
const time = new Intl.DateTimeFormat([], { hour: "numeric", minute: "2-digit" });
const date = new Intl.DateTimeFormat([], { month: "short", day: "numeric" });
const yearDate = new Intl.DateTimeFormat([], { month: "short", day: "numeric", year: "numeric" });
const full = new Intl.DateTimeFormat([], { dateStyle: "full", timeStyle: "short" });
/// When a message was sent, as its action row says it: the time on the day it
/// was sent ("3:42 PM"), "Yesterday 3:42 PM", or else its date ("Oct 28", with
/// the year when it was another year), and the full date and time for its
/// tooltip. Null for a message without a time.
export function sentAt(iso: string | undefined, now = Date.now()): { label: string; full: string } | null {
const at = new Date(iso ?? Number.NaN);
if (Number.isNaN(at.getTime())) return null;
const today = new Date(now);
const days = (day(today) - day(at)) / 86_400_000;
const label = days < 1 ? time.format(at) : days === 1 ? `Yesterday ${time.format(at)}`
: (at.getFullYear() === today.getFullYear() ? date : yearDate).format(at);
return { label, full: full.format(at) };
}Versions
| Version | Published | Plugin API | Size | Permissions | Status |
|---|---|---|---|---|---|
| 0.2.9latest | Nov 21, 2026 | >=5 <6 | 349 KB | 5 permissions | Listed |
| 0.2.8 | Nov 16, 2026 | >=5 <6 | 348.6 KB | 5 permissions | Listed |
| 0.2.7 | Nov 11, 2026 | >=5 <6 | 314.3 KB | 5 permissions | Listed |
| 0.2.6 | Nov 9, 2026 | >=5 <6 | 306.2 KB | 5 permissions | Listed |
| 0.2.5 | Oct 27, 2026 | >=2 <4 | 178.6 KB | 5 permissions | Listed |
No comments yet.