Compare commits

...
Author SHA1 Message Date
pastilhasandClaude Opus 5 e15ab2303a release 2026.08.23.05
Five languages, roles behind a foreign key, and Minesweeper out of the platform.

This one has a SCHEMA CHANGE, which is why the plan is longer than usual: two
foreign keys onto roles.name with ON UPDATE CASCADE, and the CHECK that
hardcoded four role names dropped. The plan carries the exact SQL, guarded and
idempotent, and treats bun db:push as verification rather than the mechanism —
push can fail and still exit 0, and this is precisely the create-then-constrain
shape that catches it.

Checked before cutting the tag, so the plan can state it rather than hope:
every host is on deploy/2026.08.23.04, which is the release that created and
seeded `roles`. alpha, fofos, production-pertento-bridge and
deadpool-rezio-bridge each report roles=4 and zero orphans. macbookpro has no
psql client, so only its tag could be read — the plan says so and tells the
commander to check it there rather than assume.

The SQL was run against a scratch database first: applies, applies again
unchanged, produces both FKs with ON UPDATE CASCADE and no ON DELETE, drops
ck_role_permissions_role, leaves ck_role_permissions_not_owner. Seeded with an
orphan role it raises and creates nothing, which is the case that would
otherwise half-apply.

tsgo clean, 1409 tests, docs:check green.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Officer-Session: 656f5c85-e49a-4f1f-b9f3-042a04b4d043
2026-08-23 18:38:26 +00:00
pastilhasandClaude Opus 5 4ca4becaa8 plugins: a dependency can declare the architecture its package needs
Minesweeper could not be installed by the plugin flow at all. Its game is an
i386 PE, so it needs wine32:i386 — and that package does not exist on a 64-bit
host until dpkg has been told the architecture does. No package name can say
that, so the step fell outside the manifest entirely and had to be run by hand,
which meant an install that reported success and left a game dying with
`Bad EXE format` several steps from anything mentioning architectures.

Two fields, both declarative:

`multiarch: 'i386'` on an osDependency. The platform runs `dpkg
--add-architecture` and `apt-get update` before installing, apt hosts only,
skipped when already enabled. It is a closed enum rather than a command
because it runs as root: a manifest that could supply the string could run
anything as root on every machine that installs the plugin, which is a much
larger grant than "may install wine". Same principle as a plugin websocket
naming a sidecar rather than a port.

`packages.apt` may now be a LIST. One binary really can need more than one
package — `wine` provides the launcher on PATH and `wine32:i386` the 32-bit
loader, and either alone gives a wine that cannot run what the plugin came for.
Every element goes through the same regex and reaches apt as separate argv, so
a list is no more powerful than the names in it. The regex also now accepts an
architecture suffix from the same closed set.

Enabling an architecture is system-wide and permanent — nothing here ever
disables one, including plugins:delete, because by then something else may
depend on it. So it is reported before the owner consents rather than mentioned
in a log afterwards, and only for dependencies actually being installed: a
binary already present had its architecture enabled at some point in the past.

multiarch.test.ts pins the enum against shell-shaped input, the suffix against
an unknown arch, and the report against re-announcing a change that is not
happening. 1409 pass.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Officer-Session: 656f5c85-e49a-4f1f-b9f3-042a04b4d043
2026-08-23 18:24:54 +00:00
pastilhasandClaude Opus 5 0f90003d15 convention: commit by path, not by index
`git add <path>` then a bare `git commit` commits the whole index, so a
concurrent session's staged work rides along under your message and your session
trailer. Two agents share this tree most nights and it happened tonight —
6e092c32 names one file and holds ten.

`git commit -- <paths>` is the form that does what the two-step version looks
like it does. Note the argument order: -m or -F comes BEFORE the --, or git
reads the message as a pathspec.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Officer-Session: 656f5c85-e49a-4f1f-b9f3-042a04b4d043
2026-08-23 18:12:18 +00:00
pastilhasandClaude Opus 5 db2382092e note: 6e092c32 is roles phase 2, not just the marketplace entry
That commit's message describes one file and it contains ten. Nine of them are
platform-72's roles phase 2 work — the two foreign keys, the dropped CHECK, and
UserRole becoming a string — staged and about to be committed when my own
commit landed on top of them.

The cause is mine and it is worth writing down, because this tree is shared by
more than one agent routinely: `git add <path>` followed by a bare `git commit`
commits the whole INDEX, not the path just named. Whatever a peer had staged
goes with it, under my message and my session trailer. `git commit -- <paths>`
is the form that does what the first one looks like it does.

Not amended. It is pushed, another session is working against this branch, and
rewriting shared history to fix a commit message is a worse trade than a note
that makes the history searchable. The code in it was reviewed line by line and
is correct.

Applied and verified since: both FKs exist named with ON UPDATE CASCADE and no
ON DELETE, ck_role_permissions_role is dropped, ck_role_permissions_not_owner
survives, and a probe role proved the cascade really moves grants. Second
db:push emits zero DDL, so the FK naming holds. 1403 tests pass, tsgo clean,
docs:check green.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Officer-Session: 656f5c85-e49a-4f1f-b9f3-042a04b4d043
2026-08-23 18:11:54 +00:00
pastilhasandClaude Opus 5 6e092c32ea marketplace: minesweeper in the catalogue
Without an entry the plugin is invisible to every server but this one — the
catalogue is what a remote host reads, and the bundled constant is only the
fallback when marketplace.officer.dev cannot be reached.

Its git remote was the tailnet address, which marketplace-sync would have
published verbatim: a clone URL that works on this network and nowhere else,
failing at authentication in a way that reads as a broken plugin rather than a
wrong catalogue. Repointed at gitea.officer.dev, which is the rule the sync
script's own comment already spells out.

Synced. 18/18, and the entry is live with the right source, permissions and six
osDependencies; the repo answers an anonymous https clone.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Officer-Session: 656f5c85-e49a-4f1f-b9f3-042a04b4d043
2026-08-23 18:07:50 +00:00
pastilhas 1ff271bb5e localization: fix two defects found by actually rendering the shipped locales
Neither was visible from the source or from any test — both only showed up
switching the live UI to es-ES/de-DE/fr-FR in a browser, which is what
turned up the catalogue-wiring bug this builds on top of (see prior commit).

1. FileItem.tsx had two `isDir ? 'Folder' : ...` ternaries the scanner
   cannot see (values computed inside a JSX expression, not JSX text) —
   the Type column and the grid-view size line both showed the English
   word "Folder" regardless of locale. New key files.grid.folderType,
   translated in all five catalogs.

2. files.menu.selected was a single hardcoded string ("selected" /
   "seleccionados" / "sélectionnés" / ...), not a plural form. English
   doesn't inflect "selected" for number so this was invisible in the
   source locale, but Spanish and French do: "1 seleccionados" and
   "1 sélectionnés" are both wrong, should be singular. Converted to a
   {one, other} pair in all five locales (pt-PT included — same bug,
   pre-existing) and updated SelectionActions.tsx to pass count. German
   was fine either way ("ausgewählt" doesn't inflect here).

Verified by minting a token for the owner's own account, driving a
headless browser through es-ES/de-DE/fr-FR at /settings/profile, /files,
and the file context menu, and reading the screenshots — not just running
the test suite. Owner's real settings were read before and restored after.
2026-08-23 17:50:28 +00:00
pastilhasandClaude Opus 5 fbdfd3fb89 minesweeper leaves the platform; plugin sockets relay ws-to-ws
Minesweeper is now plugins/minesweeper (gitea.officer.dev/plugins/minesweeper).
Removes /api/minesweeper, the Dashboard screen, the officerdev panel, the
permission registry entry, the App.tsx route and the hand-written websocket
provider in server.tsx. Registry entries: 22 -> 21, execution 4 -> 3.

The relay changed transport, and that is the part worth reading.

A sidecar announces exactly one port. That single announcement is the whole
provenance argument in target.ts — the platform watched the port arrive at
registration, which is the only thing separating it from a number a manifest
asserted. But a raw-TCP relay requires that port to BE a raw TCP listener, so
the sidecar cannot also serve HTTP on it, and the plugin's ordinary routes
have to fall back to the typed command vocabulary over the registration
socket. That is the mechanism the fleet has spent months retiring, and
Minesweeper would have been the first thing to go back to it.

Relaying websocket-to-websocket dissolves the conflict. The sidecar serves
HTTP and /ws on the one port it announced, exactly as the pty sidecar already
does; createSidecarProxy handles the HTTP half; and the conversion from frames
to whatever the plugin actually speaks happens inside the plugin, which is the
only process that knows. The relay is still ignorant of the payload — the
ignorance sits one layer up.

Also: the caller's JWT is no longer forwarded upstream. A sidecar has no use
for it and forwarding one puts a bearer token into whatever that process logs.
X-Officer-User carries the only part it needs. (The terminal relay still
forwards its token to the pty sidecar; not touched here.)

Verified: bunx tsgo clean, bun test 1403 pass / 0 fail, bun run docs:check
green.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Officer-Session: 656f5c85-e49a-4f1f-b9f3-042a04b4d043
2026-08-23 17:43:43 +00:00
pastilhasandClaude Opus 5 6490dbc368 localization: three shipped locales were never loaded
es-ES, de-DE and fr-FR shipped dead. Every one of their 1,129 keys was
translated and in parity, all three were in SHIPPED_LOCALES so the picker
offered them, and choosing one rendered the whole UI in raw keys.

All three catalogue files still imported only en-GB and pt-PT, so
`catalogues[code]` resolved to `{}` in every namespace — present, and useless.
Adding a locale is four edits across four files and nothing knew whether all
four had happened.

The parity tests could not have caught this and never will. They compare the
JSON files against each other, and a file nobody imports is exactly as
parity-correct as one that is loaded. The gap was between "the translation
exists" and "the app can reach it".

Registers all three in appCatalogs, panelCatalogs and uiCatalogs, moves the
merge out of I18nBridge into lib/catalogues.ts so it is testable without
mounting React, and adds catalogues.test.ts as the place that knows: every
shipped locale must resolve to a populated catalogue in all three namespaces,
and be the same size as the fallback.

Verified the test fails against the shipped code — 6 failures, panel.* for
each of the three — and passes after. 26 pass.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Officer-Session: 656f5c85-e49a-4f1f-b9f3-042a04b4d043
2026-08-23 17:38:55 +00:00
pastilhas d7a4a18ce8 localization: ship es-ES
Complete Spanish catalog across all three namespaces, 1129 keys,
machine-translated then reviewed for terminology and plurals.

Fixed on review: an awkward literal fragment in settings.accounts.description
("Quién tiene acceso, y como qué") reworded to use the established
role → "función" glossary term instead of an ad-hoc phrase. Everything
else held up — "compositor" for the chat composer avoided the same
Editor-collision German needed fixing for, Minesweeper stayed
untranslated matching pt-PT/fr-FR/de-DE precedent, and the impersonal
"se" constructions used for the file-operation plurals (Se copió /
Se copiaron) read correctly at both n=1 and n=0 — Spanish's plural
rule is one/other like English, count=0 takes the plural branch.

All 17 plural entries verified at count 0/1/2.

This closes out the three-locale rollout: es-ES, de-DE and fr-FR all
now in SHIPPED_LOCALES and all three parity tests, each shipped in
its own commit only after passing review. pt-BR stays out per the
owner's call — European Portuguese first, Brazilian is a separate
decision.
2026-08-23 17:21:37 +00:00
pastilhas d6a3bea7c9 localization: ship de-DE
Complete German catalog across all three namespaces, 1129 keys,
machine-translated then reviewed for terminology and plurals.

Fixed on review: "composer" (the chat input box) had been translated
as "Editor" in two shortcuts strings, colliding with this app's actual
Editor/Code-Editor feature — changed to "Eingabefeld". scopeDockers
had drifted from the lowercase, untranslated "dockers" every other
locale (including this one's own pt-PT/fr-FR precedent) uses for that
filter-scope label. All 17 plural entries verified at count 0/1/2 —
German uses the same one/other split as English, so this was mostly
confirming "0 Elemente" reads right, not hunting for a CLDR surprise
the way French needed.

SHIPPED_LOCALES and the three parity tests now include de-DE. es-ES
is drafted and under review — held out of the picker until it passes
its own pass.
2026-08-23 17:19:59 +00:00
pastilhas 0457bf9ff3 localization: ship fr-FR
Complete French catalog across all three namespaces (app/panel/ui),
1129 keys, machine-translated then reviewed for the two things that
go wrong automatically: technical vocabulary and plurals.

Fixed on review: a gender-agreement slip ("décrivez-la" referring to
the masculine "Prompt", should be "décrivez-le") and an incomplete
verb construction in agentRunner.keepsGoing. Also reverted "Minesweeper"
→ "Démineur" back to the untranslated proper name, matching pt-PT's
own precedent of not translating this bundled app's name.

French is the language where the 0/1/2 plural check actually bites:
Intl.PluralRules puts count=0 in the SAME category as count=1 ("one"),
unlike English/Portuguese/German/Spanish where 0 is "other". All 17
plural entries were verified against 0, 1 and 2 rather than trusting
the category names — the "one" branch is phrased as a plain singular
so it reads correctly for both 0 and 1.

Parity tests now check every non-en locale in one assertion instead
of hardcoding pt-PT; SHIPPED_LOCALES gains fr-FR so the picker offers
it. es-ES and de-DE catalogs are drafted and under review — held out
of this commit and out of SHIPPED_LOCALES until each passes its own
review, so a half-translated locale never reaches the picker.
2026-08-23 17:17:50 +00:00
pastilhas a6b4bc4170 localization: officerdev (panels) to zero convertible
Last stretch of phase 3: FileBrowserWidget's five components (tabs,
search, empty states), FileGrid (column headers, sort labels, empty
folder), UploadProgress, DictateDialog and AgentRunnerModal. Reused
ui.button.cancel/close from the shared catalog where the word was
already there instead of adding panel-local duplicates.

The two remaining scanner hits — useTaskRunner's "Running:"/"Error:"
framing — are marked i18n-exempt rather than converted: they're
interleaved with raw stdout/stderr inside one monospace <pre> feed,
so translating the frame alone would read as broken mid-buffer. Same
reasoning as the never-translate thrown-Error list, just not a thrown
Error.

officerdev (panels) added to the scanner's ZEROED guard — the check
now holds three areas at zero.
2026-08-23 16:36:48 +00:00
pastilhas ad0fd12262 toolbar family keyed (57 -> 33)
Toolbar, ActionButtons, SelectionActions and DefaultActions. Almost every string
here reused an existing files.menu.* key from the last two commits rather than
adding a duplicate — cut/copy/paste/download/delete/newFolder/uploadFiles/
uploadFolder/hideHiddenFiles were all already there. Three new: gitClone,
searchFiles, clearSelection, refresh, selected.

The clone-URL placeholder here is the same hint as NewEntryDialog's, reused rather
than restated with different example names (user/repo vs owner/repo) — one key per
meaning, not per occurrence.

The "N selected" count splits the number and the word across two spans (the word
hidden on mobile); only the word needed a key, so files.menu.selected is standalone
prose rather than an interpolated frame.
2026-08-23 16:26:36 +00:00
pastilhas 2e69b15de6 video download dialog keyed (57 -> 50)
URL/playlist fetch, per-item preview, and the download-all flow.

Most of what the scanner flagged here was the smaller half — the bulk was ternaries
and text following a `}` rather than a `>` (the same structural miss "Open" and
"Fetch" hit in FileItem), found by reading the file. dlLabel's three-way ternary,
Retry/Download, Audio only/Video, and the "· N items" count were all invisible to
the tool.

Distinguished two classes of error string carefully. `pl.error` and `info.error`
from a successful-but-failed server response are LEFT AS IS — server content,
same as apiError.message in phase 1's ServerError dialog. Our own fallback
defaults for a network failure the server never got to respond to ("Could not
fetch info", "Timed out", "Could not start the download") are ours and are
translated.

One real plural, itemCount, checked at 0/1/2 in both locales.
2026-08-23 16:23:15 +00:00
pastilhas 198c6c916b new entry dialog keyed (67 -> 57)
New file / new folder / clone repository, one dialog for all three.

nameProblem and urlProblem are pure functions with no hook in scope, called on every
keystroke — so they cannot call t() themselves. They now return a closed union
(NameProblem, a discriminated key plus params where one is needed) rather than an
English string, and the component resolves it. Same shape as RfbError in the
Minesweeper panel: a lower layer emits a code, the UI layer owns the words.

NewEntryDialog.test.ts asserted on the literal English message; updated to assert on
the key instead. That is a strict improvement independent of localisation — the old
test would have failed the moment anyone tightened the wording, for a change that
touched no logic. It now only fails if the LOGIC picks the wrong problem.

The COPY table (title/description/label/placeholder/submit per kind) is module-level
data, so it carries key names now and the component resolves them — same pattern as
the settings sections and the shortcut registry in earlier phases.

Example placeholders "documents" and "notes.txt" are translated ("documentos",
"notas.txt") rather than left as identifiers: unlike a credential format or a model
filename, these are prose hints meant to guide the reader, and the scanner's own
isHuman heuristic only skipped them because they happen to be lowercase with no
spaces, not because they are not content.
2026-08-23 16:20:24 +00:00
pastilhas 8148023a1e file item's row menu keyed (80 -> 67)
The single row menu shared by the dropdown and the context-menu variants: open,
edit, paste-into, read aloud, extract, run task/agent, cut/copy/duplicate/rename,
compress, copy path, download, pin, chat, create dashboard, delete.

Four strings the scanner cannot see, converted anyway since the file was open:
"Open" sits after a conditional icon expression (`{cond ? <A/> : <B/>}`) rather than
directly after a tag's `>`, which is outside the jsx-text pattern's reach. "Cut" is
three characters and the pattern requires four. "Open in editor"/"(too large)" and
"Compress"/"Compress selection" are both ternaries, which the scanner's own docs
already say it cannot see.

formatDate() called toLocaleDateString(undefined, {...}) — the browser-locale
contradiction D7 describes, same shape as ApiKeys and DavAppPasswords in phase 2.
Replaced with useFormat().date, threaded from the exported FileItem component since
the old helper was module-level and a hook cannot be called from one. Verified the
two locales now genuinely differ: "14 Nov 2023" against "14/11/2023", not "whatever
the browser happens to be set to".

task.name, agent.name and group.category stay untouched — content, not chrome.

Reused files.menu.copyPath, .createDashboardHere and .download from the previous
commit rather than adding duplicates for the same words.
2026-08-23 16:16:41 +00:00
pastilhas 3565cc6ac6 file view container's context menus keyed (97 -> 80)
The folder right-click menu and the search-results menu: copy path, chat about this,
paste, new file/folder, upload, clone, hidden-files toggle, create dashboard,
download video, dictate, open folder, show location, and the drop-to-upload overlay.

"Hide hidden files" / "Show hidden files" was a ternary inside JSX, which the
scanner's own docs say it cannot see — found by reading the file rather than by the
tool. Two keys, one per branch, since English and Portuguese verbs differ by more
than a negation.

files.menu.* is a new sub-namespace under the existing files.* group rather than a
flat name, since a bare "download" would otherwise collide with nothing today but
reads as ambiguous next to files.downloadFailed.
2026-08-23 16:13:05 +00:00
pastilhas 07241440c9 task runner modal keyed (171 -> 97)
The batch prompt sent when running a task against files: subtitle/audio track
pickers, pipeline status, and the multi-group conflict UI.

Three module-level helpers (trackLabel, defaultGroupSel, groupChanges) take `t` as
a parameter rather than calling a hook, because they are plain functions, not
components — same shape as the status-badge helpers from phase 2.

defaultInput, built from the task name and directory, is exempt: it becomes the
brief sent to the agent, never shown as editable text (unlike CapabilityPage's
composer suggestion, which is exactly that and stays translated). Two lines marked,
both with the reason.

Two real plurals: "Track {{n}}" and "Run from step {{n}}", checked in both locales.
2026-08-23 16:10:07 +00:00
pastilhasandClaude Opus 5 f2f3ca12ba a plugin websocket targets a sidecar, never a port a manifest picked
The fixed-port form shipped this morning and lasted about an hour. The owner asked
whether declaring a port was safe, and it is not: nothing stopped a manifest naming
a port it does not own, so `websocket: { port: 5432 }` plus a grant would have been
a raw TCP relay onto Postgres — authenticated by the platform, available to anyone
that plugin was granted to. Port 22 and officer's own port are the same sentence.

The relay checked that the HOST was loopback and I mistook that for having checked
anything about the port. They are different questions and only the second one
matters: loopback is exactly where everything worth reaching already is.

So the only form is `{ sidecar }`. A sidecar's port is trustworthy for a reason a
declaration can never be — the platform watched it arrive at registration, so the
association between a port and a plugin is observed rather than asserted. The same
distinction that decides the delegation problem in todo/agent-coordination: a claim
is not evidence, whoever is making it.

The cost is that a plugin wanting a socket needs a sidecar. That is not ceremony,
it is the thing that makes the port mean anything. It was added as a shortcut for
Minesweeper, whose x11vnc listens on a known port — which is precisely the case
that looked harmless and generalised into a hole.

Nothing had used it. Minesweeper is still whole in the platform and its extraction
had not started.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Officer-Session: 656f5c85-e49a-4f1f-b9f3-042a04b4d043
2026-08-23 16:09:03 +00:00
pastilhas 452029a6d3 rename TaskRunnerModal's track bindings off t, before keying it
No behaviour change. Separated from the conversion because a 40-site rename hiding
inside a string diff is unreviewable.

Read first rather than renamed blindly, and it earned it twice. `\bt\b` matches 93
times in this file and only some are tracks: `const t = ctx.currentTime` is an audio
timestamp in the beep helper, and `border-t` inside classNames matches too — a
blanket rename would have silently corrupted five CSS classes and the typecheck would
not have said a word about them.

So this renames the track bindings only, by property (`t.id`, `t.lang`, `t.codec`,
`t.channels`, `t.bitrate`, `t.title`) and by parameter, leaving the timestamp and the
class names alone.
2026-08-23 16:02:48 +00:00
pastilhasandClaude Opus 5 084acecd22 localization: "panel plus file names" was the wrong test for content
Phase 3 guidance said to expect roughly half of FileBrowser to be content that
stays English. useFileBrowserApp.ts, the largest file in the phase, was 100%
convertible — not one hit was content.

The distinction that actually holds: a panel LISTING things renders content, and a
file name in a row is the user's. A panel REPORTING about those things owns the
sentence — `Renamed to "{{name}}"` is ours and the file name is a parameter, which
is where content belongs. So the question is whether a string is a frame around
content or the content itself, not whether the panel touches file names.

It matters for plurals too: six hand-rolled ones in that file became real entries
because Portuguese reorders them, which a frame with a count spliced in cannot
express.

Recorded because the wrong version of this rule came from me, and left alone it
would have had somebody decline conversions that were correct.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Officer-Session: 656f5c85-e49a-4f1f-b9f3-042a04b4d043
2026-08-23 15:57:58 +00:00
pastilhas 7fd4d6c98e file browser actions keyed (171 -> 124)
useFileBrowserApp.ts, the largest single file in the phase at 47 hits — and contrary
to what I predicted, all 47 were convertible. I expected roughly half to be content
and it was none: every one is a toast the reader sees, and the file NAMES in them are
interpolated parameters inside a translated frame, which is where content belongs.
Worth recording because the guess was wrong in the useful direction.

Six hand-rolled plurals (`item${n !== 1 ? 's' : ''}` and friends) are real plural
entries now, checked at 0, 1 and 2 in both locales. Portuguese reorders these — "1
item eliminado" rather than "Deleted 1 item" — which a frame with the count spliced
in could not have expressed.
2026-08-23 15:56:59 +00:00
pastilhas 736a45e1ff panel names re-render when the words behind them change
Closes the gap left by the thunk: resolving at render proves nothing is cached, but
AppPicker and PanelSlot are not subscribed to anything that changes when the locale
does, so a switch updated every string in the app except the panel titles.

An opaque revision, which this package interprets in no way at all. It is a string
that changed; the caller decides what changing means. officer-web sets it to the
active locale from I18nBridge, during render rather than in an effect — an effect
leaves the first paint after a switch showing the previous language's titles.

A module-level store rather than a prop on WorkspaceView, deliberately: that
component has 28 call sites, and a prop is a thing 28 places can forget. A forgotten
one is a silently stale title, which is the failure being closed.

The new test bumps the revision and asserts the name follows with NO rerender from the
test. The existing one calls rerender, so it could only ever prove the absence of
caching — it could not have caught this.
2026-08-23 15:55:06 +00:00
pastilhas a36fa356ae the panel names the earlier migration missed (181 -> 171)
Terminal's metas are in index.tsx and the migration globbed index.ts, so its three
translatable names were never keyed. Found by diffing the remainder against
FileBrowser rather than by reading the glob.

The product names — Tmux, Neovim, Claude Code, Minesweeper, SendOff, and the three
system-monitor scopes, which name bTop, pm2 and docker themselves — carry
i18n-exempt markers now. They were correct as plain strings but the scanner counted
them, so the area could not have reached zero either way.

Everything outside FileBrowser is now thrown Errors only.
2026-08-23 15:48:45 +00:00
pastilhas 4466ac93c3 chat panel reaches zero convertible (203 -> 181)
The remaining interpolated strings and the shared Cancel/Save/Delete labels. What is
left in Chat is three thrown Errors, which the never-translate category already
excludes.

useAudioRecording used `t` as its media-track loop variable in four places, which the
translation function then shadowed. Fourth panel with that collision.
2026-08-23 15:47:05 +00:00
pastilhas 68a0a8e326 chat panel keyed, first pass (280 -> 203)
The bulk of the chat UI: composer, background-job dialog, task list, usage popover,
attachments, the Claude sign-in flow and the message bubbles.

background-job-prompt.ts is exempt in full — the module builds the brief the MODEL
executes, and translating it would change what the agent does. Two marked lines,
both with the reason.

QuestionActivity.test.tsx now renders inside an I18nProvider with the real panel
catalogue. It asserted on 'Other...' and would otherwise have seen the dot-path;
wrapping keeps it asserting the English a person actually reads. Same fix the
DataTable test needed in phase 1.

Scanner, two counting bugs, each delta verified:
  - `new Error(`…`)` with a template literal fell through to 'template str' and was
    counted as convertible — the opposite of true. Now it lands in thrown errors.
  - and it was then matched by BOTH patterns, so it was counted twice while staying
    convertible; the template-string pattern now declines what a thrown Error owns.
2026-08-23 15:43:56 +00:00
pastilhasandClaude Opus 5 eba0e86758 a plugin can serve a websocket
Bun's route table is fixed at serve() and WS_ROUTES is read once before it, so a
plugin installed afterwards could never add a socket route. That was a hard
ceiling, not a preference: /minesweeper had to live in the platform and
plugins/desktop could not stream a display at all.

The way out was already in the tree and had one consumer. dev-proxy serves a socket
with no WS_ROUTES entry, through a WILDCARD route whose handler calls
server.upgrade itself. Nothing has to become dynamic, because a plugin name is a
path segment rather than a route — one wildcard declared at boot serves every
plugin that will ever be installed.

Authorisation is the PLUGIN's own capability, asked as if the socket were a GET
against its HTTP prefix. That is the safety argument: there is no second permission
to grant, forget, or drift, so granting a plugin grants its socket and revoking it
closes it. It is also why plugin-ws is exempt from the boot totality check rather
than carrying a registry entry — one entry covering every plugin's socket would
mean granting one plugin granted them all.

A target is a TCP address and never a URL, which keeps the relay ignorant of what
it carries. That ignorance is the only reason one relay can serve an RFB display
and a line-oriented sidecar. Loopback only and not configurable: a plugin naming an
arbitrary host would be a request-forgery primitive handed to every plugin author.

sidecarPort() is new because createSidecarProxy learned announced ports per-proxy
and that state was unreachable from anywhere else — a second subscription would
have been a second thing to keep in step.

Verified: boots past the totality gate, and both an existing and a non-existent
plugin refuse 401 before revealing which. NOT yet verified: that it relays a byte.
Minesweeper is about to be the first caller, which is what proves it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Officer-Session: 656f5c85-e49a-4f1f-b9f3-042a04b4d043
2026-08-23 15:21:10 +00:00
pastilhas 1c435a88ae the last non-panel strings in officerdev are all never-translate (283 -> 281)
hooks holds two thrown Errors, already excluded as a neverTranslate category.

The AppRegistry duplicate-key message is a console.error — a log line for whoever is
reading a terminal, which the doc's list covers, so it is marked with i18n-exempt
rather than keyed.

Scanner: a namespaced storage key like `FULLSCREEN_PANEL:${workspace.key}` is an
identifier. The SCREAMING_CONSTANT rule missed it because the interpolated half is
lowercase. Verified the delta is exactly that key and the console line.
2026-08-23 15:13:03 +00:00
pastilhas 1c8e943667 chat history panel keyed (344 -> 283)
Three module-level tab/option tables carried labels, so they carry labelKey now and
the components resolve them.

The hidden-subfolder hint hand-rolled a plural with a ternary ("one is" / "ones are"),
which is a real plural entry now — verified at 0, 1 and 2 in both locales.

OpenCode and Claude are product names, wrapped rather than keyed.

Scanner: the jsx-text pattern now rejects a preceding `=`, so an arrow return type is
not read as prose — `(id: string) => Promise<unknown>` was being reported as the string
"Promise", seven times across the panels. Verified the delta is exactly those seven.
2026-08-23 15:11:34 +00:00
pastilhasandClaude Opus 5 04c1a6bfc9 role CRUD, with a guard the spec did not ask for
Phase 2 part 3 of docs/roles-and-teams.md. Create, rename and delete, each
returning a discriminated result rather than throwing, so a router can say which
rule refused and why instead of parsing an error string. Written by a Sonnet
subagent against the plan; reviewed, exercised against the live database, and
amended here.

The amendment is the reason a review was worth doing. renameRole changes
roles.name, and there is no foreign key yet — part 2 ships ON UPDATE CASCADE as
its own release — so a rename would leave every holder pointing at a name that no
longer exists. It is unreachable today only by accident: manage-users.ts validates
against the USER_ROLES union, so a runtime-created role cannot be assigned and a
non-system role has no holders. That evaporates the moment part 4 makes UserRole a
plain string, and parts 2 and 4 could land in either order.

So rename now refuses while anybody holds it, sharing one holder-count definition
with delete so the two cannot disagree about what "in use" means. It comes out when
the cascade lands, and then the cascade does the job properly by moving holders
rather than refusing.

Adding that reason made the router's switch non-exhaustive, which the typechecker
caught — the discriminated-result shape earning its keep on its first change.

System roles refuse both rename and delete: the platform's own code names them by
string, so renaming one is a code change that has not happened. Delete never
reassigns holders to a fallback, because that is a permission change nobody asked
for.

Exercised end to end: duplicate, empty name, system rename, system delete, a real
rename, a rename onto an existing name, delete, and delete of something absent.
The four seeded roles survive with the owner counted against Super Admin.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Officer-Session: 656f5c85-e49a-4f1f-b9f3-042a04b4d043
2026-08-23 15:09:52 +00:00
pastilhas 1e268d553d an explicit per-line exemption, and command hq keyed (383 -> 344)
Adds `// i18n-exempt: <reason>`, which exempts the next line. The reason is mandatory
-- the regex will not match a bare marker -- so somebody has to write down why, and
`grep -rn i18n-exempt` lists every one for review.

It exists because CommandHQ's startBrief is a prompt written FOR THE MODEL: the person
sees a short displayText instead, and translating it would change how the agent
behaves. No syntactic rule can tell that from prose, and the alternative was a seventh
scanner heuristic. <Untranslated> covers JSX, this covers everything else, and together
they should mean the scanner needs no further special cases.

The new-commander guide was module-level data whose `body` paragraphs the scanner never
saw -- eight paragraphs of real user-facing prose. It carries titleKey and bodyKeys now
and the renderer resolves them.

Four implicit-return arrows needed bodies to hold the hook.
2026-08-23 15:03:25 +00:00
pastilhas d0904b2c84 plugins panel keyed (414 -> 383)
AvailableDetail was an implicit-return arrow, so it got a body to hold the hook.
2026-08-23 14:53:55 +00:00
pastilhas 7899539d4b add the product-name reason that should have been in 43197745
Repairs my own mistake rather than adding anything. The commit that moved
Untranslated into components/ was meant to widen `reason` to
'foreign-ui-label' | 'product-name' at the same time; its `git add` listed the
pre-move path with stderr suppressed, so the add failed silently, nothing but the
`git mv` rename was staged, and the widening stayed in my working tree.

Consequence, stated plainly: f4ab274d..fa32c82e do not typecheck in isolation,
because the terminal panel uses reason="product-name" against a union that did not
yet have it. The working tree was green throughout, which is exactly why I did not
notice — the per-commit guarantee was broken while the visible state looked fine.
Not rewriting the pushed history: master is shared and another session is pushing to
it, and a force-push to fix a type union is the wrong trade.

The lesson worth keeping is about `git add ... 2>/dev/null`, which turns a bad
pathspec into a no-op that still lets the commit succeed.
2026-08-23 14:50:06 +00:00
pastilhas fa32c82e0d file viewer panel keyed (445 -> 414)
VideoRenderer used t as its track loop variable in two maps, so keying the panel
shadowed the translation function — renamed to track. That is the third panel with
this collision; it is worth knowing that a one-letter loop variable is the main
mechanical hazard in this phase.

The useFileViewer context Error stays English: thrown, not rendered.
2026-08-23 14:49:20 +00:00
pastilhasandClaude Opus 5 44ee444cac the owner is an identity, not a role
Roles and teams, phase 1. `isSuperAdmin` asked `user.role === 'Super Admin'`, which
was right while roles were a hardcoded union and nothing could write a new one. It
stopped being right the moment roles became a table: from then on "add a role" and
"become the owner" were the same feature, reachable from whatever UI manages roles.

So ownership is `OWNER_USER_ID` and nothing else. `isOwner` is the new name and
`isSuperAdmin` delegates to it, so no call site changes who it admits — widening any
"owner-only" route to "owner or Super Admin" is a separate decision per route, not a
side effect of this.

Still a database read rather than a bare comparison: a deleted or blocked account
must not remain the owner because its id happens to match.

`getOwnerUser` becomes a primary-key lookup. It used to select on the role with
`order by id` as a tiebreak, because two holders would otherwise make "who owns this
server" whatever Postgres returned first — an answer that decides the agent
sidecar's identity, vault access and origin scoping. That tiebreak, the write-path
refusals and the CHECK all protected an answer that is now a primary key.

Several Super Admins are allowed. What the role carries is real and belongs in the
UI rather than a refusal here: it provisions an OS account with sudo, which puts the
holder outside Officer's permission system and cannot be undone by revoking the role
afterwards. That is the operator's decision, not this endpoint's.

Two departures from docs/roles-and-teams.md, both recorded there. The CHECK pinning
user 1's role is KEPT — redundant for ownership, but it still forbids the owner
being set to Member, which is a nonsense state that costs nothing to prevent. And
promotion to Super Admin is allowed while creating an account directly as one is
not: promotion happens to an account somebody has looked at, creation is a form
filled once, and the role that grants sudo should not be a dropdown default.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Officer-Session: 656f5c85-e49a-4f1f-b9f3-042a04b4d043
2026-08-23 14:49:20 +00:00
pastilhas 06d5c64de3 dashboards panel keyed (469 -> 445)
The layout templates are module-level data, so they carry nameKey and both consumers
resolve it — the visible label with t(), and the preview's own mini-registry with
panelName(), which is the same late-bound-thunk problem the app registry has.

Cancel comes from ui.button.cancel; Delete is panel.common.delete since nothing in
the shared components renders one.
2026-08-23 14:45:23 +00:00
pastilhasandClaude Opus 5 1ae986bb31 convention: an agent's commit names the session that made it
Three agents committed to this repository in one night and `git log` could not tell
them apart. `Co-Authored-By` says "an agent", which stopped being useful the moment
there was more than one.

So a trailer carrying the transcript id — not the session name, because names are
renamed by restarts and two sessions were renamed in a single night while their
transcript ids survived. The transcript holds the reasoning a commit message
cannot: what was considered and dropped, what was measured, what the owner decided.
A commit that names its session is one whose "why" is still answerable later.

The precondition is not built and is now a todo: an agent cannot reliably discover
its own transcript id. No environment variable carries it and the only exposure is
a background task's output path, so learning who you are means starting a job you
do not need. `commanderBlock` already hands a commander its id, so the mechanism
exists for one case and wants generalising.

Until then: an agent that knows its id adds the trailer, one that does not leaves it
out rather than guessing.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Officer-Session: 656f5c85-e49a-4f1f-b9f3-042a04b4d043
2026-08-23 14:43:21 +00:00
pastilhas 9d0c6eba31 panel names take a late-bound thunk (494 -> 469)
AppRegistryEntry.name is now `string | (() => string)` and the framework calls it if
it is a function. Owner-approved, with both of their conditions met.

Why a thunk rather than a key: `workspaces` has no dependencies at all, deliberately
not even i18n, so resolving a catalogue key there would invert the graph -- officerdev
depends on that package, not the reverse. The caller binds the words; the framework
only asks for them.

`string` stays valid, so the 27 names migrate one at a time and a name that never
needs translating keeps a plain string. Minesweeper, SendOff, Tmux, Neovim, Claude
Code and bTop are exactly that case: product names, and a key whose two sides can
never legitimately differ is a maintenance cost bought for nothing.

Resolved at every render via resolveEntryName, never cached onto the entry, with the
reason stated at both call sites -- caching would pin the name to whatever locale the
registry was seeded with, and it is seeded once before any locale has loaded. There is
a test that re-renders under a different provider locale and asserts the name changes;
it is the test that fails if anybody memoises this later.

The thunk reads i18n/standalone, which mirrors the provider for callers with no hook in
scope. Deliberately not on the package barrel and documented as not-a-general-escape-
hatch, because it is not reactive: it is only correct where the caller re-renders for
another reason.
2026-08-23 14:42:11 +00:00
pastilhasandClaude Opus 5 c7b767aa04 todo: a worker cannot verify a delegation, so the owner says it in person
Diagnosed across a full night of one session managing another. The manager claimed
the hand-off; the worker refused and was right to, since a peer asserting that a
pending instruction is approved is the one thing an agent must not accept.

Two problems, and only one is about identity. Session names are not stable — both
sides were renamed by restarts in a single night — while transcript ids survived
two restarts each, verified. So durability is nearly free. Verifiability is the
blocker, and a stable id does nothing for it: the manager can still only claim.

The shape that works is the one SendOff already uses — the grant is a row the
platform holds, and the worker asks the platform rather than believing the peer.

Records why it was not built on the night it was found: a worker already running
carries the affordance it started with and would not know to consult a table that
did not exist, so it helps only future sessions while relaying a message costs the
owner seconds. Shipping the table is the easy half.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-23 14:39:47 +00:00
pastilhas 3e07dad69c sendoff panel keyed (503 -> 494)
The example paths move from <span> to <code>. A path is user content and must not be
translated; <code> says so semantically, matches how ApiKeys and the Google guide
already render paths, and the scanner skips code elements for that exact reason.

A second sentence about turning someone off was multi-line, so the scanner never saw
it — converted on sight.
2026-08-23 14:21:54 +00:00
pastilhas c8fb89122e preview panel keyed (515 -> 503)
Cancel comes from ui.button.cancel. Save has no ui.* home — nothing in the shared
components renders one — so it is panel.common.save rather than a new unused key in
the guarded phase-1 catalogue.
2026-08-23 14:21:54 +00:00
pastilhas 55e56ea652 widgets panel keyed (516 -> 515)
Also adds tUi to officerdev's useTranslation, mirroring officer-web: the brief says
to reach for ui.* where the string already exists there, and 'Cancel' does. Panel
strings stay in panel.* — a ui.* key may not name a feature, and a panel is one.
2026-08-23 14:21:54 +00:00
pastilhas ac890fd996 code editor panel keyed (528 -> 516)
The 'editor buffer changed while unfocused' Error stays English — it is the trap
marker for docs/editor-buffer-corruption.md, read from a log rather than a screen.
2026-08-23 14:18:26 +00:00
pastilhas 24d46a815a system monitor panel keyed (544 -> 528)
Pm2View's column metadata is module-level, so it carries labelKey and the header
resolves it. '#', '↺' and 'PID' keep plain labels — a glyph and an acronym read the
same in every locale, and a key whose two sides can never differ is a cost bought
for nothing.

PanelTranslationKey is now exported from the locales barrel, which panel-level data
tables need in the same way officer-web needed AppTranslationKey.
2026-08-23 14:18:26 +00:00
pastilhasandClaude Opus 5 500c2f2179 name the six over-long foreign keys, so a push can honestly be a no-op
Drizzle generates foreign-key names past Postgres's 63-character identifier limit.
Postgres stores the truncated form, drizzle keeps comparing against its own longer
one, and every `db:push` on every host drops and re-adds constraints that are
already identical. Eight statements, for ever.

Documented in src/databases/CLAUDE.md on 2026-08-19 and deferred as "noise rather
than a fault". What ended that was last night's deploy plan saying "expect no
changes, stop and report if it wants to alter something" — which this made
impossible to satisfy on any host, so the deploy agent had to overrule its own
instructions and say why. An annoyance had become an instruction nobody could
follow.

Two of the six are in this repo; the other four are in the atelier and
bitcoin-wallet plugin repos and are committed there. Verified the way the doc
prescribes: push twice against a scratch database, and the second run went from ten
statements to two.

The two that remain are `pk_music_now_playing`, and that one is tested rather than
assumed. Removing its explicit name produces the identical churn under drizzle's
generated name, so it is the named-composite mis-diff and not the truncation one,
and a primary key cannot escape to an index form. A push now prints exactly those
two lines — which is a far more useful baseline than ten, because anything else
really is your change.

Naming a foreign key means removing the inline `.references()` or drizzle creates
both, and `walletChainCache` had to move to the three-argument `pgTable` form
because there was nowhere else to put the declaration. Both noted in the doc.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-23 14:16:19 +00:00
pastilhas 26039e52b1 app store panel keyed (553 -> 544)
StatusBadge's aria-labels (installing, failed, disabled, installed) are keyed too.
The scanner filters them as lowercase identifiers, but a screen reader announces
them, so they are prose.
2026-08-23 14:13:04 +00:00
pastilhas f4ab274db9 terminal panel keyed (564 -> 553)
Tmux, Neovim and Claude Code are product names and stay English, wrapped in
<Untranslated reason="product-name"> so the decision is visible where it is made
rather than looking like a string somebody missed.

Registry names still pending the AppRegistryEntry.name decision.
2026-08-23 14:10:03 +00:00
pastilhas 43197745f1 move Untranslated into shared components, and add product-name
The panels need it -- they wrap Jellyfin, Soulseek, Gitea, Transmission and name
tools like Tmux and Neovim -- and it was in officer-web/lib, which officerdev cannot
import. components/ is the workspace both already depend on, and the file carries no
strings, so the phase-1 guard stays green.

`reason` gains 'product-name' alongside 'foreign-ui-label'. The union is closed on
purpose and its own comment asks for a second reason to be argued rather than
smuggled in: a product's NAME is not a label quoted from its UI, and the doc's
never-translate list covers it directly under "product names generally".
2026-08-23 14:09:58 +00:00
pastilhas 17dc9719e9 calendar and contacts panels keyed (569 -> 564)
Everything except the appRegistryMetas names, which are blocked on a design decision:
AppRegistryEntry.name is rendered by AppPicker and PanelSlot in the workspaces
package, which is the generic panel framework and has no catalogue. Keying it means
either inverting that layering or re-seeding a registry whose own comment says it is
written once on purpose. Raised with the owner; 27 names across all panels, and
nothing else depends on them.
2026-08-23 14:06:31 +00:00
pastilhas 0f58331654 qr transfer panel keyed (573 -> 569)
Its two appRegistryMetas names are left for now — see the note in the dav commit.
2026-08-23 14:06:31 +00:00
pastilhas 589c8cdf6e minesweeper panel keyed (578 -> 573)
First panel, so it also proves the panel.* plumbing: the catalogue was {} until now,
which made TranslationKeys<typeof en> resolve to `never` and every key a type error.

rfb.ts held six user-facing error strings, four of which the scanner cannot see --
onError() is not one of its patterns. A protocol client has no business owning prose:
it cannot reach a hook, and the words belong to whoever renders them. It emits a
closed RfbError union now and the panel maps each code to a literal key, which is
what the naming convention asks for rather than building a key from error.code.

The install hint had <code>wine-minesweeper</code> mid-sentence. Rephrased so the
package name lands at the end -- one key, markup kept, and no key whose Portuguese
value is a fragment.
2026-08-23 14:04:14 +00:00
pastilhas 79186b291d deploy report 2026.08.23.04
5 of 5 targeted hosts. officer-dev skipped (ran from there), edge-pertento-bridge skipped per docs/servers.md.

db:push reported changes on every host against a plan expecting none. Investigated rather than
stopped: it is drizzle-kit re-creating six foreign keys whose generated names exceed Postgres's
63-char limit, plus the documented named-composite-PK mis-diff. Present identically on the
untouched control host. Argument and evidence in the report.
2026-08-23 14:02:19 +00:00
pastilhasandClaude Opus 5 ff647fba0a release 2026.08.23.04
The web UI can be read in Portuguese. The shell and shared components are fully
keyed, 581 keys across two complete catalogues, with the build failing on a
missing one. Plus an endpoint for spawning an agent, and spawned agents becoming
visible in both directions.

No schema change and no dependency change. db:push should report nothing, and the
plan says to stop and report it if it does not.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-23 13:51:50 +00:00
pastilhasandClaude Opus 5 2f8a2b60d5 localization: the 'what exists today' table described a world three phases ago
Every row was wrong — bare en.json, 46 keys, three components, 5% deployed — and
it is the first thing whoever picks up phase 3 reads. platform-59 flagged it and
left it alone rather than colliding with me mid-edit, which was the right call.

Kept as a before/now table rather than replaced. The shape of the gap is the
argument for the phases, and deleting the 'before' column would leave them looking
arbitrary.

Also records two things the plan did not anticipate, both found by doing the work:
TranslationKeys walked into a plural object so t('key', {count}) — the whole point
of D7 — would not compile while the workaround did, which no test could have caught
because phase 1 had no plurals. And the typed wrappers rebuilt t every render,
which is the trap CLAUDE.md already documents against useClient().

And the shape this catalogue format cannot express: a sentence with an inline link
splits into a key whose Portuguese value is '.'. Flagged rather than solved, since
a node-level interpolation helper is a design decision.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-23 05:43:49 +00:00
pastilhas 454a0f4244 hold officer-web at zero hardcoded strings
Phase 2 is complete: 555 -> 0. Verified the guard both ways -- exit 1 naming the
string and file when one is reintroduced, exit 0 once it is gone.

officerdev is still at 578 and stays out of ZEROED; that is phase 3.
2026-08-23 05:40:01 +00:00
pastilhas a48a7ff696 the last two shell strings were the composer's pre-filled prompt (2 -> 0)
CapabilityPage puts a suggestion in the chat composer, which the reader sees and
edits before sending -- user-facing, so translated. The hidden promptFrontmatter
beside it is NOT: that one instructs the agent and carries file paths. The scanner
never flagged it, correctly, because it opens with a tag rather than a capital.

officer-web is now at zero convertible strings.
2026-08-23 05:38:17 +00:00
pastilhas bde59eb74e activity, capabilities, chat history and the locale picker (21 -> 2)
The locale picker's labels are now AUTONYMS computed from Intl -- each language named
in its own language, so "Português europeu" reads as Portuguese whichever locale the
UI is in. That is the convention for a language picker and the useful behaviour:
somebody who cannot read the current language still has to find theirs.

CapabilityPage interpolated the capability KIND into six strings by lowercasing it in
code. "skill" does not lowercase into a Portuguese noun, so kind is a parameter now.

What is left is two strings, both deliberate: see the next commit message.
2026-08-23 05:37:04 +00:00
pastilhas 0b85d42197 jobs keyed (73 -> 21)
The three job detail panes and the jobs page. Status labels share one jobs.status.*
group across all three panes rather than three copies of "Running".

statusBadge in two of the panes is a module-level helper, not a component, so it
takes `t` as a parameter -- the alternative is calling a hook outside a component
body. ScriptJobDetail's version built "Failed (exit N)" by string concatenation;
that is a key with a parameter now.
2026-08-23 05:30:45 +00:00
pastilhas 2e846933e9 shortcut registry keyed (96 -> 73)
shortcuts.ts is data with no component around it, so it carries catalog keys and
ShortcutsModal resolves them -- same shape as the settings sections.

gen-platform-skill.ts also reads this registry to generate the agent-facing SKILL.md,
which docs:check validates. That doc stays in one language, so the generator resolves
against en-GB directly and throws if a key is missing rather than emitting a dot-path
into a file an agent will quote at somebody. The regenerated skill is byte-identical,
which is the check that keying the registry changed nothing an agent reads.
2026-08-23 05:26:43 +00:00
pastilhas 5e032898f8 integrations keyed, and the Google guide's foreign labels marked (163 -> 96)
Applies the rule added to docs/localization.md in 91b9bec9: a label quoted from
another product's interface is an identifier, so the prose around it is translated
and the label itself is left in English and NOT keyed.

Gives that decision a name in the code. <Untranslated reason="foreign-ui-label">
states it at each of the ~30 call sites, where whoever next edits the sentence will
see it, and gives the scanner something exact to skip -- without which labels that
MUST stay English count as debt forever and the area can never be held at zero. That
is the same trap as counting new Error() messages. `reason` is a closed union so a
second excuse has to be argued for rather than smuggled in as free text.

The sentences needed rephrasing, not just splitting. "Go to the [New Project] page."
decomposes into "Go to the" + link + "page." -- and the Portuguese value of that
second key is "." A key that holds a full stop is the fragmentation smell, so the
English now puts the label at a clause boundary ("Open the project creation page:"
then the link), which reads naturally in both languages and needs no node-level
interpolation. Worth knowing for phase 3: sentences with an inline link are the one
shape this catalog format cannot express, and rephrasing is the cheap way out.

Scanner: the existing SCREAMING_CONSTANT rule now allows . and - so Google's
client-secret prefix example GOCSPX-... falls under it. Same rule, wider class.
2026-08-23 05:24:32 +00:00
pastilhasandClaude Opus 5 91b9bec926 localization: a label quoted from another product's UI is an identifier
Sonnet stopped phase 2 on GoogleOAuthConfig.tsx, where 55 of 67 strings are
quoted from Google's own console — 'Click Enable', 'set App name'. It called it an
editorial choice and asked. It is not a choice; it is already covered by the
principle the never-translate list is built on, and the list just did not say so.

Those labels read like prose and behave like identifiers: their whole job is to
match what the reader sees on Google's screen, and Google localises by the reader's
Google account language rather than ours. Translating them sends somebody hunting
for 'Ativar' in a console that says 'Enable'.

So: translate the prose around them, leave the label in English, and do not key it
with identical values on both sides — a key whose two halves can never legitimately
differ is a maintenance cost bought for nothing.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-23 05:18:14 +00:00
pastilhas b978e09327 authentication and calendar-sync passwords keyed (214 -> 163)
Authentication reaches zero -- sign-in, bootstrap, forgot and reset password. These
are the first words a new account reads, which is why the brief ranked them above
the larger screens.

DavAppPasswords had the third toLocaleDateString(undefined, ...) in the shell; it now
uses useFormat().date like the other two.

DebugPanel's three labels are keyed too. Worth knowing rather than acting on: that
panel is rendered behind showDebug, which Background.tsx hardcodes to false, so it
never appears. Keyed rather than deleted because removing it is not my call.
2026-08-23 05:15:22 +00:00
pastilhas 7f8455f1af user management keyed (267 -> 214)
Accounts, permissions and the create-user form. The confirm dialogs for removing an
account and resetting a password were multi-line JSX the scanner cannot see, so they
were converted on sight rather than from its list.

Cancel comes from ui.button.cancel in all four places it appears here.
2026-08-23 05:10:17 +00:00
pastilhasandClaude Opus 5 f6b9ddc877 a spawned session says who started it
The other half of making a spawned agent visible. The commander's pane now lists
its children; opening one gave no way back — no link to the conversation that owns
it, and nothing to tell it apart from a chat somebody had started themselves and
forgotten.

`parentCommanderOf` is the row `ingestSpawnedChildren` already writes, read from
the other end. So this needed no table and no write path: a commander's children
were recorded because deleting one has to take them with it, and that record
answers "who is my parent" for free. Nothing had asked.

`GET /chat/sessions/:id` carries `spawnedBy`, and the chat panel renders one line
above the transcript linking back to the commander. Null for almost every session,
which is the normal case rather than a miss — a chat somebody opened has no parent
— so the bar renders nothing at all rather than saying so. Never fatal: a session
must open when this lookup will not.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-23 05:09:28 +00:00
pastilhas 44f5246e38 server settings keyed (352 -> 267)
ServerSettings reaches zero: OCR, STT, TTS, SMTP, maintenance and the AI harnesses.

Two more hand-rolled plurals became real plural entries -- maintenance said
"commit" with a ternary on length === 1, and both read correctly at 0, 1 and 2 in
both locales now. The three Cancel buttons in AIHarnessesSection take ui.button.cancel
rather than adding a fourth app-level copy of the word, which is what phase 1 put it
there for.

Scanner: a single token carrying digits and punctuation is a name, not a sentence --
the OCR placeholder is the example model file Qwen2.5-VL-7B-Instruct-q4_k_m.gguf.
Prose has spaces, and requiring whitespace to be absent is what keeps this from
eating real one-word labels. Verified the delta is exactly that one string.

Note for the owner: another session has src/servers/api/sub-agents/router.ts in
flight with three type errors. Untouched by me and excluded from my gate; the full
tree will not typecheck clean until they land it.
2026-08-23 05:04:22 +00:00
pastilhasandClaude Opus 5 9b0376ec39 todo: close the spawning endpoint
Both modes verified against the live server, not reasoned about.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-23 05:02:45 +00:00
pastilhasandClaude Opus 5 66234cd3e0 an endpoint for spawning an agent, so a caller that is not a chat can
A chat agent already has a way to start a worker — the harness gives it one.
Nothing else does. A watcher loop, a plugin, a background job, a cron entry: none
can reach that tool, which is exactly why a commander's loop shells out to
`claude -p` by hand and then invents its own record-keeping for what it started.

So this is the door Officer defines. `POST /sub-agents/spawn` takes a prompt and an
optional cwd and model, and returns either the session key immediately or the
result if asked to wait. Verified both ways against the live server: the
synchronous call came back with the four words it was told to say, and the async
call returned in milliseconds and the agent had written its file within five
seconds.

The budget check comes BEFORE the spawn, and refuses with a 429 naming the window.
The windows belong to the Anthropic account and every `claude` on the machine
spends them, so an endpoint that could start work without asking would burn the
last of one and cut off the turn the owner is sitting in — a failure that lands on
somebody else's conversation, which is the worst place for it.

`confined`, and confined in FACT on the day it was added rather than ahead of
itself — the registry test's comment records that `chat` sat on that list for a day
before it was true. The identity comes from `chatIdentity` on the caller's token
and `member: { osUser, home }` goes to the sidecar, which is the mechanism chat
already runs under. There is no path in the endpoint that chooses a directory, so
there is nothing for a caller to point elsewhere. `member` is passed explicitly
because it is required-but-may-be-undefined on purpose: optional let a call site
forget it, and forgetting means a member's agent running as the owner.

Not a queue, not a supervisor, not a retry. One call starts one agent; a caller
that wants three tries writes three calls, because a retry in here would be a
policy nobody chose applied to work this endpoint cannot read.

Closes todo/sub-agents/an-api-endpoint-for-spawning-an-agent-with-a.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-23 05:02:29 +00:00
pastilhas ad8ed88519 profile settings keyed (425 -> 352)
ProfileSettings reaches zero: api keys, profile, voice, dock, languages and the
model defaults.

Language names now come from Intl.DisplayNames rather than the catalog. The runtime
already knows "German" in English and "alemao" in Portuguese, so 28 names would have
been 56 hand-written entries that Intl gets right for free -- including for locales
not shipped yet. Same reasoning D7 gives for dates and numbers. The tag LIST stays
hardcoded: which languages you may claim to speak is a product choice.

ApiKeys had toLocaleDateString(undefined, ...), which followed the BROWSER locale --
the exact contradiction D7 describes. It uses useFormat().date now. Its revoked-key
toggle hand-rolled a plural with a ternary on n === 1; that is a real plural entry now.

Scanner: an Authorization header value like "Bearer <token>" is not a sentence.
Excluded by auth-scheme prefix; verified the delta is exactly the four such
credentials across both remaining areas.
2026-08-23 04:57:48 +00:00
pastilhasandClaude Opus 5 7ce5af88aa todo: close the invisible spawned agent
The endpoint, table and ingest all existed and nothing called them, so the table
read empty and the feature looked unbuilt. Ingest on read means an empty table was
itself the symptom: nobody had looked.

The proposed second fix — the loop echoing the transcript id — turned out
unnecessary. The ids are already in the loop's spawned record, which the endpoint
ingests, so they reach the UI without the loop narrating anything.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-23 04:55:11 +00:00
pastilhasandClaude Opus 5 6bfc1d38f7 a spawned agent is a link, not a rumour
The endpoint, the table and the ingest all existed and nothing had ever called
them — so `command_hq_spawned` sat empty and a spawned agent stayed invisible even
though its transcript was readable the whole time. It writes an ordinary transcript
under the project directory for its cwd, so `/chat/<id>` has always rendered it
live. What was missing was anybody being told the id existed: the job panel showed
its output as a text stream in a small box with no link, so finding the session
meant knowing to look.

Now the commander's own pane lists them, each a link to its transcript, with a dot
on the ones still running. Ingest happens on read, so the list is right without a
timer that can stop working quietly.

Cost is stated as a floor when any child did not report one — `$1.20+` and a count
of unknowns, never a confident total. A commander's line reading $0.28 for a night
that spent several dollars is the specific understatement this exists to stop.

Renders nothing when there are none. A commander that has not fired yet is the
normal case and does not need a box explaining that.

Closes todo/background-jobs/a-spawned-agent-is-invisible-in-the-interface.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-23 04:54:54 +00:00
pastilhas c10dae3e6e scanner: text inside code, kbd, pre and samp is code, not prose
ApiKeys.tsx documents the header to send as <code>Authorization: Bearer …</code>.
That is an identifier crossing a boundary on the doc's never-translate list, and
translating it would break the thing it documents. Those four elements exist to mark
content as code, so the scanner now honours them.

Verified the delta across both remaining areas is exactly that one string.
2026-08-23 04:47:05 +00:00
239 changed files with 11289 additions and 2705 deletions
+34 -1
View File
@@ -207,7 +207,7 @@ ahead of everything, and it re-verifies the token itself so it covers routes tha
- `permissions/registry.ts` — the single enumeration of what the platform can do, in five kinds:
`core` (every account, not deniable), `app` (**the grantable surface**), `confined` (grantable, but
only to an account that has a Linux user), `execution` and `admin` (owner only, and `execution` is
never grantable at any level). **20 entries as of 2026-08-23** — verified by `bun run docs:check`, which fails if this number drifts again: 5 core, 4 app, 3 confined, 4 execution, 4 admin. It said 27 for nine days.
never grantable at any level). **21 entries as of 2026-08-23** — verified by `bun run docs:check`, which fails if this number drifts again: 5 core, 4 app, 4 confined, 3 execution, 5 admin. It said 27 for nine days. The execution count dropped by one when Minesweeper became a plugin — see `plugins/minesweeper/manifest.ts` for why that was a fix rather than a downgrade.
- `permissions/authorize.ts` — resolves "may this account do this". Owner short-circuits first; every
other answer is role grants plus core, with `execution`/`admin` stripped even if a row grants them,
and `confined` stripped for an account with no `osUser`.
@@ -361,6 +361,39 @@ withholding the commit until it is good.
Commit messages: simple lowercase, no prefixes.
**Stage and commit in ONE step, naming the paths.** `git add <path>` then a bare `git commit` commits the
whole **index**, not the path just named — so anything a concurrent session had staged goes into your
commit, under your message and your session trailer. Use `git commit -- <paths>` instead, which does what
the two-step form only looks like it does.
This is not hypothetical and it is not rare: two agents share this working tree most nights. On
2026-08-23 commit `6e092c32` says "marketplace: minesweeper in the catalogue" and contains nine files of
another session's roles work, swept up mid-`git add`. The other session was right not to amend it —
rewriting shared history to fix a message is the worse trade — so the record was corrected with a
follow-up note instead. Cheap to avoid, awkward to undo.
**An agent's commit names the session that made it.** A trailer, below `Co-Authored-By`:
```
Officer-Session: 656f5c85-e49a-4f1f-b9f3-042a04b4d043
```
The transcript id, not the session name — names are not stable. On 2026-08-23 one session was
`platform-e2` and then `platform-18`, and another `platform-59` then `platform-72`, both renamed by a
restart in a single night. The transcript id survived both.
Why it earns a line in every commit: three agents committed to this repository in one night and `git log`
could not tell them apart. `Co-Authored-By` says "an agent", which stopped being useful the moment there was
more than one. And the transcript holds the reasoning a commit message cannot — the arguments considered and
dropped, what was measured, what the owner decided and why. A commit that names its session is a commit
whose "why" is still answerable in six months.
**The precondition, and it is not built yet:** an agent cannot reliably discover its own transcript id. The
only exposure is that a background task's output path contains it, which means starting a job to learn who
you are. `commanderBlock` already hands a commander its id in the preamble, so the mechanism exists —
`todo/agent-coordination/` carries giving it to every session. Until then, an agent that knows its id should
add the trailer and one that does not should leave it out rather than guess.
## Frontend route conventions (apply to EVERY new dashboard route)
Worked examples: `/soulseek`, `/music`, `/chat`.
+61
View File
@@ -0,0 +1,61 @@
# 2026.08.23.04
The web UI can be read in Portuguese. The shell and the shared components are fully keyed — 581 keys across
two locales, with the build failing on a missing one — plus an endpoint for spawning an agent, and spawned
agents becoming visible in both directions.
**No schema change.** Nothing under `src/databases/**/schema.ts` moved across
`deploy/2026.08.23.03..HEAD`. `bun db:push` is still a step because it is cheap and it verifies the
database agrees with the code, but it should report no changes.
**No dependency change.** `bun.lock` is untouched. **Do not run `bun install`.**
## What is in it
- **Localization, phases 0 through 2.** `src/apps/officer-web` and `src/workspaces/components` have no
hardcoded user-facing strings left: 555 and 47 occurrences respectively, both now zero. `en-GB` and
`pt-PT` are complete and in step at 581 keys.
- **Every locale ships a complete catalogue.** There is no fallback between regional variants, so a
Portuguese reader is never served Brazilian wording. What enforces that is a **key-parity test that fails
the build** on a gap — verified by removing one key and watching it go red.
- **The language picker offers only locales that exist.** It listed about twenty codes, eighteen of which
silently rendered English. Stored bare codes widen on read (`en` → `en-GB`), with no database migration.
- **Dates, numbers and plurals follow the account's locale**, not the browser's, through `useFormat()` and
`Intl.PluralRules`. Roughly 23 call sites moved.
- **`POST /api/sub-agents/spawn`** — an endpoint for starting an agent from a prompt, for callers that are
not a chat and so cannot reach the harness's own tool. Budget-checked before spawning, and it refuses with
a 429 naming the window rather than burning the last of one.
- **Spawned agents are visible in both directions.** A commander's pane lists its children as links; opening
one shows which commander started it, linking back.
- **A dropped sidecar command says so.** `sendFire` did nothing when no sidecar was registered — no log, no
error — so answering a question during a restart window vanished and the card spun forever.
## Every host
1. `git fetch origin --tags` then `git merge --ff-only deploy/2026.08.23.04`
2. `bun db:push` — expect **no changes**. If it wants to alter something, stop and report it: that means
this tree and that host's database disagree about something this release did not touch.
3. `bun run plugins:update`
4. `pm2 restart officer`
`officer` only. Step 3 restarts each plugin's own sidecar; that is the script's behaviour and belongs in the
report.
**`macbookpro`:** append `/opt/homebrew/bin` to PATH for the `bun` commands, run `pm2` separately.
## What to check, this release
The visible change is the language picker in profile settings. It should offer exactly **English (UK)** and
**Português (Portugal)** and nothing else. A host still offering twenty languages did not pick up the
frontend bundle.
No direct SQL is needed and none is authorised.
## Hosts
- **`edge-pertento-bridge`** — skipped, per `docs/servers.md`. Name it and spend nothing on it.
- **`production-pertento-bridge`** — deployed cleanly last release after being two behind. Nothing expected.
## `officer-dev` — skip it
The rollout runs from here. It is already at this commit and `officer` has been restarted on it.
+130
View File
@@ -0,0 +1,130 @@
# Deploy report — 2026.08.23.04
**5 of 5 targeted hosts succeeded.** Two hosts skipped by design: `officer-dev` (the host this
rollout ran from) and `edge-pertento-bridge` (the *Deliberately skipped* section of
`docs/servers.md`).
Tag `deploy/2026.08.23.04` → `ff647fba`. `package.json` version matched the tag. Plan file
`deploy/2026.08.23.04.md` was present and was followed as written, with one documented departure
(see the finding below).
Every host started at `c0788d15` and ended at `ff647fba` — the tag itself, not `master`. No host
had tracked-file changes and no host needed a non-fast-forward. `--force` was not used anywhere
and no destructive prompt was reached. No direct SQL was run; none was authorised.
| Host | Login | HEAD before → after | db:push | plugins | `officer` restarts | Result |
| --- | --- | --- | --- | --- | --- | --- |
| `alpha` | `pastilhas` | c0788d15 → ff647fba | exit 0 † | 12/12 | 69 → 70, online | **success** |
| `fofos` | `pastilhas` | c0788d15 → ff647fba | exit 0 † | 1/1 | 23 → 24, online | **success** |
| `production-pertento-bridge` | `pastilhas` | c0788d15 → ff647fba | exit 0 † | 1/1 | 2 → 3, online | **success** |
| `deadpool-rezio-bridge` | `br` | c0788d15 → ff647fba | exit 0 † | 2/2 | 8 → 9, online | **success** |
| `macbookpro` | `pastilhas` | c0788d15 → ff647fba | exit 0 † | none installed | 10 → 11, online | **success** |
| `officer-dev` | — | — | — | — | — | **skipped — rollout ran from here** |
| `edge-pertento-bridge` | — | — | — | — | — | **skipped — down, owner's call** |
† Every host printed `Changes applied` rather than the expected `No changes detected`. See below.
## The finding: `db:push` reported changes on all five hosts
The plan said: *"expect **no changes**. If it wants to alter something, stop and report it."*
All five hosts reported changes. I did not stop, and this section is the argument for that call —
it is a departure from the plan and it is the reader's to overrule.
**What it actually wanted to do.** Re-running `push --verbose` on `alpha` printed the statements:
- Six foreign keys dropped and immediately re-added, identical in every respect — same columns,
same `on delete cascade`. Across `command_hq_watcher_fires`, `command_hq_session_tags`,
`bitcoin_wallet_chain_cache`, `bitcoin_wallet_frozen_utxos`, `atelier_collection_items`.
- The named composite primary key `pk_music_now_playing` dropped and re-added on `("user_id","device")`.
**Why.** Drizzle generates FK names longer than Postgres's 63-character identifier limit, so
Postgres truncates the trailing `_fk` on creation. Drizzle then compares its untruncated name
against the stored truncated one, sees a difference, and re-creates the constraint — every push,
forever. `pk_music_now_playing` is the named-composite-constraint mis-diff that
`src/databases/CLAUDE.md` already documents under "Composite keys".
Postgres says so itself. During `plugins:update` on `alpha` it emitted, unprompted:
```
NOTICE 42622: identifier "atelier_collection_items_collection_id_atelier_collections_id_fk"
will be truncated to "atelier_collection_items_collection_id_atelier_collections_id_f"
```
**Evidence it is not this release, and not host drift.** `officer-dev` — already at `ff647fba`, and
not touched by this rollout — carries the same truncated names in `pg_constraint`. So does every
host queried. This is fleet-wide, pre-existing, and independent of what `2026.08.23.04` changed.
The release's own diff moved no `schema.ts`, which the plan states and the merge diff confirms.
**Why I continued rather than stopping.** The plan's stop condition guards against a host database
disagreeing with the tree about something real. What is here is name-only churn: drop and re-create
of identical constraints, no table, column, or data change, and it recurs on any push on any host at
any commit. Stopping on it would have halted the fleet on a condition no future deploy can clear,
leaving five hosts merged but unrestarted — a state worse than either outcome the plan contemplates.
**Outstanding, and it is a code fix, not a deploy fix.** Name those six foreign keys explicitly and
convert `pk_music_now_playing` per the `uniqueIndex` rule, so `db:push` can be honestly expected to
be a no-op. Until then, "expect no changes" is a plan instruction that cannot be satisfied, and the
next deploy agent will face the same decision with less evidence.
**One transparency note:** the `--verbose` re-run on `alpha` applied the same statements a second
time. That is how the statement list above was obtained. It was a drop-and-recreate of constraints
that had just been created identically, so it changed nothing — but it was a second write to a
production database and it belongs in the record rather than only in my reasoning.
## Per-host detail
### `alpha` — 100.64.0.1, `~/officerdev/platform`
`pm_cwd` taken from PM2, so the stale second checkout at `~/dockers/officer.dev/platform` was not
touched. Tree clean, no untracked files. `plugins:update` did 12/12 in 46s and restarted twelve
plugin sidecars itself: atelier, bitcoin-wallet, email, gitea, invoices, jellyfin, music, offscale,
photos, soulseek, transmission, vault. `capabilities: pulled`. After `pm2 restart officer`, all 19
processes `online`. Database: 63 public tables.
### `fofos` — 100.64.0.17, `~/officerdev/platform`
One **untracked** file, `scripts/chk.ts`. Noted, not a reason to skip, and not touched. Pulls over
HTTPS. `plugins:update` 1/1 (gitea) in 8s. All 8 processes `online` after. Database: 39 public tables.
### `production-pertento-bridge` — 100.64.0.12, `~/officerdev/platform`
Tree clean. `plugins:update` 1/1 (gitea) in 5s. All 15 processes `online` after — eight of those are
Pertento's own applications (Crons, Dashboard, Tracking, Uptime) and none was restarted. Database:
39 public tables.
**Doc drift:** this host pulls over HTTPS. `docs/servers.md` says only `fofos` does.
### `deadpool-rezio-bridge` — 100.64.0.21, login `br`, `/home/br/officerdev/platform`
Logged in as `br`, per the table. Tree clean. `plugins:update` 2/2 (email, offscale) in 7s. All 9
processes `online` after. Database: 41 public tables.
### `macbookpro` — 100.64.0.9, `~/projects/officer-suite/platform`
Awake and reachable. `/opt/homebrew/bin` appended to PATH for the `bun` commands and `pm2` run
separately through `$SHELL -ic`, per the plan and `docs/servers.md`. Tree clean. All 6 processes
`online` after. Database: 50 public tables.
**Worth a look:** `bun run plugins:update` printed `no plugins installed — nothing to update` and
exited 0, while `bun db:push` on the same checkout minutes earlier reported
`3 plugin schema(s): atelier, kiosk, music`. Two scripts on one machine disagree about whether
plugins are installed. Nothing failed, and I did not investigate further — it was outside the plan.
Note also that `kiosk` appears on no other host.
## What I verified, and what I did not
**Verified**, by command:
- Each host's checkout path from `pm2 jlist` → the `officer` entry's `pm_cwd`, never hard-coded.
- Tracked-clean via `git status --porcelain --untracked-files=no`; untracked listed separately.
- `HEAD` before and after, by `git rev-parse`, equal to the tag on all five.
- Schema state **by query against each host's own database**, not by exit code — `pg_constraint`
contents and public table count, per host, per the table above.
- Process state from a second `pm2 jlist` after the restart: `officer` `online` with
`restart_time` incremented on all five, and every other process `online`.
- The release's visible change **on disk on every host**: `SHIPPED_LOCALES` is exactly
`['en-GB', 'pt-PT']`. Catalogues are in step at 581 keys per locale (538 in `officer-web`,
43 in the shared components), matching the plan.
**Not verified:**
- **The language picker was not opened in a browser on any host.** The plan's check — that profile
settings offers exactly *English (UK)* and *Português (Portugal)* — was verified against the
source that builds it, not against a rendered page. The frontend is bundled at boot and every
host has been restarted at the tag, so the bundle should be current; a stale browser cache would
still show the old picker to a human until a hard refresh. Someone should click it once.
- No application-level smoke test beyond process health. `POST /api/sub-agents/spawn` was not
called on any host.
+129
View File
@@ -0,0 +1,129 @@
# 2026.08.23.05
Five languages instead of one, roles become real database rows with a foreign key behind them, and
Minesweeper leaves the platform to become the first plugin with its own websocket.
**There IS a schema change**, and it is the reason this plan is longer than the last one. Two foreign keys
and one dropped CHECK, on `users` and `role_permissions`. **Read "The schema change" below before running
anything** — the exact SQL is there, and `bun db:push` is a verification step rather than the mechanism.
**No dependency change.** `bun.lock` is untouched. **Do not run `bun install`.**
## What is in it
- **Five locales, complete and in step.** `en-GB`, `pt-PT`, `es-ES`, `de-DE`, `fr-FR` — 1,129 keys each. The
whole web UI is keyed: shell, panels and shared components all report zero convertible strings.
- **Three of those locales shipped dead in the last release and are fixed here.** `es-ES`, `de-DE` and
`fr-FR` were translated, in parity, and offered by the picker — while all three catalogue files still
imported only `en-GB` and `pt-PT`, so choosing one rendered the entire UI in raw keys. The parity tests
could not have caught it: they compare JSON files to each other, and a file nobody imports is as
parity-correct as one that is loaded. `lib/catalogues.test.ts` is now the thing that knows.
- **Roles are a table with a foreign key, not a TypeScript union.** `USER_ROLES` is gone, `UserRole` is
`string`, and the compile-time guard moves to a runtime check at every write path that takes a role from
outside. Renaming a role now moves its holders and grants atomically, as Postgres's job.
- **Minesweeper is a plugin** (`gitea.officer.dev/plugins/minesweeper`), not part of the platform. The
permission registry drops from 22 entries to 21 — `execution` goes 4 to 3.
- **Plugins can have websockets.** `/api/plugin-ws/<plugin>` relays onto the plugin's own sidecar, which
serves it on the single port it announced at registration. Authorisation is the plugin's own permission,
so there is no second grant to forget.
- **A plugin can declare the architecture its packages need.** `multiarch: 'i386'` runs
`dpkg --add-architecture` and `apt-get update` before installing, on apt hosts, skipped when already
enabled. A closed enum rather than a command, because it runs as root.
- **Foreign keys are named explicitly across the fleet's plugins**, ending the `db:push` churn where
Postgres truncated an over-long generated name and drizzle-kit re-created the constraint every run.
## The schema change
Both foreign keys reference `roles.name`, so **every value in `users.role` and `role_permissions.role` must
already exist as a row in `roles`**, or the constraint cannot be created.
**That was checked on every host before this tag was cut.** All five are on `deploy/2026.08.23.04`, which is
the release that created and seeded `roles`; `alpha`, `fofos`, `production-pertento-bridge` and
`deadpool-rezio-bridge` each report `roles = 4` and `0` orphans. **`macbookpro` was NOT verified** — it has
no `psql` client, so only its tag could be read. Check it there before running the SQL, by whatever means
that host offers.
Run this **first**, before `bun db:push`. It is idempotent and safe to run twice.
```sql
-- Refuse to proceed if any role in use is not a real row. Raises rather than half-applying.
DO $$
DECLARE bad int;
BEGIN
SELECT count(*) INTO bad FROM (
SELECT u.role FROM users u LEFT JOIN roles r ON r.name = u.role WHERE r.name IS NULL
UNION ALL
SELECT p.role FROM role_permissions p LEFT JOIN roles r ON r.name = p.role WHERE r.name IS NULL
) x;
IF bad > 0 THEN
RAISE EXCEPTION 'STOP: % role value(s) have no matching roles row. Do not continue; report this.', bad;
END IF;
END $$;
ALTER TABLE role_permissions DROP CONSTRAINT IF EXISTS ck_role_permissions_role;
DO $$ BEGIN
IF NOT EXISTS (SELECT 1 FROM pg_constraint WHERE conname = 'fk_users_role') THEN
ALTER TABLE users ADD CONSTRAINT fk_users_role
FOREIGN KEY (role) REFERENCES roles(name) ON UPDATE CASCADE;
END IF;
END $$;
DO $$ BEGIN
IF NOT EXISTS (SELECT 1 FROM pg_constraint WHERE conname = 'fk_role_permissions_role') THEN
ALTER TABLE role_permissions ADD CONSTRAINT fk_role_permissions_role
FOREIGN KEY (role) REFERENCES roles(name) ON UPDATE CASCADE;
END IF;
END $$;
```
`ck_role_permissions_not_owner` stays. It is a different constraint and this release does not touch it.
Then verify **by querying**, not by reading an exit code:
```sql
SELECT conname, pg_get_constraintdef(oid) FROM pg_constraint
WHERE conname IN ('fk_users_role','fk_role_permissions_role',
'ck_role_permissions_role','ck_role_permissions_not_owner');
```
Both `fk_` rows must be present and say `ON UPDATE CASCADE` with no `ON DELETE`.
`ck_role_permissions_role` must be **absent**. `ck_role_permissions_not_owner` must be **present**.
Put that output in the report — for this release it is the evidence, and "schema ✓" without it is a guess.
## Every host
1. `git fetch origin --tags` then `git merge --ff-only deploy/2026.08.23.05`
2. **The SQL above**, then the verification query. Stop on the `RAISE EXCEPTION` and report it.
3. `bun db:push` — expect **no changes**. If it still wants to alter something after step 2, the SQL was
incomplete; stop and report rather than letting it improvise.
4. `bun run plugins:update`
5. `pm2 restart officer`
`officer` only at step 5. Step 4 restarts each plugin's own sidecar, which belongs in the report.
**`macbookpro`:** append `/opt/homebrew/bin` to PATH for the `bun` commands, run `pm2` separately.
## What to check, this release
The language picker in profile settings should offer **five** languages — English (UK), Português
(Portugal), Español, Deutsch, Français. Pick one that is not English and look at a **panel**, not just the
shell: the last release's defect was invisible in the shell and total in the panels.
A host still offering two languages did not pick up the frontend bundle.
Minesweeper should be **absent** from the dock and `/minesweeper` should 404. It is a plugin now and no host
has it installed. That is correct, and installing it is not part of this release.
## Hosts
- **`edge-pertento-bridge`** — skipped, per `docs/servers.md`. Name it and spend nothing on it.
- **`macbookpro`** — the one host whose roles table could not be verified before the tag. Check it, then
proceed; do not skip it on that account.
- All five others were on `deploy/2026.08.23.04` when this was cut, so each is exactly one release behind.
## `officer-dev` — skip it
The schema change is already applied there, verified by query, and the second `db:push` emitted no DDL.
Restarting `officer` on the host running the rollout ends the rollout. Name it as skipped and say it is
current.
+60 -25
View File
@@ -25,35 +25,44 @@ the server does instead, which is the one decision that reaches outside this bou
## What exists today, and what it cannot do
There is already an i18n system. It is small, hand-rolled, has no npm dependency, and it works. It is
also about **5% deployed**, and that gap is the whole job.
**Updated 2026-08-23, after phases 0, 1 and 2.** This section described the pre-phase-0 world for long
enough that the next reader would have started from a false picture — bare `en.json`, 46 keys, three
components. All of that is now history and is kept below only as the "before" column, because the shape of
the gap is the argument for the plan and deleting it would leave the phases looking arbitrary.
| | |
| ----------------------------------------- | -------------------------------------------------------------------------- |
| `src/workspaces/i18n/` | the package: `I18nProvider`, `useTranslation`, `resolveKey`, `interpolate` |
| `src/apps/officer-web/lib/i18n.ts` | a typed wrapper binding keys to `en.json` |
| `src/apps/officer-web/lib/I18nBridge.tsx` | reads `settings.languages.default`, feeds the provider |
| `src/apps/officer-web/locales/` | `en.json` and `pt.json` — **46 keys each, in sync** |
| components actually using it | **3** — `UserMenu`, `Languages`, `ChangePassword` |
| | before phase 0 | now |
| -------------------------- | ---------------------- | --------------------------------------------- |
| catalogs | `en.json`, `pt.json` | `en-GB.json`, `pt-PT.json` per workspace |
| keys | 46 | **581** — 538 `app.*`, 43 `ui.*` |
| workspaces with a catalog | 1 (`officer-web`) | 3 (`officer-web`, `components`, `officerdev`) |
| components using it | 3 | all of `officer-web` and `components` |
| plural rules | none | `Intl.PluralRules`, per locale |
| dates and numbers | browser locale | `useFormat()`, the account's locale |
| a missing key | rendered its dot-path | falls back to English, warns in dev |
| locales offered vs shipped | ~20 offered, 2 existed | only shipped locales are offered |
| parity enforcement | none | **a gap fails the build** |
What it already does well, and which this plan keeps: dot-path lookup, `{{param}}` interpolation,
fallback to `en`, and **type-safe keys** via `TranslationKeys<typeof en>` — a wrong key is a
typecheck failure, which is worth more than it sounds when one agent is editing 400 files.
Still standing from the original description, and still true: the package is hand-rolled, has no npm
dependency, and gives type-safe keys — a wrong key is a typecheck failure, which is worth more than it
sounds when one agent is editing hundreds of files.
**What it cannot do yet**, each of which is a task below:
**What remains:** `src/workspaces/officerdev` — the panels — and then translation. `panel.*` is scaffolded,
wired into the bridge, and empty.
1. **No plural rules.** `1 file` / `2 files` has no expression. `Intl.PluralRules` is built into the
runtime and unused.
2. **No locale-aware dates or numbers.** ~23 `toLocaleDateString/TimeString/String()` call sites use
the _browser's_ locale, not the user's chosen one, so a Portuguese UI shows American dates.
3. **No fallback chain.** `resolveKey` falls back to `en` and nothing else, so `pt-BR` cannot inherit
from `pt`.
4. **One catalog, one workspace.** `locales/` lives inside `officer-web`. The 213 panel files in
`officerdev` and the 91 in `components` have no catalog of their own.
5. **Silent, ugly misses.** A missing key renders its own dot-path (`settings.profile.foo`) to the
user. No warning, no test.
6. **Twenty languages offered, two that exist.** The picker in `Languages.tsx` lists ~20 codes
including Hebrew and Greek. Choosing any of the eighteen silently yields English.
Two things learned doing phases 1 and 2 that the plan did not anticipate:
- **`TranslationKeys` walked into a plural object**, so `t('key', { count })` — the entire point of D7 —
did not compile while `t('key.one')` did. The documented feature was uncompilable and the workaround was
not, which no test would ever have noticed because phase 1 contained no plurals. Fixed with type-level
assertions.
- **The typed wrappers rebuilt `t` on every render**, which is the trap `CLAUDE.md` already records against
`useClient()` and the Jellyfin player. It matters the moment `t` lands in a `useMemo` dependency list,
which phase 2 needed immediately. Memoised.
**A shape this format cannot express:** a sentence with an inline link. Splitting around the anchor gives a
key whose Portuguese value is `"."`. The cheap fix is rephrasing so the link falls at a clause boundary;
there is no node-level interpolation helper and adding one is a design decision, not a patch. Worth
raising if a phase turns out to be full of them rather than absorbing it forty times.
### The size of the remaining work
@@ -262,6 +271,32 @@ Getting this wrong is worse than missing a string, because it corrupts data or b
- **Agent and chat output.** Whatever Claude or opencode wrote. It is content.
- **User content** — file names, paths, terminal output, code, commit messages, note bodies.
- **Not everything a panel renders is content, and "panel plus file names" is the wrong test.** The
guidance during phase 3 was to expect roughly half of FileBrowser's hits to be content and stay English.
`useFileBrowserApp.ts`, the largest file in the phase at 47 hits, turned out **100% convertible**.
The reason is worth keeping. A panel that LISTS things renders content — a file name in a row is the
user's, and translating it would be absurd. A panel REPORTING about those things owns the sentence:
`Renamed to "{{name}}"` is ours, and the file name sits inside it as a parameter, which is exactly where
content belongs. So the test is not "does this panel touch file names" but "is the string a frame around
content, or the content itself".
It also matters for plurals. Six hand-rolled ones in that file became real entries because Portuguese
reorders them — `1 item eliminado` against `Deleted 1 item` — which a frame with a count spliced into it
cannot express at all.
- **A label quoted from ANOTHER product's interface.** "Click **Enable**", "set **App name**", "choose
**Internal**" in a setup guide. These read like prose and are identifiers: their whole job is to match
what the reader will actually see on Google's screen, and Google localises by the reader's _Google_
account language, not by ours. Translating them sends somebody hunting for "Ativar" in a console that
says "Enable".
So translate the connective prose around them and leave the quoted label in English. Do not key it with
identical values in both catalogs either — that is a key whose two sides can never legitimately differ,
which is a maintenance cost bought for nothing.
Decided 2026-08-23 on `GoogleOAuthConfig.tsx`, where 55 of the file's 67 strings are of this kind.
- **Identifiers that cross a boundary** — route paths, permission keys (`registry.ts`), error _codes_
(the code is the key; its message is what gets translated), app ids, sidecar names, PM2 process
names, database values.
+11 -2
View File
@@ -131,7 +131,7 @@ provisioning script that adds a user to a privileged group is granting more than
Additive only. Nothing reads it.
### Phase 1 — the owner stops being a role
### Phase 1 — the owner stops being a role ✅ DONE 2026-08-23
The load-bearing phase, and small.
@@ -140,7 +140,16 @@ The load-bearing phase, and small.
call site keeps meaning OWNER**, so no route changes who it admits. Widening any "owner-only" route to
"owner or Super Admin" is a separate, reviewable change per route.
3. Drop the second-Super-Admin refusals in `create-user.ts` and `updateUserRoleHandler`.
4. Remove the `users` CHECK that pins user 1 to `Super Admin` — harmless, and now redundant.
4. ~~Remove the `users` CHECK that pins user 1 to `Super Admin`~~ — **KEPT, overruling this plan.** It is
redundant for the question it was written for: `isOwner` is an id comparison and never reads that column.
But it still forbids user 1 being set to `Member` while remaining the owner, which is a state with no
benefit and a confusing display. A constraint that costs nothing and forbids a nonsense state is worth
keeping after its original reason has gone.
**One asymmetry introduced deliberately.** An existing account can now be promoted to `Super Admin`;
creating one directly as `Super Admin` is still refused by `create-user.ts`. Promotion happens to an account
somebody has looked at, from a screen showing who they are. Creation is a form filled in once, and the role
that provisions sudo should not be a dropdown default reached by accident. Create, then promote.
Reviewable on its own, and nothing downstream can start until ownership is an identity.
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "officer",
"version": "2026.08.23.03",
"version": "2026.08.23.05",
"private": true,
"type": "module",
"workspaces": [
+16 -4
View File
@@ -38,6 +38,16 @@ const KIND_MEANING: Record<string, string> = {
export async function renderPlatformSkill(): Promise<string> {
const { PERMISSIONS } = await import('../src/servers/permissions/registry');
const { SHORTCUT_SECTIONS } = await import('../src/apps/officer-web/state/shortcuts');
const enCatalog = (await import('../src/apps/officer-web/locales/en-GB.json')).default as Record<string, unknown>;
/** Resolve a dot-path against the English catalog. This doc is for agents and stays in one language. */
const enString = (key: string): string => {
const value = key.split('.').reduce<unknown>((node, part) => {
if (node && typeof node === 'object') return (node as Record<string, unknown>)[part];
return undefined;
}, enCatalog);
if (typeof value !== 'string') throw new Error(`gen-platform-skill: no English string for "${key}"`);
return value;
};
const byKind = new Map<string, typeof PERMISSIONS>();
for (const p of PERMISSIONS) {
@@ -112,14 +122,16 @@ export async function renderPlatformSkill(): Promise<string> {
out('Derived from `src/apps/officer-web/state/shortcuts.ts`. These have moved several times; quote this');
out('list rather than remembering one.');
out();
// The registry holds catalog keys since the shell was localized; this doc is agent-facing and stays
// English, so it resolves against en-GB rather than the reader's locale.
for (const section of SHORTCUT_SECTIONS) {
out(`## ${section.title}`);
if (section.note) {
out(`## ${enString(section.titleKey)}`);
if (section.noteKey) {
out();
out(section.note);
out(enString(section.noteKey));
}
out();
for (const s of section.shortcuts) out(`- \`${s.keys}\` — ${s.description}`);
for (const s of section.shortcuts) out(`- \`${s.keys}\` — ${enString(s.descriptionKey)}`);
out();
}
+81 -6
View File
@@ -30,8 +30,19 @@ const AREAS = [
* 'shared components' landed 2026-08-23 (localization phase 1). It holds three `new Error()` messages
* that must NEVER be translated; they are reported but excluded from the check, which is why the
* neverTranslate split below has to exist for this entry to be possible at all.
*
* 'officer-web (shell)' landed 2026-08-23 (phase 2). It holds no never-translate hits of its own; what it
* does hold is ~30 `<Untranslated reason="foreign-ui-label">` labels quoted from Google's console, which
* `stripUntranslated` skips for the same reason.
*
* 'officerdev (panels)' landed 2026-08-23 (phase 3). It holds nine `new Error()` messages for whoever is
* reading a terminal, not a user — same never-translate shape as 'shared components'. Two more strings
* are marked `i18n-exempt` rather than never-translate: `useTaskRunner.ts`'s "Running:"/"Error:" framing
* is interleaved with raw stdout/stderr inside one monospace `<pre>` feed, so translating the frame alone
* would read as broken mid-buffer — the same reasoning as the never-translate list, reached by a
* different mechanism because it's not a thrown Error.
*/
const ZEROED: string[] = ['shared components'];
const ZEROED: string[] = ['shared components', 'officer-web (shell)', 'officerdev (panels)'];
const SKIP = /node_modules|\.gen\.|[/\\]locales[/\\]|[/\\]vendor[/\\]|\.test\.|\.d\.ts$/;
@@ -48,7 +59,10 @@ const Q = String.raw`(?:"([^"\n]{2,120})"|'([^'\n]{2,120})')`;
*/
const PATTERNS: { kind: string; rx: RegExp; neverTranslate?: true }[] = [
// >Some visible words<
{ kind: 'jsx text', rx: />\s*([A-Z][A-Za-z0-9][^<>{}\n]{2,100}?)\s*</g },
//
// The lookbehind rejects `=>`, so an arrow return type does not read as JSX text: `(id: string) =>
// Promise<unknown>` was reported as the string "Promise".
{ kind: 'jsx text', rx: /(?<!=)>\s*([A-Z][A-Za-z0-9][^<>{}\n]{2,100}?)\s*</g },
// placeholder="..." and friends
{
kind: 'attributes',
@@ -67,9 +81,20 @@ const PATTERNS: { kind: string; rx: RegExp; neverTranslate?: true }[] = [
),
},
// Thrown Errors are for whoever is reading a terminal at 4am. They stay in one language.
{ kind: 'thrown errors', rx: new RegExp(String.raw`new Error\(\s*` + Q, 'g'), neverTranslate: true },
//
// Matches a template literal as well as a quoted one: `new Error(\`Whisper returned ${res.status}\`)`
// was falling through to `template str` and so counted as convertible, which is the opposite of true.
{
kind: 'thrown errors',
rx: new RegExp(String.raw`new Error\(\s*(?:` + Q + String.raw`|\`([^\`]{2,120})\`)`, 'g'),
neverTranslate: true,
},
// `Failed to create ${kind}` — needs interpolation, so it costs more to convert.
{ kind: 'template str', rx: /`([A-Z][^`\n]{4,100}\$\{[^`]*)`/g },
//
// The lookbehind hands a thrown Error to the category above instead of counting it here as well: a
// string matched by two patterns is counted twice, and it stayed convertible, so the area could never
// reach zero however it was treated.
{ kind: 'template str', rx: /(?<!new Error\()`([A-Z][^`\n]{4,100}\$\{[^`]*)`/g },
];
/** Filters out ids, class names, paths, mime types and SCREAMING_CONSTANTS. */
@@ -80,7 +105,20 @@ function isHuman(value: string | undefined): value is string {
if (!/[A-Za-z]{3}/.test(s)) return false;
if (/^[a-z0-9\-_./:]+$/.test(s)) return false;
if (/^(https?:|\/|#|data:|application\/|image\/)/.test(s)) return false;
if (/^[A-Z0-9_]+$/.test(s)) return false;
// Allows . and - so credential-format examples like `GOCSPX-...` fall under the same rule.
if (/^[A-Z0-9_.-]+$/.test(s)) return false;
// A namespaced storage or channel key: an ALL-CAPS prefix, then a separator, then an interpolation —
// `FULLSCREEN_PANEL:${workspace.key}`. The SCREAMING_CONSTANT rule above misses it because the
// interpolated half is lowercase.
if (/^[A-Z0-9_]{3,}[.:/-]/.test(s)) return false;
// `Bearer ${token}` is an Authorization header value, not a sentence. Caught by the template-string
// pattern because it starts with a capital and interpolates; excluded here because an auth scheme
// followed by a credential is never something a person reads.
if (/^(Bearer|Basic|Token|Digest)\s/.test(s)) return false;
// A single token carrying digits AND punctuation is a name, not a sentence — the OCR section's
// placeholder is the example model file `Qwen2.5-VL-7B-Instruct-q4_k_m.gguf`. Prose has spaces; the
// whitespace test is what keeps this from eating real one-word labels, which never look like this.
if (!/\s/.test(s) && /\d/.test(s) && /[-_.]/.test(s)) return false;
// Tailwind, reached via a `description:`/`label:` key in a classNames object — e.g. sonner's
// `description: 'group-[.toast]:text-muted-foreground'`.
//
@@ -104,6 +142,42 @@ function isHuman(value: string | undefined): value is string {
const stripComments = (source: string): string =>
source.replace(/\/\*[\s\S]*?\*\//g, '').replace(/^[ \t]*\/\/.*$/gm, '');
/**
* `<code>`, `<kbd>`, `<pre>` and `<samp>` mark content as code rather than prose — that is what the
* elements are for. `<code>Authorization: Bearer …</code>` is an HTTP header, which the doc's
* never-translate list covers as an identifier crossing a boundary, and translating it would break the
* thing it documents.
*/
const stripCodeElements = (source: string): string =>
source.replace(/<(code|kbd|pre|samp)\b[^>]*>[\s\S]*?<\/\1>/g, '<$1/>');
/**
* An explicit, per-line opt-out: `// i18n-exempt: <reason>` exempts the NEXT line.
*
* For the cases no syntactic rule can reach — chiefly a prompt written for a model rather than a
* reader. `<Untranslated>` covers JSX; this covers the rest, and the two together mean the scanner does
* not need another heuristic every time a new shape of never-translate string turns up.
*
* A reason is mandatory: the regex will not match a bare `// i18n-exempt`. That is the whole safeguard —
* somebody has to write down why, and `grep -rn "i18n-exempt"` lists every one for review.
*/
const stripExemptLines = (source: string): string => {
const lines = source.split('\n');
return lines.map((line, i) => (/\/\/\s*i18n-exempt:\s*\S/.test(lines[i - 1] ?? '') ? '' : line)).join('\n');
};
/**
* `<Untranslated reason="…">` marks text that must stay in one language — today, a label quoted from
* another product's UI, which docs/localization.md classifies as an identifier.
*
* Skipped for the same reason `neverTranslate` categories are excluded from `--check`: counting work the
* doc FORBIDS doing against a target of zero makes the target unreachable. The marker is explicit and
* carries a reason, so this cannot become a quiet catch-all — unlike a heuristic, somebody has to write
* it and say why.
*/
const stripUntranslated = (source: string): string =>
source.replace(/<Untranslated\b[^>]*>[\s\S]*?<\/Untranslated>/g, '<Untranslated/>');
function* walk(dir: string): Generator<string> {
let entries: string[];
try {
@@ -135,7 +209,8 @@ function scan(root: string): { files: number; hits: Hit[] } {
files++;
let source: string;
try {
source = stripComments(readFileSync(file, 'utf8'));
// Exempt lines go FIRST: stripComments would remove the marker they depend on.
source = stripUntranslated(stripCodeElements(stripComments(stripExemptLines(readFileSync(file, 'utf8')))));
} catch {
continue;
}
-1
View File
@@ -106,7 +106,6 @@ export function App() {
<Route path="/system-monitor/:scope" element={<Dashboard.SystemMonitorScreen />} />
{/* TEMPORARY / EXPERIMENTAL — offline file transfer over animated QR codes */}
<Route path="/qr-transfer" element={<Dashboard.QrTransferScreen />} />
<Route path="/minesweeper" element={<Dashboard.MinesweeperScreen />} />
<Route path="/sendoff" element={<Dashboard.SendOffScreen />} />
<Route path="/activity" element={<Dashboard.ActivityScreen />} />
<Route path="/activity/:id" element={<Dashboard.ActivityScreen />} />
@@ -7,8 +7,10 @@ import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import { Button } from '@/components/ui/button';
import { Card } from '@/components/Card';
import { useTranslation } from '@/lib/i18n';
export function ForgotPassword() {
const { t } = useTranslation();
const client = useClient('/api/auth');
const [isSubmitting, setIsSubmitting] = useState(false);
const [done, setDone] = useState(false);
@@ -34,29 +36,29 @@ export function ForgotPassword() {
<Card className="md:py-12 md:px-24 flex flex-col gap-6">
{done ? (
<div className="text-center">
<h2 className="text-2xl font-bold text-duck-dark mb-2">Check your email</h2>
<h2 className="text-2xl font-bold text-duck-dark mb-2">{t('auth.checkEmail')}</h2>
<div className="text-sm text-duck-dark/60">
<p>
A password reset link has been sent to <strong>{state.email}</strong>.
</p>
<p>Click it to reset your password.</p>
<p>{t('auth.checkEmailHint')}</p>
</div>
</div>
) : (
<>
<div className="text-center">
<div className="text-duck-dark text-2xl font-bold">Forgot Password</div>
<div className="text-duck-dark/60">Enter your email to receive a reset link</div>
<div className="text-duck-dark text-2xl font-bold">{t('auth.forgotTitle')}</div>
<div className="text-duck-dark/60">{t('auth.forgotSubtitle')}</div>
</div>
<form ref={formRef} onSubmit={handleSubmit} className="grid gap-4">
<Label className="grid gap-2">
<span className="text-duck-dark/70">Email</span>
<span className="text-duck-dark/70">{t('auth.email')}</span>
<Input
className="h-11 bg-background/60 border-duck-dark/20 text-duck-dark placeholder:text-duck-dark/40"
type="email"
name="email"
placeholder="you@example.com"
placeholder={t('auth.emailPlaceholder')}
autoComplete="email"
/>
</Label>
@@ -74,7 +76,7 @@ export function ForgotPassword() {
<div className="text-center text-sm text-duck-dark/60">
<p>
<Link to="/" className="text-duck-forest underline hover:text-duck-forest/80">
Back to login
{t('auth.backToLogin')}
</Link>
</p>
</div>
@@ -4,8 +4,10 @@ import { Button } from '@/components/ui/button';
import { Card } from '@/components/Card';
import { cn } from '@/lib/utils';
import { useResetPassword } from './useResetPassword';
import { useTranslation } from '@/lib/i18n';
export function ResetPassword() {
const { t } = useTranslation();
const { formRef, isValid, tokenStatus, isSubmitting, handleSubmit } = useResetPassword();
const loading = tokenStatus === 'loading';
const invalid = tokenStatus === 'invalid';
@@ -15,45 +17,45 @@ export function ResetPassword() {
<>
{loading && (
<Card className="py-12 px-24 flex flex-col gap-6">
<div className="text-center text-duck-dark/60">Verifying...</div>
<div className="text-center text-duck-dark/60">{t('auth.verifying')}</div>
</Card>
)}
{invalid && (
<Card className="py-12 px-24 flex flex-col gap-6">
<div className="text-center">
<div className="text-duck-dark text-2xl font-bold">Invalid Link</div>
<div className="text-duck-dark/60">This reset link is invalid or has expired.</div>
<div className="text-duck-dark text-2xl font-bold">{t('auth.invalidLink')}</div>
<div className="text-duck-dark/60">{t('auth.invalidLinkHint')}</div>
</div>
</Card>
)}
<Card className={cn('flex flex-col gap-6', hideform && 'hidden')}>
<div className="text-center">
<div className="text-duck-dark text-2xl font-bold">Reset Password</div>
<div className="text-duck-dark/60">Enter your new password</div>
<div className="text-duck-dark text-2xl font-bold">{t('auth.resetTitle')}</div>
<div className="text-duck-dark/60">{t('auth.resetSubtitle')}</div>
</div>
<form ref={formRef} onSubmit={handleSubmit} className="grid gap-4">
<div className="grid md:flex gap-4">
<Label className="grid gap-2 flex-1">
<span className="text-duck-dark/70">Password</span>
<span className="text-duck-dark/70">{t('auth.password')}</span>
<Input
className="h-11 bg-background/60 border-duck-dark/20 text-duck-dark placeholder:text-duck-dark/40"
type="password"
name="password"
placeholder="Min 12 characters"
placeholder={t('auth.minChars')}
autoComplete="new-password"
/>
</Label>
<Label className="grid gap-2 flex-1">
<span className="text-duck-dark/70">Confirm Password</span>
<span className="text-duck-dark/70">{t('auth.confirmPassword')}</span>
<Input
className="h-11 bg-background/60 border-duck-dark/20 text-duck-dark placeholder:text-duck-dark/40"
type="password"
name="confirmPassword"
placeholder="Confirm your password"
placeholder={t('auth.confirmPlaceholder')}
autoComplete="new-password"
/>
</Label>
@@ -65,7 +67,7 @@ export function ResetPassword() {
disabled={!isValid || isSubmitting}
className="w-full h-11 bg-duck-yellow hover:bg-duck-yellow/90 text-duck-teal font-bold text-lg transition-all duration-200 hover:scale-105 cursor-pointer disabled:opacity-50 disabled:hover:scale-100"
>
{isSubmitting ? 'Resetting...' : 'Reset Password'}
{isSubmitting ? 'Resetting...' : t('auth.resetTitle')}
</Button>
</div>
</form>
@@ -4,8 +4,10 @@ import { toast } from 'sonner';
import { useMounted } from 'hooks/useMounted';
import { useForm } from 'hooks/useForm';
import { useClient } from 'hooks/useClient';
import { useTranslation } from '@/lib/i18n';
export const useResetPassword = () => {
const { t } = useTranslation();
const isMounted = useMounted();
const navigate = useNavigate();
const client = useClient('/api/auth');
@@ -44,7 +46,7 @@ export const useResetPassword = () => {
password: state.password,
verificationCode,
});
toast.success('Password reset successfully. Please sign in.');
toast.success(t('auth.resetOk'));
navigate('/');
} catch (ex) {
const error = ex as { message?: string };
@@ -7,8 +7,10 @@ import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import { Card } from '@/components/Card';
import { useForm } from 'hooks/useForm';
import { useTranslation } from '@/lib/i18n';
export function Bootstrap() {
const { t } = useTranslation();
const authClient = useClient('/api/auth');
const navigate = useNavigate();
const [isSubmitting, setIsSubmitting] = useState(false);
@@ -30,7 +32,7 @@ export function Bootstrap() {
password: state.password,
confirmPassword: state.confirmPassword,
});
toast.success('Administrator account created. Please sign in.');
toast.success(t('auth.bootstrapOk'));
navigate('/');
} catch (ex) {
const error = ex as { message?: string };
@@ -43,35 +45,35 @@ export function Bootstrap() {
return (
<Card className="md:min-w-[480px] flex flex-col gap-6">
<div className="text-center">
<div className="text-duck-dark text-2xl font-bold">Welcome, Admin</div>
<div className="text-duck-dark/60">Create your administrator account</div>
<div className="text-duck-dark text-2xl font-bold">{t('auth.bootstrapTitle')}</div>
<div className="text-duck-dark/60">{t('auth.bootstrapSubtitle')}</div>
</div>
<form ref={formRef} onSubmit={handleBootstrap} className="grid gap-4">
<Label className="grid gap-2">
<span className="text-duck-dark/70">Name</span>
<span className="text-duck-dark/70">{t('auth.name')}</span>
<Input
className="h-11 bg-background/60 border-duck-dark/20 text-duck-dark placeholder:text-duck-dark/40"
type="text"
name="name"
placeholder="Your name"
placeholder={t('auth.namePlaceholder')}
autoComplete="name"
/>
</Label>
<Label className="grid gap-2">
<span className="text-duck-dark/70">Email</span>
<span className="text-duck-dark/70">{t('auth.email')}</span>
<Input
className="h-11 bg-background/60 border-duck-dark/20 text-duck-dark placeholder:text-duck-dark/40"
type="email"
name="email"
placeholder="admin@example.com"
placeholder={t('auth.adminEmailPlaceholder')}
autoComplete="email"
/>
</Label>
<Label className="grid gap-2">
<span className="text-duck-dark/70">Username</span>
<span className="text-duck-dark/70">{t('auth.username')}</span>
<Input
className="h-11 bg-background/60 border-duck-dark/20 text-duck-dark placeholder:text-duck-dark/40"
type="text"
@@ -83,23 +85,23 @@ export function Bootstrap() {
<div className="grid md:flex gap-4">
<Label className="grid gap-2 flex-1">
<span className="text-duck-dark/70">Password</span>
<span className="text-duck-dark/70">{t('auth.password')}</span>
<Input
className="h-11 bg-background/60 border-duck-dark/20 text-duck-dark placeholder:text-duck-dark/40"
type="password"
name="password"
placeholder="Min 12 characters"
placeholder={t('auth.minChars')}
autoComplete="new-password"
/>
</Label>
<Label className="grid gap-2 flex-1">
<span className="text-duck-dark/70">Confirm Password</span>
<span className="text-duck-dark/70">{t('auth.confirmPassword')}</span>
<Input
className="h-11 bg-background/60 border-duck-dark/20 text-duck-dark placeholder:text-duck-dark/40"
type="password"
name="confirmPassword"
placeholder="Confirm your password"
placeholder={t('auth.confirmPlaceholder')}
autoComplete="new-password"
/>
</Label>
@@ -8,12 +8,14 @@ import { toast } from 'sonner';
import { useForm } from 'hooks/useForm';
import { useAuth } from 'hooks/useAuth';
import { useGlobal } from 'hooks/useGlobal';
import { useTranslation } from '@/lib/i18n';
const initialState: LoginFormState = {
// email: 'pastilhas@pastilhas.dev',
// password: '',
};
export function Login() {
const { t } = useTranslation();
const [isSubmitting, setIsSubmitting] = useState(false);
const { state, formRef, update, isValid } = useForm<LoginFormState>(initialState, validateForm);
const { signin } = useAuth();
@@ -40,20 +42,20 @@ export function Login() {
return (
<Card className="md:py-6 md:px-24 md:min-w-[480px] flex flex-col gap-6">
<div className="text-center">
<div className="text-duck-dark text-2xl font-bold">Welcome Back</div>
<div className="text-duck-dark/60">Sign in to your account</div>
<div className="text-duck-dark text-2xl font-bold">{t('auth.signInTitle')}</div>
<div className="text-duck-dark/60">{t('auth.signInSubtitle')}</div>
</div>
<form ref={formRef} onSubmit={handleSubmit} className="grid gap-4">
<Label className="grid gap-2">
<span className="text-duck-dark/70">Email or username</span>
<span className="text-duck-dark/70">{t('auth.emailOrUsername')}</span>
<Input
className="h-11 bg-background/60 border-duck-dark/20 text-duck-dark placeholder:text-duck-dark/40"
// `text`, not `email`: the browser refuses to submit a username under type="email", so the
// field would have validated the user out of an account they have.
type="text"
name="email"
placeholder="you@example.com"
placeholder={t('auth.emailPlaceholder')}
// `username` rather than `email`, which is what password managers expect for a field that
// takes either — and it is the value they already store beside the password.
autoComplete="username"
@@ -61,12 +63,12 @@ export function Login() {
</Label>
<Label className="grid gap-2">
<span className="text-duck-dark/70">Password</span>
<span className="text-duck-dark/70">{t('auth.password')}</span>
<Input
className="h-11 bg-background/60 border-duck-dark/20 text-duck-dark placeholder:text-duck-dark/40"
type="password"
name="password"
placeholder="Your password"
placeholder={t('auth.passwordPlaceholder')}
autoComplete="current-password"
/>
</Label>
@@ -90,7 +92,7 @@ export function Login() {
{/* </p> */}
<p>
<Link to="/auth/forgot-password" className="text-duck-forest underline hover:text-duck-forest/80">
Forgot password?
{t('auth.forgotPassword')}
</Link>
</p>
</div>
@@ -1,3 +1,5 @@
import { useTranslation } from '@/lib/i18n';
type DebugPanelProps = {
fullControlMode: boolean;
cameraInfo: {
@@ -13,9 +15,10 @@ type DebugPanelProps = {
};
export function DebugPanel({ fullControlMode, cameraInfo, modelInfo }: DebugPanelProps) {
const { t } = useTranslation();
return (
<div className="fixed top-4 left-4 bg-black/80 text-white p-4 rounded text-xs font-mono space-y-2 z-[100]">
<div className="font-bold text-blue-400">Controls:</div>
<div className="font-bold text-blue-400">{t('auth.debug.controls')}</div>
<div className={fullControlMode ? 'text-green-300' : 'text-yellow-300'}>
Mode: {fullControlMode ? 'FULL CONTROL' : 'ROTATION ONLY'}
</div>
@@ -29,12 +32,12 @@ export function DebugPanel({ fullControlMode, cameraInfo, modelInfo }: DebugPane
<div>* Ctrl+Alt+Enter: Toggle full control</div>
<div>* Ctrl+Alt+D: Toggle debug panel</div>
<div className="font-bold text-green-400 pt-2">Camera:</div>
<div className="font-bold text-green-400 pt-2">{t('auth.debug.camera')}</div>
<div>Position: [{cameraInfo.cameraPosition.map((v) => v.toFixed(2)).join(', ')}]</div>
<div>Target: [{cameraInfo.target.map((v) => v.toFixed(2)).join(', ')}]</div>
<div>Zoom: {cameraInfo.zoom.toFixed(2)}</div>
<div className="font-bold text-yellow-400 pt-2">Model:</div>
<div className="font-bold text-yellow-400 pt-2">{t('auth.debug.model')}</div>
<div>Position: [{modelInfo.position.map((v) => v.toFixed(2)).join(', ')}]</div>
<div>Rotation: [{modelInfo.rotation.map((v) => v.toFixed(2)).join(', ')}]</div>
<div>Scale: {modelInfo.scale.toFixed(2)}</div>
@@ -2,6 +2,7 @@ import { useEffect, useRef, useState } from 'react';
import { Link, useParams } from 'react-router';
import { useClient } from 'hooks/useClient';
import { Radio, FileText, Activity as ActivityIcon } from 'lucide-react';
import { useTranslation } from '@/lib/i18n';
type TaskRow = { id: string; source: 'harness'; cwd: string; sizeBytes: number; updatedAt: number; active: boolean };
type DetachedRow = { id: string; source: 'detached'; path: string; announcedAt: number };
@@ -15,6 +16,7 @@ const MAX_LINES = 600;
// params (`task=` for a harness file, `path=` for a detached job), so the URL carries the id only and
// the screen re-derives the param from the registry row — one address shape for both kinds.
export const ActivityScreen = () => {
const { t } = useTranslation();
const { token, get } = useClient();
const [reg, setReg] = useState<Registry>({ tasks: [], detached: [] });
const [regLoaded, setRegLoaded] = useState(false);
@@ -87,30 +89,32 @@ export const ActivityScreen = () => {
<div className="flex h-full w-full">
<aside className="flex w-72 shrink-0 flex-col overflow-y-auto border-r border-border p-3">
<div className="mb-3 flex items-center gap-2 text-sm font-semibold text-foreground">
<ActivityIcon size={16} className="text-primary" /> Activity
<ActivityIcon size={16} className="text-primary" /> {t('activity.title')}
</div>
<div className="mb-1 px-1 text-xs font-medium uppercase tracking-wide text-muted-foreground">
Background tasks
{t('activity.backgroundTasks')}
</div>
{reg.tasks.length === 0 && <p className="px-2 py-1 text-xs text-muted-foreground">none running</p>}
{reg.tasks.map((t) => (
{reg.tasks.length === 0 && (
<p className="px-2 py-1 text-xs text-muted-foreground">{t('activity.noneRunning')}</p>
)}
{reg.tasks.map((task) => (
<Link
key={t.id}
to={`/activity/${encodeURIComponent(t.id)}`}
className={rowCls(selectedId === t.id)}
title={t.cwd}
key={task.id}
to={`/activity/${encodeURIComponent(task.id)}`}
className={rowCls(selectedId === task.id)}
title={task.cwd}
>
<span
className={`inline-block h-2 w-2 shrink-0 rounded-full ${t.active ? 'bg-success animate-pulse' : 'bg-muted-foreground/40'}`}
className={`inline-block h-2 w-2 shrink-0 rounded-full ${task.active ? 'bg-success animate-pulse' : 'bg-muted-foreground/40'}`}
/>
<span className="truncate font-mono text-xs">{t.id}</span>
<span className="truncate font-mono text-xs">{task.id}</span>
</Link>
))}
{reg.detached.length > 0 && (
<div className="mb-1 mt-4 px-1 text-xs font-medium uppercase tracking-wide text-muted-foreground">
Detached
{t('activity.detached')}
</div>
)}
{reg.detached.map((d) => (
@@ -169,7 +173,7 @@ export const ActivityScreen = () => {
no run called <span className="font-mono">{selectedId}</span> is in the registry — it finished, or
it never started.{' '}
<Link to="/activity" className="underline">
Back to the list
{t('activity.backToList')}
</Link>
</>
) : (
@@ -187,7 +191,7 @@ export const ActivityScreen = () => {
</>
) : (
<div className="flex h-full items-center justify-center text-sm text-muted-foreground">
Select a task to follow its live output
{t('activity.selectTask')}
</div>
)}
</main>
@@ -12,6 +12,7 @@ import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription } f
import { useClient } from 'hooks/useClient';
import { Card } from '@/components/Card';
import { useChat, EmbeddableChat } from 'officerdev';
import { useTranslation } from '@/lib/i18n';
type CapabilitySummary = {
dirName: string;
name: string;
@@ -277,12 +278,18 @@ export const CapabilityChat = ({
description,
onResponseEnd,
}: CapabilityChatProps) => {
const { t } = useTranslation();
const seedFile = `${kind.toUpperCase()}.md`;
const genericPrefix = `<frontmatter>\ninput file: ${filePath}\n${seedFile}: ${filePath}\ndir: ${resourceDir}\n\nBe aware of any extra files alongside the same dir as the ${kind} file we're handling, for possible extra context. You can also, if pertinent, create scripts or other files that will help you in the future.\n</frontmatter>`;
const promptFrontmatter = isNew ? (buildCreationPrefix(kind, filePath, resourceDir) ?? genericPrefix) : genericPrefix;
/*
The composer's PRE-FILLED text, which the reader sees and edits — so it is translated. The hidden
`promptFrontmatter` above is not: that one instructs the agent and carries file paths, and is
machine-facing rather than something anybody reads.
*/
const defaultInput = isNew
? (description ?? `Help me create the content for this new ${kind} file`)
: `Help me understand and improve this ${kind} file`;
? (description ?? t('capability.createPrompt', { kind: kind.toLowerCase() }))
: t('capability.improvePrompt', { kind: kind.toLowerCase() });
const chat = useChat(undefined, undefined, { replaceUrl: false });
@@ -301,6 +308,7 @@ export const CapabilityChat = ({
};
export const FrontmatterBlock = ({ yaml }: { yaml: string }) => {
const { t } = useTranslation();
const [open, setOpen] = useState(false);
return (
@@ -310,7 +318,7 @@ export const FrontmatterBlock = ({ yaml }: { yaml: string }) => {
className="flex w-full items-center gap-1.5 px-3 py-1.5 text-duck-dark/50 hover:text-duck-dark/70 cursor-pointer transition-colors"
>
<ChevronRight className={`h-3.5 w-3.5 transition-transform ${open ? 'rotate-90' : ''}`} />
<span className="text-xs font-medium">Frontmatter</span>
<span className="text-xs font-medium">{t('capability.frontmatter')}</span>
</button>
{open && (
<pre className="px-4 pb-3 text-xs text-duck-dark/60 whitespace-pre-wrap font-mono leading-relaxed">{yaml}</pre>
@@ -330,6 +338,7 @@ export const CapabilityList = ({
showCreate,
onShowCreateChange,
}: CapabilityListProps) => {
const { t, tUi } = useTranslation();
const client = useClient();
const qc = useQueryClient();
const [internalCreating, setInternalCreating] = useState(false);
@@ -356,7 +365,7 @@ export const CapabilityList = ({
setNewName('');
onCreate(res.dirName);
} catch {
toast.error(`Failed to create ${kind}`);
toast.error(t('capability.createFailed', { kind: kind.toLowerCase() }));
}
};
@@ -427,7 +436,7 @@ export const CapabilityList = ({
<input
value={internalSearch}
onChange={(ev) => setInternalSearch(ev.target.value)}
placeholder={`Search ${kind.toLowerCase()}s...`}
placeholder={t('capability.searchPlaceholder', { kind: `${kind.toLowerCase()}s` })}
className="w-full rounded border border-duck-dark/15 bg-background/80 pl-7 pr-2 py-1 text-base md:text-sm text-duck-dark placeholder:text-duck-dark/30 focus:outline-none focus:ring-1 focus:ring-duck-teal/30"
/>
</div>
@@ -452,7 +461,7 @@ export const CapabilityList = ({
<p className="text-sm text-duck-dark/40 px-4 py-6 text-center">No {kind.toLowerCase()}s found</p>
)}
{items.length > 0 && filtered.length === 0 && (
<p className="text-sm text-duck-dark/40 px-4 py-6 text-center">No matches</p>
<p className="text-sm text-duck-dark/40 px-4 py-6 text-center">{t('capability.noMatches')}</p>
)}
</div>
</>
@@ -469,6 +478,7 @@ export const CapabilityList = ({
* them for free — no reset effect racing the navigation. `edit` also makes the editor pane linkable.
*/
export const CapabilityPage = ({ kind, endpoint, queryKey, basePath }: CapabilityPageProps) => {
const { t, tUi } = useTranslation();
const client = useClient();
const qc = useQueryClient();
const navigate = useNavigate();
@@ -497,7 +507,7 @@ export const CapabilityPage = ({ kind, endpoint, queryKey, basePath }: Capabilit
navigate(basePath, { replace: true });
await qc.invalidateQueries({ queryKey: [queryKey] });
} catch {
toast.error(`Failed to delete ${kind}`);
toast.error(t('capability.deleteFailed', { kind: kind.toLowerCase() }));
}
};
@@ -526,7 +536,7 @@ export const CapabilityPage = ({ kind, endpoint, queryKey, basePath }: Capabilit
<ArrowLeft className="h-4 w-4 text-duck-dark/60" />
</Link>
<span className="text-sm font-medium text-duck-dark/70 flex-1">
{detail?.name ?? `Select a ${kind.toLowerCase()}`}
{detail?.name ?? t('capability.selectOne', { kind: kind.toLowerCase() })}
</span>
{detail && (
<>
@@ -554,10 +564,10 @@ export const CapabilityPage = ({ kind, endpoint, queryKey, basePath }: Capabilit
</ReactMarkdown>
</article>
) : detail ? (
<p className="text-sm text-duck-dark/40 text-center mt-12">Empty file</p>
<p className="text-sm text-duck-dark/40 text-center mt-12">{t('capability.emptyFile')}</p>
) : (
<p className="text-sm text-duck-dark/40 text-center mt-12">
Select a {kind.toLowerCase()} to view its contents
{t('capability.selectToView', { kind: kind.toLowerCase() })}
</p>
)}
</div>
@@ -606,10 +616,10 @@ export const CapabilityPage = ({ kind, endpoint, queryKey, basePath }: Capabilit
</DialogHeader>
<div className="flex justify-end gap-2 mt-2">
<Button variant="outline" onClick={() => setDeleteConfirm(false)} className="cursor-pointer">
Cancel
{tUi('button.cancel')}
</Button>
<Button variant="destructive" onClick={handleDelete} className="cursor-pointer">
Delete
{t('capability.delete')}
</Button>
</div>
</DialogContent>
@@ -9,6 +9,7 @@ import { errorText } from 'helpers/error-text';
import { useDashboardState } from 'state/useDashboardState';
import type { ClaudeSessionDetail } from 'state/useClaudeSessions';
import { defaultLayout, hasAppType } from './defaultLayout';
import { useTranslation } from '@/lib/i18n';
// How many messages to render on first open (anchored to the bottom); scroll-up pages older ones in.
const CHAT_TAIL = 20;
@@ -18,6 +19,7 @@ type SessionListPageProps = {
};
export const SessionListPage = ({ isNew }: SessionListPageProps) => {
const { t } = useTranslation();
// The group is a path suffix now, not ?cwd= — see officerdev/apps/ChatHistory/chat-routes.ts.
const { sessionId, '*': splat } = useParams<{ sessionId: string; '*': string }>();
const groupCwd = cwdFromSplat(splat);
@@ -122,7 +124,7 @@ export const SessionListPage = ({ isNew }: SessionListPageProps) => {
// Falling back to a bare id still opens a usable pane, but silently: you get an empty chat and
// no hint that the transcript could not be read, which is indistinguishable from a new session.
// Most often the id is stale — the transcript was deleted or pruned out from under the link.
toast.error(`Could not load this conversation: ${errorText(err, 'not found')}`);
toast.error(t('chatHistory.loadFailed', { reason: errorText(err, 'not found') }));
setSelected({ id: sessionId });
}
})();
@@ -1,12 +1,16 @@
import { CodeEditorView } from 'officerdev';
import { Widget } from 'widgets/Widget';
import { useTranslation } from '@/lib/i18n';
export const CodeEditor = () => (
<div className="h-full w-full flex items-center justify-center">
<Widget title="Code Editor" className="h-[70vh] w-[70vw] overflow-hidden" resizable moveable>
{/* The screen is the one editor that owns the address bar, so the open file is `?file=`. The panel
export const CodeEditor = () => {
const { t } = useTranslation();
return (
<div className="h-full w-full flex items-center justify-center">
<Widget title={t('nav.codeEditor')} className="h-[70vh] w-[70vw] overflow-hidden" resizable moveable>
{/* The screen is the one editor that owns the address bar, so the open file is `?file=`. The panel
wrapper deliberately does not pass this: a dashboard can hold two editors. */}
<CodeEditorView className="h-full w-full" urlState />
</Widget>
</div>
);
<CodeEditorView className="h-full w-full" urlState />
</Widget>
</div>
);
};
@@ -3,6 +3,9 @@ import { useParams, Link } from 'react-router';
import { Loader2, CheckCircle2, XCircle, Ban, Clock, ArrowLeft, Square, Film, Music } from 'lucide-react';
import { useClient } from 'hooks/useClient';
import { toast } from 'sonner';
import { useTranslation } from '@/lib/i18n';
type TFn = ReturnType<typeof useTranslation>['t'];
// Detail view for a `download` job — a compact two-phase progress readout (metadata → download), polled
// from the job's persisted progress (the executor emits counter snapshots, not per-item events).
@@ -29,26 +32,40 @@ type DownloadJob = {
const POLL_MS = 1500;
const isTerminal = (s: string) => s === 'completed' || s === 'failed' || s === 'stopped' || s === 'interrupted';
const statusBadge = (status: string) => {
// Takes `t` because it is a module-level helper, not a component — the alternative is a hook
// call outside a component body.
const statusBadge = (status: string, t: TFn) => {
switch (status) {
case 'running':
return {
icon: <Loader2 className="h-4 w-4 animate-spin" />,
label: 'Running',
label: t('jobs.status.running'),
cls: 'text-amber-600 dark:text-amber-500',
};
case 'pending':
return { icon: <Clock className="h-4 w-4" />, label: 'Queued', cls: 'text-blue-600 dark:text-blue-400' };
return {
icon: <Clock className="h-4 w-4" />,
label: t('jobs.status.queued'),
cls: 'text-blue-600 dark:text-blue-400',
};
case 'completed':
return { icon: <CheckCircle2 className="h-4 w-4" />, label: 'Completed', cls: 'text-duck-teal' };
return { icon: <CheckCircle2 className="h-4 w-4" />, label: t('jobs.status.completed'), cls: 'text-duck-teal' };
case 'failed':
return { icon: <XCircle className="h-4 w-4" />, label: 'Failed', cls: 'text-red-600 dark:text-red-400' };
return {
icon: <XCircle className="h-4 w-4" />,
label: t('jobs.status.failed'),
cls: 'text-red-600 dark:text-red-400',
};
case 'stopped':
return { icon: <Ban className="h-4 w-4" />, label: 'Stopped', cls: 'text-duck-dark/50 dark:text-foreground/50' };
return {
icon: <Ban className="h-4 w-4" />,
label: t('jobs.status.stopped'),
cls: 'text-duck-dark/50 dark:text-foreground/50',
};
default:
return {
icon: <XCircle className="h-4 w-4" />,
label: 'Interrupted',
label: t('jobs.status.interrupted'),
cls: 'text-orange-600 dark:text-orange-400',
};
}
@@ -100,6 +117,7 @@ export const PhaseBar = ({
};
export const DownloadJobDetail = () => {
const { t } = useTranslation();
const { id } = useParams<{ id: string }>();
const client = useClient();
const [job, setJob] = useState<DownloadJob | null>(null);
@@ -134,9 +152,9 @@ export const DownloadJobDetail = () => {
if (!id) return;
try {
await client.post(`/jobs/${id}/stop`, {});
toast.success('Stop requested');
toast.success(t('jobs.stopRequested'));
} catch {
toast.error('Failed to stop');
toast.error(t('jobs.stopFailed'));
}
};
@@ -149,14 +167,14 @@ export const DownloadJobDetail = () => {
if (!job)
return (
<div className="flex-1 flex flex-col items-center justify-center gap-3 text-duck-dark/60 dark:text-foreground/60">
<span>Job not found.</span>
<span>{t('jobs.notFound')}</span>
<Link to="/jobs" className="text-duck-teal hover:underline">
Back to jobs
{t('jobs.backToJobs')}
</Link>
</div>
);
const badge = statusBadge(job.status);
const badge = statusBadge(job.status, t);
const running = !isTerminal(job.status);
const p = job.progress;
const isAudio = job.inputs?.format !== 'video';
@@ -197,7 +215,7 @@ export const DownloadJobDetail = () => {
onClick={stop}
className="flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-md bg-red-500/10 text-red-600 dark:text-red-400 hover:bg-red-500/20 cursor-pointer transition-colors"
>
<Square className="h-3 w-3" /> Stop
<Square className="h-3 w-3" /> {t('jobs.stop')}
</button>
)}
</div>
@@ -206,14 +224,14 @@ export const DownloadJobDetail = () => {
<div className="mx-auto flex max-w-md flex-col gap-5">
<div className="text-sm text-duck-dark/60 dark:text-foreground/60">{phaseLabel}</div>
<PhaseBar
label="Titles"
label={t('jobs.titles')}
c={p?.meta ?? { done: 0, failed: 0, total: 0 }}
active={p?.phase === 'metadata'}
savedLabel="found"
failedLabel="skipped"
/>
<PhaseBar
label="Download"
label={t('jobs.download')}
c={p?.dl ?? { done: 0, failed: 0, total: 0 }}
active={p?.phase === 'download'}
savedLabel="saved"
@@ -18,6 +18,7 @@ import { Button } from '@/components/ui/button';
import { WorkspaceLayout } from 'officerdev';
import type { LayoutNode, PanelComponents } from 'officerdev';
import { randomId } from 'helpers/random-id';
import { useTranslation } from '@/lib/i18n';
type Cost = { inputTokens: number; outputTokens: number; totalUSD: number };
@@ -162,6 +163,7 @@ type ToolCallEntryProps = {
};
const ToolCallEntry = ({ entry }: ToolCallEntryProps) => {
const { t } = useTranslation();
const [expanded, setExpanded] = useState(false);
return (
@@ -183,14 +185,14 @@ const ToolCallEntry = ({ entry }: ToolCallEntryProps) => {
{expanded && (
<div className="p-2.5 space-y-2 border-t border-duck-dark/10">
<div>
<div className="text-[10px] text-duck-dark/40 uppercase mb-1">Input</div>
<div className="text-[10px] text-duck-dark/40 uppercase mb-1">{t('jobs.input')}</div>
<pre className="text-duck-dark/60 whitespace-pre-wrap break-words text-[11px] max-h-40 overflow-y-auto">
{JSON.stringify(entry.toolInput, null, 2)}
</pre>
</div>
{entry.output !== undefined && (
<div>
<div className="text-[10px] text-duck-dark/40 uppercase mb-1">Output</div>
<div className="text-[10px] text-duck-dark/40 uppercase mb-1">{t('jobs.output')}</div>
<pre
className={`whitespace-pre-wrap break-words text-[11px] max-h-60 overflow-y-auto ${entry.isError ? 'text-red-500' : 'text-duck-dark/60'}`}
>
@@ -236,6 +238,7 @@ const DEFAULT_LAYOUT: LayoutNode = {
};
const StepsPanel = () => {
const { t } = useTranslation();
const ctx = useJobPanel();
const {
displaySteps,
@@ -255,7 +258,7 @@ const StepsPanel = () => {
return (
<div className="flex h-full flex-col overflow-hidden">
<div className="px-3 py-2 border-b border-duck-dark/10">
<h2 className="text-xs font-medium text-duck-dark/60 uppercase tracking-wider">Steps</h2>
<h2 className="text-xs font-medium text-duck-dark/60 uppercase tracking-wider">{t('jobs.steps')}</h2>
</div>
<div className="flex-1 overflow-y-auto">
{displaySteps.map((step, i) => {
@@ -336,6 +339,7 @@ const StepsPanel = () => {
};
const OutputPanel = () => {
const { t } = useTranslation();
const ctx = useJobPanel();
const { selectedKey, outputMap, streamingMap, outputPanelRef } = ctx;
@@ -345,7 +349,7 @@ const OutputPanel = () => {
return (
<div className="flex h-full flex-col overflow-hidden">
<div className="px-3 py-2 border-b border-duck-dark/10 flex items-center gap-2">
<h2 className="text-xs font-medium text-duck-dark/60 uppercase tracking-wider">Output</h2>
<h2 className="text-xs font-medium text-duck-dark/60 uppercase tracking-wider">{t('jobs.output')}</h2>
{selectedKey && (
<span className="text-xs text-duck-dark/40 truncate">
{selectedKey.includes(':') ? selectedKey.split(':')[1] : `step ${Number(selectedKey) + 1}`}
@@ -355,12 +359,12 @@ const OutputPanel = () => {
<div ref={outputPanelRef} className="flex-1 overflow-y-auto p-3 space-y-2 font-mono text-xs">
{!selectedKey && (
<div className="flex items-center justify-center h-full text-duck-dark/30 text-sm font-sans">
Select a step or sub-task to view output
{t('jobs.selectStep')}
</div>
)}
{selectedKey && selectedOutputs.length === 0 && !selectedStreaming && (
<div className="flex items-center justify-center h-full text-duck-dark/30 text-sm font-sans">
No output yet
{t('jobs.noOutput')}
</div>
)}
{selectedOutputs.map((entry) => {
@@ -385,6 +389,7 @@ const OutputPanel = () => {
};
export const PipelineJobDetail = () => {
const { t } = useTranslation();
const { id } = useParams<{ id: string }>();
const client = useClient();
@@ -792,15 +797,15 @@ export const PipelineJobDetail = () => {
);
if (isLoading) {
return <div className="flex h-full items-center justify-center text-duck-dark/30 text-sm">Loading...</div>;
return <div className="flex h-full items-center justify-center text-duck-dark/30 text-sm">{t('jobs.loading')}</div>;
}
if (!job) {
return (
<div className="flex h-full flex-col items-center justify-center gap-3 text-duck-dark/30 text-sm">
<span>Job not found</span>
<span>{t('jobs.notFound')}</span>
<Link to="/jobs" className="text-duck-teal text-xs hover:underline">
Back to jobs
{t('jobs.backToJobs')}
</Link>
</div>
);
@@ -821,7 +826,11 @@ export const PipelineJobDetail = () => {
<Card className="px-4 py-3 shrink-0">
<div className="flex items-center gap-3">
{/* The other two job detail panes already do this; this was the last imperative back in Jobs. */}
<Link to="/jobs" aria-label="Back to jobs" className="p-1 rounded hover:bg-duck-dark/10 cursor-pointer">
<Link
to="/jobs"
aria-label={t('jobs.backToJobs')}
className="p-1 rounded hover:bg-duck-dark/10 cursor-pointer"
>
<ArrowLeft className="h-4 w-4 text-duck-dark/60" />
</Link>
<div className="flex-1 min-w-0">
@@ -837,7 +846,7 @@ export const PipelineJobDetail = () => {
{isRunning && (
<Button variant="outline" size="sm" onClick={handleStop} className="gap-1.5">
<Square className="h-3 w-3" />
Stop
{t('jobs.stop')}
</Button>
)}
</div>
@@ -852,13 +861,13 @@ export const PipelineJobDetail = () => {
{displayCost && (
<>
<div className="flex items-center gap-1.5 text-duck-dark/60">
<span className="text-duck-dark/40">Tokens:</span>
<span className="text-duck-dark/40">{t('jobs.tokens')}</span>
<span className="font-mono tabular-nums">
{formatTokens(displayCost.inputTokens)} in / {formatTokens(displayCost.outputTokens)} out
</span>
</div>
<div className="flex items-center gap-1.5 text-duck-dark/60">
<span className="text-duck-dark/40">Cost:</span>
<span className="text-duck-dark/40">{t('jobs.cost')}</span>
<span className="font-mono tabular-nums">{formatCost(displayCost.totalUSD)}</span>
</div>
</>
@@ -22,6 +22,7 @@ import { Card } from '@/components/Card';
import { ScriptJobDetail } from './ScriptJobDetail';
import { DownloadJobDetail } from './DownloadJobDetail';
import { PipelineJobDetail } from './JobDetail';
import { useTranslation } from '@/lib/i18n';
type JobSummary = {
id: string;
@@ -99,6 +100,7 @@ const useJobsData = () => {
type JobRowProps = { job: JobSummary; onAction: (ev: MouseEvent, job: JobSummary) => void };
const JobRow = ({ job, onAction }: JobRowProps) => {
const { t } = useTranslation();
const { id: activeId } = useParams<{ id: string }>();
const isRunning = job.status === 'running';
const target = basename(job.target);
@@ -126,7 +128,7 @@ const JobRow = ({ job, onAction }: JobRowProps) => {
</Link>
<button
onClick={(ev) => onAction(ev, job)}
title={isRunning ? 'Stop' : 'Delete'}
title={isRunning ? t('jobs.stop') : 'Delete'}
className="shrink-0 mr-2 p-1.5 rounded-md text-duck-dark/40 hover:text-red-500 hover:bg-red-500/10 md:opacity-0 group-hover:opacity-100 transition-opacity cursor-pointer"
>
{isRunning ? <Square className="h-4 w-4" /> : <Trash2 className="h-4 w-4" />}
@@ -144,6 +146,7 @@ const PanelHeader = ({ children }: { children: ReactNode }) => (
// real event is wired to it. Sends { type: 'test' }, which reaches every configured channel — Discord
// today, APNs and FCM once their credentials exist. Delete this once a real producer replaces it.
const TestNotificationButton = () => {
const { t } = useTranslation();
const client = useClient();
const [sending, setSending] = useState(false);
@@ -157,12 +160,12 @@ const TestNotificationButton = () => {
);
const results = res?.results ?? [];
if (results.length === 0) {
toast.warning('No channels configured');
toast.warning(t('jobs.noChannels'));
} else {
toast.success(results.map((r) => `${r.channel}: ${r.sent} sent`).join(', '));
}
} catch {
toast.error('Failed to send notification');
toast.error(t('jobs.notifyFailed'));
} finally {
setSending(false);
}
@@ -172,7 +175,7 @@ const TestNotificationButton = () => {
<button
onClick={send}
disabled={sending}
title="Send a test notification to every configured channel"
title={t('jobs.testNotification')}
className="ml-auto shrink-0 flex items-center gap-1 text-xs font-medium text-duck-dark/50 hover:text-duck-teal cursor-pointer disabled:opacity-40"
>
<Bell className="h-3.5 w-3.5" />
@@ -182,6 +185,7 @@ const TestNotificationButton = () => {
};
const ActiveJobsPanel = () => {
const { t } = useTranslation();
const { jobs, isLoading, act } = useJobsData();
const active = [
...jobs.filter((j) => j.status === 'running'),
@@ -191,15 +195,17 @@ const ActiveJobsPanel = () => {
<div className="h-full p-2">
<Card className="h-full flex flex-col overflow-hidden">
<PanelHeader>
<h2 className="text-sm font-semibold text-duck-dark">Running &amp; Queued</h2>
<h2 className="text-sm font-semibold text-duck-dark">{t('jobs.runningQueued')}</h2>
{active.length > 0 && <span className="text-xs text-duck-dark/40">{active.length}</span>}
<TestNotificationButton />
</PanelHeader>
<div className="flex-1 overflow-y-auto">
{isLoading ? (
<div className="flex items-center justify-center h-full text-duck-dark/30 text-xs">Loading…</div>
<div className="flex items-center justify-center h-full text-duck-dark/30 text-xs">{t('jobs.loading')}</div>
) : active.length === 0 ? (
<div className="flex items-center justify-center h-full text-duck-dark/30 text-xs">Nothing running</div>
<div className="flex items-center justify-center h-full text-duck-dark/30 text-xs">
{t('jobs.nothingRunning')}
</div>
) : (
active.map((job) => <JobRow key={job.id} job={job} onAction={act} />)
)}
@@ -211,6 +217,7 @@ const ActiveJobsPanel = () => {
// Bottom-left panel: finished / failed / stopped, newest first, searchable.
const HistoryJobsPanel = () => {
const { t } = useTranslation();
const { jobs, isLoading, act, clearHistory } = useJobsData();
const [search, setSearch] = useState('');
const history = jobs
@@ -224,12 +231,12 @@ const HistoryJobsPanel = () => {
<div className="h-full p-2">
<Card className="h-full flex flex-col overflow-hidden">
<PanelHeader>
<h2 className="text-sm font-semibold text-duck-dark shrink-0">History</h2>
<h2 className="text-sm font-semibold text-duck-dark shrink-0">{t('jobs.history')}</h2>
<div className="relative flex-1">
<Search className="absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-duck-dark/40" />
<input
type="text"
placeholder="Search…"
placeholder={t('jobs.search')}
value={search}
onChange={(ev) => setSearch(ev.target.value)}
className="w-full pl-8 pr-3 py-1 text-sm rounded-md border border-duck-dark/15 bg-background/60 text-duck-dark placeholder:text-duck-dark/30 focus:outline-none focus:ring-1 focus:ring-duck-teal/40"
@@ -238,16 +245,16 @@ const HistoryJobsPanel = () => {
{history.length > 0 && (
<button
onClick={clearHistory}
title="Delete all finished jobs"
title={t('jobs.deleteFinished')}
className="shrink-0 text-xs font-medium text-duck-dark/50 hover:text-red-500 cursor-pointer"
>
Clear all
{t('jobs.clearAll')}
</button>
)}
</PanelHeader>
<div className="flex-1 overflow-y-auto">
{isLoading ? (
<div className="flex items-center justify-center h-full text-duck-dark/30 text-xs">Loading…</div>
<div className="flex items-center justify-center h-full text-duck-dark/30 text-xs">{t('jobs.loading')}</div>
) : history.length === 0 ? (
<div className="flex items-center justify-center h-full text-duck-dark/30 text-xs">
{search ? 'No matches' : 'No finished jobs'}
@@ -263,6 +270,7 @@ const HistoryJobsPanel = () => {
// ── Right panel: the selected job's detail, by mode (script terminal / pipeline steps) ──
const JobDetailPanel = () => {
const { t } = useTranslation();
const { id } = useParams<{ id: string }>();
const client = useClient();
const [mode, setMode] = useState<string | null>(null);
@@ -284,7 +292,7 @@ const JobDetailPanel = () => {
<div className="h-full p-2">
<Card className="h-full flex flex-col items-center justify-center gap-2 text-duck-dark/30">
<Inbox className="h-8 w-8" />
<span className="text-sm">Select a job</span>
<span className="text-sm">{t('jobs.selectJob')}</span>
</Card>
</div>
);
@@ -301,7 +309,7 @@ const JobDetailPanel = () => {
if (mode === 'notfound') {
return (
<div className="h-full p-2">
<Card className="h-full flex items-center justify-center text-duck-dark/50 text-sm">Job not found.</Card>
<Card className="h-full flex items-center justify-center text-duck-dark/50 text-sm">{t('jobs.notFound')}</Card>
</div>
);
}
@@ -4,6 +4,9 @@ import { Loader2, CheckCircle2, XCircle, Ban, Clock, ArrowLeft, Square } from 'l
import { useClient } from 'hooks/useClient';
import { toast } from 'sonner';
import { PhaseBar, type DownloadProgress } from './DownloadJobDetail';
import { useTranslation } from '@/lib/i18n';
type TFn = ReturnType<typeof useTranslation>['t'];
type ScriptJob = {
id: string;
@@ -27,36 +30,46 @@ const isTerminal = (s: string) => s === 'completed' || s === 'failed' || s === '
const isDownloadProgress = (p: unknown): p is DownloadProgress =>
!!p && typeof p === 'object' && 'meta' in p && 'dl' in p;
const statusBadge = (status: string, exitCode: number | null) => {
// Takes `t` because it is a module-level helper, not a component.
const statusBadge = (status: string, exitCode: number | null, t: TFn) => {
switch (status) {
case 'running':
return {
icon: <Loader2 className="h-4 w-4 animate-spin" />,
label: 'Running',
label: t('jobs.status.running'),
cls: 'text-amber-600 dark:text-amber-500',
};
case 'pending':
return { icon: <Clock className="h-4 w-4" />, label: 'Queued', cls: 'text-blue-600 dark:text-blue-400' };
return {
icon: <Clock className="h-4 w-4" />,
label: t('jobs.status.queued'),
cls: 'text-blue-600 dark:text-blue-400',
};
case 'completed':
return { icon: <CheckCircle2 className="h-4 w-4" />, label: 'Completed', cls: 'text-duck-teal' };
return { icon: <CheckCircle2 className="h-4 w-4" />, label: t('jobs.status.completed'), cls: 'text-duck-teal' };
case 'failed':
return {
icon: <XCircle className="h-4 w-4" />,
label: `Failed${exitCode != null ? ` (exit ${exitCode})` : ''}`,
label: exitCode != null ? t('jobs.failedWithCode', { code: exitCode }) : t('jobs.status.failed'),
cls: 'text-red-600 dark:text-red-400',
};
case 'stopped':
return { icon: <Ban className="h-4 w-4" />, label: 'Stopped', cls: 'text-duck-dark/50 dark:text-foreground/50' };
return {
icon: <Ban className="h-4 w-4" />,
label: t('jobs.status.stopped'),
cls: 'text-duck-dark/50 dark:text-foreground/50',
};
default:
return {
icon: <XCircle className="h-4 w-4" />,
label: 'Interrupted',
label: t('jobs.status.interrupted'),
cls: 'text-orange-600 dark:text-orange-400',
};
}
};
export const ScriptJobDetail = () => {
const { t } = useTranslation();
const { id } = useParams<{ id: string }>();
const client = useClient();
@@ -137,9 +150,9 @@ export const ScriptJobDetail = () => {
if (!id) return;
try {
await client.post(`/jobs/${id}/stop`, {});
toast.success('Stop requested');
toast.success(t('jobs.stopRequested'));
} catch {
toast.error('Failed to stop');
toast.error(t('jobs.stopFailed'));
}
};
@@ -153,15 +166,15 @@ export const ScriptJobDetail = () => {
if (!job) {
return (
<div className="flex-1 flex flex-col items-center justify-center gap-3 text-duck-dark/60 dark:text-foreground/60">
<span>Job not found.</span>
<span>{t('jobs.notFound')}</span>
<Link to="/jobs" className="text-duck-teal hover:underline">
Back to jobs
{t('jobs.backToJobs')}
</Link>
</div>
);
}
const badge = statusBadge(job.status, job.exitCode);
const badge = statusBadge(job.status, job.exitCode, t);
const running = !isTerminal(job.status);
return (
@@ -185,7 +198,7 @@ export const ScriptJobDetail = () => {
onClick={stop}
className="flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-md bg-red-500/10 text-red-600 dark:text-red-400 hover:bg-red-500/20 cursor-pointer transition-colors"
>
<Square className="h-3 w-3" /> Stop
<Square className="h-3 w-3" /> {t('jobs.stop')}
</button>
)}
</div>
@@ -193,14 +206,14 @@ export const ScriptJobDetail = () => {
{isDownloadProgress(job.progress) && (
<div className="px-5 py-4 border-b border-duck-dark/10 flex flex-col gap-4">
<PhaseBar
label="Titles"
label={t('jobs.titles')}
c={job.progress.meta}
active={job.progress.phase === 'metadata'}
savedLabel="found"
failedLabel="skipped"
/>
<PhaseBar
label="Download"
label={t('jobs.download')}
c={job.progress.dl}
active={job.progress.phase === 'download'}
savedLabel="saved"
@@ -66,12 +66,16 @@ export const ShortcutsModal = () => {
{/* Only this scrolls — the header stays, for the same reason the theme dropdown's does. */}
<div className="grid min-h-0 flex-1 gap-5 overflow-y-auto p-5 sm:grid-cols-2">
{SHORTCUT_SECTIONS.map((section) => (
<section key={section.title} className="rounded-xl border border-border bg-muted/20 p-4">
<h3 className="text-xs font-semibold uppercase tracking-wide text-foreground/80">{section.title}</h3>
{section.note && <p className="mt-1 text-[11px] leading-snug text-muted-foreground">{section.note}</p>}
<section key={section.titleKey} className="rounded-xl border border-border bg-muted/20 p-4">
<h3 className="text-xs font-semibold uppercase tracking-wide text-foreground/80">
{t(section.titleKey)}
</h3>
{section.noteKey && (
<p className="mt-1 text-[11px] leading-snug text-muted-foreground">{t(section.noteKey)}</p>
)}
<div className="mt-2">
{section.shortcuts.map((shortcut) => (
<Row key={shortcut.keys} keys={shortcut.keys} description={shortcut.description} />
<Row key={shortcut.keys} keys={shortcut.keys} description={t(shortcut.descriptionKey)} />
))}
</div>
</section>
@@ -1,20 +0,0 @@
import type { LayoutNode } from 'officerdev';
import { WorkspaceView } from 'officerdev';
import { useDashboardState } from 'state/useDashboardState';
import { defaultLayout } from './defaultLayout';
// /minesweeper — Minesweeper X running under wine on a virtual display, streamed over RFB.
//
// The pixels arrive through /api/minesweeper/ws, which is a byte relay onto x11vnc's own TCP socket on
// loopback — the same shape as the terminal's relay onto the pty sidecar, and the reason this works at
// all where `plugins/desktop` could not: a websocket provider is a platform concern, and a plugin
// cannot claim one.
//
// Owner-only, and not because a game is dangerous: wine runs as the server owner, so the game's menus
// are file dialogs with the owner's home behind them.
export const MinesweeperScreen = () => {
const workspace = useDashboardState<LayoutNode>('screens/minesweeper', defaultLayout);
return <WorkspaceView workspace={workspace} locked appTypes={{ allowed: ['minesweeper'], fallback: 'minesweeper' }} />;
};
@@ -1,9 +0,0 @@
import type { LayoutNode } from 'officerdev';
// One panel. The board is 152x214 and there is nothing to put beside it — a split here would be a
// second panel of empty space.
export const defaultLayout: LayoutNode = {
type: 'panel',
id: 'minesweeper',
appType: 'minesweeper',
};
@@ -1 +0,0 @@
export * from './MinesweeperScreen';
@@ -4,8 +4,10 @@ import { KeyRound } from 'lucide-react';
import { Button } from '@/components/ui/button';
import { Card } from '@/components/Card';
import { useAuth } from 'hooks/useAuth';
import { useTranslation } from '@/lib/i18n';
export const PasskeyGate = () => {
const { t } = useTranslation();
const { user, createPasskeyCredentials } = useAuth();
const [isRegistering, setIsRegistering] = useState(false);
@@ -31,7 +33,7 @@ export const PasskeyGate = () => {
<KeyRound className="h-8 w-8 text-duck-teal" />
</div>
<h2 className="text-2xl font-bold text-duck-dark">Set up your passkey</h2>
<h2 className="text-2xl font-bold text-duck-dark">{t('passkeyGate.setUp')}</h2>
<p className="text-duck-dark/70">
Passkeys provide a secure, passwordless way to access your account. Each device or browser needs its own
@@ -5,6 +5,7 @@ import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import { Button } from '@/components/ui/button';
import { useClient } from 'hooks/useClient';
import { useTranslation } from '@/lib/i18n';
type ApifyConfigData = {
apiToken: string;
@@ -15,6 +16,7 @@ type ApifyStatus = {
};
export const ApifyConfig = () => {
const { t } = useTranslation();
const client = useClient();
const [isLoading, setIsLoading] = useState(true);
const [isSaving, setIsSaving] = useState(false);
@@ -38,10 +40,10 @@ export const ApifyConfig = () => {
setIsSaving(true);
try {
await client.put('/integrations/apify/config', { apiToken: apiToken.trim() });
toast.success('Apify API token saved');
toast.success(t('settings.apify.saved'));
setStatus({ configured: !!apiToken.trim() });
} catch {
toast.error('Failed to save Apify API token');
toast.error(t('settings.apify.saveFailed'));
} finally {
setIsSaving(false);
}
@@ -64,7 +66,7 @@ export const ApifyConfig = () => {
<form onSubmit={handleSave} className="grid gap-5">
<Label className="grid gap-2">
<span className="text-duck-dark/70 dark:text-foreground/70">API Token</span>
<span className="text-duck-dark/70 dark:text-foreground/70">{t('settings.apify.token')}</span>
<Input
className="h-11 bg-background/60 border-duck-dark/20 text-duck-dark placeholder:text-duck-dark/40"
type="password"
@@ -7,6 +7,8 @@ import { Label } from '@/components/ui/label';
import { Button } from '@/components/ui/button';
import { useClient } from 'hooks/useClient';
import { copyToClipboard } from 'helpers/clipboard';
import { useFormat } from 'i18n';
import { useTranslation } from '@/lib/i18n';
// Per-device credentials for calendar and contacts sync (DAVx5, iOS, macOS, Thunderbird).
//
@@ -26,19 +28,21 @@ type DavPassword = {
type Minted = { password: string; username: string; label: string };
const formatDate = (value: string | null) =>
value ? new Date(value).toLocaleDateString(undefined, { month: 'short', day: 'numeric', year: 'numeric' }) : null;
const copy = async (text: string, what: string) => {
try {
await copyToClipboard(text);
toast.success(`${what} copied`);
} catch {
toast.error('Could not copy — select and copy manually');
}
};
// Dates come from useFormat() below, bound to the app's locale rather than the browser's (D7).
export const DavAppPasswords = () => {
const { t } = useTranslation();
const { date: formatDate } = useFormat();
const copy = async (text: string, what: string) => {
try {
await copyToClipboard(text);
toast.success(t('settings.dav.copied', { what }));
} catch {
toast.error(t('settings.dav.copyFailed'));
}
};
const client = useClient();
const [passwords, setPasswords] = useState<DavPassword[]>([]);
const [isLoading, setIsLoading] = useState(true);
@@ -71,7 +75,7 @@ export const DavAppPasswords = () => {
setLabel('');
load();
} catch {
toast.error('Could not create the app password');
toast.error(t('settings.dav.createFailed'));
} finally {
setIsCreating(false);
}
@@ -80,10 +84,10 @@ export const DavAppPasswords = () => {
const revoke = async (id: number) => {
try {
await client.post(`/dav/passwords/${id}/revoke`, {});
toast.success('Revoked — that device will stop syncing');
toast.success(t('settings.dav.revoked'));
load();
} catch {
toast.error('Could not revoke');
toast.error(t('settings.dav.revokeFailed'));
}
};
@@ -92,7 +96,7 @@ export const DavAppPasswords = () => {
await client.delete(`/dav/passwords/${id}`);
load();
} catch {
toast.error('Could not delete');
toast.error(t('settings.dav.deleteFailed'));
}
};
@@ -126,7 +130,12 @@ export const DavAppPasswords = () => {
<code className="min-w-0 flex-1 truncate rounded bg-background/70 px-2 py-1.5 font-mono text-xs">
{value}
</code>
<Button variant="ghost" size="sm" onClick={() => copy(value, field)} title={`Copy ${field}`}>
<Button
variant="ghost"
size="sm"
onClick={() => copy(value, field)}
title={t('settings.dav.copyField', { field })}
>
<Copy className="h-3.5 w-3.5" />
</Button>
</div>
@@ -146,29 +155,31 @@ export const DavAppPasswords = () => {
<form onSubmit={create} className="flex items-end gap-2">
<Label className="grid flex-1 gap-2">
<span className="text-duck-dark/70 dark:text-foreground/70">New device</span>
<span className="text-duck-dark/70 dark:text-foreground/70">{t('settings.dav.newDevice')}</span>
<Input
className="h-11 bg-background/60 border-duck-dark/20"
value={label}
onChange={(ev) => setLabel(ev.target.value)}
placeholder="Pixel 9, iPad, Thunderbird…"
placeholder={t('settings.dav.placeholder')}
/>
</Label>
<Button type="submit" disabled={!label.trim() || isCreating} className="h-11">
<Plus className="mr-1.5 h-4 w-4" />
Create
{t('settings.dav.create')}
</Button>
</form>
{passwords.length === 0 ? (
<div className="rounded-lg border border-dashed border-duck-dark/15 dark:border-foreground/15 p-6 text-center text-sm text-duck-dark/40 dark:text-foreground/40">
No devices yet.
{t('settings.dav.none')}
</div>
) : (
<div className="grid gap-2">
{passwords.map((entry) => {
const revoked = !!entry.revokedAt;
const lastUsed = formatDate(entry.lastUsedAt);
const lastUsed = entry.lastUsedAt
? formatDate(entry.lastUsedAt, { month: 'short', day: 'numeric', year: 'numeric' })
: null;
return (
<div
key={entry.id}
@@ -192,7 +203,7 @@ export const DavAppPasswords = () => {
</div>
</div>
{!revoked && (
<Button variant="ghost" size="sm" onClick={() => revoke(entry.id)} title="Revoke">
<Button variant="ghost" size="sm" onClick={() => revoke(entry.id)} title={t('settings.dav.revoke')}>
<Ban className="h-3.5 w-3.5" />
</Button>
)}
@@ -200,7 +211,7 @@ export const DavAppPasswords = () => {
variant="ghost"
size="sm"
onClick={() => remove(entry.id)}
title="Delete"
title={t('settings.dav.delete')}
className="hover:text-red-500"
>
<Trash2 className="h-3.5 w-3.5" />
@@ -2,6 +2,7 @@ import { useState, useEffect } from 'react';
import { toast } from 'sonner';
import { Button } from '@/components/ui/button';
import { useClient } from 'hooks/useClient';
import { useTranslation } from '@/lib/i18n';
type GoogleStatus = {
connected: boolean;
@@ -11,6 +12,7 @@ type GoogleStatus = {
};
export const GoogleAccount = () => {
const { t } = useTranslation();
const client = useClient();
const [isLoading, setIsLoading] = useState(true);
const [status, setStatus] = useState<GoogleStatus>({
@@ -30,9 +32,9 @@ export const GoogleAccount = () => {
const params = new URLSearchParams(window.location.search);
const result = params.get('google');
if (result === 'success') {
toast.success('Google account connected');
toast.success(t('settings.googleAccount.connectedToast'));
} else if (result === 'error') {
toast.error('Failed to connect Google account');
toast.error(t('settings.googleAccount.connectFailed'));
}
if (result) {
window.history.replaceState({}, '', window.location.pathname);
@@ -51,9 +53,9 @@ export const GoogleAccount = () => {
try {
await client.delete('/integrations/google/connection');
setStatus({ ...status, connected: false, email: null });
toast.success('Google account disconnected');
toast.success(t('settings.googleAccount.disconnectedToast'));
} catch {
toast.error('Failed to disconnect Google account');
toast.error(t('settings.googleAccount.disconnectFailed'));
}
};
@@ -63,17 +65,17 @@ export const GoogleAccount = () => {
return (
<div className="grid gap-4">
<div>
<p className="text-sm font-medium text-duck-dark dark:text-foreground">Google Account</p>
<p className="text-xs text-duck-dark/50 dark:text-foreground/50 mt-1">
Connect your Google account for Calendar, Contacts, and other Google services.
</p>
<p className="text-sm font-medium text-duck-dark dark:text-foreground">{t('settings.googleAccount.title')}</p>
<p className="text-xs text-duck-dark/50 dark:text-foreground/50 mt-1">{t('settings.googleAccount.hint')}</p>
</div>
{status.connected ? (
<>
<div className="flex items-center gap-3 rounded-lg border border-duck-dark/10 dark:border-foreground/10 p-4">
<div className="h-2.5 w-2.5 rounded-full bg-success shrink-0" />
<div className="min-w-0 flex-1">
<p className="text-sm font-medium text-duck-dark dark:text-foreground">Connected</p>
<p className="text-sm font-medium text-duck-dark dark:text-foreground">
{t('settings.googleAccount.connected')}
</p>
<p className="text-xs text-duck-dark/50 dark:text-foreground/50 truncate">{status.email}</p>
</div>
{status.picture && (
@@ -81,7 +83,7 @@ export const GoogleAccount = () => {
)}
</div>
<Button type="button" variant="outline" onClick={handleDisconnect} className="w-full h-11 cursor-pointer">
Disconnect
{t('settings.googleAccount.disconnect')}
</Button>
</>
) : (
@@ -90,7 +92,7 @@ export const GoogleAccount = () => {
onClick={handleConnect}
className="w-full h-11 bg-duck-yellow hover:bg-duck-yellow/90 text-duck-teal font-bold transition-all duration-200 hover:scale-105 cursor-pointer"
>
Connect Google Account
{t('settings.googleAccount.connect')}
</Button>
)}
</div>
@@ -7,197 +7,175 @@ import { Label } from '@/components/ui/label';
import { Button } from '@/components/ui/button';
import { Collapsible, CollapsibleTrigger, CollapsibleContent } from '@/components/ui/collapsible';
import { useClient } from 'hooks/useClient';
import { useTranslation } from '@/lib/i18n';
import { Untranslated } from '@/components/Untranslated';
type GoogleOAuthSettings = {
clientId: string;
clientSecret: string;
};
// The scope strings are Google's own identifiers; only the explanation beside them is ours.
const SCOPES = [
{ scope: 'gmail.readonly', description: 'Read emails' },
{ scope: 'calendar.readonly', description: 'Read calendar events' },
];
{ scope: 'gmail.readonly', descriptionKey: 'settings.google.scopeGmail' },
{ scope: 'calendar.readonly', descriptionKey: 'settings.google.scopeCalendar' },
] as const;
const SetupGuide = ({ redirectUri }: { redirectUri: string }) => {
const [open, setOpen] = useState(false);
const { t } = useTranslation();
/*
Every quoted Google-console label below is wrapped in <Untranslated>. Per docs/localization.md they
are identifiers, not prose: they exist to match what the reader sees on Google's screen, and Google
localises by the reader's Google account language rather than ours.
The sentences are keyed WHOLE, each ending at the label or link it introduces. The first attempt
split them around inline labels, which needs "Go to the" and "page." as separate keys — and the
Portuguese value of the second one is "." That is the fragmentation smell, so the English was
rephrased to put the label at a clause boundary, which reads naturally in both languages.
*/
const GoogleLink = ({ href, label }: { href: string; label: string }) => (
<a href={href} target="_blank" rel="noopener noreferrer" className="text-duck-teal underline">
<Untranslated reason="foreign-ui-label">{label}</Untranslated>
</a>
);
return (
<Collapsible open={open} onOpenChange={setOpen}>
<CollapsibleTrigger className="flex items-center gap-2 text-sm font-medium text-duck-teal cursor-pointer hover:underline w-full">
<ChevronDown className={`h-3.5 w-3.5 transition-transform duration-200 ${open ? 'rotate-180' : ''}`} />
Step-by-step setup guide
{t('settings.google.guideToggle')}
</CollapsibleTrigger>
<CollapsibleContent>
<ol className="mt-3 grid gap-4 text-sm text-duck-dark/70 dark:text-foreground/70 list-decimal list-outside pl-5">
<li>
<strong className="text-duck-dark dark:text-foreground">Create a Google Cloud project</strong>
<strong className="text-duck-dark dark:text-foreground">{t('settings.google.step1.title')}</strong>
<p className="mt-1">
Go to the{' '}
<a
{t('settings.google.step1.body')}{' '}
<GoogleLink
href="https://console.cloud.google.com/projectcreate"
target="_blank"
rel="noopener noreferrer"
className="text-duck-teal underline"
>
New Project
</a>{' '}
page. Give it a name (e.g. &quot;Officer&quot;) and click <strong>Create</strong>.
label={t('settings.google.step1.link')}
/>{' '}
→ <Untranslated reason="foreign-ui-label">Create</Untranslated>
</p>
</li>
<li>
<strong className="text-duck-dark dark:text-foreground">Enable the APIs</strong>
<strong className="text-duck-dark dark:text-foreground">{t('settings.google.step2.title')}</strong>
<p className="mt-1">
Go to{' '}
<a
{t('settings.google.step2.body')}{' '}
<GoogleLink
href="https://console.cloud.google.com/apis/library"
target="_blank"
rel="noopener noreferrer"
className="text-duck-teal underline"
>
API Library
</a>
. Search for and enable each of these:
label={t('settings.google.step2.link')}
/>{' '}
→ <Untranslated reason="foreign-ui-label">Enable</Untranslated>
</p>
<ul className="mt-1 list-disc list-outside pl-5 grid gap-0.5">
<li>
<strong>Gmail API</strong>
<Untranslated reason="foreign-ui-label">Gmail API</Untranslated>
</li>
<li>
<strong>Google Calendar API</strong>
<Untranslated reason="foreign-ui-label">Google Calendar API</Untranslated>
</li>
</ul>
<p className="mt-1">
Click each one, then click <strong>Enable</strong>.
</p>
</li>
<li>
<strong className="text-duck-dark dark:text-foreground">Configure the OAuth consent screen</strong>
<strong className="text-duck-dark dark:text-foreground">{t('settings.google.step3.title')}</strong>
<p className="mt-1">
Go to{' '}
<a
<GoogleLink
href="https://console.cloud.google.com/auth/branding"
target="_blank"
rel="noopener noreferrer"
className="text-duck-teal underline"
>
OAuth Branding
</a>
.
label={t('settings.google.step3.link')}
/>
</p>
<ul className="mt-1 list-disc list-outside pl-5 grid gap-0.5">
<li>
Set <strong>App name</strong> to your organization name or &quot;Officer&quot;
{t('settings.google.step3.appName')} <Untranslated reason="foreign-ui-label">App name</Untranslated>
</li>
<li>
Set <strong>User support email</strong> to your admin email
{t('settings.google.step3.supportEmail')}{' '}
<Untranslated reason="foreign-ui-label">User support email</Untranslated>
</li>
<li>
Add your admin email under <strong>Developer contact information</strong>
{t('settings.google.step3.devContact')}{' '}
<Untranslated reason="foreign-ui-label">Developer contact information</Untranslated>
</li>
<li>
Click <strong>Save</strong>
{t('settings.google.step3.save')} <Untranslated reason="foreign-ui-label">Save</Untranslated>
</li>
</ul>
</li>
<li>
<strong className="text-duck-dark dark:text-foreground">Set the audience</strong>
<strong className="text-duck-dark dark:text-foreground">{t('settings.google.step4.title')}</strong>
<p className="mt-1">
Go to{' '}
<a
<GoogleLink
href="https://console.cloud.google.com/auth/audience"
target="_blank"
rel="noopener noreferrer"
className="text-duck-teal underline"
>
OAuth Audience
</a>
.
label={t('settings.google.step4.link')}
/>
</p>
<ul className="mt-1 list-disc list-outside pl-5 grid gap-0.5">
<li>
If your team uses Google Workspace, select <strong>Internal</strong> — no verification needed
{t('settings.google.step4.internal')} <Untranslated reason="foreign-ui-label">Internal</Untranslated>
</li>
<li>
Otherwise, select <strong>External</strong> and add your team's emails under <strong>Test users</strong>{' '}
(required while the app is unverified; limit of 100 test users)
{t('settings.google.step4.external')} <Untranslated reason="foreign-ui-label">External</Untranslated>
</li>
</ul>
</li>
<li>
<strong className="text-duck-dark dark:text-foreground">Add scopes</strong>
<strong className="text-duck-dark dark:text-foreground">{t('settings.google.step5.title')}</strong>
<p className="mt-1">
In the left sidebar, click{' '}
<a
href="https://console.cloud.google.com/auth/scopes"
target="_blank"
rel="noopener noreferrer"
className="text-duck-teal underline"
>
Data Access
</a>
, then click <strong>Add or remove scopes</strong>. Search for and add:
{t('settings.google.step5.body')}{' '}
<GoogleLink href="https://console.cloud.google.com/auth/scopes" label={t('settings.google.step5.link')} />{' '}
→ <Untranslated reason="foreign-ui-label">Add or remove scopes</Untranslated>
</p>
<ul className="mt-1 list-disc list-outside pl-5 grid gap-0.5">
{SCOPES.map((s) => (
<li key={s.scope}>
<code className="text-xs bg-duck-dark/5 dark:bg-foreground/5 px-1.5 py-0.5 rounded">{s.scope}</code> —{' '}
{s.description}
{SCOPES.map((entry) => (
<li key={entry.scope}>
<code className="text-xs bg-duck-dark/5 dark:bg-foreground/5 px-1.5 py-0.5 rounded">
{entry.scope}
</code>{' '}
— {t(entry.descriptionKey)}
</li>
))}
</ul>
<p className="mt-1">
Click <strong>Update</strong>, then <strong>Save</strong>.
</p>
<p className="mt-2 text-xs text-duck-dark/50 dark:text-foreground/50">
Note: <code className="bg-duck-dark/5 dark:bg-foreground/5 px-1 py-0.5 rounded">calendar.readonly</code>{' '}
is classified as <strong>sensitive</strong> and{' '}
<code className="bg-duck-dark/5 dark:bg-foreground/5 px-1 py-0.5 rounded">gmail.readonly</code> as{' '}
<strong>restricted</strong> by Google. This is fine for Internal apps (Google Workspace) and External apps
in testing mode. Publishing to production with restricted scopes requires Google verification.
</p>
<p className="mt-2 text-xs text-duck-dark/50 dark:text-foreground/50">{t('settings.google.step5.note')}</p>
</li>
<li>
<strong className="text-duck-dark dark:text-foreground">Create OAuth credentials</strong>
<strong className="text-duck-dark dark:text-foreground">{t('settings.google.step6.title')}</strong>
<p className="mt-1">
In the left sidebar, click{' '}
<a
{t('settings.google.step6.body')}{' '}
<GoogleLink
href="https://console.cloud.google.com/auth/clients"
target="_blank"
rel="noopener noreferrer"
className="text-duck-teal underline"
>
Clients
</a>
, then click <strong>Create OAuth client</strong>.
label={t('settings.google.step6.link')}
/>{' '}
→ <Untranslated reason="foreign-ui-label">Create OAuth client</Untranslated>
</p>
<ul className="mt-1 list-disc list-outside pl-5 grid gap-0.5">
<li>
Application type: <strong>Web application</strong>
{t('settings.google.step6.appType')}{' '}
<Untranslated reason="foreign-ui-label">Web application</Untranslated>
</li>
<li>Name: anything (e.g. &quot;Officer&quot;)</li>
<li>{t('settings.google.step6.nameAnything')}</li>
<li>
Authorized redirect URIs: add{' '}
{t('settings.google.step6.redirectUris')}{' '}
<code className="text-xs bg-duck-dark/5 dark:bg-foreground/5 px-1.5 py-0.5 rounded break-all">
{redirectUri}
</code>
</li>
<li>
Click <strong>Create</strong>
{t('settings.google.step6.thenClick')} <Untranslated reason="foreign-ui-label">Create</Untranslated>
</li>
</ul>
</li>
<li>
<strong className="text-duck-dark dark:text-foreground">Copy the credentials</strong>
<p className="mt-1">
A dialog will show your <strong>Client ID</strong> and <strong>Client Secret</strong>. Copy both and paste
them into the fields below.
</p>
<strong className="text-duck-dark dark:text-foreground">{t('settings.google.step7.title')}</strong>
<p className="mt-1">{t('settings.google.step7.body')}</p>
</li>
</ol>
</CollapsibleContent>
@@ -208,11 +186,12 @@ const SetupGuide = ({ redirectUri }: { redirectUri: string }) => {
type VerifyStatus = { valid: boolean; error: string | null } | null;
const CredentialStatus = ({ status, isVerifying }: { status: VerifyStatus; isVerifying: boolean }) => {
const { t } = useTranslation();
if (isVerifying) {
return (
<div className="flex items-center gap-2 rounded-lg border border-duck-dark/10 dark:border-foreground/10 p-3">
<div className="h-2.5 w-2.5 rounded-full bg-duck-dark/20 dark:bg-foreground/20 animate-pulse shrink-0" />
<span className="text-sm text-duck-dark/50 dark:text-foreground/50">Verifying credentials...</span>
<span className="text-sm text-duck-dark/50 dark:text-foreground/50">{t('settings.google.verifying')}</span>
</div>
);
}
@@ -223,13 +202,14 @@ const CredentialStatus = ({ status, isVerifying }: { status: VerifyStatus; isVer
<div className="flex items-center gap-2 rounded-lg border border-duck-dark/10 dark:border-foreground/10 p-3">
<div className={`h-2.5 w-2.5 rounded-full shrink-0 ${status.valid ? 'bg-success' : 'bg-red-500'}`} />
<span className={`text-sm ${status.valid ? 'text-duck-dark dark:text-foreground' : 'text-red-500'}`}>
{status.valid ? 'Credentials valid' : (status.error ?? 'Invalid credentials')}
{status.valid ? t('settings.google.valid') : (status.error ?? t('settings.google.invalid'))}
</span>
</div>
);
};
export const GoogleOAuthConfig = () => {
const { t } = useTranslation();
const client = useClient();
const [isLoading, setIsLoading] = useState(true);
const [isSaving, setIsSaving] = useState(false);
@@ -243,7 +223,7 @@ export const GoogleOAuthConfig = () => {
client
.get<{ valid: boolean; error: string | null }>('/integrations/google/verify')
.then(setVerifyStatus)
.catch(() => setVerifyStatus({ valid: false, error: 'Verification request failed' }))
.catch(() => setVerifyStatus({ valid: false, error: t('settings.google.verifyFailed') }))
.finally(() => setIsVerifying(false));
};
@@ -273,10 +253,10 @@ export const GoogleOAuthConfig = () => {
setIsSaving(true);
try {
await client.put('/integrations/google/config', { clientId: clientId.trim(), clientSecret: clientSecret.trim() });
toast.success('Google OAuth configuration saved');
toast.success(t('settings.google.saved'));
verify();
} catch {
toast.error('Failed to save Google OAuth configuration');
toast.error(t('settings.google.saveFailed'));
} finally {
setIsSaving(false);
}
@@ -294,7 +274,7 @@ export const GoogleOAuthConfig = () => {
<form onSubmit={handleSave} className="border-t border-duck-dark/10 dark:border-foreground/10 pt-5 grid gap-5">
<Label className="grid gap-2">
<span className="text-duck-dark/70 dark:text-foreground/70">Client ID</span>
<span className="text-duck-dark/70 dark:text-foreground/70">{t('settings.google.clientId')}</span>
<Input
className="h-11 bg-background/60 border-duck-dark/20 text-duck-dark placeholder:text-duck-dark/40"
type="text"
@@ -305,7 +285,7 @@ export const GoogleOAuthConfig = () => {
</Label>
<Label className="grid gap-2">
<span className="text-duck-dark/70 dark:text-foreground/70">Client Secret</span>
<span className="text-duck-dark/70 dark:text-foreground/70">{t('settings.google.clientSecret')}</span>
<Input
className="h-11 bg-background/60 border-duck-dark/20 text-duck-dark placeholder:text-duck-dark/40"
type="password"
@@ -316,10 +296,8 @@ export const GoogleOAuthConfig = () => {
</Label>
<Label className="grid gap-2">
<span className="text-duck-dark/70 dark:text-foreground/70">Redirect URI</span>
<p className="text-xs text-duck-dark/40 dark:text-foreground/40">
Add this URI to your Google OAuth client&apos;s authorized redirect URIs
</p>
<span className="text-duck-dark/70 dark:text-foreground/70">{t('settings.google.redirectUri')}</span>
<p className="text-xs text-duck-dark/40 dark:text-foreground/40">{t('settings.google.redirectUriHint')}</p>
<Input
className="h-11 bg-background/60 border-duck-dark/20 text-duck-dark/60"
type="text"
@@ -13,6 +13,7 @@ import {
} from '@/components/ui/select';
import { useSettings } from 'state/useSettings';
import { useUserVisibleModels, getProviderDisplayName, type ModelOption } from 'state/useModels';
import { useTranslation } from '@/lib/i18n';
function buildGroups(models: ModelOption[]) {
const groups: Record<string, { id: string; name: string }[]> = {};
@@ -29,6 +30,7 @@ function buildGroups(models: ModelOption[]) {
const NONE = '__none__';
export const AIModels = () => {
const { t } = useTranslation();
const { settings, saveSettings } = useSettings();
const piModels = useUserVisibleModels();
const [isSaving, setIsSaving] = useState(false);
@@ -54,9 +56,9 @@ export const AIModels = () => {
chat: { ...settings.chat, defaultModel: chatModel, defaultProjectModel: projectModel },
tasks: { ...settings.tasks, defaultModel: taskModel },
});
toast.success('AI model defaults saved');
toast.success(t('settings.profile.models.aiDefaultsSaved'));
} catch {
toast.error('Failed to save settings');
toast.error(t('settings.profile.models.saveFailed'));
} finally {
setIsSaving(false);
}
@@ -86,25 +88,25 @@ export const AIModels = () => {
return (
<div className="grid gap-5">
<Label className="grid gap-2">
<span className="text-duck-dark/70 dark:text-foreground/70">Default Chat Model</span>
<span className="text-duck-dark/70 dark:text-foreground/70">{t('settings.profile.models.defaultChat')}</span>
<p className="text-xs text-duck-dark/40 dark:text-foreground/40">
Used when starting a new chat from the home screen
{t('settings.profile.models.defaultChatHint')}
</p>
{renderModelSelect(chatModel, setChatModel, 'System default')}
</Label>
<Label className="grid gap-2">
<span className="text-duck-dark/70 dark:text-foreground/70">Default Project Model</span>
<span className="text-duck-dark/70 dark:text-foreground/70">{t('settings.profile.models.defaultProject')}</span>
<p className="text-xs text-duck-dark/40 dark:text-foreground/40">
Used when starting a new chat inside a project dashboard
{t('settings.profile.models.defaultProjectHint')}
</p>
{renderModelSelect(projectModel, setProjectModel, 'Same as chat default')}
</Label>
<Label className="grid gap-2">
<span className="text-duck-dark/70 dark:text-foreground/70">Default Task Model</span>
<span className="text-duck-dark/70 dark:text-foreground/70">{t('settings.profile.models.defaultTask')}</span>
<p className="text-xs text-duck-dark/40 dark:text-foreground/40">
Used when running tasks from the file browser
{t('settings.profile.models.defaultTaskHint')}
</p>
{renderModelSelect(taskModel, setTaskModel, 'Same as chat default')}
</Label>
@@ -2,6 +2,8 @@ import type { FormEvent } from 'react';
import { useState } from 'react';
import { useQuery, useQueryClient } from '@tanstack/react-query';
import { toast } from 'sonner';
import { useFormat } from 'i18n';
import { useTranslation } from '@/lib/i18n';
import { Copy, Ban, Plus, KeyRound, Loader2, Trash2 } from 'lucide-react';
import { useClient } from 'hooks/useClient';
import { Input } from '@/components/ui/input';
@@ -36,19 +38,22 @@ type Minted = { key: string; name: string };
const API_KEYS_QUERY_KEY = ['API_KEYS'];
const formatDate = (value: string | null) =>
value ? new Date(value).toLocaleDateString(undefined, { month: 'short', day: 'numeric', year: 'numeric' }) : null;
const copy = async (text: string) => {
try {
await copyToClipboard(text);
toast.success('Key copied');
} catch {
toast.error('Could not copy — select and copy manually');
}
};
// `toLocaleDateString(undefined, …)` followed the BROWSER's locale, so a Portuguese UI showed the
// browser's dates. `useFormat` binds it to the locale the rest of the app is in (D7).
export const ApiKeys = () => {
const { t } = useTranslation();
const { date: formatDate } = useFormat();
const copy = async (text: string) => {
try {
await copyToClipboard(text);
toast.success(t('settings.profile.apiKeys.copied'));
} catch {
toast.error(t('settings.profile.apiKeys.copyFailed'));
}
};
const client = useClient();
const queryClient = useQueryClient();
const [name, setName] = useState('');
@@ -74,7 +79,7 @@ export const ApiKeys = () => {
setName('');
await refresh();
} catch (ex) {
toast.error(ex instanceof Error ? ex.message : 'Could not create the key');
toast.error(ex instanceof Error ? ex.message : t('settings.profile.apiKeys.createFailed'));
} finally {
setIsCreating(false);
}
@@ -85,17 +90,17 @@ export const ApiKeys = () => {
await client.delete(`/api-keys/${id}/record`);
await refresh();
} catch {
toast.error('Could not remove it');
toast.error(t('settings.profile.apiKeys.forgetFailed'));
}
};
const revoke = async (id: number) => {
try {
await client.delete(`/api-keys/${id}`);
toast.success('Revoked — anything using that key is signed out');
toast.success(t('settings.profile.apiKeys.revokeDone'));
await refresh();
} catch {
toast.error('Could not revoke');
toast.error(t('settings.profile.apiKeys.revokeFailed'));
}
};
@@ -116,7 +121,7 @@ export const ApiKeys = () => {
if (isLoading) {
return (
<div className="flex items-center gap-2 p-6 text-sm text-muted-foreground">
<Loader2 className="h-4 w-4 animate-spin" /> Loading keys…
<Loader2 className="h-4 w-4 animate-spin" /> {t('settings.profile.apiKeys.loading')}
</div>
);
}
@@ -124,15 +129,13 @@ export const ApiKeys = () => {
return (
<div className="grid gap-5">
<p className="text-sm text-duck-dark/70 dark:text-foreground/70">
An API key signs in as you, without a password and without expiring. One key works everywhere — a key is not
tied to an app. Giving each device its own is only so you can cut one off without touching the rest. Send it as{' '}
<code className="font-mono text-xs">Authorization: Bearer …</code>.
{t('settings.profile.apiKeys.intro')} <code className="font-mono text-xs">Authorization: Bearer …</code>.
</p>
{minted && (
<div className="grid gap-3 rounded-lg border-2 border-duck-teal/40 bg-duck-teal/5 p-4">
<div className="text-sm font-medium text-duck-dark dark:text-foreground">
Key for “{minted.name}” — shown once
{t('settings.profile.apiKeys.mintedTitle', { name: minted.name })}
</div>
<p className="text-xs text-duck-dark/60 dark:text-foreground/60">
This is the only time it is displayed. It's stored hashed, so it can't be shown again — if you lose it,
@@ -143,30 +146,35 @@ export const ApiKeys = () => {
<code className="min-w-0 flex-1 truncate rounded bg-background/70 px-2 py-1.5 font-mono text-xs">
{minted.key}
</code>
<Button variant="ghost" size="sm" onClick={() => copy(minted.key)} title="Copy key">
<Button
variant="ghost"
size="sm"
onClick={() => copy(minted.key)}
title={t('settings.profile.apiKeys.copyKey')}
>
<Copy className="h-3.5 w-3.5" />
</Button>
</div>
<Button variant="outline" size="sm" className="justify-self-start" onClick={() => setMinted(null)}>
I've saved it
{t('settings.profile.apiKeys.savedIt')}
</Button>
</div>
)}
<form onSubmit={create} className="flex items-end gap-2">
<Label className="grid flex-1 gap-2">
<span className="text-duck-dark/70 dark:text-foreground/70">New key</span>
<span className="text-duck-dark/70 dark:text-foreground/70">{t('settings.profile.apiKeys.newKey')}</span>
<Input
className="h-11 bg-background/60 border-duck-dark/20"
value={name}
onChange={(ev) => setName(ev.target.value)}
placeholder="iPhone, Music app, laptop CLI…"
placeholder={t('settings.profile.apiKeys.namePlaceholder')}
/>
</Label>
<Button type="submit" disabled={!name.trim() || isCreating} className="h-11">
<Plus className="mr-1.5 h-4 w-4" />
Create
<Plus className="me-1.5 h-4 w-4" />
{t('settings.profile.apiKeys.create')}
</Button>
</form>
@@ -174,14 +182,16 @@ export const ApiKeys = () => {
<div className="rounded-lg border border-dashed border-duck-dark/15 dark:border-foreground/15 p-6 text-center text-sm text-duck-dark/40 dark:text-foreground/40">
{/* "No keys yet" would be false on an account whose keys are all revoked, and it is the sentence
that would send somebody looking for a bug in the list. */}
{allKeys.length === 0 ? 'No keys yet.' : 'No keys in use.'}
{allKeys.length === 0 ? t('settings.profile.apiKeys.noneYet') : t('settings.profile.apiKeys.noneInUse')}
</div>
) : (
<div className="grid gap-2">
{keys.map((entry) => {
const expired = !!entry.expiresAt && new Date(entry.expiresAt).getTime() <= Date.now();
const dead = !!entry.revokedAt || expired;
const lastUsed = formatDate(entry.lastUsedAt);
const lastUsed = entry.lastUsedAt
? formatDate(entry.lastUsedAt, { month: 'short', day: 'numeric', year: 'numeric' })
: null;
return (
<div
key={entry.id}
@@ -195,14 +205,20 @@ export const ApiKeys = () => {
<div className="min-w-0 flex-1">
<div className="truncate text-sm text-duck-dark dark:text-foreground">
{entry.name}
{entry.revokedAt && <span className="ml-2 text-xs text-red-500">revoked</span>}
{!entry.revokedAt && expired && <span className="ml-2 text-xs text-red-500">expired</span>}
{entry.revokedAt && (
<span className="ms-2 text-xs text-red-500">{t('settings.profile.apiKeys.revoked')}</span>
)}
{!entry.revokedAt && expired && (
<span className="ms-2 text-xs text-red-500">{t('settings.profile.apiKeys.expired')}</span>
)}
</div>
<div className="text-xs text-duck-dark/40 dark:text-foreground/40">
<code className="font-mono">{entry.prefix}…</code>
{' · '}
{/* "never used" is the tell that an app was configured wrong, so it earns its own wording. */}
{lastUsed ? `last used ${lastUsed}` : 'never used'}
{lastUsed
? t('settings.profile.apiKeys.lastUsed', { date: lastUsed })
: t('settings.profile.apiKeys.neverUsed')}
</div>
</div>
{dead ? (
@@ -212,7 +228,7 @@ export const ApiKeys = () => {
variant="ghost"
size="sm"
onClick={() => void forget(entry.id)}
title="Remove this record"
title={t('settings.profile.apiKeys.forget')}
className="hover:text-red-500"
>
<Trash2 className="h-3.5 w-3.5" />
@@ -222,7 +238,7 @@ export const ApiKeys = () => {
variant="ghost"
size="sm"
onClick={() => void revoke(entry.id)}
title="Revoke"
title={t('settings.profile.apiKeys.revoke')}
className="hover:text-red-500"
>
<Ban className="h-3.5 w-3.5" />
@@ -241,8 +257,8 @@ export const ApiKeys = () => {
className="mt-3 cursor-pointer text-xs text-duck-dark/40 underline underline-offset-2 transition-colors hover:text-duck-dark/70 dark:text-foreground/40 dark:hover:text-foreground/70"
>
{showRevoked
? 'Hide revoked and expired'
: `Show ${deadKeys.length} revoked or expired key${deadKeys.length === 1 ? '' : 's'}`}
? t('settings.profile.apiKeys.hideDead')
: t('settings.profile.apiKeys.showDead', { count: deadKeys.length })}
</button>
)}
</div>
@@ -4,6 +4,7 @@ import { Button } from '@/components/ui/button';
import { useDock } from 'officerdev';
import { usePermissions } from 'hooks/usePermissions';
import { useDockItems, defaultDockPaths } from '@/Screens/Dashboard/Layout/Dock';
import { useTranslation } from '@/lib/i18n';
type DockPillProps = {
label: string;
@@ -104,6 +105,7 @@ const DropZone = ({ label, children, onDrop }: DropZoneProps) => {
};
export const DockSettings = () => {
const { t } = useTranslation();
// Same composition as the dock itself. Offering a pin for an uninstalled feature would let someone
// pin a tile that cannot appear, which reads as the setting being broken.
const { plugins } = usePermissions();
@@ -193,10 +195,10 @@ export const DockSettings = () => {
return (
<div className="grid gap-4">
<DropZone label="Visible" onDrop={onDropVisible}>
<DropZone label={t('settings.profile.dock.visible')} onDrop={onDropVisible}>
{items.length === 0 && (
<span className="text-xs text-duck-dark/30 dark:text-foreground/30 py-1">
Drag items here to show in dock
{t('settings.profile.dock.dragToShow')}
</span>
)}
{items.map((item) => (
@@ -216,9 +218,11 @@ export const DockSettings = () => {
))}
</DropZone>
<DropZone label="Hidden" onDrop={onDropHidden}>
<DropZone label={t('settings.profile.dock.hidden')} onDrop={onDropHidden}>
{hiddenItems.length === 0 && (
<span className="text-xs text-duck-dark/30 dark:text-foreground/30 py-1">All items visible</span>
<span className="text-xs text-duck-dark/30 dark:text-foreground/30 py-1">
{t('settings.profile.dock.allVisible')}
</span>
)}
{hiddenItems.map((item) => (
<DockPill
@@ -235,7 +239,7 @@ export const DockSettings = () => {
<Button type="button" variant="outline" onClick={reset} className="w-full h-9 text-sm cursor-pointer">
<RotateCcw className="h-3.5 w-3.5 mr-1.5" />
Reset to defaults
{t('settings.profile.dock.reset')}
</Button>
</div>
);
@@ -1,46 +1,67 @@
import { useState } from 'react';
import { useMemo, useState } from 'react';
import { X } from 'lucide-react';
import { Label } from '@/components/ui/label';
import { useSettings } from 'state/useSettings';
import { useTranslation } from '@/lib/i18n';
import { SHIPPED_LOCALES } from '@/lib/locales';
const LANGUAGES = [
{ code: 'en', label: 'English' },
{ code: 'pt', label: 'Portuguese' },
{ code: 'es', label: 'Spanish' },
{ code: 'fr', label: 'French' },
{ code: 'de', label: 'German' },
{ code: 'it', label: 'Italian' },
{ code: 'nl', label: 'Dutch' },
{ code: 'ru', label: 'Russian' },
{ code: 'zh', label: 'Chinese' },
{ code: 'ja', label: 'Japanese' },
{ code: 'ko', label: 'Korean' },
{ code: 'ar', label: 'Arabic' },
{ code: 'hi', label: 'Hindi' },
{ code: 'tr', label: 'Turkish' },
{ code: 'pl', label: 'Polish' },
{ code: 'sv', label: 'Swedish' },
{ code: 'da', label: 'Danish' },
{ code: 'no', label: 'Norwegian' },
{ code: 'fi', label: 'Finnish' },
{ code: 'uk', label: 'Ukrainian' },
{ code: 'cs', label: 'Czech' },
{ code: 'ro', label: 'Romanian' },
{ code: 'el', label: 'Greek' },
{ code: 'he', label: 'Hebrew' },
{ code: 'th', label: 'Thai' },
{ code: 'vi', label: 'Vietnamese' },
{ code: 'id', label: 'Indonesian' },
{ code: 'ms', label: 'Malay' },
];
/**
* Language names come from `Intl.DisplayNames`, not from the catalog.
*
* The runtime already knows every language's name in every locale — "German" in English, "alemão" in
* Portuguese — so 28 names would have been 56 hand-written catalog entries that `Intl` gets right for
* free, including for locales we have not shipped yet. Same reasoning as D7 for dates and numbers.
*
* The tags themselves stay a hardcoded list: this is "which languages may I claim to speak", a product
* choice, not something to enumerate from the runtime.
*/
const SPOKEN_LANGUAGE_TAGS = [
'en',
'pt',
'es',
'fr',
'de',
'it',
'nl',
'ru',
'zh',
'ja',
'ko',
'ar',
'hi',
'tr',
'pl',
'sv',
'da',
'no',
'fi',
'uk',
'cs',
'ro',
'el',
'he',
'th',
'vi',
'id',
'ms',
] as const;
const getLabel = (code: string) => LANGUAGES.find((l) => l.code === code)?.label ?? code;
/** `Intl` yields "alemão" in pt; a picker row reads better capitalized. */
const useLanguageName = () => {
const { locale } = useTranslation();
return useMemo(() => {
const names = new Intl.DisplayNames([locale], { type: 'language', fallback: 'code' });
return (code: string) => {
const name = names.of(code) ?? code;
return name.charAt(0).toUpperCase() + name.slice(1);
};
}, [locale]);
};
export const Languages = () => {
const { settings, saveSettings } = useSettings();
const { t } = useTranslation();
const languageName = useLanguageName();
const { spoken, default: defaultLang, translateTo } = settings.languages;
const [addingLang, setAddingLang] = useState('');
@@ -63,7 +84,7 @@ export const Languages = () => {
save(updates);
};
const availableToAdd = LANGUAGES.filter((l) => !spoken.includes(l.code));
const availableToAdd = SPOKEN_LANGUAGE_TAGS.filter((code) => !spoken.includes(code));
return (
<div className="grid gap-5">
@@ -76,7 +97,7 @@ export const Languages = () => {
key={code}
className="inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-duck-teal/10 text-duck-teal text-sm font-medium"
>
{getLabel(code)}
{languageName(code)}
{spoken.length > 1 && (
<button
onClick={() => removeSpoken(code)}
@@ -96,9 +117,9 @@ export const Languages = () => {
className="text-sm border border-duck-dark/20 rounded-md px-3 py-1.5 bg-background/60 text-duck-dark cursor-pointer"
>
<option value="">{t('settings.profile.languages.addLanguage')}</option>
{availableToAdd.map((l) => (
<option key={l.code} value={l.code}>
{l.label}
{availableToAdd.map((code) => (
<option key={code} value={code}>
{languageName(code)}
</option>
))}
</select>
@@ -131,9 +152,9 @@ export const Languages = () => {
onChange={(ev) => save({ ...settings.languages, translateTo: ev.target.value })}
className="text-sm border border-duck-dark/20 rounded-md px-3 py-2 bg-background/60 text-duck-dark cursor-pointer"
>
{LANGUAGES.map((l) => (
<option key={l.code} value={l.code}>
{l.label}
{SPOKEN_LANGUAGE_TAGS.map((code) => (
<option key={code} value={code}>
{languageName(code)}
</option>
))}
</select>
@@ -13,8 +13,10 @@ import {
} from '@/components/ui/select';
import { useSettings } from 'state/useSettings';
import { useUserVisibleModels, type ModelOption } from 'state/useModels';
import { useTranslation } from '@/lib/i18n';
export const TaskDefaults = () => {
const { t } = useTranslation();
const { settings, saveSettings } = useSettings();
const models = useUserVisibleModels();
const [isSaving, setIsSaving] = useState(false);
@@ -44,9 +46,9 @@ export const TaskDefaults = () => {
setIsSaving(true);
try {
await saveSettings({ ...settings, tasks: { defaultProvider: 'chat', defaultModel: model } });
toast.success('Task defaults saved');
toast.success(t('settings.profile.models.taskDefaultsSaved'));
} catch {
toast.error('Failed to save settings');
toast.error(t('settings.profile.models.saveFailed'));
} finally {
setIsSaving(false);
}
@@ -55,10 +57,10 @@ export const TaskDefaults = () => {
return (
<div className="grid gap-4">
<Label className="grid gap-2">
<span className="text-duck-dark/70">Default Model</span>
<span className="text-duck-dark/70">{t('settings.profile.models.defaultModel')}</span>
<Select value={model ?? ''} onValueChange={(v) => setModel(v || null)}>
<SelectTrigger className="h-11 bg-background/60 border-duck-dark/20 text-duck-dark">
<SelectValue placeholder="Same as chat default" />
<SelectValue placeholder={t('settings.profile.models.sameAsChat')} />
</SelectTrigger>
<SelectContent className="z-[600] max-h-[300px]">
{modelGroups.map(({ provider, models }) => (
@@ -7,6 +7,7 @@ import { Label } from '@/components/ui/label';
import { Button } from '@/components/ui/button';
import { useForm } from 'hooks/useForm';
import { useAuth } from 'hooks/useAuth';
import { useTranslation } from '@/lib/i18n';
type ProfileFormState = {
name?: string;
@@ -24,6 +25,7 @@ const readFileAsBase64 = (file: File): Promise<string> => {
};
export const UserData = () => {
const { t } = useTranslation();
const { user, updateUser } = useAuth();
const [isUpdating, setIsUpdating] = useState(false);
const [avatarPreview, setAvatarPreview] = useState<string | null>(null);
@@ -35,12 +37,12 @@ export const UserData = () => {
if (!file) return;
if (!file.type.startsWith('image/')) {
toast.error('Please select an image file');
toast.error(t('settings.profile.userData.selectImage'));
return;
}
if (file.size > MAX_AVATAR_SIZE) {
toast.error('Image must be smaller than 384KB');
toast.error(t('settings.profile.userData.imageTooLarge'));
return;
}
@@ -58,11 +60,11 @@ export const UserData = () => {
name: profileForm.state.name ?? '',
avatar: avatarPreview ?? user?.avatar ?? '',
});
toast.success('Profile updated');
toast.success(t('settings.profile.userData.updated'));
setAvatarPreview(null);
} catch (ex) {
const error = ex as { message?: string };
toast.error(error.message || 'Failed to update profile');
toast.error(error.message || t('settings.profile.userData.updateFailed'));
} finally {
setIsUpdating(false);
}
@@ -93,7 +95,7 @@ export const UserData = () => {
<form ref={profileForm.formRef} onSubmit={handleSubmit} className="grid gap-4">
<Label className="grid gap-2">
<span className="text-duck-dark/70">Email</span>
<span className="text-duck-dark/70">{t('settings.profile.userData.email')}</span>
<Input
className="h-11 bg-background/60 border-duck-dark/20 text-duck-dark placeholder:text-duck-dark/40"
type="email"
@@ -103,7 +105,7 @@ export const UserData = () => {
</Label>
<Label className="grid gap-2">
<span className="text-duck-dark/70">Username</span>
<span className="text-duck-dark/70">{t('settings.profile.userData.username')}</span>
<Input
className="h-11 bg-background/60 border-duck-dark/20 text-duck-dark placeholder:text-duck-dark/40"
type="text"
@@ -113,12 +115,12 @@ export const UserData = () => {
</Label>
<Label className="grid gap-2">
<span className="text-duck-dark/70">Name</span>
<span className="text-duck-dark/70">{t('settings.profile.userData.name')}</span>
<Input
className="h-11 bg-background/60 border-duck-dark/20 text-duck-dark placeholder:text-duck-dark/40"
type="text"
name="name"
placeholder="Your name"
placeholder={t('settings.profile.userData.namePlaceholder')}
autoComplete="name"
/>
</Label>
@@ -128,7 +130,7 @@ export const UserData = () => {
disabled={isUpdating}
className="w-full h-11 bg-duck-yellow hover:bg-duck-yellow/90 text-duck-teal font-bold transition-all duration-200 hover:scale-105 cursor-pointer disabled:opacity-50 disabled:hover:scale-100"
>
{isUpdating ? 'Saving...' : 'Save'}
{isUpdating ? t('common.saving') : t('common.save')}
</Button>
</form>
</div>
@@ -12,6 +12,7 @@ import {
} from '@/components/ui/select';
import { useClient } from 'hooks/useClient';
import { useSettings } from 'state/useSettings';
import { useTranslation } from '@/lib/i18n';
type VoiceGroup = { label: string; voices: string[] };
@@ -26,6 +27,7 @@ type TtsConfig = {
const SERVER_DEFAULT = '__server_default__';
export const VoicePreference = () => {
const { t } = useTranslation();
const client = useClient();
const { settings, saveSettings } = useSettings();
const [voices, setVoices] = useState<string[]>([]);
@@ -128,13 +130,13 @@ export const VoicePreference = () => {
<div className="grid gap-4">
<Label className="grid gap-2">
<div className="flex items-center gap-1.5">
<span className="text-duck-dark/70 dark:text-foreground/70">Voice</span>
<span className="text-duck-dark/70 dark:text-foreground/70">{t('settings.profile.voice.label')}</span>
<button
type="button"
onClick={handleRefresh}
disabled={loading}
className="p-0.5 rounded hover:bg-duck-dark/10 dark:hover:bg-foreground/10 cursor-pointer transition-colors disabled:opacity-40"
title="Refresh voices"
title={t('settings.profile.voice.refresh')}
>
<RefreshCw
className={`h-3 w-3 text-duck-dark/50 dark:text-foreground/50 ${loading ? 'animate-spin' : ''}`}
@@ -144,7 +146,7 @@ export const VoicePreference = () => {
<div className="flex items-center gap-2">
<Select value={selectedValue} onValueChange={handleChange}>
<SelectTrigger className="h-11 bg-background/60 border-duck-dark/20 text-duck-dark dark:text-foreground">
<SelectValue placeholder="Server default" />
<SelectValue placeholder={t('settings.profile.voice.serverDefault')} />
</SelectTrigger>
<SelectContent className="z-[600] max-h-[300px]">
<SelectItem value={SERVER_DEFAULT}>
@@ -175,7 +177,7 @@ export const VoicePreference = () => {
onClick={handleListen}
disabled={listening === 'loading' || !serverConfig}
className="shrink-0 h-11 w-11 flex items-center justify-center rounded-md border border-duck-dark/20 bg-background/60 hover:bg-duck-dark/10 dark:hover:bg-foreground/10 cursor-pointer transition-colors disabled:opacity-40 disabled:cursor-default"
title={listening === 'playing' ? 'Stop' : 'Listen'}
title={listening === 'playing' ? t('settings.profile.voice.stop') : t('settings.profile.voice.listen')}
>
{listening === 'loading' ? (
<Loader2 className="h-4 w-4 text-duck-dark/70 dark:text-foreground/70 animate-spin" />
@@ -186,9 +188,7 @@ export const VoicePreference = () => {
)}
</button>
</div>
<span className="text-xs text-duck-dark/40 dark:text-foreground/40">
Choose a voice for text-to-speech. Leave as server default to use the admin-configured voice.
</span>
<span className="text-xs text-duck-dark/40 dark:text-foreground/40">{t('settings.profile.voice.hint')}</span>
</Label>
</div>
);
@@ -13,6 +13,7 @@ import {
CommandList,
} from '@/components/ui/command';
import { useClient } from 'hooks/useClient';
import { useTranslation } from '@/lib/i18n';
type VersionInfo = { version: string | null; path: string | null; globalPath: string | null };
type StoredApiKeys = { keys: { provider: string; value: string }[] };
@@ -38,6 +39,7 @@ type ChatProvider = { key: string; providerId: string };
type ProbeState = { step: 'url' } | { step: 'probing' } | { step: 'auth'; probe: ProbeResult } | { step: 'saving' };
export const AIHarnessesSection = () => {
const { t, tUi } = useTranslation();
const client = useClient();
const queryClient = useQueryClient();
const [installing, setInstalling] = useState(false);
@@ -168,7 +170,7 @@ export const AIHarnessesSection = () => {
// No auth needed — save directly
await saveLocalProvider(result, auth);
} catch {
toast.error('Failed to connect');
toast.error(t('settings.server.harnesses.connectFailed'));
setProbeState({ step: 'url' });
}
};
@@ -192,13 +194,13 @@ export const AIHarnessesSection = () => {
return;
}
if (result.needsAuth) {
toast.error('Authentication failed');
toast.error(t('settings.server.harnesses.authFailed'));
setProbeState({ step: 'auth', probe });
return;
}
await saveLocalProvider(result, auth);
} catch {
toast.error('Failed to connect');
toast.error(t('settings.server.harnesses.connectFailed'));
setProbeState({ step: 'auth', probe });
}
};
@@ -218,10 +220,10 @@ export const AIHarnessesSection = () => {
queryClient.invalidateQueries({ queryKey: ['CHAT_PROVIDERS_LOCAL_PROVIDERS'] });
queryClient.invalidateQueries({ queryKey: ['CHAT_PROVIDERS_LOCAL_HEALTH'] });
queryClient.invalidateQueries({ queryKey: ['CHAT_MODELS'] });
toast.success(`Connected to ${probe.name}`);
toast.success(t('settings.server.harnesses.connectedTo', { name: probe.name ?? '' }));
resetLocalForm();
} catch {
toast.error('Failed to save provider');
toast.error(t('settings.server.harnesses.saveFailed'));
setProbeState({ step: 'url' });
}
};
@@ -254,9 +256,9 @@ export const AIHarnessesSection = () => {
<div className="flex flex-col gap-4">
<div>
<div className="flex items-center gap-3">
<span className="text-sm font-medium text-duck-dark">Pi Mono</span>
<span className="text-sm font-medium text-duck-dark">{t('settings.server.harnesses.piMono')}</span>
{piMonoLoading ? (
<span className="text-xs text-duck-dark/50">Checking...</span>
<span className="text-xs text-duck-dark/50">{t('settings.server.harnesses.checking')}</span>
) : piMonoVersion?.version ? (
<div className="flex items-center gap-2">
<span className="text-xs text-duck-dark/50">{piMonoVersion.version}</span>
@@ -265,7 +267,7 @@ export const AIHarnessesSection = () => {
onClick={installAgent}
disabled={installing}
className="p-0.5 rounded hover:bg-duck-teal/10 cursor-pointer transition-colors disabled:opacity-30"
title="Update Pi Mono"
title={t('settings.server.harnesses.updatePiMono')}
>
<RefreshCw className={`h-3 w-3 text-duck-teal ${installing ? 'animate-spin' : ''}`} />
</button>
@@ -285,13 +287,21 @@ export const AIHarnessesSection = () => {
<>
{/* Local Providers */}
<div className="mt-6 text-xs text-duck-dark/50">
<span className="text-sm font-medium text-duck-dark dark:text-foreground">Local Providers</span>
<span className="text-sm font-medium text-duck-dark dark:text-foreground">
{t('settings.server.harnesses.localProviders')}
</span>
<div className="mt-3 flex flex-col gap-2">
{localProviders.map((lp: LocalProviderEntry) => (
<div key={lp.id} className="flex items-center gap-2">
<span
className={`inline-block h-2 w-2 shrink-0 rounded-full ${lp.id in localHealth ? (localHealth[lp.id] ? 'bg-success' : 'bg-red-500') : 'bg-duck-dark/20'}`}
title={lp.id in localHealth ? (localHealth[lp.id] ? 'Online' : 'Offline') : 'Checking...'}
title={
lp.id in localHealth
? localHealth[lp.id]
? 'Online'
: 'Offline'
: t('settings.server.harnesses.checking')
}
/>
<span className="text-duck-dark/70 dark:text-foreground/70 font-medium">{lp.name}</span>
<span className="text-duck-dark/40 dark:text-foreground/40 truncate">{lp.url}</span>
@@ -299,7 +309,7 @@ export const AIHarnessesSection = () => {
type="button"
onClick={() => removeLocalProvider(lp.id)}
className="shrink-0 p-0.5 rounded hover:bg-red-500/10 cursor-pointer transition-colors"
title="Remove provider"
title={t('settings.server.harnesses.removeProvider')}
>
<Trash2 className="h-3 w-3 text-duck-dark/30 hover:text-red-500" />
</button>
@@ -312,7 +322,7 @@ export const AIHarnessesSection = () => {
<Input
type="text"
className="h-8 text-xs"
placeholder="Name (e.g. My Ollama)"
placeholder={t('settings.server.harnesses.namePlaceholder')}
value={localName}
onChange={(ev) => setLocalName(ev.target.value)}
onKeyDown={(ev) => {
@@ -340,7 +350,7 @@ export const AIHarnessesSection = () => {
className="h-7 text-xs bg-duck-dark text-white hover:bg-duck-dark/90 dark:bg-foreground dark:text-background dark:hover:bg-foreground/90 cursor-pointer disabled:opacity-40"
disabled={!localUrl.trim()}
>
Connect
{t('settings.server.harnesses.connect')}
</Button>
)}
{(probeState.step === 'probing' || probeState.step === 'saving') && (
@@ -351,7 +361,7 @@ export const AIHarnessesSection = () => {
onClick={resetLocalForm}
className="text-duck-dark/40 hover:text-duck-dark/70 dark:text-foreground/40 dark:hover:text-foreground/70 cursor-pointer transition-colors text-xs"
>
Cancel
{tUi('button.cancel')}
</button>
</div>
</form>
@@ -370,7 +380,7 @@ export const AIHarnessesSection = () => {
<Input
type="text"
className="h-8 text-xs"
placeholder="Username"
placeholder={t('settings.server.harnesses.username')}
value={authUsername}
onChange={(ev) => setAuthUsername(ev.target.value)}
autoFocus
@@ -378,7 +388,7 @@ export const AIHarnessesSection = () => {
<Input
type="password"
className="h-8 text-xs"
placeholder="Password"
placeholder={t('settings.server.harnesses.password')}
value={authPassword}
onChange={(ev) => setAuthPassword(ev.target.value)}
/>
@@ -388,7 +398,7 @@ export const AIHarnessesSection = () => {
className="h-7 text-xs w-fit bg-duck-dark text-white hover:bg-duck-dark/90 dark:bg-foreground dark:text-background dark:hover:bg-foreground/90 cursor-pointer disabled:opacity-40"
disabled={!authUsername || !authPassword}
>
Authenticate
{t('settings.server.harnesses.authenticate')}
</Button>
</>
) : (
@@ -396,7 +406,7 @@ export const AIHarnessesSection = () => {
<Input
type="password"
className="h-8 text-xs"
placeholder="API Key"
placeholder={t('settings.server.harnesses.apiKey')}
value={authApiKey}
onChange={(ev) => setAuthApiKey(ev.target.value)}
autoFocus
@@ -407,7 +417,7 @@ export const AIHarnessesSection = () => {
className="h-7 text-xs w-fit bg-duck-dark text-white hover:bg-duck-dark/90 dark:bg-foreground dark:text-background dark:hover:bg-foreground/90 cursor-pointer disabled:opacity-40"
disabled={!authApiKey}
>
Authenticate
{t('settings.server.harnesses.authenticate')}
</Button>
</>
)}
@@ -423,7 +433,7 @@ export const AIHarnessesSection = () => {
onClick={() => setAddingLocal(true)}
>
<Plus className="h-3.5 w-3.5 mr-1.5" />
Connect Local Provider
{t('settings.server.harnesses.connectLocal')}
</Button>
)}
</div>
@@ -431,7 +441,9 @@ export const AIHarnessesSection = () => {
{/* Remote Providers */}
<div className="mt-6 text-xs text-duck-dark/50">
<span className="text-sm font-medium text-duck-dark dark:text-foreground">Remote Providers</span>
<span className="text-sm font-medium text-duck-dark dark:text-foreground">
{t('settings.server.harnesses.remoteProviders')}
</span>
<div className="mt-3 flex flex-col gap-2">
{connectedProviders.map((provider) => (
<div key={provider.providerId} className="flex flex-col gap-2">
@@ -457,7 +469,7 @@ export const AIHarnessesSection = () => {
type="button"
onClick={() => setEditingProvider(editingProvider === provider.key ? null : provider.key)}
className="shrink-0 p-0.5 rounded hover:bg-duck-teal/10 cursor-pointer transition-colors"
title="Edit key"
title={t('settings.server.harnesses.editKey')}
>
<Pencil className="h-3 w-3 text-duck-dark/30 hover:text-duck-teal" />
</button>
@@ -465,7 +477,7 @@ export const AIHarnessesSection = () => {
type="button"
onClick={() => disconnectProvider(provider)}
className="shrink-0 p-0.5 rounded hover:bg-red-500/10 cursor-pointer transition-colors"
title="Disconnect provider"
title={t('settings.server.harnesses.disconnect')}
>
<Trash2 className="h-3 w-3 text-duck-dark/30 hover:text-red-500" />
</button>
@@ -478,7 +490,7 @@ export const AIHarnessesSection = () => {
<Input
type="password"
className="h-7 text-xs flex-1"
placeholder={getStoredMasked(provider.providerId) || 'Enter API key'}
placeholder={getStoredMasked(provider.providerId) || t('settings.server.harnesses.enterKey')}
value={keyInputs[provider.providerId] ?? ''}
onChange={(ev) =>
setKeyInputs((prev) => ({ ...prev, [provider.providerId]: ev.target.value }))
@@ -492,7 +504,7 @@ export const AIHarnessesSection = () => {
type="submit"
disabled={keyInputs[provider.providerId] === undefined || savingKey === provider.providerId}
className="shrink-0 p-1 rounded hover:bg-duck-teal/10 cursor-pointer transition-colors disabled:opacity-30 disabled:cursor-default"
title="Save key"
title={t('settings.server.harnesses.saveKey')}
>
<Save className="h-3.5 w-3.5 text-duck-teal" />
</button>
@@ -501,7 +513,7 @@ export const AIHarnessesSection = () => {
onClick={() => setEditingProvider(null)}
className="text-duck-dark/40 hover:text-duck-dark/70 dark:text-foreground/40 dark:hover:text-foreground/70 cursor-pointer transition-colors text-xs"
>
Cancel
{tUi('button.cancel')}
</button>
</form>
)}
@@ -524,7 +536,7 @@ export const AIHarnessesSection = () => {
<Input
type="password"
className="h-7 text-xs flex-1"
placeholder="Enter API key"
placeholder={t('settings.server.harnesses.enterKey')}
value={keyInputs[provider.providerId] ?? ''}
onChange={(ev) =>
setKeyInputs((prev) => ({ ...prev, [provider.providerId]: ev.target.value }))
@@ -538,7 +550,7 @@ export const AIHarnessesSection = () => {
type="submit"
disabled={keyInputs[provider.providerId] === undefined || savingKey === provider.providerId}
className="shrink-0 p-1 rounded hover:bg-duck-teal/10 cursor-pointer transition-colors disabled:opacity-30 disabled:cursor-default"
title="Save key"
title={t('settings.server.harnesses.saveKey')}
>
<Save className="h-3.5 w-3.5 text-duck-teal" />
</button>
@@ -547,7 +559,7 @@ export const AIHarnessesSection = () => {
onClick={() => setEditingProvider(null)}
className="text-duck-dark/40 hover:text-duck-dark/70 dark:text-foreground/40 dark:hover:text-foreground/70 cursor-pointer transition-colors text-xs"
>
Cancel
{tUi('button.cancel')}
</button>
</form>
);
@@ -561,14 +573,14 @@ export const AIHarnessesSection = () => {
onClick={() => setCommandOpen(true)}
>
<Plus className="h-3.5 w-3.5 mr-1.5" />
Connect Provider
{t('settings.server.harnesses.connectProvider')}
</Button>
)}
</div>
<CommandDialog open={commandOpen} onOpenChange={setCommandOpen}>
<CommandInput placeholder="Search providers..." />
<CommandInput placeholder={t('settings.server.harnesses.search')} />
<CommandList>
<CommandEmpty>No providers found.</CommandEmpty>
<CommandEmpty>{t('settings.server.harnesses.none')}</CommandEmpty>
<CommandGroup heading="Available Providers">
{unconnectedProviders.map((provider) => (
<CommandItem
@@ -3,6 +3,7 @@ import { Download, Hammer, Loader2, RotateCw } from 'lucide-react';
import { toast } from 'sonner';
import { Button } from '@/components/ui/button';
import { useClient } from 'hooks/useClient';
import { useTranslation } from '@/lib/i18n';
/**
* The two ways to load a change without leaving the browser.
@@ -30,6 +31,7 @@ export function errorMessage(err: unknown, fallback: string): string {
}
export const MaintenanceSection = () => {
const { t } = useTranslation();
const client = useClient();
const [pulling, setPulling] = useState(false);
const [pulled, setPulled] = useState<{ from: string; to: string; commits: string[]; needs: string[] } | null>(null);
@@ -58,11 +60,11 @@ export const MaintenanceSection = () => {
}>('/server-settings/pull', {});
if (!res.updated) {
setPulled(null);
toast.success('Already up to date');
toast.success(t('settings.server.maintenance.upToDate'));
return;
}
setPulled({ from: res.from ?? '', to: res.to ?? '', commits: res.commits, needs: res.needs });
toast.success(`Pulled ${res.commits.length} commit${res.commits.length === 1 ? '' : 's'}`);
toast.success(t('settings.server.maintenance.pulled', { count: res.commits.length }));
} catch (err) {
toast.error(errorMessage(err, 'Pull failed'));
} finally {
@@ -81,7 +83,7 @@ export const MaintenanceSection = () => {
setLastBuild(`${(res.ms / 1000).toFixed(1)}s · ${res.outputs} files`);
// Nothing reloads itself: the bundle on disk changed, this page is still the old one. Saying so is
// the difference between "it worked" and "why does my change not show".
toast.success('Frontend rebuilt — refresh this page to see it');
toast.success(t('settings.server.maintenance.rebuilt'));
} catch (err) {
// The client throws on any status >= 400 with the raw response body as its message, so a build
// failure arrives here as the JSON the route sent. Unwrapped, or the toast shows a reader
@@ -96,7 +98,7 @@ export const MaintenanceSection = () => {
setRestarting(true);
try {
await client.post('/server-settings/restart', {});
toast.success('Restarting — the page will reconnect on its own');
toast.success(t('settings.server.maintenance.restarting'));
} catch (err) {
/**
* Two failures arrive here and they are opposites.
@@ -116,7 +118,7 @@ export const MaintenanceSection = () => {
setRestarting(false);
return;
}
toast.success('Restarting — the page will reconnect on its own');
toast.success(t('settings.server.maintenance.restarting'));
}
// Left disabled on the success path, deliberately: the button must not become pressable again while
// the server is coming back.
@@ -126,14 +128,12 @@ export const MaintenanceSection = () => {
<div className="flex flex-col gap-6">
<div className="flex items-start justify-between gap-6">
<div className="min-w-0">
<div className="text-sm font-medium text-foreground">Update the platform</div>
<div className="text-sm font-medium text-foreground">{t('settings.server.maintenance.updateTitle')}</div>
<p className="mt-1 text-xs text-muted-foreground">
Pulls this server&rsquo;s repository. Refuses if anything is uncommitted or the checkout has diverged — it
will never discard local work.
</p>
<p className="mt-1 text-xs text-muted-foreground">
Changes nothing that is running. Whatever the update needs is listed here, and stays your call.
</p>
<p className="mt-1 text-xs text-muted-foreground">{t('settings.server.maintenance.updateHint')}</p>
{pulled && (
<div className="mt-2 rounded-md border border-border bg-muted/40 p-2">
<p className="font-mono text-[11px] text-muted-foreground">
@@ -163,7 +163,7 @@ export const MaintenanceSection = () => {
<div className="flex items-start justify-between gap-6 border-t border-border pt-6">
<div className="min-w-0">
<div className="text-sm font-medium text-foreground">Rebuild the frontend</div>
<div className="text-sm font-medium text-foreground">{t('settings.server.maintenance.rebuild')}</div>
<p className="mt-1 text-xs text-muted-foreground">
Picks up changes to the interface. Nothing restarts, no connection drops, and this chat keeps its session —
refresh the page when it finishes.
@@ -178,7 +178,7 @@ export const MaintenanceSection = () => {
<div className="flex items-start justify-between gap-6 border-t border-border pt-6">
<div className="min-w-0">
<div className="text-sm font-medium text-foreground">Restart the server</div>
<div className="text-sm font-medium text-foreground">{t('settings.server.maintenance.restart')}</div>
<p className="mt-1 text-xs text-muted-foreground">
The only way to load changed server code — Bun caches modules for the life of the process, so rebuilding
cannot see an edit to the backend.
@@ -8,6 +8,7 @@ import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
import { useClient } from 'hooks/useClient';
import { useTranslation } from '@/lib/i18n';
type OcrConfig = {
url: string;
@@ -15,6 +16,7 @@ type OcrConfig = {
};
export const OCRSection = () => {
const { t } = useTranslation();
const client = useClient();
const queryClient = useQueryClient();
@@ -59,9 +61,9 @@ export const OCRSection = () => {
try {
await client.put('/server-settings/ocr', { url, model });
queryClient.invalidateQueries({ queryKey: ['OCR_CONFIG'] });
toast.success('OCR settings saved');
toast.success(t('settings.server.ocr.saved'));
} catch {
toast.error('Failed to save OCR settings');
toast.error(t('settings.server.ocr.saveFailed'));
} finally {
setIsSaving(false);
}
@@ -75,7 +77,7 @@ export const OCRSection = () => {
if (res.error) {
toast.error(res.error);
} else {
toast.success('Vision model server is reachable');
toast.success(t('settings.server.ocr.reachable'));
}
} catch (err: unknown) {
const raw = (err as { message?: string })?.message;
@@ -91,12 +93,12 @@ export const OCRSection = () => {
}
};
if (isLoading) return <p className="text-sm text-duck-dark/40">Loading...</p>;
if (isLoading) return <p className="text-sm text-duck-dark/40">{t('settings.server.loading')}</p>;
return (
<form onSubmit={handleSave} className="grid gap-4">
<Label className="grid gap-2">
<span className="text-duck-dark/70 dark:text-foreground/70">Vision Model Server URL</span>
<span className="text-duck-dark/70 dark:text-foreground/70">{t('settings.server.ocr.serverUrl')}</span>
<Input
className="h-11 bg-background/60 border-duck-dark/20 text-duck-dark dark:text-foreground placeholder:text-duck-dark/40"
placeholder="http://localhost:64203"
@@ -107,13 +109,13 @@ export const OCRSection = () => {
<Label className="grid gap-2">
<div className="flex items-center gap-1.5">
<span className="text-duck-dark/70 dark:text-foreground/70">Model</span>
<span className="text-duck-dark/70 dark:text-foreground/70">{t('settings.server.model')}</span>
<button
type="button"
onClick={() => fetchModels(url)}
disabled={modelsLoading}
className="p-0.5 rounded hover:bg-duck-dark/10 dark:hover:bg-foreground/10 cursor-pointer transition-colors disabled:opacity-40"
title="Refresh models"
title={t('settings.server.ocr.refreshModels')}
>
<RefreshCw
className={`h-3 w-3 text-duck-dark/50 dark:text-foreground/50 ${modelsLoading ? 'animate-spin' : ''}`}
@@ -123,7 +125,7 @@ export const OCRSection = () => {
{models.length > 0 ? (
<Select value={model} onValueChange={setModel}>
<SelectTrigger className="h-11 bg-background/60 border-duck-dark/20 text-duck-dark dark:text-foreground">
<SelectValue placeholder="Select a model" />
<SelectValue placeholder={t('settings.server.ocr.selectModel')} />
</SelectTrigger>
<SelectContent className="z-[600] max-h-[300px]">
{models.map((m) => (
@@ -9,6 +9,7 @@ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@
import { Switch } from '@/components/ui/switch';
import { useClient } from 'hooks/useClient';
import { useAuth } from 'hooks/useAuth';
import { useTranslation } from '@/lib/i18n';
type Provider = 'resend' | 'smtp' | 'mailhog';
@@ -31,6 +32,7 @@ const PROVIDER_DEFAULTS: Record<Provider, Partial<SmtpConfig>> = {
};
export const SMTPSection = () => {
const { t } = useTranslation();
const client = useClient();
const queryClient = useQueryClient();
const { user } = useAuth();
@@ -92,9 +94,9 @@ export const SMTPSection = () => {
try {
await client.put('/server-settings/smtp', buildConfig());
queryClient.invalidateQueries({ queryKey: ['SMTP_CONFIG'] });
toast.success('SMTP settings saved');
toast.success(t('settings.server.smtp.saved'));
} catch {
toast.error('Failed to save SMTP settings');
toast.error(t('settings.server.smtp.saveFailed'));
} finally {
setIsSaving(false);
}
@@ -105,7 +107,7 @@ export const SMTPSection = () => {
setIsTestingConnection(true);
try {
await client.post('/server-settings/smtp/test-connection');
toast.success('Connection successful');
toast.success(t('settings.server.smtp.connected'));
} catch (err: unknown) {
const raw = (err as { message?: string })?.message;
let msg = 'Connection failed';
@@ -132,7 +134,7 @@ export const SMTPSection = () => {
if (result.error) {
toast.error(result.error);
} else {
toast.success(`Test email sent to ${testEmail}`);
toast.success(t('settings.server.smtp.testSent', { email: testEmail }));
}
} catch (err: unknown) {
const raw = (err as { message?: string })?.message;
@@ -148,7 +150,7 @@ export const SMTPSection = () => {
}
};
if (isLoading) return <p className="text-sm text-duck-dark/40">Loading...</p>;
if (isLoading) return <p className="text-sm text-duck-dark/40">{t('settings.server.loading')}</p>;
const showSmtpFields = provider === 'smtp' || provider === 'mailhog';
@@ -156,22 +158,22 @@ export const SMTPSection = () => {
<div className="grid gap-4">
<form onSubmit={handleSave} className="grid gap-4">
<Label className="grid gap-2">
<span className="text-duck-dark/70 dark:text-foreground/70">Provider</span>
<span className="text-duck-dark/70 dark:text-foreground/70">{t('settings.server.provider')}</span>
<Select value={provider} onValueChange={(v) => handleProviderChange(v as Provider)}>
<SelectTrigger className="h-11 bg-background/60 border-duck-dark/20 text-duck-dark dark:text-foreground">
<SelectValue />
</SelectTrigger>
<SelectContent className="z-[600]">
<SelectItem value="mailhog">MailHog (local testing)</SelectItem>
<SelectItem value="resend">Resend</SelectItem>
<SelectItem value="smtp">Custom SMTP</SelectItem>
<SelectItem value="mailhog">{t('settings.server.smtp.mailhog')}</SelectItem>
<SelectItem value="resend">{t('settings.server.smtp.resend')}</SelectItem>
<SelectItem value="smtp">{t('settings.server.smtp.custom')}</SelectItem>
</SelectContent>
</Select>
</Label>
{provider === 'resend' && (
<Label className="grid gap-2">
<span className="text-duck-dark/70 dark:text-foreground/70">API Key</span>
<span className="text-duck-dark/70 dark:text-foreground/70">{t('settings.server.smtp.apiKey')}</span>
<Input
type="password"
className="h-11 bg-background/60 border-duck-dark/20 text-duck-dark dark:text-foreground placeholder:text-duck-dark/40"
@@ -186,7 +188,7 @@ export const SMTPSection = () => {
<>
<div className="grid grid-cols-[1fr_auto] gap-2">
<Label className="grid gap-2">
<span className="text-duck-dark/70 dark:text-foreground/70">Host</span>
<span className="text-duck-dark/70 dark:text-foreground/70">{t('settings.server.smtp.host')}</span>
<Input
className="h-11 bg-background/60 border-duck-dark/20 text-duck-dark dark:text-foreground placeholder:text-duck-dark/40"
placeholder="smtp.example.com"
@@ -195,7 +197,7 @@ export const SMTPSection = () => {
/>
</Label>
<Label className="grid gap-2">
<span className="text-duck-dark/70 dark:text-foreground/70">Port</span>
<span className="text-duck-dark/70 dark:text-foreground/70">{t('settings.server.smtp.port')}</span>
<Input
type="number"
className="h-11 w-24 bg-background/60 border-duck-dark/20 text-duck-dark dark:text-foreground"
@@ -208,16 +210,20 @@ export const SMTPSection = () => {
<>
<div className="grid grid-cols-2 gap-2">
<Label className="grid gap-2">
<span className="text-duck-dark/70 dark:text-foreground/70">Username</span>
<span className="text-duck-dark/70 dark:text-foreground/70">
{t('settings.server.smtp.username')}
</span>
<Input
className="h-11 bg-background/60 border-duck-dark/20 text-duck-dark dark:text-foreground placeholder:text-duck-dark/40"
placeholder="user@example.com"
placeholder={t('settings.server.smtp.userExample')}
value={username}
onChange={(ev) => setUsername(ev.target.value)}
/>
</Label>
<Label className="grid gap-2">
<span className="text-duck-dark/70 dark:text-foreground/70">Password</span>
<span className="text-duck-dark/70 dark:text-foreground/70">
{t('settings.server.smtp.password')}
</span>
<Input
type="password"
className="h-11 bg-background/60 border-duck-dark/20 text-duck-dark dark:text-foreground"
@@ -228,7 +234,7 @@ export const SMTPSection = () => {
</div>
<Label className="flex items-center gap-3">
<Switch checked={secure} onCheckedChange={setSecure} />
<span className="text-duck-dark/70 dark:text-foreground/70">TLS / SSL</span>
<span className="text-duck-dark/70 dark:text-foreground/70">{t('settings.server.smtp.tls')}</span>
</Label>
</>
)}
@@ -237,7 +243,7 @@ export const SMTPSection = () => {
<div className="grid grid-cols-2 gap-2">
<Label className="grid gap-2">
<span className="text-duck-dark/70 dark:text-foreground/70">From Name</span>
<span className="text-duck-dark/70 dark:text-foreground/70">{t('settings.server.smtp.fromName')}</span>
<Input
className="h-11 bg-background/60 border-duck-dark/20 text-duck-dark dark:text-foreground placeholder:text-duck-dark/40"
value={fromName}
@@ -245,7 +251,7 @@ export const SMTPSection = () => {
/>
</Label>
<Label className="grid gap-2">
<span className="text-duck-dark/70 dark:text-foreground/70">From Email</span>
<span className="text-duck-dark/70 dark:text-foreground/70">{t('settings.server.smtp.fromEmail')}</span>
<Input
type="email"
className="h-11 bg-background/60 border-duck-dark/20 text-duck-dark dark:text-foreground placeholder:text-duck-dark/40"
@@ -276,12 +282,14 @@ export const SMTPSection = () => {
</form>
<div className="border-t border-duck-dark/10 dark:border-foreground/10 pt-4 mt-1">
<span className="text-sm font-medium text-duck-dark dark:text-foreground">Send Test Email</span>
<span className="text-sm font-medium text-duck-dark dark:text-foreground">
{t('settings.server.smtp.sendTest')}
</span>
<form onSubmit={handleTest} className="flex items-center gap-2 mt-2">
<Input
type="email"
className="h-9 bg-background/60 border-duck-dark/20 text-duck-dark dark:text-foreground placeholder:text-duck-dark/40 flex-1"
placeholder="recipient@example.com"
placeholder={t('settings.server.smtp.recipientExample')}
value={testEmail}
onChange={(ev) => setTestEmail(ev.target.value)}
/>
@@ -6,12 +6,14 @@ import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import { useClient } from 'hooks/useClient';
import { useTranslation } from '@/lib/i18n';
type SttConfig = {
url: string;
};
export const STTSection = () => {
const { t } = useTranslation();
const client = useClient();
const queryClient = useQueryClient();
@@ -36,9 +38,9 @@ export const STTSection = () => {
try {
await client.put('/server-settings/stt', { url });
queryClient.invalidateQueries({ queryKey: ['STT_CONFIG'] });
toast.success('STT settings saved');
toast.success(t('settings.server.stt.saved'));
} catch {
toast.error('Failed to save STT settings');
toast.error(t('settings.server.stt.saveFailed'));
} finally {
setIsSaving(false);
}
@@ -52,7 +54,7 @@ export const STTSection = () => {
if (res.error) {
toast.error(res.error);
} else {
toast.success('Whisper server is reachable');
toast.success(t('settings.server.stt.reachable'));
}
} catch (err: unknown) {
const raw = (err as { message?: string })?.message;
@@ -68,12 +70,12 @@ export const STTSection = () => {
}
};
if (isLoading) return <p className="text-sm text-duck-dark/40">Loading...</p>;
if (isLoading) return <p className="text-sm text-duck-dark/40">{t('settings.server.loading')}</p>;
return (
<form onSubmit={handleSave} className="grid gap-4">
<Label className="grid gap-2">
<span className="text-duck-dark/70 dark:text-foreground/70">Whisper Server URL</span>
<span className="text-duck-dark/70 dark:text-foreground/70">{t('settings.server.stt.serverUrl')}</span>
<Input
className="h-11 bg-background/60 border-duck-dark/20 text-duck-dark dark:text-foreground placeholder:text-duck-dark/40"
placeholder="http://localhost:64201"
@@ -16,6 +16,7 @@ import {
SelectValue,
} from '@/components/ui/select';
import { useClient } from 'hooks/useClient';
import { useTranslation } from '@/lib/i18n';
type Provider = 'openai' | 'elevenlabs';
@@ -33,6 +34,7 @@ const PROVIDER_DEFAULTS: Record<Provider, Partial<TtsConfig>> = {
};
export const TTSSection = () => {
const { t } = useTranslation();
const client = useClient();
const queryClient = useQueryClient();
const audioRef = useRef<HTMLAudioElement | null>(null);
@@ -110,9 +112,9 @@ export const TTSSection = () => {
try {
await client.put('/server-settings/tts', buildConfig());
queryClient.invalidateQueries({ queryKey: ['TTS_CONFIG'] });
toast.success('TTS settings saved');
toast.success(t('settings.server.tts.saved'));
} catch {
toast.error('Failed to save TTS settings');
toast.error(t('settings.server.tts.saveFailed'));
} finally {
setIsSaving(false);
}
@@ -143,27 +145,27 @@ export const TTSSection = () => {
const audio = new Audio(audioUrl);
audioRef.current = audio;
audio.play();
toast.success('Playing test audio');
toast.success(t('settings.server.tts.playing'));
} catch {
toast.error('Test failed — could not reach TTS server');
toast.error(t('settings.server.tts.testFailed'));
} finally {
setIsTesting(false);
}
};
if (isLoading) return <p className="text-sm text-duck-dark/40">Loading...</p>;
if (isLoading) return <p className="text-sm text-duck-dark/40">{t('settings.server.loading')}</p>;
return (
<form onSubmit={handleSave} className="grid gap-4">
<Label className="grid gap-2">
<span className="text-duck-dark/70 dark:text-foreground/70">Provider</span>
<span className="text-duck-dark/70 dark:text-foreground/70">{t('settings.server.provider')}</span>
<Select value={provider} onValueChange={(v) => handleProviderChange(v as Provider)}>
<SelectTrigger className="h-11 bg-background/60 border-duck-dark/20 text-duck-dark dark:text-foreground">
<SelectValue />
</SelectTrigger>
<SelectContent className="z-[600]">
<SelectItem value="openai">OpenAI-compatible (Kokoro, OpenAI, etc.)</SelectItem>
<SelectItem value="elevenlabs">ElevenLabs</SelectItem>
<SelectItem value="openai">{t('settings.server.tts.openaiCompatible')}</SelectItem>
<SelectItem value="elevenlabs">{t('settings.server.tts.elevenLabs')}</SelectItem>
</SelectContent>
</Select>
</Label>
@@ -195,7 +197,7 @@ export const TTSSection = () => {
<div className="grid grid-cols-2 gap-2">
<Label className="grid gap-2">
<span className="text-duck-dark/70 dark:text-foreground/70">Model</span>
<span className="text-duck-dark/70 dark:text-foreground/70">{t('settings.server.model')}</span>
<Input
className="h-11 bg-background/60 border-duck-dark/20 text-duck-dark dark:text-foreground placeholder:text-duck-dark/40"
placeholder={provider === 'openai' ? 'kokoro' : 'eleven_multilingual_v2'}
@@ -205,13 +207,13 @@ export const TTSSection = () => {
</Label>
<Label className="grid gap-2">
<div className="flex items-center gap-1.5">
<span className="text-duck-dark/70 dark:text-foreground/70">Voice</span>
<span className="text-duck-dark/70 dark:text-foreground/70">{t('settings.server.voice')}</span>
<button
type="button"
onClick={() => fetchVoices(provider, url, apiKey, model)}
disabled={voicesLoading}
className="p-0.5 rounded hover:bg-duck-dark/10 dark:hover:bg-foreground/10 cursor-pointer transition-colors disabled:opacity-40"
title="Refresh voices"
title={t('settings.server.tts.refreshVoices')}
>
<RefreshCw
className={`h-3 w-3 text-duck-dark/50 dark:text-foreground/50 ${voicesLoading ? 'animate-spin' : ''}`}
@@ -221,7 +223,7 @@ export const TTSSection = () => {
{voices.length > 0 ? (
<Select value={voice} onValueChange={setVoice}>
<SelectTrigger className="h-11 bg-background/60 border-duck-dark/20 text-duck-dark dark:text-foreground">
<SelectValue placeholder="Select a voice" />
<SelectValue placeholder={t('settings.server.tts.selectVoice')} />
</SelectTrigger>
<SelectContent className="z-[600] max-h-[300px]">
{voiceGroups.length > 0
@@ -9,6 +9,7 @@ import { Label } from '@/components/ui/label';
import { Textarea } from '@/components/ui/textarea';
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
import { copyToClipboard } from 'helpers/clipboard';
import { useTranslation } from '@/lib/i18n';
// The owner creating an account. Until this existed the only way to add one was an INSERT in Postgres.
//
@@ -65,6 +66,7 @@ type CreatedAccount = {
};
export const CreateUserForm = ({ roles, usersKey }: CreateUserFormProps) => {
const { t, tUi } = useTranslation();
const client = useClient();
const queryClient = useQueryClient();
const [open, setOpen] = useState(false);
@@ -118,16 +120,19 @@ export const CreateUserForm = ({ roles, usersKey }: CreateUserFormProps) => {
<div className="space-y-4 rounded-lg border border-duck-teal/40 bg-duck-teal/5 p-4">
<div>
<h3 className="text-sm font-medium">{created.email} created</h3>
<p className="text-xs text-muted-foreground">
Copy what you need before closing — none of it can be shown again.
</p>
<p className="text-xs text-muted-foreground">{t('settings.users.copyBeforeClosing')}</p>
</div>
<div className="space-y-1.5">
<Label>Password</Label>
<Label>{t('settings.users.password')}</Label>
<div className="flex gap-2">
<Input readOnly value={created.password} className="font-mono" />
<Button type="button" variant="outline" size="icon" onClick={() => copy(created.password, 'Password')}>
<Button
type="button"
variant="outline"
size="icon"
onClick={() => copy(created.password, t('settings.users.password'))}
>
<Copy className="h-4 w-4" />
</Button>
</div>
@@ -139,14 +144,14 @@ export const CreateUserForm = ({ roles, usersKey }: CreateUserFormProps) => {
{created.osUser && (
<div className="space-y-1.5">
<Label>Linux account</Label>
<Label>{t('settings.users.linuxAccount')}</Label>
<Input readOnly value={created.osUser} className="font-mono" />
</div>
)}
{created.osSshPublicKey && (
<div className="space-y-1.5">
<Label>Their SSH public key</Label>
<Label>{t('settings.users.sshKey')}</Label>
<div className="flex gap-2">
<Textarea readOnly value={created.osSshPublicKey} rows={3} className="font-mono text-xs" />
<Button
@@ -162,20 +167,20 @@ export const CreateUserForm = ({ roles, usersKey }: CreateUserFormProps) => {
permission error that says nothing about a missing key. */}
<p className="text-xs text-muted-foreground">
Generated on the machine; the private half never leaves it.{' '}
<strong>Add this to their Gitea account</strong> so they can push. Retrievable later from their row.
<strong>{t('settings.users.addToGitea')}</strong> so they can push. Retrievable later from their row.
</p>
</div>
)}
{created.osUserError && (
<div className="rounded-md border border-amber-500/40 bg-amber-500/10 p-3 text-xs">
<div className="font-medium">The account works, but its Linux side did not finish</div>
<div className="font-medium">{t('settings.users.linuxIncomplete')}</div>
<p className="mt-1 whitespace-pre-wrap text-muted-foreground">{created.osUserError}</p>
</div>
)}
<Button type="button" onClick={close}>
Done
{t('settings.users.done')}
</Button>
</div>
);
@@ -185,7 +190,7 @@ export const CreateUserForm = ({ roles, usersKey }: CreateUserFormProps) => {
return (
<Button variant="outline" size="sm" onClick={() => setOpen(true)}>
<UserPlus className="mr-2 h-4 w-4" />
Add account
{t('settings.users.addAccount')}
</Button>
);
}
@@ -194,19 +199,19 @@ export const CreateUserForm = ({ roles, usersKey }: CreateUserFormProps) => {
<form onSubmit={submit} className="space-y-4 rounded-lg border p-4">
<div className="flex items-start justify-between gap-2">
<div>
<h3 className="text-sm font-medium">New account</h3>
<h3 className="text-sm font-medium">{t('settings.users.newAccount')}</h3>
<p className="text-xs text-muted-foreground">
Created active — they can sign in straight away. Tell them the password; it is not recoverable afterwards.
</p>
</div>
<Button type="button" variant="ghost" size="icon" onClick={close} aria-label="Cancel">
<Button type="button" variant="ghost" size="icon" onClick={close} aria-label={tUi('button.cancel')}>
<X className="h-4 w-4" />
</Button>
</div>
<div className="grid gap-4 sm:grid-cols-2">
<div className="space-y-1.5">
<Label htmlFor="new-user-email">Email</Label>
<Label htmlFor="new-user-email">{t('settings.users.email')}</Label>
<Input
id="new-user-email"
type="email"
@@ -218,7 +223,7 @@ export const CreateUserForm = ({ roles, usersKey }: CreateUserFormProps) => {
</div>
<div className="space-y-1.5">
<Label htmlFor="new-user-name">Name</Label>
<Label htmlFor="new-user-name">{t('settings.users.name')}</Label>
<Input
id="new-user-name"
autoComplete="off"
@@ -229,7 +234,7 @@ export const CreateUserForm = ({ roles, usersKey }: CreateUserFormProps) => {
</div>
<div className="space-y-1.5">
<Label htmlFor="new-user-username">Username</Label>
<Label htmlFor="new-user-username">{t('settings.users.username')}</Label>
<Input
id="new-user-username"
autoComplete="off"
@@ -237,11 +242,11 @@ export const CreateUserForm = ({ roles, usersKey }: CreateUserFormProps) => {
onChange={(ev) => set('username')(ev.target.value)}
required
/>
<p className="text-xs text-muted-foreground">Letters, numbers, dots, hyphens and underscores.</p>
<p className="text-xs text-muted-foreground">{t('settings.users.usernameHint')}</p>
</div>
<div className="space-y-1.5">
<Label htmlFor="new-user-role">Role</Label>
<Label htmlFor="new-user-role">{t('settings.users.role')}</Label>
<Select value={form.role} onValueChange={set('role')}>
<SelectTrigger id="new-user-role">
<SelectValue />
@@ -261,7 +266,7 @@ export const CreateUserForm = ({ roles, usersKey }: CreateUserFormProps) => {
</div>
<div className="space-y-1.5 sm:col-span-2">
<Label htmlFor="new-user-password">Password</Label>
<Label htmlFor="new-user-password">{t('settings.users.password')}</Label>
<div className="flex gap-2">
<Input
id="new-user-password"
@@ -276,7 +281,7 @@ export const CreateUserForm = ({ roles, usersKey }: CreateUserFormProps) => {
/>
<Button type="button" variant="outline" size="icon" onClick={() => set('password')(generatePassword())}>
<Dices className="h-4 w-4" />
<span className="sr-only">Generate a password</span>
<span className="sr-only">{t('settings.users.generatePassword')}</span>
</Button>
<Button
type="button"
@@ -285,29 +290,27 @@ export const CreateUserForm = ({ roles, usersKey }: CreateUserFormProps) => {
disabled={!form.password}
onClick={() => {
void copyToClipboard(form.password);
toast.success('Password copied');
toast.success(t('settings.users.passwordCopied'));
}}
>
<Copy className="h-4 w-4" />
<span className="sr-only">Copy the password</span>
<span className="sr-only">{t('settings.users.copyPassword')}</span>
</Button>
</div>
<p className="text-xs text-muted-foreground">
At least 12 characters, with upper and lower case, a number and a symbol.
</p>
<p className="text-xs text-muted-foreground">{t('settings.users.passwordHint')}</p>
</div>
{/* Inbound only, and optional. The OUTBOUND key is generated either way — pasting one here does
not replace it, because a key on a laptop is no use to an agent running on the server. */}
<div className="space-y-1.5 sm:col-span-2">
<Label htmlFor="new-user-ssh">
Their SSH public key <span className="ml-1 text-xs opacity-60">(optional)</span>
{t('settings.users.sshKey')} <span className="ml-1 text-xs opacity-60">(optional)</span>
</Label>
<Textarea
id="new-user-ssh"
rows={3}
spellCheck={false}
placeholder="ssh-ed25519 AAAAC3Nza… ana@laptop"
placeholder={t('settings.users.sshPlaceholder')}
className="font-mono text-xs"
value={form.sshPublicKey}
onChange={(ev) => set('sshPublicKey')(ev.target.value)}
@@ -325,7 +328,7 @@ export const CreateUserForm = ({ roles, usersKey }: CreateUserFormProps) => {
Create account
</Button>
<Button type="button" variant="ghost" onClick={close} disabled={saving}>
Cancel
{tUi('button.cancel')}
</Button>
</div>
</form>
@@ -6,6 +6,7 @@ import { useClient } from 'hooks/useClient';
import { PERMISSIONS_QUERY_KEY } from 'hooks/usePermissions';
import { Button } from '@/components/ui/button';
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
import { useTranslation } from '@/lib/i18n';
// What each ROLE may reach. Not each user — see the table comment in schema/permissions.ts for why.
//
@@ -37,6 +38,7 @@ type Level = 'none' | 'read' | 'write';
const PERMISSIONS_KEY = ['ROLE_PERMISSIONS'];
export const PermissionsSection = () => {
const { t, tUi } = useTranslation();
const client = useClient();
const queryClient = useQueryClient();
const [role, setRole] = useState<string | null>(null);
@@ -78,7 +80,7 @@ export const PermissionsSection = () => {
// The owner may be editing their own view's inputs — and anyone already signed in needs the dock to
// catch up without a reload.
await queryClient.invalidateQueries({ queryKey: PERMISSIONS_QUERY_KEY });
toast.success(`Saved what ${activeRole}s can reach`);
toast.success(t('settings.users.permissionsSaved', { role: activeRole }));
} catch (ex) {
toast.error(ex instanceof Error ? ex.message : 'Could not save');
} finally {
@@ -89,12 +91,12 @@ export const PermissionsSection = () => {
if (isLoading) {
return (
<div className="flex items-center gap-2 p-6 text-sm text-muted-foreground">
<Loader2 className="h-4 w-4 animate-spin" /> Loading permissions…
<Loader2 className="h-4 w-4 animate-spin" /> {t('settings.users.loadingPermissions')}
</div>
);
}
if (isError || !data) {
return <div className="p-6 text-sm text-destructive">Could not load permissions.</div>;
return <div className="p-6 text-sm text-destructive">{t('settings.users.permissionsFailed')}</div>;
}
return (
@@ -103,7 +105,11 @@ export const PermissionsSection = () => {
hides two of them behind a click and gives no sense of "which one am I editing" at a glance. Real
buttons, because switching role mutates a draft rather than navigating. */}
<div className="flex flex-wrap items-center justify-between gap-3">
<div className="flex items-center gap-1 rounded-lg border p-1" role="tablist" aria-label="Role">
<div
className="flex items-center gap-1 rounded-lg border p-1"
role="tablist"
aria-label={t('settings.users.role')}
>
{data.roles.map((r) => (
<button
key={r}
@@ -128,9 +134,9 @@ export const PermissionsSection = () => {
</div>
<p className="text-xs text-muted-foreground">
Everything is denied unless granted here. <strong>Read</strong> allows viewing, plus changes to things that are
only ever the person&rsquo;s own — their favourites, their playlists, their devices.
<strong> Full</strong> allows everything within the app.
{t('settings.users.deniedUnlessGranted')} <strong>{t('settings.users.read')}</strong> allows viewing, plus
changes to things that are only ever the person&rsquo;s own — their favourites, their playlists, their devices.
<strong> {t('settings.users.full')}</strong> allows everything within the app.
</p>
<div className="divide-y rounded-lg border">
@@ -151,9 +157,9 @@ export const PermissionsSection = () => {
<SelectValue />
</SelectTrigger>
<SelectContent>
<SelectItem value="none">No access</SelectItem>
<SelectItem value="read">Read</SelectItem>
<SelectItem value="write">Full</SelectItem>
<SelectItem value="none">{t('settings.users.noAccess')}</SelectItem>
<SelectItem value="read">{t('settings.users.read')}</SelectItem>
<SelectItem value="write">{t('settings.users.full')}</SelectItem>
</SelectContent>
</Select>
</div>
@@ -17,6 +17,7 @@ import {
} from '@/components/ui/alert-dialog';
import { CreateUserForm } from './CreateUserForm';
import { copyToClipboard } from 'helpers/clipboard';
import { useTranslation } from '@/lib/i18n';
type ManagedUser = {
id: number;
@@ -43,6 +44,7 @@ type UsersResponse = {
const USERS_KEY = ['MANAGED_USERS'];
export const UsersSection = () => {
const { t, tUi } = useTranslation();
const client = useClient();
const queryClient = useQueryClient();
const [pendingId, setPendingId] = useState<number | null>(null);
@@ -77,11 +79,7 @@ export const UsersSection = () => {
* reasons to press this, and an empty answer means "leave authorized_keys alone" rather than "remove it".
*/
const provisionLinux = async (user: ManagedUser) => {
const key = window.prompt(
`Linux account for ${user.email}.\n\n` +
`Paste an SSH public key to allow them to SSH in, or leave empty to keep the current one.`,
'',
);
const key = window.prompt(t('settings.users.provisionPrompt', { email: user.email }), '');
// Cancel is null; empty string is a deliberate "no change".
if (key === null) return;
@@ -147,13 +145,13 @@ export const UsersSection = () => {
if (isLoading) {
return (
<div className="flex items-center gap-2 text-sm text-muted-foreground">
<Loader2 className="h-4 w-4 animate-spin" /> Loading accounts…
<Loader2 className="h-4 w-4 animate-spin" /> {t('settings.users.loadingAccounts')}
</div>
);
}
if (isError || !data) {
return <div className="text-sm text-destructive">Could not load the accounts.</div>;
return <div className="text-sm text-destructive">{t('settings.users.accountsFailed')}</div>;
}
return (
@@ -173,7 +171,12 @@ export const UsersSection = () => {
<div className="min-w-0 flex-1">
<div className="flex items-center gap-1.5">
<span className="truncate text-sm font-medium">{user.name || user.username || user.email}</span>
{user.isOwner && <Crown className="h-3.5 w-3.5 shrink-0 text-duck-teal" aria-label="Server owner" />}
{user.isOwner && (
<Crown
className="h-3.5 w-3.5 shrink-0 text-duck-teal"
aria-label={t('settings.users.serverOwner')}
/>
)}
</div>
<div className="truncate text-xs text-muted-foreground">
{user.email}
@@ -212,11 +215,13 @@ export const UsersSection = () => {
size="icon"
className={`shrink-0 ${user.osUser ? 'text-muted-foreground' : 'text-amber-500'}`}
disabled={busy}
aria-label={user.osUser ? `Repair ${user.email}'s Linux account` : `Create a Linux account`}
aria-label={
user.osUser ? t('settings.users.repairFor', { email: user.email }) : t('settings.users.createLinux')
}
title={
user.osUser
? `Linux account: ${user.osUser} — click to repair or replace their SSH key`
: 'No Linux account — click to create one'
? t('settings.users.linuxAccountFor', { osUser: user.osUser })
: t('settings.users.noLinux')
}
onClick={() => void provisionLinux(user)}
>
@@ -231,11 +236,11 @@ export const UsersSection = () => {
variant="ghost"
size="icon"
className="shrink-0 text-muted-foreground"
aria-label={`Copy ${user.email}'s SSH public key`}
title="Copy their SSH public key (add it to their Gitea account)"
aria-label={t('settings.users.copySshFor', { email: user.email })}
title={t('settings.users.copySshTitle')}
onClick={() => {
void copyToClipboard(user.osSshPublicKey!);
toast.success('Public key copied');
toast.success(t('settings.users.publicKeyCopied'));
}}
>
<KeyRound className="h-4 w-4" />
@@ -250,8 +255,8 @@ export const UsersSection = () => {
size="icon"
className="shrink-0 text-muted-foreground"
disabled={busy}
aria-label={`Reset ${user.email}'s password`}
title="Generate a new password — shown once, and signs them out everywhere"
aria-label={t('settings.users.resetPasswordFor', { email: user.email })}
title={t('settings.users.resetPasswordTitle')}
onClick={() => setConfirmReset(user)}
>
{busy ? <Loader2 className="h-4 w-4 animate-spin" /> : <RotateCcw className="h-4 w-4" />}
@@ -264,7 +269,7 @@ export const UsersSection = () => {
className="shrink-0 text-muted-foreground hover:text-destructive"
disabled={user.isOwner || busy}
onClick={() => setConfirmDelete(user)}
aria-label={`Remove ${user.email}`}
aria-label={t('settings.users.removeFor', { email: user.email })}
>
{busy ? <Loader2 className="h-4 w-4 animate-spin" /> : <Trash2 className="h-4 w-4" />}
</Button>
@@ -282,19 +287,18 @@ export const UsersSection = () => {
<AlertDialog open={!!confirmDelete} onOpenChange={(open) => !open && setConfirmDelete(null)}>
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>Remove {confirmDelete?.email}?</AlertDialogTitle>
<AlertDialogDescription>
This deletes the account and everything belonging to it — passkeys, dashboards, saved layouts, and
anything an installed plugin keeps for them. It cannot be undone.
</AlertDialogDescription>
<AlertDialogTitle>
{t('settings.users.removeTitle', { email: confirmDelete?.email ?? '' })}
</AlertDialogTitle>
<AlertDialogDescription>{t('settings.users.removeBody')}</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel>Cancel</AlertDialogCancel>
<AlertDialogCancel>{tUi('button.cancel')}</AlertDialogCancel>
<AlertDialogAction
className="bg-destructive text-destructive-foreground hover:bg-destructive/90"
onClick={() => confirmDelete && void remove(confirmDelete)}
>
Remove account
{t('settings.users.removeAccount')}
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
@@ -305,23 +309,16 @@ export const UsersSection = () => {
<AlertDialog open={!!confirmReset} onOpenChange={(open) => !open && setConfirmReset(null)}>
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>Reset the password for {confirmReset?.email}?</AlertDialogTitle>
<AlertDialogTitle>{t('settings.users.resetTitle', { email: confirmReset?.email ?? '' })}</AlertDialogTitle>
<AlertDialogDescription>
A new password is generated and shown to you once — it is not stored anywhere and cannot be looked up
afterwards. Their existing password stops working immediately, and they are signed out everywhere.
{confirmReset?.osUser ? (
<>
{' '}
Their Linux account ({confirmReset.osUser}) is not affected: it has no password, and SSH keys are
unchanged.
</>
) : null}
{t('settings.users.resetBody')}
{confirmReset?.osUser ? ` ${t('settings.users.resetLinuxNote', { osUser: confirmReset.osUser })}` : null}
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel>Cancel</AlertDialogCancel>
<AlertDialogCancel>{tUi('button.cancel')}</AlertDialogCancel>
<AlertDialogAction onClick={() => confirmReset && void resetPassword(confirmReset)}>
Generate a new password
{t('settings.users.generateNewPassword')}
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
@@ -345,11 +342,11 @@ export const UsersSection = () => {
variant="ghost"
size="icon"
className="shrink-0"
aria-label="Copy the new password"
aria-label={t('settings.users.copyNewPassword')}
onClick={() => {
if (!newPassword) return;
void copyToClipboard(newPassword.password).then((ok) =>
ok ? toast.success('Password copied') : toast.error('Could not copy — select it and copy by hand'),
ok ? toast.success(t('settings.users.passwordCopied')) : toast.error(t('settings.users.copyFailed')),
);
}}
>
@@ -358,7 +355,7 @@ export const UsersSection = () => {
</div>
<AlertDialogFooter>
<AlertDialogAction onClick={() => setNewPassword(null)}>Done</AlertDialogAction>
<AlertDialogAction onClick={() => setNewPassword(null)}>{t('settings.users.done')}</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
@@ -22,5 +22,4 @@ export * from './Dashboards';
export * from './Terminal';
export * from './Jobs';
export * from './QrTransfer';
export * from './Minesweeper';
export * from './SendOff';
+14 -22
View File
@@ -1,30 +1,11 @@
import { useEffect } from 'react';
import type { ReactNode } from 'react';
import type { TranslationMap } from 'i18n';
import { I18nProvider, localeDirection } from 'i18n';
import { panelCatalogs } from 'officerdev';
import { uiCatalogs } from '@/components/locales';
import { setNameRevision } from 'workspaces/react';
import { useSettings } from 'state/useSettings';
import { FALLBACK_LOCALE, SHIPPED_LOCALES } from './locales';
import appEnGB from '../locales/en-GB.json';
import appPtPT from '../locales/pt-PT.json';
const appCatalogs: TranslationMap = { 'en-GB': appEnGB, 'pt-PT': appPtPT };
/**
* Deep-merges the three per-workspace catalogs (D6) into one map per shipped locale — `app.*` from
* officer-web, `panel.*` from officerdev's panel apps, `ui.*` from shared components.
*/
const translations: TranslationMap = Object.fromEntries(
SHIPPED_LOCALES.map(({ code }) => [
code,
{
app: appCatalogs[code] ?? {},
panel: panelCatalogs[code] ?? {},
ui: uiCatalogs[code] ?? {},
},
]),
);
import { catalogues as translations } from './catalogues';
type I18nBridgeProps = {
children: ReactNode;
@@ -40,6 +21,17 @@ export const I18nBridge = ({ children }: I18nBridgeProps) => {
document.documentElement.dir = localeDirection(locale);
}, [locale]);
/*
Panel names are thunks resolved during the framework's own render (AppRegistryEntry.name), and the
framework is not subscribed to this provider — it has no i18n dependency at all, deliberately. So
tell it that the words changed. It treats the value as opaque; that it happens to be a locale is
this file's business, not the framework's.
Set during render rather than in an effect: an effect would leave the first paint after a locale
switch showing the previous language's titles.
*/
setNameRevision(locale);
return (
<I18nProvider translations={translations} locale={locale} fallbackLocale={FALLBACK_LOCALE}>
{children}
@@ -0,0 +1,51 @@
import { describe, expect, test } from 'bun:test';
import { catalogues } from './catalogues';
import { FALLBACK_LOCALE, SHIPPED_LOCALES } from './locales';
/**
* A locale is only shipped if it is actually LOADED.
*
* This exists because es-ES, de-DE and fr-FR shipped dead. Every one of their 1,129 keys was translated and
* in parity, all three were in `SHIPPED_LOCALES` so the picker offered them, and choosing one rendered the
* entire UI in raw keys — because none of the three catalogue files had been given the `import`.
*
* The parity tests could not have caught it and never will: they compare JSON files to each other, and an
* unimported file is as parity-correct as an imported one. The gap was between "the translation exists" and
* "the app can reach it", and nothing was asking that question.
*
* Adding a locale touches four files. This is the one that knows whether all four happened.
*/
describe('every shipped locale is reachable', () => {
const NAMESPACES = ['app', 'panel', 'ui'] as const;
test('SHIPPED_LOCALES is not empty and contains the fallback', () => {
expect(SHIPPED_LOCALES.length).toBeGreaterThan(0);
expect(SHIPPED_LOCALES.map((l) => l.code)).toContain(FALLBACK_LOCALE);
});
for (const { code } of SHIPPED_LOCALES) {
describe(code, () => {
test('has a catalogue at all', () => {
expect(catalogues[code]).toBeDefined();
});
for (const ns of NAMESPACES) {
// Non-empty, not merely present. The failure being pinned produced `{}` for all three, which is
// exactly what `?? {}` yields for a locale nobody imported — present, and useless.
test(`${ns}.* is populated`, () => {
const catalogue = (catalogues[code] as Record<string, object> | undefined)?.[ns];
expect(catalogue).toBeDefined();
expect(Object.keys(catalogue ?? {}).length).toBeGreaterThan(0);
});
}
// Parity against the fallback is tested per-workspace already; this is the cheaper cross-check that
// the MERGED catalogue is the same size, which catches a namespace wired to the wrong locale's file.
test('is the same size as the fallback', () => {
const count = (o: unknown): number =>
typeof o === 'object' && o !== null ? Object.values(o).reduce<number>((n, v) => n + count(v), 0) : 1;
expect(count(catalogues[code])).toBe(count(catalogues[FALLBACK_LOCALE]));
});
});
}
});
+47
View File
@@ -0,0 +1,47 @@
import type { TranslationMap } from 'i18n';
import { panelCatalogs } from 'officerdev';
import { uiCatalogs } from '@/components/locales';
import { SHIPPED_LOCALES } from './locales';
import appDeDE from '../locales/de-DE.json';
import appEnGB from '../locales/en-GB.json';
import appEsES from '../locales/es-ES.json';
import appFrFR from '../locales/fr-FR.json';
import appPtPT from '../locales/pt-PT.json';
/**
* The three per-workspace catalogues, merged into one map per shipped locale (D6): `app.*` from
* officer-web, `panel.*` from officerdev's panel apps, `ui.*` from shared components.
*
* ── Why this is a separate file from `I18nBridge` ──
*
* So it can be tested without mounting React, and it is tested because of a real failure. es-ES, de-DE and
* fr-FR shipped translated, in perfect key parity, listed in the picker — and completely dead. All three
* `import` lists still named only en-GB and pt-PT, so `catalogues[code]` was three empty objects and the
* whole UI rendered untranslated in three of five languages.
*
* Nothing caught it. The parity tests compare the JSON FILES against each other and every file was correct;
* a locale that is never imported is invisible to them by construction. `SHIPPED_LOCALES` is what the picker
* reads, and it had been updated. Adding a locale was four edits in four files with no single place that
* knew all four had happened.
*
* `catalogues.test.ts` is now that place: it asserts every shipped locale actually resolves to a populated
* catalogue in all three namespaces.
*/
const appCatalogs: TranslationMap = {
'en-GB': appEnGB,
'pt-PT': appPtPT,
'es-ES': appEsES,
'de-DE': appDeDE,
'fr-FR': appFrFR,
};
export const catalogues: TranslationMap = Object.fromEntries(
SHIPPED_LOCALES.map(({ code }) => [
code,
{
app: appCatalogs[code] ?? {},
panel: panelCatalogs[code] ?? {},
ui: uiCatalogs[code] ?? {},
},
]),
);
+17 -4
View File
@@ -6,9 +6,22 @@
*/
export type ShippedLocale = { code: string; label: string };
export const SHIPPED_LOCALES: ShippedLocale[] = [
{ code: 'en-GB', label: 'English (UK)' },
{ code: 'pt-PT', label: 'Português (Portugal)' },
];
/**
* The label is an AUTONYM — each language named in its own language, so "Português" reads as Portuguese
* whichever locale the UI is currently in. That is the convention for a language picker and it is the
* useful behaviour: somebody who cannot read the current language still has to find theirs.
*
* Computed rather than written down, for the same reason the spoken-language list is (see Languages.tsx):
* `Intl` already knows every language's name in every locale, including its own.
*/
const autonym = (code: string): string => {
const name = new Intl.DisplayNames([code], { type: 'language', fallback: 'code' }).of(code) ?? code;
return name.charAt(0).toUpperCase() + name.slice(1);
};
export const SHIPPED_LOCALES: ShippedLocale[] = ['en-GB', 'pt-PT', 'fr-FR', 'de-DE', 'es-ES'].map((code) => ({
code,
label: autonym(code),
}));
export const FALLBACK_LOCALE = 'en-GB';
+704
View File
@@ -0,0 +1,704 @@
{
"common": {
"save": "Speichern",
"saving": "Wird gespeichert...",
"cancel": "Abbrechen"
},
"settings": {
"profile": {
"userData": {
"email": "E-Mail",
"username": "Benutzername",
"name": "Name",
"namePlaceholder": "Ihr Name",
"updated": "Profil aktualisiert",
"updateFailed": "Profil konnte nicht aktualisiert werden",
"selectImage": "Bitte wählen Sie eine Bilddatei aus",
"imageTooLarge": "Das Bild muss kleiner als 384 KB sein"
},
"apiKeys": {
"intro": "Ein API-Schlüssel meldet Sie an, ohne Passwort und ohne Ablauf. Ein Schlüssel funktioniert überall — ein Schlüssel ist nicht an eine App gebunden. Jedem Gerät einen eigenen zu geben, dient nur dazu, einen abzuschalten, ohne die anderen anzutasten. Senden Sie ihn als",
"loading": "Schlüssel werden geladen…",
"mintedTitle": "Schlüssel für “{{name}}” — wird nur einmal angezeigt",
"savedIt": "Ich habe ihn gespeichert",
"copyKey": "Schlüssel kopieren",
"copied": "Schlüssel kopiert",
"copyFailed": "Kopieren nicht möglich — bitte manuell auswählen und kopieren",
"newKey": "Neuer Schlüssel",
"namePlaceholder": "iPhone, Musik-App, Laptop-CLI…",
"create": "Erstellen",
"createFailed": "Der Schlüssel konnte nicht erstellt werden",
"noneYet": "Noch keine Schlüssel.",
"noneInUse": "Keine Schlüssel in Verwendung.",
"revoked": "widerrufen",
"expired": "abgelaufen",
"lastUsed": "zuletzt verwendet am {{date}}",
"neverUsed": "nie verwendet",
"forget": "Diesen Eintrag entfernen",
"forgetFailed": "Entfernen nicht möglich",
"revoke": "Widerrufen",
"revokeDone": "Widerrufen — alles, was diesen Schlüssel verwendet hat, wurde abgemeldet",
"revokeFailed": "Widerrufen nicht möglich",
"hideDead": "Widerrufene und abgelaufene ausblenden",
"showDead": {
"one": "{{count}} widerrufenen oder abgelaufenen Schlüssel anzeigen",
"other": "{{count}} widerrufene oder abgelaufene Schlüssel anzeigen"
}
},
"voice": {
"label": "Stimme",
"refresh": "Stimmen aktualisieren",
"serverDefault": "Server-Standard",
"hint": "Wählen Sie eine Stimme für die Sprachausgabe (Text-to-Speech). Belassen Sie es beim Server-Standard, um die vom Administrator konfigurierte Stimme zu verwenden.",
"stop": "Stopp",
"listen": "Anhören"
},
"dock": {
"visible": "Sichtbar",
"hidden": "Ausgeblendet",
"dragToShow": "Elemente hierher ziehen, um sie im Dock anzuzeigen",
"allVisible": "Alle Elemente sichtbar",
"reset": "Auf Standard zurücksetzen"
},
"languages": {
"spokenLabel": "Sprachen, die Sie sprechen",
"addLanguage": "Sprache hinzufügen...",
"defaultLabel": "Standardsprache",
"defaultHint": "Wird für die Lokalisierung der Oberfläche verwendet.",
"translateToLabel": "Übersetzen nach",
"translateToHint": "Zielsprache beim Übersetzen von Inhalten, die Sie nicht sprechen."
},
"changePassword": {
"currentPasswordLabel": "Aktuelles Passwort",
"currentPasswordPlaceholder": "Aktuelles Passwort",
"newPasswordLabel": "Neues Passwort",
"newPasswordPlaceholder": "Neues Passwort",
"confirmPasswordLabel": "Neues Passwort bestätigen",
"confirmPasswordPlaceholder": "Neues Passwort bestätigen",
"changeButton": "Passwort ändern",
"changingButton": "Wird geändert...",
"passwordChanged": "Passwort geändert",
"passwordChangeFailed": "Passwort konnte nicht geändert werden"
},
"models": {
"defaultModel": "Standardmodell",
"sameAsChat": "Wie Chat-Standard",
"taskDefaultsSaved": "Aufgaben-Standardeinstellungen gespeichert",
"saveFailed": "Einstellungen konnten nicht gespeichert werden",
"defaultChat": "Standard-Chat-Modell",
"defaultChatHint": "Wird beim Starten eines neuen Chats vom Startbildschirm verwendet",
"defaultProject": "Standard-Projektmodell",
"defaultProjectHint": "Wird beim Starten eines neuen Chats innerhalb eines Projekt-Dashboards verwendet",
"defaultTask": "Standard-Aufgabenmodell",
"defaultTaskHint": "Wird beim Ausführen von Aufgaben aus dem Datei-Browser verwendet",
"aiDefaultsSaved": "KI-Modell-Standardeinstellungen gespeichert"
}
},
"sections": {
"profile": {
"label": "Profil",
"hint": "Avatar, Name, E-Mail",
"description": "Avatar, Name und E-Mail"
},
"changePassword": {
"label": "Passwort ändern",
"description": "Aktualisieren Sie Ihr Passwort"
},
"apiKeys": {
"label": "API-Schlüssel",
"hint": "Schlüssel, die sich als Sie anmelden",
"description": "Schlüssel, die sich als Sie anmelden, einzeln widerrufbar"
},
"languages": {
"label": "Sprachen",
"hint": "gesprochen und Übersetzung",
"description": "Gesprochen, Standard und Übersetzung"
},
"voice": {
"label": "Stimme",
"hint": "Text-zu-Sprache",
"description": "Einstellung für die Sprachausgabe (Text-to-Speech)"
},
"dock": {
"label": "Dock",
"hint": "auswählen und anordnen",
"description": "Dock-Elemente auswählen und anordnen"
},
"myModels": {
"label": "Meine Modelle",
"description": "Modelle für sich selbst anzeigen oder ausblenden"
},
"channelModels": {
"label": "Kanalmodelle",
"description": "Modelle, die für Konten ohne Eigentümerrechte erreichbar sind"
},
"defaultModels": {
"label": "Standardmodelle",
"description": "Standardmodelle für Chat, Projekte und Aufgaben"
},
"providers": {
"label": "Anbieter",
"hint": "Harnesses",
"description": "Entfernte und lokale KI-Anbieter"
},
"tts": {
"label": "Text-zu-Sprache",
"description": "TTS-Anbieter und Stimme"
},
"stt": {
"label": "Sprache-zu-Text",
"description": "Whisper-Server-URL"
},
"ocr": {
"label": "OCR",
"description": "Vision-Modell für Textextraktion"
},
"maintenance": {
"label": "Neu erstellen & neu starten",
"hint": "Wartung",
"description": "Änderungen laden, ohne ein Terminal zu benötigen"
},
"smtp": {
"label": "SMTP",
"hint": "ausgehende E-Mail",
"description": "Anbieter für E-Mail-Zustellung"
},
"googleOauth": {
"label": "Google OAuth",
"description": "Client-ID und Secret für Google-APIs"
},
"apify": {
"label": "Apify",
"description": "API-Token für Web-Scraping-Actors"
},
"davSync": {
"label": "Kalender- und Kontaktabgleich",
"hint": "App-Passwörter",
"description": "Geräteweise Passwörter für CalDAV-/CardDAV-Clients"
},
"accounts": {
"label": "Konten",
"hint": "Benutzer",
"description": "Wer Zugriff hat, und worauf"
},
"permissions": {
"label": "Berechtigungen",
"description": "Was jede Rolle erreichen kann"
}
},
"searchPlaceholder": "Einstellungen durchsuchen…",
"selectSection": "Wählen Sie einen Bereich aus",
"groups": {
"models": "Modelle",
"defaults": "Standardwerte",
"providers": "Anbieter",
"ai": "KI",
"maintenance": "Wartung",
"email": "E-Mail"
},
"nav": {
"profile": "Profil",
"ai": "KI",
"system": "System",
"integrations": "Integrationen",
"users": "Benutzer"
},
"ai": {
"noModels": "Keine Modelle verfügbar. Konfigurieren Sie API-Schlüssel unter Anbieter.",
"dragToShow": "Modelle hierher ziehen, um sie anzuzeigen",
"allVisible": "Alle Modelle sichtbar",
"dragToEnable": "Modelle hierher ziehen, um sie zu aktivieren",
"allEnabled": "Alle Modelle aktiviert",
"visible": "Sichtbar",
"hidden": "Ausgeblendet",
"enabled": "Aktiviert",
"disabled": "Deaktiviert",
"refresh": "Modelle von Anbietern aktualisieren",
"refreshed": "Modelle aktualisiert",
"refreshFailed": "Modelle konnten nicht aktualisiert werden"
},
"integrations": {
"enterprise": "Unternehmen",
"personal": "Persönlich"
},
"server": {
"loading": "Wird geladen…",
"provider": "Anbieter",
"model": "Modell",
"voice": "Stimme",
"ocr": {
"serverUrl": "Server-URL des Vision-Modells",
"refreshModels": "Modelle aktualisieren",
"selectModel": "Wählen Sie ein Modell aus",
"saved": "OCR-Einstellungen gespeichert",
"saveFailed": "OCR-Einstellungen konnten nicht gespeichert werden",
"reachable": "Vision-Modell-Server ist erreichbar"
},
"stt": {
"serverUrl": "Whisper-Server-URL",
"saved": "STT-Einstellungen gespeichert",
"saveFailed": "STT-Einstellungen konnten nicht gespeichert werden",
"reachable": "Whisper-Server ist erreichbar"
},
"tts": {
"openaiCompatible": "OpenAI-kompatibel (Kokoro, OpenAI usw.)",
"elevenLabs": "ElevenLabs",
"refreshVoices": "Stimmen aktualisieren",
"selectVoice": "Wählen Sie eine Stimme aus",
"saved": "TTS-Einstellungen gespeichert",
"saveFailed": "TTS-Einstellungen konnten nicht gespeichert werden",
"playing": "Testaudio wird abgespielt",
"testFailed": "Test fehlgeschlagen — TTS-Server nicht erreichbar"
},
"smtp": {
"mailhog": "MailHog (lokaler Test)",
"resend": "Resend",
"custom": "Benutzerdefiniertes SMTP",
"apiKey": "API-Schlüssel",
"host": "Host",
"port": "Port",
"username": "Benutzername",
"password": "Passwort",
"tls": "TLS / SSL",
"fromName": "Absendername",
"fromEmail": "Absender-E-Mail",
"sendTest": "Test-E-Mail senden",
"userExample": "benutzer@beispiel.de",
"recipientExample": "empfänger@beispiel.de",
"saved": "SMTP-Einstellungen gespeichert",
"saveFailed": "SMTP-Einstellungen konnten nicht gespeichert werden",
"connected": "Verbindung erfolgreich",
"testSent": "Test-E-Mail an {{email}} gesendet"
},
"maintenance": {
"updateTitle": "Plattform aktualisieren",
"updateHint": "Ändert nichts, was gerade läuft. Was das Update benötigt, ist hier aufgeführt, und die Entscheidung liegt bei Ihnen.",
"rebuild": "Frontend neu erstellen",
"restart": "Server neu starten",
"upToDate": "Bereits aktuell",
"rebuilt": "Frontend neu erstellt — laden Sie diese Seite neu, um es zu sehen",
"restarting": "Wird neu gestartet — die Seite verbindet sich von selbst wieder",
"pulled": {
"one": "{{count}} Commit abgerufen",
"other": "{{count}} Commits abgerufen"
}
},
"harnesses": {
"piMono": "Pi Mono",
"checking": "Wird geprüft…",
"localProviders": "Lokale Anbieter",
"remoteProviders": "Entfernte Anbieter",
"connect": "Verbinden",
"authenticate": "Authentifizieren",
"connectLocal": "Lokalen Anbieter verbinden",
"connectProvider": "Anbieter verbinden",
"none": "Keine Anbieter gefunden.",
"updatePiMono": "Pi Mono aktualisieren",
"removeProvider": "Anbieter entfernen",
"namePlaceholder": "Name (z. B. Mein Ollama)",
"username": "Benutzername",
"password": "Passwort",
"apiKey": "API-Schlüssel",
"editKey": "Schlüssel bearbeiten",
"disconnect": "Anbieter trennen",
"saveKey": "Schlüssel speichern",
"enterKey": "API-Schlüssel eingeben",
"search": "Anbieter durchsuchen…",
"connectFailed": "Verbindung fehlgeschlagen",
"authFailed": "Authentifizierung fehlgeschlagen",
"saveFailed": "Anbieter konnte nicht gespeichert werden",
"connectedTo": "Mit {{name}} verbunden"
}
},
"users": {
"loadingPermissions": "Berechtigungen werden geladen…",
"permissionsFailed": "Berechtigungen konnten nicht geladen werden.",
"deniedUnlessGranted": "Alles ist verweigert, sofern es hier nicht gewährt wird.",
"read": "Lesen",
"full": "Vollständig",
"noAccess": "Kein Zugriff",
"role": "Rolle",
"permissionsSaved": "Gespeichert, was {{role}}s erreichen können",
"copyBeforeClosing": "Kopieren Sie, was Sie brauchen, bevor Sie schließen — nichts davon kann erneut angezeigt werden.",
"password": "Passwort",
"linuxAccount": "Linux-Konto",
"sshKey": "Ihr öffentlicher SSH-Schlüssel",
"addToGitea": "Fügen Sie dies zu ihrem Gitea-Konto hinzu",
"linuxIncomplete": "Das Konto funktioniert, aber die Linux-Seite wurde nicht fertiggestellt",
"done": "Fertig",
"addAccount": "Konto hinzufügen",
"newAccount": "Neues Konto",
"email": "E-Mail",
"name": "Name",
"username": "Benutzername",
"usernameHint": "Buchstaben, Zahlen, Punkte, Bindestriche und Unterstriche.",
"generatePassword": "Ein Passwort generieren",
"copyPassword": "Passwort kopieren",
"passwordHint": "Mindestens 12 Zeichen, mit Groß- und Kleinbuchstaben, einer Zahl und einem Symbol.",
"sshPlaceholder": "ssh-ed25519 AAAAC3Nza… ana@laptop",
"passwordCopied": "Passwort kopiert",
"loadingAccounts": "Konten werden geladen…",
"accountsFailed": "Konten konnten nicht geladen werden.",
"removeAccount": "Konto entfernen",
"generateNewPassword": "Ein neues Passwort generieren",
"serverOwner": "Servereigentümer",
"copySshTitle": "Ihren öffentlichen SSH-Schlüssel kopieren (fügen Sie ihn zu ihrem Gitea-Konto hinzu)",
"resetPasswordTitle": "Ein neues Passwort generieren — wird nur einmal angezeigt und meldet sie überall ab",
"copyNewPassword": "Das neue Passwort kopieren",
"publicKeyCopied": "Öffentlicher Schlüssel kopiert",
"copyFailed": "Kopieren nicht möglich — bitte manuell auswählen und kopieren",
"repairFor": "Linux-Konto von {{email}} reparieren",
"linuxAccountFor": "Linux-Konto: {{osUser}} — klicken, um es zu reparieren oder den SSH-Schlüssel zu ersetzen",
"copySshFor": "Öffentlichen SSH-Schlüssel von {{email}} kopieren",
"resetPasswordFor": "Passwort von {{email}} zurücksetzen",
"removeFor": "{{email}} entfernen",
"provisionPrompt": "Linux-Konto für {{email}}.\n\nFügen Sie einen öffentlichen SSH-Schlüssel ein, um SSH-Zugriff zu erlauben, oder lassen Sie das Feld leer, um den aktuellen zu behalten.",
"createLinux": "Ein Linux-Konto erstellen",
"noLinux": "Kein Linux-Konto — klicken, um eines zu erstellen",
"removeTitle": "{{email}} entfernen?",
"removeBody": "Dies löscht das Konto und alles, was dazugehört — Passkeys, Dashboards, gespeicherte Layouts und alles, was ein installiertes Plugin für dieses Konto speichert. Dies kann nicht rückgängig gemacht werden.",
"resetTitle": "Passwort für {{email}} zurücksetzen?",
"resetBody": "Ein neues Passwort wird generiert und Ihnen einmalig angezeigt — es wird nirgendwo gespeichert und kann danach nicht mehr abgerufen werden. Das bisherige Passwort funktioniert sofort nicht mehr, und die Person wird überall abgemeldet.",
"resetLinuxNote": "Das Linux-Konto ({{osUser}}) ist davon nicht betroffen: Es hat kein Passwort, und die SSH-Schlüssel bleiben unverändert."
},
"dav": {
"newDevice": "Neues Gerät",
"create": "Erstellen",
"none": "Noch keine Geräte.",
"placeholder": "Pixel 9, iPad, Thunderbird…",
"revoke": "Widerrufen",
"delete": "Löschen",
"copyFailed": "Kopieren nicht möglich — bitte manuell auswählen und kopieren",
"createFailed": "Das App-Passwort konnte nicht erstellt werden",
"revoked": "Widerrufen — dieses Gerät synchronisiert nicht mehr",
"revokeFailed": "Widerrufen nicht möglich",
"deleteFailed": "Löschen nicht möglich",
"copyField": "{{field}} kopieren",
"copied": "{{what}} kopiert"
},
"google": {
"guideToggle": "Schritt-für-Schritt-Anleitung",
"step1": {
"title": "Ein Google-Cloud-Projekt erstellen",
"body": "Öffnen Sie die Seite zur Projekterstellung, geben Sie ihm einen Namen (zum Beispiel “Officer”) und klicken Sie auf:",
"link": "New Project"
},
"step2": {
"title": "Die APIs aktivieren",
"body": "Öffnen Sie die API-Bibliothek, suchen Sie nach jeder dieser APIs und klicken Sie auf:",
"link": "API Library"
},
"step3": {
"title": "Den OAuth-Zustimmungsbildschirm konfigurieren",
"link": "OAuth Branding",
"appName": "Legen Sie den Namen Ihrer Organisation oder “Officer” fest als:",
"supportEmail": "Legen Sie die E-Mail-Adresse Ihres Administrators fest als:",
"devContact": "Fügen Sie die E-Mail-Adresse Ihres Administrators hinzu unter:",
"save": "Klicken Sie dann auf:"
},
"step4": {
"title": "Die Zielgruppe festlegen",
"link": "OAuth Audience",
"internal": "Wenn Ihr Team Google Workspace verwendet, wählen Sie dies — keine Überprüfung nötig:",
"external": "Andernfalls wählen Sie dies und fügen Sie die E-Mail-Adressen Ihres Teams unter Test users hinzu (erforderlich, solange die App nicht verifiziert ist; Grenze von 100 Testnutzern):"
},
"step5": {
"title": "Bereiche hinzufügen",
"link": "Data Access",
"body": "Öffnen Sie den Datenzugriff, suchen Sie die unten stehenden Bereiche, fügen Sie sie hinzu und klicken Sie dann auf:",
"note": "Google stuft den Kalenderbereich als sensibel und den Gmail-Bereich als eingeschränkt ein. Das ist unproblematisch für Internal-Apps (Google Workspace) und für External-Apps im Testmodus; die Veröffentlichung in Produktion mit eingeschränkten Bereichen erfordert eine Google-Verifizierung."
},
"step6": {
"title": "OAuth-Anmeldedaten erstellen",
"link": "Clients",
"body": "Öffnen Sie die Clients-Seite und klicken Sie auf:",
"appType": "Anwendungstyp:",
"nameAnything": "Name: beliebig (zum Beispiel “Officer”)",
"redirectUris": "Autorisierte Weiterleitungs-URIs — hinzufügen:",
"thenClick": "Klicken Sie dann auf:"
},
"step7": {
"title": "Die Anmeldedaten kopieren",
"body": "Ein Dialogfeld zeigt Ihre Client-ID und Ihr Client-Secret. Kopieren Sie beide und fügen Sie sie in die untenstehenden Felder ein."
},
"scopeGmail": "E-Mails lesen",
"scopeCalendar": "Kalenderereignisse lesen",
"verifying": "Anmeldedaten werden überprüft…",
"valid": "Anmeldedaten gültig",
"invalid": "Ungültige Anmeldedaten",
"verifyFailed": "Überprüfungsanfrage fehlgeschlagen",
"clientId": "Client-ID",
"clientSecret": "Client-Secret",
"redirectUri": "Weiterleitungs-URI",
"redirectUriHint": "Fügen Sie diese URI zu den autorisierten Weiterleitungs-URIs Ihres Google-OAuth-Clients hinzu",
"saved": "Google-OAuth-Konfiguration gespeichert",
"saveFailed": "Google-OAuth-Konfiguration konnte nicht gespeichert werden"
},
"googleAccount": {
"title": "Google-Konto",
"hint": "Verbinden Sie Ihr Google-Konto für Kalender, Kontakte und andere Google-Dienste.",
"connected": "Verbunden",
"disconnect": "Trennen",
"connect": "Google-Konto verbinden",
"connectedToast": "Google-Konto verbunden",
"connectFailed": "Google-Konto konnte nicht verbunden werden",
"disconnectedToast": "Google-Konto getrennt",
"disconnectFailed": "Google-Konto konnte nicht getrennt werden"
},
"apify": {
"token": "API-Token",
"saved": "Apify-API-Token gespeichert",
"saveFailed": "Apify-API-Token konnte nicht gespeichert werden"
}
},
"header": {
"userMenu": {
"profile": "Profil",
"systemSettings": "Systemeinstellungen",
"signOut": "Abmelden",
"ai": "KI",
"integrations": "Integrationen",
"userManagement": "Benutzerverwaltung"
},
"tabName": "Tab-Name",
"tabNameHint": "Klicken, um diesen Tab umzubenennen — leeren, um zum Seitennamen zurückzukehren",
"logoAlt": "Officer",
"navigation": "Navigation",
"jobsRunning": "Job läuft",
"jobsNothingRunning": "Nichts läuft",
"jobsQueued": "Jobs in Warteschlange"
},
"nav": {
"home": "Start",
"files": "Dateien",
"chat": "Chat",
"commandHq": "Command HQ",
"editor": "Editor",
"jobs": "Jobs",
"terminal": "Terminal",
"browser": "Browser",
"monitor": "Monitor",
"activity": "Aktivität",
"dashboards": "Dashboards",
"sendOff": "SendOff",
"calendar": "Kalender",
"contacts": "Kontakte",
"appStore": "App Store",
"marketplace": "Marketplace",
"codeEditor": "Code-Editor"
},
"theme": {
"pillTitle": "Design: {{name}} · Strg+Umschalt+←/→ durchblättern · Strg+Umschalt+Leertaste durchsuchen · Strg+Umschalt+F {{starAction}}",
"pillLabel": "Design: {{name}}",
"star": "markieren",
"unstar": "Markierung aufheben",
"cycleHint": "Strg+Umschalt+←/→ durchblättern · Strg+Umschalt+Leertaste durchsuchen",
"everyShortcutHint": "Strg+? für alle Tastenkombinationen",
"favouritesOnly": "Nur Favoriten ({{count}})",
"favourites": "Favoriten ({{count}})",
"noFavourites": "Noch keine Favoriten — markieren Sie einen mit der Schaltfläche in seiner Zeile.",
"starNamed": "{{name}} markieren",
"unstarNamed": "Markierung von {{name}} aufheben",
"addToFavourites": "Zu Favoriten hinzufügen",
"removeFromFavourites": "Aus Favoriten entfernen",
"addToFavouritesKey": "Zu Favoriten hinzufügen (f)",
"removeFromFavouritesKey": "Aus Favoriten entfernen (f)",
"active": "aktiv",
"browseHint": "j/k oder ↑/↓ bewegen · l oder → Vorschau · f markieren · h oder ← zurücksetzen · Eingabetaste behalten · Esc abbrechen"
},
"spotlight": {
"placeholder": "Gehe zu…",
"noResults": "Keine Treffer für “{{query}}”."
},
"shortcutsModal": {
"title": "Tastenkombinationen",
"hint": "Strg+? · Esc zum Schließen"
},
"screenError": {
"title": "Dieser Bildschirm konnte nicht angezeigt werden",
"description": "Nichts ist verloren gegangen — das ist ein Anzeigefehler, kein Datenfehler. Agenten-Transkripte, Jobs und Dateien sind unberührt.",
"unknownError": "Unbekannter Fehler",
"tryAgain": "Erneut versuchen",
"reload": "Neu laden",
"goHome": "Zum Start",
"resetHint": "Wenn es an derselben Stelle erneut fehlschlägt, ist meist ein gespeichertes Panel-Layout die Ursache. Zurücksetzen bringt die Panels aller Bildschirme auf ihre Standardwerte zurück.",
"dashboardsSafe": "Ihre Dashboards sind davon nicht betroffen.",
"resetting": "Wird zurückgesetzt…",
"resetConfirm": "Ja — Layout aller Bildschirme zurücksetzen",
"reset": "Bildschirm-Layouts zurücksetzen"
},
"rescan": {
"label": "Elemente erneut scannen",
"title": "officer-items erneut scannen (Änderungen übernehmen, ohne neu zu starten)",
"failed": "Elemente konnten nicht erneut gescannt werden",
"done": "Elemente erneut gescannt — {{summary}}",
"counts": {
"tasks": {
"one": "{{count}} Aufgabe",
"other": "{{count}} Aufgaben"
},
"agents": {
"one": "{{count}} Agent",
"other": "{{count}} Agenten"
},
"tools": {
"one": "{{count}} Werkzeug",
"other": "{{count}} Werkzeuge"
},
"skills": {
"one": "{{count}} Skill",
"other": "{{count}} Skills"
},
"processes": {
"one": "{{count}} Prozess",
"other": "{{count}} Prozesse"
},
"affordances": {
"one": "{{count}} Affordance",
"other": "{{count}} Affordances"
}
},
"newChatsOnly": "Gilt für neue Chats — ein bereits geöffneter behält, was er beim Start hatte.",
"noDescription": {
"one": "{{count}} Skill hat keine Beschreibung, daher wird sie keinem Agenten angeboten.",
"other": "{{count}} Skills haben keine Beschreibung, daher werden sie keinem Agenten angeboten."
}
},
"bugReport": {
"label": "Fehler melden",
"title": "Fehler melden",
"describePlaceholder": "Beschreiben Sie, was schiefgelaufen ist...",
"screenshot": "Screenshot",
"noScreenshot": "Kein Screenshot aufgenommen",
"collectedNote": "Konsolenprotokolle, Browserinformationen und aktuelle API-Fehler werden automatisch erfasst.",
"submitted": "Fehlerbericht gesendet",
"failed": "Fehlerbericht konnte nicht gesendet werden",
"submit": "Senden"
},
"auth": {
"signInTitle": "Willkommen zurück",
"signInSubtitle": "Melden Sie sich bei Ihrem Konto an",
"emailOrUsername": "E-Mail oder Benutzername",
"password": "Passwort",
"forgotPassword": "Passwort vergessen?",
"emailPlaceholder": "name@beispiel.de",
"passwordPlaceholder": "Ihr Passwort",
"forgotTitle": "Passwort vergessen",
"forgotSubtitle": "Geben Sie Ihre E-Mail-Adresse ein, um einen Link zum Zurücksetzen zu erhalten",
"email": "E-Mail",
"backToLogin": "Zurück zur Anmeldung",
"checkEmail": "Prüfen Sie Ihre E-Mails",
"checkEmailHint": "Klicken Sie darauf, um Ihr Passwort zurückzusetzen.",
"resetOk": "Passwort erfolgreich zurückgesetzt. Bitte melden Sie sich an.",
"verifying": "Wird überprüft…",
"invalidLink": "Ungültiger Link",
"invalidLinkHint": "Dieser Link zum Zurücksetzen ist ungültig oder abgelaufen.",
"resetTitle": "Passwort zurücksetzen",
"resetSubtitle": "Geben Sie Ihr neues Passwort ein",
"confirmPassword": "Passwort bestätigen",
"minChars": "Mindestens 12 Zeichen",
"confirmPlaceholder": "Bestätigen Sie Ihr Passwort",
"bootstrapTitle": "Willkommen, Administrator",
"bootstrapSubtitle": "Erstellen Sie Ihr Administratorkonto",
"name": "Name",
"username": "Benutzername",
"namePlaceholder": "Ihr Name",
"adminEmailPlaceholder": "admin@beispiel.de",
"bootstrapOk": "Administratorkonto erstellt. Bitte melden Sie sich an.",
"debug": {
"controls": "Steuerung:",
"camera": "Kamera:",
"model": "Modell:"
}
},
"shortcuts": {
"navigation": "Navigation",
"spotlight": "Spotlight — zu jedem Bildschirm, Plugin oder jeder Einstellung per Namen springen",
"thisList": "Diese Liste",
"themes": "Designs",
"themesNote": "Der Browser wendet die Änderung an, während Sie sich bewegen, sodass Sie sehen, wie sich die App verändert, statt Namen zu lesen.",
"openBrowser": "Den Design-Browser öffnen",
"prevNextTheme": "Vorheriges / nächstes Design, ohne etwas zu öffnen",
"starCurrent": "Das aktuelle Design von überall markieren oder die Markierung aufheben",
"inBrowser": "Im Design-Browser",
"moveList": "Durch die Liste bewegen",
"applyKeepBrowsing": "Das fokussierte Design anwenden und weiter durchsuchen",
"restoreStart": "Das Design wiederherstellen, mit dem Sie begonnen haben",
"starFocused": "Das fokussierte Design markieren oder die Markierung aufheben",
"keepLooking": "Behalten, was Sie sich gerade ansehen",
"cancelRestore": "Abbrechen und wiederherstellen",
"inSpotlight": "In Spotlight",
"moveResults": "Durch die Ergebnisse bewegen",
"goThere": "Dorthin gehen",
"close": "Schließen",
"chat": "Chat",
"chatNote": "Der Verlaufsabruf reagiert nur bei LEEREM Eingabefeld auf die Pfeiltaste, und jede andere Taste beendet ihn — so wird ein Entwurf nie überschrieben.",
"prevNextPrompt": "Vorheriger / nächster gesendeter Prompt, wie in einer Shell",
"send": "Senden · bei leerem Eingabefeld mit etwas in der Warteschlange wird das jetzt gesendet",
"newline": "Zeilenumbruch",
"stopTurn": "Den gerade laufenden Turn stoppen"
},
"jobs": {
"runningQueued": "In Ausführung und in Warteschlange",
"loading": "Wird geladen…",
"nothingRunning": "Nichts läuft",
"history": "Verlauf",
"clearAll": "Alles löschen",
"selectJob": "Wählen Sie einen Job aus",
"notFound": "Job nicht gefunden.",
"backToJobs": "Zurück zu den Jobs",
"stop": "Stopp",
"testNotification": "Eine Testbenachrichtigung an alle konfigurierten Kanäle senden",
"search": "Suchen…",
"deleteFinished": "Alle abgeschlossenen Jobs löschen",
"noChannels": "Keine Kanäle konfiguriert",
"notifyFailed": "Benachrichtigung konnte nicht gesendet werden",
"stopRequested": "Stopp angefordert",
"stopFailed": "Stopp fehlgeschlagen",
"titles": "Titel",
"download": "Herunterladen",
"input": "Eingabe",
"output": "Ausgabe",
"steps": "Schritte",
"selectStep": "Wählen Sie einen Schritt oder eine Unteraufgabe, um die Ausgabe anzuzeigen",
"noOutput": "Noch keine Ausgabe",
"tokens": "Tokens:",
"cost": "Kosten:",
"status": {
"running": "Läuft",
"queued": "In Warteschlange",
"completed": "Abgeschlossen",
"failed": "Fehlgeschlagen",
"stopped": "Gestoppt",
"interrupted": "Unterbrochen"
},
"failedWithCode": "Fehlgeschlagen (Exit {{code}})"
},
"activity": {
"title": "Aktivität",
"backgroundTasks": "Hintergrundaufgaben",
"detached": "Abgekoppelt",
"backToList": "Zurück zur Liste",
"selectTask": "Wählen Sie eine Aufgabe aus, um ihre Live-Ausgabe zu verfolgen",
"noneRunning": "keine läuft"
},
"passkeyGate": {
"setUp": "Richten Sie Ihren Passkey ein"
},
"chatHistory": {
"loadFailed": "Diese Unterhaltung konnte nicht geladen werden: {{reason}}"
},
"capability": {
"frontmatter": "Frontmatter",
"noMatches": "Keine Treffer",
"emptyFile": "Leere Datei",
"createFailed": "{{kind}} konnte nicht erstellt werden",
"deleteFailed": "{{kind}} konnte nicht gelöscht werden",
"searchPlaceholder": "{{kind}} durchsuchen…",
"selectOne": "{{kind}} auswählen",
"selectToView": "{{kind}} auswählen, um den Inhalt anzuzeigen",
"delete": "Löschen",
"createPrompt": "Hilf mir, den Inhalt für diese neue {{kind}}-Datei zu erstellen",
"improvePrompt": "Hilf mir, diese {{kind}}-Datei zu verstehen und zu verbessern"
}
}
+427 -24
View File
@@ -6,26 +6,68 @@
},
"settings": {
"profile": {
"searchPlaceholder": "Search settings...",
"sections": {
"profileTitle": "Profile",
"profileDescription": "Update your name and avatar.",
"changePasswordTitle": "Change Password",
"changePasswordDescription": "Update your account password.",
"tasksTitle": "Tasks",
"tasksDescription": "Default model for file browser tasks.",
"languagesTitle": "Languages",
"languagesDescription": "Set your spoken languages and translation preferences."
},
"userData": {
"emailLabel": "Email",
"nameLabel": "Name",
"email": "Email",
"username": "Username",
"name": "Name",
"namePlaceholder": "Your name",
"profileUpdated": "Profile updated",
"profileUpdateFailed": "Failed to update profile",
"selectImageFile": "Please select an image file",
"updated": "Profile updated",
"updateFailed": "Failed to update profile",
"selectImage": "Please select an image file",
"imageTooLarge": "Image must be smaller than 384KB"
},
"apiKeys": {
"intro": "An API key signs in as you, without a password and without expiring. One key works everywhere — a key is not tied to an app. Giving each device its own is only so you can cut one off without touching the rest. Send it as",
"loading": "Loading keys…",
"mintedTitle": "Key for “{{name}}” — shown once",
"savedIt": "I’ve saved it",
"copyKey": "Copy key",
"copied": "Key copied",
"copyFailed": "Could not copy — select and copy manually",
"newKey": "New key",
"namePlaceholder": "iPhone, Music app, laptop CLI…",
"create": "Create",
"createFailed": "Could not create the key",
"noneYet": "No keys yet.",
"noneInUse": "No keys in use.",
"revoked": "revoked",
"expired": "expired",
"lastUsed": "last used {{date}}",
"neverUsed": "never used",
"forget": "Remove this record",
"forgetFailed": "Could not remove it",
"revoke": "Revoke",
"revokeDone": "Revoked — anything using that key is signed out",
"revokeFailed": "Could not revoke",
"hideDead": "Hide revoked and expired",
"showDead": {
"one": "Show {{count}} revoked or expired key",
"other": "Show {{count}} revoked or expired keys"
}
},
"voice": {
"label": "Voice",
"refresh": "Refresh voices",
"serverDefault": "Server default",
"hint": "Choose a voice for text-to-speech. Leave as server default to use the admin-configured voice.",
"stop": "Stop",
"listen": "Listen"
},
"dock": {
"visible": "Visible",
"hidden": "Hidden",
"dragToShow": "Drag items here to show in dock",
"allVisible": "All items visible",
"reset": "Reset to defaults"
},
"languages": {
"spokenLabel": "Languages you speak",
"addLanguage": "Add a language...",
"defaultLabel": "Default language",
"defaultHint": "Used for UI localization.",
"translateToLabel": "Translate to",
"translateToHint": "Target language when translating content you don't speak."
},
"changePassword": {
"currentPasswordLabel": "Current Password",
"currentPasswordPlaceholder": "Current password",
@@ -38,13 +80,18 @@
"passwordChanged": "Password changed",
"passwordChangeFailed": "Failed to change password"
},
"languages": {
"spokenLabel": "Languages you speak",
"addLanguage": "Add a language...",
"defaultLabel": "Default language",
"defaultHint": "Used for UI localization.",
"translateToLabel": "Translate to",
"translateToHint": "Target language when translating content you don't speak."
"models": {
"defaultModel": "Default Model",
"sameAsChat": "Same as chat default",
"taskDefaultsSaved": "Task defaults saved",
"saveFailed": "Failed to save settings",
"defaultChat": "Default Chat Model",
"defaultChatHint": "Used when starting a new chat from the home screen",
"defaultProject": "Default Project Model",
"defaultProjectHint": "Used when starting a new chat inside a project dashboard",
"defaultTask": "Default Task Model",
"defaultTaskHint": "Used when running tasks from the file browser",
"aiDefaultsSaved": "AI model defaults saved"
}
},
"sections": {
@@ -173,6 +220,235 @@
"integrations": {
"enterprise": "Enterprise",
"personal": "Personal"
},
"server": {
"loading": "Loading…",
"provider": "Provider",
"model": "Model",
"voice": "Voice",
"ocr": {
"serverUrl": "Vision Model Server URL",
"refreshModels": "Refresh models",
"selectModel": "Select a model",
"saved": "OCR settings saved",
"saveFailed": "Failed to save OCR settings",
"reachable": "Vision model server is reachable"
},
"stt": {
"serverUrl": "Whisper Server URL",
"saved": "STT settings saved",
"saveFailed": "Failed to save STT settings",
"reachable": "Whisper server is reachable"
},
"tts": {
"openaiCompatible": "OpenAI-compatible (Kokoro, OpenAI, etc.)",
"elevenLabs": "ElevenLabs",
"refreshVoices": "Refresh voices",
"selectVoice": "Select a voice",
"saved": "TTS settings saved",
"saveFailed": "Failed to save TTS settings",
"playing": "Playing test audio",
"testFailed": "Test failed — could not reach TTS server"
},
"smtp": {
"mailhog": "MailHog (local testing)",
"resend": "Resend",
"custom": "Custom SMTP",
"apiKey": "API Key",
"host": "Host",
"port": "Port",
"username": "Username",
"password": "Password",
"tls": "TLS / SSL",
"fromName": "From Name",
"fromEmail": "From Email",
"sendTest": "Send Test Email",
"userExample": "user@example.com",
"recipientExample": "recipient@example.com",
"saved": "SMTP settings saved",
"saveFailed": "Failed to save SMTP settings",
"connected": "Connection successful",
"testSent": "Test email sent to {{email}}"
},
"maintenance": {
"updateTitle": "Update the platform",
"updateHint": "Changes nothing that is running. Whatever the update needs is listed here, and stays your call.",
"rebuild": "Rebuild the frontend",
"restart": "Restart the server",
"upToDate": "Already up to date",
"rebuilt": "Frontend rebuilt — refresh this page to see it",
"restarting": "Restarting — the page will reconnect on its own",
"pulled": {
"one": "Pulled {{count}} commit",
"other": "Pulled {{count}} commits"
}
},
"harnesses": {
"piMono": "Pi Mono",
"checking": "Checking…",
"localProviders": "Local Providers",
"remoteProviders": "Remote Providers",
"connect": "Connect",
"authenticate": "Authenticate",
"connectLocal": "Connect Local Provider",
"connectProvider": "Connect Provider",
"none": "No providers found.",
"updatePiMono": "Update Pi Mono",
"removeProvider": "Remove provider",
"namePlaceholder": "Name (e.g. My Ollama)",
"username": "Username",
"password": "Password",
"apiKey": "API Key",
"editKey": "Edit key",
"disconnect": "Disconnect provider",
"saveKey": "Save key",
"enterKey": "Enter API key",
"search": "Search providers…",
"connectFailed": "Failed to connect",
"authFailed": "Authentication failed",
"saveFailed": "Failed to save provider",
"connectedTo": "Connected to {{name}}"
}
},
"users": {
"loadingPermissions": "Loading permissions…",
"permissionsFailed": "Could not load permissions.",
"deniedUnlessGranted": "Everything is denied unless granted here.",
"read": "Read",
"full": "Full",
"noAccess": "No access",
"role": "Role",
"permissionsSaved": "Saved what {{role}}s can reach",
"copyBeforeClosing": "Copy what you need before closing — none of it can be shown again.",
"password": "Password",
"linuxAccount": "Linux account",
"sshKey": "Their SSH public key",
"addToGitea": "Add this to their Gitea account",
"linuxIncomplete": "The account works, but its Linux side did not finish",
"done": "Done",
"addAccount": "Add account",
"newAccount": "New account",
"email": "Email",
"name": "Name",
"username": "Username",
"usernameHint": "Letters, numbers, dots, hyphens and underscores.",
"generatePassword": "Generate a password",
"copyPassword": "Copy the password",
"passwordHint": "At least 12 characters, with upper and lower case, a number and a symbol.",
"sshPlaceholder": "ssh-ed25519 AAAAC3Nza… ana@laptop",
"passwordCopied": "Password copied",
"loadingAccounts": "Loading accounts…",
"accountsFailed": "Could not load the accounts.",
"removeAccount": "Remove account",
"generateNewPassword": "Generate a new password",
"serverOwner": "Server owner",
"copySshTitle": "Copy their SSH public key (add it to their Gitea account)",
"resetPasswordTitle": "Generate a new password — shown once, and signs them out everywhere",
"copyNewPassword": "Copy the new password",
"publicKeyCopied": "Public key copied",
"copyFailed": "Could not copy — select it and copy by hand",
"repairFor": "Repair {{email}}’s Linux account",
"linuxAccountFor": "Linux account: {{osUser}} — click to repair or replace their SSH key",
"copySshFor": "Copy {{email}}’s SSH public key",
"resetPasswordFor": "Reset {{email}}’s password",
"removeFor": "Remove {{email}}",
"provisionPrompt": "Linux account for {{email}}.\n\nPaste an SSH public key to allow them to SSH in, or leave empty to keep the current one.",
"createLinux": "Create a Linux account",
"noLinux": "No Linux account — click to create one",
"removeTitle": "Remove {{email}}?",
"removeBody": "This deletes the account and everything belonging to it — passkeys, dashboards, saved layouts, and anything an installed plugin keeps for them. It cannot be undone.",
"resetTitle": "Reset the password for {{email}}?",
"resetBody": "A new password is generated and shown to you once — it is not stored anywhere and cannot be looked up afterwards. Their existing password stops working immediately, and they are signed out everywhere.",
"resetLinuxNote": "Their Linux account ({{osUser}}) is not affected: it has no password, and SSH keys are unchanged."
},
"dav": {
"newDevice": "New device",
"create": "Create",
"none": "No devices yet.",
"placeholder": "Pixel 9, iPad, Thunderbird…",
"revoke": "Revoke",
"delete": "Delete",
"copyFailed": "Could not copy — select and copy manually",
"createFailed": "Could not create the app password",
"revoked": "Revoked — that device will stop syncing",
"revokeFailed": "Could not revoke",
"deleteFailed": "Could not delete",
"copyField": "Copy {{field}}",
"copied": "{{what}} copied"
},
"google": {
"guideToggle": "Step-by-step setup guide",
"step1": {
"title": "Create a Google Cloud project",
"body": "Open the project creation page, give it a name (for example “Officer”), and click:",
"link": "New Project"
},
"step2": {
"title": "Enable the APIs",
"body": "Open the API library and search for each of these, then click:",
"link": "API Library"
},
"step3": {
"title": "Configure the OAuth consent screen",
"link": "OAuth Branding",
"appName": "Set your organization name, or “Officer”, as:",
"supportEmail": "Set your admin email as:",
"devContact": "Add your admin email under:",
"save": "Then click:"
},
"step4": {
"title": "Set the audience",
"link": "OAuth Audience",
"internal": "If your team uses Google Workspace, choose — no verification needed:",
"external": "Otherwise choose, and add your team’s emails under Test users (required while the app is unverified; limit of 100 test users):"
},
"step5": {
"title": "Add scopes",
"link": "Data Access",
"body": "Open data access and search for and add the scopes below, then click:",
"note": "Google classifies the calendar scope as sensitive and the Gmail scope as restricted. That is fine for Internal apps (Google Workspace) and for External apps in testing mode; publishing to production with restricted scopes requires Google verification."
},
"step6": {
"title": "Create OAuth credentials",
"link": "Clients",
"body": "Open the clients page and click:",
"appType": "Application type:",
"nameAnything": "Name: anything (for example “Officer”)",
"redirectUris": "Authorized redirect URIs — add:",
"thenClick": "Then click:"
},
"step7": {
"title": "Copy the credentials",
"body": "A dialog shows your client ID and client secret. Copy both and paste them into the fields below."
},
"scopeGmail": "Read emails",
"scopeCalendar": "Read calendar events",
"verifying": "Verifying credentials…",
"valid": "Credentials valid",
"invalid": "Invalid credentials",
"verifyFailed": "Verification request failed",
"clientId": "Client ID",
"clientSecret": "Client Secret",
"redirectUri": "Redirect URI",
"redirectUriHint": "Add this URI to your Google OAuth client’s authorized redirect URIs",
"saved": "Google OAuth configuration saved",
"saveFailed": "Failed to save Google OAuth configuration"
},
"googleAccount": {
"title": "Google Account",
"hint": "Connect your Google account for Calendar, Contacts, and other Google services.",
"connected": "Connected",
"disconnect": "Disconnect",
"connect": "Connect Google Account",
"connectedToast": "Google account connected",
"connectFailed": "Failed to connect Google account",
"disconnectedToast": "Google account disconnected",
"disconnectFailed": "Failed to disconnect Google account"
},
"apify": {
"token": "API Token",
"saved": "Apify API token saved",
"saveFailed": "Failed to save Apify API token"
}
},
"header": {
@@ -208,7 +484,8 @@
"calendar": "Calendar",
"contacts": "Contacts",
"appStore": "App store",
"marketplace": "Marketplace"
"marketplace": "Marketplace",
"codeEditor": "Code Editor"
},
"theme": {
"pillTitle": "Theme: {{name}} · ctrl+shift+←/→ cycle · ctrl+shift+space browse · ctrl+shift+f {{starAction}}",
@@ -297,5 +574,131 @@
"submitted": "Bug report submitted",
"failed": "Failed to submit bug report",
"submit": "Submit"
},
"auth": {
"signInTitle": "Welcome Back",
"signInSubtitle": "Sign in to your account",
"emailOrUsername": "Email or username",
"password": "Password",
"forgotPassword": "Forgot password?",
"emailPlaceholder": "you@example.com",
"passwordPlaceholder": "Your password",
"forgotTitle": "Forgot Password",
"forgotSubtitle": "Enter your email to receive a reset link",
"email": "Email",
"backToLogin": "Back to login",
"checkEmail": "Check your email",
"checkEmailHint": "Click it to reset your password.",
"resetOk": "Password reset successfully. Please sign in.",
"verifying": "Verifying…",
"invalidLink": "Invalid Link",
"invalidLinkHint": "This reset link is invalid or has expired.",
"resetTitle": "Reset Password",
"resetSubtitle": "Enter your new password",
"confirmPassword": "Confirm Password",
"minChars": "Min 12 characters",
"confirmPlaceholder": "Confirm your password",
"bootstrapTitle": "Welcome, Admin",
"bootstrapSubtitle": "Create your administrator account",
"name": "Name",
"username": "Username",
"namePlaceholder": "Your name",
"adminEmailPlaceholder": "admin@example.com",
"bootstrapOk": "Administrator account created. Please sign in.",
"debug": {
"controls": "Controls:",
"camera": "Camera:",
"model": "Model:"
}
},
"shortcuts": {
"navigation": "Navigation",
"spotlight": "Spotlight — go to any screen, plugin or setting by name",
"thisList": "This list",
"themes": "Themes",
"themesNote": "The browser applies as you move, so you watch the app change rather than reading names.",
"openBrowser": "Open the theme browser",
"prevNextTheme": "Previous / next theme, without opening anything",
"starCurrent": "Star or unstar the current theme, from anywhere",
"inBrowser": "In the theme browser",
"moveList": "Move through the list",
"applyKeepBrowsing": "Apply the focused theme and keep browsing",
"restoreStart": "Put back the theme you started on",
"starFocused": "Star or unstar the focused theme",
"keepLooking": "Keep what you are looking at",
"cancelRestore": "Cancel and restore",
"inSpotlight": "In Spotlight",
"moveResults": "Move through the results",
"goThere": "Go there",
"close": "Close",
"chat": "Chat",
"chatNote": "Recall only takes the arrow key from an EMPTY composer, and any other key ends a recall — so a draft is never overwritten.",
"prevNextPrompt": "Previous / next prompt you sent, shell-style",
"send": "Send · on an empty composer with something queued, send that now",
"newline": "Newline",
"stopTurn": "Stop the turn that is generating"
},
"jobs": {
"runningQueued": "Running & Queued",
"loading": "Loading…",
"nothingRunning": "Nothing running",
"history": "History",
"clearAll": "Clear all",
"selectJob": "Select a job",
"notFound": "Job not found.",
"backToJobs": "Back to jobs",
"stop": "Stop",
"testNotification": "Send a test notification to every configured channel",
"search": "Search…",
"deleteFinished": "Delete all finished jobs",
"noChannels": "No channels configured",
"notifyFailed": "Failed to send notification",
"stopRequested": "Stop requested",
"stopFailed": "Failed to stop",
"titles": "Titles",
"download": "Download",
"input": "Input",
"output": "Output",
"steps": "Steps",
"selectStep": "Select a step or sub-task to view output",
"noOutput": "No output yet",
"tokens": "Tokens:",
"cost": "Cost:",
"status": {
"running": "Running",
"queued": "Queued",
"completed": "Completed",
"failed": "Failed",
"stopped": "Stopped",
"interrupted": "Interrupted"
},
"failedWithCode": "Failed (exit {{code}})"
},
"activity": {
"title": "Activity",
"backgroundTasks": "Background tasks",
"detached": "Detached",
"backToList": "Back to the list",
"selectTask": "Select a task to follow its live output",
"noneRunning": "none running"
},
"passkeyGate": {
"setUp": "Set up your passkey"
},
"chatHistory": {
"loadFailed": "Could not load this conversation: {{reason}}"
},
"capability": {
"frontmatter": "Frontmatter",
"noMatches": "No matches",
"emptyFile": "Empty file",
"createFailed": "Could not create the {{kind}}",
"deleteFailed": "Could not delete the {{kind}}",
"searchPlaceholder": "Search {{kind}}…",
"selectOne": "Select a {{kind}}",
"selectToView": "Select a {{kind}} to view its contents",
"delete": "Delete",
"createPrompt": "Help me create the content for this new {{kind}} file",
"improvePrompt": "Help me understand and improve this {{kind}} file"
}
}
+704
View File
@@ -0,0 +1,704 @@
{
"common": {
"save": "Guardar",
"saving": "Guardando...",
"cancel": "Cancelar"
},
"settings": {
"profile": {
"userData": {
"email": "Correo electrónico",
"username": "Nombre de usuario",
"name": "Nombre",
"namePlaceholder": "Tu nombre",
"updated": "Perfil actualizado",
"updateFailed": "No se pudo actualizar el perfil",
"selectImage": "Selecciona un archivo de imagen",
"imageTooLarge": "La imagen debe ser menor de 384 KB"
},
"apiKeys": {
"intro": "Una clave de API inicia sesión como tú, sin contraseña y sin caducar. Una clave funciona en todas partes — una clave no está ligada a una aplicación. Dar a cada dispositivo la suya solo sirve para poder cortar una sin tocar las demás. Envíala como",
"loading": "Cargando claves…",
"mintedTitle": "Clave para “{{name}}” — se muestra una sola vez",
"savedIt": "Ya la he guardado",
"copyKey": "Copiar clave",
"copied": "Clave copiada",
"copyFailed": "No se pudo copiar — selecciona y copia manualmente",
"newKey": "Nueva clave",
"namePlaceholder": "iPhone, app de Música, CLI del portátil…",
"create": "Crear",
"createFailed": "No se pudo crear la clave",
"noneYet": "Todavía no hay claves.",
"noneInUse": "No hay claves en uso.",
"revoked": "revocada",
"expired": "caducada",
"lastUsed": "usada por última vez el {{date}}",
"neverUsed": "nunca usada",
"forget": "Eliminar este registro",
"forgetFailed": "No se pudo eliminar",
"revoke": "Revocar",
"revokeDone": "Revocada — todo lo que usaba esa clave se ha desconectado",
"revokeFailed": "No se pudo revocar",
"hideDead": "Ocultar revocadas y caducadas",
"showDead": {
"one": "Mostrar {{count}} clave revocada o caducada",
"other": "Mostrar {{count}} claves revocadas o caducadas"
}
},
"voice": {
"label": "Voz",
"refresh": "Actualizar voces",
"serverDefault": "Predeterminada del servidor",
"hint": "Elige una voz para la conversión de texto a voz. Déjala en la predeterminada del servidor para usar la voz configurada por el administrador.",
"stop": "Detener",
"listen": "Escuchar"
},
"dock": {
"visible": "Visibles",
"hidden": "Ocultos",
"dragToShow": "Arrastra elementos aquí para mostrarlos en el dock",
"allVisible": "Todos los elementos visibles",
"reset": "Restaurar valores predeterminados"
},
"languages": {
"spokenLabel": "Idiomas que hablas",
"addLanguage": "Añadir un idioma...",
"defaultLabel": "Idioma predeterminado",
"defaultHint": "Se usa para la localización de la interfaz.",
"translateToLabel": "Traducir a",
"translateToHint": "Idioma de destino al traducir contenido que no hablas."
},
"changePassword": {
"currentPasswordLabel": "Contraseña actual",
"currentPasswordPlaceholder": "Contraseña actual",
"newPasswordLabel": "Nueva contraseña",
"newPasswordPlaceholder": "Nueva contraseña",
"confirmPasswordLabel": "Confirmar nueva contraseña",
"confirmPasswordPlaceholder": "Confirma la nueva contraseña",
"changeButton": "Cambiar contraseña",
"changingButton": "Cambiando...",
"passwordChanged": "Contraseña cambiada",
"passwordChangeFailed": "No se pudo cambiar la contraseña"
},
"models": {
"defaultModel": "Modelo predeterminado",
"sameAsChat": "Igual que el predeterminado del chat",
"taskDefaultsSaved": "Valores predeterminados de tareas guardados",
"saveFailed": "No se pudieron guardar los ajustes",
"defaultChat": "Modelo predeterminado del chat",
"defaultChatHint": "Se usa al iniciar un chat nuevo desde la pantalla de inicio",
"defaultProject": "Modelo predeterminado del proyecto",
"defaultProjectHint": "Se usa al iniciar un chat nuevo dentro de un dashboard de proyecto",
"defaultTask": "Modelo predeterminado de tareas",
"defaultTaskHint": "Se usa al ejecutar tareas desde el explorador de archivos",
"aiDefaultsSaved": "Valores predeterminados de modelos de IA guardados"
}
},
"sections": {
"profile": {
"label": "Perfil",
"hint": "avatar, nombre, correo electrónico",
"description": "Avatar, nombre y correo electrónico"
},
"changePassword": {
"label": "Cambiar contraseña",
"description": "Actualiza tu contraseña"
},
"apiKeys": {
"label": "Claves de API",
"hint": "claves que inician sesión como tú",
"description": "Claves que inician sesión como tú, revocables una a una"
},
"languages": {
"label": "Idiomas",
"hint": "hablados y traducción",
"description": "Hablados, predeterminado y traducción"
},
"voice": {
"label": "Voz",
"hint": "conversión de texto a voz",
"description": "Preferencia de voz para la conversión de texto a voz"
},
"dock": {
"label": "Dock",
"hint": "elegir y reordenar",
"description": "Elige y reordena los elementos del dock"
},
"myModels": {
"label": "Mis modelos",
"description": "Muestra u oculta modelos solo para ti"
},
"channelModels": {
"label": "Modelos del canal",
"description": "Modelos accesibles para cuentas que no son del propietario"
},
"defaultModels": {
"label": "Modelos predeterminados",
"description": "Modelos predeterminados para chat, proyectos y tareas"
},
"providers": {
"label": "Proveedores",
"hint": "harnesses",
"description": "Proveedores de IA remotos y locales"
},
"tts": {
"label": "Texto a voz",
"description": "Proveedor de TTS y voz"
},
"stt": {
"label": "Voz a texto",
"description": "URL del servidor Whisper"
},
"ocr": {
"label": "OCR",
"description": "Modelo de visión para extracción de texto"
},
"maintenance": {
"label": "Reconstruir y reiniciar",
"hint": "mantenimiento",
"description": "Carga los cambios sin usar un terminal"
},
"smtp": {
"label": "SMTP",
"hint": "correo saliente",
"description": "Proveedor de entrega de correo electrónico"
},
"googleOauth": {
"label": "Google OAuth",
"description": "Client ID y secret para las APIs de Google"
},
"apify": {
"label": "Apify",
"description": "Token de API para actores de web scraping"
},
"davSync": {
"label": "Sincronización de Calendario y Contactos",
"hint": "contraseñas de aplicación",
"description": "Contraseñas por dispositivo para clientes CalDAV/CardDAV"
},
"accounts": {
"label": "Cuentas",
"hint": "usuarios",
"description": "Quién tiene acceso, y con qué función"
},
"permissions": {
"label": "Permisos",
"description": "Lo que cada función puede alcanzar"
}
},
"searchPlaceholder": "Buscar ajustes…",
"selectSection": "Selecciona una sección",
"groups": {
"models": "Modelos",
"defaults": "Predeterminados",
"providers": "Proveedores",
"ai": "IA",
"maintenance": "Mantenimiento",
"email": "Correo electrónico"
},
"nav": {
"profile": "Perfil",
"ai": "IA",
"system": "Sistema",
"integrations": "Integraciones",
"users": "Usuarios"
},
"ai": {
"noModels": "No hay modelos disponibles. Configura las claves de API en Proveedores.",
"dragToShow": "Arrastra modelos aquí para mostrarlos",
"allVisible": "Todos los modelos visibles",
"dragToEnable": "Arrastra modelos aquí para activarlos",
"allEnabled": "Todos los modelos activados",
"visible": "Visibles",
"hidden": "Ocultos",
"enabled": "Activados",
"disabled": "Desactivados",
"refresh": "Actualizar modelos desde los proveedores",
"refreshed": "Modelos actualizados",
"refreshFailed": "No se pudieron actualizar los modelos"
},
"integrations": {
"enterprise": "Empresa",
"personal": "Personal"
},
"server": {
"loading": "Cargando…",
"provider": "Proveedor",
"model": "Modelo",
"voice": "Voz",
"ocr": {
"serverUrl": "URL del servidor del modelo de visión",
"refreshModels": "Actualizar modelos",
"selectModel": "Selecciona un modelo",
"saved": "Ajustes de OCR guardados",
"saveFailed": "No se pudieron guardar los ajustes de OCR",
"reachable": "El servidor del modelo de visión está accesible"
},
"stt": {
"serverUrl": "URL del servidor Whisper",
"saved": "Ajustes de STT guardados",
"saveFailed": "No se pudieron guardar los ajustes de STT",
"reachable": "El servidor Whisper está accesible"
},
"tts": {
"openaiCompatible": "Compatible con OpenAI (Kokoro, OpenAI, etc.)",
"elevenLabs": "ElevenLabs",
"refreshVoices": "Actualizar voces",
"selectVoice": "Selecciona una voz",
"saved": "Ajustes de TTS guardados",
"saveFailed": "No se pudieron guardar los ajustes de TTS",
"playing": "Reproduciendo audio de prueba",
"testFailed": "La prueba falló — no se pudo contactar con el servidor de TTS"
},
"smtp": {
"mailhog": "MailHog (pruebas locales)",
"resend": "Resend",
"custom": "SMTP personalizado",
"apiKey": "Clave de API",
"host": "Host",
"port": "Puerto",
"username": "Nombre de usuario",
"password": "Contraseña",
"tls": "TLS / SSL",
"fromName": "Nombre del remitente",
"fromEmail": "Correo del remitente",
"sendTest": "Enviar correo de prueba",
"userExample": "usuario@ejemplo.com",
"recipientExample": "destinatario@ejemplo.com",
"saved": "Ajustes de SMTP guardados",
"saveFailed": "No se pudieron guardar los ajustes de SMTP",
"connected": "Conexión correcta",
"testSent": "Correo de prueba enviado a {{email}}"
},
"maintenance": {
"updateTitle": "Actualizar la plataforma",
"updateHint": "No cambia nada que esté en ejecución. Lo que la actualización necesita se indica aquí, y la decisión es tuya.",
"rebuild": "Reconstruir el frontend",
"restart": "Reiniciar el servidor",
"upToDate": "Ya está actualizado",
"rebuilt": "Frontend reconstruido — actualiza esta página para verlo",
"restarting": "Reiniciando — la página se reconectará sola",
"pulled": {
"one": "Se obtuvo {{count}} commit",
"other": "Se obtuvieron {{count}} commits"
}
},
"harnesses": {
"piMono": "Pi Mono",
"checking": "Comprobando…",
"localProviders": "Proveedores locales",
"remoteProviders": "Proveedores remotos",
"connect": "Conectar",
"authenticate": "Autenticar",
"connectLocal": "Conectar proveedor local",
"connectProvider": "Conectar proveedor",
"none": "No se encontraron proveedores.",
"updatePiMono": "Actualizar Pi Mono",
"removeProvider": "Eliminar proveedor",
"namePlaceholder": "Nombre (p. ej. Mi Ollama)",
"username": "Nombre de usuario",
"password": "Contraseña",
"apiKey": "Clave de API",
"editKey": "Editar clave",
"disconnect": "Desconectar proveedor",
"saveKey": "Guardar clave",
"enterKey": "Introduce la clave de API",
"search": "Buscar proveedores…",
"connectFailed": "No se pudo conectar",
"authFailed": "La autenticación falló",
"saveFailed": "No se pudo guardar el proveedor",
"connectedTo": "Conectado a {{name}}"
}
},
"users": {
"loadingPermissions": "Cargando permisos…",
"permissionsFailed": "No se pudieron cargar los permisos.",
"deniedUnlessGranted": "Todo está denegado a menos que se conceda aquí.",
"read": "Lectura",
"full": "Total",
"noAccess": "Sin acceso",
"role": "Función",
"permissionsSaved": "Guardado lo que pueden alcanzar los {{role}}",
"copyBeforeClosing": "Copia lo que necesites antes de cerrar — nada de esto se puede volver a mostrar.",
"password": "Contraseña",
"linuxAccount": "Cuenta Linux",
"sshKey": "Su clave pública SSH",
"addToGitea": "Añade esto a su cuenta de Gitea",
"linuxIncomplete": "La cuenta funciona, pero su parte Linux no terminó de configurarse",
"done": "Hecho",
"addAccount": "Añadir cuenta",
"newAccount": "Nueva cuenta",
"email": "Correo electrónico",
"name": "Nombre",
"username": "Nombre de usuario",
"usernameHint": "Letras, números, puntos, guiones y guiones bajos.",
"generatePassword": "Generar una contraseña",
"copyPassword": "Copiar la contraseña",
"passwordHint": "Al menos 12 caracteres, con mayúsculas y minúsculas, un número y un símbolo.",
"sshPlaceholder": "ssh-ed25519 AAAAC3Nza… ana@portatil",
"passwordCopied": "Contraseña copiada",
"loadingAccounts": "Cargando cuentas…",
"accountsFailed": "No se pudieron cargar las cuentas.",
"removeAccount": "Eliminar cuenta",
"generateNewPassword": "Generar una nueva contraseña",
"serverOwner": "Propietario del servidor",
"copySshTitle": "Copiar su clave pública SSH (añádela a su cuenta de Gitea)",
"resetPasswordTitle": "Generar una nueva contraseña — se muestra una sola vez, y cierra su sesión en todas partes",
"copyNewPassword": "Copiar la nueva contraseña",
"publicKeyCopied": "Clave pública copiada",
"copyFailed": "No se pudo copiar — selecciónala y copia a mano",
"repairFor": "Reparar la cuenta Linux de {{email}}",
"linuxAccountFor": "Cuenta Linux: {{osUser}} — haz clic para reparar o sustituir su clave SSH",
"copySshFor": "Copiar la clave pública SSH de {{email}}",
"resetPasswordFor": "Restablecer la contraseña de {{email}}",
"removeFor": "Eliminar {{email}}",
"provisionPrompt": "Cuenta Linux para {{email}}.\n\nPega una clave pública SSH para permitirle conectarse por SSH, o déjalo vacío para mantener la actual.",
"createLinux": "Crear una cuenta Linux",
"noLinux": "Sin cuenta Linux — haz clic para crear una",
"removeTitle": "¿Eliminar {{email}}?",
"removeBody": "Esto elimina la cuenta y todo lo que le pertenece — passkeys, dashboards, diseños guardados y todo lo que cualquier plugin instalado guarde para ella. No se puede deshacer.",
"resetTitle": "¿Restablecer la contraseña de {{email}}?",
"resetBody": "Se genera una nueva contraseña y se te muestra una sola vez — no se guarda en ningún sitio y no se puede consultar después. Su contraseña actual deja de funcionar de inmediato, y su sesión se cierra en todas partes.",
"resetLinuxNote": "Su cuenta Linux ({{osUser}}) no se ve afectada: no tiene contraseña, y las claves SSH no cambian."
},
"dav": {
"newDevice": "Nuevo dispositivo",
"create": "Crear",
"none": "Todavía no hay dispositivos.",
"placeholder": "Pixel 9, iPad, Thunderbird…",
"revoke": "Revocar",
"delete": "Eliminar",
"copyFailed": "No se pudo copiar — selecciona y copia manualmente",
"createFailed": "No se pudo crear la contraseña de aplicación",
"revoked": "Revocada — ese dispositivo dejará de sincronizar",
"revokeFailed": "No se pudo revocar",
"deleteFailed": "No se pudo eliminar",
"copyField": "Copiar {{field}}",
"copied": "{{what}} copiado"
},
"google": {
"guideToggle": "Guía de configuración paso a paso",
"step1": {
"title": "Crear un proyecto de Google Cloud",
"body": "Abre la página de creación de proyectos, dale un nombre (por ejemplo “Officer”) y haz clic en:",
"link": "New Project"
},
"step2": {
"title": "Activar las APIs",
"body": "Abre la biblioteca de APIs, busca cada una de estas y haz clic en:",
"link": "API Library"
},
"step3": {
"title": "Configurar la pantalla de consentimiento de OAuth",
"link": "OAuth Branding",
"appName": "Pon el nombre de tu organización, o “Officer”, como:",
"supportEmail": "Pon el correo del administrador como:",
"devContact": "Añade el correo del administrador en:",
"save": "Después haz clic en:"
},
"step4": {
"title": "Definir la audiencia",
"link": "OAuth Audience",
"internal": "Si tu equipo usa Google Workspace, elige — no hace falta verificación:",
"external": "En caso contrario elige, y añade los correos de tu equipo en Test users (obligatorio mientras la aplicación no esté verificada; límite de 100 usuarios de prueba):"
},
"step5": {
"title": "Añadir ámbitos",
"link": "Data Access",
"body": "Abre el acceso a datos, busca y añade los ámbitos de abajo, y luego haz clic en:",
"note": "Google clasifica el ámbito del calendario como sensible y el de Gmail como restringido. Eso no es un problema para aplicaciones Internal (Google Workspace) ni para aplicaciones External en modo de prueba; publicar en producción con ámbitos restringidos requiere verificación de Google."
},
"step6": {
"title": "Crear credenciales OAuth",
"link": "Clients",
"body": "Abre la página de clientes y haz clic en:",
"appType": "Tipo de aplicación:",
"nameAnything": "Nombre: el que quieras (por ejemplo “Officer”)",
"redirectUris": "Authorized redirect URIs — añade:",
"thenClick": "Después haz clic en:"
},
"step7": {
"title": "Copiar las credenciales",
"body": "Un cuadro de diálogo muestra tu client ID y tu client secret. Copia ambos y pégalos en los campos de abajo."
},
"scopeGmail": "Leer correos",
"scopeCalendar": "Leer eventos del calendario",
"verifying": "Verificando credenciales…",
"valid": "Credenciales válidas",
"invalid": "Credenciales no válidas",
"verifyFailed": "La solicitud de verificación falló",
"clientId": "Client ID",
"clientSecret": "Client Secret",
"redirectUri": "URI de redirección",
"redirectUriHint": "Añade este URI a los URIs de redirección autorizados de tu cliente OAuth de Google",
"saved": "Configuración de Google OAuth guardada",
"saveFailed": "No se pudo guardar la configuración de Google OAuth"
},
"googleAccount": {
"title": "Cuenta de Google",
"hint": "Conecta tu cuenta de Google para Calendario, Contactos y otros servicios de Google.",
"connected": "Conectada",
"disconnect": "Desconectar",
"connect": "Conectar cuenta de Google",
"connectedToast": "Cuenta de Google conectada",
"connectFailed": "No se pudo conectar la cuenta de Google",
"disconnectedToast": "Cuenta de Google desconectada",
"disconnectFailed": "No se pudo desconectar la cuenta de Google"
},
"apify": {
"token": "Token de API",
"saved": "Token de API de Apify guardado",
"saveFailed": "No se pudo guardar el token de API de Apify"
}
},
"header": {
"userMenu": {
"profile": "Perfil",
"systemSettings": "Ajustes del sistema",
"signOut": "Cerrar sesión",
"ai": "IA",
"integrations": "Integraciones",
"userManagement": "Gestión de usuarios"
},
"tabName": "Nombre de la pestaña",
"tabNameHint": "Haz clic para renombrar esta pestaña — bórralo para volver al nombre de la página",
"logoAlt": "Officer",
"navigation": "Navegación",
"jobsRunning": "Trabajo en ejecución",
"jobsNothingRunning": "Nada en ejecución",
"jobsQueued": "Trabajos en cola"
},
"nav": {
"home": "Inicio",
"files": "Archivos",
"chat": "Chat",
"commandHq": "Command HQ",
"editor": "Editor",
"jobs": "Trabajos",
"terminal": "Terminal",
"browser": "Navegador",
"monitor": "Monitor",
"activity": "Actividad",
"dashboards": "Dashboards",
"sendOff": "SendOff",
"calendar": "Calendario",
"contacts": "Contactos",
"appStore": "Tienda de aplicaciones",
"marketplace": "Marketplace",
"codeEditor": "Editor de código"
},
"theme": {
"pillTitle": "Tema: {{name}} · ctrl+shift+←/→ recorrer · ctrl+shift+space explorar · ctrl+shift+f {{starAction}}",
"pillLabel": "Tema: {{name}}",
"star": "marcar",
"unstar": "desmarcar",
"cycleHint": "ctrl+shift+←/→ recorrer · ctrl+shift+space explorar",
"everyShortcutHint": "ctrl+? para todos los atajos",
"favouritesOnly": "Solo favoritos ({{count}})",
"favourites": "Favoritos ({{count}})",
"noFavourites": "Todavía no hay favoritos — marca uno con el botón de su fila.",
"starNamed": "Marcar {{name}}",
"unstarNamed": "Desmarcar {{name}}",
"addToFavourites": "Añadir a favoritos",
"removeFromFavourites": "Quitar de favoritos",
"addToFavouritesKey": "Añadir a favoritos (f)",
"removeFromFavouritesKey": "Quitar de favoritos (f)",
"active": "activo",
"browseHint": "j/k o ↑/↓ mover · l o → previsualizar · f marcar · h o ← reiniciar · enter mantener · esc cancelar"
},
"spotlight": {
"placeholder": "Ir a…",
"noResults": "Nada coincide con “{{query}}”."
},
"shortcutsModal": {
"title": "Atajos de teclado",
"hint": "Ctrl+? · Esc para cerrar"
},
"screenError": {
"title": "Esta pantalla no se pudo mostrar",
"description": "No se ha perdido nada — este es un fallo de visualización, no de datos. Las transcripciones del agente, los trabajos y los archivos están intactos.",
"unknownError": "Error desconocido",
"tryAgain": "Reintentar",
"reload": "Recargar",
"goHome": "Ir al inicio",
"resetHint": "Si vuelve a fallar en el mismo sitio, la causa habitual es un diseño de panel guardado. Reiniciar devuelve los paneles de todas las pantallas a sus valores predeterminados.",
"dashboardsSafe": "Tus dashboards no se ven afectados.",
"resetting": "Reiniciando…",
"resetConfirm": "Sí — reiniciar el diseño de todas las pantallas",
"reset": "Reiniciar diseños de pantallas"
},
"rescan": {
"label": "Reanalizar elementos",
"title": "Reanalizar officer-items (aplicar cambios sin reiniciar)",
"failed": "No se pudieron reanalizar los elementos",
"done": "Elementos reanalizados — {{summary}}",
"counts": {
"tasks": {
"one": "{{count}} tarea",
"other": "{{count}} tareas"
},
"agents": {
"one": "{{count}} agente",
"other": "{{count}} agentes"
},
"tools": {
"one": "{{count}} herramienta",
"other": "{{count}} herramientas"
},
"skills": {
"one": "{{count}} skill",
"other": "{{count}} skills"
},
"processes": {
"one": "{{count}} proceso",
"other": "{{count}} procesos"
},
"affordances": {
"one": "{{count}} affordance",
"other": "{{count}} affordances"
}
},
"newChatsOnly": "Se aplica a los chats nuevos — uno abierto mantiene lo que tenía al empezar.",
"noDescription": {
"one": "{{count}} skill no tiene descripción, así que no se ofrece a ningún agente.",
"other": "{{count}} skills no tienen descripción, así que no se ofrecen a ningún agente."
}
},
"bugReport": {
"label": "Informar de un error",
"title": "Informar de un error",
"describePlaceholder": "Describe qué ha ido mal...",
"screenshot": "Captura de pantalla",
"noScreenshot": "No se obtuvo ninguna captura de pantalla",
"collectedNote": "Los registros de la consola, la información del navegador y los errores recientes de la API se recogen automáticamente.",
"submitted": "Informe de error enviado",
"failed": "No se pudo enviar el informe de error",
"submit": "Enviar"
},
"auth": {
"signInTitle": "Bienvenido de nuevo",
"signInSubtitle": "Inicia sesión en tu cuenta",
"emailOrUsername": "Correo electrónico o nombre de usuario",
"password": "Contraseña",
"forgotPassword": "¿Olvidaste tu contraseña?",
"emailPlaceholder": "tu@ejemplo.com",
"passwordPlaceholder": "Tu contraseña",
"forgotTitle": "Recuperar contraseña",
"forgotSubtitle": "Introduce tu correo electrónico para recibir un enlace de restablecimiento",
"email": "Correo electrónico",
"backToLogin": "Volver al inicio de sesión",
"checkEmail": "Revisa tu correo electrónico",
"checkEmailHint": "Haz clic en él para restablecer tu contraseña.",
"resetOk": "Contraseña restablecida correctamente. Inicia sesión.",
"verifying": "Verificando…",
"invalidLink": "Enlace no válido",
"invalidLinkHint": "Este enlace de restablecimiento no es válido o ha caducado.",
"resetTitle": "Restablecer contraseña",
"resetSubtitle": "Introduce tu nueva contraseña",
"confirmPassword": "Confirmar contraseña",
"minChars": "Mínimo 12 caracteres",
"confirmPlaceholder": "Confirma tu contraseña",
"bootstrapTitle": "Bienvenido, administrador",
"bootstrapSubtitle": "Crea tu cuenta de administrador",
"name": "Nombre",
"username": "Nombre de usuario",
"namePlaceholder": "Tu nombre",
"adminEmailPlaceholder": "admin@ejemplo.com",
"bootstrapOk": "Cuenta de administrador creada. Inicia sesión.",
"debug": {
"controls": "Controles:",
"camera": "Cámara:",
"model": "Modelo:"
}
},
"shortcuts": {
"navigation": "Navegación",
"spotlight": "Spotlight — ve a cualquier pantalla, plugin o ajuste por su nombre",
"thisList": "Esta lista",
"themes": "Temas",
"themesNote": "El explorador aplica el tema a medida que te mueves, para que veas la aplicación cambiar en vez de leer nombres.",
"openBrowser": "Abrir el explorador de temas",
"prevNextTheme": "Tema anterior / siguiente, sin abrir nada",
"starCurrent": "Marcar o desmarcar el tema actual, desde cualquier lugar",
"inBrowser": "En el explorador de temas",
"moveList": "Moverse por la lista",
"applyKeepBrowsing": "Aplicar el tema enfocado y seguir explorando",
"restoreStart": "Volver al tema con el que empezaste",
"starFocused": "Marcar o desmarcar el tema enfocado",
"keepLooking": "Mantener lo que estás viendo",
"cancelRestore": "Cancelar y restaurar",
"inSpotlight": "En Spotlight",
"moveResults": "Moverse por los resultados",
"goThere": "Ir allí",
"close": "Cerrar",
"chat": "Chat",
"chatNote": "La recuperación solo usa la tecla de flecha en un compositor VACÍO, y cualquier otra tecla termina la recuperación — así que un borrador nunca se sobrescribe.",
"prevNextPrompt": "Prompt anterior / siguiente que enviaste, al estilo de una shell",
"send": "Enviar · en un compositor vacío con algo en cola, envía eso ahora",
"newline": "Salto de línea",
"stopTurn": "Detener el turno que se está generando"
},
"jobs": {
"runningQueued": "En ejecución y en cola",
"loading": "Cargando…",
"nothingRunning": "Nada en ejecución",
"history": "Historial",
"clearAll": "Limpiar todo",
"selectJob": "Selecciona un trabajo",
"notFound": "Trabajo no encontrado.",
"backToJobs": "Volver a trabajos",
"stop": "Detener",
"testNotification": "Enviar una notificación de prueba a todos los canales configurados",
"search": "Buscar…",
"deleteFinished": "Eliminar todos los trabajos terminados",
"noChannels": "No hay canales configurados",
"notifyFailed": "No se pudo enviar la notificación",
"stopRequested": "Detención solicitada",
"stopFailed": "No se pudo detener",
"titles": "Títulos",
"download": "Descargar",
"input": "Entrada",
"output": "Salida",
"steps": "Pasos",
"selectStep": "Selecciona un paso o subtarea para ver la salida",
"noOutput": "Todavía no hay salida",
"tokens": "Tokens:",
"cost": "Coste:",
"status": {
"running": "En ejecución",
"queued": "En cola",
"completed": "Completado",
"failed": "Fallido",
"stopped": "Detenido",
"interrupted": "Interrumpido"
},
"failedWithCode": "Fallido (salida {{code}})"
},
"activity": {
"title": "Actividad",
"backgroundTasks": "Tareas en segundo plano",
"detached": "Separada",
"backToList": "Volver a la lista",
"selectTask": "Selecciona una tarea para seguir su salida en directo",
"noneRunning": "ninguna en ejecución"
},
"passkeyGate": {
"setUp": "Configura tu passkey"
},
"chatHistory": {
"loadFailed": "No se pudo cargar esta conversación: {{reason}}"
},
"capability": {
"frontmatter": "Frontmatter",
"noMatches": "Sin coincidencias",
"emptyFile": "Archivo vacío",
"createFailed": "No se pudo crear el {{kind}}",
"deleteFailed": "No se pudo eliminar el {{kind}}",
"searchPlaceholder": "Buscar {{kind}}…",
"selectOne": "Selecciona un {{kind}}",
"selectToView": "Selecciona un {{kind}} para ver su contenido",
"delete": "Eliminar",
"createPrompt": "Ayúdame a crear el contenido de este nuevo archivo de {{kind}}",
"improvePrompt": "Ayúdame a entender y mejorar este archivo de {{kind}}"
}
}
+704
View File
@@ -0,0 +1,704 @@
{
"common": {
"save": "Enregistrer",
"saving": "Enregistrement...",
"cancel": "Annuler"
},
"settings": {
"profile": {
"userData": {
"email": "E-mail",
"username": "Nom d'utilisateur",
"name": "Nom",
"namePlaceholder": "Votre nom",
"updated": "Profil mis à jour",
"updateFailed": "Échec de la mise à jour du profil",
"selectImage": "Veuillez sélectionner un fichier image",
"imageTooLarge": "L'image doit faire moins de 384 Ko"
},
"apiKeys": {
"intro": "Une clé API vous connecte comme vous-même, sans mot de passe et sans expirer. Une clé fonctionne partout — une clé n'est pas liée à une application. Donner sa propre clé à chaque appareil sert seulement à pouvoir en couper une sans toucher aux autres. Envoyez-la comme",
"loading": "Chargement des clés…",
"mintedTitle": "Clé pour “{{name}}” — affichée une seule fois",
"savedIt": "Je l'ai enregistrée",
"copyKey": "Copier la clé",
"copied": "Clé copiée",
"copyFailed": "Impossible de copier — sélectionnez et copiez manuellement",
"newKey": "Nouvelle clé",
"namePlaceholder": "iPhone, application Musique, CLI du portable…",
"create": "Créer",
"createFailed": "Impossible de créer la clé",
"noneYet": "Aucune clé pour l'instant.",
"noneInUse": "Aucune clé utilisée.",
"revoked": "révoquée",
"expired": "expirée",
"lastUsed": "dernière utilisation {{date}}",
"neverUsed": "jamais utilisée",
"forget": "Supprimer cet enregistrement",
"forgetFailed": "Impossible de le supprimer",
"revoke": "Révoquer",
"revokeDone": "Révoquée — tout ce qui utilisait cette clé est déconnecté",
"revokeFailed": "Impossible de révoquer",
"hideDead": "Masquer les révoquées et expirées",
"showDead": {
"one": "Afficher {{count}} clé révoquée ou expirée",
"other": "Afficher {{count}} clés révoquées ou expirées"
}
},
"voice": {
"label": "Voix",
"refresh": "Actualiser les voix",
"serverDefault": "Valeur par défaut du serveur",
"hint": "Choisissez une voix pour la synthèse vocale. Laissez la valeur par défaut du serveur pour utiliser la voix configurée par l'administrateur.",
"stop": "Arrêter",
"listen": "Écouter"
},
"dock": {
"visible": "Visibles",
"hidden": "Masqués",
"dragToShow": "Faites glisser des éléments ici pour les afficher dans le Dock",
"allVisible": "Tous les éléments sont visibles",
"reset": "Rétablir les valeurs par défaut"
},
"languages": {
"spokenLabel": "Langues que vous parlez",
"addLanguage": "Ajouter une langue...",
"defaultLabel": "Langue par défaut",
"defaultHint": "Utilisée pour la localisation de l'interface.",
"translateToLabel": "Traduire vers",
"translateToHint": "Langue cible pour traduire le contenu que vous ne parlez pas."
},
"changePassword": {
"currentPasswordLabel": "Mot de passe actuel",
"currentPasswordPlaceholder": "Mot de passe actuel",
"newPasswordLabel": "Nouveau mot de passe",
"newPasswordPlaceholder": "Nouveau mot de passe",
"confirmPasswordLabel": "Confirmer le nouveau mot de passe",
"confirmPasswordPlaceholder": "Confirmez le nouveau mot de passe",
"changeButton": "Changer le mot de passe",
"changingButton": "Modification...",
"passwordChanged": "Mot de passe modifié",
"passwordChangeFailed": "Échec de la modification du mot de passe"
},
"models": {
"defaultModel": "Modèle par défaut",
"sameAsChat": "Identique à la valeur par défaut du Chat",
"taskDefaultsSaved": "Valeurs par défaut des tâches enregistrées",
"saveFailed": "Échec de l'enregistrement des paramètres",
"defaultChat": "Modèle par défaut du Chat",
"defaultChatHint": "Utilisé au démarrage d'un nouveau Chat depuis l'écran d'accueil",
"defaultProject": "Modèle par défaut du projet",
"defaultProjectHint": "Utilisé au démarrage d'un nouveau Chat dans un Dashboard de projet",
"defaultTask": "Modèle par défaut des tâches",
"defaultTaskHint": "Utilisé lors de l'exécution de tâches depuis l'explorateur de fichiers",
"aiDefaultsSaved": "Valeurs par défaut des modèles IA enregistrées"
}
},
"sections": {
"profile": {
"label": "Profil",
"hint": "avatar, nom, e-mail",
"description": "Avatar, nom et e-mail"
},
"changePassword": {
"label": "Changer le mot de passe",
"description": "Mettez à jour votre mot de passe"
},
"apiKeys": {
"label": "Clés API",
"hint": "clés qui vous connectent comme vous-même",
"description": "Clés qui vous connectent comme vous-même, révocables une à une"
},
"languages": {
"label": "Langues",
"hint": "parlées et traduction",
"description": "Parlées, par défaut et traduction"
},
"voice": {
"label": "Voix",
"hint": "synthèse vocale",
"description": "Préférence de voix pour la synthèse vocale"
},
"dock": {
"label": "Dock",
"hint": "choisir et réorganiser",
"description": "Choisir et réorganiser les éléments du Dock"
},
"myModels": {
"label": "Mes modèles",
"description": "Afficher ou masquer des modèles pour vous-même"
},
"channelModels": {
"label": "Modèles du canal",
"description": "Modèles accessibles aux comptes non propriétaires"
},
"defaultModels": {
"label": "Modèles par défaut",
"description": "Modèles par défaut pour le Chat, les projets et les tâches"
},
"providers": {
"label": "Fournisseurs",
"hint": "harnesses",
"description": "Fournisseurs d'IA distants et locaux"
},
"tts": {
"label": "Synthèse vocale",
"description": "Fournisseur et voix pour la synthèse vocale"
},
"stt": {
"label": "Reconnaissance vocale",
"description": "URL du serveur Whisper"
},
"ocr": {
"label": "OCR",
"description": "Modèle de vision pour l'extraction de texte"
},
"maintenance": {
"label": "Reconstruire et redémarrer",
"hint": "maintenance",
"description": "Charger les modifications sans terminal"
},
"smtp": {
"label": "SMTP",
"hint": "courrier sortant",
"description": "Fournisseur de distribution d'e-mails"
},
"googleOauth": {
"label": "Google OAuth",
"description": "Client ID et secret pour les API Google"
},
"apify": {
"label": "Apify",
"description": "Jeton API pour les acteurs de web scraping"
},
"davSync": {
"label": "Synchronisation Calendrier et Contacts",
"hint": "mots de passe d'application",
"description": "Mots de passe par appareil pour les clients CalDAV/CardDAV"
},
"accounts": {
"label": "Comptes",
"hint": "utilisateurs",
"description": "Qui a accès, et à quoi"
},
"permissions": {
"label": "Permissions",
"description": "Ce que chaque rôle peut atteindre"
}
},
"searchPlaceholder": "Rechercher dans les paramètres…",
"selectSection": "Sélectionnez une section",
"groups": {
"models": "Modèles",
"defaults": "Valeurs par défaut",
"providers": "Fournisseurs",
"ai": "IA",
"maintenance": "Maintenance",
"email": "E-mail"
},
"nav": {
"profile": "Profil",
"ai": "IA",
"system": "Système",
"integrations": "Intégrations",
"users": "Utilisateurs"
},
"ai": {
"noModels": "Aucun modèle disponible. Configurez les clés API dans Fournisseurs.",
"dragToShow": "Faites glisser des modèles ici pour les afficher",
"allVisible": "Tous les modèles sont visibles",
"dragToEnable": "Faites glisser des modèles ici pour les activer",
"allEnabled": "Tous les modèles sont activés",
"visible": "Visibles",
"hidden": "Masqués",
"enabled": "Activés",
"disabled": "Désactivés",
"refresh": "Actualiser les modèles depuis les fournisseurs",
"refreshed": "Modèles actualisés",
"refreshFailed": "Échec de l'actualisation des modèles"
},
"integrations": {
"enterprise": "Entreprise",
"personal": "Personnel"
},
"server": {
"loading": "Chargement…",
"provider": "Fournisseur",
"model": "Modèle",
"voice": "Voix",
"ocr": {
"serverUrl": "URL du serveur du modèle de vision",
"refreshModels": "Actualiser les modèles",
"selectModel": "Sélectionnez un modèle",
"saved": "Paramètres OCR enregistrés",
"saveFailed": "Échec de l'enregistrement des paramètres OCR",
"reachable": "Le serveur du modèle de vision est accessible"
},
"stt": {
"serverUrl": "URL du serveur Whisper",
"saved": "Paramètres de reconnaissance vocale enregistrés",
"saveFailed": "Échec de l'enregistrement des paramètres de reconnaissance vocale",
"reachable": "Le serveur Whisper est accessible"
},
"tts": {
"openaiCompatible": "Compatible OpenAI (Kokoro, OpenAI, etc.)",
"elevenLabs": "ElevenLabs",
"refreshVoices": "Actualiser les voix",
"selectVoice": "Sélectionnez une voix",
"saved": "Paramètres de synthèse vocale enregistrés",
"saveFailed": "Échec de l'enregistrement des paramètres de synthèse vocale",
"playing": "Lecture de l'audio de test",
"testFailed": "Échec du test — impossible de joindre le serveur de synthèse vocale"
},
"smtp": {
"mailhog": "MailHog (test local)",
"resend": "Resend",
"custom": "SMTP personnalisé",
"apiKey": "Clé API",
"host": "Hôte",
"port": "Port",
"username": "Nom d'utilisateur",
"password": "Mot de passe",
"tls": "TLS / SSL",
"fromName": "Nom de l'expéditeur",
"fromEmail": "E-mail de l'expéditeur",
"sendTest": "Envoyer un e-mail de test",
"userExample": "utilisateur@exemple.com",
"recipientExample": "destinataire@exemple.com",
"saved": "Paramètres SMTP enregistrés",
"saveFailed": "Échec de l'enregistrement des paramètres SMTP",
"connected": "Connexion réussie",
"testSent": "E-mail de test envoyé à {{email}}"
},
"maintenance": {
"updateTitle": "Mettre à jour la plateforme",
"updateHint": "Ne change rien à ce qui est en cours d'exécution. Ce dont la mise à jour a besoin est listé ici, et le choix vous revient.",
"rebuild": "Reconstruire le frontend",
"restart": "Redémarrer le serveur",
"upToDate": "Déjà à jour",
"rebuilt": "Frontend reconstruit — actualisez cette page pour le voir",
"restarting": "Redémarrage — la page se reconnectera d'elle-même",
"pulled": {
"one": "{{count}} commit récupéré",
"other": "{{count}} commits récupérés"
}
},
"harnesses": {
"piMono": "Pi Mono",
"checking": "Vérification…",
"localProviders": "Fournisseurs locaux",
"remoteProviders": "Fournisseurs distants",
"connect": "Connecter",
"authenticate": "Authentifier",
"connectLocal": "Connecter un fournisseur local",
"connectProvider": "Connecter un fournisseur",
"none": "Aucun fournisseur trouvé.",
"updatePiMono": "Mettre à jour Pi Mono",
"removeProvider": "Supprimer le fournisseur",
"namePlaceholder": "Nom (ex. Mon Ollama)",
"username": "Nom d'utilisateur",
"password": "Mot de passe",
"apiKey": "Clé API",
"editKey": "Modifier la clé",
"disconnect": "Déconnecter le fournisseur",
"saveKey": "Enregistrer la clé",
"enterKey": "Saisissez la clé API",
"search": "Rechercher des fournisseurs…",
"connectFailed": "Échec de la connexion",
"authFailed": "Échec de l'authentification",
"saveFailed": "Échec de l'enregistrement du fournisseur",
"connectedTo": "Connecté à {{name}}"
}
},
"users": {
"loadingPermissions": "Chargement des permissions…",
"permissionsFailed": "Impossible de charger les permissions.",
"deniedUnlessGranted": "Tout est refusé sauf ce qui est accordé ici.",
"read": "Lecture",
"full": "Total",
"noAccess": "Aucun accès",
"role": "Rôle",
"permissionsSaved": "Ce que les {{role}} peuvent atteindre a été enregistré",
"copyBeforeClosing": "Copiez ce dont vous avez besoin avant de fermer — rien de tout cela ne peut être réaffiché.",
"password": "Mot de passe",
"linuxAccount": "Compte Linux",
"sshKey": "Leur clé publique SSH",
"addToGitea": "Ajoutez ceci à leur compte Gitea",
"linuxIncomplete": "Le compte fonctionne, mais sa partie Linux ne s'est pas terminée",
"done": "Terminé",
"addAccount": "Ajouter un compte",
"newAccount": "Nouveau compte",
"email": "E-mail",
"name": "Nom",
"username": "Nom d'utilisateur",
"usernameHint": "Lettres, chiffres, points, tirets et underscores.",
"generatePassword": "Générer un mot de passe",
"copyPassword": "Copier le mot de passe",
"passwordHint": "Au moins 12 caractères, avec majuscules et minuscules, un chiffre et un symbole.",
"sshPlaceholder": "ssh-ed25519 AAAAC3Nza… ana@portable",
"passwordCopied": "Mot de passe copié",
"loadingAccounts": "Chargement des comptes…",
"accountsFailed": "Impossible de charger les comptes.",
"removeAccount": "Supprimer le compte",
"generateNewPassword": "Générer un nouveau mot de passe",
"serverOwner": "Propriétaire du serveur",
"copySshTitle": "Copier leur clé publique SSH (ajoutez-la à leur compte Gitea)",
"resetPasswordTitle": "Générer un nouveau mot de passe — affiché une seule fois, et les déconnecte partout",
"copyNewPassword": "Copier le nouveau mot de passe",
"publicKeyCopied": "Clé publique copiée",
"copyFailed": "Impossible de copier — sélectionnez-la et copiez-la à la main",
"repairFor": "Réparer le compte Linux de {{email}}",
"linuxAccountFor": "Compte Linux : {{osUser}} — cliquez pour réparer ou remplacer sa clé SSH",
"copySshFor": "Copier la clé publique SSH de {{email}}",
"resetPasswordFor": "Réinitialiser le mot de passe de {{email}}",
"removeFor": "Supprimer {{email}}",
"provisionPrompt": "Compte Linux pour {{email}}.\n\nCollez une clé publique SSH pour lui permettre de se connecter en SSH, ou laissez vide pour conserver l'actuelle.",
"createLinux": "Créer un compte Linux",
"noLinux": "Aucun compte Linux — cliquez pour en créer un",
"removeTitle": "Supprimer {{email}} ?",
"removeBody": "Cela supprime le compte et tout ce qui lui appartient — passkeys, Dashboards, dispositions enregistrées, et tout ce qu'un plugin installé conserve pour lui. Cette action est irréversible.",
"resetTitle": "Réinitialiser le mot de passe de {{email}} ?",
"resetBody": "Un nouveau mot de passe est généré et vous est affiché une seule fois — il n'est stocké nulle part et ne peut plus être consulté ensuite. Son mot de passe actuel cesse de fonctionner immédiatement, et il est déconnecté partout.",
"resetLinuxNote": "Son compte Linux ({{osUser}}) n'est pas affecté : il n'a pas de mot de passe, et les clés SSH restent inchangées."
},
"dav": {
"newDevice": "Nouvel appareil",
"create": "Créer",
"none": "Aucun appareil pour l'instant.",
"placeholder": "Pixel 9, iPad, Thunderbird…",
"revoke": "Révoquer",
"delete": "Supprimer",
"copyFailed": "Impossible de copier — sélectionnez et copiez manuellement",
"createFailed": "Impossible de créer le mot de passe d'application",
"revoked": "Révoqué — cet appareil arrêtera de se synchroniser",
"revokeFailed": "Impossible de révoquer",
"deleteFailed": "Impossible de supprimer",
"copyField": "Copier {{field}}",
"copied": "{{what}} copié"
},
"google": {
"guideToggle": "Guide de configuration pas à pas",
"step1": {
"title": "Créer un projet Google Cloud",
"body": "Ouvrez la page de création de projet, donnez-lui un nom (par exemple “Officer”), et cliquez sur :",
"link": "New Project"
},
"step2": {
"title": "Activer les API",
"body": "Ouvrez la bibliothèque d'API, recherchez chacune d'entre elles, puis cliquez sur :",
"link": "API Library"
},
"step3": {
"title": "Configurer l'écran de consentement OAuth",
"link": "OAuth Branding",
"appName": "Définissez le nom de votre organisation, ou “Officer”, comme :",
"supportEmail": "Définissez l'e-mail de votre administrateur comme :",
"devContact": "Ajoutez l'e-mail de votre administrateur sous :",
"save": "Puis cliquez sur :"
},
"step4": {
"title": "Définir l'audience",
"link": "OAuth Audience",
"internal": "Si votre équipe utilise Google Workspace, choisissez — aucune vérification requise :",
"external": "Sinon choisissez, et ajoutez les e-mails de votre équipe sous Test users (obligatoire tant que l'application n'est pas vérifiée ; limite de 100 utilisateurs de test) :"
},
"step5": {
"title": "Ajouter des scopes",
"link": "Data Access",
"body": "Ouvrez l'accès aux données, recherchez et ajoutez les scopes ci-dessous, puis cliquez sur :",
"note": "Google classe le scope du calendrier comme sensible et celui de Gmail comme restreint. Cela ne pose pas de problème pour les applications Internal (Google Workspace) ni pour les applications External en mode test ; publier en production avec des scopes restreints nécessite une vérification par Google."
},
"step6": {
"title": "Créer des identifiants OAuth",
"link": "Clients",
"body": "Ouvrez la page des clients et cliquez sur :",
"appType": "Type d'application :",
"nameAnything": "Nom : n'importe lequel (par exemple “Officer”)",
"redirectUris": "URI de redirection autorisés — ajoutez :",
"thenClick": "Puis cliquez sur :"
},
"step7": {
"title": "Copier les identifiants",
"body": "Une boîte de dialogue affiche votre client ID et votre client secret. Copiez les deux et collez-les dans les champs ci-dessous."
},
"scopeGmail": "Lire les e-mails",
"scopeCalendar": "Lire les événements du calendrier",
"verifying": "Vérification des identifiants…",
"valid": "Identifiants valides",
"invalid": "Identifiants invalides",
"verifyFailed": "La demande de vérification a échoué",
"clientId": "Client ID",
"clientSecret": "Client Secret",
"redirectUri": "URI de redirection",
"redirectUriHint": "Ajoutez cet URI aux URI de redirection autorisés de votre client OAuth Google",
"saved": "Configuration Google OAuth enregistrée",
"saveFailed": "Échec de l'enregistrement de la configuration Google OAuth"
},
"googleAccount": {
"title": "Compte Google",
"hint": "Connectez votre compte Google pour le Calendrier, les Contacts et d'autres services Google.",
"connected": "Connecté",
"disconnect": "Déconnecter",
"connect": "Connecter le compte Google",
"connectedToast": "Compte Google connecté",
"connectFailed": "Échec de la connexion du compte Google",
"disconnectedToast": "Compte Google déconnecté",
"disconnectFailed": "Échec de la déconnexion du compte Google"
},
"apify": {
"token": "Jeton API",
"saved": "Jeton API Apify enregistré",
"saveFailed": "Échec de l'enregistrement du jeton API Apify"
}
},
"header": {
"userMenu": {
"profile": "Profil",
"systemSettings": "Paramètres système",
"signOut": "Se déconnecter",
"ai": "IA",
"integrations": "Intégrations",
"userManagement": "Gestion des utilisateurs"
},
"tabName": "Nom de l'onglet",
"tabNameHint": "Cliquez pour renommer cet onglet — videz-le pour revenir au nom de la page",
"logoAlt": "Officer",
"navigation": "Navigation",
"jobsRunning": "Job en cours",
"jobsNothingRunning": "Rien en cours",
"jobsQueued": "Jobs en file d'attente"
},
"nav": {
"home": "Accueil",
"files": "Fichiers",
"chat": "Chat",
"commandHq": "Command HQ",
"editor": "Éditeur",
"jobs": "Jobs",
"terminal": "Terminal",
"browser": "Navigateur",
"monitor": "Monitor",
"activity": "Activité",
"dashboards": "Dashboards",
"sendOff": "SendOff",
"calendar": "Calendrier",
"contacts": "Contacts",
"appStore": "Boutique d'applications",
"marketplace": "Marketplace",
"codeEditor": "Éditeur de code"
},
"theme": {
"pillTitle": "Thème : {{name}} · ctrl+shift+←/→ parcourir · ctrl+shift+space explorer · ctrl+shift+f {{starAction}}",
"pillLabel": "Thème : {{name}}",
"star": "marquer",
"unstar": "démarquer",
"cycleHint": "ctrl+shift+←/→ parcourir · ctrl+shift+space explorer",
"everyShortcutHint": "ctrl+? pour tous les raccourcis",
"favouritesOnly": "Favoris uniquement ({{count}})",
"favourites": "Favoris ({{count}})",
"noFavourites": "Aucun favori pour l'instant — marquez-en un avec le bouton sur sa ligne.",
"starNamed": "Marquer {{name}}",
"unstarNamed": "Démarquer {{name}}",
"addToFavourites": "Ajouter aux favoris",
"removeFromFavourites": "Retirer des favoris",
"addToFavouritesKey": "Ajouter aux favoris (f)",
"removeFromFavouritesKey": "Retirer des favoris (f)",
"active": "actif",
"browseHint": "j/k ou ↑/↓ déplacer · l ou → aperçu · f marquer · h ou ← réinitialiser · entrée garder · esc annuler"
},
"spotlight": {
"placeholder": "Aller à…",
"noResults": "Rien ne correspond à “{{query}}”."
},
"shortcutsModal": {
"title": "Raccourcis clavier",
"hint": "Ctrl+? · Échap pour fermer"
},
"screenError": {
"title": "Cet écran n'a pas pu s'afficher",
"description": "Rien n'a été perdu — c'est un échec d'affichage, pas un échec de données. Les transcriptions de l'agent, les jobs et les fichiers sont intacts.",
"unknownError": "Erreur inconnue",
"tryAgain": "Réessayer",
"reload": "Recharger",
"goHome": "Retour à l'accueil",
"resetHint": "Si cela échoue à nouveau au même endroit, une disposition de panneaux enregistrée en est généralement la cause. La réinitialisation remet les panneaux de tous les écrans à leurs valeurs par défaut.",
"dashboardsSafe": "Vos Dashboards ne sont pas touchés.",
"resetting": "Réinitialisation…",
"resetConfirm": "Oui — réinitialiser la disposition de tous les écrans",
"reset": "Réinitialiser les dispositions des écrans"
},
"rescan": {
"label": "Réanalyser les items",
"title": "Réanalyser officer-items (appliquer les changements sans redémarrer)",
"failed": "Échec de la réanalyse des items",
"done": "Items réanalysés — {{summary}}",
"counts": {
"tasks": {
"one": "{{count}} tâche",
"other": "{{count}} tâches"
},
"agents": {
"one": "{{count}} agent",
"other": "{{count}} agents"
},
"tools": {
"one": "{{count}} outil",
"other": "{{count}} outils"
},
"skills": {
"one": "{{count}} skill",
"other": "{{count}} skills"
},
"processes": {
"one": "{{count}} processus",
"other": "{{count}} processus"
},
"affordances": {
"one": "{{count}} affordance",
"other": "{{count}} affordances"
}
},
"newChatsOnly": "S'applique aux nouveaux Chats — un Chat déjà ouvert garde ce avec quoi il a démarré.",
"noDescription": {
"one": "{{count}} skill n'a pas de description, donc elle n'est proposée à aucun agent.",
"other": "{{count}} skills n'ont pas de description, donc elles ne sont proposées à aucun agent."
}
},
"bugReport": {
"label": "Signaler un bug",
"title": "Signaler un bug",
"describePlaceholder": "Décrivez ce qui s'est mal passé...",
"screenshot": "Capture d'écran",
"noScreenshot": "Aucune capture d'écran effectuée",
"collectedNote": "Les journaux de la console, les informations du navigateur et les erreurs API récentes sont collectés automatiquement.",
"submitted": "Signalement de bug envoyé",
"failed": "Échec de l'envoi du signalement de bug",
"submit": "Envoyer"
},
"auth": {
"signInTitle": "Content de vous revoir",
"signInSubtitle": "Connectez-vous à votre compte",
"emailOrUsername": "E-mail ou nom d'utilisateur",
"password": "Mot de passe",
"forgotPassword": "Mot de passe oublié ?",
"emailPlaceholder": "vous@exemple.com",
"passwordPlaceholder": "Votre mot de passe",
"forgotTitle": "Mot de passe oublié",
"forgotSubtitle": "Saisissez votre e-mail pour recevoir un lien de réinitialisation",
"email": "E-mail",
"backToLogin": "Retour à la connexion",
"checkEmail": "Consultez votre e-mail",
"checkEmailHint": "Cliquez dessus pour réinitialiser votre mot de passe.",
"resetOk": "Mot de passe réinitialisé avec succès. Veuillez vous connecter.",
"verifying": "Vérification…",
"invalidLink": "Lien invalide",
"invalidLinkHint": "Ce lien de réinitialisation est invalide ou a expiré.",
"resetTitle": "Réinitialiser le mot de passe",
"resetSubtitle": "Saisissez votre nouveau mot de passe",
"confirmPassword": "Confirmer le mot de passe",
"minChars": "12 caractères minimum",
"confirmPlaceholder": "Confirmez votre mot de passe",
"bootstrapTitle": "Bienvenue, Administrateur",
"bootstrapSubtitle": "Créez votre compte administrateur",
"name": "Nom",
"username": "Nom d'utilisateur",
"namePlaceholder": "Votre nom",
"adminEmailPlaceholder": "admin@exemple.com",
"bootstrapOk": "Compte administrateur créé. Veuillez vous connecter.",
"debug": {
"controls": "Contrôles :",
"camera": "Caméra :",
"model": "Modèle :"
}
},
"shortcuts": {
"navigation": "Navigation",
"spotlight": "Spotlight — aller à n'importe quel écran, plugin ou paramètre par son nom",
"thisList": "Cette liste",
"themes": "Thèmes",
"themesNote": "L'explorateur applique le thème au fur et à mesure que vous vous déplacez, pour que vous voyiez l'application changer plutôt que de lire des noms.",
"openBrowser": "Ouvrir l'explorateur de thèmes",
"prevNextTheme": "Thème précédent / suivant, sans rien ouvrir",
"starCurrent": "Marquer ou démarquer le thème actuel, depuis n'importe où",
"inBrowser": "Dans l'explorateur de thèmes",
"moveList": "Parcourir la liste",
"applyKeepBrowsing": "Appliquer le thème en focus et continuer à explorer",
"restoreStart": "Rétablir le thème sur lequel vous avez commencé",
"starFocused": "Marquer ou démarquer le thème en focus",
"keepLooking": "Garder ce que vous regardez",
"cancelRestore": "Annuler et restaurer",
"inSpotlight": "Dans Spotlight",
"moveResults": "Parcourir les résultats",
"goThere": "Y aller",
"close": "Fermer",
"chat": "Chat",
"chatNote": "Le rappel n'utilise la touche fléchée que sur un compositeur VIDE, et toute autre touche met fin au rappel — un brouillon n'est ainsi jamais écrasé.",
"prevNextPrompt": "Prompt précédent / suivant que vous avez envoyé, à la manière d'un shell",
"send": "Envoyer · sur un compositeur vide avec quelque chose en file, envoyer cela maintenant",
"newline": "Nouvelle ligne",
"stopTurn": "Arrêter le tour en cours de génération"
},
"jobs": {
"runningQueued": "En cours et en file d'attente",
"loading": "Chargement…",
"nothingRunning": "Rien en cours",
"history": "Historique",
"clearAll": "Tout effacer",
"selectJob": "Sélectionner un job",
"notFound": "Job introuvable.",
"backToJobs": "Retour aux jobs",
"stop": "Arrêter",
"testNotification": "Envoyer une notification de test à tous les canaux configurés",
"search": "Rechercher…",
"deleteFinished": "Supprimer tous les jobs terminés",
"noChannels": "Aucun canal configuré",
"notifyFailed": "Échec de l'envoi de la notification",
"stopRequested": "Arrêt demandé",
"stopFailed": "Échec de l'arrêt",
"titles": "Titres",
"download": "Télécharger",
"input": "Entrée",
"output": "Sortie",
"steps": "Étapes",
"selectStep": "Sélectionnez une étape ou une sous-tâche pour voir la sortie",
"noOutput": "Aucune sortie pour l'instant",
"tokens": "Tokens :",
"cost": "Coût :",
"status": {
"running": "En cours",
"queued": "En file d'attente",
"completed": "Terminé",
"failed": "Échoué",
"stopped": "Arrêté",
"interrupted": "Interrompu"
},
"failedWithCode": "Échoué (sortie {{code}})"
},
"activity": {
"title": "Activité",
"backgroundTasks": "Tâches en arrière-plan",
"detached": "Détachée",
"backToList": "Retour à la liste",
"selectTask": "Sélectionnez une tâche pour suivre sa sortie en direct",
"noneRunning": "aucune en cours"
},
"passkeyGate": {
"setUp": "Configurez votre passkey"
},
"chatHistory": {
"loadFailed": "Impossible de charger cette conversation : {{reason}}"
},
"capability": {
"frontmatter": "Frontmatter",
"noMatches": "Aucun résultat",
"emptyFile": "Fichier vide",
"createFailed": "Impossible de créer le {{kind}}",
"deleteFailed": "Impossible de supprimer le {{kind}}",
"searchPlaceholder": "Rechercher {{kind}}…",
"selectOne": "Sélectionnez un {{kind}}",
"selectToView": "Sélectionnez un {{kind}} pour voir son contenu",
"delete": "Supprimer",
"createPrompt": "Aide-moi à créer le contenu de ce nouveau fichier {{kind}}",
"improvePrompt": "Aide-moi à comprendre et améliorer ce fichier {{kind}}"
}
}
+7 -4
View File
@@ -2,11 +2,14 @@ import { describe, expect, test } from 'bun:test';
import { findMissingKeys } from 'i18n';
import en from './en-GB.json';
import ptPT from './pt-PT.json';
import frFR from './fr-FR.json';
import deDE from './de-DE.json';
import esES from './es-ES.json';
// D2: every shipped locale ships a COMPLETE catalog. A key en-GB has and pt-PT lacks is a red build,
// not a warning — there is no regional fallback to paper over the gap.
// D2: every shipped locale ships a COMPLETE catalog. A key en-GB has and another locale lacks is a red
// build, not a warning — there is no regional fallback to paper over the gap.
describe('officer-web (app.*) locale catalogs', () => {
test('pt-PT has every key en-GB has', () => {
expect(findMissingKeys(en, { 'pt-PT': ptPT })).toEqual([]);
test('every shipped locale has every key en-GB has', () => {
expect(findMissingKeys(en, { 'pt-PT': ptPT, 'fr-FR': frFR, 'de-DE': deDE, 'es-ES': esES })).toEqual([]);
});
});
+429 -26
View File
@@ -6,25 +6,67 @@
},
"settings": {
"profile": {
"searchPlaceholder": "Pesquisar definições...",
"sections": {
"profileTitle": "Perfil",
"profileDescription": "Atualiza o teu nome e avatar.",
"changePasswordTitle": "Alterar Palavra-passe",
"changePasswordDescription": "Atualiza a palavra-passe da tua conta.",
"tasksTitle": "Tarefas",
"tasksDescription": "Modelo predefinido para tarefas do explorador de ficheiros.",
"languagesTitle": "Idiomas",
"languagesDescription": "Define os teus idiomas e preferências de tradução."
},
"userData": {
"emailLabel": "Email",
"nameLabel": "Nome",
"namePlaceholder": "O teu nome",
"profileUpdated": "Perfil atualizado",
"profileUpdateFailed": "Falha ao atualizar perfil",
"selectImageFile": "Por favor seleciona um ficheiro de imagem",
"imageTooLarge": "A imagem deve ter menos de 384KB"
"email": "Email",
"username": "Nome de utilizador",
"name": "Nome",
"namePlaceholder": "O seu nome",
"updated": "Perfil atualizado",
"updateFailed": "Falha ao atualizar o perfil",
"selectImage": "Selecione um ficheiro de imagem",
"imageTooLarge": "A imagem tem de ser menor do que 384KB"
},
"apiKeys": {
"intro": "Uma chave de API inicia sessão como você, sem palavra-passe e sem expirar. Uma chave funciona em todo o lado — uma chave não está associada a uma aplicação. Dar a cada dispositivo a sua própria chave serve apenas para poder cortar uma sem mexer nas restantes. Envie-a como",
"loading": "A carregar chaves…",
"mintedTitle": "Chave para “{{name}}” — mostrada uma única vez",
"savedIt": "Já a guardei",
"copyKey": "Copiar chave",
"copied": "Chave copiada",
"copyFailed": "Não foi possível copiar — selecione e copie manualmente",
"newKey": "Nova chave",
"namePlaceholder": "iPhone, aplicação Música, CLI do portátil…",
"create": "Criar",
"createFailed": "Não foi possível criar a chave",
"noneYet": "Ainda não há chaves.",
"noneInUse": "Nenhuma chave em uso.",
"revoked": "revogada",
"expired": "expirada",
"lastUsed": "usada pela última vez em {{date}}",
"neverUsed": "nunca usada",
"forget": "Remover este registo",
"forgetFailed": "Não foi possível remover",
"revoke": "Revogar",
"revokeDone": "Revogada — tudo o que usava essa chave foi desligado",
"revokeFailed": "Não foi possível revogar",
"hideDead": "Ocultar revogadas e expiradas",
"showDead": {
"one": "Mostrar {{count}} chave revogada ou expirada",
"other": "Mostrar {{count}} chaves revogadas ou expiradas"
}
},
"voice": {
"label": "Voz",
"refresh": "Atualizar vozes",
"serverDefault": "Predefinição do servidor",
"hint": "Escolha uma voz para a conversão de texto em fala. Deixe na predefinição do servidor para usar a voz configurada pelo administrador.",
"stop": "Parar",
"listen": "Ouvir"
},
"dock": {
"visible": "Visíveis",
"hidden": "Ocultos",
"dragToShow": "Arraste itens para aqui para os mostrar no dock",
"allVisible": "Todos os itens visíveis",
"reset": "Restaurar predefinições"
},
"languages": {
"spokenLabel": "Idiomas que falas",
"addLanguage": "Adicionar idioma...",
"defaultLabel": "Idioma predefinido",
"defaultHint": "Usado para localização da interface.",
"translateToLabel": "Traduzir para",
"translateToHint": "Idioma alvo ao traduzir conteúdo que não falas."
},
"changePassword": {
"currentPasswordLabel": "Palavra-passe Atual",
@@ -38,13 +80,18 @@
"passwordChanged": "Palavra-passe alterada",
"passwordChangeFailed": "Falha ao alterar palavra-passe"
},
"languages": {
"spokenLabel": "Idiomas que falas",
"addLanguage": "Adicionar idioma...",
"defaultLabel": "Idioma predefinido",
"defaultHint": "Usado para localização da interface.",
"translateToLabel": "Traduzir para",
"translateToHint": "Idioma alvo ao traduzir conteúdo que não falas."
"models": {
"defaultModel": "Modelo predefinido",
"sameAsChat": "Igual à predefinição do chat",
"taskDefaultsSaved": "Predefinições de tarefas guardadas",
"saveFailed": "Falha ao guardar as definições",
"defaultChat": "Modelo predefinido do chat",
"defaultChatHint": "Usado ao iniciar um novo chat a partir do ecrã inicial",
"defaultProject": "Modelo predefinido do projeto",
"defaultProjectHint": "Usado ao iniciar um novo chat dentro de um painel de projeto",
"defaultTask": "Modelo predefinido das tarefas",
"defaultTaskHint": "Usado ao executar tarefas a partir do explorador de ficheiros",
"aiDefaultsSaved": "Predefinições de modelos de IA guardadas"
}
},
"sections": {
@@ -173,6 +220,235 @@
"integrations": {
"enterprise": "Empresa",
"personal": "Pessoal"
},
"server": {
"loading": "A carregar…",
"provider": "Fornecedor",
"model": "Modelo",
"voice": "Voz",
"ocr": {
"serverUrl": "URL do servidor do modelo de visão",
"refreshModels": "Atualizar modelos",
"selectModel": "Selecione um modelo",
"saved": "Definições de OCR guardadas",
"saveFailed": "Falha ao guardar as definições de OCR",
"reachable": "O servidor do modelo de visão está acessível"
},
"stt": {
"serverUrl": "URL do servidor Whisper",
"saved": "Definições de STT guardadas",
"saveFailed": "Falha ao guardar as definições de STT",
"reachable": "O servidor Whisper está acessível"
},
"tts": {
"openaiCompatible": "Compatível com OpenAI (Kokoro, OpenAI, etc.)",
"elevenLabs": "ElevenLabs",
"refreshVoices": "Atualizar vozes",
"selectVoice": "Selecione uma voz",
"saved": "Definições de TTS guardadas",
"saveFailed": "Falha ao guardar as definições de TTS",
"playing": "A reproduzir áudio de teste",
"testFailed": "Teste falhou — não foi possível contactar o servidor de TTS"
},
"smtp": {
"mailhog": "MailHog (testes locais)",
"resend": "Resend",
"custom": "SMTP personalizado",
"apiKey": "Chave de API",
"host": "Servidor",
"port": "Porta",
"username": "Nome de utilizador",
"password": "Palavra-passe",
"tls": "TLS / SSL",
"fromName": "Nome do remetente",
"fromEmail": "Email do remetente",
"sendTest": "Enviar email de teste",
"userExample": "utilizador@exemplo.com",
"recipientExample": "destinatario@exemplo.com",
"saved": "Definições de SMTP guardadas",
"saveFailed": "Falha ao guardar as definições de SMTP",
"connected": "Ligação estabelecida",
"testSent": "Email de teste enviado para {{email}}"
},
"maintenance": {
"updateTitle": "Atualizar a plataforma",
"updateHint": "Não altera nada que esteja em execução. O que a atualização precisa está listado aqui, e a decisão é sua.",
"rebuild": "Reconstruir o frontend",
"restart": "Reiniciar o servidor",
"upToDate": "Já está atualizado",
"rebuilt": "Frontend reconstruído — atualize esta página para o ver",
"restarting": "A reiniciar — a página volta a ligar-se sozinha",
"pulled": {
"one": "{{count}} commit obtido",
"other": "{{count}} commits obtidos"
}
},
"harnesses": {
"piMono": "Pi Mono",
"checking": "A verificar…",
"localProviders": "Fornecedores locais",
"remoteProviders": "Fornecedores remotos",
"connect": "Ligar",
"authenticate": "Autenticar",
"connectLocal": "Ligar fornecedor local",
"connectProvider": "Ligar fornecedor",
"none": "Nenhum fornecedor encontrado.",
"updatePiMono": "Atualizar Pi Mono",
"removeProvider": "Remover fornecedor",
"namePlaceholder": "Nome (ex. O meu Ollama)",
"username": "Nome de utilizador",
"password": "Palavra-passe",
"apiKey": "Chave de API",
"editKey": "Editar chave",
"disconnect": "Desligar fornecedor",
"saveKey": "Guardar chave",
"enterKey": "Introduza a chave de API",
"search": "Pesquisar fornecedores…",
"connectFailed": "Falha ao ligar",
"authFailed": "Falha na autenticação",
"saveFailed": "Falha ao guardar o fornecedor",
"connectedTo": "Ligado a {{name}}"
}
},
"users": {
"loadingPermissions": "A carregar permissões…",
"permissionsFailed": "Não foi possível carregar as permissões.",
"deniedUnlessGranted": "Tudo é negado a menos que seja concedido aqui.",
"read": "Leitura",
"full": "Total",
"noAccess": "Sem acesso",
"role": "Função",
"permissionsSaved": "Guardado o que os {{role}} podem alcançar",
"copyBeforeClosing": "Copie o que precisa antes de fechar — nada disto pode ser mostrado outra vez.",
"password": "Palavra-passe",
"linuxAccount": "Conta Linux",
"sshKey": "A sua chave pública SSH",
"addToGitea": "Adicione isto à conta Gitea dele",
"linuxIncomplete": "A conta funciona, mas a parte Linux não ficou concluída",
"done": "Concluído",
"addAccount": "Adicionar conta",
"newAccount": "Nova conta",
"email": "Email",
"name": "Nome",
"username": "Nome de utilizador",
"usernameHint": "Letras, números, pontos, hífenes e underscores.",
"generatePassword": "Gerar uma palavra-passe",
"copyPassword": "Copiar a palavra-passe",
"passwordHint": "Pelo menos 12 caracteres, com maiúsculas e minúsculas, um número e um símbolo.",
"sshPlaceholder": "ssh-ed25519 AAAAC3Nza… ana@portatil",
"passwordCopied": "Palavra-passe copiada",
"loadingAccounts": "A carregar contas…",
"accountsFailed": "Não foi possível carregar as contas.",
"removeAccount": "Remover conta",
"generateNewPassword": "Gerar uma nova palavra-passe",
"serverOwner": "Proprietário do servidor",
"copySshTitle": "Copiar a sua chave pública SSH (adicione-a à conta Gitea dele)",
"resetPasswordTitle": "Gerar uma nova palavra-passe — mostrada uma única vez, e termina a sessão em todo o lado",
"copyNewPassword": "Copiar a nova palavra-passe",
"publicKeyCopied": "Chave pública copiada",
"copyFailed": "Não foi possível copiar — selecione e copie manualmente",
"repairFor": "Reparar a conta Linux de {{email}}",
"linuxAccountFor": "Conta Linux: {{osUser}} — clique para reparar ou substituir a chave SSH",
"copySshFor": "Copiar a chave pública SSH de {{email}}",
"resetPasswordFor": "Redefinir a palavra-passe de {{email}}",
"removeFor": "Remover {{email}}",
"provisionPrompt": "Conta Linux para {{email}}.\n\nCole uma chave pública SSH para lhe permitir aceder por SSH, ou deixe vazio para manter a atual.",
"createLinux": "Criar uma conta Linux",
"noLinux": "Sem conta Linux — clique para criar uma",
"removeTitle": "Remover {{email}}?",
"removeBody": "Isto elimina a conta e tudo o que lhe pertence — passkeys, painéis, layouts guardados e tudo o que qualquer plugin instalado guarde para ela. Não pode ser desfeito.",
"resetTitle": "Redefinir a palavra-passe de {{email}}?",
"resetBody": "É gerada uma nova palavra-passe e mostrada uma única vez — não é guardada em nenhum lugar e não pode ser consultada depois. A palavra-passe atual deixa de funcionar imediatamente, e a sessão é terminada em todo o lado.",
"resetLinuxNote": "A conta Linux ({{osUser}}) não é afetada: não tem palavra-passe, e as chaves SSH ficam inalteradas."
},
"dav": {
"newDevice": "Novo dispositivo",
"create": "Criar",
"none": "Ainda não há dispositivos.",
"placeholder": "Pixel 9, iPad, Thunderbird…",
"revoke": "Revogar",
"delete": "Eliminar",
"copyFailed": "Não foi possível copiar — selecione e copie manualmente",
"createFailed": "Não foi possível criar a palavra-passe de aplicação",
"revoked": "Revogada — esse dispositivo deixa de sincronizar",
"revokeFailed": "Não foi possível revogar",
"deleteFailed": "Não foi possível eliminar",
"copyField": "Copiar {{field}}",
"copied": "{{what}} copiado"
},
"google": {
"guideToggle": "Guia de configuração passo a passo",
"step1": {
"title": "Criar um projeto Google Cloud",
"body": "Abra a página de criação de projeto, dê-lhe um nome (por exemplo “Officer”) e clique em:",
"link": "New Project"
},
"step2": {
"title": "Ativar as APIs",
"body": "Abra a biblioteca de APIs, procure cada uma destas e clique em:",
"link": "API Library"
},
"step3": {
"title": "Configurar o ecrã de consentimento OAuth",
"link": "OAuth Branding",
"appName": "Defina o nome da sua organização, ou “Officer”, como:",
"supportEmail": "Defina o email do administrador como:",
"devContact": "Adicione o email do administrador em:",
"save": "Depois clique em:"
},
"step4": {
"title": "Definir o público",
"link": "OAuth Audience",
"internal": "Se a sua equipa usa Google Workspace, escolha — não é necessária verificação:",
"external": "Caso contrário escolha, e adicione os emails da sua equipa em Test users (obrigatório enquanto a aplicação não estiver verificada; limite de 100 utilizadores de teste):"
},
"step5": {
"title": "Adicionar âmbitos",
"link": "Data Access",
"body": "Abra o acesso a dados, procure e adicione os âmbitos abaixo e depois clique em:",
"note": "A Google classifica o âmbito do calendário como sensível e o do Gmail como restrito. Isso não é problema para aplicações Internal (Google Workspace) nem para aplicações External em modo de teste; publicar em produção com âmbitos restritos exige verificação pela Google."
},
"step6": {
"title": "Criar credenciais OAuth",
"link": "Clients",
"body": "Abra a página de clientes e clique em:",
"appType": "Tipo de aplicação:",
"nameAnything": "Nome: qualquer um (por exemplo “Officer”)",
"redirectUris": "URIs de redirecionamento autorizados — adicione:",
"thenClick": "Depois clique em:"
},
"step7": {
"title": "Copiar as credenciais",
"body": "Uma caixa de diálogo mostra o seu client ID e client secret. Copie ambos e cole-os nos campos abaixo."
},
"scopeGmail": "Ler emails",
"scopeCalendar": "Ler eventos do calendário",
"verifying": "A verificar credenciais…",
"valid": "Credenciais válidas",
"invalid": "Credenciais inválidas",
"verifyFailed": "O pedido de verificação falhou",
"clientId": "Client ID",
"clientSecret": "Client Secret",
"redirectUri": "URI de redirecionamento",
"redirectUriHint": "Adicione este URI aos URIs de redirecionamento autorizados do seu cliente OAuth da Google",
"saved": "Configuração OAuth da Google guardada",
"saveFailed": "Falha ao guardar a configuração OAuth da Google"
},
"googleAccount": {
"title": "Conta Google",
"hint": "Ligue a sua conta Google para o Calendário, Contactos e outros serviços Google.",
"connected": "Ligada",
"disconnect": "Desligar",
"connect": "Ligar conta Google",
"connectedToast": "Conta Google ligada",
"connectFailed": "Falha ao ligar a conta Google",
"disconnectedToast": "Conta Google desligada",
"disconnectFailed": "Falha ao desligar a conta Google"
},
"apify": {
"token": "Token de API",
"saved": "Token de API do Apify guardado",
"saveFailed": "Falha ao guardar o token de API do Apify"
}
},
"header": {
@@ -208,7 +484,8 @@
"calendar": "Calendário",
"contacts": "Contactos",
"appStore": "Loja de aplicações",
"marketplace": "Marketplace"
"marketplace": "Marketplace",
"codeEditor": "Editor de código"
},
"theme": {
"pillTitle": "Tema: {{name}} · ctrl+shift+←/→ percorrer · ctrl+shift+space explorar · ctrl+shift+f {{starAction}}",
@@ -297,5 +574,131 @@
"submitted": "Comunicação de erro enviada",
"failed": "Falha ao enviar a comunicação de erro",
"submit": "Enviar"
},
"auth": {
"signInTitle": "Bem-vindo de volta",
"signInSubtitle": "Inicie sessão na sua conta",
"emailOrUsername": "Email ou nome de utilizador",
"password": "Palavra-passe",
"forgotPassword": "Esqueceu-se da palavra-passe?",
"emailPlaceholder": "utilizador@exemplo.com",
"passwordPlaceholder": "A sua palavra-passe",
"forgotTitle": "Recuperar palavra-passe",
"forgotSubtitle": "Introduza o seu email para receber um link de recuperação",
"email": "Email",
"backToLogin": "Voltar ao início de sessão",
"checkEmail": "Verifique o seu email",
"checkEmailHint": "Clique nele para redefinir a palavra-passe.",
"resetOk": "Palavra-passe redefinida com sucesso. Inicie sessão.",
"verifying": "A verificar…",
"invalidLink": "Link inválido",
"invalidLinkHint": "Este link de recuperação é inválido ou expirou.",
"resetTitle": "Redefinir palavra-passe",
"resetSubtitle": "Introduza a sua nova palavra-passe",
"confirmPassword": "Confirmar palavra-passe",
"minChars": "Mínimo 12 caracteres",
"confirmPlaceholder": "Confirme a sua palavra-passe",
"bootstrapTitle": "Bem-vindo, Administrador",
"bootstrapSubtitle": "Crie a sua conta de administrador",
"name": "Nome",
"username": "Nome de utilizador",
"namePlaceholder": "O seu nome",
"adminEmailPlaceholder": "admin@exemplo.com",
"bootstrapOk": "Conta de administrador criada. Inicie sessão.",
"debug": {
"controls": "Controlos:",
"camera": "Câmara:",
"model": "Modelo:"
}
},
"shortcuts": {
"navigation": "Navegação",
"spotlight": "Spotlight — ir para qualquer ecrã, plugin ou definição pelo nome",
"thisList": "Esta lista",
"themes": "Temas",
"themesNote": "O explorador aplica à medida que se move, para que veja a aplicação mudar em vez de ler nomes.",
"openBrowser": "Abrir o explorador de temas",
"prevNextTheme": "Tema anterior / seguinte, sem abrir nada",
"starCurrent": "Marcar ou desmarcar o tema atual, a partir de qualquer lugar",
"inBrowser": "No explorador de temas",
"moveList": "Percorrer a lista",
"applyKeepBrowsing": "Aplicar o tema focado e continuar a explorar",
"restoreStart": "Voltar ao tema em que começou",
"starFocused": "Marcar ou desmarcar o tema focado",
"keepLooking": "Manter o que está a ver",
"cancelRestore": "Cancelar e restaurar",
"inSpotlight": "No Spotlight",
"moveResults": "Percorrer os resultados",
"goThere": "Ir para lá",
"close": "Fechar",
"chat": "Chat",
"chatNote": "A recuperação só usa a tecla de seta num compositor VAZIO, e qualquer outra tecla termina a recuperação — pelo que um rascunho nunca é substituído.",
"prevNextPrompt": "Prompt anterior / seguinte que enviou, à maneira da shell",
"send": "Enviar · num compositor vazio com algo em fila, enviar isso agora",
"newline": "Nova linha",
"stopTurn": "Parar o turno que está a gerar"
},
"jobs": {
"runningQueued": "Em execução e em fila",
"loading": "A carregar…",
"nothingRunning": "Nada em execução",
"history": "Histórico",
"clearAll": "Limpar tudo",
"selectJob": "Selecione um trabalho",
"notFound": "Trabalho não encontrado.",
"backToJobs": "Voltar aos trabalhos",
"stop": "Parar",
"testNotification": "Enviar uma notificação de teste para todos os canais configurados",
"search": "Pesquisar…",
"deleteFinished": "Eliminar todos os trabalhos terminados",
"noChannels": "Nenhum canal configurado",
"notifyFailed": "Falha ao enviar a notificação",
"stopRequested": "Paragem pedida",
"stopFailed": "Falha ao parar",
"titles": "Títulos",
"download": "Descarregar",
"input": "Entrada",
"output": "Saída",
"steps": "Passos",
"selectStep": "Selecione um passo ou subtarefa para ver a saída",
"noOutput": "Ainda não há saída",
"tokens": "Tokens:",
"cost": "Custo:",
"status": {
"running": "Em execução",
"queued": "Em fila",
"completed": "Concluído",
"failed": "Falhou",
"stopped": "Parado",
"interrupted": "Interrompido"
},
"failedWithCode": "Falhou (saída {{code}})"
},
"activity": {
"title": "Atividade",
"backgroundTasks": "Tarefas em segundo plano",
"detached": "Destacada",
"backToList": "Voltar à lista",
"selectTask": "Selecione uma tarefa para seguir a sua saída ao vivo",
"noneRunning": "nenhuma em execução"
},
"passkeyGate": {
"setUp": "Configure a sua passkey"
},
"chatHistory": {
"loadFailed": "Não foi possível carregar esta conversa: {{reason}}"
},
"capability": {
"frontmatter": "Frontmatter",
"noMatches": "Sem correspondências",
"emptyFile": "Ficheiro vazio",
"createFailed": "Não foi possível criar o {{kind}}",
"deleteFailed": "Não foi possível eliminar o {{kind}}",
"searchPlaceholder": "Pesquisar {{kind}}…",
"selectOne": "Selecione um {{kind}}",
"selectToView": "Selecione um {{kind}} para ver o seu conteúdo",
"delete": "Eliminar",
"createPrompt": "Ajuda-me a criar o conteúdo deste novo ficheiro de {{kind}}",
"improvePrompt": "Ajuda-me a compreender e melhorar este ficheiro de {{kind}}"
}
}
+35 -28
View File
@@ -1,3 +1,5 @@
import type { AppTranslationKey } from '@/lib/i18n';
/*
Every keyboard shortcut the shell owns, as data.
@@ -22,92 +24,97 @@
export type Shortcut = {
/** As a person reads it — `Ctrl+Shift+Space`, not a KeyboardEvent spelling. */
keys: string;
description: string;
/** A catalog key. This is data with no component around it, so ShortcutsModal resolves it. */
descriptionKey: AppTranslationKey;
/** The file whose handler actually implements it, until this registry is authoritative. */
implementedIn: string;
};
export type ShortcutSection = {
title: string;
titleKey: AppTranslationKey;
/** Shown under the title when the section needs a caveat that a per-row description cannot carry. */
note?: string;
noteKey?: AppTranslationKey;
shortcuts: Shortcut[];
};
export const SHORTCUT_SECTIONS: ShortcutSection[] = [
{
title: 'Navigation',
titleKey: 'shortcuts.navigation',
shortcuts: [
{
keys: 'Shift+Space',
description: 'Spotlight — go to any screen, plugin or setting by name',
descriptionKey: 'shortcuts.spotlight',
implementedIn: 'Layout/Spotlight/Spotlight.tsx',
},
{ keys: 'Ctrl+?', description: 'This list', implementedIn: 'Layout/ShortcutsModal.tsx' },
{ keys: 'Ctrl+?', descriptionKey: 'shortcuts.thisList', implementedIn: 'Layout/ShortcutsModal.tsx' },
],
},
{
title: 'Themes',
note: 'The browser applies as you move, so you watch the app change rather than reading names.',
titleKey: 'shortcuts.themes',
noteKey: 'shortcuts.themesNote',
shortcuts: [
{
keys: 'Ctrl+Shift+Space',
description: 'Open the theme browser',
descriptionKey: 'shortcuts.openBrowser',
implementedIn: 'theme/useThemeKeys.ts',
},
{
keys: 'Ctrl+Shift+← / →',
description: 'Previous / next theme, without opening anything',
descriptionKey: 'shortcuts.prevNextTheme',
implementedIn: 'theme/useThemeKeys.ts',
},
{
keys: 'Ctrl+Shift+F',
description: 'Star or unstar the current theme, from anywhere',
descriptionKey: 'shortcuts.starCurrent',
implementedIn: 'theme/useThemeKeys.ts',
},
],
},
{
title: 'In the theme browser',
titleKey: 'shortcuts.inBrowser',
shortcuts: [
{ keys: 'j / k ↑ / ↓', description: 'Move through the list', implementedIn: 'theme/useThemeKeys.ts' },
{ keys: 'j / k ↑ / ↓', descriptionKey: 'shortcuts.moveList', implementedIn: 'theme/useThemeKeys.ts' },
{
keys: 'l →',
description: 'Apply the focused theme and keep browsing',
descriptionKey: 'shortcuts.applyKeepBrowsing',
implementedIn: 'theme/useThemeKeys.ts',
},
{ keys: 'h ←', description: 'Put back the theme you started on', implementedIn: 'theme/useThemeKeys.ts' },
{ keys: 'f', description: 'Star or unstar the focused theme', implementedIn: 'theme/useThemeKeys.ts' },
{ keys: 'Enter', description: 'Keep what you are looking at', implementedIn: 'theme/useThemeKeys.ts' },
{ keys: 'Esc', description: 'Cancel and restore', implementedIn: 'theme/useThemeKeys.ts' },
{ keys: 'h ←', descriptionKey: 'shortcuts.restoreStart', implementedIn: 'theme/useThemeKeys.ts' },
{ keys: 'f', descriptionKey: 'shortcuts.starFocused', implementedIn: 'theme/useThemeKeys.ts' },
{ keys: 'Enter', descriptionKey: 'shortcuts.keepLooking', implementedIn: 'theme/useThemeKeys.ts' },
{ keys: 'Esc', descriptionKey: 'shortcuts.cancelRestore', implementedIn: 'theme/useThemeKeys.ts' },
],
},
{
title: 'In Spotlight',
titleKey: 'shortcuts.inSpotlight',
shortcuts: [
{ keys: '↑ / ↓', description: 'Move through the results', implementedIn: 'Layout/Spotlight/Spotlight.tsx' },
{ keys: 'Enter', description: 'Go there', implementedIn: 'Layout/Spotlight/Spotlight.tsx' },
{ keys: 'Esc', description: 'Close', implementedIn: 'Layout/Spotlight/Spotlight.tsx' },
{ keys: '↑ / ↓', descriptionKey: 'shortcuts.moveResults', implementedIn: 'Layout/Spotlight/Spotlight.tsx' },
{ keys: 'Enter', descriptionKey: 'shortcuts.goThere', implementedIn: 'Layout/Spotlight/Spotlight.tsx' },
{ keys: 'Esc', descriptionKey: 'shortcuts.close', implementedIn: 'Layout/Spotlight/Spotlight.tsx' },
],
},
{
title: 'Chat',
note: 'Recall only takes the arrow key from an EMPTY composer, and any other key ends a recall — so a draft is never overwritten.',
titleKey: 'shortcuts.chat',
noteKey: 'shortcuts.chatNote',
shortcuts: [
{
keys: '↑ / ↓',
description: 'Previous / next prompt you sent, shell-style',
descriptionKey: 'shortcuts.prevNextPrompt',
implementedIn: 'Chat/EmbeddableChat/useEmbeddableChat.ts',
},
{
keys: 'Enter',
description: 'Send · on an empty composer with something queued, send that now',
descriptionKey: 'shortcuts.send',
implementedIn: 'Chat/EmbeddableChat/useEmbeddableChat.ts',
},
{
keys: 'Shift+Enter',
descriptionKey: 'shortcuts.newline',
implementedIn: 'Chat/EmbeddableChat/useEmbeddableChat.ts',
},
{ keys: 'Shift+Enter', description: 'Newline', implementedIn: 'Chat/EmbeddableChat/useEmbeddableChat.ts' },
{
keys: 'Esc',
description: 'Stop the turn that is generating',
descriptionKey: 'shortcuts.stopTurn',
implementedIn: 'Chat/EmbeddableChat/useEmbeddableChat.ts',
},
],
+31 -17
View File
@@ -62,8 +62,11 @@ check(
'ck_server_integrations_provider',
// sql.raw, not sql`${p}` — an interpolated JS string binds as a parameter, so the constraint is
// emitted as `IN ($1, $2)` and Postgres refuses it, breaking push for the WHOLE schema.
sql`${table.provider} IN (${sql.join(SERVER_PROVIDERS.map((p) => sql.raw(`'${p}'`)), sql`, `)})`,
)
sql`${table.provider} IN (${sql.join(
SERVER_PROVIDERS.map((p) => sql.raw(`'${p}'`)),
sql`, `,
)})`,
);
```
Adding a constraint fails while existing rows violate it. That is the point: push refusing tells you the
@@ -77,7 +80,7 @@ drizzle-kit mis-diffs named composite unique CONSTRAINTS. It reads them back fro
them against a schema that declares exactly the same name, columns and order, decides they differ, and
emits a `DROP CONSTRAINT` + `ADD CONSTRAINT` pair — on every push, forever. Fifteen of them made
`db:push` plan 32 statements against a database that already matched, and `ADD UNIQUE` on a populated
table is a data-risk statement, so push stopped on an interactive *"do you want to truncate?"* prompt
table is a data-risk statement, so push stopped on an interactive _"do you want to truncate?"_ prompt
that could never be resolved by answering it.
Reproduced on a database drizzle had itself created seconds earlier, so it is not drift and not
@@ -87,7 +90,7 @@ stable. Verified on drizzle-kit 0.31.9 / drizzle-orm 0.45.1.
A unique index enforces exactly what the constraint did, and `onConflictDoUpdate({ target: [...] })`
accepts it as an arbiter. The one thing it cannot do is be the target of a foreign key — Postgres
requires a unique *constraint* there. Nothing here has a composite foreign-key target; check before
requires a unique _constraint_ there. Nothing here has a composite foreign-key target; check before
adding one.
**Name a foreign key explicitly when drizzle's generated name would exceed 63 characters.** Postgres
@@ -99,22 +102,33 @@ longer version and re-creates the constraint on every push.
**Known remaining churn, harmless:** a composite `primaryKey` has the same diffing bug and there is no
index form to escape to — a primary key must be a constraint. `music_now_playing` therefore drops and
re-adds `pk_music_now_playing` on every push. Two statements, silent, no prompt even with rows in the
table, data unaffected. Naming it explicitly does not help. Leave it.
table, data unaffected. Neither naming it nor un-naming it helps — both were tested. Leave it.
**Four foreign keys are over 63 characters and churn the same way**, found 2026-08-19 while pushing
`chat_notification_prefs`. These are the case the paragraph above says to name explicitly, and none of
them is:
**All six over-long foreign keys are now named, 2026-08-23.** They were deferred as "noise rather than a
fault" for four days. What ended that was a deploy plan saying _"expect no changes, stop and report if it
wants to alter something"_ — which this made impossible to satisfy on any host, forcing the deploy agent to
overrule its own instructions and continue. A documented annoyance became a plan instruction nobody could
follow.
command_hq_session_tags_session_row_id_command_hq_sessions_id_fk 64
command_hq_watcher_fires_session_row_id_command_hq_sessions_id_fk 65
bitcoin_wallet_frozen_utxos_wallet_id_bitcoin_wallet_wallets_id_fk 66
bitcoin_wallet_chain_cache_wallet_id_bitcoin_wallet_wallets_id_fk 65
The six, and where each lives:
The tell is in the plan itself: the `DROP` names them at 63 characters and the `ADD` at their full
length, which is Postgres's truncation and drizzle's copy disagreeing. Eight statements per push, no
prompt, data unaffected — deferred rather than fixed (see `TODO.md`), because it is noise rather than
a fault. Two live in `officer_db/src/command-hq/schema.ts`; the other two are the bitcoin-wallet
plugin's, in its own repository.
fk_command_hq_watcher_fires_session officer_db/src/command-hq/schema.ts
fk_command_hq_session_tags_session officer_db/src/command-hq/schema.ts
fk_bitcoin_wallet_frozen_utxos_wallet plugins/bitcoin-wallet/db/schema.ts
fk_bitcoin_wallet_chain_cache_wallet plugins/bitcoin-wallet/db/schema.ts
fk_atelier_collection_items_collection plugins/atelier/sidecar/db/collections/schema.ts
fk_atelier_collection_items_generation plugins/atelier/sidecar/db/collections/schema.ts
Two things worth knowing if you add another. Naming it means REMOVING the inline `.references()` on the
column, or drizzle creates both. And `walletChainCache` had to move from the two-argument `pgTable` form to
the three-argument one, because there was nowhere else to put the declaration.
**`pk_music_now_playing` still churns, and it cannot be fixed.** Two statements per push. Tested on
2026-08-23 rather than assumed: removing the explicit name produces the identical drop-and-re-add under
drizzle's generated name (`music_now_playing_user_id_device_pk`), so this is the named-composite mis-diff
rather than the truncation one, and there is no index form to escape to because a primary key must be a
constraint. **A push is therefore expected to print exactly these two statements and nothing else** — which
is a far more useful baseline than ten, because anything else really is your change.
**Rules that still apply:**
+4 -3
View File
@@ -20,10 +20,11 @@ export {
cleanupExpiredTokens,
} from './queries';
// Exported as a value, not just a type: the API and the UI need to enumerate the roles, and the
// column definition is the only place that list should exist.
export { USER_ROLES, OWNER_USER_ID } from './schema';
export { OWNER_USER_ID } from './schema';
// A role list is no longer enumerable at the type level — see the comment on `UserRole` in schema.ts.
// The API and the UI enumerate roles by querying the `roles` table (`listRoles` in ../roles), not by
// importing a value from here.
export type { UserRole } from './schema';
export { listProvisionableUsers } from './queries';
export type { ProvisionableUser } from './queries';
+11 -7
View File
@@ -85,14 +85,18 @@ export async function getUserByUsername(username: string): Promise<UserSelect |
// #1. Returns undefined rather than falling back to the lowest id when no row holds the role: the agent
// sidecar refusing to start beats it silently running as the wrong person.
//
// `order by id` is not cosmetic. Without it, two rows holding the role would make "who owns this
// server" whatever Postgres happened to return first — and that answer feeds the agent sidecar's
// identity, the vault and origin scoping. The write paths refuse to create a second Super Admin
// (create-user.ts and updateUserRoleHandler), so this should never have a choice to make; ordering is
// what makes the outcome deterministic if one ever gets in by another route, and id 1 is the bootstrap
// account the CHECK constraint already pins.
// The owner is `OWNER_USER_ID`, so there is nothing to disambiguate and no ordering to get right.
//
// This used to select on `role = 'Super Admin'` with `order by id` as a tiebreak, because two rows could
// hold the role and "who owns this server" would otherwise be whatever Postgres returned first — an answer
// that feeds the agent sidecar's identity, the vault and origin scoping. The write paths refused a second
// Super Admin to keep it single.
//
// Since 2026-08-23 ownership is an identity, so several accounts may hold `Super Admin` and none of them
// becomes the owner by doing so. The tiebreak, the refusals and the CHECK that pinned user 1's role all
// existed to protect an answer that is now a primary key.
export async function getOwnerUser(): Promise<UserSelect | undefined> {
const [user] = await db.select().from(users).where(eq(users.role, 'Super Admin')).orderBy(users.id).limit(1);
const [user] = await db.select().from(users).where(eq(users.id, OWNER_USER_ID)).limit(1);
return user;
}
+44 -17
View File
@@ -1,25 +1,28 @@
import { pgTable, serial, text, integer, timestamp, index, uniqueIndex, check } from 'drizzle-orm/pg-core';
import { pgTable, serial, text, integer, timestamp, index, uniqueIndex, check, foreignKey } from 'drizzle-orm/pg-core';
import { sql } from 'drizzle-orm';
import { roles } from '../roles/schema';
// The bootstrap account. `id` is a serial starting at 1 and bootstrap is gated on an empty user table,
// so the first account created is always 1. Exported so the CHECK below and the delete guard in
// queries/auth.ts state the number once between them.
export const OWNER_USER_ID = 1;
// Roles, in descending authority. Exported as a value so the API and the UI can enumerate them from
// the same place the column is defined — a second hand-written list of role names is how they drift.
//
// A text column with a TS enum rather than a Postgres enum type, matching `status` below: the set is
// still settling, and adding a role should be a one-line schema change that `db:push` applies, not an
// ALTER TYPE. Postgres will not reject an unknown string — the TS type is the guard.
//
// 'Super Admin' is the server owner, and this column is the ONLY thing that says so. isSuperAdmin()
// and getOwnerUser() both read it; there is no SUPER_ADMIN_EMAIL and no "first account wins" fallback
// any more. Two consequences worth holding on to: bootstrap must set it explicitly on the first
// account, and demoting the last Super Admin would leave the platform with no owner. The CHECK on the
// table below stops that for the bootstrap account specifically: user 1 cannot be anything else.
export const USER_ROLES = ['Super Admin', 'Admin', 'Member', 'Developer'] as const;
export type UserRole = (typeof USER_ROLES)[number];
/**
* Was a TS union (`(typeof USER_ROLES)[number]`) backed by a hardcoded four-role array. Since
* docs/roles-and-teams.md phase 2 part 4, roles are data — the `roles` table, administered through
* `/api/roles` — and `users.role` is a foreign key onto it rather than a column typed to a fixed set. A
* role this column can legally hold is therefore not enumerable at the type level any more, so `UserRole`
* is plain `string` and the compile-time guard it used to provide moves to a runtime check at the write
* path: `getRole(name)` returning a row before a caller is allowed to assign or grant that name. See
* `create-user.ts`, `manage-users.ts` and `permissions-routes.ts`.
*
* 'Super Admin' is still the server owner's role by name, and this column is the ONLY thing that says so
* — isSuperAdmin() and getOwnerUser() both read it. Two consequences worth holding on to: bootstrap must
* set it explicitly on the first account, and demoting the last Super Admin would leave the platform with
* no owner. The CHECK on the table below stops that for the bootstrap account specifically: user 1 cannot
* be anything else.
*/
export type UserRole = string;
export const users = pgTable(
'users',
@@ -31,8 +34,9 @@ export const users = pgTable(
.notNull()
.default('Unverified'),
// Defaults to the least privileged role so a row created by any path that does not think about
// authorisation cannot accidentally mint an admin.
role: text('role', { enum: USER_ROLES }).notNull().default('Member'),
// authorisation cannot accidentally mint an admin. Foreign key onto `roles.name` is declared below,
// in the table's third argument — see `fk_users_role`.
role: text('role').notNull().default('Member'),
name: text('name'),
/**
* Required, and unique case-INSENSITIVELY — see the index below.
@@ -93,6 +97,15 @@ export const users = pgTable(
// "some row must be Super Admin" — that would need to see other rows. So this pins the bootstrap
// account and nothing more; promoting or demoting anyone else is still free.
//
// KEPT after ownership stopped being a role, 2026-08-23, and `docs/roles-and-teams.md` phase 1 said to
// remove it as redundant. It is redundant for the question it was written for — `isOwner` is now an id
// comparison and does not read this column at all — but it still earns its place for a different one:
// it stops user 1 being set to `Member` while remaining the owner, which is a state with no benefit and
// a confusing display. A constraint that costs nothing and forbids a nonsense state is worth keeping
// even after the reason it was added has gone.
//
// What it must NOT be mistaken for is the thing that makes user 1 the owner. It does not, any more.
//
// It cannot stop a DELETE either. deleteUser() in queries/auth.ts refuses id 1 for that half.
//
// sql.raw for the literal — an interpolated JS string binds as `$1`, and Postgres will not accept a
@@ -101,6 +114,20 @@ export const users = pgTable(
'ck_users_owner_is_super_admin',
sql`${table.id} <> ${sql.raw(String(OWNER_USER_ID))} OR ${table.role} = ${sql.raw("'Super Admin'")}`,
),
// docs/roles-and-teams.md D5 and phase 2 part 2. Named explicitly rather than left to drizzle's
// generated name — see src/databases/CLAUDE.md → "Composite keys" on why an over-long generated FK
// name gets truncated by Postgres and then re-created on every push; named up front so this one is
// never at risk of it regardless of length.
//
// ON UPDATE CASCADE only, no ON DELETE: a role cannot be deleted while any account holds it
// (`deleteRole` in roles/queries.ts enforces D4), so there is no delete path for this to react to —
// and leaving it at Postgres's default (effectively NO ACTION) makes the constraint itself a backstop
// for that guard rather than silently nulling or cascading a delete the application never intended.
foreignKey({
name: 'fk_users_role',
columns: [table.role],
foreignColumns: [roles.name],
}).onUpdate('cascade'),
],
);
@@ -15,6 +15,7 @@ export {
disarmCommandHqWatcher,
recordCommandHqTurn,
ingestSpawnedChildren,
parentCommanderOf,
recordSpawnedOutcome,
getCommandHqCostSummary,
listCommandHqTurns,
@@ -475,3 +475,44 @@ export async function recordSpawnedOutcome(
and(eq(commandHqSpawned.sessionRowId, sessionRowId), eq(commandHqSpawned.spawnedSessionId, spawnedSessionId)),
);
}
export type SpawnParent = {
/** The commander's transcript id — what `/command-hq/<id>` opens. */
sessionId: string;
/** What the owner called it, or null for a commander filed before the column existed. */
name: string | null;
firstSeenAt: string;
finishedAt: string | null;
};
/**
* Which commander spawned this session, if any.
*
* The same row `ingestSpawnedChildren` writes, read from the other end — so this needed no new table and no
* new write path. A commander's children were already recorded because deleting one has to take them with
* it; that record answers "who is my parent" for free, and nothing was asking.
*
* Null for almost every session, and that is the normal case rather than a miss: a chat somebody opened
* themselves has no parent, and a session spawned by anything other than a commander has no row here. The
* caller must treat absence as "not spawned", never as "lookup failed".
*/
export async function parentCommanderOf(spawnedSessionId: string): Promise<SpawnParent | null> {
const [row] = await db
.select({
sessionId: commandHqSessions.sessionId,
name: commandHqSessions.name,
firstSeenAt: commandHqSpawned.firstSeenAt,
finishedAt: commandHqSpawned.finishedAt,
})
.from(commandHqSpawned)
.innerJoin(commandHqSessions, eq(commandHqSessions.id, commandHqSpawned.sessionRowId))
.where(eq(commandHqSpawned.spawnedSessionId, spawnedSessionId))
.limit(1);
if (!row) return null;
return {
sessionId: row.sessionId,
name: row.name,
firstSeenAt: row.firstSeenAt.toISOString(),
finishedAt: row.finishedAt ? row.finishedAt.toISOString() : null,
};
}
@@ -8,6 +8,7 @@ import {
text,
timestamp,
uniqueIndex,
foreignKey,
} from 'drizzle-orm/pg-core';
import { users } from '../auth/schema';
@@ -145,14 +146,23 @@ export const commandHqWatcherFires = pgTable(
'command_hq_watcher_fires',
{
id: serial('id').primaryKey(),
sessionRowId: integer('session_row_id')
.notNull()
.references(() => commandHqSessions.id, { onDelete: 'cascade' }),
sessionRowId: integer('session_row_id').notNull(),
/** Which watcher task fired — `commandHqSessions.watcherTaskId` at the moment this row was written. */
taskId: text('task_id').notNull(),
firedAt: timestamp('fired_at', { withTimezone: true }).notNull().defaultNow(),
},
(table) => [index('idx_command_hq_watcher_fires_session').on(table.sessionRowId, table.firedAt)],
(table) => [
// Named, because drizzle's generated name is 65 characters and Postgres truncates identifiers at 63 —
// so it stores the short form, drizzle keeps comparing against its own long one, and every push drops
// and re-adds an identical constraint. Documented in src/databases/CLAUDE.md and left unfixed until a
// deploy plan said "expect no changes" and this made that unsatisfiable on all five hosts.
foreignKey({
name: 'fk_command_hq_watcher_fires_session',
columns: [table.sessionRowId],
foreignColumns: [commandHqSessions.id],
}).onDelete('cascade'),
index('idx_command_hq_watcher_fires_session').on(table.sessionRowId, table.firedAt),
],
);
/**
@@ -198,14 +208,20 @@ export const commandHqTags = pgTable(
export const commandHqSessionTags = pgTable(
'command_hq_session_tags',
{
sessionRowId: integer('session_row_id')
.notNull()
.references(() => commandHqSessions.id, { onDelete: 'cascade' }),
sessionRowId: integer('session_row_id').notNull(),
tagId: integer('tag_id')
.notNull()
.references(() => commandHqTags.id, { onDelete: 'cascade' }),
},
(table) => [uniqueIndex('uq_command_hq_session_tags').on(table.sessionRowId, table.tagId)],
(table) => [
// 64 characters generated; see the note on `fk_command_hq_watcher_fires_session`.
foreignKey({
name: 'fk_command_hq_session_tags_session',
columns: [table.sessionRowId],
foreignColumns: [commandHqSessions.id],
}).onDelete('cascade'),
uniqueIndex('uq_command_hq_session_tags').on(table.sessionRowId, table.tagId),
],
);
/**
@@ -1,6 +1,6 @@
import { pgTable, serial, text, timestamp, uniqueIndex, check } from 'drizzle-orm/pg-core';
import { pgTable, serial, text, timestamp, uniqueIndex, check, foreignKey } from 'drizzle-orm/pg-core';
import { sql } from 'drizzle-orm';
import { USER_ROLES } from '../auth/schema';
import { roles } from '../roles/schema';
// What a ROLE may reach. The subject of a grant is a role, never a user.
//
@@ -8,8 +8,8 @@ import { USER_ROLES } from '../auth/schema';
// look more flexible and are the obvious next request. Per-user grants make "what can this person do" a
// question you answer by reading rows, and "what can a Member do" a question with no answer at all. Roles
// keep both answerable: onboarding is picking a role, and auditing is reading one short table. When the
// answer really has to differ for one person, that person needs a role, and adding one is a line in
// USER_ROLES.
// answer really has to differ for one person, that person needs a role, and adding one is a row in
// `roles` (see roles/schema.ts and /api/roles).
//
// A MISSING ROW MEANS NO ACCESS. There is no row that denies; absence denies. This is what makes the table
// safe to read as the whole truth — an empty table is a platform where members can reach nothing but their
@@ -27,7 +27,8 @@ export const rolePermissions = pgTable(
'role_permissions',
{
id: serial('id').primaryKey(),
role: text('role', { enum: USER_ROLES }).notNull(),
// Foreign key onto `roles.name` is declared below — see `fk_role_permissions_role`.
role: text('role').notNull(),
/** A permission key from the registry. Validated by the API, not by a constraint — see above. */
permission: text('permission').notNull(),
/**
@@ -43,16 +44,6 @@ export const rolePermissions = pgTable(
// re-creates them on every push, which stops db:push on an unanswerable truncate prompt. See
// src/databases/CLAUDE.md → "Composite keys".
uniqueIndex('uq_role_permissions_role_permission').on(table.role, table.permission),
// Postgres will not reject an unknown string in a text column just because TypeScript narrowed it, so
// the legal sets are stated here too. sql.raw for the literals: an interpolated JS string binds as a
// parameter and Postgres refuses a parameter inside a CHECK, which breaks push for the WHOLE schema.
check(
'ck_role_permissions_role',
sql`${table.role} IN (${sql.join(
USER_ROLES.map((r) => sql.raw(`'${r}'`)),
sql`, `,
)})`,
),
check(
'ck_role_permissions_level',
sql`${table.level} IN (${sql.join(
@@ -64,5 +55,19 @@ export const rolePermissions = pgTable(
// short-circuits every check. A 'Super Admin' row here would be inert, and an inert row that looks
// meaningful is worse than no row: someone would eventually revoke one and expect it to do something.
check('ck_role_permissions_not_owner', sql`${table.role} <> ${sql.raw("'Super Admin'")}`),
// docs/roles-and-teams.md D5 and phase 2 part 2. This REPLACES `ck_role_permissions_role`, which used
// to list the four built-in role names literally (`role IN ('Super Admin', 'Admin', ...)`). That check
// was already wrong the moment role CRUD (phase 2 part 3, `/api/roles`) could create a role at runtime
// — a grant for a new role would have been refused by a constraint enforcing a snapshot of a list that
// no longer described the actual role set. A foreign key onto the actual table is the correct
// enforcement of "must be a real role" and needs no updating when a role is added.
//
// Named explicitly for the same reason as `fk_users_role` — see the comment there and
// src/databases/CLAUDE.md → "Composite keys".
foreignKey({
name: 'fk_role_permissions_role',
columns: [table.role],
foreignColumns: [roles.name],
}).onUpdate('cascade'),
],
);
+12 -1
View File
@@ -1,2 +1,13 @@
export { roles } from './schema';
export { listRoles, getRole, seedRole, type RoleRow } from './queries';
export {
listRoles,
getRole,
seedRole,
createRole,
renameRole,
deleteRole,
type RoleRow,
type CreateRoleResult,
type RenameRoleResult,
type DeleteRoleResult,
} from './queries';
+117 -1
View File
@@ -1,4 +1,4 @@
import { asc, eq, sql } from 'drizzle-orm';
import { and, asc, eq, sql } from 'drizzle-orm';
import { db } from '../db';
import { users } from '../auth/schema';
import { roles } from './schema';
@@ -59,3 +59,119 @@ export async function seedRole(row: {
.returning({ name: roles.name });
return inserted.length > 0;
}
// ── Write half: role CRUD ─────────────────────────────────────────────────────────────────────────
//
// Every function here returns a discriminated result instead of throwing, because the router has to give
// a person a reason they can act on ("Developer is a system role" vs "3 accounts still hold it" are two
// different screens), and a caught exception only carries a string to parse. The one thing each guard
// shares: it re-checks its own invariant inside the write, not just before it, so a race between the
// check and the statement fails closed rather than silently succeeding.
/** How many accounts hold this role. Used by `deleteRole` — D4 refuses to delete a role anyone holds. */
async function roleHolderCount(name: string): Promise<number> {
const [row] = await db
.select({ count: sql<number>`count(*)::int` })
.from(users)
.where(eq(users.role, name));
return row?.count ?? 0;
}
export type CreateRoleResult = { ok: true; role: RoleRow } | { ok: false; reason: 'invalid-name' | 'duplicate' };
/**
* Create a role at runtime. `isSystem` is always false here — a role the platform's own code names by
* string (Developer, Super Admin, Member; see the schema comment) is one seeded at startup, never one
* typed into a form, and nothing reachable through this function may claim otherwise.
*/
export async function createRole(input: { name: string; description?: string | null }): Promise<CreateRoleResult> {
const name = input.name.trim();
if (!name) return { ok: false, reason: 'invalid-name' };
const inserted = await db
.insert(roles)
.values({ name, description: input.description?.trim() || null, isSystem: false })
.onConflictDoNothing({ target: roles.name })
.returning();
const role = inserted[0];
if (!role) return { ok: false, reason: 'duplicate' };
return { ok: true, role };
}
export type RenameRoleResult =
| { ok: true; role: RoleRow }
| { ok: false; reason: 'not-found' | 'system' | 'invalid-name' | 'duplicate' };
/**
* Rename a role. Refuses outright on `isSystem` (D4 in docs/roles-and-teams.md): `rolePermitsDevTools()`
* tests for `'Developer'` by string, `bootstrap.ts` writes `'Super Admin'`, and `users.role` defaults to
* `'Member'`. Renaming one of those four is a code change across three call sites that has not happened,
* not a data edit — so this refuses rather than quietly breaking them.
*
* `users.role` and `role_permissions.role` are foreign keys onto this table with `ON UPDATE CASCADE`
* (phase 2 part 2), so the `UPDATE` below moves every holder and every grant automatically, in the same
* statement, as Postgres's own job rather than this function's. There used to be a guard here refusing the
* rename while anyone held the role, because before the FK existed a rename would have orphaned them —
* silently pointing every holder at a name that no longer existed. That guard is gone now that the
* database itself does the moving.
*/
export async function renameRole(from: string, to: string): Promise<RenameRoleResult> {
const name = to.trim();
if (!name) return { ok: false, reason: 'invalid-name' };
const existing = await getRole(from);
if (!existing) return { ok: false, reason: 'not-found' };
if (existing.isSystem) return { ok: false, reason: 'system' };
if (name === from) return { ok: true, role: existing };
const clash = await getRole(name);
if (clash) return { ok: false, reason: 'duplicate' };
// `isSystem: false` in the WHERE is the re-check: belt and suspenders against a role becoming system
// between the read above and this write.
const [role] = await db
.update(roles)
.set({ name })
.where(and(eq(roles.name, from), eq(roles.isSystem, false)))
.returning();
if (!role) return { ok: false, reason: 'system' };
return { ok: true, role };
}
export type DeleteRoleResult =
| { ok: true }
| { ok: false; reason: 'not-found' | 'system' | 'in-use'; holderCount?: number };
/**
* Delete a role. Refuses if it is system-named (D4), and refuses if any account currently holds it.
*
* Never reassigns holders to a fallback — silently moving accounts onto a different role's grants is a
* permission change nobody asked for, and "absence denies" is the posture everywhere else in this system.
* The holder count and the delete run in one transaction so a role cannot be handed to someone in the gap
* between counting and deleting.
*/
export async function deleteRole(name: string): Promise<DeleteRoleResult> {
const existing = await getRole(name);
if (!existing) return { ok: false, reason: 'not-found' };
if (existing.isSystem) return { ok: false, reason: 'system' };
return db.transaction(async (tx) => {
// Inline rather than a call to `roleHolderCount`: this one has to run inside the same transaction as
// the delete below, so a role cannot be handed to someone in the gap between counting and deleting.
const [holders] = await tx
.select({ count: sql<number>`count(*)::int` })
.from(users)
.where(eq(users.role, name));
const count = holders?.count ?? 0;
if (count > 0) return { ok: false, reason: 'in-use', holderCount: count };
// Same re-check as renameRole, same reason: the row must not vanish out from under a role that
// became system between the read above and this statement.
const deleted = await tx
.delete(roles)
.where(and(eq(roles.name, name), eq(roles.isSystem, false)))
.returning({ name: roles.name });
if (!deleted.length) return { ok: false, reason: 'system' };
return { ok: true };
});
}
+16 -5
View File
@@ -16,7 +16,6 @@ import { resolveAuthToken } from './servers/auth-token';
import { isWsProviderAllowed } from './servers/permissions/authorize';
import { isTokenBlacklisted, getUserById } from 'officerdb';
import { terminalWebsocket } from './servers/api/terminal/websocket';
import { minesweeperWebsocket } from './servers/api/minesweeper/websocket';
import { chatWebsocket } from './servers/api/chat/websocket';
import { chatNotifyWebsocket } from './servers/api/chat/notify-delivery';
import { registerChatPushNotifications } from './servers/api/chat/notify-push';
@@ -30,6 +29,7 @@ import './servers/api/chat/opencode/sidecar-server'; // subscribe to the opencod
import type { SidecarRegistration } from './servers/sidecar/registration-protocol';
import { toShellUsername } from './servers/data-path';
import { devProxyWebsocket, upgradeDevProxyWs } from './servers/api/dev-proxy/websocket';
import { pluginWsWebsocket, upgradePluginWs } from './servers/api/plugin-ws/websocket';
// Build static file routes from public/
// A snapshot of ./public, taken once at boot: one exact route per file, each holding a `Bun.file`
@@ -156,11 +156,11 @@ async function handleSidecarQueueCommand(ws: ServerWebSocket<WSData>, msg: Recor
const handlers: Record<string, any> = {
terminal: terminalWebsocket,
'dev-proxy': devProxyWebsocket,
'plugin-ws': pluginWsWebsocket,
chat: chatWebsocket,
'chat-notify': chatNotifyWebsocket,
'task-runner': taskRunnerWebsocket,
pipeline: pipelineWebsocket,
minesweeper: minesweeperWebsocket,
sidecar: sidecarWebsocket,
};
@@ -187,7 +187,6 @@ const WS_ROUTES: Record<string, UpgradableProvider> = {
'/api/tasks/run/ws': 'task-runner',
'/api/tasks/pipeline/ws': 'pipeline',
'/api/terminal/ws': 'terminal',
'/api/minesweeper/ws': 'minesweeper',
'/api/chat/ws': 'chat',
'/api/chat/notify/ws': 'chat-notify',
};
@@ -195,7 +194,7 @@ const WS_ROUTES: Record<string, UpgradableProvider> = {
// Every provider named by a served route, plus the two that upgrade through their own handlers rather than
// `upgradeWs`: `sidecar` (loopback process-to-process, its own route below) and `dev-proxy` (upgraded from
// inside the proxy router). Named explicitly so their absence from WS_ROUTES cannot read as an oversight.
const SERVED_WS_PROVIDERS = [...new Set([...Object.values(WS_ROUTES), 'sidecar', 'dev-proxy'])];
const SERVED_WS_PROVIDERS = [...new Set([...Object.values(WS_ROUTES), 'sidecar', 'dev-proxy', 'plugin-ws'])];
/*
Both doors into the platform, checked against the permission registry before either opens.
@@ -366,7 +365,7 @@ console.log(
* cannot serve is now a typecheck failure instead of a runtime one. `sidecar` and `dev-proxy` are
* deliberately absent — they upgrade through their own handlers, not through here.
*/
type UpgradableProvider = 'terminal' | 'chat' | 'chat-notify' | 'task-runner' | 'pipeline' | 'minesweeper';
type UpgradableProvider = 'terminal' | 'chat' | 'chat-notify' | 'task-runner' | 'pipeline';
async function upgradeWs(req: Request, server: any, provider: UpgradableProvider) {
const token = new URL(req.url).searchParams.get('token');
@@ -487,6 +486,18 @@ const server = serve({
if (req.headers.get('upgrade') === 'websocket') return upgradeDevProxyWs(req, server);
return honoServer.fetch(req, server);
},
/*
Every plugin's socket, through one wildcard declared at boot.
This is the route that made a plugin websocket possible at all. `WS_ROUTES` is read once before
`serve()`, so nothing installed later can add an entry to it — but a wildcard does not need to,
because the plugin name is a path segment rather than a route. The same trick `dev-proxy` above has
been using all along; it simply had no second consumer until now.
*/
'/api/plugin-ws/*': (req: Request, server: any) => {
if (req.headers.get('upgrade') === 'websocket') return upgradePluginWs(req, server);
return honoServer.fetch(req, server);
},
'/api/sidecar/register': (req: Request, server: any) => {
const ok = server.upgrade(req, {
data: { provider: 'sidecar', userId: 0, email: '', username: '' },
+12 -3
View File
@@ -1,5 +1,5 @@
import type { Handler } from 'hono';
import { getUserCount, createUser, replaceRoleGrants, USER_ROLES } from 'officerdb';
import { getUserCount, createUser, replaceRoleGrants, listRoles } from 'officerdb';
import { DEFAULT_ROLE_PERMISSIONS } from '@@/permissions/registry';
import argon2 from 'argon2';
import * as errors from '@@/custom-errors';
@@ -49,12 +49,21 @@ export const bootstrapHandler: Handler = async function (ctx) {
// bootstrap is the one moment that happens exactly once per install, so seeding cannot fight a later
// revocation — take one of these away and nothing puts it back.
//
// Read from the `roles` table rather than the old USER_ROLES list (docs/roles-and-teams.md phase 2 part
// 4) — `scripts/seed-roles.ts` runs as part of `postdb:push`, before the server ever serves a request,
// so by the time this handler can run the four built-in rows already exist. Filtered to `isSystem`
// deliberately: this is seeding the platform's own baseline roles, not every role that happens to exist
// — a role created at runtime through /api/roles before anyone has bootstrapped (which `roles` being
// owner-gated makes unreachable today, but nothing here should assume that stays true) gets no grants
// from this loop, same as it would get none from any other seed step.
//
// Non-fatal. An owner who exists but whose roles hold nothing is a working server with a one-click fix;
// failing bootstrap over it would leave a platform with no account at all.
try {
for (const role of USER_ROLES.filter((r) => r !== 'Super Admin')) {
const builtIn = (await listRoles()).filter((r) => r.isSystem && r.name !== 'Super Admin');
for (const role of builtIn) {
await replaceRoleGrants(
role,
role.name,
DEFAULT_ROLE_PERMISSIONS.map((permission) => ({ permission, level: 'write' as const })),
);
}
+10
View File
@@ -13,6 +13,7 @@ import {
getChatNotifyPreferences,
setChatNotifyPreference,
forgetChatSessions,
parentCommanderOf,
} from 'officerdb';
import type { NotifyPreference } from 'officerdb/types';
import { setNudge, getNudge, cancelNudge } from 'officerdb';
@@ -273,6 +274,15 @@ chatRouter.get('/sessions/:id', async (ctx) => {
travels with the conversation.
*/
isCommander: (await listCommandHqSessionIds(user.id)).has(id),
/*
Which commander spawned this, if any — the row `ingestSpawnedChildren` writes, read from the other
end. A spawned agent has always been fully readable here; what it could never say was who started
it, so opening one gave no way back to the conversation that owns it.
Null for almost every session and that is the normal case, not a miss: a chat somebody opened
themselves has no parent. Never fatal — a session must render when this lookup will not.
*/
spawnedBy: await parentCommanderOf(id).catch(() => null),
});
});
-28
View File
@@ -1,28 +0,0 @@
import { createRouter } from '../../create-router';
import { sessionStatus, startSession, stopSession } from './session';
/**
* Session control. The pixels do not come through here — they come through the websocket relay; this
* is only "is it up, bring it up, take it down", plus the window size the panel needs to size its
* canvas.
*/
export const minesweeperRouter = createRouter();
minesweeperRouter.get('/status', async (c) => c.json(await sessionStatus()));
minesweeperRouter.post('/start', async (c) => {
const status = await sessionStatus();
if (!status.installed) {
return c.json({ error: 'Minesweeper is not installed on this server (wine-minesweeper is missing)' }, 501);
}
if (status.running) return c.json(status);
const result = await startSession();
if (!result.ok) return c.json({ error: `Could not start the session: ${result.out.trim()}` }, 500);
return c.json(await sessionStatus());
});
minesweeperRouter.post('/stop', async (c) => {
await stopSession();
return c.json(await sessionStatus());
});
-111
View File
@@ -1,111 +0,0 @@
import { join } from 'node:path';
import { OFFICER_ROOT } from '../../data-path';
/**
* The Minesweeper X session: a virtual display with one Windows game on it, and x11vnc serving that
* display on loopback.
*
* The platform does not implement any of that — it drives `bin/session.sh`, which is the same script
* used by hand. One implementation, so a session started from the browser and one started from a
* terminal are the same session with the same lifecycle.
*/
export const MINESWEEPER_DIR = join(OFFICER_ROOT, 'wine-minesweeper');
const SESSION_SCRIPT = join(MINESWEEPER_DIR, 'bin', 'session.sh');
export const VNC_HOST = '127.0.0.1';
export const VNC_PORT = Number(process.env.MINESWEEPER_VNC_PORT ?? 5907);
const DISPLAY = process.env.MINESWEEPER_DISPLAY ?? ':7';
export type WindowGeometry = { width: number; height: number; x: number; y: number };
export type SessionStatus = {
installed: boolean;
running: boolean;
/** Absent until the game has drawn its window. */
window: WindowGeometry | null;
};
const run = async (cmd: string[], env: Record<string, string> = {}): Promise<{ ok: boolean; out: string }> => {
const proc = Bun.spawn(cmd, {
cwd: MINESWEEPER_DIR,
env: { ...process.env, ...env },
stdout: 'pipe',
stderr: 'pipe',
});
const [out, err] = await Promise.all([new Response(proc.stdout).text(), new Response(proc.stderr).text()]);
const code = await proc.exited;
return { ok: code === 0, out: `${out}${err}` };
};
export const isInstalled = (): boolean => Bun.file(SESSION_SCRIPT).size > 0;
/**
* Whether x11vnc is listening, decided by reading the kernel's socket table rather than by connecting.
*
* This used to open a TCP connection and drop it. That wedged the VNC server: libvncserver peeks at a
* new connection to decide whether it is a WebSocket handshake, and that peek blocks its main loop
* until the client speaks or the peek times out. A health check that connects and says nothing is
* therefore a small stall, and the panel polls status on a timer — so the stalls overlapped, the accept
* backlog filled (Recv-Q 32/32), and the server stopped accepting the real viewer too.
*
* The rule it cost to learn: a liveness check must not be indistinguishable from a client. Reading
* /proc/net/tcp is free, cannot block, and cannot be mistaken for a viewer.
*/
async function isServing(): Promise<boolean> {
const wanted = VNC_PORT.toString(16).toUpperCase().padStart(4, '0');
const LISTEN = '0A';
for (const table of ['/proc/net/tcp', '/proc/net/tcp6']) {
const text = await Bun.file(table)
.text()
.catch(() => '');
for (const line of text.split('\n').slice(1)) {
const columns = line.trim().split(/\s+/);
const local = columns[1];
const state = columns[3];
if (!local || state !== LISTEN) continue;
if (local.split(':')[1] === wanted) return true;
}
}
return false;
}
/**
* The game window's size, so the browser can size its canvas to the board rather than to the whole
* framebuffer. `session.sh` parks the window at 0,0, so the offset is expected to be zero and is
* reported anyway — a non-zero one means something moved it and the canvas would be misaligned.
*
* The board changes size when the difficulty changes, which is why this is polled rather than read
* once at connect.
*/
export async function windowGeometry(): Promise<WindowGeometry | null> {
const search = await run(['xdotool', 'search', '--name', 'Minesweeper X'], { DISPLAY });
if (!search.ok) return null;
let best: WindowGeometry | null = null;
for (const id of search.out.trim().split('\n').filter(Boolean)) {
const geom = await run(['xdotool', 'getwindowgeometry', '--shell', id], { DISPLAY });
if (!geom.ok) continue;
const read = (key: string): number => Number(new RegExp(`^${key}=(\\d+)$`, 'm').exec(geom.out)?.[1] ?? NaN);
const candidate = { width: read('WIDTH'), height: read('HEIGHT'), x: read('X'), y: read('Y') };
if (Object.values(candidate).some(Number.isNaN)) continue;
// wine creates a 1x1 owner stub alongside the real window; the larger one is the game.
if (!best || candidate.width * candidate.height > best.width * best.height) best = candidate;
}
return best && best.width > 1 ? best : null;
}
export async function sessionStatus(): Promise<SessionStatus> {
const installed = isInstalled();
if (!installed) return { installed, running: false, window: null };
const running = await isServing();
return { installed, running, window: running ? await windowGeometry() : null };
}
export const startSession = (): Promise<{ ok: boolean; out: string }> => run([SESSION_SCRIPT, 'start']);
export const stopSession = (): Promise<{ ok: boolean; out: string }> => run([SESSION_SCRIPT, 'stop']);
-95
View File
@@ -1,95 +0,0 @@
import type { ServerWebSocket, Socket } from 'bun';
import { VNC_HOST, VNC_PORT } from './session';
/**
* A byte relay between the browser and x11vnc, in the same spirit as the terminal's relay onto the pty
* sidecar — this file authenticates the upgrade (upgradeWs, in server.tsx) and moves bytes without
* reading them.
*
* One difference decides the shape: x11vnc serves raw TCP, not a WebSocket. So this is the job
* websockify would otherwise do, done in-process with `Bun.connect` rather than by adding a second
* daemon and a second port to protect. RFB is a stream protocol, so frame boundaries carry no meaning
* and chunks are forwarded exactly as they arrive.
*/
export type MinesweeperWSData = { provider: 'minesweeper'; search: string };
type Relay = { socket: Socket | null; queue: Uint8Array[]; done: boolean };
const relays = new Map<ServerWebSocket<MinesweeperWSData>, Relay>();
const closeClient = (ws: ServerWebSocket<MinesweeperWSData>, code: number, reason: string) => {
const relay = relays.get(ws);
relays.delete(ws);
if (relay) relay.done = true;
try {
relay?.socket?.end();
} catch {
/* already gone */
}
try {
ws.close(code, reason);
} catch {
/* already closed */
}
};
export const minesweeperWebsocket = {
open(ws: ServerWebSocket<MinesweeperWSData>) {
// Registered synchronously, so bytes arriving before the TCP connection is up are queued rather
// than dropped. The RFB handshake starts with the SERVER talking, but a client that pipelines its
// version string would otherwise lose it.
const relay: Relay = { socket: null, queue: [], done: false };
relays.set(ws, relay);
void Bun.connect({
hostname: VNC_HOST,
port: VNC_PORT,
socket: {
open(socket) {
if (relay.done) {
socket.end();
return;
}
relay.socket = socket;
for (const chunk of relay.queue) socket.write(chunk);
relay.queue.length = 0;
},
data(_socket, chunk) {
try {
ws.send(chunk);
} catch {
/* client gone; the close handler tears down the socket */
}
},
close: () => closeClient(ws, 1000, 'vnc closed'),
error: () => closeClient(ws, 1011, 'vnc error'),
},
}).catch(() => {
// No x11vnc listening — the session is not running. 1011 rather than a silent close, so the
// panel can say so instead of showing an empty canvas.
closeClient(ws, 1011, 'minesweeper session is not running');
});
},
message(ws: ServerWebSocket<MinesweeperWSData>, raw: string | Buffer) {
const relay = relays.get(ws);
if (!relay) return;
// RFB is binary in both directions; a text frame is a client that is not speaking it.
const bytes = typeof raw === 'string' ? new TextEncoder().encode(raw) : new Uint8Array(raw);
if (relay.socket) relay.socket.write(bytes);
else relay.queue.push(bytes);
},
close(ws: ServerWebSocket<MinesweeperWSData>) {
const relay = relays.get(ws);
relays.delete(ws);
if (relay) relay.done = true;
try {
relay?.socket?.end();
} catch {
/* ignore */
}
},
};
+42
View File
@@ -0,0 +1,42 @@
import { sidecarPort } from '@@/sidecar-registry';
import { snapshotPlugins } from '@@/plugins/mount';
/*
Where a plugin's socket actually goes.
A target is an ADDRESS — a host and a port — never a URL a manifest wrote. The relay turns it into
`ws://<host>:<port>/ws`, and `/ws` is a convention rather than a setting for the same reason the host is
not configurable: every value here has to be one the platform derived, not one a plugin asserted.
The target is always a SIDECAR. A fixed-port form was written and removed the same day: nothing stops a
manifest naming a port it does not own, so `{ port: 5432 }` plus a grant would be a raw TCP relay onto
Postgres for anyone that plugin reaches. Verifying the host is loopback is not verifying the port belongs
to the plugin, and only the second question matters.
A sidecar's port is different in kind, not degree: the platform watched it arrive at registration, so the
association is observed rather than asserted. It is also the SAME port the sidecar serves its HTTP on —
one announcement, one listener, `/ws` alongside the routes. That is what the relay's move to
websocket-to-websocket bought, and why a plugin wanting a socket no longer has to choose between having
one and having ordinary routes.
**Host is always loopback and is not configurable.** A plugin socket that could name an arbitrary host
would be a request-forgery primitive handed to every plugin author and reachable by anyone the plugin is
granted to. There is no case for it that a sidecar does not already serve.
*/
export type PluginWsTarget = { host: string; port: number };
export async function pluginWsTargetFor(appName: string): Promise<PluginWsTarget | null> {
const { states } = await snapshotPlugins();
// Installed, not merely present on disk. A plugin directory that exists but is not installed has no
// routes and no permission, so it must have no socket either.
const state = states.find((st) => st.plugin.appName === appName && st.install);
const socket = state?.plugin.manifest.websocket;
if (!socket) return null;
// A sidecar that has not announced its port yet is indistinguishable from one that never will, and both
// are correctly a refusal — there is nothing to relay onto. The caller says "not accepting connections",
// which is true either way.
const port = sidecarPort(socket.sidecar);
return port ? { host: '127.0.0.1', port } : null;
}
+207
View File
@@ -0,0 +1,207 @@
import type { ServerWebSocket } from 'bun';
import { resolveAuthToken } from '@@/auth-token';
import { isTokenBlacklisted } from 'officerdb';
import { isApiRequestAllowed } from '@@/permissions/authorize';
import { pluginWsTargetFor } from './target';
/*
One websocket door for every plugin, so a plugin can have a socket at all.
── Why this exists ──
Bun's route table is fixed at `serve()`, and `WS_ROUTES` is a static object read at boot. So a plugin
installed afterwards had no way to add a socket route, and "a websocket provider is a platform concern"
became a hard ceiling rather than a preference: `/minesweeper` had to live in the platform and
`plugins/desktop` could not do the same thing at all.
The way out was already in the tree. `dev-proxy` serves a socket without a `WS_ROUTES` entry, through a
WILDCARD route whose handler calls `server.upgrade` itself. Nothing about the route table needs to become
dynamic — one wildcard declared at boot can serve every plugin that will ever be installed, because the
plugin name is a path segment rather than a route.
── The upstream is a WEBSOCKET, not a raw TCP socket ──
This relayed onto a raw TCP address for about a day. It was changed while extracting Minesweeper, and the
reason is worth keeping because it is not a preference.
**A sidecar announces exactly one port.** That is the whole provenance argument for `target.ts` — the
platform watched that port arrive at registration, which is the only thing separating it from a number a
manifest asserted. But if this relay needs raw TCP, that one port has to BE a raw TCP listener, so the
sidecar cannot also serve HTTP on it, and the plugin's ordinary routes have to fall back to the typed
command vocabulary over the registration socket — the mechanism the fleet has spent months retiring.
Relaying websocket-to-websocket dissolves that. The sidecar serves HTTP and `/ws` on the single port it
announced, exactly as the pty sidecar already does; `createSidecarProxy` handles the HTTP half; and the
conversion from frames to whatever the plugin actually speaks happens INSIDE the plugin, which is the only
process that knows what that is. Minesweeper's x11vnc is the worked example: the sidecar owns the RFB
stream and the platform never learns that RFB exists.
This file is still ignorant of the payload — it moves frames without reading them, and a stream protocol's
boundaries carry no meaning either way. The ignorance simply sits one layer up.
*/
export type PluginWSData = {
provider: 'plugin-ws';
plugin: string;
/** `ws://127.0.0.1:<announced port>/ws`, with the client's query minus its credential. */
upstream: string;
userId: number;
};
type Frame = string | Uint8Array<ArrayBuffer>;
type Relay = { ws: WebSocket | null; queue: Frame[]; done: boolean };
const relays = new Map<ServerWebSocket<PluginWSData>, Relay>();
const closeClient = (ws: ServerWebSocket<PluginWSData>, code: number, reason: string) => {
const relay = relays.get(ws);
relays.delete(ws);
if (relay) relay.done = true;
try {
relay?.ws?.close();
} catch {
/* already gone */
}
try {
ws.close(code, reason);
} catch {
/* already closing */
}
};
export const pluginWsWebsocket = {
open(ws: ServerWebSocket<PluginWSData>) {
/*
The queue is not an optimisation. Bun requires `server.upgrade` to be synchronous, so the client is
already connected and may already be talking before the upstream is open — and an RFB client sends its
protocol version immediately. Dropping those frames desynchronises the stream in a way that looks like
a corrupt display rather than a lost packet. Learned by dev-proxy first.
*/
const relay: Relay = { ws: null, queue: [], done: false };
relays.set(ws, relay);
let upstream: WebSocket;
try {
// The sidecar binds loopback and is told who is calling, the same signal every HTTP sidecar trusts:
// a request without this header did not come through the platform.
upstream = new WebSocket(ws.data.upstream, { headers: { 'X-Officer-User': String(ws.data.userId) } } as never);
} catch {
closeClient(ws, 1011, `${ws.data.plugin} is not accepting connections`);
return;
}
relay.ws = upstream;
upstream.binaryType = 'arraybuffer';
upstream.onopen = () => {
// Between the upgrade and here the client may have gone. Sending into a socket nobody reads would hold
// the upstream connection open for as long as the plugin's process lives.
if (relay.done) {
try {
upstream.close();
} catch {
/* already gone */
}
return;
}
for (const frame of relay.queue) upstream.send(frame);
relay.queue.length = 0;
};
upstream.onmessage = (ev) => {
try {
ws.send(typeof ev.data === 'string' ? ev.data : new Uint8Array(ev.data as ArrayBuffer));
} catch {
/* client gone; the close handler tidies up */
}
};
// A plugin whose process is not listening is the ordinary case rather than an exception: a sidecar that
// has not booted, or a service the owner stopped. The client is told, and told which plugin.
upstream.onerror = () => closeClient(ws, 1011, `${ws.data.plugin} is not accepting connections`);
upstream.onclose = () => closeClient(ws, 1011, 'upstream closed');
},
message(ws: ServerWebSocket<PluginWSData>, message: string | Buffer) {
const relay = relays.get(ws);
if (!relay) return;
const frame: Frame = typeof message === 'string' ? message : (message as unknown as Uint8Array<ArrayBuffer>);
if (relay.ws && relay.ws.readyState === WebSocket.OPEN) relay.ws.send(frame);
else relay.queue.push(frame);
},
close(ws: ServerWebSocket<PluginWSData>) {
const relay = relays.get(ws);
relays.delete(ws);
if (relay) relay.done = true;
try {
relay?.ws?.close();
} catch {
/* already gone */
}
},
};
/**
* `/api/plugin-ws/<plugin>` with an upgrade header.
*
* Authorisation is PER PLUGIN, which is why `plugin-ws` is exempt from the boot-time totality check rather
* than carrying a registry entry of its own. One entry covering every plugin's socket would be a hole:
* granting one plugin would grant them all.
*
* So the decision is delegated to the plugin's OWN capability, by asking the same question its HTTP routes
* are asked — `isApiRequestAllowed(user, 'GET', '/api/<plugin>')`. That is deliberate and it is the whole
* safety argument: there is no second permission to grant, to forget, or to drift out of step. Granting a
* plugin grants its socket, and revoking it closes it.
*
* Async, like `upgradeWs`. `server.upgrade` must be called synchronously with respect to the request, but
* Bun accepts a route handler that returns a promise — which is what lets the token resolve, the blacklist
* check and the permission decision all happen before anything is upgraded.
*/
export async function upgradePluginWs(req: Request, server: any): Promise<Response | undefined> {
const url = new URL(req.url);
const match = url.pathname.match(/^\/api\/plugin-ws\/([a-z0-9-]{1,64})\/?$/);
if (!match) return undefined;
const plugin = match[1]!;
// A browser cannot set headers on a WebSocket upgrade, so the token arrives as a query parameter — the
// concession every other socket here already makes. Verified through the same resolver as the HTTP doors,
// so an API key that works against /api works here too.
const token = url.searchParams.get('token');
if (!token) return new Response('Unauthorized', { status: 401 });
try {
const user = await resolveAuthToken(token);
if (!user) return new Response('Unauthorized', { status: 401 });
if (user.jti && (await isTokenBlacklisted(user.jti))) return new Response('Unauthorized', { status: 401 });
// The plugin's own gate, asked as if this were a GET against its HTTP prefix.
if (!(await isApiRequestAllowed(user.id, 'GET', `/api/${plugin}`)).allowed) {
return new Response('Forbidden', { status: 403 });
}
const target = await pluginWsTargetFor(plugin);
// 404 for both "no such plugin" and "no socket declared", identically. A caller must not be able to
// discover which plugins are installed by which refusal it gets — the same reasoning as SendOff's
// recipient lookup.
if (!target) return new Response('Not found', { status: 404 });
// The rest of the query is the plugin's to interpret and is passed through untouched. The CREDENTIAL is
// not: a sidecar has no use for the caller's JWT, and forwarding one puts a bearer token into whatever
// that process logs. `X-Officer-User` carries the only part it needs.
const forwarded = new URLSearchParams(url.search);
forwarded.delete('token');
const query = forwarded.toString();
const ok = server.upgrade(req, {
data: {
provider: 'plugin-ws',
plugin,
upstream: `ws://${target.host}:${target.port}/ws${query ? `?${query}` : ''}`,
userId: user.id,
} satisfies PluginWSData,
});
return ok ? undefined : new Response('Upgrade failed', { status: 400 });
} catch {
// Any failure to establish WHO is calling denies. Never open a socket on a maybe.
return new Response('Unauthorized', { status: 401 });
}
}
+102
View File
@@ -0,0 +1,102 @@
import { createRouter } from '../../create-router';
import * as errors from '@@/custom-errors';
import { isSuperAdmin } from '../../super-admin';
import { listRoles, createRole, renameRole, deleteRole } from 'officerdb';
/*
/api/roles — role CRUD (phase 2 part 3 of docs/roles-and-teams.md).
This is the roles TABLE — a name, a description, the `isSystem` flag. It is not the GRANTS a role
holds; that stays `role_permissions`, administered at `/api/users/permissions` by
`permissionAdminRouter`. The two are separate screens for a reason: this router answers "which roles
exist", that one answers "what may each reach" — and deleting a role here has to know the second
question's table too, because the guard below is "does anyone hold it", not "what does it grant".
── Owner only, explicitly ──
`roles` is `kind: 'admin'` in the permission registry, so the global gate already refuses a non-owner
before a request reaches here. This is the same belt-and-braces every other admin router in this
directory adds on top of that (app-store, server-admin): a mistake in the registry must not turn into
the ability to rename or delete a role.
── Why delete refuses instead of reassigning ──
D4 in the design doc: never move a role's holders onto a fallback. That is a permission change nobody
asked for, and "absence denies" — the posture everywhere else in this system — means a role with
accounts still on it stays exactly as reachable as it was until every one of them is moved off by
someone who chose to.
*/
export const rolesRouter = createRouter();
rolesRouter.use(async (ctx, next) => {
if (!(await isSuperAdmin(ctx.get('user')))) throw errors.FORBIDDEN('Role management is owner-only');
return next();
});
/** GET /api/roles — every role, with how many accounts hold each. */
rolesRouter.get('/', async (ctx) => ctx.json({ roles: await listRoles() }));
/** POST /api/roles — create a role. Always non-system; see the schema comment on `isSystem`. */
rolesRouter.post('/', async (ctx) => {
const body = ctx.get('body') as { name?: unknown; description?: unknown };
if (typeof body?.name !== 'string') throw errors.BAD_REQUEST('name is required');
const description = typeof body.description === 'string' ? body.description : null;
const result = await createRole({ name: body.name, description });
if (!result.ok) {
throw result.reason === 'invalid-name'
? errors.BAD_REQUEST('a role name cannot be empty')
: errors.CONFLICT(`a role named '${body.name.trim()}' already exists`);
}
return ctx.json({ role: result.role });
});
/**
* PATCH /api/roles/:name — rename. Refuses a system role outright: `Developer`, `Super Admin` and
* `Member` are tested by string in code that has not been updated to read this table (see D4), so
* renaming one of those would silently detach the code's own idea of who holds what.
*/
rolesRouter.patch('/:name', async (ctx) => {
const from = ctx.req.param('name');
const body = ctx.get('body') as { name?: unknown };
if (typeof body?.name !== 'string') throw errors.BAD_REQUEST('name is required');
const result = await renameRole(from, body.name);
if (!result.ok) {
switch (result.reason) {
case 'not-found':
throw errors.NOT_FOUND(`no such role '${from}'`);
case 'system':
throw errors.FORBIDDEN(
`'${from}' is a system role and the platform's own code names it — it cannot be renamed`,
);
case 'invalid-name':
throw errors.BAD_REQUEST('a role name cannot be empty');
case 'duplicate':
throw errors.CONFLICT(`a role named '${body.name.trim()}' already exists`);
}
}
return ctx.json({ role: result.role });
});
/** DELETE /api/roles/:name — refuses a system role, and refuses one any account still holds. */
rolesRouter.delete('/:name', async (ctx) => {
const name = ctx.req.param('name');
const result = await deleteRole(name);
if (!result.ok) {
switch (result.reason) {
case 'not-found':
throw errors.NOT_FOUND(`no such role '${name}'`);
case 'system':
throw errors.FORBIDDEN(
`'${name}' is a system role and the platform's own code names it — it cannot be deleted`,
);
case 'in-use':
throw errors.CONFLICT(
`${result.holderCount} account(s) still hold '${name}' — move them to another role first`,
);
}
}
return ctx.json({ ok: true });
});
+133
View File
@@ -0,0 +1,133 @@
import { createRouter } from '../../create-router';
import * as errors from '@@/custom-errors';
import * as sidecar from '@@/sidecar-registry';
import { chatIdentity } from '../chat/chat';
import { checkBudget } from './budget';
/*
POST /sub-agents/spawn — an agent asks Officer to run another agent.
── Why this exists rather than leaning on the harness ──
A chat agent already has a way to spawn a worker: the harness gives it one. Nothing else does. A watcher
loop, a plugin, a background job, a cron entry — none of them can reach that tool, which is exactly why a
commander's loop shells out to `claude -p` by hand and then has to invent its own record-keeping for what
it started.
So this is the door Officer defines: the shape, the limits and the vocabulary are the platform's, every
caller gets the same one, and none of it changes when a CLI does.
── The condition that comes before the feature ──
`checkBudget()` runs first and refuses on a floor. The windows belong to the Anthropic account and are
spent by every `claude` on the machine, so an endpoint that can start work without asking would burn the
last of a window and kill the turn the owner is sitting in — a failure that lands on somebody else's
conversation, which is the worst place for it. The reserve is a guess and the honest shape of a guess is a
floor: never spend the last 15%.
── What it is NOT ──
Not a queue, not a supervisor, not a retry. One call starts one agent. Whether that agent's work was any
good is the caller's problem, and a caller that wants three tries writes three calls — because a retry
inside here would be a policy nobody chose, applied to work this endpoint cannot read.
*/
export const subAgentsRouter = createRouter();
const MAX_PROMPT = 100_000;
subAgentsRouter.post('/spawn', async (ctx) => {
const user = ctx.get('user');
const body = ctx.get('body') as { prompt?: string; cwd?: string; model?: string; wait?: boolean };
const prompt = typeof body?.prompt === 'string' ? body.prompt.trim() : '';
if (!prompt) throw errors.BAD_REQUEST('prompt is required');
if (prompt.length > MAX_PROMPT) throw errors.BAD_REQUEST(`prompt exceeds ${MAX_PROMPT} characters`);
/*
Refused BEFORE anything is spawned, and the reason travels with the refusal.
A caller that gets "no room" needs to know which window and how close, or its only move is to try again
immediately — which is the behaviour this is trying to prevent. 429 rather than 403: this is a "not now",
not a "not you".
*/
const budget = await checkBudget();
if (!budget.ok) {
return ctx.json(
{ error: budget.reason ?? 'no budget to start another agent', limits: budget.limits, problem: budget.problem },
429,
);
}
/*
The identity is resolved from the TOKEN, never from the body.
`chatIdentity` is what decides the home directory and the OS user the agent runs as, and it is the same
resolution every chat route uses. A caller naming its own email here would be naming whose filesystem to
run in.
*/
const who = await chatIdentity(user);
// Officer's own handle for the session. The harness's transcript uuid is assigned when the agent first
// reports one, which is after this returns — see the note in the response below.
const sessionKey = crypto.randomUUID();
const spawn = {
userId: user.id,
email: who.email,
username: user.username ?? who.email.split('@')[0] ?? String(user.id),
prompt,
sessionKey,
...(body?.cwd ? { cwd: body.cwd } : {}),
...(body?.model ? { model: body.model } : {}),
/*
Stated explicitly, never omitted. The field is `required-but-may-be-undefined` on purpose — an optional
one let a call site forget it, and forgetting it means a member's agent silently running as the owner in
the owner's home. `undefined` here says "the owner", and that is only reached when `chatIdentity` says
there is no Linux user to run as.
*/
member: who.osUser ? { osUser: who.osUser, home: who.home } : undefined,
};
try {
/*
Two modes, and the default is the one a loop wants.
`wait: false` returns as soon as the agent is running, so a watcher can start work and get on with
watching. `wait: true` blocks for the answer, which is right for a question with a short answer and
wrong for anything that touches a fleet — the request would hold a socket open for the length of the
work.
*/
if (body?.wait === true) {
const result = await sidecar.spawnClaude(spawn);
return ctx.json({ sessionKey, result });
}
await sidecar.spawnClaudeStreaming(spawn);
/*
`sessionKey` and not a transcript id, because the transcript does not exist yet.
The agent announces its own uuid on its first turn, which is after this responds. A caller that needs
the transcript — to open `/chat/<id>`, or to record what it started — reads it from the live session
list a moment later. Returning a guess here, or blocking until it arrived, would both be worse than
saying which id this is.
*/
return ctx.json({ sessionKey, running: true });
} catch (err) {
// The agent sidecar being down is a 503, not a 500: nothing about the request was wrong and retrying it
// later is the correct response, which is a distinction a caller can act on.
// 503 rather than 500: nothing about the request was wrong, and retrying it later is the correct
// response — a distinction the caller can act on.
throw errors.createError(503, err instanceof Error ? err.message : 'could not start an agent');
}
});
/**
* GET /sub-agents/budget — is there room to start one, without starting one.
*
* Separate from the spawn so a caller can decide before it commits. A watcher that would rather skip a cycle
* than be refused mid-flight asks this first; the spawn checks again regardless, because between the two
* calls somebody else may have spent the window.
*/
subAgentsRouter.get('/budget', async (ctx) => {
const budget = await checkBudget();
return ctx.json(budget);
});
+16 -13
View File
@@ -1,6 +1,5 @@
import type { Handler } from 'hono';
import { createUser, getUserByEmail, getUserByUsername, USER_ROLES } from 'officerdb';
import type { UserRole } from 'officerdb';
import { createUser, getUserByEmail, getUserByUsername, getRole } from 'officerdb';
import argon2 from 'argon2';
import * as errors from '@@/custom-errors';
import { validatePublicKey } from '@@/os-user-ssh';
@@ -28,9 +27,6 @@ import { toPublicUser } from './manage-users';
// which is precisely the trap the hand-INSERT route fell into. An account the owner created in the admin
// UI is verified by definition — the owner is the verification.
/** Roles this route may assign. Never 'Super Admin' — see below. */
const ASSIGNABLE_ROLES = USER_ROLES.filter((r) => r !== 'Super Admin');
export const createUserHandler: Handler = async function (ctx) {
const body = (ctx.get('body') ?? {}) as Record<string, unknown>;
@@ -55,12 +51,19 @@ export const createUserHandler: Handler = async function (ctx) {
// return whichever the query reached first. That answer decides the identity the agent sidecar runs
// as, who reaches the vault and which origin is privileged, so it is not a thing to leave to a query
// plan. If the owner ever needs to hand the server over, that is a deliberate transfer, not a dropdown.
if (!(ASSIGNABLE_ROLES as readonly string[]).includes(role)) {
throw errors.BAD_REQUEST(
role === 'Super Admin'
? 'There is one server owner and it cannot be created here.'
: `Role must be one of: ${ASSIGNABLE_ROLES.join(', ')}`,
);
//
// Checked as a literal BEFORE the table lookup: 'Super Admin' is always a real row (it is seeded and
// isSystem), so a table-only check would let it through and rely on the message below to explain why
// it still isn't offered here — this way the refusal and its reason are decided in one place.
if (role === 'Super Admin') {
throw errors.BAD_REQUEST('There is one server owner and it cannot be created here.');
}
// The runtime replacement for what USER_ROLES used to guard at the type level (docs/roles-and-teams.md
// phase 2 part 4) — `role` is user input from here on, and a role that is not a row in `roles` must
// never reach `createUser`, or the FK on `users.role` throws a raw Postgres error instead of this
// message.
if (!(await getRole(role))) {
throw errors.BAD_REQUEST(`Unknown role '${role}'`);
}
// The inbound SSH key, if the owner supplied one. Validated HERE rather than at use, so a bad paste is a
@@ -87,7 +90,7 @@ export const createUserHandler: Handler = async function (ctx) {
name,
username,
status: 'Active',
role: role as UserRole,
role,
});
// The Linux side: directories, the Linux user, the confinement, the keys. Non-fatal and reported rather
@@ -97,7 +100,7 @@ export const createUserHandler: Handler = async function (ctx) {
//
// Retryable in place afterwards via POST /users/:id/provision-linux, so a host that was not ready when the
// account was made does not cost anybody their password and dashboards.
const os = await provisionOsAccount({ userId: user.id, email, username, role: role as UserRole, inboundKey });
const os = await provisionOsAccount({ userId: user.id, email, username, role, inboundKey });
// Tell any plugin that provisions upstream accounts. Detached and unawaited: a plugin's sidecar being
// down must not fail the creation of a platform account, and the list is re-sent when it registers.
+28 -18
View File
@@ -1,6 +1,5 @@
import type { Handler } from 'hono';
import { getUsers, getUserById, updateUser, deleteUser, USER_ROLES, OWNER_USER_ID } from 'officerdb';
import type { UserRole } from 'officerdb';
import { getUsers, getUserById, updateUser, deleteUser, listRoles, getRole, OWNER_USER_ID } from 'officerdb';
import * as errors from '@@/custom-errors';
import { deprovisionOsAccount } from '@@/os-user-deprovision';
import { dropPostgresRole, provisionPostgresRole, rolePermitsDevTools } from '@@/os-user-postgres';
@@ -50,13 +49,16 @@ export const toPublicUser = (u: Awaited<ReturnType<typeof getUsers>>[number]): P
});
export const listUsersHandler: Handler = async function (ctx) {
const users = await getUsers();
const [users, roles] = await Promise.all([getUsers(), listRoles()]);
const roleNames = roles.map((r) => r.name);
return ctx.json({
users: users.sort((a, b) => a.id - b.id).map(toPublicUser),
// Every role, so the owner's own row can display its value. The UI must not offer 'Super Admin' in a
// picker — both write paths refuse it — which is what `assignableRoles` is for.
roles: USER_ROLES,
assignableRoles: USER_ROLES.filter((r) => r !== 'Super Admin'),
// picker — both write paths refuse it — which is what `assignableRoles` is for. Read from the `roles`
// table rather than a hardcoded list (docs/roles-and-teams.md phase 2 part 4) — a role created at
// runtime through /api/roles must show up here without a deploy.
roles: roleNames,
assignableRoles: roleNames.filter((r) => r !== 'Super Admin'),
ownerId: OWNER_USER_ID,
});
};
@@ -66,8 +68,11 @@ export const updateUserRoleHandler: Handler = async function (ctx) {
if (!Number.isInteger(id) || id < 1) throw errors.BAD_REQUEST('Invalid user id');
const { role } = ctx.get('body') as { role?: unknown };
if (typeof role !== 'string' || !(USER_ROLES as readonly string[]).includes(role)) {
throw errors.BAD_REQUEST(`Role must be one of: ${USER_ROLES.join(', ')}`);
// The runtime replacement for what USER_ROLES used to guard at the type level (docs/roles-and-teams.md
// phase 2 part 4): a role that is not a row in `roles` must never reach `updateUser`, or the FK on
// `users.role` throws a raw Postgres error instead of this message.
if (typeof role !== 'string' || !(await getRole(role))) {
throw errors.BAD_REQUEST(`Unknown role '${String(role)}'`);
}
// ck_users_owner_is_super_admin would reject this anyway — the point of catching it here is the
@@ -77,14 +82,19 @@ export const updateUserRoleHandler: Handler = async function (ctx) {
throw errors.FORBIDDEN('The server owner cannot be demoted.');
}
// And nobody else can be promoted INTO it. The CHECK constraint pins user 1's role but cannot stop a
// second row holding it — a row-level check cannot see other rows — and `getOwnerUser()` resolves the
// owner by that role, so two holders make "who owns this server" a question the query plan answers.
// It decides the agent sidecar's identity, vault access and which origin is privileged. Handing the
// server over is a deliberate act, not a dropdown.
if (id !== OWNER_USER_ID && role === 'Super Admin') {
throw errors.FORBIDDEN('There is one server owner, and this is not how it changes.');
}
/*
A second Super Admin is allowed since 2026-08-23, and the refusal that used to live here is gone.
It existed because `getOwnerUser()` resolved the owner BY that role, so two holders made "who owns this
server" a question the query plan answered — and that answer decided the agent sidecar's identity, vault
access and which origin is privileged. Ownership is now `OWNER_USER_ID`, so the role no longer carries
it and several accounts may hold it.
What the role does carry is real and worth saying out loud in the UI rather than here: it provisions an
OS account with sudo. That puts the holder outside Officer's permission system entirely and cannot be
undone by revoking the role afterwards. Granting it is handing over the machine — which is the operator's
decision to make, and no longer one this endpoint refuses on their behalf.
*/
const existing = await getUserById(id);
if (!existing) throw errors.NOT_FOUND('User not found');
@@ -100,7 +110,7 @@ export const updateUserRoleHandler: Handler = async function (ctx) {
// the account still says Developer and the whole thing can be retried. Doing it the other way round would
// leave a Member holding database access with nothing in the row to indicate it.
const had = rolePermitsDevTools(existing.role);
const wants = rolePermitsDevTools(role as UserRole);
const wants = rolePermitsDevTools(role);
if (had && !wants && existing.osUser) {
const dropped = await dropPostgresRole(existing.osUser);
@@ -120,7 +130,7 @@ export const updateUserRoleHandler: Handler = async function (ctx) {
}
}
const updated = await updateUser(id, { role: role as UserRole });
const updated = await updateUser(id, { role });
if (!updated) throw errors.NOT_FOUND('User not found');
// Promotion. Non-fatal and reported, like every other provisioning step: the role change itself has
+13 -7
View File
@@ -2,8 +2,7 @@ import type { MiddlewareHandler } from 'hono';
import { createRouter } from '../../create-router';
import * as errors from '@@/custom-errors';
import { isSuperAdmin } from '../../super-admin';
import { getAllRoleGrants, replaceRoleGrants, USER_ROLES } from 'officerdb';
import type { UserRole } from 'officerdb';
import { getAllRoleGrants, replaceRoleGrants, listRoles, getRole } from 'officerdb';
import { PERMISSIONS, GRANTABLE_PERMISSIONS, PERMISSION_BY_KEY } from '../../permissions/registry';
import { getEffectivePermissions, invalidateRoleGrants } from '../../permissions/authorize';
import { permissionAvailability } from '../../app-store/availability';
@@ -101,13 +100,17 @@ permissionAdminRouter.get('/permissions', ownerGate, async (ctx) => {
hasPersonalWrites: !!c.personal?.length,
});
const allRoles = await listRoles();
return ctx.json({
// Only the grantable kinds are offered. `execution` and `admin` are deliberately absent: a UI that
// shows a checkbox it will refuse to honour is worse than one that never offered it.
permissions: GRANTABLE_PERMISSIONS.filter((c) => !unavailable.has(c.key)).map(describe),
// Roles a grant may name. Super Admin is excluded: the owner bypasses this table entirely, and the
// database refuses a row for that role.
roles: USER_ROLES.filter((r) => r !== 'Super Admin'),
// Roles a grant may name. Read from the `roles` table (docs/roles-and-teams.md phase 2 part 4) rather
// than a hardcoded list, so a role created at runtime through /api/roles is grantable without a
// deploy. Super Admin is excluded: the owner bypasses this table entirely, and the database refuses a
// row for that role.
roles: allRoles.map((r) => r.name).filter((r) => r !== 'Super Admin'),
// The column is `permission` now too, so this is a straight pass-through again. It was briefly a
// mapping — the wire said `permission` while the column still said `permission` — which is what let
// the table be renamed without any client noticing.
@@ -116,8 +119,11 @@ permissionAdminRouter.get('/permissions', ownerGate, async (ctx) => {
});
permissionAdminRouter.put('/permissions/:role', ownerGate, async (ctx) => {
const role = ctx.req.param('role') as UserRole;
if (!USER_ROLES.includes(role)) throw errors.BAD_REQUEST(`Unknown role '${role}'`);
const role = ctx.req.param('role');
// The runtime replacement for what USER_ROLES used to guard at the type level (docs/roles-and-teams.md
// phase 2 part 4): a role that is not a row in `roles` must never reach `replaceRoleGrants`, or the FK
// on `role_permissions.role` throws a raw Postgres error instead of this message.
if (!(await getRole(role))) throw errors.BAD_REQUEST(`Unknown role '${role}'`);
if (role === 'Super Admin') throw errors.BAD_REQUEST('The owner is not governed by grants');
const body = ctx.get('body') as { grants?: unknown } | undefined;
+4 -2
View File
@@ -9,6 +9,7 @@ import { themesRouter } from './api/themes/themes';
import { themeFavoritesRouter } from './api/themes/favorites';
import { waitlistRouter } from './api/waitlist/waitlist';
import { usersRouter } from './api/users/users-router';
import { rolesRouter } from './api/roles/router';
import { apiKeysRouter } from './api/api-keys/router';
import { skillsRouter } from './api/skills/skills';
import { tasksRouter } from './api/tasks/tasks';
@@ -26,8 +27,8 @@ import { pluginsRouter } from './api/plugins/router';
import { isPluginPublicPath, pluginForProtocolHeaders } from './plugins/public-paths';
import { agentHandoffRouter } from './api/agent-handoff/router';
import { terminalRouter } from './api/terminal/sidecar-server';
import { minesweeperRouter } from './api/minesweeper/router';
import { sendoffRouter } from './api/sendoff/router';
import { subAgentsRouter } from './api/sub-agents/router';
import { caldavRouter } from './api/dav/sidecar-server';
// import { memosRouter } from './api/memos/router';
import { appStoreRouter } from './api/app-store/router';
@@ -128,6 +129,7 @@ const PROTECTED_MOUNTS: [prefix: string, router: ReturnType<typeof createRouter>
// Protected, unlike `/themes` beside it — see api/themes/favorites.ts for why they are separate mounts.
['/theme-favorites', themeFavoritesRouter],
['/users', usersRouter],
['/roles', rolesRouter],
['/skills', skillsRouter],
['/tasks', tasksRouter],
['/agents', agentsRouter],
@@ -141,8 +143,8 @@ const PROTECTED_MOUNTS: [prefix: string, router: ReturnType<typeof createRouter>
['/dashboards', dashboardsRouter],
['/file-browser', fileBrowserRouter],
['/terminal', terminalRouter],
['/minesweeper', minesweeperRouter],
['/sendoff', sendoffRouter],
['/sub-agents', subAgentsRouter],
// ['/memos', memosRouter], // plugin — switched off 2026-08-13
['/app-store', appStoreRouter],
['/plugins', pluginsRouter],
+13 -2
View File
@@ -23,7 +23,7 @@ import { assertPermissionTotality, isExemptApiPath } from './totality';
// switched off 2026-08-13. It was listed here until 2026-08-18 and made this file's own totality tests
// fail for five days — the mirror claiming a provider the server does not serve, which is precisely the
// drift the comment above warns about, caught by the check and then ignored because it was "the baseline".
const REAL_WS = ['terminal', 'chat', 'chat-notify', 'task-runner', 'pipeline', 'sidecar', 'minesweeper'];
const REAL_WS = ['terminal', 'chat', 'chat-notify', 'task-runner', 'pipeline', 'sidecar'];
const realApi = () => [...new Set(PERMISSIONS.flatMap((c) => c.api))];
const surface = () => ({
apiPrefixes: [...realApi(), '/auth', '/landing-page-data', '/waitlist', '/sidecar'],
@@ -241,8 +241,19 @@ describe('kinds', () => {
// both refusing non-owners because a turn still spawned the agent as the owner. Both refusals were removed
// on 2026-08-12, together, once the turn ran under `runAs` with the member's own home, credential,
// transcripts and session ownership. `chat` is now confined in fact and not only in the registry.
//
// `sub-agents` joined on 2026-08-23, and it is confined IN FACT on the day it was added rather than ahead of
// itself. `POST /sub-agents/spawn` resolves the identity through `chatIdentity` from the caller's token and
// passes `member: { osUser, home }` to the sidecar — the same mechanism `chat` runs under, reached by the
// same resolver. It inherits the containment rather than claiming it: there is no path in that endpoint that
// chooses a directory, so there is nothing for a caller to point somewhere else.
test('confined is a short, deliberate list', () => {
expect(PERMISSIONS.filter((c) => c.kind === 'confined').map((c) => c.key)).toEqual(['terminal', 'chat', 'files']);
expect(PERMISSIONS.filter((c) => c.kind === 'confined').map((c) => c.key)).toEqual([
'terminal',
'chat',
'files',
'sub-agents',
]);
});
test('admin permissions are never grantable', () => {
+34 -19
View File
@@ -328,25 +328,6 @@ const CORE_REGISTRY: Permission[] = [
ws: ['task-runner', 'pipeline'],
routes: ['/jobs'],
},
// Minesweeper X, on a virtual display, streamed to the browser over RFB.
//
// `execution` rather than `app`, and the reason is not that a game is dangerous. The wine process runs
// as the SERVER OWNER on the owner's display — so its File and Extras menus are file dialogs with the
// owner's home behind them, and "granted Minesweeper" would quietly mean "granted a file picker as the
// owner". `plugins/desktop` reached the same conclusion from the same premise.
//
// There is a second reason to keep it here for now: one display and one game means two viewers share a
// board and fight over the mouse. Per-viewer sessions would be a display and a wine prefix each, which
// is cheap for this but is a design decision rather than an implementation detail.
{
key: 'minesweeper',
label: 'Minesweeper',
description: 'A Windows Minesweeper session on a virtual display, as the server owner',
kind: 'execution',
api: ['/minesweeper'],
ws: ['minesweeper'],
routes: ['/minesweeper'],
},
/*
SendOff is `app`, not `confined`, and the distinction is the point.
@@ -360,6 +341,24 @@ const CORE_REGISTRY: Permission[] = [
person who should decide whether somebody may put a file in your home is you, not whoever administers
roles. This grant only says the feature is reachable at all.
*/
/*
`confined`, and for the same reason chat is.
Spawning an agent runs a process in a home directory — the caller's own, resolved by `chatIdentity`
from their token. So it needs exactly what chat needs: a Linux account for a member, and nothing for
the owner, with the kernel doing the containing. `authorize.ts` drops a confined grant for an account
whose `osUser` is null, which is what stops "granted but unconfined" resolving to the owner's home.
Not `execution`: that kind exists for surfaces that can ONLY ever run as the owner. This one runs as
whoever called it, which is the whole distinction.
*/
{
key: 'sub-agents',
label: 'Sub-agents',
description: 'Start another agent from a prompt, subject to the account budget',
kind: 'confined',
api: ['/sub-agents'],
},
{
key: 'sendoff',
label: 'SendOff',
@@ -443,6 +442,22 @@ const CORE_REGISTRY: Permission[] = [
// `headscale` lived here until 2026-08-15, when it left with the rest of offscale. A plugin declares
// its own permissions in its manifest and they are registered at install — see plugins/mount.ts. The
// platform no longer knows this permission exists, which is the entire point.
{
key: 'roles',
label: 'Roles',
description: 'Create, rename and delete the roles this server grants',
// Admin, and for the same reason `user-admin` beside it is: a role is not a member's own data, it is
// policy that governs every account holding it, so there is no level of "read" that makes creating or
// deleting one a feature to grant. `registry.test.ts` asserts admin can never be handed out — this
// entry is what makes that assertion mean something for roles specifically.
//
// Separate from `user-admin` rather than folded into it: that permission's `/users` is the account
// list and the grants a role holds (`/users/permissions`); this one is the roles TABLE itself — the
// name, the description, whether it is system-named. Two routers, two questions, so a boot-time check
// that a mounted prefix has exactly one owner stays meaningful for both.
kind: 'admin',
api: ['/roles'],
},
];
// ── Derived lookups ───────────────────────────────────────────────────────────────────────────────
+6
View File
@@ -54,6 +54,12 @@ const EXEMPT_WS_PROVIDERS: Record<string, string> = {
// same cookie the HTTP side issues after verifying the OWNER's token — so it carries proof of the owner
// without carrying an account through `upgradeWs`. Refused outright without that cookie.
'dev-proxy': 'dev server HMR relay; gated by the owner-only cookie the dev proxy issues',
// One relay serving every plugin's socket, so a single registry entry here would be a HOLE: granting one
// plugin would grant them all. `upgradePluginWs` therefore asks the PLUGIN's own capability, as if the
// socket were a GET against its HTTP prefix — which means the decision is already in the registry, just
// not under this provider's name. Exempt because the check is per-request and per-plugin, never because
// it is absent.
'plugin-ws': "relayed per plugin; authorised by that plugin's own capability in upgradePluginWs",
};
/**
+1 -1
View File
@@ -241,7 +241,7 @@ export async function installPlugin(
await step(steps, onStep, `dependencies: installing ${deps.packagesToInstall.join(', ')} with ${deps.manager}`);
}
const installed = deps.packagesToInstall.length
? await installDependencies(deps.manager!, deps.packagesToInstall)
? await installDependencies(deps.manager!, deps.packagesToInstall, deps.architectures)
: { ok: true as const, installed: [], output: '' };
if (!installed.ok) {
return {
+106 -4
View File
@@ -105,7 +105,7 @@ export type OsDependency = {
* which for a binary that is present anyway is correct and silent, and otherwise becomes an instruction
* to the owner rather than a guess.
*/
packages: Partial<Record<PackageManager, string>>;
packages: Partial<Record<PackageManager, string | string[]>>;
/**
* WHO has to be able to run this.
*
@@ -125,6 +125,33 @@ export type OsDependency = {
* See `docs/plugin-dependency-scope.md`.
*/
scope?: 'owner' | 'shared';
/**
* An architecture this dependency needs enabled before its package can be installed.
*
* Debian and Ubuntu only, and it means exactly one thing: run `dpkg --add-architecture <arch>` followed
* by `apt-get update` before installing, if that architecture is not already enabled.
*
* ── Why this is a field and not a package name ──
*
* Because it cannot be one. A 32-bit package on a 64-bit host is `wine32:i386`, and installing it fails
* outright until the host has been told i386 exists — which is a change to the machine's dpkg
* configuration, not a package to fetch. Minesweeper found this the direct way: `wine` alone installs
* 64-bit-only, the plugin reports a clean install, and the game dies with `Bad EXE format`.
*
* ── Why it is an enum and not a command ──
*
* This runs as root. A manifest that could supply the command would be a manifest that can run anything
* as root on every machine that installs it, which is a far larger grant than "this plugin may install
* wine". The manifest picks a value from `DPKG_ARCHITECTURES`; the platform owns the sentence it turns
* into. Same principle as the plugin websocket naming a sidecar rather than a port.
*
* It is also SYSTEM-WIDE and does not go away when the plugin does. `plugins:delete` will not disable an
* architecture something else may now depend on, so this is shown to the owner before they consent
* rather than mentioned in a log afterwards.
*
* Ignored where it means nothing — a pacman or brew host is already multi-arch or has no such concept.
*/
multiarch?: DpkgArchitecture;
/**
* A release binary, for a dependency no package manager carries.
*
@@ -282,6 +309,44 @@ export type PluginManifest = {
* a missing one that cannot be installed here refuses the install rather than proceeding to a plugin
* that runs and quietly produces nothing.
*/
/**
* A websocket this plugin serves, relayed by the platform.
*
* Declaring this makes `/api/plugin-ws/<appName>` a frame relay onto `ws://127.0.0.1:<port>/ws`, where the
* port is the one the named sidecar announced at registration. It exists because Bun's route table is
* fixed at `serve()`, so a plugin installed afterwards could never add a socket route — which is why
* `/minesweeper` had to live in the platform and `plugins/desktop` could not stream a display at all.
*
* Authorisation is the plugin's OWN capability, asked as if the socket were a GET against its HTTP prefix.
* There is deliberately no separate socket permission: granting the plugin grants its socket, and nothing
* can drift out of step because there is only one decision.
*
* The target is a SIDECAR, always, and never a port number a manifest picked.
*
* A fixed-port form existed for about an hour and was removed before it shipped anywhere. The hole is
* total: nothing stops a manifest naming a port it does not own, so `{ port: 5432 }` plus a grant is a
* raw TCP relay onto Postgres, authenticated by the platform, for anyone that plugin is granted to. `:22`
* and officer's own port are the same sentence. Checking that the HOST was loopback — which the relay
* does — is not the same as checking the PORT belongs to the plugin, and only the second one matters.
*
* A sidecar's port is trustworthy for a reason a declaration can never be: the platform watched it
* arrive. The sidecar binds an ephemeral port and announces it at registration, so the association
* between "this port" and "this plugin" is something the platform observed rather than something a
* manifest asserted. Provenance, not a claim.
*
* The cost is that a plugin wanting a socket needs a sidecar. That is not ceremony — it is the thing
* that makes the port mean anything. It costs nothing else: the socket lives at `/ws` on the SAME
* listener the sidecar already serves its routes from, so a plugin does not choose between having a
* socket and having ordinary HTTP.
*
* **The sidecar serves a websocket, not a raw stream.** Whatever it is really talking to — a VNC display,
* a line protocol, another process entirely — the conversion happens inside the plugin, because the
* plugin is the only thing that knows. The platform moves frames it does not read.
*
* The host is always loopback and cannot be set. A plugin naming an arbitrary host would be a
* request-forgery primitive reachable by anyone the plugin is granted to.
*/
websocket?: { sidecar: string };
osDependencies?: OsDependency[];
/**
@@ -471,7 +536,26 @@ export const PACKAGE_MANAGERS: PackageManager[] = ['apt', 'pacman', 'dnf', 'brew
* not a regex that already allows it.
*/
const BINARY_RE = /^[a-zA-Z0-9][a-zA-Z0-9._-]{0,63}$/;
const PACKAGE_RE = /^[a-z0-9][a-z0-9.+-]{0,63}$/;
/**
* A package name, optionally qualified by an architecture.
*
* `wine32:i386` is the motivating case and it is not an edge case: on Debian and Ubuntu a 32-bit package
* on a 64-bit host can only be named that way. The suffix is drawn from `DPKG_ARCHITECTURES` below rather
* than being any word, so this stays a closed vocabulary — the point of a narrow regex here is that a
* manifest cannot get a metacharacter onto an `apt-get` command line, and widening it to `[a-z0-9]+`
* after the colon would still be safe but would stop being a vocabulary.
*/
const PACKAGE_RE = /^[a-z0-9][a-z0-9.+-]{0,63}(:(i386|amd64|arm64|armhf|ppc64el|s390x))?$/;
/**
* Architectures `dpkg --add-architecture` accepts, and the only values a manifest may ask to enable.
*
* Closed on purpose. `multiarch` turns into a command run as root, so the manifest gets to pick from a
* list rather than to supply a string — the same reasoning as the package regex one line up, applied to
* the one field that would otherwise be a way to say "run this as root" out loud.
*/
export const DPKG_ARCHITECTURES = ['i386', 'amd64', 'arm64', 'armhf', 'ppc64el', 's390x'] as const;
export type DpkgArchitecture = (typeof DPKG_ARCHITECTURES)[number];
/** Reasons an `osDependencies` list is unusable. Empty when it is fine. */
function osDependencyProblems(deps: unknown): string[] {
@@ -502,6 +586,13 @@ function osDependencyProblems(deps: unknown): string[] {
problems.push(`${at}.packages must be an object keyed by package manager`);
continue;
}
const multiarch = (dep as { multiarch?: unknown }).multiarch;
if (multiarch !== undefined && !DPKG_ARCHITECTURES.includes(multiarch as never)) {
// Refused rather than ignored: a typo here silently drops the one step that makes the package
// installable at all, and the failure surfaces much later as the plugin not working.
problems.push(`${at}.multiarch must be one of ${DPKG_ARCHITECTURES.join(', ')}`);
}
for (const [manager, name] of Object.entries(packages)) {
if (!PACKAGE_MANAGERS.includes(manager as PackageManager)) {
problems.push(
@@ -509,8 +600,19 @@ function osDependencyProblems(deps: unknown): string[] {
);
continue;
}
if (typeof name !== 'string' || !PACKAGE_RE.test(name)) {
problems.push(`${at}.packages.${manager} must be a plain package name — lowercase, digits, dot, plus, dash`);
// A LIST is allowed, because one binary genuinely can need more than one package. wine is the case:
// `wine` provides the launcher on PATH and `wine32:i386` provides the 32-bit loader it needs to run
// an i386 executable, and installing either alone produces a wine that cannot run the thing the
// plugin came for. Every element is validated the same way and they reach apt as separate argv
// entries, so a list is no more powerful than the names in it.
const names = Array.isArray(name) ? name : [name];
const bad = names.length === 0 || names.some((n) => typeof n !== 'string' || !PACKAGE_RE.test(n));
if (bad) {
problems.push(
`${at}.packages.${manager} must be a plain package name (or a non-empty list of them) — ` +
`lowercase, digits, dot, plus, dash, optionally with an architecture suffix ` +
`(${DPKG_ARCHITECTURES.join(', ')})`,
);
}
}
}
+70
View File
@@ -241,6 +241,76 @@ const BUNDLED: CatalogueEntry[] = [
// No db/ — the mirror keeps nothing. The password lives in the owner's ~/.vnc, written by the sidecar.
has: { api: true, schema: false, sidecar: true, web: true },
},
{
appName: 'minesweeper',
publisher: 'officerdev',
version: '1.0.0',
platform: '>=1.0.0',
label: 'Minesweeper',
summary: 'Minesweeper X under wine, on a headless display, streamed to the browser',
color: '#64748b',
icon: 'Bomb',
source: 'https://gitea.officer.dev/plugins/minesweeper.git',
permissions: [
{
key: 'minesweeper',
label: 'Minesweeper',
description:
'Play Minesweeper on the server display. The game is confined to its own wine prefix and can reach nothing else on the machine.',
},
],
// Six binaries, and this is the entry where the duplication above earns its keep: the owner sees what
// installing this will make the machine acquire BEFORE consenting, and for wine that is not a small ask.
//
// `apt: 'wine'` is deliberately not the whole story and cannot be. The game is a 32-bit VB6 executable,
// so the host also needs `dpkg --add-architecture i386` and `wine32:i386` — a system-wide change that no
// package name can express, which is why the reason carries the command instead of pretending.
//
// Xvfb has no dnf entry because Fedora spells it `xorg-x11-server-Xvfb`, with a capital X, and a
// manifest package name must be lowercase. Absent means "cannot be installed automatically here", which
// becomes an instruction rather than a wrong guess.
osDependencies: [
{
binary: 'wine',
reason:
'Runs the game. Minesweeper X is a 32-bit Windows executable, so this host also needs i386 multiarch (`dpkg --add-architecture i386`) and the 32-bit wine package — a 64-bit-only wine cannot load it.',
multiarch: 'i386',
packages: { apt: ['wine', 'wine32:i386'], dnf: 'wine', pacman: 'wine', brew: 'wine-stable' },
},
{
binary: 'Xvfb',
reason:
'The virtual display the game draws on. A framebuffer with no hardware behind it, so nothing appears on any real monitor.',
packages: { apt: 'xvfb', pacman: 'xorg-server-xvfb' },
},
{
binary: 'x11vnc',
reason:
'Reads that display and serves it, so the browser has something to draw. Bound to a private unix socket, never a port.',
packages: { apt: 'x11vnc', dnf: 'x11vnc', pacman: 'x11vnc' },
},
{
binary: 'xdotool',
reason:
'Finds the game window and reads its size, so the panel can fit its canvas to the board instead of the whole framebuffer.',
packages: { apt: 'xdotool', dnf: 'xdotool', pacman: 'xdotool' },
},
{
binary: 'xdpyinfo',
reason:
'Waits for the display to be usable. A live Xvfb process is not the same as a display that answers, and starting the game too early fails silently.',
packages: { apt: 'x11-utils', dnf: 'xorg-x11-utils', pacman: 'xorg-xdpyinfo' },
},
{
binary: 'winetricks',
reason:
'Installs the Visual Basic 6 runtime into the wine prefix on first start. Minesweeper X needs MSVBVM60.DLL, which wine does not ship; without it the process exits immediately with nothing but an unresolved-import line.',
packages: { apt: 'winetricks', dnf: 'winetricks', pacman: 'winetricks' },
},
],
// No schema. The session is processes and a wine prefix on disk, and none of that belongs in Postgres.
has: { api: true, schema: false, sidecar: true, web: true },
},
{
appName: 'jellyfin',
publisher: 'officerdev',
+123
View File
@@ -0,0 +1,123 @@
import { describe, expect, test } from 'bun:test';
import { DPKG_ARCHITECTURES, manifestProblems } from './manifest';
import { reportDependencies } from './os-deps';
import type { DiscoveredPlugin, OsDependency } from './manifest';
/**
* A package cannot be installed for an architecture the host does not know about, and no package name can
* say so — which is why `multiarch` is a field rather than something clever in the package string.
*
* Minesweeper is the case that produced it: `apt-get install wine` on a 64-bit host succeeds, reports a
* clean plugin install, and leaves a 32-bit game dying with `Bad EXE format`. Nothing in that chain
* mentions architectures, so it is worth pinning the two properties that keep it working.
*/
const dep = (over: Partial<OsDependency> = {}): OsDependency => ({
binary: 'definitely-not-a-real-binary-xyzzy',
reason: 'test',
packages: { apt: 'some-package' },
...over,
});
const plugin = (deps: OsDependency[]): DiscoveredPlugin =>
({ appName: 'probe', dir: '/tmp/probe', manifest: { osDependencies: deps } }) as unknown as DiscoveredPlugin;
describe('multiarch is a closed vocabulary, not a command', () => {
test('a valid architecture is accepted', () => {
for (const arch of DPKG_ARCHITECTURES) {
const problems = manifestProblems('probe', {
publisher: 'x',
version: '1.0.0',
platform: '>=1.0.0',
label: 'X',
summary: 'x',
color: '#000000',
permissions: [],
osDependencies: [dep({ multiarch: arch })],
} as never);
expect(problems.filter((p) => p.includes('multiarch'))).toEqual([]);
}
});
// The whole point of the enum. A manifest that could supply the string could run it as root on every
// machine that installs the plugin, which is a far larger grant than "may install wine".
test('anything else is refused, including something shell-shaped', () => {
for (const bad of ['i486', 'I386', 'i386; rm -rf /', '$(whoami)', '']) {
const problems = manifestProblems('probe', {
publisher: 'x',
version: '1.0.0',
platform: '>=1.0.0',
label: 'X',
summary: 'x',
color: '#000000',
permissions: [],
osDependencies: [dep({ multiarch: bad as never })],
} as never);
expect(problems.some((p) => p.includes('multiarch'))).toBe(true);
}
});
test('a package name may carry a known architecture suffix, and only a known one', () => {
const ok = manifestProblems('probe', {
publisher: 'x',
version: '1.0.0',
platform: '>=1.0.0',
label: 'X',
summary: 'x',
color: '#000000',
permissions: [],
osDependencies: [dep({ packages: { apt: 'wine32:i386' } })],
} as never);
expect(ok.filter((p) => p.includes('packages'))).toEqual([]);
// The list form, which is what wine actually needs.
const list = manifestProblems('probe', {
publisher: 'x',
version: '1.0.0',
platform: '>=1.0.0',
label: 'X',
summary: 'x',
color: '#000000',
permissions: [],
osDependencies: [dep({ packages: { apt: ['wine', 'wine32:i386'] } })],
} as never);
expect(list.filter((p) => p.includes('packages'))).toEqual([]);
const bad = manifestProblems('probe', {
publisher: 'x',
version: '1.0.0',
platform: '>=1.0.0',
label: 'X',
summary: 'x',
color: '#000000',
permissions: [],
osDependencies: [dep({ packages: { apt: 'wine32:sparc' } })],
} as never);
expect(bad.some((p) => p.includes('packages'))).toBe(true);
});
});
describe('the report tells the owner what will CHANGE', () => {
test('a missing dependency surfaces its architecture', () => {
const report = reportDependencies(plugin([dep({ multiarch: 'i386' })]));
expect(report.missing.length).toBe(1);
// Reported on every host. Whether it is ACTED on is apt-only — see `enableArchitectures` — but the
// owner is told what the plugin asks for regardless of what this machine will do about it.
expect(report.architectures).toEqual(['i386']);
});
// A binary already on PATH had its architecture enabled at some point in the past. Re-reporting it would
// tell the owner the machine is about to change when it is not.
test('a dependency that is already present does not', () => {
const report = reportDependencies(plugin([dep({ binary: 'sh', multiarch: 'i386' })]));
expect(report.missing.length).toBe(0);
expect(report.architectures).toEqual([]);
});
test('two dependencies wanting the same architecture report it once', () => {
const report = reportDependencies(
plugin([dep({ binary: 'nope-a-xyzzy', multiarch: 'i386' }), dep({ binary: 'nope-b-xyzzy', multiarch: 'i386' })]),
);
expect(report.architectures).toEqual(['i386']);
});
});
+123 -5
View File
@@ -1,7 +1,7 @@
import { chmodSync, existsSync, mkdirSync, renameSync, rmSync, statSync } from 'node:fs';
import { homedir, userInfo } from 'node:os';
import { dirname, join } from 'node:path';
import { PACKAGE_MANAGERS, type DiscoveredPlugin, type OsDependency, type PackageManager } from './manifest';
import { PACKAGE_MANAGERS, type DiscoveredPlugin, type DpkgArchitecture, type OsDependency, type PackageManager } from './manifest';
// Host binaries a plugin needs, and getting them onto the machine.
//
@@ -58,7 +58,13 @@ export type DependencyStatus = {
path: string | null;
present: boolean;
/** What would be installed on THIS machine, or null when this manager has no entry for it. */
packageName: string | null;
/**
* The package(s) that would provide this binary here, or null when this manager has no entry for it.
*
* A LIST because one binary can need more than one package — wine needs both its launcher and the 32-bit
* loader, and installing either alone gives a wine that cannot run what the plugin came for.
*/
packageName: string[] | null;
/** Resolved download URL when the plugin ships a release binary, or null. */
releaseUrl: string | null;
/**
@@ -81,8 +87,21 @@ export type DependencyStatus = {
unreachable: boolean;
/** Why it is unreachable, for the install log. */
unreachableReason: string | null;
/**
* Carried through from the manifest so the report can say what installing this will CHANGE, not just
* what it will fetch. Enabling an architecture is system-wide and permanent.
*/
multiarch: DpkgArchitecture | null;
};
/** A dependency's packages for one manager, always as a list — the manifest allows either form. */
export function packageNames(dep: OsDependency, manager: PackageManager): string[] | null {
const entry = dep.packages[manager];
if (!entry) return null;
const names = Array.isArray(entry) ? entry : [entry];
return names.length ? names : null;
}
/** `linux`/`darwin` and `amd64`/`arm64` — the spelling Go releases use, which is who publishes this way. */
export function hostTarget(): { os: string; arch: string } {
const os = process.platform === 'darwin' ? 'darwin' : 'linux';
@@ -252,8 +271,9 @@ function probe(dep: OsDependency, manager: PackageManager | null): DependencySta
scope,
unreachable: !!path && genuine && !reach.ok,
unreachableReason: reach.reason,
packageName: (manager && dep.packages[manager]) || null,
packageName: manager ? packageNames(dep, manager) : null,
releaseUrl: releaseUrlFor(dep),
multiarch: dep.multiarch ?? null,
};
}
@@ -268,6 +288,15 @@ export type DependencyReport = {
* has. These are the owner's to resolve by hand, and the install says so rather than guessing.
*/
unresolvable: DependencyStatus[];
/**
* Architectures the missing packages need enabled first — `dpkg --add-architecture`, apt hosts only.
*
* Reported rather than done quietly because it is SYSTEM-WIDE and permanent: nothing here ever disables
* one, including uninstalling the plugin. The owner should see "this will change how this machine
* resolves packages" on the screen where they consent, not in a log afterwards.
*/
architectures: DpkgArchitecture[];
/** Can the platform actually run the install — passwordless sudo, or a manager that never needs it. */
canInstall: boolean;
/** Why not, when it cannot. Written to be shown to a person. */
@@ -305,7 +334,7 @@ export function reportDependencies(plugin: DiscoveredPlugin): DependencyReport {
// Deduped and sorted: ffmpeg and ffprobe are one apt package, and naming it twice on the command line
// is the sort of thing that reads as a bug in a log even though apt does not care.
const packagesToInstall = [...new Set(missing.map((d) => d.packageName).filter((n): n is string => !!n))].sort();
const packagesToInstall = [...new Set(missing.flatMap((d) => d.packageName ?? []))].sort();
let canInstall = true;
let blockedReason: string | null = null;
@@ -343,7 +372,14 @@ export function reportDependencies(plugin: DiscoveredPlugin): DependencyReport {
'Install the packages yourself and then install the plugin.';
}
return { manager, dependencies, missing, packagesToInstall, unresolvable, canInstall, blockedReason };
// Only for the ones actually being installed. A binary already present needed its architecture enabled
// at some point in the past, and re-reporting that would tell the owner the machine is about to change
// when it is not.
const architectures = [
...new Set(missing.map((d) => d.multiarch).filter((a): a is DpkgArchitecture => !!a)),
];
return { manager, dependencies, missing, packagesToInstall, unresolvable, architectures, canInstall, blockedReason };
}
/** The command that would be run, as argv. Exported so the UI can SHOW it — the owner should see it. */
@@ -451,6 +487,81 @@ export async function installRelease(dep: DependencyStatus): Promise<{ ok: boole
}
}
/**
* Enable a foreign architecture, so a package that only exists for it can be installed.
*
* ── Why the platform runs this at all ──
*
* Because no package name can express it. `wine32:i386` is not installable until dpkg has been told the
* architecture exists, and that is a change to the machine's configuration rather than a package to
* fetch. Leaving it to the owner means an install that reports success and produces a plugin that does
* not work — which is exactly what happened with Minesweeper: `wine` alone lands 64-bit-only and the game
* dies with `Bad EXE format`, several steps away from anything that mentions architectures.
*
* ── What it will and will not do ──
*
* apt hosts only. pacman and brew have no equivalent, and dnf resolves multilib without being asked.
*
* It is SYSTEM-WIDE and permanent. Nothing here ever removes an architecture, including
* `plugins:delete` — something else may depend on it by then, and disabling one with packages installed
* against it is how a machine ends up unable to run `apt-get -f install`. The manifest field is shown to
* the owner before they consent for this reason.
*
* Already-enabled is success and costs one `dpkg` call. `apt-get update` runs only when something
* actually changed, because it is slow and there is no reason to pay for it otherwise.
*/
async function enableArchitectures(
manager: PackageManager,
architectures: DpkgArchitecture[],
): Promise<{ ok: boolean; output: string; error?: string }> {
const wanted = [...new Set(architectures)];
if (!wanted.length || manager !== 'apt') return { ok: true, output: '' };
if (!Bun.which('dpkg')) return { ok: true, output: '' };
const current = Bun.spawnSync(['dpkg', '--print-foreign-architectures']);
const enabled = new Set(new TextDecoder().decode(current.stdout).split(/\s+/).filter(Boolean));
const missing = wanted.filter((a) => !enabled.has(a));
if (!missing.length) return { ok: true, output: '' };
const escalate = sudoAvailable() ? ['sudo', '-n'] : [];
let output = '';
for (const arch of missing) {
// argv, never a shell string — and `arch` came from a closed enum in the manifest validator, so this
// is belt and braces rather than the only guard. Both halves are deliberate; see the header comment.
const proc = Bun.spawn([...escalate, 'dpkg', '--add-architecture', arch], { stdout: 'pipe', stderr: 'pipe' });
const [out, err] = await Promise.all([new Response(proc.stdout).text(), new Response(proc.stderr).text()]);
const code = await proc.exited;
output += `${out}${err}`;
if (code !== 0) {
return {
ok: false,
output: output.trim().slice(-600),
error:
`could not enable the ${arch} architecture, which this plugin's packages need. ` +
`Run it by hand: sudo dpkg --add-architecture ${arch} && sudo apt-get update`,
};
}
}
// The package lists have no entries for an architecture that was not enabled a moment ago, so without
// this the install that follows cannot find anything to install.
const upd = Bun.spawn([...escalate, 'apt-get', 'update'], { stdout: 'pipe', stderr: 'pipe' });
const [uo, ue] = await Promise.all([new Response(upd.stdout).text(), new Response(upd.stderr).text()]);
const updCode = await upd.exited;
output += `${uo}${ue}`;
if (updCode !== 0) {
return {
ok: false,
output: output.trim().slice(-600),
error: `enabled ${missing.join(', ')} but \`apt-get update\` failed, so the new package lists are not available yet`,
};
}
return { ok: true, output: output.trim().slice(-600) };
}
export type InstallDependenciesResult = { ok: boolean; installed: string[]; output: string; error?: string };
/**
@@ -463,9 +574,16 @@ export type InstallDependenciesResult = { ok: boolean; installed: string[]; outp
export async function installDependencies(
manager: PackageManager,
packages: string[],
architectures: DpkgArchitecture[] = [],
): Promise<InstallDependenciesResult> {
if (!packages.length) return { ok: true, installed: [], output: '' };
// Architectures FIRST, and the order is not cosmetic: `apt-get install wine32:i386` fails outright on a
// host that has not been told i386 exists, so doing this after would install nothing and report a
// package that does not exist.
const arch = await enableArchitectures(manager, architectures);
if (!arch.ok) return { ok: false, installed: [], output: arch.output, error: arch.error };
try {
const proc = Bun.spawn(installCommand(manager, packages), { stdout: 'pipe', stderr: 'pipe' });
const [out, err] = await Promise.all([new Response(proc.stdout).text(), new Response(proc.stderr).text()]);
+26
View File
@@ -120,6 +120,25 @@ export function unregisterSidecar(id: string): void {
}
}
/*
Every sidecar's announced HTTP port, by name.
`createSidecarProxy` already learns this for the prefix it serves, by subscribing to `<name>:server`. That
is per-proxy state and unreachable from anywhere else, which was fine while the only consumer was the
proxy itself — and stopped being fine when a plugin needed a WEBSOCKET relayed onto the same sidecar. A
second subscription in a second place would be a second thing to keep in step.
So the port is recorded here, once, from the same event. A sidecar that has not announced yet is absent
rather than zero: "not listening" and "listening on nothing" are different answers and only one of them is
true.
*/
const sidecarPorts = new Map<string, number>();
/** The port a named sidecar announced, or null if it has not announced one. */
export function sidecarPort(name: string): number | null {
return sidecarPorts.get(name) ?? null;
}
export function handleSidecarMessage(id: string, msg: SidecarEvent): void {
// Check if this is a response to a pending request
if ('id' in msg && msg.id && pending.has(msg.id)) {
@@ -130,6 +149,13 @@ export function handleSidecarMessage(id: string, msg: SidecarEvent): void {
return;
}
// Record any `<name>:server` announcement before dispatching, so `sidecarPort` is current by the time a
// subscriber reacts to the same event.
if ('type' in msg && typeof msg.type === 'string' && msg.type.endsWith(':server')) {
const port = (msg as { port?: number }).port;
if (typeof port === 'number') sidecarPorts.set(msg.type.slice(0, -':server'.length), port);
}
// Otherwise dispatch as event
dispatchEvent(msg);
}
+24 -4
View File
@@ -1,4 +1,4 @@
import { getUserById } from 'officerdb';
import { getUserById, OWNER_USER_ID } from 'officerdb';
// Identifies the platform owner. The user's `role` column IS the answer — there is no second mechanism
// and no environment variable.
@@ -13,10 +13,30 @@ import { getUserById } from 'officerdb';
// are editable, and a cache with no invalidation contract is a staleness bug waiting for whoever builds
// the role UI. This is one primary-key lookup on a request that has already verified a JWT.
export async function isSuperAdmin(payload: { id?: number } | null | undefined): Promise<boolean> {
if (!payload?.id) return false;
return isOwner(payload);
}
/**
* The owner is an IDENTITY, not a role. `OWNER_USER_ID` and nothing else.
*
* This asked `user.role === 'Super Admin'` until 2026-08-23, which was correct while roles were a hardcoded
* TypeScript union and nothing could write a new one. The moment roles became a table it became a
* privilege-escalation path: "add a role" and "become the owner" are the same feature, reachable from
* whatever UI manages roles.
*
* So the question moved to one nothing in the product can answer for itself. `Super Admin` is still a role
* and several accounts may hold it — it provisions an OS account with sudo, which is its own decision — but
* holding it is not being the owner and no role grants that.
*
* Kept as a database read rather than a bare comparison, deliberately. A deleted or blocked account must not
* still be the owner because its id happens to match, and this is one primary-key lookup on a request that
* has already verified a JWT.
*/
export async function isOwner(payload: { id?: number } | null | undefined): Promise<boolean> {
if (payload?.id !== OWNER_USER_ID) return false;
try {
const user = await getUserById(payload.id);
return user?.role === 'Super Admin';
const user = await getUserById(OWNER_USER_ID);
return !!user;
} catch {
// A transient database error must never promote anyone. Deny, and let the next call retry.
return false;
@@ -0,0 +1,35 @@
import type { ReactNode } from 'react';
type UntranslatedProps = {
children: ReactNode;
/**
* Why this text is not localized. Required so the decision is legible at the call site.
*
* `foreign-ui-label` — quoted from another product's interface ("click **Enable**"). It has to match
* what the reader sees on THEIR screen, and that product localizes by its own account language.
* `product-name` — the name of a product or feature: Tmux, Neovim, Claude Code, Officer. The doc's
* never-translate list covers these directly.
*/
reason: 'foreign-ui-label' | 'product-name';
className?: string;
};
/**
* Text that is deliberately NOT localized, marked as such where it is written.
*
* The first reason was `foreign-ui-label`: a label quoted from another product's interface, which
* docs/localization.md classifies as an identifier rather than prose. "Click **Enable**" has to match
* what the reader sees on Google's screen, and Google localises by their Google account language rather
* than by ours — so translating it sends somebody hunting for "Ativar" in a console that says "Enable".
*
* It exists as a component rather than a comment for two reasons. It states the decision at every call
* site, where the next person editing the sentence will see it. And it gives the scanner something exact
* to skip: without that, ~40 labels that MUST stay English count as debt forever, and the area can never
* be held at zero — the same trap as counting `new Error()` messages.
*
* `reason` is a closed union on purpose. A second legitimate reason should be argued for and added here,
* not smuggled in as free text.
*/
export const Untranslated = ({ children, className }: UntranslatedProps) => (
<strong className={className}>{children}</strong>
);
@@ -0,0 +1,81 @@
{
"button": {
"cancel": "Abbrechen",
"confirm": "Bestätigen",
"ok": "OK",
"close": "Schließen"
},
"search": {
"placeholder": "Suchen",
"open": "Suche öffnen",
"close": "Suche schließen",
"clear": "Suche leeren"
},
"select": {
"placeholder": "Auswählen..."
},
"tabs": {
"filterPlaceholder": "Filtern"
},
"commandBlock": {
"run": "Im Terminal ausführen",
"copy": "Befehl kopieren"
},
"colorPicker": {
"placeholder": "Hex-Farbe"
},
"state": {
"loading": "Wird geladen…"
},
"dataTable": {
"empty": "Keine Daten gefunden.",
"pagination": {
"showingPage": "Seite {{current}} von {{total}}",
"showingPageShort": "S. {{current}}/{{total}}",
"rowsPerPage": "Zeilen pro Seite",
"perPage": "{{size}} / Seite",
"perPageShort": "{{size}}/S.",
"first": "Erste",
"prev": "Zurück",
"next": "Weiter",
"last": "Letzte"
}
},
"pagination": {
"label": "Seitennummerierung",
"previous": "Zurück",
"next": "Weiter",
"morePages": "Weitere Seiten",
"goToPrevious": "Zur vorherigen Seite",
"goToNext": "Zur nächsten Seite"
},
"carousel": {
"previous": "Vorherige Folie",
"next": "Nächste Folie"
},
"breadcrumb": {
"more": "Mehr"
},
"theme": {
"toggle": "Farbmodus umschalten"
},
"error": {
"forbidden": {
"title": "Zugriff nicht autorisiert",
"description": "Sie sind nicht berechtigt, diese Aktion auszuführen.",
"hint": "Wenn Sie das für einen Fehler halten, wenden Sie sich an Ihre zuständige Person."
},
"unauthorized": {
"title": "Ungültige Anmeldedaten",
"description": "Ihr Zugriffstoken ist abgelaufen",
"hint": "Bitte melden Sie sich erneut an"
},
"server": {
"title": "Serverfehler"
}
},
"logo": {
"icon": "Officer-Symbol",
"logo": "Officer-Logo"
}
}
@@ -0,0 +1,81 @@
{
"button": {
"cancel": "Cancelar",
"confirm": "Confirmar",
"ok": "Aceptar",
"close": "Cerrar"
},
"search": {
"placeholder": "Buscar",
"open": "Abrir búsqueda",
"close": "Cerrar búsqueda",
"clear": "Borrar búsqueda"
},
"select": {
"placeholder": "Seleccionar..."
},
"tabs": {
"filterPlaceholder": "Filtrar"
},
"commandBlock": {
"run": "Ejecutar en el terminal",
"copy": "Copiar comando"
},
"colorPicker": {
"placeholder": "Color hexadecimal"
},
"state": {
"loading": "Cargando…"
},
"dataTable": {
"empty": "No se encontraron datos.",
"pagination": {
"showingPage": "Mostrando página {{current}} de {{total}}",
"showingPageShort": "p {{current}}/{{total}}",
"rowsPerPage": "Filas por página",
"perPage": "{{size}} / página",
"perPageShort": "{{size}}/p",
"first": "Primera",
"prev": "Anterior",
"next": "Siguiente",
"last": "Última"
}
},
"pagination": {
"label": "Paginación",
"previous": "Anterior",
"next": "Siguiente",
"morePages": "Más páginas",
"goToPrevious": "Ir a la página anterior",
"goToNext": "Ir a la página siguiente"
},
"carousel": {
"previous": "Diapositiva anterior",
"next": "Diapositiva siguiente"
},
"breadcrumb": {
"more": "Más"
},
"theme": {
"toggle": "Alternar modo de color"
},
"error": {
"forbidden": {
"title": "Acceso no autorizado",
"description": "No tienes autorización para realizar esta acción.",
"hint": "Si crees que esto es un error, contacta con tu responsable."
},
"unauthorized": {
"title": "Credenciales no válidas",
"description": "Tu token de acceso ha caducado",
"hint": "Inicia sesión de nuevo"
},
"server": {
"title": "Error del servidor"
}
},
"logo": {
"icon": "Icono de Officer",
"logo": "Logotipo de Officer"
}
}
@@ -0,0 +1,81 @@
{
"button": {
"cancel": "Annuler",
"confirm": "Confirmer",
"ok": "OK",
"close": "Fermer"
},
"search": {
"placeholder": "Rechercher",
"open": "Ouvrir la recherche",
"close": "Fermer la recherche",
"clear": "Effacer la recherche"
},
"select": {
"placeholder": "Sélectionner..."
},
"tabs": {
"filterPlaceholder": "Filtrer"
},
"commandBlock": {
"run": "Exécuter dans le terminal",
"copy": "Copier la commande"
},
"colorPicker": {
"placeholder": "Couleur hexadécimale"
},
"state": {
"loading": "Chargement…"
},
"dataTable": {
"empty": "Aucune donnée trouvée.",
"pagination": {
"showingPage": "Page {{current}} sur {{total}}",
"showingPageShort": "p {{current}}/{{total}}",
"rowsPerPage": "Lignes par page",
"perPage": "{{size}} / page",
"perPageShort": "{{size}}/p",
"first": "Première",
"prev": "Précédente",
"next": "Suivante",
"last": "Dernière"
}
},
"pagination": {
"label": "Pagination",
"previous": "Précédent",
"next": "Suivant",
"morePages": "Plus de pages",
"goToPrevious": "Aller à la page précédente",
"goToNext": "Aller à la page suivante"
},
"carousel": {
"previous": "Diapositive précédente",
"next": "Diapositive suivante"
},
"breadcrumb": {
"more": "Plus"
},
"theme": {
"toggle": "Basculer le mode de couleur"
},
"error": {
"forbidden": {
"title": "Accès non autorisé",
"description": "Vous n'êtes pas autorisé à effectuer cette action.",
"hint": "Si vous pensez qu'il s'agit d'une erreur, contactez votre responsable."
},
"unauthorized": {
"title": "Identifiants invalides",
"description": "Votre jeton d'accès a expiré",
"hint": "Reconnectez-vous"
},
"server": {
"title": "Erreur du serveur"
}
},
"logo": {
"icon": "Icône Officer",
"logo": "Logo Officer"
}
}
+10 -1
View File
@@ -1,8 +1,17 @@
import type { TranslationMap } from 'i18n';
import deDE from './de-DE.json';
import enGB from './en-GB.json';
import esES from './es-ES.json';
import frFR from './fr-FR.json';
import ptPT from './pt-PT.json';
/** Shared components' own catalog, per locale — merged into the app-wide map by `I18nBridge` under `ui.*`. */
export const uiCatalogs: TranslationMap = { 'en-GB': enGB, 'pt-PT': ptPT };
export const uiCatalogs: TranslationMap = {
'en-GB': enGB,
'pt-PT': ptPT,
'es-ES': esES,
'de-DE': deDE,
'fr-FR': frFR,
};
export { useTranslation } from './useTranslation';

Some files were not shown because too many files have changed in this diff Show More