Commit graph

189 commits

Author SHA1 Message Date
Virgil
91e41615d1 feat(mcp): implement HTTP resource reads
Add support for plans://, sessions://, and content:// resources via the MCP API controller instead of returning 501 for every request.\n\nCo-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 12:30:07 +00:00
Virgil
981ad9f7da feat(mcp): fan out bridge observers for brain recall
Allow the IDE bridge to register multiple observers so the IDE and brain subsystems can both react to inbound Laravel messages. Brain recall notifications now fire from the bridge callback with the real result count instead of the request path, and the brain provider follows the same async notification flow.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 12:22:13 +00:00
Virgil
e138af6635 feat(agentic): add watch, mirror, and review queue tools
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 12:16:17 +00:00
Virgil
e40b05c900 feat(mcp): emit test result channel notifications
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 12:09:41 +00:00
Virgil
f62c9c924d fix(mcp): close TCP sessions on handler exit
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 12:03:20 +00:00
Virgil
ca9d879b21 feat(mcp): forward process output notifications
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 11:59:05 +00:00
Virgil
2df8866404 feat(mcp): forward process lifecycle actions to channel notifications
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 11:53:44 +00:00
Virgil
d57f9d4039 refactor(mcp): remove empty runtime options DTO
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 11:46:09 +00:00
Virgil
dcd3187aed feat(agentic): add plan status alias and safer reads
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 11:36:20 +00:00
Virgil
dd33bfb691 refactor(mcp): centralize notification channel names
Keep channel emitters, provider metadata, and capability advertising in sync by sharing the same constants across the MCP subsystems.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 11:28:49 +00:00
Virgil
d5a76bf2c7 feat(agentic): emit harvest completion notifications
Tighten MCP session notification dispatch and add coverage for harvest.complete payloads.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 11:21:02 +00:00
Virgil
ed4efcbd55 feat(ide): emit build start lifecycle notifications
Advertise and emit build.start when a bridged build enters a running state, alongside the existing complete/fail lifecycle events.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 11:14:17 +00:00
Virgil
dd48cc16f8 feat(ide): emit build lifecycle notifications
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 11:09:55 +00:00
Virgil
dd01f366f2 feat(agentic): add plan checkpoint tool
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 11:05:37 +00:00
Virgil
e62f4ab654 fix(mcp): resolve workspace paths for tools
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 11:01:11 +00:00
Virgil
45d439926f feat(ide): add local build and dashboard state
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 10:54:31 +00:00
Virgil
b96b05ab0b fix(mcp): stabilise file existence checks
Use Stat() for file_exists and sort directory listings for deterministic output.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 10:48:34 +00:00
Virgil
599d0b6298 feat(brain): add direct list support
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 10:43:54 +00:00
Virgil
b82d399349 refactor(mcp): centralize channel capability names
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 10:40:40 +00:00
Virgil
0516e51db8 feat(agentic): emit workspace lifecycle notifications
Wire the agentic subsystem into the shared MCP notifier so workspace
completion, blocked, and status transitions are broadcast to clients.
Also keep resumed workspaces from leaving stale running state after the
process exits.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 10:35:58 +00:00
Virgil
bf3ef9f595 fix(mcp): broadcast notifications without log gating
Use the underlying MCP notification path for session broadcasts so fresh sessions receive notifications without requiring a prior log-level handshake.

