The interface speaks Slovak
969 strings, an instance default and a per-person choice, and no half-done corner: the admin prose is translated too. Design and reasoning: LLeMbas.wiki/Translations. KEYED BY THE ENGLISH SENTENCE A missing entry renders the key, which is the English -- so an untranslated string looks as it always did, an English instance is byte-for-byte 1.6.0, and a half-finished catalogue is a half-translated page rather than a page of dotted key names. The cost is that editing an English sentence orphans its translation silently, which is what tests/test_translations.py asserts in both directions. No gettext: .po -> .mo is a build step and this project does not have one. A JINJA GLOBAL, AND THEREFORE A CONTEXTVAR `t()` is a global for the reason `brand` already documents -- render() is bypassed by 25 TemplateResponse calls and 8 get_template().render() calls, the latter being the SSE frames, which have no Request at all. A global is bound once at import and the language is per person, so the active language is a ContextVar set per request. 🚨 `get_current_user` had to become `async def`. FastAPI runs a sync dependency in a threadpool, and anyio copies the context in and discards it on the way out -- so the language was set where nothing could see it and every page rendered in the instance's language whatever anybody had chosen, with no error anywhere. NOT TRANSLATED, ON PURPOSE Everything a model reads: the 60 prompt fragments, and the dates in harness.py, schedule/runner.py and schedule/compile.py. Only `i18n.stamp` is localised, and only where a person reads it -- with the *format* translatable as well as the words, because "26. septembra 2026" is a different pattern rather than the same one with different words in it. A process locale is not an option: global, not thread-safe, two people's pages at once. A second fragment telling models to answer in the reader's language was written during this work and removed: `core.style` has said it since long before, and test_an_empty_override_turns_a_fragment_off caught the duplicate. THE BULK PASS 1213 sites wrapped by a one-off script that only touched patterns it could not misread. It got three wrong in a way that mattered -- `t('…')` inside `attr="…"` where the sentence held an apostrophe, closing the Jinja string and 500ing two pages whose partials no test renders. tests/test_translations.py now compiles all 110 templates. It also wrapped the product's own name, an SSH key header, a keystroke hint and an example URL, all taken back out: a string is not translatable just because it is a string. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
<div class="topbar__actions">{% block actions %}{% endblock %}</div>
|
||||
</header>
|
||||
|
||||
<nav class="tabs__bar" aria-label="Library">
|
||||
<nav class="tabs__bar" aria-label="{{ t('Library') }}">
|
||||
<a class="tabs__tab {{ 'is-active' if section == 'knowledge' }}"
|
||||
href="/library/knowledge">{{ icon("archive", "icon--sm") }} Knowledge</a>
|
||||
<a class="tabs__tab {{ 'is-active' if section == 'notes' }}"
|
||||
|
||||
@@ -25,8 +25,8 @@
|
||||
something is missing. `aria-hidden` and a `role="status"` label beside it,
|
||||
because a paragraph of grey blocks is nothing to read aloud. #}
|
||||
<section class="card">
|
||||
<h2 class="card__title">Shared with</h2>
|
||||
<span class="visually-hidden" role="status">Loading who this is shared with</span>
|
||||
<h2 class="card__title">{{ t("Shared with") }}</h2>
|
||||
<span class="visually-hidden" role="status">{{ t("Loading who this is shared with") }}</span>
|
||||
<div aria-hidden="true">
|
||||
<div class="skeleton skeleton--row"></div>
|
||||
<div class="skeleton skeleton--row skeleton--short"></div>
|
||||
@@ -36,6 +36,6 @@
|
||||
{% elif not is_owner %}
|
||||
<div class="alert">
|
||||
{{ icon("users", "alert__icon") }}
|
||||
<span>Shared with you. You can read this but not change it.</span>
|
||||
<span>{{ t("Shared with you. You can read this but not change it.") }}</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
@@ -22,34 +22,27 @@
|
||||
{% if share_count %}
|
||||
<span class="badge badge--leaf">{{ share_count }}</span>
|
||||
{% else %}
|
||||
<span class="badge">nobody</span>
|
||||
<span class="badge">{{ t("nobody") }}</span>
|
||||
{% endif %}
|
||||
</h2>
|
||||
<p class="card__lede">
|
||||
They will be able to read this, and their models will find it. They cannot
|
||||
change it, delete it, or share it on — so “who can see this?” stays a
|
||||
question you can answer.
|
||||
</p>
|
||||
<p class="card__lede">{{ t("They will be able to read this, and their models will find it. They cannot change it, delete it, or share it on — so “who can see this?” stays a question you can answer.") }}</p>
|
||||
|
||||
<div class="field">
|
||||
<label class="field__label" for="share-search">Find somebody</label>
|
||||
<label class="field__label" for="share-search">{{ t("Find somebody") }}</label>
|
||||
<input class="input" id="share-search" type="search" name="q" value="{{ q }}"
|
||||
placeholder="Name, email or group…"
|
||||
placeholder="{{ t('Name, email or group…') }}"
|
||||
hx-get="/api/library/share/{{ kind }}/{{ resource.id }}"
|
||||
hx-trigger="input changed delay:250ms, search"
|
||||
hx-target="#share-panel"
|
||||
hx-swap="outerHTML">
|
||||
{% if truncated %}
|
||||
<p class="field__hint">
|
||||
Showing the first few. Type to narrow it — anything already shared stays
|
||||
listed whatever you search for.
|
||||
</p>
|
||||
<p class="field__hint">{{ t("Showing the first few. Type to narrow it — anything already shared stays listed whatever you search for.") }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if groups %}
|
||||
<div class="field">
|
||||
<label class="field__label">Groups</label>
|
||||
<label class="field__label">{{ t("Groups") }}</label>
|
||||
<div class="checkbox-row">
|
||||
{% for group in groups %}
|
||||
{% set on = group.id in shared_groups %}
|
||||
@@ -69,7 +62,7 @@
|
||||
|
||||
{% if people %}
|
||||
<div class="field">
|
||||
<label class="field__label">People</label>
|
||||
<label class="field__label">{{ t("People") }}</label>
|
||||
<div class="checkbox-row">
|
||||
{% for person in people %}
|
||||
{% set on = person.id in shared_users %}
|
||||
|
||||
@@ -14,32 +14,28 @@
|
||||
|
||||
{% if is_owner %}
|
||||
<section class="card">
|
||||
<h2 class="card__title">Add to this base</h2>
|
||||
<h2 class="card__title">{{ t("Add to this base") }}</h2>
|
||||
<div class="grid grid--2">
|
||||
<form method="post" action="/api/library/documents" enctype="multipart/form-data">
|
||||
<input type="hidden" name="base_id" value="{{ base.id }}">
|
||||
<div class="field">
|
||||
<label class="field__label" for="doc-file">A file</label>
|
||||
<label class="field__label" for="doc-file">{{ t("A file") }}</label>
|
||||
<input class="input" id="doc-file" type="file" name="file" required
|
||||
accept="image/*,.pdf,.txt,.md,.csv,.json,.py,.js,.ts,.rs,.go,.sh,.sql,.yaml,.yml,.toml,.log">
|
||||
<p class="field__hint">
|
||||
Images, PDFs and text. A PDF has its text read once, now.
|
||||
</p>
|
||||
<p class="field__hint">{{ t("Images, PDFs and text. A PDF has its text read once, now.") }}</p>
|
||||
</div>
|
||||
<button class="btn btn--primary" type="submit">Upload</button>
|
||||
<button class="btn btn--primary" type="submit">{{ t("Upload") }}</button>
|
||||
</form>
|
||||
|
||||
<form method="post" action="/api/library/documents/link">
|
||||
<input type="hidden" name="base_id" value="{{ base.id }}">
|
||||
<div class="field">
|
||||
<label class="field__label" for="doc-url">A web page</label>
|
||||
<label class="field__label" for="doc-url">{{ t("A web page") }}</label>
|
||||
<input class="input" id="doc-url" type="url" name="url" required
|
||||
placeholder="https://example.com/article">
|
||||
<p class="field__hint">
|
||||
Fetched now and kept as text, so it survives the page changing.
|
||||
</p>
|
||||
<p class="field__hint">{{ t("Fetched now and kept as text, so it survives the page changing.") }}</p>
|
||||
</div>
|
||||
<button class="btn" type="submit">Save page</button>
|
||||
<button class="btn" type="submit">{{ t("Save page") }}</button>
|
||||
</form>
|
||||
</div>
|
||||
</section>
|
||||
@@ -48,7 +44,7 @@
|
||||
<form method="get" action="/library/knowledge/{{ base.id }}" class="btn-row"
|
||||
style="margin-bottom: var(--sp-5)">
|
||||
<input class="input" type="search" name="q" value="{{ q }}" style="flex: 1"
|
||||
placeholder="Search this base…">
|
||||
placeholder="{{ t('Search this base…') }}">
|
||||
<button class="btn" type="submit">{{ icon("search", "icon--sm") }} Search</button>
|
||||
{% if q %}<a class="btn btn--sm" href="/library/knowledge/{{ base.id }}">Clear</a>{% endif %}
|
||||
</form>
|
||||
@@ -82,7 +78,7 @@
|
||||
</div>
|
||||
<div class="btn-row">
|
||||
{% if document.extraction_error %}
|
||||
<span class="badge badge--danger" title="{{ document.extraction_error }}">no text</span>
|
||||
<span class="badge badge--danger" title="{{ document.extraction_error }}">{{ t("no text") }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</li>
|
||||
@@ -93,15 +89,15 @@
|
||||
|
||||
<form method="post" action="/api/library/bases/{{ base.id }}" style="margin-top: var(--sp-8)">
|
||||
<section class="card">
|
||||
<h2 class="card__title">This base</h2>
|
||||
<h2 class="card__title">{{ t("This base") }}</h2>
|
||||
<div class="grid grid--2">
|
||||
<div class="field">
|
||||
<label class="field__label" for="name">Name</label>
|
||||
<label class="field__label" for="name">{{ t("Name") }}</label>
|
||||
<input class="input" id="name" name="name" value="{{ base.name }}" maxlength="200"
|
||||
{{ 'disabled' if not is_owner }}>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="field__label" for="description">Description</label>
|
||||
<label class="field__label" for="description">{{ t("Description") }}</label>
|
||||
<input class="input" id="description" name="description" maxlength="2000"
|
||||
value="{{ base.description }}" {{ 'disabled' if not is_owner }}>
|
||||
</div>
|
||||
@@ -112,12 +108,12 @@
|
||||
|
||||
{% if is_owner %}
|
||||
<div class="form-actions">
|
||||
<button class="btn btn--primary" type="submit">Save</button>
|
||||
<button class="btn btn--primary" type="submit">{{ t("Save") }}</button>
|
||||
<span class="spacer"></span>
|
||||
<button class="btn btn--danger" type="submit"
|
||||
formaction="/api/library/bases/{{ base.id }}/delete"
|
||||
data-confirm-button="Delete “{{ base.name }}” and the {{ pager.total }} document(s) in it? Messages they were attached to keep their copies."
|
||||
data-confirm-title="Delete knowledge base">
|
||||
data-confirm-title="{{ t('Delete knowledge base') }}">
|
||||
{{ icon("trash", "icon--sm") }} Delete base
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -6,12 +6,7 @@
|
||||
{% block heading %}Knowledge{% endblock %}
|
||||
|
||||
{% block library_content %}
|
||||
<p class="admin-lede">
|
||||
Knowledge bases are collections of documents, images and saved web pages. Keep
|
||||
them separate — one per subject, project or client — and a chat can be pointed
|
||||
at just the ones it should draw on. Sharing happens here too: share a base and
|
||||
everything in it comes with it.
|
||||
</p>
|
||||
<p class="admin-lede">{{ t("Knowledge bases are collections of documents, images and saved web pages. Keep them separate — one per subject, project or client — and a chat can be pointed at just the ones it should draw on. Sharing happens here too: share a base and everything in it comes with it.") }}</p>
|
||||
|
||||
{# Links rather than a form, so a filtered view is a URL you can keep. #}
|
||||
<div class="filter-tabs" style="margin-bottom: var(--sp-4)">
|
||||
@@ -36,7 +31,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="btn-row">
|
||||
{% if base.owner_id != user.id %}<span class="badge">shared with you</span>{% endif %}
|
||||
{% if base.owner_id != user.id %}<span class="badge">{{ t("shared with you") }}</span>{% endif %}
|
||||
</div>
|
||||
</li>
|
||||
{% endfor %}
|
||||
@@ -44,27 +39,24 @@
|
||||
{% else %}
|
||||
<div class="empty">
|
||||
{{ icon("archive", "empty__mark") }}
|
||||
<h2 class="empty__title">No knowledge bases yet</h2>
|
||||
<p class="empty__text">
|
||||
Make one below, then put documents in it. A chat with no base attached
|
||||
searches everything you have; a chat pointed at one searches only that.
|
||||
</p>
|
||||
<h2 class="empty__title">{{ t("No knowledge bases yet") }}</h2>
|
||||
<p class="empty__text">{{ t("Make one below, then put documents in it. A chat with no base attached searches everything you have; a chat pointed at one searches only that.") }}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<section class="card" style="margin-top: var(--sp-6)">
|
||||
<h2 class="card__title">New knowledge base</h2>
|
||||
<h2 class="card__title">{{ t("New knowledge base") }}</h2>
|
||||
<form method="post" action="/api/library/bases">
|
||||
<div class="grid grid--2">
|
||||
<div class="field">
|
||||
<label class="field__label" for="base-name">Name</label>
|
||||
<label class="field__label" for="base-name">{{ t("Name") }}</label>
|
||||
<input class="input" id="base-name" name="name" required maxlength="200"
|
||||
placeholder="Contracts">
|
||||
placeholder="{{ t('Contracts') }}">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="field__label" for="base-description">Description</label>
|
||||
<label class="field__label" for="base-description">{{ t("Description") }}</label>
|
||||
<input class="input" id="base-description" name="description" maxlength="2000"
|
||||
placeholder="What belongs in here.">
|
||||
placeholder="{{ t('What belongs in here.') }}">
|
||||
</div>
|
||||
</div>
|
||||
<button class="btn btn--primary" type="submit">{{ icon("plus", "icon--sm") }} Create</button>
|
||||
|
||||
@@ -14,25 +14,23 @@
|
||||
|
||||
<form method="post" action="/api/library/documents/{{ document.id }}">
|
||||
<section class="card">
|
||||
<h2 class="card__title">Details</h2>
|
||||
<h2 class="card__title">{{ t("Details") }}</h2>
|
||||
<div class="field">
|
||||
<label class="field__label" for="title">Title</label>
|
||||
<label class="field__label" for="title">{{ t("Title") }}</label>
|
||||
<input class="input" id="title" name="title" value="{{ document.title }}"
|
||||
maxlength="300" {{ 'disabled' if not is_owner }}>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="field__label" for="description">Description</label>
|
||||
<label class="field__label" for="description">{{ t("Description") }}</label>
|
||||
<textarea class="textarea" id="description" name="description" rows="2"
|
||||
{{ 'disabled' if not is_owner }}
|
||||
placeholder="What this is, and when it is worth reading.">{{ document.description }}</textarea>
|
||||
<p class="field__hint">
|
||||
Searched along with the contents, so a line here helps a model find it.
|
||||
</p>
|
||||
placeholder="{{ t('What this is, and when it is worth reading.') }}">{{ document.description }}</textarea>
|
||||
<p class="field__hint">{{ t("Searched along with the contents, so a line here helps a model find it.") }}</p>
|
||||
</div>
|
||||
|
||||
{% if document.base %}
|
||||
<div class="field">
|
||||
<label class="field__label" for="base_id">Knowledge base</label>
|
||||
<label class="field__label" for="base_id">{{ t("Knowledge base") }}</label>
|
||||
{# Moving a document changes who can see it, which is the point of bases.
|
||||
Only bases this person can write to are offered. #}
|
||||
<select class="select" id="base_id" name="base_id" {{ 'disabled' if not is_owner }}>
|
||||
@@ -42,7 +40,7 @@
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<p class="field__hint">Moving it changes who can see it.</p>
|
||||
<p class="field__hint">{{ t("Moving it changes who can see it.") }}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
@@ -70,7 +68,7 @@
|
||||
|
||||
{% if is_owner %}
|
||||
<div class="form-actions">
|
||||
<button class="btn btn--primary" type="submit">Save</button>
|
||||
<button class="btn btn--primary" type="submit">{{ t("Save") }}</button>
|
||||
{% if document.stored_name %}
|
||||
<a class="btn" href="/api/library/documents/{{ document.id }}/content">Download</a>
|
||||
{% endif %}
|
||||
@@ -78,7 +76,7 @@
|
||||
<button class="btn btn--danger" type="submit"
|
||||
formaction="/api/library/documents/{{ document.id }}/delete"
|
||||
data-confirm-button="Delete “{{ document.title }}”? Messages it was already attached to keep their copy."
|
||||
data-confirm-title="Delete document">
|
||||
data-confirm-title="{{ t('Delete document') }}">
|
||||
{{ icon("trash", "icon--sm") }} Delete
|
||||
</button>
|
||||
</div>
|
||||
@@ -87,14 +85,14 @@
|
||||
|
||||
{% if document.is_image and document.stored_name %}
|
||||
<section class="card">
|
||||
<h2 class="card__title">Preview</h2>
|
||||
<h2 class="card__title">{{ t("Preview") }}</h2>
|
||||
<img src="/api/library/documents/{{ document.id }}/content" alt="{{ document.title }}"
|
||||
style="max-width: 100%; border-radius: var(--radius)">
|
||||
</section>
|
||||
{% elif document.extracted_text %}
|
||||
<section class="card">
|
||||
<h2 class="card__title">Text</h2>
|
||||
<p class="card__lede">What a model is given when it reads this.</p>
|
||||
<h2 class="card__title">{{ t("Text") }}</h2>
|
||||
<p class="card__lede">{{ t("What a model is given when it reads this.") }}</p>
|
||||
<div class="reasoning__body" style="max-height: 30rem">{{ document.extracted_text }}</div>
|
||||
</section>
|
||||
{% endif %}
|
||||
|
||||
@@ -14,20 +14,18 @@
|
||||
action="{{ '/api/library/notes/' ~ note.id if note else '/api/library/notes' }}">
|
||||
<section class="card">
|
||||
<div class="field">
|
||||
<label class="field__label" for="title">Title</label>
|
||||
<label class="field__label" for="title">{{ t("Title") }}</label>
|
||||
<input class="input" id="title" name="title" maxlength="300" required
|
||||
value="{{ note.title if note else '' }}"
|
||||
{{ 'disabled' if note and not is_owner }}
|
||||
placeholder="What this note is about">
|
||||
<p class="field__hint">
|
||||
Shown in search results, so it is what decides whether a model opens it.
|
||||
</p>
|
||||
placeholder="{{ t('What this note is about') }}">
|
||||
<p class="field__hint">{{ t("Shown in search results, so it is what decides whether a model opens it.") }}</p>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="field__label" for="body">Body</label>
|
||||
<label class="field__label" for="body">{{ t("Body") }}</label>
|
||||
<textarea class="textarea" id="body" name="body" rows="18"
|
||||
{{ 'disabled' if note and not is_owner }}
|
||||
placeholder="Markdown.">{{ note.body if note else '' }}</textarea>
|
||||
placeholder="{{ t('Markdown.') }}">{{ note.body if note else '' }}</textarea>
|
||||
</div>
|
||||
{% if note and note.author == "model" %}
|
||||
<p class="field__hint">
|
||||
@@ -47,7 +45,7 @@
|
||||
<button class="btn btn--danger" type="submit"
|
||||
formaction="/api/library/notes/{{ note.id }}/delete"
|
||||
data-confirm-button="Delete “{{ note.title }}”?"
|
||||
data-confirm-title="Delete note">
|
||||
data-confirm-title="{{ t('Delete note') }}">
|
||||
{{ icon("trash", "icon--sm") }} Delete
|
||||
</button>
|
||||
{% endif %}
|
||||
@@ -57,7 +55,7 @@
|
||||
|
||||
{% if note and body_html %}
|
||||
<section class="card">
|
||||
<h2 class="card__title">Rendered</h2>
|
||||
<h2 class="card__title">{{ t("Rendered") }}</h2>
|
||||
<div class="msg__body">{{ body_html|safe }}</div>
|
||||
</section>
|
||||
{% endif %}
|
||||
|
||||
@@ -9,11 +9,7 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block library_content %}
|
||||
<p class="admin-lede">
|
||||
Longer things worth keeping between conversations. A model writes these itself
|
||||
when it works something out, and you can edit or delete any of them — they are
|
||||
yours, not its.
|
||||
</p>
|
||||
<p class="admin-lede">{{ t("Longer things worth keeping between conversations. A model writes these itself when it works something out, and you can edit or delete any of them — they are yours, not its.") }}</p>
|
||||
|
||||
{#
|
||||
Two views, as links, so a filtered list is a real URL you can keep -- the same
|
||||
@@ -26,7 +22,7 @@
|
||||
</div>
|
||||
<form method="get" action="/library/notes" class="btn-row" style="margin-bottom: var(--sp-5)">
|
||||
<input class="input" type="search" name="q" value="{{ q }}" style="flex: 1"
|
||||
placeholder="Search notes…">
|
||||
placeholder="{{ t('Search notes…') }}">
|
||||
<button class="btn" type="submit">{{ icon("search", "icon--sm") }} Search</button>
|
||||
{% if q %}<a class="btn btn--sm" href="/library/notes">Clear</a>{% endif %}
|
||||
</form>
|
||||
@@ -53,8 +49,8 @@
|
||||
<div class="text-xs faint">{{ note.body[:160] }}{{ "…" if note.body|length > 160 }}</div>
|
||||
</div>
|
||||
<div class="btn-row">
|
||||
{% if note.author == "model" %}<span class="badge badge--leaf">written by a model</span>{% endif %}
|
||||
{% if note.owner_id != user.id %}<span class="badge">shared</span>{% endif %}
|
||||
{% if note.author == "model" %}<span class="badge badge--leaf">{{ t("written by a model") }}</span>{% endif %}
|
||||
{% if note.owner_id != user.id %}<span class="badge">{{ t("shared") }}</span>{% endif %}
|
||||
</div>
|
||||
</li>
|
||||
{% endfor %}
|
||||
|
||||
@@ -15,33 +15,30 @@
|
||||
<section class="card">
|
||||
{% if not skill %}
|
||||
<div class="field">
|
||||
<label class="field__label" for="name">Name</label>
|
||||
<label class="field__label" for="name">{{ t("Name") }}</label>
|
||||
<input class="input mono" id="name" name="name" required maxlength="60"
|
||||
placeholder="weekly-report" pattern="[a-zA-Z0-9 _-]+">
|
||||
<p class="field__hint">
|
||||
Lowercase letters, numbers and hyphens. This is how a model asks for it,
|
||||
and it cannot be changed later.
|
||||
</p>
|
||||
placeholder="{{ t('weekly-report') }}" pattern="[a-zA-Z0-9 _-]+">
|
||||
<p class="field__hint">{{ t("Lowercase letters, numbers and hyphens. This is how a model asks for it, and it cannot be changed later.") }}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="field">
|
||||
<label class="field__label" for="description">When to use it</label>
|
||||
<label class="field__label" for="description">{{ t("When to use it") }}</label>
|
||||
<textarea class="textarea" id="description" name="description" rows="2" required
|
||||
{{ 'disabled' if skill and not is_owner }}
|
||||
placeholder="When the user asks for the weekly report.">{{ skill.description if skill else '' }}</textarea>
|
||||
placeholder="{{ t('When the user asks for the weekly report.') }}">{{ skill.description if skill else '' }}</textarea>
|
||||
<p class="field__hint">
|
||||
<strong>The load-bearing field.</strong> This one line is all a model
|
||||
<strong>{{ t("The load-bearing field.") }}</strong> This one line is all a model
|
||||
sees until it opens the skill, so it has to say when the skill applies —
|
||||
not what it does.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label class="field__label" for="body">Instructions</label>
|
||||
<label class="field__label" for="body">{{ t("Instructions") }}</label>
|
||||
<textarea class="textarea" id="body" name="body" rows="18"
|
||||
{{ 'disabled' if skill and not is_owner }}
|
||||
placeholder="Markdown. Steps, conventions, things to avoid.">{{ skill.body if skill else '' }}</textarea>
|
||||
placeholder="{{ t('Markdown. Steps, conventions, things to avoid.') }}">{{ skill.body if skill else '' }}</textarea>
|
||||
</div>
|
||||
|
||||
{% if skill %}
|
||||
@@ -49,11 +46,9 @@
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" name="enabled" value="true" {{ 'checked' if skill.enabled }}
|
||||
{{ 'disabled' if not is_owner }}>
|
||||
<span>Offer this skill to models</span>
|
||||
<span>{{ t("Offer this skill to models") }}</span>
|
||||
</label>
|
||||
<p class="field__hint">
|
||||
Turned off, it stays here but disappears from the list the model sees.
|
||||
</p>
|
||||
<p class="field__hint">{{ t("Turned off, it stays here but disappears from the list the model sees.") }}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
@@ -61,7 +56,7 @@
|
||||
<div class="alert alert--warning">
|
||||
{{ icon("sparkle", "alert__icon") }}
|
||||
<div>
|
||||
<strong>A model wrote this version.</strong>
|
||||
<strong>{{ t("A model wrote this version.") }}</strong>
|
||||
<div class="text-sm" style="margin-top: var(--sp-1)">
|
||||
Worth reading before you rely on it. A model that has just read a web
|
||||
page can be talked into things by that page, and a skill persists.
|
||||
@@ -82,7 +77,7 @@
|
||||
<button class="btn btn--danger" type="submit"
|
||||
formaction="/api/library/skills/{{ skill.id }}/delete"
|
||||
data-confirm-button="Delete the skill “{{ skill.name }}” and all its history?"
|
||||
data-confirm-title="Delete skill">
|
||||
data-confirm-title="{{ t('Delete skill') }}">
|
||||
{{ icon("trash", "icon--sm") }} Delete
|
||||
</button>
|
||||
{% endif %}
|
||||
@@ -93,19 +88,16 @@
|
||||
{% if skill and revisions %}
|
||||
<section class="card">
|
||||
<h2 class="card__title">History <span class="badge">{{ revisions|length }}</span></h2>
|
||||
<p class="card__lede">
|
||||
What this skill said before each change. This is the whole safety story for a
|
||||
model editing its own instructions: not a gate, but a record and a way back.
|
||||
</p>
|
||||
<p class="card__lede">{{ t("What this skill said before each change. This is the whole safety story for a model editing its own instructions: not a gate, but a record and a way back.") }}</p>
|
||||
<ul class="model-list">
|
||||
{% for revision in revisions %}
|
||||
<li class="model-list__item">
|
||||
<div style="min-width: 0">
|
||||
<strong>{{ revision.created_at.strftime("%Y-%m-%d %H:%M") }}</strong>
|
||||
{% if revision.author == "model" %}
|
||||
<span class="badge badge--leaf">model</span>
|
||||
<span class="badge badge--leaf">{{ t("model") }}</span>
|
||||
{% else %}
|
||||
<span class="badge">you</span>
|
||||
<span class="badge">{{ t("you") }}</span>
|
||||
{% endif %}
|
||||
{% if revision.note %}<div class="text-xs faint">{{ revision.note }}</div>{% endif %}
|
||||
<div class="text-xs faint">{{ revision.body[:200] }}{{ "…" if revision.body|length > 200 }}</div>
|
||||
@@ -113,8 +105,8 @@
|
||||
{% if is_owner %}
|
||||
<form method="post"
|
||||
action="/api/library/skills/{{ skill.id }}/revert/{{ revision.id }}"
|
||||
data-confirm="Put the skill back to this version? The current one is kept in the history."
|
||||
data-confirm-label="Revert" data-confirm-danger="false">
|
||||
data-confirm="{{ t('Put the skill back to this version? The current one is kept in the history.') }}"
|
||||
data-confirm-label="{{ t('Revert') }}" data-confirm-danger="false">
|
||||
<button class="btn btn--sm" type="submit">{{ icon("refresh", "icon--sm") }} Revert</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
|
||||
@@ -9,12 +9,7 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block library_content %}
|
||||
<p class="admin-lede">
|
||||
Saved procedures. Every enabled skill's name and description are shown to the
|
||||
model on each turn; it reads the instructions only when it decides one
|
||||
applies. A model may write and revise its own — every version is kept, so any
|
||||
change can be read and undone.
|
||||
</p>
|
||||
<p class="admin-lede">{{ t("Saved procedures. Every enabled skill's name and description are shown to the model on each turn; it reads the instructions only when it decides one applies. A model may write and revise its own — every version is kept, so any change can be read and undone.") }}</p>
|
||||
|
||||
{#
|
||||
Two views, as links, so a filtered list is a real URL you can keep -- the same
|
||||
@@ -26,7 +21,7 @@
|
||||
</div>
|
||||
<form method="get" action="/library/skills" class="btn-row" style="margin-bottom: var(--sp-5)">
|
||||
<input class="input" type="search" name="q" value="{{ q }}" style="flex: 1"
|
||||
placeholder="Search skills…">
|
||||
placeholder="{{ t('Search skills…') }}">
|
||||
<button class="btn" type="submit">{{ icon("search", "icon--sm") }} Search</button>
|
||||
{% if q %}<a class="btn btn--sm" href="/library/skills">Clear</a>{% endif %}
|
||||
</form>
|
||||
@@ -53,9 +48,9 @@
|
||||
<div class="text-xs faint">{{ skill.description }}</div>
|
||||
</div>
|
||||
<div class="btn-row">
|
||||
{% if not skill.enabled %}<span class="badge">off</span>{% endif %}
|
||||
{% if skill.author == "model" %}<span class="badge badge--leaf">written by a model</span>{% endif %}
|
||||
{% if skill.owner_id != user.id %}<span class="badge">shared</span>{% endif %}
|
||||
{% if not skill.enabled %}<span class="badge">{{ t("off") }}</span>{% endif %}
|
||||
{% if skill.author == "model" %}<span class="badge badge--leaf">{{ t("written by a model") }}</span>{% endif %}
|
||||
{% if skill.owner_id != user.id %}<span class="badge">{{ t("shared") }}</span>{% endif %}
|
||||
</div>
|
||||
</li>
|
||||
{% endfor %}
|
||||
|
||||
Reference in New Issue
Block a user