@zhiman_innies/innies-codex 0.122.23 → 0.122.25

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.
@@ -21,25 +21,7 @@
21
21
  "slug": "qwen35_35b",
22
22
  "display_name": "qwen35_35b",
23
23
  "description": "Zhiman private Qwen 35B model.",
24
- "default_reasoning_level": "medium",
25
- "supported_reasoning_levels": [
26
- {
27
- "effort": "low",
28
- "description": "Fast responses with lighter reasoning"
29
- },
30
- {
31
- "effort": "medium",
32
- "description": "Balances speed and reasoning depth for everyday tasks"
33
- },
34
- {
35
- "effort": "high",
36
- "description": "Greater reasoning depth for complex problems"
37
- },
38
- {
39
- "effort": "xhigh",
40
- "description": "Extra high reasoning depth for complex problems"
41
- }
42
- ],
24
+ "supported_reasoning_levels": [],
43
25
  "shell_type": "shell_command",
44
26
  "visibility": "list",
45
27
  "minimal_client_version": "0.98.0",
@@ -92,25 +74,7 @@
92
74
  "slug": "qwen3.6-plus",
93
75
  "display_name": "qwen3.6-plus",
94
76
  "description": "DashScope Qwen 3.6 Plus model.",
95
- "default_reasoning_level": "medium",
96
- "supported_reasoning_levels": [
97
- {
98
- "effort": "low",
99
- "description": "Fast responses with lighter reasoning"
100
- },
101
- {
102
- "effort": "medium",
103
- "description": "Balances speed and reasoning depth for everyday tasks"
104
- },
105
- {
106
- "effort": "high",
107
- "description": "Greater reasoning depth for complex problems"
108
- },
109
- {
110
- "effort": "xhigh",
111
- "description": "Extra high reasoning depth for complex problems"
112
- }
113
- ],
77
+ "supported_reasoning_levels": [],
114
78
  "shell_type": "shell_command",
115
79
  "visibility": "list",
116
80
  "minimal_client_version": "0.98.0",
@@ -8,6 +8,7 @@ const __dirname = path.dirname(__filename);
8
8
  const DEFAULT_MODEL = "qwen35_35b";
9
9
  const DEFAULT_PROVIDER = "zhiman_35b";
10
10
  const DASHSCOPE_MODEL = "qwen3.6-plus";
11
+ const QWEN_MODELS = new Set([DEFAULT_MODEL, DASHSCOPE_MODEL]);
11
12
  const LEGACY_MODELS = new Set(["qwen-plus", "qwen-plus-latest"]);
12
13
  const DEFAULT_HOME_DIR = ".inniescoder";
13
14
  const DEFAULT_CATALOG_FILENAME = "catalog.json";
@@ -33,7 +34,6 @@ const ROOT_MANAGED_SETTINGS = Object.freeze([
33
34
  ["model_catalog_json", null],
34
35
  ["model_reasoning_effort", null],
35
36
  ]);
36
- const ROOT_CATALOG_ONLY_SETTINGS = Object.freeze([["model_catalog_json", null]]);
37
37
  const LEGACY_MANAGED_GPT_MODEL = "gpt-5.5";
38
38
  const LEGACY_MANAGED_GPT_PROVIDER = "openai";
39
39
  const LEGACY_MANAGED_GPT_REASONING = "high";
@@ -135,14 +135,19 @@ function shouldReplaceLegacyCatalog(catalog) {
135
135
  return true;
136
136
  }
137
137
 
