Files
davidandClaude Opus 5.5 c36f786ae9 Fixes from the first round of TEST.md
SEO: a domain property (sc-domain:) covers every subdomain, so the shop,
Gitea and forum were counted as the website. What ranks, the morning
check, the Monday report, keywords, change candidates and the audit's
traffic now read only the website's own host (with or without www).
The report keeps pages worth a proposal apart from "Waiting for your
yes", explains only moves past the thresholds, and says "places up/down".

Also:
- Feed summaries drop the posts' scripts and styles.
- Spend you log can't be negative.
- Test and check buttons can't be clicked twice while they run.
- Previews show the site's web fonts and icon sprites.
- Backups are read without leaving -wal/-shm files; deleting one removes
  them, and leftovers are swept at start.
- The Overview's setup flags a CRM that Hermes can't reach.
- Import now says what came in; adding a prospect that exists says so;
  prospects can be deleted.
- Signal tags and brief addresses keep accented letters (Ü → u).
- Page errors start with a capital; clearer messages for bad uploads,
  CRM retry and cancel, keywords, and the finished audit.
- The module you're in stays unfolded in the sidebar.
- A picked keyword can be unpicked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 06:31:42 -07:00

77 lines
4.6 KiB
HTML

{{define "content"}}{{template "settings-start" .}}{{with .Data}}{{$cfg := .Cfg}}{{$set := .Set}}
<h2>AI</h2>
<p class="lede">The model Supermarket writes with: drafts, the profile draft, and later the other modules. It's called directly, never through Hermes, so text read from the web can't reach an agent with tools.</p>
<form method="post" action="/settings/ai" id="ai-form" autocomplete="off">
<section class="card">
<fieldset class="choice">
<legend>Provider</legend>
<label class="check"><input type="radio" name="provider" value="anthropic" {{if ne $cfg.Provider "openai"}}checked{{end}} data-toggle="provider"> Anthropic (Claude)</label>
<label class="check"><input type="radio" name="provider" value="openai" {{if eq $cfg.Provider "openai"}}checked{{end}} data-toggle="provider">
A server on your network (Ollama, LM Studio, llama.cpp, vLLM) or another OpenAI-compatible service</label>
</fieldset>
</section>
<section class="card" data-show-for="anthropic">
<h3>Key</h3>
{{if .HasAnthropicKey}}<p class="ok">Using the key saved here.</p>
{{else if .Shared}}<p class="ok">Using Hermes' key, shared by <code>supermarket hermes</code>. Hermes uses {{.Shared.Model}}.</p>
<p class="help">To use a separate key, for example to see Supermarket's costs apart from Hermes', save it below: it takes the place of Hermes'.</p>
{{else}}<p class="warn-text">No key yet. Save one below, or share Hermes' by running <code>supermarket hermes</code>.</p>{{end}}
{{range .Keys}}{{if eq .Group "anthropic"}}{{template "key-field" (dict "F" . "Set" (index $set .Name))}}{{end}}{{end}}
</section>
<section class="card" data-show-for="openai">
<h3>Server</h3>
<label>Address <input name="base_url" id="base_url" value="{{$cfg.BaseURL}}" placeholder="http://192.168.1.20:11434" list="servers">
<span class="help">Supermarket runs in Docker: for a server on this computer use <code>http://host.docker.internal:11434</code>, and use an IP address rather than a <code>.local</code> name.</span></label>
<datalist id="servers">{{range .Servers}}<option value="{{.BaseURL}}">{{.Name}}</option>{{end}}</datalist>
{{if .Servers}}<p class="help">Found by CoreDesktop's <code>configure ai-servers</code>: {{range $i, $s := .Servers}}{{if $i}}, {{end}}{{$s.Name}} ({{$s.BaseURL}}){{end}}.</p>{{end}}
<button hx-disabled-elt="this" type="button" class="secondary" hx-get="/settings/ai/models" hx-include="#base_url" hx-target="#model-list" hx-indicator="#listing-models">List its models</button> <span id="listing-models" class="htmx-indicator">Asking the server…</span>
<div id="model-list"></div>
{{range .Keys}}{{if eq .Group "openai"}}{{template "key-field" (dict "F" . "Set" (index $set .Name))}}{{end}}{{end}}
</section>
<section class="card">
<h3>Model</h3>
<label>Model <input name="model" value="{{$cfg.Model}}" list="anthropic-models" required></label>
<datalist id="anthropic-models">{{range .AnthropicModels}}<option value="{{.}}">{{end}}</datalist>
<label data-show-for="anthropic">Effort
<select name="effort">
{{range .Efforts}}<option value="{{.}}" {{if eq $cfg.Effort .}}selected{{end}}>{{.}}</option>{{end}}
</select>
<span class="help">How hard the model thinks. Medium suits drafting; higher costs more and takes longer.</span>
</label>
<details>
<summary>A different model per task</summary>
<p class="help">Leave empty to use the model above. Same provider.</p>
{{range .Tasks}}
<label>{{.Label}} <input name="task_{{.ID}}" value="{{index $cfg.TaskModels .ID}}" list="anthropic-models"></label>
{{end}}
</details>
</section>
<div class="actions">
<button type="submit">Save</button>
<button hx-disabled-elt="this" type="button" class="secondary" hx-post="/settings/ai/test" hx-include="#ai-form" hx-target="#test-result" hx-indicator="#testing">Test</button>
<span id="testing" class="htmx-indicator">Asking the model…</span>
</div>
<p class="help">Test uses the provider and model in the form, and the keys already saved: save a new key before testing it.</p>
<div id="test-result"></div>
</form>
{{end}}{{template "settings-end"}}{{end}}
{{define "test-result"}}
{{if .Error}}<p class="error">{{.Error}}</p>
{{else}}<p class="flash">The model answered in {{.Took}}: “{{.Reply}}”</p>{{end}}
{{end}}
{{define "model-list"}}
{{if .Error}}<p class="error">{{.Error}}</p>
{{else if .Models}}<p class="help">Models on this server (click one to use it):</p>
<ul class="pills">{{range .Models}}<li><button type="button" class="pill" data-fill="model" data-value="{{.}}">{{.}}</button></li>{{end}}</ul>
{{else}}<p class="help">The server has no models.</p>{{end}}
{{end}}