@juicesharp/rpiv-config 2.6.0 → 2.6.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/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [2.6.2] - 2026-08-18
2
+
3
+ ## [2.6.1] - 2026-08-17
4
+
5
+ ### Added
6
+
7
+ - `GuidanceFields` (interface, `GuidanceFieldsSchema`, `validateGuidanceFields`) now supports an optional `description` field — kept when it is a non-empty string, dropped otherwise. Consumers that read `validateGuidanceFields` output and ignore the field are unaffected; consumers that compose `GuidanceFieldsSchema` into a `Value.Check`-validated config now reject a *wrong-typed* `description` (previously tolerated as an unknown key), so such consumers should degrade per field rather than per file.
8
+
1
9
  ## [2.6.0] - 2026-08-15
2
10
 
3
11
  ## [2.5.2] - 2026-08-14
package/README.md CHANGED
@@ -39,9 +39,9 @@ Eleven exports, all stateless — no singletons, no caches, no import-time side
39
39
  | `loadJsonConfigWithLegacyFallback(name, file?)` | Reads the XDG path; only when that file is absent does it read the pre-XDG `~/.config/<name>/<file>`. Corruption is surfaced, never masked by the legacy file. |
40
40
  | `saveJsonConfig(path, data)` | `mkdir -p`, writes pretty JSON with a trailing newline, then chmods `0600` (best effort). Returns `true`/`false` instead of throwing — guard your "Saved" message on it. |
41
41
  | `validateConfig(schema, value)` | Strips unknown keys, layers schema defaults underneath, and returns `{}` on any failure. |
42
- | `validateGuidanceFields(fields)` | Keeps `promptSnippet` only if it is a non-empty string, and `promptGuidelines` only if it is a non-empty array of non-empty strings. Everything else is dropped. |
43
- | `GuidanceFieldsSchema` | TypeBox object for the two guidance fields, with `additionalProperties: true` so consumers can nest it in a larger config schema. |
44
- | `GuidanceFields` | Type for the same shape: `{ promptSnippet?: string; promptGuidelines?: string[] }`. |
42
+ | `validateGuidanceFields(fields)` | Keeps `promptSnippet` and `description` only if each is a non-empty string, and `promptGuidelines` only if it is a non-empty array of non-empty strings. Everything else is dropped. |
43
+ | `GuidanceFieldsSchema` | TypeBox object for the three guidance fields, with `additionalProperties: true` so consumers can nest it in a larger config schema. |
44
+ | `GuidanceFields` | Type for the same shape: `{ promptSnippet?: string; promptGuidelines?: string[]; description?: string }`. |
45
45
  | `parseModelKey(key)` | Splits `provider/modelId`, also accepting the legacy `provider:modelId`; slash wins when both are present. Returns `undefined` if there is no separator at index ≥ 1. |
46
46
  | `modelKey({ provider, id })` | Emits the canonical `provider/id`. Paired with `parseModelKey`, persisted colon-form keys migrate on the next save. |
47
47
  | `readEnvVar(key, fallback?)` | Returns the trimmed variable, or `fallback` when it is unset or empty after trimming. |
package/config.ts CHANGED
@@ -181,19 +181,22 @@ export function saveJsonConfig(path: string, data: unknown): boolean {
181
181
  export interface GuidanceFields {
182
182
  promptSnippet?: string;
183
183
  promptGuidelines?: string[];
184
+ description?: string;
184
185
  }
185
186
 
186
187
  // TypeBox form of GuidanceFields. Mirrors the interface 1:1 — same fields,
187
188
  // same optionality. `additionalProperties: true` lets consumers compose
188
189
  // wrappers that may carry sibling-specific keys without those leaking back
189
- // into rpiv-config. The runtime invariants (non-empty string, non-empty
190
- // array of non-empty strings) are still enforced by `validateGuidanceFields`;
191
- // the schema is a structural type-narrowing aid for callers that bake
192
- // guidance into a larger TypeBox-validated config object.
190
+ // into rpiv-config. The runtime invariants (string fields must be non-empty,
191
+ // the array field must be non-empty and contain only non-empty strings) are
192
+ // still enforced by `validateGuidanceFields`; the schema is a structural
193
+ // type-narrowing aid for callers that bake guidance into a larger
194
+ // TypeBox-validated config object.
193
195
  export const GuidanceFieldsSchema = Type.Object(
194
196
  {
195
197
  promptSnippet: Type.Optional(Type.String()),
196
198
  promptGuidelines: Type.Optional(Type.Array(Type.String())),
199
+ description: Type.Optional(Type.String()),
197
200
  },
198
201
  { additionalProperties: true },
199
202
  );
@@ -219,6 +222,9 @@ export function validateGuidanceFields(fields: unknown): GuidanceFields {
219
222
  ) {
220
223
  result.promptGuidelines = g.promptGuidelines;
221
224
  }
225
+ if (typeof g.description === "string" && g.description.length > 0) {
226
+ result.description = g.description;
227
+ }
222
228
  return result;
223
229
  }
224
230
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juicesharp/rpiv-config",
3
- "version": "2.6.0",
3
+ "version": "2.6.2",
4
4
  "description": "Shared config I/O utilities for rpiv-mono sibling packages",
5
5
  "keywords": [
6
6
  "rpiv",