api

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package api exposes the §13 application-layer research REST API. It is a thin HTTP server that composes workflow documents, submits them through the Control API v1, and materializes the domain state from observable kernel surfaces. The server is stateless between runs except for the namespace-key → kernel-workflow-id mapping stored in the artifact root.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComposeWorkflowDocument

func ComposeWorkflowDocument(template []byte, goal string, workflowID string, deadline time.Time, budgetOverride *BudgetOverride) ([]byte, error)

ComposeWorkflowDocument renders the template with the concrete goal, deadline, workflow id, user budget override, and per-role/round envelopes. It mirrors the e2e test helpers' substitution pattern (helpers_test.go createResearch) at the object level so envelope strings stay properly JSON-escaped. The caller must validate the output with workflowkernel.DecodeWorkflowSpec before submission to the Control API.

Types

type BudgetOverride

type BudgetOverride struct {
	MaxTasks  int64 `json:"maxTasks,omitempty"`
	MaxTokens int64 `json:"maxTokens,omitempty"`
}

BudgetOverride carries the optional user-supplied budget in a POST /research request (§13). Zero values use the workflow template defaults.

type Server

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

Server routes the application REST API.

func NewServer

func NewServer(control *repository.Client, template []byte, artifactStore *artifact.Filesystem, tenant, namespace string, deadline time.Duration, mappingRoot string) *Server

NewServer builds the application-layer research API. The mapping directory (namespace-key → kernel-workflow-id) is created under mappingRoot on first use so the server survives restarts.

func (*Server) Handler

func (s *Server) Handler() http.Handler

Handler returns the HTTP handler with all routes mounted.

Jump to

Keyboard shortcuts

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