feat: add doc copilot context api (#10103)

### What Changed?
- Add graphql APIs.
- Provide context and session service in `AIProvider`.
- Rename the state from `embedding` to `processing`.
- Reafctor front-end session create, update and save logic.

Persist the document selected by the user:
[录屏2025-02-08 11.04.40.mov <span class="graphite__hidden">(uploaded via Graphite)</span> <img class="graphite__hidden" src="https://app.graphite.dev/api/v1/graphite/video/thumbnail/sJGviKxfE3Ap685cl5bj/195a85f2-43c4-4e49-88d9-6b5fc4f235ca.mov" />](https://app.graphite.dev/media/video/sJGviKxfE3Ap685cl5bj/195a85f2-43c4-4e49-88d9-6b5fc4f235ca.mov)
This commit is contained in:
akumatus
2025-02-12 08:33:06 +00:00
parent 53fdb1e8a5
commit 58fed5928b
21 changed files with 588 additions and 244 deletions

View File

@@ -713,7 +713,7 @@ type Mutation {
removeAvatar: RemoveAvatar!
"""remove a doc from context"""
removeContextDoc(options: RemoveContextFileInput!): Boolean!
removeContextDoc(options: RemoveContextDocInput!): Boolean!
removeWorkspaceFeature(feature: FeatureType!, workspaceId: String!): Boolean!
resumeSubscription(idempotencyKey: String @deprecated(reason: "use header `Idempotency-Key`"), plan: SubscriptionPlan = Pro, workspaceId: String): SubscriptionType!
revoke(userId: String!, workspaceId: String!): Boolean!
@@ -891,9 +891,9 @@ type RemoveAvatar {
success: Boolean!
}
input RemoveContextFileInput {
input RemoveContextDocInput {
contextId: String!
fileId: String!
docId: String!
}
input RevokeDocUserRoleInput {