feishu

package
v0.1.23 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: MIT Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cfg Config, deps Deps) (agentkit.Platform, error)

New registers platform/feishu: Feishu WebSocket / webhook.

Types

type Config

type Config struct {
	common.AgentRoutingConfig
	AppID                      string            `json:"appId"`
	AppSecret                  string            `json:"appSecret"`
	Domain                     string            `json:"domain"`
	AllowFrom                  string            `json:"allowFrom"`
	AllowChat                  string            `json:"allowChat"`
	GroupReplyAll              bool              `json:"groupReplyAll"`
	ShareSessionInChannel      bool              `json:"shareSessionInChannel"` // deprecated: use runner.config.sessionScope
	ThreadIsolation            bool              `json:"threadIsolation"`
	ReplyInThread              *bool             `json:"replyInThread"`
	ReactionEmoji              string            `json:"reactionEmoji"`
	DoneEmoji                  string            `json:"doneEmoji"`
	GroupOnly                  bool              `json:"groupOnly"`
	RespondToAtEveryoneAndHere bool              `json:"respondToAtEveryoneAndHere"`
	ReplyToTrigger             *bool             `json:"replyToTrigger"`
	ResolveMentions            bool              `json:"resolveMentions"`
	PeerBots                   map[string]string `json:"peerBots"`
	ProgressStyle              string            `json:"progressStyle"`
	ShowThinking               *bool             `json:"showThinking"`
	ShowToolProgress           *bool             `json:"showToolProgress"`
	EnableFeishuCard           *bool             `json:"enableFeishuCard"`
	EncryptKey                 string            `json:"encryptKey"`
	Port                       string            `json:"port"`
	CallbackPath               string            `json:"callbackPath"`
}

type Deps

type Deps struct {
	Commands     agentkit.Commands     `json:"commands,omitempty"`
	SessionStore agentkit.SessionStore `json:"sessionStore,omitempty"`
	Workspace    workspace.Service     `json:"workspace,omitempty"`
}

type Platform

type Platform struct {
	// contains filtered or unexported fields
}

func (*Platform) AddDoneReaction

func (p *Platform) AddDoneReaction(rctx any)

AddDoneReaction adds a "done" emoji reaction so the user gets a push notification when the agent finishes a multi-round turn in quiet mode.

func (*Platform) BuildRichCard

func (p *Platform) BuildRichCard(status cardStatus, title string, steps []toolStep, markdown string, streaming bool, elapsed time.Duration) string

BuildRichCard implements core.RichCardSupporter. Feishu engine passes an elapsed duration via the preview handle; buildRichCard itself is the renderer and must be called with the duration from engine state.

func (*Platform) DeletePreviewMessage

func (p *Platform) DeletePreviewMessage(ctx context.Context, previewHandle any) error

DeletePreviewMessage removes a preview message so the caller can send a separate final message without leaving a stale interactive card behind.

func (*Platform) IsMessageRecalled

func (p *Platform) IsMessageRecalled(ctx context.Context, rctx any) (bool, error)

func (*Platform) PermissionCapability

func (p *Platform) PermissionCapability() permission.Capability

func (*Platform) PlatformID

func (p *Platform) PlatformID() string

func (*Platform) ReadChatHistory added in v0.1.22

func (p *Platform) ReadChatHistory(ctx context.Context, req chathistory.Request) (chathistory.Result, error)

ReadChatHistory lists messages from Feishu/Lark IM for the given delivery session.

func (*Platform) Receive

func (p *Platform) Receive(ctx context.Context) (agentkit.MessageEvent, error)

func (*Platform) ReconstructReplyCtx

func (p *Platform) ReconstructReplyCtx(sessionKey string) (any, error)

func (*Platform) RefreshCard

func (p *Platform) RefreshCard(ctx context.Context, sessionKey string, card *common.Card) error

func (*Platform) Reply

func (p *Platform) Reply(ctx context.Context, rctx any, content string) error

func (*Platform) ReplyCard

func (p *Platform) ReplyCard(ctx context.Context, rctx replyContext, card *common.Card) error

func (*Platform) Send

func (p *Platform) Send(ctx context.Context, event agentkit.OutboundEvent) error

func (*Platform) SendAudio

func (p *Platform) SendAudio(ctx context.Context, rctx any, audio []byte, format string) error

SendAudio uploads audio bytes to Feishu and sends a voice message. Implements core.AudioSender interface. Feishu audio messages require opus format; non-opus input is converted via ffmpeg.

func (*Platform) SendFile

func (p *Platform) SendFile(ctx context.Context, rctx any, file common.FileAttachment) error

func (*Platform) SendImage

func (p *Platform) SendImage(ctx context.Context, rctx any, img common.ImageAttachment) error

func (*Platform) SendPreviewStart

func (p *Platform) SendPreviewStart(ctx context.Context, rctx any, content string) (any, error)

SendPreviewStart sends a new card message and returns a handle for subsequent edits. Using card (interactive) type for both preview and final message so updates are in-place without needing to delete and resend.

func (*Platform) SetPreviewStatus

func (p *Platform) SetPreviewStatus(previewHandle any, status cardStatus)

SetPreviewStatus updates the card header color to reflect the agent's current state.

func (*Platform) SplitMarkdownByTables

func (p *Platform) SplitMarkdownByTables(md string, maxTables int) []string

SplitMarkdownByTables implements core.MarkdownTableSplitter.

func (*Platform) StartTyping

func (p *Platform) StartTyping(ctx context.Context, rctx any) (stop func())

StartTyping adds an emoji reaction to the user's message and returns a stop function that removes the reaction when processing is complete.

func (*Platform) UpdateMessage

func (p *Platform) UpdateMessage(ctx context.Context, previewHandle any, content string) error

UpdateMessage edits an existing card message identified by previewHandle. Uses the Patch API (HTTP PATCH) which is required for interactive card messages.

Jump to

Keyboard shortcuts

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