feat(server): adapt context model (#11028)

expose more field in listContextObject
This commit is contained in:
darkskygit
2025-03-21 05:36:45 +00:00
parent a5b975ac46
commit 5acba9d5a0
25 changed files with 537 additions and 377 deletions

View File

@@ -37,6 +37,13 @@ export interface Scalars {
Upload: { input: File; output: File };
}
export interface AddContextCategoryInput {
categoryId: Scalars['String']['input'];
contextId: Scalars['String']['input'];
docs?: InputMaybe<Array<Scalars['String']['input']>>;
type: ContextCategories;
}
export interface AddContextDocInput {
contextId: Scalars['String']['input'];
docId: Scalars['String']['input'];
@@ -47,12 +54,6 @@ export interface AddContextFileInput {
contextId: Scalars['String']['input'];
}
export interface AddRemoveContextCategoryInput {
categoryId: Scalars['String']['input'];
contextId: Scalars['String']['input'];
type: ContextCategories;
}
export enum AiJobStatus {
claimed = 'claimed',
failed = 'failed',
@@ -164,6 +165,8 @@ export interface CopilotSessionsArgs {
export interface CopilotContext {
__typename?: 'CopilotContext';
/** list collections in context */
collections: Array<CopilotContextCategory>;
/** list files in context */
docs: Array<CopilotContextDoc>;
/** list files in context */
@@ -173,6 +176,8 @@ export interface CopilotContext {
matchContext: Array<ContextMatchedFileChunk>;
/** match workspace doc content */
matchWorkspaceContext: ContextMatchedDocChunk;
/** list tags in context */
tags: Array<CopilotContextCategory>;
workspaceId: Scalars['String']['output'];
}
@@ -190,6 +195,7 @@ export interface CopilotContextMatchWorkspaceContextArgs {
export interface CopilotContextCategory {
__typename?: 'CopilotContextCategory';
createdAt: Scalars['SafeInt']['output'];
docs: Array<CopilotDocType>;
id: Scalars['ID']['output'];
type: ContextCategories;
}
@@ -197,6 +203,7 @@ export interface CopilotContextCategory {
export interface CopilotContextDoc {
__typename?: 'CopilotContextDoc';
createdAt: Scalars['SafeInt']['output'];
error: Maybe<Scalars['String']['output']>;
id: Scalars['ID']['output'];
status: Maybe<ContextEmbedStatus>;
}
@@ -223,6 +230,13 @@ export interface CopilotDocNotFoundDataType {
docId: Scalars['String']['output'];
}
export interface CopilotDocType {
__typename?: 'CopilotDocType';
createdAt: Scalars['SafeInt']['output'];
id: Scalars['ID']['output'];
status: Maybe<ContextEmbedStatus>;
}
export interface CopilotFailedToMatchContextDataType {
__typename?: 'CopilotFailedToMatchContextDataType';
content: Scalars['String']['output'];
@@ -549,6 +563,7 @@ export enum ErrorNames {
CAPTCHA_VERIFICATION_FAILED = 'CAPTCHA_VERIFICATION_FAILED',
COPILOT_ACTION_TAKEN = 'COPILOT_ACTION_TAKEN',
COPILOT_CONTEXT_FILE_NOT_SUPPORTED = 'COPILOT_CONTEXT_FILE_NOT_SUPPORTED',
COPILOT_DOCS_NOT_FOUND = 'COPILOT_DOCS_NOT_FOUND',
COPILOT_DOC_NOT_FOUND = 'COPILOT_DOC_NOT_FOUND',
COPILOT_EMBEDDING_UNAVAILABLE = 'COPILOT_EMBEDDING_UNAVAILABLE',
COPILOT_FAILED_TO_CREATE_MESSAGE = 'COPILOT_FAILED_TO_CREATE_MESSAGE',
@@ -1103,7 +1118,7 @@ export interface MutationActivateLicenseArgs {
}
export interface MutationAddContextCategoryArgs {
options: AddRemoveContextCategoryInput;
options: AddContextCategoryInput;
}
export interface MutationAddContextDocArgs {
@@ -1297,7 +1312,7 @@ export interface MutationReleaseDeletedBlobsArgs {
}
export interface MutationRemoveContextCategoryArgs {
options: AddRemoveContextCategoryInput;
options: RemoveContextCategoryInput;
}
export interface MutationRemoveContextDocArgs {
@@ -1695,6 +1710,12 @@ export interface RemoveAvatar {
success: Scalars['Boolean']['output'];
}
export interface RemoveContextCategoryInput {
categoryId: Scalars['String']['input'];
contextId: Scalars['String']['input'];
type: ContextCategories;
}
export interface RemoveContextDocInput {
contextId: Scalars['String']['input'];
docId: Scalars['String']['input'];
@@ -2423,7 +2444,7 @@ export type ChangePasswordMutation = {
};
export type AddContextCategoryMutationVariables = Exact<{
options: AddRemoveContextCategoryInput;
options: AddContextCategoryInput;
}>;
export type AddContextCategoryMutation = {
@@ -2433,11 +2454,17 @@ export type AddContextCategoryMutation = {
id: string;
createdAt: number;
type: ContextCategories;
docs: Array<{
__typename?: 'CopilotDocType';
id: string;
createdAt: number;
status: ContextEmbedStatus | null;
}>;
};
};
export type RemoveContextCategoryMutationVariables = Exact<{
options: AddRemoveContextCategoryInput;
options: RemoveContextCategoryInput;
}>;
export type RemoveContextCategoryMutation = {
@@ -2466,6 +2493,7 @@ export type AddContextDocMutation = {
id: string;
createdAt: number;
status: ContextEmbedStatus | null;
error: string | null;
};
};
@@ -2550,6 +2578,7 @@ export type ListContextObjectQuery = {
__typename?: 'CopilotContextDoc';
id: string;
status: ContextEmbedStatus | null;
error: string | null;
createdAt: number;
}>;
files: Array<{
@@ -2562,6 +2591,26 @@ export type ListContextObjectQuery = {
status: ContextEmbedStatus;
createdAt: number;
}>;
tags: Array<{
__typename?: 'CopilotContextCategory';
id: string;
createdAt: number;
docs: Array<{
__typename?: 'CopilotDocType';
id: string;
status: ContextEmbedStatus | null;
}>;
}>;
collections: Array<{
__typename?: 'CopilotContextCategory';
id: string;
createdAt: number;
docs: Array<{
__typename?: 'CopilotDocType';
id: string;
status: ContextEmbedStatus | null;
}>;
}>;
}>;
};
} | null;