mindnet_obsidian/src/settings.ts
Lars 7ea36fbed4
Some checks are pending
Node.js build / build (20.x) (push) Waiting to run
Node.js build / build (22.x) (push) Waiting to run
Enhance inline micro edge handling and settings
- Introduced new settings for enabling inline micro edge suggestions and configuring the maximum number of alternatives displayed.
- Updated the InterviewWizardModal to support inline micro edging, allowing users to select edge types immediately after inserting links.
- Enhanced the semantic mapping builder to incorporate pending edge assignments, improving the handling of rel:type links.
- Improved the user experience with clearer logging and error handling during inline edge type selection and mapping processes.
2026-01-17 11:54:14 +01:00

73 lines
3.2 KiB
TypeScript

export interface MindnetSettings {
edgeVocabularyPath: string; // vault-relativ
graphSchemaPath: string; // vault-relativ (später)
maxHops: number;
strictMode: boolean;
showCanonicalHints: boolean;
chainDirection: "forward" | "backward" | "both";
interviewConfigPath: string; // vault-relativ
autoStartInterviewOnCreate: boolean;
interceptUnresolvedLinkClicks: boolean;
autoStartOnUnresolvedClick: boolean; // Auto-start interview when creating note from unresolved link
bypassModifier: "Alt" | "Ctrl" | "Shift" | "None"; // Modifier key to bypass intercept (Reading View)
editorFollowModifier: "Alt" | "Ctrl" | "Shift" | "None"; // Modifier key required for editor intercept (Live Preview/Source)
waitForFirstModifyAfterCreate: boolean; // Wait for Templater to modify file before starting wizard
waitForModifyTimeoutMs: number; // Timeout in ms for waiting for modify event
debugLogging: boolean; // Enable debug logging for unresolved link handling
adoptNewNotesInEditor: boolean; // Auto-adopt newly created notes in editor
adoptMaxChars: number; // Max content length to consider note as adopt-candidate
adoptConfirmMode: "always" | "onlyLowConfidence" | "never"; // When to show adoption confirmation
highConfidenceWindowMs: number; // Time window in ms for high-confidence adoption
// Semantic mapping builder settings
mappingWrapperCalloutType: string; // default: "abstract"
mappingWrapperTitle: string; // default: "🕸️ Semantic Mapping"
mappingWrapperFolded: boolean; // default: true
defaultEdgeType: string; // default: ""
unassignedHandling: "prompt" | "none" | "defaultType" | "advisor"; // default: "prompt"
allowOverwriteExistingMappings: boolean; // default: false
defaultNotesFolder: string; // default: "" (vault root)
// Inline micro edge suggester settings
inlineMicroEnabled: boolean; // default: true
inlineMaxAlternatives: number; // default: 6
inlineCancelBehavior: "keep_link"; // default: "keep_link" (future: "revert")
}
export const DEFAULT_SETTINGS: MindnetSettings = {
edgeVocabularyPath: "_system/dictionary/edge_vocabulary.md",
graphSchemaPath: "_system/dictionary/graph_schema.md",
maxHops: 3,
strictMode: false,
showCanonicalHints: false,
chainDirection: "forward",
interviewConfigPath: "_system/dictionary/interview_config.yaml",
autoStartInterviewOnCreate: false,
interceptUnresolvedLinkClicks: true,
autoStartOnUnresolvedClick: true,
bypassModifier: "Alt",
editorFollowModifier: "Ctrl",
waitForFirstModifyAfterCreate: true,
waitForModifyTimeoutMs: 1200,
debugLogging: false,
adoptNewNotesInEditor: true,
adoptMaxChars: 200,
adoptConfirmMode: "onlyLowConfidence",
highConfidenceWindowMs: 3000,
mappingWrapperCalloutType: "abstract",
mappingWrapperTitle: "🕸️ Semantic Mapping",
mappingWrapperFolded: true,
defaultEdgeType: "",
unassignedHandling: "prompt",
allowOverwriteExistingMappings: false,
defaultNotesFolder: "",
inlineMicroEnabled: true,
inlineMaxAlternatives: 6,
inlineCancelBehavior: "keep_link",
};
/**
* Optional helper: normalize to Obsidian vault paths (forward slashes).
*/
export function normalizeVaultPath(p: string): string {
return (p || "").trim().replace(/\\/g, "/");
}