mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-27 07:16:19 +09:00
refactor: inbox (#137)
* refactor: inbox * fix: migrations * fix: migrations
This commit is contained in:
@@ -29,13 +29,20 @@ ${skill.content}
|
||||
|
||||
const formatInbox = (items: InboxItem[]): string => {
|
||||
if (!items || items.length === 0) return ''
|
||||
const formatted = items.map((item) => ({
|
||||
id: item.id,
|
||||
source: item.source,
|
||||
header: item.header,
|
||||
content: item.content,
|
||||
createdAt: item.createdAt,
|
||||
}))
|
||||
return `
|
||||
## Inbox (${items.length} unread)
|
||||
|
||||
These are messages from other channels — NOT from the current conversation. Use ${quote('send')} or ${quote('react')} if you want to respond to any of them.
|
||||
|
||||
<inbox>
|
||||
${JSON.stringify(items)}
|
||||
${JSON.stringify(formatted)}
|
||||
</inbox>
|
||||
|
||||
Use ${quote('search_inbox')} to find older messages by keyword.
|
||||
|
||||
@@ -33,7 +33,8 @@ export const allActions = Object.values(AgentAction)
|
||||
export interface InboxItem {
|
||||
id: string
|
||||
source: string
|
||||
content: Record<string, unknown>
|
||||
header: Record<string, unknown>
|
||||
content: string
|
||||
createdAt: string
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -499,6 +499,12 @@ export type HandlersPingResponse = {
|
||||
status?: string;
|
||||
};
|
||||
|
||||
export type HandlersRefreshResponse = {
|
||||
access_token?: string;
|
||||
expires_at?: string;
|
||||
token_type?: string;
|
||||
};
|
||||
|
||||
export type HandlersSkillItem = {
|
||||
content?: string;
|
||||
description?: string;
|
||||
@@ -623,19 +629,23 @@ export type InboxCountResult = {
|
||||
};
|
||||
|
||||
export type InboxCreateRequest = {
|
||||
action?: string;
|
||||
bot_id?: string;
|
||||
content?: {
|
||||
content?: string;
|
||||
header?: {
|
||||
[key: string]: unknown;
|
||||
};
|
||||
source?: string;
|
||||
};
|
||||
|
||||
export type InboxItem = {
|
||||
action?: string;
|
||||
bot_id?: string;
|
||||
content?: {
|
||||
content?: string;
|
||||
created_at?: string;
|
||||
header?: {
|
||||
[key: string]: unknown;
|
||||
};
|
||||
created_at?: string;
|
||||
id?: string;
|
||||
is_read?: boolean;
|
||||
read_at?: string;
|
||||
@@ -975,7 +985,7 @@ export type SearchprovidersProviderMeta = {
|
||||
provider?: string;
|
||||
};
|
||||
|
||||
export type SearchprovidersProviderName = 'brave' | 'bing' | 'google';
|
||||
export type SearchprovidersProviderName = 'brave' | 'bing' | 'google' | 'tavily';
|
||||
|
||||
export type SearchprovidersUpdateRequest = {
|
||||
config?: {
|
||||
@@ -1130,6 +1140,35 @@ export type PostAuthLoginResponses = {
|
||||
|
||||
export type PostAuthLoginResponse = PostAuthLoginResponses[keyof PostAuthLoginResponses];
|
||||
|
||||
export type PostAuthRefreshData = {
|
||||
body?: never;
|
||||
path?: never;
|
||||
query?: never;
|
||||
url: '/auth/refresh';
|
||||
};
|
||||
|
||||
export type PostAuthRefreshErrors = {
|
||||
/**
|
||||
* Unauthorized
|
||||
*/
|
||||
401: HandlersErrorResponse;
|
||||
/**
|
||||
* Internal Server Error
|
||||
*/
|
||||
500: HandlersErrorResponse;
|
||||
};
|
||||
|
||||
export type PostAuthRefreshError = PostAuthRefreshErrors[keyof PostAuthRefreshErrors];
|
||||
|
||||
export type PostAuthRefreshResponses = {
|
||||
/**
|
||||
* OK
|
||||
*/
|
||||
200: HandlersRefreshResponse;
|
||||
};
|
||||
|
||||
export type PostAuthRefreshResponse = PostAuthRefreshResponses[keyof PostAuthRefreshResponses];
|
||||
|
||||
export type GetBotsData = {
|
||||
body?: never;
|
||||
path?: never;
|
||||
|
||||
Reference in New Issue
Block a user