project

package
v0.1.0-alpha.39 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AgentModeDirect  = "direct"
	AgentModeDurable = "durable"
	AgentKindHandler = "handler"
	AgentKindAI      = "ai"
)
View Source
const (
	WorkflowKind           = "workflow"
	ActivityKind           = "activity"
	DefaultWorkflowQueueID = gb.DefaultTaskQueueID
)
View Source
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.

View Source
const LegacyGeneratedDir = "internal/gobeyondgen"

LegacyGeneratedDir is the pre-alpha.11 projection root; SyncGoSources removes it.

Variables

This section is empty.

Functions

func APIKey

func APIKey(relative string) string

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

func AgentDefinitionKey(id string) string

AgentDefinitionKey returns the deterministic generated package key for an agent.

func BuildID

func BuildID(root string, routes []Route) (string, error)

func BuildSnapshot

func BuildSnapshot(root string) (map[string]string, error)

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

func DiscoverMiddlewareSource(root string) (string, error)

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 Generate

func Generate(root, buildRoot string, check bool) error

func SyncGoSources

func SyncGoSources(root string, routes []Route, check bool) error

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 WorkflowDefinitionKey(id string) string

func WorkflowQueueKey

func WorkflowQueueKey(id string) string

func Write

func Write(root string, routes []Route, buildID string, check bool) error

Write persists deterministic route registries using an already finalized build identity. The build command uses this after hashing compiler outputs.

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 AgentManifestTool struct {
	ID        string `json:"id"`
	TaskQueue string `json:"taskQueue,omitempty"`
}

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

func LoadManifest(root string) (Manifest, error)

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"`
}

func Discover

func Discover(root string) ([]Route, error)

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 WorkflowManifestDefinition

type WorkflowManifestDefinition struct {
	ID         string `json:"id"`
	Name       string `json:"name"`
	Kind       string `json:"kind"`
	ParentID   string `json:"parentId,omitempty"`
	TaskQueue  string `json:"taskQueue"`
	Public     bool   `json:"public"`
	Standalone bool   `json:"standalone,omitempty"`
}

type WorkflowManifestQueue

type WorkflowManifestQueue struct {
	ID          string   `json:"id"`
	Definitions []string `json:"definitions"`
}

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"`
}

Jump to

Keyboard shortcuts

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