dsh-plugin-soulbridge 0.0.107 → 0.0.108

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 +11 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -484,6 +484,7 @@ export function mentions(text, entity) {
484
484
  export function buildFactHooks(text, options = {}) {
485
485
  const parts = [];
486
486
  const used = [];
487
+ let sawInferred = false;
487
488
  try {
488
489
  const known = ensureSoul().findEntities('', 50);
489
490
  // The entity timeline already covers the subject of an entity question;
@@ -499,7 +500,11 @@ export function buildFactHooks(text, options = {}) {
499
500
  if (seen.has(fact.id)) continue;
500
501
  seen.add(fact.id);
501
502
  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)})` : ''}`);
503
+ // ADR 0035: a fact from my side of the exchange is inferred. Two characters plus one
504
+ // explanation below the block, because a per-line sentence would double the text.
505
+ const marker = fact.source === 'inferred' ? '我: ' : '';
506
+ if (marker) sawInferred = true;
507
+ lines.push(`- ${marker}[${fact.id}] ${escapeBlockText(fact.statement)}${when ? `(${escapeBlockText(when)})` : ''}`);
503
508
  used.push(fact.id);
504
509
  }
505
510
  if (lines.length > 0) {
@@ -510,6 +515,11 @@ export function buildFactHooks(text, options = {}) {
510
515
  log(`prestep: hooks failed: ${error instanceof Error ? error.message : String(error)}`);
511
516
  }
512
517
  if (parts.length === 0) return '';
518
+ if (sawInferred) {
519
+ parts.push(
520
+ '<source-notes>以「我:」开头的是我上一轮说的话,未经用户确认;没标的都是用户说的。</source-notes>',
521
+ );
522
+ }
513
523
  return { text: parts.join('\n\n'), used };
514
524
  }
515
525
 
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.108",
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",