@zhiman_innies/innies-codex 0.122.20 → 0.122.21
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/bin/innies.js +23 -11
- package/package.json +3 -3
package/bin/innies.js
CHANGED
|
@@ -15,7 +15,11 @@ const DEFAULT_CATALOG_FILENAME = "catalog.json";
|
|
|
15
15
|
const DEFAULT_CONFIG_FILENAME = "config.toml";
|
|
16
16
|
const DEFAULT_STATE_FILENAME = "innies-state.json";
|
|
17
17
|
const DASHSCOPE_PROVIDER_HEADER = "[model_providers.dashscope]";
|
|
18
|
-
const
|
|
18
|
+
const RESERVED_PROVIDER_HEADERS = Object.freeze([
|
|
19
|
+
"[model_providers.openai]",
|
|
20
|
+
"[model_providers.ollama]",
|
|
21
|
+
"[model_providers.lmstudio]",
|
|
22
|
+
]);
|
|
19
23
|
const MODEL_SELECTION_STATES = Object.freeze({
|
|
20
24
|
MANAGED_DEFAULT: "managed_default",
|
|
21
25
|
USER_SELECTED: "user_selected",
|
|
@@ -189,12 +193,10 @@ function normalizeInniesConfig(contents, catalogPath, state) {
|
|
|
189
193
|
updated = `${updated}\n`;
|
|
190
194
|
}
|
|
191
195
|
|
|
196
|
+
updated = stripReservedProviderBlocks(updated);
|
|
192
197
|
if (!updated.includes(DASHSCOPE_PROVIDER_HEADER)) {
|
|
193
198
|
updated = `${updated.trimEnd()}\n\n${defaultDashscopeProviderBlock()}\n`;
|
|
194
199
|
}
|
|
195
|
-
if (!updated.includes(OPENAI_PROVIDER_HEADER)) {
|
|
196
|
-
updated = `${updated.trimEnd()}\n\n${defaultOpenaiProviderBlock()}\n`;
|
|
197
|
-
}
|
|
198
200
|
|
|
199
201
|
return updated;
|
|
200
202
|
}
|
|
@@ -225,13 +227,23 @@ function readRootSetting(contents, key) {
|
|
|
225
227
|
return contents.match(settingPattern)?.[0] ?? null;
|
|
226
228
|
}
|
|
227
229
|
|
|
228
|
-
function
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
230
|
+
function stripReservedProviderBlocks(contents) {
|
|
231
|
+
const lines = contents.split(/\r?\n/);
|
|
232
|
+
const keptLines = [];
|
|
233
|
+
let skippingReservedBlock = false;
|
|
234
|
+
|
|
235
|
+
for (const line of lines) {
|
|
236
|
+
const trimmed = line.trim();
|
|
237
|
+
const isSectionHeader = /^\[[^\]]+\]$/.test(trimmed);
|
|
238
|
+
if (isSectionHeader) {
|
|
239
|
+
skippingReservedBlock = RESERVED_PROVIDER_HEADERS.includes(trimmed);
|
|
240
|
+
}
|
|
241
|
+
if (!skippingReservedBlock) {
|
|
242
|
+
keptLines.push(line);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
return keptLines.join("\n").replace(/\n{3,}/g, "\n\n").trimEnd();
|
|
235
247
|
}
|
|
236
248
|
|
|
237
249
|
function determineModelSelectionState(contents, previousState) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhiman_innies/innies-codex",
|
|
3
|
-
"version": "0.122.
|
|
3
|
+
"version": "0.122.21",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"bin": {
|
|
6
6
|
"innies": "bin/innies.js"
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
},
|
|
21
21
|
"packageManager": "pnpm@10.29.3+sha512.498e1fb4cca5aa06c1dcf2611e6fafc50972ffe7189998c409e90de74566444298ffe43e6cd2acdc775ba1aa7cc5e092a8b7054c811ba8c5770f84693d33d2dc",
|
|
22
22
|
"optionalDependencies": {
|
|
23
|
-
"@zhiman_innies/innies-codex-darwin-x64": "0.122.
|
|
24
|
-
"@zhiman_innies/innies-codex-darwin-arm64": "0.122.
|
|
23
|
+
"@zhiman_innies/innies-codex-darwin-x64": "0.122.21-darwin-x64",
|
|
24
|
+
"@zhiman_innies/innies-codex-darwin-arm64": "0.122.21-darwin-arm64"
|
|
25
25
|
}
|
|
26
26
|
}
|