mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-25 00:36:31 +02:00
Merge remote-tracking branch 'upstream/dev' into electon-desktop
This commit is contained in:
commit
ab3c636bcd
85 changed files with 4642 additions and 414 deletions
|
|
@ -277,6 +277,19 @@ class ConnectorsApiService {
|
|||
}>(`/api/v1/connectors/${connectorId}/drive-picker-token`);
|
||||
};
|
||||
|
||||
/**
|
||||
* List OneDrive folders and files
|
||||
*/
|
||||
listOneDriveFolders = async (request: { connector_id: number; parent_id?: string }) => {
|
||||
const queryParams = request.parent_id
|
||||
? `?parent_id=${encodeURIComponent(request.parent_id)}`
|
||||
: "";
|
||||
return baseApiService.get(
|
||||
`/api/v1/connectors/${request.connector_id}/onedrive/folders${queryParams}`,
|
||||
listGoogleDriveFoldersResponse
|
||||
);
|
||||
};
|
||||
|
||||
// =============================================================================
|
||||
// MCP Connector Methods
|
||||
// =============================================================================
|
||||
|
|
|
|||
|
|
@ -132,11 +132,30 @@ export function buildContentForPersistence(
|
|||
return parts.length > 0 ? parts : [{ type: "text", text: "" }];
|
||||
}
|
||||
|
||||
export type SSEEvent =
|
||||
| { type: "text-delta"; delta: string }
|
||||
| { type: "tool-input-start"; toolCallId: string; toolName: string }
|
||||
| {
|
||||
type: "tool-input-available";
|
||||
toolCallId: string;
|
||||
toolName: string;
|
||||
input: Record<string, unknown>;
|
||||
}
|
||||
| {
|
||||
type: "tool-output-available";
|
||||
toolCallId: string;
|
||||
output: Record<string, unknown>;
|
||||
}
|
||||
| { type: "data-thinking-step"; data: ThinkingStepData }
|
||||
| { type: "data-thread-title-update"; data: { threadId: number; title: string } }
|
||||
| { type: "data-interrupt-request"; data: Record<string, unknown> }
|
||||
| { type: "error"; errorText: string };
|
||||
|
||||
/**
|
||||
* Async generator that reads an SSE stream and yields parsed JSON objects.
|
||||
* Handles buffering, event splitting, and skips malformed JSON / [DONE] lines.
|
||||
*/
|
||||
export async function* readSSEStream(response: Response): AsyncGenerator<unknown> {
|
||||
export async function* readSSEStream(response: Response): AsyncGenerator<SSEEvent> {
|
||||
if (!response.body) {
|
||||
throw new Error("No response body");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ export const getConnectorTypeDisplay = (type: string): string => {
|
|||
BAIDU_SEARCH_API: "Baidu Search",
|
||||
SLACK_CONNECTOR: "Slack",
|
||||
TEAMS_CONNECTOR: "Microsoft Teams",
|
||||
ONEDRIVE_CONNECTOR: "OneDrive",
|
||||
NOTION_CONNECTOR: "Notion",
|
||||
GITHUB_CONNECTOR: "GitHub",
|
||||
LINEAR_CONNECTOR: "Linear",
|
||||
|
|
|
|||
|
|
@ -79,10 +79,6 @@ export const cacheKeys = {
|
|||
folders: (connectorId: number, parentId?: string) =>
|
||||
["connectors", "google-drive", connectorId, "folders", parentId] as const,
|
||||
},
|
||||
composioDrive: {
|
||||
folders: (connectorId: number, parentId?: string) =>
|
||||
["connectors", "composio-drive", connectorId, "folders", parentId] as const,
|
||||
},
|
||||
},
|
||||
comments: {
|
||||
byMessage: (messageId: number) => ["comments", "message", messageId] as const,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue