@venizia/vulcan 0.2.0-7 → 0.2.0-9

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.
@@ -6,7 +6,7 @@ import type { TConfigExtension } from '../config/index.ts';
6
6
  import { InitConstants, InitStatuses } from './common/index.ts';
7
7
  import type { IInitEntry, IScaffoldFile } from './common/index.ts';
8
8
 
9
- /** Atlas serves the knowledge bundle alone, and the wiki and changelogs when there are any. */
9
+ /** The entry for a `.mcp.json` that exists already: atlas serves the knowledge bundle alone, and the wiki when there is one. */
10
10
  const MCP_SERVER_HINT =
11
11
  '"atlas": { "command": "bun", "args": ["x", "--no-install", "vulcan", "x", "atlas", "mcp", "--root", "."] }';
12
12
 
@@ -15,6 +15,7 @@ const SCAFFOLD_FILES: IScaffoldFile[] = [
15
15
  { path: 'AGENTS.md', template: 'AGENTS.md' },
16
16
  { path: '.agents/rules.md', template: 'rules.md' },
17
17
  { path: '.agents/knowledge/index.md', template: 'knowledge-index.md' },
18
+ { path: '.mcp.json', template: 'mcp.json' },
18
19
  ];
19
20
 
20
21
  /** The lint configs of a single-package project. A workspaces project keeps them in each app. */
@@ -134,7 +135,11 @@ export const scaffoldProject = (opts: {
134
135
 
135
136
  if (!existsSync(makefile)) {
136
137
  entries.push(
137
- writeIfAbsent({ root, path: 'Makefile', content: `${ProjectLayout.MAKE_INCLUDE_LINE}\n` }),
138
+ writeIfAbsent({
139
+ root,
140
+ path: 'Makefile',
141
+ content: renderTemplate({ template: 'Makefile', name }),
142
+ }),
138
143
  );
139
144
  } else if (!readFileSync(makefile, 'utf8').includes(ProjectLayout.MAKE_INCLUDE_LINE)) {
140
145
  entries.push({
@@ -143,10 +148,19 @@ export const scaffoldProject = (opts: {
143
148
  });
144
149
  }
145
150
 
146
- entries.push({
147
- status: InitStatuses.ADD,
148
- subject: `.mcp.json, for atlas over the knowledge bundle (and the wiki, when there is one; --root pins the project): ${MCP_SERVER_HINT}`,
149
- });
151
+ // A `.mcp.json` that was already there is the project's: it gets the atlas entry as a hint, never an edit.
152
+ if (
153
+ !entries.some(entry => entry.subject === '.mcp.json' && entry.status === InitStatuses.CREATED)
154
+ ) {
155
+ const servers = readFileSync(join(root, '.mcp.json'), 'utf8');
156
+
157
+ if (!servers.includes('"atlas"')) {
158
+ entries.push({
159
+ status: InitStatuses.ADD,
160
+ subject: `.mcp.json: the atlas server, for the knowledge bundle (and the wiki, when there is one; --root pins the project): ${MCP_SERVER_HINT}`,
161
+ });
162
+ }
163
+ }
150
164
 
151
165
  const gitignore = join(root, '.gitignore');
152
166
  const ignored = existsSync(gitignore) ? readFileSync(gitignore, 'utf8').split('\n') : [];
@@ -74,6 +74,8 @@ export const renderManifest = (opts: { root: string; config: TResolvedConfig }):
74
74
  rules: { project: ManifestConstants.PROJECT_RULES, base: buildBaseRuleHashes() },
75
75
  // The sources this project reads knowledge from (atlas, git mode); a project without any carries none.
76
76
  ...(config.atlas.sources.length === 0 ? {} : { sources: config.atlas.sources }),
77
+ // The remote-host guard reads its policy here; a project without the key has no guard.
78
+ ...(config.remoteHosts === undefined ? {} : { remoteHosts: config.remoteHosts }),
77
79
  };
78
80
 
79
81
  return `${JSON.stringify(manifest, null, 2)}\n`;
@@ -22,6 +22,8 @@ export class SyncConstants {
22
22
  static readonly CLAUDE_TOOL_FILE = 'CLAUDE.md';
23
23
  static readonly CLAUDE_DIRECTORY = '.claude';
24
24
  static readonly SETTINGS_FILE = 'settings.json';
25
+ /** The hook sync adds when the config sets `remoteHosts`; lives next to the shipped settings. */
26
+ static readonly REMOTE_HOSTS_FILE = 'remote-hosts.json';
25
27
  /** What sync applied last time, so a later sync can take back what the project no longer asks for. */
26
28
  static readonly MANAGED_FILE = 'vulcan-managed.json';
27
29
  static readonly SKILLS_DIRECTORY = 'skills';
@@ -94,6 +94,15 @@ const buildManagedOverlay = (opts: { config: TResolvedConfig }): TSettings => {
94
94
  }
95
95
  }
96
96
 
97
+ if (opts.config.remoteHosts !== undefined) {
98
+ overlay = mergeSettings({
99
+ base: overlay,
100
+ overlay: JSON.parse(
101
+ readFileSync(join(BASE_DIRECTORY, 'claude', SyncConstants.REMOTE_HOSTS_FILE), 'utf8'),
102
+ ),
103
+ });
104
+ }
105
+
97
106
  overlay = mergeSettings({
98
107
  base: overlay,
99
108
  overlay: buildProjectHookSettings({ hooks: opts.config.hooks }),