feat(server): paginated list endpoint (#13026)

fix AI-323
This commit is contained in:
DarkSky
2025-07-08 17:11:58 +08:00
committed by GitHub
parent 8c49a45162
commit 6dac94d90a
36 changed files with 1136 additions and 702 deletions

View File

@@ -1,17 +1,29 @@
query getCopilotHistoryIds(
$workspaceId: String!
$pagination: PaginationInput!
$docId: String
$options: QueryChatHistoriesInput
) {
currentUser {
copilot(workspaceId: $workspaceId) {
histories(docId: $docId, options: $options) {
sessionId
pinned
messages {
id
role
createdAt
chats(pagination: $pagination, docId: $docId, options: $options) {
pageInfo {
hasNextPage
hasPreviousPage
startCursor
endCursor
}
edges {
cursor
node {
sessionId
pinned
messages {
id
role
createdAt
}
}
}
}
}

View File

@@ -1,31 +1,15 @@
#import "./fragments/copilot.gql"
query getCopilotDocSessions(
$workspaceId: String!
$docId: String!
$pagination: PaginationInput!
$options: QueryChatHistoriesInput
) {
currentUser {
copilot(workspaceId: $workspaceId) {
histories(docId: $docId, options: $options) {
sessionId
pinned
tokens
action
createdAt
messages {
id
role
content
streamObjects {
type
textDelta
toolCallId
toolName
args
result
}
attachments
createdAt
}
chats(pagination: $pagination, docId: $docId, options: $options) {
...PaginatedCopilotChats
}
}
}

View File

@@ -1,3 +1,5 @@
#import "./fragments/copilot.gql"
query getCopilotPinnedSessions(
$workspaceId: String!
$docId: String
@@ -6,32 +8,12 @@ query getCopilotPinnedSessions(
) {
currentUser {
copilot(workspaceId: $workspaceId) {
histories(docId: $docId, options: {
limit: 1,
chats(pagination: { first: 1 }, docId: $docId, options: {
pinned: true,
messageOrder: $messageOrder,
withPrompt: $withPrompt
}) {
sessionId
pinned
tokens
action
createdAt
messages {
id
role
content
streamObjects {
type
textDelta
toolCallId
toolName
args
result
}
attachments
createdAt
}
...PaginatedCopilotChats
}
}
}

View File

@@ -1,30 +1,14 @@
#import "./fragments/copilot.gql"
query getCopilotWorkspaceSessions(
$workspaceId: String!
$pagination: PaginationInput!
$options: QueryChatHistoriesInput
) {
currentUser {
copilot(workspaceId: $workspaceId) {
histories(docId: null, options: $options) {
sessionId
pinned
tokens
action
createdAt
messages {
id
role
content
streamObjects {
type
textDelta
toolCallId
toolName
args
result
}
attachments
createdAt
}
chats(pagination: $pagination, docId: null, options: $options) {
...PaginatedCopilotChats
}
}
}

View File

@@ -1,31 +1,15 @@
#import "./fragments/copilot.gql"
query getCopilotHistories(
$workspaceId: String!
$pagination: PaginationInput!
$docId: String
$options: QueryChatHistoriesInput
) {
currentUser {
copilot(workspaceId: $workspaceId) {
histories(docId: $docId, options: $options) {
sessionId
pinned
tokens
action
createdAt
messages {
id
role
content
streamObjects {
type
textDelta
toolCallId
toolName
args
result
}
attachments
createdAt
}
chats(pagination: $pagination, docId: $docId, options: $options) {
...PaginatedCopilotChats
}
}
}

View File

@@ -1,34 +1,22 @@
#import "./fragments/copilot.gql"
query getCopilotLatestDocSession(
$workspaceId: String!
$docId: String!
) {
currentUser {
copilot(workspaceId: $workspaceId) {
histories(
chats(
pagination: { first: 1 }
docId: $docId
options: {
limit: 1
sessionOrder: desc
action: false
fork: false
withMessages: true
}
) {
sessionId
workspaceId
docId
pinned
action
tokens
createdAt
updatedAt
messages {
id
role
content
attachments
params
createdAt
}
...PaginatedCopilotChats
}
}
}

View File

@@ -1,18 +1,16 @@
#import "./fragments/copilot.gql"
query getCopilotSession(
$workspaceId: String!
$sessionId: String!
) {
currentUser {
copilot(workspaceId: $workspaceId) {
session(sessionId: $sessionId) {
id
parentSessionId
docId
pinned
title
promptName
model
optionalModels
chats(
pagination: { first: 1 }
options: { sessionId: $sessionId }
) {
...PaginatedCopilotChats
}
}
}

View File

@@ -1,23 +1,20 @@
#import "./fragments/copilot.gql"
query getCopilotRecentSessions(
$workspaceId: String!
$limit: Int = 10
) {
currentUser {
copilot(workspaceId: $workspaceId) {
histories(
chats(
pagination: { first: $limit }
options: {
limit: $limit
fork: false
sessionOrder: desc
withMessages: true
}
) {
sessionId
workspaceId
docId
pinned
action
tokens
createdAt
updatedAt
...PaginatedCopilotChats
}
}
}

View File

@@ -1,19 +1,15 @@
#import "./fragments/copilot.gql"
query getCopilotSessions(
$workspaceId: String!
$pagination: PaginationInput!
$docId: String
$options: QueryChatSessionsInput
$options: QueryChatHistoriesInput
) {
currentUser {
copilot(workspaceId: $workspaceId) {
sessions(docId: $docId, options: $options) {
id
parentSessionId
docId
pinned
title
promptName
model
optionalModels
chats(pagination: $pagination, docId: $docId, options: $options) {
...PaginatedCopilotChats
}
}
}

View File

@@ -0,0 +1,49 @@
fragment CopilotChatMessage on ChatMessage {
id
role
content
attachments
streamObjects {
type
textDelta
toolCallId
toolName
args
result
}
createdAt
}
fragment CopilotChatHistory on CopilotHistories {
sessionId
workspaceId
docId
parentSessionId
promptName
model
optionalModels
action
pinned
title
tokens
messages {
...CopilotChatMessage
}
createdAt
updatedAt
}
fragment PaginatedCopilotChats on PaginatedCopilotHistoriesType {
pageInfo {
hasNextPage
hasPreviousPage
startCursor
endCursor
}
edges {
cursor
node {
...CopilotChatHistory
}
}
}

View File

@@ -6,6 +6,53 @@ export interface GraphQLQuery {
file?: boolean;
deprecations?: string[];
}
export const copilotChatMessageFragment = `fragment CopilotChatMessage on ChatMessage {
id
role
content
attachments
streamObjects {
type
textDelta
toolCallId
toolName
args
result
}
createdAt
}`;
export const copilotChatHistoryFragment = `fragment CopilotChatHistory on CopilotHistories {
sessionId
workspaceId
docId
parentSessionId
promptName
model
optionalModels
action
pinned
title
tokens
messages {
...CopilotChatMessage
}
createdAt
updatedAt
}`;
export const paginatedCopilotChatsFragment = `fragment PaginatedCopilotChats on PaginatedCopilotHistoriesType {
pageInfo {
hasNextPage
hasPreviousPage
startCursor
endCursor
}
edges {
cursor
node {
...CopilotChatHistory
}
}
}`;
export const credentialsRequirementsFragment = `fragment CredentialsRequirements on CredentialsRequirementType {
password {
...PasswordLimits
@@ -762,16 +809,27 @@ export const queueWorkspaceEmbeddingMutation = {
export const getCopilotHistoryIdsQuery = {
id: 'getCopilotHistoryIdsQuery' as const,
op: 'getCopilotHistoryIds',
query: `query getCopilotHistoryIds($workspaceId: String!, $docId: String, $options: QueryChatHistoriesInput) {
query: `query getCopilotHistoryIds($workspaceId: String!, $pagination: PaginationInput!, $docId: String, $options: QueryChatHistoriesInput) {
currentUser {
copilot(workspaceId: $workspaceId) {
histories(docId: $docId, options: $options) {
sessionId
pinned
messages {
id
role
createdAt
chats(pagination: $pagination, docId: $docId, options: $options) {
pageInfo {
hasNextPage
hasPreviousPage
startCursor
endCursor
}
edges {
cursor
node {
sessionId
pinned
messages {
id
role
createdAt
}
}
}
}
}
@@ -782,34 +840,18 @@ export const getCopilotHistoryIdsQuery = {
export const getCopilotDocSessionsQuery = {
id: 'getCopilotDocSessionsQuery' as const,
op: 'getCopilotDocSessions',
query: `query getCopilotDocSessions($workspaceId: String!, $docId: String!, $options: QueryChatHistoriesInput) {
query: `query getCopilotDocSessions($workspaceId: String!, $docId: String!, $pagination: PaginationInput!, $options: QueryChatHistoriesInput) {
currentUser {
copilot(workspaceId: $workspaceId) {
histories(docId: $docId, options: $options) {
sessionId
pinned
tokens
action
createdAt
messages {
id
role
content
streamObjects {
type
textDelta
toolCallId
toolName
args
result
}
attachments
createdAt
}
chats(pagination: $pagination, docId: $docId, options: $options) {
...PaginatedCopilotChats
}
}
}
}`,
}
${copilotChatMessageFragment}
${copilotChatHistoryFragment}
${paginatedCopilotChatsFragment}`,
};
export const getCopilotPinnedSessionsQuery = {
@@ -818,100 +860,53 @@ export const getCopilotPinnedSessionsQuery = {
query: `query getCopilotPinnedSessions($workspaceId: String!, $docId: String, $messageOrder: ChatHistoryOrder, $withPrompt: Boolean) {
currentUser {
copilot(workspaceId: $workspaceId) {
histories(
chats(
pagination: {first: 1}
docId: $docId
options: {limit: 1, pinned: true, messageOrder: $messageOrder, withPrompt: $withPrompt}
options: {pinned: true, messageOrder: $messageOrder, withPrompt: $withPrompt}
) {
sessionId
pinned
tokens
action
createdAt
messages {
id
role
content
streamObjects {
type
textDelta
toolCallId
toolName
args
result
}
attachments
createdAt
}
...PaginatedCopilotChats
}
}
}
}`,
}
${copilotChatMessageFragment}
${copilotChatHistoryFragment}
${paginatedCopilotChatsFragment}`,
};
export const getCopilotWorkspaceSessionsQuery = {
id: 'getCopilotWorkspaceSessionsQuery' as const,
op: 'getCopilotWorkspaceSessions',
query: `query getCopilotWorkspaceSessions($workspaceId: String!, $options: QueryChatHistoriesInput) {
query: `query getCopilotWorkspaceSessions($workspaceId: String!, $pagination: PaginationInput!, $options: QueryChatHistoriesInput) {
currentUser {
copilot(workspaceId: $workspaceId) {
histories(docId: null, options: $options) {
sessionId
pinned
tokens
action
createdAt
messages {
id
role
content
streamObjects {
type
textDelta
toolCallId
toolName
args
result
}
attachments
createdAt
}
chats(pagination: $pagination, docId: null, options: $options) {
...PaginatedCopilotChats
}
}
}
}`,
}
${copilotChatMessageFragment}
${copilotChatHistoryFragment}
${paginatedCopilotChatsFragment}`,
};
export const getCopilotHistoriesQuery = {
id: 'getCopilotHistoriesQuery' as const,
op: 'getCopilotHistories',
query: `query getCopilotHistories($workspaceId: String!, $docId: String, $options: QueryChatHistoriesInput) {
query: `query getCopilotHistories($workspaceId: String!, $pagination: PaginationInput!, $docId: String, $options: QueryChatHistoriesInput) {
currentUser {
copilot(workspaceId: $workspaceId) {
histories(docId: $docId, options: $options) {
sessionId
pinned
tokens
action
createdAt
messages {
id
role
content
streamObjects {
type
textDelta
toolCallId
toolName
args
result
}
attachments
createdAt
}
chats(pagination: $pagination, docId: $docId, options: $options) {
...PaginatedCopilotChats
}
}
}
}`,
}
${copilotChatMessageFragment}
${copilotChatHistoryFragment}
${paginatedCopilotChatsFragment}`,
};
export const submitAudioTranscriptionMutation = {
@@ -1039,30 +1034,19 @@ export const getCopilotLatestDocSessionQuery = {
query: `query getCopilotLatestDocSession($workspaceId: String!, $docId: String!) {
currentUser {
copilot(workspaceId: $workspaceId) {
histories(
chats(
pagination: {first: 1}
docId: $docId
options: {limit: 1, sessionOrder: desc, action: false, fork: false}
options: {sessionOrder: desc, action: false, fork: false, withMessages: true}
) {
sessionId
workspaceId
docId
pinned
action
tokens
createdAt
updatedAt
messages {
id
role
content
attachments
params
createdAt
}
...PaginatedCopilotChats
}
}
}
}`,
}
${copilotChatMessageFragment}
${copilotChatHistoryFragment}
${paginatedCopilotChatsFragment}`,
};
export const getCopilotSessionQuery = {
@@ -1071,19 +1055,15 @@ export const getCopilotSessionQuery = {
query: `query getCopilotSession($workspaceId: String!, $sessionId: String!) {
currentUser {
copilot(workspaceId: $workspaceId) {
session(sessionId: $sessionId) {
id
parentSessionId
docId
pinned
title
promptName
model
optionalModels
chats(pagination: {first: 1}, options: {sessionId: $sessionId}) {
...PaginatedCopilotChats
}
}
}
}`,
}
${copilotChatMessageFragment}
${copilotChatHistoryFragment}
${paginatedCopilotChatsFragment}`,
};
export const getCopilotRecentSessionsQuery = {
@@ -1092,19 +1072,18 @@ export const getCopilotRecentSessionsQuery = {
query: `query getCopilotRecentSessions($workspaceId: String!, $limit: Int = 10) {
currentUser {
copilot(workspaceId: $workspaceId) {
histories(options: {limit: $limit, sessionOrder: desc}) {
sessionId
workspaceId
docId
pinned
action
tokens
createdAt
updatedAt
chats(
pagination: {first: $limit}
options: {fork: false, sessionOrder: desc, withMessages: true}
) {
...PaginatedCopilotChats
}
}
}
}`,
}
${copilotChatMessageFragment}
${copilotChatHistoryFragment}
${paginatedCopilotChatsFragment}`,
};
export const updateCopilotSessionMutation = {
@@ -1118,22 +1097,18 @@ export const updateCopilotSessionMutation = {
export const getCopilotSessionsQuery = {
id: 'getCopilotSessionsQuery' as const,
op: 'getCopilotSessions',
query: `query getCopilotSessions($workspaceId: String!, $docId: String, $options: QueryChatSessionsInput) {
query: `query getCopilotSessions($workspaceId: String!, $pagination: PaginationInput!, $docId: String, $options: QueryChatHistoriesInput) {
currentUser {
copilot(workspaceId: $workspaceId) {
sessions(docId: $docId, options: $options) {
id
parentSessionId
docId
pinned
title
promptName
model
optionalModels
chats(pagination: $pagination, docId: $docId, options: $options) {
...PaginatedCopilotChats
}
}
}
}`,
}
${copilotChatMessageFragment}
${copilotChatHistoryFragment}
${paginatedCopilotChatsFragment}`,
};
export const addWorkspaceEmbeddingFilesMutation = {

View File

@@ -245,14 +245,19 @@ export interface ContextWorkspaceEmbeddingStatus {
export interface Copilot {
__typename?: 'Copilot';
audioTranscription: Maybe<TranscriptionResultType>;
chats: PaginatedCopilotHistoriesType;
/** Get the context list of a session */
contexts: Array<CopilotContext>;
/** @deprecated use `chats` instead */
histories: Array<CopilotHistories>;
/** Get the quota of the user in the workspace */
quota: CopilotQuota;
/** Get the session by id */
session: CopilotSessionType;
/** Get the session list in the workspace */
/**
* Get the session list in the workspace
* @deprecated use `chats` instead
*/
sessions: Array<CopilotSessionType>;
workspaceId: Maybe<Scalars['ID']['output']>;
}
@@ -262,6 +267,12 @@ export interface CopilotAudioTranscriptionArgs {
jobId?: InputMaybe<Scalars['String']['input']>;
}
export interface CopilotChatsArgs {
docId?: InputMaybe<Scalars['String']['input']>;
options?: InputMaybe<QueryChatHistoriesInput>;
pagination: PaginationInput;
}
export interface CopilotContextsArgs {
contextId?: InputMaybe<Scalars['String']['input']>;
sessionId?: InputMaybe<Scalars['String']['input']>;
@@ -391,14 +402,25 @@ export interface CopilotHistories {
createdAt: Scalars['DateTime']['output'];
docId: Maybe<Scalars['String']['output']>;
messages: Array<ChatMessage>;
model: Scalars['String']['output'];
optionalModels: Array<Scalars['String']['output']>;
parentSessionId: Maybe<Scalars['String']['output']>;
pinned: Scalars['Boolean']['output'];
promptName: Scalars['String']['output'];
sessionId: Scalars['String']['output'];
title: Maybe<Scalars['String']['output']>;
/** The number of tokens used in the session */
tokens: Scalars['Int']['output'];
updatedAt: Scalars['DateTime']['output'];
workspaceId: Scalars['String']['output'];
}
export interface CopilotHistoriesTypeEdge {
__typename?: 'CopilotHistoriesTypeEdge';
cursor: Scalars['String']['output'];
node: CopilotHistories;
}
export interface CopilotInvalidContextDataType {
__typename?: 'CopilotInvalidContextDataType';
contextId: Scalars['String']['output'];
@@ -1954,6 +1976,13 @@ export interface PaginatedCommentObjectType {
totalCount: Scalars['Int']['output'];
}
export interface PaginatedCopilotHistoriesType {
__typename?: 'PaginatedCopilotHistoriesType';
edges: Array<CopilotHistoriesTypeEdge>;
pageInfo: PageInfo;
totalCount: Scalars['Int']['output'];
}
export interface PaginatedCopilotWorkspaceFileType {
__typename?: 'PaginatedCopilotWorkspaceFileType';
edges: Array<CopilotWorkspaceFileTypeEdge>;
@@ -2133,6 +2162,7 @@ export interface QueryChatHistoriesInput {
sessionId?: InputMaybe<Scalars['String']['input']>;
sessionOrder?: InputMaybe<ChatHistoryOrder>;
skip?: InputMaybe<Scalars['Int']['input']>;
withMessages?: InputMaybe<Scalars['Boolean']['input']>;
withPrompt?: InputMaybe<Scalars['Boolean']['input']>;
}
@@ -3757,6 +3787,7 @@ export type QueueWorkspaceEmbeddingMutation = {
export type GetCopilotHistoryIdsQueryVariables = Exact<{
workspaceId: Scalars['String']['input'];
pagination: PaginationInput;
docId?: InputMaybe<Scalars['String']['input']>;
options?: InputMaybe<QueryChatHistoriesInput>;
}>;
@@ -3767,17 +3798,31 @@ export type GetCopilotHistoryIdsQuery = {
__typename?: 'UserType';
copilot: {
__typename?: 'Copilot';
histories: Array<{
__typename?: 'CopilotHistories';
sessionId: string;
pinned: boolean;
messages: Array<{
__typename?: 'ChatMessage';
id: string | null;
role: string;
createdAt: string;
chats: {
__typename?: 'PaginatedCopilotHistoriesType';
pageInfo: {
__typename?: 'PageInfo';
hasNextPage: boolean;
hasPreviousPage: boolean;
startCursor: string | null;
endCursor: string | null;
};
edges: Array<{
__typename?: 'CopilotHistoriesTypeEdge';
cursor: string;
node: {
__typename?: 'CopilotHistories';
sessionId: string;
pinned: boolean;
messages: Array<{
__typename?: 'ChatMessage';
id: string | null;
role: string;
createdAt: string;
}>;
};
}>;
}>;
};
};
} | null;
};
@@ -3785,6 +3830,7 @@ export type GetCopilotHistoryIdsQuery = {
export type GetCopilotDocSessionsQueryVariables = Exact<{
workspaceId: Scalars['String']['input'];
docId: Scalars['String']['input'];
pagination: PaginationInput;
options?: InputMaybe<QueryChatHistoriesInput>;
}>;
@@ -3794,31 +3840,53 @@ export type GetCopilotDocSessionsQuery = {
__typename?: 'UserType';
copilot: {
__typename?: 'Copilot';
histories: Array<{
__typename?: 'CopilotHistories';
sessionId: string;
pinned: boolean;
tokens: number;
action: string | null;
createdAt: string;
messages: Array<{
__typename?: 'ChatMessage';
id: string | null;
role: string;
content: string;
attachments: Array<string> | null;
createdAt: string;
streamObjects: Array<{
__typename?: 'StreamObject';
type: string;
textDelta: string | null;
toolCallId: string | null;
toolName: string | null;
args: Record<string, string> | null;
result: Record<string, string> | null;
}> | null;
chats: {
__typename?: 'PaginatedCopilotHistoriesType';
pageInfo: {
__typename?: 'PageInfo';
hasNextPage: boolean;
hasPreviousPage: boolean;
startCursor: string | null;
endCursor: string | null;
};
edges: Array<{
__typename?: 'CopilotHistoriesTypeEdge';
cursor: string;
node: {
__typename?: 'CopilotHistories';
sessionId: string;
workspaceId: string;
docId: string | null;
parentSessionId: string | null;
promptName: string;
model: string;
optionalModels: Array<string>;
action: string | null;
pinned: boolean;
title: string | null;
tokens: number;
createdAt: string;
updatedAt: string;
messages: Array<{
__typename?: 'ChatMessage';
id: string | null;
role: string;
content: string;
attachments: Array<string> | null;
createdAt: string;
streamObjects: Array<{
__typename?: 'StreamObject';
type: string;
textDelta: string | null;
toolCallId: string | null;
toolName: string | null;
args: Record<string, string> | null;
result: Record<string, string> | null;
}> | null;
}>;
};
}>;
}>;
};
};
} | null;
};
@@ -3836,37 +3904,60 @@ export type GetCopilotPinnedSessionsQuery = {
__typename?: 'UserType';
copilot: {
__typename?: 'Copilot';
histories: Array<{
__typename?: 'CopilotHistories';
sessionId: string;
pinned: boolean;
tokens: number;
action: string | null;
createdAt: string;
messages: Array<{
__typename?: 'ChatMessage';
id: string | null;
role: string;
content: string;
attachments: Array<string> | null;
createdAt: string;
streamObjects: Array<{
__typename?: 'StreamObject';
type: string;
textDelta: string | null;
toolCallId: string | null;
toolName: string | null;
args: Record<string, string> | null;
result: Record<string, string> | null;
}> | null;
chats: {
__typename?: 'PaginatedCopilotHistoriesType';
pageInfo: {
__typename?: 'PageInfo';
hasNextPage: boolean;
hasPreviousPage: boolean;
startCursor: string | null;
endCursor: string | null;
};
edges: Array<{
__typename?: 'CopilotHistoriesTypeEdge';
cursor: string;
node: {
__typename?: 'CopilotHistories';
sessionId: string;
workspaceId: string;
docId: string | null;
parentSessionId: string | null;
promptName: string;
model: string;
optionalModels: Array<string>;
action: string | null;
pinned: boolean;
title: string | null;
tokens: number;
createdAt: string;
updatedAt: string;
messages: Array<{
__typename?: 'ChatMessage';
id: string | null;
role: string;
content: string;
attachments: Array<string> | null;
createdAt: string;
streamObjects: Array<{
__typename?: 'StreamObject';
type: string;
textDelta: string | null;
toolCallId: string | null;
toolName: string | null;
args: Record<string, string> | null;
result: Record<string, string> | null;
}> | null;
}>;
};
}>;
}>;
};
};
} | null;
};
export type GetCopilotWorkspaceSessionsQueryVariables = Exact<{
workspaceId: Scalars['String']['input'];
pagination: PaginationInput;
options?: InputMaybe<QueryChatHistoriesInput>;
}>;
@@ -3876,37 +3967,60 @@ export type GetCopilotWorkspaceSessionsQuery = {
__typename?: 'UserType';
copilot: {
__typename?: 'Copilot';
histories: Array<{
__typename?: 'CopilotHistories';
sessionId: string;
pinned: boolean;
tokens: number;
action: string | null;
createdAt: string;
messages: Array<{
__typename?: 'ChatMessage';
id: string | null;
role: string;
content: string;
attachments: Array<string> | null;
createdAt: string;
streamObjects: Array<{
__typename?: 'StreamObject';
type: string;
textDelta: string | null;
toolCallId: string | null;
toolName: string | null;
args: Record<string, string> | null;
result: Record<string, string> | null;
}> | null;
chats: {
__typename?: 'PaginatedCopilotHistoriesType';
pageInfo: {
__typename?: 'PageInfo';
hasNextPage: boolean;
hasPreviousPage: boolean;
startCursor: string | null;
endCursor: string | null;
};
edges: Array<{
__typename?: 'CopilotHistoriesTypeEdge';
cursor: string;
node: {
__typename?: 'CopilotHistories';
sessionId: string;
workspaceId: string;
docId: string | null;
parentSessionId: string | null;
promptName: string;
model: string;
optionalModels: Array<string>;
action: string | null;
pinned: boolean;
title: string | null;
tokens: number;
createdAt: string;
updatedAt: string;
messages: Array<{
__typename?: 'ChatMessage';
id: string | null;
role: string;
content: string;
attachments: Array<string> | null;
createdAt: string;
streamObjects: Array<{
__typename?: 'StreamObject';
type: string;
textDelta: string | null;
toolCallId: string | null;
toolName: string | null;
args: Record<string, string> | null;
result: Record<string, string> | null;
}> | null;
}>;
};
}>;
}>;
};
};
} | null;
};
export type GetCopilotHistoriesQueryVariables = Exact<{
workspaceId: Scalars['String']['input'];
pagination: PaginationInput;
docId?: InputMaybe<Scalars['String']['input']>;
options?: InputMaybe<QueryChatHistoriesInput>;
}>;
@@ -3917,31 +4031,53 @@ export type GetCopilotHistoriesQuery = {
__typename?: 'UserType';
copilot: {
__typename?: 'Copilot';
histories: Array<{
__typename?: 'CopilotHistories';
sessionId: string;
pinned: boolean;
tokens: number;
action: string | null;
createdAt: string;
messages: Array<{
__typename?: 'ChatMessage';
id: string | null;
role: string;
content: string;
attachments: Array<string> | null;
createdAt: string;
streamObjects: Array<{
__typename?: 'StreamObject';
type: string;
textDelta: string | null;
toolCallId: string | null;
toolName: string | null;
args: Record<string, string> | null;
result: Record<string, string> | null;
}> | null;
chats: {
__typename?: 'PaginatedCopilotHistoriesType';
pageInfo: {
__typename?: 'PageInfo';
hasNextPage: boolean;
hasPreviousPage: boolean;
startCursor: string | null;
endCursor: string | null;
};
edges: Array<{
__typename?: 'CopilotHistoriesTypeEdge';
cursor: string;
node: {
__typename?: 'CopilotHistories';
sessionId: string;
workspaceId: string;
docId: string | null;
parentSessionId: string | null;
promptName: string;
model: string;
optionalModels: Array<string>;
action: string | null;
pinned: boolean;
title: string | null;
tokens: number;
createdAt: string;
updatedAt: string;
messages: Array<{
__typename?: 'ChatMessage';
id: string | null;
role: string;
content: string;
attachments: Array<string> | null;
createdAt: string;
streamObjects: Array<{
__typename?: 'StreamObject';
type: string;
textDelta: string | null;
toolCallId: string | null;
toolName: string | null;
args: Record<string, string> | null;
result: Record<string, string> | null;
}> | null;
}>;
};
}>;
}>;
};
};
} | null;
};
@@ -4095,26 +4231,53 @@ export type GetCopilotLatestDocSessionQuery = {
__typename?: 'UserType';
copilot: {
__typename?: 'Copilot';
histories: Array<{
__typename?: 'CopilotHistories';
sessionId: string;
workspaceId: string;
docId: string | null;
pinned: boolean;
action: string | null;
tokens: number;
createdAt: string;
updatedAt: string;
messages: Array<{
__typename?: 'ChatMessage';
id: string | null;
role: string;
content: string;
attachments: Array<string> | null;
params: Record<string, string> | null;
createdAt: string;
chats: {
__typename?: 'PaginatedCopilotHistoriesType';
pageInfo: {
__typename?: 'PageInfo';
hasNextPage: boolean;
hasPreviousPage: boolean;
startCursor: string | null;
endCursor: string | null;
};
edges: Array<{
__typename?: 'CopilotHistoriesTypeEdge';
cursor: string;
node: {
__typename?: 'CopilotHistories';
sessionId: string;
workspaceId: string;
docId: string | null;
parentSessionId: string | null;
promptName: string;
model: string;
optionalModels: Array<string>;
action: string | null;
pinned: boolean;
title: string | null;
tokens: number;
createdAt: string;
updatedAt: string;
messages: Array<{
__typename?: 'ChatMessage';
id: string | null;
role: string;
content: string;
attachments: Array<string> | null;
createdAt: string;
streamObjects: Array<{
__typename?: 'StreamObject';
type: string;
textDelta: string | null;
toolCallId: string | null;
toolName: string | null;
args: Record<string, string> | null;
result: Record<string, string> | null;
}> | null;
}>;
};
}>;
}>;
};
};
} | null;
};
@@ -4130,16 +4293,52 @@ export type GetCopilotSessionQuery = {
__typename?: 'UserType';
copilot: {
__typename?: 'Copilot';
session: {
__typename?: 'CopilotSessionType';
id: string;
parentSessionId: string | null;
docId: string | null;
pinned: boolean;
title: string | null;
promptName: string;
model: string;
optionalModels: Array<string>;
chats: {
__typename?: 'PaginatedCopilotHistoriesType';
pageInfo: {
__typename?: 'PageInfo';
hasNextPage: boolean;
hasPreviousPage: boolean;
startCursor: string | null;
endCursor: string | null;
};
edges: Array<{
__typename?: 'CopilotHistoriesTypeEdge';
cursor: string;
node: {
__typename?: 'CopilotHistories';
sessionId: string;
workspaceId: string;
docId: string | null;
parentSessionId: string | null;
promptName: string;
model: string;
optionalModels: Array<string>;
action: string | null;
pinned: boolean;
title: string | null;
tokens: number;
createdAt: string;
updatedAt: string;
messages: Array<{
__typename?: 'ChatMessage';
id: string | null;
role: string;
content: string;
attachments: Array<string> | null;
createdAt: string;
streamObjects: Array<{
__typename?: 'StreamObject';
type: string;
textDelta: string | null;
toolCallId: string | null;
toolName: string | null;
args: Record<string, string> | null;
result: Record<string, string> | null;
}> | null;
}>;
};
}>;
};
};
} | null;
@@ -4156,17 +4355,53 @@ export type GetCopilotRecentSessionsQuery = {
__typename?: 'UserType';
copilot: {
__typename?: 'Copilot';
histories: Array<{
__typename?: 'CopilotHistories';
sessionId: string;
workspaceId: string;
docId: string | null;
pinned: boolean;
action: string | null;
tokens: number;
createdAt: string;
updatedAt: string;
}>;
chats: {
__typename?: 'PaginatedCopilotHistoriesType';
pageInfo: {
__typename?: 'PageInfo';
hasNextPage: boolean;
hasPreviousPage: boolean;
startCursor: string | null;
endCursor: string | null;
};
edges: Array<{
__typename?: 'CopilotHistoriesTypeEdge';
cursor: string;
node: {
__typename?: 'CopilotHistories';
sessionId: string;
workspaceId: string;
docId: string | null;
parentSessionId: string | null;
promptName: string;
model: string;
optionalModels: Array<string>;
action: string | null;
pinned: boolean;
title: string | null;
tokens: number;
createdAt: string;
updatedAt: string;
messages: Array<{
__typename?: 'ChatMessage';
id: string | null;
role: string;
content: string;
attachments: Array<string> | null;
createdAt: string;
streamObjects: Array<{
__typename?: 'StreamObject';
type: string;
textDelta: string | null;
toolCallId: string | null;
toolName: string | null;
args: Record<string, string> | null;
result: Record<string, string> | null;
}> | null;
}>;
};
}>;
};
};
} | null;
};
@@ -4182,8 +4417,9 @@ export type UpdateCopilotSessionMutation = {
export type GetCopilotSessionsQueryVariables = Exact<{
workspaceId: Scalars['String']['input'];
pagination: PaginationInput;
docId?: InputMaybe<Scalars['String']['input']>;
options?: InputMaybe<QueryChatSessionsInput>;
options?: InputMaybe<QueryChatHistoriesInput>;
}>;
export type GetCopilotSessionsQuery = {
@@ -4192,17 +4428,53 @@ export type GetCopilotSessionsQuery = {
__typename?: 'UserType';
copilot: {
__typename?: 'Copilot';
sessions: Array<{
__typename?: 'CopilotSessionType';
id: string;
parentSessionId: string | null;
docId: string | null;
pinned: boolean;
title: string | null;
promptName: string;
model: string;
optionalModels: Array<string>;
}>;
chats: {
__typename?: 'PaginatedCopilotHistoriesType';
pageInfo: {
__typename?: 'PageInfo';
hasNextPage: boolean;
hasPreviousPage: boolean;
startCursor: string | null;
endCursor: string | null;
};
edges: Array<{
__typename?: 'CopilotHistoriesTypeEdge';
cursor: string;
node: {
__typename?: 'CopilotHistories';
sessionId: string;
workspaceId: string;
docId: string | null;
parentSessionId: string | null;
promptName: string;
model: string;
optionalModels: Array<string>;
action: string | null;
pinned: boolean;
title: string | null;
tokens: number;
createdAt: string;
updatedAt: string;
messages: Array<{
__typename?: 'ChatMessage';
id: string | null;
role: string;
content: string;
attachments: Array<string> | null;
createdAt: string;
streamObjects: Array<{
__typename?: 'StreamObject';
type: string;
textDelta: string | null;
toolCallId: string | null;
toolName: string | null;
args: Record<string, string> | null;
result: Record<string, string> | null;
}> | null;
}>;
};
}>;
};
};
} | null;
};
@@ -4438,6 +4710,106 @@ export type GetDocRolePermissionsQuery = {
};
};
export type CopilotChatMessageFragment = {
__typename?: 'ChatMessage';
id: string | null;
role: string;
content: string;
attachments: Array<string> | null;
createdAt: string;
streamObjects: Array<{
__typename?: 'StreamObject';
type: string;
textDelta: string | null;
toolCallId: string | null;
toolName: string | null;
args: Record<string, string> | null;
result: Record<string, string> | null;
}> | null;
};
export type CopilotChatHistoryFragment = {
__typename?: 'CopilotHistories';
sessionId: string;
workspaceId: string;
docId: string | null;
parentSessionId: string | null;
promptName: string;
model: string;
optionalModels: Array<string>;
action: string | null;
pinned: boolean;
title: string | null;
tokens: number;
createdAt: string;
updatedAt: string;
messages: Array<{
__typename?: 'ChatMessage';
id: string | null;
role: string;
content: string;
attachments: Array<string> | null;
createdAt: string;
streamObjects: Array<{
__typename?: 'StreamObject';
type: string;
textDelta: string | null;
toolCallId: string | null;
toolName: string | null;
args: Record<string, string> | null;
result: Record<string, string> | null;
}> | null;
}>;
};
export type PaginatedCopilotChatsFragment = {
__typename?: 'PaginatedCopilotHistoriesType';
pageInfo: {
__typename?: 'PageInfo';
hasNextPage: boolean;
hasPreviousPage: boolean;
startCursor: string | null;
endCursor: string | null;
};
edges: Array<{
__typename?: 'CopilotHistoriesTypeEdge';
cursor: string;
node: {
__typename?: 'CopilotHistories';
sessionId: string;
workspaceId: string;
docId: string | null;
parentSessionId: string | null;
promptName: string;
model: string;
optionalModels: Array<string>;
action: string | null;
pinned: boolean;
title: string | null;
tokens: number;
createdAt: string;
updatedAt: string;
messages: Array<{
__typename?: 'ChatMessage';
id: string | null;
role: string;
content: string;
attachments: Array<string> | null;
createdAt: string;
streamObjects: Array<{
__typename?: 'StreamObject';
type: string;
textDelta: string | null;
toolCallId: string | null;
toolName: string | null;
args: Record<string, string> | null;
result: Record<string, string> | null;
}> | null;
}>;
};
}>;
};
export type CredentialsRequirementsFragment = {
__typename?: 'CredentialsRequirementType';
password: {