supipowers 0.2.6 → 0.2.7
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/package.json +1 -1
- package/src/commands/config.ts +53 -23
package/package.json
CHANGED
package/src/commands/config.ts
CHANGED
|
@@ -3,10 +3,29 @@ import { loadConfig, updateConfig } from "../config/loader.js";
|
|
|
3
3
|
import { listProfiles } from "../config/profiles.js";
|
|
4
4
|
import type { SupipowersConfig } from "../types.js";
|
|
5
5
|
|
|
6
|
+
const FRAMEWORK_OPTIONS = [
|
|
7
|
+
{ value: "", label: "not set — auto-detect on first /supi:qa run", command: null },
|
|
8
|
+
{ value: "vitest", label: "vitest — npx vitest run", command: "npx vitest run" },
|
|
9
|
+
{ value: "jest", label: "jest — npx jest", command: "npx jest" },
|
|
10
|
+
{ value: "mocha", label: "mocha — npx mocha", command: "npx mocha" },
|
|
11
|
+
{ value: "pytest", label: "pytest — pytest", command: "pytest" },
|
|
12
|
+
{ value: "cargo-test", label: "cargo-test — cargo test", command: "cargo test" },
|
|
13
|
+
{ value: "go-test", label: "go-test — go test ./...", command: "go test ./..." },
|
|
14
|
+
{ value: "npm-test", label: "npm-test — npm test", command: "npm test" },
|
|
15
|
+
];
|
|
16
|
+
|
|
17
|
+
const PIPELINE_OPTIONS = [
|
|
18
|
+
{ value: "", label: "not set — choose on first /supi:release run" },
|
|
19
|
+
{ value: "npm", label: "npm — npm publish to registry" },
|
|
20
|
+
{ value: "github", label: "github — GitHub Release with gh CLI" },
|
|
21
|
+
{ value: "manual", label: "manual — I'll handle publishing myself" },
|
|
22
|
+
];
|
|
23
|
+
|
|
6
24
|
interface SettingDef {
|
|
7
25
|
label: string;
|
|
8
26
|
key: string;
|
|
9
|
-
|
|
27
|
+
helpText: string;
|
|
28
|
+
type: "select" | "toggle";
|
|
10
29
|
options?: string[];
|
|
11
30
|
get: (config: SupipowersConfig) => string;
|
|
12
31
|
set: (cwd: string, value: unknown) => void;
|
|
@@ -17,6 +36,7 @@ function buildSettings(cwd: string): SettingDef[] {
|
|
|
17
36
|
{
|
|
18
37
|
label: "Default profile",
|
|
19
38
|
key: "defaultProfile",
|
|
39
|
+
helpText: "Review depth used when no flag is passed to /supi:review",
|
|
20
40
|
type: "select",
|
|
21
41
|
options: listProfiles(cwd),
|
|
22
42
|
get: (c) => c.defaultProfile,
|
|
@@ -25,6 +45,7 @@ function buildSettings(cwd: string): SettingDef[] {
|
|
|
25
45
|
{
|
|
26
46
|
label: "Max parallel agents",
|
|
27
47
|
key: "orchestration.maxParallelAgents",
|
|
48
|
+
helpText: "Sub-agents running concurrently in each /supi:run batch",
|
|
28
49
|
type: "select",
|
|
29
50
|
options: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"],
|
|
30
51
|
get: (c) => String(c.orchestration.maxParallelAgents),
|
|
@@ -33,6 +54,7 @@ function buildSettings(cwd: string): SettingDef[] {
|
|
|
33
54
|
{
|
|
34
55
|
label: "Max fix retries",
|
|
35
56
|
key: "orchestration.maxFixRetries",
|
|
57
|
+
helpText: "Times a failed task is retried before marking it blocked",
|
|
36
58
|
type: "select",
|
|
37
59
|
options: ["0", "1", "2", "3", "4", "5"],
|
|
38
60
|
get: (c) => String(c.orchestration.maxFixRetries),
|
|
@@ -41,6 +63,7 @@ function buildSettings(cwd: string): SettingDef[] {
|
|
|
41
63
|
{
|
|
42
64
|
label: "Max nesting depth",
|
|
43
65
|
key: "orchestration.maxNestingDepth",
|
|
66
|
+
helpText: "How deep sub-agents can spawn other sub-agents",
|
|
44
67
|
type: "select",
|
|
45
68
|
options: ["0", "1", "2", "3", "4", "5"],
|
|
46
69
|
get: (c) => String(c.orchestration.maxNestingDepth),
|
|
@@ -49,6 +72,7 @@ function buildSettings(cwd: string): SettingDef[] {
|
|
|
49
72
|
{
|
|
50
73
|
label: "Model preference",
|
|
51
74
|
key: "orchestration.modelPreference",
|
|
75
|
+
helpText: "Which model sub-agents use for code generation",
|
|
52
76
|
type: "select",
|
|
53
77
|
options: ["auto", "fast", "balanced", "quality"],
|
|
54
78
|
get: (c) => c.orchestration.modelPreference,
|
|
@@ -57,6 +81,7 @@ function buildSettings(cwd: string): SettingDef[] {
|
|
|
57
81
|
{
|
|
58
82
|
label: "LSP setup guide",
|
|
59
83
|
key: "lsp.setupGuide",
|
|
84
|
+
helpText: "Show LSP setup tips when no language server is active",
|
|
60
85
|
type: "toggle",
|
|
61
86
|
get: (c) => c.lsp.setupGuide ? "on" : "off",
|
|
62
87
|
set: (d, v) => updateConfig(d, { lsp: { setupGuide: v === "on" } }),
|
|
@@ -64,6 +89,7 @@ function buildSettings(cwd: string): SettingDef[] {
|
|
|
64
89
|
{
|
|
65
90
|
label: "Notification verbosity",
|
|
66
91
|
key: "notifications.verbosity",
|
|
92
|
+
helpText: "How much detail supipowers shows in notifications",
|
|
67
93
|
type: "select",
|
|
68
94
|
options: ["quiet", "normal", "verbose"],
|
|
69
95
|
get: (c) => c.notifications.verbosity,
|
|
@@ -72,23 +98,30 @@ function buildSettings(cwd: string): SettingDef[] {
|
|
|
72
98
|
{
|
|
73
99
|
label: "QA framework",
|
|
74
100
|
key: "qa.framework",
|
|
75
|
-
|
|
101
|
+
helpText: "Test runner used by /supi:qa",
|
|
102
|
+
type: "select",
|
|
103
|
+
options: FRAMEWORK_OPTIONS.map((f) => f.label),
|
|
76
104
|
get: (c) => c.qa.framework ?? "not set",
|
|
77
|
-
set: (d, v) =>
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
get: (c) => c.qa.command ?? "not set",
|
|
84
|
-
set: (d, v) => updateConfig(d, { qa: { command: v || null } }),
|
|
105
|
+
set: (d, v) => {
|
|
106
|
+
const chosen = FRAMEWORK_OPTIONS.find((f) => f.label === v);
|
|
107
|
+
if (chosen) {
|
|
108
|
+
updateConfig(d, { qa: { framework: chosen.value || null, command: chosen.command } });
|
|
109
|
+
}
|
|
110
|
+
},
|
|
85
111
|
},
|
|
86
112
|
{
|
|
87
113
|
label: "Release pipeline",
|
|
88
114
|
key: "release.pipeline",
|
|
89
|
-
|
|
115
|
+
helpText: "How /supi:release publishes your project",
|
|
116
|
+
type: "select",
|
|
117
|
+
options: PIPELINE_OPTIONS.map((p) => p.label),
|
|
90
118
|
get: (c) => c.release.pipeline ?? "not set",
|
|
91
|
-
set: (d, v) =>
|
|
119
|
+
set: (d, v) => {
|
|
120
|
+
const chosen = PIPELINE_OPTIONS.find((p) => p.label === v);
|
|
121
|
+
if (chosen) {
|
|
122
|
+
updateConfig(d, { release: { pipeline: chosen.value || null } });
|
|
123
|
+
}
|
|
124
|
+
},
|
|
92
125
|
},
|
|
93
126
|
];
|
|
94
127
|
}
|
|
@@ -123,29 +156,26 @@ export function handleConfig(ctx: ExtensionContext): void {
|
|
|
123
156
|
if (!setting) break;
|
|
124
157
|
|
|
125
158
|
if (setting.type === "select" && setting.options) {
|
|
159
|
+
const currentValue = setting.get(config);
|
|
160
|
+
const currentIndex = setting.options.findIndex((o) => o.startsWith(currentValue));
|
|
126
161
|
const value = await ctx.ui.select(
|
|
127
162
|
setting.label,
|
|
128
163
|
setting.options,
|
|
129
|
-
{
|
|
164
|
+
{
|
|
165
|
+
initialIndex: Math.max(0, currentIndex),
|
|
166
|
+
helpText: setting.helpText,
|
|
167
|
+
},
|
|
130
168
|
);
|
|
131
169
|
if (value !== undefined) {
|
|
132
170
|
setting.set(ctx.cwd, value);
|
|
133
|
-
|
|
171
|
+
const display = value.split(" — ")[0];
|
|
172
|
+
ctx.ui.notify(`${setting.label} → ${display}`, "info");
|
|
134
173
|
}
|
|
135
174
|
} else if (setting.type === "toggle") {
|
|
136
175
|
const current = setting.get(config);
|
|
137
176
|
const newValue = current === "on" ? "off" : "on";
|
|
138
177
|
setting.set(ctx.cwd, newValue);
|
|
139
178
|
ctx.ui.notify(`${setting.label} → ${newValue}`, "info");
|
|
140
|
-
} else if (setting.type === "text") {
|
|
141
|
-
const value = await ctx.ui.input(
|
|
142
|
-
setting.label,
|
|
143
|
-
setting.get(config) === "not set" ? undefined : setting.get(config),
|
|
144
|
-
);
|
|
145
|
-
if (value !== undefined) {
|
|
146
|
-
setting.set(ctx.cwd, value);
|
|
147
|
-
ctx.ui.notify(`${setting.label} → ${value || "cleared"}`, "info");
|
|
148
|
-
}
|
|
149
179
|
}
|
|
150
180
|
}
|
|
151
181
|
})();
|