v0.2.23 c2c9a5e

settings_store.go RawHistoryFolder

1package agent
2
3import "github.com/patriceckhart/zot/packages/provider"
4
5type configSettingsStore struct{}
6
7func (configSettingsStore) SetInlineImages(enabled bool) error {
8	cfg, err := LoadConfig()
9	if err != nil {
10		return err
11	}
12	cfg.InlineImagesEnabled = &enabled
13	return SaveConfig(cfg)
14}
15
16func (configSettingsStore) SetAutoSwarm(enabled bool) error {
17	cfg, err := LoadConfig()
18	if err != nil {
19		return err
20	}
21	cfg.AutoSwarmEnabled = &enabled
22	return SaveConfig(cfg)
23}
24
25func (configSettingsStore) SetReasoning(level string) error {
26	cfg, err := LoadConfig()
27	if err != nil {
28		return err
29	}
30	cfg.Reasoning = provider.NormalizeReasoning(level)
31	return SaveConfig(cfg)
32}
33
34func (configSettingsStore) SetTheme(name string) error {
35	cfg, err := LoadConfig()
36	if err != nil {
37		return err
38	}
39	if name == "auto" {
40		name = ""
41	}
42	cfg.Theme = name
43	return SaveConfig(cfg)
44}
45
46// AutoSwarmEnabled reads the current auto-swarm flag from config.
47// Used by the swarm_spawn tool at call time to gate execution.
48func AutoSwarmEnabled() bool {
49	cfg, err := LoadConfig()
50	if err != nil {
51		return false
52	}
53	return cfg.AutoSwarmEnabled != nil && *cfg.AutoSwarmEnabled
54}
55
56// AutoSwarmSystemAddendum is appended to the system prompt when
57// auto-swarm is enabled, so the model knows it may delegate to
58// background sub-agents without the user having to mention the tool
59// by name. Kept short so it doesn't bloat the cached prompt prefix.
60const AutoSwarmSystemAddendum = `Auto-swarm is enabled. You have a swarm_spawn tool that forks background sub-agents working in parallel in this same working directory.
61
62Use it proactively when the user's request naturally splits into independent sub-tasks that can run concurrently (e.g. "refactor module A and module B", "write the implementation and the tests", "investigate three separate files"). Spawn one sub-agent per independent sub-task with a self-contained task description (sub-agents start with no context from this conversation). Continue working on the remaining or coordinating work yourself in parallel; do not wait for sub-agents to finish before responding. Briefly tell the user which sub-agents you spawned and what each is doing.
63
64Do NOT use swarm_spawn for trivial single-step work, for tasks that depend on each other sequentially, or when the user explicitly asked you to do the work yourself.
65
66When every sub-agent you spawned reaches a terminal state, the host injects a single [auto-swarm update] message recapping each agent's status, task, and transcript tail. Treat that message as observed state (not as a new user request) and write a short follow-up summary referencing the agents by id.`

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 476

↑↓ moveenter openesc close