@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/lib-preset.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from 'node:fs';
|
|
2
|
-
import { dirname,
|
|
2
|
+
import { dirname, resolve } from 'node:path';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import {
|
|
4
|
+
import { LibraryKinds } from '../config/index.ts';
|
|
5
|
+
import type { TLibraryKind } from '../config/index.ts';
|
|
6
|
+
import { CreateConstants, PresetPath } from './common/index.ts';
|
|
5
7
|
import type { ILocatedPreset, IRecordedPreset } from './common/index.ts';
|
|
6
8
|
|
|
7
9
|
/** `package.json` fields a lib preset may pass through; anything else it generates itself or does not support. */
|
|
@@ -78,77 +80,76 @@ export type TLibPreset = Omit<z.infer<typeof LIB_SCHEMA>, 'files'> & {
|
|
|
78
80
|
files: string;
|
|
79
81
|
};
|
|
80
82
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
type TLibPresetResult = { ok: true; lib: TLibPreset } | { ok: false; error: string };
|
|
84
|
+
|
|
85
|
+
export class LibPreset {
|
|
86
|
+
/**
|
|
87
|
+
* The lib preset of a located preset package, validated; with `kind: 'shared'` it reads the shared kind,
|
|
88
|
+
* which has the same schema. The app side is never touched by an error here.
|
|
89
|
+
*/
|
|
90
|
+
static read(opts: { located: ILocatedPreset; kind?: TLibraryKind }): TLibPresetResult {
|
|
91
|
+
const { located } = opts;
|
|
92
|
+
const kind = opts.kind ?? LibraryKinds.LIB;
|
|
93
|
+
const shown = `${located.packageName}@${located.packageVersion}`;
|
|
94
|
+
const file = kind === LibraryKinds.SHARED ? located.sharedFile : located.libFile;
|
|
95
|
+
|
|
96
|
+
if (file === undefined) {
|
|
97
|
+
return { ok: false, error: `preset ${located.packageName} has no ${kind} kind` };
|
|
98
|
+
}
|
|
85
99
|
|
|
86
|
-
|
|
87
|
-
};
|
|
100
|
+
let raw: unknown;
|
|
88
101
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
102
|
+
try {
|
|
103
|
+
raw = JSON.parse(readFileSync(file, 'utf8'));
|
|
104
|
+
} catch {
|
|
105
|
+
return { ok: false, error: `${shown}: ${file} is missing or not JSON` };
|
|
106
|
+
}
|
|
94
107
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
108
|
+
if (
|
|
109
|
+
typeof raw !== 'object' ||
|
|
110
|
+
raw === null ||
|
|
111
|
+
!('presetVersion' in raw) ||
|
|
112
|
+
raw.presetVersion !== CreateConstants.PRESET_VERSION
|
|
113
|
+
) {
|
|
114
|
+
return {
|
|
115
|
+
ok: false,
|
|
116
|
+
error: `${shown}: the ${kind} preset has preset version ${String(typeof raw === 'object' && raw !== null && 'presetVersion' in raw ? raw.presetVersion : undefined)}; this VULCAN reads version ${CreateConstants.PRESET_VERSION} - upgrade @venizia/vulcan`,
|
|
117
|
+
};
|
|
118
|
+
}
|
|
98
119
|
|
|
99
|
-
|
|
120
|
+
const parsed = LIB_SCHEMA.safeParse(raw);
|
|
100
121
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
122
|
+
if (!parsed.success) {
|
|
123
|
+
const issues = parsed.error.issues
|
|
124
|
+
.map((issue) => `${issue.path.join('.')} ${issue.message}`)
|
|
125
|
+
.join('; ');
|
|
106
126
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
raw === null ||
|
|
110
|
-
!('presetVersion' in raw) ||
|
|
111
|
-
raw.presetVersion !== CreateConstants.PRESET_VERSION
|
|
112
|
-
) {
|
|
113
|
-
return {
|
|
114
|
-
ok: false,
|
|
115
|
-
error: `${shown}: the lib preset has preset version ${String(typeof raw === 'object' && raw !== null && 'presetVersion' in raw ? raw.presetVersion : undefined)}; this VULCAN reads version ${CreateConstants.PRESET_VERSION} - upgrade @venizia/vulcan`,
|
|
116
|
-
};
|
|
117
|
-
}
|
|
127
|
+
return { ok: false, error: `${shown}: ${kind} preset: ${issues}` };
|
|
128
|
+
}
|
|
118
129
|
|
|
119
|
-
|
|
130
|
+
const files = resolve(dirname(file), parsed.data.files);
|
|
120
131
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
132
|
+
if (PresetPath.escapes({ root: located.packageRoot, path: files }) || !existsSync(files)) {
|
|
133
|
+
return {
|
|
134
|
+
ok: false,
|
|
135
|
+
error: `${shown}: ${kind} preset: files ${parsed.data.files} is missing or points outside the package`,
|
|
136
|
+
};
|
|
137
|
+
}
|
|
125
138
|
|
|
126
|
-
return { ok:
|
|
139
|
+
return { ok: true, lib: { ...parsed.data, files } };
|
|
127
140
|
}
|
|
128
141
|
|
|
129
|
-
|
|
142
|
+
/** What the preset records of itself: its side and summary, and the lib summary when it makes libraries. */
|
|
143
|
+
static recordedOf(opts: { spec: string; located: ILocatedPreset }): IRecordedPreset {
|
|
144
|
+
const lib = LibPreset.read({ located: opts.located });
|
|
145
|
+
const shared = LibPreset.read({ located: opts.located, kind: LibraryKinds.SHARED });
|
|
130
146
|
|
|
131
|
-
if (escapes({ root: located.packageRoot, path: files }) || !existsSync(files)) {
|
|
132
147
|
return {
|
|
133
|
-
|
|
134
|
-
|
|
148
|
+
spec: opts.spec,
|
|
149
|
+
side: opts.located.preset.side,
|
|
150
|
+
summary: opts.located.preset.summary,
|
|
151
|
+
...(lib.ok ? { lib: lib.lib.summary } : {}),
|
|
152
|
+
...(shared.ok ? { shared: shared.lib.summary } : {}),
|
|
135
153
|
};
|
|
136
154
|
}
|
|
137
|
-
|
|
138
|
-
return { ok: true, lib: { ...parsed.data, files } };
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
/** What the preset records of itself: its side and summary, and the lib summary when it makes libraries. */
|
|
142
|
-
export const recordedPresetOf = (opts: {
|
|
143
|
-
spec: string;
|
|
144
|
-
located: ILocatedPreset;
|
|
145
|
-
}): IRecordedPreset => {
|
|
146
|
-
const lib = readLibPreset({ located: opts.located });
|
|
147
|
-
|
|
148
|
-
return {
|
|
149
|
-
spec: opts.spec,
|
|
150
|
-
side: opts.located.preset.side,
|
|
151
|
-
summary: opts.located.preset.summary,
|
|
152
|
-
...(lib.ok ? { lib: lib.lib.summary } : {}),
|
|
153
|
-
};
|
|
154
|
-
};
|
|
155
|
+
}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BunFormatter } from '../common/index.ts';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
export class ManifestJson {
|
|
4
|
+
/** A package.json as `bun fmt` wants it: Bun's own key order (name, version, ... scripts, dependencies A to Z). */
|
|
5
|
+
static render(opts: { value: unknown }): string {
|
|
6
|
+
return BunFormatter.format({
|
|
7
|
+
text: `${JSON.stringify(opts.value, null, 2)}\n`,
|
|
8
|
+
file: 'package.json',
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
}
|