node

package
v0.10.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package node exposes a Fort's local runtime over HTTP so another Fort — the control plane — can dispatch runs to this machine (spec 022). It depends only on core/runtime (the interface); cmd/fort injects the concrete native runtime.

The wire protocol is deliberately small:

POST /api/exec              body: RunSpec JSON
                           -> application/x-ndjson: one RunEvent per line,
                              flushed live, until a terminal exited/error, EOF.
POST /api/exec/{id}/signal  body: raw input  -> HITL stdin injection
POST /api/exec/{id}/cancel                    -> cancel a running remote run

Every route requires "Authorization: Bearer <token>" (constant-time compared): the endpoint runs arbitrary agent CLIs, so it is never left unauthenticated.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server serves the inter-Fort execution endpoint over an injected runtime.

func New

func New(rt runtime.Runtime, token func() string) *Server

New builds a node server over rt. token is read fresh on every request, so the endpoint accepts requests as soon as a token exists — even if it is minted after the server is already mounted (e.g. a mesh invite writing the token into a running daemon). An empty token disables the endpoint (403).

func (*Server) Register

func (s *Server) Register(mux *http.ServeMux)

Register mounts the exec routes onto mux.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL