@statezero/core 0.1.2 → 0.1.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/dist/cli/commands/syncModels.js +13 -18
- package/package.json +1 -1
|
@@ -97,32 +97,27 @@ import { loadConfigFromFile } from "../configFileLoader.js";
|
|
|
97
97
|
// Fallback Selection for Inquirer Errors
|
|
98
98
|
// --------------------
|
|
99
99
|
/**
|
|
100
|
-
* Simple fallback
|
|
100
|
+
* Simple fallback that generates all models when inquirer fails
|
|
101
101
|
* @param {Array} choices - Array of choice objects with {name, value, checked} properties
|
|
102
102
|
* @param {string} message - Selection message
|
|
103
|
-
* @returns {Promise<Array>} -
|
|
103
|
+
* @returns {Promise<Array>} - All model values
|
|
104
104
|
*/
|
|
105
|
-
async function
|
|
105
|
+
async function fallbackSelectAll(choices, message) {
|
|
106
106
|
console.log(`\n${message}`);
|
|
107
|
-
console.log("Interactive selection not available -
|
|
108
|
-
const
|
|
107
|
+
console.log("Interactive selection not available - generating ALL models:");
|
|
108
|
+
const allModels = [];
|
|
109
109
|
for (const choice of choices) {
|
|
110
110
|
// Skip separators (they don't have a 'value' property)
|
|
111
111
|
if (!choice.value) {
|
|
112
112
|
console.log(choice.name); // Print separator text
|
|
113
113
|
continue;
|
|
114
114
|
}
|
|
115
|
-
//
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
console.log(` ✓ ${choice.name}`);
|
|
119
|
-
}
|
|
120
|
-
else {
|
|
121
|
-
console.log(` ${choice.name}`);
|
|
122
|
-
}
|
|
115
|
+
// Add ALL models, regardless of checked status
|
|
116
|
+
allModels.push(choice.value);
|
|
117
|
+
console.log(` ✓ ${choice.name}`);
|
|
123
118
|
}
|
|
124
|
-
console.log(`\
|
|
125
|
-
return
|
|
119
|
+
console.log(`\nGenerating ALL ${allModels.length} models.`);
|
|
120
|
+
return allModels;
|
|
126
121
|
}
|
|
127
122
|
/**
|
|
128
123
|
* Model selection with inquirer fallback
|
|
@@ -146,9 +141,9 @@ async function selectModels(choices, message) {
|
|
|
146
141
|
return selectedModels;
|
|
147
142
|
}
|
|
148
143
|
catch (error) {
|
|
149
|
-
// Fall back to
|
|
150
|
-
console.warn("Interactive selection failed,
|
|
151
|
-
return await
|
|
144
|
+
// Fall back to generating all models if inquirer fails for any reason
|
|
145
|
+
console.warn("Interactive selection failed, generating all models:", error.message);
|
|
146
|
+
return await fallbackSelectAll(choices, message);
|
|
152
147
|
}
|
|
153
148
|
}
|
|
154
149
|
// --------------------
|
package/package.json
CHANGED