@stitchdb/cli 0.9.0 → 0.10.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.
Files changed (2) hide show
  1. package/dist/cli.js +22 -4
  2. package/package.json +2 -2
package/dist/cli.js CHANGED
@@ -683,7 +683,13 @@ async function cmdHook(args) {
683
683
  for (const m of sortedMems) {
684
684
  const isAuto = Array.isArray(m.tags) && m.tags.includes('auto');
685
685
  const txt = String(m.content || '').replace(/\n+/g, ' ').slice(0, 350);
686
- lines.push(`- **[${m.kind}${isAuto ? '·auto' : ''}]** ${txt}`);
686
+ // Source receipt: when this memory came from a distilled thread,
687
+ // mark the source so the agent knows it can call thread_recall on
688
+ // that thread for verbatim context behind the fact.
689
+ const src = m.source_thread_id
690
+ ? ` _(from thread, ${m.source_turn_ids?.length || 0} turns)_`
691
+ : '';
692
+ lines.push(`- **[${m.kind}${isAuto ? '·auto' : ''}]** ${txt}${src}`);
687
693
  }
688
694
  lines.push('');
689
695
  }
@@ -1238,13 +1244,25 @@ async function cmdDistill(args) {
1238
1244
  bumpDistillCooldown(thread);
1239
1245
  return;
1240
1246
  }
1241
- // Push each to Stitch as a memory with auto:true tag. No project:* tag —
1242
- // the workspace itself is the project identity.
1247
+ // Push each to Stitch as a memory with auto:true tag, plus receipts:
1248
+ // the source thread + the IDs of the turns this distill batch covered,
1249
+ // and a short excerpt from the most recent user turn so the dashboard /
1250
+ // recall surface can preview the conversational context behind the fact
1251
+ // without an extra round-trip.
1252
+ const sourceTurnIds = recall.recent.map((t) => t.id);
1253
+ const lastUserTurn = [...recall.recent].reverse().find((t) => t.role === 'user');
1254
+ const sourceExcerpt = lastUserTurn ? String(lastUserTurn.content || '').slice(0, 300) : undefined;
1243
1255
  let saved = 0;
1244
1256
  for (const m of memories) {
1245
1257
  try {
1246
1258
  const tags = ['auto', 'auto:distill', `thread:${thread}`, ...(m.tags || [])];
1247
- await stitch.remember(m.content, { kind: m.kind, tags });
1259
+ await stitch.remember(m.content, {
1260
+ kind: m.kind,
1261
+ tags,
1262
+ source_thread_id: recall.thread_id,
1263
+ source_turn_ids: sourceTurnIds,
1264
+ source_excerpt: sourceExcerpt,
1265
+ });
1248
1266
  saved++;
1249
1267
  }
1250
1268
  catch (e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stitchdb/cli",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "description": "Stitch CLI — manage memory + run agents from your terminal",
5
5
  "type": "module",
6
6
  "bin": {
@@ -16,7 +16,7 @@
16
16
  "license": "MIT",
17
17
  "engines": { "node": ">=20" },
18
18
  "dependencies": {
19
- "@stitchdb/agent": "^0.2.0"
19
+ "@stitchdb/agent": "^0.3.0"
20
20
  },
21
21
  "devDependencies": {
22
22
  "typescript": "^5.4.0",