basics
This commit is contained in:
39
index.js
Normal file
39
index.js
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
import { eventHandlers } from "./src/events.js";
|
||||||
|
import { eventSource, event_types } from "/script.js"
|
||||||
|
import { extension_settings } from "/scripts/extensions.js";
|
||||||
|
|
||||||
|
import { registerGenerationMutexListeners } from './lib/interconnection.js';
|
||||||
|
|
||||||
|
import { initSettings } from "./src/settings/settings.js";
|
||||||
|
import { debug } from "./src/debug.js";
|
||||||
|
|
||||||
|
export const extensionName = "embedded-thinking-concept";
|
||||||
|
export const extensionFolderPath = `scripts/extensions/third-party/${extensionName}`;
|
||||||
|
|
||||||
|
if (!extension_settings[extensionName.toLowerCase()]) extension_settings[extensionName.toLowerCase()] = {};
|
||||||
|
export const extensionSettings = extension_settings[extensionName.toLowerCase()];
|
||||||
|
|
||||||
|
jQuery(async () => {
|
||||||
|
await initSettings();
|
||||||
|
});
|
||||||
|
|
||||||
|
registerGenerationMutexListeners();
|
||||||
|
|
||||||
|
eventSource.on(event_types.APP_READY, eventHandlers.onAppReady);
|
||||||
|
eventSource.on(event_types.IMPERSONATE_READY, () => debug(`IMPERSONATE_READY`));
|
||||||
|
|
||||||
|
// in order of operation
|
||||||
|
// create a thought object in the first stage?
|
||||||
|
eventSource.on(event_types.GENERATION_AFTER_COMMANDS, eventHandlers.onGenerationAfterCommands);
|
||||||
|
eventSource.on(event_types.GENERATE_BEFORE_COMBINE_PROMPTS, eventHandlers.onGenerateBeforeCombinePrompts);
|
||||||
|
eventSource.on(event_types.GENERATE_AFTER_COMBINE_PROMPTS, eventHandlers.onGenerateAfterCombinePrompts);
|
||||||
|
eventSource.on(event_types.GENERATION_STOPPED, eventHandlers.onGenerationStopped);
|
||||||
|
eventSource.on(event_types.GENERATION_ENDED, eventHandlers.onGenerationEnded);
|
||||||
|
eventSource.on(event_types.CHAT_CHANGED, eventHandlers.onChatChanged);
|
||||||
|
eventSource.on(event_types.MESSAGE_SENT, eventHandlers.onMessageSent);
|
||||||
|
eventSource.on(event_types.MESSAGE_DELETED, eventHandlers.onMessageDeleted);
|
||||||
|
eventSource.on(event_types.MESSAGE_RECEIVED, eventHandlers.onMessageReceived);
|
||||||
|
|
||||||
|
// custom events
|
||||||
|
event_types.THOUGHT_GENERATED = 'thought_generated';
|
||||||
|
eventSource.on(event_types.THOUGHT_GENERATED, eventHandlers.onThoughtGenerated);
|
||||||
19
jsconfig.json
Normal file
19
jsconfig.json
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"baseUrl": ".", // Make the current folder the base for resolving paths
|
||||||
|
"paths": {
|
||||||
|
// Aliases (optional, for convenience if you ever want to use them)
|
||||||
|
"/script.js": [
|
||||||
|
"../../../../public/script.js"
|
||||||
|
], // Points to the `public` folder
|
||||||
|
"/scripts/*": [
|
||||||
|
"../../../../public/scripts/*"
|
||||||
|
] // Points to `public/scripts`
|
||||||
|
|
||||||
|
// No need for custom aliases for relative paths; they resolve naturally
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"include": [
|
||||||
|
"**/*"
|
||||||
|
] // Includes all files in your extension folder
|
||||||
|
}
|
||||||
11
manifest.json
Normal file
11
manifest.json
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"display_name": "Silly Tavern Character Creator",
|
||||||
|
"loading_order": 9,
|
||||||
|
"requires": [],
|
||||||
|
"optional": [],
|
||||||
|
"js": "index.js",
|
||||||
|
"css": "style.css",
|
||||||
|
"author": "gmarth",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"homePage": "https://git.project-insanity.de/gmarth/SillyCharacterExtension"
|
||||||
|
}
|
||||||
44
style.css
Normal file
44
style.css
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
.mes_embedded_thought {
|
||||||
|
background-color: rgba(0, 0, 0, 0);
|
||||||
|
font-family: var(--SmartThemeEmColor);
|
||||||
|
font-size: smaller;
|
||||||
|
border-style: none;
|
||||||
|
padding-top: 2px;
|
||||||
|
padding-bottom: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mes_embedded_thought_title {
|
||||||
|
font-family: var(--mainFontFamily);
|
||||||
|
text-align: center;
|
||||||
|
font-size: smaller;
|
||||||
|
color: var(--SmartThemeEmColor);
|
||||||
|
margin: 10px 0;
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mes_embedded_thought_title::before {
|
||||||
|
content: '';
|
||||||
|
flex: 1;
|
||||||
|
height: 1px;
|
||||||
|
/* Line thickness */
|
||||||
|
background-image: linear-gradient(90deg, var(--transparent), var(--SmartThemeBodyColor));
|
||||||
|
opacity: 0.2;
|
||||||
|
/* Line opacity */
|
||||||
|
margin-right: 10px;
|
||||||
|
/* Spacing between line and text */
|
||||||
|
}
|
||||||
|
|
||||||
|
.mes_embedded_thought_title::after {
|
||||||
|
content: '';
|
||||||
|
flex: 1;
|
||||||
|
height: 1px;
|
||||||
|
/* Line thickness */
|
||||||
|
background-image: linear-gradient(90deg, var(--SmartThemeBodyColor), var(--transparent));
|
||||||
|
opacity: 0.2;
|
||||||
|
/* Line opacity */
|
||||||
|
margin-left: 10px;
|
||||||
|
/* Spacing between line and text */
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user