diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json
index 6291c09..8abdd09 100644
--- a/.claude-plugin/marketplace.json
+++ b/.claude-plugin/marketplace.json
@@ -6,14 +6,14 @@
},
"metadata": {
"description": "Basalt — the trust layer for AI-generated work. Connect your AI to publish, update and share governed docs by URL.",
- "version": "0.3.5"
+ "version": "0.3.6"
},
"plugins": [
{
"name": "basalt",
"source": "./plugins/basalt",
"description": "Connect your AI to Basalt — publish, update and share governed docs by URL. Bundles the Basalt MCP server (OAuth) + a skill that converges on it when you ask to publish or share written work.",
- "version": "0.3.5",
+ "version": "0.3.6",
"author": {
"name": "Cofoundy SAC"
},
diff --git a/README.md b/README.md
index 813629b..861401d 100644
--- a/README.md
+++ b/README.md
@@ -140,15 +140,21 @@ workspace directly.
-**New first, then edits.** Each doc says what the session did to it: `new v1` when the
-session created it, `edited v7` when it published a new version of a doc that already
-existed (the version comes from the server; basalt-cli ≥ 0.16.1 prints it, and a pushed
-doc is `new` when the push added the file). The band shows the newest doc the session
-*created*, with the tally beside it (`1 new · 2 edited`); the pane lists the created docs
-first, under their own heading, then the edits, newest first in each. Publishing the same
-doc again updates its row: the version moves, and a doc the session created stays `new`.
-
-`o` opens the doc in the band in your browser, `c` copies its URL, `l` (or `/basalt-links`)
+**Unseen first.** A doc is *unseen* until you open or copy it, and turns unseen again when
+the session publishes it once more: a doc an agent published while you were away from a
+long session never hides behind one you already read. The band shows the first unseen
+doc with the count beside it (`● 2 unseen`) and goes quiet (`5 docs`, dimmed) once you
+opened everything; the pane lists the unseen docs under their own heading, then the seen
+ones. Within each group, created docs come before new versions, newest first.
+
+Each doc also says what the session did to it: `created v1` when the session created it,
+`edited v7` when it published a new version of a doc that already existed (the version
+comes from the server; basalt-cli ≥ 0.16.1 prints it, and a pushed doc is `created` when
+the push added the file). A doc the session created stays `created` when it publishes it
+again.
+
+`o` opens the doc in the band in your browser (no browser on the box, as over SSH: it
+copies the link and says so), `c` copies its URL, `l` (or `/basalt-links`)
opens a side pane with every doc of the session. The pane stays pinned across reloads
and sessions until you close it. Long nested names keep the title (cut in the middle,
so its version suffix survives), then the space, then the nearest folders.
diff --git a/plugins/basalt/.claude-plugin/plugin.json b/plugins/basalt/.claude-plugin/plugin.json
index 690d0f9..007ada6 100644
--- a/plugins/basalt/.claude-plugin/plugin.json
+++ b/plugins/basalt/.claude-plugin/plugin.json
@@ -1,7 +1,7 @@
{
"name": "basalt",
"description": "Connect your AI to Basalt — publish, update and share governed docs by URL. Bundles the Basalt MCP server (OAuth), a skill that converges on it when you ask to publish or share written work, and quiet session hooks (auth probe · edit tracking · publish nudge).",
- "version": "0.3.5",
+ "version": "0.3.6",
"author": {
"name": "Cofoundy SAC",
"url": "https://cofoundy.dev"
diff --git a/plugins/basalt/hooks/register.tsx b/plugins/basalt/hooks/register.tsx
index d797db7..91939b8 100644
--- a/plugins/basalt/hooks/register.tsx
+++ b/plugins/basalt/hooks/register.tsx
@@ -212,14 +212,26 @@ export const withWorkspace = (link: BasaltLink, list: BasaltLink[]): BasaltLink
// Rows stored by an earlier version carry no trail.
const fresh = (link: BasaltLink) => (Array.isArray(link.trail) ? link : toLink(link.url, link.by, link.at))
-// Created docs first, then new versions, each newest first: what the person most likely
-// wants to open is what this session MADE. Rows from an earlier band (no kind) go last.
+// Unseen: published since the person last opened or copied it (or never opened at all).
+export const isUnseen = (link: BasaltLink): boolean => link.seenAt === undefined || link.at > link.seenAt
+
+// What the person has not opened yet comes first: a doc published while they were away
+// from the session must not hide behind one they already read. Within each group, created
+// docs before new versions, newest first; rows from an earlier band (no kind) last.
const RANK = { new: 0, edited: 1, unknown: 2 } as const
export const ordered = (list: BasaltLink[]): BasaltLink[] =>
- [...list].sort((a, b) => RANK[a.kind ?? 'unknown'] - RANK[b.kind ?? 'unknown'] || b.at - a.at)
-
-// Publishing a doc again updates its row instead of adding nothing: the time moves, the
-// version is the latest, and a doc this session created stays «new».
+ [...list].sort(
+ (a, b) =>
+ Number(isUnseen(b)) - Number(isUnseen(a)) || RANK[a.kind ?? 'unknown'] - RANK[b.kind ?? 'unknown'] || b.at - a.at,
+ )
+
+// Opening or copying a doc is seeing it.
+export const markSeen = (list: BasaltLink[], url: string, at: number): BasaltLink[] =>
+ list.map(link => (link.url === url ? { ...link, seenAt: Math.max(at, link.at) } : link))
+
+// Publishing a doc again updates its row instead of adding nothing: the time moves (so a
+// doc already seen turns unseen again), the version is the latest, and a doc this session
+// created stays created.
export const merge = (row: BasaltLink, again: BasaltLink): BasaltLink => ({
...row,
at: Math.max(row.at, again.at),
@@ -235,9 +247,6 @@ const cut = (text: string, room: number) => {
return text.slice(0, head) + '…' + text.slice(text.length - (keep - head))
}
-// Fits "space › folder › title" into `room` cells: the title always survives
-// (cut in the middle, so its start and its version suffix stay), then the
-// nearest folders, and whatever does not fit collapses to "…".
// Fits "space › folder › title" into `room` cells. Priority: the title (cut in
// the middle, so its start and its version suffix stay), then the space, then
// the nearest folders; the folders that do not fit collapse to "…".
@@ -264,42 +273,37 @@ export const crumb = (link: BasaltLink, room: number) => {
return { path: [...head, '…', ...near].map(part => part + ' › ').join(''), title }
}
-async function openUrl($: EngineInterface, url: string) {
- const mac = await $.process.run(['open', url]).catch(() => ({ exitCode: 1 }))
- if (mac.exitCode !== 0) await $.process.run(['xdg-open', url]).catch(() => undefined)
-}
-
// English by default; Spanish when the locale says so (POSIX precedence:
// LC_ALL, then LC_MESSAGES, then LANG).
const STRINGS = {
en: {
- open: 'Open', copy: 'Copy', all: 'All', copied: 'Link copied',
+ open: 'Open', copy: 'Copy', all: 'All', copied: 'Link copied', notCopied: 'Could not copy the link',
+ noBrowser: 'No browser here — link copied',
pane: 'Basalt · session docs', empty: 'No Basalt docs in this session yet.',
command: 'List the Basalt docs of this session', opened: 'Basalt docs of this session opened in the pane.',
session: 'session', subagent: 'subagent',
- new: 'new', edited: 'edited', newGroup: 'New', editedGroup: 'Edited',
+ new: 'created', edited: 'edited', unseen: 'unseen', unseenGroup: 'Unseen', seenGroup: 'Seen',
},
es: {
- open: 'Abrir', copy: 'Copiar', all: 'Todos', copied: 'Link copiado',
+ open: 'Abrir', copy: 'Copiar', all: 'Todos', copied: 'Link copiado', notCopied: 'No se pudo copiar el link',
+ noBrowser: 'Sin navegador aquí — link copiado',
pane: 'Basalt · docs de la sesión', empty: 'Ningún doc de Basalt en esta sesión todavía.',
command: 'Lista los docs de Basalt de esta sesión', opened: 'Docs de Basalt de esta sesión abiertos en el panel.',
session: 'sesión', subagent: 'subagente',
- new: 'nuevo', edited: 'editado', newGroup: 'Nuevos', editedGroup: 'Editados',
+ new: 'creado', edited: 'editado', unseen: 'sin abrir', unseenGroup: 'Sin abrir', seenGroup: 'Vistos',
},
} as const
type Strings = (typeof STRINGS)[keyof typeof STRINGS]
-// «nuevo» / «editado v3» — the one word that says what this session did to the doc.
+// «creado v1» / «editado v3» — what this session did to the doc. Never «new»: that word
+// reads as «not seen yet», which is `isUnseen`'s job.
export const tag = (link: BasaltLink, t: Pick): string =>
link.kind === undefined ? '' : `${link.kind === 'new' ? t.new : t.edited}${link.version ? ` v${link.version}` : ''}`
-// «1 nuevo · 2 editados»; falls back to the plain count when no row knows its kind.
-export const tally = (list: BasaltLink[], t: Pick, es: boolean): string => {
- const n = list.filter(l => l.kind === 'new').length
- const m = list.filter(l => l.kind === 'edited').length
- if (n + m === 0) return `${list.length} doc${list.length === 1 ? '' : 's'}`
- const plural = (word: string, k: number) => (k === 1 || !es ? word : `${word}s`)
- return [n ? `${n} ${plural(t.new, n)}` : '', m ? `${m} ${plural(t.edited, m)}` : ''].filter(Boolean).join(' · ')
+// «● 2 sin abrir» while something waits; «5 docs» once everything was opened.
+export const tally = (list: BasaltLink[], t: Pick): string => {
+ const unseen = list.filter(isUnseen).length
+ return unseen > 0 ? `● ${unseen} ${t.unseen}` : `${list.length} doc${list.length === 1 ? '' : 's'}`
}
export const pickLanguage = (lcAll?: string, lcMessages?: string, lang?: string): keyof typeof STRINGS => {
@@ -320,9 +324,30 @@ async function openPane($: EngineInterface, focus?: true) {
await $.ui.open({ id: PANE, title: (await labels($)).pane, ...(focus ? { focus } : {}) })
}
-async function copyUrl($: EngineInterface, url: string, surface: Parameters[0]['surface']) {
- await $.ui.copy({ text: url, surface })
- $.ui.toast((await labels($)).copied)
+type Surface = Parameters[0]['surface']
+
+async function seen($: EngineInterface, url: string) {
+ const now = await $.clock.now()
+ await update($, links, list => markSeen(list.map(fresh), url, now))
+}
+
+// The press marks the doc seen first, so the band answers at once; the slow part follows.
+async function copyUrl($: EngineInterface, url: string, surface: Surface) {
+ await seen($, url)
+ const copied = await $.ui.copy({ text: url, surface }).then(r => r.isCopied, () => false)
+ const t = await labels($)
+ $.ui.toast(copied ? t.copied : t.notCopied)
+}
+
+// macOS `open`, else `xdg-open`. Neither (a remote box over SSH, no display): copy it
+// instead, so Open never does nothing.
+async function openUrl($: EngineInterface, url: string, surface: Surface) {
+ await seen($, url)
+ const run = (cmd: string) => $.process.run([cmd, url]).then(r => r.exitCode === 0, () => false)
+ if ((await run('open')) || (await run('xdg-open'))) return
+ const copied = await $.ui.copy({ text: url, surface }).then(r => r.isCopied, () => false)
+ const t = await labels($)
+ $.ui.toast(copied ? t.noBrowser : t.notCopied)
}
// Whether this terminal shows kitty graphics: kitty or Ghostty, run directly.
@@ -418,8 +443,10 @@ export const register: Register = on => {
const { Box, Button, Text } = $.ui.resolve(e)
const t = await labels($)
- const count = tally(list, t, t === STRINGS.es)
+ const count = tally(list, t)
const label = tag(last, t)
+ // Unseen speaks in Signal Teal; once everything was opened the band goes quiet.
+ const waiting = isUnseen(last)
const { path, title } = crumb(last, e.props.bodyColumns - BAND_CHROME - count.length - (label ? label.length + 3 : 0))
const below = await next(e)
@@ -430,12 +457,12 @@ export const register: Register = on => {
basalt
- {count}
+ {count}
- {path}
- {title}
- {label ? · {label} : null}
-