Commit graph

163 commits

Author SHA1 Message Date
Snider
8f3afaa42a refactor(mcp): migrate stdlib imports to core/go primitives + upgrade go-sdk v1.5.0
- Replace fmt/errors/strings/path/filepath with core.Sprintf, core.E,
  core.Contains, core.Path etc. across 16 files
- Remove 'errors' import from bridge.go (core.Is/core.As)
- Remove 'fmt' from transport_tcp.go, ide.go (core.Print, inline interface)
- Remove 'strings' from notify.go, transport_http.go, tools_webview.go,
  process_notifications.go (core.Trim, core.HasPrefix, core.Lower etc.)
- Upgrade go-sdk from v1.4.1 to v1.5.0
- Keep encoding/json for json.NewDecoder/MarshalIndent (no core equivalent)
- Keep os/exec in agentic subsystem (needs go-process Action wiring)

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-08 22:03:52 +01:00
Snider
f8f137b465 fix(mcp): disable ListChanged to prevent premature stdio notifications
The go-sdk fires notifications/tools/list_changed and
notifications/resources/list_changed with 10ms delay after AddTool/AddResource.
Since all registration happens before server.Run(), these hit stdout
before the client sends initialize, breaking the MCP handshake.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-08 20:50:46 +01:00
Snider
429f1c2b6c Revert "perf(mcp): gate extended built-in tools behind CORE_MCP_FULL"
This reverts commit 9f7dd84d4a.
2026-04-08 20:47:34 +01:00
Snider
9f7dd84d4a perf(mcp): gate extended built-in tools behind CORE_MCP_FULL
Metrics, RAG, and webview tools only register when CORE_MCP_FULL=1.
Process and WS tools always register (used by factory).
Reduces default tool count by 15.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-08 19:17:32 +01:00
Snider
9bd3084da4 fix(mcp): bridge test body + process dep resolution
- Fix TestBridgeToAPI_Good_EndToEnd: POST with empty JSON body instead of nil
- Add local replace for go-process to resolve API drift with core v0.8.0

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-08 16:39:28 +01:00
Snider
20e4a381cf fix: migrate module paths from forge.lthn.ai to dappco.re
Update all import paths and version pins:
- forge.lthn.ai/core/go-* → dappco.re/go/core/*
- forge.lthn.ai/core/api → dappco.re/go/core/api
- forge.lthn.ai/core/cli → dappco.re/go/core/cli
- Updated: api v0.3.0, cli v0.5.2, ai v0.2.2, io v0.4.1, log v0.1.2
- Updated: process v0.5.0, rag v0.1.13, ws v0.4.0, webview v0.2.1
- Updated: i18n v0.2.3, inference v0.3.0, scm v0.6.1

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-07 12:59:22 +01:00
Virgil
0b63f9cd22 fix(mcp): harden tool handlers 2026-04-02 18:50:20 +00:00
Virgil
ab1aa0cad0 refactor(mcp): align REST bridge errors with AX 2026-04-02 18:46:08 +00:00
Virgil
1b3d102684 refactor(agentic): canonicalize PR input DTO 2026-04-02 18:38:03 +00:00
Virgil
23063599df docs(mcp): clarify channel capability helpers 2026-04-02 18:34:15 +00:00
Virgil
476a699b96 fix(mcp): type REST bridge input errors 2026-04-02 18:29:51 +00:00
Virgil
0bd3f70e20 docs(mcp): align public API comments with AX conventions 2026-04-02 18:26:17 +00:00
Virgil
6e73fb6e8d fix(agentic): preserve issue labels on unlock 2026-04-02 18:23:35 +00:00
Virgil
cf0885389a feat(brain): emit complete bridge notifications 2026-04-02 18:20:25 +00:00
Virgil
8a1efa8f12 refactor(agentic): surface workspace persistence failures 2026-04-02 18:12:16 +00:00
Virgil
583abea788 refactor(agentic): write workspace files atomically 2026-04-02 18:07:53 +00:00
Virgil
9f68a74491 docs(mcp): add AX-style usage examples to agentic DTOs 2026-04-02 18:04:32 +00:00
Virgil
954a5e1e98 refactor(mcp): document directory entry paths 2026-04-02 18:01:16 +00:00
Virgil
1373a6d296 refactor(mcp): centralize session broadcast iteration 2026-04-02 17:50:49 +00:00
Virgil
d4de2b4cd7 fix(mcp): make BridgeToAPI nil-safe 2026-04-02 17:45:55 +00:00
Virgil
1c3fe69cbc refactor(mcp): centralise channel capability name 2026-04-02 17:40:08 +00:00
Virgil
c42e7ad050 fix(mcp): harden subsystem interface contracts 2026-04-02 17:35:43 +00:00
Virgil
4732e31b74 refactor(mcp): broadcast notifications from session snapshots 2026-04-02 17:32:23 +00:00
Virgil
6e1a7d7d2a refactor(mcp): expose notification method constants 2026-04-02 17:28:30 +00:00
Virgil
5edaa7ead1 fix(mcp): align webview error handling 2026-04-02 17:23:49 +00:00
Virgil
a3c39ccae7 fix(agentic): release issue lock on dispatch failure 2026-04-02 17:18:55 +00:00
Virgil
1873adb6ae Fix MCP bridge test wiring 2026-04-02 17:14:36 +00:00
Virgil
da30f3144a refactor(mcp): record subsystem tools centrally
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 17:11:16 +00:00
Virgil
a215428df8 feat(mcp): add client notification aliases 2026-04-02 17:03:11 +00:00
Virgil
b6aa33a8e0 feat(mcp): improve tool schema generation 2026-04-02 16:58:53 +00:00
Virgil
c83df5f113 feat(agentic): surface workspace metadata in status output 2026-04-02 16:50:50 +00:00
Virgil
4ab909f391 docs(mcp): add usage examples to agentic DTOs 2026-04-02 14:54:37 +00:00
Virgil
ffcd05ea1f chore(mcp): restore SPDX headers in public Go files
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 14:48:46 +00:00
Virgil
555f9ec614 refactor(mcp): expose channel callback subsystem contract
Make the func-based channel wiring contract explicit instead of relying on an anonymous interface inside New(). This keeps the extension point discoverable and aligned with the repository's AX-style API clarity.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 14:43:06 +00:00
Virgil
94cf1c0ba7 fix(mcp): harden notification metadata and logging
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 14:36:33 +00:00
Virgil
fa9a5eed28 refactor(mcp): add typed channel capability helper
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 14:30:04 +00:00
Virgil
af3cf3c8e3 docs(mcp): add usage examples to remaining public DTOs
Align the IDE bridge and brain subsystem public types with the repo's AX-style comment convention by adding concrete usage examples for bridge messages, DTOs, and helper callbacks.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 14:17:47 +00:00
Virgil
2a4e8b7ba3 fix(mcp): snapshot exposed service slices
Return copies from service accessors and ignore nil subsystems during construction to keep the MCP service API stable and AX-friendly.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 14:10:53 +00:00
Virgil
aae824a4d0 docs(mcp): align notification API docs with AX conventions
Reorder subsystem notification wiring so channel callbacks are available before tool registration, and add usage-example comments to the public notification DTOs and helpers.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 14:06:21 +00:00
Virgil
072a36cb73 test(mcp): cover multi-session notification fanout 2026-04-02 13:57:33 +00:00
Virgil
8b7e0c40a6 fix(mcp): harden session notification dispatch 2026-04-02 13:54:12 +00:00
Virgil
8bc44d83a4 fix(mcp): expose channel capability helpers
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 13:49:35 +00:00
Virgil
d9d452b941 refactor(mcp): share notifier contract in brain subsystem
Remove the duplicate brain-local notifier interface and use the shared pkg/mcp Notifier type directly. Also align stale test comments with the current Options constructor API.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 13:44:59 +00:00
Virgil
12346208cc fix(mcp): wire notifier before subsystem registration
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 13:40:22 +00:00
Virgil
cd60d9030c fix(mcp): normalize tcp defaults and notification context
Make notification broadcasting tolerant of a nil context and make TCP transport fall back to DefaultTCPAddr when no address is supplied.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 13:19:24 +00:00
Virgil
a0caa6918c fix(mcp): make notifications nil-safe
Guard the notification broadcast helpers against nil Service and nil server values so they degrade to no-ops instead of panicking. Add coverage for zero-value and nil-server use.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 13:13:04 +00:00
Virgil
d498b2981a docs(mcp): add usage examples to constructors
Core MCP already implements the RFC-shape functionality; this pass tightens the AX surface by adding usage-example comments to public constructors and config helpers.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 13:06:28 +00:00
Virgil
41f83b52f6 refactor(mcp): align service descriptions with runtime behavior
Update stale MCP service and CLI descriptions so they match the current runtime shape, and log the actual bound TCP address when listening on an ephemeral port.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 13:01:41 +00:00
Virgil
8e77c5e58d feat(mcp): auto-select unix socket transport
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 12:56:30 +00:00
Virgil
e09f3518e0 feat(mcp): enrich process notifications with runtime context
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 12:51:27 +00:00