@venizia/vulcan 0.4.8 → 0.4.9-1
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/base/extensions/vulcan-guards.ts +48 -41
- package/base/hooks/antigravity-guards.ts +4 -3
- package/base/hooks/codex-guards.ts +17 -6
- package/base/hooks/guard-git.ts +8 -8
- package/base/hooks/guard-manifest.ts +5 -5
- package/base/hooks/guard-outside.ts +8 -8
- package/base/hooks/guard-package.ts +6 -6
- package/base/hooks/guard-remote-hosts.ts +14 -9
- package/base/hooks/guard-scripting.ts +6 -6
- package/base/hooks/guard-writes.ts +20 -11
- package/base/hooks/post-tool.ts +4 -3
- package/base/hooks/prompt-submit.ts +4 -3
- package/base/hooks/session-start.ts +5 -3
- package/base/hooks/stop.ts +4 -3
- package/base/hooks/subagent-start.ts +2 -2
- package/base/make/vulcan.mk +1 -4
- package/base/skills/build-a-feature/SKILL.md +1 -1
- package/base/skills/docs-update/SKILL.md +11 -5
- package/base/skills/docs-update/evals/evals.json +1 -1
- package/base/skills/docs-writing/SKILL.md +1 -1
- package/base/skills/plan-a-change/references/spec-card.md +1 -1
- package/base/skills/ship/SKILL.md +1 -1
- package/base/skills/visualize-work/SKILL.md +29 -6
- package/base/skills/visualize-work/references/spec.md +16 -5
- package/package.json +5 -6
- package/src/agents/atlas-block.ts +43 -43
- package/src/agents/codex-hooks.ts +55 -52
- package/src/agents/common/types.ts +1 -1
- package/src/agents/detect.ts +19 -16
- package/src/agents/exclude.ts +97 -98
- package/src/agents/hooks-json.ts +41 -43
- package/src/agents/local.ts +46 -43
- package/src/agents/prompt.ts +45 -42
- package/src/agents/render.ts +203 -201
- package/src/agents/resolve.ts +133 -134
- package/src/agents/table.ts +12 -8
- package/src/cli.ts +3 -1
- package/src/commands/add.command.ts +2 -2
- package/src/commands/agents.command.ts +11 -17
- package/src/commands/clean.command.ts +6 -6
- package/src/commands/doctor.command.ts +6 -4
- package/src/commands/help.command.ts +11 -9
- package/src/commands/init.command.ts +14 -8
- package/src/commands/preset.command.ts +2 -2
- package/src/commands/profile.command.ts +43 -50
- package/src/commands/sync.command.ts +109 -111
- package/src/commands/upgrade.command.ts +85 -78
- package/src/commands/visualize.command.ts +20 -5
- package/src/commands/x.command.ts +55 -50
- package/src/common/format.ts +23 -21
- package/src/common/index.ts +2 -0
- package/src/common/json.ts +8 -5
- package/src/common/layout-folder.ts +96 -111
- package/src/common/paths.ts +14 -12
- package/src/common/record.ts +7 -0
- package/src/common/text.ts +7 -0
- package/src/config/common/constants.ts +13 -1
- package/src/config/common/types.ts +8 -1
- package/src/config/loader.ts +53 -48
- package/src/config/packages.ts +17 -11
- package/src/config/schema.ts +54 -7
- package/src/create/add-app.ts +604 -493
- package/src/create/add-lib.ts +249 -242
- package/src/create/bunfig.ts +26 -23
- package/src/create/checks.ts +36 -34
- package/src/create/common/constants.ts +1 -0
- package/src/create/common/failure.ts +10 -0
- package/src/create/common/index.ts +2 -0
- package/src/create/common/preset-path.ts +11 -0
- package/src/create/common/types.ts +7 -2
- package/src/create/diff.ts +21 -23
- package/src/create/dockerignore.ts +26 -24
- package/src/create/files.ts +7 -5
- package/src/create/init-monorepo.ts +78 -80
- package/src/create/lib-preset.ts +62 -61
- package/src/create/manifest-json.ts +10 -4
- package/src/create/names.ts +217 -210
- package/src/create/next.ts +27 -24
- package/src/create/plan.ts +15 -12
- package/src/create/preset-diff.ts +415 -240
- package/src/create/preset-menu.ts +40 -34
- package/src/create/preset.ts +207 -194
- package/src/create/process.ts +80 -71
- package/src/create/scratch.ts +49 -48
- package/src/create/workspace.ts +423 -398
- package/src/doctor/checks.ts +1069 -998
- package/src/doctor/makefile.ts +17 -13
- package/src/doctor/runner.ts +88 -116
- package/src/doctor/skills.ts +97 -95
- package/src/doctor/tags.ts +44 -41
- package/src/hooks/codex-patch.ts +27 -24
- package/src/hooks/command-view.ts +44 -39
- package/src/hooks/common/constants.ts +0 -3
- package/src/hooks/common/types.ts +15 -1
- package/src/hooks/decision.ts +38 -42
- package/src/hooks/guard-git.ts +52 -50
- package/src/hooks/guard-manifest.ts +58 -55
- package/src/hooks/guard-outside.ts +109 -88
- package/src/hooks/guard-package.ts +86 -77
- package/src/hooks/guard-scripting.ts +20 -15
- package/src/hooks/guard-writes.ts +169 -111
- package/src/hooks/owner-reply.ts +128 -128
- package/src/hooks/post-tool.ts +94 -93
- package/src/hooks/project-guards.ts +93 -55
- package/src/hooks/project-tmp.ts +27 -24
- package/src/hooks/remote-hosts.ts +157 -149
- package/src/hooks/session-digest.ts +99 -95
- package/src/hooks/shell.ts +519 -500
- package/src/hooks/subagent-card.ts +11 -7
- package/src/hooks/trusted-scripts.ts +158 -80
- package/src/init/common/types.ts +1 -1
- package/src/init/scaffold.ts +137 -134
- package/src/local/clean.ts +39 -37
- package/src/local/format.ts +21 -17
- package/src/local/scan.ts +146 -140
- package/src/manifest/render.ts +127 -112
- package/src/owner/card.ts +51 -46
- package/src/owner/profile.ts +100 -96
- package/src/owner/reply-switch.ts +9 -6
- package/src/owner/shape.ts +72 -70
- package/src/owner/survey.ts +175 -164
- package/src/owner/view.ts +62 -59
- package/src/owner/violations.ts +119 -123
- package/src/router.ts +4 -1
- package/src/rules/base.ts +15 -11
- package/src/rules/common/types.ts +1 -1
- package/src/rules/parser.ts +39 -32
- package/src/rules/slots.ts +8 -6
- package/src/signals/claims.ts +30 -28
- package/src/signals/classify.ts +36 -33
- package/src/signals/loop.ts +39 -37
- package/src/signals/state.ts +80 -85
- package/src/skills/frontmatter.ts +28 -28
- package/src/sync/agent-files.ts +217 -199
- package/src/sync/agent-removal.ts +62 -68
- package/src/sync/atlas-block.ts +45 -43
- package/src/sync/base-rules.ts +32 -30
- package/src/sync/claude-launch.ts +74 -37
- package/src/sync/common/constants.ts +4 -0
- package/src/sync/common/index.ts +1 -0
- package/src/sync/common/symlink.ts +9 -0
- package/src/sync/common/types.ts +2 -2
- package/src/sync/exclude.ts +77 -69
- package/src/sync/local-choice.ts +50 -47
- package/src/sync/planner.ts +64 -68
- package/src/sync/prune.ts +52 -48
- package/src/sync/settings.ts +167 -168
- package/src/ui/capability.ts +12 -7
- package/src/ui/keyboard.ts +35 -33
- package/src/ui/prompt.ts +81 -77
- package/src/visualize/assets.ts +379 -195
- package/src/visualize/charts.ts +188 -176
- package/src/visualize/compare-css.ts +31 -0
- package/src/visualize/compare-render.ts +196 -0
- package/src/visualize/compare-schema.ts +81 -0
- package/src/visualize/compare-validate.ts +126 -0
- package/src/visualize/constants.ts +29 -3
- package/src/visualize/diagrams.ts +189 -174
- package/src/visualize/gate.ts +136 -0
- package/src/visualize/grid-span.ts +34 -0
- package/src/visualize/icons.ts +9 -4
- package/src/visualize/index.ts +2 -0
- package/src/visualize/kinds-css.ts +54 -0
- package/src/visualize/kinds-render.ts +698 -0
- package/src/visualize/kinds-schema.ts +148 -0
- package/src/visualize/kinds-validate.ts +186 -0
- package/src/visualize/labels-vi.ts +109 -0
- package/src/visualize/labels.ts +53 -0
- package/src/visualize/layout.ts +112 -92
- package/src/visualize/page.ts +140 -114
- package/src/visualize/render.ts +158 -114
- package/src/visualize/schema.ts +21 -1
- package/src/visualize/sections.ts +401 -309
- package/src/visualize/sources.ts +270 -0
- package/src/visualize/theme.ts +474 -0
- package/src/visualize/validate.ts +15 -5
- package/src/wiki/anchors.ts +39 -37
- package/src/wiki/command.ts +4 -4
- package/src/wiki/source-links.ts +49 -49
package/src/create/process.ts
CHANGED
|
@@ -1,92 +1,101 @@
|
|
|
1
1
|
import { ExitCodes } from '../common/index.ts';
|
|
2
2
|
import { CreateConstants } from './common/index.ts';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
export class SubProcess {
|
|
5
|
+
/**
|
|
6
|
+
* Any command, under the same skip rule as `runBun`; a skipped one counts as done. A quiet command
|
|
7
|
+
* prints nothing while it runs: its output is kept and written only when it fails.
|
|
8
|
+
*/
|
|
9
|
+
private static async runCommand(opts: {
|
|
10
|
+
cwd: string;
|
|
11
|
+
command: string[];
|
|
12
|
+
label: string;
|
|
13
|
+
quiet?: boolean;
|
|
14
|
+
}): Promise<number> {
|
|
15
|
+
if (SubProcess.isInstallSkipped()) {
|
|
16
|
+
process.stderr.write(` skipped ${opts.label} (VULCAN_NO_INSTALL)\n`);
|
|
6
17
|
|
|
7
|
-
|
|
8
|
-
|
|
18
|
+
return ExitCodes.OK;
|
|
19
|
+
}
|
|
9
20
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
cwd: string;
|
|
16
|
-
command: string[];
|
|
17
|
-
label: string;
|
|
18
|
-
quiet?: boolean;
|
|
19
|
-
}): Promise<number> => {
|
|
20
|
-
if (isInstallSkipped()) {
|
|
21
|
-
process.stderr.write(` skipped ${opts.label} (VULCAN_NO_INSTALL)\n`);
|
|
21
|
+
if (opts.quiet !== true) {
|
|
22
|
+
const child = Bun.spawn(opts.command, {
|
|
23
|
+
cwd: opts.cwd,
|
|
24
|
+
stdio: ['inherit', 'inherit', 'inherit'],
|
|
25
|
+
});
|
|
22
26
|
|
|
23
|
-
|
|
24
|
-
|
|
27
|
+
return child.exited;
|
|
28
|
+
}
|
|
25
29
|
|
|
26
|
-
if (opts.quiet !== true) {
|
|
27
30
|
const child = Bun.spawn(opts.command, {
|
|
28
31
|
cwd: opts.cwd,
|
|
29
|
-
|
|
32
|
+
stdin: 'ignore',
|
|
33
|
+
stdout: 'pipe',
|
|
34
|
+
stderr: 'pipe',
|
|
30
35
|
});
|
|
36
|
+
const [stdout, stderr, code] = await Promise.all([
|
|
37
|
+
new Response(child.stdout).text(),
|
|
38
|
+
new Response(child.stderr).text(),
|
|
39
|
+
child.exited,
|
|
40
|
+
]);
|
|
31
41
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
const child = Bun.spawn(opts.command, {
|
|
36
|
-
cwd: opts.cwd,
|
|
37
|
-
stdin: 'ignore',
|
|
38
|
-
stdout: 'pipe',
|
|
39
|
-
stderr: 'pipe',
|
|
40
|
-
});
|
|
41
|
-
const [stdout, stderr, code] = await Promise.all([
|
|
42
|
-
new Response(child.stdout).text(),
|
|
43
|
-
new Response(child.stderr).text(),
|
|
44
|
-
child.exited,
|
|
45
|
-
]);
|
|
42
|
+
if (code !== ExitCodes.OK) {
|
|
43
|
+
process.stderr.write(`${stdout}${stderr}`);
|
|
44
|
+
}
|
|
46
45
|
|
|
47
|
-
|
|
48
|
-
process.stderr.write(`${stdout}${stderr}`);
|
|
46
|
+
return code;
|
|
49
47
|
}
|
|
50
48
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
cwd: string;
|
|
56
|
-
args: string[];
|
|
57
|
-
label: string;
|
|
58
|
-
quiet?: boolean;
|
|
59
|
-
}): Promise<number> =>
|
|
60
|
-
runCommand({
|
|
61
|
-
cwd: opts.cwd,
|
|
62
|
-
command: [bunExecutable(), ...opts.args],
|
|
63
|
-
label: opts.label,
|
|
64
|
-
quiet: opts.quiet,
|
|
65
|
-
});
|
|
49
|
+
/** `bun` commands init and add run; VULCAN_NO_INSTALL=1 (tests) prints them instead. */
|
|
50
|
+
static isInstallSkipped(): boolean {
|
|
51
|
+
return process.env[CreateConstants.NO_INSTALL_ENV] === '1';
|
|
52
|
+
}
|
|
66
53
|
|
|
67
|
-
/**
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
export const runGitInit = async (opts: { cwd: string }): Promise<number> => {
|
|
72
|
-
const git = process.env[CreateConstants.GIT_ENV] ?? 'git';
|
|
73
|
-
let code: number = ExitCodes.FAILURE;
|
|
54
|
+
/** The `bun` this process runs, unless a test replaced it. */
|
|
55
|
+
static bunExecutable(): string {
|
|
56
|
+
return process.env[CreateConstants.BUN_ENV] ?? process.execPath;
|
|
57
|
+
}
|
|
74
58
|
|
|
75
|
-
|
|
76
|
-
|
|
59
|
+
static async runBun(opts: {
|
|
60
|
+
cwd: string;
|
|
61
|
+
args: string[];
|
|
62
|
+
label: string;
|
|
63
|
+
quiet?: boolean;
|
|
64
|
+
}): Promise<number> {
|
|
65
|
+
return SubProcess.runCommand({
|
|
77
66
|
cwd: opts.cwd,
|
|
78
|
-
command: [
|
|
79
|
-
label:
|
|
67
|
+
command: [SubProcess.bunExecutable(), ...opts.args],
|
|
68
|
+
label: opts.label,
|
|
69
|
+
quiet: opts.quiet,
|
|
80
70
|
});
|
|
81
|
-
} catch {
|
|
82
|
-
// Bun.spawn throws when the executable is not there; the message below says what to do.
|
|
83
71
|
}
|
|
84
72
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
73
|
+
/**
|
|
74
|
+
* `git init` on the new project. A machine without git (or with one too old for `-b`) still gets a
|
|
75
|
+
* working project: the missing step is printed for the user to run, and the flow goes on.
|
|
76
|
+
*/
|
|
77
|
+
static async runGitInit(opts: { cwd: string }): Promise<number> {
|
|
78
|
+
const git = process.env[CreateConstants.GIT_ENV] ?? 'git';
|
|
79
|
+
let code: number = ExitCodes.FAILURE;
|
|
80
|
+
|
|
81
|
+
try {
|
|
82
|
+
const exitCode = await SubProcess.runCommand({
|
|
83
|
+
cwd: opts.cwd,
|
|
84
|
+
command: [git, 'init', '-q', '-b', 'develop'],
|
|
85
|
+
label: 'git init',
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
code = exitCode;
|
|
89
|
+
} catch {
|
|
90
|
+
// Bun.spawn throws when the executable is not there; the message below says what to do.
|
|
91
|
+
}
|
|
90
92
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
+
if (code !== ExitCodes.OK) {
|
|
94
|
+
process.stderr.write(
|
|
95
|
+
`vulcan init: git init did not run - install git, then run: git init -b develop (in ${opts.cwd})\n`,
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return ExitCodes.OK;
|
|
100
|
+
}
|
|
101
|
+
}
|
package/src/create/scratch.ts
CHANGED
|
@@ -2,34 +2,7 @@ import { mkdirSync, mkdtempSync, rmdirSync, rmSync, writeFileSync } from 'node:f
|
|
|
2
2
|
import { join } from 'node:path';
|
|
3
3
|
import { ProjectLayout } from '../common/index.ts';
|
|
4
4
|
import type { IPresetSpec } from './common/index.ts';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* An npm preset is read from node_modules, so it is installed into a scratch folder apart from the
|
|
9
|
-
* project's own files, under `.agents/local/tmp/` (nothing goes outside the project): every refusal that depends on what the package says happens before anything is written.
|
|
10
|
-
* One line says what is fetched; bun's own output would land between the questions, so it is kept
|
|
11
|
-
* and shown only when the install fails.
|
|
12
|
-
*/
|
|
13
|
-
export const installNpmPreset = async (opts: {
|
|
14
|
-
scratch: string;
|
|
15
|
-
spec: IPresetSpec;
|
|
16
|
-
}): Promise<number> => {
|
|
17
|
-
writeFileSync(
|
|
18
|
-
join(opts.scratch, 'package.json'),
|
|
19
|
-
`${JSON.stringify({ name: 'vulcan-preset-scratch', private: true })}\n`,
|
|
20
|
-
);
|
|
21
|
-
|
|
22
|
-
const preset = `${opts.spec.packageName}@${opts.spec.range}`;
|
|
23
|
-
|
|
24
|
-
process.stderr.write(`Fetching preset ${preset} ...\n`);
|
|
25
|
-
|
|
26
|
-
return runBun({
|
|
27
|
-
cwd: opts.scratch,
|
|
28
|
-
args: ['add', preset],
|
|
29
|
-
label: `bun add ${preset}`,
|
|
30
|
-
quiet: true,
|
|
31
|
-
});
|
|
32
|
-
};
|
|
5
|
+
import { SubProcess } from './process.ts';
|
|
33
6
|
|
|
34
7
|
/** Removes `directory` when nothing is in it; one that holds anything stays. */
|
|
35
8
|
const removeIfEmpty = (opts: { directory: string }): void => {
|
|
@@ -40,27 +13,55 @@ const removeIfEmpty = (opts: { directory: string }): void => {
|
|
|
40
13
|
}
|
|
41
14
|
};
|
|
42
15
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}): Promise<
|
|
51
|
-
|
|
52
|
-
|
|
16
|
+
export class PresetScratch {
|
|
17
|
+
/**
|
|
18
|
+
* An npm preset is read from node_modules, so it is installed into a scratch folder apart from the
|
|
19
|
+
* project's own files, under `.agents/local/tmp/` (nothing goes outside the project): every refusal that depends on what the package says happens before anything is written.
|
|
20
|
+
* One line says what is fetched; bun's own output would land between the questions, so it is kept
|
|
21
|
+
* and shown only when the install fails.
|
|
22
|
+
*/
|
|
23
|
+
static async installNpm(opts: { scratch: string; spec: IPresetSpec }): Promise<number> {
|
|
24
|
+
writeFileSync(
|
|
25
|
+
join(opts.scratch, 'package.json'),
|
|
26
|
+
`${JSON.stringify({ name: 'vulcan-preset-scratch', private: true })}\n`,
|
|
27
|
+
);
|
|
53
28
|
|
|
54
|
-
|
|
29
|
+
const preset = `${opts.spec.packageName}@${opts.spec.range}`;
|
|
55
30
|
|
|
56
|
-
|
|
31
|
+
process.stderr.write(`Fetching preset ${preset} ...\n`);
|
|
57
32
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
removeIfEmpty({ directory: join(opts.root, '.agents') });
|
|
33
|
+
return SubProcess.runBun({
|
|
34
|
+
cwd: opts.scratch,
|
|
35
|
+
args: ['add', preset],
|
|
36
|
+
label: `bun add ${preset}`,
|
|
37
|
+
quiet: true,
|
|
38
|
+
});
|
|
65
39
|
}
|
|
66
|
-
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* The scratch folder lives as long as the flow: the located preset's files are copied from it. It is
|
|
43
|
+
* made under `<root>/.agents/local/tmp/`, and the folders made for it go with it when they are empty.
|
|
44
|
+
*/
|
|
45
|
+
static async withScratch<TResult>(opts: {
|
|
46
|
+
root: string;
|
|
47
|
+
run: (scratch: string) => Promise<TResult>;
|
|
48
|
+
}): Promise<TResult> {
|
|
49
|
+
const local = join(opts.root, ProjectLayout.LOCAL_DIRECTORY);
|
|
50
|
+
const parent = join(local, 'tmp');
|
|
51
|
+
|
|
52
|
+
mkdirSync(parent, { recursive: true });
|
|
53
|
+
|
|
54
|
+
const scratch = mkdtempSync(join(parent, 'preset-'));
|
|
55
|
+
|
|
56
|
+
try {
|
|
57
|
+
const outcome = await opts.run(scratch);
|
|
58
|
+
|
|
59
|
+
return outcome;
|
|
60
|
+
} finally {
|
|
61
|
+
rmSync(scratch, { recursive: true, force: true });
|
|
62
|
+
removeIfEmpty({ directory: parent });
|
|
63
|
+
removeIfEmpty({ directory: local });
|
|
64
|
+
removeIfEmpty({ directory: join(opts.root, '.agents') });
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|