v0.2.26 4c2e835

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) SetRecursiveFileSuggest(enabled bool) error {
26	cfg, err := LoadConfig()
27	if err != nil {
28		return err
29	}
30	cfg.RecursiveFileSuggest = &enabled
31	return SaveConfig(cfg)
32}
33
34func (configSettingsStore) SetRespectGitignore(enabled bool) error {
35	cfg, err := LoadConfig()
36	if err != nil {
37		return err
38	}
39	cfg.RespectGitignore = &enabled
40	return SaveConfig(cfg)
41}
42
43func (configSettingsStore) SetReasoning(level string) error {
44	cfg, err := LoadConfig()
45	if err != nil {
46		return err
47	}
48	cfg.Reasoning = provider.NormalizeReasoning(level)
49	return SaveConfig(cfg)
50}
51
52func (configSettingsStore) SetTheme(name string) error {
53	cfg, err := LoadConfig()
54	if err != nil {
55		return err
56	}
57	if name == "auto" {
58		name = ""
59	}
60	cfg.Theme = name
61	return SaveConfig(cfg)
62}
63
64// AutoSwarmEnabled reads the current auto-swarm flag from config.
65// Used by the swarm_spawn tool at call time to gate execution.
66func AutoSwarmEnabled() bool {
67	cfg, err := LoadConfig()
68	if err != nil {
69		return false
70	}
71	return cfg.AutoSwarmEnabled != nil && *cfg.AutoSwarmEnabled
72}
73
74// AutoSwarmSystemAddendum is appended to the system prompt when
75// auto-swarm is enabled, so the model knows it may delegate to
76// background sub-agents without the user having to mention the tool
77// by name. Kept short so it doesn't bloat the cached prompt prefix.
78const AutoSwarmSystemAddendum = `Auto-swarm is enabled. You have a swarm_spawn tool that forks background sub-agents working in parallel in this same working directory.
79
80Use 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.
81
82Do 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.
83
84When 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