Skip to content

Commit 64aa084

Browse files
authored
Merge pull request #111 from baalimago/feat/minor-tweaks
Features of note: * There's a notification via `\a` bell character * Added `clai confdir` which simply returns path to conf dir * Moved context shell to system prompt instead of user message. This is to make indexing easier
2 parents 7a10375 + 57eaa0d commit 64aa084

40 files changed

Lines changed: 649 additions & 285 deletions

AGENTS.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ You're working on a project called "clai".
55
## Always read:
66

77
- ./main.go - This contains usage which gives a functional overview
8-
- ./main_test.go - This contains goldenfile tests, which explains functionality in further detail
98
- ./go.mod - This shows which libraries are used, do not add additional third party libraries
109
- ./architecture - This is a directory with many files explaining the architecture of sub-features. Read the document regarding the feature you wish to know more about.
1110

File renamed without changes.
Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ The file is automatically created with defaults if missing.
2525

2626
### Theme fields
2727

28-
All fields are raw ANSI escape sequences represented as JSON strings.
28+
All colour fields are raw ANSI escape sequences represented as JSON strings.
2929

3030
| Field | Purpose |
3131
|------:|---------|
@@ -36,9 +36,27 @@ All fields are raw ANSI escape sequences represented as JSON strings.
3636
| `roleUser` | Colour for `user` role labels. |
3737
| `roleTool` | Colour for `tool` role labels. |
3838
| `roleOther` | Fallback colour for any other/unknown role. |
39+
| `notificationBell` | Whether clai should emit terminal BEL (`\a`) after successful task completion. |
3940

4041
Defaults are chosen to match the existing `AttemptPrettyPrint` role palette (system=blue, user=cyan, tool=magenta).
4142

43+
Example:
44+
45+
```json
46+
{
47+
"primary": "\u001b[38;2;110;130;150m",
48+
"secondary": "\u001b[38;2;140;165;190m",
49+
"breadtext": "\u001b[38;2;200;210;220m",
50+
"roleSystem": "\u001b[34m",
51+
"roleUser": "\u001b[36m",
52+
"roleTool": "\u001b[35m",
53+
"roleOther": "\u001b[34m",
54+
"notificationBell": true
55+
}
56+
```
57+
58+
`notificationBell` is intended for terminal/tmux attention behavior. Depending on terminal and tmux configuration, BEL may produce an audible bell, visual flash, or other attention marker.
59+
4260
## Disabling colour: `NO_COLOR`
4361

4462
clai follows the common `NO_COLOR` convention (see also `main.go` usage text).
@@ -84,6 +102,14 @@ All colouring is applied via `utils.Colorize(...)`, so it automatically respects
84102
- Table rows: `theme.breadtext`
85103
- Interactive prompt line: `theme.secondary`
86104

105+
### 4) Completion notification
106+
107+
After a successful task/query completes, clai may emit terminal BEL depending on `theme.notificationBell`.
108+
109+
Implementation:
110+
- `main.go:triggerCompletionNotification()`
111+
- `internal/utils.NotificationBellEnabled()`
112+
87113
## Customization
88114

89115
To customize colours, edit:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ Stored under:
111111
- `<config>/conversations/globalScope.json` (global reply context)
112112
- `<config>/conversations/dirs/*` (directory-scoped binding metadata)
113113

114-
These are described in `architecture/CHAT.md`.
114+
These are described in `architecture/chat.md`.
115115

116116
They aren’t traditional config, but they influence prompt assembly (`-re`, `-dre`, `chat continue`, etc.).
117117

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ main.go:run()
2828
| `internal/dre.go` | Implements the `dre` command querier (`dreQuerier`) |
2929
| `internal/chat/replay.go` | `Replay(raw, dirScoped)` + `replayDirScoped` |
3030
| `internal/chat/dirscope.go` | Directory binding storage + lookup (`LoadDirScope`) |
31-
| `architecture/CHAT.md` | Background: how conversations and dir bindings work |
31+
| `architecture/chat.md` | Background: how conversations and dir bindings work |
3232

3333
## How it finds the conversation
3434

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)