prompts

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddPrompts

func AddPrompts(prompts Prompts, mcpServer *server.MCPServer)

addPrompts registers a collection of prompts with the MCP server and logs the registration.

func RegisterPrompts

func RegisterPrompts(mcpServer *server.MCPServer)

RegisterPrompts initializes and registers predefined prompts with the MCP server. This is a convenience function that uses the default PromptRegistrar implementation. For backward compatibility, this function delegates to the interface-based implementation.

Types

type BasePromptRegistrar

type BasePromptRegistrar struct{}

func (*BasePromptRegistrar) RegisterCommonPrompts

func (b *BasePromptRegistrar) RegisterCommonPrompts(prompts *Prompts)

registerCommonPrompts adds prompts that are common to both internal and external modes. This method can be called by derived implementations to include common prompts.

func (*BasePromptRegistrar) RegisterPrompts

func (b *BasePromptRegistrar) RegisterPrompts(mcpServer *server.MCPServer)

RegisterPrompts registers common prompts available in both internal and external modes.

type Mode

type Mode string
const (
	Standard  Mode = "standard"
	Architect Mode = "architect"
)

type Prompt

type Prompt struct {
	Name              string
	Description       string
	ResultDescription string
	Text              string
	Role              Role
}

Prompt represents the prompt data needed to add to the MCP server.

func NewPrompt

func NewPrompt() *Prompt

NewPrompt creates a new Prompt instance with default values.

func (*Prompt) Build

func (b *Prompt) Build() *Prompt

Build constructs and returns a new Prompt instance based on the current state.

func (*Prompt) SetDescription

func (b *Prompt) SetDescription(description string) *Prompt

SetDescription sets the description of the prompt and returns the updated Prompt instance.

func (*Prompt) SetName

func (b *Prompt) SetName(name string) *Prompt

SetName sets the name of the prompt and returns the updated Prompt instance.

func (*Prompt) SetResultDescription

func (b *Prompt) SetResultDescription(resultDescription string) *Prompt

SetResultDescription sets the result description of the prompt and returns the updated Prompt instance.

func (*Prompt) SetText

func (b *Prompt) SetText(text string) *Prompt

SetText sets the text content of the prompt and returns the updated Prompt instance.

type PromptRegistrar

type PromptRegistrar interface {
	RegisterPrompts(mcpServer *server.MCPServer)
}

PromptRegistrar defines the interface for registering prompts with the MCP server. This interface allows different implementations for internal and external repos.

func NewPromptRegistrar

func NewPromptRegistrar() PromptRegistrar

NewPromptRegistrar creates a new prompt registrar.

type Prompts

type Prompts struct {
	Prompts []*Prompt
}

Prompts is a collection of Prompt instances.

func (*Prompts) Append

func (p *Prompts) Append(prompt *Prompt)

Append adds a new Prompt to the Prompts collection.

func (*Prompts) GetPrompts

func (p *Prompts) GetPrompts() []*Prompt

GetPrompts retrieves all prompts from the Prompts collection.

type Role

type Role int

Role represents the role of the prompt creator, either User or Assistant.

const (
	User      Role = iota // 0
	Assistant             // 1
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL