/
Nspection
/
rules-manager-mcp
Обзор
Документация
Войти
/
Nspection
/
rules-manager-mcp
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
dev
src/types.ts
94 строки
2 KB
Buglov Evgeny
refactor: split monolithic dist/index.js into separate modules
08 мар 2026, 20:17
08 мар 2026, 20:17
a966cbf
Код
Авторство
О чём код?
import { RuleMeta } from "./utils/index-manager.js"; /** * Типы предложений изменений (предложения требуют подтверждения через apply_proposal) */ export type ProposalType = | "new_rule" | "rule_update" | "delete_rule" | "index_update" | "merge_rules" | "delete_backup"; /** * Интерфейс предложения изменения */ export interface Proposal { type: ProposalType; key?: string; uid?: string; target_key?: string; target_uid?: string; old_content?: string; new_content?: string; content?: string; reason?: string; new_meta?: RuleMeta; meta?: { name: string; description: string; tags: string[]; critical?: boolean }; source_keys?: string[]; source_uids?: string[]; merged_name?: string; merged_description?: string; merged_content?: string; delete_sources?: boolean; final_tags?: string[]; critical?: boolean; filename?: string; timestamp: string; } /** * Контекст сервера — общие данные, используемые обработчиками */ export interface ServerContext { rulesIndex: RulesIndexExtended; projectRules: Record<string, string>; pendingUpdates: Record<string, Proposal>; rulesDir: string; backupDir: string; } /** * Расширенный интерфейс индекса правил с методами */ export interface RulesIndexExtended { version: string; last_updated: string; rules: Record<string, RuleMeta>; } /** * Результат валидации правила */ export interface ValidationResult { ok: boolean; warning?: string; } /** * Режимы обновления правил */ export type UpdateMode = | "replace_full" | "insert_after" | "insert_before" | "replace_section" | "append" | "prepend" | "delete_section"; /** * Стратегии объединения правил */ export type MergeStrategy = "append" | "prepend" | "custom"; /** * Результат поиска правил */ export interface SearchResult { name: string; uid: string; description: string; tags: string[]; }