Add process bypass option and update bypass fields

Introduce a new 'process' bypass option and remove the old 'maps' key, updating all related schemas, types, defaults and validation. Adjusted napcat.json ordering and NapcatConfig defaults, updated BypassOptions schema and TypeScript interfaces, backend validation keys, loader/default parsing logic, and the web UI form mappings/labels to reflect the new field set and ordering.
This commit is contained in:
手瓜一十雪
2026-02-18 22:14:31 +08:00
parent b9f61cc0ee
commit a3b3836b8a
8 changed files with 51 additions and 55 deletions

View File

@@ -16,11 +16,11 @@ const defaultNapcatConfig = {
o3HookMode: 1,
bypass: {
hook: true,
module: true,
window: true,
js: true,
module: true,
process: true,
container: true,
maps: true,
js: true,
},
};
@@ -81,7 +81,7 @@ export const NapCatSetConfigHandler: RequestHandler = (req, res) => {
// 验证 bypass 字段
if (mergedConfig.bypass && typeof mergedConfig.bypass === 'object') {
const bypass = mergedConfig.bypass as Record<string, unknown>;
const validKeys = ['hook', 'module', 'window', 'js', 'container', 'maps'];
const validKeys = ['hook', 'window', 'module', 'process', 'container', 'js'];
for (const key of validKeys) {
if (key in bypass && typeof bypass[key] !== 'boolean') {
return sendError(res, `bypass.${key} must be boolean`);