Documentation
¶
Index ¶
Constants ¶
const MaxWireBodyBytes = 8 << 20 // 8 MiB
MaxWireBodyBytes caps the request body a daemon HTTP handler will read into memory. It is generous for real payloads - a unified diff, a patch, a review remark - but bounds an authenticated or LAN-reachable client (a connector-token MCP client, a share viewer) so a multi-gigabyte POST cannot exhaust daemon memory. The proc socket path caps its frames separately (internal/proc).
Variables ¶
This section is empty.
Functions ¶
func AllowGet ¶ added in v0.4.0
func AllowGet(w http.ResponseWriter, r *http.Request) bool
AllowGet answers a CORS preflight (204) and rejects non-GET methods (405), returning false when the caller should stop.
Here rather than beside any one route: every read handler in every handler package applies the same gate, and the copy that lived next to the insight route was the one six unrelated files reached across for.
func LimitRequestBody ¶ added in v0.4.0
func LimitRequestBody(w http.ResponseWriter, r *http.Request)
LimitRequestBody caps r.Body at MaxWireBodyBytes so a later decode fails once the body exceeds the cap instead of reading an unbounded stream. Call it before reading the body.
func WriteJSON ¶ added in v0.4.0
func WriteJSON(w http.ResponseWriter, v any)
WriteJSON marshals v and writes it as an uncached JSON body, matching the read handlers' no-store posture: these reads reflect live daemon state.
Types ¶
type Base ¶
Base is the embedded core of every HTTP route handler: the http.Handler that actually serves the route, plus a request-scoped logger the handler can use. Embedding it makes each handler a concrete named type (not a bare interface) that callers can hold, reference, and log through. Construct it with New so the logger is never nil.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package activity is the console-facing ActivityService handler: it lists recent activity events (newest first, filtered) and serves a payload blob by ref for the /dashboard and log viewer.
|
Package activity is the console-facing ActivityService handler: it lists recent activity events (newest first, filtered) and serves a payload blob by ref for the /dashboard and log viewer. |
|
Package diff serves the review session's plain-JSON routes under /api/v1/diff.
|
Package diff serves the review session's plain-JSON routes under /api/v1/diff. |
|
Package graph holds the graph surfaces the daemon serves and the magus.graph.v1alpha1 wire mapping behind them: the GET /api/v1/graph route (a bulk subgraph document) and the GraphService RPCs (ranked retrieval - query, resolve, explain, path, stats).
|
Package graph holds the graph surfaces the daemon serves and the magus.graph.v1alpha1 wire mapping behind them: the GET /api/v1/graph route (a bulk subgraph document) and the GraphService RPCs (ranked retrieval - query, resolve, explain, path, stats). |
|
Package insight is the console-facing InsightService handler: it serves every insight lens (the four VCS-history lenses from one cached git-log scan, plus the run-outcome volatility lens folded in fresh) as the magus.insight.v1alpha1 wire type.
|
Package insight is the console-facing InsightService handler: it serves every insight lens (the four VCS-history lenses from one cached git-log scan, plus the run-outcome volatility lens folded in fresh) as the magus.insight.v1alpha1 wire type. |
|
Package job is the console-facing JobService handler: the daemon's CONTROL surface, the mutating sibling of the read-only activity/status/viewer handlers.
|
Package job is the console-facing JobService handler: the daemon's CONTROL surface, the mutating sibling of the read-only activity/status/viewer handlers. |
|
Package mcp implements the MCP (Model Context Protocol) server for magus.
|
Package mcp implements the MCP (Model Context Protocol) server for magus. |
|
origin
Package origin carries agent origin metadata across goroutines via context.
|
Package origin carries agent origin metadata across goroutines via context. |
|
Package memory is the console-facing MemoryService handler: an observable, editable view over the durable handoff-journal entries the MCP magus_memory tool writes.
|
Package memory is the console-facing MemoryService handler: an observable, editable view over the durable handoff-journal entries the MCP magus_memory tool writes. |
|
Package metrics is the daemon's derived-dashboard presentation layer for magus's OTel metrics.
|
Package metrics is the daemon's derived-dashboard presentation layer for magus's OTel metrics. |
|
Package notes is the console-facing NotesService handler: a READ-ONLY view over the workspace's human-authored notes, both the shared store in the checkout and the private one on this machine.
|
Package notes is the console-facing NotesService handler: a READ-ONLY view over the workspace's human-authored notes, both the shared store in the checkout and the private one on this machine. |
|
Package status maps the live status report onto the magus.status.v1alpha1 wire message and base64-encodes it for the dashboard's SSE stream.
|
Package status maps the live status report onto the magus.status.v1alpha1 wire message and base64-encodes it for the dashboard's SSE stream. |
|
Package token is the console-facing TokenService handler: the typed management surface for the daemon's auth tokens.
|
Package token is the console-facing TokenService handler: the typed management surface for the daemon's auth tokens. |
|
Package tool serves the toolchain view: every binary a workspace's spells drive, the version each one reported, and the window it is held to.
|
Package tool serves the toolchain view: every binary a workspace's spells drive, the version each one reported, and the window it is held to. |
|
Package trailrpc is the audit interceptor for the daemon's Connect services: a connect.Interceptor that records MUTATING unary RPCs to the activity trail by construction, so auditing a state change is a structural default of the mount rather than a per-handler line a developer must remember to add.
|
Package trailrpc is the audit interceptor for the daemon's Connect services: a connect.Interceptor that records MUTATING unary RPCs to the activity trail by construction, so auditing a state change is a structural default of the mount rather than a per-handler line a developer must remember to add. |
|
Package viewer holds the magus.viewer.v1alpha1 wire contract: the code that maps captured DOMAIN events onto the versioned protobuf tool-page contract and encodes them for a browser (a URL-fragment blob for a finished run, or a live SSE stream), plus the viewer's filter DSL.
|
Package viewer holds the magus.viewer.v1alpha1 wire contract: the code that maps captured DOMAIN events onto the versioned protobuf tool-page contract and encodes them for a browser (a URL-fragment blob for a finished run, or a live SSE stream), plus the viewer's filter DSL. |