fix: msteams attachments + plugin prompt hints
Co-authored-by: Christof <10854026+Evizero@users.noreply.github.com>
This commit is contained in:
@@ -21,6 +21,13 @@ export function supportsChannelMessageButtons(cfg: ClawdbotConfig): boolean {
|
||||
return false;
|
||||
}
|
||||
|
||||
export function supportsChannelMessageCards(cfg: ClawdbotConfig): boolean {
|
||||
for (const plugin of listChannelPlugins()) {
|
||||
if (plugin.actions?.supportsCards?.({ cfg })) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
export async function dispatchChannelMessageAction(
|
||||
ctx: ChannelMessageActionContext,
|
||||
): Promise<AgentToolResult<unknown> | null> {
|
||||
|
||||
@@ -240,6 +240,10 @@ export type ChannelMessagingAdapter = {
|
||||
}) => string;
|
||||
};
|
||||
|
||||
export type ChannelAgentPromptAdapter = {
|
||||
messageToolHints?: (params: { cfg: ClawdbotConfig; accountId?: string | null }) => string[];
|
||||
};
|
||||
|
||||
export type ChannelDirectoryEntryKind = "user" | "group" | "channel";
|
||||
|
||||
export type ChannelDirectoryEntry = {
|
||||
@@ -281,6 +285,7 @@ export type ChannelMessageActionAdapter = {
|
||||
listActions?: (params: { cfg: ClawdbotConfig }) => ChannelMessageActionName[];
|
||||
supportsAction?: (params: { action: ChannelMessageActionName }) => boolean;
|
||||
supportsButtons?: (params: { cfg: ClawdbotConfig }) => boolean;
|
||||
supportsCards?: (params: { cfg: ClawdbotConfig }) => boolean;
|
||||
extractToolSend?: (params: { args: Record<string, unknown> }) => ChannelToolSend | null;
|
||||
handleAction?: (ctx: ChannelMessageActionContext) => Promise<AgentToolResult<unknown>>;
|
||||
};
|
||||
|
||||
@@ -20,6 +20,7 @@ import type {
|
||||
ChannelAgentToolFactory,
|
||||
ChannelCapabilities,
|
||||
ChannelId,
|
||||
ChannelAgentPromptAdapter,
|
||||
ChannelMentionAdapter,
|
||||
ChannelMessageActionAdapter,
|
||||
ChannelMessagingAdapter,
|
||||
@@ -73,6 +74,7 @@ export type ChannelPlugin<ResolvedAccount = any> = {
|
||||
streaming?: ChannelStreamingAdapter;
|
||||
threading?: ChannelThreadingAdapter;
|
||||
messaging?: ChannelMessagingAdapter;
|
||||
agentPrompt?: ChannelAgentPromptAdapter;
|
||||
directory?: ChannelDirectoryAdapter;
|
||||
resolver?: ChannelResolverAdapter;
|
||||
actions?: ChannelMessageActionAdapter;
|
||||
|
||||
@@ -31,6 +31,7 @@ export type {
|
||||
export type {
|
||||
ChannelAccountSnapshot,
|
||||
ChannelAccountState,
|
||||
ChannelAgentPromptAdapter,
|
||||
ChannelAgentTool,
|
||||
ChannelAgentToolFactory,
|
||||
ChannelCapabilities,
|
||||
|
||||
Reference in New Issue
Block a user