stitchkit 0.87.0 → 0.87.1

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/CHANGELOG.md CHANGED
@@ -15,6 +15,20 @@ additive**; the first breaking change landed in 0.10.0. Grep the file for
15
15
 
16
16
  ## [Unreleased]
17
17
 
18
+ ## [0.87.1] — 2026-09-08
19
+
20
+ ### Fixed
21
+
22
+ - **A compaction summary reads after the block it stands for.** It was written
23
+ at the position of the first message it replaced, which the model's history
24
+ cannot tell from the last — every replaced message is gone from it either
25
+ way. A page that includes the compacted messages can: the summary landed
26
+ between the first message and the rest of the block, so a person read one
27
+ message, then a retelling of the next ten, then those ten. The summary now
28
+ takes the position of the last message it replaces. The model's history and
29
+ its order are unchanged, and so is every existing row: this places new
30
+ summaries, it does not rewrite old ones.
31
+
18
32
  ## [0.87.0] — 2026-09-08
19
33
 
20
34
  ### ⚠️ Breaking changes
@@ -1 +1 @@
1
- {"version":3,"file":"sqlite.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/sqlite.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAe,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAGL,KAAK,uBAAuB,EAC7B,MAAM,iBAAiB,CAAC;AAKzB,OAAO,EAML,uBAAuB,EACxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAEL,KAAK,uBAAuB,EAG5B,KAAK,qBAAqB,EAG3B,MAAM,gBAAgB,CAAC;AAMxB,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEvF,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,EAAE,cAAc,CAAC;IACzB,sEAAsE;IACtE,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,UAAU,CAAC,OAAO,uBAAuB,CAAC,cAAc,CAAC,CAAC,CAAC;IAClE,aAA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AC;IAClE,aAAa,EAAE,uBAAuB,CAAC;IACvC;;;;;;;OAOG;IACH,QAAQ,EAAE,cAAc,CAAC;IACzB;;;;;;;;;OASG;IACH,WAAW,CAAC,MAAM,EAChB,IAAI,EAAE,CAAC,KAAK,EAAE,sBAAsB,KAAK,OAAO,CAAC,MAAM,CAAC,GACvD,OAAO,CAAC,MAAM,CAAC,CAAC;IACnB,oFAAoF;IACpF,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAED,4DAA4D;AAC5D,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,cAAc,CAAC;IACzB,WAAW,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;CAC7E;AAwKD;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI,CAqG3E;AAED,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,6BAA6B,GACpC,uBAAuB,CAmrBzB"}
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createSqliteAgentRuntimeStore,
3
3
  initializeAgentRuntimeSqlite
4
- } from "./index-3yrqvza8.js";
4
+ } from "./index-6g273pqx.js";
5
5
  import"./index-9553432s.js";
6
6
  import"./index-5wezxcxx.js";
7
7
  import"./index-z1m86vc8.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createSqliteAgentRuntimeStore,
3
3
  initializeAgentRuntimeSqlite
4
- } from "./index-3yrqvza8.js";
4
+ } from "./index-6g273pqx.js";
5
5
  import"./index-9553432s.js";
6
6
  import"./index-5wezxcxx.js";
7
7
  import"./index-z1m86vc8.js";
@@ -664,8 +664,8 @@ function createSqliteAgentRuntimeStore(config) {
664
664
  AND id IN (${placeholders(parameters.length)})
665
665
  ORDER BY position ASC
666
666
  `).all(message.conversationId, ...parameters).map((row) => PositionedMessageRowSchema.parse(row));
667
- const first = rows[0];
668
- if (!first || rows.length !== parameters.length) {
667
+ const anchor = rows.at(-1);
668
+ if (!anchor || rows.length !== parameters.length) {
669
669
  throw new Error("Compaction range changed inside the transaction");
670
670
  }
671
671
  transaction.prepare(`
@@ -676,7 +676,7 @@ function createSqliteAgentRuntimeStore(config) {
676
676
  INSERT INTO stitchkit_agent_runtime_messages
677
677
  (conversation_id, id, position, active, payload)
678
678
  VALUES (?, ?, ?, 1, ?)
679
- `).run(message.conversationId, message.id, first.position, encodeJson(message));
679
+ `).run(message.conversationId, message.id, anchor.position, encodeJson(message));
680
680
  return;
681
681
  }
682
682
  const existing = transaction.prepare(`
package/llms-full.txt CHANGED
@@ -4952,8 +4952,10 @@ const removed = new Set(page.compacted)
4952
4952
  `items` stays one sequence in the order it happened, and `compacted` names the
4953
4953
  ids inside it that the model no longer sees — the boundary is a mark on the
4954
4954
  conversation, not a second list. A compaction summary sits at the position of
4955
- the first message it replaced, so it appears at the head of the block it
4956
- stands for. Without the flag the page is exactly what it was, `compacted`
4955
+ the last message it replaced, so the block reads through and the summary
4956
+ arrives after it, where it was written; in the model's history, where every
4957
+ replaced message is gone, it occupies the block's place either way. Without
4958
+ the flag the page is exactly what it was, `compacted`
4957
4959
  empty. The v1 → v2 migration baseline records the same thing: the whole
4958
4960
  sequence, with `compacted` naming what had been folded away. A file migrated
4959
4961
  by 0.86.0 has a baseline built from the active history only — the messages
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stitchkit",
3
- "version": "0.87.0",
3
+ "version": "0.87.1",
4
4
  "description": "Contract-first backend framework — one defineContract() into an HTTP API, MCP tools, AI-agent tools and a typed client. Bun and Node.",
5
5
  "keywords": [
6
6
  "bun",