@venizia/vulcan 0.3.8 → 0.3.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.
- package/README.md +2 -2
- package/base/skills/build-a-feature/SKILL.md +122 -0
- package/base/skills/build-a-feature/evals/evals.json +29 -0
- package/package.json +4 -3
- package/src/agents/atlas-block.ts +1 -0
- package/src/agents/exclude.ts +5 -0
- package/src/agents/prompt.ts +64 -2
- package/src/agents/render.ts +16 -2
- package/src/commands/sync.command.ts +2 -4
- package/src/config/schema.ts +2 -0
- package/src/create/add-app.ts +103 -14
- package/src/create/add-lib.ts +29 -6
- package/src/create/common/types.ts +15 -1
- package/src/create/init-monorepo.ts +35 -10
- package/src/create/names.ts +72 -7
- package/src/create/plan.ts +17 -0
- package/src/create/preset-menu.ts +45 -0
- package/src/create/workspace.ts +41 -1
- package/src/doctor/checks.ts +29 -13
- package/src/init/scaffold.ts +1 -41
- package/src/sync/agent-files.ts +59 -5
- package/src/sync/agent-removal.ts +55 -0
- package/src/sync/atlas-block.ts +4 -5
- package/src/ui/capability.ts +7 -0
- package/src/ui/index.ts +2 -0
- package/src/ui/prompt.ts +85 -0
- package/base/templates/mcp.json +0 -8
package/src/sync/atlas-block.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { existsSync, readFileSync, writeFileSync } from 'node:fs';
|
|
|
2
2
|
import { join } from 'node:path';
|
|
3
3
|
import { mergeAtlasBlock, renderAtlasBlock } from '../agents/index.ts';
|
|
4
4
|
import type { TResolvedConfig } from '../config/index.ts';
|
|
5
|
-
import { runsAtlas } from '../init/scaffold.ts';
|
|
6
5
|
import { projectNameOf } from '../manifest/index.ts';
|
|
7
6
|
import { SyncStatuses } from './common/index.ts';
|
|
8
7
|
import type { ISyncAction } from './common/index.ts';
|
|
@@ -10,17 +9,17 @@ import type { ISyncAction } from './common/index.ts';
|
|
|
10
9
|
const NO_CHANGE = (): void => {};
|
|
11
10
|
|
|
12
11
|
/**
|
|
13
|
-
* The block's text for this project, or undefined when AGENTS.md is absent
|
|
14
|
-
*
|
|
12
|
+
* The block's text for this project, or undefined when AGENTS.md is absent. Every project has the
|
|
13
|
+
* atlas server, and the block is what an agent that does not show the server's own text reads, so it
|
|
14
|
+
* does not wait for a per-machine MCP file to exist.
|
|
15
15
|
*/
|
|
16
16
|
export const mergedAtlasBlock = (opts: {
|
|
17
17
|
root: string;
|
|
18
18
|
config: TResolvedConfig;
|
|
19
19
|
}): { path: string; changed: boolean; text: string } | undefined => {
|
|
20
20
|
const path = join(opts.root, 'AGENTS.md');
|
|
21
|
-
const mcp = join(opts.root, '.mcp.json');
|
|
22
21
|
|
|
23
|
-
if (!existsSync(path)
|
|
22
|
+
if (!existsSync(path)) {
|
|
24
23
|
return undefined;
|
|
25
24
|
}
|
|
26
25
|
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether the menus can draw: both ends are a terminal and it understands cursor movement. Anything
|
|
3
|
+
* else (a pipe, a redirect, `TERM=dumb`) keeps the plain questions, so what scripts and logs see does
|
|
4
|
+
* not change.
|
|
5
|
+
*/
|
|
6
|
+
export const menusAvailable = (): boolean =>
|
|
7
|
+
process.stdin.isTTY === true && process.stdout.isTTY === true && process.env.TERM !== 'dumb';
|
package/src/ui/index.ts
ADDED
package/src/ui/prompt.ts
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { confirm, isCancel, multiselect, note, select, text } from '@clack/prompts';
|
|
2
|
+
|
|
3
|
+
/** One line of a menu: what it is called, and a short note beside it. */
|
|
4
|
+
export interface IChoice {
|
|
5
|
+
value: string;
|
|
6
|
+
label: string;
|
|
7
|
+
hint?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Free text, only where there is nothing to pick from (a new name). A default, when there is one, is
|
|
12
|
+
* shown and taken on Enter; `validate` returns the message to show, or nothing when the text is fine.
|
|
13
|
+
* Every prompt answers `null` when the user cancelled (Esc, Ctrl-C): the command stops, never picks
|
|
14
|
+
* for them.
|
|
15
|
+
*/
|
|
16
|
+
export const promptText = async (opts: {
|
|
17
|
+
message: string;
|
|
18
|
+
defaultValue?: string;
|
|
19
|
+
validate?: (value: string) => string | undefined;
|
|
20
|
+
}): Promise<string | null> => {
|
|
21
|
+
const value = await text({
|
|
22
|
+
message: opts.message,
|
|
23
|
+
...(opts.defaultValue === undefined
|
|
24
|
+
? {}
|
|
25
|
+
: { placeholder: opts.defaultValue, defaultValue: opts.defaultValue }),
|
|
26
|
+
validate: input => opts.validate?.(input ?? ''),
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
return isCancel(value) ? null : value;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/** Pick one: arrows to move, Enter to choose. */
|
|
33
|
+
export const promptSelect = async (opts: {
|
|
34
|
+
message: string;
|
|
35
|
+
choices: IChoice[];
|
|
36
|
+
initial?: string;
|
|
37
|
+
}): Promise<string | null> => {
|
|
38
|
+
const value = await select({
|
|
39
|
+
message: opts.message,
|
|
40
|
+
options: opts.choices.map(choice => ({
|
|
41
|
+
value: choice.value,
|
|
42
|
+
label: choice.label,
|
|
43
|
+
...(choice.hint === undefined ? {} : { hint: choice.hint }),
|
|
44
|
+
})),
|
|
45
|
+
initialValue: opts.initial,
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
return isCancel(value) ? null : value;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/** Tick any number: arrows to move, space to toggle, `a` for all, Enter to confirm; what is ticked at the start is `initial`. */
|
|
52
|
+
export const promptMultiselect = async (opts: {
|
|
53
|
+
message: string;
|
|
54
|
+
choices: IChoice[];
|
|
55
|
+
initial: string[];
|
|
56
|
+
}): Promise<string[] | null> => {
|
|
57
|
+
const value = await multiselect({
|
|
58
|
+
message: opts.message,
|
|
59
|
+
options: opts.choices.map(choice => ({
|
|
60
|
+
value: choice.value,
|
|
61
|
+
label: choice.label,
|
|
62
|
+
...(choice.hint === undefined ? {} : { hint: choice.hint }),
|
|
63
|
+
})),
|
|
64
|
+
initialValues: opts.initial,
|
|
65
|
+
required: false,
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
return isCancel(value) ? null : value;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export const promptConfirm = async (opts: {
|
|
72
|
+
message: string;
|
|
73
|
+
initial?: boolean;
|
|
74
|
+
}): Promise<boolean | null> => {
|
|
75
|
+
const value = await confirm({ message: opts.message, initialValue: opts.initial ?? true });
|
|
76
|
+
|
|
77
|
+
return isCancel(value) ? null : value;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
/** The summary of what is about to be written, then the confirm; true only when the user said yes. */
|
|
81
|
+
export const promptPlan = async (opts: { title: string; lines: string[] }): Promise<boolean> => {
|
|
82
|
+
note(opts.lines.join('\n'), opts.title);
|
|
83
|
+
|
|
84
|
+
return (await promptConfirm({ message: 'Write these files?' })) === true;
|
|
85
|
+
};
|