cognitive-kit 1.0.0-alpha.2 → 1.0.0-alpha.4
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/README.md +297 -64
- package/cli.mjs +5 -0
- package/dist/host/adapters/FileSystemAdapter.d.ts +22 -0
- package/dist/host/adapters/FileSystemAdapter.js +203 -0
- package/dist/host/adapters/FileSystemAdapter.js.map +1 -0
- package/dist/host/adapters/PostgresAdapter.d.ts +30 -0
- package/dist/host/adapters/PostgresAdapter.js +252 -0
- package/dist/host/adapters/PostgresAdapter.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/docs/examples/custom-adapter.md +79 -0
- package/docs/examples/federation.md +60 -0
- package/docs/examples/library-embed.md +69 -0
- package/docs/examples/mcp-server.md +48 -0
- package/docs/examples/pg-explorer.md +48 -0
- package/docs/guides/antigravity-integration.md +348 -0
- package/docs/guides/claude-desktop-integration.md +71 -0
- package/docs/guides/cursor-integration.md +64 -0
- package/docs/guides/vscode-integration.md +80 -0
- package/mcp.json +50 -0
- package/package.json +13 -7
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
# Antigravity Integration Guide
|
|
2
|
+
|
|
3
|
+
Integrate `cognitive-kit` (31+ MCP tools) into the **Antigravity AI Agent** framework to extend its cognitive capabilities — reasoning, research, planning, security, knowledge, agency orchestration, and adaptive pipelines.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Architecture
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
┌──────────────────────────────────────────────┐
|
|
11
|
+
│ ANTIGRAVITY AI AGENT │
|
|
12
|
+
│ .gemini/GEMINI.md ← Agent Rules │
|
|
13
|
+
│ C4IRS+S Roles ← Reasoning Cycles │
|
|
14
|
+
│ AR-Tier Personas ← Domain Specialization │
|
|
15
|
+
│ │
|
|
16
|
+
│ ┌──────────────────────────────────────┐ │
|
|
17
|
+
│ │ MCP CLIENT (built-in) │ │
|
|
18
|
+
│ └──────────┬───────────────────────────┘ │
|
|
19
|
+
└─────────────┼────────────────────────────────┘
|
|
20
|
+
│ MCP stdio/SSE
|
|
21
|
+
▼
|
|
22
|
+
┌──────────────────────────────────────────────┐
|
|
23
|
+
│ COGNITIVE KIT (MCP Server) │
|
|
24
|
+
│ │
|
|
25
|
+
│ 31 tools: cognitive_reason, cognitive_plan, │
|
|
26
|
+
│ security_gate, ethics_audit, agency_execute, │
|
|
27
|
+
│ guardian_status, skill_forge, federation... │
|
|
28
|
+
│ │
|
|
29
|
+
│ Guardian Gate → Sovereignty + Firewall │
|
|
30
|
+
│ Agency Orch. → Adaptive pipelines │
|
|
31
|
+
│ Skill Forging → Pattern → Skills │
|
|
32
|
+
│ Federation → Multi-kit │
|
|
33
|
+
└──────────────────────────────────────────────┘
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Quick Start (VS Code)
|
|
39
|
+
|
|
40
|
+
### 1. Install the Kit
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
npm install -g cognitive-kit
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### 2. Configure MCP in VS Code
|
|
47
|
+
|
|
48
|
+
Create `.vscode/mcp.json` in your workspace:
|
|
49
|
+
|
|
50
|
+
```json
|
|
51
|
+
{
|
|
52
|
+
"servers": {
|
|
53
|
+
"cognitive-kit": {
|
|
54
|
+
"type": "stdio",
|
|
55
|
+
"command": "npx",
|
|
56
|
+
"args": ["cognitive-kit"],
|
|
57
|
+
"env": {
|
|
58
|
+
"KIT_HOST_ID": "antigravity-${workspaceFolderBasename}",
|
|
59
|
+
"KIT_HOST_NAME": "${workspaceFolderBasename}",
|
|
60
|
+
"KIT_SOVEREIGN_KEY": ""
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### 3. Restart VS Code
|
|
68
|
+
|
|
69
|
+
The kit's 31 tools appear in the MCP tool list. Antigravity can now invoke them via C4IRS cycles.
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Persona-to-Tool Mapping
|
|
74
|
+
|
|
75
|
+
Map C4IRS+S roles and AR-tier personas to cognitive-kit tools for precise capability delegation.
|
|
76
|
+
|
|
77
|
+
| C4IRS Role | AR Persona | cognitive-kit Tools |
|
|
78
|
+
|------------|------------|-------------------|
|
|
79
|
+
| **`[C]` Command** | AR-100 Architect | `cognitive_plan`, `cognitive_reason`, `consensus_engine` |
|
|
80
|
+
| **`[C]` Control** | AR-200 Engineer | `execution_flow`, `swarm_orchestrator`, `subagent_protocol` |
|
|
81
|
+
| **`[C]` Communications** | AR-300 Artisan | `cognitive_create`, `sentiment_adapter`, `context_synth` |
|
|
82
|
+
| **`[I]` Intelligence** | AR-400 Oracle | `cognitive_research`, `knowledge_evolve`, `memory_vam` |
|
|
83
|
+
| **`[R]` Reconnaissance** | AR-400 Oracle | `code_archaeologist`, `context_synth`, `threat_mapper` |
|
|
84
|
+
| **`[S]` Surveillance** | AR-500 Operator | `guardian_status`, `state_guardian`, `integrity_ledger` |
|
|
85
|
+
| **`[S]` Sovereignty** | AR-100 Architect | `guardian_freeze`, `guardian_unfreeze`, `integrity_ledger` |
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## C4IRS Workflow Integration
|
|
90
|
+
|
|
91
|
+
### `[C]` Command — Strategic Planning
|
|
92
|
+
|
|
93
|
+
Instead of manual reasoning, delegate to the agency pipeline:
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
Antigravity: "Plan the authentication microservice"
|
|
97
|
+
→ calls agency_execute(objective: "Design auth service", mode: "adaptive")
|
|
98
|
+
→ Kit selects phases: [delimit, research, architect, security, validate]
|
|
99
|
+
→ Kit assigns agents: [Strategist, Analyst, Architect, Guardian, Validator]
|
|
100
|
+
→ Returns: mission plan with 5 phases, synergy score, sovereignty seal
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### `[I]` Intelligence — Deep Research
|
|
104
|
+
|
|
105
|
+
Use multi-perspective research:
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
Antigravity: "Research vector database options"
|
|
109
|
+
→ calls cognitive_research(topic: "vector databases 2026", depth: "deep")
|
|
110
|
+
→ Returns: analysis from architect, guardian, executor, strategic perspectives
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### `[R]` Reconnaissance — Codebase Analysis
|
|
114
|
+
|
|
115
|
+
Analyze project structure:
|
|
116
|
+
|
|
117
|
+
```
|
|
118
|
+
Antigravity: "Analyze the src/ directory structure"
|
|
119
|
+
→ calls fs_list(path: "src")
|
|
120
|
+
→ calls code_archaeologist(code: "<file content>", mode: "full")
|
|
121
|
+
→ calls knowledge_evolve(knowledgeBase: "<analysis>", mode: "gap")
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### `[S]` Surveillance — System Health
|
|
125
|
+
|
|
126
|
+
Monitor the kit's operational state:
|
|
127
|
+
|
|
128
|
+
```
|
|
129
|
+
Antigravity: "Check system health"
|
|
130
|
+
→ calls guardian_status()
|
|
131
|
+
→ Returns: tool metrics, error rate, firewall stats, sovereignty chain
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## Prompt Injection (`.gemini/GEMINI.md`)
|
|
137
|
+
|
|
138
|
+
Add these rules to your `.gemini/GEMINI.md` to enable cognitive-kit awareness:
|
|
139
|
+
|
|
140
|
+
```markdown
|
|
141
|
+
## 🧠 Cognitive Kit Integration (MCP)
|
|
142
|
+
|
|
143
|
+
You have access to the Cognitive Kit MCP server with 31+ tools.
|
|
144
|
+
|
|
145
|
+
### Available Tool Categories
|
|
146
|
+
|
|
147
|
+
| Category | Tools | Use Case |
|
|
148
|
+
|----------|-------|----------|
|
|
149
|
+
| **Cognitive** | reason, research, plan, create, reflect | Core reasoning & analysis |
|
|
150
|
+
| **Security** | gate, ethics, ledger, threat, redteam, blast | Security audits & threat modeling |
|
|
151
|
+
| **Knowledge** | vam, evolve, synth | Memory & knowledge operations |
|
|
152
|
+
| **Analysis** | code, sentiment, consensus, flow | Code review & process analysis |
|
|
153
|
+
| **Agency** | swarm, meta, subagent, execute | Multi-agent orchestration |
|
|
154
|
+
| **Guardian** | status, freeze, unfreeze | System monitoring & control |
|
|
155
|
+
| **Federation** | status, connect, execute, disconnect | Multi-kit communication |
|
|
156
|
+
| **Forge** | skill_forge, skill_list_forged | Auto-generate skills |
|
|
157
|
+
|
|
158
|
+
### C4IRS Tool Delegation
|
|
159
|
+
|
|
160
|
+
- Use `agency_execute` for complex multi-step tasks (replaces manual iteration)
|
|
161
|
+
- Use `cognitive_reason` for logical analysis (replaces chain-of-thought)
|
|
162
|
+
- Use `consensus_engine` for architectural decisions (replaces manual deliberation)
|
|
163
|
+
- Use `threat_mapper` for risk assessment (replaces STRIDE manual analysis)
|
|
164
|
+
- Use `guardian_status` before ANY destructive operation
|
|
165
|
+
|
|
166
|
+
### Execution Protocol
|
|
167
|
+
|
|
168
|
+
1. Before any action, call `guardian_status` to verify system health
|
|
169
|
+
2. For complex tasks, call `agency_execute` with mode: "adaptive"
|
|
170
|
+
3. For analysis, delegate to the appropriate cognitive tool
|
|
171
|
+
4. After execution, call `integrity_ledger` to seal the operation
|
|
172
|
+
5. Call `guardian_status` to verify post-operation state
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## Antigravity Autorun Configuration
|
|
178
|
+
|
|
179
|
+
Update your `.antigravity-autorun.njk` to start the kit automatically:
|
|
180
|
+
|
|
181
|
+
```njk
|
|
182
|
+
# Antigravity Autorun Configuration
|
|
183
|
+
# Auto-enables CDP: true
|
|
184
|
+
# Run always: true
|
|
185
|
+
|
|
186
|
+
# Start Cognitive Kit MCP Server
|
|
187
|
+
npx cognitive-kit &
|
|
188
|
+
sleep 2
|
|
189
|
+
echo "Cognitive Kit ready — 31 tools available"
|
|
190
|
+
|
|
191
|
+
{% set languages = ["python", "go", "typescript"] %}
|
|
192
|
+
{% for lang in languages %}
|
|
193
|
+
- Enable {{ lang }} usage: true
|
|
194
|
+
{% endfor %}
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## Using cognitive-kit as a Library (Embedded Mode)
|
|
200
|
+
|
|
201
|
+
For deeper integration, embed cognitive-kit directly into Antigravity's runtime:
|
|
202
|
+
|
|
203
|
+
```javascript
|
|
204
|
+
// antigravity-cognitive.js
|
|
205
|
+
import { CognitiveKit, FileSystemAdapter } from 'cognitive-kit';
|
|
206
|
+
|
|
207
|
+
const kit = new CognitiveKit({
|
|
208
|
+
host: new FileSystemAdapter(process.cwd(), { allowWrite: true }),
|
|
209
|
+
storage: { type: 'sqlite', path: './.cognitive-kit.db' },
|
|
210
|
+
transport: { type: 'direct' }, // in-process, no MCP needed
|
|
211
|
+
sovereignty: {
|
|
212
|
+
hostId: 'antigravity-' + process.env.KIT_HOST_ID,
|
|
213
|
+
hostName: 'Antigravity Agent',
|
|
214
|
+
},
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
await kit.initialize();
|
|
218
|
+
|
|
219
|
+
export default {
|
|
220
|
+
// Expose tools to Antigravity's reasoning engine
|
|
221
|
+
reason: (problem) => kit['toolRegistry'].execute('cognitive_reason', { problem }),
|
|
222
|
+
research: (topic) => kit['toolRegistry'].execute('cognitive_research', { topic }),
|
|
223
|
+
plan: (objective) => kit.executeAgency(objective, { mode: 'adaptive' }),
|
|
224
|
+
gate: (payload) => kit.guardian.guardianGate.executeTool('security_gate', { payload }, ctx),
|
|
225
|
+
status: () => kit.guardian.stateGuardian.getMetrics(),
|
|
226
|
+
};
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
## Federation: Antigravity + Other Systems
|
|
232
|
+
|
|
233
|
+
Connect Antigravity to other kit instances (databases, CI/CD, etc.):
|
|
234
|
+
|
|
235
|
+
```
|
|
236
|
+
Antigravity (VS Code)
|
|
237
|
+
│ federation_connect("http://db-kit:4200")
|
|
238
|
+
│
|
|
239
|
+
├── pg_schema → Explore database structure
|
|
240
|
+
├── cognitive_reason → Analyze schema relationships
|
|
241
|
+
└── knowledge_evolve → Identify knowledge gaps
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
```json
|
|
245
|
+
{
|
|
246
|
+
"servers": {
|
|
247
|
+
"cognitive-kit": {
|
|
248
|
+
"type": "stdio",
|
|
249
|
+
"command": "npx",
|
|
250
|
+
"args": ["cognitive-kit"],
|
|
251
|
+
"env": {
|
|
252
|
+
"KIT_FEDERATION_PEERS": "http://localhost:4200"
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
---
|
|
260
|
+
|
|
261
|
+
## Tool Reference by Antigravity Workflow
|
|
262
|
+
|
|
263
|
+
### W-201 Deep Research
|
|
264
|
+
```
|
|
265
|
+
cognitive_research(topic, depth: "deep", perspectives: "architect,guardian,executor,strategic")
|
|
266
|
+
knowledge_evolve(knowledgeBase: "<findings>", mode: "gap")
|
|
267
|
+
context_synth(sources: "<findings>", mode: "summarize")
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
### W-202 Chain Actions
|
|
271
|
+
```
|
|
272
|
+
agency_execute(objective, mode: "sequential")
|
|
273
|
+
execution_flow(process, granularity: "fine")
|
|
274
|
+
subagent_protocol(task, mode: "supervised")
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
### W-203 Semantic Embeddings
|
|
278
|
+
```
|
|
279
|
+
memory_vam(action: "search", query, namespace: "knowledge")
|
|
280
|
+
knowledge_evolve(knowledgeBase: "<results>", mode: "connect")
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
### W-204 Context Orchestration
|
|
284
|
+
```
|
|
285
|
+
context_synth(sources: "<contexts>", mode: "merge")
|
|
286
|
+
memory_vam(action: "store", content: "<synthesized>", namespace: "context")
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
### W-205 Criteria Enforcement
|
|
290
|
+
```
|
|
291
|
+
ethics_audit(subject: "<decision>")
|
|
292
|
+
consensus_engine(proposal: "<decision>", model: "weighted")
|
|
293
|
+
integrity_ledger(action: "create", payload: "<decision>")
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
---
|
|
297
|
+
|
|
298
|
+
## Example: Antigravity + cognitive-kit Session
|
|
299
|
+
|
|
300
|
+
```
|
|
301
|
+
User: "Design and implement a secure file upload service"
|
|
302
|
+
|
|
303
|
+
Antigravity:
|
|
304
|
+
[C] Command → agency_execute(objective: "Design file upload service", mode: "adaptive")
|
|
305
|
+
← Returns: 6-phase plan [delimit, research, architect, security, validate, execute]
|
|
306
|
+
|
|
307
|
+
[I] Intelligence → cognitive_research(topic: "secure file upload patterns 2026", depth: "deep")
|
|
308
|
+
← Returns: multi-perspective analysis
|
|
309
|
+
|
|
310
|
+
[C] Control → execution_flow(process: "Implement upload endpoint", granularity: "fine")
|
|
311
|
+
← Returns: 8-step execution plan with dependencies
|
|
312
|
+
|
|
313
|
+
[S] Surveillance → security_gate(payload: "<implementation code>")
|
|
314
|
+
← Returns: PASSED (no violations)
|
|
315
|
+
|
|
316
|
+
[S] Sovereignty → integrity_ledger(action: "create", payload: "Upload service v1 deployed")
|
|
317
|
+
← Returns: signed ledger entry with seal
|
|
318
|
+
|
|
319
|
+
→ Emits: Sovereign Audit Trace with completion status
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
---
|
|
323
|
+
|
|
324
|
+
## Requirements
|
|
325
|
+
|
|
326
|
+
- Node.js ≥ 20
|
|
327
|
+
- VS Code (or any MCP-compatible editor)
|
|
328
|
+
- `npx cognitive-kit` (auto-installs on first run)
|
|
329
|
+
- `.vscode/mcp.json` configured (see Quick Start)
|
|
330
|
+
|
|
331
|
+
## Troubleshooting
|
|
332
|
+
|
|
333
|
+
| Symptom | Fix |
|
|
334
|
+
|---------|-----|
|
|
335
|
+
| "Tool not found" | Ensure cognitive-kit is running (`npx cognitive-kit`) |
|
|
336
|
+
| Connection refused | Restart VS Code after adding `mcp.json` |
|
|
337
|
+
| Firewall blocked | Check `guardian_status` for blocked operations |
|
|
338
|
+
| Federation timeout | Verify peer URL and port are correct |
|
|
339
|
+
|
|
340
|
+
---
|
|
341
|
+
|
|
342
|
+
## Related
|
|
343
|
+
|
|
344
|
+
- [VS Code Integration Guide](./vscode-integration.md)
|
|
345
|
+
- [Cursor Integration Guide](./cursor-integration.md)
|
|
346
|
+
- [Claude Desktop Integration Guide](./claude-desktop-integration.md)
|
|
347
|
+
- [Federation Multi-Kit Example](../examples/federation.md)
|
|
348
|
+
- [Cognitive Kit README](../../README.md)
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Claude Desktop Integration Guide
|
|
2
|
+
|
|
3
|
+
Connect Cognitive Kit to Claude Desktop as an MCP tool server.
|
|
4
|
+
|
|
5
|
+
## Setup
|
|
6
|
+
|
|
7
|
+
### 1. Install the Kit
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g cognitive-kit
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### 2. Configure Claude Desktop
|
|
14
|
+
|
|
15
|
+
Edit `claude_desktop_config.json` (located at `~/Library/Application Support/Claude/` on macOS, `%APPDATA%/Claude/` on Windows):
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"mcpServers": {
|
|
20
|
+
"cognitive-kit": {
|
|
21
|
+
"command": "npx",
|
|
22
|
+
"args": ["cognitive-kit"],
|
|
23
|
+
"env": {
|
|
24
|
+
"KIT_HOST_ID": "claude-desktop",
|
|
25
|
+
"KIT_HOST_NAME": "Claude Desktop",
|
|
26
|
+
"KIT_SOVEREIGN_KEY": ""
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### 3. Restart Claude Desktop
|
|
34
|
+
|
|
35
|
+
The kit's 31 tools become available to Claude.
|
|
36
|
+
|
|
37
|
+
## Using with Claude
|
|
38
|
+
|
|
39
|
+
Claude can now invoke cognitive tools directly in conversation:
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
User: "Analyze this business strategy using multiple frameworks"
|
|
43
|
+
Claude: [calls cognitive_research, ethics_audit, consensus_engine]
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Example Prompts
|
|
47
|
+
|
|
48
|
+
**Strategic Planning:**
|
|
49
|
+
```
|
|
50
|
+
Use agency_execute to plan the Q2 product roadmap
|
|
51
|
+
with mode: "sequential" and include all 8 phases
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
**Code Review:**
|
|
55
|
+
```
|
|
56
|
+
Run code_archaeologist on my project's main module
|
|
57
|
+
and then apply cognitive_reason to identify improvements
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**Security Assessment:**
|
|
61
|
+
```
|
|
62
|
+
Execute threat_mapper on our architecture,
|
|
63
|
+
then red_team for adversarial simulation,
|
|
64
|
+
then guardian_status to verify protections
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Notes
|
|
68
|
+
|
|
69
|
+
- Claude Desktop passes tool results back to the conversation
|
|
70
|
+
- The kit runs as a child process — Claude handles lifecycle
|
|
71
|
+
- Use `guardian_freeze` if you need to pause operations
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Cursor Integration Guide
|
|
2
|
+
|
|
3
|
+
Connect Cognitive Kit to Cursor AI editor via MCP.
|
|
4
|
+
|
|
5
|
+
## Setup
|
|
6
|
+
|
|
7
|
+
### 1. Configure MCP in Cursor
|
|
8
|
+
|
|
9
|
+
1. Open Cursor Settings
|
|
10
|
+
2. Navigate to **Features → MCP**
|
|
11
|
+
3. Click **+ Add New MCP Server**
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
Name: cognitive-kit
|
|
15
|
+
Type: command
|
|
16
|
+
Command: npx cognitive-kit
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
4. Add environment variables (optional):
|
|
20
|
+
|
|
21
|
+
| Variable | Value |
|
|
22
|
+
|----------|-------|
|
|
23
|
+
| `KIT_HOST_ID` | `cursor-my-project` |
|
|
24
|
+
| `KIT_HOST_NAME` | `My Project` |
|
|
25
|
+
| `KIT_SOVEREIGN_KEY` | *(optional)* |
|
|
26
|
+
|
|
27
|
+
### 2. Verify
|
|
28
|
+
|
|
29
|
+
Run any tool from Cursor's MCP panel:
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
cognitive_reason({ problem: "Why is this function failing?" })
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Available Commands
|
|
36
|
+
|
|
37
|
+
Via Cursor's AI chat:
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
Analyze this code using cognitive_reason:
|
|
41
|
+
[code block]
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
Plan the implementation using cognitive_plan:
|
|
46
|
+
[requirements]
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
Check for security issues using security_gate:
|
|
51
|
+
[code/config]
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
Research this topic using cognitive_research:
|
|
56
|
+
[topic]
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Tips
|
|
60
|
+
|
|
61
|
+
- Use `agency_execute` for complex multi-step tasks
|
|
62
|
+
- Use `guardian_status` to monitor system health
|
|
63
|
+
- Use `code_archaeologist` for codebase analysis
|
|
64
|
+
- Use `consensus_engine` for architectural decisions
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# VS Code Integration Guide
|
|
2
|
+
|
|
3
|
+
Connect Cognitive Kit to VS Code via MCP for inline reasoning, code analysis, planning, and security auditing.
|
|
4
|
+
|
|
5
|
+
## Setup
|
|
6
|
+
|
|
7
|
+
### 1. Install the Kit
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g cognitive-kit
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### 2. Configure MCP
|
|
14
|
+
|
|
15
|
+
Create or edit `.vscode/mcp.json` in your project:
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"servers": {
|
|
20
|
+
"cognitive-kit": {
|
|
21
|
+
"type": "stdio",
|
|
22
|
+
"command": "npx",
|
|
23
|
+
"args": ["cognitive-kit"],
|
|
24
|
+
"env": {
|
|
25
|
+
"KIT_HOST_ID": "vscode-${workspaceFolderBasename}",
|
|
26
|
+
"KIT_HOST_NAME": "${workspaceFolderBasename}"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### 3. Restart VS Code
|
|
34
|
+
|
|
35
|
+
The kit starts automatically. You can now use all 31 tools from the VS Code MCP interface.
|
|
36
|
+
|
|
37
|
+
## VS Code Extension
|
|
38
|
+
|
|
39
|
+
Alternatively, install the VS Code extension (if published):
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
code --install-extension cognitive-kit-vscode
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
The extension provides:
|
|
46
|
+
|
|
47
|
+
- **`Cognitive Kit: Analyze Selection`** — Runs reasoning on selected code/text
|
|
48
|
+
- **`Cognitive Kit: Reflect on Workspace`** — Meta-reflection on project state
|
|
49
|
+
- **`Cognitive Kit: Show Status`** — Guardian metrics and tool counts
|
|
50
|
+
|
|
51
|
+
## Example Workflows
|
|
52
|
+
|
|
53
|
+
### Code Review
|
|
54
|
+
|
|
55
|
+
1. Select a block of code
|
|
56
|
+
2. Run `Cognitive Kit: Analyze Selection`
|
|
57
|
+
3. The kit applies `cognitive_reason` for logical analysis
|
|
58
|
+
4. Results appear in a new editor panel
|
|
59
|
+
|
|
60
|
+
### Security Audit
|
|
61
|
+
|
|
62
|
+
Via MCP, call:
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
security_gate(payload: "the code to inspect")
|
|
66
|
+
ethics_audit(subject: "implementation decision")
|
|
67
|
+
threat_mapper(systemDescription: "architecture overview")
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Project Planning
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
agency_execute(objective: "Design authentication module", mode: "adaptive")
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Requirements
|
|
77
|
+
|
|
78
|
+
- VS Code ≥ 1.96
|
|
79
|
+
- Node.js ≥ 20
|
|
80
|
+
- Internet for first `npx` run
|
package/mcp.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"servers": {
|
|
3
|
+
"cognitive-kit": {
|
|
4
|
+
"name": "Cognitive Kit",
|
|
5
|
+
"description": "Pluggable cognitive layer — 31+ MCP tools for reasoning, research, planning, creativity, security, knowledge, analysis, agency orchestration, and adaptive pipelines",
|
|
6
|
+
"type": "stdio",
|
|
7
|
+
"command": "npx",
|
|
8
|
+
"args": ["cognitive-kit"],
|
|
9
|
+
"env": {
|
|
10
|
+
"KIT_HOST_ID": "${workspaceFolderBasename}",
|
|
11
|
+
"KIT_HOST_NAME": "${workspaceFolderBasename}",
|
|
12
|
+
"KIT_SOVEREIGN_KEY": ""
|
|
13
|
+
},
|
|
14
|
+
"icon": "🧠",
|
|
15
|
+
"tools": [
|
|
16
|
+
"cognitive_reason",
|
|
17
|
+
"cognitive_research",
|
|
18
|
+
"cognitive_plan",
|
|
19
|
+
"cognitive_create",
|
|
20
|
+
"cognitive_reflect",
|
|
21
|
+
"security_gate",
|
|
22
|
+
"ethics_audit",
|
|
23
|
+
"integrity_ledger",
|
|
24
|
+
"threat_mapper",
|
|
25
|
+
"red_team",
|
|
26
|
+
"blast_radius",
|
|
27
|
+
"guardian_status",
|
|
28
|
+
"guardian_freeze",
|
|
29
|
+
"guardian_unfreeze",
|
|
30
|
+
"memory_vam",
|
|
31
|
+
"knowledge_evolve",
|
|
32
|
+
"context_synth",
|
|
33
|
+
"code_archaeologist",
|
|
34
|
+
"sentiment_adapter",
|
|
35
|
+
"consensus_engine",
|
|
36
|
+
"execution_flow",
|
|
37
|
+
"swarm_orchestrator",
|
|
38
|
+
"meta_orchestrator",
|
|
39
|
+
"subagent_protocol",
|
|
40
|
+
"agency_execute",
|
|
41
|
+
"skill_forge",
|
|
42
|
+
"skill_list_forged",
|
|
43
|
+
"federation_status",
|
|
44
|
+
"federation_connect",
|
|
45
|
+
"federation_execute",
|
|
46
|
+
"federation_disconnect"
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cognitive-kit",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.4",
|
|
4
4
|
"description": "Pluggable cognitive layer — port of GCS v15.3 as an embeddable MCP cognitive kit. Provides reasoning, research, planning, creativity, reflection, security, knowledge, analysis, agency orchestration, and adaptive pipelines via MCP protocol.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -19,11 +19,14 @@
|
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
"bin": {
|
|
22
|
-
"cognitive-kit": "./
|
|
22
|
+
"cognitive-kit": "./cli.mjs"
|
|
23
23
|
},
|
|
24
24
|
"files": [
|
|
25
25
|
"dist",
|
|
26
26
|
"types",
|
|
27
|
+
"docs",
|
|
28
|
+
"cli.mjs",
|
|
29
|
+
"mcp.json",
|
|
27
30
|
"README.md",
|
|
28
31
|
"LICENSE"
|
|
29
32
|
],
|
|
@@ -33,7 +36,7 @@
|
|
|
33
36
|
"scripts": {
|
|
34
37
|
"build": "tsc -p tsconfig.json",
|
|
35
38
|
"dev": "tsc --watch -p tsconfig.json",
|
|
36
|
-
"test": "node
|
|
39
|
+
"test": "node tests/mcp-test-all.mjs && node tests/guardian-test.mjs && node tests/forge-test.mjs && node tests/federation-test.mjs",
|
|
37
40
|
"start": "node dist/cli.js",
|
|
38
41
|
"prepublishOnly": "npm run build"
|
|
39
42
|
},
|
|
@@ -42,13 +45,12 @@
|
|
|
42
45
|
},
|
|
43
46
|
"repository": {
|
|
44
47
|
"type": "git",
|
|
45
|
-
"url": "https://github.com/GaboBase/
|
|
46
|
-
"directory": "packages/cognitive-kit"
|
|
48
|
+
"url": "https://github.com/GaboBase/cognitive-kit.git"
|
|
47
49
|
},
|
|
48
50
|
"bugs": {
|
|
49
|
-
"url": "https://github.com/GaboBase/
|
|
51
|
+
"url": "https://github.com/GaboBase/cognitive-kit/issues"
|
|
50
52
|
},
|
|
51
|
-
"homepage": "https://github.com/GaboBase/
|
|
53
|
+
"homepage": "https://github.com/GaboBase/cognitive-kit",
|
|
52
54
|
"keywords": [
|
|
53
55
|
"mcp",
|
|
54
56
|
"model-context-protocol",
|
|
@@ -75,8 +77,12 @@
|
|
|
75
77
|
"dependencies": {
|
|
76
78
|
"sql.js": "^1.11.0"
|
|
77
79
|
},
|
|
80
|
+
"optionalDependencies": {
|
|
81
|
+
"pg": "^8.14.0"
|
|
82
|
+
},
|
|
78
83
|
"devDependencies": {
|
|
79
84
|
"@types/node": "^24.0.0",
|
|
85
|
+
"@types/pg": "^8.20.0",
|
|
80
86
|
"typescript": "^5.8.2"
|
|
81
87
|
}
|
|
82
88
|
}
|