dsh-plugin-soulbridge 0.0.113 → 0.0.114

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 (3) hide show
  1. package/README.md +11 -2
  2. package/index.js +9 -7
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -107,8 +107,17 @@ DSH 启动器对 `package.json` 直接 `JSON.parse`,不剥 BOM。用 Windows P
107
107
 
108
108
  计数来源是宿主的事件流:`step/start`(一次调用)、`assistant/attempt`(重试且没出消息)、
109
109
  `assistant/message.usage`(token)。子代理跑在自己的会话里,因此各自一条记录——事件流
110
- 里没有父子关系,猜一个比写两条更坏。插件**不算钱**:金额只从 `scripts/billing.mjs`
111
- (读平台导出)来,价目有峰谷两档且会变。
110
+ 里没有父子关系,猜一个比写两条更坏。
111
+
112
+ 插件**不算钱**(价目有峰谷两档且会变)。账单是另一件事,也只属于宿主侧的运维:
113
+
114
+ ```powershell
115
+ node scripts/billing.mjs --days 4 # 读平台导出,按天给金额/请求/三类 token 并复核单价
116
+ ```
117
+
118
+ 判读与限制见 [docs/cost-visibility.md](docs/cost-visibility.md)。这两样都**不属于 soulbridge**:
119
+ 记忆层存"发生了什么",不记"值多少钱"。
120
+
112
121
  ## 升级提示:新增工具需要新开会话
113
122
 
114
123
  `ctx.inject(['tools'])` 注册的工具在**会话创建时**进入该会话的工具集。插件升级后
package/index.js CHANGED
@@ -663,7 +663,7 @@ export function buildFactHooks(text, options = {}) {
663
663
  for (const fact of [...earliest, ...recent]) {
664
664
  if (seen.has(fact.id)) continue;
665
665
  seen.add(fact.id);
666
- const when = fact.atText ?? (fact.at ? new Date(fact.at).toISOString().slice(0, 10) : '');
666
+ const when = fact.validFromText ?? (fact.validFrom ? new Date(fact.validFrom).toISOString().slice(0, 10) : '');
667
667
  // ADR 0035: a fact from my side of the exchange is inferred. Two characters plus one
668
668
  // explanation below the block, because a per-line sentence would double the text.
669
669
  const marker = fact.source === 'inferred' ? INFERRED_MARKER : '';
@@ -810,7 +810,7 @@ function buildRelatedContext(text, state = {}) {
810
810
  const body = timeline
811
811
  .map(
812
812
  (fact) =>
813
- `- [${fact.id}] ${fact.atText ? `${escapeBlockText(fact.atText)} ` : ''}${escapeBlockText(fact.statement)}`,
813
+ `- [${fact.id}] ${fact.validFromText ? `${escapeBlockText(fact.validFromText)} ` : ''}${escapeBlockText(fact.statement)}`,
814
814
  )
815
815
  .join('\n');
816
816
  parts.push(`<about-now name="${escapeAttr(plan.subject)}">\n${body}\n</about-now>`);
@@ -2106,7 +2106,7 @@ async function runConsolidationStep() {
2106
2106
  const batch = context.facts.slice(0, CONSOLIDATION_MAX_FACTS).map((fact) => ({
2107
2107
  id: fact.id,
2108
2108
  statement: fact.statement,
2109
- atText: fact.atText,
2109
+ validFromText: fact.validFromText,
2110
2110
  }));
2111
2111
  let raw;
2112
2112
  try {
@@ -2351,8 +2351,9 @@ function detailTool() {
2351
2351
  properties: {
2352
2352
  ok: { type: 'boolean' },
2353
2353
  statement: { type: 'string' },
2354
- at: { type: 'number' },
2355
- atText: { type: 'string' },
2354
+ validFrom: { type: 'number' },
2355
+ validFromText: { type: 'string' },
2356
+ validTo: { type: 'number' },
2356
2357
  userText: { type: 'string' },
2357
2358
  assistantText: { type: 'string' },
2358
2359
  reason: { type: 'string' },
@@ -2373,8 +2374,9 @@ function detailTool() {
2373
2374
  return {
2374
2375
  ok: true,
2375
2376
  statement: detail.fact.statement,
2376
- at: detail.fact.at,
2377
- atText: detail.fact.atText,
2377
+ validFrom: detail.fact.validFrom,
2378
+ validFromText: detail.fact.validFromText,
2379
+ validTo: detail.fact.validTo,
2378
2380
  userText: detail.turn?.userText,
2379
2381
  assistantText: detail.turn?.assistantText,
2380
2382
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-plugin-soulbridge",
3
- "version": "0.0.113",
3
+ "version": "0.0.114",
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",