@cleocode/core 2026.3.54 → 2026.3.55

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cleocode/core",
3
- "version": "2026.3.54",
3
+ "version": "2026.3.55",
4
4
  "description": "CLEO core business logic kernel — tasks, sessions, memory, orchestration, lifecycle, with bundled SQLite store",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -36,10 +36,10 @@
36
36
  "write-file-atomic": "^6.0.0",
37
37
  "yaml": "^2.8.2",
38
38
  "zod": "^3.25.76",
39
- "@cleocode/adapters": "2026.3.54",
40
- "@cleocode/contracts": "2026.3.54",
41
- "@cleocode/skills": "2026.3.54",
42
- "@cleocode/agents": "2026.3.54"
39
+ "@cleocode/adapters": "2026.3.55",
40
+ "@cleocode/agents": "2026.3.55",
41
+ "@cleocode/contracts": "2026.3.55",
42
+ "@cleocode/skills": "2026.3.55"
43
43
  },
44
44
  "engines": {
45
45
  "node": ">=24.0.0"
@@ -50,18 +50,18 @@ describe('CLEO-INJECTION v2.1.0 minimal-only template', () => {
50
50
 
51
51
  it('includes Mandatory Efficiency Sequence', () => {
52
52
  expect(content).toContain('## Mandatory Efficiency Sequence');
53
- expect(content).toContain('query session status');
54
- expect(content).toContain('query admin dash');
55
- expect(content).toContain('query tasks current');
56
- expect(content).toContain('query tasks next');
57
- expect(content).toContain('query tasks show');
53
+ expect(content).toContain('cleo session status');
54
+ expect(content).toContain('cleo dash');
55
+ expect(content).toContain('cleo current');
56
+ expect(content).toContain('cleo next');
57
+ expect(content).toContain('cleo show');
58
58
  });
59
59
 
60
60
  it('includes Agent Work Loop', () => {
61
61
  expect(content).toContain('## Agent Work Loop');
62
- expect(content).toContain('tasks current');
63
- expect(content).toContain('tasks complete');
64
- expect(content).toContain('tasks next');
62
+ expect(content).toContain('cleo current');
63
+ expect(content).toContain('cleo complete');
64
+ expect(content).toContain('cleo next');
65
65
  });
66
66
 
67
67
  it('includes Context Ethics', () => {
@@ -173,9 +173,9 @@ describe('CLEO-INJECTION v2.1.0 minimal-only template', () => {
173
173
  });
174
174
 
175
175
  describe('Template size', () => {
176
- it('is under 120 lines', () => {
176
+ it('is under 160 lines', () => {
177
177
  const lines = content.split('\n').length;
178
- expect(lines).toBeLessThan(130);
178
+ expect(lines).toBeLessThan(160);
179
179
  });
180
180
 
181
181
  it('is at least 60 lines (not accidentally empty)', () => {
@@ -3,29 +3,53 @@
3
3
  Version: 2.1.0
4
4
  Status: ACTIVE
5
5
 
6
+ ## Runtime Environment
7
+
8
+ <!-- CleoOS injects CLEO_RUNTIME=cleoos when launching agents from a workspace -->
9
+ <!-- When this variable is absent, assume standalone CLI mode -->
10
+
11
+ **Mode**: `${CLEO_RUNTIME:-standalone}`
12
+
13
+ ### Channel Preference
14
+
15
+ | Runtime | Primary Channel | Fallback | Rationale |
16
+ |---------|----------------|----------|-----------|
17
+ | `standalone` | CLI (`cleo <command>`) | MCP (query/mutate) | CLI is cheaper (fewer tokens), more reliable, and baked into core |
18
+ | `cleoos` | Workspace-provided | CLI | CleoOS workspace manages channel routing via capability matrix |
19
+
20
+ When running in **standalone** mode (the default):
21
+ - Prefer CLI commands over MCP tool calls for all CLEO operations
22
+ - CLI commands are shorter, use fewer tokens, and bypass the MCP dispatch layer
23
+ - Use MCP only when the provider does not support shell execution
24
+
25
+ When running in **CleoOS** mode:
26
+ - Follow the workspace-provided channel routing preferences
27
+ - CleoOS manages the capability matrix and optimal channel selection
28
+ - This mode is a work-in-progress — fall back to CLI if unsure
29
+
6
30
  ## CLEO Identity
7
31
 
8
- You are a CLEO protocol agent. Use MCP-first operations:
9
- - `query` for reads
10
- - `mutate` for writes
32
+ You are a CLEO protocol agent. CLEO operations are available via CLI (primary) and MCP (fallback):
33
+ - CLI: `cleo <command> [args]` — preferred for token efficiency (flat commands, not domain-prefixed)
34
+ - MCP: `query`/`mutate` gateways with `{domain, operation, params}` — use when CLI is unavailable
11
35
 
12
36
  ## Mandatory Efficiency Sequence
13
37
 
14
38
  Run cheapest-first at session start:
15
- 1. `query session status` — resume existing? (~200 tokens)
16
- 2. `query admin dash` — project overview (~500 tokens)
17
- 3. `query tasks current` — active task? (~100 tokens)
18
- 4. `query tasks next` — what to work on (~300 tokens)
19
- 5. `query tasks show` — full details for chosen task (~400 tokens)
39
+ 1. `cleo session status` — resume existing? (~200 tokens)
40
+ 2. `cleo dash` — project overview (~500 tokens)
41
+ 3. `cleo current` — active task? (~100 tokens)
42
+ 4. `cleo next` — what to work on (~300 tokens)
43
+ 5. `cleo show {id}` — full details for chosen task (~400 tokens)
20
44
 
21
45
  ## Agent Work Loop
22
46
 
23
47
  Repeat until session ends:
24
- 1. `tasks current` or `tasks next` → pick task
25
- 2. `tasks show {id}` → read requirements
48
+ 1. `cleo current` or `cleo next` → pick task
49
+ 2. `cleo show {id}` → read requirements
26
50
  3. Do the work (code, test, document)
27
- 4. `tasks complete {id}` → mark done
28
- 5. `tasks next` → continue or end session
51
+ 4. `cleo complete {id}` → mark done
52
+ 5. `cleo next` → continue or end session
29
53
 
30
54
  ## Context Ethics
31
55
 
@@ -61,12 +85,12 @@ Agents MUST NOT provide hours/days/week estimates. Use `small`, `medium`, `large
61
85
 
62
86
  ## Session Quick Reference
63
87
 
64
- | Goal | Operation | Gateway |
65
- |------|-----------|---------|
66
- | Check active session | `session status` | query |
67
- | Resume context from last session | `session handoff.show` | query |
68
- | Start working | `session start` (scope required) | mutate |
69
- | Stop working | `session end` | mutate |
88
+ | Goal | CLI (Primary) | MCP (Fallback) |
89
+ |------|--------------|----------------|
90
+ | Check active session | `cleo session status` | `query session status` |
91
+ | Resume context | `cleo briefing` | `query session briefing.show` |
92
+ | Start working | `cleo session start --scope global` | `mutate session start {scope: "global"}` |
93
+ | Stop working | `cleo session end` | `mutate session end` |
70
94
 
71
95
  For advanced session ops (find, suspend, resume, debrief, decisions): see `.cleo/agent-outputs/T5124-session-decision-tree.md`
72
96
 
@@ -78,23 +102,23 @@ CLEO includes a native BRAIN memory system. Use the 3-layer retrieval pattern fo
78
102
 
79
103
  | Step | Operation | Gateway | ~Tokens | Purpose |
80
104
  |------|-----------|---------|---------|---------|
81
- | 1 | `memory brain.search` | query | 50/hit | Search index (IDs + titles) |
82
- | 2 | `memory brain.timeline` | query | 200-500 | Context around an anchor ID |
83
- | 3 | `memory brain.fetch` | query | 500/entry | Full details for filtered IDs |
84
- | Save | `memory brain.observe` | mutate | — | Save observation to brain.db |
105
+ | 1 | `memory find` | query | 50/hit | Search index (IDs + titles) |
106
+ | 2 | `memory timeline` | query | 200-500 | Context around an anchor ID |
107
+ | 3 | `memory fetch` | query | 500/entry | Full details for filtered IDs |
108
+ | Save | `memory observe` | mutate | — | Save observation to brain.db |
85
109
 
86
110
  **Workflow**: Search first (cheap) → filter interesting IDs → fetch only what you need.
87
111
 
88
- **Example**:
112
+ **Example** (CLI):
89
113
  ```
90
- query memory brain.search {query: "authentication"}
91
- query memory brain.fetch {ids: ["O-abc123"]}
92
- mutate memory brain.observe {text: "Found auth uses JWT", title: "Auth discovery"}
114
+ cleo memory find "authentication"
115
+ cleo memory fetch O-abc123
116
+ cleo observe "Found auth uses JWT" --title "Auth discovery"
93
117
  ```
94
118
 
95
119
  **Anti-patterns:**
96
120
  - Fetching all entries without searching first (expensive)
97
- - Skipping brain.search and going straight to brain.fetch
121
+ - Skipping memory find and going straight to memory fetch
98
122
 
99
123
  ## Memory Bridge
100
124