Skip to content

Commit 3d8a049

Browse files
committed
2 parents 92150ec + 9be7748 commit 3d8a049

6 files changed

Lines changed: 91 additions & 5 deletions

File tree

AgentTools.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public static readonly (string Id, string[] Tools)[] Presets =
4646
("spreadsheet-files", new[] { "FileTool", "SpreadsheetTool", "GitTool" }),
4747
("email-agent", new[] { "EMailTool" }),
4848
("office-files", new[] { "FileTool", "OfficeTool", "GitTool" }),
49-
("multi-files", new[] { "FileTool", "WebTool", "DocumentTool", "SpreadsheetTool", "EMailTool", "GitTool" }),
49+
("multi-files", new[] { "FileTool", "WebTool", "DocumentTool", "SpreadsheetTool", "PresentationTool", "EMailTool", "GitTool" }),
5050
};
5151

5252
/// <summary>Agent-set ids exposed as models: the static presets plus the dynamic

Tui.cs

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4020,15 +4020,26 @@ private void ShowProvidersPanel()
40204020
};
40214021
dlg.Add(activeModelLabel);
40224022

4023+
// API key of the provider shown in the dropdown, editable right here (issue #11:
4024+
// the key was only reachable through the provider's Edit dialog, so users could
4025+
// not find where to paste it). The field follows the dropdown — switching the
4026+
// provider loads that provider's current key — and Save writes the edited value
4027+
// back through the single key-mutation path (ProviderConfigs.SetApiKey). Local
4028+
// providers simply leave it empty. The field is added to the view tree AFTER the
4029+
// Add/Edit/Remove buttons so the keyboard focus order (dropdown → list → Add →
4030+
// Edit) that the setup tests rely on is preserved.
4031+
dlg.Add(new Label { Text = Dictionary.ProviderApiKey, X = 1, Y = 2, Width = 18 });
4032+
var apiKeyField = new TextField { Text = "", X = 20, Y = 2, Width = 44, Secret = true };
4033+
40234034
// Validation message shown next to the dropdown when no provider is selected.
40244035
var validationLabel = new Label
40254036
{
4026-
Text = "", X = 1, Y = 2, Width = Dim.Fill() - 2,
4037+
Text = "", X = 1, Y = 3, Width = Dim.Fill() - 2,
40274038
SchemeName = "Hint",
40284039
};
40294040
dlg.Add(validationLabel);
40304041

4031-
int y = 3;
4042+
int y = 4;
40324043
dlg.Add(new Label { Text = Dictionary.SetupConfiguredProviders, X = 1, Y = y, Width = Dim.Fill() });
40334044
y++;
40344045
providersList.X = 1; providersList.Y = y; providersList.Width = 62; providersList.Height = 6;
@@ -4038,10 +4049,11 @@ private void ShowProvidersPanel()
40384049
var editBtn = new Button { Text = Dictionary.SetupEdit, X = Pos.Right(addBtn) + 1, Y = y };
40394050
var removeBtn = new Button { Text = Dictionary.SetupRemove, X = Pos.Right(editBtn) + 1, Y = y };
40404051
dlg.Add(addBtn, editBtn, removeBtn);
4052+
dlg.Add(apiKeyField);
40414053

