@cleocode/cleo-os 2026.4.18 → 2026.4.20

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.
@@ -0,0 +1,323 @@
1
+ /**
2
+ * CleoOS TUI design system theme — shared ANSI color constants.
3
+ *
4
+ * CANONICAL LOCATION: `packages/cleo-os/extensions/tui-theme.ts`
5
+ *
6
+ * Maps the design tokens from `docs/design/CLEO-PI-AGENT-TUI-DESIGN.md`
7
+ * and `docs/design/QUICK-REFERENCE.md` to ANSI 256-color escape sequences.
8
+ *
9
+ * All Pi extensions that render TUI elements MUST import from this module
10
+ * rather than defining ad-hoc ANSI codes inline. This ensures visual
11
+ * consistency across the CleoOS Hearth surface.
12
+ *
13
+ * ANSI 256-color mapping rationale:
14
+ * Terminal environments do not support arbitrary hex colors. The 256-color
15
+ * palette provides the closest available approximation. Each constant
16
+ * documents the target hex value from the design spec and the chosen
17
+ * ANSI 256-color code that best approximates it.
18
+ *
19
+ * @packageDocumentation
20
+ */
21
+
22
+ // ============================================================================
23
+ // ANSI primitives
24
+ // ============================================================================
25
+
26
+ /** ANSI escape code prefix. */
27
+ const ESC = "\x1b[";
28
+
29
+ /** ANSI reset sequence — clears all styling. */
30
+ export const RESET = `${ESC}0m`;
31
+
32
+ // ============================================================================
33
+ // Raw ANSI 256-color codes (design token → closest 256-color match)
34
+ // ============================================================================
35
+
36
+ /**
37
+ * Design token `bg-primary` (#0a0a0f) — main background.
38
+ * ANSI 256-color 232 (darkest gray, #080808).
39
+ */
40
+ export const CODE_BG_PRIMARY = 232;
41
+
42
+ /**
43
+ * Design token `bg-secondary` (#13131f) — panels, elevated surfaces.
44
+ * ANSI 256-color 233 (#121212).
45
+ */
46
+ export const CODE_BG_SECONDARY = 233;
47
+
48
+ /**
49
+ * Design token `bg-tertiary` (#1a1a2e) — inputs, cards, subtle highlights.
50
+ * ANSI 256-color 234 (#1c1c1c).
51
+ */
52
+ export const CODE_BG_TERTIARY = 234;
53
+
54
+ /**
55
+ * Design token `accent-primary` (#a855f7) — Pi AI purple accent.
56
+ * ANSI 256-color 135 (#af5fff).
57
+ */
58
+ export const CODE_ACCENT_PRIMARY = 135;
59
+
60
+ /**
61
+ * Design token `accent-secondary` (#ec4899) — pink accent.
62
+ * ANSI 256-color 205 (#ff5faf).
63
+ */
64
+ export const CODE_ACCENT_SECONDARY = 205;
65
+
66
+ /**
67
+ * Design token `accent-success` (#22c55e) — success / active states.
68
+ * ANSI 256-color 35 (#00af5f).
69
+ */
70
+ export const CODE_ACCENT_SUCCESS = 35;
71
+
72
+ /**
73
+ * Design token `accent-warning` (#f59e0b) — warning states.
74
+ * ANSI 256-color 214 (#ffaf00).
75
+ */
76
+ export const CODE_ACCENT_WARNING = 214;
77
+
78
+ /**
79
+ * Design token `accent-error` (#ef4444) — error states.
80
+ * ANSI 256-color 196 (#ff0000).
81
+ */
82
+ export const CODE_ACCENT_ERROR = 196;
83
+
84
+ /**
85
+ * Design token `text-primary` (#f8fafc) — primary headings text.
86
+ * ANSI 256-color 255 (#eeeeee).
87
+ */
88
+ export const CODE_TEXT_PRIMARY = 255;
89
+
90
+ /**
91
+ * Design token `text-secondary` (#94a3b8) — body / muted text.
92
+ * ANSI 256-color 245 (#8a8a8a).
93
+ */
94
+ export const CODE_TEXT_SECONDARY = 245;
95
+
96
+ /**
97
+ * Design token `text-tertiary` (#64748b) — disabled / very muted text.
98
+ * ANSI 256-color 243 (#767676).
99
+ */
100
+ export const CODE_TEXT_TERTIARY = 243;
101
+
102
+ /**
103
+ * Design token `border-subtle` (#2a2a3e) — dividers, borders.
104
+ * ANSI 256-color 236 (#303030).
105
+ */
106
+ export const CODE_BORDER_SUBTLE = 236;
107
+
108
+ /**
109
+ * Design token `border-focus` (#4a4a5e) — focus rings.
110
+ * ANSI 256-color 240 (#585858).
111
+ */
112
+ export const CODE_BORDER_FOCUS = 240;
113
+
114
+ /**
115
+ * Blue accent for worker tier badges (not in the design palette but used
116
+ * consistently in the Circle of Ten worker display).
117
+ * ANSI 256-color 75 (#5fafff).
118
+ */
119
+ export const CODE_TIER_WORKER = 75;
120
+
121
+ // ============================================================================
122
+ // Convenience styling functions
123
+ // ============================================================================
124
+
125
+ /**
126
+ * Wrap text in ANSI 256-color foreground.
127
+ *
128
+ * @param text - The text to colorize.
129
+ * @param code - ANSI 256-color code (0-255).
130
+ * @returns The text wrapped in ANSI color escape sequences.
131
+ */
132
+ export function fg256(text: string, code: number): string {
133
+ return `${ESC}38;5;${code}m${text}${RESET}`;
134
+ }
135
+
136
+ /**
137
+ * Apply `accent-primary` (purple, #a855f7) foreground to text.
138
+ *
139
+ * Used for: Pi AI branding, active tab indicators, focus borders,
140
+ * Circle of Ten header, banner chrome.
141
+ *
142
+ * @param text - The text to style.
143
+ * @returns Purple ANSI text.
144
+ */
145
+ export function accentPrimary(text: string): string {
146
+ return fg256(text, CODE_ACCENT_PRIMARY);
147
+ }
148
+
149
+ /**
150
+ * Apply `accent-secondary` (pink, #ec4899) foreground to text.
151
+ *
152
+ * Used for: secondary emphasis, user message borders, gradient endpoints.
153
+ *
154
+ * @param text - The text to style.
155
+ * @returns Pink ANSI text.
156
+ */
157
+ export function accentSecondary(text: string): string {
158
+ return fg256(text, CODE_ACCENT_SECONDARY);
159
+ }
160
+
161
+ /**
162
+ * Apply `accent-success` (green, #22c55e) foreground to text.
163
+ *
164
+ * Used for: active status dots, success badges, healthy system states,
165
+ * orchestrator tier prefix.
166
+ *
167
+ * @param text - The text to style.
168
+ * @returns Green ANSI text.
169
+ */
170
+ export function accentSuccess(text: string): string {
171
+ return fg256(text, CODE_ACCENT_SUCCESS);
172
+ }
173
+
174
+ /**
175
+ * Apply `accent-warning` (amber, #f59e0b) foreground to text.
176
+ *
177
+ * Used for: paused status, warning badges, lead tier prefix,
178
+ * modified file indicators.
179
+ *
180
+ * @param text - The text to style.
181
+ * @returns Amber/yellow ANSI text.
182
+ */
183
+ export function accentWarning(text: string): string {
184
+ return fg256(text, CODE_ACCENT_WARNING);
185
+ }
186
+
187
+ /**
188
+ * Apply `accent-error` (red, #ef4444) foreground to text.
189
+ *
190
+ * Used for: error status, failed states, deleted file indicators,
191
+ * validation failures.
192
+ *
193
+ * @param text - The text to style.
194
+ * @returns Red ANSI text.
195
+ */
196
+ export function accentError(text: string): string {
197
+ return fg256(text, CODE_ACCENT_ERROR);
198
+ }
199
+
200
+ /**
201
+ * Apply `text-secondary` (gray, #94a3b8) foreground to text.
202
+ *
203
+ * Used for: body text, timestamps, metadata, dim separators.
204
+ *
205
+ * @param text - The text to dim.
206
+ * @returns Dim gray ANSI text.
207
+ */
208
+ export function textSecondary(text: string): string {
209
+ return fg256(text, CODE_TEXT_SECONDARY);
210
+ }
211
+
212
+ /**
213
+ * Apply `text-tertiary` (dark gray, #64748b) foreground to text.
214
+ *
215
+ * Used for: disabled text, placeholders, line numbers.
216
+ *
217
+ * @param text - The text to style.
218
+ * @returns Dark gray ANSI text.
219
+ */
220
+ export function textTertiary(text: string): string {
221
+ return fg256(text, CODE_TEXT_TERTIARY);
222
+ }
223
+
224
+ /**
225
+ * Apply worker tier blue accent foreground to text.
226
+ *
227
+ * Used for: worker agent tier prefix `[W]` in the Circle of Ten display.
228
+ *
229
+ * @param text - The text to style.
230
+ * @returns Blue ANSI text.
231
+ */
232
+ export function tierWorker(text: string): string {
233
+ return fg256(text, CODE_TIER_WORKER);
234
+ }
235
+
236
+ /**
237
+ * Apply `border-subtle` (#2a2a3e) foreground to text.
238
+ *
239
+ * Used for: separator lines, box-drawing border characters.
240
+ *
241
+ * @param text - The text to style.
242
+ * @returns Subtle border-colored ANSI text.
243
+ */
244
+ export function borderSubtle(text: string): string {
245
+ return fg256(text, CODE_BORDER_SUBTLE);
246
+ }
247
+
248
+ /**
249
+ * Apply ANSI bold to text.
250
+ *
251
+ * Used for: headings, agent names, active labels, H2/H3 elements.
252
+ *
253
+ * @param text - The text to bold.
254
+ * @returns Bold ANSI text.
255
+ */
256
+ export function bold(text: string): string {
257
+ return `${ESC}1m${text}${RESET}`;
258
+ }
259
+
260
+ /**
261
+ * Apply ANSI italic to text.
262
+ *
263
+ * Used for: thought process text, AI reasoning display.
264
+ *
265
+ * @param text - The text to italicize.
266
+ * @returns Italic ANSI text.
267
+ */
268
+ export function italic(text: string): string {
269
+ return `${ESC}3m${text}${RESET}`;
270
+ }
271
+
272
+ // ============================================================================
273
+ // Box-drawing constants (Forge aesthetic)
274
+ // ============================================================================
275
+
276
+ /** Double-line horizontal bar character. */
277
+ export const BOX_HORIZONTAL = "\u2550";
278
+
279
+ /** Double-line vertical bar character. */
280
+ export const BOX_VERTICAL = "\u2551";
281
+
282
+ /** Double-line top-left corner. */
283
+ export const BOX_TOP_LEFT = "\u2554";
284
+
285
+ /** Double-line top-right corner. */
286
+ export const BOX_TOP_RIGHT = "\u2557";
287
+
288
+ /** Double-line bottom-left corner. */
289
+ export const BOX_BOTTOM_LEFT = "\u255A";
290
+
291
+ /** Double-line bottom-right corner. */
292
+ export const BOX_BOTTOM_RIGHT = "\u255D";
293
+
294
+ /** Double-line left T-junction. */
295
+ export const BOX_LEFT_T = "\u2560";
296
+
297
+ /** Double-line right T-junction. */
298
+ export const BOX_RIGHT_T = "\u2563";
299
+
300
+ /** Single-line horizontal bar character (for lighter separators). */
301
+ export const LINE_HORIZONTAL = "\u2500";
302
+
303
+ /** Single-line vertical bar character (for lighter separators). */
304
+ export const LINE_VERTICAL = "\u2502";
305
+
306
+ // ============================================================================
307
+ // Status indicator characters
308
+ // ============================================================================
309
+
310
+ /** Filled circle — active / online status. */
311
+ export const DOT_FILLED = "\u25CF";
312
+
313
+ /** Hollow circle — inactive / offline status. */
314
+ export const DOT_HOLLOW = "\u25CB";
315
+
316
+ /** Hammer and pick — CleoOS forge icon. */
317
+ export const ICON_FORGE = "\u2692";
318
+
319
+ /** Diamond — team indicator. */
320
+ export const ICON_DIAMOND = "\u25C6";
321
+
322
+ /** Triangle up — tier/priority indicator. */
323
+ export const ICON_TRIANGLE = "\u25B2";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cleocode/cleo-os",
3
- "version": "2026.4.18",
3
+ "version": "2026.4.20",
4
4
  "description": "CleoOS — the batteries-included agentic development environment wrapping Pi",
