@feelingmindful/thinking-graph 1.13.0 → 1.14.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/vault/bridge.d.ts +7 -0
- package/dist/vault/bridge.js +16 -0
- package/package.json +1 -1
package/dist/vault/bridge.d.ts
CHANGED
|
@@ -45,6 +45,13 @@ export declare class VaultBridge {
|
|
|
45
45
|
* If a file with the same title already exists, appends a timestamp suffix.
|
|
46
46
|
*/
|
|
47
47
|
write(opts: VaultWriteOpts): string;
|
|
48
|
+
/**
|
|
49
|
+
* Drop a sentinel at the vault root so the knowledge-graph indexer knows
|
|
50
|
+
* there are pending writes to flush on the next search. Best-effort: a
|
|
51
|
+
* failure here must not break the write path, since the consequence is
|
|
52
|
+
* just a stale `kg_search()` until the next manual `kg_index()`.
|
|
53
|
+
*/
|
|
54
|
+
private markPendingIndex;
|
|
48
55
|
/** Read a single note by relative path. */
|
|
49
56
|
read(relPath: string): VaultNote | null;
|
|
50
57
|
/**
|
package/dist/vault/bridge.js
CHANGED
|
@@ -126,8 +126,24 @@ export class VaultBridge {
|
|
|
126
126
|
};
|
|
127
127
|
const fileContent = matter.stringify(opts.content, fm);
|
|
128
128
|
writeFileSync(absPath, fileContent, 'utf-8');
|
|
129
|
+
this.markPendingIndex();
|
|
129
130
|
return relative(this.vaultRoot, absPath);
|
|
130
131
|
}
|
|
132
|
+
/**
|
|
133
|
+
* Drop a sentinel at the vault root so the knowledge-graph indexer knows
|
|
134
|
+
* there are pending writes to flush on the next search. Best-effort: a
|
|
135
|
+
* failure here must not break the write path, since the consequence is
|
|
136
|
+
* just a stale `kg_search()` until the next manual `kg_index()`.
|
|
137
|
+
*/
|
|
138
|
+
markPendingIndex() {
|
|
139
|
+
try {
|
|
140
|
+
const sentinel = join(this.vaultRoot, '.kg-pending-index');
|
|
141
|
+
writeFileSync(sentinel, new Date().toISOString(), 'utf-8');
|
|
142
|
+
}
|
|
143
|
+
catch {
|
|
144
|
+
// Non-fatal — manual `kg_index()` still works as a backstop.
|
|
145
|
+
}
|
|
146
|
+
}
|
|
131
147
|
// ─── Read ───────────────────────────────────────────
|
|
132
148
|
/** Read a single note by relative path. */
|
|
133
149
|
read(relPath) {
|
package/package.json
CHANGED