flavor-code 1.3.22 → 1.4.0-beta.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.
Files changed (134) hide show
  1. package/README.md +437 -434
  2. package/README.zh-CN.md +434 -431
  3. package/dist/{app-MWGRT3BJ.js → app-C5ZQUOKJ.js} +37 -63
  4. package/dist/astgraph/grammars.mjs +68 -68
  5. package/dist/astgraph/vendor/tree-sitter.js +3980 -3980
  6. package/dist/astgraph/vendor/zod/LICENSE +21 -21
  7. package/dist/astgraph/vendor/zod/index.js +4 -4
  8. package/dist/astgraph/vendor/zod/locales/index.js +1 -1
  9. package/dist/astgraph/vendor/zod/locales/package.json +7 -7
  10. package/dist/astgraph/vendor/zod/package.json +135 -135
  11. package/dist/astgraph/vendor/zod/v4/classic/checks.js +1 -1
  12. package/dist/astgraph/vendor/zod/v4/classic/coerce.js +17 -17
  13. package/dist/astgraph/vendor/zod/v4/classic/compat.js +31 -31
  14. package/dist/astgraph/vendor/zod/v4/classic/errors.js +48 -48
  15. package/dist/astgraph/vendor/zod/v4/classic/external.js +20 -20
  16. package/dist/astgraph/vendor/zod/v4/classic/from-json-schema.js +599 -599
  17. package/dist/astgraph/vendor/zod/v4/classic/index.js +4 -4
  18. package/dist/astgraph/vendor/zod/v4/classic/iso.js +30 -30
  19. package/dist/astgraph/vendor/zod/v4/classic/package.json +7 -7
  20. package/dist/astgraph/vendor/zod/v4/classic/parse.js +15 -15
  21. package/dist/astgraph/vendor/zod/v4/classic/schemas.js +1395 -1395
  22. package/dist/astgraph/vendor/zod/v4/core/api.js +1087 -1087
  23. package/dist/astgraph/vendor/zod/v4/core/checks.js +575 -575
  24. package/dist/astgraph/vendor/zod/v4/core/core.js +78 -78
  25. package/dist/astgraph/vendor/zod/v4/core/doc.js +35 -35
  26. package/dist/astgraph/vendor/zod/v4/core/errors.js +185 -185
  27. package/dist/astgraph/vendor/zod/v4/core/index.js +16 -16
  28. package/dist/astgraph/vendor/zod/v4/core/json-schema-generator.js +95 -95
  29. package/dist/astgraph/vendor/zod/v4/core/json-schema-processors.js +601 -601
  30. package/dist/astgraph/vendor/zod/v4/core/json-schema.js +1 -1
  31. package/dist/astgraph/vendor/zod/v4/core/package.json +7 -7
  32. package/dist/astgraph/vendor/zod/v4/core/parse.js +93 -93
  33. package/dist/astgraph/vendor/zod/v4/core/regexes.js +139 -139
  34. package/dist/astgraph/vendor/zod/v4/core/registries.js +51 -51
  35. package/dist/astgraph/vendor/zod/v4/core/schemas.js +2239 -2239
  36. package/dist/astgraph/vendor/zod/v4/core/standard-schema.js +1 -1
  37. package/dist/astgraph/vendor/zod/v4/core/to-json-schema.js +448 -448
  38. package/dist/astgraph/vendor/zod/v4/core/util.js +674 -674
  39. package/dist/astgraph/vendor/zod/v4/core/versions.js +5 -5
  40. package/dist/astgraph/vendor/zod/v4/index.js +3 -3
  41. package/dist/astgraph/vendor/zod/v4/locales/ar.js +106 -106
  42. package/dist/astgraph/vendor/zod/v4/locales/az.js +105 -105
  43. package/dist/astgraph/vendor/zod/v4/locales/be.js +156 -156
  44. package/dist/astgraph/vendor/zod/v4/locales/bg.js +120 -120
  45. package/dist/astgraph/vendor/zod/v4/locales/ca.js +107 -107
  46. package/dist/astgraph/vendor/zod/v4/locales/cs.js +111 -111
  47. package/dist/astgraph/vendor/zod/v4/locales/da.js +115 -115
  48. package/dist/astgraph/vendor/zod/v4/locales/de.js +108 -108
  49. package/dist/astgraph/vendor/zod/v4/locales/el.js +109 -109
  50. package/dist/astgraph/vendor/zod/v4/locales/en.js +113 -113
  51. package/dist/astgraph/vendor/zod/v4/locales/eo.js +109 -109
  52. package/dist/astgraph/vendor/zod/v4/locales/es.js +132 -132
  53. package/dist/astgraph/vendor/zod/v4/locales/fa.js +114 -114
  54. package/dist/astgraph/vendor/zod/v4/locales/fi.js +112 -112
  55. package/dist/astgraph/vendor/zod/v4/locales/fr-CA.js +107 -107
  56. package/dist/astgraph/vendor/zod/v4/locales/fr.js +125 -125
  57. package/dist/astgraph/vendor/zod/v4/locales/he.js +214 -214
  58. package/dist/astgraph/vendor/zod/v4/locales/hr.js +122 -122
  59. package/dist/astgraph/vendor/zod/v4/locales/hu.js +108 -108
  60. package/dist/astgraph/vendor/zod/v4/locales/hy.js +147 -147
  61. package/dist/astgraph/vendor/zod/v4/locales/id.js +106 -106
  62. package/dist/astgraph/vendor/zod/v4/locales/index.js +52 -52
  63. package/dist/astgraph/vendor/zod/v4/locales/is.js +109 -109
  64. package/dist/astgraph/vendor/zod/v4/locales/it.js +108 -108
  65. package/dist/astgraph/vendor/zod/v4/locales/ja.js +107 -107
  66. package/dist/astgraph/vendor/zod/v4/locales/ka.js +112 -112
  67. package/dist/astgraph/vendor/zod/v4/locales/kh.js +5 -5
  68. package/dist/astgraph/vendor/zod/v4/locales/km.js +110 -110
  69. package/dist/astgraph/vendor/zod/v4/locales/ko.js +111 -111
  70. package/dist/astgraph/vendor/zod/v4/locales/lt.js +203 -203
  71. package/dist/astgraph/vendor/zod/v4/locales/mk.js +109 -109
  72. package/dist/astgraph/vendor/zod/v4/locales/ms.js +107 -107
  73. package/dist/astgraph/vendor/zod/v4/locales/nl.js +110 -110
  74. package/dist/astgraph/vendor/zod/v4/locales/no.js +108 -108
  75. package/dist/astgraph/vendor/zod/v4/locales/ota.js +109 -109
  76. package/dist/astgraph/vendor/zod/v4/locales/package.json +7 -7
  77. package/dist/astgraph/vendor/zod/v4/locales/pl.js +109 -109
  78. package/dist/astgraph/vendor/zod/v4/locales/ps.js +114 -114
  79. package/dist/astgraph/vendor/zod/v4/locales/pt.js +108 -108
  80. package/dist/astgraph/vendor/zod/v4/locales/ro.js +119 -119
  81. package/dist/astgraph/vendor/zod/v4/locales/ru.js +156 -156
  82. package/dist/astgraph/vendor/zod/v4/locales/sl.js +109 -109
  83. package/dist/astgraph/vendor/zod/v4/locales/sv.js +110 -110
  84. package/dist/astgraph/vendor/zod/v4/locales/ta.js +110 -110
  85. package/dist/astgraph/vendor/zod/v4/locales/th.js +110 -110
  86. package/dist/astgraph/vendor/zod/v4/locales/tr.js +105 -105
  87. package/dist/astgraph/vendor/zod/v4/locales/ua.js +5 -5
  88. package/dist/astgraph/vendor/zod/v4/locales/uk.js +108 -108
  89. package/dist/astgraph/vendor/zod/v4/locales/ur.js +110 -110
  90. package/dist/astgraph/vendor/zod/v4/locales/uz.js +110 -110
  91. package/dist/astgraph/vendor/zod/v4/locales/vi.js +108 -108
  92. package/dist/astgraph/vendor/zod/v4/locales/yo.js +107 -107
  93. package/dist/astgraph/vendor/zod/v4/locales/zh-CN.js +109 -109
  94. package/dist/astgraph/vendor/zod/v4/locales/zh-TW.js +107 -107
  95. package/dist/astgraph/vendor/zod/v4/mini/checks.js +1 -1
  96. package/dist/astgraph/vendor/zod/v4/mini/coerce.js +22 -22
  97. package/dist/astgraph/vendor/zod/v4/mini/external.js +14 -14
  98. package/dist/astgraph/vendor/zod/v4/mini/index.js +3 -3
  99. package/dist/astgraph/vendor/zod/v4/mini/iso.js +34 -34
  100. package/dist/astgraph/vendor/zod/v4/mini/package.json +7 -7
  101. package/dist/astgraph/vendor/zod/v4/mini/parse.js +1 -1
  102. package/dist/astgraph/vendor/zod/v4/mini/schemas.js +961 -961
  103. package/dist/astgraph/vendor/zod/v4/package.json +7 -7
  104. package/dist/{chunk-7OICVL2M.js → chunk-2BF7CVWZ.js} +0 -42
  105. package/dist/{chunk-RQTYHUMK.js → chunk-3WCDZ6ZL.js} +15 -0
  106. package/dist/{chunk-Z62P4LL7.js → chunk-6MNOZ2TX.js} +8962 -8422
  107. package/dist/{chunk-VEUSROUQ.js → chunk-FOTMP4ZS.js} +1 -1
  108. package/dist/{chunk-SUSLIHXO.js → chunk-ODRWR4KK.js} +1 -1
  109. package/dist/{chunk-RPFWB45Y.js → chunk-URUVFECH.js} +1 -1
  110. package/dist/{claude-ink-6CEG2XZZ.js → claude-ink-LP32NSX5.js} +2 -3
  111. package/dist/cli-main.js +27 -11
  112. package/dist/config/load.d.ts +2 -0
  113. package/dist/desktop/main.js +1092 -541
  114. package/dist/desktop-renderer/assets/index-Bk6FYhyh.css +1 -0
  115. package/dist/desktop-renderer/assets/{index-D75ozXnZ.js → index-CqRIr-hz.js} +3 -3
  116. package/dist/desktop-renderer/assets/{interactive-terminal-CTFo4fK9.js → interactive-terminal-C4o7MNPO.js} +1 -1
  117. package/dist/desktop-renderer/index.html +2 -2
  118. package/dist/doctor.d.ts +38 -0
  119. package/dist/execution/docker.d.ts +5 -1
  120. package/dist/execution/types.d.ts +11 -0
  121. package/dist/jobs/registry.d.ts +1 -0
  122. package/dist/{load-4FWNXE6F.js → load-V2UIYYQI.js} +1 -1
  123. package/dist/sdk/index.js +4 -4
  124. package/dist/tools/shell.d.ts +17 -12
  125. package/dist/tools/types.d.ts +1 -0
  126. package/dist/ui/commands.d.ts +1 -1
  127. package/dist/ui/session.d.ts +1 -0
  128. package/dist/update/check.d.ts +20 -0
  129. package/dist/utils/semver.d.ts +3 -0
  130. package/dist/utils/spawn-executable.d.ts +2 -0
  131. package/package.json +1 -1
  132. package//346/212/200/346/234/257/346/226/271/346/241/210/346/212/245/345/221/212.md +5848 -5848
  133. package/dist/chunk-OTYFL4AG.js +0 -16
  134. package/dist/desktop-renderer/assets/index-ZZsUx916.css +0 -1
