@equationalapplications/core-llm-wiki 7.11.1 → 7.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/README.md +22 -0
- package/dist/{chunk-IJFOAWPS.mjs → chunk-KN4XSLLB.mjs} +2103 -1414
- package/dist/chunk-KN4XSLLB.mjs.map +1 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2930 -2631
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +156 -549
- package/dist/index.mjs.map +1 -1
- package/dist/{testing-C-WsBxLh.d.mts → testing-7d76Ptlq.d.mts} +90 -9
- package/dist/{testing-C-WsBxLh.d.ts → testing-7d76Ptlq.d.ts} +90 -9
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +431 -25
- package/dist/testing.js.map +1 -1
- package/dist/testing.mjs +1 -1
- package/package.json +3 -3
- package/dist/chunk-IJFOAWPS.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -238,6 +238,11 @@ const wikiMemory = new WikiMemory(db, {
|
|
|
238
238
|
// The first setup() that attaches FTS5 to an existing database rebuilds the index in one transaction, holding
|
|
239
239
|
// the write lock for its whole duration. Keyword rankings differ between the two backends; set 'minisearch'
|
|
240
240
|
// to keep the pre-7.11 behavior.
|
|
241
|
+
// Under 'auto', a failed FTS5 init is retried once, then setup() completes with keyword search unavailable
|
|
242
|
+
// (queries throw WikiSearchUnavailableError); it never silently demotes to MiniSearch. While unavailable,
|
|
243
|
+
// runHeal returns searchUnavailable: true, runPendingMaintenance lists skipped jobs in perEntity[].searchUnavailable,
|
|
244
|
+
// and a no-arg syncSearchIndex() retries the init (after a failure, backing off from 5 s up to 5 min). MiniSearch holds all
|
|
245
|
+
// entry text in the JS heap — the measured ceiling is ~1M entries on a default Node heap (--max-old-space-size).
|
|
241
246
|
indexStrategy: 'auto', // default: 'auto' — 'fts5' | 'minisearch' | 'auto'
|
|
242
247
|
enableOutbox: false, // default: false — when true, entry/task mutations write to an internal SQLite outbox table for external sync (e.g. via @equationalapplications/prisma-outbox)
|
|
243
248
|
excludeDrafts: false, // default: false — engine default for read()/traverseGraph() excludeDrafts; see Draft Review
|
|
@@ -263,6 +268,23 @@ const wikiMemory = new WikiMemory(db, {
|
|
|
263
268
|
});
|
|
264
269
|
```
|
|
265
270
|
|
|
271
|
+
### Opening inside a writer lease
|
|
272
|
+
|
|
273
|
+
One-time upgrade work (schema migrations, the `source_ref` normalize) can take minutes on a large store. If you open the store inside a time-limited writer lease, refuse that work instead of running it:
|
|
274
|
+
|
|
275
|
+
```typescript
|
|
276
|
+
try {
|
|
277
|
+
await wiki.setup({ migrations: 'refuse' }); // also settable as config.migrations
|
|
278
|
+
} catch (err) {
|
|
279
|
+
if (!(err instanceof WikiMigrationRequiredError)) throw err;
|
|
280
|
+
// err.pendingWork says what is pending. Release the lease, then:
|
|
281
|
+
await wiki.setup(); // runs the work out of lease (resumable if interrupted)
|
|
282
|
+
// ...re-acquire the lease and open again with 'refuse'.
|
|
283
|
+
}
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
`'allow'` (default) runs everything; `'auto'` throws on a pending schema migration but runs a pending normalize. Await `setup()` before any other call on the instance.
|
|
287
|
+
|
|
266
288
|
## Prompt Management & Overrides
|
|
267
289
|
|
|
268
290
|
Core maintenance tasks (`ingestDocument`, `runLibrarian`, `runHeal`) use system prompts to instruct the LLM. You can customize these prompts using `{{mustache}}` style variables to inject context dynamically.
|