5
5
  "type": "module",
6
6
  "main": "./dist/cli.js",
@@ -9,8 +9,8 @@
9
9
  },
10
10
  "dependencies": {
11
11
  "@mariozechner/pi-coding-agent": ">=0.60.0",
12
- "@cleocode/cleo": "2026.4.18",
13
- "@cleocode/cant": "2026.4.18"
12
+ "@cleocode/cant": "2026.4.20",
13
+ "@cleocode/cleo": "2026.4.20"
14
14
  },
15
15
  "devDependencies": {
16
16
  "typescript": "^6.0.2",
@@ -31,7 +31,8 @@
31
31
  "files": [
32
32
  "dist",
33
33
  "extensions",
34
- "bin"
34
+ "bin",
35
+ "starter-bundle"
35
36
  ],
36
37
  "scripts": {
37
38
  "build": "tsc && tsc -p tsconfig.extensions.json || true && tsc -p tsconfig.postinstall.json",
@@ -0,0 +1,48 @@
1
+ # CleoOS Starter Bundle
2
+
3
+ Default CANT agent and team definitions deployed on `cleoos init`. These
4
+ files give every new CleoOS project a working multi-agent team topology out
5
+ of the box, so the CANT bridge has something to compile on first run.
6
+
7
+ ## Contents
8
+
9
+ | File | Kind | Purpose |
10
+ |------|------|---------|
11
+ | `team.cant` | `team` | Declares the **Starter Team** with one orchestrator, one lead, and two workers |
12
+ | `agents/cleo-orchestrator.cant` | `agent` | **Orchestrator** (tier: high) — coordinates the team, dispatches to dev-lead |
13
+ | `agents/dev-lead.cant` | `agent` | **Lead** (tier: mid) — decomposes tasks, dispatches to workers. No Edit/Write/Bash |
14
+ | `agents/code-worker.cant` | `agent` | **Worker** (tier: mid) — writes code, runs tests within declared file globs |
15
+ | `agents/docs-worker.cant` | `agent` | **Worker** (tier: mid) — writes documentation within declared doc globs |
16
+
17
+ ## Team Topology
18
+
19
+ ```
20
+ cleo-orchestrator (orchestrator, high)
21
+ dev-lead (lead, mid)
22
+ code-worker (worker, mid)
23
+ docs-worker (worker, mid)
24
+ ```
25
+
26
+ ## Customization
27
+
28
+ These files are copied into your project at `.cleo/cant/` during
29
+ initialization. Edit them freely to match your project structure:
30
+
31
+ - Add new workers for specialized domains (e.g., `test-worker.cant`)
32
+ - Adjust `permissions.files.write` globs to match your source layout
33
+ - Add `context_sources` queries relevant to your codebase
34
+ - Modify `skills` lists to load project-specific skills
35
+
36
+ ## CANT Syntax Reference
37
+
38
+ Every `.cant` file requires frontmatter:
39
+
40
+ ```cant
41
+ ---
42
+ kind: agent # or team, tool, mental-model
43
+ version: "1"
44
+ ---
45
+ ```
46
+
47
+ See `docs/plans/CLEO-ULTRAPLAN.md` sections 8-10 for the full grammar
48
+ specification, tier caps, and hierarchy rules.
@@ -0,0 +1,49 @@
1
+ ---
2
+ kind: agent
3
+ version: "1"
4
+ ---
5
+
6
+ # Starter Orchestrator — coordinates the starter team.
7
+ # Routes tasks to the dev-lead and synthesizes results for the user.
8
+
9
+ agent cleo-orchestrator:
10
+ role: orchestrator
11
+ tier: high
12
+ description: "Starter team orchestrator. Reads task context, classifies work, dispatches to the dev-lead, and synthesizes results. Does not execute code — coordinates."
13
+ consult-when: "Cross-team decisions, scope changes, human-in-the-loop escalation, or when the dev-lead reports a blocking ambiguity"
14
+
15
+ context_sources:
16
+ - source: decisions
17
+ query: "recent architectural and project decisions"
18
+ max_entries: 5
19
+ - source: patterns
20
+ query: "project conventions and established patterns"
21
+ max_entries: 3
22
+ on_overflow: escalate_tier
23
+
24
+ mental_model:
25
+ scope: project
26
+ max_tokens: 2000
27
+ on_load:
28
+ validate: true
29
+
30
+ permissions:
31
+ tasks: read, write
32
+ session: read, write
33
+ memory: read, write
34
+
35
+ skills:
36
+ - ct-cleo
37
+ - ct-task-executor
38
+
39
+ tools:
40
+ core: [Read, Grep, Glob]
41
+ dispatch: [dispatch_worker, report_to_user]
42
+
43
+ on SessionStart:
44
+ session "Read active tasks and recent decisions to build situational awareness"
45
+ context: [active-tasks, memory-bridge, recent-decisions]
46
+
47
+ on TaskCompleted:
48
+ if **the completed task unblocks downstream work**:
49
+ session "Reassess task queue and dispatch next work to dev-lead"
@@ -0,0 +1,51 @@
1
+ ---
2
+ kind: agent
3
+ version: "1"
4
+ ---
5
+
6
+ # Code Worker — executes code changes within declared file globs.
7
+ # Receives assignments from dev-lead. Writes code, runs tests, formats.
8
+
9
+ agent code-worker:
10
+ role: worker
11
+ parent: dev-lead
12
+ tier: mid
13
+ description: "General-purpose code worker. Reads requirements from the dev-lead, writes code, runs tests, and validates changes. Operates within declared file permission globs."
14
+ consult-when: "Writing code, fixing bugs, running tests, formatting, or any file modification task"
15
+
16
+ context_sources:
17
+ - source: patterns
18
+ query: "coding conventions and testing patterns"
19
+ max_entries: 5
20
+ - source: learnings
21
+ query: "past implementation mistakes and fixes"
22
+ max_entries: 3
23
+ on_overflow: escalate_tier
24
+
25
+ mental_model:
26
+ scope: project
27
+ max_tokens: 1000
28
+ on_load:
29
+ validate: true
30
+
31
+ permissions:
32
+ files:
33
+ write: ["src/**", "packages/**", "lib/**", "test/**", "tests/**"]
34
+ read: ["**/*"]
35
+ delete: ["src/**", "packages/**", "lib/**", "test/**", "tests/**"]
36
+
37
+ skills:
38
+ - ct-cleo
39
+ - ct-dev-workflow
40
+ - ct-task-executor
41
+
42
+ tools:
43
+ core: [Read, Edit, Write, Bash, Glob, Grep]
44
+
45
+ on SessionStart:
46
+ session "Check assigned task and read relevant source files before starting work"
47
+ context: [active-tasks, memory-bridge]
48
+
49
+ on PostToolUse:
50
+ if tool.name == "Write" or tool.name == "Edit":
51
+ session "Verify the change compiles and passes lint before proceeding"
@@ -0,0 +1,54 @@
1
+ ---
2
+ kind: agent
3
+ version: "1"
4
+ ---
5
+
6
+ # Development Lead — decides HOW to build. Dispatches to workers.
7
+ # MUST NOT hold Edit/Write/Bash tools (TEAM-002 / ULTRAPLAN 10.3).
8
+
9
+ agent dev-lead:
10
+ role: lead
11
+ parent: cleo-orchestrator
12
+ tier: mid
13
+ description: "Development lead. Decomposes tasks into concrete implementation steps, reviews worker output, and decides technical approach. Dispatches to code-worker and docs-worker. Does not write code directly."
14
+ consult-when: "Implementation strategy, code architecture, refactoring direction, task decomposition, or when workers need clarification"
15
+ stages: [specification, implementation, validation]
16
+ workers:
17
+ - code-worker
18
+ - docs-worker
19
+
20
+ context_sources:
21
+ - source: patterns
22
+ query: "codebase conventions and architecture patterns"
23
+ max_entries: 5
24
+ - source: decisions
25
+ query: "technical decisions affecting implementation"
26
+ max_entries: 3
27
+ on_overflow: escalate_tier
28
+
29
+ mental_model:
30
+ scope: project
31
+ max_tokens: 1000
32
+ on_load:
33
+ validate: true
34
+
35
+ permissions:
36
+ files:
37
+ read: ["**/*"]
38
+
39
+ skills:
40
+ - ct-cleo
41
+ - ct-dev-workflow
42
+ - ct-task-executor
43
+
44
+ tools:
45
+ core: [Read, Grep, Glob]
46
+ dispatch: [dispatch_worker, report_to_orchestrator]
47
+
48
+ on SessionStart:
49
+ session "Review current task assignments and worker availability"
50
+ context: [active-tasks, memory-bridge]
51
+
52
+ on TaskCompleted:
53
+ if **the completed task introduced new code**:
54
+ session "Review worker output for quality and completeness before reporting to orchestrator"
@@ -0,0 +1,51 @@
1
+ ---
2
+ kind: agent
3
+ version: "1"
4
+ ---
5
+
6
+ # Docs Worker — writes and maintains documentation within declared globs.
7
+ # Receives assignments from dev-lead. Creates docs, updates READMEs, writes TSDoc.
8
+
9
+ agent docs-worker:
10
+ role: worker
11
+ parent: dev-lead
12
+ tier: mid
13
+ description: "Documentation worker. Writes READMEs, updates guides, adds TSDoc comments, and maintains project documentation. Operates within declared documentation file globs."
14
+ consult-when: "Writing documentation, updating READMEs, adding TSDoc comments, or improving existing docs"
15
+
16
+ context_sources:
17
+ - source: patterns
18
+ query: "documentation conventions and style patterns"
19
+ max_entries: 3
20
+ - source: decisions
21
+ query: "architectural decisions needing documentation"
22
+ max_entries: 3
23
+ on_overflow: escalate_tier
24
+
25
+ mental_model:
26
+ scope: project
27
+ max_tokens: 1000
28
+ on_load:
29
+ validate: true
30
+
31
+ permissions:
32
+ files:
33
+ write: ["docs/**", "**/*.md", "**/*.mdx"]
34
+ read: ["**/*"]
35
+ delete: ["docs/**"]
36
+
37
+ skills:
38
+ - ct-cleo
39
+ - ct-documentor
40
+ - ct-docs-write
41
+
42
+ tools:
43
+ core: [Read, Edit, Write, Bash, Glob, Grep]
44
+
45
+ on SessionStart:
46
+ session "Check assigned documentation task and review existing docs for context"
47
+ context: [active-tasks, memory-bridge]
48
+
49
+ on PostToolUse:
50
+ if tool.name == "Write" or tool.name == "Edit":
51
+ session "Verify markdown renders correctly and follows project style conventions"
@@ -0,0 +1,20 @@
1
+ ---
2
+ kind: team
3
+ version: "1"
4
+ ---
5
+
6
+ # Starter Team — default team topology for new CleoOS projects.
7
+ # Deployed by `cleoos init` or postinstall. Customize for your project.
8
+
9
+ team starter:
10
+ name: Starter Team
11
+ orchestrator: cleo-orchestrator
12
+ enforcement: strict
13
+ consult-when: "Cross-boundary decisions, human-in-the-loop governance, or when a task spans multiple stages"
14
+ stages: [research, specification, implementation, validation, testing]
15
+
16
+ leads:
17
+ development: dev-lead
18
+
19
+ workers:
20
+ development: [code-worker, docs-worker]