-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
70 changed files
with
3,327 additions
and
2,103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,6 @@ jobs: | |
|
||
- name: Build | ||
run: yarn build | ||
|
||
- name: Unit Tests | ||
run: yarn vitest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export const AppActionsType = { | ||
// Message actions | ||
Create: 'create_comment', | ||
Edit: 'edit_comment', | ||
Delete: 'delete_comment', | ||
Reply: 'reply_comment', | ||
// chatbot actions | ||
AskChatbot: 'ask_chatbot', | ||
} as const; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { AppData } from '@graasp/sdk'; | ||
|
||
export const AppDataTypes = { | ||
UserComment: 'comment', | ||
BotComment: 'bot-comment', | ||
}; | ||
|
||
export const COMMENT_APP_DATA_TYPES: string[] = [ | ||
AppDataTypes.UserComment, | ||
AppDataTypes.BotComment, | ||
]; | ||
|
||
export type VisibilityVariants = 'member' | 'item'; | ||
|
||
export type CommentData = { | ||
content: string; | ||
parent: string | null; | ||
chatbotPromptSettingId?: string; | ||
}; | ||
export type CommentAppData = AppData<CommentData>; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
export const SettingsKeys = { | ||
ChatbotPrompt: 'chatbot-prompt', | ||
General: 'general', | ||
} as const; | ||
|
||
export type ChatCompletionMessageRoles = 'system' | 'user' | 'assistant'; | ||
|
||
export type ChatCompletionMessage = { | ||
role: ChatCompletionMessageRoles; | ||
content: string; | ||
}; | ||
|
||
// Chatbot Prompt Setting keys | ||
export enum ChatbotPromptSettingsKeys { | ||
InitialPrompt = 'initialPrompt', | ||
ChatbotCue = 'chatbotCue', | ||
ChatbotName = 'chatbotName', | ||
} | ||
|
||
export type ChatbotPromptSettings = { | ||
[ChatbotPromptSettingsKeys.InitialPrompt]: ChatCompletionMessage[]; | ||
[ChatbotPromptSettingsKeys.ChatbotCue]: string; | ||
[ChatbotPromptSettingsKeys.ChatbotName]: string; | ||
|
||
// used to allow access using settings[settingKey] syntax | ||
// [key: string]: unknown; | ||
}; | ||
|
||
// Chatbot Prompt Setting keys | ||
export enum GeneralSettingsKeys { | ||
MaxCommentLength = 'maxCommentLength', | ||
MaxThreadLength = 'maxThreadLength', | ||
} | ||
|
||
export type GeneralSettings = { | ||
[GeneralSettingsKeys.MaxCommentLength]: number; | ||
[GeneralSettingsKeys.MaxThreadLength]: number; | ||
}; | ||
export const DEFAULT_GENERAL_SETTINGS: GeneralSettings = { | ||
[GeneralSettingsKeys.MaxCommentLength]: 300, | ||
[GeneralSettingsKeys.MaxThreadLength]: 50, | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
export const DEFAULT_BOT_USERNAME = 'Graasp Bot'; | ||
export const ANONYMOUS_USER = 'Anonymous'; | ||
|
||
// UI | ||
export const SMALL_BORDER_RADIUS = '4px'; | ||
export const BIG_BORDER_RADIUS = '8px'; | ||
|
||
// messages | ||
export const UNEXPECTED_ERROR_MESSAGE = 'An unexpected error has occurred.'; | ||
export const SUCCESS_MESSAGE = 'The operation succeeded.'; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.