Documentation
¶
Overview ¶
Package agentctx defines context keys for adapter routing information that flows through the agent pipeline. Both agent and configmcp import this package to set and extract routing context without coupling to each other.
Index ¶
- func Adapter(ctx context.Context) string
- func ConversationID(ctx context.Context) string
- func ExternalID(ctx context.Context) string
- func WithAdapter(ctx context.Context, name string) context.Context
- func WithConversationID(ctx context.Context, id string) context.Context
- func WithExecMark(ctx context.Context, m *ExecMark) context.Context
- func WithExternalID(ctx context.Context, id string) context.Context
- func WithSkillContext(ctx context.Context, s *SkillSummary) context.Context
- type ExecMark
- type SkillSummary
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConversationID ¶
ConversationID extracts the conversation ID, or "" if unset.
func ExternalID ¶
ExternalID extracts the external message ID, or "" if unset.
func WithAdapter ¶
WithAdapter returns a context carrying the adapter name (e.g. "telegram", "ws").
func WithConversationID ¶
WithConversationID returns a context carrying the conversation ID.
func WithExecMark ¶ added in v0.43.0
WithExecMark returns a context carrying the audit overlay for a non-live turn.
func WithExternalID ¶
WithExternalID returns a context carrying the platform-specific message ID.
func WithSkillContext ¶ added in v0.31.8
func WithSkillContext(ctx context.Context, s *SkillSummary) context.Context
WithSkillContext returns a context carrying skill metadata for supervisor review.
Types ¶
type ExecMark ¶ added in v0.43.0
type ExecMark struct {
// Agent is the variant-scoped pseudo-identity written to the event's
// agent field, e.g. "pamela#dryrun" or "pamela#eval:candidate". The "#"
// is rejected by resource-name validation, so it can never collide with a
// real agent, and exact-match agent queries exclude these events for free.
Agent string
// Source is the event source, e.g. "dryrun" or "eval". Exact-match
// filterable, and excludable via the audit exclude_source filter.
Source string
// Summary requests reduced emission (lifecycle and errors only) instead of
// the default full live-turn semantics.
Summary bool
}
ExecMark labels every audit event produced by a turn that ran under a non-live execution policy (a dry-run preview or an eval sample), so the record stays complete while the view can stay quiet.
It travels in the context rather than as a parameter because audit events are emitted from a dozen places in the turn — including helpers that never see the policy — and a single overlay at the emit site is the only way to mark all of them without threading the policy everywhere.
func ExecMarkFrom ¶ added in v0.43.0
ExecMarkFrom extracts the audit overlay, or nil for an ordinary live turn.
type SkillSummary ¶ added in v0.31.8
type SkillSummary struct {
Name string
Description string
Body string // skill body (markdown); truncated at render time
IsScheduled bool
ScheduleName string
}
SkillSummary carries lightweight metadata about the skill driving the current session. Used by the supervisor to understand *why* a tool call is being made, especially for scheduled skill invocations.
func SkillContext ¶ added in v0.31.8
func SkillContext(ctx context.Context) *SkillSummary
SkillContext extracts the skill summary, or nil if unset.