@cortex-agent/server 2026.5.19-1 → 2026.5.19-3
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 +184 -0
- package/package.json +14 -4
package/README.md
ADDED
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
# Cortex — Autonomous Project Owner
|
|
2
|
+
|
|
3
|
+
[中文文档](./docs/zh/)
|
|
4
|
+
|
|
5
|
+
Cortex is an autonomous agent system for long-running projects. You give
|
|
6
|
+
it a mission with a success criterion, and it plans the work, dispatches
|
|
7
|
+
a pipeline of agents to execute it, keeps a structured log of progress
|
|
8
|
+
in your repo, and reviews itself before each commit — across days or
|
|
9
|
+
weeks of unattended work.
|
|
10
|
+
|
|
11
|
+
Cortex is designed around four failure modes of long agent runs.
|
|
12
|
+
**Context rot** — durable project state lives as plain files in your
|
|
13
|
+
repo, not chat history that accumulates and decays. **Execution drift**
|
|
14
|
+
— every task carries a verifiable success criterion, checked at
|
|
15
|
+
completion. **Context window limits** — work is partitioned across
|
|
16
|
+
agent pipelines, each with bounded scope and fresh context.
|
|
17
|
+
**Single-perspective bias** — adversarial review is a built-in pipeline
|
|
18
|
+
stage, not a polite suggestion.
|
|
19
|
+
|
|
20
|
+
## Features
|
|
21
|
+
|
|
22
|
+
- **Mission-driven task system** — hand off a goal; Cortex decomposes
|
|
23
|
+
it into tracked tasks with priorities, dependencies, and verifiable
|
|
24
|
+
done-conditions, works through them autonomously, and stops to ask
|
|
25
|
+
only when blocked. You stop maintaining the todo list.
|
|
26
|
+
See [docs/tasks.md](./docs/tasks.md).
|
|
27
|
+
|
|
28
|
+
- **Multi-agent thread pipelines** — long jobs run as a relay of
|
|
29
|
+
focused agents instead of one overloaded session. Each step starts
|
|
30
|
+
with a clean context and a narrow scope, so the model never loses
|
|
31
|
+
the plot mid-task. Handoffs carry only what the next stage needs.
|
|
32
|
+
See [docs/threads.md](./docs/threads.md).
|
|
33
|
+
|
|
34
|
+
- **Structured project log** — every project keeps mission, roadmap,
|
|
35
|
+
status, experiments, knowledge, patterns, and decisions as plain
|
|
36
|
+
files in your repo. A fresh agent (or a fresh you, weeks later) can
|
|
37
|
+
pick up where the last one left off — no chat history to scroll, no
|
|
38
|
+
vector store to query.
|
|
39
|
+
See [docs/memory.md](./docs/memory.md).
|
|
40
|
+
|
|
41
|
+
- **Cron and interval scheduling** — schedule Cortex to scan a domain
|
|
42
|
+
every morning, ship a weekly digest, or sweep an inbox every few
|
|
43
|
+
minutes. Schedules persist across restarts and hot-reload without
|
|
44
|
+
downtime.
|
|
45
|
+
See [docs/scheduling.md](./docs/scheduling.md).
|
|
46
|
+
|
|
47
|
+
- **Self-evolving skills** — when Cortex catches itself doing the same
|
|
48
|
+
thing a third time, it drafts a new skill, you approve, and future
|
|
49
|
+
runs use it automatically. The longer Cortex runs, the more your
|
|
50
|
+
patterns become first-class behavior.
|
|
51
|
+
See [docs/skills-and-plugins.md](./docs/skills-and-plugins.md).
|
|
52
|
+
|
|
53
|
+
- **One agent across your machines** — your compute, documents, code,
|
|
54
|
+
and tools rarely live on one box. Connect any Mac, Windows, or Linux
|
|
55
|
+
machine as a remote host via `cortex-client`, and Cortex can read,
|
|
56
|
+
write, and execute across all of them from a single control plane.
|
|
57
|
+
See [docs/cross-machine.md](./docs/cross-machine.md).
|
|
58
|
+
|
|
59
|
+
- **Backend agnostic** — runs on Claude Code or PI today, with adapter
|
|
60
|
+
abstraction for additional coding agents. Use the LLM subscription
|
|
61
|
+
you already pay for — no extra API key, no second bill.
|
|
62
|
+
|
|
63
|
+
- **Slack and CLI native** — talk to Cortex from Slack on your phone
|
|
64
|
+
(interactive prompts, threads, file uploads) or from a terminal on
|
|
65
|
+
your laptop. Same agent, same project, same memory.
|
|
66
|
+
|
|
67
|
+
## Quickstart
|
|
68
|
+
|
|
69
|
+
Requirements: Node 20+ and an installed coding agent backend (Claude Code or PI).
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
# Install
|
|
73
|
+
npm install -g @cortex-agent/server
|
|
74
|
+
|
|
75
|
+
# Initialize (guided setup)
|
|
76
|
+
cortex init
|
|
77
|
+
|
|
78
|
+
# Start
|
|
79
|
+
cortex start
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Once running, message Cortex from Slack — it reads your project context,
|
|
83
|
+
plans the work, and dispatches agents automatically.
|
|
84
|
+
|
|
85
|
+
## How a project looks
|
|
86
|
+
|
|
87
|
+
Each project lives under `.cortex/context/projects/<name>/` with a
|
|
88
|
+
predictable layout:
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
projects/my-project/
|
|
92
|
+
├── mission.md # Goal and success criteria
|
|
93
|
+
├── roadmap.md # Milestones and timeline
|
|
94
|
+
├── STATUS.md # Current state (overwrite)
|
|
95
|
+
├── ISSUES.md # Open friction points (append)
|
|
96
|
+
├── TASKS.yaml # Machine-readable task queue
|
|
97
|
+
├── decisions/ # DR-NNNN.md design decisions (append)
|
|
98
|
+
├── experiments/ # EXP-NNN.md atomic experiment records
|
|
99
|
+
├── knowledge/ # K-NNN.md atomic knowledge entries
|
|
100
|
+
├── patterns/ # PAT-NNN.md cross-experiment patterns
|
|
101
|
+
└── tasks-archive.md # Completed tasks (auto-archived)
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
This is the project log. It survives sessions, restarts, and model
|
|
105
|
+
upgrades. A fresh agent can resume work from here without the previous
|
|
106
|
+
conversation.
|
|
107
|
+
|
|
108
|
+
## Safety boundaries
|
|
109
|
+
|
|
110
|
+
Cortex classifies operations by blast radius. The harness enforces this
|
|
111
|
+
at the tool-call layer.
|
|
112
|
+
|
|
113
|
+
| Class | Examples |
|
|
114
|
+
|-------------------|------------------------------------------------------------|
|
|
115
|
+
| Autonomous | read files, run small scripts, edit context files, web search, in-budget compute |
|
|
116
|
+
| Requires approval | modify CLAUDE.md rules, add new skills, change agent-server behavior, over-budget compute, delete data |
|
|
117
|
+
| Forbidden | system-level package install, system config changes, `rm -rf` |
|
|
118
|
+
|
|
119
|
+
The approval queue lives at `.cortex/context/PENDING_APPROVALS.md`.
|
|
120
|
+
Configure additional rules in `.claude/settings.json`.
|
|
121
|
+
|
|
122
|
+
## Configuration
|
|
123
|
+
|
|
124
|
+
All configuration lives under `$CORTEX_HOME/config/`. Only
|
|
125
|
+
`CORTEX_PLATFORM` and your platform credentials (Slack tokens) are
|
|
126
|
+
required. Run `cortex init` for guided setup. The full environment
|
|
127
|
+
variable reference, file layout, and precedence rules are in
|
|
128
|
+
[docs/configuration.md](./docs/configuration.md).
|
|
129
|
+
|
|
130
|
+
## Docs
|
|
131
|
+
|
|
132
|
+
| Doc | What it covers |
|
|
133
|
+
|---|---|
|
|
134
|
+
| [Quickstart](./docs/quickstart.md) | Install, init, and first Slack message in 5 minutes |
|
|
135
|
+
| [Slack Setup](./docs/slack-setup.md) | App creation, token collection, Socket Mode, scopes |
|
|
136
|
+
| [Configuration](./docs/configuration.md) | Full `.env` reference, `profiles.json`, file layout, hot-reload |
|
|
137
|
+
| [CLI Reference](./docs/cli-reference.md) | `cortex`, `cortex-task`, `cortex-run` — every subcommand and flag |
|
|
138
|
+
| [Backends](./docs/backends.md) | Claude Code vs PI vs Codex, feature matrix, fallback, cost reporting |
|
|
139
|
+
| [Architecture](./docs/architecture.md) | Server layers, WS protocol, event bus |
|
|
140
|
+
| [Threads](./docs/threads.md) | Multi-agent pipelines, templates, transitions, hooks |
|
|
141
|
+
| [Tasks](./docs/tasks.md) | TASKS.yaml format, lifecycle, dispatch, cortex-run watchdog |
|
|
142
|
+
| [Memory](./docs/memory.md) | EXP/K/PAT atomized knowledge, project log governance |
|
|
143
|
+
| [Skills & Plugins](./docs/skills-and-plugins.md) | Skill authoring, plugin layout, third-party plugins |
|
|
144
|
+
| [Scheduling](./docs/scheduling.md) | Interval/daily/weekly/once schedules, preCheck, fallback |
|
|
145
|
+
| [Safety & Approvals](./docs/safety-and-approvals.md) | Blast-radius classes, approval workflow, audit trail |
|
|
146
|
+
| [Hooks](./docs/hooks.md) | Hook lifecycle, hook-bridge, custom hooks in settings.json |
|
|
147
|
+
| [MCP](./docs/mcp.md) | Cortex-core and cortex-ext MCP servers, third-party MCP |
|
|
148
|
+
| [Cross-machine](./docs/cross-machine.md) | cortex-client deployment, remote tools, network topology |
|
|
149
|
+
|
|
150
|
+
## Developing on Cortex
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
# Clone and install dependencies
|
|
154
|
+
git clone https://github.com/<your-org>/cortex
|
|
155
|
+
cd cortex/agent-server && npm install
|
|
156
|
+
|
|
157
|
+
# Build
|
|
158
|
+
npm run build
|
|
159
|
+
|
|
160
|
+
# Run tests
|
|
161
|
+
npm test
|
|
162
|
+
|
|
163
|
+
# Start in dev mode (hot-reload via .restart watcher)
|
|
164
|
+
npm run build && npm start
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### Architecture
|
|
168
|
+
|
|
169
|
+
Cortex has three main packages:
|
|
170
|
+
|
|
171
|
+
| Package | npm | Role |
|
|
172
|
+
|---------|-----|------|
|
|
173
|
+
| `@cortex-agent/server` | `agent-server/` | Control plane — Slack bot, task dispatch, scheduling, thread orchestration |
|
|
174
|
+
| `@cortex-agent/client` | `client/` | Remote worker — runs on remote machines, executes commands via WebSocket |
|
|
175
|
+
| Plugins | `plugins/` | Role-scoped skills loaded by thread agents at runtime |
|
|
176
|
+
|
|
177
|
+
The server is organized in six layers (`src/`): core utilities → persistence
|
|
178
|
+
→ event bus → domain logic → orchestration → entry points. Test coverage is
|
|
179
|
+
mandatory for all code changes. See [docs/architecture.md](./docs/architecture.md)
|
|
180
|
+
for the full architecture.
|
|
181
|
+
|
|
182
|
+
## License
|
|
183
|
+
|
|
184
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cortex-agent/server",
|
|
3
|
-
"version": "2026.5.19-
|
|
3
|
+
"version": "2026.5.19-3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Autonomous agent system for long-running projects — mission-driven, multi-agent pipelines, self-evolving skills.",
|
|
6
6
|
"engines": {
|
|
@@ -15,13 +15,14 @@
|
|
|
15
15
|
"files": [
|
|
16
16
|
"dist/",
|
|
17
17
|
"defaults/",
|
|
18
|
-
"scripts/postinstall-restart-trigger.mjs"
|
|
18
|
+
"scripts/postinstall-restart-trigger.mjs",
|
|
19
|
+
"README.md"
|
|
19
20
|
],
|
|
20
21
|
"publishConfig": {
|
|
21
22
|
"access": "public"
|
|
22
23
|
},
|
|
23
24
|
"scripts": {
|
|
24
|
-
"prepare": "npm run build",
|
|
25
|
+
"prepare": "cp ../README.md . && npm run build",
|
|
25
26
|
"postinstall": "node scripts/postinstall-restart-trigger.mjs",
|
|
26
27
|
"build": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json && node scripts/copy-assets.js",
|
|
27
28
|
"typecheck": "tsc --noEmit",
|
|
@@ -54,5 +55,14 @@
|
|
|
54
55
|
"tsx": "^4.21.0",
|
|
55
56
|
"typescript": "^5.9.3"
|
|
56
57
|
},
|
|
57
|
-
"repository": "https://github.com/fangxm233/cortex-agent"
|
|
58
|
+
"repository": "https://github.com/fangxm233/cortex-agent",
|
|
59
|
+
"keywords": [
|
|
60
|
+
"agent",
|
|
61
|
+
"ai-agent",
|
|
62
|
+
"autonomous-agent",
|
|
63
|
+
"multi-agent",
|
|
64
|
+
"self-evolving",
|
|
65
|
+
"scheduling",
|
|
66
|
+
"task-automation"
|
|
67
|
+
]
|
|
58
68
|
}
|