@aexol/spectral 0.9.185 → 0.9.186
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/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js +1 -1
- package/dist/memory/tools/compact-context.d.ts +12 -12
- package/dist/memory/tools/compact-context.d.ts.map +1 -1
- package/dist/memory/tools/compact-context.js +147 -117
- package/dist/sdk/coding-agent/core/agent-session.d.ts.map +1 -1
- package/dist/sdk/coding-agent/core/agent-session.js +0 -1
- package/dist/sdk/coding-agent/core/compaction/compaction.d.ts.map +1 -1
- package/dist/sdk/coding-agent/core/compaction/compaction.js +2 -2
- package/dist/sdk/coding-agent/core/compaction/policy.d.ts +22 -4
- package/dist/sdk/coding-agent/core/compaction/policy.d.ts.map +1 -1
- package/dist/sdk/coding-agent/core/compaction/policy.js +39 -6
- package/dist/server/session-stream.d.ts.map +1 -1
- package/dist/server/session-stream.js +4 -4
- package/dist/server/sqlite-adapter.d.ts +11 -8
- package/dist/server/sqlite-adapter.d.ts.map +1 -1
- package/dist/server/sqlite-adapter.js +195 -44
- package/dist/server/storage.d.ts +8 -5
- package/dist/server/storage.d.ts.map +1 -1
- package/dist/server/storage.js +9 -6
- package/package.json +1 -1
package/dist/server/storage.js
CHANGED
|
@@ -4,10 +4,12 @@
|
|
|
4
4
|
* Two-tier model:
|
|
5
5
|
* projects ─< sessions ─< messages
|
|
6
6
|
*
|
|
7
|
-
* Single-process, single-file.
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
7
|
+
* Single-process, single-file. The storage layer goes through the `SqliteAdapter`
|
|
8
|
+
* abstraction (see `sqlite-adapter.ts`) which prefers Node's built-in
|
|
9
|
+
* `node:sqlite` on modern Node, `bun:sqlite` under Bun, and only falls back
|
|
10
|
+
* to `better-sqlite3` on older Node runtimes. The synchronous adapter API is a
|
|
11
|
+
* perfect fit for the per-WS-event write pattern: no connection pool, no
|
|
12
|
+
* callback churn, transactions are trivial.
|
|
11
13
|
*
|
|
12
14
|
* Schema migrations:
|
|
13
15
|
* We track schema with the `user_version` PRAGMA. When opening a DB whose
|
|
@@ -1478,8 +1480,9 @@ export function preflightSqlite(dbPath) {
|
|
|
1478
1480
|
const msg = err instanceof Error ? err.message : String(err);
|
|
1479
1481
|
return {
|
|
1480
1482
|
ok: false,
|
|
1481
|
-
error: `Failed to load
|
|
1482
|
-
`
|
|
1483
|
+
error: `Failed to load the SQLite storage module (${msg}).\n` +
|
|
1484
|
+
` On Node >= 22.5 spectral uses the built-in node:sqlite module; on older\n` +
|
|
1485
|
+
` Node it falls back to better-sqlite3, which needs its native binary built.\n` +
|
|
1483
1486
|
` Try: cd ${getConfigDir()} && npm rebuild better-sqlite3\n` +
|
|
1484
1487
|
` Or reinstall: npm install -g @aexol/spectral`,
|
|
1485
1488
|
};
|