138
- const qwenModel = catalog.models.find((model) => model?.slug === DEFAULT_MODEL);
139
- if (
140
- qwenModel &&
141
- (qwenModel.apply_patch_tool_type !== "function" ||
138
+ for (const qwenModel of catalog.models.filter((model) =>
139
+ QWEN_MODELS.has(model?.slug),
140
+ )) {
141
+ if (
142
+ qwenModel.apply_patch_tool_type !== "function" ||
142
143
  qwenModel.supports_reasoning_summaries !== false ||
143
- qwenModel.support_verbosity !== false)
144
- ) {
145
- return true;
144
+ qwenModel.support_verbosity !== false ||
145
+ Object.prototype.hasOwnProperty.call(qwenModel, "default_reasoning_level") ||
146
+ !Array.isArray(qwenModel.supported_reasoning_levels) ||
147
+ qwenModel.supported_reasoning_levels.length !== 0
148
+ ) {
149
+ return true;
150
+ }
146
151
  }
147
152
 
148
153
  if (!slugs.includes(DEFAULT_MODEL)) {
@@ -154,7 +159,7 @@ function shouldReplaceLegacyCatalog(catalog) {
154
159
 
155
160
  function ensureInniesConfig(configPath, catalogPath, state) {
156
161
  if (!fs.existsSync(configPath)) {
157
- fs.writeFileSync(configPath, defaultInniesConfig(catalogPath, managedDefaultFromAuth(null)));
162
+ fs.writeFileSync(configPath, defaultInniesConfig(catalogPath, managedDefaultModel()));
158
163
  return defaultInniesState();
159
164
  }
160
165
 
@@ -183,15 +188,13 @@ function defaultInniesConfig(catalogPath, managedDefault) {
183
188
 
184
189
  function normalizeInniesConfig(contents, catalogPath, state) {
185
190
  if (contents.trim() === "") {
186
- return defaultInniesConfig(catalogPath, managedDefaultFromAuth(null));
191
+ return defaultInniesConfig(catalogPath, managedDefaultModel());
187
192
  }
188
193
 
189
194
  const isUserSelected =
190
195
  state.model_selection_state === MODEL_SELECTION_STATES.USER_SELECTED;
191
- const managedDefault = isUserSelected ? null : managedDefaultFromAuth(contents);
192
- const managedSettings = managedDefault
193
- ? ROOT_MANAGED_SETTINGS
194
- : ROOT_CATALOG_ONLY_SETTINGS;
196
+ const managedDefault = isUserSelected ? null : managedDefaultModel();
197
+ const managedSettings = ROOT_MANAGED_SETTINGS;
195
198
  const unmanagedContents = stripManagedRootSettings(contents, managedSettings).trim();
196
199
  const managedLines = isUserSelected
197
200
  ? preservedUserManagedLines(contents, catalogPath)
@@ -222,7 +225,6 @@ function managedDefaultLines(catalogPath, managedDefault) {
222
225
  `model_provider = ${JSON.stringify(managedDefault.provider)}`,
223
226
  `model = ${JSON.stringify(managedDefault.model)}`,
224
227
  `model_catalog_json = ${JSON.stringify(catalogPath)}`,
225
- 'model_reasoning_effort = "none"',
226
228
  ];
227
229
  }
228
230
 
@@ -233,13 +235,22 @@ function catalogOnlyManagedLines(catalogPath) {
233
235
  function preservedUserManagedLines(contents, catalogPath) {
234
236
  const preservedModelProvider = readRootSetting(contents, "model_provider");
235
237
  const preservedModel = readRootSetting(contents, "model");
236
- const preservedEffort = readRootSetting(contents, "model_reasoning_effort");
238
+ const preservedModelValue = extractRootSettingValue(contents, "model");
239
+ const preservedProviderValue = extractRootSettingValue(contents, "model_provider");
240
+ const preservesQwenModel =
241
+ (preservedModelValue === DEFAULT_MODEL &&
242
+ (preservedProviderValue == null || preservedProviderValue === DEFAULT_PROVIDER)) ||
243
+ (preservedModelValue === DASHSCOPE_MODEL &&
244
+ (preservedProviderValue == null || preservedProviderValue === "dashscope"));
245
+ const preservedEffort = preservesQwenModel
246
+ ? null
247
+ : readRootSetting(contents, "model_reasoning_effort");
237
248
 
238
249
  return [
239
250
  preservedModelProvider ?? 'model_provider = "openai"',
240
251
  preservedModel ?? 'model = "gpt-5.5"',
241
252
  `model_catalog_json = ${JSON.stringify(catalogPath)}`,
242
- preservedEffort ?? 'model_reasoning_effort = "high"',
253
+ ...(preservedEffort ? [preservedEffort] : []),
243
254
  ];
244
255
  }
245
256
 
@@ -318,77 +329,33 @@ function extractRootSettingValue(contents, key) {
318
329
  }
319
330
 
320
331
  function stripManagedRootSettings(contents, managedSettings = ROOT_MANAGED_SETTINGS) {
321
- let stripped = contents;
322
- for (const [key] of managedSettings) {
323
- const settingPattern = new RegExp(`^\\s*${key}\\s*=.*(?:\\r?\\n)?`, "gm");
324
- stripped = stripped.replace(settingPattern, "");
325
- }
326
-
327
- return stripped.replace(/\n{3,}/g, "\n\n");
328
- }
329
-
330
- function managedDefaultFromAuth(contents) {
331
- if (hasZhiman35bAuth(contents)) {
332
- return {
333
- provider: DEFAULT_PROVIDER,
334
- model: DEFAULT_MODEL,
335
- };
336
- }
337
- if (hasDashscopeAuth(contents ?? "")) {
338
- return {
339
- provider: "dashscope",
340
- model: DASHSCOPE_MODEL,
341
- };
342
- }
343
- return null;
344
- }
345
-
346
- function hasZhiman35bApiKey() {
347
- return (process.env.ZHIMAN_35B_API_KEY ?? "").trim() !== "";
348
- }
349
-
350
- function hasZhiman35bAuth(contents) {
351
- return hasZhiman35bApiKey() || zhiman35bProviderBlock(contents ?? "").some((line) =>
352
- /^\s*experimental_bearer_token\s*=\s*"[^"]+"\s*$/.test(line),
353
- );
354
- }
355
-
356
- function hasDashscopeApiKey() {
357
- return (process.env.DASHSCOPE_API_KEY ?? "").trim() !== "";
358
- }
359
-
360
- function hasDashscopeAuth(contents) {
361
- return hasDashscopeApiKey() || dashscopeProviderBlock(contents).some((line) =>
362
- /^\s*experimental_bearer_token\s*=\s*"[^"]+"\s*$/.test(line),
363
- );
364
- }
365
-
366
- function zhiman35bProviderBlock(contents) {
367
- return providerBlock(contents, ZHIMAN_35B_PROVIDER_HEADER);
368
- }
369
-
370
- function dashscopeProviderBlock(contents) {
371
- return providerBlock(contents, DASHSCOPE_PROVIDER_HEADER);
372
- }
373
-
374
- function providerBlock(contents, providerHeader) {
332
+ const managedKeys = new Set(managedSettings.map(([key]) => key));
375
333
  const lines = contents.split(/\r?\n/);
376
- const providerLines = [];
377
- let inProviderBlock = false;
334
+ const keptLines = [];
335
+ let inRootTable = true;
378
336
 
379
337
  for (const line of lines) {
380
338
  const trimmed = line.trim();
381
- const isSectionHeader = /^\[[^\]]+\]$/.test(trimmed);
382
- if (isSectionHeader) {
383
- inProviderBlock = trimmed === providerHeader;
384
- continue;
339
+ if (/^\[[^\]]+\]$/.test(trimmed)) {
340
+ inRootTable = false;
385
341
  }
386
- if (inProviderBlock) {
387
- providerLines.push(line);
342
+
343
+ const rootSetting = line.match(/^\s*([A-Za-z0-9_]+)\s*=/);
344
+ if (inRootTable && rootSetting && managedKeys.has(rootSetting[1])) {
345
+ continue;
388
346
  }
347
+
348
+ keptLines.push(line);
389
349
  }
390
350
 
391
- return providerLines;
351
+ return keptLines.join("\n").replace(/\n{3,}/g, "\n\n");
352
+ }
353
+
354
+ function managedDefaultModel() {
355
+ return {
356
+ provider: DEFAULT_PROVIDER,
357
+ model: DEFAULT_MODEL,
358
+ };
392
359
  }
393
360
 
394
361
  function normalizeManagedProviderBlocks(contents) {
package/bin/innies.js CHANGED
@@ -6,6 +6,18 @@ import { ensureInniesHomeDefaults, resolveInniesHome } from "./innies-config.js"
6
6
 
7
7
  const INNIES_HOME_ENV_VAR = "INNIES_HOME";
8
8
 
9
+ function isVersionRequest(args) {
10
+ return args.length === 1 && (args[0] === "--version" || args[0] === "-V");
11
+ }
12
+
13
+ if (isVersionRequest(process.argv.slice(2))) {
14
+ const packageJson = JSON.parse(
15
+ fs.readFileSync(new URL("../package.json", import.meta.url), "utf8"),
16
+ );
17
+ console.log(`innies-cli ${packageJson.version}`);
18
+ process.exit(0);
19
+ }
20
+
9
21
  const codexHome = resolveInniesHome();
10
22
  process.env[INNIES_HOME_ENV_VAR] = codexHome;
11
23
  process.env.CODEX_HOME = codexHome;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhiman_innies/innies-codex",
3
- "version": "0.122.23",
3
+ "version": "0.122.25",
4
4
  "license": "Apache-2.0",
5
5
  "bin": {
6
6
  "innies": "bin/innies.js"
@@ -23,7 +23,7 @@
23
23
  "postinstall": "node bin/innies-init.js"
24
24
  },
25
25
  "optionalDependencies": {
26
- "@zhiman_innies/innies-codex-darwin-x64": "0.122.23-darwin-x64",
27
- "@zhiman_innies/innies-codex-darwin-arm64": "0.122.23-darwin-arm64"
26
+ "@zhiman_innies/innies-codex-darwin-x64": "0.122.25-darwin-x64",
27
+ "@zhiman_innies/innies-codex-darwin-arm64": "0.122.25-darwin-arm64"
28
28
  }
29
29
  }