move QuizService to services folder
This commit is contained in:
parent
35725099c1
commit
9ae00f592b
6 changed files with 36 additions and 43 deletions
|
|
@ -1,2 +0,0 @@
|
|||
export { QuizService, quizService } from "./QuizService.js";
|
||||
export * from "./types.js";
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
export interface QuizQuestion {
|
||||
question: string;
|
||||
options?: string[];
|
||||
defaultAnswer?: string;
|
||||
}
|
||||
|
||||
export interface PendingQuestion extends QuizQuestion {
|
||||
requestId: string;
|
||||
timestamp: number;
|
||||
}
|
||||
|
||||
export interface QuizAnswer {
|
||||
requestId: string;
|
||||
answer: string;
|
||||
isCustomAnswer: boolean;
|
||||
}
|
||||
|
||||
export interface QuizServiceState {
|
||||
pendingQuestion: PendingQuestion | null;
|
||||
}
|
||||
|
||||
export interface QuestionRequestedEvent {
|
||||
requestId: string;
|
||||
question: QuizQuestion;
|
||||
}
|
||||
|
||||
export interface QuestionAnsweredEvent {
|
||||
requestId: string;
|
||||
answer: string;
|
||||
isCustomAnswer: boolean;
|
||||
}
|
||||
|
|
@ -1,13 +1,39 @@
|
|||
import { EventEmitter } from "events";
|
||||
|
||||
import {
|
||||
PendingQuestion,
|
||||
QuestionAnsweredEvent,
|
||||
QuestionRequestedEvent,
|
||||
QuizQuestion,
|
||||
QuizServiceState,
|
||||
} from "./types.js";
|
||||
/**Types */
|
||||
export interface QuizQuestion {
|
||||
question: string;
|
||||
options?: string[];
|
||||
defaultAnswer?: string;
|
||||
}
|
||||
|
||||
export interface PendingQuestion extends QuizQuestion {
|
||||
requestId: string;
|
||||
timestamp: number;
|
||||
}
|
||||
|
||||
export interface QuizAnswer {
|
||||
requestId: string;
|
||||
answer: string;
|
||||
isCustomAnswer: boolean;
|
||||
}
|
||||
|
||||
export interface QuizServiceState {
|
||||
pendingQuestion: PendingQuestion | null;
|
||||
}
|
||||
|
||||
export interface QuestionRequestedEvent {
|
||||
requestId: string;
|
||||
question: QuizQuestion;
|
||||
}
|
||||
|
||||
export interface QuestionAnsweredEvent {
|
||||
requestId: string;
|
||||
answer: string;
|
||||
isCustomAnswer: boolean;
|
||||
}
|
||||
|
||||
/**Quiz service */
|
||||
export class QuizService extends EventEmitter {
|
||||
private pendingRequests = new Map<
|
||||
string,
|
||||
|
|
@ -1,6 +1,5 @@
|
|||
import { loadAuthConfig } from "../auth/workos.js";
|
||||
import { initializeWithOnboarding } from "../onboarding.js";
|
||||
import { quizService } from "../quiz/index.js";
|
||||
import {
|
||||
setBetaSubagentToolEnabled,
|
||||
setBetaUploadArtifactToolEnabled,
|
||||
|
|
@ -18,6 +17,7 @@ import { FileIndexService } from "./FileIndexService.js";
|
|||
import { GitAiIntegrationService } from "./GitAiIntegrationService.js";
|
||||
import { MCPService } from "./MCPService.js";
|
||||
import { ModelService } from "./ModelService.js";
|
||||
import { quizService } from "./QuizService.js";
|
||||
import { ResourceMonitoringService } from "./ResourceMonitoringService.js";
|
||||
import { serviceContainer } from "./ServiceContainer.js";
|
||||
import { StorageSyncService } from "./StorageSyncService.js";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { quizService } from "../quiz/index.js";
|
||||
import { quizService } from "../services/QuizService.js";
|
||||
|
||||
import { Tool } from "./types.js";
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { AssistantUnrolled, ModelConfig } from "@continuedev/config-yaml";
|
|||
import { BaseLlmApi } from "@continuedev/openai-adapters";
|
||||
import type { Session } from "core/index.js";
|
||||
|
||||
import { QuestionRequestedEvent } from "../../quiz/types.js";
|
||||
import { QuestionRequestedEvent } from "../../services/QuizService.js";
|
||||
import { ToolCallPreview } from "../../tools/types.js";
|
||||
|
||||
export interface UseChatProps {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue