wendkeep 0.64.0 → 0.65.0

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.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,26 @@ All notable changes to **wendkeep** are documented here. Format based on
4
4
  [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); this project follows
5
5
  [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [0.65.0] — 2026-07-29
8
+
9
+ ### Added
10
+
11
+ - **O workspace privado MCP passa a ter um kernel canônico de configuração.**
12
+ `packages/mcp/src/config.mjs` concentra a entrada do MCPVault, a seleção de servidores por
13
+ descritores e o merge imutável de `.mcp.json`, sem efeitos no import.
14
+ - **O tarball instalado prova a composição MCP fora do checkout.** O teste executa `init` em um
15
+ consumidor temporário, confirma a preservação de configuração existente e rejeita exports
16
+ públicos prematuros como `wendkeep/mcp` e `@wendkeep/mcp`.
17
+
18
+ ### Changed
19
+
20
+ - **Taxonomia e instalador agora delegam ao kernel MCP.** `src/taxonomy.mjs` fornece descritores
21
+ como dados e preserva a identidade dos exports históricos; `src/init.mjs` mantém a orquestração
22
+ do filesystem e o comportamento de reconciliação, inclusive `.mcp.json.new` para JSON inválido.
23
+ - **A publicação continua unificada e compatível.** Não há servidor MCP nativo, subpath público ou
24
+ pacote npm separado nesta fase; comandos, flags, transporte MCPVault e arquivos existentes
25
+ preservam o comportamento anterior.
26
+
7
27
  ## [0.64.0] — 2026-07-28
8
28
 
9
29
  ### Added
package/README.en.md CHANGED
@@ -16,14 +16,22 @@
16
16
  **Persistent memory for AI coding agents, built on your Obsidian vault.** Every Claude Code **and Codex** session is captured turn by turn into local Markdown — `init` wires both (Codex asks you to approve its hooks once; `import` backfills past sessions either way) — with token/cost tracking and automatically extracted decisions, bugs, and learnings. That always-on plane is **Keep Core**. On top of it, **Wend Runtime** provides a native, zero-dependency lifecycle (spec → change → TDD → sensor-gated archive), selected through the `OFF`, `FLOW`, `GUIDE`, `GOVERN`, and `ASSURE` Operating Profiles. 100% local, open-core.
17
17
 
18
18
  The runtime is being separated into six physical boundaries — `cli`, `harness`, `vault`, `mcp`,
19
- `integrations`, and `pi` — without fragmenting installation. The private `cli`, `harness`, and
20
- `vault` workspaces now canonically own the executable runtime, Operating Profiles/the sensor
21
- engine, and safe binding/the Shared Project Memory v2 kernel, respectively. The root package
22
- exposes Harness and Vault through `wendkeep/harness` and `wendkeep/vault`; CLI remains public only
23
- through the `wendkeep`/`wk` binaries. Historical imports keep working through compatibility
24
- facades and no session data needs migration;
19
+ `integrations`, and `pi` — without fragmenting installation. The private `cli`, `harness`,
20
+ `vault`, and `mcp` workspaces now canonically own the executable runtime, Operating Profiles/the
21
+ sensor engine, safe binding/the Shared Project Memory v2 kernel, and the MCP configuration kernel,
22
+ respectively. The root package exposes Harness and Vault through `wendkeep/harness` and
23
+ `wendkeep/vault`; CLI and MCP remain private surfaces, reached only through the binaries and the
24
+ configuration effects of `init`. Historical imports keep working through compatibility facades
25
+ and no session data needs migration;
25
26
  see the [modular architecture](docs/en/architecture.md).
26
27
 
28
+ In the **0.65 MCP Configuration Kernel** phase, `packages/mcp/src/config.mjs` becomes the
29
+ canonical authority for the MCPVault entry, catalog-described server selection, and `.mcp.json`
30
+ merging. `src/taxonomy.mjs` supplies descriptors while `src/init.mjs` retains only filesystem
31
+ orchestration. Existing keys and servers remain preserved; invalid JSON stays byte-for-byte intact
32
+ and the reconciled proposal is written to `.mcp.json.new`. The workspace remains private, with no
33
+ public `wendkeep/mcp` subpath or separate npm package.
34
+
27
35
  In the **0.64 CLI Runtime** phase, `packages/cli/src/index.mjs` owns help, version reporting, Vault
28
36
  selection, error presentation, and lazy dispatch. `bin/wendkeep.mjs` is reduced to the shebang and
29
37
  a `runCli()` invocation. The tarball remains a single artifact and proves both aliases in an
package/README.md CHANGED
@@ -16,14 +16,22 @@
16
16
  **Persistent memory for AI coding agents, built on your Obsidian vault.** Every Claude Code **and Codex** session is captured turn by turn into local Markdown — `init` wires both (Codex asks you to approve its hooks once; `import` backfills past sessions either way) — with token/cost tracking and automatically extracted decisions, bugs, and learnings. That always-on plane is **Keep Core**. On top of it, **Wend Runtime** provides a native, zero-dependency lifecycle (spec → change → TDD → sensor-gated archive), selected through the `OFF`, `FLOW`, `GUIDE`, `GOVERN`, and `ASSURE` Operating Profiles. 100% local, open-core.
17
17
 
18
18
  The runtime is being separated into six physical boundaries — `cli`, `harness`, `vault`, `mcp`,
19
- `integrations`, and `pi` — without fragmenting installation. The private `cli`, `harness`, and
20
- `vault` workspaces now canonically own the executable runtime, Operating Profiles/the sensor
21
- engine, and safe binding/the Shared Project Memory v2 kernel, respectively. The root package
22
- exposes Harness and Vault through `wendkeep/harness` and `wendkeep/vault`; CLI remains public only
23
- through the `wendkeep`/`wk` binaries. Historical imports keep working through compatibility
24
- facades and no session data needs migration;
19
+ `integrations`, and `pi` — without fragmenting installation. The private `cli`, `harness`,
20
+ `vault`, and `mcp` workspaces now canonically own the executable runtime, Operating Profiles/the
21
+ sensor engine, safe binding/the Shared Project Memory v2 kernel, and the MCP configuration kernel,
22
+ respectively. The root package exposes Harness and Vault through `wendkeep/harness` and
23
+ `wendkeep/vault`; CLI and MCP remain private surfaces, reached only through the binaries and the
24
+ configuration effects of `init`. Historical imports keep working through compatibility facades
25
+ and no session data needs migration;
25
26
  see the [modular architecture](docs/en/architecture.md).
26
27
 
28
+ In the **0.65 MCP Configuration Kernel** phase, `packages/mcp/src/config.mjs` becomes the
29
+ canonical authority for the MCPVault entry, catalog-described server selection, and `.mcp.json`
30
+ merging. `src/taxonomy.mjs` supplies descriptors while `src/init.mjs` retains only filesystem
31
+ orchestration. Existing keys and servers remain preserved; invalid JSON stays byte-for-byte intact
32
+ and the reconciled proposal is written to `.mcp.json.new`. The workspace remains private, with no
33
+ public `wendkeep/mcp` subpath or separate npm package.
34
+
27
35
  In the **0.64 CLI Runtime** phase, `packages/cli/src/index.mjs` owns help, version reporting, Vault
28
36
  selection, error presentation, and lazy dispatch. `bin/wendkeep.mjs` is reduced to the shebang and
29
37
  a `runCli()` invocation. The tarball remains a single artifact and proves both aliases in an
@@ -73,6 +73,11 @@ pnpm exec wendkeep sync --yes
73
73
  The project receives `.wendkeep.json`, managed Claude/Codex hooks, skill definitions, and an
74
74
  initialized vault. Existing files are merged or preserved, and the selected vault is printed.
75
75
 
76
+ When MCP is enabled, `init` preserves existing properties and servers in `.mcp.json` and adds
77
+ `wendkeep-vault`. If the existing JSON is invalid, the original file remains byte-for-byte intact
78
+ and the reconciled proposal is written to `.mcp.json.new`. Since version 0.65, this composition is
79
+ owned by the private MCP kernel without changing commands, flags, or the public npm surface.
80
+
76
81
  ## Common errors and diagnosis
77
82
 
78
83
  - Wrong vault: inspect `.wendkeep.json` and run `wendkeep doctor --vault <path>`.
@@ -74,6 +74,11 @@ O projeto recebe `.wendkeep.json`, hooks gerenciados de Claude/Codex, definiçõ
74
74
  cofre inicializado. Arquivos preexistentes são mesclados ou preservados; o comando informa o
75
75
  cofre efetivamente selecionado.
76
76
 
77
+ Quando MCP está habilitado, o `init` preserva propriedades e servidores existentes em `.mcp.json`
78
+ e adiciona `wendkeep-vault`. Se o JSON existente for inválido, o arquivo original permanece byte
79
+ a byte intacto e a proposta reconciliada é gravada em `.mcp.json.new`. Desde a versão 0.65, essa
80
+ composição pertence ao kernel MCP privado, sem alterar comandos, flags ou a superfície npm pública.
81
+
77
82
  ## Erros comuns e diagnóstico
78
83
 
79
84
  - Cofre errado: confira `.wendkeep.json` e rode `wendkeep doctor --vault <path>`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wendkeep",
3
- "version": "0.64.0",
3
+ "version": "0.65.0",
4
4
  "description": "Vault-first persistent memory for AI coding agents, with an optional profile-aware governance runtime: OFF, FLOW, GUIDE, GOVERN, or ASSURE. Local-first and agent-agnostic (Claude Code, Codex, Cursor…).",
5
5
  "type": "module",
6
6
  "workspaces": [
@@ -31,7 +31,7 @@
31
31
  "node": ">=18"
32
32
  },
33
33
  "scripts": {
34
- "check": "node --check bin/wendkeep.mjs && node --check packages/cli/src/index.mjs && node --check src/init.mjs && node --check src/doctor.mjs && node --check src/project-vault.mjs && node --check src/operating-profile.mjs && node --check src/profile.mjs && node --check src/flow.mjs && node --check hooks/operating-profile-runtime.mjs && node --check hooks/flow-core.mjs && node --check hooks/flow-protected-policy.mjs && node --check hooks/git-snapshot.mjs && node --check hooks/vault-path-safety.mjs && node --check hooks/vault-runtime-store.mjs && node --check packages/harness/src/index.mjs && node --check packages/harness/src/flow-store.mjs && node --check packages/harness/src/operating-profile.mjs && node --check packages/harness/src/sensors-core.mjs && node --check packages/vault/src/index.mjs && node --check packages/vault/src/project-vault.mjs && node --check packages/vault/src/vault-path-safety.mjs && node --check packages/vault/src/locale.mjs && node --check packages/vault/src/memory-schema.mjs && node --check packages/vault/src/memory-mode.mjs && node --check packages/vault/src/memory-handoff.mjs && node --check packages/vault/src/memory-store.mjs && node --check packages/vault/src/validate-core.mjs && node --check packages/vault/src/validate-memory.mjs",
34
+ "check": "node --check bin/wendkeep.mjs && node --check packages/cli/src/index.mjs && node --check src/init.mjs && node --check src/doctor.mjs && node --check src/project-vault.mjs && node --check src/operating-profile.mjs && node --check src/profile.mjs && node --check src/flow.mjs && node --check hooks/operating-profile-runtime.mjs && node --check hooks/flow-core.mjs && node --check hooks/flow-protected-policy.mjs && node --check hooks/git-snapshot.mjs && node --check hooks/vault-path-safety.mjs && node --check hooks/vault-runtime-store.mjs && node --check packages/harness/src/index.mjs && node --check packages/harness/src/flow-store.mjs && node --check packages/harness/src/operating-profile.mjs && node --check packages/harness/src/sensors-core.mjs && node --check packages/mcp/src/config.mjs && node --check packages/mcp/src/index.mjs && node --check packages/vault/src/index.mjs && node --check packages/vault/src/project-vault.mjs && node --check packages/vault/src/vault-path-safety.mjs && node --check packages/vault/src/locale.mjs && node --check packages/vault/src/memory-schema.mjs && node --check packages/vault/src/memory-mode.mjs && node --check packages/vault/src/memory-handoff.mjs && node --check packages/vault/src/memory-store.mjs && node --check packages/vault/src/validate-core.mjs && node --check packages/vault/src/validate-memory.mjs",
35
35
  "test": "node --test",
36
36
  "release": "node scripts/release.mjs",
37
37
  "release:dry": "node scripts/release.mjs --dry-run",
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "name": "@wendkeep/mcp",
3
3
  "private": true,
4
- "type": "module"
4
+ "type": "module",
5
+ "exports": "./src/index.mjs"
5
6
  }
@@ -0,0 +1,33 @@
1
+ export const MCP_SERVER_KEY = 'wendkeep-vault';
2
+
3
+ export function mcpServerEntry(vaultPath) {
4
+ return {
5
+ type: 'stdio',
6
+ command: 'npx',
7
+ args: ['-y', '@bitbonsai/mcpvault@latest', vaultPath],
8
+ };
9
+ }
10
+
11
+ export function selectMcpServers(descriptors, skipIds = []) {
12
+ const skipSet = new Set(skipIds);
13
+ const servers = {};
14
+ for (const descriptor of descriptors || []) {
15
+ if (!descriptor || skipSet.has(descriptor.id)) continue;
16
+ if (typeof descriptor.key !== 'string' || !descriptor.key) continue;
17
+ if (!descriptor.entry || typeof descriptor.entry !== 'object') continue;
18
+ servers[descriptor.key] = descriptor.entry;
19
+ }
20
+ return servers;
21
+ }
22
+
23
+ export function mergeMcpConfig(existing, {
24
+ vaultPath,
25
+ withVault = true,
26
+ servers = {},
27
+ } = {}) {
28
+ const config = existing && typeof existing === 'object' ? { ...existing } : {};
29
+ config.mcpServers = { ...(config.mcpServers || {}) };
30
+ if (withVault) config.mcpServers[MCP_SERVER_KEY] = mcpServerEntry(vaultPath);
31
+ Object.assign(config.mcpServers, servers);
32
+ return config;
33
+ }
@@ -0,0 +1 @@
1
+ export * from './config.mjs';
package/src/init.mjs CHANGED
@@ -6,13 +6,12 @@ import { spawnSync } from 'node:child_process';
6
6
  import { copyFileSync, existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from 'node:fs';
7
7
  import { basename, isAbsolute, join, resolve } from 'node:path';
8
8
  import { createInterface } from 'node:readline/promises';
9
+ import { MCP_SERVER_KEY, mergeMcpConfig } from '../packages/mcp/src/index.mjs';
9
10
  import {
10
11
  VAULT_FOLDERS,
11
12
  SESSION_HOOKS,
12
13
  CHANGE_NUDGE_HOOKS,
13
14
  CHANGE_GATE_HOOKS,
14
- MCP_SERVER_KEY,
15
- mcpServerEntry,
16
15
  hookCommand,
17
16
  hookCommandLocal,
18
17
  hookCommandLocalLegacy,
@@ -245,11 +244,11 @@ export function mergeCodexHooks(existing, { force = false } = {}) {
245
244
  }
246
245
 
247
246
  export function mergeMcp(existing, { vaultPath, withVault = true, companions = [], skipMcp = [] }) {
248
- const m = existing && typeof existing === 'object' ? { ...existing } : {};
249
- m.mcpServers = { ...(m.mcpServers || {}) };
250
- if (withVault) m.mcpServers[MCP_SERVER_KEY] = mcpServerEntry(vaultPath);
251
- Object.assign(m.mcpServers, companionMcpPatch(companions, skipMcp));
252
- return m;
247
+ return mergeMcpConfig(existing, {
248
+ vaultPath,
249
+ withVault,
250
+ servers: companionMcpPatch(companions, skipMcp),
251
+ });
253
252
  }
254
253
 
255
254
  // Run caveman's cross-agent installer (non-Claude skill coverage). Downloads the
package/src/taxonomy.mjs CHANGED
@@ -1,3 +1,11 @@
1
+ import {
2
+ MCP_SERVER_KEY,
3
+ mcpServerEntry,
4
+ selectMcpServers,
5
+ } from '../packages/mcp/src/index.mjs';
6
+
7
+ export { MCP_SERVER_KEY, mcpServerEntry };
8
+
1
9
  // Shared, data-only constants for the wendkeep installer and CLI.
2
10
  // Kept free of side effects so both bin/ and src/ can import it cheaply.
3
11
 
@@ -93,17 +101,6 @@ export const RUNNABLE_HOOKS = [
93
101
  'plan-capture',
94
102
  ];
95
103
 
96
- // The MCP server entry wendkeep wires into .mcp.json so the agent can read/write the
97
- // vault. Uses the published mcpvault server (no secrets).
98
- export function mcpServerEntry(vaultPath) {
99
- return {
100
- type: 'stdio',
101
- command: 'npx',
102
- args: ['-y', '@bitbonsai/mcpvault@latest', vaultPath],
103
- };
104
- }
105
- export const MCP_SERVER_KEY = 'wendkeep-vault';
106
-
107
104
  // The three Claude Code session hooks, expressed as `wendkeep hook <name>` so the
108
105
  // installed package is the single source of truth (update with `npm update wendkeep`,
109
106
  // no re-copying). Returned as a spec the merge logic folds into settings.json.
@@ -281,14 +278,11 @@ export function companionSettingsPatch(ids) {
281
278
  // `skip` omits ids whose MCP is already configured elsewhere (e.g. dotcontext set
282
279
  // globally in ~/.claude.json — avoids a duplicate project-scoped server).
283
280
  export function companionMcpPatch(ids, skip = []) {
284
- const skipSet = new Set(skip);
285
- const servers = {};
286
- for (const id of ids) {
287
- if (skipSet.has(id)) continue;
288
- const c = COMPANION_BY_ID[id];
289
- if (c?.mcp) servers[c.mcp.key] = c.mcp.entry;
290
- }
291
- return servers;
281
+ const descriptors = ids.map((id) => {
282
+ const mcp = COMPANION_BY_ID[id]?.mcp;
283
+ return mcp ? { id, key: mcp.key, entry: mcp.entry } : { id };
284
+ });
285
+ return selectMcpServers(descriptors, skip);
292
286
  }
293
287
 
294
288
  // SessionStart hook specs wendkeep must author for companions that lack a native