package/README.md CHANGED
@@ -1,434 +1,437 @@
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`, `/goal`, and conflict-safe parallel execution (tasks owning overlapping files run serially) |
36
- | 🏝️ | **Flavor Island local control** | Host apps steer a running session over a token-authenticated local IPC channel (Windows named pipes / Unix sockets): abort, steering, follow-ups, and window focus; model duration, token usage, task summaries, and deliverables are reported via hook events |
37
- | ⏪ | **Traceable, resumable results** | Full timeline, checkpoints, rewind, traces, diffs, and failure audits |
38
- | 🧱 | **Crash-consistent execution** | Fsync-backed event journal, durable steering queue, savepoints, and no automatic replay of non-idempotent tools |
39
- | 🧠 | **Local long-term context** | Memory, Skills, plugins, and project guides stored on your machine |
40
- | 🔎 | **Code graph navigation** | A local AST code-graph index (`.flavor/astgraph/`) powers `ast_search`/`ast_callers`/`ast_impact` queries for precise symbol lookup and reachability tracing; `/explain` turns that graph plus git history into newcomer-oriented walkthroughs |
41
- | 🌿 | **Git-native workflows** | `/commit` drafts a Conventional-Commits message for staged changes and commits after confirmation; `/review` audits uncommitted changes; the read-only `GitHistory` tool explains when and why code changed |
42
- | 🎨 | **E2E requirement-to-delivery** | From a rough requirement or a design export to a delivered product: PRD, interactive prototype, visual implementation, API integration, autonomous acceptance, and scored delivery (Electron only) |
43
- | 🔁 | **Bounded self-improvement** | Repeated tool failures are captured, deduped, and proposed as suggestions; fixes ship as sandbox-verified plugins or as learned guardrail rules injected into future prompts, with run trends and rule management (`/evolve`) |
44
- | 🛡️ | **Clear permission boundaries** | Independent control over read, write, Shell, network, and destructive actions; Docker supported |
45
-
46
- ## Quick Start
47
-
48
- > [!IMPORTANT]
49
- > 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).
50
-
51
- **1. Install**
52
-
53
- ```bash
54
- npm install -g flavor-code
55
- ```
56
-
57
- **2. Start in your project**
58
-
59
- ```bash
60
- cd your-project
61
- flavor
62
- ```
63
-
64
- **3. Initialize project context**
65
-
66
- 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.
67
-
68
- You can also run one-off tasks directly:
69
-
70
- ```bash
71
- flavor --print "Analyze this project and list the top three issues worth fixing"
72
- flavor --resume
73
- flavor --resume -p "Continue the remaining work"
74
- ```
75
-
76
- Non-interactive mode refuses actions that require human approval and never hangs waiting for input.
77
-
78
- **4. Staying up to date**
79
-
80
- ```bash
81
- flavor update
82
- ```
83
-
84
- Flavor checks the npm registry at startup and shows an update hint on the welcome card. Run `flavor update` to upgrade the global install to the latest release, then restart Flavor.
85
-
86
- ## Configuring Models
87
-
88
- The fastest way is to set environment variables:
89
-
90
- ```bash
91
- # macOS / Linux
92
- export OPENAI_API_KEY="sk-..."
93
-
94
- # Windows PowerShell
95
- $env:OPENAI_API_KEY = "sk-..."
96
- ```
97
-
98
- You can also put the key in a `.env` file at the project root.
99
-
100
- <details>
101
- <summary><strong>Configure multiple providers with <code>.flavor/flavor.json</code></strong></summary>
102
-
103
- Example project configuration:
104
-
105
- ```json
106
- {
107
- "providers": {
108
- "openai": {
109
- "type": "openai",
110
- "apiKey": "${OPENAI_API_KEY}",
111
- "defaultModel": "gpt-5",
112
- "cheapModel": "gpt-5-mini"
113
- }
114
- },
115
- "agents": {
116
- "main": { "model": "openai:gpt-5" },
117
- "subagent": { "model": "openai:gpt-5-mini" }
118
- },
119
- "permissionMode": "default",
120
- "maxSubagents": 3,
121
- "language": "zh-CN"
122
- }
123
- ```
124
-
125
- Configuration is merged in the following order, with later sources taking precedence:
126
-
127
- 1. Global `~/.flavor-code/flavor.json`
128
- 2. Project `.flavor/flavor.json`
129
- 3. `.env`
130
- 4. Process environment variables
131
-
132
- Commonly supported provider types:
133
-
134
- - `openai`: OpenAI's official API
135
- - `anthropic`: Anthropic's official API
136
- - `openai-compatible`: Services compatible with the OpenAI protocol
137
-
138
- </details>
139
-
140
- 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.
141
-
142
- ## Entry Points
143
-
144
- | Entry point | Best for | How to start |
145
- | --- | --- | --- |
146
- | **CLI** | Daily development, remote environments, scripting, and CI | `flavor` |
147
- | **Electron** | Visual sessions, diffs, permissions, and resource management | `npm run desktop:start` |
148
- | **VS Code / Qoder** | Editor context, diagnostic fixes, and a task control plane | `npm run ide:install` |
149
-
150
- ### CLI
151
-
152
- Run `flavor` and type natural language. Typing `/` shows built-in commands, plugin commands, and Skills.
153
-
154
- Common commands:
155
-
156
- | Command | Purpose |
157
- | --- | --- |
158
- | `/init` | Generate or update `FLAVOR.md` |
159
- | `/model` | View or switch main/sub-agent models |
160
- | `/permissions` | Switch permission modes |
161
- | `/tasks` | View task plans and sub-agent status |
162
- | `/compact` | Manually compact long session context |
163
- | `/checkpoint`, `/tree` | Save state, view the session tree |
164
- | `/rewind`, `/unrevert`, `/fork` | Resume or fork sessions |
165
- | `/memory`, `/remember`, `/forget`, `/forget-cold` | Manage long-term memory; `/forget-cold` purges cold entries and their files |
166
- | `/mcp` | View and manage MCP servers |
167
- | `/loop <goal>` | Run an autonomous loop with verification |
168
- | `/goal <objective>` | Run the plan, execute, adversarial-review workflow |
169
- | `/commit [hint]` | Draft a Conventional-Commits message for staged changes and commit after confirmation |
170
- | `/review [focus]` | Review uncommitted changes for bugs and risks before committing |
171
- | `/explain <symbol \| file.ts#symbol> [focus]` | Explain a symbol for newcomers using the code graph, real source and git history (interactive picker on ambiguity) |
172
- | `/evolve <signals\|suggest\|improve ...>` | Self-improvement loop: review repeated tool failures, scaffold fix plugins, manage run trends and learned guardrail rules, verify and hot-reload |
173
- | `/pals`, `/chat`, `/co-work` | Discover and collaborate with other local CLI instances |
174
- | `/audit` | View tool failure audits |
175
-
176
- 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.
177
-
178
- `/commit` and `/review` use the cheap sub-agent model and degrade gracefully when it is unavailable. Session checkpoints are tagged with the current git state (`branch@sha`), so `/tree` shows what the workspace looked like at each node. `/explain <symbol>` runs on the same cheap model: it assembles call relations from the code graph, the symbol's real source slice, and recent commits touching the file, then generates a five-part newcomer walkthrough (what it does / key implementation points / call flow / why it is written this way / gotchas); an interactive picker disambiguates multiple matches, and a missing graph degrades to a `/ast init` hint instead of an error.
179
-
180
- #### CLI pals and cross-project work
181
-
182
- Interactive CLI instances on the same Windows or macOS user account can collaborate over local-only IPC (Windows named pipes or Unix sockets; no TCP fallback). Give each window a memorable alias:
183
-
184
- ```bash
185
- # terminal A, in project A
186
- flavor --pal-name A
187
-
188
- # terminal B, in project B
189
- flavor --pal-name B
190
- ```
191
-
192
- Useful commands:
193
-
194
- ```text
195
- /pals # aliases and per-process UUIDs
196
- /pals --verbose # also show project paths and timestamps
197
- /pals rename api # rename this active instance
198
- /chat B Update the API and tests # deliver to B and start its agent safely
199
- /co-work B Upgrade B, then adapt A # negotiate one plan before parallel work
200
- /co-work status [co-work-uuid]
201
- /co-work cancel <co-work-uuid> [reason]
202
- ```
203
-
204
- `/chat` is bidirectional and task-oriented. If B is idle, the attributed message starts a normal model turn; if B is already running, it becomes steering, or a follow-up when another local submission is pending. Remote text is converted to a safe non-slash prompt, so `/exit`-like text is not dispatched as a local command. B can answer with `/chat A ...`.
205
-
206
- `/co-work` first places both agents in planning and waits for both to accept the same hashed plan and declare READY. Early READY intents are retained, and only the broker's exactly-once START event opens parallel execution. Each agent works only in its own project, receives only its assigned tasks, and reports bounded completion evidence. The broker-selected integration owner verifies all assertions and emits END or FAIL through `CoWorkIntegrate`. Communication uses authenticated, bounded local IPC with no TCP listener; peer input cannot approve tools or access the other workspace. UUID/alias routing and the protocol already support a third active client; durable artifact exchange, broker-restart journaling/recovery, and large-group coordination are later hardening work. See the [CLI pals specification](./docs/specs/2026-08-14-cli-pals-cowork.md).
207
-
208
- ### Electron Desktop
209
-
210
- ```bash
211
- npm run desktop:dev # dev mode
212
- npm run desktop:start # build and start
213
- npm run desktop:pack # Windows portable directory
214
- npm run desktop:dist # Windows NSIS installer
215
- ```
216
-
217
- The desktop app keeps multiple projects open and can run up to four independent tasks concurrently inside one project; switching projects or tasks does not stop background work. Completion, failure, attention, and interruption events enter a persistent activity inbox and trigger native notifications, while unread completions retain a blue dot. Projects can be pinned, renamed, closed, revealed, or copied; tasks can be searched, renamed, pinned, and archived.
218
-
219
- Use `Ctrl+P` to switch projects, `Ctrl+K` for the command palette, and `Ctrl+N` for a new task; the title bar also supports back/forward navigation. Interrupted work gets a recovery banner after an abnormal exit. The **Git Changes** view provides per-file diffs, stage/unstage/discard, commits, and `/review` handoff. Streaming Markdown, permission confirmations, and Skills, MCP, memory, and model management remain available.
220
-
221
- The **E2E** module in the sidebar drives a rough requirement or an existing design export through the full delivery pipeline: it generates a PRD and an interactive prototype for review, then moves into D2C visual implementation (Vue 3 / React) under `src/d2c-output/<task>/`. A Vite dev server starts automatically for pixel-level comparison, producing a visual-fidelity score and a structured diff report (region offsets, color deviations, font differences); the results workbench offers overlay, curtain, flicker, and heatmap modes, an SVG annotation layer, and a severity-sorted issue list. After visual review, a Swagger/OpenAPI contract is generated or imported to auto-create Axios wrappers and an Express mock server, followed by autonomous interactive acceptance and scored delivery.
222
-
223
- ### VS Code / Qoder
224
-
225
- ```bash
226
- npm run vscode:install # install into VS Code
227
- npm run qoder:install # install into Qoder
228
- npm run ide:install # auto-select the installed IDE
229
- ```
230
-
231
- 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`.
232
-
233
- ## MCP, Skills & Plugins
234
-
235
- Flavor can connect to stdio or Streamable HTTP MCP servers. Example project configuration:
236
-
237
- <details>
238
- <summary><strong>MCP configuration and CLI examples</strong></summary>
239
-
240
- ```json
241
- {
242
- "mcpServers": {
243
- "docs": {
244
- "url": "https://example.com/mcp",
245
- "headers": {
246
- "Authorization": "Bearer ${MCP_TOKEN}"
247
- }
248
- }
249
- }
250
- }
251
- ```
252
-
253
- MCP configuration can also be managed from the CLI:
254
-
255
- ```bash
256
- flavor mcp list
257
- flavor mcp add docs --url https://example.com/mcp
258
- flavor mcp disable docs
259
- ```
260
-
261
- </details>
262
-
263
- 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>`. Skill bodies support `$ARGUMENTS`, `$ARGUMENTS[N]`, and `$N` substitutions. A running composite Skill can load a dependency through the read-only `Skill` tool; plugin-qualified names such as `superharness:test-driven-development` resolve to discovered skills.
264
-
265
- Plugins live in `.flavor/plugins/` and can register commands, tools, hooks, Skill roots, and model adapters. Official plugins can be installed with the plugin manager: `npx --yes @flavor-code/plugin-manager`. `additionalContext` returned by `SessionStart` and `UserPromptSubmit` hooks is added to the current task context, enabling reliable project-level engineering policy injection. Plugin loads record a content fingerprint plus declared capabilities. Worker/vm isolation is available through the embedding API's `pluginSandbox: true` option; the compatibility default remains in-process because bundled and existing plugins use Node.js APIs that the isolated runtime does not yet mediate.
266
-
267
- When the `flavor-island` plugin is loaded, Flavor also starts a Flavor Island local control channel: a loopback-only IPC service (Windows named pipe, or Unix socket on macOS/Linux) secured by a random token. A host app (such as the Flavor Island desktop) can use it to abort, steer, or send follow-ups to a running session, and desktop hosts can also bring their window into focus. The channel's endpoint, token, and capability list are exposed to the host plugin via hook event context (`islandControlEndpoint`/`islandControlToken`/`islandControlCapabilities`); model-call duration and token usage, plus the final task summary and deliverables, are reported through hook events so the host can show live status and a result overview.
268
-
269
- > [!WARNING]
270
- > The default in-process plugin runtime grants full Node.js access. Only install and enable plugins you trust. Sandboxing reduces ambient access but does not make untrusted instructions safe, and plugins that import Node.js built-ins will not load with `pluginSandbox: true` yet.
271
-
272
- ## Sessions, Memory & Execution Records
273
-
274
- Project runtime data lives under `.flavor/`:
275
-
276
- ```text
277
- .flavor/
278
- ├── flavor.json # Project config
279
- ├── sessions/ # Session timelines
280
- │ └── *.events.jsonl # Crash-consistent execution journals
281
- ├── session-assets/ # Image attachments
282
- ├── session-trees/ # Explicit /checkpoint session branches
283
- ├── checkpoints/ # Workspace snapshots
284
- ├── memory/ # Long-term memory
285
- ├── traces/ # Optional execution traces
286
- ├── audit.jsonl # Tool failure audits
287
- ├── evolve/ # Self-improvement signals and run reflections
288
- ├── skills/ # Project skills
289
- └── plugins/ # Project plugins
290
- ```
291
-
292
- 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.
293
-
294
- 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.
295
-
296
- ## Permissions & Sandbox
297
-
298
- | Mode | Behavior |
299
- | --- | --- |
300
- | `default` | Reads are auto-approved; writes, Shell, network, and destructive actions are confirmed on demand |
301
- | `acceptEdits` | Workspace writes and routine verification are auto-approved |
302
- | `plan` | Read-only planning; no modifications or execution |
303
- | `bypassPermissions` | The main agent executes as much as possible after hard safety checks |
304
- | `auto` | A classifier decides, falling back to human approval when uncertain |
305
- | `bubble` | Uncertain operations bubble up to the main session for approval |
306
-
307
- Layered permission policies can be defined in the managed, user, project, local-project, and session tiers. Matching rules use token arrays and the strictest result always wins (`deny > ask > allow`); built-in hard denials cannot be weakened.
308
-
309
- > [!CAUTION]
310
- > Local Shell still runs as your current user. Consider enabling Docker when working with untrusted projects.
311
-
312
- <details>
313
- <summary><strong>Docker execution environment example</strong></summary>
314
-
315
- ```json
316
- {
317
- "execution": {
318
- "mode": "docker",
319
- "image": "node:24-bookworm-slim",
320
- "network": false,
321
- "memory": "2g",
322
- "cpus": 2
323
- }
324
- }
325
- ```
326
-
327
- 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.
328
-
329
- </details>
330
-
331
- ## SDK, RPC & Evaluation
332
-
333
- <details>
334
- <summary><strong>Node.js SDK example</strong></summary>
335
-
336
- ```ts
337
- import { createFlavorRuntime } from "flavor-code/sdk";
338
-
339
- const runtime = await createFlavorRuntime({
340
- workspace: process.cwd(),
341
- approvalPolicy: "deny",
342
- output: console.log,
343
- });
344
-
345
- await runtime.session.start();
346
- await runtime.session.submit("fix the failing tests");
347
- await runtime.dispose();
348
- ```
349
-
350
- </details>
351
-
352
- Other IDEs or languages can integrate over JSONL RPC:
353
-
354
- ```bash
355
- flavor --mode rpc --workspace . --trace .flavor/traces/run.jsonl
356
- ```
357
-
358
- Run evaluations:
359
-
360
- ```bash
361
- flavor eval eval.json --output report.json
362
- ```
363
-
364
- 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).
365
-
366
- ## Development
367
-
368
- ```bash
369
- npm ci
370
- npm test
371
- npm run typecheck
372
- npm run vscode:typecheck
373
- npm run build
374
- npm run smoke:install
375
- ```
376
-
377
- - TypeScript strict, targeting ES2022, Node.js 20+
378
- - Vitest for unit and integration tests
379
- - tsup builds the CLI, SDK, Electron main process, and VS Code extension
380
- - Vite builds the Electron renderer
381
- - CI covers Windows/macOS with Node 20/24
382
-
383
- Release builds do not generate or package source maps by default. For a local debugging build, enable them explicitly:
384
-
385
- ```bash
386
- # macOS / Linux
387
- FLAVOR_SOURCEMAP=1 npm run build
388
-
389
- # Windows PowerShell
390
- $env:FLAVOR_SOURCEMAP = "1"
391
- npm run build
392
- ```
393
-
394
- ## Documentation
395
-
396
- - [Technical Design Report](./技术方案报告.md): overall architecture, agent loop, context, permissions, plugins, and security model
397
- - [Runtime reliability spec](./docs/specs/2026-07-26-runtime-reliability.md)
398
- - [1.3 reliability, prompt-cache & verification contract](./docs/specs/2026-08-24-v1.3-reliability-contract.md)
399
- - [Control plane, sandbox & VS Code spec](./docs/specs/2026-07-29-control-plane-sandbox-vscode.md)
400
- - [Multimodal image attachments spec](./docs/specs/2026-07-30-multimodal-image-attachments.md)
401
- - [D2C design-to-code spec](./docs/specs/2026-08-09-d2c-design-to-code.md)
402
- - [D2C review & integration spec](./docs/specs/2026-08-10-d2c-review-and-integration.md)
403
- - [E2E requirement-to-delivery spec](./docs/specs/2026-08-12-e2e-requirement-to-delivery.md)
404
- - [1.2.9 runtime productivity spec](./docs/specs/2026-08-13-runtime-productivity-waves.md)
405
- - [VS Code next steps](./docs/specs/2026-08-01-flavor-code-vscode-next.md)
406
-
407
- ## Security Notes
408
-
409
- - Review model-generated code and commands, especially dependency installs, scripts, and deletions.
410
- - Do not treat `.flavor/sessions/`, traces, or long-term memory as secret stores.
411
- - Use least-privilege API keys and never commit `.env`.
412
- - Skill content can influence model behavior; sandboxed plugins still require review, while explicitly enabled legacy in-process plugins have full Node.js permissions.
413
- - Work under version control and create checkpoints before high-risk tasks.
414
-
415
- ## Contributing
416
-
417
- Issues and Pull Requests are welcome. Please at least run the following before submitting:
418
-
419
- ```bash
420
- npm test
421
- npm run typecheck
422
- npm run vscode:typecheck
423
- npm run build
424
- ```
425
-
426
- For architecture changes, read the [Technical Design Report](./技术方案报告.md) and the relevant [design specs](./docs/specs/) first.
427
-
428
- ## License
429
-
430
- [MIT](./LICENSE)
431
-
432
- <p align="center">
433
- Made with 🌶️ by Flavor Code contributors.
434
- </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`, `/goal`, and conflict-safe parallel execution (tasks owning overlapping files run serially) |
36
+ | 🏝️ | **Flavor Island local control** | Host apps steer a running session over a token-authenticated local IPC channel (Windows named pipes / Unix sockets): abort, steering, follow-ups, and window focus; model duration, token usage, task summaries, and deliverables are reported via hook events |
37
+ | ⏪ | **Traceable, resumable results** | Full timeline, checkpoints, rewind, traces, diffs, and failure audits |
38
+ | 🧱 | **Crash-consistent execution** | Fsync-backed event journal, durable steering queue, savepoints, and no automatic replay of non-idempotent tools |
39
+ | 🧠 | **Local long-term context** | Memory, Skills, plugins, and project guides stored on your machine |
40
+ | 🔎 | **Code graph navigation** | A local AST code-graph index (`.flavor/astgraph/`) powers `ast_search`/`ast_callers`/`ast_impact` queries for precise symbol lookup and reachability tracing; `/explain` turns that graph plus git history into newcomer-oriented walkthroughs |
41
+ | 🌿 | **Git-native workflows** | `/commit` drafts a Conventional-Commits message for staged changes and commits after confirmation; `/review` audits uncommitted changes; the read-only `GitHistory` tool explains when and why code changed |
42
+ | 🎨 | **E2E requirement-to-delivery** | From a rough requirement or a design export to a delivered product: PRD, interactive prototype, visual implementation, API integration, autonomous acceptance, and scored delivery (Electron only) |
43
+ | 🔁 | **Bounded self-improvement** | Repeated tool failures are captured, deduped, and proposed as suggestions; fixes ship as sandbox-verified plugins or as learned guardrail rules injected into future prompts, with run trends and rule management (`/evolve`) |
44
+ | 🛡️ | **Clear permission boundaries** | Independent control over read, write, Shell, network, and destructive actions; Docker supported |
45
+
46
+ ## Quick Start
47
+
48
+ > [!IMPORTANT]
49
+ > 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).
50
+
51
+ **1. Install**
52
+
53
+ ```bash
54
+ npm install -g flavor-code
55
+ ```
56
+
57
+ **2. Start in your project**
58
+
59
+ ```bash
60
+ cd your-project
61
+ flavor
62
+ ```
63
+
64
+ **3. Initialize project context**
65
+
66
+ 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.
67
+
68
+ You can also run one-off tasks directly:
69
+
70
+ ```bash
71
+ flavor --print "Analyze this project and list the top three issues worth fixing"
72
+ flavor --resume
73
+ flavor --resume -p "Continue the remaining work"
74
+ ```
75
+
76
+ Non-interactive mode refuses actions that require human approval and never hangs waiting for input.
77
+
78
+ **4. Staying up to date**
79
+
80
+ ```bash
81
+ flavor update
82
+ ```
83
+
84
+ Flavor checks the npm registry at startup and shows an update hint on the welcome card. Run `flavor update` to upgrade the global install to the latest release, then restart Flavor.
85
+
86
+ If Flavor cannot start or local tools behave unexpectedly, run `flavor doctor` from a terminal. In the interactive CLI and desktop app, run `/doctor`. Both entry points check Node.js, configuration, providers, the command shell, ripgrep, plugin directories, and npm registry access. Use `flavor doctor --json` for a machine-readable issue report; API keys are never printed.
87
+
88
+ ## Configuring Models
89
+
90
+ The fastest way is to set environment variables:
91
+
92
+ ```bash
93
+ # macOS / Linux
94
+ export OPENAI_API_KEY="sk-..."
95
+
96
+ # Windows PowerShell
97
+ $env:OPENAI_API_KEY = "sk-..."
98
+ ```
99
+
100
+ You can also put the key in a `.env` file at the project root.
101
+
102
+ <details>
103
+ <summary><strong>Configure multiple providers with <code>.flavor/flavor.json</code></strong></summary>
104
+
105
+ Example project configuration:
106
+
107
+ ```json
108
+ {
109
+ "providers": {
110
+ "openai": {
111
+ "type": "openai",
112
+ "apiKey": "${OPENAI_API_KEY}",
113
+ "defaultModel": "gpt-5",
114
+ "cheapModel": "gpt-5-mini"
115
+ }
116
+ },
117
+ "agents": {
118
+ "main": { "model": "openai:gpt-5" },
119
+ "subagent": { "model": "openai:gpt-5-mini" }
120
+ },
121
+ "permissionMode": "default",
122
+ "maxSubagents": 3,
123
+ "language": "zh-CN"
124
+ }
125
+ ```
126
+
127
+ Configuration is merged in the following order, with later sources taking precedence:
128
+
129
+ 1. Global `~/.flavor-code/flavor.json`
130
+ 2. Project `.flavor/flavor.json`
131
+ 3. `.env`
132
+ 4. Process environment variables
133
+
134
+ Commonly supported provider types:
135
+
136
+ - `openai`: OpenAI's official API
137
+ - `anthropic`: Anthropic's official API
138
+ - `openai-compatible`: Services compatible with the OpenAI protocol
139
+
140
+ </details>
141
+
142
+ 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.
143
+
144
+ ## Entry Points
145
+
146
+ | Entry point | Best for | How to start |
147
+ | --- | --- | --- |
148
+ | **CLI** | Daily development, remote environments, scripting, and CI | `flavor` |
149
+ | **Electron** | Visual sessions, diffs, permissions, and resource management | `npm run desktop:start` |
150
+ | **VS Code / Qoder** | Editor context, diagnostic fixes, and a task control plane | `npm run ide:install` |
151
+
152
+ ### CLI
153
+
154
+ Run `flavor` and type natural language. Typing `/` shows built-in commands, plugin commands, and Skills.
155
+
156
+ Common commands:
157
+
158
+ | Command | Purpose |
159
+ | --- | --- |
160
+ | `/init` | Generate or update `FLAVOR.md` |
161
+ | `/doctor` | Diagnose the local runtime, configuration, tools, plugins, and npm access |
162
+ | `/model` | View or switch main/sub-agent models |
163
+ | `/permissions` | Switch permission modes |
164
+ | `/tasks` | View task plans and sub-agent status |
165
+ | `/compact` | Manually compact long session context |
166
+ | `/checkpoint`, `/tree` | Save state, view the session tree |
167
+ | `/rewind`, `/unrevert`, `/fork` | Resume or fork sessions |
168
+ | `/memory`, `/remember`, `/forget`, `/forget-cold` | Manage long-term memory; `/forget-cold` purges cold entries and their files |
169
+ | `/mcp` | View and manage MCP servers |
170
+ | `/loop <goal>` | Run an autonomous loop with verification |
171
+ | `/goal <objective>` | Run the plan, execute, adversarial-review workflow |
172
+ | `/commit [hint]` | Draft a Conventional-Commits message for staged changes and commit after confirmation |
173
+ | `/review [focus]` | Review uncommitted changes for bugs and risks before committing |
174
+ | `/explain <symbol \| file.ts#symbol> [focus]` | Explain a symbol for newcomers using the code graph, real source and git history (interactive picker on ambiguity) |
175
+ | `/evolve <signals\|suggest\|improve ...>` | Self-improvement loop: review repeated tool failures, scaffold fix plugins, manage run trends and learned guardrail rules, verify and hot-reload |
176
+ | `/pals`, `/chat`, `/co-work` | Discover and collaborate with other local CLI instances |
177
+ | `/audit` | View tool failure audits |
178
+
179
+ 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.
180
+
181
+ `/commit` and `/review` use the cheap sub-agent model and degrade gracefully when it is unavailable. Session checkpoints are tagged with the current git state (`branch@sha`), so `/tree` shows what the workspace looked like at each node. `/explain <symbol>` runs on the same cheap model: it assembles call relations from the code graph, the symbol's real source slice, and recent commits touching the file, then generates a five-part newcomer walkthrough (what it does / key implementation points / call flow / why it is written this way / gotchas); an interactive picker disambiguates multiple matches, and a missing graph degrades to a `/ast init` hint instead of an error.
182
+
183
+ #### CLI pals and cross-project work
184
+
185
+ Interactive CLI instances on the same Windows or macOS user account can collaborate over local-only IPC (Windows named pipes or Unix sockets; no TCP fallback). Give each window a memorable alias:
186
+
187
+ ```bash
188
+ # terminal A, in project A
189
+ flavor --pal-name A
190
+
191
+ # terminal B, in project B
192
+ flavor --pal-name B
193
+ ```
194
+
195
+ Useful commands:
196
+
197
+ ```text
198
+ /pals # aliases and per-process UUIDs
199
+ /pals --verbose # also show project paths and timestamps
200
+ /pals rename api # rename this active instance
201
+ /chat B Update the API and tests # deliver to B and start its agent safely
202
+ /co-work B Upgrade B, then adapt A # negotiate one plan before parallel work
203
+ /co-work status [co-work-uuid]
204
+ /co-work cancel <co-work-uuid> [reason]
205
+ ```
206
+
207
+ `/chat` is bidirectional and task-oriented. If B is idle, the attributed message starts a normal model turn; if B is already running, it becomes steering, or a follow-up when another local submission is pending. Remote text is converted to a safe non-slash prompt, so `/exit`-like text is not dispatched as a local command. B can answer with `/chat A ...`.
208
+
209
+ `/co-work` first places both agents in planning and waits for both to accept the same hashed plan and declare READY. Early READY intents are retained, and only the broker's exactly-once START event opens parallel execution. Each agent works only in its own project, receives only its assigned tasks, and reports bounded completion evidence. The broker-selected integration owner verifies all assertions and emits END or FAIL through `CoWorkIntegrate`. Communication uses authenticated, bounded local IPC with no TCP listener; peer input cannot approve tools or access the other workspace. UUID/alias routing and the protocol already support a third active client; durable artifact exchange, broker-restart journaling/recovery, and large-group coordination are later hardening work. See the [CLI pals specification](./docs/specs/2026-08-14-cli-pals-cowork.md).
210
+
211
+ ### Electron Desktop
212
+
213
+ ```bash
214
+ npm run desktop:dev # dev mode
215
+ npm run desktop:start # build and start
216
+ npm run desktop:pack # Windows portable directory
217
+ npm run desktop:dist # Windows NSIS installer
218
+ ```
219
+
220
+ The desktop app keeps multiple projects open and can run up to four independent tasks concurrently inside one project; switching projects or tasks does not stop background work. Completion, failure, attention, and interruption events enter a persistent activity inbox and trigger native notifications, while unread completions retain a blue dot. Projects can be pinned, renamed, closed, revealed, or copied; tasks can be searched, renamed, pinned, and archived.
221
+
222
+ Use `Ctrl+P` to switch projects, `Ctrl+K` for the command palette, and `Ctrl+N` for a new task; the title bar also supports back/forward navigation. Interrupted work gets a recovery banner after an abnormal exit. The **Git Changes** view provides per-file diffs, stage/unstage/discard, commits, and `/review` handoff. Streaming Markdown, permission confirmations, and Skills, MCP, memory, and model management remain available.
223
+
224
+ The **E2E** module in the sidebar drives a rough requirement or an existing design export through the full delivery pipeline: it generates a PRD and an interactive prototype for review, then moves into D2C visual implementation (Vue 3 / React) under `src/d2c-output/<task>/`. A Vite dev server starts automatically for pixel-level comparison, producing a visual-fidelity score and a structured diff report (region offsets, color deviations, font differences); the results workbench offers overlay, curtain, flicker, and heatmap modes, an SVG annotation layer, and a severity-sorted issue list. After visual review, a Swagger/OpenAPI contract is generated or imported to auto-create Axios wrappers and an Express mock server, followed by autonomous interactive acceptance and scored delivery.
225
+
226
+ ### VS Code / Qoder
227
+
228
+ ```bash
229
+ npm run vscode:install # install into VS Code
230
+ npm run qoder:install # install into Qoder
231
+ npm run ide:install # auto-select the installed IDE
232
+ ```
233
+
234
+ 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`.
235
+
236
+ ## MCP, Skills & Plugins
237
+
238
+ Flavor can connect to stdio or Streamable HTTP MCP servers. Example project configuration:
239
+
240
+ <details>
241
+ <summary><strong>MCP configuration and CLI examples</strong></summary>
242
+
243
+ ```json
244
+ {
245
+ "mcpServers": {
246
+ "docs": {
247
+ "url": "https://example.com/mcp",
248
+ "headers": {
249
+ "Authorization": "Bearer ${MCP_TOKEN}"
250
+ }
251
+ }
252
+ }
253
+ }
254
+ ```
255
+
256
+ MCP configuration can also be managed from the CLI:
257
+
258
+ ```bash
259
+ flavor mcp list
260
+ flavor mcp add docs --url https://example.com/mcp
261
+ flavor mcp disable docs
262
+ ```
263
+
264
+ </details>
265
+
266
+ 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>`. Skill bodies support `$ARGUMENTS`, `$ARGUMENTS[N]`, and `$N` substitutions. A running composite Skill can load a dependency through the read-only `Skill` tool; plugin-qualified names such as `superharness:test-driven-development` resolve to discovered skills.
267
+
268
+ Plugins live in `.flavor/plugins/` and can register commands, tools, hooks, Skill roots, and model adapters. Official plugins can be installed with the plugin manager: `npx --yes @flavor-code/plugin-manager`. `additionalContext` returned by `SessionStart` and `UserPromptSubmit` hooks is added to the current task context, enabling reliable project-level engineering policy injection. Plugin loads record a content fingerprint plus declared capabilities. Worker/vm isolation is available through the embedding API's `pluginSandbox: true` option; the compatibility default remains in-process because bundled and existing plugins use Node.js APIs that the isolated runtime does not yet mediate.
269
+
270
+ When the `flavor-island` plugin is loaded, Flavor also starts a Flavor Island local control channel: a loopback-only IPC service (Windows named pipe, or Unix socket on macOS/Linux) secured by a random token. A host app (such as the Flavor Island desktop) can use it to abort, steer, or send follow-ups to a running session, and desktop hosts can also bring their window into focus. The channel's endpoint, token, and capability list are exposed to the host plugin via hook event context (`islandControlEndpoint`/`islandControlToken`/`islandControlCapabilities`); model-call duration and token usage, plus the final task summary and deliverables, are reported through hook events so the host can show live status and a result overview.
271
+
272
+ > [!WARNING]
273
+ > The default in-process plugin runtime grants full Node.js access. Only install and enable plugins you trust. Sandboxing reduces ambient access but does not make untrusted instructions safe, and plugins that import Node.js built-ins will not load with `pluginSandbox: true` yet.
274
+
275
+ ## Sessions, Memory & Execution Records
276
+
277
+ Project runtime data lives under `.flavor/`:
278
+
279
+ ```text
280
+ .flavor/
281
+ ├── flavor.json # Project config
282
+ ├── sessions/ # Session timelines
283
+ │ └── *.events.jsonl # Crash-consistent execution journals
284
+ ├── session-assets/ # Image attachments
285
+ ├── session-trees/ # Explicit /checkpoint session branches
286
+ ├── checkpoints/ # Workspace snapshots
287
+ ├── memory/ # Long-term memory
288
+ ├── traces/ # Optional execution traces
289
+ ├── audit.jsonl # Tool failure audits
290
+ ├── evolve/ # Self-improvement signals and run reflections
291
+ ├── skills/ # Project skills
292
+ └── plugins/ # Project plugins
293
+ ```
294
+
295
+ 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.
296
+
297
+ 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.
298
+
299
+ ## Permissions & Sandbox
300
+
301
+ | Mode | Behavior |
302
+ | --- | --- |
303
+ | `default` | Reads are auto-approved; writes, Shell, network, and destructive actions are confirmed on demand |
304
+ | `acceptEdits` | Workspace writes and routine verification are auto-approved |
305
+ | `plan` | Read-only planning; no modifications or execution |
306
+ | `bypassPermissions` | The main agent executes as much as possible after hard safety checks |
307
+ | `auto` | A classifier decides, falling back to human approval when uncertain |
308
+ | `bubble` | Uncertain operations bubble up to the main session for approval |
309
+
310
+ Layered permission policies can be defined in the managed, user, project, local-project, and session tiers. Matching rules use token arrays and the strictest result always wins (`deny > ask > allow`); built-in hard denials cannot be weakened.
311
+
312
+ > [!CAUTION]
313
+ > Local Shell still runs as your current user. Consider enabling Docker when working with untrusted projects.
314
+
315
+ <details>
316
+ <summary><strong>Docker execution environment example</strong></summary>
317
+
318
+ ```json
319
+ {
320
+ "execution": {
321
+ "mode": "docker",
322
+ "image": "node:24-bookworm-slim",
323
+ "network": false,
324
+ "memory": "2g",
325
+ "cpus": 2
326
+ }
327
+ }
328
+ ```
329
+
330
+ 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.
331
+
332
+ </details>
333
+
334
+ ## SDK, RPC & Evaluation
335
+
336
+ <details>
337
+ <summary><strong>Node.js SDK example</strong></summary>
338
+
339
+ ```ts
340
+ import { createFlavorRuntime } from "flavor-code/sdk";
341
+
342
+ const runtime = await createFlavorRuntime({
343
+ workspace: process.cwd(),
344
+ approvalPolicy: "deny",
345
+ output: console.log,
346
+ });
347
+
348
+ await runtime.session.start();
349
+ await runtime.session.submit("fix the failing tests");
350
+ await runtime.dispose();
351
+ ```
352
+
353
+ </details>
354
+
355
+ Other IDEs or languages can integrate over JSONL RPC:
356
+
357
+ ```bash
358
+ flavor --mode rpc --workspace . --trace .flavor/traces/run.jsonl
359
+ ```
360
+
361
+ Run evaluations:
362
+
363
+ ```bash
364
+ flavor eval eval.json --output report.json
365
+ ```
366
+
367
+ 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).
368
+
369
+ ## Development
370
+
371
+ ```bash
372
+ npm ci
373
+ npm test
374
+ npm run typecheck
375
+ npm run vscode:typecheck
376
+ npm run build
377
+ npm run smoke:install
378
+ ```
379
+
380
+ - TypeScript strict, targeting ES2022, Node.js 20+
381
+ - Vitest for unit and integration tests
382
+ - tsup builds the CLI, SDK, Electron main process, and VS Code extension
383
+ - Vite builds the Electron renderer
384
+ - CI covers Windows/macOS with Node 20/24
385
+
386
+ Release builds do not generate or package source maps by default. For a local debugging build, enable them explicitly:
387
+
388
+ ```bash
389
+ # macOS / Linux
390
+ FLAVOR_SOURCEMAP=1 npm run build
391
+
392
+ # Windows PowerShell
393
+ $env:FLAVOR_SOURCEMAP = "1"
394
+ npm run build
395
+ ```
396
+
397
+ ## Documentation
398
+
399
+ - [Technical Design Report](./技术方案报告.md): overall architecture, agent loop, context, permissions, plugins, and security model
400
+ - [Runtime reliability spec](./docs/specs/2026-07-26-runtime-reliability.md)
401
+ - [1.3 reliability, prompt-cache & verification contract](./docs/specs/2026-08-24-v1.3-reliability-contract.md)
402
+ - [Control plane, sandbox & VS Code spec](./docs/specs/2026-07-29-control-plane-sandbox-vscode.md)
403
+ - [Multimodal image attachments spec](./docs/specs/2026-07-30-multimodal-image-attachments.md)
404
+ - [D2C design-to-code spec](./docs/specs/2026-08-09-d2c-design-to-code.md)
405
+ - [D2C review & integration spec](./docs/specs/2026-08-10-d2c-review-and-integration.md)
406
+ - [E2E requirement-to-delivery spec](./docs/specs/2026-08-12-e2e-requirement-to-delivery.md)
407
+ - [1.2.9 runtime productivity spec](./docs/specs/2026-08-13-runtime-productivity-waves.md)
408
+ - [VS Code next steps](./docs/specs/2026-08-01-flavor-code-vscode-next.md)
409
+
410
+ ## Security Notes
411
+
412
+ - Review model-generated code and commands, especially dependency installs, scripts, and deletions.
413
+ - Do not treat `.flavor/sessions/`, traces, or long-term memory as secret stores.
414
+ - Use least-privilege API keys and never commit `.env`.
415
+ - Skill content can influence model behavior; sandboxed plugins still require review, while explicitly enabled legacy in-process plugins have full Node.js permissions.
416
+ - Work under version control and create checkpoints before high-risk tasks.
417
+
418
+ ## Contributing
419
+
420
+ Issues and Pull Requests are welcome. Please at least run the following before submitting:
421
+
422
+ ```bash
423
+ npm test
424
+ npm run typecheck
425
+ npm run vscode:typecheck
426
+ npm run build
427
+ ```
428
+
429
+ For architecture changes, read the [Technical Design Report](./技术方案报告.md) and the relevant [design specs](./docs/specs/) first.
430
+
431
+ ## License
432
+
433
+ [MIT](./LICENSE)
434
+
435
+ <p align="center">
436
+ Made with 🌶️ by Flavor Code contributors.
437
+ </p>