flavor-code 1.2.7 → 1.2.8

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/README.md CHANGED
@@ -1,369 +1,370 @@
1
- <p align="center"><b><a href="./README.md">English</a></b> | <a href="./README.zh-CN.md">简体中文</a></p>
2
-
3
- <div align="center">
4
- <img src="./assets/icon-transparent-512.png" alt="Flavor Code Logo" width="168" />
5
- <h1>Flavor Code</h1>
6
- <p><strong>Local-first, auditable, resumable AI coding assistant</strong></p>
7
- <p>Read code, edit files, run commands, and complete complex tasks in the terminal, Electron desktop, and VS Code.</p>
8
-
9
- <p>
10
- <a href="https://www.npmjs.com/package/flavor-code"><img alt="npm version" src="https://img.shields.io/npm/v/flavor-code?color=cb3837&logo=npm" /></a>
11
- <a href="https://github.com/YachuanWzh/flavor-code/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/YachuanWzh/flavor-code/actions/workflows/ci.yml/badge.svg?branch=main" /></a>
12
- <img alt="Node.js 20+" src="https://img.shields.io/badge/Node.js-20%2B-339933?logo=nodedotjs&logoColor=white" />
13
- <a href="./LICENSE"><img alt="MIT License" src="https://img.shields.io/badge/license-MIT-blue.svg" /></a>
14
- </p>
15
-
16
- <p>
17
- <a href="#quick-start">Quick Start</a> ·
18
- <a href="#features">Features</a> ·
19
- <a href="#entry-points">Entry Points</a> ·
20
- <a href="#permissions--sandbox">Security</a> ·
21
- <a href="#development">Development</a>
22
- </p>
23
- </div>
24
-
25
- ---
26
-
27
- Flavor Code connects to OpenAI, Anthropic, or compatible services and works with file, search, Shell, MCP, and custom tools inside a controlled workspace. Complex tasks can be broken into plans and parallel sub-tasks; sessions, diffs, tool calls, checkpoints, and audit records are all stored locally so you can resume, review, and continue at any time.
28
-
29
- ## Features
30
-
31
- | | Capability | What you get |
32
- | --- | --- | --- |
33
- | 🖥️ | **One runtime, three entry points** | CLI, Electron, and VS Code share model configuration, sessions, and tooling |
34
- | 🧭 | **Controlled progress on complex tasks** | Task plans, sub-agents, steering, follow-ups, `/loop`, and `/goal` |
35
- | ⏪ | **Traceable, resumable results** | Full timeline, checkpoints, rewind, traces, diffs, and failure audits |
36
- | 🧠 | **Local long-term context** | Memory, Skills, plugins, and project guides stored on your machine |
37
- | 🛡️ | **Clear permission boundaries** | Independent control over read, write, Shell, network, and destructive actions; Docker supported |
38
-
39
- ## Quick Start
40
-
41
- > [!IMPORTANT]
42
- > The CLI requires Node.js 20 or later. Windows desktop builds can also be downloaded directly from [Releases](https://github.com/YachuanWzh/flavor-code/releases).
43
-
44
- **1. Install**
45
-
46
- ```bash
47
- npm install -g flavor-code
48
- ```
49
-
50
- **2. Start in your project**
51
-
52
- ```bash
53
- cd your-project
54
- flavor
55
- ```
56
-
57
- **3. Initialize project context**
58
-
59
- Run `/init` the first time you enter a project. Flavor analyzes the language, package manager, source directories, and verification commands, then generates a `FLAVOR.md` project guide.
60
-
61
- You can also run one-off tasks directly:
62
-
63
- ```bash
64
- flavor --print "Analyze this project and list the top three issues worth fixing"
65
- flavor --resume
66
- flavor --resume -p "Continue the remaining work"
67
- ```
68
-
69
- Non-interactive mode refuses actions that require human approval and never hangs waiting for input.
70
-
71
- ## Configuring Models
72
-
73
- The fastest way is to set environment variables:
74
-
75
- ```bash
76
- # macOS / Linux
77
- export OPENAI_API_KEY="sk-..."
78
-
79
- # Windows PowerShell
80
- $env:OPENAI_API_KEY = "sk-..."
81
- ```
82
-
83
- You can also put the key in a `.env` file at the project root.
84
-
85
- <details>
86
- <summary><strong>Configure multiple providers with <code>.flavor/flavor.json</code></strong></summary>
87
-
88
- Example project configuration:
89
-
90
- ```json
91
- {
92
- "providers": {
93
- "openai": {
94
- "type": "openai",
95
- "apiKey": "${OPENAI_API_KEY}",
96
- "defaultModel": "gpt-5",
97
- "cheapModel": "gpt-5-mini"
98
- }
99
- },
100
- "agents": {
101
- "main": { "model": "openai:gpt-5" },
102
- "subagent": { "model": "openai:gpt-5-mini" }
103
- },
104
- "permissionMode": "default",
105
- "maxSubagents": 3,
106
- "language": "zh-CN"
107
- }
108
- ```
109
-
110
- Configuration is merged in the following order, with later sources taking precedence:
111
-
112
- 1. Global `~/.flavor-code/flavor.json`
113
- 2. Project `.flavor/flavor.json`
114
- 3. `.env`
115
- 4. Process environment variables
116
-
117
- Commonly supported provider types:
118
-
119
- - `openai`: OpenAI's official API
120
- - `anthropic`: Anthropic's official API
121
- - `openai-compatible`: Services compatible with the OpenAI protocol
122
-
123
- </details>
124
-
125
- Runtime behavior and configuration conventions for OAuth PKCE are described in the [PKCE spec](./docs/specs/pkce-runtime-config.md). The [config schema](./src/config/schema.ts) is the source of truth for all fields.
126
-
127
- ## Entry Points
128
-
129
- | Entry point | Best for | How to start |
130
- | --- | --- | --- |
131
- | **CLI** | Daily development, remote environments, scripting, and CI | `flavor` |
132
- | **Electron** | Visual sessions, diffs, permissions, and resource management | `npm run desktop:start` |
133
- | **VS Code / Qoder** | Editor context, diagnostic fixes, and a task control plane | `npm run ide:install` |
134
-
135
- ### CLI
136
-
137
- Run `flavor` and type natural language. Typing `/` shows built-in commands, plugin commands, and Skills.
138
-
139
- Common commands:
140
-
141
- | Command | Purpose |
142
- | --- | --- |
143
- | `/init` | Generate or update `FLAVOR.md` |
144
- | `/model` | View or switch main/sub-agent models |
145
- | `/permissions` | Switch permission modes |
146
- | `/tasks` | View task plans and sub-agent status |
147
- | `/compact` | Manually compact long session context |
148
- | `/checkpoint`, `/tree` | Save state, view the session tree |
149
- | `/rewind`, `/unrevert`, `/fork` | Resume or fork sessions |
150
- | `/memory`, `/remember`, `/forget`, `/forget-cold` | Manage long-term memory; `/forget-cold` purges cold entries and their files |
151
- | `/mcp` | View and manage MCP servers |
152
- | `/loop <goal>` | Run an autonomous loop with verification |
153
- | `/goal <objective>` | Run the plan, execute, adversarial-review workflow |
154
- | `/audit` | View tool failure audits |
155
-
156
- You can submit steering or queue follow-ups while a run is in progress; once the current model response finishes, the task picks up new instructions at safe boundaries.
157
-
158
- ### Electron Desktop
159
-
160
- ```bash
161
- npm run desktop:dev # dev mode
162
- npm run desktop:start # build and start
163
- npm run desktop:pack # Windows portable directory
164
- npm run desktop:dist # Windows NSIS installer
165
- ```
166
-
167
- The desktop app provides project and session switching, streaming Markdown, tool and diff views, permission confirmations, task status, and management of Skills, MCP, memory, and models.
168
-
169
- ### VS Code / Qoder
170
-
171
- ```bash
172
- npm run vscode:install # install into VS Code
173
- npm run qoder:install # install into Qoder
174
- npm run ide:install # auto-select the installed IDE
175
- ```
176
-
177
- The extension includes the `@flavor` Chat Participant, Mission Control, Changes & Health, Time Machine, diagnostic fixes, CodeLens, checkpoints, and rewind. If `flavor` is not on your `PATH`, set `flavorCode.executable`.
178
-
179
- ## MCP, Skills & Plugins
180
-
181
- Flavor can connect to stdio or Streamable HTTP MCP servers. Example project configuration:
182
-
183
- <details>
184
- <summary><strong>MCP configuration and CLI examples</strong></summary>
185
-
186
- ```json
187
- {
188
- "mcpServers": {
189
- "docs": {
190
- "url": "https://example.com/mcp",
191
- "headers": {
192
- "Authorization": "Bearer ${MCP_TOKEN}"
193
- }
194
- }
195
- }
196
- }
197
- ```
198
-
199
- MCP configuration can also be managed from the CLI:
200
-
201
- ```bash
202
- flavor mcp list
203
- flavor mcp add docs --url https://example.com/mcp
204
- flavor mcp disable docs
205
- ```
206
-
207
- </details>
208
-
209
- A Skill is a `SKILL.md` with YAML frontmatter, placed in `.flavor/skills/<name>/` or `~/.flavor-code/skills/<name>/`. Flavor loads skills progressively based on the task, and you can invoke one explicitly with `/<skill-name>`.
210
-
211
- Plugins live in `.flavor/plugins/` and can register commands, tools, hooks, Skill roots, and model adapters.
212
-
213
- > [!WARNING]
214
- > Plugins and agent self-registered tools are in-process JavaScript, not a security sandbox. Only install, enable, and approve code you trust.
215
-
216
- ## Sessions, Memory & Execution Records
217
-
218
- Project runtime data lives under `.flavor/`:
219
-
220
- ```text
221
- .flavor/
222
- ├── flavor.json # Project config
223
- ├── sessions/ # Session timelines
224
- ├── session-assets/ # Image attachments
225
- ├── session-trees/ # Session branches
226
- ├── checkpoints/ # Workspace snapshots
227
- ├── memory/ # Long-term memory
228
- ├── traces/ # Optional execution traces
229
- ├── audit.jsonl # Tool failure audits
230
- ├── skills/ # Project skills
231
- └── plugins/ # Project plugins
232
- ```
233
-
234
- Long-term memory distinguishes user preferences, behavioral feedback, project conventions, and external references. Automatic extraction only keeps high-confidence candidates and provides confirm, ignore, and delete actions; secrets, tokens, raw tool output, and model guesses are rejected.
235
-
236
- Image prompts support PNG, JPEG, and WebP, with a 5 MiB per-image maximum and up to 5 images per prompt. The desktop app supports picking or drag-and-drop; CLI clipboard images currently work on Windows and macOS.
237
-
238
- ## Permissions & Sandbox
239
-
240
- | Mode | Behavior |
241
- | --- | --- |
242
- | `default` | Reads are auto-approved; writes, Shell, network, and destructive actions are confirmed on demand |
243
- | `acceptEdits` | Workspace writes and routine verification are auto-approved |
244
- | `plan` | Read-only planning; no modifications or execution |
245
- | `bypassPermissions` | The main agent executes as much as possible after hard safety checks |
246
- | `auto` | A classifier decides, falling back to human approval when uncertain |
247
- | `bubble` | Uncertain operations bubble up to the main session for approval |
248
-
249
- > [!CAUTION]
250
- > Local Shell still runs as your current user. Consider enabling Docker when working with untrusted projects.
251
-
252
- <details>
253
- <summary><strong>Docker execution environment example</strong></summary>
254
-
255
- ```json
256
- {
257
- "execution": {
258
- "mode": "docker",
259
- "image": "node:24-bookworm-slim",
260
- "network": false,
261
- "memory": "2g",
262
- "cpus": 2
263
- }
264
- }
265
- ```
266
-
267
- If Docker is unavailable, tasks fail rather than silently falling back to the host. Sensitive fields in config files and OAuth tokens are encrypted at rest with AES-256-GCM using a local configuration key.
268
-
269
- </details>
270
-
271
- ## SDK, RPC & Evaluation
272
-
273
- <details>
274
- <summary><strong>Node.js SDK example</strong></summary>
275
-
276
- ```ts
277
- import { createFlavorRuntime } from "flavor-code/sdk";
278
-
279
- const runtime = await createFlavorRuntime({
280
- workspace: process.cwd(),
281
- approvalPolicy: "deny",
282
- output: console.log,
283
- });
284
-
285
- await runtime.session.start();
286
- await runtime.session.submit("fix the failing tests");
287
- await runtime.dispose();
288
- ```
289
-
290
- </details>
291
-
292
- Other IDEs or languages can integrate over JSONL RPC:
293
-
294
- ```bash
295
- flavor --mode rpc --workspace . --trace .flavor/traces/run.jsonl
296
- ```
297
-
298
- Run evaluations:
299
-
300
- ```bash
301
- flavor eval eval.json --output report.json
302
- ```
303
-
304
- Design constraints for RPC, traces, replay, eval, session trees, and Docker are in the [control-plane spec](./docs/specs/2026-07-29-control-plane-sandbox-vscode.md).
305
-
306
- ## Development
307
-
308
- ```bash
309
- npm ci
310
- npm test
311
- npm run typecheck
312
- npm run vscode:typecheck
313
- npm run build
314
- npm run smoke:install
315
- ```
316
-
317
- - TypeScript strict, targeting ES2022, Node.js 20+
318
- - Vitest for unit and integration tests
319
- - tsup builds the CLI, SDK, Electron main process, and VS Code extension
320
- - Vite builds the Electron renderer
321
- - CI covers Windows/macOS with Node 20/24
322
-
323
- Release builds do not generate or package source maps by default. For a local debugging build, enable them explicitly:
324
-
325
- ```bash
326
- # macOS / Linux
327
- FLAVOR_SOURCEMAP=1 npm run build
328
-
329
- # Windows PowerShell
330
- $env:FLAVOR_SOURCEMAP = "1"
331
- npm run build
332
- ```
333
-
334
- ## Documentation
335
-
336
- - [Technical Design Report](./技术方案报告.md): overall architecture, agent loop, context, permissions, plugins, and security model
337
- - [Runtime reliability spec](./docs/specs/2026-07-26-runtime-reliability.md)
338
- - [Control plane, sandbox & VS Code spec](./docs/specs/2026-07-29-control-plane-sandbox-vscode.md)
339
- - [Multimodal image attachments spec](./docs/specs/2026-07-30-multimodal-image-attachments.md)
340
- - [VS Code next steps](./docs/specs/2026-08-01-flavor-code-vscode-next.md)
341
-
342
- ## Security Notes
343
-
344
- - Review model-generated code and commands, especially dependency installs, scripts, and deletions.
345
- - Do not treat `.flavor/sessions/`, traces, or long-term memory as secret stores.
346
- - Use least-privilege API keys and never commit `.env`.
347
- - Skill content can influence model behavior; plugins and self-registered tools also have in-process Node.js permissions.
348
- - Work under version control and create checkpoints before high-risk tasks.
349
-
350
- ## Contributing
351
-
352
- Issues and Pull Requests are welcome. Please at least run the following before submitting:
353
-
354
- ```bash
355
- npm test
356
- npm run typecheck
357
- npm run vscode:typecheck
358
- npm run build
359
- ```
360
-
361
- For architecture changes, read the [Technical Design Report](./技术方案报告.md) and the relevant [design specs](./docs/specs/) first.
362
-
363
- ## License
364
-
365
- [MIT](./LICENSE)
366
-
367
- <p align="center">
368
- Made with 🌶️ by Flavor Code contributors.
369
- </p>
1
+ <p align="center"><b><a href="./README.md">English</a></b> | <a href="./README.zh-CN.md">简体中文</a></p>
2
+
3
+ <div align="center">
4
+ <img src="./assets/icon-transparent-512.png" alt="Flavor Code Logo" width="168" />
5
+ <h1>Flavor Code</h1>
6
+ <p><strong>Local-first, auditable, resumable AI coding assistant</strong></p>
7
+ <p>Read code, edit files, run commands, and complete complex tasks in the terminal, Electron desktop, and VS Code.</p>
8
+
9
+ <p>
10
+ <a href="https://www.npmjs.com/package/flavor-code"><img alt="npm version" src="https://img.shields.io/npm/v/flavor-code?color=cb3837&logo=npm" /></a>
11
+ <a href="https://github.com/YachuanWzh/flavor-code/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/YachuanWzh/flavor-code/actions/workflows/ci.yml/badge.svg?branch=main" /></a>
12
+ <img alt="Node.js 20+" src="https://img.shields.io/badge/Node.js-20%2B-339933?logo=nodedotjs&logoColor=white" />
13
+ <a href="./LICENSE"><img alt="MIT License" src="https://img.shields.io/badge/license-MIT-blue.svg" /></a>
14
+ </p>
15
+
16
+ <p>
17
+ <a href="#quick-start">Quick Start</a> ·
18
+ <a href="#features">Features</a> ·
19
+ <a href="#entry-points">Entry Points</a> ·
20
+ <a href="#permissions--sandbox">Security</a> ·
21
+ <a href="#development">Development</a> ·
22
+ <a href="./CHANGELOG.md">Changelog</a>
23
+ </p>
24
+ </div>
25
+
26
+ ---
27
+
28
+ Flavor Code connects to OpenAI, Anthropic, or compatible services and works with file, search, Shell, MCP, and custom tools inside a controlled workspace. Complex tasks can be broken into plans and parallel sub-tasks; sessions, diffs, tool calls, checkpoints, and audit records are all stored locally so you can resume, review, and continue at any time.
29
+
30
+ ## Features
31
+
32
+ | | Capability | What you get |
33
+ | --- | --- | --- |
34
+ | 🖥️ | **One runtime, three entry points** | CLI, Electron, and VS Code share model configuration, sessions, and tooling |
35
+ | 🧭 | **Controlled progress on complex tasks** | Task plans, sub-agents, steering, follow-ups, `/loop`, and `/goal` |
36
+ | ⏪ | **Traceable, resumable results** | Full timeline, checkpoints, rewind, traces, diffs, and failure audits |
37
+ | 🧠 | **Local long-term context** | Memory, Skills, plugins, and project guides stored on your machine |
38
+ | 🛡️ | **Clear permission boundaries** | Independent control over read, write, Shell, network, and destructive actions; Docker supported |
39
+
40
+ ## Quick Start
41
+
42
+ > [!IMPORTANT]
43
+ > The CLI requires Node.js 20 or later. Windows desktop builds can also be downloaded directly from [Releases](https://github.com/YachuanWzh/flavor-code/releases).
44
+
45
+ **1. Install**
46
+
47
+ ```bash
48
+ npm install -g flavor-code
49
+ ```
50
+
51
+ **2. Start in your project**
52
+
53
+ ```bash
54
+ cd your-project
55
+ flavor
56
+ ```
57
+
58
+ **3. Initialize project context**
59
+
60
+ Run `/init` the first time you enter a project. Flavor analyzes the language, package manager, source directories, and verification commands, then generates a `FLAVOR.md` project guide.
61
+
62
+ You can also run one-off tasks directly:
63
+
64
+ ```bash
65
+ flavor --print "Analyze this project and list the top three issues worth fixing"
66
+ flavor --resume
67
+ flavor --resume -p "Continue the remaining work"
68
+ ```
69
+
70
+ Non-interactive mode refuses actions that require human approval and never hangs waiting for input.
71
+
72
+ ## Configuring Models
73
+
74
+ The fastest way is to set environment variables:
75
+
76
+ ```bash
77
+ # macOS / Linux
78
+ export OPENAI_API_KEY="sk-..."
79
+
80
+ # Windows PowerShell
81
+ $env:OPENAI_API_KEY = "sk-..."
82
+ ```
83
+
84
+ You can also put the key in a `.env` file at the project root.
85
+
86
+ <details>
87
+ <summary><strong>Configure multiple providers with <code>.flavor/flavor.json</code></strong></summary>
88
+
89
+ Example project configuration:
90
+
91
+ ```json
92
+ {
93
+ "providers": {
94
+ "openai": {
95
+ "type": "openai",
96
+ "apiKey": "${OPENAI_API_KEY}",
97
+ "defaultModel": "gpt-5",
98
+ "cheapModel": "gpt-5-mini"
99
+ }
100
+ },
101
+ "agents": {
102
+ "main": { "model": "openai:gpt-5" },
103
+ "subagent": { "model": "openai:gpt-5-mini" }
104
+ },
105
+ "permissionMode": "default",
106
+ "maxSubagents": 3,
107
+ "language": "zh-CN"
108
+ }
109
+ ```
110
+
111
+ Configuration is merged in the following order, with later sources taking precedence:
112
+
113
+ 1. Global `~/.flavor-code/flavor.json`
114
+ 2. Project `.flavor/flavor.json`
115
+ 3. `.env`
116
+ 4. Process environment variables
117
+
118
+ Commonly supported provider types:
119
+
120
+ - `openai`: OpenAI's official API
121
+ - `anthropic`: Anthropic's official API
122
+ - `openai-compatible`: Services compatible with the OpenAI protocol
123
+
124
+ </details>
125
+
126
+ Runtime behavior and configuration conventions for OAuth PKCE are described in the [PKCE spec](./docs/specs/pkce-runtime-config.md). The [config schema](./src/config/schema.ts) is the source of truth for all fields.
127
+
128
+ ## Entry Points
129
+
130
+ | Entry point | Best for | How to start |
131
+ | --- | --- | --- |
132
+ | **CLI** | Daily development, remote environments, scripting, and CI | `flavor` |
133
+ | **Electron** | Visual sessions, diffs, permissions, and resource management | `npm run desktop:start` |
134
+ | **VS Code / Qoder** | Editor context, diagnostic fixes, and a task control plane | `npm run ide:install` |
135
+
136
+ ### CLI
137
+
138
+ Run `flavor` and type natural language. Typing `/` shows built-in commands, plugin commands, and Skills.
139
+
140
+ Common commands:
141
+
142
+ | Command | Purpose |
143
+ | --- | --- |
144
+ | `/init` | Generate or update `FLAVOR.md` |
145
+ | `/model` | View or switch main/sub-agent models |
146
+ | `/permissions` | Switch permission modes |
147
+ | `/tasks` | View task plans and sub-agent status |
148
+ | `/compact` | Manually compact long session context |
149
+ | `/checkpoint`, `/tree` | Save state, view the session tree |
150
+ | `/rewind`, `/unrevert`, `/fork` | Resume or fork sessions |
151
+ | `/memory`, `/remember`, `/forget`, `/forget-cold` | Manage long-term memory; `/forget-cold` purges cold entries and their files |
152
+ | `/mcp` | View and manage MCP servers |
153
+ | `/loop <goal>` | Run an autonomous loop with verification |
154
+ | `/goal <objective>` | Run the plan, execute, adversarial-review workflow |
155
+ | `/audit` | View tool failure audits |
156
+
157
+ You can submit steering or queue follow-ups while a run is in progress; once the current model response finishes, the task picks up new instructions at safe boundaries.
158
+
159
+ ### Electron Desktop
160
+
161
+ ```bash
162
+ npm run desktop:dev # dev mode
163
+ npm run desktop:start # build and start
164
+ npm run desktop:pack # Windows portable directory
165
+ npm run desktop:dist # Windows NSIS installer
166
+ ```
167
+
168
+ The desktop app provides project and session switching, streaming Markdown, tool and diff views, permission confirmations, task status, and management of Skills, MCP, memory, and models.
169
+
170
+ ### VS Code / Qoder
171
+
172
+ ```bash
173
+ npm run vscode:install # install into VS Code
174
+ npm run qoder:install # install into Qoder
175
+ npm run ide:install # auto-select the installed IDE
176
+ ```
177
+
178
+ The extension includes the `@flavor` Chat Participant, Mission Control, Changes & Health, Time Machine, diagnostic fixes, CodeLens, checkpoints, and rewind. If `flavor` is not on your `PATH`, set `flavorCode.executable`.
179
+
180
+ ## MCP, Skills & Plugins
181
+
182
+ Flavor can connect to stdio or Streamable HTTP MCP servers. Example project configuration:
183
+
184
+ <details>
185
+ <summary><strong>MCP configuration and CLI examples</strong></summary>
186
+
187
+ ```json
188
+ {
189
+ "mcpServers": {
190
+ "docs": {
191
+ "url": "https://example.com/mcp",
192
+ "headers": {
193
+ "Authorization": "Bearer ${MCP_TOKEN}"
194
+ }
195
+ }
196
+ }
197
+ }
198
+ ```
199
+
200
+ MCP configuration can also be managed from the CLI:
201
+
202
+ ```bash
203
+ flavor mcp list
204
+ flavor mcp add docs --url https://example.com/mcp
205
+ flavor mcp disable docs
206
+ ```
207
+
208
+ </details>
209
+
210
+ A Skill is a `SKILL.md` with YAML frontmatter, placed in `.flavor/skills/<name>/` or `~/.flavor-code/skills/<name>/`. Flavor loads skills progressively based on the task, and you can invoke one explicitly with `/<skill-name>`.
211
+
212
+ Plugins live in `.flavor/plugins/` and can register commands, tools, hooks, Skill roots, and model adapters.
213
+
214
+ > [!WARNING]
215
+ > Plugins and agent self-registered tools are in-process JavaScript, not a security sandbox. Only install, enable, and approve code you trust.
216
+
217
+ ## Sessions, Memory & Execution Records
218
+
219
+ Project runtime data lives under `.flavor/`:
220
+
221
+ ```text
222
+ .flavor/
223
+ ├── flavor.json # Project config
224
+ ├── sessions/ # Session timelines
225
+ ├── session-assets/ # Image attachments
226
+ ├── session-trees/ # Session branches
227
+ ├── checkpoints/ # Workspace snapshots
228
+ ├── memory/ # Long-term memory
229
+ ├── traces/ # Optional execution traces
230
+ ├── audit.jsonl # Tool failure audits
231
+ ├── skills/ # Project skills
232
+ └── plugins/ # Project plugins
233
+ ```
234
+
235
+ Long-term memory distinguishes user preferences, behavioral feedback, project conventions, and external references. Automatic extraction only keeps high-confidence candidates and provides confirm, ignore, and delete actions; secrets, tokens, raw tool output, and model guesses are rejected.
236
+
237
+ Image prompts support PNG, JPEG, and WebP, with a 5 MiB per-image maximum and up to 5 images per prompt. The desktop app supports picking or drag-and-drop; CLI clipboard images currently work on Windows and macOS.
238
+
239
+ ## Permissions & Sandbox
240
+
241
+ | Mode | Behavior |
242
+ | --- | --- |
243
+ | `default` | Reads are auto-approved; writes, Shell, network, and destructive actions are confirmed on demand |
244
+ | `acceptEdits` | Workspace writes and routine verification are auto-approved |
245
+ | `plan` | Read-only planning; no modifications or execution |
246
+ | `bypassPermissions` | The main agent executes as much as possible after hard safety checks |
247
+ | `auto` | A classifier decides, falling back to human approval when uncertain |
248
+ | `bubble` | Uncertain operations bubble up to the main session for approval |
249
+
250
+ > [!CAUTION]
251
+ > Local Shell still runs as your current user. Consider enabling Docker when working with untrusted projects.
252
+
253
+ <details>
254
+ <summary><strong>Docker execution environment example</strong></summary>
255
+
256
+ ```json
257
+ {
258
+ "execution": {
259
+ "mode": "docker",
260
+ "image": "node:24-bookworm-slim",
261
+ "network": false,
262
+ "memory": "2g",
263
+ "cpus": 2
264
+ }
265
+ }
266
+ ```
267
+
268
+ If Docker is unavailable, tasks fail rather than silently falling back to the host. Sensitive fields in config files and OAuth tokens are encrypted at rest with AES-256-GCM using a local configuration key.
269
+
270
+ </details>
271
+
272
+ ## SDK, RPC & Evaluation
273
+
274
+ <details>
275
+ <summary><strong>Node.js SDK example</strong></summary>
276
+
277
+ ```ts
278
+ import { createFlavorRuntime } from "flavor-code/sdk";
279
+
280
+ const runtime = await createFlavorRuntime({
281
+ workspace: process.cwd(),
282
+ approvalPolicy: "deny",
283
+ output: console.log,
284
+ });
285
+
286
+ await runtime.session.start();
287
+ await runtime.session.submit("fix the failing tests");
288
+ await runtime.dispose();
289
+ ```
290
+
291
+ </details>
292
+
293
+ Other IDEs or languages can integrate over JSONL RPC:
294
+
295
+ ```bash
296
+ flavor --mode rpc --workspace . --trace .flavor/traces/run.jsonl
297
+ ```
298
+
299
+ Run evaluations:
300
+
301
+ ```bash
302
+ flavor eval eval.json --output report.json
303
+ ```
304
+
305
+ Design constraints for RPC, traces, replay, eval, session trees, and Docker are in the [control-plane spec](./docs/specs/2026-07-29-control-plane-sandbox-vscode.md).
306
+
307
+ ## Development
308
+
309
+ ```bash
310
+ npm ci
311
+ npm test
312
+ npm run typecheck
313
+ npm run vscode:typecheck
314
+ npm run build
315
+ npm run smoke:install
316
+ ```
317
+
318
+ - TypeScript strict, targeting ES2022, Node.js 20+
319
+ - Vitest for unit and integration tests
320
+ - tsup builds the CLI, SDK, Electron main process, and VS Code extension
321
+ - Vite builds the Electron renderer
322
+ - CI covers Windows/macOS with Node 20/24
323
+
324
+ Release builds do not generate or package source maps by default. For a local debugging build, enable them explicitly:
325
+
326
+ ```bash
327
+ # macOS / Linux
328
+ FLAVOR_SOURCEMAP=1 npm run build
329
+
330
+ # Windows PowerShell
331
+ $env:FLAVOR_SOURCEMAP = "1"
332
+ npm run build
333
+ ```
334
+
335
+ ## Documentation
336
+
337
+ - [Technical Design Report](./技术方案报告.md): overall architecture, agent loop, context, permissions, plugins, and security model
338
+ - [Runtime reliability spec](./docs/specs/2026-07-26-runtime-reliability.md)
339
+ - [Control plane, sandbox & VS Code spec](./docs/specs/2026-07-29-control-plane-sandbox-vscode.md)
340
+ - [Multimodal image attachments spec](./docs/specs/2026-07-30-multimodal-image-attachments.md)
341
+ - [VS Code next steps](./docs/specs/2026-08-01-flavor-code-vscode-next.md)
342
+
343
+ ## Security Notes
344
+
345
+ - Review model-generated code and commands, especially dependency installs, scripts, and deletions.
346
+ - Do not treat `.flavor/sessions/`, traces, or long-term memory as secret stores.
347
+ - Use least-privilege API keys and never commit `.env`.
348
+ - Skill content can influence model behavior; plugins and self-registered tools also have in-process Node.js permissions.
349
+ - Work under version control and create checkpoints before high-risk tasks.
350
+
351
+ ## Contributing
352
+
353
+ Issues and Pull Requests are welcome. Please at least run the following before submitting:
354
+
355
+ ```bash
356
+ npm test
357
+ npm run typecheck
358
+ npm run vscode:typecheck
359
+ npm run build
360
+ ```
361
+
362
+ For architecture changes, read the [Technical Design Report](./技术方案报告.md) and the relevant [design specs](./docs/specs/) first.
363
+
364
+ ## License
365
+
366
+ [MIT](./LICENSE)
367
+
368
+ <p align="center">
369
+ Made with 🌶️ by Flavor Code contributors.
370
+ </p>