package feishu

import (
	"context"
	"fmt"

	"git.yeij.top/AskaEth/Cyrene/platform-bridge/internal/bridge"
)

// Adapter implements PlatformAdapter for Feishu (Lark Open API).
// Currently a stub — requires Feishu app credentials and Lark Go SDK.
type Adapter struct{}

func NewAdapter() *Adapter { return &Adapter{} }

func (a *Adapter) PlatformName() string { return "feishu" }

func (a *Adapter) Capabilities() bridge.PlatformCapabilities {
	return bridge.PlatformCapabilities{
		MaxMessageLength:   3000,
		SupportsMarkdown:   true,
		SupportsImage:      true,
		SupportsVoice:      false,
		SupportsEmoji:      true,
		SupportsReaction:   true,
		SupportsTypingHint: true,
		RecommendBurstMax:  2,
	}
}

func (a *Adapter) Connect(ctx context.Context) error {
	fmt.Println("[feishu] stub adapter — requires Feishu app credentials and Lark Go SDK")
	return nil
}

func (a *Adapter) Disconnect(ctx context.Context) error { return nil }

func (a *Adapter) IsConnected() bool { return false }

func (a *Adapter) HealthCheck() error {
	return fmt.Errorf("feishu adapter is a stub — not connected to Feishu")
}

func (a *Adapter) ToUnified(rawMessage interface{}) (*bridge.UnifiedMessage, error) {
	return nil, fmt.Errorf("feishu adapter is a stub — implement with Lark Go SDK")
}

func (a *Adapter) FromUnified(response *bridge.UnifiedResponse) ([]bridge.PlatformMessage, error) {
	return nil, fmt.Errorf("feishu adapter is a stub")
}
