Skip to content

Commit 0192cef

Browse files
committed
release: prepare 0.2.0 capability runtime
1 parent df1865e commit 0192cef

42 files changed

Lines changed: 2110 additions & 132 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,3 +223,4 @@ CODEX.md
223223

224224
# Local vCode Entry
225225
.vcode
226+
compares

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,11 @@ check:
3838

3939
check-matrix:
4040
@for version in $(PYTHON_VERSIONS); do \
41+
short_version=$${version%.*}; \
4142
printf "$(BLUE)==>$(RESET) Running validation matrix for Python $$version...\n"; \
4243
uv run --python $$version ruff check src/vcode tests || exit $$?; \
43-
uv run --python $$version ty check --python-version $$version || exit $$?; \
44-
uv run --python $$version basedpyright --pythonversion $$version || exit $$?; \
44+
uv run --python $$version ty check --python-version $$short_version || exit $$?; \
45+
uv run --python $$version basedpyright --pythonversion $$short_version || exit $$?; \
4546
done
4647
@printf "$(GREEN)✔ Matrix checking complete.$(RESET)\n"
4748

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@ The current repository is intentionally focused on a narrow but working skeleton
99
- `Ask`, `Plan`, and `Agent` modes
1010
- per-session approvals for file writes
1111
- model selection and ACP model/config surfaces
12-
- local workspace tools for list, read, and write
12+
- capability-first runtime assembly on top of `pydantic-ai`
13+
- local workspace tools for list, read, and write through native capabilities
14+
- mode-aware tool visibility with `PrepareTools`
15+
- MCP server integration through native `MCP` capabilities
16+
- YAML-first `.vcode/mcp.yml` with JSON fallback
17+
- YAML-first `.vcode/hooks.yml` with JSON fallback
18+
- hook command execution via `pydantic-ai Hooks`
1319

1420
## Quick Start
1521

@@ -99,7 +105,16 @@ Implemented today:
99105
- mode switching
100106
- model selection
101107
- write approvals with diff previews
108+
- capability-based runtime composition
109+
- native MCP capability wiring from `.vcode/mcp.yml`
102110
- `.vcode/.vcodeignore` filtering for reads and file listing
111+
- `/hooks` and `/mcp` runtime inspection commands
112+
113+
Local demo assets also exist for manual validation:
114+
115+
- `scripts/demo_mcp_server.py` for a real stdio MCP server
116+
- `scripts/mock_hook_audit.py` for append-only hook auditing
117+
- `scripts/mock_hook_snapshot.py` for payload snapshots
103118

104119
Not implemented yet:
105120

@@ -108,3 +123,4 @@ Not implemented yet:
108123
- web search and scraping
109124
- Python quality tools as runtime tools
110125
- subagents, CodeMode, and RLM workflows
126+
- approval-aware hook execution

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.1.0
1+
0.2.0

docs/acp.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,15 @@ The current permission request includes:
6666

6767
This is especially important for ACP clients such as `toad`, which can render file diffs in approval dialogs.
6868

69+
## Hook and MCP visibility
70+
71+
ACP clients now also receive projections for:
72+
73+
- hook command executions as generic `execute` tool updates
74+
- non-filesystem tools, including MCP-backed tools, as generic execute-style tool updates
75+
76+
This means MCP and hook activity is no longer invisible in ACP sessions, even when the tool family does not map to a specialized ACP kind such as `read` or `edit`.
77+
6978
## Known current limits
7079

7180
The ACP surface is already useful, but still incomplete.
@@ -76,4 +85,4 @@ Missing or partial areas:
7685
- filesystem client-backed fallback behavior
7786
- richer session metadata
7887
- search and browser tools
79-
- MCP-backed tool routing
88+
- richer MCP approval and policy routing

docs/configuration.md

Lines changed: 99 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,112 @@ Current typed shape:
8080

8181
Only the `model` field is currently validated.
8282

83-
### `mcp.json`
83+
### `mcp.yml`
8484

85-
This file is also loadable, including environment variable interpolation for fields such as:
85+
MCP config is YAML-first.
86+
87+
Resolution order:
88+
89+
- `.vcode/mcp.yml`
90+
- `.vcode/mcp.yaml`
91+
- `.vcode/mcp.json`
92+
- `~/.vcode/mcp.yml`
93+
- `~/.vcode/mcp.yaml`
94+
- `~/.vcode/mcp.json`
95+
96+
JSON remains supported, but `mcp.yml` is the native format.
97+
98+
Environment variable interpolation is supported for fields such as:
8699

