Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,31 @@
All notable changes to ThunderClaw are documented here. Current releases ship
only the Thunderbird extension. Earlier component releases remain recorded below.

## Thunderbird extension [0.3.0] - 2026-10-25

### Added

- Review compose edits with local Changes, Original, and Proposed views. Inline
comparisons preserve supported text, list, and rich formatting; large changes
fall back to complete removed and inserted blocks without truncating content.
- Expand the same preview into a separate review window with a scrolling
comparison and visible Apply/Undo controls, without another model request.
- Show elapsed generation time and Cancel controls for compose edits and
received-message summaries and translations. Running and cancelled state
survives reopening the popup; late cancelled results are not used. Providers
may continue processing after cancellation.
- Choose Fireworks AI directly in connection settings, using an exact full model,
router, or deployment ID. Default to JSON Schema, support provider-specific
thinking choices, and reject context overflow instead of reducing the output
allowance. Model discovery is unavailable for this preset.

### Fixed

- Shorten displayed Fireworks model names while preserving full IDs in requests.
- Keep Apply/Undo and cancellation bound to the exact draft, preview, and run
across popup reopening and expanded review. Preserve Thunderbird's separate
Send decision.

## Thunderbird extension [0.2.4] - 2026-10-24

### Changed
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ eligibility rules.
## Your inference connection