Add a regression test that verifies broadcast delivery on a connected session.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 10:31:39 +00:00
Virgil
a34115266c fix(mcp): return local IDE state without bridge
Headless IDE sessions now keep working for chat history, session listing, session creation, plan status, dashboard activity, dashboard metrics, and build lookups. The Laravel bridge is still used when available, but it is no longer a hard dependency for the local cache-backed tools.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 10:25:29 +00:00
Virgil
76d351d8a4 feat(mcp): persist IDE session state locally
Generate real session IDs and retain chat/activity/session state in the IDE subsystem so session_create, chat_history, session_list, and dashboard tools return useful local data before the backend responds.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 10:19:29 +00:00
Virgil
c3a449e678 fix(mcp): add session notification helper
Use the Core context for forwarded IPC channel events and expose a session-level notification helper that the broadcast path reuses. This keeps the notification API more symmetric and avoids dropping context during IPC forwarding.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 10:12:35 +00:00
Virgil
a541c95dc8 feat(mcp): align language catalog with detector
Expose all languages already recognized by lang_detect in lang_list, and keep the two paths synchronized through a shared catalog.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 10:09:04 +00:00
Virgil
116df41200 feat(mcp): honor graceful process stop and webview wait timeout
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 10:05:07 +00:00
Virgil
53fffbd96a feat(agentic): add issue dispatch tools
Implement agentic_dispatch_issue and agentic_pr for Forge issue-driven workflows, and track issue-specific branch metadata in agent workspaces.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 07:58:29 +00:00
Virgil
faf9490e7f feat(mcp): wire optional core services in Register
Auto-discovers process.Service and ws.Hub instances already registered in Core so the MCP service factory exposes the matching tool groups without extra manual wiring.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 07:53:06 +00:00
Virgil
aa1146807e fix(mcp): emit claude/channel notifications directly
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 07:47:38 +00:00
Virgil
27107cd75e fix(mcp): enforce REST bridge body limit
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 07:39:19 +00:00
Virgil
6adf61e593 fix(mcp): allow unauthenticated HTTP transport when token is unset
Treat an empty MCP_AUTH_TOKEN as local development mode and pass requests through to /mcp. Add tests for the no-token path and update the empty-token unit case accordingly.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 07:35:35 +00:00
Virgil
7b22fd3141 refactor(mcp): remove unused registry iterator helper
Keeps the registry surface tighter by removing the unused splitTagSeq helper and updating the test to cover the production splitTag helper directly.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 07:29:59 +00:00
Virgil
bfb5bf84e2 feat(mcp): register built-in tool groups
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 07:25:48 +00:00
Virgil
20caaebc21 Add describe_table MCP tool 2026-04-01 09:55:50 +00:00
Virgil
a45bc388b5 feat(mcp): advertise brain list completion channel 2026-04-01 07:37:23 +00:00
Virgil
6d45f87e26 refactor(mcp): assert notifier conformance
Aligns the service with the AX preference for explicit interface contracts.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-31 18:18:16 +00:00
Virgil
9bdd44d9b6 fix(mcp): advertise process.start in channel capability
Sync the claude/channel capability list with the process lifecycle events emitted by the service.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-31 18:13:27 +00:00
Virgil
102097222d refactor(mcp): remove dead stdio transport state
Drop the unused stdioMode field, route Run() through ServeStdio(), and keep startup logging on the service logger.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-31 18:08:03 +00:00
Virgil
17280b0aed refactor(mcp): remove deprecated coreRef state
Align the MCP service runtime with the AX service model by dropping the unused coreRef escape hatch and relying on ServiceRuntime for Core access.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-31 18:04:50 +00:00
Virgil
985bc2017f refactor(mcp): align AX DTO defaults and IDE config
Normalize the MCP constructor workspace defaulting to use the actual working directory, and replace the IDE subsystem's functional options with a Config DTO so the codebase stays aligned with AX-style configuration objects.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-31 18:02:16 +00:00
Virgil
5177dc391b docs(mcp): refresh AX migration notes and options references 2026-03-30 07:52:58 +00:00
Virgil
ea8478b776 feat(mcp): align channel notifications with AX notifier flow 2026-03-30 05:48:11 +00:00
Snider
014c18e563 fix(mcp): set stdioMode in ServeStdio + use shared locked writer
ServeStdio never set stdioMode=true, so ChannelSend always returned
early. Also switched from StdioTransport to IOTransport with a shared
lockedWriter that both the SDK and ChannelSend write through.

This fixes channel notifications not arriving in Claude Code sessions.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-26 12:22:53 +00:00
Snider
c8089fd597 fix(mcp): use shared locked writer for channel notifications
ChannelSend was writing to os.Stdout directly while the SDK's
StdioTransport also writes to os.Stdout — causing interleaved
JSON-RPC messages. Now both use a shared lockedWriter via IOTransport.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-26 12:22:53 +00:00
Snider
3ece6656d2 feat(mcp): add ChannelPush IPC message + HandleIPCEvents
Services can now push channel events to Claude Code by sending a
ChannelPush message via Core IPC. The MCP service catches it in
HandleIPCEvents and calls ChannelSend to the stdio transport.

- ChannelPush{Channel, Data} message type in subsystem.go
- HandleIPCEvents on Service catches ChannelPush → ChannelSend
- Enables runner→mcp→Claude Code notification pipeline

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-26 12:22:53 +00:00
Snider
c68698fc5c deps: bump dappco.re/go/core to v0.8.0-alpha.1
Resolves build failures from using Core primitives (JSONMarshalString,
JSONUnmarshal, ReadAll, ServiceRuntime, etc.) that didn't exist in v0.4.7.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-26 12:22:46 +00:00
Snider
63dab254bf fix: ide/bridge.go — remove encoding/json
json.Marshal → core.JSONMarshalString
json.Unmarshal → core.JSONUnmarshal

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-26 12:22:46 +00:00
Snider
83bcb1e5e1 fix: bridge.go — remove encoding/json entirely
Error classification uses string match on unmarshal errors instead of
stdlib json.SyntaxError/UnmarshalTypeError type assertions. No exceptions.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-26 12:22:46 +00:00
Snider
3d3deb1bf5 fix: bridge.go — io.ReadAll → core.ReadAll, errors.As → core.As
encoding/json stays for SyntaxError/UnmarshalTypeError type assertions.
net/http stays — transport boundary.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-26 12:22:46 +00:00
Snider
0e38e3a7f0 feat: AX quality gate — eliminate disallowed imports from production code
- mcp.go: os/filepath/strings → core.Env, core.JoinPath, core.PathExt,
  core.PathBase, core.Contains, core.Replace + local helpers
- registry.go: encoding/json/strings → core.JSONUnmarshal, core.Split
- notify.go: encoding/json → core.JSONMarshalString
- tools_metrics.go: fmt/strings → core.Sprintf, core.Trim
- tools_rag.go: fmt → core.Sprintf
- tools_webview.go: fmt → core.Sprintf
- tools_ws.go: fmt → core.Sprintf

Transport files (http/tcp/unix/stdio) retain os/net/http — boundary code.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-26 12:22:27 +00:00