87100
- `command`
88101
- `args`
89102
- `url`
90103
- `env`
91104

92-
The current runtime does not yet instantiate MCP servers from it.
105+
The current runtime reads this file and builds native `pydantic-ai` MCP capabilities from it.
106+
107+
Example:
108+
109+
```yaml
110+
servers:
111+
- name: demo-local
112+
transport: stdio
113+
command: python3.11
114+
args:
115+
- scripts/demo_mcp_server.py
116+
prefix: demo
117+
118+
- name: searx-local
119+
transport: http
120+
url: ${SEARX_MCP_URL}
121+
prefix: searx
122+
enabled: false
123+
```
124+
125+
Tracked local demo server:
126+
127+
- `scripts/demo_mcp_server.py`
128+
129+
### `hooks.yml`
130+
131+
Hooks config is also YAML-first.
132+
133+
Resolution order:
134+
135+
- `.vcode/hooks.yml`
136+
- `.vcode/hooks.yaml`
137+
- `.vcode/hooks.json`
138+
- `~/.vcode/hooks.yml`
139+
- `~/.vcode/hooks.yaml`
140+
- `~/.vcode/hooks.json`
141+
142+
Current scope:
143+
144+
- the file is loadable and typed
145+
- configured commands are bridged into native `pydantic-ai` `Hooks`
146+
- event ids match `pydantic-ai` hook lifecycle names
147+
148+
Example:
149+
150+
```yaml
151+
events:
152+
before_tool_execute:
153+
- name: audit-write
154+
command: python3.11
155+
args:
156+
- scripts/mock_hook_audit.py
157+
tools:
158+
- write_file
159+
160+
after_model_request:
161+
- name: snapshot-model-response
162+
command: python3.11
163+
args:
164+
- scripts/mock_hook_snapshot.py
165+
```
166+
167+
Current behavior:
168+
169+
- commands run with the workspace root as `cwd`
170+
- configured `env` entries are merged into the process environment
171+
- optional `name` gives a stable display label for `/hooks` and ACP hook projections
172+
- optional `tools` filters a hook command to matching tool names or glob patterns
173+
- `VCODE_HOOK_EVENT`
174+
- `VCODE_HOOK_WORKSPACE_ROOT`
175+
- `VCODE_HOOK_SESSION_ID`
176+
- `VCODE_HOOK_MODE_ID`
177+
- `VCODE_HOOK_PAYLOAD_JSON`
178+
are injected for each hook command
179+
180+
Inspection commands:
181+
182+
- `/hooks` shows the resolved hook configuration for the current workspace
183+
- `/mcp` shows the resolved MCP server configuration for the current workspace
184+
185+
Tracked local demo scripts:
186+
187+
- `scripts/mock_hook_audit.py`
188+
- `scripts/mock_hook_snapshot.py`
93189

94190
## Session storage
95191

docs/current-capabilities.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,20 +62,38 @@ vCode currently supports:
6262
Current storage:
6363

6464
- `.vcode/preferences.json`
65+
- `.vcode/mcp.yml` with JSON fallback
66+
- `.vcode/hooks.yml` with JSON fallback
67+
68+
## Capability stack
69+
70+
The runtime is assembled from native `pydantic-ai` capabilities:
71+
72+
- `Toolset(build_filesystem_toolset(...))`
73+
- `PrepareTools(...)` for mode-aware filesystem visibility
74+
- `Hooks(...)` built from `.vcode/hooks.yml`
75+
- `MCP(...)` or stdio MCP toolsets from `.vcode/mcp.yml`
6576

6677
## Workspace tools
6778

68-
Implemented local tools:
79+
Implemented local filesystem tools:
6980

7081
- `list_files`
7182
- `read_file`
7283
- `write_file`
7384

85+
Manual demo assets also exist in the repository:
86+
87+
- `scripts/demo_mcp_server.py`
88+
- `scripts/mock_hook_audit.py`
89+
- `scripts/mock_hook_snapshot.py`
90+
7491
Current behavior:
7592

7693
- reads are plain text reads
7794
- writes are mode-gated
78-
- writes require approval unless already allowed for the session
95+
- `Ask` mode hides `write_file` from the model through `PrepareTools`
96+
- writes require deferred approval unless already allowed for the session
7997
- `.vcode/.vcodeignore` hides matching files from read/list
8098