ThunderClaw connects directly to OpenAI, OpenRouter,
DeepSeek, Ollama, LM Studio, or a custom OpenAI-compatible endpoint. Choose the
DeepSeek, Fireworks AI, Ollama, LM Studio, or a custom OpenAI-compatible endpoint. Choose the
endpoint and model in settings, provide a key if needed, grant host access,
save, and run the synthetic connection test. Keys are remembered locally across
restarts. They are not synchronized or an encrypted vault.
Expand Down Expand Up @@ -92,7 +92,7 @@ See [architecture](docs/architecture.md) and [security and privacy](docs/securit
## Installation

Install from [Thunderbird Add-ons](https://addons.thunderbird.net/en-US/thunderbird/addon/thunderclaw/), then open ThunderClaw settings. Choose a provider,
load or enter a model, save your key and connection, grant host access, and click
load a model where available or enter its exact ID, save your key and connection, grant host access, and click
**Test connection**. Your key stays saved across restarts.

For local development, build the XPI from this checkout and install it through
Expand Down
9 changes: 8 additions & 1 deletion docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,17 @@ The existing local compose lifecycle and product types retain some legacy protoc

## Inference boundary

One configured provider and model are active. Presets cover OpenAI, OpenRouter, DeepSeek, Ollama, LM Studio, and custom compatible servers. Configuration contains a canonical API base, model, structured-output mode, response-token limit, thinking level, and optional writing style. Provider differences are explicit; there is no automatic endpoint/model fallback.
One configured provider and model are active. Presets cover OpenAI, OpenRouter, DeepSeek, Fireworks AI, Ollama, LM Studio, and custom compatible servers. Configuration contains a canonical API base, model, structured-output mode, response-token limit, thinking level, and optional writing style. Provider differences are explicit; there is no automatic endpoint/model fallback.

Calls use nonstreaming Chat Completions with bounded JSON output. JSON Schema is preferred where supported; JSON-object mode accommodates DeepSeek and compatible servers. Both modes use the same local product validation. Model names and API errors are untrusted data. Reject tool calls, refusals, truncation, invalid shapes, oversize output, and stale completions.

Compose review compares the captured original with the locally validated
replacement in a text-only renderer. The expanded review is a fixed extension
page bound by the background to its opening compose tab and exact job. Its
sender, job, and suggestion identities are checked before Apply or Undo; it
cannot select another source tab. Both review surfaces share one background job
and one mutation gate.

Remote endpoints require HTTPS. HTTP is restricted to explicit loopback addresses. Build only fixed models/chat-completions routes under the configured base, reject redirects, and omit cookies. Host permissions do not replace exact application-level origin/path checks.

## Credentials and context
Expand Down
20 changes: 12 additions & 8 deletions docs/compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,21 @@ See the [product contract](product-contract.md) for eligibility rules.
## Inference API

ThunderClaw supports OpenAI-compatible, nonstreaming Chat Completions. Presets
provide API bases and request defaults for OpenAI, OpenRouter, DeepSeek, Ollama,
and LM Studio; Custom accepts another compatible base. The extension appends
`/models` for discovery and `/chat/completions` for generation. A model ID can be
entered manually when discovery is unavailable. It never silently chooses a
model, changes endpoints, or retries with a fallback model.
provide API bases and request defaults for OpenAI, OpenRouter, DeepSeek,
Fireworks AI, Ollama, and LM Studio; Custom accepts another compatible base.
The extension appends `/models` for discovery where supported and
`/chat/completions` for generation. Fireworks model discovery is unavailable;
enter an exact full model, router, or deployment ID manually. ThunderClaw never
silently chooses a model, changes endpoints, or retries with a fallback model.

The endpoint/model must accept the configured structured-output mode and return
a complete, bounded JSON result. JSON Schema is the default for most presets;
DeepSeek defaults to JSON object compatibility. Local validation is equally
strict in both modes. Chat-only models without suitable structured output may
fail despite accepting ordinary chat requests.
DeepSeek defaults to JSON object compatibility; Fireworks defaults to JSON Schema.
Local validation is equally strict in both modes. Chat-only models without suitable
structured output may fail despite accepting ordinary chat requests.
Fireworks requests reject cases where the prompt plus requested output budget
exceeds the context window, instead of silently reducing the output allowance.
An over-limit request fails without applying partial output.

Response limits and reasoning controls differ by provider and model. Presets
select a request vocabulary, not a discovered capability guarantee. See
Expand Down
3 changes: 2 additions & 1 deletion docs/inference-prompts.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ levels are opt-in, and saved changes require a fresh connection test.
| OpenAI | `max_completion_tokens`, optional `reasoning_effort` | [Effort values vary by model](https://developers.openai.com/api/docs/guides/reasoning?api-mode=chat); some cannot turn reasoning off. |
| OpenRouter | `max_tokens`, optional `reasoning` | [Unified efforts](https://openrouter.ai/docs/guides/best-practices/reasoning-tokens) depend on the routed model; some require reasoning. Explicit provider fallback remains disabled. |
| DeepSeek | `max_tokens`, `thinking`, optional `reasoning_effort` | [Thinking controls](https://api-docs.deepseek.com/guides/thinking_mode/) support Off and low/high/max effort. Model default omits both controls. |
| Fireworks AI | `max_tokens`, `context_length_exceeded_behavior: error`, optional `reasoning_effort` | [Chat Completions](https://docs.fireworks.ai/api-reference/post-chatcompletions) uses the exact model/router/deployment ID entered in settings. Model default omits effort; explicit Off/Low/Medium/High/Very high/Maximum may be rejected or reinterpreted by the selected model. Requests fail when the prompt plus requested output budget exceeds the context window, instead of reducing the output allowance. |
| Ollama | `max_tokens`, optional `reasoning_effort` | [Compatibility controls](https://docs.ollama.com/api/openai-compatibility) depend on local model metadata; unsupported named levels may resolve to the model default. |
| LM Studio | `max_tokens`, optional `reasoning_effort` | Requires a server version with chat reasoning controls and a compatible model; see the [API changelog](https://lmstudio.ai/changelog/lmstudio). |
| Custom | `max_tokens`, optional `reasoning_effort` | Explicit efforts require support for OpenAI-style reasoning controls. Model default omits the effort parameter. |
Expand All @@ -45,7 +46,7 @@ These selectors describe request formats, not discovered model capabilities.
The extension does not query extra capability routes or silently substitute a
different effort/model. A connection test checks whether the request and result
are accepted; it cannot prove that a server honored an effort setting internally.
Use Model default when uncertain about a local or custom model's support.
Use Model default when uncertain about a model's support.

Reasoning can consume the generation budget before the final JSON response,
leaving too little room for a newsletter translation. Responses reaching their
Expand Down
26 changes: 18 additions & 8 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ release XPI rather than a local rebuild.
1. Open ThunderClaw settings from its add-on entry.
2. Choose a provider. Check the API base URL, including any required base path.
3. Enter an API key if the endpoint requires one. Keys are remembered locally.
4. Click **Load models** and choose a model, or enter its exact **Model ID**.
Loading the list does not select a model automatically.
4. Click **Load models** where available and choose a model, or enter its exact
**Model ID**. Fireworks AI requires manual entry of its full model, router,
or deployment ID. Loading a list does not select a model automatically.
5. Review **Structured output**, **Response token limit**, and **Thinking level**.
Start with the preset defaults. Writing style is optional.
6. Confirm the data-sharing notice, click **Save connection**, and approve
Expand All @@ -37,6 +38,7 @@ release XPI rather than a local rebuild.
| OpenAI | `https://api.openai.com/v1` | Supply your API key and a compatible model. |
| OpenRouter | `https://openrouter.ai/api/v1` | Supply your key; compatibility depends on the selected model and route. |
| DeepSeek | `https://api.deepseek.com` | Supply your key; JSON object compatibility and thinking Off are preset defaults. |
| Fireworks AI | `https://api.fireworks.ai/inference/v1` | Supply your key and copy the exact full model, router, or deployment ID from Fireworks; model discovery is unavailable. JSON Schema and Model default thinking are preset defaults. |
| Ollama | `http://127.0.0.1:11434/v1` | Start your local server and make a compatible model available. |
| LM Studio | `http://127.0.0.1:1234/v1` | Start the local API server and load a compatible model. |
| Custom | Enter your API base | Requires compatible models and Chat Completions routes with structured JSON output. |
Expand Down Expand Up @@ -64,24 +66,32 @@ not increase the model's input context or remove other safety limits.

Thinking defaults to **Off** for DeepSeek and **Model default** for other presets.
Available levels depend on the provider, and individual models may reject or
ignore a level. The connection test checks acceptance, not the server's internal
reinterpret a level. Fireworks offers Off, Low, Medium, High, Very high, and
Maximum in addition to Model default; start with Model default when support is
unknown. The connection test checks acceptance, not the server's internal
reasoning behavior. For long translations, reducing thinking can leave more room
for the answer. See [response controls](inference-prompts.md#response-limit-and-thinking).

## Use and troubleshoot

In a draft, select eligible text and open ThunderClaw. Generate a proposal,
review the Preview, then Apply it. Undo restores the accepted previous state
review Changes, Original, or Proposed in the popup or choose **Expand review**
for a larger window, then Apply the whole suggestion. Undo restores the accepted previous state
when no intervening change makes that unsafe. Sending remains Thunderbird's
normal separate action.

For a received message, choose Summarize or Translate. Translation defaults to
automatic source-language detection; choose the target language. Translations
can be restored to the original, and summaries appear in a separate card.

If model discovery fails, verify the server is running, endpoint, key, and host
permission. You can enter a known model ID manually. If structured output is
unsupported, choose **JSON object compatibility** and save/retest. Both modes
While a model is running, ThunderClaw shows elapsed time and Cancel. A cancelled
result is not used, though the provider may continue processing or charging.

If model discovery is available but fails, verify the server is running,
endpoint, key, and host permission. You can enter a known model ID manually.
Fireworks requires an exact full ID, such as
`accounts/fireworks/models/deepseek-v4p1-flash-1017`; this is an example, not a
preselected model. If structured output is unsupported, choose **JSON object
compatibility** and save/retest. Both modes
receive the same local validation. A response-limit error means the result was
incomplete: increase the limit within the model's supported range, reduce
thinking, or use a shorter input. Partial output is never applied. For connection
Expand Down
2 changes: 2 additions & 0 deletions docs/privacy-policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,6 @@ Change or remove a saved connection/key in settings. Local removal does not revo

A loopback server can forward requests to cloud services. OpenRouter may route to an upstream provider. Choose the model/server configuration appropriate for your data. ThunderClaw does not silently switch your connection.

For Fireworks AI, its [data-handling documentation](https://docs.fireworks.ai/guides/security_compliance/data_handling) says open-model prompts and outputs are not persistently retained unless you opt in, while request metadata is logged and transient caches may hold content. Provider and account settings govern actual handling; ThunderClaw cannot control those policies.

Models cannot send email or change recipients, attachments, or headers. Compose edits require Preview and Apply, with stale-state checks and Undo. Reading translations are reversible and summaries are displayed separately.
12 changes: 11 additions & 1 deletion docs/product-contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,22 @@ record of how the behavior was developed.
ThunderClaw can improve, proofread, shorten, retone, translate, summarize, or
follow a custom instruction for an eligible selection.

Generate does not mutate the draft. Preview shows only a validated result.
Generate does not mutate the draft. Preview shows a local Changes comparison by
default, with Original and Proposed views and an optional expanded review window.
The comparison is built from the captured source and validated replacement,
never from model-supplied markup. A long comparison scrolls without hiding the
whole-suggestion Apply and Undo controls. Closing the review window keeps the
current suggestion available in the compose popup.
Apply is allowed only while the compose generation, connection binding,
selected provider/model, target identity, target hash, context hash, headers,
recipients, and attachments still match the authoritative state captured for the result.
Undo is rejected after a newer user edit or another state change makes exact
restoration unsafe.
An elapsed timer and Cancel are available while a compose or message model run
is active. Cancel invalidates the local run; a late response cannot become a
preview or displayed message result. A result already being committed to the
message display cannot be cancelled. Cancelling cannot guarantee the remote
provider stops processing or charging.

## Plain selected text

Expand Down
2 changes: 1 addition & 1 deletion docs/security-and-privacy.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ have their own retention, privacy, and billing policies.
The project operates no inference or analytics service. A local API address can
still route to hosted models. OpenRouter can route to upstream providers. Choose
a connection appropriate for your mail. See the [privacy policy](privacy-policy.md)
for what is transmitted and stored.
for what is transmitted and stored, including Fireworks data handling.

## Model authority and prompt injection

Expand Down
4 changes: 2 additions & 2 deletions docs/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ sequentially when they share the default `build/` directory.

| Layer | Coverage | Limits |
| --- | --- | --- |
| Deterministic tests | Prompt assembly, strict contracts, provider mappings, credentials, permissions, races, lifecycle, stale results, DOM/Undo rules, workflow guards | Mocked responses do not establish real-model quality or provider availability |
| Real Thunderbird with a synthetic API fixture | Built XPI installation, settings, model picker, key persistence/restart, capture, Preview, Apply, Undo/Redo, and eligible rich formatting | Bounded pinned versions and disposable profile configuration |
| Deterministic tests | Prompt assembly, strict contracts, provider mappings, credentials, permissions, review-window bindings, cancellation races, local comparison rendering, lifecycle, stale results, DOM/Undo rules, workflow guards | Mocked responses do not establish real-model quality or provider availability |
| Real Thunderbird with a synthetic API fixture | Built XPI installation, settings, model picker, key persistence/restart, capture, expanded review, Apply, Undo/Redo, compose and received elapsed timers and Cancel, and eligible rich formatting | Bounded pinned versions and disposable profile configuration |
| Live model trials | Request acceptance, faithful transformations, translations, formatting, injection evaluations | Model/server/version-specific evidence; never universal compatibility |
| Release qualification | Checksummed build-once XPI, Linux/Windows Thunderbird gates, reviewer-source reproduction, protected promotion and public signed-XPI verification | Successful upload alone does not mean marketplace review is complete |

Expand Down
Loading