Documentation
¶
Overview ¶
Package factory wires concrete dependencies for the agent-pi binary.
Index ¶
- Constants
- func CreateAgent(runner pilib.Runner, envContext map[string]string) *agentlib.Agent
- func CreateAgentProvider(runner pilib.Runner, envContext map[string]string) agentlib.AgentProvider
- func CreateFileResultDeliverer(filePath string) agentlib.ResultDeliverer
- func CreateKafkaResultDeliverer(syncProducer libkafka.SyncProducer, topicPrefix base.TopicPrefix, ...) agentlib.ResultDeliverer
- func CreatePiRunner(agentDir string, allowedTools string, model string, env map[string]string, ...) pilib.Runner
- func CreatePiSessionFactory(agentDir string, allowedTools string, model string, env map[string]string) agentlib.SessionFactory
Constants ¶
const AgentTypeService = "service"
AgentTypeService is the AGENT_TYPE value the executor stamps for a Config whose spec.type is service. The executor owns this value — it comes from AgentTypeService in agent-task-executor/k8s/apis/agent.benjamin-borbe.de/v1 — and this side only reads it. The coupling is silent when it breaks: a mismatch means sessions simply stop persisting, with nothing logged.
const ServiceName = "agent-pi"
ServiceName is the canonical service name for the agent-pi binary.
Variables ¶
This section is empty.
Functions ¶
func CreateAgent ¶
CreateAgent assembles the 3-phase pi agent from a pre-constructed Runner.
func CreateAgentProvider ¶
func CreateAgentProvider( runner pilib.Runner, envContext map[string]string, ) agentlib.AgentProvider
CreateAgentProvider wires the per-task-type dispatch table from a pre-constructed Runner so callers control Runner lifecycle.
func CreateFileResultDeliverer ¶
func CreateFileResultDeliverer(filePath string) agentlib.ResultDeliverer
CreateFileResultDeliverer creates a ResultDeliverer that writes the agent's output back to a markdown file.
func CreateKafkaResultDeliverer ¶
func CreateKafkaResultDeliverer( syncProducer libkafka.SyncProducer, topicPrefix base.TopicPrefix, taskID agentlib.TaskIdentifier, originalContent string, currentDateTime libtime.CurrentDateTimeGetter, ) agentlib.ResultDeliverer
CreateKafkaResultDeliverer creates a ResultDeliverer that publishes task updates to Kafka.
func CreatePiRunner ¶
func CreatePiRunner( agentDir string, allowedTools string, model string, env map[string]string, sessionID string, ) pilib.Runner
CreatePiRunner constructs a Pi Runner pre-configured with tools, model, and env.
sessionID is the agent's session identity: empty for a task-routed agent, set for a long-running identity agent. It is deliberately the *single* knob for both halves of continuity rather than a separate persist flag — persistence without an identity writes a transcript that nothing ever reads, which is exactly the defect that made a service agent save every conversation and remember none of them. Passing an id turns persistence on and pins the run to it; passing "" leaves the agent ephemeral, so a task-routed run still leaves nothing behind on the shared volume.
See PiRunnerConfig.SessionID for why this is --session-id rather than --continue.
func CreatePiSessionFactory ¶ added in v0.5.1
func CreatePiSessionFactory( agentDir string, allowedTools string, model string, env map[string]string, ) agentlib.SessionFactory
CreatePiSessionFactory builds the shared service's per-session factory over the pi runner. The session id selects the conversation: pi.NewSessionFactory derives PersistSession and SessionID from it, so this repository does not repeat that derivation.
Types ¶
This section is empty.