Documentation
¶
Overview ¶
Package forgecore provides a high-level API surface for embedding Forge's compiler, validator, and runtime engine as a library.
This is the primary entry point for external consumers (e.g. Command) who want to use Forge's capabilities without importing CLI dependencies.
Index ¶
- func NewRuntime(cfg RuntimeConfig) *runtime.LLMExecutor
- func SimulateImport(spec *agentspec.AgentSpec) *validate.ImportSimResult
- func ValidateAgentSpec(jsonData []byte) ([]string, error)
- func ValidateCommandCompat(spec *agentspec.AgentSpec) *validate.ValidationResult
- func ValidateConfig(cfg *types.ForgeConfig) *validate.ValidationResult
- type CompileRequest
- type CompileResult
- type RuntimeConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRuntime ¶
func NewRuntime(cfg RuntimeConfig) *runtime.LLMExecutor
NewRuntime creates a new LLMExecutor configured for agent execution.
func SimulateImport ¶
func SimulateImport(spec *agentspec.AgentSpec) *validate.ImportSimResult
SimulateImport simulates what Command's import API would produce from an AgentSpec.
func ValidateAgentSpec ¶
ValidateAgentSpec validates raw JSON bytes against the AgentSpec v1.0 schema.
func ValidateCommandCompat ¶
func ValidateCommandCompat(spec *agentspec.AgentSpec) *validate.ValidationResult
ValidateCommandCompat checks an AgentSpec against Command platform requirements.
func ValidateConfig ¶
func ValidateConfig(cfg *types.ForgeConfig) *validate.ValidationResult
ValidateConfig checks a ForgeConfig for errors and warnings.
Types ¶
type CompileRequest ¶
type CompileRequest struct {
Config *types.ForgeConfig
PluginConfig *plugins.AgentConfig // optional framework plugin config
SkillEntries []contract.SkillEntry // optional skill entries
}
CompileRequest contains the inputs for compiling a ForgeConfig into an AgentSpec.
type CompileResult ¶
type CompileResult struct {
Spec *agentspec.AgentSpec
CompiledSkills *contract.CompiledSkills // nil if no skills
EgressConfig *security.EgressConfig
Allowlist []byte // JSON-encoded allowlist
}
CompileResult contains the outputs of a successful compilation.
func Compile ¶
func Compile(req CompileRequest) (*CompileResult, error)
Compile transforms a ForgeConfig into a fully-resolved AgentSpec with security configuration, skill compilation, and optional plugin merging.
type RuntimeConfig ¶
type RuntimeConfig struct {
LLMClient llm.Client
Tools runtime.ToolExecutor
Hooks *runtime.HookRegistry
SystemPrompt string
MaxIterations int
Guardrails runtime.GuardrailChecker // optional
Logger runtime.Logger // optional
}
RuntimeConfig configures the LLM agent runtime.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package a2a provides shared types for the Agent-to-Agent (A2A) protocol.
|
Package a2a provides shared types for the Agent-to-Agent (A2A) protocol. |
|
Package auth provides bearer-token authentication for the A2A server, built around a pluggable Provider chain.
|
Package auth provides bearer-token authentication for the A2A server, built around a pluggable Provider chain. |
|
providers/aws_sigv4
Package aws_sigv4 authenticates AWS-IAM callers using the pre-signed URL pattern.
|
Package aws_sigv4 authenticates AWS-IAM callers using the pre-signed URL pattern. |
|
providers/azure_ad
Package azure_ad authenticates Microsoft Entra ID (Azure AD) tokens.
|
Package azure_ad authenticates Microsoft Entra ID (Azure AD) tokens. |
|
providers/gcp_iap
Package gcp_iap authenticates requests that come through GCP's Identity-Aware Proxy.
|
Package gcp_iap authenticates requests that come through GCP's Identity-Aware Proxy. |
|
providers/httpverifier
Package httpverifier implements the legacy external auth provider: POST a JSON envelope to a verifier URL and trust its response.
|
Package httpverifier implements the legacy external auth provider: POST a JSON envelope to a verifier URL and trust its response. |
|
providers/oidc
Package oidc implements an auth.Provider that verifies JWT bearer tokens against an OpenID Connect issuer.
|
Package oidc implements an auth.Provider that verifies JWT bearer tokens against an OpenID Connect issuer. |
|
providers/statictoken
Package statictoken implements a Provider that matches the presented bearer token against a single expected value using constant-time comparison.
|
Package statictoken implements a Provider that matches the presented bearer token against a single expected value using constant-time comparison. |
|
Package catalog is the single source of truth for the option lists offered when configuring an agent: LLM providers (and their models), messaging channels, and authentication modes.
|
Package catalog is the single source of truth for the option lists offered when configuring an agent: LLM providers (and their models), messaging channels, and authentication modes. |
|
Package channels defines the channel adapter architecture for exposing self-hosted agents via messaging platforms like Slack and Telegram.
|
Package channels defines the channel adapter architecture for exposing self-hosted agents via messaging platforms like Slack and Telegram. |
|
Package compiler provides pure functions for generating and transforming AgentSpec data.
|
Package compiler provides pure functions for generating and transforming AgentSpec data. |
|
Package compress wires reversible context compression (ctxzip) into the forge agent loop.
|
Package compress wires reversible context compression (ctxzip) into the forge agent loop. |
|
Package credentials implements governance R9 — Just-In-Time credential dispensing for per-action least privilege.
|
Package credentials implements governance R9 — Just-In-Time credential dispensing for per-action least privilege. |
|
static
Package static is the reference no-op Credential provider for governance R9.
|
Package static is the reference no-op Credential provider for governance R9. |
|
sts
Package sts is the AWS STS AssumeRole reference provider for governance R9 (JIT credential dispensing).
|
Package sts is the AWS STS AssumeRole reference provider for governance R9 (JIT credential dispensing). |
|
Package export provides pure logic for building Command platform export envelopes.
|
Package export provides pure logic for building Command platform export envelopes. |
|
Package llm provides canonical types for LLM chat interactions.
|
Package llm provides canonical types for LLM chat interactions. |
|
providers
Package providers implements LLM client providers for various APIs.
|
Package providers implements LLM client providers for various APIs. |
|
Package mcp implements Forge's Model Context Protocol client.
|
Package mcp implements Forge's Model Context Protocol client. |
|
Package memory provides long-term agent memory with file-based storage, vector search, and hybrid retrieval.
|
Package memory provides long-term agent memory with file-based storage, vector search, and hybrid retrieval. |
|
Package observability constructs the real OTLP tracer provider Forge hands to the runtime seam in forge-core/runtime/tracing.go.
|
Package observability constructs the real OTLP tracer provider Forge hands to the runtime seam in forge-core/runtime/tracing.go. |
|
Package packaging provides bin classification, base image selection, and Dockerfile generation for container packaging of Forge agents.
|
Package packaging provides bin classification, base image selection, and Dockerfile generation for container packaging of Forge agents. |
|
Package pipeline provides a sequential stage-based execution pipeline.
|
Package pipeline provides a sequential stage-based execution pipeline. |
|
Package plugins provides a plugin registry and hook system for Forge.
|
Package plugins provides a plugin registry and hook system for Forge. |
|
Package scheduler provides a cron-based task scheduler for Forge agents.
|
Package scheduler provides a cron-based task scheduler for Forge agents. |
|
Package secrets provides a provider-based secret management system.
|
Package secrets provides a provider-based secret management system. |
|
Package security provides egress security resolution for containerized agents.
|
Package security provides egress security resolution for containerized agents. |
|
authgate
Package authgate implements the AARM R10 auth-required gate — the pause-and-resume primitive behind delegated MCP consent (#330).
|
Package authgate implements the AARM R10 auth-required gate — the pause-and-resume primitive behind delegated MCP consent (#330). |
|
deferpolicy
Package defer implements governance R4c — the DEFER authorization decision.
|
Package defer implements governance R4c — the DEFER authorization decision. |
|
intent
Package intent implements governance R3 — the intent-alignment policy check.
|
Package intent implements governance R3 — the intent-alignment policy check. |
|
stepup
Package stepup implements governance R4b — the STEP_UP authorization decision.
|
Package stepup implements governance R4b — the STEP_UP authorization decision. |
|
Package tools provides the tool plugin system for Forge agents.
|
Package tools provides the tool plugin system for Forge agents. |
|
adapters
Package adapters provides tools that call out to external systems.
|
Package adapters provides tools that call out to external systems. |
|
builtins
Package builtins provides built-in tools available to all agents.
|
Package builtins provides built-in tools available to all agents. |
|
Package types holds configuration types for forge.yaml.
|
Package types holds configuration types for forge.yaml. |
|
Package util provides shared utility functions.
|
Package util provides shared utility functions. |
|
process
Package process provides small, platform-aware utilities for interacting with OS processes by PID.
|
Package process provides small, platform-aware utilities for interacting with OS processes by PID. |
|
Package validate provides JSON Schema validation for Forge specifications.
|
Package validate provides JSON Schema validation for Forge specifications. |