brass-runtime 1.15.0 → 1.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/README.md +673 -136
- package/dist/agent/cli/main.cjs +40 -35
- package/dist/agent/cli/main.js +9 -4
- package/dist/agent/cli/main.mjs +9 -4
- package/dist/agent/index.cjs +8 -4
- package/dist/agent/index.d.ts +1 -1
- package/dist/agent/index.js +7 -3
- package/dist/agent/index.mjs +7 -3
- package/dist/chunk-2HQTDLHF.mjs +683 -0
- package/dist/chunk-36I3M4UC.mjs +370 -0
- package/dist/chunk-3AYM6WPJ.js +1629 -0
- package/dist/chunk-3LOYJFRR.cjs +300 -0
- package/dist/chunk-3RG5ZIWI.js +10 -0
- package/dist/chunk-3Y2RIUMM.js +300 -0
- package/dist/{chunk-VEZNF5GZ.cjs → chunk-4ROBZFL6.cjs} +130 -126
- package/dist/{chunk-3QMOKAS5.js → chunk-52OB2ROS.js} +9 -5
- package/dist/chunk-52PPNNI4.cjs +416 -0
- package/dist/chunk-5EC274J5.cjs +2874 -0
- package/dist/chunk-5QC7LRZ3.js +229 -0
- package/dist/chunk-5VRJNBLZ.mjs +2874 -0
- package/dist/chunk-62AZW6UT.cjs +313 -0
- package/dist/chunk-6IXXWIUM.js +683 -0
- package/dist/chunk-74ZTY6CP.js +2871 -0
- package/dist/chunk-76YMRMH2.cjs +777 -0
- package/dist/chunk-7CMJS3QE.mjs +2871 -0
- package/dist/{chunk-4NHES7VK.mjs → chunk-7JIJOVCT.js} +27 -13
- package/dist/chunk-A2OM6NEH.mjs +194 -0
- package/dist/chunk-AGR5B2BC.cjs +683 -0
- package/dist/chunk-AVNQLJ5V.js +777 -0
- package/dist/chunk-B33ICAKP.js +313 -0
- package/dist/{chunk-ELOOF35R.mjs → chunk-B5JD23U7.mjs} +1 -1
- package/dist/chunk-BABBZK4Y.js +2024 -0
- package/dist/chunk-C3MDXTRZ.js +354 -0
- package/dist/chunk-CIZFIMK5.js +2193 -0
- package/dist/chunk-CZIVE6NT.cjs +354 -0
- package/dist/chunk-DNFJLJMW.mjs +354 -0
- package/dist/chunk-DNFO2EIZ.mjs +777 -0
- package/dist/chunk-EJ6BPYVR.mjs +416 -0
- package/dist/chunk-ENKODRU3.cjs +2193 -0
- package/dist/chunk-EOC4UHBS.mjs +229 -0
- package/dist/{chunk-BMH5AV44.js → chunk-FH2X7BVP.js} +756 -440
- package/dist/{chunk-PPUXIH5R.js → chunk-FHQGHPMO.mjs} +27 -13
- package/dist/{chunk-TGIFUAK4.cjs → chunk-GLE2WY7Z.cjs} +951 -635
- package/dist/{chunk-BDF4AMWX.mjs → chunk-GYM3LLGS.mjs} +756 -440
- package/dist/chunk-HLWLMW2F.mjs +2024 -0
- package/dist/chunk-JF5WGYJJ.cjs +194 -0
- package/dist/chunk-KH4SYAOS.mjs +1629 -0
- package/dist/chunk-KN32XNTH.mjs +313 -0
- package/dist/chunk-KQLYONSE.cjs +2871 -0
- package/dist/{chunk-STVLQ3XD.cjs → chunk-KZJQ723N.cjs} +92 -78
- package/dist/chunk-L2SYFEBS.js +194 -0
- package/dist/chunk-L6VB5N7Q.cjs +104 -0
- package/dist/{chunk-K6M7MDZ4.mjs → chunk-MBEJI5HF.mjs} +9 -5
- package/dist/chunk-MIIYDLGM.js +2874 -0
- package/dist/chunk-MOO4L7F4.mjs +104 -0
- package/dist/chunk-MT3OWDPC.mjs +2193 -0
- package/dist/chunk-MVGUEJ5Z.cjs +370 -0
- package/dist/chunk-OBGZSXTJ.cjs +10 -0
- package/dist/chunk-PD4EJTQC.cjs +229 -0
- package/dist/chunk-PWC3RBQE.mjs +300 -0
- package/dist/chunk-Q2I37RP3.cjs +1629 -0
- package/dist/chunk-RKGKFN2A.js +416 -0
- package/dist/{chunk-R3R2FVLG.cjs → chunk-SA6HUJVI.cjs} +5 -5
- package/dist/chunk-TRM4JUZQ.js +104 -0
- package/dist/chunk-UB4B6OFY.js +370 -0
- package/dist/{chunk-TO7IKXYT.js → chunk-UCUBNWM2.js} +1 -1
- package/dist/chunk-VN44DYYT.cjs +2024 -0
- package/dist/chunk-Y6FXYEAI.mjs +10 -0
- package/dist/client-CZHU674n.d.ts +820 -0
- package/dist/core/index.cjs +198 -4
- package/dist/core/index.d.ts +311 -212
- package/dist/core/index.js +237 -43
- package/dist/core/index.mjs +237 -43
- package/dist/{effect-CMOQKX8y.d.ts → effect-DIUHZ9IN.d.ts} +195 -1
- package/dist/effectRunner-CFLC32IK.cjs +8 -0
- package/dist/effectRunner-L4S7IPT3.js +8 -0
- package/dist/effectRunner-NNGG75QA.mjs +8 -0
- package/dist/http/index.cjs +1227 -2971
- package/dist/http/index.d.ts +826 -280
- package/dist/http/index.js +1089 -2833
- package/dist/http/index.mjs +1089 -2833
- package/dist/http/testing.cjs +161 -0
- package/dist/http/testing.d.ts +43 -0
- package/dist/http/testing.js +161 -0
- package/dist/http/testing.mjs +161 -0
- package/dist/index.cjs +486 -250
- package/dist/index.d.ts +87 -95
- package/dist/index.js +391 -155
- package/dist/index.mjs +391 -155
- package/dist/observability/index.cjs +162 -0
- package/dist/observability/index.d.ts +152 -0
- package/dist/observability/index.js +162 -0
- package/dist/observability/index.mjs +162 -0
- package/dist/perf/cli.cjs +401 -0
- package/dist/perf/cli.d.ts +1 -0
- package/dist/perf/cli.js +401 -0
- package/dist/perf/cli.mjs +401 -0
- package/dist/perf/index.cjs +141 -0
- package/dist/perf/index.d.ts +483 -0
- package/dist/perf/index.js +141 -0
- package/dist/perf/index.mjs +141 -0
- package/dist/schedule-CK3Ml_7p.d.ts +259 -0
- package/dist/schema/index.cjs +29 -0
- package/dist/schema/index.d.ts +179 -0
- package/dist/schema/index.js +29 -0
- package/dist/schema/index.mjs +29 -0
- package/dist/server-GJPg8ZSG.d.ts +675 -0
- package/dist/{stream-FQm9h4Mg.d.ts → stream-B4oK9JFP.d.ts} +1 -1
- package/dist/tracer-Hwt1cl7h.d.ts +189 -0
- package/dist/tracing-DqbTKGcf.d.ts +148 -0
- package/docs/ARCHITECTURE.md +292 -0
- package/docs/README.md +63 -0
- package/docs/adr/0001-ai-context-pack.md +32 -0
- package/docs/agent-apply-mode.md +104 -0
- package/docs/agent-approvals.md +110 -0
- package/docs/agent-batch.md +185 -0
- package/docs/agent-boundaries.md +112 -0
- package/docs/agent-chat-sessions.md +160 -0
- package/docs/agent-ci.md +17 -0
- package/docs/agent-cli.md +405 -0
- package/docs/agent-config.md +480 -0
- package/docs/agent-context-discovery.md +159 -0
- package/docs/agent-copilot-like-dx.md +126 -0
- package/docs/agent-declarative-optimized-planning.md +138 -0
- package/docs/agent-dx.md +224 -0
- package/docs/agent-env-files.md +126 -0
- package/docs/agent-follow-up-context.md +43 -0
- package/docs/agent-global-usage.md +180 -0
- package/docs/agent-init.md +109 -0
- package/docs/agent-install-and-configure.md +516 -0
- package/docs/agent-language-workspace-ux.md +99 -0
- package/docs/agent-llm-adapters.md +123 -0
- package/docs/agent-local-install.md +190 -0
- package/docs/agent-local-tests.md +51 -0
- package/docs/agent-observability.md +155 -0
- package/docs/agent-patch-quality-loop.md +162 -0
- package/docs/agent-presets.md +22 -0
- package/docs/agent-project-commands.md +237 -0
- package/docs/agent-project-intelligence.md +156 -0
- package/docs/agent-redaction.md +18 -0
- package/docs/agent-release-readiness.md +76 -0
- package/docs/agent-rollback-safety.md +162 -0
- package/docs/agent-rollback.md +23 -0
- package/docs/agent-run-artifacts.md +16 -0
- package/docs/agent-vscode-auto-discovery.md +137 -0
- package/docs/agent-vscode-batch-runner.md +100 -0
- package/docs/agent-vscode-chat-layout.md +90 -0
- package/docs/agent-vscode-clean-install.md +147 -0
- package/docs/agent-vscode-code-actions.md +70 -0
- package/docs/agent-vscode-diff-preview.md +45 -0
- package/docs/agent-vscode-inline-assist.md +56 -0
- package/docs/agent-vscode-install.md +186 -0
- package/docs/agent-vscode-model-setup.md +97 -0
- package/docs/agent-vscode-patch-preview.md +92 -0
- package/docs/agent-vscode-problems.md +79 -0
- package/docs/agent-vscode-project-dashboard.md +106 -0
- package/docs/agent-vscode-run-history.md +92 -0
- package/docs/agent-vscode-ux.md +73 -0
- package/docs/ai/INVARIANTS.md +84 -0
- package/docs/ai/PROJECT_MAP.md +338 -0
- package/docs/ai/PUBLIC_API.md +336 -0
- package/docs/ai/VALIDATION_MATRIX.md +67 -0
- package/docs/api-polish.md +37 -0
- package/docs/cancellation.md +162 -0
- package/docs/coverage.md +46 -0
- package/docs/getting-started.md +159 -0
- package/docs/guides/README.md +40 -0
- package/docs/guides/circuit-breaker.md +89 -0
- package/docs/guides/error-handling.md +91 -0
- package/docs/guides/getting-started.md +107 -0
- package/docs/guides/layers.md +189 -0
- package/docs/guides/metrics.md +101 -0
- package/docs/guides/resource-management.md +141 -0
- package/docs/guides/retry.md +215 -0
- package/docs/guides/semaphore.md +66 -0
- package/docs/guides/streams.md +117 -0
- package/docs/guides/supervisors.md +98 -0
- package/docs/guides/testing.md +162 -0
- package/docs/guides/tracing.md +71 -0
- package/docs/http-recipes.md +399 -0
- package/docs/http.md +749 -0
- package/docs/modules.md +285 -0
- package/docs/observability-collector-smoke.md +31 -0
- package/docs/observability-framework-examples.md +98 -0
- package/docs/observability.md +542 -0
- package/docs/otel-collector-smoke.yaml +27 -0
- package/docs/performance-profiler.md +199 -0
- package/docs/production-readiness.md +73 -0
- package/docs/recipes/README.md +12 -0
- package/docs/recipes/http-server.md +45 -0
- package/docs/recipes/layers.md +44 -0
- package/docs/recipes/performance.md +47 -0
- package/docs/recipes/runtime.md +41 -0
- package/docs/recipes/testing.md +41 -0
- package/docs/release.md +53 -0
- package/docs/wasm-bounded-queues.md +44 -0
- package/docs/wasm-engine-observability-benchmarks.md +85 -0
- package/docs/wasm-fiber-engine.md +117 -0
- package/docs/wasm-scheduler-state-machine.md +122 -0
- package/docs/wasm-stream-chunks.md +54 -0
- package/package.json +48 -2
- package/dist/chunk-AR22SXML.js +0 -1043
- package/dist/chunk-BDYEENHT.js +0 -224
- package/dist/chunk-JFPU5GQI.mjs +0 -1043
- package/dist/chunk-MS34J5LY.cjs +0 -224
- package/dist/chunk-UMAZLXAB.mjs +0 -224
- package/dist/chunk-XPZNXSVN.cjs +0 -1043
- package/dist/tracing-DNT9jEbr.d.ts +0 -106
|
@@ -0,0 +1,516 @@
|
|
|
1
|
+
# Brass Agent install and configuration
|
|
2
|
+
|
|
3
|
+
This guide is the shortest path from a fresh checkout to a working local
|
|
4
|
+
`brass-agent` CLI and VS Code extension.
|
|
5
|
+
|
|
6
|
+
`brass-agent` is still an experimental module that lives on top of
|
|
7
|
+
`brass-runtime`. Treat this as an alpha install flow: good for local dogfooding,
|
|
8
|
+
not yet a stable release process.
|
|
9
|
+
|
|
10
|
+
## What gets installed
|
|
11
|
+
|
|
12
|
+
There are two pieces:
|
|
13
|
+
|
|
14
|
+
```txt
|
|
15
|
+
brass-agent CLI
|
|
16
|
+
The canonical runner. It owns config loading, policy, approvals, LLM adapters,
|
|
17
|
+
patch application, rollback safety, context discovery, and batch execution.
|
|
18
|
+
|
|
19
|
+
VS Code extension
|
|
20
|
+
A thin client. It calls the CLI through --protocol-json, renders progress,
|
|
21
|
+
patch previews, history, and batch runs. It does not apply patches directly.
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
The boundary remains:
|
|
25
|
+
|
|
26
|
+
```txt
|
|
27
|
+
src/core
|
|
28
|
+
↑
|
|
29
|
+
src/agent
|
|
30
|
+
↑
|
|
31
|
+
brass-agent CLI
|
|
32
|
+
↑
|
|
33
|
+
VS Code extension / editor clients
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Prerequisites
|
|
37
|
+
|
|
38
|
+
You need these available locally:
|
|
39
|
+
|
|
40
|
+
```txt
|
|
41
|
+
Node.js + npm
|
|
42
|
+
Git
|
|
43
|
+
ripgrep (`rg`) for context search
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Optional but recommended:
|
|
47
|
+
|
|
48
|
+
```txt
|
|
49
|
+
VS Code CLI (`code`) if you want one-command VS Code extension installation
|
|
50
|
+
A Gemini or OpenAI-compatible API key if you want a real model
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Check your machine with:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
brass-agent --doctor
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
or, before globally linking the CLI:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
npm run agent:doctor
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Install the CLI from source
|
|
66
|
+
|
|
67
|
+
From the `brass-runtime` checkout:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
npm install
|
|
71
|
+
npm run build
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Smoke test the built CLI directly:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
node dist/agent/cli/main.cjs --doctor
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
To expose `brass-agent` on your shell path during local development:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
npm run agent:link
|
|
84
|
+
brass-agent --doctor
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
This lets you run `brass-agent` from any project, not just the
|
|
88
|
+
`brass-runtime` checkout. To verify which project root will be used:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
cd /path/to/my-project/some/subfolder
|
|
92
|
+
brass-agent --where
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
The CLI auto-discovers the nearest workspace root by searching upward for
|
|
96
|
+
`.brass-agent.json`, `brass-agent.config.json`, `package.json`, workspace
|
|
97
|
+
markers, or `.git`. Use `--no-discover-workspace` when you intentionally want
|
|
98
|
+
`--cwd` to be exact.
|
|
99
|
+
|
|
100
|
+
To remove only the global CLI link/install:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
npm run agent:unlink
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
To remove the VS Code global-command setup and the global CLI link/install together:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
npm run agent:vscode:uninstall:global
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
If you do not want to link it globally, use one of these instead:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
npm run agent:dev -- --doctor
|
|
116
|
+
node /absolute/path/to/brass-runtime/dist/agent/cli/main.cjs --doctor
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Initialize a workspace
|
|
120
|
+
|
|
121
|
+
In the project where you want to use the agent:
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
cd /path/to/my-project
|
|
125
|
+
brass-agent --init
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
This creates:
|
|
129
|
+
|
|
130
|
+
```txt
|
|
131
|
+
.brass-agent.json
|
|
132
|
+
brass-agent.batch.json
|
|
133
|
+
.env.example
|
|
134
|
+
BRASS_AGENT.md
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Existing files are skipped. To preview without writing:
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
brass-agent --init --init-dry-run
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
To overwrite generated files intentionally:
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
brass-agent --init --force
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Provider-specific init
|
|
150
|
+
|
|
151
|
+
For Gemini / Google:
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
brass-agent --init --init-profile google
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
For OpenAI-compatible APIs:
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
brass-agent --init --init-profile openai-compatible
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
For offline smoke tests:
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
brass-agent --init --init-profile fake
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## Configure an LLM provider
|
|
170
|
+
|
|
171
|
+
Secrets should live in environment variables, not in `.brass-agent.json`.
|
|
172
|
+
The config file should reference the variable name through `apiKeyEnv`.
|
|
173
|
+
|
|
174
|
+
### Google / Gemini
|
|
175
|
+
|
|
176
|
+
`.brass-agent.json`:
|
|
177
|
+
|
|
178
|
+
```json
|
|
179
|
+
{
|
|
180
|
+
"llm": {
|
|
181
|
+
"provider": "google",
|
|
182
|
+
"model": "gemini-2.5-flash",
|
|
183
|
+
"apiKeyEnv": "GEMINI_API_KEY"
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
Shell:
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
export GEMINI_API_KEY="..."
|
|
192
|
+
brass-agent --doctor
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
Or `.env` / `.brass-agent.env` in the workspace:
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
BRASS_LLM_PROVIDER=google
|
|
199
|
+
GEMINI_API_KEY="..."
|
|
200
|
+
BRASS_GOOGLE_MODEL=gemini-2.5-flash
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
`brass-agent --doctor` auto-loads supported agent keys from those files.
|
|
204
|
+
|
|
205
|
+
### OpenAI-compatible
|
|
206
|
+
|
|
207
|
+
`.brass-agent.json`:
|
|
208
|
+
|
|
209
|
+
```json
|
|
210
|
+
{
|
|
211
|
+
"llm": {
|
|
212
|
+
"provider": "openai-compatible",
|
|
213
|
+
"endpoint": "https://api.openai.com/v1/chat/completions",
|
|
214
|
+
"model": "gpt-4.1",
|
|
215
|
+
"apiKeyEnv": "BRASS_LLM_API_KEY"
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
Shell:
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
export BRASS_LLM_API_KEY="..."
|
|
224
|
+
brass-agent --doctor
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
Or `.env` / `.brass-agent.env` in the workspace:
|
|
228
|
+
|
|
229
|
+
```bash
|
|
230
|
+
BRASS_LLM_PROVIDER=openai-compatible
|
|
231
|
+
BRASS_LLM_ENDPOINT=https://api.openai.com/v1/chat/completions
|
|
232
|
+
BRASS_LLM_API_KEY="..."
|
|
233
|
+
BRASS_LLM_MODEL=gpt-4.1
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
### Fake / offline
|
|
237
|
+
|
|
238
|
+
`.brass-agent.json`:
|
|
239
|
+
|
|
240
|
+
```json
|
|
241
|
+
{
|
|
242
|
+
"llm": {
|
|
243
|
+
"provider": "fake",
|
|
244
|
+
"fakeResponse": "Fake plan from local config."
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
or per command:
|
|
250
|
+
|
|
251
|
+
```bash
|
|
252
|
+
BRASS_LLM_PROVIDER=fake brass-agent --preset inspect
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
## Recommended `.brass-agent.json`
|
|
256
|
+
|
|
257
|
+
A conservative starting point:
|
|
258
|
+
|
|
259
|
+
```json
|
|
260
|
+
{
|
|
261
|
+
"mode": "propose",
|
|
262
|
+
"approval": "auto",
|
|
263
|
+
"llm": {
|
|
264
|
+
"provider": "google",
|
|
265
|
+
"model": "gemini-2.5-flash",
|
|
266
|
+
"apiKeyEnv": "GEMINI_API_KEY"
|
|
267
|
+
},
|
|
268
|
+
"project": {
|
|
269
|
+
"packageManager": "auto",
|
|
270
|
+
"includeTypecheck": true,
|
|
271
|
+
"includeLint": true,
|
|
272
|
+
"maxValidationCommands": 2
|
|
273
|
+
},
|
|
274
|
+
"context": {
|
|
275
|
+
"enabled": true,
|
|
276
|
+
"maxSearchQueries": 3,
|
|
277
|
+
"maxFiles": 4,
|
|
278
|
+
"maxSearchResults": 40,
|
|
279
|
+
"excludeGlobs": [
|
|
280
|
+
".env*",
|
|
281
|
+
"secrets/**",
|
|
282
|
+
"*.pem",
|
|
283
|
+
"*.key",
|
|
284
|
+
"node_modules/**",
|
|
285
|
+
"dist/**",
|
|
286
|
+
"build/**"
|
|
287
|
+
]
|
|
288
|
+
},
|
|
289
|
+
"redaction": {
|
|
290
|
+
"enabled": true
|
|
291
|
+
},
|
|
292
|
+
"patchQuality": {
|
|
293
|
+
"enabled": true,
|
|
294
|
+
"maxRepairAttempts": 1
|
|
295
|
+
},
|
|
296
|
+
"rollback": {
|
|
297
|
+
"enabled": true,
|
|
298
|
+
"onFinalValidationFailure": true,
|
|
299
|
+
"strategy": "all",
|
|
300
|
+
"runValidationAfterRollback": true,
|
|
301
|
+
"allowForSuppliedPatches": false
|
|
302
|
+
},
|
|
303
|
+
"permissions": {
|
|
304
|
+
"patchApply": {
|
|
305
|
+
"decision": "ask",
|
|
306
|
+
"reason": "Apply generated code changes to this workspace.",
|
|
307
|
+
"risk": "high",
|
|
308
|
+
"defaultAnswer": "reject"
|
|
309
|
+
},
|
|
310
|
+
"shell": {
|
|
311
|
+
"inheritDefaults": true,
|
|
312
|
+
"deny": [
|
|
313
|
+
"rm *",
|
|
314
|
+
"git push *",
|
|
315
|
+
"git reset *",
|
|
316
|
+
"git clean *"
|
|
317
|
+
]
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
Important defaults:
|
|
324
|
+
|
|
325
|
+
```txt
|
|
326
|
+
mode: propose
|
|
327
|
+
The agent can inspect, validate, and propose patches, but does not write by default.
|
|
328
|
+
|
|
329
|
+
approval: auto
|
|
330
|
+
Interactive terminal prompts when possible; non-interactive runs reject approval-required actions unless --yes is used.
|
|
331
|
+
|
|
332
|
+
patchApply: ask
|
|
333
|
+
Generated patches require approval before being applied.
|
|
334
|
+
|
|
335
|
+
redaction.enabled: true
|
|
336
|
+
Prompt context is redacted before LLM calls.
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
## First commands to run
|
|
340
|
+
|
|
341
|
+
After `--init` and provider setup:
|
|
342
|
+
|
|
343
|
+
```bash
|
|
344
|
+
brass-agent --doctor
|
|
345
|
+
brass-agent --preset inspect
|
|
346
|
+
brass-agent --preset typecheck
|
|
347
|
+
brass-agent --preset lint
|
|
348
|
+
brass-agent --preset fix-tests
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
Default runs are safe/propose-oriented. To allow writes:
|
|
352
|
+
|
|
353
|
+
```bash
|
|
354
|
+
brass-agent --apply "fix the failing tests"
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
In an interactive terminal, approval is requested before `patch.apply`.
|
|
358
|
+
For local smoke tests where you intentionally want to auto-approve:
|
|
359
|
+
|
|
360
|
+
```bash
|
|
361
|
+
brass-agent --apply --yes "fix the failing tests"
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
## Batch runs
|
|
365
|
+
|
|
366
|
+
`--init` creates `brass-agent.batch.json`. Run it with:
|
|
367
|
+
|
|
368
|
+
```bash
|
|
369
|
+
brass-agent --batch-file brass-agent.batch.json
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
For a configured batch in `.brass-agent.json`:
|
|
373
|
+
|
|
374
|
+
```bash
|
|
375
|
+
brass-agent
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
only uses the configured batch when no explicit goal, preset, patch file, or
|
|
379
|
+
batch file is provided.
|
|
380
|
+
|
|
381
|
+
## Save run artifacts
|
|
382
|
+
|
|
383
|
+
To keep a local JSON and Markdown record of a run:
|
|
384
|
+
|
|
385
|
+
```bash
|
|
386
|
+
brass-agent --save-run .brass-agent/runs --preset fix-tests
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
Generated artifacts are local files and may include compacted observations and
|
|
390
|
+
summaries. Review before committing them.
|
|
391
|
+
|
|
392
|
+
## Use the same CLI in many projects
|
|
393
|
+
|
|
394
|
+
For many projects, the easiest setup is:
|
|
395
|
+
|
|
396
|
+
```bash
|
|
397
|
+
cd /path/to/brass-runtime
|
|
398
|
+
npm run agent:vscode:install:global
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
To remove or reinstall that setup later:
|
|
402
|
+
|
|
403
|
+
```bash
|
|
404
|
+
npm run agent:vscode:uninstall:global
|
|
405
|
+
npm run agent:vscode:reinstall:global
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
Then any VS Code workspace can use:
|
|
409
|
+
|
|
410
|
+
```json
|
|
411
|
+
{
|
|
412
|
+
"brassAgent.command": "brass-agent"
|
|
413
|
+
}
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
See [Agent global usage and workspace discovery](./agent-global-usage.md).
|
|
417
|
+
|
|
418
|
+
## Install the VS Code extension locally
|
|
419
|
+
|
|
420
|
+
From the `brass-runtime` checkout:
|
|
421
|
+
|
|
422
|
+
```bash
|
|
423
|
+
npm run agent:vscode:install
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
This packages and installs the local extension and writes workspace settings so
|
|
427
|
+
VS Code knows which `brass-agent` command to call.
|
|
428
|
+
|
|
429
|
+
Manual packaging:
|
|
430
|
+
|
|
431
|
+
```bash
|
|
432
|
+
npm run agent:vscode:package
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
Then install the generated `.vsix` from VS Code with **Extensions: Install from
|
|
436
|
+
VSIX...**.
|
|
437
|
+
|
|
438
|
+
Useful VS Code commands:
|
|
439
|
+
|
|
440
|
+
```txt
|
|
441
|
+
Brass Agent: Initialize Workspace
|
|
442
|
+
Brass Agent: Doctor
|
|
443
|
+
Brass Agent: Inspect Workspace
|
|
444
|
+
Brass Agent: Propose Fix
|
|
445
|
+
Brass Agent: Apply Fix
|
|
446
|
+
Brass Agent: Fix Tests
|
|
447
|
+
Brass Agent: Typecheck
|
|
448
|
+
Brass Agent: Lint
|
|
449
|
+
Brass Agent: Run Batch File
|
|
450
|
+
Brass Agent: Run Configured Batch
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
If VS Code cannot find the CLI, set:
|
|
454
|
+
|
|
455
|
+
```json
|
|
456
|
+
{
|
|
457
|
+
"brassAgent.command": "/absolute/path/to/brass-runtime/dist/agent/cli/main.cjs"
|
|
458
|
+
}
|
|
459
|
+
```
|
|
460
|
+
|
|
461
|
+
or use the global linked command:
|
|
462
|
+
|
|
463
|
+
```json
|
|
464
|
+
{
|
|
465
|
+
"brassAgent.command": "brass-agent"
|
|
466
|
+
}
|
|
467
|
+
```
|
|
468
|
+
|
|
469
|
+
## Common troubleshooting
|
|
470
|
+
|
|
471
|
+
Run:
|
|
472
|
+
|
|
473
|
+
```bash
|
|
474
|
+
brass-agent --doctor
|
|
475
|
+
```
|
|
476
|
+
|
|
477
|
+
Common fixes:
|
|
478
|
+
|
|
479
|
+
| Symptom | Fix |
|
|
480
|
+
|---|---|
|
|
481
|
+
| `brass-agent: command not found` | Run `npm run build && npm link`, or use `node dist/agent/cli/main.cjs`. |
|
|
482
|
+
| VS Code cannot run the agent | Set `brassAgent.command` to the absolute CLI path. |
|
|
483
|
+
| Context discovery does not find files | Install `ripgrep` and confirm `rg --version` works. |
|
|
484
|
+
| LLM calls use fake provider unexpectedly | Check `brass-agent --doctor` and verify provider env vars. |
|
|
485
|
+
| Writes are rejected in scripts/CI | Use interactive approval locally, or pass `--yes` intentionally. |
|
|
486
|
+
| Patch apply fails | Check `git apply --check` output in the run details; the agent does not force patches. |
|
|
487
|
+
| Secrets appear in repo files | Add globs to `context.excludeGlobs` and keep `redaction.enabled: true`. |
|
|
488
|
+
|
|
489
|
+
## Safety checklist before dogfooding
|
|
490
|
+
|
|
491
|
+
Before using `--apply` on a real project:
|
|
492
|
+
|
|
493
|
+
```txt
|
|
494
|
+
- commit or stash your current work
|
|
495
|
+
- run brass-agent --doctor
|
|
496
|
+
- review .brass-agent.json permissions
|
|
497
|
+
- keep mode=propose as the default
|
|
498
|
+
- use VS Code patch preview or CLI approval before applying changes
|
|
499
|
+
- avoid --yes except for local smoke tests or intentional automation
|
|
500
|
+
```
|
|
501
|
+
|
|
502
|
+
## Related docs
|
|
503
|
+
|
|
504
|
+
- [Brass Agent CLI](./agent-cli.md)
|
|
505
|
+
- [Agent init](./agent-init.md)
|
|
506
|
+
- [Agent config and policy files](./agent-config.md)
|
|
507
|
+
- [Agent local install and doctor](./agent-local-install.md)
|
|
508
|
+
- [VS Code local install](./agent-vscode-install.md)
|
|
509
|
+
- [Agent LLM adapters](./agent-llm-adapters.md)
|
|
510
|
+
- [Agent approvals](./agent-approvals.md)
|
|
511
|
+
- [Agent automatic rollback safety](./agent-rollback-safety.md)
|
|
512
|
+
|
|
513
|
+
|
|
514
|
+
## VS Code auto-discovery
|
|
515
|
+
|
|
516
|
+
The VS Code extension can now use `brassAgent.command = "auto"` and prefer its bundled CLI, so you can open any repo and use Brass Agent without linking the CLI globally. See [VS Code auto-discovery](./agent-vscode-auto-discovery.md).
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# Agent language and workspace setup UX
|
|
2
|
+
|
|
3
|
+
Brass Agent supports two setup paths:
|
|
4
|
+
|
|
5
|
+
- **Model setup**: stored by the VS Code extension in Secret Storage.
|
|
6
|
+
- **Workspace setup**: stored in the repository as `.brass-agent.json`.
|
|
7
|
+
|
|
8
|
+
The VS Code extension exposes both from the Chat view:
|
|
9
|
+
|
|
10
|
+
```txt
|
|
11
|
+
/model configure the LLM provider and API keys
|
|
12
|
+
/workspace create or update .brass-agent.json
|
|
13
|
+
/config alias for /workspace
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Response language
|
|
17
|
+
|
|
18
|
+
By default, Brass Agent tries to answer in the same language as the user's latest goal. For example, Spanish prompts should get Spanish explanations.
|
|
19
|
+
|
|
20
|
+
The behavior can be forced per workspace:
|
|
21
|
+
|
|
22
|
+
```json
|
|
23
|
+
{
|
|
24
|
+
"language": {
|
|
25
|
+
"response": "es"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Supported values:
|
|
31
|
+
|
|
32
|
+
```txt
|
|
33
|
+
auto infer from the latest user goal
|
|
34
|
+
match-user same intent as auto, explicit in config
|
|
35
|
+
en English
|
|
36
|
+
es Spanish
|
|
37
|
+
pt Portuguese
|
|
38
|
+
fr French
|
|
39
|
+
de German
|
|
40
|
+
it Italian
|
|
41
|
+
custom custom language name, via language.custom
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
When Brass Agent is launched from VS Code, the extension can also pass a language preference through the `brassAgent.language.response` setting. Workspace config still remains the best place when a project should consistently answer in one language.
|
|
45
|
+
|
|
46
|
+
Language policy only affects natural-language responses. Code, identifiers, paths, shell commands, logs, and unified diffs are kept unchanged.
|
|
47
|
+
|
|
48
|
+
## Create `.brass-agent.json` from VS Code
|
|
49
|
+
|
|
50
|
+
Use either:
|
|
51
|
+
|
|
52
|
+
```txt
|
|
53
|
+
Brass Agent: Configure Workspace
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
or in the Chat view:
|
|
57
|
+
|
|
58
|
+
```txt
|
|
59
|
+
/workspace
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
The wizard asks for:
|
|
63
|
+
|
|
64
|
+
1. response language
|
|
65
|
+
2. validation command behavior
|
|
66
|
+
|
|
67
|
+
For validation commands, it can:
|
|
68
|
+
|
|
69
|
+
- auto-discover from `package.json`
|
|
70
|
+
- disable validation commands
|
|
71
|
+
- choose a detected script, such as `npm run repo:check`
|
|
72
|
+
- accept a custom command
|
|
73
|
+
|
|
74
|
+
When a specific validation command is selected, the extension adds it to:
|
|
75
|
+
|
|
76
|
+
```json
|
|
77
|
+
{
|
|
78
|
+
"project": {
|
|
79
|
+
"validationCommands": ["npm run repo:check"]
|
|
80
|
+
},
|
|
81
|
+
"permissions": {
|
|
82
|
+
"shell": {
|
|
83
|
+
"allow": ["npm run repo:check"]
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
That means future runs can execute the command through the normal Brass Agent permission pipeline.
|
|
90
|
+
|
|
91
|
+
## CLI usage
|
|
92
|
+
|
|
93
|
+
The CLI also accepts a temporary language override:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
brass-agent --language es "explicame este repo"
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
This does not modify config. For persistent behavior, use `.brass-agent.json`.
|