@mrclrchtr/supi-prompt-suggestions 4.0.0 → 4.2.0
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/node_modules/@mrclrchtr/supi-core/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-core/src/settings/settings-action-menu.ts +1 -0
- package/node_modules/@mrclrchtr/supi-core/src/settings/settings-schema.ts +9 -0
- package/node_modules/@mrclrchtr/supi-core/src/settings.ts +1 -0
- package/package.json +2 -2
|
@@ -34,6 +34,7 @@ export function buildActionMenu(field: ScopedFieldValue, scope: SettingsScope):
|
|
|
34
34
|
if (choices.length > 0) {
|
|
35
35
|
for (const choice of choices) menu.push({ value: `set:${choice}`, label: choice });
|
|
36
36
|
} else if (field.field.kind === "number") menu.push({ value: "edit", label: "Edit value…" });
|
|
37
|
+
else if (field.field.kind === "string") menu.push({ value: "edit", label: "Edit value…" });
|
|
37
38
|
else if (field.field.kind === "stringList") menu.push({ value: "edit", label: "Edit values…" });
|
|
38
39
|
else if (field.field.kind === "modelPicker")
|
|
39
40
|
menu.push({ value: "edit", label: "Choose model…" });
|
|
@@ -86,6 +86,11 @@ export interface NumberField extends BaseField {
|
|
|
86
86
|
values?: string[];
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
+
/** One free-form string. */
|
|
90
|
+
export interface StringField extends BaseField {
|
|
91
|
+
kind: "string";
|
|
92
|
+
}
|
|
93
|
+
|
|
89
94
|
/** Comma-separated string list. */
|
|
90
95
|
export interface StringListField extends BaseField {
|
|
91
96
|
kind: "stringList";
|
|
@@ -164,6 +169,7 @@ export type SettingsField =
|
|
|
164
169
|
| BoolField
|
|
165
170
|
| EnumField
|
|
166
171
|
| NumberField
|
|
172
|
+
| StringField
|
|
167
173
|
| StringListField
|
|
168
174
|
| ModelPickerField
|
|
169
175
|
| CustomField;
|
|
@@ -248,6 +254,8 @@ export function formatValue(value: unknown, field: SettingsField): string {
|
|
|
248
254
|
return value ? "on" : "off";
|
|
249
255
|
case "number":
|
|
250
256
|
return String(value ?? "");
|
|
257
|
+
case "string":
|
|
258
|
+
return typeof value === "string" && value ? value : "none";
|
|
251
259
|
case "stringList": {
|
|
252
260
|
const arr = Array.isArray(value) ? value : [];
|
|
253
261
|
return arr.length > 0 ? arr.map(String).join(", ") : "none";
|
|
@@ -271,6 +279,7 @@ export function sourceBadge(displayValue: string, source: ValueSource): string {
|
|
|
271
279
|
|
|
272
280
|
/** Format the value used to prefill editors and compare concrete choices. */
|
|
273
281
|
export function formatEditValue(value: unknown, field: SettingsField): string {
|
|
282
|
+
if (field.kind === "string") return typeof value === "string" ? value : "";
|
|
274
283
|
if (field.kind === "stringList") {
|
|
275
284
|
const arr = Array.isArray(value) ? value : [];
|
|
276
285
|
return arr.map(String).join(", ");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mrclrchtr/supi-prompt-suggestions",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"description": "Advisory ghost-text prompt suggestions for the pi coding agent",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@earendil-works/pi-ai": "*",
|
|
50
50
|
"@earendil-works/pi-coding-agent": "*",
|
|
51
51
|
"@earendil-works/pi-tui": "*",
|
|
52
|
-
"@mrclrchtr/supi-core": "4.
|
|
52
|
+
"@mrclrchtr/supi-core": "4.2.0"
|
|
53
53
|
},
|
|
54
54
|
"bundledDependencies": [
|
|
55
55
|
"@mrclrchtr/supi-core"
|