feat(plugins): add JavaScript plugin system with overlay panel (#303)

This commit is contained in:
sudacode authored and GitHub committed 2026-10-31 19:09:54 -07:00
1 parent 90fc7cf940
commit a9a4c4f083
110 files changed
+5897 -344

No files matched your search

+4
View File
@@ -18,6 +18,7 @@ export const OVERLAY_HOSTED_MODALS = [
'session-help',
'character-dictionary',
'changelog',
'plugin-panel',
] as const;
export type OverlayHostedModal = (typeof OVERLAY_HOSTED_MODALS)[number];
@@ -160,6 +161,9 @@ export const IPC_CHANNELS = {
lookupWindowToggleRequested: 'lookup-window-toggle:requested',
sessionHelpOpen: 'session-help:open',
changelogOpen: 'changelog:open',
pluginPanelOpen: 'plugin-panel:open',
pluginPanelUpdate: 'plugin-panel:update',
pluginPanelClose: 'plugin-panel:close',
characterDictionaryManagerOpen: 'character-dictionary:manager-open',
controllerSelectOpen: 'controller-select:open',
controllerDebugOpen: 'controller-debug:open',
+10
View File
@@ -50,6 +50,7 @@ const SESSION_ACTION_IDS: SessionActionId[] = [
'replayCurrentSubtitle',
'playNextSubtitle',
'cycleRuntimeOption',
'runPluginAction',
];
const RUNTIME_OPTION_IDS: RuntimeOptionId[] = [
@@ -111,6 +112,15 @@ function parseSessionActionPayload(
};
}
if (actionId === 'runPluginAction') {
if (!isObject(value)) return null;
if (Object.keys(value).some((key) => key !== 'pluginActionId')) return null;
if (typeof value.pluginActionId !== 'string' || !value.pluginActionId.includes('/')) {
return null;
}
return { pluginActionId: value.pluginActionId };
}
return value === undefined ? undefined : null;
}