dsh-plugin-soulbridge 0.0.109 → 0.0.111

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/index.js +17 -0
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -509,6 +509,11 @@ export function buildFactHooks(text, options = {}) {
509
509
  lines.push(`- ${marker}[${fact.id}] ${escapeBlockText(fact.statement)}${when ? `(${escapeBlockText(when)})` : ''}`);
510
510
  used.push(fact.id);
511
511
  }
512
+ // The open questions about this person are what make the block actionable: without
513
+ // them the model sees history but cannot ask "how is she now".
514
+ for (const gap of ensureSoul().openGapsAbout(entity.id).slice(0, 2)) {
515
+ lines.push(`- 未闭合:${escapeBlockText(gap.topic)}`);
516
+ }
512
517
  if (lines.length > 0) {
513
518
  parts.push(`<about name="${escapeAttr(entity.name)}">\n${lines.join('\n')}\n</about>`);
514
519
  }
@@ -884,6 +889,18 @@ export function createPreStepHandler(deps) {
884
889
  } catch (error) {
885
890
  log(`threads close failed: ${error instanceof Error ? error.message : String(error)}`);
886
891
  }
892
+
893
+ // Housekeeping once per turn: an open question nobody answered in two weeks stopped
894
+ // being a question worth asking. No model call, one UPDATE.
895
+ try {
896
+ const swept = ensureSoul().sweep(Date.now(), { gapMaxAgeDays: 14 });
897
+ if (swept.gapsClosed > 0) {
898
+ log(`gaps closed: ${swept.gapsClosed} (expired)`);
899
+ trace({ event: 'gaps-expired', closed: swept.gapsClosed });
900
+ }
901
+ } catch (error) {
902
+ log(`gap sweep failed: ${error instanceof Error ? error.message : String(error)}`);
903
+ }
887
904
  const messages = Array.isArray(payload?.messages) ? payload.messages : [];
888
905
  const text = textOf(messages[messages.length - 1]?.content);
889
906
  if (text.length === 0) return decision;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-plugin-soulbridge",
3
- "version": "0.0.109",
3
+ "version": "0.0.111",
4
4
  "description": "Inject soulbridge context into DSH sessions and feed user turns back as observations.",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -42,6 +42,6 @@
42
42
  "setup": "node scripts/install-hooks.mjs"
43
43
  },
44
44
  "dependencies": {
45
- "soulbridge": ">=0.0.106 <0.1.0"
45
+ "soulbridge": ">=0.0.108 <0.1.0"
46
46
  }
47
47
  }