// Package adk provides ADK-Go tool wrappers for StemeDB.
//
// This package wraps the base StemeDB SDK with tool definitions suitable
// for Google's Agent Development Kit (ADK-Go). It provides:
//
//   - QueryTool - Query with lens-based resolution
//   - AssertTool - Create assertions with confidence
//   - ConstraintCheckTool - Pre-flight validation
//   - TraceTool - Audit trail queries
//   - SupersedeTool - Epoch/correction management
//
// Since ADK-Go is not yet publicly released, these tools use interface-based
// design and can be adapted to any ADK implementation.
//
// Example usage:
//
//	client := steme.NewClient("http://localhost:18180", signer)
//	tools := adk.AllTools(client)
//
//	// Use tools with your ADK agent configuration
//	agent := configureAgent(tools)
package adk

import (
	"context"

	"github.com/orchard9/stemedb-go/steme"
)

// Tool represents a generic ADK tool interface.
//
// This interface is designed to be compatible with any ADK implementation.
type Tool interface {
	Name() string
	Description() string
	Execute(ctx context.Context, input []byte) ([]byte, error)
}

// EpistemeClient defines the interface for StemeDB operations.
//
// This interface allows for easy mocking and testing.
type EpistemeClient interface {
	Query(ctx context.Context, params steme.QueryParams) (*steme.QueryResult, error)
	Assert(ctx context.Context, assertion steme.Assertion) (string, error)
	Trace(ctx context.Context, params steme.TraceParams) (*steme.TraceResult, error)
	Supersede(ctx context.Context, params steme.SupersedeParams) (*steme.SupersedeResult, error)
}

// AllTools returns all available Episteme tools.
//
// Use this for agent configuration:
//
//	tools := adk.AllTools(client)
func AllTools(client EpistemeClient) []Tool {
	return []Tool{
		NewQueryTool(client),
		NewAssertTool(client),
		NewConstraintCheckTool(client),
		NewTraceTool(client),
		NewSupersedeTool(client),
	}
}
