@unson/brainbase-mcp 0.50.23 → 0.50.25

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.
@@ -0,0 +1,26 @@
1
+ export interface JudgmentProjectBindingCandidates {
2
+ /** The Host runtime of the turn (`codex` or `claude-code`). */
3
+ hostRuntime: string;
4
+ /** BRAINBASE_JUDGMENT_PROJECT_CODE as the Host received it. */
5
+ configuredProjectCode?: string | null;
6
+ /** The enabled public relay's project for the cwd's repository. */
7
+ relayProjectCode?: string | null;
8
+ /** The owner-local repository mapping's project for the cwd. */
9
+ ownerRepositoryProjectCode?: string | null;
10
+ /** The cwd's repository name, as the last fallback. */
11
+ sourceRepository?: string | null;
12
+ }
13
+ /**
14
+ * Order:
15
+ * 1. A Claude Code turn's configured project. The owner's bridge sets it only
16
+ * from that request's project header and removes it otherwise, so it is
17
+ * the project the turn named.
18
+ * 2. The enabled public relay's repository mapping. In a Codex environment it
19
+ * stays authoritative over a configured project left from earlier work.
20
+ * When a Claude Code turn named another project, the relay refuses the
21
+ * receipt at delivery (project mapping mismatch) instead of publishing it
22
+ * under the relay's project.
23
+ * 3. The configured project, then the owner-local repository mapping, then
24
+ * the repository name.
25
+ */
26
+ export declare function selectJudgmentProjectBinding(candidates: JudgmentProjectBindingCandidates): string | null;
@@ -0,0 +1,30 @@
1
+ // The project a judgment turn is resolved and audited for, chosen from the
2
+ // candidates a Host already holds. The Host reads the environment, the
3
+ // public relay's repository map, and the cwd's repository; this module only
4
+ // orders them, so every Host that resolves a turn picks the same project.
5
+ function present(value) {
6
+ const trimmed = typeof value === 'string' ? value.trim() : '';
7
+ return trimmed ? trimmed : null;
8
+ }
9
+ /**
10
+ * Order:
11
+ * 1. A Claude Code turn's configured project. The owner's bridge sets it only
12
+ * from that request's project header and removes it otherwise, so it is
13
+ * the project the turn named.
14
+ * 2. The enabled public relay's repository mapping. In a Codex environment it
15
+ * stays authoritative over a configured project left from earlier work.
16
+ * When a Claude Code turn named another project, the relay refuses the
17
+ * receipt at delivery (project mapping mismatch) instead of publishing it
18
+ * under the relay's project.
19
+ * 3. The configured project, then the owner-local repository mapping, then
20
+ * the repository name.
21
+ */
22
+ export function selectJudgmentProjectBinding(candidates) {
23
+ const configured = present(candidates.configuredProjectCode);
24
+ if (candidates.hostRuntime === 'claude-code' && configured)
25
+ return configured;
26
+ return present(candidates.relayProjectCode)
27
+ ?? configured
28
+ ?? present(candidates.ownerRepositoryProjectCode)
29
+ ?? present(candidates.sourceRepository);
30
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unson/brainbase-mcp",
3
- "version": "0.50.23",
3
+ "version": "0.50.25",
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",
@@ -79,6 +79,10 @@
79
79
  "types": "./dist/judgment-frame-evidence.d.ts",
80
80
  "import": "./dist/judgment-frame-evidence.js"
81
81
  },
82
+ "./judgment-project-binding": {
83
+ "types": "./dist/judgment-project-binding.d.ts",
84
+ "import": "./dist/judgment-project-binding.js"
85
+ },
82
86
  "./judgment-event-adapter": {
83
87
  "types": "./dist/judgment-event-adapter.d.ts",
84
88
  "import": "./dist/judgment-event-adapter.js"
@@ -171,6 +175,10 @@
171
175
  "types": "./dist/company-os-objectives.d.ts",
172
176
  "import": "./dist/company-os-objectives.js"
173
177
  },
178
+ "./claude-code-judgment-hook": {
179
+ "types": "./dist/claude-code-judgment-hook.d.ts",
180
+ "import": "./dist/claude-code-judgment-hook.js"
181
+ },
174
182
  "./company-os-evaluation": {
175
183
  "types": "./dist/company-os-evaluation.d.ts",
176
184
  "import": "./dist/company-os-evaluation.js"
@@ -291,6 +299,10 @@
291
299
  "types": "./dist/ontology-release-trust.d.ts",
292
300
  "import": "./dist/ontology-release-trust.js"
293
301
  },
302
+ "./brainbase-login": {
303
+ "types": "./dist/brainbase-login.d.ts",
304
+ "import": "./dist/brainbase-login.js"
305
+ },
294
306
  "./canonical-document-writer": {
295
307
  "types": "./dist/canonical-document-writer.d.ts",
296
308
  "import": "./dist/canonical-document-writer.js"
@@ -657,5 +669,5 @@
657
669
  "url": "https://github.com/Unson-LLC/brainbase/issues"
658
670
  },
659
671
  "homepage": "https://github.com/Unson-LLC/brainbase#readme",
660
- "gitHead": "49263ad02569eb3b2cccc652cade085502f82d4d"
672
+ "gitHead": "66825861926190cf2ec1c736285393a68bd307fe"
661
673
  }