summaryrefslogtreecommitdiffhomepage
path: root/dispatch.toml
blob: 69649931688cd869ed4df831a8c7ef236d12310f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# Dispatch — Key & Permission Configuration
# Credentials and API keys are stored in the SQLite database.
# Use the Model Status panel to import credentials, or run bin/import-credentials.ts.
#
# ─── Global defaults ─────────────────────────────────────────────
# A HOME-directory config at ~/.config/dispatch/dispatch.toml (override with
# the DISPATCH_GLOBAL_CONFIG env var) is loaded and MERGED underneath this
# project config, so machine-wide settings (e.g. globally available LSP
# servers) work in any repository without per-repo setup. This LOCAL file
# always takes PRECEDENCE on conflicts:
#   [lsp]          merged by server id — a local [lsp.<id>] overrides the
#                  global one of the same id; non-conflicting ids from both
#                  stay active.
#   [[keys]]       merged by id — a local key overrides the global key of the
#                  same id; non-conflicting ids from both stay active.
#   [permissions]  merged per group: nested { pattern = action } groups merge
#                  pattern-by-pattern (local patterns win), and a local value
#                  replaces a global one of the same key. Global patterns are
#                  emitted first so local rules win at evaluation time.
# Both files hot-reload: editing either re-merges and applies live.

# ─── API Keys ───────────────────────────────────────────────────

[[keys]]
id = "claude-pro"
provider = "anthropic"
base_url = "https://api.anthropic.com/v1"
credentials_file = "/home/tradam/.claude/.credentials-pro.json"

[[keys]]
id = "claude-max"
provider = "anthropic"
base_url = "https://api.anthropic.com/v1"
credentials_file = "/home/tradam/.claude/.credentials-max.json"

[[keys]]
id = "opencode-1"
provider = "opencode-go"
base_url = "https://opencode.ai/zen/go/v1"

[[keys]]
id = "opencode-2"
provider = "opencode-go"
base_url = "https://opencode.ai/zen/go/v1"

# ─── Permissions ─────────────────────────────────────────────────

[permissions]
read = "allow"

# NOTE on ordering: rules are flattened in file order and the LAST matching
# rule wins (see evaluate()'s findLast). So a broad fallback like "*" must be
# placed FIRST and the more-specific overrides AFTER it — otherwise a trailing
# "*" would shadow every specific rule above it. (Global+local merge preserves
# this: global patterns are emitted before local ones so local overrides win.)

[permissions.edit]
"*" = "ask"
"src/**" = "allow"

[permissions.bash]
"*" = "ask"
"npm test" = "allow"
"npm run *" = "allow"
"git status" = "allow"
"git diff" = "allow"
"git log *" = "allow"
"git branch *" = "allow"
"git add *" = "allow"
"git commit *" = "allow"
"git push *" = "allow"
"ls *" = "allow"

[permissions.external_directory]
"~/*" = "ask"
"/tmp/*" = "allow"

# ─── Language Servers (LSP) ──────────────────────────────────────
# After `write_file` edits a matching file, dispatch appends any diagnostics.
# Grant `perm_lsp` to also expose the on-demand `lsp` tool for hover/definition/references.

[lsp.biome]
command = ["/home/tradam/projects/dispatch/dispatch-source/node_modules/.bin/biome", "lsp-proxy"]
extensions = [".ts", ".tsx", ".js", ".jsx", ".svelte", ".css", ".json"]

[lsp.typescript-language-server]
command = ["/home/tradam/.local/bin/typescript-language-server", "--stdio"]
extensions = [".ts", ".tsx"]
env = { PATH = "/home/tradam/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin" }