cognitive-modules 2.2.0__tar.gz → 2.2.2__tar.gz
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.
- {cognitive_modules-2.2.0 → cognitive_modules-2.2.2}/PKG-INFO +72 -55
- {cognitive_modules-2.2.0 → cognitive_modules-2.2.2}/README.md +71 -54
- {cognitive_modules-2.2.0 → cognitive_modules-2.2.2}/pyproject.toml +2 -2
- {cognitive_modules-2.2.0 → cognitive_modules-2.2.2}/src/cognitive/loader.py +8 -4
- {cognitive_modules-2.2.0 → cognitive_modules-2.2.2}/src/cognitive/providers/__init__.py +152 -1
- cognitive_modules-2.2.2/src/cognitive/runner.py +1192 -0
- {cognitive_modules-2.2.0 → cognitive_modules-2.2.2}/src/cognitive/validator.py +2 -4
- {cognitive_modules-2.2.0 → cognitive_modules-2.2.2}/src/cognitive_modules.egg-info/PKG-INFO +72 -55
- cognitive_modules-2.2.2/src/cognitive_modules.egg-info/entry_points.txt +2 -0
- {cognitive_modules-2.2.0 → cognitive_modules-2.2.2}/tests/test_runner.py +309 -7
- cognitive_modules-2.2.0/src/cognitive/runner.py +0 -654
- cognitive_modules-2.2.0/src/cognitive_modules.egg-info/entry_points.txt +0 -2
- {cognitive_modules-2.2.0 → cognitive_modules-2.2.2}/LICENSE +0 -0
- {cognitive_modules-2.2.0 → cognitive_modules-2.2.2}/setup.cfg +0 -0
- {cognitive_modules-2.2.0 → cognitive_modules-2.2.2}/src/cognitive/__init__.py +0 -0
- {cognitive_modules-2.2.0 → cognitive_modules-2.2.2}/src/cognitive/cli.py +0 -0
- {cognitive_modules-2.2.0 → cognitive_modules-2.2.2}/src/cognitive/mcp_server.py +0 -0
- {cognitive_modules-2.2.0 → cognitive_modules-2.2.2}/src/cognitive/migrate.py +0 -0
- {cognitive_modules-2.2.0 → cognitive_modules-2.2.2}/src/cognitive/registry.py +0 -0
- {cognitive_modules-2.2.0 → cognitive_modules-2.2.2}/src/cognitive/server.py +0 -0
- {cognitive_modules-2.2.0 → cognitive_modules-2.2.2}/src/cognitive/subagent.py +0 -0
- {cognitive_modules-2.2.0 → cognitive_modules-2.2.2}/src/cognitive/templates.py +0 -0
- {cognitive_modules-2.2.0 → cognitive_modules-2.2.2}/src/cognitive_modules.egg-info/SOURCES.txt +0 -0
- {cognitive_modules-2.2.0 → cognitive_modules-2.2.2}/src/cognitive_modules.egg-info/dependency_links.txt +0 -0
- {cognitive_modules-2.2.0 → cognitive_modules-2.2.2}/src/cognitive_modules.egg-info/requires.txt +0 -0
- {cognitive_modules-2.2.0 → cognitive_modules-2.2.2}/src/cognitive_modules.egg-info/top_level.txt +0 -0
- {cognitive_modules-2.2.0 → cognitive_modules-2.2.2}/tests/test_cli.py +0 -0
- {cognitive_modules-2.2.0 → cognitive_modules-2.2.2}/tests/test_loader.py +0 -0
- {cognitive_modules-2.2.0 → cognitive_modules-2.2.2}/tests/test_migrate.py +0 -0
- {cognitive_modules-2.2.0 → cognitive_modules-2.2.2}/tests/test_registry.py +0 -0
- {cognitive_modules-2.2.0 → cognitive_modules-2.2.2}/tests/test_subagent.py +0 -0
- {cognitive_modules-2.2.0 → cognitive_modules-2.2.2}/tests/test_validator.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cognitive-modules
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.2
|
|
4
4
|
Summary: Structured LLM task runner with schema validation, confidence scoring, and subagent orchestration
|
|
5
5
|
Author: ziel-io
|
|
6
6
|
License: MIT
|
|
@@ -59,7 +59,10 @@ Dynamic: license-file
|
|
|
59
59
|
# Cognitive Modules
|
|
60
60
|
|
|
61
61
|
[](https://github.com/ziel-io/cognitive-modules/actions/workflows/ci.yml)
|
|
62
|
-
[](https://www.npmjs.com/package/cognitive-modules-cli)
|
|
63
|
+
[](https://pypi.org/project/cognitive-modules/)
|
|
64
|
+
[](https://www.npmjs.com/package/cognitive-modules-cli)
|
|
65
|
+
[](https://nodejs.org/)
|
|
63
66
|
[](https://www.python.org/downloads/)
|
|
64
67
|
[](https://opensource.org/licenses/MIT)
|
|
65
68
|
|
|
@@ -88,7 +91,24 @@ Cognitive Modules is an AI task definition specification designed for generation
|
|
|
88
91
|
- **Subagent Orchestration** - `@call:module` supports inter-module calls
|
|
89
92
|
- **Parameter Passing** - `$ARGUMENTS` runtime substitution
|
|
90
93
|
- **Multi-LLM Support** - OpenAI / Anthropic / MiniMax / Ollama
|
|
91
|
-
- **Public Registry** - `
|
|
94
|
+
- **Public Registry** - `cog install registry:module-name`
|
|
95
|
+
|
|
96
|
+
## Version Selection
|
|
97
|
+
|
|
98
|
+
| Version | Spec | npm | PyPI | Status |
|
|
99
|
+
|---------|------|-----|------|--------|
|
|
100
|
+
| **v2.2** | v2.2 | `2.2.0` | `2.2.1` | ✅ Stable (recommended) |
|
|
101
|
+
| **v2.5** | v2.5 | `2.5.0-beta.x` | `2.5.0bx` | 🧪 Beta (streaming + multimodal) |
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
# Install stable v2.2
|
|
105
|
+
npm install cognitive-modules-cli@2.2.0
|
|
106
|
+
pip install cognitive-modules==2.2.1
|
|
107
|
+
|
|
108
|
+
# Install beta v2.5 (streaming + multimodal)
|
|
109
|
+
npm install cognitive-modules-cli@beta
|
|
110
|
+
pip install cognitive-modules==2.5.0b1
|
|
111
|
+
```
|
|
92
112
|
|
|
93
113
|
## Installation
|
|
94
114
|
|
|
@@ -96,30 +116,27 @@ Cognitive Modules is an AI task definition specification designed for generation
|
|
|
96
116
|
|
|
97
117
|
```bash
|
|
98
118
|
# Zero-install quick start (recommended)
|
|
99
|
-
npx
|
|
119
|
+
npx cognitive-modules-cli@2.2.0 run code-reviewer --args "your code"
|
|
100
120
|
|
|
101
121
|
# Global installation
|
|
102
|
-
npm install -g
|
|
103
|
-
|
|
104
|
-
# Or install with full package name
|
|
105
|
-
npm install -g cognitive-modules-cli
|
|
122
|
+
npm install -g cognitive-modules-cli@2.2.0
|
|
106
123
|
```
|
|
107
124
|
|
|
108
125
|
### Python (pip)
|
|
109
126
|
|
|
110
127
|
```bash
|
|
111
|
-
pip install cognitive-modules
|
|
128
|
+
pip install cognitive-modules==2.2.1
|
|
112
129
|
|
|
113
130
|
# With LLM support
|
|
114
|
-
pip install cognitive-modules[openai] # OpenAI
|
|
115
|
-
pip install cognitive-modules[anthropic] # Claude
|
|
116
|
-
pip install cognitive-modules[all] # All providers
|
|
131
|
+
pip install "cognitive-modules[openai]==2.2.1" # OpenAI
|
|
132
|
+
pip install "cognitive-modules[anthropic]==2.2.1" # Claude
|
|
133
|
+
pip install "cognitive-modules[all]==2.2.1" # All providers
|
|
117
134
|
```
|
|
118
135
|
|
|
119
136
|
| Platform | Package | Command | Features |
|
|
120
137
|
|----------|---------|---------|----------|
|
|
121
|
-
| **npm** | `
|
|
122
|
-
| pip | `cognitive-modules` | `
|
|
138
|
+
| **npm** | `cognitive-modules-cli` | `cog` | ✅ Recommended, zero-install, full features |
|
|
139
|
+
| pip | `cognitive-modules` | `cog` | ✅ Full features |
|
|
123
140
|
|
|
124
141
|
## Quick Start
|
|
125
142
|
|
|
@@ -129,7 +146,7 @@ export LLM_PROVIDER=openai
|
|
|
129
146
|
export OPENAI_API_KEY=sk-xxx
|
|
130
147
|
|
|
131
148
|
# Run code review (npm)
|
|
132
|
-
npx
|
|
149
|
+
npx cognitive-modules-cli run code-reviewer --args "def login(u,p): return db.query(f'SELECT * FROM users WHERE name={u}')" --pretty
|
|
133
150
|
|
|
134
151
|
# Or use globally installed cog command
|
|
135
152
|
cog run code-reviewer --args "..." --pretty
|
|
@@ -195,70 +212,70 @@ All modules now return the unified v2.2 envelope format:
|
|
|
195
212
|
| **Risk Aggregation** | `meta.risk = max(changes[*].risk)` |
|
|
196
213
|
| **Parameter Passing** | `$ARGUMENTS` runtime substitution |
|
|
197
214
|
| **Subagents** | `@call:module` for inter-module calls |
|
|
198
|
-
| **Validation Tools** | `
|
|
215
|
+
| **Validation Tools** | `cog validate` / `cog validate --v22` |
|
|
199
216
|
|
|
200
217
|
## Integration Methods
|
|
201
218
|
|
|
202
219
|
| Method | Command | Use Case |
|
|
203
220
|
|--------|---------|----------|
|
|
204
|
-
| CLI | `
|
|
205
|
-
| HTTP API | `
|
|
206
|
-
| MCP Server | `
|
|
221
|
+
| CLI | `cog run` | Command line |
|
|
222
|
+
| HTTP API | `cog serve` | n8n, Coze, Dify |
|
|
223
|
+
| MCP Server | `cog mcp` | Claude, Cursor |
|
|
207
224
|
|
|
208
225
|
## CLI Commands
|
|
209
226
|
|
|
210
227
|
```bash
|
|
211
228
|
# Module management
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
229
|
+
cog list # List installed modules
|
|
230
|
+
cog info <module> # View module details
|
|
231
|
+
cog validate <module> # Validate module structure
|
|
232
|
+
cog validate <module> --v22 # Validate v2.2 format
|
|
216
233
|
|
|
217
234
|
# Run modules
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
235
|
+
cog run <module> input.json -o output.json --pretty
|
|
236
|
+
cog run <module> --args "requirements" --pretty
|
|
237
|
+
cog run <module> --args "requirements" --subagent # Enable subagent
|
|
221
238
|
|
|
222
239
|
# Create modules
|
|
223
|
-
|
|
224
|
-
|
|
240
|
+
cog init <name> -d "description"
|
|
241
|
+
cog init <name> --format v22 # Create v2.2 format module
|
|
225
242
|
|
|
226
243
|
# Migrate modules
|
|
227
|
-
|
|
244
|
+
cog migrate <module> # Migrate v1/v2.1 module to v2.2
|
|
228
245
|
|
|
229
246
|
# Install from GitHub (recommended)
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
247
|
+
cog add ziel-io/cognitive-modules -m code-simplifier
|
|
248
|
+
cog add org/repo -m module-name --tag v1.0.0 # Install specific version
|
|
249
|
+
cog remove <module> # Remove module
|
|
233
250
|
|
|
234
251
|
# Version management
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
252
|
+
cog update <module> # Update to latest version
|
|
253
|
+
cog update <module> --tag v2.0.0 # Update to specific version
|
|
254
|
+
cog versions <url> # View available versions
|
|
238
255
|
|
|
239
256
|
# Other installation methods
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
257
|
+
cog install github:user/repo/path
|
|
258
|
+
cog install registry:module-name
|
|
259
|
+
cog uninstall <module>
|
|
243
260
|
|
|
244
261
|
# Registry
|
|
245
|
-
|
|
246
|
-
|
|
262
|
+
cog registry # View public modules
|
|
263
|
+
cog search <query> # Search modules
|
|
247
264
|
|
|
248
265
|
# Environment check
|
|
249
|
-
|
|
266
|
+
cog doctor
|
|
250
267
|
```
|
|
251
268
|
|
|
252
269
|
## Built-in Modules
|
|
253
270
|
|
|
254
271
|
| Module | Tier | Function | Example |
|
|
255
272
|
|--------|------|----------|---------|
|
|
256
|
-
| `code-reviewer` | decision | Code review | `
|
|
257
|
-
| `code-simplifier` | decision | Code simplification | `
|
|
258
|
-
| `task-prioritizer` | decision | Task priority sorting | `
|
|
259
|
-
| `api-designer` | decision | REST API design | `
|
|
260
|
-
| `ui-spec-generator` | exploration | UI spec generation | `
|
|
261
|
-
| `product-analyzer` | exploration | Product analysis (subagent) | `
|
|
273
|
+
| `code-reviewer` | decision | Code review | `cog run code-reviewer --args "your code"` |
|
|
274
|
+
| `code-simplifier` | decision | Code simplification | `cog run code-simplifier --args "complex code"` |
|
|
275
|
+
| `task-prioritizer` | decision | Task priority sorting | `cog run task-prioritizer --args "task1,task2"` |
|
|
276
|
+
| `api-designer` | decision | REST API design | `cog run api-designer --args "order system"` |
|
|
277
|
+
| `ui-spec-generator` | exploration | UI spec generation | `cog run ui-spec-generator --args "e-commerce homepage"` |
|
|
278
|
+
| `product-analyzer` | exploration | Product analysis (subagent) | `cog run product-analyzer --args "health product" -s` |
|
|
262
279
|
|
|
263
280
|
## Module Format
|
|
264
281
|
|
|
@@ -370,7 +387,7 @@ export MINIMAX_API_KEY=sk-xxx
|
|
|
370
387
|
export LLM_PROVIDER=ollama
|
|
371
388
|
|
|
372
389
|
# Check configuration
|
|
373
|
-
|
|
390
|
+
cog doctor
|
|
374
391
|
```
|
|
375
392
|
|
|
376
393
|
## Migrating to v2.2
|
|
@@ -379,13 +396,13 @@ Migrate from v1 or v2.1 modules to v2.2:
|
|
|
379
396
|
|
|
380
397
|
```bash
|
|
381
398
|
# Auto-migrate single module
|
|
382
|
-
|
|
399
|
+
cog migrate code-reviewer
|
|
383
400
|
|
|
384
401
|
# Migrate all modules
|
|
385
|
-
|
|
402
|
+
cog migrate --all
|
|
386
403
|
|
|
387
404
|
# Verify migration result
|
|
388
|
-
|
|
405
|
+
cog validate code-reviewer --v22
|
|
389
406
|
```
|
|
390
407
|
|
|
391
408
|
Manual migration steps:
|
|
@@ -408,8 +425,8 @@ pip install -e ".[dev]"
|
|
|
408
425
|
pytest tests/ -v
|
|
409
426
|
|
|
410
427
|
# Create new module (v2.2 format)
|
|
411
|
-
|
|
412
|
-
|
|
428
|
+
cog init my-module -d "module description" --format v22
|
|
429
|
+
cog validate my-module --v22
|
|
413
430
|
```
|
|
414
431
|
|
|
415
432
|
## Project Structure
|
|
@@ -443,8 +460,8 @@ cognitive-modules/
|
|
|
443
460
|
|
|
444
461
|
| Platform | Package | Command | Installation |
|
|
445
462
|
|----------|---------|---------|--------------|
|
|
446
|
-
| Python | `cognitive-modules` | `
|
|
447
|
-
| Node.js | `
|
|
463
|
+
| Python | `cognitive-modules` | `cog` | `pip install cognitive-modules` |
|
|
464
|
+
| Node.js | `cognitive-modules-cli` | `cog` | `npm install -g cognitive-modules-cli` |
|
|
448
465
|
|
|
449
466
|
Both versions share the same module format and v2.2 specification.
|
|
450
467
|
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
# Cognitive Modules
|
|
2
2
|
|
|
3
3
|
[](https://github.com/ziel-io/cognitive-modules/actions/workflows/ci.yml)
|
|
4
|
-
[](https://www.npmjs.com/package/cognitive-modules-cli)
|
|
5
|
+
[](https://pypi.org/project/cognitive-modules/)
|
|
6
|
+
[](https://www.npmjs.com/package/cognitive-modules-cli)
|
|
7
|
+
[](https://nodejs.org/)
|
|
5
8
|
[](https://www.python.org/downloads/)
|
|
6
9
|
[](https://opensource.org/licenses/MIT)
|
|
7
10
|
|
|
@@ -30,7 +33,24 @@ Cognitive Modules is an AI task definition specification designed for generation
|
|
|
30
33
|
- **Subagent Orchestration** - `@call:module` supports inter-module calls
|
|
31
34
|
- **Parameter Passing** - `$ARGUMENTS` runtime substitution
|
|
32
35
|
- **Multi-LLM Support** - OpenAI / Anthropic / MiniMax / Ollama
|
|
33
|
-
- **Public Registry** - `
|
|
36
|
+
- **Public Registry** - `cog install registry:module-name`
|
|
37
|
+
|
|
38
|
+
## Version Selection
|
|
39
|
+
|
|
40
|
+
| Version | Spec | npm | PyPI | Status |
|
|
41
|
+
|---------|------|-----|------|--------|
|
|
42
|
+
| **v2.2** | v2.2 | `2.2.0` | `2.2.1` | ✅ Stable (recommended) |
|
|
43
|
+
| **v2.5** | v2.5 | `2.5.0-beta.x` | `2.5.0bx` | 🧪 Beta (streaming + multimodal) |
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
# Install stable v2.2
|
|
47
|
+
npm install cognitive-modules-cli@2.2.0
|
|
48
|
+
pip install cognitive-modules==2.2.1
|
|
49
|
+
|
|
50
|
+
# Install beta v2.5 (streaming + multimodal)
|
|
51
|
+
npm install cognitive-modules-cli@beta
|
|
52
|
+
pip install cognitive-modules==2.5.0b1
|
|
53
|
+
```
|
|
34
54
|
|
|
35
55
|
## Installation
|
|
36
56
|
|
|
@@ -38,30 +58,27 @@ Cognitive Modules is an AI task definition specification designed for generation
|
|
|
38
58
|
|
|
39
59
|
```bash
|
|
40
60
|
# Zero-install quick start (recommended)
|
|
41
|
-
npx
|
|
61
|
+
npx cognitive-modules-cli@2.2.0 run code-reviewer --args "your code"
|
|
42
62
|
|
|
43
63
|
# Global installation
|
|
44
|
-
npm install -g
|
|
45
|
-
|
|
46
|
-
# Or install with full package name
|
|
47
|
-
npm install -g cognitive-modules-cli
|
|
64
|
+
npm install -g cognitive-modules-cli@2.2.0
|
|
48
65
|
```
|
|
49
66
|
|
|
50
67
|
### Python (pip)
|
|
51
68
|
|
|
52
69
|
```bash
|
|
53
|
-
pip install cognitive-modules
|
|
70
|
+
pip install cognitive-modules==2.2.1
|
|
54
71
|
|
|
55
72
|
# With LLM support
|
|
56
|
-
pip install cognitive-modules[openai] # OpenAI
|
|
57
|
-
pip install cognitive-modules[anthropic] # Claude
|
|
58
|
-
pip install cognitive-modules[all] # All providers
|
|
73
|
+
pip install "cognitive-modules[openai]==2.2.1" # OpenAI
|
|
74
|
+
pip install "cognitive-modules[anthropic]==2.2.1" # Claude
|
|
75
|
+
pip install "cognitive-modules[all]==2.2.1" # All providers
|
|
59
76
|
```
|
|
60
77
|
|
|
61
78
|
| Platform | Package | Command | Features |
|
|
62
79
|
|----------|---------|---------|----------|
|
|
63
|
-
| **npm** | `
|
|
64
|
-
| pip | `cognitive-modules` | `
|
|
80
|
+
| **npm** | `cognitive-modules-cli` | `cog` | ✅ Recommended, zero-install, full features |
|
|
81
|
+
| pip | `cognitive-modules` | `cog` | ✅ Full features |
|
|
65
82
|
|
|
66
83
|
## Quick Start
|
|
67
84
|
|
|
@@ -71,7 +88,7 @@ export LLM_PROVIDER=openai
|
|
|
71
88
|
export OPENAI_API_KEY=sk-xxx
|
|
72
89
|
|
|
73
90
|
# Run code review (npm)
|
|
74
|
-
npx
|
|
91
|
+
npx cognitive-modules-cli run code-reviewer --args "def login(u,p): return db.query(f'SELECT * FROM users WHERE name={u}')" --pretty
|
|
75
92
|
|
|
76
93
|
# Or use globally installed cog command
|
|
77
94
|
cog run code-reviewer --args "..." --pretty
|
|
@@ -137,70 +154,70 @@ All modules now return the unified v2.2 envelope format:
|
|
|
137
154
|
| **Risk Aggregation** | `meta.risk = max(changes[*].risk)` |
|
|
138
155
|
| **Parameter Passing** | `$ARGUMENTS` runtime substitution |
|
|
139
156
|
| **Subagents** | `@call:module` for inter-module calls |
|
|
140
|
-
| **Validation Tools** | `
|
|
157
|
+
| **Validation Tools** | `cog validate` / `cog validate --v22` |
|
|
141
158
|
|
|
142
159
|
## Integration Methods
|
|
143
160
|
|
|
144
161
|
| Method | Command | Use Case |
|
|
145
162
|
|--------|---------|----------|
|
|
146
|
-
| CLI | `
|
|
147
|
-
| HTTP API | `
|
|
148
|
-
| MCP Server | `
|
|
163
|
+
| CLI | `cog run` | Command line |
|
|
164
|
+
| HTTP API | `cog serve` | n8n, Coze, Dify |
|
|
165
|
+
| MCP Server | `cog mcp` | Claude, Cursor |
|
|
149
166
|
|
|
150
167
|
## CLI Commands
|
|
151
168
|
|
|
152
169
|
```bash
|
|
153
170
|
# Module management
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
171
|
+
cog list # List installed modules
|
|
172
|
+
cog info <module> # View module details
|
|
173
|
+
cog validate <module> # Validate module structure
|
|
174
|
+
cog validate <module> --v22 # Validate v2.2 format
|
|
158
175
|
|
|
159
176
|
# Run modules
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
177
|
+
cog run <module> input.json -o output.json --pretty
|
|
178
|
+
cog run <module> --args "requirements" --pretty
|
|
179
|
+
cog run <module> --args "requirements" --subagent # Enable subagent
|
|
163
180
|
|
|
164
181
|
# Create modules
|
|
165
|
-
|
|
166
|
-
|
|
182
|
+
cog init <name> -d "description"
|
|
183
|
+
cog init <name> --format v22 # Create v2.2 format module
|
|
167
184
|
|
|
168
185
|
# Migrate modules
|
|
169
|
-
|
|
186
|
+
cog migrate <module> # Migrate v1/v2.1 module to v2.2
|
|
170
187
|
|
|
171
188
|
# Install from GitHub (recommended)
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
189
|
+
cog add ziel-io/cognitive-modules -m code-simplifier
|
|
190
|
+
cog add org/repo -m module-name --tag v1.0.0 # Install specific version
|
|
191
|
+
cog remove <module> # Remove module
|
|
175
192
|
|
|
176
193
|
# Version management
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
194
|
+
cog update <module> # Update to latest version
|
|
195
|
+
cog update <module> --tag v2.0.0 # Update to specific version
|
|
196
|
+
cog versions <url> # View available versions
|
|
180
197
|
|
|
181
198
|
# Other installation methods
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
199
|
+
cog install github:user/repo/path
|
|
200
|
+
cog install registry:module-name
|
|
201
|
+
cog uninstall <module>
|
|
185
202
|
|
|
186
203
|
# Registry
|
|
187
|
-
|
|
188
|
-
|
|
204
|
+
cog registry # View public modules
|
|
205
|
+
cog search <query> # Search modules
|
|
189
206
|
|
|
190
207
|
# Environment check
|
|
191
|
-
|
|
208
|
+
cog doctor
|
|
192
209
|
```
|
|
193
210
|
|
|
194
211
|
## Built-in Modules
|
|
195
212
|
|
|
196
213
|
| Module | Tier | Function | Example |
|
|
197
214
|
|--------|------|----------|---------|
|
|
198
|
-
| `code-reviewer` | decision | Code review | `
|
|
199
|
-
| `code-simplifier` | decision | Code simplification | `
|
|
200
|
-
| `task-prioritizer` | decision | Task priority sorting | `
|
|
201
|
-
| `api-designer` | decision | REST API design | `
|
|
202
|
-
| `ui-spec-generator` | exploration | UI spec generation | `
|
|
203
|
-
| `product-analyzer` | exploration | Product analysis (subagent) | `
|
|
215
|
+
| `code-reviewer` | decision | Code review | `cog run code-reviewer --args "your code"` |
|
|
216
|
+
| `code-simplifier` | decision | Code simplification | `cog run code-simplifier --args "complex code"` |
|
|
217
|
+
| `task-prioritizer` | decision | Task priority sorting | `cog run task-prioritizer --args "task1,task2"` |
|
|
218
|
+
| `api-designer` | decision | REST API design | `cog run api-designer --args "order system"` |
|
|
219
|
+
| `ui-spec-generator` | exploration | UI spec generation | `cog run ui-spec-generator --args "e-commerce homepage"` |
|
|
220
|
+
| `product-analyzer` | exploration | Product analysis (subagent) | `cog run product-analyzer --args "health product" -s` |
|
|
204
221
|
|
|
205
222
|
## Module Format
|
|
206
223
|
|
|
@@ -312,7 +329,7 @@ export MINIMAX_API_KEY=sk-xxx
|
|
|
312
329
|
export LLM_PROVIDER=ollama
|
|
313
330
|
|
|
314
331
|
# Check configuration
|
|
315
|
-
|
|
332
|
+
cog doctor
|
|
316
333
|
```
|
|
317
334
|
|
|
318
335
|
## Migrating to v2.2
|
|
@@ -321,13 +338,13 @@ Migrate from v1 or v2.1 modules to v2.2:
|
|
|
321
338
|
|
|
322
339
|
```bash
|
|
323
340
|
# Auto-migrate single module
|
|
324
|
-
|
|
341
|
+
cog migrate code-reviewer
|
|
325
342
|
|
|
326
343
|
# Migrate all modules
|
|
327
|
-
|
|
344
|
+
cog migrate --all
|
|
328
345
|
|
|
329
346
|
# Verify migration result
|
|
330
|
-
|
|
347
|
+
cog validate code-reviewer --v22
|
|
331
348
|
```
|
|
332
349
|
|
|
333
350
|
Manual migration steps:
|
|
@@ -350,8 +367,8 @@ pip install -e ".[dev]"
|
|
|
350
367
|
pytest tests/ -v
|
|
351
368
|
|
|
352
369
|
# Create new module (v2.2 format)
|
|
353
|
-
|
|
354
|
-
|
|
370
|
+
cog init my-module -d "module description" --format v22
|
|
371
|
+
cog validate my-module --v22
|
|
355
372
|
```
|
|
356
373
|
|
|
357
374
|
## Project Structure
|
|
@@ -385,8 +402,8 @@ cognitive-modules/
|
|
|
385
402
|
|
|
386
403
|
| Platform | Package | Command | Installation |
|
|
387
404
|
|----------|---------|---------|--------------|
|
|
388
|
-
| Python | `cognitive-modules` | `
|
|
389
|
-
| Node.js | `
|
|
405
|
+
| Python | `cognitive-modules` | `cog` | `pip install cognitive-modules` |
|
|
406
|
+
| Node.js | `cognitive-modules-cli` | `cog` | `npm install -g cognitive-modules-cli` |
|
|
390
407
|
|
|
391
408
|
Both versions share the same module format and v2.2 specification.
|
|
392
409
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "cognitive-modules"
|
|
7
|
-
version = "2.2.
|
|
7
|
+
version = "2.2.2"
|
|
8
8
|
description = "Structured LLM task runner with schema validation, confidence scoring, and subagent orchestration"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = {text = "MIT"}
|
|
@@ -76,7 +76,7 @@ docs = [
|
|
|
76
76
|
]
|
|
77
77
|
|
|
78
78
|
[project.scripts]
|
|
79
|
-
|
|
79
|
+
cog = "cognitive.cli:app"
|
|
80
80
|
|
|
81
81
|
[project.urls]
|
|
82
82
|
Homepage = "https://github.com/ziel-io/cognitive-modules"
|
|
@@ -184,16 +184,20 @@ def load_v2_format(module_path: Path) -> dict:
|
|
|
184
184
|
"require_suggested_mapping": overflow_raw.get("require_suggested_mapping", True)
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
-
enums
|
|
187
|
+
# Merge enums with defaults (ensure defaults are applied even if partial config exists)
|
|
188
|
+
enums_defaults = {
|
|
188
189
|
"strategy": "extensible" if tier in ("decision", "exploration") else "strict",
|
|
189
190
|
"unknown_tag": "custom"
|
|
190
|
-
}
|
|
191
|
+
}
|
|
192
|
+
enums = {**enums_defaults, **manifest.get("enums", {})}
|
|
191
193
|
|
|
192
|
-
compat
|
|
194
|
+
# Merge compat with defaults (ensure defaults are applied even if partial config exists)
|
|
195
|
+
compat_defaults = {
|
|
193
196
|
"accepts_v21_payload": True,
|
|
194
197
|
"runtime_auto_wrap": True,
|
|
195
198
|
"schema_output_alias": "data"
|
|
196
|
-
}
|
|
199
|
+
}
|
|
200
|
+
compat = {**compat_defaults, **manifest.get("compat", {})}
|
|
197
201
|
|
|
198
202
|
io_config = manifest.get("io", {})
|
|
199
203
|
tests = manifest.get("tests", [])
|