@im-nobsidian/core 0.10.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -87,6 +87,7 @@ declare const ConfigSchema: z.ZodObject<{
87
87
  autoSyncInterval: z.ZodDefault<z.ZodNumber>;
88
88
  fullReconcileInterval: z.ZodDefault<z.ZodNumber>;
89
89
  deleteSync: z.ZodDefault<z.ZodBoolean>;
90
+ renameOnTitleChange: z.ZodDefault<z.ZodBoolean>;
90
91
  syncFiles: z.ZodDefault<z.ZodBoolean>;
91
92
  createDatabases: z.ZodDefault<z.ZodBoolean>;
92
93
  notifications: z.ZodDefault<z.ZodEnum<["silent", "default"]>>;
@@ -98,6 +99,7 @@ declare const ConfigSchema: z.ZodObject<{
98
99
  autoSyncInterval: number;
99
100
  fullReconcileInterval: number;
100
101
  deleteSync: boolean;
102
+ renameOnTitleChange: boolean;
101
103
  syncFiles: boolean;
102
104
  createDatabases: boolean;
103
105
  }, {
@@ -108,6 +110,7 @@ declare const ConfigSchema: z.ZodObject<{
108
110
  autoSyncInterval?: number | undefined;
109
111
  fullReconcileInterval?: number | undefined;
110
112
  deleteSync?: boolean | undefined;
113
+ renameOnTitleChange?: boolean | undefined;
111
114
  syncFiles?: boolean | undefined;
112
115
  createDatabases?: boolean | undefined;
113
116
  }>;
@@ -222,6 +225,7 @@ declare const ConfigSchema: z.ZodObject<{
222
225
  autoSyncInterval: number;
223
226
  fullReconcileInterval: number;
224
227
  deleteSync: boolean;
228
+ renameOnTitleChange: boolean;
225
229
  syncFiles: boolean;
226
230
  createDatabases: boolean;
227
231
  };
@@ -280,6 +284,7 @@ declare const ConfigSchema: z.ZodObject<{
280
284
  autoSyncInterval?: number | undefined;
281
285
  fullReconcileInterval?: number | undefined;
282
286
  deleteSync?: boolean | undefined;
287
+ renameOnTitleChange?: boolean | undefined;
283
288
  syncFiles?: boolean | undefined;
284
289
  createDatabases?: boolean | undefined;
285
290
  };
@@ -459,6 +464,21 @@ interface PushResult {
459
464
  readonly moved: number;
460
465
  readonly failed: FailedOperation[];
461
466
  readonly duration: number;
467
+ /**
468
+ * 볼트에서 고쳤지만 올리지 않은 읽기 전용 속성(수식 · 롤업 · ID …) — Notion 이 값을 정한다. 다음 pull 이 Notion
469
+ * 값으로 되돌리므로 화면이 알린다. 예전에는 로그 한 줄만 남아 고친 값이 말없이 사라졌다. 없으면 빈 목록 · 생략.
470
+ */
471
+ readonly readOnlySkipped?: readonly ReadOnlySkip[];
472
+ /**
473
+ * 볼트에서 지웠지만 Notion 에서 지우지 않은 노트(`sync.deleteSync` 꺼짐) — 다음 pull 이 Notion 에서 되살린다.
474
+ * 예전에는 아무 말 없이 대기로 적기만 해, 지운 파일이 다음 pull 에 말없이 돌아왔다(D8). 없으면 빈 목록 · 생략.
475
+ */
476
+ readonly unsentDeletions?: readonly string[];
477
+ }
478
+ /** 노트 하나에서 올리지 않은 읽기 전용 속성. */
479
+ interface ReadOnlySkip {
480
+ readonly path: string;
481
+ readonly properties: readonly string[];
462
482
  }
463
483
  /**
464
484
  * 전체 대조를 한 이유 (ADR-027).
@@ -485,7 +505,8 @@ interface RemoteScanInfo {
485
505
  readonly nextFullAt: string | null;
486
506
  /**
487
507
  * Notion 에서 지운 노트가 아직 볼트에 반영되지 않았을 수 있나 — 바뀐 것만 찾았고 원격 삭제를 볼트에
488
- * 반영하는 설정(`sync.deleteSync`)일 때. 다음 전체 대조가 반영한다. 설정이 꺼져 있으면 원격 삭제는
508
+ * 반영하는 설정(`sync.deleteSync`)일 때. pull 은 추적 중인 것을 차례로 몇 개씩 묻는다 — 이번에 모두
509
+ * 물었으면 false 다. 나머지는 다음 pull 들 · 다음 전체 대조가 반영한다. 설정이 꺼져 있으면 원격 삭제는
489
510
  * 볼트에 반영하지 않으므로 늘 false 다.
490
511
  */
491
512
  readonly deletionsDeferred: boolean;
@@ -502,6 +523,8 @@ interface PullResult {
502
523
  * 파일이 없어졌다가 복구됐다는 사실 자체를 알 수 없다.
503
524
  */
504
525
  readonly restored: number;
526
+ /** 되살린(dry-run 은 되살릴) 노트 · 행의 경로 — {@link restored} 의 목록. 없으면 생략. */
527
+ readonly restoredPaths?: readonly string[];
505
528
  readonly conflicts: Conflict[];
506
529
  readonly writtenPaths: string[];
507
530
  readonly failed: FailedOperation[];
@@ -515,11 +538,20 @@ interface PullResult {
515
538
  readonly moved?: readonly RemoteMove[];
516
539
  /** Notion 에서 옮겼지만 볼트에서 옮기지 않은 것과 그 까닭. */
517
540
  readonly moveSkipped?: readonly RemoteMoveSkip[];
541
+ /** 옮기거나 이름을 바꾼 노트를 가리키던 링크를 고친 노트 — 없으면 고친 것이 없다. */
542
+ readonly relinked?: readonly string[];
543
+ /**
544
+ * Notion 에 새로 생겼지만 동기화에서 뺀 자리(paths · `.im-nobsidian-ignore`)에 놓일 것이라 받지 않은 페이지 —
545
+ * 받았다면 놓였을 경로. dry-run 은 받지 않을 것.
546
+ */
547
+ readonly excluded?: readonly string[];
518
548
  }
519
549
  /** Notion 에서 옮긴 페이지를 볼트에서 옮긴 것 하나 — 노트 하나거나 폴더 하나다. */
520
550
  interface RemoteMove {
521
551
  readonly from: string;
522
552
  readonly to: string;
553
+ /** Notion 에서 바꾼 제목으로 이름을 바꾼 것(`sync.renameOnTitleChange`) — 없으면 옮긴 것. */
554
+ readonly renamed?: boolean;
523
555
  }
524
556
  /** 옮기지 않고 둔 것과 그 까닭 — 볼트에서 직접 옮기면 다음 push 가 Notion 을 맞춘다. */
525
557
  interface RemoteMoveSkip {
@@ -568,6 +600,14 @@ interface StatusResult {
568
600
  readonly lastFullScanAt: string | null;
569
601
  /** 원격을 얼마나 훑었나. 로컬만 본 확인(`statusLocal`)에는 없다. */
570
602
  readonly remoteScan?: RemoteScanInfo;
603
+ /**
604
+ * 다음 pull 이 볼트에서 옮기거나(Notion 에서 옮긴 페이지) 이름을 바꿀(바꾼 제목) 노트 · 옮기지 않을 것과 까닭.
605
+ * 원격을 본 확인에만 있다. 옮기기만 하고 고치지 않은 페이지는 전체 대조(pull)에서야 보인다.
606
+ */
607
+ readonly remoteMoves?: readonly RemoteMove[];
608
+ readonly remoteMoveSkipped?: readonly RemoteMoveSkip[];
609
+ /** Notion 에 새로 생겼지만 뺀 자리에 놓일 것이라 다음 pull 이 받지 않을 페이지의 경로. `remoteChanges` 에서 뺐다. */
610
+ readonly remoteExcluded?: readonly string[];
571
611
  }
572
612
  interface FailedOperation {
573
613
  readonly path: string;
@@ -1244,6 +1284,8 @@ declare class PropertyMapper {
1244
1284
  * 호출측이 기준에서 빼 두고 다시 보낸다.
1245
1285
  */
1246
1286
  relationKeys(keys: readonly string[]): string[];
1287
+ /** 이 속성들 가운데 Notion 이 값을 정하는 것(수식 · 롤업 · ID · 생성일 …) — 볼트에서 고쳐도 보낼 수 없다. */
1288
+ readOnlyKeys(keys: readonly string[]): string[];
1247
1289
  /**
1248
1290
  * 값을 보낼 수 있는 속성만, pull 이 적는 모양으로 — 원격 값과 로컬 값을 견줄 때 쓴다.
1249
1291
  *
@@ -1804,6 +1846,12 @@ declare class NotionClient {
1804
1846
  * 슬롯을 붙잡아 남을 막는 대신, 다 같이 보는 이 게이트로 쉬게 한다.
1805
1847
  */
1806
1848
  private cooldownUntil;
1849
+ /**
1850
+ * Free 워크스페이스 블록 한도에 막힌 거절과 그 시각. 막힌 동안 블록을 만드는 요청은 보내지 않고 이 거절을 그대로
1851
+ * 돌려준다 — 플랜을 올리기 전에는 풀리지 않으므로 노트마다 같은 거절을 받으러 가지 않는다. 그 사이 플랜을
1852
+ * 올렸을 수 있어 {@link BLOCK_LIMIT_RECHECK_MS} 가 지나면 다시 보내 본다.
1853
+ */
1854
+ private blockLimit;
1807
1855
  /**
1808
1856
  * 요청 1건을 rate limit 슬롯 안에서 실행하고, 재시도 가능한 실패는 백오프 후 다시 시도한다.
1809
1857
  *
@@ -1931,6 +1979,29 @@ declare class NotionBlockBuilder {
1931
1979
  static table(rows: string[][], hasColumnHeader?: boolean, hasRowHeader?: boolean): NotionBlock;
1932
1980
  }
1933
1981
 
1982
+ /** 찾을 레코드 — {@link IStateDB.getAll} 이 그대로 만족한다. */
1983
+ interface NestedFolderRecord {
1984
+ readonly obsidianPath: string;
1985
+ readonly notionPageId: string | null;
1986
+ readonly notionParentId: string | null;
1987
+ readonly fileType: string;
1988
+ }
1989
+ /** 두 겹 하나 — 바깥(Notion 부모)과 안쪽(같은 이름의 자식). */
1990
+ interface NestedFolderPage {
1991
+ /** 두 겹이 나타내는 볼트 폴더. */
1992
+ readonly folder: string;
1993
+ readonly outer: {
1994
+ readonly path: string;
1995
+ readonly notionPageId: string;
1996
+ };
1997
+ readonly inner: {
1998
+ readonly path: string;
1999
+ readonly notionPageId: string;
2000
+ };
2001
+ }
2002
+ /** 같은 폴더를 나타내면서 Notion 에서 부모 · 자식인 레코드 쌍. 폴더 경로 순. */
2003
+ declare function findNestedFolderPages(records: readonly NestedFolderRecord[]): NestedFolderPage[];
2004
+
1934
2005
  /**
1935
2006
  * DB 완결성 게이트 — "원격에 있는 행이 볼트에도 전부 있는가"를 대조한다.
1936
2007
  *
@@ -1959,6 +2030,7 @@ declare class NotionBlockBuilder {
1959
2030
  * 를 순회하는 SSOT — 하나만 쓴다. 여기서 별도 쿼리를 짜면 검증기가 피검증 대상과 다른
1960
2031
  * 열거 규칙을 갖게 돼, 게이트가 통과해도 실제 pull 은 놓치는 상황이 생긴다.
1961
2032
  */
2033
+
1962
2034
  /** 원격 행 열거 — {@link NotionClient} 가 그대로 만족한다(전 data source 순회 SSOT). */
1963
2035
  interface CompletenessRemoteSource {
1964
2036
  queryAllDatabasePages(databaseId: string, filter?: unknown): Promise<Array<{
@@ -2058,6 +2130,11 @@ interface VaultCompletenessReport {
2058
2130
  readonly databases: CompletenessReport;
2059
2131
  /** 페이지 모드에서만 채워진다. DB 모드에는 root 서브트리가 없어 `null`. */
2060
2132
  readonly pages: PageCompletenessReport | null;
2133
+ /**
2134
+ * 같은 이름의 두 겹 폴더 페이지 — 예전 빌드가 남긴 것(ADR-012). 알리기만 한다: 사람이 정할 일이라
2135
+ * `complete` 에 넣지 않는다.
2136
+ */
2137
+ readonly nestedFolderPages: readonly NestedFolderPage[];
2061
2138
  /** 두 대조가 모두 통과. */
2062
2139
  readonly complete: boolean;
2063
2140
  }
@@ -2139,6 +2216,11 @@ interface VaultFS {
2139
2216
  moveFile(from: string, to: string): Promise<void>;
2140
2217
  exists(path: string): Promise<boolean>;
2141
2218
  ensureFolder(path: string): Promise<void>;
2219
+ /**
2220
+ * 폴더가 완전히 비었으면 지운다 — 파일 · 폴더 · 숨김 파일이 하나라도 있으면 두고 false. 없거나 폴더가 아니어도
2221
+ * false. Notion 에서 지운 폴더 페이지의 폴더를 치울 때 쓴다. 없으면 폴더를 지우지 않는다.
2222
+ */
2223
+ removeEmptyFolder?(path: string): Promise<boolean>;
2142
2224
  listMarkdownFiles(): Promise<FileInfo[]>;
2143
2225
  listMarkdownFileStats(): Promise<FileStatInfo[]>;
2144
2226
  listNonMarkdownFiles(): Promise<NonMdFileInfo[]>;
@@ -2472,6 +2554,8 @@ declare class SyncOrchestrator {
2472
2554
  private readonly databaseCreator;
2473
2555
  private readonly planner;
2474
2556
  private readonly remoteMoves;
2557
+ private readonly remoteRenames;
2558
+ private readonly linkUpdater;
2475
2559
  private readonly detector;
2476
2560
  private readonly drift;
2477
2561
  private readonly discovery;
@@ -2492,6 +2576,11 @@ declare class SyncOrchestrator {
2492
2576
  */
2493
2577
  private assertConnectionScope;
2494
2578
  private executePush;
2579
+ /**
2580
+ * 볼트에서 지운 이 노트를 Notion 에서 지우지 않아 다음 pull 이 되살리나 — deleteSync 가 꺼져 있고 pull 이
2581
+ * 되살리는 레코드일 때. 예전에는 대기로 적기만 하고 알리지 않아, 지운 파일이 말없이 돌아왔다(D8).
2582
+ */
2583
+ private unsentDeletion;
2495
2584
  /**
2496
2585
  * 만든 DB 에 relation · rollup · formula 를 붙이고, 행 스키마를 다시 읽게 한 뒤 보기를 만든다. 실패는
2497
2586
  * 다음 push 가 이어 붙인다 — 행은 그대로 올린다.
@@ -2500,8 +2589,15 @@ declare class SyncOrchestrator {
2500
2589
  /** 볼트의 노트가 마지막으로 올린 내용 그대로인가 — 읽지 못하면(지움 · 옮김) 아니다. */
2501
2590
  private unchangedSincePush;
2502
2591
  pull(options?: PullOptions): Promise<PullResult>;
2592
+ /** 새 원격 페이지 가운데 동기화에서 뺀 자리에 놓일 것 — 페이지 id → 그 자리. dry-run 이 받지 않을 것으로 알린다. */
2593
+ private plannedExclusions;
2503
2594
  /** 감지가 본, Notion 에서 옮긴 페이지를 볼트에서 옮긴다 — 경로를 좁힌 pull 은 그 범위의 것만. */
2504
2595
  private followRemoteMoves;
2596
+ /**
2597
+ * Notion 에서 제목을 바꾼 페이지의 노트 이름을 바꾼다 — `sync.renameOnTitleChange` 를 켰을 때만, 경로를 좁힌 pull 은
2598
+ * 그 범위의 것만. 설정이 뺀 노트는 두지 않는다.
2599
+ */
2600
+ private followRemoteRenames;
2505
2601
  private executePull;
2506
2602
  sync(options?: SyncOptions): Promise<SyncResult>;
2507
2603
  private executeSync;
@@ -2603,6 +2699,8 @@ declare class NodeVaultFS implements VaultFS {
2603
2699
  writeFile(path: string, content: string): Promise<void>;
2604
2700
  writeBinary(path: string, data: Buffer): Promise<void>;
2605
2701
  deleteFile(path: string): Promise<void>;
2702
+ /** `rmdir` 는 비지 않은 폴더를 지우지 않는다(ENOTEMPTY) — 숨김 파일도 그대로 둔다. */
2703
+ removeEmptyFolder(path: string): Promise<boolean>;
2606
2704
  moveFile(from: string, to: string): Promise<void>;
2607
2705
  exists(path: string): Promise<boolean>;
2608
2706
  ensureFolder(path: string): Promise<void>;
@@ -2661,6 +2759,8 @@ interface ImageDownloadResult {
2661
2759
  readonly fileHash?: string;
2662
2760
  /** 임베드 별칭으로 쓸 이름 — 받은 이름에서 이 볼트가 붙인 내용 해시를 뗀 것({@link withoutOwnHash}). */
2663
2761
  readonly name?: string;
2762
+ /** 크기 상한을 넘어 받지 않은 파일의 크기(바이트) — 받았거나 다른 이유로 못 받았으면 없다. */
2763
+ readonly skippedBytes?: number;
2664
2764
  }
2665
2765
  interface ImageUploadResult {
2666
2766
  readonly localPath: string;
@@ -2951,6 +3051,10 @@ declare class ConversionPipeline {
2951
3051
  private readonly postProcessors;
2952
3052
  registerPreProcessor(processor: Processor): void;
2953
3053
  registerPostProcessor(processor: Processor): void;
3054
+ /**
3055
+ * 토글 헤딩은 Markdown API 경로가 변환한다(`toggle-heading.ts`) — 블록 경로로 보내면 콜아웃이 옛 이모지 꼴로
3056
+ * 바뀐다(`CalloutTransformer`). 예전에 여기 있던 토글 헤딩 탐지는 띄어 쓴 마커를 찾아 한 번도 맞지 않았다.
3057
+ */
2954
3058
  selectPath(content: string): ConversionPath;
2955
3059
  convertToNotion(markdown: string, context: ConversionContext): ConversionResult;
2956
3060
  convertToMarkdown(content: string, context: ConversionContext, metadata?: ProcessorMetadata): string;
@@ -2959,6 +3063,11 @@ declare class ConversionPipeline {
2959
3063
  interface DbBaseFile {
2960
3064
  readonly basePath: string;
2961
3065
  readonly title: string;
3066
+ /**
3067
+ * pull 이 그 경로에 마지막으로 쓴 내용의 해시 — 파일이 이것과 다르면 볼트에서 고친 것이라 덮어쓰지 않는다. 예전 버전이
3068
+ * 적은 기록에는 없다 — 그때는 가를 수 없어 예전처럼 쓰고, 쓴 해시부터 적는다.
3069
+ */
3070
+ readonly hash?: string;
2962
3071
  }
2963
3072
  /**
2964
3073
  * DB 마다 실제로 기록한 `.base` 경로와 DB 제목 — 인라인 DB placeholder 를 `.base` 임베드로 바꿀 때
@@ -2972,10 +3081,12 @@ interface DbBaseFile {
2972
3081
  declare class DbBaseFiles {
2973
3082
  private readonly stateDb;
2974
3083
  private entries;
3084
+ /** 마지막으로 읽거나 쓴 메타 값 — 그 사이 다른 쪽(폴더를 옮긴 NoteRelocator)이 고쳐 적었으면 다시 읽는다. */
3085
+ private loadedRaw;
2975
3086
  constructor(stateDb: Pick<IStateDB, "getMeta" | "setMeta">);
2976
3087
  get(databaseId: string): DbBaseFile | undefined;
2977
3088
  set(databaseId: string, info: DbBaseFile): void;
2978
- /** 상태 메타에서 한 번 읽는다. 없거나 깨졌으면 비어 있다 — 이번 실행이 기록하는 것부터 다시 쌓는다. */
3089
+ /** 상태 메타에서 읽는다 — 값이 그대로면 읽어 둔 것을 쓴다. 없거나 깨졌으면 비어 있다 — 이번 실행이 기록하는 것부터 다시 쌓는다. */
2979
3090
  private load;
2980
3091
  }
2981
3092
 
@@ -3118,9 +3229,14 @@ declare class DatabaseSyncer {
3118
3229
  */
3119
3230
  private readonly appearances;
3120
3231
  private readonly baseFileGenerator;
3121
- /** 사용자가 만든 `.base` 라 덮어쓰지 않았다고 이미 알린 경로 — 한 pull 이 같은 DB 를 여러 번 다시 쓴다. */
3232
+ /** 사용자가 만들거나 고친 `.base` 라 덮어쓰지 않았다고 이미 알린 경로 — 한 pull 이 같은 DB 를 여러 번 다시 쓴다. */
3122
3233
  private readonly keptUserBases;
3123
3234
  private readonly sidecarGenerator;
3235
+ /** Notion 에서 바꾼 제목으로 이름을 바꾼 행과 실제로 옮긴 차례 — pull 마감이 가져가 다른 노트의 링크를 고친다. */
3236
+ private readonly relocator;
3237
+ private renamedRows;
3238
+ /** 볼트에서 사라져 되살린 행의 경로 — pull 마감이 가져가 화면에 알린다(D8). */
3239
+ private restoredRows;
3124
3240
  /**
3125
3241
  * 실제로 기록한 .base 경로/DB 제목 — placeholder 임베드 재작성(F22)의 SSOT. 이번 pull 이 조회하지
3126
3242
  * 않은 DB 의 것도 남아 있다({@link DbBaseFiles}).
@@ -3273,8 +3389,8 @@ declare class DatabaseSyncer {
3273
3389
  */
3274
3390
  private appearanceOf;
3275
3391
  private readAppearance;
3276
- /** pull 이 쓰지 않은 `.base` · 사이드카가 이미 있는가 — 없거나 읽지 못하면 false. */
3277
- private isUserFile;
3392
+ /** 볼트에서 고친 `.base` 를 덮어쓰거나 지우지 않았다고 한 번 알린다. */
3393
+ private warnEditedBase;
3278
3394
  /**
3279
3395
  * DB 제목이 바뀌면 `.base`/`.notion.json` 파일명(safeName)이 바뀌어 옛 이름의 산출물이
3280
3396
  * 같은 폴더에 고아로 잔존한다(drift·부활 원인). DB 폴더 **직속**의 산출물 중 현재 이름이
@@ -3340,6 +3456,13 @@ declare class DatabaseSyncer {
3340
3456
  * (아직 push 하지 않은 노트)을 새 행이 덮어쓰면 그 글이 사라졌다. 일반 페이지 받기(`claimFilePath`)처럼 피한다.
3341
3457
  */
3342
3458
  private rowPathOwners;
3459
+ /** 되살린 행의 경로를 가져가고 비운다. */
3460
+ takeRestoredRows(): string[];
3461
+ /** 이름을 바꾼 행을 가져가고 비운다. */
3462
+ takeRenamedRows(): {
3463
+ renamed: RemoteMove[];
3464
+ applied: RemoteMove[];
3465
+ };
3343
3466
  private pullDatabasePage;
3344
3467
  }
3345
3468
 
@@ -3494,15 +3617,15 @@ declare class FrontmatterGenerator implements Processor {
3494
3617
  * 핵심 전제(F28 교훈): DB 에 저장된 startIndex 는 **push 시점 문자열**의 절대
3495
3618
  * 오프셋이라 pull 산출물에서는 무의미하다 — 프론트매터 앞·단어 한가운데에
3496
3619
  * 마커를 박아 파일을 파손시켰다. 재삽입은 반드시
3497
- * 1) 이미 의미적으로 복원된 마커는 건너뛰고(위키링크 → `[[...]]` 존재 등),
3620
+ * 1) 다른 복원기가 맡는 마커는 건너뛰고(위키링크 · 미디어 · 표 정렬),
3498
3621
  * 2) 텍스트 앵커(__anchor)를 1차 위치 수단으로 쓰며,
3499
3622
  * 3) 프론트매터 뒤·줄 경계에만, 마커 단독 줄로 삽입한다.
3500
3623
  *
3501
3624
  * 이중 모드: `__anchor` 키가 없는 마커는 구버전 DB blob(수집기가 앵커를 안 남기던
3502
3625
  * 시절)이다. 이들은 구계약 — "변환이 마커만 제거했다면 startIndex 오프셋 원문 삽입이
3503
3626
  * 원본을 정확히 재구성한다" — 을 유지하되 프론트매터 앞 삽입만 금지한다. 위해한
3504
- * 레거시 사례(빈 params 껍데기, 이미 복원된 위키링크)는 render-null 폐기와 의미
3505
- * 복원 검사가 이미 걸러낸다.
3627
+ * 레거시 사례(빈 params 껍데기, 위키링크)는 render-null 폐기와 다른 복원기 검사가
3628
+ * 이미 걸러낸다.
3506
3629
  */
3507
3630
  declare class PreserveMarkerInjector implements Processor {
3508
3631
  readonly name = "PreserveMarkerInjector";
@@ -3510,8 +3633,8 @@ declare class PreserveMarkerInjector implements Processor {
3510
3633
  process(input: ProcessorInput): ProcessorOutput;
3511
3634
  /** 마커의 본문 표현. 복원 불가능한(빈) 마커는 null — 삽입하지 않고 폐기한다. */
3512
3635
  private renderMarker;
3513
- /** 마커가 이미 원래 문법으로 복원돼 있으면 재삽입은 중복·오염이다. */
3514
- private isSemanticallyRestored;
3636
+ /** 다른 복원기가 맡는 마커 — 본문에 다시 끼우면 중복 · 오염이다. */
3637
+ private restoredElsewhere;
3515
3638
  /** 삽입 위치: 앵커 → startIndex(줄 경계 보정) 순. 항상 프론트매터 뒤. */
3516
3639
  private findInsertionPoint;
3517
3640
  }
@@ -3947,6 +4070,7 @@ declare function notionIdsEqual(a: string, b: string): boolean;
3947
4070
  */
3948
4071
  declare function compactNotionId(id: string): string;
3949
4072
 
4073
+ /** Notion 제목 → 볼트 파일 이름(확장자 없이). */
3950
4074
  declare function sanitizeFileName(name: string): string;
3951
4075
 
3952
4076
  /** 노트(마크다운 파일)의 경로 · 이름인가. */
@@ -4006,6 +4130,8 @@ declare class PathFilter {
4006
4130
  private readonly include;
4007
4131
  private readonly exclude;
4008
4132
  constructor(include: readonly string[], exclude: readonly string[]);
4133
+ /** 아무것도 빼지 않는다 — 포함 패턴이 없거나 전부(`**\/*`)이고 제외 패턴이 없다. */
4134
+ isEmpty(): boolean;
4009
4135
  /** 동기화하지 않는 노트 · 첨부 — 포함 패턴 어느 것에도 맞지 않거나 제외 패턴에 맞는다. */
4010
4136
  excludesFile(path: string): boolean;
4011
4137
  /**
@@ -4014,6 +4140,10 @@ declare class PathFilter {
4014
4140
  */
4015
4141
  excludesFolder(path: string): boolean;
4016
4142
  }
4143
+ /**
4144
+ * `.im-nobsidian-ignore` 의 글 → 패턴. 빈 줄과 `#` 로 시작하는 줄은 뺀다. CLI 와 플러그인이 같은 규칙으로 읽는다.
4145
+ */
4146
+ declare function parseIgnorePatterns(content: string): string[];
4017
4147
  /** 운영체제 구분자로 이은 상대 경로 → 볼트 경로(`/`). `relative()` 의 결과에 쓴다. */
4018
4148
  declare function toVaultPath(relativePath: string, separator: string): string;
4019
4149
 
@@ -4068,6 +4198,37 @@ interface Logger {
4068
4198
  declare function setLogger(logger: Logger): void;
4069
4199
  declare function getLogger(): Logger;
4070
4200
 
4201
+ /**
4202
+ * 경로 패턴(`paths.include` · `paths.exclude` · `.im-nobsidian-ignore`)을 목록에 대는 VaultFS.
4203
+ *
4204
+ * CLI 는 볼트를 걸을 때 패턴을 대지만({@link NodeVaultFS}) 플러그인은 Obsidian 이 아는 파일 목록을 그대로 쓴다 —
4205
+ * 그래서 예전 플러그인은 패턴을 무시했다. 이 감싸개가 목록에서 뺀 파일을 지우고 `excludesPath` 를 답한다.
4206
+ * 뺀 노트는 목록에 없어도 「볼트에서 지움」 으로 보지 않는다 — 감지 · pull 이 `excludesPath` 로 가른다.
4207
+ *
4208
+ * 패턴은 감싼 VaultFS 의 경로(연결 폴더 기준)에 댄다 — CLI 가 연결 폴더에서 돌 때와 같다.
4209
+ */
4210
+ declare class FilteredVaultFS implements VaultFS {
4211
+ private readonly inner;
4212
+ private readonly filter;
4213
+ readonly ownsPath?: (path: string) => boolean;
4214
+ readonly holdsOtherConnection?: (folder: string) => boolean;
4215
+ constructor(inner: VaultFS, filter: PathFilter);
4216
+ excludesPath(path: string, kind?: "file" | "folder"): boolean;
4217
+ listMarkdownFiles(): Promise<FileInfo[]>;
4218
+ listMarkdownFileStats(): Promise<FileStatInfo[]>;
4219
+ listNonMarkdownFiles(): Promise<NonMdFileInfo[]>;
4220
+ readFile(path: string): Promise<string>;
4221
+ readBinary(path: string): Promise<Buffer>;
4222
+ writeFile(path: string, content: string): Promise<void>;
4223
+ writeBinary(path: string, data: Buffer): Promise<void>;
4224
+ deleteFile(path: string): Promise<void>;
4225
+ moveFile(from: string, to: string): Promise<void>;
4226
+ exists(path: string): Promise<boolean>;
4227
+ ensureFolder(path: string): Promise<void>;
4228
+ removeEmptyFolder(path: string): Promise<boolean>;
4229
+ getFileStat(path: string): Promise<FileStatInfo | null>;
4230
+ }
4231
+
4071
4232
  /**
4072
4233
  * 볼트 하나에 연결 여럿 (ADR-038) — 연결마다 볼트 안의 폴더 하나를 맡는다.
4073
4234
  *
@@ -4134,6 +4295,7 @@ declare class ScopedVaultFS implements VaultFS {
4134
4295
  moveFile(from: string, to: string): Promise<void>;
4135
4296
  exists(path: string): Promise<boolean>;
4136
4297
  ensureFolder(path: string): Promise<void>;
4298
+ removeEmptyFolder(path: string): Promise<boolean>;
4137
4299
  /** 맡은 노트만 읽는다 — 볼트 전체의 본문을 읽지 않는다. */
4138
4300
  listMarkdownFiles(): Promise<FileInfo[]>;
4139
4301
  listMarkdownFileStats(): Promise<FileStatInfo[]>;
@@ -4271,6 +4433,16 @@ declare function parseDesignColor(token: string | undefined): DesignColor | unde
4271
4433
  /** 한 줄을 읽는다. 마커가 없는 줄은 글 조각 하나뿐인 결과를 돌려준다. */
4272
4434
  declare function readDesignLine(line: string): DesignLine;
4273
4435
 
4436
+ /** 제목 줄인가. */
4437
+ declare function isHeadingLine(line: string): boolean;
4438
+ /** 제목 아래로 내린 마커만 있는 줄인가 — 앞줄이 제목일 때 그 제목의 것이다. */
4439
+ declare function isHeadingMarkerLine(line: string): boolean;
4440
+ /**
4441
+ * 한 섹션의 원문 줄 — 섹션이 제목으로 끝나고 다음 줄이 그 제목의 마커 줄이면 제목 줄 끝에 붙여 돌려준다.
4442
+ * Obsidian 은 그 마커 줄을 다음 섹션으로 가르므로, 읽기 화면이 제목을 칠하려면 다음 줄을 함께 봐야 한다.
4443
+ */
4444
+ declare function sectionLinesWithHeadingMarkers(all: readonly string[], start: number, end: number): string[];
4445
+
4274
4446
  /**
4275
4447
  * Notion 컬럼이 볼트 노트의 어느 줄에 걸치나 (#74).
4276
4448
  *
@@ -4303,4 +4475,4 @@ declare function readColumnLayout(lines: readonly string[]): (ColumnPlace | unde
4303
4475
  /** 열 이름표 — `열 2/3 · 50%`. 비율이 없으면 `열 2/3`. */
4304
4476
  declare function columnLabel(place: ColumnPlace): string;
4305
4477
 
4306
- export { BaseFileGenerator, type BaseFileOptions, type BasePropertyOption, type BasePropertySchema, type BaseStatusGroup, type BaseSyncOptions, type BasesFilterNode, type BasesViewMapping, type BasesViewType, BlankLineCollapser, type BookmarkTarget, CONFIG_FILE, type CalendarEntry, type CalloutDesign, CalloutRestorer, CalloutTransformer, ChangeDetector, type ChangeDiff, ColorAnnotator, type ColumnPlace, type CompletenessFailure, type CompletenessLocalSource, type CompletenessOptions, type CompletenessRemoteSource, type CompletenessReport, type Config, ConfigManager, ConfigSchema, type Conflict, ConflictResolver, type ConflictStrategy, ConnectionBoundaryError, ConnectionScopeError, type ConversionContext, type ConversionPath, ConversionPipeline, type ConversionResult, type CoverConfig, type DBEntry, DB_VIEWS_FILE, DB_VIEWS_PATH, DEFAULT_CONFIG, DEFAULT_TITLE_PROPERTY, DEFAULT_WATCH_DEBOUNCE_MS, DIFF_SIGN, type DatabaseCompleteness, type DatabaseSyncConfig, type DatabaseSyncResult, DatabaseSyncer, type DatabaseViewsConfig, type DeferredCode, type DegradeNote, type DesignColor, type DesignLine, type DesignSegment, type DiffHunk, type DiffLine, EmbedResolver, EntryEditor, type FailedOperation, type FidelityClassification, type FidelityContext, type FidelityDefect, type FidelityDefectForm, type FidelitySummary, type FileDownloadResult, FileHandler, type FileInfo, type FileRegistryEntry, type FileStatInfo, type FileSystemEntry, type FileType, type FileUploadResult, FileWatcher, type FilterCondition, type FolderDatabaseReport, type FolderMoveChange, FrontmatterExtractor, FrontmatterGenerator, type FullScanReason, GITIGNORE_ENTRY, type GatedOperation, type GroupByConfig, type GroupedEntries, IGNORE_FILE, INTERNAL_DIR, INTERNAL_DIR_GLOB, type IStateDB, type ImageDownloadResult, ImageHandler, type ImageReference, type InferredProperty, InlineAnnotationPreserver, InlineDBParser, type InlineStyle, type LineDiffOptions, type LineRange, type LocalChange, LocalImageRestorer, type LocalMoveAdoption, type LocalScan, type LocalScanOptions, type Logger, MARKER_BRAND, type MappingResult, type MappingType, MathNormalizer, MentionToWikilink, type MergeConflictRegion, type MergeResult, NOTION_COLOR_NAMES, NOTION_TOKEN_PREFIX, NOTION_TO_BASES_VIEW, NodeVaultFS, type NonMdFileInfo, type NotionBlock, NotionBlockBuilder, NotionClient, type NotionClientOptions, type NotionColor, type NotionPageNode, type NotionRichText, type RichTextItem as NotionRichTextItem, type NotionSidecar, OBSIDIAN_CONFIG_DIR, type OperationType, type PageCompletenessRemoteSource, type PageCompletenessReport, type PageCover, type PageCreationPlan, type PageIcon, PathFilter, type PathFilterConfig, type PendingOperation, PendingWalError, type PlannedRow, type PreserveMarker, PreserveMarkerCollector, PreserveMarkerInjector, type Processor, type ProcessorInput, type ProcessorMetadata, type ProcessorOutput, type ProgressCallback, type ProgressItem, PropertiesTableInjector, PropertiesTableRestorer, PropertyMapper, type PropertyOption, type PropertySchema, type PropertyValue, type PullOptions, type PullResult, type PushOptions, type PushResult, RENDER_LINE_RULES, type RecordPendingInput, type RegisterFileInput, type RemoteChange, type RemoteMove, type RemoteMoveSkip, type RemoteObservation, type RemoteScanInfo, type RenameHints, type RenameKind, type RenderFinding, type RenderLineRule, type ResolutionChoice, type ResolutionResult, type RichTextSegment, type RowProgress, SAVED_STATE_TABLES_QUERY, SEPARATOR_BODY, STATE_DB_FILE, STATE_DB_MIGRATIONS, STATE_DB_PATH, SavedStateDbError, ScopedVaultFS, SidecarGenerator, type SidecarProperty, type SidecarView, StateDB, StateDbLockedError, type StateDbMigration, type StateDbTool, StateDbUnavailableError, StateLock, type StateLockClaim, type StateLockOwner, type StatusOptions, type StatusResult, type StyledRange, SyncBusyError, type SyncDirection, type SyncOptions, SyncOrchestrator, type SyncRecord, type SyncResult, type SyncStatus, type TableLineDesign, type TranslationResult, TreeMapper, UnsupportedBlockStripper, type UpsertSyncRecord, type VaultCompletenessReport, type VaultFS, type ViewConfig, ViewDataProvider, type ViewPropertyConfig, type ViewRenderData, type ViewType, WIKILINK_LOOKUPS, type WatchSyncOptions, type WatchSyncScope, WatchSyncService, type WikilinkEntry, type WikilinkLookup, WikilinkResolver, applicableChoices, assertNoPendingWal, basesViewMappingOf, basesViewTypeOf, choiceForStrategy, classifyBodyFidelity, columnLabel, compactNotionId, computeBufferHash, computeHash, configDirFrom, connectionFolderOf, createDefaultPipeline, extractCalendarEntries, filterByMonth, filterEntries, findConnectionFolders, formatUnifiedDiff, generateColorCSS, generateId, getLogger, getNotionBgColor, getNotionColor, getVisibleProperties, groupEntries, hasColumnLayout, hasDesignMarker, inAnyPathScope, isInternalPath, isMarkdownPath, isRemoteDeletion, lineDiff, lintRenderedMarkdown, matchesPathScope, normalizeNotionId, normalizeVaultPath, noteNameFromPath, notionIdFromInput, notionIdsEqual, operationLabel, parseDesignColor, pendingWalBytes, readColumnLayout, readDesignLine, resolvePropertyName, sanitizeFileName, setLogger, sortEntries, stateDbLockPath, stateDbWalPath, stripMarkdownExtension, summarizeFidelity, systemTimeZone, threeWayMerge, toVaultPath, translateNotionFilter, verifyDatabaseCompleteness, verifyPageCompleteness, wikilinkLookupsIn };
4478
+ export { BaseFileGenerator, type BaseFileOptions, type BasePropertyOption, type BasePropertySchema, type BaseStatusGroup, type BaseSyncOptions, type BasesFilterNode, type BasesViewMapping, type BasesViewType, BlankLineCollapser, type BookmarkTarget, CONFIG_FILE, type CalendarEntry, type CalloutDesign, CalloutRestorer, CalloutTransformer, ChangeDetector, type ChangeDiff, ColorAnnotator, type ColumnPlace, type CompletenessFailure, type CompletenessLocalSource, type CompletenessOptions, type CompletenessRemoteSource, type CompletenessReport, type Config, ConfigManager, ConfigSchema, type Conflict, ConflictResolver, type ConflictStrategy, ConnectionBoundaryError, ConnectionScopeError, type ConversionContext, type ConversionPath, ConversionPipeline, type ConversionResult, type CoverConfig, type DBEntry, DB_VIEWS_FILE, DB_VIEWS_PATH, DEFAULT_CONFIG, DEFAULT_TITLE_PROPERTY, DEFAULT_WATCH_DEBOUNCE_MS, DIFF_SIGN, type DatabaseCompleteness, type DatabaseSyncConfig, type DatabaseSyncResult, DatabaseSyncer, type DatabaseViewsConfig, type DeferredCode, type DegradeNote, type DesignColor, type DesignLine, type DesignSegment, type DiffHunk, type DiffLine, EmbedResolver, EntryEditor, type FailedOperation, type FidelityClassification, type FidelityContext, type FidelityDefect, type FidelityDefectForm, type FidelitySummary, type FileDownloadResult, FileHandler, type FileInfo, type FileRegistryEntry, type FileStatInfo, type FileSystemEntry, type FileType, type FileUploadResult, FileWatcher, type FilterCondition, FilteredVaultFS, type FolderDatabaseReport, type FolderMoveChange, FrontmatterExtractor, FrontmatterGenerator, type FullScanReason, GITIGNORE_ENTRY, type GatedOperation, type GroupByConfig, type GroupedEntries, IGNORE_FILE, INTERNAL_DIR, INTERNAL_DIR_GLOB, type IStateDB, type ImageDownloadResult, ImageHandler, type ImageReference, type InferredProperty, InlineAnnotationPreserver, InlineDBParser, type InlineStyle, type LineDiffOptions, type LineRange, type LocalChange, LocalImageRestorer, type LocalMoveAdoption, type LocalScan, type LocalScanOptions, type Logger, MARKER_BRAND, type MappingResult, type MappingType, MathNormalizer, MentionToWikilink, type MergeConflictRegion, type MergeResult, NOTION_COLOR_NAMES, NOTION_TOKEN_PREFIX, NOTION_TO_BASES_VIEW, type NestedFolderPage, type NestedFolderRecord, NodeVaultFS, type NonMdFileInfo, type NotionBlock, NotionBlockBuilder, NotionClient, type NotionClientOptions, type NotionColor, type NotionPageNode, type NotionRichText, type RichTextItem as NotionRichTextItem, type NotionSidecar, OBSIDIAN_CONFIG_DIR, type OperationType, type PageCompletenessRemoteSource, type PageCompletenessReport, type PageCover, type PageCreationPlan, type PageIcon, PathFilter, type PathFilterConfig, type PendingOperation, PendingWalError, type PlannedRow, type PreserveMarker, PreserveMarkerCollector, PreserveMarkerInjector, type Processor, type ProcessorInput, type ProcessorMetadata, type ProcessorOutput, type ProgressCallback, type ProgressItem, PropertiesTableInjector, PropertiesTableRestorer, PropertyMapper, type PropertyOption, type PropertySchema, type PropertyValue, type PullOptions, type PullResult, type PushOptions, type PushResult, RENDER_LINE_RULES, type ReadOnlySkip, type RecordPendingInput, type RegisterFileInput, type RemoteChange, type RemoteMove, type RemoteMoveSkip, type RemoteObservation, type RemoteScanInfo, type RenameHints, type RenameKind, type RenderFinding, type RenderLineRule, type ResolutionChoice, type ResolutionResult, type RichTextSegment, type RowProgress, SAVED_STATE_TABLES_QUERY, SEPARATOR_BODY, STATE_DB_FILE, STATE_DB_MIGRATIONS, STATE_DB_PATH, SavedStateDbError, ScopedVaultFS, SidecarGenerator, type SidecarProperty, type SidecarView, StateDB, StateDbLockedError, type StateDbMigration, type StateDbTool, StateDbUnavailableError, StateLock, type StateLockClaim, type StateLockOwner, type StatusOptions, type StatusResult, type StyledRange, SyncBusyError, type SyncDirection, type SyncOptions, SyncOrchestrator, type SyncRecord, type SyncResult, type SyncStatus, type TableLineDesign, type TranslationResult, TreeMapper, UnsupportedBlockStripper, type UpsertSyncRecord, type VaultCompletenessReport, type VaultFS, type ViewConfig, ViewDataProvider, type ViewPropertyConfig, type ViewRenderData, type ViewType, WIKILINK_LOOKUPS, type WatchSyncOptions, type WatchSyncScope, WatchSyncService, type WikilinkEntry, type WikilinkLookup, WikilinkResolver, applicableChoices, assertNoPendingWal, basesViewMappingOf, basesViewTypeOf, choiceForStrategy, classifyBodyFidelity, columnLabel, compactNotionId, computeBufferHash, computeHash, configDirFrom, connectionFolderOf, createDefaultPipeline, extractCalendarEntries, filterByMonth, filterEntries, findConnectionFolders, findNestedFolderPages, formatUnifiedDiff, generateColorCSS, generateId, getLogger, getNotionBgColor, getNotionColor, getVisibleProperties, groupEntries, hasColumnLayout, hasDesignMarker, inAnyPathScope, isHeadingLine, isHeadingMarkerLine, isInternalPath, isMarkdownPath, isRemoteDeletion, lineDiff, lintRenderedMarkdown, matchesPathScope, normalizeNotionId, normalizeVaultPath, noteNameFromPath, notionIdFromInput, notionIdsEqual, operationLabel, parseDesignColor, parseIgnorePatterns, pendingWalBytes, readColumnLayout, readDesignLine, resolvePropertyName, sanitizeFileName, sectionLinesWithHeadingMarkers, setLogger, sortEntries, stateDbLockPath, stateDbWalPath, stripMarkdownExtension, summarizeFidelity, systemTimeZone, threeWayMerge, toVaultPath, translateNotionFilter, verifyDatabaseCompleteness, verifyPageCompleteness, wikilinkLookupsIn };