Documentation
¶
Index ¶
- Constants
- func APIKey(relative string) string
- func AgentDefinitionKey(id string) string
- func BuildID(root string, routes []Route) (string, error)
- func BuildSnapshot(root string) (map[string]string, error)
- func DiscoverMiddlewareSource(root string) (string, error)
- func Generate(root, buildRoot string, check bool) error
- func SyncGoSources(root string, routes []Route, check bool) error
- func WorkflowDefinitionKey(id string) string
- func WorkflowQueueKey(id string) string
- func Write(root string, routes []Route, buildID string, check bool) error
- type AgentDefinition
- type AgentManifestDefinition
- type AgentManifestTool
- type AgentSlots
- type AgentToolDefinition
- type AgentsManifest
- type Manifest
- type Route
- type WorkflowDefinition
- type WorkflowManifestDefinition
- type WorkflowManifestQueue
- type WorkflowQueue
- type WorkflowsManifest
Constants ¶
const ( AgentModeDirect = "direct" AgentModeDurable = "durable" AgentKindHandler = "handler" AgentKindAI = "ai" )
const ( WorkflowKind = "workflow" ActivityKind = "activity" DefaultWorkflowQueueID = gb.DefaultTaskQueueID )
const GeneratedDir = "generated"
GeneratedDir is the website-relative directory owned by gobeyond for projections, registries, contracts, and generated process mains. Authors write app/, workflows/, agents/, and internal/ only.
Must not start with "." or "_": Go ignores those directory names when matching package patterns, and import paths under them break normal `go build` / `go test` workflows.
const LegacyGeneratedDir = "internal/gobeyondgen"
LegacyGeneratedDir is the pre-alpha.11 projection root; SyncGoSources removes it.
Variables ¶
This section is empty.
Functions ¶
func APIKey ¶
APIKey returns the deterministic, Go-safe generated package directory for a co-located app/api route. The input is relative to app/api.
func AgentDefinitionKey ¶
AgentDefinitionKey returns the deterministic generated package key for an agent.
func BuildSnapshot ¶
BuildSnapshot records the same source files used by BuildID, keyed by their slash-normalized path relative to root. Development mode uses it to identify which build products a source edit can affect.
func DiscoverMiddlewareSource ¶
DiscoverMiddlewareSource returns the one supported authored middleware entry. GoBeyond middleware is a root middleware.ts or middleware.js default export; the compiler rejects legacy Go and edge-middleware layouts so one application never has two request-middleware contracts.
func SyncGoSources ¶
SyncGoSources projects route-owned Go into import-safe generated packages. Authored app directories remain editor inputs and are never imported by the production server.
func WorkflowDefinitionKey ¶
func WorkflowQueueKey ¶
Types ¶
type AgentDefinition ¶
type AgentDefinition struct {
ID string
Key string
Kind string
Mode string
TaskQueue string
TaskQueueSet bool
Durable bool
Realtime bool
Public bool
Model string
MaxSteps int
Instructions string
Revision string
SourceDir string
EntryFile string
PackageName string
Handler string
InputType string
OutputType string
SourceFiles []string
Slots AgentSlots
Tools []AgentToolDefinition
}
AgentDefinition is the compiler-visible model for agents/<id>/agent.go. It intentionally records slots even though this slice does not yet bind their provider implementations or generate execution wiring.
func DiscoverAgentDefinitions ¶
func DiscoverAgentDefinitions(root string) ([]AgentDefinition, error)
DiscoverAgentDefinitions validates and discovers top-level agent packages. Each agent is an isolated package under agents/<id>/ with agent.go as its declaration entry point; supporting Go files may live beside it.
type AgentManifestDefinition ¶
type AgentManifestDefinition struct {
ID string `json:"id"`
Kind string `json:"kind"`
Mode string `json:"mode"`
TaskQueue string `json:"taskQueue,omitempty"`
TaskQueues []string `json:"taskQueues,omitempty"`
Durable bool `json:"durable"`
Realtime bool `json:"realtime"`
Public bool `json:"public"`
Model string `json:"model,omitempty"`
MaxSteps int `json:"maxSteps,omitempty"`
Revision string `json:"revision,omitempty"`
Slots AgentSlots `json:"slots"`
Tools []AgentManifestTool `json:"tools"`
}
type AgentManifestTool ¶
type AgentSlots ¶
type AgentSlots struct {
Tools []string `json:"tools"`
Skills []string `json:"skills"`
Subagents []string `json:"subagents"`
Schedules []string `json:"schedules"`
Channels []string `json:"channels"`
}
AgentSlots contains all author-visible extension references.
type AgentToolDefinition ¶
type AgentToolDefinition struct {
ID string `json:"id"`
Variable string `json:"-"`
TaskQueue string `json:"taskQueue,omitempty"`
TaskQueueSet bool `json:"-"`
}
AgentToolDefinition is the compiler-visible execution metadata for one DefineAI tool. Variable is retained only for source validation; manifests expose the stable map key and resolved logical queue.
type AgentsManifest ¶
type AgentsManifest struct {
APIVersion string `json:"apiVersion"`
BuildID string `json:"buildId"`
Agents []AgentManifestDefinition `json:"agents"`
}
func LoadAgentsManifest ¶
func LoadAgentsManifest(root string) (AgentsManifest, error)
LoadAgentsManifest reads the compiler-owned portable agent deployment projection. Build copies this validated value to dist/deploy/agents.json.
type Manifest ¶
type Manifest struct {
APIVersion string `json:"apiVersion"`
BuildID string `json:"buildId"`
Routes []Route `json:"routes"`
}
func LoadManifest ¶
type Route ¶
type Route struct {
ID string `json:"id"`
Pattern string `json:"pattern"`
Mode string `json:"mode"`
Reason string `json:"reason"`
AppDir string `json:"appDir"`
ServerKey string `json:"serverKey"`
PageFile string `json:"pageFile"`
SchemaFile string `json:"schemaFile,omitempty"`
BuildFile string `json:"buildFile,omitempty"`
ServerFile string `json:"serverFile,omitempty"`
PlanFile string `json:"planFile"`
ClientEntry string `json:"clientEntry"`
}
type WorkflowDefinition ¶
type WorkflowDefinition struct {
ID string
Key string
Kind string
Name string
TaskQueue string
SourceDir string
EntryFile string
PackageName string
ParentID string
Handler string
Public bool
Standalone bool
SourceFiles []string
InputType string
OutputType string
HandlerHasInput bool
HandlerHasOutput bool
}
WorkflowDefinition describes one compiler-owned definition in workflows/. A definition maps to one Go package; queue workers may register several definitions from different packages.
func DiscoverWorkflowDefinitions ¶
func DiscoverWorkflowDefinitions(root string) ([]WorkflowDefinition, error)
DiscoverWorkflowDefinitions validates and discovers the authored workflow tree. Legacy workers/ is intentionally a hard error for the new contract.
type WorkflowManifestQueue ¶
type WorkflowQueue ¶
type WorkflowQueue struct {
ID string
Key string
Definitions []WorkflowDefinition
Agents []AgentDefinition
}
WorkflowQueue is one logical Temporal task queue and the definitions that the generated poller registers on it.
func GroupWorkerQueues ¶
func GroupWorkerQueues(definitions []WorkflowDefinition, agents []AgentDefinition) []WorkflowQueue
GroupWorkerQueues combines authored workflows and durable agents by their effective logical Temporal task queue. Direct agents never create pollers.
func GroupWorkflowQueues ¶
func GroupWorkflowQueues(definitions []WorkflowDefinition) []WorkflowQueue
type WorkflowsManifest ¶
type WorkflowsManifest struct {
APIVersion string `json:"apiVersion"`
Definitions []WorkflowManifestDefinition `json:"definitions"`
TaskQueues []WorkflowManifestQueue `json:"taskQueues"`
}