cognitive-modules-cli 2.2.9 → 2.2.10

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
@@ -2,6 +2,10 @@
2
2
 
3
3
  All notable changes to this package are documented in this file.
4
4
 
5
+ ## 2.2.10 - 2026-02-07
6
+
7
+ - Fix: Gemini `responseSchema` compatibility by converting JSON-Schema `const` to `enum`.
8
+
5
9
  ## 2.2.9 - 2026-02-07
6
10
 
7
11
  - Fix: `cog core run` now prints the error envelope (instead of `Error: undefined`) when execution fails.
package/README.md CHANGED
@@ -10,12 +10,12 @@ Node.js/TypeScript 版本的 Cognitive Modules CLI,提供 `cog` 命令。
10
10
 
11
11
  ```bash
12
12
  # 全局安装(推荐)
13
- npm install -g cogn@2.2.9
13
+ npm install -g cogn@2.2.10
14
14
  # 或使用完整包名(同样提供 `cog` 命令)
15
- # npm install -g cognitive-modules-cli@2.2.9
15
+ # npm install -g cognitive-modules-cli@2.2.10
16
16
 
17
17
  # 或使用 npx 零安装
18
- npx cogn@2.2.9 --help
18
+ npx cogn@2.2.10 --help
19
19
  ```
20
20
 
21
21
  ## 快速开始
@@ -95,7 +95,7 @@ cog doctor
95
95
  # 可通过环境变量或全局参数覆盖:
96
96
  COGNITIVE_REGISTRY_URL=... cog search
97
97
  COGNITIVE_REGISTRY_TIMEOUT_MS=15000 COGNITIVE_REGISTRY_MAX_BYTES=2097152 cog search
98
- cog search --registry https://github.com/Cognary/cognitive/releases/download/v2.2.9/cognitive-registry.v2.json
98
+ cog search --registry https://github.com/Cognary/cognitive/releases/download/v2.2.10/cognitive-registry.v2.json
99
99
  cog registry verify --remote --index https://github.com/Cognary/cognitive/releases/latest/download/cognitive-registry.v2.json
100
100
  cog registry verify --remote --concurrency 2
101
101
  ```
@@ -36,6 +36,12 @@ export class GeminiProvider extends BaseProvider {
36
36
  if (obj && typeof obj === 'object') {
37
37
  const result = {};
38
38
  for (const [key, value] of Object.entries(obj)) {
39
+ // Gemini's responseSchema does not accept JSON-Schema `const`.
40
+ // Convert `{ const: X }` into `{ enum: [X] }` for compatibility.
41
+ if (key === 'const') {
42
+ result.enum = [clean(value)];
43
+ continue;
44
+ }
39
45
  if (!unsupportedFields.includes(key)) {
40
46
  result[key] = clean(value);
41
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cognitive-modules-cli",
3
- "version": "2.2.9",
3
+ "version": "2.2.10",
4
4
  "description": "Cognitive Modules - Structured AI Task Execution with version management",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",