omp-config-crypt 0.9.2 → 0.9.3

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omp-config-crypt",
3
- "version": "0.9.2",
3
+ "version": "0.9.3",
4
4
  "description": "Universal cross-platform encrypted portability for omp config, extensions, and instructions",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -231,10 +231,20 @@ export function ensureLocalExtension(ompDir) {
231
231
  */
232
232
  export function parseYamlModels(str) {
233
233
  if (!str || typeof str !== "string") return {};
234
- const providers = parseBlockYamlModels(str);
235
- if (Object.keys(providers).length) return providers;
236
- // Flow-style (brace/bracket) YAML: delegate to the yaml package.
237
- return parseFlowYamlModels(str);
234
+ // Prefer the yaml package: handles flow-style (braces) and block-list values
235
+ // (e.g. `input:` followed by `- text` lines) the line parser cannot.
236
+ const parsed = normalizeProviderInputs(parseFlowYamlModels(str));
237
+ if (Object.keys(parsed).length) return parsed;
238
+ return normalizeProviderInputs(parseBlockYamlModels(str));
239
+ }
240
+
241
+ function normalizeProviderInputs(providers) {
242
+ for (const cfg of Object.values(providers || {})) {
243
+ for (const model of cfg?.models || []) {
244
+ if (typeof model.input === "string" && model.input) model.input = [model.input];
245
+ }
246
+ }
247
+ return providers;
238
248
  }
239
249
 
240
250
  function parseFlowYamlModels(str) {
@@ -608,6 +618,7 @@ function scanBlockSource(text) {
608
618
  if (section === "models" || section === "model" || section === "compat") {
609
619
  if (indent === 6 && trimmed.startsWith("- ") && field === "id") { section = "model"; continue; }
610
620
  if (indent === 8 && MODEL_FIELDS.has(field)) { section = field === "compat" ? "compat" : "model"; continue; }
621
+ if (section === "model" && indent === 10 && trimmed.startsWith("- ")) continue;
611
622
  if (indent === 10 && section === "compat" && /^[A-Za-z0-9_-]+:\s*\S/.test(trimmed)) continue;
612
623
  }
613
624
  unsupported(`${provider || "root"}.${field}`);