diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json
index 490c5de..354a94e 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.0"
+ "version": "0.3.1"
},
"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.0",
+ "version": "0.3.1",
"author": {
"name": "Cofoundy SAC"
},
diff --git a/README.md b/README.md
index 70484b8..473917e 100644
--- a/README.md
+++ b/README.md
@@ -130,7 +130,7 @@ above the prompt keeps them: every `app.basalt.cofoundy.ai` link that enters the
session — from the CLI, the MCP, the model's own text or a subagent — lands there.
-
+
`o` opens the latest doc in your browser, `c` copies its URL, `l` (or `/basalt-links`)
@@ -142,6 +142,9 @@ The mark is the real logo where the surface can draw it: the SVG on the desktop
a PNG on kitty or Ghostty run directly, and `⬣` in Molten elsewhere (inside tmux,
screen, zellij or herdr Claude Code draws no pictures).
+Labels are in English, and in Spanish when your locale is (`LC_ALL`, `LC_MESSAGES` or
+`LANG` starting with `es`).
+
It is a Claude Code function-hooks module (early access); clients without function
hooks keep the three shell hooks above, unchanged. Already installed? Update the
plugin (`/plugin` → basalt → update) and run `/reload-plugins`.
diff --git a/assets/readme/links-band.svg b/assets/readme/links-band.svg
index d37b899..f2d8cea 100644
--- a/assets/readme/links-band.svg
+++ b/assets/readme/links-band.svg
@@ -1,6 +1,6 @@
The Basalt links band in Claude Code
-A Claude Code session where the agent published three docs. Above the prompt, the Basalt band shows the Basalt mark, 3 docs and the latest doc, architecture-v2, with the buttons Abrir, Copiar and Todos. A side pane lists every doc of the session with its space, folder and link.
+A Claude Code session where the agent published three docs. Above the prompt, the Basalt band shows the Basalt mark, 3 docs and the latest doc, architecture-v2, with the buttons Open, Copy and All. A side pane lists every doc of the session with its space, folder and link.
@@ -49,33 +49,33 @@
docs
handbook › … ›
architecture-v2
-[ Abrir ]
-[ Copiar ]
-[ Todos ]
+[ Open ]
+[ Copy ]
+[ All ]
❯
-Basalt · docs de la sesión
+Basalt · session docs
architecture-v2
handbook › architecture
https://app.basalt.co…ture/architecture-v2
-[ Abrir ]
-[ Copiar ]
- · sesión
+[ Open ]
+[ Copy ]
+ · session
deploy-runbook
handbook › runbooks
https://app.basalt.co…ooks/deploy-runbook
-[ Abrir ]
-[ Copiar ]
- · sesión
+[ Open ]
+[ Copy ]
+ · session
q3-incident-review
handbook › postmortems
https://app.basalt.co…/q3-incident-review
-[ Abrir ]
-[ Copiar ]
- · subagente
+[ Open ]
+[ Copy ]
+ · subagent
o
open the latest doc
diff --git a/plugins/basalt/.claude-plugin/plugin.json b/plugins/basalt/.claude-plugin/plugin.json
index 26cae5f..e50ac1c 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.0",
+ "version": "0.3.1",
"author": {
"name": "Cofoundy SAC",
"url": "https://cofoundy.dev"
diff --git a/plugins/basalt/hooks/register.tsx b/plugins/basalt/hooks/register.tsx
index b5cd1de..6d849ea 100644
--- a/plugins/basalt/hooks/register.tsx
+++ b/plugins/basalt/hooks/register.tsx
@@ -20,7 +20,7 @@ const URL_RE = /https:\/\/app\.basalt\.cofoundy\.ai\/[^\s)\]"'<>`\\]+/g
const BAND_CHROME = 24 + 44
const links = atom({ plugin: 'basalt', key: 'links' } as const, [])
-// Junta todos los strings de un content (texto del modelo, tool results, anidados).
+// Every string in a row's content (model text, tool results, nested blocks).
const strings = (value: unknown, out: string[] = []): string[] => {
if (typeof value === 'string') out.push(value)
else if (Array.isArray(value)) value.forEach(v => strings(v, out))
@@ -39,7 +39,7 @@ export const toLink = (url: string, by: string, at: number): BasaltLink => {
return { url, title, trail: trail.slice(0, -1), by, at }
}
-// Rows stored by an earlier version of this mod carry no trail.
+// 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))
const cut = (text: string, room: number) => {
@@ -84,15 +84,45 @@ async function openUrl($: EngineInterface, url: string) {
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',
+ 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',
+ },
+ es: {
+ open: 'Abrir', copy: 'Copiar', all: 'Todos', copied: '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',
+ },
+} as const
+type Strings = (typeof STRINGS)[keyof typeof STRINGS]
+
+export const pickLanguage = (lcAll?: string, lcMessages?: string, lang?: string): keyof typeof STRINGS => {
+ const locale = lcAll || lcMessages || lang || ''
+
+ return locale.toLowerCase().startsWith('es') ? 'es' : 'en'
+}
+
+async function labels($: EngineInterface): Promise {
+ const language = pickLanguage(await $.env.get('LC_ALL'), await $.env.get('LC_MESSAGES'), await $.env.get('LANG'))
+
+ return STRINGS[language]
+}
+
// The pane stays open across reloads and sessions until the person closes it.
async function openPane($: EngineInterface, focus?: true) {
await $.store.set('isPinned', true)
- await $.ui.open({ id: PANE, title: 'Basalt · docs de la sesión', ...(focus ? { focus } : {}) })
+ 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('Link copiado')
+ $.ui.toast((await labels($)).copied)
}
// Whether this terminal shows kitty graphics: kitty or Ghostty, run directly.
@@ -131,7 +161,7 @@ async function mark($: EngineInterface, e: Parameters {
on('session.start', async ($, e, next) => {
- await $.command.register({ name: 'basalt-links', description: 'Lista los docs de Basalt de esta sesión' })
+ await $.command.register({ name: 'basalt-links', description: (await labels($)).command })
if ((await $.store.get('isPinned')) === true) void openPane($)
return next(e)
@@ -140,16 +170,16 @@ export const register: Register = on => {
on('command.run', { command: 'basalt-links' }, async $ => {
await openPane($)
- return { text: 'Docs de Basalt de esta sesión abiertos en el panel.' }
+ return { text: (await labels($)).opened }
})
- // Cada fila que entra a la conversación (tuya, del modelo, de un tool, de un subagente) se escanea.
+ // Every row the conversation keeps (the person's, the model's, a tool's, a subagent's) is scanned.
on('session.append', async ($, e, next) => {
const stored = await next(e)
const found = strings(e.message.content).flatMap(text => text.match(URL_RE) ?? [])
if (found.length > 0) {
const now = await $.clock.now()
- const by = e.agentId ? 'subagente' : 'sesión'
+ const by = e.agentId ? 'subagent' : 'session'
await update($, links, list => {
const known = new Set(list.map(link => link.url))
const fresh = [...new Set(found.map(url => url.replace(/[.,;:!?]+$/, '')))]
@@ -169,6 +199,7 @@ export const register: Register = on => {
if (e.props.hasSurvey || !last) return next(e)
const { Box, Button, Text } = $.ui.resolve(e)
+ const t = await labels($)
const { path, title } = crumb(last, e.props.bodyColumns - BAND_CHROME)
const below = await next(e)
@@ -183,11 +214,11 @@ export const register: Register = on => {
doc{list.length === 1 ? '' : 's'}
{path}
{title}
- openUrl($, last.url)} />
+ openUrl($, last.url)} />
- copyUrl($, last.url, e.surface)} />
+ copyUrl($, last.url, e.surface)} />
- openPane($, true)} />
+ openPane($, true)} />
{below}
@@ -202,12 +233,13 @@ export const register: Register = on => {
on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
const { Box, Button, Text } = $.ui.resolve(e)
+ const t = await labels($)
const list = (await read($, links)).map(fresh)
const room = Math.max(16, e.props.bodyColumns - 2)
return (
- {list.length === 0 && Ningún doc de Basalt en esta sesión todavía. }
+ {list.length === 0 && {t.empty} }
{[...list].reverse().map(link => {
const { path } = crumb({ ...link, title: '' }, room)
@@ -217,10 +249,10 @@ export const register: Register = on => {
{link.trail.length > 0 && {path.replace(/ › $/, '')} }
{link.url}
- openUrl($, link.url)} />
+ openUrl($, link.url)} />
- copyUrl($, link.url, e.surface)} />
- · {link.by}
+ copyUrl($, link.url, e.surface)} />
+ · {link.by === 'subagent' || link.by === 'subagente' ? t.subagent : t.session}
)
diff --git a/plugins/basalt/tests/language.test.ts b/plugins/basalt/tests/language.test.ts
new file mode 100644
index 0000000..f9afd1a
--- /dev/null
+++ b/plugins/basalt/tests/language.test.ts
@@ -0,0 +1,13 @@
+import { expect, test } from 'claude-code/testing'
+
+import { pickLanguage } from '../hooks/register'
+
+test('English unless the locale is Spanish, POSIX precedence', () => {
+ expect(pickLanguage(undefined, undefined, undefined)).toBe('en')
+ expect(pickLanguage(undefined, undefined, 'en_US.UTF-8')).toBe('en')
+ expect(pickLanguage(undefined, undefined, 'es_PE.UTF-8')).toBe('es')
+ expect(pickLanguage('', '', 'es_ES.UTF-8')).toBe('es')
+ expect(pickLanguage(undefined, 'es_MX.UTF-8', 'en_US.UTF-8')).toBe('es')
+ expect(pickLanguage('en_US.UTF-8', undefined, 'es_PE.UTF-8')).toBe('en')
+ expect(pickLanguage('C', undefined, 'es_PE.UTF-8')).toBe('en')
+})