intentdna 1.8.5 → 1.8.6

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.
@@ -9,7 +9,7 @@
9
9
  {
10
10
  "name": "intentdna",
11
11
  "description": "Declarative policy layer for AI agent behavior with plugin-managed hook runtime for Claude Code.",
12
- "version": "1.8.5",
12
+ "version": "1.8.6",
13
13
  "author": {
14
14
  "name": "Samuel"
15
15
  },
@@ -25,5 +25,5 @@
25
25
  ]
26
26
  }
27
27
  ],
28
- "version": "1.8.5"
28
+ "version": "1.8.6"
29
29
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intentdna",
3
- "version": "1.8.5",
3
+ "version": "1.8.6",
4
4
  "description": "Declarative policy layer for AI agent behavior",
5
5
  "author": {
6
6
  "name": "Samuel"
@@ -921,7 +921,7 @@ export async function runSync(opts) {
921
921
  }
922
922
  const configPath = opts.files.length === 1 ? opts.files[0] : null;
923
923
  const variables = await resolveVariables(rawVars, configPath, { dryRun: opts.dryRun });
924
- // Step 8: Generate .claude/.mcp.json only for Claude Code skills.
924
+ // Step 8: Generate project-root .mcp.json only for Claude Code skills.
925
925
  if (skillSurface === "claude_code") {
926
926
  const mcpDeps = {};
927
927
  for (const d of dnas) {
@@ -929,7 +929,7 @@ export async function runSync(opts) {
929
929
  Object.assign(mcpDeps, d.mcp);
930
930
  }
931
931
  if (Object.keys(mcpDeps).length > 0) {
932
- const mcpJsonPath = resolve(projectDir, ".claude", ".mcp.json");
932
+ const mcpJsonPath = resolve(projectDir, ".mcp.json");
933
933
  if (opts.dryRun) {
934
934
  process.stderr.write(`Dry-run: would write ${Object.keys(mcpDeps).length} MCP server(s) to ${mcpJsonPath}\n`);
935
935
  }
@@ -1063,7 +1063,7 @@ export async function runSync(opts) {
1063
1063
  }
1064
1064
  }
1065
1065
  /**
1066
- * Write MCP server configuration to .claude/.mcp.json.
1066
+ * Write MCP server configuration to the Claude project-root .mcp.json.
1067
1067
  * Merges with existing config — DNA-declared servers are added/updated,
1068
1068
  * but existing user-configured servers are NOT overwritten.
1069
1069
  */
@@ -1074,7 +1074,12 @@ async function writeMCPConfig(mcpDeps, mcpJsonPath, variables) {
1074
1074
  const raw = await readFile(mcpJsonPath, "utf-8");
1075
1075
  existing = JSON.parse(raw);
1076
1076
  }
1077
- catch { /* doesn't exist yet */ }
1077
+ catch (error) {
1078
+ const code = error && typeof error === "object" && "code" in error ? error.code : undefined;
1079
+ if (code !== "ENOENT") {
1080
+ throw new Error(`Cannot read Claude MCP config: ${mcpJsonPath}`);
1081
+ }
1082
+ }
1078
1083
  const mcpServers = (existing.mcpServers ?? {});
1079
1084
  for (const [name, server] of Object.entries(mcpDeps)) {
1080
1085
  // Don't overwrite existing user-configured servers
@@ -524,7 +524,7 @@ export async function runHealth() {
524
524
  }
525
525
  catch {
526
526
  // Check for plugin registration instead
527
- const mcpPath = resolve(cwd, ".claude", ".mcp.json");
527
+ const mcpPath = resolve(cwd, ".mcp.json");
528
528
  try {
529
529
  const raw = await rf(mcpPath, "utf-8");
530
530
  const mcp = JSON.parse(raw);
@@ -46,7 +46,7 @@ export function createClaudeCoreSyncTargetPlan(options) {
46
46
  const compiledIR = createCompiledIR(options.ir, options.roles);
47
47
  const compiledIRPath = resolve(options.projectDir, ".dna", "compiled", "ir.json");
48
48
  const legacyHooksDir = resolve(options.projectDir, ".claude", "hooks");
49
- const mcpConfigPath = resolve(options.projectDir, ".claude", ".mcp.json");
49
+ const mcpConfigPath = resolve(options.projectDir, ".mcp.json");
50
50
  const settingsHookRegistration = createSettingsHookRegistration(options.ir, options.mode, options.settingsPath);
51
51
  const plannedArtifacts = [
52
52
  {
@@ -218,13 +218,18 @@ function createClaudeEvidencePlan(plannedArtifacts) {
218
218
  };
219
219
  }
220
220
  async function registerDNAMCPServer(projectDir) {
221
- const mcpJsonPath = resolve(projectDir, ".claude", ".mcp.json");
221
+ const mcpJsonPath = resolve(projectDir, ".mcp.json");
222
222
  let existing = {};
223
223
  try {
224
224
  const raw = await readFile(mcpJsonPath, "utf-8");
225
225
  existing = JSON.parse(raw);
226
226
  }
227
- catch { /* doesn't exist yet */ }
227
+ catch (error) {
228
+ const code = error && typeof error === "object" && "code" in error ? error.code : undefined;
229
+ if (code !== "ENOENT") {
230
+ throw new Error(`Cannot read Claude MCP config: ${mcpJsonPath}`);
231
+ }
232
+ }
228
233
  const mcpServers = (existing.mcpServers ?? {});
229
234
  if (mcpServers["intentdna"])
230
235
  return { path: mcpJsonPath, registered: false };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intentdna",
3
- "version": "1.8.5",
3
+ "version": "1.8.6",
4
4
  "description": "Intent DNA — Declarative policy layer for AI agent behavior",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",