@tyyyho/treg 1.0.1 → 1.0.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.
|
@@ -19,6 +19,7 @@ const AI_TOOL_CHOICES = [
|
|
|
19
19
|
{ value: "claude", label: "Claude" },
|
|
20
20
|
{ value: "codex", label: "Codex" },
|
|
21
21
|
{ value: "gemini", label: "Gemini" },
|
|
22
|
+
{ value: "skip", label: "skip (disable AI skill guidance)" },
|
|
22
23
|
];
|
|
23
24
|
const FEATURE_CHOICES = [
|
|
24
25
|
{ value: "lint", label: "lint" },
|
|
@@ -67,13 +68,25 @@ async function promptSingleChoice(message, choices, defaultValue) {
|
|
|
67
68
|
const result = await prompts.select(defaultChoice ? { ...options, initialValue: defaultChoice } : options);
|
|
68
69
|
return unwrapPromptResult(result, prompts).value;
|
|
69
70
|
}
|
|
70
|
-
|
|
71
|
+
function resolveAiToolSelection(selected) {
|
|
72
|
+
if (selected.includes("skip")) {
|
|
73
|
+
return {
|
|
74
|
+
skills: false,
|
|
75
|
+
aiTools: [],
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
skills: selected.length > 0,
|
|
80
|
+
aiTools: selected,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
async function promptMultiChoice(message, choices, defaultValues, required = false) {
|
|
71
84
|
const prompts = await getPrompts();
|
|
72
85
|
const result = await prompts.multiselect({
|
|
73
86
|
message,
|
|
74
87
|
options: mapChoiceOptions(choices),
|
|
75
88
|
initialValues: choices.filter(choice => defaultValues.includes(choice.value)),
|
|
76
|
-
required
|
|
89
|
+
required,
|
|
77
90
|
});
|
|
78
91
|
return unwrapPromptResult(result, prompts).map(choice => choice.value);
|
|
79
92
|
}
|
|
@@ -124,9 +137,12 @@ export async function collectInitPrompts(defaults) {
|
|
|
124
137
|
let aiTools = [];
|
|
125
138
|
let skills = featureSelection.skills;
|
|
126
139
|
if (skills) {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
140
|
+
const aiToolAnswers = await promptMultiChoice("5) AI tools (Space to select, A to toggle all)", AI_TOOL_CHOICES, [], true);
|
|
141
|
+
const aiToolSelection = resolveAiToolSelection(aiToolAnswers);
|
|
142
|
+
skills = aiToolSelection.skills;
|
|
143
|
+
aiTools = aiToolSelection.aiTools;
|
|
144
|
+
if (!skills) {
|
|
145
|
+
console.log("AI skill guidance disabled by selection: skip");
|
|
130
146
|
}
|
|
131
147
|
}
|
|
132
148
|
else {
|
|
@@ -143,4 +159,5 @@ export async function collectInitPrompts(defaults) {
|
|
|
143
159
|
}
|
|
144
160
|
export const __testables__ = {
|
|
145
161
|
toFeatureSelection,
|
|
162
|
+
resolveAiToolSelection,
|
|
146
163
|
};
|