dsh-plugin-soulbridge 0.0.107 → 0.0.109

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 +9 -1
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -37,6 +37,8 @@ import {
37
37
  readVerification,
38
38
  escapeAttr,
39
39
  escapeBlockText,
40
+ INFERRED_MARKER,
41
+ SOURCE_NOTES,
40
42
  } from 'soulbridge';
41
43
 
42
44
  export const name = 'dsh-plugin-soulbridge';
@@ -484,6 +486,7 @@ export function mentions(text, entity) {
484
486
  export function buildFactHooks(text, options = {}) {
485
487
  const parts = [];
486
488
  const used = [];
489
+ let sawInferred = false;
487
490
  try {
488
491
  const known = ensureSoul().findEntities('', 50);
489
492
  // The entity timeline already covers the subject of an entity question;
@@ -499,7 +502,11 @@ export function buildFactHooks(text, options = {}) {
499
502
  if (seen.has(fact.id)) continue;
500
503
  seen.add(fact.id);
501
504
  const when = fact.atText ?? (fact.at ? new Date(fact.at).toISOString().slice(0, 10) : '');
502
- lines.push(`- [${fact.id}] ${escapeBlockText(fact.statement)}${when ? `(${escapeBlockText(when)})` : ''}`);
505
+ // ADR 0035: a fact from my side of the exchange is inferred. Two characters plus one
506
+ // explanation below the block, because a per-line sentence would double the text.
507
+ const marker = fact.source === 'inferred' ? INFERRED_MARKER : '';
508
+ if (marker) sawInferred = true;
509
+ lines.push(`- ${marker}[${fact.id}] ${escapeBlockText(fact.statement)}${when ? `(${escapeBlockText(when)})` : ''}`);
503
510
  used.push(fact.id);
504
511
  }
505
512
  if (lines.length > 0) {
@@ -510,6 +517,7 @@ export function buildFactHooks(text, options = {}) {
510
517
  log(`prestep: hooks failed: ${error instanceof Error ? error.message : String(error)}`);
511
518
  }
512
519
  if (parts.length === 0) return '';
520
+ if (sawInferred) parts.push(SOURCE_NOTES);
513
521
  return { text: parts.join('\n\n'), used };
514
522
  }
515
523
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-plugin-soulbridge",
3
- "version": "0.0.107",
3
+ "version": "0.0.109",
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.100 <0.1.0"
45
+ "soulbridge": ">=0.0.106 <0.1.0"
46
46
  }
47
47
  }