Documentation
¶
Overview ¶
Package aitesting provides shared test helpers for code that exercises the ai package's leak-prevention machinery from outside the ai package itself.
The ai package's own tests (internal/ai/prompt_test.go) cannot import this package — that would be an import cycle. They use the same underlying constants directly (ai.PrrSpecificToolNames). Sibling packages (internal/security, internal/audit, future leak-test sites) use the re-exports and helpers here.
Index ¶
- Variables
- type ClaudeCodeProvider
- func (ClaudeCodeProvider) Capabilities() ai.Capabilities
- func (ClaudeCodeProvider) Chat(context.Context, ai.ChatRequest) (*ai.ChatResponse, error)
- func (ClaudeCodeProvider) ModelID() string
- func (ClaudeCodeProvider) Name() string
- func (ClaudeCodeProvider) StreamChat(context.Context, ai.ChatRequest) (<-chan ai.ChatEvent, error)
Constants ¶
This section is empty.
Variables ¶
var PrrSpecificToolNames = ai.PrrSpecificToolNames
PrrSpecificToolNames re-exports ai.PrrSpecificToolNames so leak tests in other packages depend on a single import path. The source of truth is ai.PrrSpecificToolNames; do not maintain a separate copy here.
Functions ¶
This section is empty.
Types ¶
type ClaudeCodeProvider ¶
type ClaudeCodeProvider struct{}
ClaudeCodeProvider is a stub ai.Provider that reports RunsOwnToolLoop: true. Useful as the second argument to ai.ResolveTools in leak tests that need to drive the Claude-Code branch without spinning up a real subprocess.
Chat and StreamChat return nil/zero — this is a test double, not a functional provider. Don't use it for anything that actually exercises the chat path.
func (ClaudeCodeProvider) Capabilities ¶
func (ClaudeCodeProvider) Capabilities() ai.Capabilities
func (ClaudeCodeProvider) Chat ¶
func (ClaudeCodeProvider) Chat(context.Context, ai.ChatRequest) (*ai.ChatResponse, error)
func (ClaudeCodeProvider) ModelID ¶
func (ClaudeCodeProvider) ModelID() string
func (ClaudeCodeProvider) Name ¶
func (ClaudeCodeProvider) Name() string
func (ClaudeCodeProvider) StreamChat ¶
func (ClaudeCodeProvider) StreamChat(context.Context, ai.ChatRequest) (<-chan ai.ChatEvent, error)