@venizia/vulcan 0.4.10-2 → 0.4.10-21
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/README.md +30 -23
- package/base/checks/wiki-source-links.ts +17 -1
- package/base/claude/events.json +1 -11
- package/base/claude/settings.json +5 -76
- package/base/extensions/vulcan-guards.ts +81 -18
- package/base/hooks/guard-git.ts +95 -19
- package/base/hooks/guard-outside.ts +163 -43
- package/base/hooks/guard-writes.ts +15 -36
- package/base/hooks/session-start.ts +1 -1
- package/base/make/vulcan.mk +8 -5
- package/base/packs/venizia.md +16 -0
- package/base/references/delegation-brief.md +3 -5
- package/base/references/testing.md +1 -9
- package/base/rules.md +33 -38
- package/base/skills/build-a-feature/SKILL.md +4 -4
- package/base/skills/docs-update/SKILL.md +19 -8
- package/base/skills/fix-a-bug/SKILL.md +4 -2
- package/base/skills/plan-a-change/SKILL.md +1 -1
- package/base/skills/research/SKILL.md +1 -1
- package/base/skills/retro/SKILL.md +2 -2
- package/base/skills/review-a-change/SKILL.md +1 -1
- package/base/skills/visualize-work/SKILL.md +3 -3
- package/base/skills/visualize-work/references/spec.md +6 -3
- package/base/templates/AGENTS.md +9 -7
- package/base/templates/board.html +10 -110
- package/package.json +3 -3
- package/src/agents/atlas-block.ts +8 -31
- package/src/agents/codex-hooks.ts +1 -1
- package/src/agents/generated-block.ts +52 -0
- package/src/agents/hooks-json.ts +22 -3
- package/src/agents/index.ts +2 -0
- package/src/agents/render.ts +15 -2
- package/src/agents/resolve.ts +1 -0
- package/src/agents/rules-block.ts +92 -0
- package/src/board/command.ts +92 -30
- package/src/board/common/constants.ts +26 -0
- package/src/board/common/types.ts +10 -3
- package/src/board/fold.ts +1 -1
- package/src/board/github.ts +1 -2
- package/src/board/gitlab.ts +436 -0
- package/src/board/index.ts +1 -0
- package/src/board/logo.ts +49 -0
- package/src/board/open-file.ts +110 -0
- package/src/board/page.ts +57 -5
- package/src/board/schema.ts +4 -1
- package/src/board/server.ts +87 -3
- package/src/board/settings.ts +21 -24
- package/src/commands/changelog.command.ts +40 -0
- package/src/commands/clean.command.ts +6 -1
- package/src/commands/help.command.ts +2 -63
- package/src/commands/index.ts +6 -1
- package/src/commands/migrate.command.ts +71 -0
- package/src/commands/profile.command.ts +1 -1
- package/src/commands/runners.command.ts +43 -0
- package/src/commands/sync.command.ts +8 -4
- package/src/commands/table.ts +362 -0
- package/src/commit/check.ts +1 -0
- package/src/commit/common/constants.ts +4 -0
- package/src/commit/hook.ts +112 -8
- package/src/common/constants.ts +11 -9
- package/src/common/env-variables.ts +41 -0
- package/src/common/index.ts +1 -0
- package/src/common/layout-folder.ts +3 -4
- package/src/common/record.ts +5 -0
- package/src/config/common/constants.ts +28 -22
- package/src/config/loader.ts +22 -0
- package/src/config/schema.ts +330 -146
- package/src/create/add-app.ts +7 -2
- package/src/create/add-lib.ts +2 -4
- package/src/create/common/constants.ts +5 -3
- package/src/create/preset.ts +1 -0
- package/src/create/scratch.ts +2 -1
- package/src/doctor/checks.ts +277 -448
- package/src/doctor/common/constants.ts +27 -19
- package/src/doctor/private-values.ts +4 -1
- package/src/doctor/runner.ts +5 -12
- package/src/doctor/schema.ts +4 -0
- package/src/events/common/actor-names.ts +12 -0
- package/src/events/common/constants.ts +65 -38
- package/src/events/common/index.ts +1 -0
- package/src/events/hook.ts +5 -56
- package/src/events/text.ts +41 -6
- package/src/hooks/command-view.ts +80 -19
- package/src/hooks/common/constants.ts +26 -17
- package/src/hooks/common/types.ts +13 -24
- package/src/hooks/decision.ts +30 -12
- package/src/hooks/git-queries.ts +113 -0
- package/src/hooks/guard-git.ts +76 -24
- package/src/hooks/guard-outside.ts +334 -311
- package/src/hooks/guard-runner.ts +206 -0
- package/src/hooks/guard-writes.ts +87 -184
- package/src/hooks/hook-input.ts +57 -0
- package/src/hooks/index.ts +3 -6
- package/src/hooks/link-makers.ts +315 -0
- package/src/hooks/package-runners.ts +268 -0
- package/src/hooks/project-guards.ts +81 -44
- package/src/hooks/project-tmp.ts +39 -4
- package/src/hooks/runner-scan.ts +257 -0
- package/src/hooks/script-runners.ts +400 -0
- package/src/hooks/session-digest.ts +27 -117
- package/src/hooks/shell-folders.ts +760 -0
- package/src/hooks/shell-writes.ts +646 -0
- package/src/hooks/shell.ts +1421 -194
- package/src/hooks/subagent-card.ts +2 -2
- package/src/hooks/write-commands.ts +898 -0
- package/src/init/scaffold.ts +2 -3
- package/src/local/auto-clean.ts +2 -1
- package/src/local/browser-socket.ts +33 -0
- package/src/local/clean.ts +37 -6
- package/src/local/constants.ts +15 -1
- package/src/local/index.ts +1 -0
- package/src/local/scan.ts +41 -10
- package/src/manifest/render.ts +84 -30
- package/src/owner/constants.ts +4 -5
- package/src/owner/index.ts +0 -2
- package/src/owner/profile.ts +1 -0
- package/src/owner/schema.ts +51 -27
- package/src/owner/survey.ts +0 -3
- package/src/owner/view.ts +0 -9
- package/src/router.ts +8 -132
- package/src/rules/base.ts +12 -7
- package/src/rules/index.ts +1 -0
- package/src/rules/packs.ts +44 -0
- package/src/runners/check.ts +130 -0
- package/src/skills/frontmatter.ts +1 -0
- package/src/sync/agents-block.ts +104 -0
- package/src/sync/base-rules.ts +3 -3
- package/src/sync/claude-launch.ts +12 -12
- package/src/sync/common/constants.ts +0 -2
- package/src/sync/index.ts +1 -1
- package/src/sync/local-choice.ts +32 -3
- package/src/sync/planner.ts +2 -15
- package/src/sync/settings.ts +0 -17
- package/src/theme/index.ts +1 -0
- package/src/theme/tokens.ts +410 -0
- package/src/ui/prompt.ts +1 -0
- package/src/visualize/architecture.ts +504 -0
- package/src/visualize/assets.ts +41 -30
- package/src/visualize/compare-render.ts +22 -24
- package/src/visualize/constants.ts +27 -0
- package/src/visualize/diagrams.ts +13 -121
- package/src/visualize/kinds-render.ts +2 -2
- package/src/visualize/kinds-schema.ts +49 -0
- package/src/visualize/labels-vi.ts +25 -0
- package/src/visualize/labels.ts +2 -0
- package/src/visualize/layout.ts +415 -66
- package/src/visualize/page.ts +82 -15
- package/src/visualize/render.ts +2 -1
- package/src/visualize/schema.ts +29 -1
- package/src/visualize/sections.ts +78 -9
- package/src/visualize/theme.ts +49 -18
- package/src/wiki/anchors.ts +1 -0
- package/src/wiki/command.ts +10 -3
- package/src/wiki/source-links.ts +57 -18
- package/base/ci-global.json +0 -13
- package/base/claude/remote-hosts.json +0 -15
- package/base/hooks/guard-manifest.ts +0 -27
- package/base/hooks/guard-package.ts +0 -30
- package/base/hooks/guard-remote-hosts.ts +0 -70
- package/base/hooks/guard-scripting.ts +0 -32
- package/base/hooks/post-tool.ts +0 -37
- package/base/hooks/prompt-submit.ts +0 -54
- package/base/hooks/stop.ts +0 -40
- package/base/skills/build-a-feature/evals/evals.json +0 -29
- package/base/skills/docs-update/evals/evals.json +0 -23
- package/base/skills/docs-writing/evals/evals.json +0 -17
- package/base/skills/fix-a-bug/evals/evals.json +0 -17
- package/base/skills/knowledge-sync/SKILL.md +0 -81
- package/base/skills/knowledge-sync/knowledge-sync.workflow.js +0 -291
- package/base/skills/knowledge-sync/references/workflow.md +0 -44
- package/base/skills/plan-a-change/evals/evals.json +0 -47
- package/base/skills/report-back/evals/evals.json +0 -23
- package/base/skills/research/evals/evals.json +0 -17
- package/base/skills/retro/evals/evals.json +0 -17
- package/base/skills/review-a-change/evals/evals.json +0 -17
- package/base/skills/ship/evals/evals.json +0 -23
- package/base/skills/visualize-work/evals/evals.json +0 -17
- package/base/templates/ci/github-actions.yml +0 -75
- package/base/templates/ci/gitlab-ci.yml +0 -52
- package/base/templates/trusted-hosts.local.example +0 -11
- package/src/ci/affected.ts +0 -176
- package/src/ci/command.ts +0 -166
- package/src/ci/common/constants.ts +0 -76
- package/src/ci/common/index.ts +0 -2
- package/src/ci/common/types.ts +0 -37
- package/src/ci/git.ts +0 -72
- package/src/ci/global.ts +0 -48
- package/src/ci/graph.ts +0 -43
- package/src/ci/index.ts +0 -7
- package/src/ci/workspace.ts +0 -119
- package/src/commands/ci.command.ts +0 -4
- package/src/hooks/guard-manifest.ts +0 -109
- package/src/hooks/guard-package.ts +0 -226
- package/src/hooks/guard-scripting.ts +0 -36
- package/src/hooks/host-pattern.ts +0 -17
- package/src/hooks/owner-reply.ts +0 -162
- package/src/hooks/post-tool.ts +0 -138
- package/src/hooks/remote-hosts.ts +0 -1013
- package/src/hooks/trusted-scripts.ts +0 -212
- package/src/owner/shape.ts +0 -496
- package/src/owner/violations.ts +0 -332
- package/src/signals/claims.ts +0 -73
- package/src/signals/classify.ts +0 -137
- package/src/signals/constants.ts +0 -88
- package/src/signals/index.ts +0 -5
- package/src/signals/loop.ts +0 -48
- package/src/signals/state.ts +0 -271
- package/src/sync/atlas-block.ts +0 -56
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { existsSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { ContentsList } from '@venizia/vulcan-okf';
|
|
4
|
+
import { AtlasBlock, RulesBlock } from '../agents/index.ts';
|
|
5
|
+
import { ProjectLayout } from '../common/index.ts';
|
|
6
|
+
import type { TResolvedConfig } from '../config/index.ts';
|
|
7
|
+
import { ProjectTmp } from '../hooks/project-tmp.ts';
|
|
8
|
+
import { ProjectManifest } from '../manifest/index.ts';
|
|
9
|
+
import { BaseRules, RulePacks, RuleParser, RuleSlots } from '../rules/index.ts';
|
|
10
|
+
import { SyncStatuses } from './common/index.ts';
|
|
11
|
+
import type { ISyncAction } from './common/index.ts';
|
|
12
|
+
|
|
13
|
+
const NO_CHANGE = (): void => {};
|
|
14
|
+
|
|
15
|
+
const AGENTS_FILE = 'AGENTS.md';
|
|
16
|
+
|
|
17
|
+
const readText = (opts: { file: string }): string =>
|
|
18
|
+
existsSync(opts.file) ? readFileSync(opts.file, 'utf8') : '';
|
|
19
|
+
|
|
20
|
+
export class AgentsBlockPlan {
|
|
21
|
+
/** The rules block of this project: the base rules and the project's own, the slot choices and the config's often-dropped list. */
|
|
22
|
+
private static rulesBlockOf(opts: { root: string; config: TResolvedConfig }): string {
|
|
23
|
+
return RulesBlock.render({
|
|
24
|
+
rows: [
|
|
25
|
+
...Object.values(BaseRules.read({ packs: opts.config.packs })),
|
|
26
|
+
...RuleParser.extractRows({
|
|
27
|
+
markdown: readText({ file: join(opts.root, '.agents', 'rules.md') }),
|
|
28
|
+
}),
|
|
29
|
+
],
|
|
30
|
+
packs: opts.config.packs.map((name) => ({
|
|
31
|
+
path: RulePacks.pathOf({ name }),
|
|
32
|
+
name,
|
|
33
|
+
ids: Object.keys(RulePacks.rowsOf({ name })),
|
|
34
|
+
})),
|
|
35
|
+
slotLines: RulesBlock.slotLinesOf({
|
|
36
|
+
slots: RuleSlots.read(),
|
|
37
|
+
choices: opts.config.rules,
|
|
38
|
+
command: ProjectLayout.VULCAN_COMMAND,
|
|
39
|
+
}),
|
|
40
|
+
tmp: ProjectTmp.configuredOf({ tmp: opts.config.local.tmp }),
|
|
41
|
+
oftenDropped: opts.config.digest.oftenDropped,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* AGENTS.md with the Atlas block and the rules block merged in, or undefined when AGENTS.md is absent. Every
|
|
47
|
+
* project has the atlas server, and the blocks are what an agent that does not show the server's own text, or
|
|
48
|
+
* that no session-start hook reaches, reads, so they do not wait for a per-machine file to exist.
|
|
49
|
+
*/
|
|
50
|
+
static merged(opts: {
|
|
51
|
+
root: string;
|
|
52
|
+
config: TResolvedConfig;
|
|
53
|
+
}): { path: string; changed: boolean; text: string } | undefined {
|
|
54
|
+
const path = join(opts.root, AGENTS_FILE);
|
|
55
|
+
|
|
56
|
+
if (!existsSync(path)) {
|
|
57
|
+
return undefined;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const original = readFileSync(path, 'utf8');
|
|
61
|
+
const atlas = AtlasBlock.merge({
|
|
62
|
+
text: original,
|
|
63
|
+
block: AtlasBlock.render({
|
|
64
|
+
project: ProjectManifest.projectNameOf(opts),
|
|
65
|
+
sources: opts.config.atlas.sources.map((source) => source.name),
|
|
66
|
+
}),
|
|
67
|
+
});
|
|
68
|
+
const rules = RulesBlock.merge({
|
|
69
|
+
text: atlas.text,
|
|
70
|
+
block: AgentsBlockPlan.rulesBlockOf(opts),
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
// The blocks can make the file long, and a long agent-read file carries a contents list that `okf check --strict` wants fresh.
|
|
74
|
+
const text = opts.config.okf.contents.files.some((pattern) =>
|
|
75
|
+
new Bun.Glob(pattern).match(AGENTS_FILE),
|
|
76
|
+
)
|
|
77
|
+
? ContentsList.withContents({ text: rules.text })
|
|
78
|
+
: rules.text;
|
|
79
|
+
|
|
80
|
+
return { path, changed: text !== original, text };
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** The committed AGENTS.md carries the blocks for every agent, Claude included. */
|
|
84
|
+
static plan(opts: { root: string; config: TResolvedConfig }): ISyncAction[] {
|
|
85
|
+
const merged = AgentsBlockPlan.merged(opts);
|
|
86
|
+
|
|
87
|
+
if (merged === undefined) {
|
|
88
|
+
return [];
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if (!merged.changed) {
|
|
92
|
+
return [{ path: merged.path, status: SyncStatuses.UNCHANGED, apply: NO_CHANGE }];
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return [
|
|
96
|
+
{
|
|
97
|
+
path: merged.path,
|
|
98
|
+
status: SyncStatuses.REPLACED,
|
|
99
|
+
note: 'Atlas and rules blocks',
|
|
100
|
+
apply: () => writeFileSync(merged.path, merged.text),
|
|
101
|
+
},
|
|
102
|
+
];
|
|
103
|
+
}
|
|
104
|
+
}
|
package/src/sync/base-rules.ts
CHANGED
|
@@ -37,15 +37,15 @@ const readSyncedHashes = (opts: { root: string }): Record<string, unknown> => {
|
|
|
37
37
|
|
|
38
38
|
export class BaseRulesDiff {
|
|
39
39
|
/** V3: each base rule added, changed or removed since the committed manifest's last sync. */
|
|
40
|
-
static diff(opts: { root: string }): IBaseRuleChange[] {
|
|
40
|
+
static diff(opts: { root: string; packs?: string[] }): IBaseRuleChange[] {
|
|
41
41
|
const synced = readSyncedHashes(opts);
|
|
42
42
|
|
|
43
43
|
if (Object.keys(synced).length === 0) {
|
|
44
44
|
return [];
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
const installed = ProjectManifest.buildBaseRuleHashes();
|
|
48
|
-
const rows = BaseRules.read();
|
|
47
|
+
const installed = ProjectManifest.buildBaseRuleHashes({ packs: opts.packs });
|
|
48
|
+
const rows = BaseRules.read({ packs: opts.packs });
|
|
49
49
|
const changes: IBaseRuleChange[] = [];
|
|
50
50
|
|
|
51
51
|
for (const [id, hash] of Object.entries(installed)) {
|
|
@@ -16,16 +16,16 @@ export class LaunchSettings {
|
|
|
16
16
|
* moves its own task-output files and its MCP servers into the project. Absolute paths: the file belongs
|
|
17
17
|
* to one checkout of one developer.
|
|
18
18
|
*/
|
|
19
|
-
static renderClaude(opts: { root: string }): string {
|
|
20
|
-
const folder = ProjectTmp.projectOf(
|
|
19
|
+
static renderClaude(opts: { root: string; tmp?: string }): string {
|
|
20
|
+
const folder = ProjectTmp.projectOf(opts);
|
|
21
21
|
|
|
22
22
|
return `${JSON.stringify({ env: { TMPDIR: folder, CLAUDE_CODE_TMPDIR: folder } }, null, 2)}\n`;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
/** The launch file when it is missing or written for another folder; nothing to do when it is current. */
|
|
26
|
-
static planClaude(opts: { root: string }): ISyncAction[] {
|
|
26
|
+
static planClaude(opts: { root: string; tmp?: string }): ISyncAction[] {
|
|
27
27
|
const path = join(opts.root, CLAUDE_LAUNCH_FILE);
|
|
28
|
-
const text = LaunchSettings.renderClaude(
|
|
28
|
+
const text = LaunchSettings.renderClaude(opts);
|
|
29
29
|
const before = existsSync(path) ? readFileSync(path, 'utf8') : undefined;
|
|
30
30
|
|
|
31
31
|
if (before === text) {
|
|
@@ -100,14 +100,14 @@ export class ClaudeLaunch {
|
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
};
|
|
103
|
+
const isInProjectTmp = [opts.root, ...homes].some((home) =>
|
|
104
|
+
inside({ folder: real, base: realOf({ path: ProjectTmp.projectOf({ root: home }) }) }),
|
|
105
|
+
);
|
|
106
|
+
const isInLocal = homes.some((home) =>
|
|
107
|
+
inside({ folder: real, base: join(home, ProjectLayout.LOCAL_DIRECTORY) }),
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
return { state: isInProjectTmp || isInLocal ? 'inside' : 'outside', folder };
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
/**
|
|
@@ -14,8 +14,6 @@ export class SyncConstants {
|
|
|
14
14
|
|
|
15
15
|
static readonly CLAUDE_DIRECTORY = '.claude';
|
|
16
16
|
static readonly SETTINGS_FILE = 'settings.json';
|
|
17
|
-
/** The hook sync adds when the config sets `remoteHosts`; lives next to the shipped settings. */
|
|
18
|
-
static readonly REMOTE_HOSTS_FILE = 'remote-hosts.json';
|
|
19
17
|
static readonly COMMIT_ATTRIBUTION_FILE = 'commit-attribution.json';
|
|
20
18
|
/** The hooks sync adds when the config sets `events.log`. */
|
|
21
19
|
static readonly EVENTS_FILE = 'events.json';
|
package/src/sync/index.ts
CHANGED
|
@@ -5,6 +5,6 @@ export * from './settings.ts';
|
|
|
5
5
|
export * from './local-choice.ts';
|
|
6
6
|
export * from './claude-launch.ts';
|
|
7
7
|
export * from './agent-files.ts';
|
|
8
|
-
export * from './
|
|
8
|
+
export * from './agents-block.ts';
|
|
9
9
|
export * from './exclude.ts';
|
|
10
10
|
export * from './agent-removal.ts';
|
package/src/sync/local-choice.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
|
-
import { dirname, join } from 'node:path';
|
|
2
|
+
import { dirname, join, relative } from 'node:path';
|
|
3
3
|
import { LOCAL_AGENTS_FILE, LocalChoice } from '../agents/index.ts';
|
|
4
4
|
import { ProjectLayout } from '../common/index.ts';
|
|
5
|
+
import { HookConstants } from '../hooks/common/index.ts';
|
|
6
|
+
import { ProjectTmp } from '../hooks/project-tmp.ts';
|
|
5
7
|
import { LaunchSettings } from './claude-launch.ts';
|
|
6
8
|
import { SyncStatuses } from './common/index.ts';
|
|
7
9
|
import type { ISyncAction } from './common/index.ts';
|
|
@@ -62,11 +64,37 @@ export class LocalPlan {
|
|
|
62
64
|
return planIgnoreLine({ root: opts.root, line: LOCAL_AGENTS_FILE });
|
|
63
65
|
}
|
|
64
66
|
|
|
67
|
+
/**
|
|
68
|
+
* The folder `local.tmp` names, when it is not the default one: made and gitignored (a name is never hidden, so
|
|
69
|
+
* it is never under the `.agents/local/` that is ignored whole). The default folder is one of the layout's.
|
|
70
|
+
*/
|
|
71
|
+
static planTmp(opts: { root: string; tmp?: string }): ISyncAction[] {
|
|
72
|
+
const tmp = ProjectTmp.projectOf(opts);
|
|
73
|
+
|
|
74
|
+
if (tmp === join(opts.root, HookConstants.PROJECT_TMP)) {
|
|
75
|
+
return [];
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const isMade = existsSync(tmp);
|
|
79
|
+
|
|
80
|
+
return [
|
|
81
|
+
...planIgnoreLine({ root: opts.root, line: `/${relative(opts.root, tmp)}/` }),
|
|
82
|
+
{
|
|
83
|
+
path: tmp,
|
|
84
|
+
status: isMade ? SyncStatuses.UNCHANGED : SyncStatuses.CREATED,
|
|
85
|
+
...(isMade ? {} : { note: 'the project tmp folder, local.tmp' }),
|
|
86
|
+
apply: () => {
|
|
87
|
+
mkdirSync(tmp, { recursive: true });
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
];
|
|
91
|
+
}
|
|
92
|
+
|
|
65
93
|
/**
|
|
66
94
|
* The project's local workspace: `.agents/local/` is gitignored and holds what an agent creates while
|
|
67
95
|
* it works (scratch, worktrees, clones, cache, prototypes), so nothing lands outside the project.
|
|
68
96
|
*/
|
|
69
|
-
static planWorkspace(opts: { root: string }): ISyncAction[] {
|
|
97
|
+
static planWorkspace(opts: { root: string; tmp?: string }): ISyncAction[] {
|
|
70
98
|
const directory = join(opts.root, ProjectLayout.LOCAL_DIRECTORY);
|
|
71
99
|
const missing = ProjectLayout.LOCAL_LAYOUT.filter((entry) => !('onDemand' in entry))
|
|
72
100
|
.map((entry) => entry.name)
|
|
@@ -74,7 +102,8 @@ export class LocalPlan {
|
|
|
74
102
|
|
|
75
103
|
return [
|
|
76
104
|
...planIgnoreLine({ root: opts.root, line: `${ProjectLayout.LOCAL_DIRECTORY}/` }),
|
|
77
|
-
...
|
|
105
|
+
...LocalPlan.planTmp(opts),
|
|
106
|
+
...LaunchSettings.planClaude(opts),
|
|
78
107
|
{
|
|
79
108
|
path: directory,
|
|
80
109
|
status: missing.length === 0 ? SyncStatuses.UNCHANGED : SyncStatuses.CREATED,
|
package/src/sync/planner.ts
CHANGED
|
@@ -79,15 +79,6 @@ const buildManagedOverlay = (opts: { config: TResolvedConfig }): TSettings => {
|
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
if (opts.config.remoteHosts !== undefined) {
|
|
83
|
-
overlay = ProjectSettings.merge({
|
|
84
|
-
base: overlay,
|
|
85
|
-
overlay: JSON.parse(
|
|
86
|
-
readFileSync(join(BASE_DIRECTORY, 'claude', SyncConstants.REMOTE_HOSTS_FILE), 'utf8'),
|
|
87
|
-
),
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
|
|
91
82
|
if (opts.config.commit.message.agent.signature === AgentSignaturePolicies.DENY) {
|
|
92
83
|
overlay = ProjectSettings.merge({
|
|
93
84
|
base: overlay,
|
|
@@ -106,11 +97,6 @@ const buildManagedOverlay = (opts: { config: TResolvedConfig }): TSettings => {
|
|
|
106
97
|
});
|
|
107
98
|
}
|
|
108
99
|
|
|
109
|
-
overlay = ProjectSettings.merge({
|
|
110
|
-
base: overlay,
|
|
111
|
-
overlay: ProjectSettings.buildHook({ hooks: opts.config.hooks }),
|
|
112
|
-
});
|
|
113
|
-
|
|
114
100
|
return ProjectSettings.merge({ base: overlay, overlay: opts.config.claude.settings });
|
|
115
101
|
};
|
|
116
102
|
|
|
@@ -151,7 +137,7 @@ const planSettings = (opts: { root: string; config: TResolvedConfig }): ISyncAct
|
|
|
151
137
|
return {
|
|
152
138
|
path,
|
|
153
139
|
status: before === undefined ? SyncStatuses.CREATED : SyncStatuses.REPLACED,
|
|
154
|
-
note: 'shipped, slot
|
|
140
|
+
note: 'shipped, slot and claude.settings over personal keys',
|
|
155
141
|
apply: () => {
|
|
156
142
|
mkdirSync(directory, { recursive: true });
|
|
157
143
|
writeFileSync(path, text);
|
|
@@ -287,6 +273,7 @@ const skillDirectoriesOf = (opts: { agents: string[] }): string[] => [
|
|
|
287
273
|
),
|
|
288
274
|
];
|
|
289
275
|
|
|
276
|
+
/** Plans the files `vulcan sync` writes, as a list of actions, without touching disk; also used by `vulcan doctor` to find drift. */
|
|
290
277
|
export class SyncPlanner {
|
|
291
278
|
/** The committed project manifest (Project Contract v1, C1), rendered from the config. */
|
|
292
279
|
static planManifest(opts: { root: string; config: TResolvedConfig }): ISyncAction {
|
package/src/sync/settings.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { TResolvedConfig } from '../config/index.ts';
|
|
2
1
|
import { SyncConstants } from './common/index.ts';
|
|
3
2
|
import type { TSettings } from './common/index.ts';
|
|
4
3
|
|
|
@@ -222,20 +221,4 @@ export class ProjectSettings {
|
|
|
222
221
|
|
|
223
222
|
return remaining;
|
|
224
223
|
}
|
|
225
|
-
|
|
226
|
-
/** The project's own hooks from config, in Claude Code's settings shape. */
|
|
227
|
-
static buildHook(opts: { hooks: TResolvedConfig['hooks'] }): TSettings {
|
|
228
|
-
const byEvent: Record<string, unknown[]> = {};
|
|
229
|
-
|
|
230
|
-
for (const hook of opts.hooks) {
|
|
231
|
-
const entry = {
|
|
232
|
-
...(hook.matcher === undefined ? {} : { matcher: hook.matcher }),
|
|
233
|
-
hooks: [{ type: 'command', command: hook.command }],
|
|
234
|
-
};
|
|
235
|
-
|
|
236
|
-
byEvent[hook.event] = [...(byEvent[hook.event] ?? []), entry];
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
return { hooks: byEvent };
|
|
240
|
-
}
|
|
241
224
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './tokens.ts';
|