Documentation
¶
Index ¶
- Constants
- Variables
- func AsyncSubagents(subagents []AsyncSubagent, options ...AsyncSubagentsOption) dagent.Middleware
- func ConversationSubagentTool(store ConversationSubagentStore, runner ConversationSubagentRunner, ...) datool.Tool
- func GLM52TerminalStallRecovery() dagent.Middleware
- func LoadHarnessProfilePlugins(plugins ...HarnessProfilePlugin) []error
- func ManagedMemoryGuard(backend dabackend.Backend, guardedPath string, additionalPaths ...string) dagent.Middleware
- func New(model damodel.Chat, options ...Option) *dagent.Agent
- func PatchToolCalls() dagent.Middleware
- func RegisterHarnessProfile(key string, profile Profile) error
- func Rubric(model damodel.Chat, options RubricOptions) dagent.Middleware
- func RubricWithRepository(model damodel.Chat, repositoryBackend dabackend.Backend, ...) dagent.Middleware
- func SanitizeSubagentSlug(slug string) string
- func Subagents(subagents []Subagent, options ...SubagentsOption) dagent.Middleware
- func SummarizationTool(model damodel.Chat, backend dabackend.Backend, ...) dagent.Middleware
- func ToolExclusion(names []string) dagent.Middleware
- func Version() string
- type ArgumentTruncationOptions
- type AsyncCancelRequest
- type AsyncCheckRequest
- type AsyncFailure
- type AsyncOutcome
- type AsyncRun
- type AsyncStartRequest
- type AsyncSubagent
- type AsyncSubagentRunner
- type AsyncSubagentsOption
- type AsyncSuccess
- type AsyncTask
- type AsyncUpdateRequest
- type CompactOption
- func WithCompactCutoffs(cutoffs ...int) CompactOption
- func WithCompactHistoryFormatter(format func([]damessage.Message) (string, error)) CompactOption
- func WithCompactInstructions(instructions string) CompactOption
- func WithCompactKeepMessages(count int) CompactOption
- func WithCompactKeepTokens(count int) CompactOption
- func WithCompactPrompt(prompt string) CompactOption
- func WithCompactReasoning(reasoning damodel.Reasoning) CompactOption
- func WithCompactSystemPrompt(prompt string) CompactOption
- type ContentLimit
- type ContentLimitUnit
- type ConversationCompaction
- type ConversationSubagentConversation
- type ConversationSubagentConversationRequest
- type ConversationSubagentDisplay
- type ConversationSubagentInput
- type ConversationSubagentModel
- type ConversationSubagentOptions
- type ConversationSubagentReply
- type ConversationSubagentRun
- type ConversationSubagentRunner
- type ConversationSubagentStore
- type Filesystem
- type FilesystemOperation
- type FilesystemPermission
- type GeneralPurposeSubagentMode
- type GeneralPurposeSubagentProfile
- type HarnessProfilePlugin
- type Interpreter
- type Memory
- type Option
- func WithApprovalRules(rules ...dagent.ApprovalRule) Option
- func WithAsyncSubagents(subagents []AsyncSubagent, options ...AsyncSubagentsOption) Option
- func WithBackend(backend dabackend.Backend) Option
- func WithCache(cache dacache.Cache) Option
- func WithDebug() Option
- func WithDependencies(dependencies any) Option
- func WithFatalToolErrors() Option
- func WithFilesystem(filesystem Filesystem) Option
- func WithInterpreter(interpreter Interpreter) Option
- func WithLogger(logger *slog.Logger) Option
- func WithMaxConcurrency(limit int) Option
- func WithMemory(memory Memory) Option
- func WithMetadata(metadata map[string]json.RawMessage) Option
- func WithMiddleware(middleware ...dagent.Middleware) Option
- func WithName(name string) Option
- func WithProfiles(profiles ...Profile) Option
- func WithPromptCache(options PromptCacheOptions) Option
- func WithPromptCacheRetention(retention string) Option
- func WithRecursionLimit(limit int) Option
- func WithRetainedThreadState() Option
- func WithSaver(saver dacheckpoint.Saver) Option
- func WithSkills(skills Skills) Option
- func WithStateFields(fields map[string]dagent.StateField) Option
- func WithStore(store dastore.Store) Option
- func WithStructuredOutput(output *dagent.StructuredOutput) Option
- func WithSubagents(subagents ...Subagent) Option
- func WithSummarization(summarization Summarization) Option
- func WithSystemMessage(message damessage.Message) Option
- func WithSystemPrompt(prompt string) Option
- func WithTags(tags ...string) Option
- func WithTodo(options ...dagent.TodoOption) Option
- func WithTools(tools ...datool.Tool) Option
- func WithoutMiddleware(names ...string) Option
- type PermissionMode
- type Profile
- type PromptCacheOptions
- type PromptMode
- type PromptTemplate
- type RubricCriterionEvaluation
- type RubricEvaluation
- type RubricGraderResponse
- type RubricOptions
- type RubricResult
- type RubricSnapshot
- type Runnable
- type RunnableSubagentOption
- type Skill
- type SkillSource
- type Skills
- type StreamingRunnable
- type Subagent
- type SubagentsOption
- type Summarization
- type SummarizationToolOptions
- type SummarizationTriggerClause
Constants ¶
const ( // ManagedMemoryBlockStart begins the machine-owned portion of a memory file. ManagedMemoryBlockStart = "<!-- deepagents:onboarding-name:start -->" // ManagedMemoryBlockEnd ends the machine-owned portion of a memory file. ManagedMemoryBlockEnd = "<!-- deepagents:onboarding-name:end -->" )
const ( RubricKey = "rubric" RubricStatusKey = "_rubric_status" RubricIterationsKey = "_rubric_iterations" RubricEvaluationsKey = "_rubric_evaluations" RubricRunIDKey = "_current_grading_run_id" RubricActiveKey = "_active_rubric" RubricGraderSource = "rubric_grader" )
const AsyncTasksKey = "async_tasks"
const FilesystemDeleteDescription = `` /* 157-byte string literal not displayed */
const FilesystemEditDescription = `` /* 189-byte string literal not displayed */
const FilesystemGlobDescription = `` /* 134-byte string literal not displayed */
const FilesystemListDescription = `` /* 196-byte string literal not displayed */
const FilesystemWriteDescription = `` /* 211-byte string literal not displayed */
const SubagentResponseFormatConfigKey = "subagent_response_format"
SubagentResponseFormatConfigKey selects a structured-output format for the declarative subagent launched by a task call. The configurable value must be a dagent.StructuredOutput or *dagent.StructuredOutput.
Variables ¶
var FilesystemReadDescription = fmt.Sprintf(filesystemReadDescriptionTemplate,
"By default, it reads up to 100 lines starting from the beginning of the file.",
"- For images and PDFs, omit offset and limit.",
)
var FilesystemReadVideoDescription = fmt.Sprintf(filesystemReadDescriptionTemplate,
"For text files, by default it reads up to 100 lines starting from the beginning of the file.",
"- For images and PDFs, omit offset and limit.\n- For videos, offset and limit are seconds; the default window is 100 seconds.",
)
Functions ¶
func AsyncSubagents ¶
func AsyncSubagents(subagents []AsyncSubagent, options ...AsyncSubagentsOption) dagent.Middleware
AsyncSubagents adds tools for starting and managing durable background tasks.
func ConversationSubagentTool ¶
func ConversationSubagentTool(store ConversationSubagentStore, runner ConversationSubagentRunner, workingDirectory func() string, parentConversationID, modelID string, optionValues ...ConversationSubagentOptions) datool.Tool
ConversationSubagentTool creates a tool that delegates work to named, persistent child conversations.
func GLM52TerminalStallRecovery ¶
func GLM52TerminalStallRecovery() dagent.Middleware
GLM52TerminalStallRecovery returns the one-shot recovery middleware for a headless harness. Callers should not install it in interactive agents, whose tool-free responses can be intentional.
Recovery is deliberately limited to the measured Fireworks GLM-5.2 model. A normalized max-token response containing exactly one assistant message, no tool call, and no structured result is retried once with reasoning disabled and a required tool choice. All other models and response shapes pass through.
func LoadHarnessProfilePlugins ¶
func LoadHarnessProfilePlugins(plugins ...HarnessProfilePlugin) []error
LoadHarnessProfilePlugins invokes explicitly supplied plugins in order. A returned error or panic is captured for that plugin and does not prevent later plugins from loading. Registrations completed before a failure remain registered, matching the additive plugin contract.
func ManagedMemoryGuard ¶
func ManagedMemoryGuard(backend dabackend.Backend, guardedPath string, additionalPaths ...string) dagent.Middleware
ManagedMemoryGuard protects machine-owned blocks in the supplied memory paths. The backend and guarded paths are required inputs; paths use the same virtual namespace as filesystem tools. The returned middleware is safe to share with subagents that share the backend.
The guard must run inside the filesystem middleware so runtime-backed backends have already been bound. NewAgent arranges that ordering automatically for Memory.Sources.
func New ¶
New constructs a deep agent. It panics when static construction options violate an invariant; invocation and dependency failures remain errors on Agent methods.
func PatchToolCalls ¶
func PatchToolCalls() dagent.Middleware
PatchToolCalls repairs assistant tool calls that have no matching result before a resumed agent run. Interrupted turns can otherwise leave model history that providers reject because a requested tool was never answered.
func RegisterHarnessProfile ¶
RegisterHarnessProfile additively registers a provider or provider:model harness profile. An incoming profile layers on top of an existing profile under the same key. Registration is safe to call concurrently and stores a defensive copy.
Registered profiles layer over built-ins during agent construction, while profiles passed with WithProfiles remain caller-owned and have final precedence.
func Rubric ¶
func Rubric(model damodel.Chat, options RubricOptions) dagent.Middleware
Rubric grades natural agent completions and, when necessary, injects actionable feedback before routing back to the model. It panics when static options violate an invariant.
func RubricWithRepository ¶
func RubricWithRepository(model damodel.Chat, repositoryBackend dabackend.Backend, repositoryOptions darepository.Options, options RubricOptions) dagent.Middleware
RubricWithRepository constructs a rubric grader with bounded, read-only access to repositoryBackend. Repository dependencies are explicit and positional; zero repository options select conservative defaults.
func SanitizeSubagentSlug ¶
SanitizeSubagentSlug converts a user label to a lowercase ASCII slug.
func Subagents ¶
func Subagents(subagents []Subagent, options ...SubagentsOption) dagent.Middleware
Subagents adds the task tool. Each invocation receives only its task message and a distinct thread identity, preventing parent and sibling state leaks.
func SummarizationTool ¶
func SummarizationTool(model damodel.Chat, backend dabackend.Backend, toolOptions SummarizationToolOptions) dagent.Middleware
SummarizationTool exposes opt-in manual conversation compaction. It shares the private event format used by Summarization but never compacts in the background. It panics when static options violate an invariant.
func ToolExclusion ¶
func ToolExclusion(names []string) dagent.Middleware
ToolExclusion removes profile-excluded tools at the final model boundary, after custom middleware has had an opportunity to alter the request. It intentionally leaves the executor registry intact so historical or resumed tool calls retain the same behavior as the canonical middleware.
Types ¶
type AsyncCancelRequest ¶
AsyncCancelRequest identifies one background run to cancel.
type AsyncCheckRequest ¶
AsyncCheckRequest identifies one background run to inspect.
type AsyncFailure ¶
type AsyncFailure struct{ Message string }
AsyncFailure carries a provider-neutral failure message.
type AsyncOutcome ¶
type AsyncOutcome interface {
// contains filtered or unexported methods
}
AsyncOutcome is the closed result union for a terminal async run.
type AsyncRun ¶
type AsyncRun struct {
ThreadID string
RunID string
Status string
Outcome AsyncOutcome
}
AsyncRun is the provider-neutral status returned by a background-agent runner.
type AsyncStartRequest ¶
AsyncStartRequest identifies the remote graph and initial task.
type AsyncSubagent ¶
type AsyncSubagent struct {
Name string
Description string
GraphID string
Runner AsyncSubagentRunner
}
AsyncSubagent binds a model-visible agent type to an explicit runner.
type AsyncSubagentRunner ¶
type AsyncSubagentRunner interface {
Start(context.Context, AsyncStartRequest) (AsyncRun, error)
Check(context.Context, AsyncCheckRequest) (AsyncRun, error)
Update(context.Context, AsyncUpdateRequest) (AsyncRun, error)
Cancel(context.Context, AsyncCancelRequest) error
}
AsyncSubagentRunner adapts a hosted or local background-agent service.
type AsyncSubagentsOption ¶
type AsyncSubagentsOption interface {
// contains filtered or unexported methods
}
AsyncSubagentsOption configures background-agent middleware.
func WithAsyncSystemPrompt ¶
func WithAsyncSystemPrompt(prompt string) AsyncSubagentsOption
WithAsyncSystemPrompt adds model instructions for the available background agents.
type AsyncSuccess ¶
type AsyncSuccess struct{ Value any }
AsyncSuccess carries a successful final value. A nil Value means the run completed without an output message; an empty string is an explicit result.
type AsyncTask ¶
type AsyncTask struct {
TaskID string `json:"task_id"`
AgentName string `json:"agent_name"`
ThreadID string `json:"thread_id"`
RunID string `json:"run_id"`
Status string `json:"status"`
CreatedAt string `json:"created_at"`
LastCheckedAt string `json:"last_checked_at"`
LastUpdatedAt string `json:"last_updated_at"`
}
AsyncTask is the durable provider-neutral state tracked for one background run.
type AsyncUpdateRequest ¶
AsyncUpdateRequest starts a replacement run on an existing thread.
type CompactOption ¶
type CompactOption interface {
// contains filtered or unexported methods
}
CompactOption configures one explicit conversation compaction.
func WithCompactCutoffs ¶
func WithCompactCutoffs(cutoffs ...int) CompactOption
func WithCompactHistoryFormatter ¶
func WithCompactHistoryFormatter(format func([]damessage.Message) (string, error)) CompactOption
func WithCompactInstructions ¶
func WithCompactInstructions(instructions string) CompactOption
func WithCompactKeepMessages ¶
func WithCompactKeepMessages(count int) CompactOption
func WithCompactKeepTokens ¶
func WithCompactKeepTokens(count int) CompactOption
func WithCompactPrompt ¶
func WithCompactPrompt(prompt string) CompactOption
func WithCompactReasoning ¶
func WithCompactReasoning(reasoning damodel.Reasoning) CompactOption
func WithCompactSystemPrompt ¶
func WithCompactSystemPrompt(prompt string) CompactOption
type ContentLimit ¶
type ContentLimit struct {
Unit ContentLimitUnit
Amount int
}
ContentLimit is a single token-or-byte limit. The zero value selects the documented default; Amount -1 disables the limit.
type ContentLimitUnit ¶
type ContentLimitUnit string
ContentLimitUnit selects how a content limit is measured.
const ( ContentTokens ContentLimitUnit = "tokens" ContentBytes ContentLimitUnit = "bytes" )
type ConversationCompaction ¶
type ConversationCompaction struct {
Summary string
Cutoff int
Older []damessage.Message
Recent []damessage.Message
Usage *damessage.Usage
Started time.Time
Finished time.Time
}
ConversationCompaction is the reusable result of one explicit compaction.
func CompactConversation ¶
func CompactConversation(ctx context.Context, model damodel.Chat, messages []damessage.Message, options ...CompactOption) (ConversationCompaction, error)
CompactConversation summarizes the portion of messages before a safe cut point and returns the recent verbatim tail. It does not mutate checkpoints or application projections.
type ConversationSubagentConversation ¶
ConversationSubagentConversation identifies a created or reused child conversation.
type ConversationSubagentConversationRequest ¶
type ConversationSubagentConversationRequest struct {
Slug string
ParentConversationID string
WorkingDirectory string
}
ConversationSubagentConversationRequest identifies the child conversation to create or reuse.
type ConversationSubagentDisplay ¶
type ConversationSubagentDisplay struct {
Slug string `json:"slug"`
ConversationID string `json:"conversation_id"`
}
ConversationSubagentDisplay identifies the persistent conversation created or reused by a call.
type ConversationSubagentInput ¶
type ConversationSubagentInput struct {
Slug string `json:"slug" description:"A short identifier for this subagent (e.g., 'research-api', 'test-runner')"`
Prompt string `json:"prompt" description:"The message to send to the subagent"`
TimeoutSeconds int `json:"timeout_seconds,omitempty"`
Wait *bool `` /* 141-byte string literal not displayed */
Model string `json:"model,omitempty" description:"LLM model for the subagent. Defaults to the parent conversation's model."`
Reasoning string `` /* 167-byte string literal not displayed */
}
ConversationSubagentInput is the input accepted by ConversationSubagentTool.
type ConversationSubagentModel ¶
ConversationSubagentModel describes a model exposed to child conversations.
type ConversationSubagentOptions ¶
type ConversationSubagentOptions struct {
AvailableModels []ConversationSubagentModel
ParentReasoning string
ReasoningLevels []string
DefaultTimeout time.Duration
MaxTimeout time.Duration
}
ConversationSubagentOptions configures a persistent conversation subagent tool.
type ConversationSubagentReply ¶
type ConversationSubagentReply struct {
Content string
}
ConversationSubagentReply is the visible response from a child conversation.
type ConversationSubagentRun ¶
type ConversationSubagentRun struct {
ConversationID string
Prompt string
Wait bool
Timeout time.Duration
ModelID string
Reasoning string
}
ConversationSubagentRun describes one turn in a persistent child conversation.
type ConversationSubagentRunner ¶
type ConversationSubagentRunner interface {
RunSubagent(context.Context, ConversationSubagentRun) (ConversationSubagentReply, error)
}
ConversationSubagentRunner executes a turn in a persistent child conversation.
type ConversationSubagentStore ¶
type ConversationSubagentStore interface {
GetOrCreateSubagentConversation(context.Context, ConversationSubagentConversationRequest) (ConversationSubagentConversation, error)
}
ConversationSubagentStore resolves a stable child conversation from its slug.
type Filesystem ¶
type Filesystem struct {
Permissions []FilesystemPermission
Tools []string
ToolDescriptions map[string]string
ReadLimit int
GrepLimit int
// GrepUncapped disables the configured default match cap. Individual grep
// calls can also request this behavior with an explicit JSON null max_count.
GrepUncapped bool
GlobTimeout time.Duration
MaxExecuteTimeout time.Duration
ToolResultLimit ContentLimit
// HumanMessageTokenLimit uses zero for its documented default and -1 to
// disable the limit. Positive values select an explicit token limit.
HumanMessageTokenLimit int
ArtifactsRoot string
ConversationHistoryRoot string
VideoExtractor davideo.Extractor
MaxVideoBytes int
VideoSamplingRate float64
// contains filtered or unexported fields
}
Filesystem configures the agent-owned filesystem facility. New binds it to the agent's Backend and compiles the corresponding middleware.
type FilesystemOperation ¶
type FilesystemOperation string
const ( FilesystemRead FilesystemOperation = "read" FilesystemWrite FilesystemOperation = "write" )
type FilesystemPermission ¶
type FilesystemPermission struct {
Operations []FilesystemOperation
Paths []string
Mode PermissionMode
}
FilesystemPermission is evaluated in declaration order; the first matching rule wins. Unmatched operations are allowed.
type GeneralPurposeSubagentMode ¶
type GeneralPurposeSubagentMode string
const ( GeneralPurposeSubagentEnabled GeneralPurposeSubagentMode = "enabled" GeneralPurposeSubagentDisabled GeneralPurposeSubagentMode = "disabled" )
type GeneralPurposeSubagentProfile ¶
type GeneralPurposeSubagentProfile struct {
Mode GeneralPurposeSubagentMode
Description *string
SystemPrompt *string
}
GeneralPurposeSubagentProfile controls the automatically added worker. An empty Mode inherits; otherwise it explicitly enables or disables the worker.
type HarnessProfilePlugin ¶
HarnessProfilePlugin identifies an explicitly imported harness-profile plugin. Register may call RegisterHarnessProfile one or more times.
Go does not provide a portable equivalent of Python package entry points, so applications must import plugin packages and pass their registration functions to LoadHarnessProfilePlugins (or rely on an imported package's init function calling RegisterHarnessProfile).
type Interpreter ¶
type Interpreter struct {
ToolName string
Timeout time.Duration
MemoryLimit uint64
StackLimit uint64
MaxStdoutChars int
MaxResultChars int
MaxSnapshotBytes int
MaxPTCCalls int
// PTC is an allowlist of agent tool names exposed as async functions under
// tools.*. Nil selects the read-only filesystem tools; an empty non-nil
// slice disables programmatic tool calling.
PTC []string
// PTCTransparency emits programmatic tool calls through the ordinary tool
// lifecycle stream so user interfaces and protocol adapters can render
// them like model-originated calls. It does not add the calls to model
// history or route them through tool-call middleware.
PTCTransparency bool
}
Interpreter configures the agent-owned JavaScript code interpreter. Normal Go builds host an isolated QuickJS-ng WASM instance in Wazero. TinyGo builds exclude that implementation and reject interpreter configurations.
type Memory ¶
type Memory struct {
Sources []string
// Contents supplies already-loaded source text. Entries whose paths appear
// in Sources are used without downloading them from Backend.
Contents map[string]string
SystemPrompt PromptTemplate
// ReadOnly selects the default prompt that exposes memory as reference
// material without asking the model to persist new learnings. An explicit
// SystemPrompt still takes precedence.
ReadOnly bool
}
Memory configures the agent-owned memory facility. New binds it to the agent's Backend and compiles the corresponding middleware.
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option configures an agent constructed by New.
func WithApprovalRules ¶
func WithApprovalRules(rules ...dagent.ApprovalRule) Option
WithApprovalRules adds human-approval middleware.
func WithAsyncSubagents ¶
func WithAsyncSubagents(subagents []AsyncSubagent, options ...AsyncSubagentsOption) Option
WithAsyncSubagents adds hosted asynchronous-subagent middleware.
func WithBackend ¶
WithBackend sets the backend used by backend-backed middleware.
func WithDependencies ¶
WithDependencies sets construction-time runtime dependencies.
func WithFatalToolErrors ¶
func WithFatalToolErrors() Option
WithFatalToolErrors makes operational tool failures terminate the invocation.
func WithFilesystem ¶
func WithFilesystem(filesystem Filesystem) Option
WithFilesystem adds filesystem middleware with the given configuration.
func WithInterpreter ¶
func WithInterpreter(interpreter Interpreter) Option
WithInterpreter adds persistent JavaScript interpreter middleware.
func WithLogger ¶
WithLogger routes enabled graph debug events to logger. An omitted logger preserves slog.Default behavior; a nil explicit logger is a static error.
func WithMaxConcurrency ¶
WithMaxConcurrency sets the maximum concurrent graph tasks.
func WithMemory ¶
WithMemory adds persistent-memory prompt middleware.
func WithMetadata ¶
func WithMetadata(metadata map[string]json.RawMessage) Option
WithMetadata sets invocation metadata used by tracing and evaluation adapters.
func WithMiddleware ¶
func WithMiddleware(middleware ...dagent.Middleware) Option
WithMiddleware appends caller-provided middleware. A later middleware with the same name replaces the earlier contribution.
func WithProfiles ¶
WithProfiles sets the ordered harness profiles applied to the agent.
func WithPromptCache ¶
func WithPromptCache(options PromptCacheOptions) Option
WithPromptCache enables current prompt-cache options. It panics when static values cannot be accepted by the provider API.
func WithPromptCacheRetention ¶
WithPromptCacheRetention adds provider prompt-caching middleware.
func WithRecursionLimit ¶
WithRecursionLimit sets the maximum graph steps for one invocation.
func WithRetainedThreadState ¶
func WithRetainedThreadState() Option
WithRetainedThreadState keeps active thread state in memory between invocations.
func WithSaver ¶
func WithSaver(saver dacheckpoint.Saver) Option
WithSaver sets the thread checkpoint saver.
func WithSkills ¶
WithSkills adds skill-discovery middleware.
func WithStateFields ¶
func WithStateFields(fields map[string]dagent.StateField) Option
WithStateFields sets application-owned state fields and reducers.
func WithStructuredOutput ¶
func WithStructuredOutput(output *dagent.StructuredOutput) Option
WithStructuredOutput sets the agent's structured response contract.
func WithSubagents ¶
WithSubagents adds task delegation middleware. Calling it without explicit subagents enables only the default general-purpose worker.
func WithSummarization ¶
func WithSummarization(summarization Summarization) Option
WithSummarization adds automatic conversation-summarization middleware.
func WithSystemMessage ¶
WithSystemMessage sets the agent's system message.
func WithSystemPrompt ¶
WithSystemPrompt sets a plain-text system message.
func WithTodo ¶
func WithTodo(options ...dagent.TodoOption) Option
WithTodo adds todo-list middleware.
func WithoutMiddleware ¶
WithoutMiddleware removes inherited or profile-provided middleware by public or serialized name. It is primarily useful for declarative child agents.
type PermissionMode ¶
type PermissionMode string
const ( PermissionAllow PermissionMode = "allow" PermissionDeny PermissionMode = "deny" PermissionInterrupt PermissionMode = "interrupt" )
type Profile ¶
type Profile struct {
Name string
BaseSystemPrompt *string
SystemPromptSuffix *string
SystemPrompt string
ToolDescriptions map[string]string
ExcludeTools []string
Middleware []dagent.Middleware
ExcludeMiddleware []string
GeneralPurpose *GeneralPurposeSubagentProfile
}
Profile is a composable construction overlay. Later profiles win for scalar and tool-description values; slices append in declaration order.
func MergeProfiles ¶
type PromptCacheOptions ¶
type PromptCacheOptions struct {
Key string
}
PromptCacheOptions configures prompt caching for current OpenAI models. Key may be omitted to derive a stable routing key from the agent's prompt shape.
type PromptMode ¶
type PromptMode string
const ( PromptCustom PromptMode = "custom" PromptDisabled PromptMode = "disabled" )
type PromptTemplate ¶
type PromptTemplate struct {
Mode PromptMode
Text string
}
PromptTemplate represents the default, a custom template, or no prompt without pointer-to-scalar option fields.
type RubricEvaluation ¶
type RubricEvaluation struct {
GradingRunID string `json:"grading_run_id"`
Iteration int `json:"iteration"`
Result RubricResult `json:"result"`
Explanation string `json:"explanation"`
Criteria []RubricCriterionEvaluation `json:"criteria"`
}
type RubricGraderResponse ¶
type RubricGraderResponse struct {
Result RubricResult `json:"result"`
Explanation string `json:"explanation"`
Criteria []RubricCriterionEvaluation `json:"criteria"`
}
type RubricOptions ¶
type RubricResult ¶
type RubricResult string
const ( RubricSatisfied RubricResult = "satisfied" RubricNeedsRevision RubricResult = "needs_revision" RubricFailed RubricResult = "failed" RubricMaxIterations RubricResult = "max_iterations_reached" RubricGraderError RubricResult = "grader_error" )
type RubricSnapshot ¶
type RubricSnapshot struct {
Criteria string `json:"criteria,omitempty"`
Status RubricResult `json:"status,omitempty"`
Iterations int `json:"iterations"`
Evaluations []RubricEvaluation `json:"evaluations,omitempty"`
}
RubricSnapshot is the durable, host-facing view of rubric state. Criteria and the latest verdict are public because hosts need them to restore their controls; grading bookkeeping remains private to the middleware.
func RubricSnapshotFromState ¶
func RubricSnapshotFromState(values dastate.Values) RubricSnapshot
RubricSnapshotFromState projects live or checkpoint-restored agent state into a detached host view. Malformed fields fail closed to their zero values instead of leaking loosely typed checkpoint data to callers.
type RunnableSubagentOption ¶
type RunnableSubagentOption interface {
// contains filtered or unexported methods
}
RunnableSubagentOption configures delegation to an already compiled runnable. Agent construction options are intentionally unavailable because the graph has already been built.
func WithInheritedState ¶
func WithInheritedState(keys ...string) RunnableSubagentOption
WithInheritedState selects parent state fields copied into an already compiled runnable subagent and propagated back when changed.
type SkillSource ¶
type Skills ¶
type Skills struct {
Sources []string
LabeledSources []SkillSource
// Catalog supplies skills that were discovered by an application. Filesystem
// sources remain higher priority and replace catalog entries with the same
// name.
Catalog []Skill
// Activate returns the progressive-disclosure instruction for a skill. The
// default uses a catalog skill's Body, then falls back to telling the agent
// to read the skill file through the filesystem tools.
Activate func(Skill) string
SystemPrompt PromptTemplate
MaxFileBytes int
Warn func(string)
}
Skills configures the agent-owned skill catalog. New binds it to the agent's Backend and compiles the corresponding middleware.
type StreamingRunnable ¶
type StreamingRunnable interface {
Runnable
Stream(context.Context, ...dagent.RunOption) *dagent.Stream
}
StreamingRunnable lets a compiled subagent project its nested lifecycle onto the parent stream. Runnable remains sufficient for invoke-only integrations.
type Subagent ¶
type Subagent struct {
// contains filtered or unexported fields
}
func NewRunnableSubagent ¶
func NewRunnableSubagent(name, description string, runnable Runnable, options ...RunnableSubagentOption) Subagent
NewRunnableSubagent registers an already compiled runnable. It accepts only delegation options because agent construction options cannot reconfigure a compiled graph.
func NewSubagent ¶
NewSubagent declares an agent compiled with the same functional options as a top-level agent. A nil model inherits the parent model.
func (Subagent) WithInheritedState ¶
WithInheritedState selects parent state fields copied into this declarative subagent and propagated back when changed. Calling it with no keys disables inheritance. It is separate from Option because delegation is not part of agent construction.
type SubagentsOption ¶
type SubagentsOption interface {
// contains filtered or unexported methods
}
SubagentsOption configures one subagent middleware construction.
func WithPrivateState ¶
func WithPrivateState(keys ...string) SubagentsOption
WithPrivateState prevents selected parent state fields from reaching child agents.
type Summarization ¶
type Summarization struct {
// Model overrides the agent model for summary generation. Nil reuses the
// agent model.
Model damodel.Chat
// TriggerClauses are ORed together; every non-zero threshold within one
// clause must match. This represents Deep Agents' list-of-trigger-clauses
// contract without Python tuple/dict unions.
TriggerClauses []SummarizationTriggerClause
KeepMessages int
KeepTokens int
KeepFraction float64
HistoryRoot string
MediaRoot string
OverflowClipTokens int
LargeToolResultsRoot string
SummaryPrompt string
// Nil selects profile-aware defaults. An empty value disables argument
// truncation; a populated value supplies a custom policy.
ArgumentTruncation *ArgumentTruncationOptions
}
Summarization configures the agent-owned conversation compactor. New binds its model and backend and compiles the corresponding middleware.
type SummarizationToolOptions ¶
type SummarizationToolOptions struct {
Summarization Summarization
// SystemPrompt optionally nudges the model to use compact_conversation.
SystemPrompt string
}
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package browser contains reusable building blocks for agents that run as Go WebAssembly inside a browser worker.
|
Package browser contains reusable building blocks for agents that run as Go WebAssembly inside a browser worker. |
|
browserfs
Package browserfs implements a bounded, just-in-time browser workspace for Go WebAssembly agents.
|
Package browserfs implements a bounded, just-in-time browser workspace for Go WebAssembly agents. |
|
checkpoint
Package checkpoint implements browser persistence for graph checkpoints.
|
Package checkpoint implements browser persistence for graph checkpoints. |
|
jsbridge
Package jsbridge contains syscall/js helpers for exposing asynchronous Go functions to browser JavaScript and awaiting JavaScript promises.
|
Package jsbridge contains syscall/js helpers for exposing asynchronous Go functions to browser JavaScript and awaiting JavaScript promises. |
|
justbash
Package justbash defines the portable request boundary used to run a sandboxed just-bash shell beside a Go WebAssembly agent.
|
Package justbash defines the portable request boundary used to run a sandboxed just-bash shell beside a Go WebAssembly agent. |
|
webgpu
Package webgpu adapts an asynchronous browser inference function to the damodel.Chat interface for Go WebAssembly agents.
|
Package webgpu adapts an asynchronous browser inference function to the damodel.Chat interface for Go WebAssembly agents. |
|
cmd
|
|
|
dacode
command
|
|
|
dago
command
|
|
|
datalon
command
Command datalon exposes local long-running assistant utilities.
|
Command datalon exposes local long-running assistant utilities. |
|
Package daacp exposes dago agents through Agent Client Protocol version 1.
|
Package daacp exposes dago agents through Agent Client Protocol version 1. |
|
Package daagentprotocol adapts the Agent Protocol HTTP API to background subagents.
|
Package daagentprotocol adapts the Agent Protocol HTTP API to background subagents. |
|
Package daaskuser provides an opt-in tool for asking structured questions during an agent run.
|
Package daaskuser provides an opt-in tool for asking structured questions during an agent run. |
|
Package dabackend defines virtual file and optional shell capabilities used by deep agent filesystem middleware.
|
Package dabackend defines virtual file and optional shell capabilities used by deep agent filesystem middleware. |
|
agentcore
Package agentcore adapts a caller-authenticated AgentCore Code Interpreter transport to dago's sandbox contracts.
|
Package agentcore adapts a caller-authenticated AgentCore Code Interpreter transport to dago's sandbox contracts. |
|
contexthub
Package contexthub stores a dago virtual file tree in a persistent Context Hub agent repository.
|
Package contexthub stores a dago virtual file tree in a persistent Context Hub agent repository. |
|
daytona
Package daytona adapts caller-supplied Daytona transports to dago's sandbox backend.
|
Package daytona adapts caller-supplied Daytona transports to dago's sandbox backend. |
|
docker
Package docker provides an explicitly constructed sandbox backed by a local Docker Engine.
|
Package docker provides an explicitly constructed sandbox backed by a local Docker Engine. |
|
langsmith
Package langsmith adapts a LangSmith remote sandbox to dago's backend contracts.
|
Package langsmith adapts a LangSmith remote sandbox to dago's backend contracts. |
|
modal
Package modal adapts a caller-supplied Modal sandbox transport to dago's sandbox backend.
|
Package modal adapts a caller-supplied Modal sandbox transport to dago's sandbox backend. |
|
runloop
Package runloop adapts caller-supplied Runloop devbox transports to dago's sandbox backend.
|
Package runloop adapts caller-supplied Runloop devbox transports to dago's sandbox backend. |
|
vercel
Package vercel adapts a caller-supplied Vercel Sandbox transport to dago's sandbox backend.
|
Package vercel adapts a caller-supplied Vercel Sandbox transport to dago's sandbox backend. |
|
Package dacache defines deterministic node and model result caching contracts.
|
Package dacache defines deterministic node and model result caching contracts. |
|
Package dacheckpoint defines durable graph execution records and saver contracts.
|
Package dacheckpoint defines durable graph execution records and saver contracts. |
|
postgres
Package postgres implements the standard Python-schema-compatible PostgreSQL saver.
|
Package postgres implements the standard Python-schema-compatible PostgreSQL saver. |
|
serde
Package serde implements the safe language-neutral checkpoint payload subset.
|
Package serde implements the safe language-neutral checkpoint payload subset. |
|
sqlite
Package sqlite implements the standard Python-schema-compatible SQLite saver.
|
Package sqlite implements the standard Python-schema-compatible SQLite saver. |
|
Package daconfig provides provider-neutral layered configuration contracts.
|
Package daconfig provides provider-neutral layered configuration contracts. |
|
Package dacost provides provider-neutral, bounded token and cost accounting.
|
Package dacost provides provider-neutral, bounded token and cost accounting. |
|
Package dacredential stores provider and service credentials in an owner-private, versioned file without owning provider SDKs or login flows.
|
Package dacredential stores provider and service credentials in an owner-private, versioned file without owning provider SDKs or login flows. |
|
Package dadoctor collects bounded, offline diagnostics suitable for pasting into support reports.
|
Package dadoctor collects bounded, offline diagnostics suitable for pasting into support reports. |
|
Package daenv resolves bounded project and user dotenv layers without mutating the process environment.
|
Package daenv resolves bounded project and user dotenv layers without mutating the process environment. |
|
Package daeval evaluates agent behavior from provider-neutral trajectories.
|
Package daeval evaluates agent behavior from provider-neutral trajectories. |
|
clbench
Package clbench adapts a caller-supplied structured agent to the continual-learning-bench system lifecycle.
|
Package clbench adapts a caller-supplied structured agent to the continual-learning-bench system lifecycle. |
|
harbor
Package harbor runs sandboxed benchmarks through caller-supplied transports.
|
Package harbor runs sandboxed benchmarks through caller-supplied transports. |
|
scorecard
Package scorecard compares provider-neutral evaluation results across models.
|
Package scorecard compares provider-neutral evaluation results across models. |
|
Package daeventbus provides opt-in, transport-neutral external event ingress.
|
Package daeventbus provides opt-in, transport-neutral external event ingress. |
|
Package dagent implements the provider-neutral model/tool loop and middleware contracts required by deep agents.
|
Package dagent implements the provider-neutral model/tool loop and middleware contracts required by deep agents. |
|
Package dagit reads lightweight Git repository metadata without requiring a Git subprocess for ordinary repository layouts.
|
Package dagit reads lightweight Git repository metadata without requiring a Git subprocess for ordinary repository layouts. |
|
Package dagoal provides durable, provider-neutral goals for dago agents.
|
Package dagoal provides durable, provider-neutral goals for dago agents. |
|
Package dahook implements the versioned lifecycle-hook protocol used by dago hosts.
|
Package dahook implements the versioned lifecycle-hook protocol used by dago hosts. |
|
Package dahousekeeping provides bounded, application-owned startup chores.
|
Package dahousekeeping provides bounded, application-owned startup chores. |
|
Package dainstall provides a closed-catalog dependency installer.
|
Package dainstall provides a closed-catalog dependency installer. |
|
Package damanaged provides a bounded client for the managed-agent API.
|
Package damanaged provides a bounded client for the managed-agent API. |
|
Package damcp implements host-neutral policy for project-supplied MCP servers.
|
Package damcp implements host-neutral policy for project-supplied MCP servers. |
|
Package damessage defines the provider-neutral messages exchanged by models, tools, agents, and checkpoints.
|
Package damessage defines the provider-neutral messages exchanged by models, tools, agents, and checkpoints. |
|
Package damodel defines provider-neutral chat model contracts.
|
Package damodel defines provider-neutral chat model contracts. |
|
modeltest
Package modeltest provides deterministic model doubles for tests and examples.
|
Package modeltest provides deterministic model doubles for tests and examples. |
|
Package daplugin provides bounded local plugin and marketplace management.
|
Package daplugin provides bounded local plugin and marketplace management. |
|
Package daprofilecfg provides safe JSON and YAML harness-profile configuration.
|
Package daprofilecfg provides safe JSON and YAML harness-profile configuration. |
|
daproviders
|
|
|
anthropic
Package anthropic adapts Anthropic's Messages API to damodel.Chat.
|
Package anthropic adapts Anthropic's Messages API to damodel.Chat. |
|
claudeagent
Package claudeagent adapts the Claude CLI print protocol to damodel.Chat.
|
Package claudeagent adapts the Claude CLI print protocol to damodel.Chat. |
|
langsmithgateway
Package langsmithgateway resolves provider:model specifications through the LangSmith LLM Gateway without owning provider SDKs or credentials discovery.
|
Package langsmithgateway resolves provider:model specifications through the LangSmith LLM Gateway without owning provider SDKs or credentials discovery. |
|
modelconfig
Package modelconfig resolves provider-qualified and bare model names into caller-owned model factories.
|
Package modelconfig resolves provider-qualified and bare model names into caller-owned model factories. |
|
nemotron
Package nemotron provides harness profiles and middleware for NVIDIA Nemotron models.
|
Package nemotron provides harness profiles and middleware for NVIDIA Nemotron models. |
|
ollama
Package ollama discovers models exposed by an explicitly selected local Ollama daemon.
|
Package ollama discovers models exposed by an explicitly selected local Ollama daemon. |
|
openai
Package openai adapts the OpenAI Responses API to dago's provider-neutral model contract.
|
Package openai adapts the OpenAI Responses API to dago's provider-neutral model contract. |
|
openrouter
Package openrouter adapts OpenRouter's OpenAI-compatible Responses API to dago's provider-neutral model contract.
|
Package openrouter adapts OpenRouter's OpenAI-compatible Responses API to dago's provider-neutral model contract. |
|
profile
Package profile applies explicit provider-construction profiles.
|
Package profile applies explicit provider-construction profiles. |
|
Package darepository provides bounded, read-only repository tools for untrusted nested agents such as acceptance-criteria drafters and graders.
|
Package darepository provides bounded, read-only repository tools for untrusted nested agents such as acceptance-criteria drafters and graders. |
|
Package dasandbox resolves and owns remote sandbox sessions across built-in, extension, and application-configured provider factories.
|
Package dasandbox resolves and owns remote sandbox sessions across built-in, extension, and application-configured provider factories. |
|
Package daserver exposes dago agents through the LangGraph Agent Server HTTP protocol used by LangSmith Studio and the LangGraph SDKs.
|
Package daserver exposes dago agents through the LangGraph Agent Server HTTP protocol used by LangSmith Studio and the LangGraph SDKs. |
|
Package daskill implements the language-neutral Agent Skills metadata contract.
|
Package daskill implements the language-neutral Agent Skills metadata contract. |
|
Package dastate defines language-neutral graph state values and update markers.
|
Package dastate defines language-neutral graph state values and update markers. |
|
Package dastore defines namespaced durable memory used by graph and agent runs.
|
Package dastore defines namespaced durable memory used by graph and agent runs. |
|
sqlite
Package sqlite provides a durable namespaced store with versioned migrations.
|
Package sqlite provides a durable namespaced store with versioned migrations. |
|
Package dasubagent discovers declarative subagent definitions from bounded, confined AGENTS.md files.
|
Package dasubagent discovers declarative subagent definitions from bounded, confined AGENTS.md files. |
|
Package datalon provides an experimental local host for long-running agents.
|
Package datalon provides an experimental local host for long-running agents. |
|
approval
Package approval provides Talon's experimental channel tool-approval policy.
|
Package approval provides Talon's experimental channel tool-approval policy. |
|
cron
Package cron provides persistent minute-granularity jobs for datalon hosts.
|
Package cron provides persistent minute-granularity jobs for datalon hosts. |
|
fleet
Package fleet imports Fleet zip exports into a local datalon assistant state directory.
|
Package fleet imports Fleet zip exports into a local datalon assistant state directory. |
|
lifecycle
Package lifecycle applies bounded retention policy to one datalon assistant's sensitive local state.
|
Package lifecycle applies bounded retention policy to one datalon assistant's sensitive local state. |
|
mcp
Package mcp loads Model Context Protocol tools for a long-running assistant.
|
Package mcp loads Model Context Protocol tools for a long-running assistant. |
|
mcp/oauthpolicy
Package oauthpolicy selects bounded, provider-specific OAuth policies for remote MCP servers.
|
Package oauthpolicy selects bounded, provider-specific OAuth policies for remote MCP servers. |
|
speech
Package speech provides opt-in inbound voice transcription for datalon channels.
|
Package speech provides opt-in inbound voice transcription for datalon channels. |
|
telegram
Package telegram adapts Telegram's Bot API to datalon.Channel.
|
Package telegram adapts Telegram's Bot API to datalon.Channel. |
|
tracing
Package tracing adds provider-neutral per-run tracing to a datalon runtime.
|
Package tracing adds provider-neutral per-run tracing to a datalon runtime. |
|
tracing/langsmith
Package langsmith adapts LangSmith run ingestion to datalon tracing.
|
Package langsmith adapts LangSmith run ingestion to datalon tracing. |
|
whatsapp
Package whatsapp adapts datalon to the packaged loopback WhatsApp Node bridge.
|
Package whatsapp adapts datalon to the packaged loopback WhatsApp Node bridge. |
|
Package datool defines provider-neutral tool schemas and execution contracts.
|
Package datool defines provider-neutral tool schemas and execution contracts. |
|
Package daupdate verifies and atomically activates signed release artifacts.
|
Package daupdate verifies and atomically activates signed release artifacts. |
|
Package davideo defines video extraction contracts and an optional FFmpeg adapter.
|
Package davideo defines video extraction contracts and an optional FFmpeg adapter. |
|
Package daweb provides opt-in HTTP, page-fetching, and Tavily search tools.
|
Package daweb provides opt-in HTTP, page-fetching, and Tavily search tools. |
|
Package daworkflow provides deterministic JavaScript orchestration as an optional dago middleware extension.
|
Package daworkflow provides deterministic JavaScript orchestration as an optional dago middleware extension. |
|
Package daworkspace discovers workspace instructions and conventional local configuration shared by dago applications.
|
Package daworkspace discovers workspace instructions and conventional local configuration shared by dago applications. |
|
examples
|
|
|
basic
command
|
|
|
openai
command
|
|
|
studio
Package studio provides a network-free agent for exercising dago with LangSmith Studio.
|
Package studio provides a network-free agent for exercising dago with LangSmith Studio. |
|
internal
|
|
|
conformance/cmd/generate
command
|
|
|
dacli
Package dacli contains shared command-line workflows for the dago binary.
|
Package dacli contains shared command-line workflows for the dago binary. |
|
optionvalue
Package optionvalue resolves optional zero-or-one configuration values.
|
Package optionvalue resolves optional zero-or-one configuration values. |
|
quickjswasm
Package quickjswasm embeds the QuickJS-ng execution guest shipped by quickjs-rs v0.2.5 and dago's source-controlled fork of its transform guest.
|
Package quickjswasm embeds the QuickJS-ng execution guest shipped by quickjs-rs v0.2.5 and dago's source-controlled fork of its transform guest. |
|
unicodesecurity
Package unicodesecurity detects text and URLs that may render deceptively.
|
Package unicodesecurity detects text and URLs that may render deceptively. |
|
wafl
Package wafl instruments WebAssembly stores with passive page-dirty tracking.
|
Package wafl instruments WebAssembly stores with passive page-dirty tracking. |