40424054
// The list mirrors the dropdown selection with a single "(attivo)" marker — the
40434055
// user sees exactly one active provider, no redundant "default" tag.
4044-
providerDropdown.ValueChanged += (_, _) => RefreshProviderList();
4056+
providerDropdown.ValueChanged += (_, _) => { RefreshProviderList(); LoadApiKeyForSelection(); };
40454057
void RefreshProviderList()
40464058
{
40474059
providersList.Source = new ListWrapper<string>(new ObservableCollection<string>(
@@ -4075,6 +4087,17 @@ void RefreshProviders()
40754087
? _provider
40764088
: ProviderConfigs.Default.ProviderName;
40774089
RefreshProviderList();
4090+
LoadApiKeyForSelection();
4091+
}
4092+
// Loads the selected provider's current API key into the panel's key field so the
4093+
// user can see and edit it without opening the provider's Edit dialog (issue #11).
4094+
void LoadApiKeyForSelection()
4095+
{
4096+
var name = providerDropdown.Text;
4097+
apiKeyField.Text = !string.IsNullOrWhiteSpace(name)
4098+
&& ProviderConfigs.TryGet(name, out var cfg) && cfg != null
4099+
? cfg.ApiKey ?? ""
4100+
: "";
40784101
}
40794102
RefreshProviders();
40804103

@@ -4141,6 +4164,15 @@ void RefreshProviders()
41414164
return;
41424165
}
41434166
validationLabel.Text = "";
4167+
// Persist an edited API key for the selected provider (issue #11). Written
4168+
// only when the value actually changed, so opening and saving without
4169+
// touching the key never rewrites providers.json for nothing.
4170+
if (ProviderConfigs.TryGet(chosen, out var chosenCfg) && chosenCfg != null)
4171+
{
4172+
var newKey = (apiKeyField.Text ?? "").Trim();
4173+
if (!string.Equals(newKey, chosenCfg.ApiKey ?? "", StringComparison.Ordinal))
4174+
ProviderConfigs.SetApiKey(chosen, newKey, persist: true);
4175+
}
41444176
// The dropdown selection is the definitive active provider: persist it as the
41454177
// default (new chats start from it) and adopt it for the running process.
41464178
ProviderConfigs.SetDefault(chosen, persist: true);

docs/MANUAL.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@ On Linux/macOS, make the executable runnable:
5353
chmod +x agent
5454
```
5555

56+
> **Windows SmartScreen / Smart App Control.** The release binaries are not yet code-signed, so
57+
> Windows may warn or block `agent.exe` on first run. For SmartScreen use **More info → Run
58+
> anyway**, or right-click the file → **Properties → Unblock**. Smart App Control (Windows 11)
59+
> has no per-app override and must be turned off in Windows Security. See
60+
> [Getting started → If Windows blocks the app the first time](guide/01-Getting-Started.md) for
61+
> the full steps. Code signing is on the roadmap.
62+
5663
**From source (developers):**
5764

5865
```bash
@@ -305,6 +312,15 @@ see [section 6](#6-connect-a-client-to-localhost)):
305312
> server reports them unavailable (the UI shows it, the API returns 501 and
306313
> `GET /v1/control` lists exactly what is available).
307314
315+
> **Creating documents, spreadsheets, presentations and PDFs.** The `default-agent` set
316+
> carries only the everyday tools (files, web, versioning) and has **no** document-creation
317+
> tool, so a request for a `.docx`/`.xlsx`/`.pptx`/PDF there returns "no tool available".
318+
> Switch to a file-capable set for the conversation: `/tools multi-files` (Word, Excel,
319+
> browser slide decks and PDF reports together), `/tools document-files` (documents + PDF
320+
> reports), `/tools spreadsheet-files` (Excel), or `/tools office-files` for genuine
321+
> Microsoft Office files (real `.docx`/`.xlsx`/`.pptx`). See
322+
> [Creating documents](guide/05-Creating-Documents.md).
323+
308324
---
309325

310326
## 6. Connect a client to localhost

docs/guide/01-Getting-Started.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,18 @@ After the download finishes, extract the archive into a folder of your choice. O
1414

1515
When AgentBridge starts, you will see a full-screen chat window, similar to a messaging application. At the same time, a small local server starts on your machine that other programs can use to speak with the same assistant. You do not need to worry about this detail, because everything works together automatically.
1616

17+
## If Windows blocks the app the first time
18+
19+
Windows has a built-in protection that watches programs you download from the internet. Because AgentBridge is not yet digitally signed with a commercial certificate (we are still arranging one), Windows may stop it the first time you open it and show a warning. This is normal for newer software that is not signed, and it does not mean the program is harmful. AgentBridge is open source, so anyone can read exactly what it does. Here is how to get past the warning.
20+
21+
**The blue "Windows protected your PC" window (SmartScreen).** This is the most common case. The window says that SmartScreen prevented an unrecognized app from starting. Click the small **More info** link in that window, and a **Run anyway** button appears. Click it and the program starts. You only need to do this once.
22+
23+
**Unblock the file instead.** If you prefer, right-click the file named agent.exe, choose **Properties**, and at the bottom of the General tab tick the **Unblock** checkbox, then click **Apply** and **OK**. This tells Windows the file is trusted, so it stops interrupting you. You can also do it for the whole folder from PowerShell with `Unblock-File` on the files inside it.
24+
25+
**"Smart App Control blocked an app" (Windows 11).** Smart App Control is a stricter protection that some Windows 11 computers have turned on. Unlike SmartScreen, it blocks every unsigned program and does not offer a "Run anyway" button for a single app. To run AgentBridge you need to turn Smart App Control off: open the Start menu, search for **Windows Security**, go to **App & browser control**, open **Smart App Control settings**, and choose **Off**. Please read this before you do it: once Smart App Control is turned off it cannot be turned back on again without reinstalling Windows, so only turn it off if you trust where you downloaded the program from. Downloading AgentBridge from the official download page or the official GitHub releases page is the trusted source.
26+
27+
If you would rather not change any Windows setting, the one-line installer described above runs the download and setup for you and is the smoothest way to get going on Windows.
28+
1729
## The first start
1830

1931
The first time you start AgentBridge, the assistant begins reading your documents folder in the background. If you have a large collection of files, this first indexing can take a few minutes, but you can start chatting right away while it works. From that moment on, the assistant can answer questions using the information found in your own files, instead of guessing.

docs/guide/02-Choosing-Your-AI.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Open the chat window and type /providers, or use the menu Settings and then LLM
88

99
## API keys
1010

11-
Most cloud providers require a key that identifies you. When you add a cloud provider, the window asks for its API key, and the key is hidden while you type. Local providers, which run on your own computer, do not need a key. All your keys are stored on your machine and are never touched by an update.
11+
Most cloud providers require a key that identifies you. Open the LLM & Provider panel and you will see a "API key" box right under the provider selector: it shows the key of the provider currently chosen in the dropdown, and you can paste or change it there and press Save. Switching the provider in the dropdown loads that provider's own key, so you always edit the right one. The key stays hidden while you type. You can also set it when you add or edit a provider from the list below. Local providers, which run on your own computer, do not need a key, so you can leave the box empty for them. All your keys are stored on your machine and are never touched by an update.
1212

1313
## Switching at any time
1414

docs/guide/05-Creating-Documents.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,32 @@ Ask for a Word document and the agent writes the text and lays it out for you. A
1010

1111
For market analysis, financial reports, or any analytical document, the assistant produces accurate PDF reports with professional sources and a level of detail that is hard to match by hand. Just describe the topic and the depth you need, and the report comes back as a finished PDF.
1212

13+
## Turning the document tools on
14+
15+
These abilities come from tools, and the assistant starts with only the everyday ones
16+
switched on so that it stays quick and light. If you ask for a document, a spreadsheet,
17+
a presentation or a PDF and it replies that it has no tool for that, it simply means the
18+
right tool is not active in your current conversation yet. Turn it on with the
19+
**`/tools`** command: a checklist opens, tick the tool you need, and close it — your choice
20+
is remembered. If you already know what the conversation is about, name a ready-made
21+
combination straight after the command.
22+
23+
Which combination to pick:
24+
25+
- **`/tools multi-files`** is the easiest all-round choice. It lets the assistant write
26+
Word documents, build spreadsheets with charts, make a slide deck you open in the
27+
browser, and produce PDF reports, all in the same conversation.
28+
- **`/tools document-files`** when you only want documents and PDF reports.
29+
- **`/tools office-files`** when you need a real PowerPoint file (`.pptx`), a real Word
30+
file (`.docx`) or a real Excel file (`.xlsx`) that you will keep editing in Microsoft
31+
Office. This is the tool that produces genuine Office files rather than a browser deck.
32+
- **`/tools all-files`** turns on everything at once.
33+
34+
A note on presentations: the slide decks made in the `multi-files` conversation open in
35+
your web browser (press F11 for full screen) and look like a real presentation, but they
36+
are not a `.pptx` file. If you specifically need a `.pptx` you can hand to someone else or
37+
open in PowerPoint, use `/tools office-files`.
38+
1339
## A personal style
1440

1541
The assistant remembers the style it used for your documents and keeps it for future work. If you want a different look, you simply ask, and it adjusts the result to your taste.

0 commit comments

Comments
 (0)