8199
## Approval system
@@ -86,13 +104,16 @@ Implemented today:
86104
- manual allow/deny commands
87105
- importing approval preferences from another session
88106
- ACP permission prompts with diff previews for writes
107+
- native deferred approvals through `pydantic-ai`
108+
- hook commands executed through `pydantic-ai Hooks`
89109

90110
Not implemented yet:
91111

92112
- terminal approvals
93113
- network approvals
94114
- browser approvals
95115
- multi-tool approval policies
116+
- approval gating for hook command execution
96117

97118
## Slash commands
98119

@@ -103,6 +124,8 @@ Currently handled in the runtime:
103124
- `/model <model-id>`
104125
- `/model <ask|plan|agent> <model-id>`
105126
- `/approvals`
127+
- `/hooks`
128+
- `/mcp`
106129
- `/approve <tool> <target>`
107130
- `/deny <tool> <target>`
108131
- `/update-preferences <session-id>`
@@ -113,6 +136,7 @@ The repository currently has tests for:
113136

114137
- session behavior
115138
- ACP adapter behavior
139+
- capability composition
116140
- config loading
117141
- approval persistence
118142
- model command flows

docs/index.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ The current codebase is intentionally narrow: it focuses on a solid skeleton for
2121
- Ask for write approvals with file-aware diff previews
2222
- Store the selected default model in `.vcode/preferences.json`
2323
- Let each mode inherit the default model or override it per mode
24+
- Compose the runtime from native `pydantic-ai` capabilities
25+
- Load YAML-first MCP and hooks config from `.vcode/`
26+
- Attach configured MCP servers through native `MCP` capabilities
27+
- Execute configured hook commands through `pydantic-ai Hooks`
2428

2529
## What is not finished yet
2630

@@ -31,7 +35,7 @@ These items are planned, but not part of the current working skeleton:
3135
- built-in web search and scraping
3236
- Python quality loop (`pytest`, `ruff`, `mypy`/`pyright`) as first-class tools
3337
- subagents, CodeMode, RLM, and multi-agent orchestration
34-
- full MCP runtime integration from `mcp.json`
38+
- richer hook actions and approval policy for `hooks.yml` / `hooks.json`
3539

3640
## Documentation map
3741

docs/limitations.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,20 @@ Not implemented yet:
2424

2525
## Config gaps
2626

27-
These surfaces exist but are not yet fully active:
27+
These surfaces still exist, but are not yet full runtime bootstrap surfaces:
2828

2929
- `agents.json`
30-
- `mcp.json`
3130

32-
They can be loaded and validated, but they do not yet drive a complete runtime bootstrap.
31+
`mcp.yml` / `mcp.json` is active and builds native MCP capabilities, but still has current limits:
32+
33+
- approval policy is not yet wired into MCP tool calls
34+
- collision strategy still relies on explicit prefixes when needed
35+
- there is no richer agent-level MCP orchestration yet
36+
37+
`hooks.yml` / `hooks.json` is active for command hooks, but still limited:
38+
39+
- no approval layer for hook commands yet
40+
- no richer hook action types beyond command execution
3341

3442
## Approval gaps
3543

docs/llms.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,15 @@ The repository currently contains a working bare ACP agent skeleton, not a full
2121
- `list_files`
2222
- `read_file`
2323
- `write_file`
24+
- capability-first runtime assembly with native `pydantic-ai` capabilities
25+
- mode-aware filesystem visibility via `PrepareTools`
26+
- MCP capability wiring from `.vcode/mcp.yml`
2427
- session-scoped write approvals
2528
- ACP permission prompts with structured diff previews for file writes
2629
- `.vcode/.vcodeignore` support for read and list filtering
30+
- YAML-first `.vcode/mcp.yml` with JSON fallback
31+
- YAML-first `.vcode/hooks.yml` with JSON fallback
32+
- hook command execution via `pydantic-ai Hooks`
2733

2834
## Important constraints
2935

@@ -39,7 +45,7 @@ The repository currently contains a working bare ACP agent skeleton, not a full
3945
- workspace regex/text search
4046
- web search and scraping as built-in tools
4147
- Python lint/test/typecheck tool loop
42-
- full MCP runtime consumption from `mcp.json`
48+
- richer hook actions and approval policy for `hooks.yml` / `hooks.json`
4349
- subagents, CodeMode, RLM, and multi-agent orchestration
4450

4551
## Repo structure

0 commit comments

Comments
 (0)