@venizia/vulcan 0.4.9-0 → 0.4.9-2
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 +2 -2
- package/base/hooks/codex-guards.ts +15 -5
- package/base/hooks/guard-git.ts +8 -8
- package/base/hooks/guard-manifest.ts +4 -5
- package/base/hooks/guard-outside.ts +8 -8
- package/base/hooks/guard-package.ts +5 -6
- package/base/hooks/guard-remote-hosts.ts +6 -7
- package/base/hooks/guard-scripting.ts +5 -6
- package/base/hooks/guard-writes.ts +8 -9
- package/base/hooks/post-tool.ts +2 -2
- package/base/hooks/prompt-submit.ts +2 -2
- package/base/hooks/session-start.ts +3 -3
- package/base/hooks/stop.ts +2 -2
- package/base/hooks/subagent-start.ts +2 -2
- package/base/skills/docs-update/SKILL.md +4 -2
- package/base/skills/visualize-work/SKILL.md +9 -0
- package/package.json +3 -3
- package/src/agents/atlas-block.ts +43 -43
- package/src/agents/codex-hooks.ts +45 -43
- package/src/agents/detect.ts +19 -16
- package/src/agents/exclude.ts +96 -97
- package/src/agents/hooks-json.ts +38 -36
- package/src/agents/local.ts +46 -43
- package/src/agents/prompt.ts +45 -42
- package/src/agents/render.ts +201 -195
- package/src/agents/resolve.ts +133 -134
- package/src/agents/table.ts +12 -8
- 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 +4 -4
- package/src/commands/init.command.ts +12 -8
- package/src/commands/preset.command.ts +2 -2
- package/src/commands/profile.command.ts +42 -49
- package/src/commands/sync.command.ts +109 -111
- package/src/commands/upgrade.command.ts +80 -75
- package/src/commands/visualize.command.ts +7 -13
- package/src/commands/x.command.ts +55 -50
- package/src/common/format.ts +23 -21
- package/src/common/json.ts +8 -5
- package/src/common/layout-folder.ts +94 -91
- package/src/common/paths.ts +14 -12
- package/src/config/loader.ts +52 -49
- package/src/config/packages.ts +14 -11
- package/src/config/schema.ts +3 -3
- package/src/create/add-app.ts +519 -509
- package/src/create/add-lib.ts +237 -240
- package/src/create/bunfig.ts +26 -23
- package/src/create/checks.ts +36 -34
- 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 +75 -80
- package/src/create/lib-preset.ts +59 -63
- package/src/create/manifest-json.ts +10 -4
- package/src/create/names.ts +217 -210
- package/src/create/next.ts +26 -23
- package/src/create/plan.ts +15 -12
- package/src/create/preset-diff.ts +301 -303
- package/src/create/preset-menu.ts +38 -32
- package/src/create/preset.ts +202 -197
- package/src/create/process.ts +79 -72
- package/src/create/scratch.ts +48 -49
- package/src/create/workspace.ts +404 -396
- package/src/doctor/checks.ts +1027 -1014
- package/src/doctor/makefile.ts +17 -13
- package/src/doctor/runner.ts +88 -118
- package/src/doctor/skills.ts +97 -95
- package/src/doctor/tags.ts +42 -37
- package/src/hooks/codex-patch.ts +25 -22
- package/src/hooks/command-view.ts +44 -39
- package/src/hooks/decision.ts +37 -37
- package/src/hooks/guard-git.ts +51 -49
- package/src/hooks/guard-manifest.ts +58 -55
- package/src/hooks/guard-outside.ts +93 -91
- package/src/hooks/guard-package.ts +82 -79
- package/src/hooks/guard-scripting.ts +19 -14
- package/src/hooks/guard-writes.ts +154 -149
- package/src/hooks/owner-reply.ts +127 -127
- package/src/hooks/post-tool.ts +94 -93
- package/src/hooks/project-guards.ts +65 -62
- package/src/hooks/project-tmp.ts +27 -24
- package/src/hooks/remote-hosts.ts +153 -130
- package/src/hooks/session-digest.ts +98 -101
- package/src/hooks/shell.ts +509 -499
- package/src/hooks/subagent-card.ts +11 -7
- package/src/hooks/trusted-scripts.ts +106 -104
- package/src/init/scaffold.ts +135 -132
- package/src/local/clean.ts +38 -36
- package/src/local/format.ts +21 -17
- package/src/local/scan.ts +144 -138
- package/src/manifest/render.ts +110 -104
- package/src/owner/card.ts +51 -46
- package/src/owner/profile.ts +99 -93
- package/src/owner/reply-switch.ts +9 -6
- package/src/owner/shape.ts +71 -69
- package/src/owner/survey.ts +173 -171
- package/src/owner/view.ts +62 -59
- package/src/owner/violations.ts +119 -123
- package/src/rules/base.ts +15 -11
- 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 +38 -33
- package/src/signals/loop.ts +39 -37
- package/src/signals/state.ts +79 -81
- package/src/skills/frontmatter.ts +28 -28
- package/src/sync/agent-files.ts +217 -199
- package/src/sync/agent-removal.ts +56 -59
- package/src/sync/atlas-block.ts +45 -43
- package/src/sync/base-rules.ts +32 -30
- package/src/sync/claude-launch.ts +36 -34
- package/src/sync/exclude.ts +77 -69
- package/src/sync/local-choice.ts +50 -47
- package/src/sync/planner.ts +59 -61
- package/src/sync/prune.ts +52 -48
- package/src/sync/settings.ts +166 -167
- package/src/ui/capability.ts +12 -7
- package/src/ui/keyboard.ts +38 -38
- package/src/ui/prompt.ts +79 -77
- package/src/visualize/assets.ts +33 -24
- package/src/visualize/charts.ts +179 -176
- package/src/visualize/compare-css.ts +3 -2
- package/src/visualize/compare-render.ts +9 -7
- package/src/visualize/diagrams.ts +189 -174
- package/src/visualize/grid-span.ts +34 -0
- package/src/visualize/icons.ts +7 -5
- package/src/visualize/kinds-render.ts +50 -45
- package/src/visualize/kinds-validate.ts +12 -10
- package/src/visualize/labels.ts +21 -17
- package/src/visualize/layout.ts +112 -97
- package/src/visualize/page.ts +92 -104
- package/src/visualize/render.ts +143 -140
- package/src/visualize/sections.ts +395 -384
- package/src/visualize/sources.ts +2 -2
- package/src/visualize/theme.ts +12 -10
- package/src/visualize/validate.ts +13 -9
- package/src/wiki/anchors.ts +38 -36
- package/src/wiki/command.ts +4 -4
- package/src/wiki/source-links.ts +46 -44
package/src/visualize/sources.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import type { TChrome } from './constants.ts';
|
|
3
|
-
import {
|
|
3
|
+
import { FigureLayout } from './layout.ts';
|
|
4
4
|
import type { TVisualizeSpec } from './schema.ts';
|
|
5
5
|
|
|
6
6
|
/** One line of plain text: no markup is interpreted anywhere, it is all escaped. */
|
|
@@ -59,7 +59,7 @@ interface ISourceUse {
|
|
|
59
59
|
source: TSource;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
const escaped = (value: string): string => escapeText({ value });
|
|
62
|
+
const escaped = (value: string): string => FigureLayout.escapeText({ value });
|
|
63
63
|
|
|
64
64
|
const REPO = /^[A-Za-z0-9][A-Za-z0-9._-]*(\/[A-Za-z0-9][A-Za-z0-9._-]*)*$/;
|
|
65
65
|
const COMMIT = /^[0-9a-f]{40}$/;
|
package/src/visualize/theme.ts
CHANGED
|
@@ -107,12 +107,14 @@ const luminance = (hex: string): number => {
|
|
|
107
107
|
return 0.2126 * channel(r) + 0.7152 * channel(g) + 0.0722 * channel(b);
|
|
108
108
|
};
|
|
109
109
|
|
|
110
|
-
export
|
|
111
|
-
|
|
112
|
-
|
|
110
|
+
export class Theme {
|
|
111
|
+
static contrastOf(opts: { foreground: string; background: string }): number {
|
|
112
|
+
const a = luminance(opts.foreground);
|
|
113
|
+
const b = luminance(opts.background);
|
|
113
114
|
|
|
114
|
-
|
|
115
|
-
}
|
|
115
|
+
return (Math.max(a, b) + 0.05) / (Math.min(a, b) + 0.05);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
116
118
|
|
|
117
119
|
const hueOf = (hex: string): number => {
|
|
118
120
|
const { r, g, b } = parse(hex);
|
|
@@ -209,7 +211,7 @@ export class ProjectTheme {
|
|
|
209
211
|
['the page', lightGrounds.bg],
|
|
210
212
|
['a soft panel', lightGrounds.bgSoft],
|
|
211
213
|
] as const) {
|
|
212
|
-
const mark = contrastOf({ foreground: given.accent, background: ground });
|
|
214
|
+
const mark = Theme.contrastOf({ foreground: given.accent, background: ground });
|
|
213
215
|
|
|
214
216
|
if (mark < MARK_RATIO) {
|
|
215
217
|
problems.push(
|
|
@@ -223,7 +225,7 @@ export class ProjectTheme {
|
|
|
223
225
|
['a soft panel', lightGrounds.bgSoft],
|
|
224
226
|
['an accent tint', accentSoft],
|
|
225
227
|
] as const) {
|
|
226
|
-
const text = contrastOf({ foreground: accentText, background: ground });
|
|
228
|
+
const text = Theme.contrastOf({ foreground: accentText, background: ground });
|
|
227
229
|
|
|
228
230
|
if (text < TEXT_RATIO) {
|
|
229
231
|
const which = given.accentText === undefined ? 'accent' : 'accentText';
|
|
@@ -250,7 +252,7 @@ export class ProjectTheme {
|
|
|
250
252
|
const darkNeeds = [darkGrounds.bg, darkGrounds.bgSoft, ...slabs];
|
|
251
253
|
const darkPasses = (color: string): boolean =>
|
|
252
254
|
darkNeeds.every(
|
|
253
|
-
(ground) => contrastOf({ foreground: color, background: ground }) >= TEXT_RATIO,
|
|
255
|
+
(ground) => Theme.contrastOf({ foreground: color, background: ground }) >= TEXT_RATIO,
|
|
254
256
|
);
|
|
255
257
|
let dark = given.accentDark;
|
|
256
258
|
|
|
@@ -275,7 +277,7 @@ export class ProjectTheme {
|
|
|
275
277
|
}
|
|
276
278
|
} else {
|
|
277
279
|
for (const ground of darkNeeds) {
|
|
278
|
-
const value = contrastOf({ foreground: dark, background: ground });
|
|
280
|
+
const value = Theme.contrastOf({ foreground: dark, background: ground });
|
|
279
281
|
|
|
280
282
|
if (value < TEXT_RATIO) {
|
|
281
283
|
problems.push(
|
|
@@ -360,7 +362,7 @@ export class ProjectTheme {
|
|
|
360
362
|
const candidates = ['#ffffff', '#0e0e0f'];
|
|
361
363
|
|
|
362
364
|
return candidates.find(
|
|
363
|
-
(ink) => contrastOf({ foreground: ink, background: opts.fill }) >= TEXT_RATIO,
|
|
365
|
+
(ink) => Theme.contrastOf({ foreground: ink, background: opts.fill }) >= TEXT_RATIO,
|
|
364
366
|
);
|
|
365
367
|
}
|
|
366
368
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CompareChecks } from './compare-validate.ts';
|
|
2
|
-
import {
|
|
2
|
+
import { KindsValidate } from './kinds-validate.ts';
|
|
3
3
|
import type { TVisualizeSpec } from './schema.ts';
|
|
4
4
|
import { SourceRefs } from './sources.ts';
|
|
5
5
|
|
|
@@ -216,11 +216,15 @@ const checkKinds = (opts: { spec: TVisualizeSpec }): string[] => {
|
|
|
216
216
|
return problems;
|
|
217
217
|
};
|
|
218
218
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
219
|
+
export class SpecValidation {
|
|
220
|
+
/** What a schema cannot say, for every kind on the page. */
|
|
221
|
+
static check(opts: { spec: TVisualizeSpec }): string[] {
|
|
222
|
+
return [
|
|
223
|
+
...(opts.spec.flow === undefined ? [] : checkFlow({ flow: opts.spec.flow })),
|
|
224
|
+
...checkKinds({ spec: opts.spec }),
|
|
225
|
+
...KindsValidate.checkNew({ spec: opts.spec }),
|
|
226
|
+
...CompareChecks.check({ spec: opts.spec }),
|
|
227
|
+
...SourceRefs.check({ spec: opts.spec }),
|
|
228
|
+
];
|
|
229
|
+
}
|
|
230
|
+
}
|
package/src/wiki/anchors.ts
CHANGED
|
@@ -76,43 +76,45 @@ const readAnchors = (opts: { dist: string }): Map<string, Set<string>> => {
|
|
|
76
76
|
return anchorsByRoute;
|
|
77
77
|
};
|
|
78
78
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
content: string;
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
for (const
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
79
|
+
export class AnchorCheck {
|
|
80
|
+
/** Checks every `](page#fragment)` link of the markdown under `content` against the ids built in `dist`. */
|
|
81
|
+
static check(opts: { content: string; dist: string }): {
|
|
82
|
+
checked: number;
|
|
83
|
+
broken: IBrokenAnchor[];
|
|
84
|
+
} {
|
|
85
|
+
const { content } = opts;
|
|
86
|
+
const anchorsByRoute = readAnchors({ dist: opts.dist });
|
|
87
|
+
const broken: IBrokenAnchor[] = [];
|
|
88
|
+
let checked = 0;
|
|
89
|
+
|
|
90
|
+
for (const file of walk({ directory: content, extension: '.md' })) {
|
|
91
|
+
// Fenced code carries example links that are not ours to resolve.
|
|
92
|
+
const body = readFileSync(file, 'utf8').replace(/```[\s\S]*?```/g, (match) =>
|
|
93
|
+
match.replace(/[^\n]/g, ' '),
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
for (const [index, text] of body.split('\n').entries()) {
|
|
97
|
+
for (const match of text.matchAll(/\]\(([^)\s]*?)#([\w.-]+)\)/g)) {
|
|
98
|
+
const [, page = '', anchor = ''] = match;
|
|
99
|
+
|
|
100
|
+
if (page.startsWith('http')) {
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
checked += 1;
|
|
105
|
+
|
|
106
|
+
const ids = anchorsByRoute.get(resolveRoute({ file, target: page, content }));
|
|
107
|
+
const target = `${page}#${anchor}`;
|
|
108
|
+
|
|
109
|
+
if (ids === undefined) {
|
|
110
|
+
broken.push({ file, line: index + 1, target, reason: AnchorProblems.MISSING_PAGE });
|
|
111
|
+
} else if (!ids.has(anchor)) {
|
|
112
|
+
broken.push({ file, line: index + 1, target, reason: AnchorProblems.DEAD_ANCHOR });
|
|
113
|
+
}
|
|
112
114
|
}
|
|
113
115
|
}
|
|
114
116
|
}
|
|
115
|
-
}
|
|
116
117
|
|
|
117
|
-
|
|
118
|
-
}
|
|
118
|
+
return { checked, broken };
|
|
119
|
+
}
|
|
120
|
+
}
|
package/src/wiki/command.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { existsSync } from 'node:fs';
|
|
2
2
|
import { ExitCodes } from '../common/index.ts';
|
|
3
|
-
import {
|
|
3
|
+
import { AnchorCheck } from './anchors.ts';
|
|
4
4
|
import { WikiDefaults, WikiFlags } from './constants.ts';
|
|
5
|
-
import {
|
|
5
|
+
import { SourceLinkCheck } from './source-links.ts';
|
|
6
6
|
|
|
7
7
|
/** The value after `--flag`, or the fallback; `undefined` when the flag has no value after it. */
|
|
8
8
|
const valueOf = (opts: { args: string[]; flag: string; fallback?: string }): string | undefined => {
|
|
@@ -56,7 +56,7 @@ export const runSourceLinksCommand = (opts: { args: string[]; root: string }): n
|
|
|
56
56
|
return ExitCodes.FAILURE;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
const { checked, missing } =
|
|
59
|
+
const { checked, missing } = SourceLinkCheck.check({
|
|
60
60
|
root: opts.root,
|
|
61
61
|
repo,
|
|
62
62
|
directories: listOf({ value: directories }),
|
|
@@ -98,7 +98,7 @@ export const runAnchorsCommand = (opts: { args: string[]; root: string }): numbe
|
|
|
98
98
|
return ExitCodes.FAILURE;
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
const { checked, broken } =
|
|
101
|
+
const { checked, broken } = AnchorCheck.check({ content, dist });
|
|
102
102
|
|
|
103
103
|
for (const entry of broken) {
|
|
104
104
|
console.log(`${entry.file}:${entry.line} ${entry.reason}: ${entry.target}`);
|
package/src/wiki/source-links.ts
CHANGED
|
@@ -126,59 +126,61 @@ const extractResource = (opts: { lines: string[] }): { line: number; path: strin
|
|
|
126
126
|
return undefined;
|
|
127
127
|
};
|
|
128
128
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
for (const
|
|
149
|
-
const
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
129
|
+
export class SourceLinkCheck {
|
|
130
|
+
/**
|
|
131
|
+
* Walks the `.md` files under `directories` (paths relative to `root`) and reports every source path
|
|
132
|
+
* that git does not track. `skipFiles` are generated pages that are never held to the gate.
|
|
133
|
+
*/
|
|
134
|
+
static check(opts: {
|
|
135
|
+
root: string;
|
|
136
|
+
repo: string;
|
|
137
|
+
directories: string[];
|
|
138
|
+
skipProseUnder: string[];
|
|
139
|
+
skipFiles: string[];
|
|
140
|
+
}): { checked: number; missing: IMissingSourceLink[] } {
|
|
141
|
+
const { root, repo, skipFiles, skipProseUnder } = opts;
|
|
142
|
+
const tracked = loadTracked({ root });
|
|
143
|
+
const exists = (path: string): boolean =>
|
|
144
|
+
tracked.files.has(path) || tracked.directories.has(path);
|
|
145
|
+
const missing: IMissingSourceLink[] = [];
|
|
146
|
+
let checked = 0;
|
|
147
|
+
|
|
148
|
+
for (const directory of opts.directories) {
|
|
149
|
+
for (const file of walkMarkdown({ directory: resolve(root, directory) })) {
|
|
150
|
+
const path = relative(root, file);
|
|
151
|
+
|
|
152
|
+
if (skipFiles.some((skip) => isUnder({ path, directory: skip }))) {
|
|
153
|
+
continue;
|
|
154
|
+
}
|
|
154
155
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
156
|
+
const skipProse = skipProseUnder.some((skip) => isUnder({ path, directory: skip }));
|
|
157
|
+
const lines = readFileSync(file, 'utf8').split('\n');
|
|
158
|
+
const resource = isUnder({ path, directory: WikiDefaults.KNOWLEDGE_DIRECTORY })
|
|
159
|
+
? extractResource({ lines })
|
|
160
|
+
: undefined;
|
|
160
161
|
|
|
161
|
-
|
|
162
|
-
|
|
162
|
+
if (resource !== undefined) {
|
|
163
|
+
checked += 1;
|
|
163
164
|
|
|
164
|
-
|
|
165
|
-
|
|
165
|
+
if (!exists(resource.path)) {
|
|
166
|
+
missing.push({ file: path, line: resource.line, path: resource.path });
|
|
167
|
+
}
|
|
166
168
|
}
|
|
167
|
-
}
|
|
168
169
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
170
|
+
for (const [index, text] of lines.entries()) {
|
|
171
|
+
for (const found of extractPaths({ text, repo, skipProse })) {
|
|
172
|
+
checked += 1;
|
|
172
173
|
|
|
173
|
-
|
|
174
|
-
|
|
174
|
+
if (!exists(found)) {
|
|
175
|
+
missing.push({ file: path, line: index + 1, path: found });
|
|
176
|
+
}
|
|
175
177
|
}
|
|
176
178
|
}
|
|
177
179
|
}
|
|
178
180
|
}
|
|
179
|
-
}
|
|
180
181
|
|
|
181
|
-
|
|
182
|
+
missing.sort((left, right) => left.file.localeCompare(right.file) || left.line - right.line);
|
|
182
183
|
|
|
183
|
-
|
|
184
|
-
}
|
|
184
|
+
return { checked, missing };
|
|
185
|
+
}
|
|
186
|
+
}
|