Files
cobble/src/functions/frontend/post-session-api.ts
T
tbenandClaude Opus 5.5 f13fa863c5 Trim page props and page the conversation's messages
Bot and workspace lists in page props leave out instructions, memory and
workspace context, and carry the last message as a short preview. The
header avatar's edit form loads the bot's instructions when it opens.
The conversation renders its latest 30 messages and loads older ones as
the thread scrolls to its top.

Also: the composer shows a placeholder until its editor loads, and
`bun start` no longer builds first.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-20 20:09:01 +01:00

25 lines
679 B
TypeScript

import fetchApi from "@moduletrace/twui/utils/fetch/fetchApi";
import type { APIResponseObject } from "@moduletrace/bunext/types";
type Params = {
/**
* Under `/api/admin/bots/`.
*/
path: | "list-sessions"
| "new-session"
| "reopen-session"
| "session-messages"
| "older-messages";
body: Record<string, unknown>;
};
/**
* Posts to a conversation-session API route.
*/
export default async function postSessionApi<T extends { [k: string]: any }>({ path, body }: Params) {
return await fetchApi<Record<string, unknown>, APIResponseObject<T>>(`/api/admin/bots/${path}`, {
method: "POST",
body,
});
}