Documentation
¶
Overview ¶
Package prompt provides prompt management for the MCP data platform. It defines the Store interface for prompt persistence and the Prompt type that represents a user-managed MCP prompt.
Index ¶
Constants ¶
View Source
const ( ScopeGlobal = "global" ScopePersona = "persona" ScopePersonal = "personal" )
Scope constants define prompt visibility levels.
View Source
const ( SourceOperator = "operator" SourceAgent = "agent" SourceSystem = "system" )
Source constants define prompt origins.
Variables ¶
This section is empty.
Functions ¶
func ValidateName ¶
ValidateName checks that a prompt name is well-formed.
func ValidateScope ¶
ValidateScope checks that a scope value is allowed for database-stored prompts.
Types ¶
type Argument ¶
type Argument struct {
Name string `json:"name"`
Description string `json:"description"`
Required bool `json:"required"`
}
Argument describes a prompt argument.
type ListFilter ¶
type ListFilter struct {
Scope string // "global", "persona", "personal", or "" for all
Personas []string // filter by persona membership (OR match)
OwnerEmail string // filter by owner
Enabled *bool // filter by enabled state
Search string // free-text search on name, display_name, description
}
ListFilter controls which prompts are returned by List.
type Prompt ¶
type Prompt struct {
ID string `json:"id"`
Name string `json:"name"`
DisplayName string `json:"display_name"`
Description string `json:"description"`
Content string `json:"content"`
Arguments []Argument `json:"arguments"`
Category string `json:"category"`
Scope string `json:"scope"`
Personas []string `json:"personas"`
OwnerEmail string `json:"owner_email"`
Source string `json:"source"`
Enabled bool `json:"enabled"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Prompt represents a user-managed MCP prompt.
type Store ¶
type Store interface {
// Create persists a new prompt.
Create(ctx context.Context, p *Prompt) error
// Get retrieves a prompt by name. Returns nil, nil if not found.
Get(ctx context.Context, name string) (*Prompt, error)
// GetByID retrieves a prompt by ID. Returns nil, nil if not found.
GetByID(ctx context.Context, id string) (*Prompt, error)
// Update modifies an existing prompt.
Update(ctx context.Context, p *Prompt) error
// Delete removes a prompt by name.
Delete(ctx context.Context, name string) error
// DeleteByID removes a prompt by ID.
DeleteByID(ctx context.Context, id string) error
// List returns prompts matching the filter.
List(ctx context.Context, filter ListFilter) ([]Prompt, error)
// Count returns the number of prompts matching the filter.
Count(ctx context.Context, filter ListFilter) (int, error)
}
Store defines the interface for prompt persistence.
Click to show internal directories.
Click to hide internal directories.