@unson/brainbase-mcp 0.50.24 → 0.50.26

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.
@@ -46,11 +46,7 @@ export function createJudgmentJournalTurnPublisher(options) {
46
46
  || ('tenant_id' in episode && episode.tenant_id !== input.trustedPrincipal.tenantId))
47
47
  throw new Error('invalid');
48
48
  const final = (await read(`${prefix}.final.json`));
49
- const receipt = episode.initial_route_receipt;
50
- if (!object(receipt) || typeof receipt.resolution_id !== 'string' || !receipt.resolution_id
51
- || receipt.project_code !== input.projectCode
52
- || (receipt.turn_id !== undefined && receipt.turn_id !== input.turnId)
53
- || (episode.turn_id !== undefined && episode.turn_id !== input.turnId)
49
+ if ((episode.turn_id !== undefined && episode.turn_id !== input.turnId)
54
50
  || (episode.session_ref !== undefined && episode.session_ref !== sessionRef)
55
51
  || (final.turn_id !== undefined && final.turn_id !== input.turnId)
56
52
  || (final.session_ref !== undefined && final.session_ref !== sessionRef)
@@ -80,6 +76,19 @@ export function createJudgmentJournalTurnPublisher(options) {
80
76
  });
81
77
  if (final.event_count !== events.length)
82
78
  throw new Error('invalid');
79
+ // The Host finalizes against the last successful brainbase_resolve_turn TurnContract,
80
+ // falling back to the episode's bootstrap route receipt; the history reader binds the same way.
81
+ const resolved = [...rawEvents].reverse().find(event => event.success === true
82
+ && Array.isArray(event.satisfies) && event.satisfies.includes('judgment.resolve_turn')
83
+ && object(event.safe_metadata) && object(event.safe_metadata.turn_contract));
84
+ const receipt = resolved ? resolved.safe_metadata.turn_contract
85
+ : episode.initial_route_receipt;
86
+ if (!object(receipt) || typeof receipt.resolution_id !== 'string' || !receipt.resolution_id
87
+ || receipt.project_code !== input.projectCode
88
+ || (receipt.turn_id !== undefined && receipt.turn_id !== input.turnId)
89
+ || ('owner_person_id' in receipt && receipt.owner_person_id !== input.trustedPrincipal.personId)
90
+ || ('tenant_id' in receipt && receipt.tenant_id !== input.trustedPrincipal.tenantId))
91
+ throw new Error('invalid');
83
92
  const turnInput = await read(`${prefix}.turn-input.json`, true);
84
93
  const valueProof = await read(`${prefix}.value-proof.json`, true);
85
94
  body = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unson/brainbase-mcp",
3
- "version": "0.50.24",
3
+ "version": "0.50.26",
4
4
  "description": "Local-first Brainbase judgment OS that lets supported AI agents reuse a user's approved goals, priorities, decisions, and judgment criteria.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -175,6 +175,10 @@
175
175
  "types": "./dist/company-os-objectives.d.ts",
176
176
  "import": "./dist/company-os-objectives.js"
177
177
  },
178
+ "./claude-code-judgment-hook": {
179
+ "types": "./dist/claude-code-judgment-hook.d.ts",
180
+ "import": "./dist/claude-code-judgment-hook.js"
181
+ },
178
182
  "./company-os-evaluation": {
179
183
  "types": "./dist/company-os-evaluation.d.ts",
180
184
  "import": "./dist/company-os-evaluation.js"
@@ -295,6 +299,10 @@
295
299
  "types": "./dist/ontology-release-trust.d.ts",
296
300
  "import": "./dist/ontology-release-trust.js"
297
301
  },
302
+ "./brainbase-login": {
303
+ "types": "./dist/brainbase-login.d.ts",
304
+ "import": "./dist/brainbase-login.js"
305
+ },
298
306
  "./canonical-document-writer": {
299
307
  "types": "./dist/canonical-document-writer.d.ts",
300
308
  "import": "./dist/canonical-document-writer.js"
@@ -661,5 +669,5 @@
661
669
  "url": "https://github.com/Unson-LLC/brainbase/issues"
662
670
  },
663
671
  "homepage": "https://github.com/Unson-LLC/brainbase#readme",
664
- "gitHead": "a5b10747c2cea7d6370bb977def167093efbdbc8"
672
+ "gitHead": "be6520308b1f4e17bdb4494a556532e89e231268"
665
673
  }